/* =====================================================================
   Mecánica de Retenciones · estilos
   Layout: barra superior pegajosa con pestañas tipo tecla, vistas en
   paneles en relieve (3D), libros diarios como papel contable elevado.
   ===================================================================== */
:root {
  /* Color — verde institucional (AdminPH), papel contable, oro de moneda */
  --bg: #e6ece6;
  --bg-2: #dbe4dc;
  --surface: #f8faf6;
  --surface-2: #eef3ec;
  --ink: #132219;
  --muted: #56685d;
  --line: #c9d5cb;
  --accent: #1f5c43;
  --accent-ink: #ffffff;
  --accent-soft: #d3e6da;
  --gold: #b9862a;
  --gold-soft: #f3e3bd;
  --debit: #1d5f86;
  --debit-soft: #dbeaf3;
  --credit: #8a4b16;
  --credit-soft: #f5e4d3;
  --ok: #217a45;
  --ok-soft: #d6efdf;
  --bad: #b23a2c;
  --bad-soft: #f6dcd7;
  --edge: #a9baad;
  --shadow: rgba(20, 45, 30, .28);
  --hi: rgba(255, 255, 255, .85);
  /* Type */
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r: 14px;
  --r-sm: 9px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1511; --bg-2: #101c16; --surface: #16231c; --surface-2: #1c2c23;
    --ink: #e2ece5; --muted: #9db1a4; --line: #2b3d33;
    --accent: #5fc493; --accent-ink: #08130d; --accent-soft: #1d3a2c;
    --gold: #e2b65a; --gold-soft: #3a2f17;
    --debit: #7cc0e8; --debit-soft: #16303f; --credit: #f0ad73; --credit-soft: #3a2817;
    --ok: #6fd69a; --ok-soft: #173826; --bad: #f08a7c; --bad-soft: #3d1c18;
    --edge: #050a07; --shadow: rgba(0, 0, 0, .6); --hi: rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1511; --bg-2: #101c16; --surface: #16231c; --surface-2: #1c2c23;
  --ink: #e2ece5; --muted: #9db1a4; --line: #2b3d33;
  --accent: #5fc493; --accent-ink: #08130d; --accent-soft: #1d3a2c;
  --gold: #e2b65a; --gold-soft: #3a2f17;
  --debit: #7cc0e8; --debit-soft: #16303f; --credit: #f0ad73; --credit-soft: #3a2817;
  --ok: #6fd69a; --ok-soft: #173826; --bad: #f08a7c; --bad-soft: #3d1c18;
  --edge: #050a07; --shadow: rgba(0, 0, 0, .6); --hi: rgba(255, 255, 255, .06);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 var(--f-body);
  min-height: 100%;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
[hidden] { display: none !important; }
code { font-family: var(--f-mono); font-size: .78em; color: var(--muted); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.55rem); font-weight: 800; font-stretch: 85%; line-height: 1.08; }
h2 { font-size: 1.22rem; font-weight: 750; font-stretch: 90%; }
h3 { font-size: 1.02rem; font-weight: 700; }
.eyebrow { margin: 0 0 6px; font: 600 .72rem/1 var(--f-display); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.lede { max-width: 68ch; color: var(--muted); margin: 10px 0 0; }
.muted { color: var(--muted); font-size: .88rem; max-width: 75ch; }
.center { text-align: center; }

/* ---------------- barra superior ---------------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px var(--shadow);
}
.topbar-inner, .tabs, .wrap, .footer-inner {
  max-width: 1400px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px 6px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font: 800 1.08rem/1.1 var(--f-display); font-stretch: 88%; }
.brand-text small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* cubo isométrico 3D */
.cube { width: 34px; height: 34px; position: relative; flex: none; transform-style: preserve-3d; transform: rotateX(-24deg) rotateY(38deg); margin: 2px 6px 0 2px; }
.cube i { position: absolute; inset: 0; border-radius: 4px; }
.cube i:nth-child(1) { background: var(--accent); transform: translateZ(17px); }
.cube i:nth-child(2) { background: color-mix(in srgb, var(--accent) 70%, #000); transform: rotateY(90deg) translateZ(17px); }
.cube i:nth-child(3) { background: var(--gold); transform: rotateX(90deg) translateZ(17px); }

.theme-btn { flex: none; width: 38px; height: 38px; border-radius: 11px; border: 0; cursor: pointer; color: var(--ink); background: var(--surface-2); box-shadow: 0 3px 0 var(--edge), 0 6px 12px -6px var(--shadow), inset 0 1px 0 var(--hi); transition: transform .12s, box-shadow .12s; }
.theme-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge), inset 0 1px 0 var(--hi); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-block: 6px 12px; scrollbar-width: thin; }
.tabs a {
  flex: none; text-decoration: none; color: var(--ink);
  font: 650 .82rem/1 var(--f-display); font-stretch: 95%;
  padding: 10px 14px 9px; border-radius: 10px;
  background: linear-gradient(var(--surface), var(--surface-2));
  box-shadow: 0 4px 0 var(--edge), 0 8px 14px -8px var(--shadow), inset 0 1px 0 var(--hi);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.tabs a:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--edge), 0 10px 16px -8px var(--shadow), inset 0 1px 0 var(--hi); }
