/* Demo platform stylesheet (O4a.2 redesign). Mobile first.
   Brand colours come from /e/<slug>/marca.css (--brand-*); everything else is the platform's own palette.
   The one bold element: the highlighter mark laid over the document page (.mark), echoed on the value chosen.
   Type: Atkinson Hyperlegible Next for the interface; its Mono for plates, VINs, references and amounts —
   both drawn so 0/O, 1/I/l and 8/B cannot be confused, which is what checking a document is about.
   Fonts are served from here (OFL, see fuentes/LICENCIA-OFL.txt): no CDN, and the CSP allows nothing else. */

@font-face { font-family: "Atkinson Next"; src: url("fuentes/atkinson-next.woff2") format("woff2");
             font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Mono"; src: url("fuentes/atkinson-mono.woff2") format("woff2");
             font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --brand-primary: #1f3a5f;
  --brand-on-primary: #ffffff;
  --brand-accent: #2e7d6b;
  --brand-on-accent: #ffffff;

  --paper: #eef1f0;   /* the desk */
  --sheet: #ffffff;   /* what sits on it */
  --ink: #16232d;
  --quiet: #566770;
  --rule: #d3dbd9;
  --rule-soft: #e6ebea;
  --marker: #ffd84a;  /* highlighter */
  --marker-soft: #fff4bf;

  --verde: #17713b; --verde-bg: #e3f3e8; --verde-line: #9fd2b0;
  --ambar: #8f5200; --ambar-bg: #fff1d6; --ambar-line: #f0c777;
  --rojo: #ad2318;  --rojo-bg: #fde9e7;  --rojo-line: #f2b3ac;
  --danger: var(--rojo);
  --warn: var(--ambar);

  --font-ui: "Atkinson Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Atkinson Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* 1.25 scale */
  --t-xs: .8rem; --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.5625rem; --t-2xl: 1.953rem; --t-3xl: 2.441rem;
  --radius: 10px;
  --radius-sm: 6px;
  --space: 16px;
  --rail-w: 232px;

  font-family: var(--font-ui);
  font-size: 100%;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.005em; }
h1 { font-size: var(--t-xl); margin: 0 0 var(--space); font-weight: 750; }
h2 { font-size: var(--t-lg); margin: 0 0 12px; font-weight: 700; }
h3 { font-size: var(--t-md); margin: 20px 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--brand-primary); text-underline-offset: .18em; }
code, pre, .ref, .num { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.ref { letter-spacing: .02em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--sheet);
        color: var(--ink); border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- shell: a top bar on phones, a rail on wide screens --------------------------------------- */
.rail { background: var(--brand-primary); color: var(--brand-on-primary); }
.rail__brand { display: flex; align-items: center; gap: 10px; padding: 12px var(--space); font-weight: 700; min-height: 56px; }
.rail__logo { height: 34px; width: auto; max-width: 180px; background: #fff; border-radius: var(--radius-sm); padding: 3px 6px; }
/* A logo drawn for dark backgrounds sits straight on the rail, without the white plate. */
.rail__logo--oscuro { height: 40px; max-width: 196px; background: none; padding: 0; border-radius: 0; }
/* The accent is chosen for light backgrounds; on the rail the focus ring takes the rail's text colour. */
.rail :focus-visible { outline-color: var(--brand-on-primary); }
.rail__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; flex: none;
              background: var(--brand-accent); color: var(--brand-on-accent); font-size: var(--t-lg); font-weight: 800; }
.rail__name { font-size: var(--t-md); }
.rail__nav { display: flex; gap: 2px; overflow-x: auto; padding: 0 8px 8px; scrollbar-width: none; }
.rail__nav::-webkit-scrollbar { display: none; }
.rail__group { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.rail__nav a { display: block; white-space: nowrap; padding: 8px 12px; border-radius: 8px; color: var(--brand-on-primary);
               text-decoration: none; font-size: var(--t-sm); opacity: .86; }
.rail__nav a:hover { opacity: 1; background: color-mix(in srgb, var(--brand-on-primary) 12%, transparent); }
.rail__nav a[aria-current="page"] { opacity: 1; font-weight: 700;
                                    background: color-mix(in srgb, var(--brand-on-primary) 18%, transparent); }
.rail__user { display: none; }
.rail__exit { color: var(--brand-on-primary); }

.main { width: 100%; max-width: 1240px; margin: 0 auto; padding: var(--space); }
.public .main { max-width: 480px; padding-top: 4vh; }
.public .rail { background: transparent; color: var(--ink); }
.public .rail__brand { justify-content: center; padding-top: 6vh; }

@media (min-width: 1000px) {
  /* The rail's colour runs the full height of the page, also below the sticky rail itself. */
  .app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr);
         background: linear-gradient(to right, var(--brand-primary) var(--rail-w), var(--paper) var(--rail-w)); }
  .app .rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 8px 0 12px; }
  .app .rail__brand { padding: 14px 18px 18px; }
  .app .rail__nav { flex-direction: column; overflow: visible; padding: 0 10px; gap: 14px; flex: 1; }
  .app .rail__group { flex-direction: column; }
  .app .rail__group--admin { border-top: 1px solid color-mix(in srgb, var(--brand-on-primary) 20%, transparent); padding-top: 12px; }
  .app .rail__nav a { font-size: var(--t-md); padding: 9px 12px; }
  .app .rail__user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px 0;
                     border-top: 1px solid color-mix(in srgb, var(--brand-on-primary) 20%, transparent); }
  .rail__who { display: grid; font-size: var(--t-sm); font-weight: 600; }
  .rail__who small { font-weight: 400; opacity: .8; }
  .main { padding: 28px 32px 48px; }
}
/* On phones the bar scrolls away with the page (a fixed one would take a third of the screen and hide
   the document when a crop sends you to it); the user and the exit button sit under the nav strip. */
