/* Estudio · El huevo de Colón — the egg-packing centre.
   Moulded-pulp ground, label-paper panels ruled in ink, egg-stamp marks for the networks,
   and one reserved ink (orange) for «lo siguiente que toca». Light by use scene: a lit room or a phone in daylight. */

@font-face { font-family: Archivo; src: url("/ui/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: Doto; src: url("/ui/fonts/doto.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --pulp: #d1ccc2;
  --pulp-deep: #c1bbb0;
  --pulp-shade: #a9a296;
  --paper: #f4f0e8;
  --paper-2: #ebe5d9;
  --white: #fffdf8;
  --ink: #1d1a16;
  --ink-2: #4e473e;
  --ink-3: #6f665a;
  --rule: rgba(29, 26, 22, .2);
  --rule-strong: #1d1a16;
  --next: #ff8a3d;
  --ok: #2f6b4f;
  --err: #b3261e;
  --err-soft: #f6dcd6;

  --f-ui: Archivo, system-ui, sans-serif;
  --f-dot: Doto, ui-monospace, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --rail: 232px;
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--pulp); color: var(--ink); font: 400 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; caret-color: var(--ink); }
body {
  margin: 0; min-height: 100vh;
  /* the fibre of moulded pulp, barely there */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .18 0 0 0 0 .15 0 0 0 .17 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--next); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--pulp-shade) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--pulp-shade); border-radius: 10px; border: 2px solid var(--pulp); }
