/* Pilot Desk: ThemeContext.tsx light-default / dark-vscode; global.css and tabs.css. */
:root {
  color-scheme: light;
  --color-primary: #34a953;
  --color-primary-hover: #2d9348;
  --color-primary-light: #f0fdf4;
  --color-primary-bg: #f0fdf4;
  --color-bg-app: #f8fafc;
  --color-bg-surface: #ffffff;
  --color-bg-surface-hover: #f8fafc;
  --color-bg-hover: #f8fafc;
  --color-nav-bg: #1e293b;
  --color-nav-border: #334155;
  --color-nav-text: #f8fafc;
  --color-nav-text-muted: #94a3b8;
  --color-nav-tab-active-bg: #34a953;
  --color-nav-tab-hover-bg: rgba(255,255,255,.08);
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-text-primary: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-text-placeholder: #cbd5e1;
  --color-text-inverse: #fff;
  --color-error: #ef4444;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;
  --color-success: #22c55e;
  --color-success-bg: #f0fdf4;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-dark: #d97706;
  --color-link: #34a953;
  --color-focus: #2d9348;   /* AGORA-0006: el verde «hover» de la paleta; ≥3:1 sobre todos los fondos claros (decisión del director, 27-sep-2026) */
  --color-scrollbar: #cbd5e1;
  --primary: var(--color-primary);
  --primary-hover: var(--color-primary-hover);
  --primary-light: var(--color-primary-light);
  --app: var(--color-bg-app);
  --surface: var(--color-bg-surface);
  --surface-hover: var(--color-bg-surface-hover);
  --nav: var(--color-nav-bg);
  --border: var(--color-border);
  --border-light: var(--color-border-light);
  --text: var(--color-text-primary);
  --secondary: var(--color-text-secondary);
  --muted: var(--color-text-muted);
  --warning-bg: var(--color-warning-bg);
  --warning-border: var(--color-warning-border);
  --warning-text: var(--color-warning-dark);
  --z-dropdown: 100;
  --z-notice: 150;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --color-focus: #34a953;   /* en oscuro pasa la norma con el verde principal: no se toca */
  --color-primary-hover: #3dbd5e;
  --color-primary-light: #1e2b22;
  --color-primary-bg: #1c281f;
  --dark-primary-bg: #1c281f;
  --color-bg-app: #1e1e1e;
  --color-bg-surface: #252526;
  --color-bg-surface-hover: #2d2d2d;
  --color-bg-hover: #2a2a2a;
  --color-nav-bg: #181818;
  --color-nav-border: #2b2b2b;
  --color-nav-text: #d4d4d4;
  --color-nav-text-muted: #858585;
  --color-border: #3c3c3c;
  --color-border-light: #333333;
  --color-text-primary: #d4d4d4;
  --color-text-secondary: #bdbdbd;
  --color-text-muted: #858585;
  --color-text-placeholder: #6e6e6e;
  --color-error: #f87171;
  --color-error-bg: #2d2020;
  --color-error-border: #5c2a2a;
  --color-success: #4ade80;
  --color-success-bg: #1f2b22;
  --color-warning: #fbbf24;
  --color-warning-bg: #2d2818;
  --color-warning-border: #4a3a15;
  --color-warning-dark: #f59e0b;
  --color-scrollbar: #4e4e4e;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--app); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--color-link); text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 20; color: #fff; background: #166534; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 10px; }
html[data-theme="dark"] .skip-link { color: #fff; }
.layout { width: 100%; margin: 0; padding-left: 24px; padding-right: 24px; }
.topbar__inner { padding: 0 16px; }

.topbar { background: var(--nav); color: #f8fafc; border-bottom: 1px solid var(--color-nav-border); }
.topbar__inner { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff !important; font-size: 20px; font-weight: 700; letter-spacing: normal; text-decoration: none; }
.brand img { object-fit: contain; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.prototype-pill { color: #d1fae5; border: 1px solid rgba(134, 239, 172, .36); background: rgba(34, 197, 94, .1); padding: 5px 10px; border-radius: 50px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.theme-button { border: 0; border-radius: 8px; background: transparent; color: var(--color-nav-text-muted); padding: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; transition: all .15s; }
#account-trigger { padding: 4px 8px; }
.theme-button svg { width: 16px; height: 16px; flex-shrink: 0; }
.control-chevron { width: 14px; height: 14px; opacity: .6; transition: transform .15s ease; flex-shrink: 0; }
[aria-expanded="true"] > .control-chevron { transform: rotate(180deg); }
.theme-button:hover { background: var(--color-nav-tab-hover-bg); color: var(--color-nav-text); }
.theme-button__icon { font-size: 17px; line-height: 1; }

main > .layout { padding-top: 16px; padding-bottom: 32px; }
.prototype-warning { display: flex; align-items: center; gap: 13px; padding: 11px 15px; border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-text); border-radius: 8px; font-size: 13px; }
.prototype-warning p { margin: 0; }
.prototype-warning a { color: inherit; }
.prototype-warning__mark { width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; flex: 0 0 24px; text-align: center; font-weight: 800; line-height: 22px; }
.read-status { color: var(--secondary); font-size: 12px; margin: 12px 2px 0; }
.intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(285px, .7fr); gap: 44px; align-items: center; margin: 54px 0 40px; }
.eyebrow { color: var(--color-primary); font-size: 11px; line-height: 1.25; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; margin: 0 0 9px; }
html[data-theme="dark"] .eyebrow { color: var(--color-primary); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 690px; font-size: clamp(32px, 3.9vw, 49px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 16px; }
.intro__description { max-width: 640px; color: var(--secondary); font-size: 16px; margin: 0; }
.source-card { padding: 20px 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.source-card__label { display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 650; color: var(--muted); }
.source-card strong { font-size: 16px; }
.source-card p { margin: 8px 0 9px; color: var(--secondary); }
.source-card a { font-size: 13px; font-weight: 650; }

.search-panel, .card, .results, .state-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.search-panel { padding: 25px 27px 26px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 23px; line-height: 1.25; letter-spacing: -.025em; }
.section-heading__detail, .result-count { color: var(--secondary); font-size: 12px; white-space: nowrap; padding-bottom: 2px; }
.result-count { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.search-panel form { margin-top: 20px; }
label { display: block; color: var(--secondary); font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.search-control { display: flex; gap: 10px; }
.search-control input { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--app); color: var(--text); border-radius: 8px; padding: 8px 12px; font-size: 13px; outline-offset: 2px; }
.search-control input::placeholder { color: var(--secondary); opacity: 1; }
.search-control input:focus { border-color: var(--primary); }
.field-hint { margin: 8px 0 0; color: var(--secondary); font-size: 12px; }
.sample-controls { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--border-light); }
.sample-controls label { margin-bottom: 3px; }
.sample-controls p { margin: 0; color: var(--secondary); font-size: 12px; max-width: 68ch; }
.sample-controls select { min-height: 44px; max-width: 100%; flex: 0 0 220px; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--text); background: var(--surface); }
.btn { padding: 8px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; font-size: 13px; font-weight: 400; line-height: 1.5; text-decoration: none; white-space: normal; text-align: center; cursor: pointer; }
.btn-primary { border: none; background: var(--primary); color: var(--color-text-inverse) !important; font-weight: 600; transition: opacity .15s; }
.btn-primary:hover { opacity: .9; }
.btn-secondary { border: 1px solid var(--border); background: var(--surface); color: var(--secondary) !important; transition: border-color .15s; }
.btn-secondary:hover { border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.results-section { margin-top: 40px; }
.section-heading--results { margin-bottom: 17px; }
.state-box { padding: 25px 27px; color: var(--secondary); }
.state-box--error { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-text); }
.state-box--stale { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-text); }
.state-skeleton { max-width: 580px; display: grid; gap: 8px; margin-top: 16px; }
.state-skeleton span { height: 10px; border-radius: 4px; background: var(--border-light); }
.state-skeleton span:nth-child(2) { width: 78%; }
.state-skeleton span:nth-child(3) { width: 51%; }
#retry { margin-top: 12px; }
.results { overflow: hidden; border-radius: 10px; }
.results__table { width: 100%; border-collapse: collapse; text-align: left; }
.results__table th { background: var(--app); padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--secondary); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.results__table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); vertical-align: top; font-size: 13px; }
.results__table tr:last-child td { border-bottom: 0; }
.results__table tbody tr { transition: background .12s; }
.results__table tbody tr:hover { background: var(--app); }
.result-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 4px; font-size: 14px; font-weight: 650; }
.result-link:hover { color: var(--color-link); }
html[data-theme="dark"] .result-link:hover { color: var(--color-primary); }
.small-line { display: block; margin-top: 3px; color: var(--secondary); font-size: 12px; }
.result-evidence { display: grid; gap: 3px; margin-top: 9px; padding-top: 9px; max-width: 48ch; border-top: 1px solid var(--border-light); color: var(--secondary); font-size: 11px; line-height: 1.4; }
.result-evidence strong { font-weight: 650; color: var(--text); }
.status-chip { display: inline-block; padding: 2px 8px; border: 0; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 600; white-space: nowrap; }
.results__table .status-chip--compact { display: none; }
.muted-value { color: var(--secondary); }
.result-cards { display: none; }

