/* Caja de herramientas de campo. Usa los colores del sistema (styles.css :root) con respaldo por si cambian. */

.tbx-home, .tbx-sheet {
  --tbx-gold: var(--oro, #FDB207);
  --tbx-gold-600: var(--oro-600, #E5A000);
  --tbx-gold-50: var(--oro-50, #FFF8E3);
  --tbx-gold-100: var(--oro-100, #FFEFC2);
  --tbx-gold-ink: var(--oro-texto, #8A5A00);
  --tbx-gold-soft: rgba(253, 178, 7, .16);
  --tbx-ink: var(--grafito, #0B0C0E);
  --tbx-ink-2: var(--grafito-800, #17191D);
  --tbx-paper: var(--papel, #FFFFFF);
  --tbx-bg: var(--fondo, #F6F6F3);
  --tbx-soft: var(--acero-50, #F3F4F6);
  --tbx-line: var(--acero-100, #E9ECF0);
  --tbx-line-2: var(--acero-200, #D5D9E0);
  --tbx-dim: var(--acero-300, #B4BAC4);
  --tbx-muted: var(--acero-500, #6B7280);
  --tbx-text-2: var(--acero-700, #3D434D);
  --tbx-ok: var(--ok, #15803D);
  --tbx-ok-50: var(--ok-50, #E3F5E9);
  --tbx-err: var(--error, #B91C1C);
  --tbx-r-lg: var(--radio-lg, 20px);
  --tbx-shadow-1: var(--sombra-1, 0 1px 2px rgba(11, 12, 14, .06), 0 1px 3px rgba(11, 12, 14, .05));
  --tbx-shadow-2: var(--sombra-2, 0 8px 24px rgba(11, 12, 14, .08), 0 2px 6px rgba(11, 12, 14, .05));
  --tbx-title: var(--titulo, 'Archivo', 'Inter', system-ui, sans-serif);
  --tbx-safe-b: var(--safe-b, env(safe-area-inset-bottom, 0px));
}

/* ───────── Inicio: cuadrícula de herramientas ───────── */
.tbx-home { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.tbx-home-tech { gap: 14px; }
.tbx-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--tbx-r-lg); color: #fff;
  background: var(--tbx-ink);
}
.tbx-hero h2 { color: #fff; font-size: 1.5rem; }
.tbx-hero p { color: var(--tbx-dim); font-size: 0.875rem; margin-top: 4px; }
.tbx-hero-k { font-size: 0.7188rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tbx-gold); margin-bottom: 4px; }
.tbx-hero-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none; background: rgba(253, 178, 7, .14); color: var(--tbx-gold); box-shadow: none; }
.tbx-hero-3d { flex: none; filter: none; }

.tbx-sections { display: grid; gap: 22px; }
.page.tbx-home .tbx-sections { max-width: 1120px; }
.tbx-sec { display: grid; gap: 10px; }
.tbx-sec-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 0 2px; }
.tbx-sec-h h3 { display: flex; align-items: center; gap: 8px; font-size: 1.1875rem; font-weight: 800; letter-spacing: -.01em; }
.tbx-sec-h h3::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: #FFE08A; }
.tbx-sec-h span { font-size: 0.8125rem; color: var(--tbx-muted); }
.tbx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .tbx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.tbx-tile {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-height: 160px; padding: 16px 16px 18px; text-align: left; font: inherit; color: var(--tbx-ink);
  background: #FFFFFF; border: 1px solid var(--tbx-line); border-radius: var(--tbx-r-lg); box-shadow: var(--tbx-shadow-1);
  cursor: pointer; transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s, border-color .16s; -webkit-tap-highlight-color: transparent;
  animation: tbx-rise .36s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 22ms);
}
@keyframes tbx-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.tbx-tile::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tbx-gold); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.tbx-tile:hover { box-shadow: var(--tbx-shadow-2); border-color: var(--tbx-line-2); transform: translateY(-2px); }
.tbx-tile:hover::after, .tbx-tile:focus-visible::after { transform: scaleX(1); }
.tbx-tile:active { transform: scale(.96); box-shadow: var(--tbx-shadow-1); transition-duration: .08s; }
.tbx-tile-ic { margin: -3px 0 10px -3px; flex: none; filter: drop-shadow(0 6px 10px rgba(11, 12, 14, .18)); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.tbx-tile:hover .tbx-tile-ic { transform: translateY(-1px) rotate(-3deg); }
.tbx-tile:active .tbx-tile-ic { transform: scale(.94); }
.tbx-tile-name { font-family: var(--tbx-title); font-weight: 800; font-size: 1.0625rem; line-height: 1.15; letter-spacing: -.01em; }
.tbx-tile-desc { font-size: 0.8125rem; color: var(--tbx-muted); line-height: 1.35; }
.tbx-tile-art { position: absolute; z-index: -1; right: -26px; top: -22px; color: var(--tbx-gold); opacity: .14; transform: rotate(-14deg); pointer-events: none; }
.tbx-tile-live, .tbx-tile-new { position: absolute; top: 14px; right: 12px; padding: 3px 9px; border-radius: 999px; background: var(--tbx-ok); color: #fff; font-size: 0.7188rem; font-weight: 700; }
.tbx-tile-new { background: var(--tbx-ink); color: var(--tbx-gold); letter-spacing: .02em; }

/* ───────── Hoja de pantalla completa ───────── */
.tbx-sheet {
  position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; background: var(--tbx-bg); color: var(--tbx-ink);
  animation: tbx-in .24s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain;
}
.tbx-sheet.is-instant { animation: none; }
@keyframes tbx-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes tbx-fade { from { opacity: 0; } }
@keyframes tbx-rot { to { transform: rotate(360deg); } }
.tbx-bar {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: var(--tbx-paper); border-bottom: 1px solid var(--tbx-line);
  box-shadow: 0 6px 18px -12px rgba(11, 12, 14, .25); position: relative; z-index: 2;
}
.tbx-back {
  flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 16px 0 10px; border-radius: 999px;
  border: 1.5px solid var(--tbx-line-2); background: var(--tbx-paper); color: var(--tbx-ink); font: inherit; font-weight: 700; font-size: 0.9375rem; cursor: pointer;
}
.tbx-back:hover { background: var(--tbx-soft); }
.tbx-bar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 1.1875rem; font-weight: 800; }
.tbx-bar-ic { flex: none; filter: drop-shadow(0 3px 6px rgba(11, 12, 14, .18)); animation: tbx-pop .35s cubic-bezier(.2, .8, .2, 1.2) both; }
@keyframes tbx-pop { from { opacity: 0; transform: scale(.7) rotate(-8deg); } }
.tbx-bar-actions { display: flex; gap: 2px; flex: none; }
.tbx-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(28px + var(--tbx-safe-b));
  display: grid; gap: 14px; align-content: start; grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content; /* sin esto, las tarjetas con overflow:hidden se aplastan cuando el contenido no cabe */
}
.tbx-b-narrow { grid-template-columns: minmax(0, 720px); justify-content: center; }
.tbx-b-center { align-content: center; align-content: safe center; justify-items: center; }
.tbx-b-fill { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.tbx-dark { background: var(--tbx-ink); color: #fff; }
.tbx-dark .tbx-bar { background: var(--tbx-ink); border-bottom-color: rgba(255, 255, 255, .08); }
.tbx-dark .tbx-back { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.tbx-dark .tbx-back:hover { background: rgba(255, 255, 255, .14); }
.tbx-dark .tbx-bar { box-shadow: none; }
.tbx-dark .tbx-help { color: var(--tbx-dim); }
.tbx-dark .tbx-ib { color: #fff; }
.tbx-dark .tbx-ib:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: #fff; }

/* ───────── Piezas comunes ───────── */
.tbx-ib { width: 48px; height: 48px; display: grid; place-items: center; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--tbx-text-2); cursor: pointer; padding: 0; }
.tbx-ib:hover:not(:disabled) { background: var(--tbx-soft); color: var(--tbx-ink); }
.tbx-ib:disabled { opacity: .32; cursor: default; }
.tbx-ib svg { width: 22px; height: 22px; }
.tbx-chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--tbx-line-2); background: var(--tbx-paper); color: var(--tbx-ink); font: inherit; font-weight: 600; font-size: 0.875rem;
  transition: background .15s, border-color .15s, transform .08s;
}
.tbx-chip-btn:active:not(:disabled) { transform: scale(.97); }
.tbx-chip-btn:disabled { opacity: .45; cursor: default; }
.tbx-chip-btn[aria-pressed="true"] { border-color: var(--tbx-gold); background: var(--tbx-gold-50); }
.tbx-chip-btn:hover { border-color: var(--tbx-gold); background: var(--tbx-gold-50); }
.tbx-seg { display: flex; gap: 4px; padding: 4px; background: var(--tbx-line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.tbx-seg::-webkit-scrollbar { display: none; }
.tbx-seg-b {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 600; font-size: 0.9063rem; color: var(--tbx-text-2); cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.tbx-seg-b[aria-selected="true"] { background: var(--tbx-paper); color: var(--tbx-ink); box-shadow: var(--tbx-shadow-1); }
.tbx-seg.is-wrap { flex-wrap: wrap; background: none; padding: 0; gap: 8px; overflow: visible; }
.tbx-seg.is-wrap .tbx-seg-b { flex: 1 1 auto; background: var(--tbx-paper); border: 1.5px solid var(--tbx-line-2); border-radius: 999px; }
.tbx-seg.is-wrap .tbx-seg-b[aria-selected="true"] { background: var(--tbx-ink); border-color: var(--tbx-ink); color: #fff; box-shadow: none; }
.tbx-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--tbx-line-2); background: var(--tbx-paper); color: var(--tbx-text-2); font: inherit; font-weight: 600; font-size: 0.875rem;
  transition: background .15s, border-color .15s, transform .08s;
}
.tbx-toggle:active:not(:disabled) { transform: scale(.97); }
.tbx-toggle:disabled { opacity: .45; cursor: default; }
.tbx-toggle[aria-pressed="true"] { border-color: var(--tbx-gold); background: var(--tbx-gold-50); color: var(--tbx-ink); }
.tbx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tbx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tbx-help { font-size: 0.8438rem; color: var(--tbx-muted); line-height: 1.45; }
.tbx-center { text-align: center; justify-self: center; }
.tbx-card { background: var(--tbx-paper); border: 1px solid var(--tbx-line); border-radius: var(--tbx-r-lg); box-shadow: var(--tbx-shadow-1); padding: 16px; }
.tbx-card-h { display: flex; align-items: baseline; gap: 8px; font-size: 1rem; margin-bottom: 12px; }
.tbx-card-h span { font-family: var(--texto, inherit); font-size: 0.8125rem; font-weight: 500; color: var(--tbx-muted); }
.tbx-field-l { font-size: 0.8125rem; font-weight: 600; color: var(--tbx-text-2); }
.tbx-spin { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, .22); border-top-color: var(--tbx-gold); border-radius: 50%; animation: tbx-rot .8s linear infinite; }
.tbx-spin.is-dark { width: 22px; height: 22px; border-width: 3px; border-color: var(--tbx-line-2); border-top-color: var(--tbx-gold-600); flex: none; }
.tbx-note-msg {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 14px; font-size: 0.9063rem; line-height: 1.4;
  background: rgba(253, 178, 7, .12); color: #FFE9A8; border: 1px solid rgba(253, 178, 7, .3); animation: tbx-fade .2s;
}
.tbx-note-msg svg { flex: none; margin-top: 1px; }
.tbx-note-msg.is-light { background: var(--tbx-gold-50); color: var(--tbx-gold-ink); border-color: var(--tbx-gold-100); }
.tbx-ask { display: grid; justify-items: center; gap: 12px; text-align: center; max-width: 380px; padding: 24px 8px; }
.tbx-ask-3d { margin-bottom: 4px; filter: drop-shadow(0 12px 22px rgba(11, 12, 14, .22)); }
.tbx-ask p { color: var(--tbx-muted); }
.tbx-narrowbox { width: min(480px, 100%); }

/* ───────── Linterna ───────── */
.tbx-hidden-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tbx-torch { position: relative; display: grid; justify-items: center; gap: 12px; width: min(420px, 100%); text-align: center; padding: 8px 0 20px; }
.tbx-torch-glow { position: absolute; top: -70px; left: 50%; width: 380px; height: 380px; margin-left: -190px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .35s; background: none; }
.tbx-torch.is-on .tbx-torch-glow { opacity: 1; }
.tbx-power {
  position: relative; width: 172px; height: 172px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; color: rgba(255, 255, 255, .86);
  background: #30343B;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .09), 0 0 0 10px rgba(255, 255, 255, .04), 0 0 0 11px rgba(255, 255, 255, .08), 0 20px 44px rgba(0, 0, 0, .55);
  transition: transform .1s, box-shadow .3s, color .3s, background .3s;
}
.tbx-power:active:not(:disabled) { transform: scale(.96); }
.tbx-power:disabled { cursor: progress; }
.tbx-torch.is-on .tbx-power {
  color: var(--tbx-ink); background: #FFE08A;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .4);
}
.tbx-torch-state { font-family: var(--tbx-title); font-weight: 800; font-size: 1.75rem; margin-top: 10px; }
.tbx-torch.is-on .tbx-torch-state { color: var(--tbx-gold); }
.tbx-torch-hint { color: var(--tbx-dim); font-size: 0.9063rem; margin-bottom: 6px; }
.tbx-screen-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 14px; margin-top: 6px; text-align: left; border-radius: 18px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); color: #fff; font: inherit;
}
.tbx-screen-btn:hover { background: rgba(255, 255, 255, .1); }
.tbx-screen-btn strong { display: block; font-size: 1rem; }
.tbx-screen-btn small { display: block; color: var(--tbx-dim); font-size: 0.8125rem; margin-top: 2px; }
.tbx-screen-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: #fff; color: var(--tbx-ink); box-shadow: 0 0 24px rgba(255, 255, 255, .25); }
.tbx-suggest { border-color: var(--tbx-gold); box-shadow: none; animation: tbx-pulse 1.6s ease-in-out 3; }
@keyframes tbx-pulse { 50% { box-shadow: none; } }
.tbx-screenlight {
  position: fixed; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center;
  padding: 24px 16px calc(28px + var(--tbx-safe-b)); background: #FFFFFF; animation: tbx-fade .15s;
}
.tbx-screenlight.is-warm { background: #FFF0CC; }
.tbx-screenlight-ui { display: grid; gap: 12px; justify-items: center; color: #6B7280; font-size: 0.8125rem; text-align: center; }
.tbx-screenlight-btns { display: flex; gap: 10px; }
.tbx-screenlight-btns button { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid #E5E7EB; background: rgba(255, 255, 255, .7); color: #3D434D; font: inherit; font-weight: 700; cursor: pointer; }
.tbx-screenlight-btns .is-off { background: #0B0C0E; border-color: #0B0C0E; color: #fff; }

/* ───────── Nivel ───────── */
.tbx-level { display: grid; justify-items: center; gap: 16px; padding: 16px 14px 20px; background: var(--tbx-paper); border: 1px solid var(--tbx-line); border-radius: 24px; box-shadow: var(--tbx-shadow-1); transition: border-color .2s, box-shadow .2s; }
.tbx-level.is-ok { border-color: var(--tbx-ok); box-shadow: 0 0 0 4px var(--tbx-ok-50); }
.tbx-level.is-idle .tbx-bull, .tbx-level.is-idle .tbx-vial, .tbx-level.is-idle .tbx-lv-read, .tbx-lv-read.is-dim { opacity: .5; }
.tbx-lv-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 32px; }
.tbx-lv-pill { font-weight: 700; font-size: 0.875rem; padding: 6px 14px; border-radius: 999px; background: var(--tbx-soft); color: var(--tbx-text-2); }
.tbx-lv-pill.is-ok { background: var(--tbx-ok); color: #fff; }
.tbx-lv-mode { font-size: 0.8125rem; color: var(--tbx-muted); font-weight: 600; }
.tbx-bull {
  --d: min(68vw, 270px); --bs: 46px; --travel: calc(var(--d) / 2 - var(--bs) / 2 - 8px);
  position: relative; width: var(--d); height: var(--d); border-radius: 50%; transition: opacity .2s;
  background: #FFEFBF;
  box-shadow: inset 0 8px 22px rgba(138, 90, 0, .2), inset 0 0 0 2px rgba(138, 90, 0, .16), 0 0 0 8px var(--tbx-soft), 0 0 0 9px var(--tbx-line);
}
.tbx-bull.is-ok { background: #CBEFD7; box-shadow: inset 0 8px 22px rgba(21, 128, 61, .2), inset 0 0 0 2px rgba(21, 128, 61, .25), 0 0 0 8px var(--tbx-ok-50), 0 0 0 9px rgba(21, 128, 61, .25); }
.tbx-bull.is-dim { opacity: .45; }
.tbx-bull-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 2px solid rgba(11, 12, 14, .22); transform: translate(-50%, -50%); }
.tbx-bull-ring.r1 { width: calc(var(--bs) + 10px); height: calc(var(--bs) + 10px); border-color: rgba(11, 12, 14, .55); }
.tbx-bull-ring.r2 { width: 64%; height: 64%; border-style: dashed; }
.tbx-bull-cross { position: absolute; inset: 0; }
.tbx-bull-cross::before, .tbx-bull-cross::after { content: ''; position: absolute; background: rgba(11, 12, 14, .16); }
.tbx-bull-cross::before { left: 50%; top: 7%; bottom: 7%; width: 1.5px; margin-left: -.75px; }
.tbx-bull-cross::after { top: 50%; left: 7%; right: 7%; height: 1.5px; margin-top: -.75px; }
.tbx-bubble {
  position: absolute; left: 50%; top: 50%; width: var(--bs); height: var(--bs); margin: calc(var(--bs) / -2) 0 0 calc(var(--bs) / -2); border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 -4px 8px rgba(138, 90, 0, .22), 0 2px 8px rgba(11, 12, 14, .18);
  transform: translate(calc(var(--bx) * var(--travel)), calc(var(--by) * var(--travel))); transition: transform .08s linear;
}
.tbx-bull.is-ok .tbx-bubble { box-shadow: inset 0 -4px 8px rgba(21, 128, 61, .25), 0 0 0 3px var(--tbx-ok); }
.tbx-lv-read { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.tbx-lv-n { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--tbx-soft); text-align: center; transition: background .2s; }
.tbx-lv-n span { font-size: 0.7813rem; font-weight: 600; color: var(--tbx-muted); }
.tbx-lv-n strong { font-family: var(--tbx-title); font-weight: 800; font-size: 1.875rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tbx-lv-n.is-ok { background: var(--tbx-ok-50); }
.tbx-lv-n.is-ok strong { color: var(--tbx-ok); }
.tbx-vial-wrap { width: 100%; display: grid; place-items: center; height: 66px; transition: height .2s; }
.tbx-vial-wrap.is-v { height: min(80vw, 300px); }
.tbx-vial {
  --w: min(78vw, 300px); --vb: 42px; --vt: calc(var(--w) / 2 - var(--vb) / 2 - 10px);
  position: relative; width: var(--w); height: 52px; border-radius: 26px; transition: transform .25s;
  background: #FFF3CF;
  box-shadow: inset 0 3px 8px rgba(138, 90, 0, .24), inset 0 0 0 2px rgba(138, 90, 0, .18), 0 0 0 6px var(--tbx-soft), 0 0 0 7px var(--tbx-line);
}
.tbx-vial.is-ok { background: #E6F8EC; }
.tbx-vial-mark { position: absolute; top: 7px; bottom: 7px; left: 50%; width: 2px; background: rgba(11, 12, 14, .45); }
.tbx-vial-mark.l { margin-left: calc(var(--vb) / -2 - 5px); }
.tbx-vial-mark.r { margin-left: calc(var(--vb) / 2 + 3px); }
.tbx-vial-bubble {
  position: absolute; top: 50%; left: 50%; width: var(--vb); height: 30px; margin: -15px 0 0 calc(var(--vb) / -2); border-radius: 15px;
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 -2px 5px rgba(138, 90, 0, .2), 0 1px 4px rgba(11, 12, 14, .15);
  transform: translateX(calc(var(--bb) * var(--vt))); transition: transform .08s linear;
}
.tbx-lv-bar-read { font-size: 0.8438rem; color: var(--tbx-muted); text-align: center; }
.tbx-lv-bar-read strong { color: var(--tbx-ink); font-weight: 800; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

/* ───────── Regla ───────── */
.tbx-ruler { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--tbx-paper); }
.tbx-ruler-box { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; }
.tbx-ruler-box canvas { position: absolute; left: 0; top: 0; display: block; }
.tbx-ruler-read {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 196px; padding: 12px 24px 14px; border-radius: 22px; pointer-events: none;
  background: var(--tbx-ink); color: #fff; text-align: center;
  box-shadow: 0 14px 34px rgba(11, 12, 14, .32), inset 0 0 0 1px rgba(255, 255, 255, .06); transition: top .25s cubic-bezier(.2, .8, .2, 1), left .25s cubic-bezier(.2, .8, .2, 1);
}
.tbx-ruler-cm { font-size: 1.1875rem; color: var(--tbx-dim); font-weight: 600; }
.tbx-ruler-cm strong { font-family: var(--tbx-title); font-weight: 800; font-size: 3.625rem; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tbx-ruler-sub { font-size: 0.9375rem; color: var(--tbx-gold); font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tbx-ruler-k { font-size: 0.7188rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tbx-gold); }
.tbx-ruler-read.is-total { box-shadow: 0 14px 34px rgba(11, 12, 14, .32), 0 0 0 3px var(--tbx-gold); }
.tbx-ruler-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(8px + var(--tbx-safe-b)); background: var(--tbx-paper); border-top: 1px solid var(--tbx-line); }
.tbx-ruler-tip { display: grid; justify-items: center; gap: 6px; font-size: 0.8125rem; color: var(--tbx-muted); text-align: center; line-height: 1.35; }
.tbx-long-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--tbx-ink); color: var(--tbx-gold); font: inherit; font-weight: 700; font-size: 0.8438rem;
}
.tbx-ruler-acts { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tbx-ruler-acts .btn { min-height: 48px; padding: 0 16px; }
.tbx-ruler-steps { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px 10px; background: var(--tbx-ink); color: #fff; font-size: 0.75rem; line-height: 1.3; }
.tbx-ruler-steps span { display: flex; align-items: flex-start; gap: 6px; }
.tbx-ruler-steps b { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--tbx-gold); color: var(--tbx-ink); font-size: 0.7188rem; }
.tbx-ruler-segs { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; background: var(--tbx-paper); border-top: 1px solid var(--tbx-line); }
.tbx-ruler-chips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tbx-chip-btn.is-sm { min-height: 40px; padding: 0 12px; font-size: 0.8125rem; flex: none; }
.tbx-seg-chip { flex: none; padding: 5px 11px; border-radius: 999px; background: var(--tbx-gold-50); color: var(--tbx-gold-ink); font-size: 0.8125rem; font-weight: 700; box-shadow: inset 0 0 0 1px var(--tbx-gold-100); font-variant-numeric: tabular-nums; animation: tbx-pop .3s both; }
.tbx-calib { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px calc(14px + var(--tbx-safe-b)); max-width: 760px; width: 100%; margin: 0 auto; }
.tbx-calib-tip { font-size: 0.9063rem; line-height: 1.4; }
.tbx-calib-area {
  position: relative; flex: 1; min-height: 180px; overflow: hidden; border-radius: 0 16px 16px 16px; border: 1px solid var(--tbx-line-2);
  background: repeating-linear-gradient(45deg, var(--tbx-soft) 0 10px, var(--tbx-paper) 10px 20px);
}
.tbx-card-ghost {
  position: absolute; left: 0; top: 0; border: 2.5px dashed var(--tbx-gold-600); background: rgba(253, 178, 7, .16);
  display: grid; place-items: center; transition: width .05s, height .05s;
}
.tbx-card-chip { position: absolute; left: 16%; top: 14%; width: 22%; height: 11%; border-radius: 6px; background: #F7D576; opacity: .8; }
.tbx-card-lbl { font-family: var(--tbx-title); font-weight: 800; font-size: 0.9375rem; color: var(--tbx-gold-ink); letter-spacing: .06em; text-transform: uppercase; }
.tbx-calib-ctl { display: flex; align-items: center; gap: 6px; }
.tbx-calib-ctl input[type="range"] { flex: 1; height: 48px; accent-color: var(--tbx-gold-600); }

/* ───────── Notas ───────── */
.tbx-editor .dictate textarea.input { min-height: 240px; font-size: 1.0313rem; line-height: 1.5; }
.tbx-saved { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.7813rem; font-weight: 600; color: var(--tbx-ok); }
.tbx-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tbx-acts .btn[disabled] { pointer-events: none; opacity: .5; }
.tbx-notes-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.tbx-notes-top > :only-child { grid-column: 1 / -1; }
.tbx-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 16px; color: var(--tbx-muted); max-width: 420px; justify-self: center; }
.tbx-empty strong { color: var(--tbx-ink); font-size: 1.125rem; font-family: var(--tbx-title); }
.tbx-empty .i3d { margin-bottom: 6px; filter: drop-shadow(0 10px 18px rgba(138, 90, 0, .18)); }
.tbx-notes { display: grid; gap: 10px; }
.tbx-note {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 14px 16px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--tbx-paper); border: 1px solid var(--tbx-line); border-left: 4px solid var(--tbx-gold); border-radius: 16px; box-shadow: var(--tbx-shadow-1);
  transition: box-shadow .15s, transform .08s; animation: tbx-rise .3s cubic-bezier(.2, .8, .2, 1) both;
}
.tbx-note:hover { box-shadow: var(--tbx-shadow-2); }
.tbx-note:active { transform: scale(.985); }
.tbx-note-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tbx-note-t { font-weight: 700; font-size: 0.9688rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbx-note-p { font-size: 0.875rem; color: var(--tbx-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbx-note-d { font-size: 0.75rem; color: var(--tbx-muted); }

/* ───────── Croquis ───────── */
.tbx-sk { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tbx-sk-area { position: relative; flex: 1; min-height: 0; background: var(--tbx-line); background-image: radial-gradient(rgba(11, 12, 14, .08) 1px, transparent 1px); background-size: 14px 14px; }
.tbx-sk-fit { position: absolute; inset: 10px; display: grid; place-items: center; }
.tbx-sk-paper { position: relative; overflow: hidden; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(11, 12, 14, .16), 0 0 0 1px rgba(11, 12, 14, .06); }
.tbx-sk-paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tbx-sk-ink { touch-action: none; cursor: crosshair; }
.tbx-sk-ink.m-text { cursor: text; }
.tbx-sk-ink.m-eraser { cursor: cell; }
.tbx-sk-dock { flex: none; display: grid; gap: 6px; padding: 8px 8px calc(10px + var(--tbx-safe-b)); background: var(--tbx-paper); border-top: 1px solid var(--tbx-line); box-shadow: 0 -6px 20px rgba(11, 12, 14, .05); }
.tbx-sk-dock > * { width: 100%; max-width: 720px; margin: 0 auto; }
.tbx-sk-tools, .tbx-sk-acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.tbx-sk-tool, .tbx-sk-act {
  display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; border: 0; border-radius: 13px; cursor: pointer;
  background: transparent; color: var(--tbx-text-2); font: inherit; font-size: 0.7188rem; font-weight: 600; white-space: nowrap; transition: background .12s, color .12s;
}
.tbx-sk-tool:hover { background: var(--tbx-soft); }
.tbx-sk-tool[aria-checked="true"] { background: var(--tbx-ink); color: var(--tbx-gold); }
.tbx-sk-act { background: var(--tbx-soft); }
.tbx-sk-act:hover { background: var(--tbx-line); }
.tbx-sk-act[aria-pressed="true"] { background: var(--tbx-gold-50); color: var(--tbx-gold-ink); box-shadow: inset 0 0 0 1.5px var(--tbx-gold); }
.tbx-sk-act.tbx-gold { background: var(--tbx-gold); color: var(--tbx-ink); }
.tbx-sk-act.tbx-gold:hover { background: var(--tbx-gold-600); }
.tbx-sk-style { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 6px; padding: 0 2px; }
@media (max-width: 400px) { .tbx-sk-style { justify-content: center; } }
.tbx-swatches, .tbx-sizes { display: flex; }
.tbx-swatch { width: 42px; height: 48px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.tbx-swatch i { width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(11, 12, 14, .2); transition: transform .12s, box-shadow .12s; }
.tbx-swatch[aria-checked="true"] i { transform: scale(1.06); box-shadow: inset 0 0 0 1px rgba(11, 12, 14, .2), 0 0 0 3px var(--tbx-paper), 0 0 0 5px var(--tbx-ink); }
.tbx-sizes { gap: 2px; padding: 2px; border-radius: 14px; background: var(--tbx-soft); }
.tbx-size { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.tbx-size i { border-radius: 50%; display: block; }
.tbx-size[aria-checked="true"] { background: var(--tbx-paper); box-shadow: var(--tbx-shadow-1), inset 0 0 0 1.5px var(--tbx-ink); }
.tbx-job {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1.5px solid var(--tbx-line-2, #D5D9E0); border-radius: 14px; background: var(--tbx-paper, #fff);
}
.tbx-job:hover:not(:disabled) { border-color: var(--tbx-gold, #FDB207); background: var(--tbx-gold-50, #FFF8E3); }
.tbx-job:disabled { opacity: .6; cursor: progress; }
.tbx-job .grow { display: grid; }
.tbx-job-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--grafito, #0B0C0E); color: var(--oro, #FDB207); }

/* ───────── Calculadora de obra ───────── */
.tbx-num { display: grid; gap: 5px; min-width: 0; align-content: start; }
.tbx-num label { font-size: 0.8125rem; font-weight: 600; color: var(--tbx-text-2); }
.tbx-num-box { position: relative; display: flex; align-items: center; }
.tbx-num-box .input { min-height: 50px; padding-right: 48px; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tbx-num-u { position: absolute; right: 12px; font-size: 0.875rem; font-weight: 600; color: var(--tbx-muted); pointer-events: none; }
.tbx-num-h { font-size: 0.7813rem; color: var(--tbx-muted); }
.tbx-rowin { display: grid; grid-template-columns: 24px minmax(0, 1fr) 12px minmax(0, 1fr) 48px; align-items: end; gap: 6px; margin-bottom: 12px; }
.tbx-rowin.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)) 48px; }
.tbx-rowin .tbx-num-box .input { padding-right: 30px; padding-left: 12px; }
.tbx-rowin .tbx-num-u { right: 10px; }
.tbx-rowin-n { width: 24px; height: 24px; margin-bottom: 13px; border-radius: 50%; display: grid; place-items: center; background: var(--tbx-ink); color: var(--tbx-gold); font-size: 0.75rem; font-weight: 800; }
.tbx-times { margin-bottom: 14px; text-align: center; color: var(--tbx-muted); font-weight: 700; }
.tbx-rowin .tbx-ib { margin-bottom: 1px; }
.tbx-add {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px dashed var(--tbx-line-2); background: none; color: var(--tbx-gold-ink); font: inherit; font-weight: 700;
}
.tbx-add:hover { border-color: var(--tbx-gold); background: var(--tbx-gold-50); }
.tbx-use { justify-self: start; min-height: 44px; padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer; background: var(--tbx-gold-50); color: var(--tbx-gold-ink); font: inherit; font-size: 0.8438rem; box-shadow: inset 0 0 0 1px var(--tbx-gold-100); }
.tbx-use:hover { background: var(--tbx-gold-100); }
.tbx-result {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: 22px; color: #fff; box-shadow: var(--tbx-shadow-2);
  background: var(--tbx-ink);
}
.tbx-result-l { font-size: 0.75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tbx-gold); }
.tbx-result-v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.tbx-result-v span { font-family: var(--tbx-title); font-weight: 800; font-size: 3.5rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tbx-result-v small { font-size: 1.125rem; font-weight: 600; color: var(--tbx-dim); }
.tbx-result.is-empty .tbx-result-v span { color: rgba(255, 255, 255, .28); }
.tbx-result-rows { display: grid; margin: 14px 0 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.tbx-result-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 0.9063rem; }
.tbx-result-rows div:last-child { border-bottom: 0; padding-bottom: 0; }
.tbx-result-rows dt { color: var(--tbx-dim); }
.tbx-result-rows dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.tbx-result-note { margin-top: 10px; font-size: 0.8125rem; color: var(--tbx-dim); }

/* ───────── Conversor ───────── */
.tbx-conv { display: grid; gap: 10px; }
.tbx-conv-box { display: grid; gap: 10px; padding: 16px; border-radius: 22px; background: var(--tbx-paper); border: 1px solid var(--tbx-line); box-shadow: var(--tbx-shadow-1); }
.tbx-conv-in {
  width: 100%; padding: 2px 0 6px; border: 0; border-bottom: 2px solid var(--tbx-line-2); background: none; outline: none; color: var(--tbx-ink);
  font-family: var(--tbx-title); font-weight: 800; font-size: 2.625rem; font-variant-numeric: tabular-nums;
}
.tbx-conv-in:focus { border-bottom-color: var(--tbx-gold); }
.tbx-conv-box.is-out { background: var(--tbx-ink); border-color: var(--tbx-ink); color: #fff; }
.tbx-conv-box.is-out .tbx-field-l { color: var(--tbx-gold); text-transform: uppercase; letter-spacing: .1em; font-size: 0.75rem; }
.tbx-conv-box.is-out select.input { background-color: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .2); }
.tbx-conv-box.is-out select.input option { color: #0B0C0E; background: #fff; }
.tbx-conv-res { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.tbx-conv-res span { font-family: var(--tbx-title); font-weight: 800; font-size: 2.875rem; line-height: 1.05; font-variant-numeric: tabular-nums; word-break: break-all; }
.tbx-conv-res small { font-size: 1.125rem; font-weight: 600; color: var(--tbx-dim); }
.tbx-frac { color: var(--tbx-gold); font-weight: 600; font-size: 0.9375rem; margin-top: -4px; }
.tbx-swap {
  justify-self: center; position: relative; z-index: 1; width: 52px; height: 52px; margin: -24px 0; display: grid; place-items: center; cursor: pointer;
  border: 4px solid var(--tbx-bg); border-radius: 50%; background: var(--tbx-gold); color: var(--tbx-ink); box-shadow: var(--tbx-shadow-2); transition: transform .2s;
}
.tbx-swap:active { transform: rotate(180deg); }
.tbx-eq { display: grid; }
.tbx-eq-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 4px; text-align: left; cursor: pointer;
  border: 0; border-top: 1px solid var(--tbx-line); background: none; font: inherit; color: inherit;
}
.tbx-eq-row:first-child { border-top: 0; }
.tbx-eq-row span { color: var(--tbx-text-2); }
.tbx-eq-row strong { font-variant-numeric: tabular-nums; text-align: right; }
.tbx-eq-row strong small { color: var(--tbx-muted); font-weight: 600; }
.tbx-eq-row.is-on strong { color: var(--tbx-gold-ink); }

/* ───────── Lupa ───────── */
.tbx-mag { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tbx-mag-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; touch-action: none; }
.tbx-mag-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: center; transition: transform .1s linear; }
.tbx-mag-media[hidden] { display: none; }
.tbx-mag-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: var(--tbx-dim); font-size: 0.9375rem; line-height: 1.45; max-width: 420px; margin: 0 auto; }
.tbx-mag-badge {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(11, 12, 14, .72); color: #fff; font-size: 0.8125rem; font-weight: 600;
}
.tbx-mag-ctl { flex: none; display: grid; gap: 8px; padding: 10px 14px calc(14px + var(--tbx-safe-b)); background: var(--tbx-ink); }
.tbx-mag-ctl > * { width: 100%; max-width: 640px; margin: 0 auto; }
.tbx-zoom { display: flex; align-items: center; gap: 4px; }
.tbx-zoom input { flex: 1; min-width: 0; height: 48px; accent-color: var(--tbx-gold); }
.tbx-zoom-v { min-width: 54px; text-align: right; font-family: var(--tbx-title); font-weight: 800; font-size: 1.125rem; color: var(--tbx-gold); font-variant-numeric: tabular-nums; }
.tbx-mag-btns { display: flex; gap: 10px; justify-content: center; }
.tbx-pill {
  flex: 1; max-width: 200px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-weight: 700; font-size: 0.9375rem;
}
.tbx-pill.is-primary { background: var(--tbx-gold); border-color: var(--tbx-gold); color: var(--tbx-ink); }
.tbx-pill[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--tbx-ink); }
.tbx-pill:disabled { opacity: .4; cursor: default; }

/* ───────── Cronómetro y temporizador ───────── */
.tbx-sw { display: grid; justify-items: center; gap: 24px; padding: 30px 12px; background: var(--tbx-paper); border: 1px solid var(--tbx-line); border-radius: 24px; box-shadow: var(--tbx-shadow-1); }
.tbx-sw-time { font-family: var(--tbx-title); font-weight: 800; font-size: clamp(54px, 17vw, 88px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tbx-sw-btns { display: flex; gap: 20px; justify-content: center; }
.tbx-big-btn {
  width: 98px; height: 98px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
  background: var(--tbx-soft); color: var(--tbx-text-2); box-shadow: inset 0 0 0 1.5px var(--tbx-line-2); transition: transform .1s;
}
.tbx-big-btn:active:not(:disabled) { transform: scale(.95); }
.tbx-big-btn.is-go { background: var(--tbx-gold); color: var(--tbx-ink); box-shadow: none; }
.tbx-big-btn.is-stop { background: var(--tbx-ink); color: #fff; box-shadow: 0 8px 22px rgba(11, 12, 14, .25); }
.tbx-big-btn:disabled { opacity: .45; cursor: default; }
.tbx-laps { padding: 4px 16px; }
.tbx-lap { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 16px; padding: 12px 0; border-top: 1px solid var(--tbx-line); font-variant-numeric: tabular-nums; }
.tbx-lap:first-child { border-top: 0; }
.tbx-lap strong { font-size: 1.0625rem; }
.tbx-lap .muted { font-size: 0.8438rem; }
.tbx-lap.is-best strong { color: var(--tbx-ok); }
.tbx-lap.is-worst strong { color: var(--tbx-err); }
.tbx-tm-set { display: grid; gap: 18px; justify-items: center; }
.tbx-tm-pick { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tbx-tm-colon { font-family: var(--tbx-title); font-weight: 800; font-size: 2.75rem; color: var(--tbx-dim); padding-top: 22px; }
.tbx-step { display: grid; gap: 6px; justify-items: center; }
.tbx-step label { font-size: 0.8125rem; font-weight: 600; color: var(--tbx-muted); }
.tbx-step-box { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; padding: 4px; border-radius: 18px; background: var(--tbx-soft); }
.tbx-step-box input {
  width: 96px; padding: 0; border: 0; background: none; outline: none; text-align: center; color: var(--tbx-ink);
  font-family: var(--tbx-title); font-weight: 800; font-size: 2.875rem; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.tbx-step-box input:focus { color: var(--tbx-gold-ink); }
.tbx-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tbx-preset { min-height: 48px; padding: 0 16px; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--tbx-line-2); background: var(--tbx-paper); color: var(--tbx-text-2); font: inherit; font-weight: 600; }
.tbx-preset[aria-pressed="true"] { background: var(--tbx-ink); border-color: var(--tbx-ink); color: #fff; }
.tbx-ring { position: relative; width: min(74vw, 280px); aspect-ratio: 1; justify-self: center; margin: 8px 0; }
.tbx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tbx-ring circle { fill: none; stroke-width: 14; }
.tbx-ring .bg { stroke: var(--tbx-line); }
.tbx-ring .fg { stroke: var(--tbx-gold); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.tbx-ring.is-done .fg { stroke: var(--tbx-err); }
.tbx-ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.tbx-ring-time { font-family: var(--tbx-title); font-weight: 800; font-size: clamp(44px, 14vw, 60px); line-height: 1; font-variant-numeric: tabular-nums; }
.tbx-ring-st { margin-top: 6px; color: var(--tbx-muted); font-weight: 600; }
.tbx-ring.is-done .tbx-ring-st { color: var(--tbx-err); font-size: 1.25rem; font-weight: 800; animation: tbx-blink 1s steps(2) infinite; }
@keyframes tbx-blink { 50% { opacity: .35; } }

/* ───────── Brújula ───────── */
.tbx-compass { display: grid; justify-items: center; gap: 18px; padding-top: 14px; }
.tbx-compass.is-idle .tbx-compass-dial { opacity: .45; }
.tbx-compass-dial { position: relative; width: min(80vw, 320px); aspect-ratio: 1; }
.tbx-lubber { position: absolute; top: -10px; left: 50%; z-index: 1; width: 0; height: 0; margin-left: -11px; border: 11px solid transparent; border-top: 18px solid var(--tbx-gold); border-bottom: 0; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.tbx-rose { width: 100%; height: 100%; transition: transform .12s linear; }
.tbx-rose .face { fill: var(--tbx-ink-2); stroke: rgba(253, 178, 7, .35); stroke-width: 2; }
.tbx-rose .tk { stroke: rgba(255, 255, 255, .32); stroke-width: 1.5; }
.tbx-rose .tk.big { stroke: rgba(255, 255, 255, .85); stroke-width: 2.5; }
.tbx-rose .cd { fill: #fff; font-family: var(--tbx-title); font-weight: 800; font-size: 1.5rem; text-anchor: middle; dominant-baseline: middle; }
.tbx-rose .cd.n { fill: var(--tbx-gold); }
.tbx-rose .ndl.n { fill: var(--tbx-gold); }
.tbx-rose .ndl.s { fill: rgba(255, 255, 255, .45); }
.tbx-compass-read { display: grid; justify-items: center; gap: 2px; }
.tbx-compass-read strong { font-family: var(--tbx-title); font-weight: 800; font-size: 3.375rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tbx-compass-read span { color: var(--tbx-gold); font-weight: 700; font-size: 1.125rem; }

/* ───────── Carga de una herramienta ───────── */
.tbx-loading { display: grid; justify-items: center; gap: 12px; max-width: 360px; text-align: center; color: var(--tbx-muted); font-weight: 600; animation: tbx-fade .3s .1s both; }
.tbx-loading strong { color: inherit; font-family: var(--tbx-title); font-size: 1.125rem; }
.tbx-dark .tbx-loading { color: var(--tbx-dim); }
.tbx-dark .tbx-loading strong { color: #fff; }

/* ───────── Linterna: explicación del permiso y ayuda ───────── */
.tbx-explain {
  display: grid; gap: 10px; width: 100%; padding: 16px; border-radius: 20px; text-align: left; font-size: 0.9063rem; line-height: 1.45;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #E8E9EC; animation: tbx-rise .35s cubic-bezier(.2, .8, .2, 1) both;
}
.tbx-explain.is-warn { border-color: rgba(253, 178, 7, .45); background: rgba(253, 178, 7, .08); }
.tbx-explain-h { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1rem; }
.tbx-explain-h svg:not(.i3d) { color: var(--tbx-gold); flex: none; }
.tbx-explain-h.is-msg { align-items: flex-start; font-weight: 600; line-height: 1.4; }
.tbx-torch.has-msg .tbx-power { width: 140px; height: 140px; }
.tbx-torch.has-msg .tbx-torch-state { margin-top: 2px; font-size: 1.5rem; }
.tbx-explain strong { color: #fff; }
.tbx-explain-acts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.tbx-explain .btn { min-height: 48px; white-space: normal; text-align: center; line-height: 1.2; }
.tbx-torch > * { min-width: 0; max-width: 100%; }
.tbx-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 8px; }
.tbx-steps li { counter-increment: st; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.tbx-steps li::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tbx-gold); color: var(--tbx-ink); font-weight: 800; font-size: 0.8125rem; }
.tbx-torch.is-blink .tbx-torch-glow { opacity: .15; }
.tbx-torch.is-blink .tbx-power { background: #4A4741; color: var(--tbx-gold); }
.tbx-torch .tbx-seg { width: 100%; background: rgba(255, 255, 255, .08); }
.tbx-torch .tbx-seg-b { color: var(--tbx-dim); }
.tbx-torch .tbx-seg-b[aria-selected="true"] { background: var(--tbx-gold); color: var(--tbx-ink); }

/* ───────── Notas: fotos ───────── */
.tbx-photos { display: grid; gap: 12px; }
.tbx-photos-h { display: flex; align-items: center; gap: 8px; font-size: 0.9688rem; }
.tbx-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--tbx-ink); color: var(--tbx-gold); font-size: 0.7813rem; font-weight: 800; }
.tbx-saving { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--tbx-muted); font-weight: 600; }
.tbx-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.tbx-thumb {
  position: relative; display: block; aspect-ratio: 1; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--tbx-soft); box-shadow: inset 0 0 0 1px var(--tbx-line); animation: tbx-pop .3s both;
}
.tbx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbx-thumb:active { transform: scale(.96); }
.tbx-thumb.is-small { width: 56px; height: 56px; flex: none; border-radius: 12px; cursor: inherit; animation: none; }
.tbx-thumb-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--tbx-dim); }
.tbx-add-photo {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 12px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed var(--tbx-line-2); background: var(--tbx-paper); color: var(--tbx-ink); font: inherit; font-weight: 700; transition: background .15s, border-color .15s;
}
.tbx-add-photo:hover { border-color: var(--tbx-gold); background: var(--tbx-gold-50); }
.tbx-add-photo svg { color: var(--tbx-gold-ink); }
.tbx-note-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--tbx-ink); color: var(--tbx-gold); font-weight: 700; vertical-align: 1px; }
.tbx-viewer { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #000; color: #fff; animation: tbx-fade .2s; }
.tbx-viewer-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 8px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: rgba(0, 0, 0, .7); position: relative; z-index: 1; }
.tbx-viewer-b { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.tbx-viewer-b.is-danger { color: #FFB4AB; }
.tbx-viewer-n { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.tbx-viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; touch-action: pan-y; overflow: hidden; }
.tbx-viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; transition: transform .2s; animation: tbx-fade .2s; }
.tbx-viewer-nav { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; }
.tbx-viewer-nav.is-prev { left: 10px; }
.tbx-viewer-nav.is-next { right: 10px; }
.tbx-viewer-dots { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--tbx-safe-b)); display: flex; justify-content: center; gap: 6px; }
.tbx-viewer-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .35); transition: background .2s, transform .2s; }
.tbx-viewer-dots i.on { background: var(--tbx-gold); transform: scale(1.25); }

/* ───────── Calculadora eléctrica ───────── */
.tbx-ohm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tbx-ohm-c { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.tbx-ohm-c span { font-size: 0.7813rem; color: var(--tbx-dim); font-weight: 600; }
.tbx-ohm-c strong { font-family: var(--tbx-title); font-weight: 800; font-size: 1.875rem; line-height: 1.05; color: var(--tbx-gold); font-variant-numeric: tabular-nums; word-break: break-all; }
.tbx-ohm-c small { font-size: 0.8125rem; color: var(--tbx-dim); font-weight: 600; }
.tbx-ohm-c.is-given strong { color: #fff; }
.tbx-disclaimer { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 0.8125rem; line-height: 1.45; background: var(--tbx-gold-50); color: var(--tbx-gold-ink); box-shadow: inset 0 0 0 1px var(--tbx-gold-100); }
.tbx-disclaimer svg { flex: none; margin-top: 1px; }

/* ───────── Transportador ───────── */
.tbx-prot { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--tbx-paper); }
.tbx-prot-top { flex: none; padding: 8px 10px; background: var(--tbx-paper); border-bottom: 1px solid var(--tbx-line); }
.tbx-prot-top > * { max-width: 520px; margin: 0 auto; }
.tbx-prot-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; background: #FFFDF5; cursor: grab; }
.tbx-prot.has-cam .tbx-prot-stage { background: #000; }
.tbx-prot-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tbx-prot-video[hidden] { display: none; }
.tbx-prot-svg { position: absolute; inset: 0; display: block; }
.tbx-prot-svg .dial { fill: rgba(253, 178, 7, .1); stroke: rgba(11, 12, 14, .55); stroke-width: 2; }
.tbx-prot.has-cam .tbx-prot-svg .dial { fill: rgba(11, 12, 14, .2); stroke: rgba(255, 255, 255, .8); }
.tbx-prot-svg .tk { stroke: rgba(11, 12, 14, .45); stroke-width: 1; }
.tbx-prot-svg .tk.big { stroke-width: 1.6; stroke: rgba(11, 12, 14, .7); }
.tbx-prot-svg .tk.xl { stroke-width: 2.4; stroke: var(--tbx-ink); }
.tbx-prot-svg .lb { font: 700 0.75rem Inter, system-ui, sans-serif; fill: var(--tbx-text-2); text-anchor: middle; dominant-baseline: middle; }
.tbx-prot.has-cam .tbx-prot-svg .tk, .tbx-prot.has-cam .tbx-prot-svg .tk.big, .tbx-prot.has-cam .tbx-prot-svg .tk.xl { stroke: #fff; }
.tbx-prot.has-cam .tbx-prot-svg .lb { fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .6); stroke-width: 3px; }
.tbx-prot-svg .sector { fill: rgba(253, 178, 7, .38); stroke: var(--tbx-gold-600); stroke-width: 1.5; }
.tbx-prot-svg .sector-lb { font: 800 0.9375rem Archivo, Inter, sans-serif; fill: var(--tbx-ink); text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.tbx-prot-svg .arm line { stroke: var(--tbx-ink); stroke-width: 3; stroke-linecap: round; }
.tbx-prot-svg .arm-b line { stroke: var(--tbx-gold-600); }
.tbx-prot.has-cam .tbx-prot-svg .arm-a line { stroke: #fff; }
.tbx-prot-svg .arm .hdl { fill: #fff; stroke: var(--tbx-ink); stroke-width: 3; transition: r .15s; }
.tbx-prot-svg .arm-b .hdl { stroke: var(--tbx-gold-600); }
.tbx-prot-svg .arm.is-sel .hdl { fill: var(--tbx-gold); }
.tbx-prot-svg .hub { fill: var(--tbx-ink); stroke: #fff; stroke-width: 2; }
.tbx-prot-read {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; padding: 8px 18px 10px; border-radius: 20px; pointer-events: none;
  background: var(--tbx-ink); color: #fff; box-shadow: 0 12px 30px rgba(11, 12, 14, .3); min-width: 210px;
}
.tbx-prot-main strong { font-family: var(--tbx-title); font-weight: 800; font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tbx-prot-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; font-size: 0.7813rem; color: var(--tbx-dim); }
.tbx-prot-sub b { color: var(--tbx-gold); font-variant-numeric: tabular-nums; }
.tbx-prot-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(8px + var(--tbx-safe-b)); background: var(--tbx-paper); border-top: 1px solid var(--tbx-line); }
.tbx-prot-acts { display: flex; gap: 8px; justify-content: center; }
.tbx-prot-acts .tbx-chip-btn { padding: 0 14px; }
.tbx-incl { display: grid; justify-items: center; gap: 4px; padding: 18px 14px 20px; background: var(--tbx-paper); border: 1px solid var(--tbx-line); border-radius: 24px; box-shadow: var(--tbx-shadow-1); transition: box-shadow .2s, border-color .2s; }
.tbx-incl.is-held { border-color: var(--tbx-gold); box-shadow: 0 0 0 4px var(--tbx-gold-soft); }
.tbx-incl.is-idle .tbx-incl-svg { opacity: .5; }
.tbx-incl-svg { width: min(86vw, 340px); }
.tbx-incl-svg .arc { fill: none; stroke: var(--tbx-line-2); stroke-width: 14; stroke-linecap: round; }
.tbx-incl-svg .tk { stroke: var(--tbx-muted); stroke-width: 1.5; }
.tbx-incl-svg .tk.big { stroke: var(--tbx-ink); stroke-width: 2.5; }
.tbx-incl-svg .lb { font: 700 0.6875rem Inter, system-ui, sans-serif; fill: var(--tbx-muted); text-anchor: middle; dominant-baseline: middle; }
.tbx-incl-svg .ndl { stroke: var(--tbx-gold-600); stroke-width: 5; stroke-linecap: round; transition: all .12s linear; }
.tbx-incl-svg .hub { fill: var(--tbx-ink); }
.tbx-incl-read { display: grid; justify-items: center; gap: 2px; margin-top: -8px; }
.tbx-incl-read strong { font-family: var(--tbx-title); font-weight: 800; font-size: 3.75rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tbx-incl.is-held .tbx-incl-read strong { color: var(--tbx-gold-ink); }
.tbx-incl-read span { font-size: 0.8438rem; font-weight: 600; color: var(--tbx-muted); }

/* ───────── Escáner ───────── */
.tbx-scan { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tbx-scan-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.tbx-scan-frame { position: absolute; left: 50%; top: 46%; width: min(68vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 26px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .42); pointer-events: none; }
.tbx-scan-frame i { position: absolute; width: 44px; height: 44px; border: 5px solid var(--tbx-gold); }
.tbx-scan-frame .c1 { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-radius: 26px 0 0 0; }
.tbx-scan-frame .c2 { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-radius: 0 26px 0 0; }
.tbx-scan-frame .c3 { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 26px; }
.tbx-scan-frame .c4 { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-radius: 0 0 26px 0; }
.tbx-scan-line { position: absolute; left: 10%; right: 10%; top: 10%; height: 3px; border-radius: 2px; background: var(--tbx-gold); box-shadow: none; animation: tbx-scan 2.2s ease-in-out infinite; }
@keyframes tbx-scan { 50% { top: 88%; } }
.tbx-scan-tip { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #fff; font-weight: 600; font-size: 0.9063rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); padding: 0 16px; }
.tbx-msg-title { color: #fff; font-family: var(--tbx-title); font-size: 1.1875rem; }
.tbx-scan-res {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; overflow-y: auto; display: grid; gap: 12px; padding: 18px 16px 18px; border-radius: 26px 26px 0 0;
  background: var(--tbx-paper); color: var(--tbx-ink); box-shadow: 0 -20px 50px rgba(0, 0, 0, .45); animation: tbx-up .28s cubic-bezier(.2, .8, .2, 1);
}
.tbx-scan-res > * { width: 100%; max-width: 560px; margin: 0 auto; }
@keyframes tbx-up { from { transform: translateY(40px); opacity: 0; } }
.tbx-scan-res-h { display: flex; align-items: center; gap: 12px; }
.tbx-scan-res-h strong { display: block; font-size: 1rem; }
.tbx-scan-res-h small { color: var(--tbx-muted); font-size: 0.7813rem; }
.tbx-scan-val { padding: 14px; border-radius: 14px; background: var(--tbx-soft); font-family: var(--mono, ui-monospace, monospace); font-size: 1rem; line-height: 1.4; word-break: break-all; user-select: text; max-height: 180px; overflow-y: auto; }
.tbx-scan-val.is-url { color: var(--info, #1D4ED8); }
.tbx-scan-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tbx-scan-acts .btn { flex: 1 1 auto; min-height: 48px; }
.tbx-scan-list { display: grid; }
.tbx-scan-item { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 4px; border: 0; border-top: 1px solid var(--tbx-line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tbx-scan-item:first-child { border-top: 0; }
.tbx-scan-item .grow { min-width: 0; display: grid; }
.tbx-scan-item-v { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbx-scan-item small { color: var(--tbx-muted); font-size: 0.7813rem; }

/* ───────── Sonómetro ───────── */
.tbx-snd { display: grid; justify-items: center; gap: 10px; padding: 18px 14px 16px; border-radius: 26px; background: var(--tbx-ink-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.tbx-snd-svg { width: min(86vw, 340px); overflow: visible; }
.tbx-snd-svg .zn { fill: none; stroke-width: 14; }
.tbx-snd-svg .z1 { stroke: #22A568; }
.tbx-snd-svg .z2 { stroke: #FDB207; }
.tbx-snd-svg .z3 { stroke: #E5483D; }
.tbx-snd.is-idle .tbx-snd-svg .zn { opacity: .35; }
.tbx-snd-svg .tk { stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; }
.tbx-snd-svg .lb { font: 600 0.6563rem Inter, system-ui, sans-serif; fill: var(--tbx-dim); text-anchor: middle; dominant-baseline: middle; }
.tbx-snd-svg .ndl { stroke: #fff; stroke-width: 5; stroke-linecap: round; transition: all .12s linear; }
.tbx-snd-svg .hub { fill: #fff; }
.tbx-snd-read { display: flex; align-items: baseline; gap: 6px; margin-top: -28px; }
.tbx-snd-read strong { font-family: var(--tbx-title); font-weight: 800; font-size: 4.5rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.tbx-snd-read span { font-size: 1.25rem; font-weight: 700; color: var(--tbx-dim); }
.tbx-snd-zone { min-height: 30px; padding: 4px 14px; border-radius: 999px; font-weight: 700; font-size: 0.875rem; background: rgba(255, 255, 255, .08); color: var(--tbx-dim); transition: background .25s, color .25s; }
.tbx-snd.z1 .tbx-snd-zone { background: rgba(34, 165, 104, .2); color: #8BE3B0; }
.tbx-snd.z2 .tbx-snd-zone { background: rgba(253, 178, 7, .18); color: #FFE08A; }
.tbx-snd.z3 .tbx-snd-zone { background: rgba(229, 72, 61, .22); color: #FFB4AB; }
.tbx-snd-spark { width: 100%; height: 46px; display: flex; align-items: flex-end; gap: 2px; padding: 0 4px; }
.tbx-snd-spark i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: #22A568; opacity: .85; transition: height .12s linear; }
.tbx-snd-spark i.z2 { background: #FDB207; }
.tbx-snd-spark i.z3 { background: #E5483D; }
.tbx-snd-spark i.is-empty { height: 4%; background: rgba(255, 255, 255, .1); }
.tbx-snd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.tbx-snd-stats div { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.tbx-snd-stats span { font-size: 0.75rem; color: var(--tbx-dim); font-weight: 600; }
.tbx-snd-stats strong { font-family: var(--tbx-title); font-weight: 800; font-size: 1.625rem; font-variant-numeric: tabular-nums; }
.tbx-sheet .tbx-row2 > .tbx-pill { max-width: none; }
.tbx-snd-cal { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); font-size: 0.875rem; }
.tbx-snd-cal small { color: var(--tbx-dim); }
.tbx-snd-cal strong { min-width: 58px; text-align: center; font-variant-numeric: tabular-nums; }
.tbx-snd-ref { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 0.7813rem; color: var(--tbx-dim); }
.tbx-snd-ref span { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.tbx-snd-ref b { color: var(--tbx-gold); font-family: var(--tbx-title); font-size: 0.9375rem; }
.tbx-help svg { vertical-align: -2px; }

/* ───────── Medir con cámara (realidad aumentada) ───────── */
.tbx-ar-intro { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 10px 4px; }
.tbx-ar-intro .i3d { filter: none; }
.tbx-ar-intro h3 { color: #fff; font-size: 1.375rem; }
.tbx-ar-intro p { color: var(--tbx-dim); line-height: 1.5; }
.tbx-ar-intro p strong { color: #fff; }
.tbx-ar-intro .btn { min-height: 54px; }
.tbx-steps.is-dark { text-align: left; color: #E8E9EC; font-size: 0.9063rem; line-height: 1.45; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .06); }
.tbx-ar-last { color: var(--tbx-ink); display: grid; gap: 12px; animation: tbx-rise .3s both; }
.tbx-ar-last-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tbx-ar-last-h span { font-size: 0.75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--tbx-gold-ink); }
.tbx-ar-last-h strong { font-family: var(--tbx-title); font-weight: 800; font-size: 2.5rem; font-variant-numeric: tabular-nums; }
.tbx-ar-segs { margin: 0; padding: 0; list-style: none; display: grid; }
.tbx-ar-segs li { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--tbx-line); font-variant-numeric: tabular-nums; }
.tbx-ar-ov { position: fixed; inset: 0; z-index: 40; background: transparent; color: #fff; }
.tbx-ar-ov:not(.is-on) { display: none; }
.tbx-ar-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tbx-ar-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.tbx-ar-ui > * { pointer-events: auto; }
.tbx-ar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 0; }
.tbx-ar-total { display: grid; padding: 10px 18px 12px; border-radius: 20px; background: rgba(11, 12, 14, .78); box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.tbx-ar-total span { font-size: 0.7188rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tbx-gold); }
.tbx-ar-total strong { font-family: var(--tbx-title); font-weight: 800; font-size: 2.5rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tbx-ar-total small { font-size: 0.9375rem; font-weight: 700; color: #fff; opacity: .8; font-variant-numeric: tabular-nums; }
.tbx-ar-done { min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; background: #fff; color: var(--tbx-ink); font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.tbx-ar-hint { align-self: center; margin-top: auto; margin-bottom: 14px; padding: 8px 16px; border-radius: 999px; background: rgba(11, 12, 14, .66); font-weight: 600; font-size: 0.9063rem; text-align: center; pointer-events: none; }
.tbx-ar-bottom { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; gap: 6px; padding: 10px 12px calc(16px + var(--tbx-safe-b)); background: rgba(0, 0, 0, .55); }
.tbx-ar-b { display: grid; justify-items: center; gap: 3px; min-height: 60px; padding: 6px 2px; border: 0; border-radius: 16px; background: rgba(11, 12, 14, .55); color: #fff; font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.tbx-ar-b:disabled { opacity: .4; }
.tbx-ar-b.is-ghost { visibility: hidden; }
.tbx-ar-add { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; border: 5px solid #fff; background: var(--tbx-gold); color: var(--tbx-ink); cursor: pointer; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); transition: transform .1s, opacity .2s; }
.tbx-ar-add:active { transform: scale(.92); }
.tbx-ar-add.is-off { opacity: .55; }

/* ───────── Inteligencia (mosaico ancho) y «Muy pronto» ───────── */
.tbx-tile.is-wide {
  grid-column: 1 / -1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 3px;
  padding: 18px; color: #fff; border-color: transparent;
  background: var(--tbx-ink);
  box-shadow: 0 14px 34px -12px rgba(11, 12, 14, .55), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.tbx-tile.is-wide::after { display: none; }
.tbx-tile.is-wide .tbx-tile-ic { margin: 0; width: 64px; height: 64px; filter: none; }
.tbx-tile.is-wide .tbx-tile-name { font-size: 1.25rem; color: #fff; }
.tbx-tile.is-wide .tbx-tile-desc { color: #E8D9AE; font-size: 0.8438rem; }
.tbx-tile.is-wide .tbx-tile-art { opacity: .1; }
.tbx-tile.is-wide .tbx-tile-ic { grid-row: 1 / 3; align-self: center; }
.tbx-tile.is-wide .tbx-tile-name { align-self: end; padding-right: 92px; }
.tbx-tile.is-wide .tbx-tile-desc { align-self: start; }
.tbx-tile.is-wide .tbx-tile-new { background: var(--tbx-gold); color: var(--tbx-ink); }
.tbx-tile.is-soon:not(.is-wide) { opacity: .75; }
.tbx-tile-new.is-soon { background: var(--tbx-soft); color: var(--tbx-text-2); }
.tbx-tile.is-wide .tbx-tile-new.is-soon { background: rgba(255, 255, 255, .14); color: #fff; }
.tbx-soon .i3d { filter: none; margin-bottom: 4px; }
.tbx-soon strong { font-size: 1.3125rem; }

/* ───────── Sugerencias de tienda y folio ───────── */
.tbx-suggest-f { position: relative; min-width: 0; }
.tbx-suggest-l {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; display: grid; max-height: 264px; overflow-y: auto; padding: 4px;
  background: var(--tbx-paper); border: 1px solid var(--tbx-line-2); border-radius: 14px; box-shadow: var(--tbx-shadow-2); animation: tbx-fade .15s;
}
.tbx-suggest-o { display: grid; gap: 1px; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tbx-suggest-o:hover, .tbx-suggest-o:focus-visible { background: var(--tbx-gold-50); }
.tbx-suggest-o span { font-weight: 600; }
.tbx-suggest-o small { color: var(--tbx-muted); font-size: 0.7813rem; }
.tbx-place .field { margin: 0; }
@media (max-width: 520px) { .tbx-place { grid-template-columns: minmax(0, 1fr); } }

/* ───────── Contador ───────── */
.tbx-cnt-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 22px; color: #fff;
  background: var(--tbx-ink); box-shadow: var(--tbx-shadow-2);
}
.tbx-cnt-head .grow { min-width: 0; }
.tbx-cnt-title { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-family: var(--tbx-title); font-weight: 800; font-size: 1.1875rem; cursor: pointer; text-align: left; }
.tbx-cnt-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbx-cnt-title svg { flex: none; color: var(--tbx-gold); }
.tbx-cnt-meta { font-size: 0.8125rem; color: var(--tbx-dim); }
.tbx-cnt-total { display: grid; justify-items: end; flex: none; }
.tbx-cnt-total span { font-size: 0.7188rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tbx-gold); }
.tbx-cnt-total strong { font-family: var(--tbx-title); font-weight: 800; font-size: 2.875rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tbx-cnts { display: grid; gap: 10px; }
.tbx-cnt {
  display: grid; grid-template-columns: minmax(0, 1fr) 60px 96px; align-items: stretch; gap: 8px; padding: 10px; border-radius: 22px;
  background: var(--tbx-paper); border: 1px solid var(--tbx-line); box-shadow: var(--tbx-shadow-1); animation: tbx-rise .3s cubic-bezier(.2, .8, .2, 1) both;
}
.tbx-cnt-main { display: grid; align-content: center; min-width: 0; padding-left: 6px; }
.tbx-cnt-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--tbx-text-2); cursor: pointer; text-align: left; }
.tbx-cnt-name svg { flex: none; color: var(--tbx-muted); }
.tbx-cnt-v { font-family: var(--tbx-title); font-weight: 800; font-size: 3.375rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; cursor: default; }
.tbx-cnt-step { font-size: 0.75rem; color: var(--tbx-muted); font-weight: 600; margin-top: 2px; }
.tbx-cnt-minus, .tbx-cnt-plus { display: grid; place-items: center; border: 0; border-radius: 18px; cursor: pointer; touch-action: manipulation; transition: transform .08s, background .15s; -webkit-tap-highlight-color: transparent; }
.tbx-cnt-minus { background: var(--tbx-soft); color: var(--tbx-ink); min-height: 96px; }
.tbx-cnt-minus:disabled { opacity: .35; cursor: default; }
.tbx-cnt-plus { position: relative; min-height: 96px; background: var(--tbx-gold); color: var(--tbx-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.tbx-cnt-plus span { position: absolute; bottom: 8px; right: 10px; font-weight: 800; font-size: 0.8125rem; }
.tbx-cnt-minus:active:not(:disabled), .tbx-cnt-plus:active { transform: scale(.94); }
.tbx-cnt-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tbx-cnt-acts .tbx-chip-btn { text-decoration: none; }
.tbx-cnt-h { padding: 8px 6px 8px 16px; }
.tbx-cnt-h.is-cur { border-left-color: var(--tbx-ok); }
.tbx-plain { padding: 6px 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tbx-cnt-h-total { font-family: var(--tbx-title); font-weight: 800; font-size: 1.625rem; font-variant-numeric: tabular-nums; }

/* ───────── Registro ───────── */
.tbx-reg-tpl { display: flex; align-items: center; gap: 12px; }
.tbx-reg-tpl strong { display: block; font-family: var(--tbx-title); font-size: 1.125rem; }
.tbx-reg-tpl small { color: var(--tbx-muted); font-size: 0.8125rem; }
.tbx-tpls { display: grid; gap: 10px; }
.tbx-tpl-w { display: flex; align-items: center; gap: 4px; }
.tbx-tpl-w .tbx-tpl { flex: 1; min-width: 0; }
.tbx-tpl {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--tbx-paper); border: 1px solid var(--tbx-line); border-radius: 18px; box-shadow: var(--tbx-shadow-1); transition: box-shadow .15s, transform .08s, border-color .15s;
  animation: tbx-rise .3s cubic-bezier(.2, .8, .2, 1) both;
}
.tbx-tpl:hover { box-shadow: var(--tbx-shadow-2); border-color: var(--tbx-line-2); }
.tbx-tpl:active { transform: scale(.985); }
.tbx-tpl .grow { min-width: 0; display: grid; gap: 2px; }
.tbx-tpl strong { font-size: 1rem; }
.tbx-tpl small { color: var(--tbx-muted); font-size: 0.8125rem; line-height: 1.35; }
.tbx-tpl.is-new { border: 1.5px dashed var(--tbx-gold); background: var(--tbx-gold-50); }
.tbx-fld { display: grid; gap: 8px; }
.tbx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tbx-chips .tbx-preset[aria-checked="true"] { background: var(--tbx-ink); border-color: var(--tbx-ink); color: var(--tbx-gold); }
.tbx-b-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 48px; gap: 8px; align-items: end; padding: 10px; border-radius: 16px; background: var(--tbx-soft); }
.tbx-b-row .field { margin: 0; }
@media (max-width: 420px) { .tbx-b-row { grid-template-columns: minmax(0, 1fr) 48px; } .tbx-b-row > :nth-child(2) { grid-column: 1; grid-row: 2; } }
.tbx-reg-filters { display: grid; gap: 10px; }
.tbx-reg-filters .field { margin: 0; }
.tbx-reg-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.8438rem; color: var(--tbx-muted); font-weight: 600; }
.tbx-reg-chip { justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--tbx-gold-50); color: var(--tbx-gold-ink); font-size: 0.7188rem; font-weight: 800; letter-spacing: .02em; box-shadow: inset 0 0 0 1px var(--tbx-gold-100); }
.tbx-reg-detail { display: grid; gap: 12px; }
.tbx-reg-title { font-size: 1.3125rem; line-height: 1.25; }
.tbx-reg-place { display: flex; flex-wrap: wrap; gap: 8px; }
.tbx-reg-place span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--tbx-soft); font-size: 0.8438rem; font-weight: 600; }
.tbx-reg-dl { margin: 0; display: grid; }
.tbx-reg-dl div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--tbx-line); }
.tbx-reg-dl dt { color: var(--tbx-muted); font-size: 0.8438rem; font-weight: 600; }
.tbx-reg-dl dd { margin: 0; font-weight: 600; white-space: pre-wrap; word-break: break-word; }

/* ───────── Pantallas angostas ───────── */
@media (max-width: 400px) {
  .tbx-bar { gap: 6px; padding-left: 10px; padding-right: 8px; }
  .tbx-bar.has-actions .tbx-bar-ic { display: none; }
  .tbx-bar.has-actions .tbx-back { padding-right: 10px; }
  .tbx-bar.has-actions .tbx-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tbx-back { padding-right: 12px; }
  .tbx-bar-title { font-size: 1.0625rem; }
  .tbx-ruler-steps { font-size: 0.7188rem; }
  .tbx-ohm-c strong { font-size: 1.625rem; }
}
@media (min-width: 900px) {
  .tbx-bar { padding-left: 20px; padding-right: 20px; }
  .tbx-body:not(.tbx-b-fill) { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .tbx-sheet, .tbx-tile, .tbx-tile-ic, .tbx-bar-ic, .tbx-bubble, .tbx-vial-bubble, .tbx-rose, .tbx-suggest, .tbx-ring .fg, .tbx-note, .tbx-thumb, .tbx-explain,
  .tbx-scan-line, .tbx-scan-res, .tbx-seg-chip, .tbx-viewer, .tbx-viewer-stage img, .tbx-incl-svg .ndl, .tbx-snd-svg .ndl, .tbx-snd-spark i, .tbx-ar-last,
  .tbx-loading, .tbx-ruler-read, .tbx-cnt, .tbx-tpl, .tbx-suggest-l, .tbx-cnt-plus, .tbx-cnt-minus { animation: none !important; transition: none !important; }
}