::-webkit-scrollbar-track { background: transparent; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, video { display: block; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 22px 14px 18px; background: var(--pulp-deep); border-right: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 20px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand b { display: block; font-weight: 800; font-stretch: 72%; font-size: 21px; line-height: 1; letter-spacing: .005em; }
.brand small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.rail a.nav {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px;
  text-decoration: none; font-weight: 600; color: var(--ink-2);
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.rail a.nav:hover { color: var(--ink); background: rgba(255, 253, 248, .35); }
.rail a.nav[aria-current="page"] { color: var(--ink); background: var(--paper); border-color: var(--rule-strong); }
.rail a.nav .count { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 99px; background: var(--next); color: var(--ink); font-size: 12px; font-weight: 800; text-align: center; }
.rail hr { border: 0; border-top: 1px solid var(--rule); margin: 12px 8px; }
.usage { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); display: grid; gap: 8px; }
.usage .u b { display: block; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.usage .bar { height: 4px; background: rgba(29, 26, 22, .12); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.usage .bar i { display: block; height: 100%; background: var(--ink-2); }

main { min-width: 0; padding: 28px var(--gutter) 64px; }
.tabbar { display: none; }

/* ------------------------------------------------------------------ type + controls */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 22px; }
h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; font-stretch: 70%; line-height: .98; letter-spacing: -0.005em; margin: 0; text-wrap: balance; }
h2 { font-size: 22px; font-weight: 800; font-stretch: 72%; line-height: 1.05; margin: 0 0 10px; text-wrap: balance; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.2; margin: 0; }
.lede { color: var(--ink-2); max-width: 64ch; margin: 8px 0 0; }
.hint { color: var(--ink-2); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 14px/1 var(--f-ui); color: var(--ink); text-decoration: none; white-space: nowrap;
  padding: 10px 14px; min-height: 40px; border-radius: 8px; border: 1px solid var(--rule-strong); background: var(--white);
  cursor: pointer; transition: background-color .18s var(--ease-out), transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ic { width: 16px; height: 16px; }
.btn.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.ink:hover { background: #3a342c; }
/* the reserved ink: only ever the next thing to do */
.btn.next { background: var(--next); border-color: #e2702a; color: var(--ink); }
.btn.next:hover { background: #ff9a55; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding-left: 8px; padding-right: 8px; }
.btn.quiet:hover { color: var(--ink); background: rgba(29, 26, 22, .06); }
.btn.danger { color: var(--err); border-color: currentColor; background: transparent; }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { min-height: 32px; padding: 7px 10px; font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

input, select, textarea {
  font: 400 15px/1.45 var(--f-ui); color: var(--ink); background: var(--white);
  border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: rgba(29, 26, 22, .45); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29, 26, 22, .14); }
textarea { resize: vertical; }
label.lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }

/* the inkjet dot-matrix of an egg stamp: display sizes only (it stops reading below ~22px) */
.dot { font-family: var(--f-dot); font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.lotnum { font-weight: 800; font-stretch: 75%; letter-spacing: .05em; font-variant-numeric: tabular-nums; }

/* a label panel: paper, ruled in ink */
.label { background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; }
.label > .sec { padding: 18px 22px; border-top: 1px solid var(--rule-strong); }
.label > .sec:first-child { border-top: 0; }

.progress { height: 6px; border-radius: 6px; background: rgba(29, 26, 22, .12); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: 6px; }

.err-box { background: var(--err-soft); border: 1px solid var(--err); color: #5c140f; border-radius: 6px; padding: 10px 12px; }
.warn-box { background: var(--white); border: 1px dashed var(--ink-2); border-radius: 6px; padding: 10px 12px; color: var(--ink-2); }

/* ------------------------------------------------------------------ the line: one ruled band, jobs divided by hairlines */
.line { display: flex; overflow-x: auto; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); margin: 0 0 22px; }
.line .calm { color: var(--ink-2); margin: 0; padding: 13px 0; }
.seg { flex: 1 1 320px; min-width: 300px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 13px 18px; border-left: 1px solid var(--rule); }
.seg:first-child { border-left: 0; padding-left: 0; }
.seg > * { min-width: 0; }
.seg .what { display: flex; align-items: baseline; gap: 10px; text-decoration: none; font-weight: 700; }
.seg .what .lotnum { font-size: 14px; color: var(--ink-2); flex: none; }
.seg .what b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg a.what:hover b { text-decoration: underline; text-underline-offset: 3px; }
.seg .state { grid-column: 1; font-size: 13px; color: var(--ink-2); }
.seg .state b { color: var(--ink); }
.seg .progress { grid-column: 1; }
.seg .act { grid-column: 2; grid-row: 1 / span 3; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--rule); margin: 0 0 24px; }
.tabs button {
  font: 700 15px/1 var(--f-ui); color: var(--ink-2); background: none; border: 0; padding: 0 0 12px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: baseline;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .n { font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ the tray */
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 30px 22px; }
.slot { display: grid; gap: 10px; align-content: start; text-decoration: none; min-width: 0; }
.well { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; padding: 6px; background: var(--pulp-deep); border: 1px solid var(--rule); }
.well img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.slot:hover .well img { transform: translateY(-3px); box-shadow: 0 10px 18px -6px rgba(29, 26, 22, .5); }
.well .tag { position: absolute; left: 14px; top: 14px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 3px 6px 2px; font-size: 13px; line-height: 1; }
.well .len { position: absolute; right: 14px; bottom: 14px; background: rgba(29, 26, 22, .78); color: var(--paper); border-radius: 4px; padding: 3px 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.well .empty { position: absolute; inset: 6px; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 16px; text-align: center; color: var(--ink-2); background: rgba(255, 253, 248, .32); }
.well .empty .big { font-size: 46px; line-height: 1; color: var(--ink); }
.well .empty .progress { width: 100%; }
.slot h3 { font-size: 17px; font-weight: 800; font-stretch: 78%; line-height: 1.1; text-wrap: balance; }
.slot .hook { font-size: 13px; color: var(--ink-2); margin: -4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot .phase { font-size: 13px; color: var(--ink-2); }
.slot .phase b { color: var(--ink); }
.slot .waiting { justify-self: start; font-size: 12px; font-weight: 800; background: var(--next); color: var(--ink); padding: 4px 8px; border-radius: 5px; }
.slot .failed { justify-self: start; font-size: 12px; font-weight: 800; color: var(--err); }

/* the egg stamp: inked = published, dashed = still missing */
.stamps { display: flex; gap: 6px; }
.stamp {
  --s: 26px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  border: 1.5px dashed var(--ink-3); color: var(--ink-3);
}
.stamp svg { width: 46%; height: 46%; }
.stamp.on { border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); transform: rotate(-8deg); }
.stamp.on:nth-child(2n) { transform: rotate(6deg); }
.stamp.big { --s: 40px; }
.stamp.inked { animation: inked .52s var(--ease-out) both; }
@keyframes inked {
  0% { transform: scale(1.9) rotate(-22deg); opacity: 0; filter: blur(3px); }
  55% { transform: scale(.9) rotate(-6deg); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) rotate(-8deg); }
}

.empty-tray { padding: 48px 0; max-width: 46ch; }
.empty-tray p { color: var(--ink-2); }

/* ------------------------------------------------------------------ reel screen */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-weight: 600; margin: 0 0 16px; }
.back:hover { color: var(--ink); }
.reel { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.player { position: sticky; top: 24px; display: grid; gap: 12px; }
.player .well { border-radius: 22px; padding: 7px; }
.player video, .player .well img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; background: var(--ink); }
.player .well .empty { inset: 7px; border-radius: 15px; }

.carton-head { display: grid; gap: 10px; }
.carton-head .hookline { font-size: 16px; max-width: 70ch; margin: 0; color: var(--ink-2); }
/* the label's ruled field table: hairlines only between cells (a wrapped row starts clean), top rule in ink */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); row-gap: 4px; margin: 6px 0 -4px -12px; padding-top: 1px; overflow: hidden;
  background: linear-gradient(var(--rule-strong), var(--rule-strong)) 12px 0 / calc(100% - 12px) 1px no-repeat; }
.fields div { padding: 10px 12px 2px; box-shadow: -1px 0 0 var(--rule); }
.fields dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.fields dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; text-wrap: balance; overflow-wrap: anywhere; }
.fields dd.dot { font-size: 26px; line-height: 1; font-weight: 800; }

.plates { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.plate { display: grid; gap: 7px; justify-items: center; padding: 2px 2px; border-left: 1px solid var(--rule); text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.plate:first-child { border-left: 0; }
.plate .mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--ink-3); }
.plate .mk svg { width: 13px; height: 13px; }
.plate.done { color: var(--ink); }
.plate.done .mk { border: 0; background: var(--ink); color: var(--paper); }
.plate.now { color: var(--ink); font-weight: 800; }
.plate.now .mk { border: 0; background: var(--next); color: var(--ink); }
.plate.run .mk svg { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.next h2 { display: flex; align-items: center; gap: 10px; }
.next h2 .pip { width: 12px; height: 12px; border-radius: 50%; background: var(--next); box-shadow: 0 0 0 3px rgba(255, 138, 61, .25); flex: none; }
.next h2 .pip.run { background: var(--ink); box-shadow: 0 0 0 3px rgba(29, 26, 22, .15); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(29, 26, 22, .06); } }
.next .work { display: grid; gap: 8px; margin: 4px 0 14px; }
.next .work .when { font-size: 13px; color: var(--ink-2); }
.next .work .when b { color: var(--ink); }
.next .work .doing { font-size: 14px; }
.next .grid2 { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px; margin: 12px 0; }

/* signs of life: a beating dot while signals arrive; orange when it needs the owner; red when it is blocked */
.health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-2); }
.health .beat { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); flex: none; animation: beat 1.4s ease-in-out infinite; }
.health.warn { color: var(--ink); font-weight: 600; }
.health.warn .beat { background: var(--next); animation: none; box-shadow: 0 0 0 3px rgba(255, 138, 61, .25); }
.health.stop { color: var(--err); font-weight: 600; }
.health.stop .beat { background: var(--err); animation: none; }
.health.drive { flex-wrap: wrap; }
.health.drive > span:not(.beat) { flex: 1 1 120px; min-width: 0; }
.health.drive > .ic { flex: none; }
.health.drive:not(.warn):not(.stop):has(.ic) { color: var(--ok); }
.health .btn { margin-left: auto; }
@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.55); opacity: .45; } }
.seg .health { grid-column: 1; }

