:root {
  --bg: #f7f6f2; --fg: #1d1d1b; --muted: #5f5f5a; --card: #ffffff; --line: #e3e1da;
  --accent: #0b6e4f; --accent-fg: #ffffff; --danger: #b42318; --warn: #b54708; --ok: #067647;
  --field-bg: #ffffff; --field-line: #8a877d; --danger-bg: #b42318;
  --radius: 16px; --radius-sm: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5;
  /* Native controls (file pickers, checkboxes, selects, scrollbars) follow the scheme too. */
  color-scheme: light dark; accent-color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --fg: #ecebe6; --muted: #a8a79f; --card: #1f1f1d; --line: #34332f; --accent: #3fb68b; --accent-fg: #0b1510; --field-bg: #141413; --field-line: #6b6963;
    --warn: #f5a35c; --danger: #f97066; --ok: #47cd89; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); }
a { color: var(--accent); }
header.top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 750; font-size: 1.2rem; letter-spacing: -.01em; color: var(--fg); text-decoration: none; }
.logo-mark { flex: none; }
.logo-bg { fill: var(--accent); }
.logo-fg { fill: var(--accent-fg); }
.logo-check { stroke: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
nav a { color: var(--fg); text-decoration: none; }
main { max-width: 46rem; margin: 0 auto; padding: 1rem; }
footer { max-width: 46rem; margin: 2rem auto; padding: 0 1rem; color: var(--muted); font-size: .875rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 1rem 0; }
h1 { font-size: 1.6rem; font-weight: 760; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 .5rem; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.flash { background: var(--card); border-left: 4px solid var(--accent); padding: .5rem .75rem; }
.flash.warn { border-left-color: var(--warn); }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: var(--accent); color: var(--accent-fg); border: 0; border-radius: var(--radius-sm); padding: .65rem 1.15rem; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.danger { background: var(--danger-bg); color: #fff; }
button.link { background: none; color: var(--fg); padding: .25rem 0; min-height: 44px; font-weight: 400; text-decoration: underline; text-underline-offset: .2em; }
button.secondary, .button.secondary { border-color: var(--field-line); }
:where(a, button, .button, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:not(.link):not(.secondary):focus-visible, .button:not(.secondary):focus-visible { outline-color: var(--fg); }
.skip { position: absolute; left: -999px; top: .5rem; }
.skip:focus { left: 1rem; z-index: 10; background: var(--card); color: var(--fg); padding: .5rem .75rem; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.card { overflow-wrap: anywhere; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
/* Tables keep each word whole: a column is never narrower than its longest word ("Vence",
   "22/10/2026", a CURP), and a table wider than its card scrolls inside .table-wrap. Dates,
   badges and codes meant to be compared stay on one line. */
table { overflow-wrap: break-word; }
.badge, .nowrap, time[data-local="date"] { white-space: nowrap; }
.mono.nowrap { word-break: normal; }
summary { padding: .5rem 0; cursor: pointer; }
nav a { padding: .5rem .25rem; min-height: 44px; display: inline-flex; align-items: center; }
nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: .3em; }
nav button.link { color: var(--fg); padding: .5rem .25rem; }
nav .nav-sep { flex: none; width: 1px; height: 1.5rem; background: var(--line); }
/* Phones: the navigation folds into a "Menú" disclosure (a <details>, no script needed) that
   lists every section, the current one marked, and "Salir" as a full-width row. Wider
   screens show the same links in the header (.nav-wide); only one of the two is ever
   displayed, so assistive technology meets a single navigation. */
.nav-menu { display: none; position: relative; }
.nav-menu > summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem .85rem; list-style: none;
  border: 1px solid var(--field-line); border-radius: var(--radius-sm); font-weight: 600; color: var(--fg); }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary svg { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-menu[open] > summary { background: var(--card); border-color: var(--accent); }
.nav-menu nav { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
  width: min(17rem, calc(100vw - 1.5rem)); padding: .35rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgb(0 0 0 / .18); }
.nav-menu nav a { padding: .6rem .75rem; border-radius: 8px; }
.nav-menu nav a[aria-current="page"] { text-decoration: none; background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.nav-menu nav form.inline { display: block; }
.nav-menu nav button.link { width: 100%; justify-content: flex-start; padding: .6rem .75rem; text-decoration: none; border-radius: 8px; }
.nav-menu .nav-sep { width: auto; height: 1px; margin: .35rem .25rem; }
@media (max-width: 40rem) {
  header.top { flex-wrap: nowrap; gap: .5rem; padding: .25rem .75rem; }
  header.top.flow { flex-wrap: wrap; }
  header.top .nav-wide { display: none; }
  .nav-menu { display: block; }
  main { padding: .5rem .75rem 1rem; }
  .card { padding: 1rem; }
}
/* Approval: the code to compare first, then the amount, then a decision bar that stays in
   reach of the thumb. */
.code-check { text-align: center; border: 2px solid var(--accent); border-radius: 12px; padding: .75rem; margin-bottom: 1rem; }
.code-check p { margin: .25rem 0; }
.code-label { font-weight: 600; }
.code { font: 700 2rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: .12em; }
.amount { font-size: 1.6rem; font-weight: 700; margin: .5rem 0; }
.amount-label { display: block; font-size: .875rem; font-weight: 400; color: var(--muted); }
.decide { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.decide form { margin: 0; }
.decide button { width: 100%; min-height: 48px; font-size: 1.05rem; }
@media (max-width: 40rem) {
  .decide { position: sticky; bottom: 0; background: var(--card); padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
}
button:disabled { opacity: .6; cursor: progress; }
form.inline { display: inline; }
label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=file], input[type=password], textarea, select {
  width: 100%; min-height: 44px; padding: .6rem; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--field-bg); color: var(--fg); font: inherit; font-size: 1rem; }
input[type=file]::file-selector-button { margin-right: .75rem; padding: .45rem .8rem; border: 1px solid var(--field-line); border-radius: 8px; background: var(--card); color: var(--fg); font: inherit; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 1.375rem; height: 1.375rem; margin: 0; accent-color: var(--accent); }
input[aria-invalid="true"], select[aria-invalid="true"], input[aria-invalid="true"]:focus-visible { border-color: var(--danger); border-width: 2px; }
.field-error { color: var(--danger); margin: .35rem 0 0; font-size: .95rem; }
.hint { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
ul.claims { padding-left: 1.2rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; }
.badge.basic { border-color: var(--muted); }
.badge.verified { border-color: var(--accent); color: var(--accent); }
.badge.strong { background: var(--accent); color: var(--accent-fg); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions form { margin: 0; }
/* Phones: the decision buttons stack full width, primary first, with room between them. */
@media (max-width: 40rem) {
  .actions.stack { flex-direction: column; align-items: stretch; }
  .actions.stack > *, .actions.stack form > button { width: 100%; }
}
.small { font-size: .875rem; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 8px; }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: .9em; word-break: break-all; }
fieldset { border: 0; padding: 0; margin: .75rem 0; }
legend { font-weight: 600; margin-bottom: .25rem; }
label.choice { display: flex; gap: .75rem; align-items: flex-start; min-height: 44px; padding: .5rem 0; font-weight: 400; margin: .25rem 0; cursor: pointer; }
label.choice input { flex: none; margin-top: .1rem; }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Rows: a list of things with a title, details and an optional action (verifications,
   passkeys, a service's history). Readable at any width, no table to squeeze. */
.rows { list-style: none; margin: .25rem 0 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; padding-bottom: 0; }
.card > .rows:first-child > li:first-child { padding-top: 0; }
.rows > li > p { margin: 0; }
.rows form { margin: 0; }
.row-main { flex: 1 1 14rem; min-width: 0; }
.row-title { margin: 0; font-weight: 600; }
.row-meta { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.row-meta + .row-meta { margin-top: .35rem; }
ul.row-meta { padding-left: 1.1rem; }
/* Facts: short label–value pairs (CURP, level, expiry). */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .5rem 0 0; }
.facts > div { display: contents; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.identity-name { font-size: 1.3rem; }
/* Section pages (the navigation's destinations) put their h1 above the cards; a page inside
   a section links back to it above its h1. */
.back { margin: 0; }
.back a { display: inline-flex; align-items: center; min-height: 44px; }
button.compact, .button.compact { min-height: 44px; padding: .45rem .9rem; font-size: .95rem; }
/* Stacked tables: on phones each row becomes a small card of "label: value" lines (the
   label comes from the cell's data-label); wider screens keep the table. */
@media (max-width: 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  table.stack td { padding: .1rem 0; border: 0; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; content: attr(data-label) ": " / ""; color: var(--muted); }
  table.stack td:empty { display: none; }
}
.permission.paused { opacity: .8; border-style: dashed; }
.perm-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.perm-head p { margin: 0; }
.budget { margin: .6rem 0; }
.budget label { font-weight: 400; margin: 0 0 .25rem; }
.budget meter { width: 100%; height: 1rem; }
details.tighten { margin-top: .75rem; }
details.tighten summary { cursor: pointer; color: var(--accent); }
form.inline + form.inline { margin-left: .25rem; }
meter { appearance: none; background: var(--line); border: 0; border-radius: 999px; }
meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 999px; height: 1rem; }
meter::-webkit-meter-optimum-value { background: var(--accent); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: var(--warn); border-radius: 999px; }
meter::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--accent); border-radius: 999px; }
.warn-card { border-color: var(--warn); }
.actions.equal > * { flex: 1 1 12rem; }
.actions.equal button { width: 100%; }
/* Manual review (staff console): the capture's images side by side, mismatches flagged in
   words as well as colour. */
.review-kind { margin: 0 0 .25rem; font-size: 1rem; }
.review-kind .badge { font-size: .95rem; font-weight: 700; padding: .2rem .7rem; }
.reasons { margin: .25rem 0; padding-left: 1.2rem; }
.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin-top: .75rem; }
.evidence figure { margin: 0; }
.evidence a { display: block; }
.evidence img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.evidence figcaption { margin-top: .25rem; font-size: .875rem; color: var(--muted); }
table.compare tr.mismatch th, table.compare tr.mismatch td { border-bottom-color: var(--danger); }
table.compare tr.mismatch th { box-shadow: inset 4px 0 0 var(--danger); padding-left: .65rem; }
/* Task flows (enrollment, a service's sign-in, verification): the header names the task
   instead of offering exits, and a cue names the official site. */
header.top.flow { flex-wrap: wrap; row-gap: 0; }
.flow-label { margin: 0; color: var(--muted); font-size: .95rem; text-align: right; }
.trust { flex-basis: 100%; margin: 0 0 .25rem; display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .85rem; }
.trust svg { flex: none; fill: var(--ok); }
.trust strong { color: var(--fg); font-weight: 600; }
.kicker { margin: 0 0 .4rem; font-size: .8rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
/* Step indicator: <ol class="steps"> with aria-current="step" on the current step. */
.steps { display: flex; gap: .35rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.steps li { flex: 1; height: .3rem; border-radius: 999px; background: var(--line); }
.steps li.done, .steps li[aria-current="step"] { background: var(--accent); }
.sent-to { font-size: 1.05rem; }
.sent-to strong { white-space: nowrap; }
.otp { font: 600 1.4rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: .3em; text-align: center; max-width: 14rem; }
.resend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; margin-top: .75rem; }
.resend form { margin: 0; }
.explain { background: var(--bg); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 1rem 0; }
.explain p { margin: .25rem 0; }
/* INE capture: each side is a large tile around its file input. */
.capture-tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1rem 0; }
.capture-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 9rem; margin: 0; padding: 1rem;
  border: 2px dashed var(--field-line); border-radius: var(--radius); background: var(--field-bg); text-align: center; cursor: pointer; }
.capture-tile:hover, .capture-tile:focus-within { border-color: var(--accent); }
.capture-tile:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.capture-tile input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.capture-tile svg { width: 4rem; height: 2.6rem; fill: none; stroke: var(--accent); stroke-width: 2; }
.capture-tile .tile-title { font-weight: 650; }
.capture-tile .tile-state { color: var(--muted); font-size: .9rem; font-weight: 400; overflow-wrap: anywhere; }
.capture-tile.chosen { border-style: solid; border-color: var(--ok); }
.capture-tile.chosen .tile-state { color: var(--ok); }
.capture-tile img { display: block; max-width: 100%; max-height: 8rem; border-radius: 8px; }
.capture-tips { margin: .5rem 0 0; padding-left: 1.2rem; }
.capture-tile.chosen svg { display: none; }
/* Status badges of organizations and clients (statusTone): approved green, waiting amber,
   rejected or suspended red; the words say it too. */
.badge.danger { border-color: var(--danger); color: var(--danger); }
h1 .badge, h2 .badge { vertical-align: middle; font-weight: 600; letter-spacing: 0; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .25rem 0 0; padding: 0; list-style: none; }
/* Code blocks (a client's registered JWKS): pretty-printed, wrapped inside the card and never
   wider than the page; a long one scrolls inside its own box. */
pre { margin: .5rem 0 0; padding: .75rem; max-height: 24rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .85rem; line-height: 1.45; }
pre.mono { word-break: normal; }
pre:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* A heading with a copy button (data-copy) beside it. */
button[data-copy][hidden] { display: none; }
.copy-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.copy-head > :first-child { margin: 0; }
.copy-state { min-height: 1.5em; margin: .25rem 0 0; color: var(--ok); font-size: .9rem; }
.copy-state:empty { min-height: 0; margin: 0; }
/* A value meant to be copied (a client_id, a user identifier) with its button. */
.copyable { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.copyable code { padding: .35rem .5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
/* Manual review: the INE front and the liveness frame side by side at the same height, for
   the face comparison; phones stack them. The back follows as a thumbnail. */
.evidence-title { margin: 1rem 0 .25rem; font-size: 1rem; }
.evidence-compare { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: .75rem; margin-top: .75rem; }
.evidence-compare figure { margin: 0; }
.evidence-compare figure > a { display: block; }
.evidence-compare img { display: block; width: 100%; height: 20rem; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.evidence figcaption, .evidence-compare figcaption { margin-top: .35rem; font-size: .875rem; color: var(--muted); }
.evidence figcaption a, .evidence-compare figcaption a { display: inline-flex; align-items: center; min-height: 44px; }
.evidence-label { display: block; font-weight: 600; color: var(--fg); }
.evidence { grid-template-columns: repeat(auto-fill, minmax(12rem, 16rem)); }
@media (max-width: 40rem) {
  .evidence-compare { grid-template-columns: minmax(0, 1fr); }
  .evidence-compare img { height: 14rem; }
}
/* Label–value tables (a client's integration details): on phones each label sits above its
   value instead of squeezing both into two narrow columns. */
@media (max-width: 40rem) {
  table.kv, table.kv tbody, table.kv tr, table.kv th, table.kv td { display: block; }
  table.kv tr { padding: .5rem 0; border-bottom: 1px solid var(--line); }
  table.kv th, table.kv td { padding: 0; border: 0; }
  table.kv th { color: var(--muted); font-size: .9rem; }
}
