/* Caja de Cacharrería — estilos
   Estilo: teenage engineering (styles.refero.design), adaptado a una caja de mostrador.
   Lienzo gris niebla, tinta negra, bandas carbón, líneas de 1px, cero radio, sin sombras.
   El ámbar es la única señal: los dígitos de la báscula y lo que pide acción.
   Columna de 1200px; separaciones 15 / 22 / 33 / 66. */
:root {
  --ground: #f6f8f7;
  --surface: #ffffff;
  --raised: #f6f8f7;
  --active: #eceeed;
  --border: #e5e5e5;
  --rule: #e5e5e5;
  --strong: #000000;
  --control: #b2b2b2;
  --text: #000000;
  --muted: #5e5e5e;
  --faint: #6b6b6b;
  --carbon: #0f0e12;
  --on-carbon: #f6f8f7;
  --carbon-muted: #a3a3a8;
  --primary: #000000;
  --on-primary: #ffffff;
  --link: #0071bb;
  --signal: #f5b800;
  --signal-ink: #8a5a00;
  --data: #8a5a00;
  --positive: #1f6e3a;
  --negative: #c4242a;
  --pill-positive-bg: #e3f4e8; --pill-positive-ink: #0f3d1f;
  --pill-negative-bg: #fdeceb; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fff3cc;  --pill-warning-ink: #6b4400;
  --pill-neutral-bg: #eceeed;  --pill-neutral-ink: #333333;
  --display: #0f0e12; --display-edge: #0f0e12; --led: #f5b800; --led-dim: #a3a3a8;
  --paper: #ffffff; --paper-ink: #111111; --paper-line: #b2b2b2;
  --chart-1: #f0a800; --chart-muted: #c8c8c8; --grid: #e5e5e5; --axis-ink: #5e5e5e; --ink: #000000;

  --radius-card: 0px; --radius-control: 0px; --radius-chip: 0px;
  --gap: 22px; --pad: 22px;
  --control-height: 40px; --row-height: 44px;
  --font: "Inter", "Suisse Int'l", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --led-font: "Doto", ui-monospace, Menlo, Consolas, monospace;
  --fs-title: 40px; --fs-section: 19px; --fs-kpi: 32px; --fs-body: 15px; --fs-small: 13px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f0e12; --surface: #17161b; --raised: #1d1c22; --active: #26252c;
    --border: #2b2a31; --rule: #2b2a31; --strong: #f6f8f7; --control: #4a4950;
    --text: #f6f8f7; --muted: #a9a9ae; --faint: #9b9ba0;
    --carbon: #000000; --on-carbon: #f6f8f7; --carbon-muted: #9b9ba0;
    --primary: #f6f8f7; --on-primary: #0f0e12; --link: #5aaee8;
    --signal-ink: #f5b800; --data: #f5b800; --positive: #57c47e; --negative: #ff7a70;
    --pill-positive-bg: #14261b; --pill-positive-ink: #74d395;
    --pill-negative-bg: #2b1717; --pill-negative-ink: #ff948b;
    --pill-warning-bg: #2b2310; --pill-warning-ink: #f5c84a;
    --pill-neutral-bg: #26252c; --pill-neutral-ink: #d4d4d8;
    --display: #000000; --display-edge: #2b2a31;
    --paper: #f6f8f7; --chart-1: #f5b800; --chart-muted: #4a4950; --grid: #2b2a31; --axis-ink: #a9a9ae; --ink: #f6f8f7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0f0e12; --surface: #17161b; --raised: #1d1c22; --active: #26252c;
  --border: #2b2a31; --rule: #2b2a31; --strong: #f6f8f7; --control: #4a4950;
  --text: #f6f8f7; --muted: #a9a9ae; --faint: #9b9ba0;
  --carbon: #000000; --on-carbon: #f6f8f7; --carbon-muted: #9b9ba0;
  --primary: #f6f8f7; --on-primary: #0f0e12; --link: #5aaee8;
  --signal-ink: #f5b800; --data: #f5b800; --positive: #57c47e; --negative: #ff7a70;
  --pill-positive-bg: #14261b; --pill-positive-ink: #74d395;
  --pill-negative-bg: #2b1717; --pill-negative-ink: #ff948b;
  --pill-warning-bg: #2b2310; --pill-warning-ink: #f5c84a;
  --pill-neutral-bg: #26252c; --pill-neutral-ink: #d4d4d8;
  --display: #000000; --display-edge: #2b2a31;
  --paper: #f6f8f7; --chart-1: #f5b800; --chart-muted: #4a4950; --grid: #2b2a31; --axis-ink: #a9a9ae; --ink: #f6f8f7;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--font); font-size: var(--fs-body); font-weight: 400; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
.num, input.num, td.n, th.n { font-variant-numeric: tabular-nums; }
::selection { background: var(--signal); color: #000; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ground); }

.wrap { width: 100%; max-width: 1244px; margin: 0 auto; padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }

/* ---------- Barra superior (66px, línea fina abajo) ---------- */
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--ground); border-bottom: 1px solid var(--strong); }
.bar { display: flex; align-items: center; gap: 33px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; }
.mark { width: 22px; height: 22px; flex: none; color: var(--text); }
.brand .name { font-size: 22px; font-weight: 300; letter-spacing: -0.01em; text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
nav.tabs { display: flex; align-self: stretch; gap: 0; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { flex: none; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 400; font-size: 15px; text-transform: lowercase; padding: 0 12px; text-decoration: none; transition: color .15s; }
nav.tabs a::before { content: ""; width: 7px; height: 7px; border: 1px solid currentColor; flex: none; transition: background-color .15s, border-color .15s; }
nav.tabs a:hover { color: var(--text); }
nav.tabs a[aria-current="page"] { color: var(--text); }
nav.tabs a[aria-current="page"]::before { background: var(--signal); border-color: var(--text); }
nav.tabs a:focus-visible { outline-offset: -4px; }
.who-pill { display: flex; align-items: center; gap: 12px; flex: none; color: var(--muted); font-size: 13px; }
.who-pill b { color: var(--text); font-weight: 400; font-size: 15px; }

/* ---------- Columna y títulos ---------- */
main { padding-block: 44px 66px; flex: 1 0 auto; }
section.view { display: grid; gap: var(--gap); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap; padding-bottom: 15px; border-bottom: 1px solid var(--strong); margin-bottom: 11px; }
.title-row .ttl { font-size: var(--fs-title); line-height: 1.11; font-weight: 300; letter-spacing: -0.02em; }
.title-row .sub { color: var(--muted); font-size: 15px; font-weight: 300; margin-top: 8px; }
.title-row .sub b { color: var(--text); font-weight: 500; }
.cols { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) {
  .cols { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #v-comprar .cols > .panel:last-child { position: sticky; top: 88px; }
}
.stack { display: grid; gap: var(--gap); }

.panel { background: var(--surface); border: 1px solid var(--border); padding: var(--pad); display: grid; gap: 22px; min-width: 0; }
.panel h2 { font-size: var(--fs-section); font-weight: 300; line-height: 1.15; letter-spacing: -0.01em; }
.panel h3 { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 18px; text-transform: lowercase; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; line-height: 18px; }
.hint b { color: var(--text); font-weight: 500; }
.note { background: var(--pill-warning-bg); color: var(--pill-warning-ink); padding: 12px 15px; font-size: 14px; border-left: 3px solid var(--signal); }
.note a { color: inherit; font-weight: 500; text-decoration: underline; }
.err { color: var(--negative); font-size: 14px; }

/* ---------- Controles ---------- */
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 400; color: var(--muted); min-width: 0; text-transform: lowercase; }
input, select, textarea { font: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--control); border-radius: 0; height: var(--control-height); padding: 0 12px; width: 100%; min-width: 0; transition: border-color .15s; }
textarea { height: auto; padding: 10px 12px; }
input::placeholder { color: var(--faint); font-weight: 300; }
input:hover, select:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--text); box-shadow: inset 0 -2px 0 var(--signal); }
input.num { text-align: right; }
button, .btn { font: inherit; font-size: 14px; font-weight: 400; height: var(--control-height); padding: 0 18px; border-radius: 0; border: 1px solid var(--text); background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; transition: background-color .12s, color .12s, transform .12s var(--ease); }
button:hover, .btn:hover { background: var(--text); color: var(--ground); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 500; }
button.primary:hover, .btn.primary:hover { background: var(--primary); color: var(--signal); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 0 8px; }
button.ghost:hover { color: var(--text); background: transparent; text-decoration: underline; }
button.small, .btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
button.danger { color: var(--negative); border-color: var(--negative); }
button.danger:hover { background: var(--negative); color: #fff; }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
button:disabled:hover { background: transparent; color: var(--text); }
button.primary:disabled:hover { background: var(--primary); color: var(--on-primary); }
.row { display: flex; gap: 15px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 170px; }
.row > button, .row > .btn { flex: 0 0 auto; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #000; }

/* ---------- Tablero de precios: catálogo de productos ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.chip { height: auto; min-height: 118px; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); justify-items: start; justify-content: stretch; align-content: stretch; gap: 6px; padding: 12px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; white-space: normal; font-weight: 400; position: relative; transition: background-color .15s; }
.chip svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.chip span { font-size: 13px; line-height: 16px; color: var(--muted); align-self: end; text-transform: lowercase; }
.chip b { font-size: 22px; line-height: 1.1; font-weight: 300; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.chip small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.chip::after { content: ""; position: absolute; top: 12px; right: 12px; width: 7px; height: 7px; border: 1px solid var(--control); }
.chip:hover { background: var(--ground); color: var(--text); }
.chip[aria-pressed="true"]::after { background: var(--signal); border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--ground); }
.chip:active { transform: none; background: var(--active); }

/* ---------- Líneas de material ---------- */
.lines { display: grid; gap: 0; border-top: 1px solid var(--border); }
.line { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; grid-template-areas: "mat mat" "kg pr" "sub x" "hint hint"; padding: 15px 0; border-bottom: 1px solid var(--border); background: transparent; }
.l-mat { grid-area: mat; } .l-kg { grid-area: kg; } .l-pr { grid-area: pr; }
.l-sub { grid-area: sub; align-self: center; font-weight: 300; font-variant-numeric: tabular-nums; font-size: 22px; }
.l-x { grid-area: x; justify-self: end; }
.l-hint { grid-area: hint; font-size: 13px; color: var(--muted); }
.l-hint:empty { display: none; }
.l-hint b { color: var(--text); font-weight: 500; }
@media (min-width: 640px) {
  .line { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(110px, 1fr) auto; grid-template-areas: "mat kg pr sub x" "hint hint hint hint hint"; align-items: end; }
  .l-sub { text-align: right; padding-bottom: 6px; }
}

/* ---------- Banda carbón de la báscula ---------- */
.readout { background: var(--display); border: 1px solid var(--display-edge); color: var(--led); padding: 18px 22px; display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.ro-cell { display: grid; gap: 4px; min-width: 0; }
.ro-main { text-align: right; justify-items: end; margin-left: auto; }
.ro-lbl { font-size: 13px; color: var(--led-dim); font-family: var(--font); font-weight: 300; text-transform: lowercase; }
.ro-num { font-family: var(--led-font); font-weight: 800; font-size: 40px; line-height: 44px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ro-num.sm { font-size: 24px; line-height: 30px; }
.ro-num .u, .ro-unit { font-family: var(--font); font-size: 13px; font-weight: 300; color: var(--led-dim); margin-left: 6px; letter-spacing: 0; }
.ro-status { font-size: 13px; color: var(--led-dim); font-family: var(--font); }
.paybar { display: grid; gap: 0; position: sticky; bottom: 0; z-index: 3; background: var(--surface); margin: 0 calc(var(--pad) * -1) calc(var(--pad) * -1); padding: 0; }
.paybar .readout { border-left: 0; border-right: 0; border-bottom: 0; }
.paybar button.primary { height: 56px; font-size: 16px; width: 100%; border-left: 0; border-right: 0; }
@media (max-width: 700px) {
  .paybar { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .paybar .readout { padding: 10px 16px; gap: 10px; }
  .paybar button.primary { height: 50px; }
  .ro-num { font-size: 30px; line-height: 34px; }
  .ro-num.sm { font-size: 20px; line-height: 26px; }
}

/* ---------- Cifras en franja de celdas ---------- */
.strip { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); border: 1px solid var(--border); background: var(--surface); }
.strip .cell { padding: 15px 18px 18px; display: grid; gap: 6px; align-content: start; min-width: 0; border-left: 1px solid var(--border); }
.strip .cell:first-child { border-left: 0; }
.strip .k { font-size: 13px; color: var(--muted); text-transform: lowercase; }
.strip .v { font-size: var(--fs-kpi); line-height: 1.1; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip .v.money { font-weight: 400; }
.strip .s { font-size: 13px; color: var(--muted); }
.strip .lead { background: var(--carbon); color: var(--on-carbon); }
.strip .lead .k, .strip .lead .s { color: var(--carbon-muted); }
.strip .lead .v { font-size: 34px; color: var(--signal); }
.strip .lead .v.neg { color: #ff8a80; }
.strip .lead .v.pos { color: var(--signal); }
.strip .v.pos { color: var(--positive); } .strip .v.neg { color: var(--negative); }
.panel .strip .v { font-size: 26px; }
.panel .strip .cell { padding: 12px 15px 15px; }
@media (max-width: 700px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip .cell { border-left: 0; border-top: 1px solid var(--border); }
  .strip .cell:nth-child(-n+2) { border-top: 0; }
  .strip .cell:nth-child(even) { border-left: 1px solid var(--border); }
  .strip .cell:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .strip .v { font-size: 24px; }
  .strip .lead .v { font-size: 30px; }
}
.pos { color: var(--positive); } .neg { color: var(--negative); }

/* ---------- Tablas ---------- */
.tbl { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 0 12px; height: var(--row-height); border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; } th:last-child, td:last-child { padding-right: 0; }
th { height: 36px; font-size: 13px; font-weight: 400; color: var(--muted); border-bottom-color: var(--strong); text-transform: lowercase; }
td.n { font-weight: 300; }
td.n, th.n { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s; }
tbody tr:hover td { background: var(--ground); }
tr.dim td { color: var(--faint); }
tfoot td { font-weight: 500; border-top: 1px solid var(--strong); border-bottom: 0; }
td input { height: 34px; width: 110px; font-size: 15px; }
td input.wide { width: 190px; }
td select { height: 34px; width: auto; font-size: 15px; }
.empty { color: var(--muted); text-align: left; white-space: normal; height: auto; padding: 18px 0; }
td .hint { font-size: 12px; }
td:has(br) { height: auto; padding-block: 8px; line-height: 18px; }

/* ---------- Listas ---------- */
.list { display: grid; border-top: 1px solid var(--strong); }
.item { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 2px 15px; align-items: center; padding: 12px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; width: 100%; height: auto; border-radius: 0; font-weight: 400; white-space: normal; color: var(--text); }
button.item { cursor: pointer; transition: background-color .15s, padding .15s; }
button.item:hover { background: var(--ground); color: var(--text); padding-left: 6px; padding-right: 6px; }
button.item:active { transform: none; }
.item .t { white-space: nowrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; grid-row: 1 / 3; align-self: start; line-height: 20px; }
.item .who { font-weight: 400; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; min-width: 0; }
.item .what { grid-column: 2 / 3; font-size: 13px; color: var(--muted); line-height: 18px; }
.item .amt { font-weight: 300; font-size: 19px; font-variant-numeric: tabular-nums; grid-row: 1 / 3; grid-column: 3; text-align: right; }
.item.void .who, .item.void .amt { text-decoration: line-through; color: var(--faint); }
.item.fresh { animation: llega 1.2s var(--ease); }
@keyframes llega { from { background-color: var(--pill-warning-bg); } to { background-color: transparent; } }
.tag { flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 400; background: var(--pill-warning-bg); color: var(--pill-warning-ink); white-space: nowrap; text-transform: lowercase; }
.tag.bad { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.tag.neutral { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.role { font-size: 13px; color: var(--muted); text-transform: lowercase; }
.mini-row { display: flex; gap: 8px; align-items: center; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--text); }
.seg button { height: 34px; border: 0; border-left: 1px solid var(--text); background: transparent; color: var(--text); padding: 0 14px; font-size: 13px; text-transform: lowercase; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--ground); }

/* ---------- Gráfica ---------- */
.chart { min-height: 200px; }
.chart-cap { display: flex; gap: 15px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ---------- Pie carbón ---------- */
footer.foot { background: var(--carbon); color: var(--on-carbon); }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 15px 33px; flex-wrap: wrap; padding-block: 33px; font-size: 13px; font-weight: 300; }
footer.foot .wm { font-size: 22px; text-transform: lowercase; letter-spacing: -0.01em; }
footer.foot .meta { display: flex; gap: 8px 22px; flex-wrap: wrap; color: var(--carbon-muted); align-items: flex-end; }

/* ---------- Comprobante ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(15, 14, 18, .72); display: grid; place-items: start center; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 33px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 33px) max(16px, env(safe-area-inset-left, 0px)); animation: velo .2s ease both; }
@keyframes velo { from { opacity: 0; } }
.sheet { width: 100%; max-width: 420px; display: grid; gap: 15px; animation: imprime .55s var(--ease) both; transform-origin: 50% 0; }
@keyframes imprime { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.ticket { background: var(--paper); color: var(--paper-ink); font-size: 13px; line-height: 18px; padding: 24px 22px 28px; position: relative; font-variant-numeric: tabular-nums;
  -webkit-mask: radial-gradient(circle 6px at 50% 0, #0000 98%, #000) 50% 0/14px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) 50% 100%/14px 51% repeat-x; /* taste-skill-ignore: máscara del borde perforado del tiquete, no un relleno */
  mask: radial-gradient(circle 6px at 50% 0, #0000 98%, #000) 50% 0/14px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) 50% 100%/14px 51% repeat-x; /* taste-skill-ignore */ }
.ticket .c { text-align: center; }
.ticket .biz { font-weight: 300; font-size: 22px; line-height: 26px; letter-spacing: -0.01em; text-transform: lowercase; }
.ticket hr { border: 0; border-top: 1px dashed var(--paper-line); margin: 12px 0; }
.ticket .kv { display: flex; justify-content: space-between; gap: 12px; }
.ticket .kv span:first-child { color: #555; }
.ticket .kv span:last-child { text-align: right; }
.ticket table { font-size: 12.5px; }
.ticket th, .ticket td { padding: 3px 0 3px 8px; height: auto; border: 0; color: var(--paper-ink); white-space: normal; background: transparent !important; font-weight: 400; }
.ticket th:first-child, .ticket td:first-child { padding-left: 0; }
.ticket th { border-bottom: 1px solid #111; color: #555; font-size: 11.5px; }
.ticket .tot { display: flex; justify-content: space-between; font-weight: 500; font-size: 20px; line-height: 26px; margin-top: 6px; }
.ticket .sub { font-size: 12px; color: #555; margin-top: 6px; }
.ticket .sign { margin-top: 33px; border-top: 1px solid var(--paper-ink); padding-top: 4px; font-size: 12px; text-align: center; color: #555; }
.ticket .stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 3px solid #b42318; color: #b42318; font-weight: 700; font-size: 26px; padding: 2px 12px; letter-spacing: .08em; opacity: .85; }
.sheet .acts { display: flex; gap: 0; flex-wrap: wrap; border: 1px solid #f6f8f7; background: #0f0e12; }
.sheet .acts > * { flex: 1 1 120px; border: 0; border-left: 1px solid rgba(246,248,247,.25); color: #f6f8f7; background: transparent; height: 46px; }
.sheet .acts > *:first-child { border-left: 0; }
.sheet .acts .primary { background: var(--signal); color: #000; border-color: var(--signal); }
.sheet .acts .primary:hover { background: #ffcd2e; color: #000; }
.sheet .acts > *:hover { background: #f6f8f7; color: #000; }
.sheet .acts .danger { color: #ff8a80; }
.sheet .acts .danger:hover { background: #c4242a; color: #fff; }
textarea.copybox { font-size: 13px; min-height: 140px; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); background: var(--carbon); color: var(--on-carbon); padding: 12px 18px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); border-left: 3px solid var(--signal); animation: toast .22s var(--ease) both; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- Pantalla de entrada ---------- */
.rise { animation: rise .5s var(--ease) both; }
.rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; } .rise.d3 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.mark .drop { animation: cae .7s var(--ease) both; transform-origin: 50% 0; }
@keyframes cae { 0% { transform: translateY(-10px); opacity: 0; } 60% { transform: translateY(1.5px); opacity: 1; } 100% { transform: none; } }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .bar { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 12px; }
  .brand { flex: 1 1 auto; }
  .brand .name { max-width: 60vw; font-size: 20px; }
  .who-pill .role, .who-pill b { display: none; }
  nav.tabs { flex-basis: 100%; order: 3; height: 44px; margin-top: 6px; }
  nav.tabs a { padding: 0 10px; }
  nav.tabs a:first-child { padding-left: 0; }
  main { padding-block: 26px 44px; }
  :root { --pad: 16px; --gap: 16px; --fs-title: 30px; }
  .item { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .item .t { font-size: 12px; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chip { min-height: 104px; padding: 10px; }
  .chip svg { width: 26px; height: 26px; }
  .chip b { font-size: 18px; }
}

/* Franja de 5 cifras (Reportes) */
@media (max-width: 1100px) and (min-width: 701px) {
  .strip.five { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .strip.five .lead { grid-column: 1 / -1; border-bottom: 1px solid var(--border); }
  .strip.five .cell:nth-child(2) { border-left: 0; }
}
@media (max-width: 700px) {
  .strip.five .lead { grid-column: 1 / -1; }
  .strip.five .cell { border-left: 0; border-top: 1px solid var(--border); }
  .strip.five .cell.lead { border-top: 0; }
  .strip.five .cell:nth-child(odd):not(.lead) { border-left: 1px solid var(--border); }
  .strip.five .cell:last-child:nth-child(odd) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- Imprimir solo el comprobante ---------- */
@media print {
  @page { margin: 4mm; }
  :root { padding: 0 !important; }
  body { background: #fff !important; display: block; }
  body::before { display: none !important; }
  body > *:not(#modal) { display: none !important; }
  #modal { position: static !important; background: none !important; padding: 0 !important; display: block !important; overflow: visible !important; animation: none !important; }
  .sheet { max-width: none !important; display: block !important; animation: none !important; }
  .sheet .acts, #t-text { display: none !important; }
  .ticket { -webkit-mask: none !important; mask: none !important; background: #fff !important; color: #000 !important; padding: 0 !important; width: 72mm; font-size: 11px; }
  .ticket th, .ticket td { color: #000 !important; }
}

/* Cifras más compactas en tableta */
@media (max-width: 1100px) and (min-width: 701px) {
  .strip .v { font-size: 26px; }
  .strip .lead .v { font-size: 32px; }
  .strip .cell { padding: 14px 15px 16px; }
}

/* =====================================================================
   COLOR Y MOVIMIENTO — los colores de los aparatos de teenage engineering
   ===================================================================== */
:root {
  --orange: #ff5a1f;
  --c-papel: #ff6a13;     /* cartón, archivo, periódico */
  --c-plastico: #2f6ff3;  /* PET, soplado */
  --c-vidrio: #13a867;
  --c-cobre: #d9480f;     /* cobre, bronce */
  --c-alum: #00a3c4;      /* aluminio, lata */
  --c-hierro: #5b6472;    /* chatarra, inox */
  --c-otro: #f0338d;
  --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='1.5' cy='1.5' r='1' fill='%23000' fill-opacity='.09'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='1.5' cy='1.5' r='1' fill='%23fff' fill-opacity='.07'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] { --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='1.5' cy='1.5' r='1' fill='%23fff' fill-opacity='.07'/%3E%3C/svg%3E"); }
body { background-image: var(--dots); background-attachment: fixed; }

/* Menú: cada sección con su color de perilla */
nav.tabs a[data-tab="comprar"] { --c: var(--orange); }
nav.tabs a[data-tab="caja"] { --c: var(--signal); }
nav.tabs a[data-tab="inventario"] { --c: var(--c-vidrio); }
nav.tabs a[data-tab="vender"] { --c: var(--c-plastico); }
nav.tabs a[data-tab="precios"] { --c: var(--c-otro); }
nav.tabs a[data-tab="reportes"] { --c: var(--c-alum); }
nav.tabs a[data-tab="personal"] { --c: var(--c-hierro); }
nav.tabs a { position: relative; }
nav.tabs a::before { border-radius: 50%; width: 9px; height: 9px; border-color: var(--c); }
nav.tabs a:hover::before { background: var(--c); }
nav.tabs a[aria-current="page"]::before { background: var(--c); border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
nav.tabs a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
nav.tabs a[aria-current="page"]::after { transform: scaleX(1); }

/* Cinta LED de precios */
.ticker { background: var(--carbon); color: var(--on-carbon); height: 30px; overflow: hidden; border-top: 1px solid var(--strong); }
.ticker-track { display: flex; width: max-content; height: 100%; animation: cinta var(--dur, 40s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk-run { display: flex; align-items: center; }
.tk { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; font-size: 12px; color: var(--carbon-muted); white-space: nowrap; text-transform: lowercase; border-right: 1px solid #2b2a31; height: 30px; }
.tk i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tk b { font-family: var(--led-font); font-weight: 800; font-size: 15px; color: var(--led); letter-spacing: .03em; }
@keyframes cinta { to { transform: translateX(-50%); } }

/* Tablero: perillas de colores */
.chip .knob { width: 40px; height: 40px; border-radius: 50%; background: var(--c); display: grid; place-items: center; transition: transform .35s var(--ease); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.chip .knob svg { width: 24px; height: 24px; stroke: #fff; stroke-width: 1.6; }
.chip::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.chip:hover::before, .chip[aria-pressed="true"]::before { transform: scaleX(1); }
.chip:hover .knob { transform: rotate(-18deg) scale(1.06); }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.chip[aria-pressed="true"]::after { background: var(--c); border-color: var(--c); }
.chip b { transition: color .2s; }
.chip[aria-pressed="true"] b { color: var(--c); }
.chip.pop .knob { animation: perilla .5s var(--ease); }
@keyframes perilla { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(-120deg) scale(.88); } 100% { transform: rotate(-18deg) scale(1.06); } }

/* Botón principal naranja */
button.primary, .btn.primary { background: var(--orange); border-color: var(--orange); color: #000; }
button.primary:hover, .btn.primary:hover { background: #000; color: var(--orange); border-color: #000; }
button.primary:disabled, button.primary:disabled:hover { background: var(--active); color: var(--muted); border-color: var(--active); }
.paybar button.primary { font-weight: 600; letter-spacing: .01em; }

/* Medidor de nivel de la báscula */
.vu { display: flex; gap: 3px; width: 100%; height: 10px; flex-basis: 100%; }
.vu i { flex: 1; background: #2b2a31; transition: background-color .18s; }
.vu i.on:nth-child(-n+12) { background: #2ecc71; }
.vu i.on:nth-child(n+13) { background: var(--signal); }
.vu i.on:nth-child(n+17) { background: var(--orange); }
.vu i.on:nth-child(n+19) { background: #ff3b30; }
.vu.boot i { animation: barrido 1.6s ease both; }
@keyframes barrido { 0%, 10% { background: #2b2a31; } 40% { background: var(--signal); } 70%, 100% { background: #2b2a31; } }
.vu.boot i:nth-child(1) { animation-delay: .02s } .vu.boot i:nth-child(2) { animation-delay: .04s } .vu.boot i:nth-child(3) { animation-delay: .06s } .vu.boot i:nth-child(4) { animation-delay: .08s } .vu.boot i:nth-child(5) { animation-delay: .1s }
.vu.boot i:nth-child(6) { animation-delay: .12s } .vu.boot i:nth-child(7) { animation-delay: .14s } .vu.boot i:nth-child(8) { animation-delay: .16s } .vu.boot i:nth-child(9) { animation-delay: .18s } .vu.boot i:nth-child(10) { animation-delay: .2s }
.vu.boot i:nth-child(11) { animation-delay: .22s } .vu.boot i:nth-child(12) { animation-delay: .24s } .vu.boot i:nth-child(13) { animation-delay: .26s } .vu.boot i:nth-child(14) { animation-delay: .28s } .vu.boot i:nth-child(15) { animation-delay: .3s }
.vu.boot i:nth-child(16) { animation-delay: .32s } .vu.boot i:nth-child(17) { animation-delay: .34s } .vu.boot i:nth-child(18) { animation-delay: .36s } .vu.boot i:nth-child(19) { animation-delay: .38s } .vu.boot i:nth-child(20) { animation-delay: .4s }

/* Cifras: cada celda con su raya de color */
.strip .cell { position: relative; }
.strip .cell::before { content: ""; position: absolute; left: -1px; right: 0; top: -1px; height: 4px; background: var(--c, transparent); }
.strip .cell:nth-child(1) { --c: var(--orange); }
.strip .cell:nth-child(2) { --c: var(--c-plastico); }
.strip .cell:nth-child(3) { --c: var(--c-vidrio); }
.strip .cell:nth-child(4) { --c: var(--signal); }
.strip .cell:nth-child(5) { --c: var(--c-otro); }
.strip .lead { --c: var(--signal); }

/* Puntos y barras de color por material */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 10px; vertical-align: 0; }
th.share-h { width: 22%; }
td.share { width: 22%; padding-right: 22px; }
.sbar { display: block; height: 10px; width: var(--w); min-width: 2px; background: var(--c); transform-origin: left; animation: barra .8s var(--ease) both; }
@keyframes barra { from { transform: scaleX(0); } }
@media (max-width: 700px) { th.share-h, td.share { display: none; } }

/* Entrada de cada pantalla: los bloques suben uno tras otro */
.view.enter > *, .view.enter .cols > *, .view.enter .stack > * { animation: rise .55s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .06s; } .view.enter > *:nth-child(3) { animation-delay: .12s; }
.view.enter > *:nth-child(4) { animation-delay: .18s; } .view.enter > *:nth-child(5) { animation-delay: .24s; }
.view.enter > *:nth-child(n+6) { animation-delay: .3s; }
.view.enter .cols > *:nth-child(2) { animation-delay: .14s; }
.view.enter .title-row { animation: none; }
.view.enter .title-row .ttl { animation: titulo .6s var(--ease) both; }
@keyframes titulo { from { opacity: 0; transform: translateX(-16px); letter-spacing: .02em; } }
.view.enter .title-row::after { content: ""; display: block; flex-basis: 100%; }
.title-row { position: relative; }
.title-row::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 3px; width: 66px; background: var(--orange); transform-origin: left; }
#v-caja .title-row::before { background: var(--signal); }
#v-inventario .title-row::before { background: var(--c-vidrio); }
#v-vender .title-row::before { background: var(--c-plastico); }
#v-precios .title-row::before { background: var(--c-otro); }
#v-reportes .title-row::before { background: var(--c-alum); }
#v-personal .title-row::before { background: var(--c-hierro); }
.view.enter .title-row::before { animation: raya .7s var(--ease) both .1s; }
@keyframes raya { from { transform: scaleX(0); } }
.view.enter .board .chip { animation: rise .45s var(--ease) both; }
.view.enter .board .chip:nth-child(2) { animation-delay: .03s } .view.enter .board .chip:nth-child(3) { animation-delay: .06s } .view.enter .board .chip:nth-child(4) { animation-delay: .09s }
.view.enter .board .chip:nth-child(5) { animation-delay: .12s } .view.enter .board .chip:nth-child(6) { animation-delay: .15s } .view.enter .board .chip:nth-child(7) { animation-delay: .18s } .view.enter .board .chip:nth-child(8) { animation-delay: .21s }
.view.enter .board .chip:nth-child(n+9) { animation-delay: .24s }
.view.enter .list .item { animation: rise .4s var(--ease) both .2s; }

/* Pequeños gestos */
.panel { transition: border-color .2s; }
.panel:hover { border-color: #cfcfcf; }
.toast { border-left-color: var(--orange); }
.readout .ro-num { text-shadow: 0 0 14px rgba(245, 184, 0, .35); }
@media (max-width: 1360px) and (min-width: 761px) { .bar { gap: 20px; } nav.tabs a { padding: 0 8px; font-size: 14px; } .brand .name { font-size: 20px; } .who-pill .role { display: none; } }

/* La app aparece completa después de las persianas */
body.revelando main, body.revelando header.top, body.revelando footer.foot { animation: app-entra .8s var(--ease) both .25s; }
@keyframes app-entra { from { opacity: 0; transform: scale(.985) translateY(10px); } }

/* =====================================================================
   MODO TRABAJO: el color se queda, el movimiento se calma.
   Solo se mueve lo que da información (la báscula al pesar).
   ===================================================================== */
/* cambio de pantalla: un desvanecido corto, sin cascada */
.view.enter > *, .view.enter .cols > *, .view.enter .stack > *, .view.enter .board .chip, .view.enter .list .item { animation: none !important; }
.view.enter { animation: aparece .22s ease both; }
@keyframes aparece { from { opacity: 0; } }
.view.enter .title-row .ttl, .view.enter .title-row::before { animation: none !important; }
/* app tras entrar: sin escalado */
body.revelando main, body.revelando header.top, body.revelando footer.foot { animation: aparece .3s ease both; }
.mark .drop { animation: none; }
/* cinta de precios quieta: se lee, no se persigue */
.ticker-track { animation: none; }
.tk-run + .tk-run { display: none; }
.ticker { overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
/* tablero: sin giros ni rebotes */
.chip:hover .knob { transform: none; }
.chip.pop .knob { animation: none; }
.chip::before { transition: none; }
.sbar { animation: none; }
nav.tabs a::after { transition: none; }
/* menos brillo en los dígitos */
.readout .ro-num { text-shadow: none; }
.vu.boot i { animation: none; }
.item.fresh { animation: llega .8s ease; }


/* =====================================================================
   ESTADOS DEL MATERIAL: mojado, sucio, quemado… cada uno con su precio
   ===================================================================== */
.l-est { grid-area: est; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.l-est:empty { display: none; }
.est-lbl { font-size: 13px; color: var(--muted); margin-right: 4px; }
.est-opt { height: 40px; padding: 0 12px; gap: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; }
.est-opt span { text-transform: lowercase; }
.est-opt b { font-weight: 400; font-variant-numeric: tabular-nums; color: var(--muted); }
.est-opt:hover { border-color: var(--text); background: var(--surface); color: var(--text); }
.est-opt[aria-pressed="true"], .est-opt[aria-pressed="true"]:hover { background: var(--orange); border-color: var(--orange); color: #000; }
.est-opt[aria-pressed="true"] b { color: #000; }
.line.has-est { grid-template-areas: "mat mat" "est est" "kg pr" "sub x" "hint hint"; }
@media (min-width: 640px) {
  .line.has-est { grid-template-areas: "mat kg pr sub x" "est est est est est" "hint hint hint hint hint"; }
}
.chip .ch-est { display: block; font-style: normal; font-size: 12px; color: var(--muted); opacity: .85; text-transform: none; }

/* Precios: resumen de estados bajo el nombre y su editor */
.p-est { display: block; height: auto; min-height: 0; padding: 6px 0 0; border: 0; background: none; color: var(--muted); font-size: 13px; line-height: 18px; text-align: left; white-space: normal; }
.p-est b { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.p-est:hover { background: none; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.p-est[aria-expanded="true"] { color: var(--orange); }
tr.est-edit td { background: var(--surface); padding: 18px 15px 20px; }
.ee { display: grid; gap: 12px; max-width: 640px; }
.ee-t { font-size: 14px; color: var(--muted); max-width: 62ch; }
.ee-t b { color: var(--text); font-weight: 500; }
.ee-rows { display: grid; gap: 8px; }
.er { display: grid; grid-template-columns: minmax(0, 1fr) 128px auto; gap: 8px; align-items: center; }
.ee-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ee-acts .sp { flex: 1; }

/* =====================================================================
   ENTRADA: una lata girando bajo el foco del patio — Chatarrería La 58
   ===================================================================== */
.lock {
  --lk-night: #0d0c10; --lk-panel: #141317; --lk-line: #27262c; --lk-text: #f4f4f2; --lk-muted: #a09fa6;
  --ground: var(--lk-night); --surface: #1a191e; --text: var(--lk-text); --muted: var(--lk-muted); --faint: #8d8c93;
  --control: #46454c; --border: #2d2c33; --strong: var(--lk-text); --negative: #ff7a70;
  --stencil: "Big Shoulders Stencil Display", "Big Shoulders Stencil", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(380px, 1fr);
  background: var(--lk-night); color: var(--lk-text); color-scheme: dark;
}
.lock[hidden] { display: none !important; }
.lk-stage { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; isolation: isolate; }
.lk-beam { position: absolute; left: 50%; top: 0; width: 70%; height: 100%; transform: translateX(-50%); z-index: -2;
  background: linear-gradient(to bottom, rgba(255, 196, 150, .13), rgba(255, 120, 60, .05) 55%, transparent 80%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); }
.lk-glow { position: absolute; left: 50%; top: 54%; width: min(118vh, 120%); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 90, 31, .66), rgba(255, 90, 31, .30) 34%, rgba(255, 90, 31, .10) 58%, transparent 78%); }
.lk-giant { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: -1; margin: 0; white-space: nowrap; pointer-events: none; user-select: none;
  font-family: var(--stencil); font-weight: 800; text-transform: uppercase; font-size: clamp(150px, 27vw, 440px); line-height: .8; letter-spacing: -0.005em;
  color: rgba(255, 255, 255, .025); -webkit-text-stroke: 1.5px rgba(255, 255, 255, .16); }
#lk-can { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.lk-brand { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 26px); left: 32px; display: flex; align-items: center; gap: 12px; z-index: 1; }
.lk-brand .mark { width: 24px; height: 24px; color: var(--lk-text); flex: none; }
.lock .lk-name { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--lk-text); }
.lk-fact { position: absolute; left: 32px; bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); max-width: 34ch; margin: 0; z-index: 1; font-size: 14px; line-height: 1.45; font-weight: 300; color: var(--lk-muted); }

.lk-panel { display: grid; align-content: center; background: var(--lk-panel); border-left: 1px solid var(--lk-line);
  padding: calc(env(safe-area-inset-top, 0px) + 48px) max(clamp(28px, 4.5vw, 72px), env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 48px) clamp(28px, 4.5vw, 72px); }
.lk-form { width: 100%; max-width: 380px; display: grid; gap: 0; }
.lock h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 300; letter-spacing: -0.02em; }
.lk-sub { margin: 10px 0 0; font-size: 15px; line-height: 1.45; font-weight: 300; color: var(--lk-muted); max-width: 32ch; }
.lock form { display: grid; gap: 14px; margin-top: 32px; }
.lock form button.primary { height: 52px; margin-top: 6px; font-size: 15px; color: #000; }
.lock input { background: #1a191e; color: var(--lk-text); }
.lock input:hover { border-color: #8d8c93; }
.lock input:focus-visible { border-color: var(--lk-text); }
.lock input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #1a191e inset; -webkit-text-fill-color: var(--lk-text); }
.lock .fine { margin: 28px 0 0; font-size: 13px; line-height: 1.45; color: var(--lk-muted); max-width: 36ch; }
#lk-msg { margin-top: 18px; color: var(--lk-text); }
#lk-msg:empty { display: none; }
.lock.saludo form, .lock.saludo .fine { display: none; }

/* La entrada: el foco se enciende, el nombre aparece detrás y la lata cae girando (canvas). */
.lock.entra .lk-glow { animation: lk-foco 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.lock.entra .lk-beam { animation: lk-luz .9s ease both .1s; }
.lock.entra .lk-giant { animation: lk-giant 1.3s cubic-bezier(.2, .7, .2, 1) both .15s; }
.lock.entra .lk-form, .lock.entra .lk-brand, .lock.entra .lk-fact { animation: aparece .6s ease both .55s; }
@keyframes lk-foco { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.55); } 35% { opacity: .5; } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes lk-luz { 0% { opacity: 0; } 30% { opacity: 1; } 45% { opacity: .35; } 60%, 100% { opacity: 1; } }
@keyframes lk-giant { from { opacity: 0; letter-spacing: .14em; } to { opacity: 1; } }
/* Al entrar: el foco se aviva mientras la lata sale, y la pantalla se va. */
.lock.sale .lk-glow { animation: lk-aviva .7s ease forwards; }
.lock.sale { animation: aparece-fuera .4s ease forwards .32s; }
@keyframes lk-aviva { to { opacity: 1; transform: translate(-50%, -50%) scale(1.25); filter: brightness(1.3); } }
@keyframes aparece-fuera { to { opacity: 0; } }

@media (max-width: 900px) {
  .lock { display: block; }
  .lk-stage { min-height: 0; height: 48vh; height: 48svh; min-height: 320px; max-height: 480px; }
  .lk-giant { font-size: clamp(120px, 40vw, 260px); }
  .lk-glow { width: min(92vh, 150%); }
  .lk-brand { left: 20px; top: calc(env(safe-area-inset-top, 0px) + 18px); }
  .lk-fact { display: none; }
  .lk-panel { border-left: 0; border-top: 1px solid var(--lk-line); align-content: start; min-height: 52vh; min-height: 52svh;
    padding: 30px max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 36px) max(20px, env(safe-area-inset-left, 0px)); }
  .lk-form { max-width: 520px; margin: 0 auto; }
  .lock h1 { font-size: 28px; }
  .lock form { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { .lock.entra *, .lock.sale, .lock.sale * { animation: none !important; } }
.er input { width: 100%; min-width: 0; max-width: none; }
@media (max-width: 520px) { .er { grid-template-columns: minmax(0, 1fr) 96px auto; } }