/* network rows on the carton label */
.nets { display: grid; }
.net { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.net:first-child { border-top: 0; padding-top: 2px; }
.net .who b { display: block; font-weight: 700; }
.net .who span { font-size: 13px; color: var(--ink-2); }
.net .who .on { color: var(--ink); font-weight: 700; }
.net .who .off { color: var(--ink-2); }
.net .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.net details { grid-column: 2 / -1; }
.net summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.net summary::-webkit-details-marker { display: none; }
.net summary .ic { width: 14px; height: 14px; transition: transform .2s var(--ease-out); }
.net details[open] summary .ic { transform: rotate(90deg); }
.net .copy { display: grid; gap: 10px; margin-top: 10px; }
.net .copy .cnt { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.net .copy .cnt.over { color: var(--err); font-weight: 700; }
.net .copy ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.net .mark { grid-column: 2 / -1; display: flex; gap: 8px; }
.net .mark input { max-width: 420px; }

.files { display: flex; flex-wrap: wrap; gap: 8px; }

details.activity summary { cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: 14px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.activity summary::-webkit-details-marker { display: none; }
details.activity[open] summary .ic { transform: rotate(90deg); }
.log { margin-top: 10px; max-height: 260px; overflow: auto; font-size: 13px; color: var(--ink-2); display: grid; gap: 3px; }
.log div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
.log time { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.log .k-error { color: var(--err); }

/* ------------------------------------------------------------------ create */
.create { max-width: 760px; display: grid; gap: 18px; }
.create .topic { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; padding: 14px 16px; }
.create .foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ ideas */
.idea-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 760px; margin: 0 0 18px; }
.idea-search .span { grid-column: 1 / -1; }
.idea-search .span:empty { display: none; }
.pick { display: grid; gap: 6px; max-width: 420px; }
.ideas { display: grid; gap: 14px; }
.idea { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 18px 20px; }
.idea.used { opacity: .55; }
.caliber { display: grid; justify-items: center; gap: 2px; padding-top: 2px; }
.caliber .g { font-weight: 800; font-stretch: 70%; font-size: 30px; line-height: 1; }
.caliber .s { font-size: 26px; line-height: 1; }
.caliber small { font-size: 11px; color: var(--ink-2); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.idea h3 { font-size: 19px; font-weight: 800; font-stretch: 78%; }
.idea .season { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.idea .hook { font-size: 15px; margin: 8px 0 4px; }
.idea .why, .idea .share { font-size: 13px; color: var(--ink-2); margin: 2px 0; max-width: 72ch; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 10px; max-width: 620px; }
.bars span { font-size: 11px; color: var(--ink-2); display: grid; gap: 4px; }
.bars b { height: 4px; border-radius: 4px; background: rgba(29, 26, 22, .12); overflow: hidden; }
.bars i { display: block; height: 100%; background: var(--ink-2); }
.idea .links { font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.idea .links a { color: var(--ink); }

/* ------------------------------------------------------------------ panels: memoria, consumo, redes */
.panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 980px; }
.panel > * { min-width: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); border: 1px solid var(--rule-strong); }
table.t th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--rule-strong); }
table.t td { padding: 9px 12px; border-top: 1px solid var(--rule); vertical-align: top; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.day td { background: var(--paper-2); font-weight: 700; }
.tag { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--ink-3); color: var(--ink-2); }
.tag.ok { border-color: var(--ink); color: var(--ink); }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.meter { padding: 16px 18px; display: grid; gap: 8px; }
.meter .k { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.meter .v { font-size: 30px; font-weight: 800; font-stretch: 72%; line-height: 1; font-variant-numeric: tabular-nums; }
.meter .s { font-size: 12px; color: var(--ink-2); }
.conn { display: flex; gap: 12px; align-items: flex-start; }
.conn .led { width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--ink-3); margin-top: 4px; flex: none; }
.conn .led.on { border: 0; background: var(--ink); }
.accs { display: grid; }
.acc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.acc:first-child { border-top: 0; padding-top: 0; }
.acc .led { width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--ink-3); }
.acc .led.on { border: 0; background: var(--ink); }
.acc .who { display: grid; gap: 2px; justify-items: start; }
.acc .who b { font-weight: 700; overflow-wrap: anywhere; }
.acc .who span:not(.tag) { font-size: 13px; color: var(--ink-2); }
.acc .who .tag { margin-top: 4px; }
.acc .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.acc .wait { grid-column: 2 / -1; display: grid; gap: 8px; font-size: 14px; }
.acc .wait > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.acc .wait > span .ic { animation: spin 1.2s linear infinite; }
.acc .wait .row, .acc-add .row { display: flex; gap: 8px; }
.acc-add { display: grid; gap: 10px; }
.acc-add input[type="email"] { max-width: 420px; }
.auto { display: grid; gap: 10px; }
.auto-opts { display: grid; gap: 8px; padding-left: 26px; }
.auto-on { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; font-size: 14px; }
.auto-on .ic { width: 16px; height: 16px; }
.auto-on .btn { margin-left: auto; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.chk input { width: auto; accent-color: var(--ink); }
.usage .acct { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.usage .acct-pick { display: grid; gap: 5px; }
.usage .acct-pick span { font-size: 12px; color: var(--ink-2); }
.usage .acct-pick select { font-size: 13px; font-weight: 700; padding: 7px 8px; background: var(--paper); border-color: var(--rule-strong); }
.hint.pay { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.hint.pay .ic { width: 16px; height: 16px; }
.movil-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 22px; align-items: start; }
.checks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; }
.checks-list .led { width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--ink-3); margin-top: 3px; }
.checks-list .led.on { border: 0; background: var(--ink); }
.checks-list .btn { margin-left: 8px; }
.code-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.code-box b { font-size: 28px; line-height: 1; }
.qr { background: var(--white); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 8px; }
.qr svg { width: 100%; height: auto; display: block; }
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 72ch; }
.field { display: grid; gap: 6px; max-width: 520px; }
code { font: 600 13px/1.4 ui-monospace, Menlo, monospace; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
.more { display: grid; gap: 8px; max-width: 520px; }
.more a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; font-weight: 700; }
.more a .ic { width: 20px; height: 20px; }
.more a .chev { margin-left: auto; color: var(--ink-3); }
.frame { width: 100%; height: calc(100vh - 150px); border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--paper); }