@media (max-width: 999px) {
  .app .rail__user { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space) 10px;
                     font-size: var(--t-sm); }
  .rail__who small { display: none; }
}

/* ---- building blocks ---------------------------------------------------------------------------- */
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius);
        padding: 18px; margin-bottom: var(--space); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card--narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.lead { color: var(--quiet); font-size: var(--t-md); max-width: 62ch; margin: 0; flex-basis: 100%; }
.headrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.headrow h1 { margin: 0; }
.muted { color: var(--quiet); font-size: var(--t-sm); }
.empty { color: var(--quiet); }
.empty--big { background: var(--sheet); border: 1px dashed var(--rule); border-radius: var(--radius); padding: 28px 20px;
              font-size: var(--t-md); text-align: center; }
.placeholder { border: 2px dashed var(--rule); border-radius: var(--radius); padding: var(--space); color: var(--quiet); }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: var(--t-sm); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  font: inherit; font-size: var(--t-md); font-weight: 400; color: var(--ink); background: var(--sheet);
  padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; width: 100%; min-height: 44px; }
input:hover, select:hover, textarea:hover { border-color: #b6c2bf; }
input[type=color] { width: 64px; height: 40px; border: 1px solid var(--rule); border-radius: 8px; padding: 2px; }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.form--inline label { flex: 1 1 220px; display: grid; gap: 6px; font-weight: 600; font-size: var(--t-sm); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700;
          cursor: pointer; text-decoration: none; padding: 10px 18px; min-height: 44px; border: 0; border-radius: 8px;
          background: var(--brand-accent); color: var(--brand-on-accent); }
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.button--ghost { background: transparent; color: var(--brand-primary); border: 1px solid var(--rule); font-weight: 600;
                 padding: 8px 14px; min-height: 40px; }
.button--ghost:hover { background: var(--rule-soft); filter: none; }
.button--ok { background: var(--verde); color: #fff; font-size: var(--t-md); padding: 12px 22px; min-height: 48px; }
.button--danger { background: var(--rojo); color: #fff; }
.danger-link { color: var(--rojo); font-size: var(--t-sm); }
.card--danger { border-top: 4px solid var(--rojo); }
.card--danger .form { margin-top: var(--space); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; }
.alert--error { background: var(--rojo-bg); color: var(--rojo); border-color: var(--rojo-line); }
.alert--warn { background: var(--ambar-bg); color: var(--ambar); border-color: var(--ambar-line); }
.alert--ok { background: var(--verde-bg); color: var(--verde); border-color: var(--verde-line); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 700; padding: 3px 10px;
         border-radius: 999px; white-space: nowrap; }
.badge--verde { background: var(--verde-bg); color: var(--verde); }
.badge--ambar { background: var(--ambar-bg); color: var(--ambar); }
.badge--rojo { background: var(--rojo-bg); color: var(--rojo); }
.counts { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.tag { display: inline-block; font-size: var(--t-xs); padding: 1px 8px; border-radius: 999px; background: var(--rule-soft);
       color: var(--quiet); vertical-align: 1px; }
.tag--off { background: var(--rojo-bg); color: var(--rojo); }
.tag--warn, .tag--doubt { background: var(--ambar-bg); color: var(--ambar); }
.tag--regla, .tag--heredado { background: #e6ecfb; color: #2a438c; }
.tag--corregido { background: #f1e6fa; color: #6a2a8e; }
.tag--elegido { background: var(--verde-bg); color: var(--verde); }
.tag--leido { background: var(--rule-soft); color: var(--quiet); }

.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center;
              padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.list__item:last-child { border-bottom: 0; }
.more { margin-top: 12px; }
.more > summary { cursor: pointer; padding: 8px 0; color: var(--brand-primary); font-weight: 600; }
details.card > summary h2 { display: inline; }

/* The headline identifier (a plate, a policy number…): neutral here; packages may restyle it. */
.headline { font-family: var(--font-mono); font-weight: 700; letter-spacing: .04em; }
.headline--big { font-size: var(--t-xl); }

/* ---- home panel --------------------------------------------------------------------------------- */
.saved { padding: 4px 0 20px; }
.saved__title { font-size: var(--t-xl); font-weight: 600; margin: 14px 0 8px; max-width: 30ch; }
.saved__n { display: block; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 800;
            font-size: var(--t-3xl); letter-spacing: -.02em; line-height: 1.05; width: fit-content; padding: 0 .08em;
            background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%); }
.saved__when { color: var(--quiet); font-weight: 400; }
.saved__how { color: var(--quiet); max-width: 64ch; font-size: var(--t-sm); }
.segmented { display: inline-flex; background: var(--sheet); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.segmented a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--quiet); font-size: var(--t-sm); font-weight: 600; }
.segmented a[aria-current="true"] { background: var(--ink); color: #fff; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 var(--space);
         background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.stat { padding: 14px 16px; border-top: 1px solid var(--rule-soft); }
.stat:nth-child(-n+2) { border-top: 0; }
.stat:nth-child(even) { border-left: 1px solid var(--rule-soft); }
.stat dt { font-size: var(--t-sm); color: var(--quiet); }
.stat dd { margin: 0; }
.stat .num { font-size: var(--t-xl); font-weight: 700; }
.stat__note { font-size: var(--t-xs); color: var(--quiet); }
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat, .stat:nth-child(-n+2) { border-top: 0; }
  .stat + .stat { border-left: 1px solid var(--rule-soft); }
}
.split { display: grid; gap: var(--space); margin-bottom: var(--space); }
.split > .card { margin-bottom: 0; }
@media (min-width: 900px) { .split { grid-template-columns: 1.15fr 1fr; } }

.mix { display: block; width: 100%; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 12px; background: var(--rule-soft); }
.mix--rojo { fill: var(--rojo); }
.mix--ambar { fill: #d48a12; }
.mix--verde { fill: var(--verde); }
.legend { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; font-size: var(--t-sm); }
.legend li { display: flex; gap: 8px; align-items: baseline; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; transform: translateY(1px); }
.legend--rojo::before { background: var(--rojo); }
.legend--ambar::before { background: #d48a12; }
.legend--verde::before { background: var(--verde); }
.legend .num { font-weight: 700; min-width: 2ch; text-align: right; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 10px 0;
       border-bottom: 1px solid var(--rule-soft); }
.row:last-child { border-bottom: 0; }
.row__link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-height: 44px; }
.row__what { display: grid; font-size: var(--t-sm); }
.row__what small { color: var(--quiet); }
.row__aside { display: flex; align-items: center; gap: 10px; }

/* ---- the agent at work (panel, inbox, case) ---------------------------------------------------- */
.working { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.working__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 12px;
                 border-radius: 8px; background: var(--paper); font-size: var(--t-sm); }
.working__step { display: flex; align-items: center; gap: 8px; }
.working__step::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-accent);
                         animation: pulse 1.4s ease-in-out infinite; }
.working__item[data-paso="listo"] .working__step::before { animation: none; background: var(--verde); }
.working__item[data-paso="revision"] .working__step::before { animation: none; background: var(--rojo); }
.working__time { color: var(--quiet); font-family: var(--font-mono); }
@keyframes pulse { 50% { opacity: .25; } }
.live { background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--brand-accent);
        border-radius: var(--radius); padding: 12px 14px; margin-bottom: var(--space); }
.live__title { font-size: var(--t-md); margin-bottom: 8px; }

.progress { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 20px;
            max-width: 640px; margin: 4vh auto; }
.progress__ref { color: var(--quiet); margin-bottom: 4px; }
.steps { list-style: none; margin: 22px 0; padding: 0; display: grid; }
.step { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--quiet); }
.step:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 32px; bottom: -10px; width: 2px; background: var(--rule); }
.step__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rule); background: var(--sheet); flex: none; }
.step--hecho { color: var(--ink); }
.step--hecho .step__dot { background: var(--verde); border-color: var(--verde); }
.step--hecho:not(:last-child)::after { background: var(--verde); }
.step--ahora { color: var(--ink); font-weight: 700; }
.step--ahora .step__dot { border-color: var(--brand-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-accent) 22%, transparent);
                          animation: pulse 1.4s ease-in-out infinite; }