.tabs a.active { background: var(--accent); color: var(--accent-ink); transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 55%, #000), inset 0 2px 6px rgba(0,0,0,.25); }

/* ---------------- layout ---------------- */
.wrap { padding-block: 26px 40px; }
.view { display: flex; flex-direction: column; gap: 20px; animation: rise .35s ease both; }
@keyframes rise { from { transform: translateY(8px); opacity: .6; } to { transform: none; opacity: 1; } }
.view-head { padding-block: 4px 2px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.two-col.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.journal { min-width: 380px; }
@media (max-width: 1060px) { .two-col, .two-col.wide-left { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .three-col { grid-template-columns: minmax(0, 1fr); } }

/* panel en relieve */
.panel {
  position: relative; min-width: 0;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: var(--r);
  padding: 20px;
  box-shadow:
    inset 0 1px 0 var(--hi),
    0 1px 0 var(--line),
    0 6px 0 -1px var(--edge),
    0 22px 34px -18px var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.panel-title { display: flex; align-items: baseline; gap: 8px; }
.panel-row { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; }
.panel.info h3 { color: var(--accent); }
.panel.info p { margin: 0; color: var(--muted); font-size: .9rem; }
.sub { margin-top: 6px; }

/* ---------------- KPIs ---------------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; perspective: 900px; }
.kpi {
  border-radius: 12px; padding: 14px 16px; min-width: 0;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  box-shadow: inset 0 1px 0 var(--hi), 0 5px 0 var(--edge), 0 16px 24px -14px var(--shadow);
  transform: rotateX(6deg); transform-origin: bottom; transition: transform .25s;
}
.kpi:hover { transform: rotateX(0) translateY(-2px); }
.kpi span { display: block; font: 600 .7rem/1.2 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; margin-top: 6px; font: 700 1.2rem/1.1 var(--f-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi.hero { background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #000)); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 0 color-mix(in srgb, var(--accent) 45%, #000), 0 18px 26px -12px var(--shadow); }
.kpi.hero span { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); }
@media (max-width: 1060px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi { transform: none; } .kpi.hero { grid-column: 1 / -1; } }

/* ---------------- mecánica ---------------- */
.mec-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1060px) { .mec-grid { grid-template-columns: minmax(0, 1fr); } }
.params { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 130px); max-height: calc(100vh - 150px); overflow: auto; }
@media (max-width: 1060px) { .params { position: static; max-height: none; } }
.pgroup { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.pgroup legend { margin-bottom: 8px; padding: 0; }
.tag { display: inline-block; font: 700 .7rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; }
.tag-v { background: var(--debit-soft); color: var(--debit); }
.tag-c { background: var(--credit-soft); color: var(--credit); }
.tag-t { background: var(--gold-soft); color: var(--gold); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field.grow { flex: 1 1 260px; }
.field.compact { flex: 0 1 260px; }
input, select {
  font: 500 .92rem var(--f-body); color: var(--ink); width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 11px; min-height: 40px;
  box-shadow: inset 0 2px 4px -1px var(--shadow);
}
input[inputmode="numeric"], input[type="number"] { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: inset 0 2px 4px -1px var(--shadow), 0 0 0 3px var(--accent-soft); }
.readout { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 11px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: .8rem; }
.readout b { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.param-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { margin: 0; font-size: .78rem; color: var(--muted); }
.inline-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.inline-fields .field { flex: 1 1 150px; }

.btn {
  font: 700 .82rem/1 var(--f-display); cursor: pointer; border: 0; border-radius: 10px;
  padding: 11px 14px; color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 50%, #000), 0 10px 16px -10px var(--shadow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent, inset 0 2px 5px rgba(0,0,0,.3); }
.btn-ghost { background: var(--surface-2); color: var(--ink); box-shadow: 0 4px 0 var(--edge), 0 10px 16px -10px var(--shadow), inset 0 1px 0 var(--hi); }

.ledgers { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ledger-card { border-top: 5px solid var(--debit); }
.ledger-card.side-c { border-top-color: var(--credit); }
.ledger-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.balance { font: 700 .74rem/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; transform: rotate(-3deg); box-shadow: 0 3px 0 var(--edge); }
.balance.ok { background: var(--ok-soft); color: var(--ok); }
.balance.bad { background: var(--bad-soft); color: var(--bad); }

/* libro contable */
.ledger { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ledger h3 { font-size: .9rem; color: var(--muted); font-stretch: 95%; }
.ledger .scroll-x { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line), 0 10px 18px -16px var(--shadow); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
.journal th, .journal td { padding: 8px 10px; text-align: left; font-size: .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.journal thead th { font: 700 .68rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.journal .acc { font-family: var(--f-mono); white-space: nowrap; }
.journal .acc small { display: block; color: var(--muted); font-size: .7rem; }
.journal .num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal td.d { color: var(--debit); }
.journal td.c { color: var(--credit); }
.journal tr.off td { opacity: .38; }
.journal tr.off td.name { font-style: italic; }
.journal tr.on { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.journal tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.journal .err { color: var(--bad); font-weight: 700; }
.fx { border: 0; cursor: pointer; width: 28px; height: 26px; border-radius: 7px; font: italic 700 .82rem var(--f-mono); color: var(--gold); background: var(--gold-soft); box-shadow: 0 2px 0 var(--edge); }
.fx:active { transform: translateY(2px); box-shadow: none; }
.fx-ico { font-style: italic; color: var(--gold); }
.utility, .cuotas, .letras { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: .88rem; }
.utility b, .cuotas b { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.letras b { font-family: var(--f-display); font-weight: 600; font-stretch: 92%; }

/* popover de fórmulas */
.fx-pop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(3px); padding: max(16px, env(safe-area-inset-left, 0px)); }
.fx-card { width: min(760px, 100%); max-height: 82vh; overflow: auto; background: var(--surface); border-radius: var(--r); padding: 18px 20px 20px; box-shadow: 0 6px 0 var(--edge), 0 40px 60px -20px var(--shadow); }
.fx-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.fx-card .x { border: 0; background: var(--surface-2); color: var(--ink); width: 34px; height: 34px; border-radius: 9px; font-size: 1.3rem; cursor: pointer; box-shadow: 0 3px 0 var(--edge); }
.fx-card pre { white-space: pre-wrap; word-break: break-word; font: .78rem/1.5 var(--f-mono); background: var(--surface-2); padding: 12px; border-radius: 10px; margin: 6px 0 14px; color: var(--ink); }
.fx-card .why { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .88rem; margin-bottom: 12px; }

/* ---------------- matrices ---------------- */
.matrix { min-width: 760px; border-collapse: separate; border-spacing: 6px; }
.matrix th { font: 700 .72rem/1.2 var(--f-display); text-align: left; color: var(--muted); padding: 6px; vertical-align: bottom; }
.matrix th.row { text-align: right; vertical-align: middle; max-width: 160px; }
.matrix th.corner { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.matrix td { padding: 0; vertical-align: top; }
.cellbtn {
  width: 100%; min-height: 96px; text-align: left; cursor: pointer; border: 0; border-radius: 11px; padding: 9px; color: var(--ink);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  box-shadow: inset 0 1px 0 var(--hi), 0 4px 0 var(--edge), 0 10px 16px -12px var(--shadow);
  display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s;
}
.cellbtn:hover { transform: translateY(-2px) rotateX(4deg); }
.cellbtn.current { outline: 3px solid var(--gold); }
.cellbtn .side { font: 700 .6rem/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font: 600 .66rem/1 var(--f-body); padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.chip.iva { background: var(--debit-soft); color: var(--debit); }
.chip.ret { background: var(--credit-soft); color: var(--credit); }
.chip.ica { background: var(--gold-soft); color: var(--gold); }
.chip.auto { background: var(--accent-soft); color: var(--accent); }
.chip.none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip.warn { background: var(--bad-soft); color: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); }
.matrix.ref { min-width: 640px; }
.matrix.ref td { background: var(--surface); border-radius: 9px; padding: 8px; box-shadow: inset 0 0 0 1px var(--line); font-size: .78rem; }
.matrix.ref td.nr { color: var(--muted); }
.matrix.ref td.y { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.matrix.ref td.a { background: var(--gold-soft); color: var(--gold); font-weight: 700; }

.note { padding: 14px 16px; border-radius: 12px; background: var(--gold-soft); color: var(--ink); font-size: .9rem; box-shadow: 0 4px 0 var(--edge); }

/* tablas de datos */
.scroll-x { overflow-x: auto; max-width: 100%; }
.data th, .data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .85rem; vertical-align: top; }
.data thead th { position: sticky; top: 0; background: var(--surface-2); font: 700 .68rem/1.2 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.data .num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .mono { font-family: var(--f-mono); white-space: nowrap; }
.data tr.hl td { background: var(--accent-soft); }

/* ---------------- barras 3D ---------------- */
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 4px 10px; align-items: center; }
.hbar .lbl { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); line-height: 1.25; }
.hbar .track { height: 16px; position: relative; margin-top: 6px; margin-right: 6px; }
.hbar .fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--w);
  background: linear-gradient(180deg, var(--bar), color-mix(in srgb, var(--bar) 78%, #000));
  border-radius: 2px 0 0 2px; transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.hbar .fill::before { content: ""; position: absolute; left: 3px; right: -6px; top: -6px; height: 6px; background: color-mix(in srgb, var(--bar) 70%, #fff); transform: skewX(-45deg); transform-origin: bottom left; }
.hbar .fill::after { content: ""; position: absolute; top: -3px; right: -6px; width: 6px; height: 100%; background: color-mix(in srgb, var(--bar) 55%, #000); transform: skewY(-45deg); transform-origin: top left; }
.hbar .val { font: 700 .8rem var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.hbar.sel .lbl { color: var(--ink); font-weight: 700; }
.hgroup { font: 700 .7rem/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-top: 8px; }

.vbars { display: flex; align-items: end; gap: 8px; height: 220px; padding: 18px 8px 0; overflow-x: auto; border-bottom: 2px solid var(--line); }
.vbar { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; gap: 6px; }
.vbar .col { width: 70%; height: var(--h); position: relative; background: linear-gradient(90deg, var(--bar), color-mix(in srgb, var(--bar) 75%, #000)); transition: height .5s; }
.vbar .col::before { content: ""; position: absolute; left: 0; right: -8px; top: -8px; height: 8px; background: color-mix(in srgb, var(--bar) 65%, #fff); transform: skewX(-45deg); transform-origin: bottom left; }
.vbar .col::after { content: ""; position: absolute; right: -8px; top: -4px; width: 8px; height: 100%; background: color-mix(in srgb, var(--bar) 50%, #000); transform: skewY(-45deg); transform-origin: top left; }
.vbar small { font: .66rem var(--f-mono); color: var(--muted); }
.vbar .v { font: 600 .6rem var(--f-mono); color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }

/* bandas de resultado */
.result-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.result-band div { padding: 10px 12px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 3px 0 var(--edge); }
.result-band span { display: block; font-size: .72rem; color: var(--muted); }
.result-band b { font: 700 1rem var(--f-mono); font-variant-numeric: tabular-nums; }
.result-band .big { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 50%, #000); }
.result-band .big span { color: inherit; opacity: .85; }
.calc-steps { display: grid; gap: 6px; }
.calc-steps div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: .88rem; }
.calc-steps b { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.calc-steps .tot { background: var(--accent-soft); font-weight: 700; }

/* cuenta T */
.taccount { display: grid; grid-template-columns: 1fr 1fr; border-top: 3px solid var(--ink); margin-top: 6px; }
.taccount > div { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.taccount > div:first-child { border-right: 3px solid var(--ink); }
.taccount .h { font: 700 .72rem/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.taccount .n { font: 700 1rem var(--f-mono); }
.t-title { text-align: center; font: 800 1rem var(--f-display); }

/* tarjetas de impuestos */
.tax-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 20px; }

/* exoneración */
.exo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .exo-grid { grid-template-columns: minmax(0, 1fr); } }
.exo { background: var(--surface); border-radius: 12px; padding: 14px; display: grid; gap: 10px; box-shadow: inset 0 0 0 1px var(--line), 0 4px 0 var(--edge); }
.exo-row { display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px; font-size: .85rem; }
.exo-row span { color: var(--muted); }
.exo-row.ok { background: var(--ok-soft); }
.exo-row.no { background: var(--bad-soft); }

.checks { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; font-size: .88rem; }
.checks li { display: flex; gap: 8px; }
.checks li::before { content: "✓"; color: var(--ok); font-weight: 800; }

/* factura */
.receipt { font: .8rem/1.5 var(--f-mono); background: var(--surface); color: var(--ink); max-width: 360px; margin: 0 auto; padding: 18px; border-radius: 4px; box-shadow: 0 1px 0 var(--line), 0 14px 26px -10px var(--shadow); transform: rotate(-1.2deg); }
.receipt .c { text-align: center; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; }
.receipt hr { border: 0; border-top: 1px dashed var(--muted); margin: 8px 0; }

/* PUC */
.puc-tools { display: flex; flex-wrap: wrap; gap: 12px; }
.class-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.class-chips button { cursor: pointer; border: 0; border-radius: 9px; padding: 8px 10px; font: 650 .78rem var(--f-display); color: var(--ink); background: var(--surface); box-shadow: 0 3px 0 var(--edge), inset 0 1px 0 var(--hi); }
.class-chips button.on { background: var(--accent); color: var(--accent-ink); transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.puc-scroll { max-height: 70vh; overflow: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.puc td.lv1 { font-weight: 800; font-family: var(--f-display); }
.puc td.lv2 { font-weight: 700; padding-left: 18px; }
.puc td.lv3 { font-weight: 600; padding-left: 30px; }
.puc td.lv4 { padding-left: 42px; }
.puc td.lv5 { padding-left: 54px; color: var(--muted); }
.lvl { display: inline-block; font: 600 .66rem/1 var(--f-display); padding: 4px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.lvl.l1 { background: var(--accent); color: var(--accent-ink); }
.lvl.l2 { background: var(--accent-soft); color: var(--accent); }
.lvl.l3 { background: var(--gold-soft); color: var(--gold); }
mark { background: var(--gold-soft); color: inherit; border-radius: 3px; }

/* ---------------- footer ---------------- */
.site-footer { margin-top: 20px; background: var(--surface); box-shadow: 0 -1px 0 var(--line), 0 -14px 30px -24px var(--shadow); }
.footer-inner { padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--muted); font-size: .9rem; }
.footer-inner p { margin: 4px 0; }
.footer-inner strong { color: var(--ink); }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); text-decoration: underline; }
.f-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.f-item svg { color: var(--bad); }
.f-item + .f-item svg, .f-item:last-child svg { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kpi { transform: none; }
}