/* ------------------------------------------------------------------ dialog + toast */
dialog#viewer { width: min(1180px, 94vw); height: min(92vh, 1000px); padding: 0; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--paper); color: var(--ink); }
dialog#viewer.media { width: auto; height: auto; max-height: 94vh; }
dialog#viewer::backdrop { background: rgba(29, 26, 22, .5); backdrop-filter: blur(3px); }
dialog#viewer[open] { display: flex; flex-direction: column; animation: rise .32s var(--ease-out); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--rule-strong); font-weight: 700; }
#viewer-body { flex: 1; min-height: 0; overflow: auto; }
#viewer-body iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--white); }
dialog#viewer.media #viewer-body { display: grid; place-items: center; padding: 14px; background: var(--ink); }
dialog#viewer.media img, dialog#viewer.media video { max-height: calc(94vh - 90px); width: auto; max-width: 100%; border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100vw - 32px));
  background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  box-shadow: 0 14px 30px -10px rgba(29, 26, 22, .6); animation: rise .3s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* a wait must still look alive: the spinner breathes instead of turning */
  .ic.spin { animation: breathe 1.8s ease-in-out infinite !important; }
}

/* ------------------------------------------------------------------ setup */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plates.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plates.steps .mk { font: 700 12px/1 var(--f-ui); }
.setup-card { margin: 0 0 18px; max-width: 760px; }
.setup-card h2 { margin: 0 0 6px; }
.setup-card .hint { margin: 0; max-width: 62ch; }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; display: contents; }
fieldset.bare:disabled .foot, fieldset.bare:disabled > * { opacity: .55; }
details.step > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 22px; cursor: pointer; list-style: none; }
details.step > summary::-webkit-details-marker { display: none; }
details.step > summary > .ic { transition: transform .2s var(--ease-out); color: var(--ink-2); }
details.step[open] > summary > .ic { transform: rotate(90deg); }
details.step > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.stepnum { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--ink-3); font: 700 13px/1 var(--f-ui); color: var(--ink-2); }
.stepnum.done { border: 0; background: var(--ink); color: var(--paper); }
details.step[open] .stepnum:not(.done) { border: 0; background: var(--next); color: var(--ink); }
.steptitle { display: grid; gap: 2px; }
.steptitle b { font-size: 17px; }
.steptitle small { color: var(--ink-2); font-size: 13px; }
details.step > .sec { display: grid; gap: 12px; }
details.step .hint { margin: 0; max-width: 68ch; }
.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice .opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--white); cursor: pointer; }
.choice .opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .opt input { margin-top: 3px; accent-color: var(--ink); }
.choice .opt b { display: block; }
.choice .opt small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; max-width: 60ch; }
.key-form .row { display: flex; gap: 8px; }
.key-form .row input { flex: 1; min-width: 0; }
.field-msg { margin: 6px 0 0; font-size: 13px; min-height: 1em; }
.field-msg.err { color: var(--err); font-weight: 600; }
.field-msg.warn { color: var(--ink); background: var(--paper-2); border: 1px dashed var(--ink-2); padding: 8px 10px; border-radius: 6px; }
.label .grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.label.ready { border-color: var(--ink); }
.label.ready h2 { margin: 0 0 6px; }
@media (max-width: 860px) {
  .label .grid2 { grid-template-columns: minmax(0, 1fr); }
  details.step > summary { padding: 14px 16px; }
}