.progress__clock { font-size: var(--t-md); }

/* ---- inbox ---------------------------------------------------------------------------------------- */
.lane { margin-bottom: 26px; }
.lane > h2, .lane__head h2 { display: flex; align-items: center; gap: 10px; font-size: var(--t-lg); margin: 0 0 10px; }
.lane__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lane__n { font-size: var(--t-sm); background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 9px; }
.cases { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.case { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 14px; align-items: center;
        background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px 12px 18px; }
.case::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 0 4px 4px 0; background: var(--rule); }
.case--verde::before { background: var(--verde); }
.case--ambar::before { background: #d48a12; }
.case--rojo::before { background: var(--rojo); }
.case:hover { border-color: #b9c5c2; }
.case__pick { display: flex; align-items: center; min-height: 44px; }
.case__pick input { width: 22px; height: 22px; accent-color: var(--verde); }
.case:has(.case__pick) { grid-template-columns: auto minmax(0, 1fr); }
.case__link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; text-decoration: none; color: var(--ink); min-height: 44px; }
.case__link:hover .case__what { text-decoration: underline; }
.case__what { display: grid; font-weight: 600; font-size: var(--t-md); }
.case__what small { font-weight: 400; color: var(--quiet); font-size: var(--t-sm); }
.case__metric { display: none; }
.case__aside { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; grid-column: 1 / -1; }
.case:has(.case__pick) .case__aside { grid-column: 2 / -1; }
.case__aside small { color: var(--quiet); font-size: var(--t-xs); }
.case .reasons, .case__note { grid-column: 1 / -1; margin: 0; }
.case__note { color: var(--quiet); font-size: var(--t-sm); }
@media (min-width: 760px) {
  .case { grid-template-columns: minmax(0, 1fr) 9rem 12rem; }
  .case:has(.case__pick) { grid-template-columns: auto minmax(0, 1fr) 9rem 12rem; }
  .case__metric { display: grid; justify-items: end; }
  .case__aside, .case:has(.case__pick) .case__aside { grid-column: auto; display: grid; justify-items: end; gap: 2px; text-align: right; }
  .case__metric small { color: var(--quiet); font-size: var(--t-xs); }
}
.reasons { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--t-sm); }
.reason { display: flex; gap: 8px; }
.reason::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-top: .5em; flex: none; background: currentColor; }
.reason--rojo { color: var(--rojo); }
.reason--ambar { color: var(--ambar); }

