/* App del taller — Faruk Muebles Design.
   Dos caras: la tablet del taller (un paso por pantalla, fichas grandes con dibujo) y la app de Faruk
   (columna de celular con pestañas abajo). El cobre de la marca marca solo lo que se toca. */
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 600; font-display: swap; src: url("fonts/jost-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #ece8e2; --surface: #ffffff; --sunk: #f6f3ef; --ink: #1d1b18; --muted: #69635b; --line: #dcd5cb;
  --accent: #b9581a; --accent-ink: #ffffff; --accent-soft: #f6e3d4; --accent-line: #e2b08c;
  --ok: #2b6a48; --ok-soft: #dfeee5; --warn: #8a5800; --warn-soft: #fbecc9; --bad: #a1362a; --bad-soft: #f7dcd6;
  --band: #26221e; --band-ink: #f4efe8; --band-muted: #b9b0a5;
  --display: "Jost", "Futura", "Avenir Next", "Century Gothic", sans-serif;
  --body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-m: #eee8e0;
  --bg: #121110; --surface: #1c1a17; --sunk: #232019; --ink: #eee8e0; --muted: #a59d93; --line: #35302a;
  --accent: #ec8a48; --accent-ink: #1a120c; --accent-soft: #3a2719; --accent-line: #7a4a29;
  --ok: #93cfae; --ok-soft: #1c3126; --warn: #efc46c; --warn-soft: #372b13; --bad: #f0a092; --bad-soft: #3a211c;
  --band: #0b0a09; --band-ink: #eee8e0; --band-muted: #9b9389; color-scheme: dark } }
:root[data-theme="dark"] { --logo-m: #eee8e0;
  --bg: #121110; --surface: #1c1a17; --sunk: #232019; --ink: #eee8e0; --muted: #a59d93; --line: #35302a;
  --accent: #ec8a48; --accent-ink: #1a120c; --accent-soft: #3a2719; --accent-line: #7a4a29;
  --ok: #93cfae; --ok-soft: #1c3126; --warn: #efc46c; --warn-soft: #372b13; --bad: #f0a092; --bad-soft: #3a211c;
  --band: #0b0a09; --band-ink: #eee8e0; --band-muted: #9b9389; color-scheme: dark }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; text-wrap: balance; }
p { margin: 0; }
svg.i { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- pantallas de aviso ---------- */
.aviso-pantalla { min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); text-align: center; }
.aviso-pantalla .caja { max-width: 520px; display: grid; gap: 14px; justify-items: center; }
.aviso-pantalla h1 { font-size: 30px; }
.aviso-pantalla p { color: var(--muted); font-size: 18px; }
.logo-card { background: #fff; border-radius: 18px; padding: 12px 16px; border: 1px solid var(--line); display: inline-block; }
.logo-card img { display: block; width: min(240px, 66vw); height: auto; }
.pie-logo { display: grid; justify-items: center; gap: 8px; padding: 26px 0 8px; }
.pie-logo .logo-card img { width: 170px; }
/* Marca (círculo con la F): colores de la marca, el marrón se aclara sobre fondo oscuro */
:root { --logo-n: #e59946; --logo-m: #503528; }
.marca-box { display: inline-grid; flex: none; }
.marca-box svg { width: 100%; height: 100%; display: block; }
.marca .ln { fill: var(--logo-n); }
.marca .lns { fill: none; stroke: var(--logo-n); }
.marca .lms { fill: none; stroke: var(--logo-m); }
.o-marca { width: 40px; height: 40px; }
.t-marca { width: 40px; height: 40px; --logo-m: #f3eadf; }

/* ---------- tablet ---------- */
.tablet { min-height: 100dvh; background: var(--surface); display: flex; flex-direction: column; }
.tablet > .t-body { flex: 1 0 auto; }
.t-top { position: sticky; top: 0; z-index: 5; background: var(--band); color: var(--band-ink); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 10px max(18px, env(safe-area-inset-left, 0px)); }
.t-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-date { font-family: var(--display); font-size: 21px; line-height: 1.15; min-width: 0; }
.t-date small { display: block; font-family: var(--body); font-size: 13px; color: var(--band-muted); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #5d554c; display: block; }
.dots i.on { background: var(--accent); }
.dots i.past { background: var(--band-muted); }
.t-tools { display: flex; gap: 8px; align-items: center; }
.t-tool { background: transparent; border: 1px solid #4d463e; color: var(--band-ink); border-radius: 12px; padding: 8px 12px; display: inline-flex; gap: 8px; align-items: center; font-weight: 700; cursor: pointer; font-size: 15px; white-space: nowrap; }
.t-tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.t-tool svg { font-size: 20px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--band-muted); white-space: nowrap; }
.sync.warn { color: #f3c46c; }
.sync i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: block; }
.t-body { padding: 26px max(26px, env(safe-area-inset-right, 0px)) 18px max(26px, env(safe-area-inset-left, 0px)); display: grid; align-content: start; gap: 20px; min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto; }
.q { display: grid; gap: 6px; }
.q h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; }
.q p { font-size: 19px; color: var(--muted); }
.q .ctx { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--accent); font-size: 18px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.grid.big { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { position: relative; min-height: 150px; border: 2px solid var(--line); background: var(--sunk); border-radius: 20px; padding: 18px 14px; display: grid; justify-items: center; align-content: center; gap: 12px; text-align: center; cursor: pointer; transition: transform .08s ease, border-color .12s ease; color: var(--ink); }
.tile:active { transform: scale(.98); }
.tile .ic { font-size: 54px; color: var(--ink); display: grid; place-items: center; }
.tile b { font-size: 22px; line-height: 1.15; }
.tile small { font-size: 15px; color: var(--muted); line-height: 1.2; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/18px no-repeat; }
.tile .badge { position: absolute; top: 10px; left: 10px; right: 10px; }
.tile.listo { border-color: var(--ok); }
.tile.nota-tile { cursor: default; }
.avatar { width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 52px; font-weight: 600; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; font-size: 19px; box-shadow: none; }
.avatar.xs { width: 26px; height: 26px; font-size: 13px; box-shadow: none; }
.obra-num { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: .02em; padding: 4px 14px; border-radius: 12px; color: #fff; min-width: 64px; }
.tile.obra { min-height: 170px; }
.t-foot { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; gap: 12px; padding: 14px max(26px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(26px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.btn { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px 24px; font-size: 20px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; min-height: 64px; color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn svg { font-size: 26px; }
.link { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 17px; cursor: pointer; padding: 8px 0; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.mini-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.seg-dia { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; justify-self: start; }
.seg-dia button { border: 0; background: transparent; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 17px; color: var(--muted); cursor: pointer; }
.seg-dia button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
textarea.voz { width: 100%; min-height: 110px; border: 2px solid var(--line); border-radius: 16px; background: var(--sunk); padding: 14px; font-size: 20px; resize: vertical; }
.hint { font-size: 18px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint .mic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 20px; }

/* contadores de material */
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mat { border: 2px solid var(--line); background: var(--sunk); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: 64px 1fr; gap: 10px 14px; align-items: center; }
.mat.on { border-color: var(--accent); background: var(--accent-soft); }
.sw { width: 64px; height: 64px; border-radius: 12px; border: 1px solid rgba(0,0,0,.18); flex: none; }
.sw.sm { width: 34px; height: 34px; border-radius: 8px; }
.sw.xs { width: 22px; height: 22px; border-radius: 6px; }
.mat-name { min-width: 0; }
.mat-name b { display: block; font-size: 19px; line-height: 1.15; }
.mat-name small { color: var(--muted); font-size: 14px; }
.stepper { grid-column: 1 / -1; display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: center; }
.stepper button { height: 60px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 34px; font-weight: 700; line-height: 1; cursor: pointer; color: var(--ink); }
.stepper button.plus { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stepper output { text-align: center; font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; }
.stepper output small { font-family: var(--body); font-size: 15px; color: var(--muted); margin-left: 4px; }
.stepper.chico { grid-template-columns: 48px 1fr 48px; }
.stepper.chico button { height: 46px; font-size: 26px; border-radius: 12px; }
.stepper.chico output { font-size: 22px; }
.add-mat { border: 2px dashed var(--accent-line); background: transparent; border-radius: 18px; min-height: 150px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 19px; cursor: pointer; }
.add-mat svg { font-size: 40px; }

/* fotos */
.foto-box { display: grid; gap: 14px; justify-items: center; }
.foto-btn { width: min(100%, 520px); min-height: 200px; border: 2px dashed var(--accent-line); background: var(--accent-soft); border-radius: 22px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--accent); font-size: 24px; font-weight: 700; cursor: pointer; }
.foto-btn svg { font-size: 72px; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; width: 100%; }
.foto { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); aspect-ratio: 4 / 3; padding: 0; cursor: pointer; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .quitar { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 22px; cursor: pointer; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs button { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); padding: 0; cursor: pointer; background: var(--sunk); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* resumen y listo */
.sum { border: 2px solid var(--line); border-radius: 20px; padding: 18px; display: grid; gap: 14px; background: var(--sunk); }
.sum-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip.acc { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.sm { font-size: 12.5px; padding: 2px 8px; }
.done { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 40px 10px; }
.done .big-check { width: 132px; height: 132px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 76px; animation: pop .35s ease-out; }
.done h2 { font-size: 40px; }
.done p { font-size: 20px; color: var(--muted); max-width: 560px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- app de Faruk ---------- */
.dueno { min-height: 100dvh; display: block; max-width: 760px; margin: 0 auto; background: var(--surface); padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 761px) { .dueno { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.o-head { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.o-head .grow { flex: 1; min-width: 0; }
.o-head h2 { font-size: 26px; }
.o-head p { color: var(--muted); font-size: 14px; }
.o-body { padding: 14px max(14px, env(safe-area-inset-right, 0px)) 18px max(14px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; align-content: start; min-width: 0; }
.o-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--surface); padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); max-width: 760px; margin: 0 auto; }
.o-nav button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; border-radius: 12px; }
.o-nav button svg { font-size: 24px; }
.o-nav button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card.tap { cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.card h3 { font-size: 18px; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.sec-title { font-family: var(--display); font-size: 17px; font-weight: 500; display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; gap: 10px; }
.sec-title span { font-family: var(--body); font-size: 13px; color: var(--muted); }
.status-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.status-row .st { display: grid; justify-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.lines { display: grid; gap: 6px; }
.line { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; font-size: 14.5px; }
.line .q2 { font-variant-numeric: tabular-nums; font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.over i { background: var(--bad); }
.num-badge { font-family: var(--display); font-weight: 600; color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 15px; flex: none; }
.info { border-radius: 14px; padding: 12px 14px; background: var(--accent-soft); color: var(--ink); font-size: 14.5px; }
.info.plain { background: var(--sunk); }
.info.bad { background: var(--bad-soft); }
.info.warn { background: var(--warn-soft); }
.search { width: 100%; border: 1px solid var(--line); background: var(--sunk); border-radius: 12px; padding: 11px 12px; font: 16px var(--body); color: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: 14.5px; cursor: pointer; color: var(--muted); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chips.big button { font-size: 17px; padding: 10px 16px; }
.stock-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; color: var(--ink); }
.stock-row b { font-size: 15px; display: block; }
.stock-row .q2 { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.stock-row.bajo .q2 { color: var(--bad); }
.conteo-row { display: grid; grid-template-columns: 34px 1fr 170px; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.conteo-row.cambio { background: var(--accent-soft); }
.o-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 14px; font-weight: 700; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
.o-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.o-btn.bad { color: var(--bad); }
.o-btn[disabled] { opacity: .45; cursor: default; }
.o-btn svg { font-size: 18px; }
.o-btn.ico { padding: 10px; }
select.o-sel, input.o-in, textarea.o-in { border: 1px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 10px; padding: 10px 11px; font: 16px var(--body); max-width: 100%; width: 100%; }
textarea.o-in { min-height: 80px; resize: vertical; }
.f { display: grid; gap: 5px; font-weight: 600; font-size: 14px; color: var(--muted); }
.form { display: grid; gap: 12px; }
.form .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; }
.cerrado { opacity: .55; }

/* hoja que sube desde abajo */
.sheet-wrap { position: fixed; inset: 0; background: rgba(15, 12, 10, .45); display: grid; align-items: end; justify-items: center; z-index: 20; }
.sheet { width: min(100%, 980px); max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; align-content: start; overscroll-behavior: contain; }
.sheet.narrow { width: min(100%, 560px); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: -18px; background: var(--surface); padding: 6px 0; z-index: 2; }
.sheet-head h2 { font-size: 26px; }
.x { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; font-size: 22px; flex: none; color: var(--ink); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.swatch { position: relative; border: 2px solid var(--line); border-radius: 14px; background: var(--sunk); padding: 8px; display: grid; gap: 6px; text-align: left; cursor: pointer; color: var(--ink); }
.swatch[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.swatch .sw { width: 100%; height: 64px; }
.swatch span { font-size: 14px; font-weight: 600; line-height: 1.15; }
.swatch .cnt { position: absolute; top: 4px; right: 4px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; font-size: 15px; padding: 0 6px; }
.mail { white-space: pre-wrap; font: 15px/1.5 var(--body); background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 40; max-width: calc(100% - 32px); text-align: center; }
.tw { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.qr { background: #fff; padding: 14px; border-radius: 16px; justify-self: center; line-height: 0; }
.qr svg, .qr img { width: min(72vw, 300px); height: auto; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 50; display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 86dvh; border-radius: 10px; }
.lightbox .x { position: absolute; top: max(14px, env(safe-area-inset-top, 0px)); right: 14px; background: #fff; color: #111; }
.lightbox .acciones { position: absolute; bottom: max(14px, env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; }

@media (max-width: 640px) {
  .t-body { padding: 18px 14px 14px; }
  .t-foot { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .grid, .grid.big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 124px; padding: 14px 8px; }
  .tile .ic { font-size: 42px; }
  .tile b { font-size: 18px; }
  .avatar { width: 84px; height: 84px; font-size: 38px; }
  .btn { padding: 12px 16px; font-size: 18px; min-height: 56px; }
  .t-date { font-size: 16px; }
  .t-date small, .dots { display: none; }
  .t-tool { padding: 8px 10px; }
  .t-tool span { display: none; }
  .conteo-row { grid-template-columns: 34px 1fr 150px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.sync.claro { color: var(--muted); }
.sync.claro.warn { color: var(--warn); }
input[type="color"].o-in { height: 46px; padding: 4px; cursor: pointer; }