/* ------------------------------------------------------------------ account data */
.danger-zone > summary { cursor: pointer; font-weight: 700; }
.danger-zone[open] > summary { margin-bottom: 10px; }
.danger-zone .hint { max-width: 66ch; }

/* ------------------------------------------------------------------ plans */
.plans { display: grid; gap: 0; margin: 0 0 10px; }
.planrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.planrow:first-child { border-top: 0; padding-top: 0; }
.planrow span { color: var(--ink-2); font-size: 14px; }
.planrow .price { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .planrow { grid-template-columns: minmax(0, 1fr) auto; } }

/* ------------------------------------------------------------------ notifications */
.push { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; font-size: 14px; }
.push > span { flex: 1 1 200px; }
.push.on .ic { color: var(--ok); }

/* ------------------------------------------------------------------ approval gate */
.voice-pick { display: flex; gap: 8px; }
.voice-pick select { flex: 1; min-width: 0; }
.linkish { background: none; border: 0; padding: 0; margin-top: 8px; font: inherit; font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.linkish .hint { text-decoration: none; }
.receipt { list-style: none; margin: 14px 0; padding: 12px 14px; display: grid; gap: 6px; border: 1px dashed var(--ink-2); border-radius: 6px; background: var(--white); font-size: 14px; }
.receipt li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
.receipt b { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding-top: 2px; }
@media (max-width: 860px) { .receipt li { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ------------------------------------------------------------------ waiting */
.ic.spin { animation: spin 1.1s linear infinite; }
@keyframes breathe { 50% { opacity: .3; } }
.busy { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--paper-2); border: 1px solid var(--rule); font-weight: 600; }
.busy .ic { flex: none; margin-top: 2px; }
.busy small { display: block; margin-top: 2px; font-weight: 400; color: var(--ink-2); }
button[aria-busy="true"] { cursor: progress; }

/* ------------------------------------------------------------------ phone */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  main { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--pulp-deep); border-top: 1px solid var(--rule); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 700; color: var(--ink-2); text-decoration: none; border-radius: 8px; position: relative; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); background: var(--paper); }
  .tabbar a .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 1px 5px; border-radius: 99px; background: var(--next); color: var(--ink); font-size: 11px; font-weight: 800; }
  .page-head { margin-bottom: 16px; }
  .page-head .btn.ink { display: none; }
  .tray { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .line { flex-direction: column; }
  .seg { min-width: 0; flex-basis: auto; border-left: 0; border-top: 1px solid var(--rule); padding: 12px 0; }
  .seg:first-child { border-top: 0; }
  .reel { grid-template-columns: minmax(0, 1fr); }
  .player { position: static; max-width: 220px; width: 100%; margin: 0 auto; }
  .plate { font-size: 10px; gap: 5px; line-height: 1.15; hyphens: auto; overflow-wrap: anywhere; }
  .net { grid-template-columns: auto minmax(0, 1fr); }
  .net .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .net details, .net .mark { grid-column: 1 / -1; }
  .next .grid2 { grid-template-columns: minmax(0, 1fr); }
  .idea { grid-template-columns: 64px minmax(0, 1fr); }
  .movil-grid { grid-template-columns: minmax(0, 1fr); }
  .acc { grid-template-columns: auto minmax(0, 1fr); }
  .acc .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .acc .wait { grid-column: 1 / -1; }
  .acc-add .row, .acc .wait .row { flex-direction: column; }
  .idea > .btns { grid-column: 1 / -1; }
  .bars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .idea-search { grid-template-columns: minmax(0, 1fr); }
  .label > .sec { padding: 16px; }
  .frame { height: calc(100vh - 190px); }
  table.t { font-size: 13px; }
  .tabs { gap: 18px; overflow-x: auto; }
}