/* ---- case page ------------------------------------------------------------------------------------ */
.case-layout { display: grid; }
.case-layout > * { min-width: 0; }
.case-head { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius);
             padding: 18px 18px 16px 22px; margin-bottom: var(--space); }
.case-head::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 6px; border-radius: 0 4px 4px 0; background: var(--rule); }
.case-head.case--verde::before { background: var(--verde); }
.case-head.case--ambar::before { background: #d48a12; }
.case-head.case--rojo::before { background: var(--rojo); }
.case-head__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.case-head__title { font-size: var(--t-lg); margin: 12px 0 10px; }
.case-head__ok { color: var(--verde); font-size: var(--t-sm); margin: 10px 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: var(--t-sm); }
.meta dt { color: var(--quiet); font-size: var(--t-xs); }
.meta dd { margin: 0; font-weight: 600; }
.metric { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.metric__label { color: var(--quiet); font-size: var(--t-sm); margin-right: 4px; }
.metric__old { color: var(--quiet); }
.metric__new { font-size: var(--t-lg); font-weight: 800; }
.metric__delta { font-size: var(--t-sm); font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--rule-soft); }

.compare { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
.compare th { font-size: var(--t-xs); color: var(--quiet); font-weight: 600; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.compare td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.compare__label { color: var(--quiet); font-size: var(--t-sm); width: 24%; }
.compare__out { color: var(--quiet); width: 30%; }
.row--rule td, .facts .row--rule { background: #f6f8fd; }
.row--metric td { font-weight: 700; border-top: 2px solid var(--rule); border-bottom: 0; }
.value { overflow-wrap: anywhere; }
.value--doubt { background: var(--ambar-bg); padding: 0 4px; border-radius: 4px; }
.legend-origins { color: var(--quiet); font-size: var(--t-sm); margin-top: 12px; }
@media (max-width: 719px) {
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare tbody, .compare tr { display: block; }
  .compare tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
  .compare td { border: 0; padding: 0; width: auto; }
  .compare__label { grid-column: 1 / -1; font-size: var(--t-xs); font-weight: 700; margin-bottom: 2px; }
  .compare__out::before { content: "Sale "; font-size: var(--t-xs); color: var(--quiet); }
  .compare__in::before { content: "Entra "; font-size: var(--t-xs); color: var(--quiet); }
}

/* A value's crop: a link that marks the value on the page beside it. */
.crop-link { display: block; width: fit-content; max-width: 100%; margin-top: 6px; border-radius: 6px; outline-offset: 1px; }
.crop { display: block; max-width: 100%; max-height: 60px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.crop-link:hover .crop { border-color: var(--ink); }
.crop-link.is-marked .crop { border-color: #c79c00; box-shadow: 0 0 0 3px var(--marker); }
.crop-note { display: block; font-size: var(--t-xs); color: var(--quiet); max-width: 36ch; }
.evidence { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--rule); display: grid; gap: 8px; font-size: var(--t-sm); }
.evidence__label { color: var(--quiet); }
.evidence__label::after { content: ":"; }
.evidence__ref { font-family: var(--font-mono); font-size: var(--t-xs); background: var(--rule-soft); padding: 1px 6px; border-radius: 4px; }
.evidence .crop { max-height: 44px; }

/* The document viewer and the highlighter. */
.viewer { margin-bottom: var(--space); }
.viewer__tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.viewer__tabs a { padding: 6px 12px; border-radius: 999px; font-size: var(--t-sm); text-decoration: none; color: var(--quiet);
                  background: var(--sheet); border: 1px solid var(--rule); }
.viewer__tabs a::first-letter { text-transform: uppercase; }
.viewer__tabs a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sheet { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; }
.sheet__page { position: relative; line-height: 0; border-radius: 4px; overflow: hidden; background: #f7f7f5;
               box-shadow: 0 1px 0 var(--rule), 0 8px 24px -16px rgba(22, 35, 45, .5); }
.sheet__img { display: block; width: 100%; height: auto; }
.sheet__marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mark { fill: var(--marker); fill-opacity: .45; stroke: #c79c00; stroke-width: 3; vector-effect: non-scaling-stroke;
        mix-blend-mode: multiply; transition: x .25s ease, y .25s ease, width .25s ease, height .25s ease; }
.mark--off { display: none; }
.sheet__caption { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: space-between;
                  padding: 10px 2px 0; font-size: var(--t-sm); }
.sheet__approx { color: var(--ambar); }

@media (min-width: 1100px) {
  .case-layout--doc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; grid-auto-flow: row dense; }
  .case-layout--doc > * { grid-column: 1; }
  .case-layout--doc > .viewer { grid-column: 2; grid-row: 1 / span 40; align-self: start; position: sticky; top: 16px; }
  .case-layout--doc .sheet__page { max-height: calc(100vh - 150px); overflow: auto; }
}

.options { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.options form { margin: 0; }
.option { display: grid; gap: 2px; width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 12px 14px;
          border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); min-height: 44px; color: var(--ink); }
.option:hover { border-color: var(--brand-accent); }
.option span { color: var(--quiet); font-size: var(--t-sm); }
.actions-card .form { margin-bottom: 14px; }
.ok-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.confirm { background: var(--marker-soft); border: 1px solid #f0d77a; padding: 12px; border-radius: 8px; }
.draft, textarea.code { width: 100%; font: var(--t-sm)/1.45 var(--font-mono); padding: 10px; border: 1px solid var(--rule);
                        border-radius: 8px; background: #fafbfa; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; margin: 0; }
.facts div { padding: 8px 10px; border-radius: 6px; }
.facts dt { font-size: var(--t-xs); color: var(--quiet); }
.facts dd { margin: 0; }
.history { margin: 0; padding-left: 20px; font-size: var(--t-sm); display: grid; gap: 4px; }
pre.code { white-space: pre-wrap; word-break: break-word; font-size: var(--t-sm); background: #fafbfa; padding: 12px;
           border: 1px solid var(--rule); border-radius: 8px; max-height: 520px; overflow: auto; }
.docs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.docs a { display: inline-block; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; font-size: var(--t-sm); }

/* ---- new request ----------------------------------------------------------------------------------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space); align-items: start; }
.intake > .card { margin: 0; min-width: 0; }
@media (min-width: 900px) { .intake { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dropzone { position: relative; display: grid; gap: 4px; place-items: center; text-align: center; padding: 30px 16px;
            border: 2px dashed color-mix(in srgb, var(--brand-accent) 60%, var(--rule)); border-radius: var(--radius);
            background: color-mix(in srgb, var(--brand-accent) 5%, var(--sheet)); cursor: pointer; font-weight: 400; }
.dropzone:hover, .dropzone:focus-within, .dropzone.is-over { background: color-mix(in srgb, var(--brand-accent) 11%, var(--sheet));
                                                              border-style: solid; }
.dropzone__title { font-weight: 700; font-size: var(--t-md); }
.dropzone input[type=file] { max-width: 100%; font-size: var(--t-sm); }
.dropzone__files { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink); }

/* ---- other pages (users, logs, tracking, rules, brand) --------------------------------------------- */
.qr svg { width: 220px; height: 220px; display: block; margin: 8px 0; }
.secret { word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0; list-style: none; }
.codes code { display: block; padding: 6px; background: var(--rule-soft); border-radius: 6px; text-align: center; }
.link-box { padding: 10px; background: var(--rule-soft); border-radius: 8px; word-break: break-all; font-family: var(--font-mono); font-size: var(--t-sm); }
.swatches { display: flex; gap: 8px; margin-bottom: var(--space); }
.swatch { padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.swatch--primary { background: var(--brand-primary); color: var(--brand-on-primary); }
.swatch--accent { background: var(--brand-accent); color: var(--brand-on-accent); }
.logos { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 var(--space); }
.logos img { height: 56px; width: auto; max-width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
             border: 1px solid var(--rule); }
.logos__claro { background: var(--sheet); }
.logos__oscuro { background: var(--brand-primary); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; font-size: var(--t-xs); color: var(--quiet); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--rule-soft); white-space: nowrap; }
.row--denied td { color: var(--rojo); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.filters label { display: grid; gap: 6px; font-weight: 600; font-size: var(--t-sm); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--rule); border-radius: 8px; padding: 12px; display: grid; gap: 2px; color: var(--quiet); font-size: var(--t-sm); background: var(--sheet); }
.kpi__n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--t-xl); font-weight: 700; color: var(--ink); }
.inline-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.diff .add { background: var(--verde-bg); color: var(--verde); }
.diff .del { background: var(--rojo-bg); color: var(--rojo); }
@media (max-width: 719px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; background: var(--sheet); }
  .table td { border: 0; padding: 3px 0; white-space: normal; word-break: break-word; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--t-xs); color: var(--quiet); font-weight: 600; }
  .table td:empty { display: none; }
  .table--ops tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 6px 8px; }
  .table--ops td { padding: 1px 0; }
  .table--ops td[data-label]::before { display: inline; margin-right: 4px; }
  .table--ops td:nth-child(2), .table--ops td:nth-child(4), .table--ops td:nth-child(8) { display: none; }
}

@media (min-width: 720px) {
  h1 { font-size: var(--t-2xl); }
  .card { padding: 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