#vista-expediente { margin-top: 40px; }
.back-button { border: 0; padding: 5px 0; color: var(--color-primary); background: transparent; font-size: 13px; font-weight: 650; }
html[data-theme="dark"] .back-button { color: var(--color-primary); }
.record-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-top: 27px; }
.record-header h1 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 5px; letter-spacing: -.03em; line-height: 1.2; }
.expand-title { display: none; border: 0; padding: 0; margin: 0 0 9px; background: transparent; color: var(--color-primary); font-size: 12px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.record-number { margin: 0; color: var(--secondary); font-variant-numeric: tabular-nums; }
.coverage-badge { display: inline-block; flex: 0 0 auto; padding: 6px 11px; border-radius: 50px; border: 1px solid var(--warning-border); color: var(--warning-text); background: var(--warning-bg); font-size: 12px; font-weight: 650; }
.record-origin { margin: 18px 0 23px; color: var(--secondary); font-size: 12px; }
.record-state { margin: 0 0 18px; }
.record-evidence { margin: 17px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.record-evidence h2 { margin: 0 0 12px; font-size: 15px; line-height: 1.3; }
.record-evidence dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 25px; margin: 0; }
.record-evidence dt { color: var(--secondary); font-size: 11px; font-weight: 650; }
.record-evidence dd { margin: 2px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fact { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 18px; min-height: 103px; }
.fact__label { display: block; margin-bottom: 9px; color: var(--secondary); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.fact__value { display: block; font-size: 16px; font-weight: 650; line-height: 1.3; }
.fact__hint { color: var(--secondary); font-size: 11px; margin-top: 5px; }
.record-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 17px; }
.card { padding: 18px; }
.card__heading { display: flex; gap: 11px; align-items: center; }
.card__symbol { width: 28px; height: 28px; flex: 0 0 28px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--warning-text); background: var(--warning-bg); font-weight: 700; }
.card__symbol--green { color: #166534; background: var(--primary-light); }
html[data-theme="dark"] .card__symbol--green { color: var(--color-primary); }
.card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card p { color: var(--secondary); margin: 13px 0 17px; }
.missing-list, .official-steps { margin: 0; padding: 0; }
.missing-list { list-style: none; }
.missing-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border-light); font-size: 12px; }
.missing-list strong { color: var(--warning-text); font-size: 11px; font-weight: 650; flex: 0 0 auto; }
.official-steps { padding-left: 20px; color: var(--text); }
.official-number-state { padding: 10px 12px; border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-text) !important; border-radius: 8px; font-size: 12px; }
.official-steps li { padding-left: 3px; margin: 8px 0; }
.official-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.record-state-fallback { display: none; }
#vista-expediente > [data-screen-body][hidden] + .record-state-fallback { display: flex; }
.copy-status { min-height: 17px; margin: 10px 0 0 !important; font-size: 12px; }
.save-trigger { margin-top: 16px; }

.limits { margin-top: 70px; }
.limits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 19px; }
.limit-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.limit-card__status { color: var(--color-primary); background: var(--primary-light); display: inline-block; padding: 4px 9px; border-radius: 50px; font-size: 11px; font-weight: 650; }
html[data-theme="dark"] .limit-card__status { color: var(--color-primary); }
.limit-card__status--pending { color: var(--warning-text); background: var(--warning-bg); }
.limit-card__status--official { color: var(--secondary); background: var(--app); border: 1px solid var(--border); }
.limit-card h3 { margin: 14px 0 6px; font-size: 16px; }
.limit-card p { margin: 0; color: var(--secondary); font-size: 13px; }
dialog { width: 450px; max-width: 95vw; max-height: 85vh; overflow: auto; background: var(--surface); border: none; border-radius: 14px; padding: 24px; color: var(--text); box-shadow: 0 8px 32px rgba(0,0,0,.16); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog[open] { animation: pilotModalIn .15s ease-out; }
dialog[open]::backdrop { animation: pilotBackdropIn .15s; }
dialog.is-closing { animation: pilotModalOut .15s ease-out; }
dialog.is-closing::backdrop { animation: pilotBackdropOut .15s; }
body:has(dialog[open]) { overflow: hidden; }
@keyframes pilotModalIn { from { opacity: 0; transform: translateY(8px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pilotModalOut { to { opacity: 0; transform: translateY(8px) scale(.95); } }
@keyframes pilotBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pilotBackdropOut { to { opacity: 0; } }
dialog h2 { margin: 0 0 9px; font-size: 21px; }
dialog p { color: var(--secondary); margin: 0 0 20px; }
footer { border-top: 1px solid var(--border); padding: 24px 0 32px; color: var(--secondary); font-size: 12px; }

/* Pantallas públicas; los componentes compartidos siguen la referencia Desk registrada en P08. */

.topbar__inner { flex-wrap: nowrap; }
.main-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.main-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 14px; border: none; color: var(--color-nav-text-muted) !important; text-decoration: none; border-radius: 6px; font-size: 12.5px; font-weight: 600; transition: background .15s ease, color .15s ease; }
.main-nav a:hover { background: var(--color-nav-tab-hover-bg); color: var(--color-nav-text) !important; }
.main-nav a[aria-current="page"] { background: var(--color-nav-tab-active-bg); color: white !important; }
.main-nav svg { width: 14px; height: 14px; flex-shrink: 0; }

.page-context { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin: 8px 0 16px; }
.read-status { margin-top: 5px; max-width: 75ch; }
.review-tools { flex: 0 0 auto; max-width: 340px; font-size: 12px; }
.review-tools>summary { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); cursor: pointer; user-select: none; list-style: none; padding: 2px 0; transition: color .12s; }
.review-tools>summary::-webkit-details-marker { display: none; }
.review-tools>summary:hover { color: var(--secondary); }
.review-tools>summary::before { content: "›"; display: inline-block; font-size: 14px; line-height: 1; transition: transform .15s ease; width: 10px; text-align: center; }
.review-tools[open]>summary::before { transform: rotate(90deg); }
.review-tools__body { margin-top: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.review-tools__body select { display: block; width: 100%; margin-bottom: 12px; }
.search-panel { padding: 16px; margin-bottom: 16px; border-radius: 10px; }
.search-panel form { margin-top: 0; }
.search-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.text-action { padding: 8px 0; font-size: 13px; white-space: nowrap; }
.screen { padding-top: 8px; }
.screen h1 { max-width: none; font-size: 18px; font-weight: 700; line-height: 1.4; letter-spacing: normal; margin: 0 0 8px; }
.screen h2 { font-size: 18px; line-height: 1.35; margin: 24px 0 12px; letter-spacing: normal; }
.screen h3 { font-size: 15px; line-height: 1.4; font-weight: 600; }
.screen-heading { margin: 0 -24px 20px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.screen-heading>p, .screen>h1+p { max-width: 75ch; color: var(--secondary); margin: 0; font-size: 13px; }
.screen>h1+p { margin-bottom: 20px; }
.screen p, .article-body, .plain-list { max-width: 75ch; }
.screen .record-header h1 { font-size: 18px; letter-spacing: normal; }
.screen .record-header { align-items: start; margin-top: 20px; }
#vista-expediente { margin-top: 0; }
.screen-state { margin: 20px 0; }
.screen-state>p { margin-top: 8px; }
.screen-state.state-error { background: var(--color-error-bg); color: var(--color-error); border-color: var(--color-error); }
.screen-state.state-loading { background: var(--surface); color: var(--secondary); border-color: var(--border); }
.state-skeleton { margin-bottom: 16px; }
.notice { padding: 14px 16px; margin: 16px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--app); color: var(--secondary); font-size: 13px; }
.notice>h2, .notice>h3 { color: var(--text); margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.notice[data-personal-output="deletion-status"]:empty { padding: 0; margin: 0; border: 0; }
.empty-state { max-width: 560px; padding: 28px; margin: 24px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.empty-state h2 { margin-top: 0; }
.empty-state p { color: var(--secondary); }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.split-grid>* { min-width: 0; }
.inline-actions, .intent-links, .panel-heading, .results-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.panel-heading, .results-toolbar { justify-content: space-between; margin: 20px 0 12px; }
.panel-heading>h2 { margin: 0; }
.form-stack { display: grid; gap: 16px; max-width: 720px; margin: 20px 0; }
.form-stack>p, .form-stack>.notice { margin: 0; }
.form-stack>.btn { justify-self: start; }
.field label, .form-stack label { font-size: 12px; font-weight: 500; margin-bottom: 4px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--app); font-size: 13px; padding: 10px 12px; outline: none; transition: border-color .15s; }
.field input:not([type="checkbox"]), .field textarea, .field select, .form-stack>input, .form-stack>select, .document-toolbar input { width: 100%; }
input::placeholder, textarea::placeholder, .search-control input::placeholder { color: var(--color-text-placeholder); opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus { border-color: var(--primary); }
input:not([type="checkbox"]):not([type="radio"]):focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
input:disabled, select:disabled { opacity: .72; cursor: not-allowed; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0; padding: 16px; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; }
.checkbox-row { display: flex !important; align-items: start; gap: 10px; padding: 8px 0; font-size: 14px !important; font-weight: 400 !important; }
.checkbox-row input { margin: 2px 0 0; }
input[type="checkbox"], input[type="radio"] { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; transition: all .15s; }
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") no-repeat center / 12px; }
input[type="radio"]:checked { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--primary); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .4; cursor: not-allowed; }
.field-error { color: var(--color-error); }
.section-links { display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--border); margin-top: 28px; padding-top: 16px; }
.section-links a { padding: 5px 0; font-size: 13px; }
.help-shortcuts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0 20px; }
.help-shortcuts a { display: inline-flex; align-items: center; min-height: 44px; }
.welcome-intents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 940px; margin: 18px 0 16px; }
.welcome-intents a { display: flex; align-items: center; min-height: 56px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.welcome-intents a { padding: 16px; border-radius: 10px; transition: border-color .2s, box-shadow .2s; }
.welcome-intents a:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.welcome-exit { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 26px; }
.welcome-exit a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.coverage-details { display: grid; grid-template-columns: minmax(160px, .35fr) minmax(0, 1fr); gap: 10px 18px; }
.coverage-details dt { font-weight: 600; }
.coverage-details dd { margin: 0; overflow-wrap: anywhere; }
.data-list { padding: 0; list-style: none; }
.data-list>li, .data-list>article, .data-list>div { padding: 14px 0; border-bottom: 1px solid var(--border-light); overflow-wrap: anywhere; }
.data-list .field-hint, .data-list p { display: block; }
.data-list .btn { margin: 6px 8px 0 0; }
.data-list .tag { display: inline-block; margin-left: 8px; }
.shared-task { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--primary); background: var(--app); overflow-wrap: anywhere; }
.shared-task>.field-hint:first-child { margin-top: 0; }
.shared-task-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 720px; margin-top: 12px; }
.shared-task-controls>.field { min-width: 0; }
.shared-task-controls select { width: 100%; min-width: 0; }
.shared-task-history ol { padding-left: 20px; font-size: 12px; color: var(--secondary); }
.shared-task-history li { margin: 8px 0; overflow-wrap: anywhere; }
.tag { border-radius: 6px; padding: 3px 7px; font-size: 11px; background: var(--app); border: 1px solid var(--border); color: var(--secondary); }
.definition-list, .document-properties dl { display: grid; grid-template-columns: minmax(120px, .4fr) 1fr; gap: 12px 24px; margin: 20px 0; }
.definition-list dt, .document-properties dt { font-weight: 600; }
.definition-list dd, .document-properties dd { margin: 0; color: var(--secondary); overflow-wrap: anywhere; }
.current-record-context { padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.current-record-context strong, .current-record-context span { display: block; }
.current-record-context span { color: var(--secondary); margin-top: 4px; }
.timeline { padding: 0; list-style: none; margin: 20px 0; }
.timeline li { display: grid; grid-template-columns: minmax(180px, .6fr) 1fr; gap: 4px 20px; border-bottom: 1px solid var(--border-light); padding: 14px 0; }
.timeline p { grid-column: 2; margin: 0; }
.screen details { margin: 16px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.screen summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 12px 14px; color: var(--text); }
.screen details > :not(summary) { margin-left: 14px; margin-right: 14px; margin-bottom: 14px; }
.screen details p { color: var(--secondary); }
.plain-list { padding-left: 24px; }
.plain-list li { margin: 10px 0; }
.quick-views { display: inline-flex; flex-wrap: wrap; gap: 0; margin: 20px 0 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.quick-views button { border: 0; border-right: 1px solid var(--border); border-radius: 0; color: var(--secondary); background: var(--surface); padding: 5px 10px; font-size: 12px; transition: background .15s; }
.quick-views button:last-child { border-right: 0; }
.quick-views button[aria-pressed="true"] { color: var(--primary); background: var(--surface-hover); font-weight: 600; }
.filter-chip { border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--surface); padding: 7px 12px; font-size: 13px; }
.quick-views button:hover, .filter-chip:hover { background: var(--surface-hover); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.comparison-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.comparison-table th { background: var(--app); font-size: 11px; text-align: left; padding: 10px 14px; }
.comparison-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.comparison-table td, .comparison-table th { overflow-wrap: anywhere; }
#screen-AGO-PRECIOS [data-public-comparison], #public-comparison-results { max-width: none; min-width: 0; }
#public-comparison-results .comparison-table { table-layout: fixed; }
#public-comparison-results .comparison-table th:first-child { width: 20%; overflow-wrap: normal; }
@media (max-width: 767px) {
  .shared-task-controls { grid-template-columns: minmax(0, 1fr); }
  #public-comparison-results .comparison-table th:first-child { min-width: 9rem; }
  #public-comparison-results .comparison-table td, #public-comparison-results .comparison-table th:not(:first-child) { min-width: 14rem; }
}
.pilot-menu { position: fixed; inset: auto; min-width: 200px; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.pilot-menu a { display: block; padding: 8px 12px; font-size: 13px; color: var(--text) !important; text-decoration: none; border-radius: 6px; }
.pilot-menu a:hover { background: var(--surface-hover); }
.pilot-combo { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13px; color: var(--text); background: var(--surface); text-align: left; }
.pilot-combo-panel { position: fixed; inset: auto; margin: 0; width: min(420px, calc(100vw - 32px)); max-height: min(390px, calc(100vh - 24px)); overflow: auto; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.pilot-combo:hover { background: var(--color-bg-hover); }
.pilot-combo-panel input { width: calc(100% - 16px); padding: 7px 10px !important; margin: 8px; border-radius: 7px; }
#institution-options { max-height: 320px; overflow: auto; padding: 0 4px 4px; }
#institution-empty { padding: 10px 12px; margin: 0; }
.pilot-option { display: block; width: 100%; border: 0; border-radius: 7px; padding: 8px 10px; background: transparent; color: var(--text); text-align: left; font-size: 13px; }
.pilot-option:hover, .pilot-option:focus-visible { background: var(--color-bg-hover); }
.pilot-option[aria-selected="true"] { background: var(--color-primary-bg); }
.global-notice:empty { display: none; }
.global-notice { position: sticky; bottom: 16px; z-index: var(--z-notice); max-width: 760px; margin: 24px auto 0; padding: 12px 16px; border: 1px solid var(--primary); border-radius: 8px; color: var(--text); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

.screen [tabindex="-1"]:focus { outline: none; }
.screen [tabindex="-1"]:focus-visible { outline: 2px solid var(--color-focus); }
@media (max-width: 1023px) {
  .layout, .topbar__inner { padding-left: 20px; padding-right: 20px; }
  .screen-heading { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .topbar__inner { min-height: 56px; height: auto; flex-wrap: wrap; gap: 0 12px; }
  .brand, .topbar__actions { min-height: 56px; }
  .main-nav { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .main-nav a { min-height: 44px; flex: 1; padding: 8px; }
  .topbar__actions { margin-left: auto; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea, .pilot-combo { font-size: 16px; min-height: 44px; }
  .pilot-menu a, .pilot-option, .quick-views button, .filter-chip, summary, .section-links a, .checkbox-row { min-height: 44px; }
}
@media (max-width: 767px) {
  .layout, .topbar__inner { padding-left: 16px; padding-right: 16px; }
  .split-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .page-context { display: block; }
  .review-tools { max-width: 100%; margin-top: 8px; }
  .review-tools__body { max-width: 100%; }
  .screen-heading { margin-left: -16px; margin-right: -16px; padding: 14px 16px; }
  .screen .record-header { flex-direction: column; gap: 12px; }
  .search-panel { padding: 16px; }
  .search-control { flex-wrap: wrap; }
  .search-control input { flex-basis: 100%; }
  .search-control .btn { flex: 1; }
  .search-meta { align-items: start; }
  .text-action { min-height: 44px; }
  .definition-list, .document-properties dl { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .definition-list dd, .document-properties dd { margin-bottom: 12px; }
  .timeline li { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .timeline p { grid-column: 1; }
  .comparison-table { display: block; overflow-x: auto; }
  .empty-state { padding: 20px 16px; }
  .global-notice { bottom: max(8px, env(safe-area-inset-bottom)); font-size: 13px; }
}

@media (max-width: 1023px) {
  .btn, .theme-button, .back-button, .expand-title { min-width: 44px; min-height: 44px; }
  .search-control input, .sample-controls select { min-height: 44px; font-size: 16px; }
}
@media (max-width: 900px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 43px 0 32px; }
  .source-card { max-width: 520px; }
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-columns { grid-template-columns: 1fr; }
  .limits-grid { grid-template-columns: repeat(2, 1fr); }
  .results__table th:nth-child(3), .results__table td:nth-child(3) { display: none; }
  .results__table .status-chip--compact { display: inline-block; margin-top: 8px; }
  .sample-controls { align-items: start; flex-direction: column; }
  .sample-controls select { flex: none; width: min(100%, 360px); }
}
@media (max-width: 767px) {
  .results__table { display: none; }
  .result-cards { display: block; }
  .results { border: 0; background: transparent; }
  .result-card { padding: 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: var(--surface); }
  .result-card:last-child { margin-bottom: 0; }
  .result-card__top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
  .result-card .status-chip { margin: 10px 0; }
  .result-card__facts { display: grid; gap: 9px; margin-top: 10px; }
  .result-card__facts > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
  .result-card__facts span { color: var(--secondary); font-size: 12px; display: block; }
  .result-card__facts strong { font-size: 14px; font-weight: 500; display: block; }
  .result-card .result-evidence { max-width: none; margin-top: 12px; }
}
@media (max-width: 640px) {
  .welcome-intents { grid-template-columns: 1fr; gap: 8px; }
  .welcome-intents a { min-height: 48px; }
  .welcome-exit .btn { min-height: 44px; }
  .coverage-details { grid-template-columns: 1fr; gap: 4px; }
  .coverage-details dd { margin-bottom: 12px; }
  .layout, .topbar__inner { padding-left: 16px; padding-right: 16px; }
  .topbar__inner { height: auto; min-height: 56px; }
  .brand { font-size: 18px; }
  .topbar__actions { gap: 7px; }
  .prototype-pill { font-size: 10px; padding: 4px 7px; }
  .theme-button { padding: 7px 9px; }
  .theme-button span:last-child { display: none; }
  main > .layout { padding-top: 16px; padding-bottom: 48px; }
  .prototype-warning { align-items: flex-start; }
  .intro { margin: 35px 0 27px; }
  h1 { font-size: clamp(31px, 8vw, 39px); }
  .intro__description { font-size: 15px; }
  .search-panel { padding: 16px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 20px; }
  .section-heading__detail { display: none; }
  .search-control { flex-direction: column; }
  .search-control input { width: 100%; }
  .search-control .btn { min-height: 44px; }
  .results-section { margin-top: 31px; }
  .record-header { align-items: start; flex-direction: column; gap: 12px; }
  .record-header h1.is-truncated { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .expand-title:not([hidden]) { display: inline-block; }
  .facts-grid, .limits-grid { grid-template-columns: 1fr; }
  .record-evidence dl { grid-template-columns: 1fr; gap: 9px; }
  .fact { min-height: auto; padding: 15px; }
  .card { padding: 20px 16px; }
  .missing-list li { flex-direction: column; gap: 2px; }
  .official-actions { flex-direction: column; }
  .limits { margin-top: 49px; }
}
@media (max-width: 640px) {
  .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding-bottom: 8px; }
  .main-nav a { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .prototype-warning, .coverage-badge, .status-chip, .limit-card__status { border: 1px solid currentColor; }
  :focus-visible { outline: 3px solid Highlight !important; outline-offset: 3px; }
}

/* AGORA-0007 (28-sep-2026): en el portal publicado, la línea de estado de arriba cambia de «Consultando…» (una línea)
   al texto de cobertura, que en el teléfono ocupa siete líneas y llegaba después de los datos: empujaba toda la página
   108 px (el «contenido que se mueve» que mide el protocolo). Se reserva desde el principio el alto del texto final;
   el texto no cambia. Alto medido en la copia: 7 líneas a 393 px de ancho y 3 en computadora (12 px, interlineado 1.5). */
html[data-agora-service] #read-status { min-height: calc(3 * 1.5em); line-height: 1.5; }
@media (max-width: 767px) { html[data-agora-service] #read-status { min-height: calc(5 * 1.5em); } }
@media (max-width: 480px) { html[data-agora-service] #read-status { min-height: calc(7 * 1.5em); } }
