/* Mesa de Obra CPEI 571/26 · interfaz 1.1 (modo Operar).
   Sistema visual tomado de la demo SEPEI (paleta «solanad», escala y tipografía IBM Plex), servido en
   local: fuentes en /vendor/fonts (OFL-1.1), sin orígenes externos. Fondo crema para oficina y parque
   con luz diurna; variante oscura por preferencia del sistema. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap; src: url(/vendor/fonts/ibm-plex-serif-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/vendor/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "IBM Plex Serif", Cambria, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r-lg: 12px; --r: 8px; --r-sm: 5px;
  --shadow-pop: 0 14px 32px -12px rgba(10, 16, 18, .30);
  --side-w: 252px;
  --bg: #F4F1E6; --surface: #FBF9F3; --sunk: #ECE8DB; --sunk-2: #E2DDCD; --scene: #E6E3D8;
  --ink: #0F1214; --muted: #444444; --faint: #4C4C4A; --line: #DAD7CE; --line-strong: #B6B5AD; --field: #82837F;
  --ok-soft: #DDE4DC; --ok: #015243; --warn-soft: #F3E6C8; --warn: #614101; --signal-soft: #F2E0D8; --signal: #8A2118;
  --info-soft: #DCE7E9; --info: #0B4A5C; --sim-soft: #EADFE1; --sim: #6C3260;
  --accent: #FFC21A; --on-accent: #0F1214; --accent-soft: #FCF0D5; --accent-ink: #674500; --focus: #674500;
  --brand-ink: #003C4C; --side: #003C4C; --sd-ink: #F4F1E6; --sd-muted: #D0DEDD; --sd-hover: #1A4957; --sd-line: #335A66; --sd-brand: #FFC21A;
  --tone-none: #B9B5A8; --tone-progress: #D9A21B; --tone-pending: #3E7CB1; --tone-valid: #0E8A6E; --tone-received: #015243; --tone-revalidate: #B3261E;
  --band-none: #B9B5A8; --band-low: #E3C77A; --band-mid: #6FAE93; --band-done: #015243;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F181C; --surface: #16232A; --sunk: #131E23; --sunk-2: #1F2E35; --scene: #16232A;
    --ink: #F6F3EA; --muted: #B7B9B6; --faint: #A9ADAB; --line: #283033; --line-strong: #444B4D; --field: #6C7170;
    --ok-soft: #1E3E3D; --ok: #5BDFB7; --warn-soft: #3F4034; --warn: #FFCD5C; --signal-soft: #3E3B3F; --signal: #FFC0B7;
    --info-soft: #1D3640; --info: #9FD3E2; --sim-soft: #393B47; --sim: #F2BEE8;
    --accent: #FFC21A; --on-accent: #0F181C; --accent-soft: #3F4034; --accent-ink: #FFCD5C; --focus: #FFCD5C;
    --brand-ink: #FFC21A; --side: #003C4C; --sd-hover: #1A4958;
    --tone-none: #6C7170; --tone-progress: #E0B13A; --tone-pending: #6FA8DC; --tone-valid: #2EBC96; --tone-received: #5BDFB7; --tone-revalidate: #FF8A80;
    --band-none: #6C7170; --band-low: #C9A646; --band-mid: #4FA585; --band-done: #5BDFB7;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); font-variant-numeric: lining-nums tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
a { color: var(--brand-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 600 30px/1.15 var(--serif); letter-spacing: -.01em; color: var(--brand-ink); }
h2 { font: 600 19px/1.3 var(--sans); margin: 1.8rem 0 .7rem; }
h3 { font: 600 15px/1.35 var(--sans); margin: 1rem 0 .4rem; }
p { margin: .3rem 0 .6rem; }
.lede { font: 600 19px/1.45 var(--serif); color: var(--ink); max-width: 62rem; margin: .5rem 0 .3rem; }
.num, td.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.bad { color: var(--signal); font-weight: 600; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--side); color: var(--sd-ink); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }
.boot, .loading { padding: 2rem; color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 13px; height: 13px; }

/* ---- armazón ---- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side) var(--side-w), var(--bg) var(--side-w)); }
.col { min-width: 0; display: flex; flex-direction: column; }
main { min-width: 0; outline: none; }
.page { padding: 18px 36px 80px; max-width: 1280px; }
.page p, .page li, .page dd { overflow-wrap: break-word; }
.page .mono, .page p.small { overflow-wrap: anywhere; }

.side { background: var(--side); color: var(--sd-ink); padding: 20px 14px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-color: var(--sd-line) transparent; --ink: var(--sd-ink); --muted: var(--sd-muted); }
.side :focus-visible { outline-color: var(--sd-brand); }
.side .brand { text-decoration: none; color: var(--sd-ink); padding: 0 10px; display: block; }
.side .brand b { display: block; font: 600 22px/1.15 var(--serif); color: var(--sd-brand); }
.side .brand span { font-size: 13px; color: var(--sd-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--sd-ink); font-weight: 500; min-height: 40px; }
.nav a:hover { background: var(--sd-hover); }
.nav a[aria-current="page"] { background: #F4F1E6; color: #0F1214; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav a[aria-current="page"] .count, .nav a.pk[aria-current="page"] .pid { color: #505150; }
.nav .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--sd-muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.nav .count.warn { color: var(--accent); font-weight: 600; }
.nav a[aria-current="page"] .count.warn { color: #8A2118; }
.nav .grp { font-size: 12px; color: var(--sd-muted); padding: 14px 10px 4px; font-weight: 600; }
.nav .sep { height: 1px; background: var(--sd-line); margin: 8px 10px; }
.nav a.pk { min-height: 34px; padding: 5px 10px; font-size: 14.5px; gap: 8px; }
.nav a.pk .pid { font: 500 11.5px var(--mono); color: var(--sd-muted); width: 2.4em; flex: none; }
.parks { display: flex; flex-direction: column; gap: 1px; }
.side-foot { font-size: 12px; color: var(--sd-muted); padding: 0 10px; margin-top: auto; }
.backdrop { display: none; }

.top { display: flex; align-items: center; gap: 14px; padding: 12px 36px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; min-height: 64px; }
.top .spacer { flex: 1; }
.top .who { font-size: 13px; text-align: right; line-height: 1.25; }
.top .who b { display: block; font-weight: 600; }
.top .who span { color: var(--muted); }
.menu-btn { display: none; }
.search { position: relative; display: flex; align-items: center; flex: 0 1 420px; min-width: 0; }
.search .ic { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input[type=search] { padding-left: 36px; padding-right: 34px; background: var(--surface); }
.search kbd { position: absolute; right: 9px; font: 500 12px var(--mono); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; color: var(--muted); }
.sresults { position: absolute; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow-pop); z-index: 40; max-height: 60vh; overflow-y: auto; }
.sresults li { padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; display: flex; flex-direction: column; }
.sresults li span { font-size: 12.5px; color: var(--muted); }
.sresults li[aria-selected="true"], .sresults li:hover { background: var(--accent-soft); }
.sresults li.empty { color: var(--muted); cursor: default; }
.stelpill { display: inline-flex; align-items: center; gap: .4rem; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; background: var(--sunk); color: var(--ink); white-space: nowrap; text-decoration: none; border: 1px solid var(--line); }
.stelpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--field); display: inline-block; }
.stelpill.sim i { background: var(--sim); } .stelpill.live i { background: var(--ok); } .stelpill.err i { background: var(--signal); }

.crumbs { padding: 18px 36px 0; font-size: 13.5px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "›"; margin: 0 6px 0 2px; color: var(--field); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: var(--ink); }

/* ---- controles ---- */
button, .btn { font: 600 14px/1.2 var(--sans); border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 9px 14px; min-height: 40px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: background-color .12s ease-out, border-color .12s ease-out; }
button:hover, .btn:hover { background: var(--sunk); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: #F2B200; border-color: #F2B200; }
button.secondary, .btn.secondary { background: var(--side); border-color: var(--side); color: #F4F1E6; }
button.secondary:hover, .btn.secondary:hover { background: var(--sd-hover); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small, .btn.small { min-height: 34px; padding: 6px 11px; font-size: 13.5px; }
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  font: 400 15px/1.4 var(--sans); width: 100%; padding: 9px 11px; min-height: 42px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--side); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; min-height: 40px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.err { color: var(--signal); font-weight: 600; }
.errbox { background: var(--signal-soft); color: var(--signal); border: 1px solid var(--signal); padding: 10px 14px; border-radius: var(--r); margin: 10px 0; }
.notice { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-ink); padding: 9px 14px; border-radius: var(--r); margin: 6px 0; font-size: 14.5px; }
.simbanner { background: var(--sim-soft); border: 1px solid var(--sim); color: var(--sim); padding: 9px 14px; border-radius: var(--r); margin: 6px 0; font-weight: 600; }

/* ---- chips ---- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.chip.n { background: var(--sunk); color: var(--muted); }
.chip.i { background: var(--info-soft); color: var(--info); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.w { background: var(--warn-soft); color: var(--warn); }
.chip.b { background: var(--signal-soft); color: var(--signal); }
.chip.u { background: transparent; color: var(--muted); border: 1px dashed var(--field); }
.chip.sim { background: var(--sim-soft); color: var(--sim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- bloques comunes ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin: 10px 0; }
.panel h2 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.warnpanel { border-color: var(--signal); }
.warnpanel h2 { color: var(--signal); }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 26px 0 10px; }
.sec-h h2 { margin: 0; }
.sec-h .lede { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--sunk); }
tfoot th, tfoot td { font-weight: 600; background: var(--sunk); border-bottom: 0; }
td.mono, td.num { white-space: nowrap; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.linklist { list-style: none; padding: 0; margin: 4px 0; }
.linklist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.linklist li:last-child { border-bottom: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 8px 0 14px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
.pill.band-low { background: var(--warn-soft); } .pill.band-mid { background: var(--ok-soft); } .pill.band-done { background: var(--ok); color: var(--bg); border-color: var(--ok); }

/* ---- vista ejecutiva ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 6px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.kpi .k { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.kpi .v { font: 600 24px/1.25 var(--sans); margin: 4px 0 2px; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.kpi .sub.bad { color: var(--signal); font-weight: 600; }
.issue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; margin: 0 0 12px; }
.issue[data-kind="REVALIDATION"], .issue[data-kind="STEL_CONFLICT"] { border-color: var(--signal); }
.issue-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.issue-h h3 { margin: 0; font-size: 16px; }
.issue-h .n { font: 600 15px var(--sans); color: var(--muted); }
.issue[data-kind="REVALIDATION"] .issue-h .n { color: var(--signal); }
.doorlinks { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.doorlinks li { display: inline-flex; align-items: center; gap: 8px; }
.clist { list-style: none; padding: 0; margin: 0 0 12px; }
.clist li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.clist li span { font-size: 13px; color: var(--muted); }

/* ---- hoy en obra ---- */
.next { border-color: var(--accent); }
.next-id { font: 600 26px/1.2 var(--serif); margin: 4px 0 10px; }
.next-id a { text-decoration: none; color: var(--brand-ink); }

/* ---- registro ---- */
.activity { list-style: none; padding: 0; margin: 10px 0; }
.activity li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: start; }
.activity li.new { background: var(--accent-soft); }
.activity time { font-size: 13px; color: var(--muted); }

/* ---- parque ---- */
.park-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 24px; margin: 8px 0 4px; }
.park-head .sub { color: var(--muted); margin-top: 4px; }
.park-progress { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.park-progress .big { font: 600 30px/1.1 var(--serif); color: var(--brand-ink); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: baseline; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; color: var(--faint); }
.doorlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.dooritem { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.dooritem:last-child { border-bottom: 0; }
.dooritem:hover { background: var(--accent-soft); }
.dooritem .id { font-weight: 600; }
.dooritem .meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.thumb { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; font-size: 12.5px; margin: 0; }
.thumb img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--sunk); }
.thumb .cap { padding: 6px 8px; }
.thumb .cond { color: var(--muted); margin-top: 3px; }

/* ---- maqueta ---- */
.seal { display: inline-block; font: 500 12.5px/1.45 var(--mono); color: var(--accent-ink); background: var(--accent-soft); border: 1px dashed var(--accent-ink); border-radius: var(--r-sm); padding: 5px 10px; margin: 0 0 12px; }
.maq-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.stage { position: relative; background: var(--scene); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-height: 200px; touch-action: pan-y; }
.stage canvas { display: block; width: 100%; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.maq[data-render="3d"] .alzado { display: none; }
.maq[data-render="2d"] .stage { touch-action: auto; padding: 8px; overflow-x: auto; overscroll-behavior-x: contain; }
/* three.js fija display:block en línea en el canvas: hace falta !important para ocultarlo en modo 2D */
.maq[data-render="2d"] .stage canvas, .maq[data-render="2d"] .tags, .maq[data-render="2d"] .stage-hint, .maq[data-render="2d"] .stage-ctl { display: none !important; }
.stage-bar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.stage-ctl { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.stage-btn { min-width: 40px; min-height: 40px; padding: 0; font: 600 20px/1 var(--sans); border: 1.5px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .35); cursor: pointer; }
.stage-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) { .stage-hint { max-width: calc(100% - 170px); text-align: right; font-size: 11px; } }
.tags { position: absolute; inset: 0; pointer-events: none; }
.door-tag { pointer-events: auto; position: absolute; left: 0; top: 0; min-height: 0; padding: 2px 7px; font: 600 12px/1.3 var(--mono); border-radius: 5px; border: 1.5px solid var(--ink);
  background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .35); }
.door-tag::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--tone, var(--tone-none)); vertical-align: 0; }
.door-tag.sel { background: var(--accent); color: var(--on-accent); }
.stage-hint { position: absolute; right: 10px; bottom: 6px; margin: 0; font-size: 12px; color: var(--muted); background: var(--surface); padding: 2px 8px; border-radius: 4px; pointer-events: none; }
.alzado { width: 100%; height: auto; display: block; font-family: var(--sans); }
.alzado .rt { font: 600 14px var(--sans); fill: var(--muted); }
.alzado .wall { fill: var(--sunk-2); stroke: var(--line-strong); }
.alzado .ground { stroke: var(--field); stroke-width: 1.5; }
.alzado .fence { stroke: var(--field); stroke-width: 2; stroke-dasharray: 2 5; }
.alzado .door { cursor: pointer; }
.alzado .door:focus { outline: none; }
.alzado .leaf { fill: var(--tone, var(--tone-none)); stroke: var(--ink); stroke-width: 1; }
.alzado .tex { pointer-events: none; }
.alzado .pl { stroke: rgba(0, 0, 0, .3); stroke-width: 1.2; }
.alzado .pl.thin { stroke-width: .7; }
.alzado .pn { fill: none; }
.alzado .hatch { stroke: rgba(0, 0, 0, .4); stroke-width: 1.4; }
.alzado .inset { fill: none; stroke: rgba(0, 0, 0, .35); stroke-width: 1.2; pointer-events: none; }
.alzado .rail { stroke: var(--ink); stroke-width: 2; }
.alzado .sel { fill: none; stroke: transparent; stroke-width: 3; }
.alzado .door.selected .sel, .alzado .door:focus-visible .sel { stroke: var(--focus); }
.alzado .dl { font: 600 13px var(--mono); fill: var(--ink); }
.alzado .nm { font: 600 11.5px var(--sans); fill: var(--signal); }
.tone-sin-iniciar { --tone: var(--tone-none); } .tone-en-curso { --tone: var(--tone-progress); } .tone-pendiente { --tone: var(--tone-pending); }
.tone-validada { --tone: var(--tone-valid); } .tone-recibida { --tone: var(--tone-received); } .tone-revalidar { --tone: var(--tone-revalidate); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 10px 0; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--tone, var(--tone-none)); border: 1px solid rgba(0, 0, 0, .25); flex: none; }
.door-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.door-panel h3 { margin: 0 0 6px; font: 600 20px var(--serif); color: var(--brand-ink); }
.maq-side h3 { margin: 16px 0 8px; }
.door-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.gcell { flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; min-height: 0; font-weight: 500; text-align: left; }
.gcell b { font: 600 13px var(--mono); display: inline-flex; align-items: center; }
.gcell span { font-size: 11.5px; color: var(--muted); }
.gcell .sw { position: absolute; }
.gcell { position: relative; padding-left: 26px; }
.gcell .sw { left: 8px; top: 9px; }
.gcell[aria-pressed="true"] { border-color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---- conjunto: mapa y cronograma ---- */
.map-cols { margin-top: 10px; }
.mapfig { margin: 0; }
.map { width: 100%; height: auto; max-height: 560px; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.map .prov { fill: var(--sunk); stroke: var(--line-strong); stroke-width: 1.2; stroke-linejoin: round; }
.park-dot { stroke: var(--ink); stroke-width: 1.4; }
.park-dot.band-none, .sw.band-none { fill: var(--band-none); background: var(--band-none); }
.park-dot.band-low, .sw.band-low { fill: var(--band-low); background: var(--band-low); }
.park-dot.band-mid, .sw.band-mid { fill: var(--band-mid); background: var(--band-mid); }
.park-dot.band-done, .sw.band-done { fill: var(--band-done); background: var(--band-done); }
.park-ring { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }
.sw.ring { background: transparent; border: 1.5px dashed var(--ink); border-radius: 50%; }
.park-lbl { font: 600 12.5px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.park-link:hover .park-dot, .park-link:focus .park-dot { stroke-width: 3; }
.park-link:focus { outline: none; }
.park-link:focus-visible .park-dot { stroke: var(--focus); stroke-width: 3.5; }
.rule { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r); padding: 8px 12px; font-size: 14px; color: var(--accent-ink); }
.gantt { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.g-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); border-bottom: 1px solid var(--line); min-height: 44px; }
.g-row:last-child { border-bottom: 0; }
.g-head { background: var(--sunk); min-height: 30px; font-size: 12.5px; color: var(--muted); }
.g-label { padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); min-width: 0; }
.g-label a { font-weight: 600; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-label small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-axis, .g-track { position: relative; }
.g-axis span { position: absolute; top: 6px; transform: translateX(2px); white-space: nowrap; }
.g-axis span::before { content: ""; position: absolute; left: -2px; top: -6px; height: 30px; border-left: 1px solid var(--line-strong); }
.g-bar { position: absolute; top: 9px; height: 26px; background: var(--side); color: #F4F1E6; border-radius: 5px; font: 600 11px/26px var(--mono); padding: 0 5px; overflow: hidden; white-space: nowrap; text-decoration: none; min-width: 6px; }
.g-bar.immob { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .22) 6px 9px); }
.g-bar.blocked { background-color: var(--signal); }
.g-ovl { position: absolute; top: 3px; bottom: 3px; border: 2px solid var(--signal); background: var(--signal-soft); border-radius: 6px; }
.g-ovl.ok { border-style: dashed; border-color: var(--warn); background: var(--warn-soft); }
.g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--accent-ink); }
.g-sw { background: var(--side); border: 0; }
.g-sw.immob { background-image: repeating-linear-gradient(135deg, var(--side) 0 3px, #6E8C93 3px 5px); }
.g-sw.ovl { background: var(--signal-soft); border: 2px solid var(--signal); }
.g-sw.ovl.ok { background: var(--warn-soft); border: 2px dashed var(--warn); }
.assumptions .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.assumptions .kv dt { margin-top: 8px; }

/* ---- ficha de puerta (1.0, con el estilo nuevo) ---- */
.door-page .wrap { max-width: 1100px; }
.backlink { display: inline-block; margin: 2px 0 8px; font-size: 14px; }
.doorhead { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; justify-content: space-between; }
.doorhead .sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.dims { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin: 16px 0; }
.dims > div { padding: 11px 14px; border-right: 1px solid var(--line); }
.dims > div:last-child { border-right: 0; }
.dims .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dims .v { margin-top: 4px; }
.event { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 12px 16px; margin: 10px 0; }
.event .line1 { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.history { margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--line); font-size: 13.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mobilebar { display: none; }
.backbtn { display: none; }

/* ---- diálogo ---- */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); width: min(760px, 96vw); max-height: 92vh; box-shadow: var(--shadow-pop); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(0, 30, 38, .5); }
dialog .dh { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; z-index: 2; }
dialog .dh h2 { margin: 0; font: 600 21px/1.2 var(--serif); color: var(--brand-ink); }
dialog .db { padding: 16px 18px; overflow-y: auto; }
dialog .df { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.draftstate { margin-right: auto; font-size: 13.5px; color: var(--muted); }
.workitem { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: var(--bg); }
.doorres { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.uplist { list-style: none; padding: 0; margin: 6px 0; font-size: 13.5px; }
.uplist li { padding: 5px 0; border-bottom: 1px dashed var(--line); }

/* ---- acceso ---- */
.login { max-width: 440px; margin: 10vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.login-brand { font: 600 15px var(--sans); color: var(--accent-ink); margin: 0 0 4px; }
.login h1 { margin-bottom: 6px; }
.login button { width: 100%; }

#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--side); color: #F4F1E6; padding: 11px 18px; border-radius: var(--r); font-size: 14.5px; opacity: 0;
  pointer-events: none; transition: opacity .18s ease-out; z-index: 60; max-width: calc(100vw - 32px); box-shadow: var(--shadow-pop); }
#toast.show { opacity: 1; }

/* ---- pantallas medianas ---- */
@media (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .maq-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- móvil: la barra lateral pasa a cajón ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform .2s ease-out; visibility: hidden; }
  .side.open { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0, 30, 38, .45); z-index: 45; }
  .menu-btn { display: inline-flex; padding: 8px; min-width: 42px; }
  .top { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .top .who, .top .stelpill { display: none; }
  .search { flex: 1 1 0; }
  .search kbd { display: none; }
  .crumbs { padding: 14px 16px 0; }
  .page { padding: 12px 16px 72px; }
  h1 { font-size: 25px; }
  .lede { font-size: 17px; }
  .cols2, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi .v { font-size: 21px; }
  .activity li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .g-row { grid-template-columns: 96px minmax(0, 1fr); }
  .dims { grid-template-columns: 1fr 1fr; }
  .dims > div:nth-child(2) { border-right: 0; }
  .dims > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workitem { grid-template-columns: 1fr 1fr; }
  .workitem > :first-child { grid-column: 1 / -1; }
  .park-progress { align-items: flex-start; }
  .mobilebar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 15; }
  .mobilebar button { flex: 1; min-height: 46px; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
}

/* ---- impresión: alzado 2D en lugar de la escena 3D ---- */
@media print {
  .side, .top, .crumbs, .tabs, .stage-hint, .tags, .backdrop, .mobilebar, #toast { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; }
  .maq[data-render="3d"] .alzado { display: block; }
  .stage canvas, .stage-ctl, .stage-bar { display: none !important; }
  .maq-grid { grid-template-columns: 1fr; }
}
/* =====================================================================
   1.4 · LIMPIEZA, BELLEZA, USABILIDAD
   Misma paleta y tipografía; menos líneas, más aire, superficies suaves
   y palabras llanas. Este bloque va al final y manda sobre lo anterior.
   ===================================================================== */
:root { --r-lg: 16px; --r: 10px; --soft: 0 1px 2px rgba(15, 18, 20, .05), 0 6px 18px -10px rgba(15, 18, 20, .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .6); } }
body { font-size: 16px; line-height: 1.55; }
h1 { font-size: 34px; }
h2 { font: 600 20px/1.3 var(--serif); color: var(--brand-ink); margin: 2.2rem 0 .9rem; }
.lede { font: 400 19px/1.5 var(--sans); color: var(--muted); margin: .4rem 0 1.4rem; }
.page { padding: 28px 44px 96px; max-width: 1200px; }
.page.narrow { max-width: 860px; }
.small { font-size: 14px; }
.ic.sm { width: 15px; height: 15px; }

/* menú */
.side { padding: 26px 14px 18px; gap: 18px; }
.side .brand b { font-size: 24px; }
.side .brand span { display: block; margin-top: 4px; line-height: 1.35; }
.nav a { min-height: 44px; font-size: 15.5px; }
.nav .grp { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; padding: 18px 10px 6px; }
.nav a.pk { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 3px; row-gap: 5px; column-gap: 8px; min-height: 40px; padding: 7px 10px 8px; font-size: 14.5px; font-weight: 500; }
.nav a.pk .count { margin-left: 0; }
.pk-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--sd-line); overflow: hidden; }
.pk-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.nav a.pk[aria-current="page"] .pk-bar { background: #D8D3C2; }
.nav a.pk[aria-current="page"] .pk-bar i { background: var(--ok); }

/* barra superior */
.top { border-bottom: 0; background: var(--bg); padding: 14px 44px; }
.top .who { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.search { flex: 0 1 460px; }
.search input[type=search] { border-radius: 999px; border-color: var(--line); background: var(--surface); box-shadow: var(--soft); min-height: 44px; padding-right: 16px; }
.crumbs { padding: 22px 44px 0; }

/* controles */
button, .btn { border-radius: 999px; padding: 10px 18px; min-height: 44px; font-size: 15px; }
button.small, .btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.big, button.big { min-height: 50px; padding: 12px 24px; font-size: 16px; }
button.icon-btn { padding: 0; width: 40px; min-width: 40px; min-height: 40px; border-radius: 50%; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=datetime-local], select, textarea { border-radius: 12px; min-height: 46px; font-size: 16px; border-color: var(--line-strong); }
.notice { background: var(--accent-soft); border: 0; border-radius: 12px; padding: 12px 16px; }
.errbox { border: 0; border-radius: 12px; }
.chip { font-size: 13px; padding: 3px 11px; }
.chip.u { border-style: solid; border-color: var(--line-strong); }

/* superficies: sombra suave en vez de bordes */
.panel, .issue, .event, .doorlist, .tablewrap, .gantt, .door-panel, .map, .thumb, .kpi { border: 0; box-shadow: var(--soft); }
.panel { padding: 20px 22px; }
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.issue { padding: 18px 22px; margin-bottom: 14px; }
.issue h3, .issue-h h3 { font: 600 17px/1.3 var(--sans); }
.issue p { color: var(--muted); }
.issue[data-kind="REVALIDATION"] { box-shadow: inset 4px 0 0 var(--signal), var(--soft); }
.issue[data-kind="VALIDATION_PENDING"], .issue[data-kind="RECEIPT_PENDING"] { box-shadow: inset 4px 0 0 var(--tone-pending), var(--soft); }
.issue[data-kind="EVIDENCE_INCOMPLETE"] { box-shadow: inset 4px 0 0 var(--tone-progress), var(--soft); }
.linkcard { display: block; text-decoration: none; color: var(--ink); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.linkcard:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 18, 20, .06), 0 12px 26px -12px rgba(15, 18, 20, .28); }
.linkcard .issue-h .ic { color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; }
ul.plain li { padding: 4px 0; color: var(--muted); }
ul.plain li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); margin: 0 10px 2px 0; }
.doorpills { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.doorpill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 14px; border-radius: 999px; background: var(--sunk); color: var(--ink); text-decoration: none; font-size: 14.5px; }
.doorpill b { font-weight: 600; }
.doorpill span { color: var(--muted); }
.doorpill .ic { color: var(--muted); }
.doorpill:hover { background: var(--accent-soft); }
.doorpill.act { background: var(--accent); color: var(--on-accent); }
.doorpill.act span, .doorpill.act .ic { color: var(--on-accent); opacity: .75; }
.empty-ok { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--ok-soft); color: var(--ok); border-radius: var(--r-lg); font-weight: 600; }
.empty-ok p { margin: 0; }
.empty-ok .ic { width: 28px; height: 28px; stroke-width: 2.2; }
p.empty { padding: 14px 0; }

/* inicio */
.home h1 { margin-top: 4px; }
.hero-card { display: flex; align-items: center; gap: 44px; padding: 28px 34px; background: var(--surface); border-radius: 22px; box-shadow: var(--soft); margin: 4px 0 8px; }
.pring { width: 150px; height: 150px; flex: none; }
.ring-bg { fill: none; stroke: var(--sunk-2); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--ok); stroke-width: 12; stroke-linecap: round; }
.ring-n { font: 600 30px var(--serif); fill: var(--brand-ink); }
.ring-l { font: 500 12px var(--sans); fill: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 40px; flex: 1; }
.stat .v { font: 600 32px/1.1 var(--serif); color: var(--ink); }
.stat .k { font-size: 15px; color: var(--muted); margin-top: 4px; }
.stat .sub { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.stat.bad .sub { color: var(--signal); font-weight: 600; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0 0 14px; }
.facts dt { font-size: 13.5px; color: var(--muted); padding-top: 12px; }
.facts dd { margin: 2px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.facts dd:last-of-type { border-bottom: 0; }
.facts dd b { font-weight: 600; }

/* hoy */
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 600; color: var(--accent-ink); margin: 0 0 6px; }
.next-card { background: var(--surface); border-radius: 22px; box-shadow: inset 5px 0 0 var(--accent), var(--soft); padding: 24px 28px; margin: 0 0 8px; }
.next-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font: 600 34px/1.15 var(--serif); margin: 2px 0 12px; }
.next-id span { font: 500 18px var(--sans); color: var(--muted); }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 11px 4px; text-decoration: none; color: var(--ink); }
.row-link:hover { background: var(--accent-soft); border-radius: 10px; }
.row-link .when { margin-left: auto; color: var(--muted); font-size: 14px; }
.rows li.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; }
.rows li.row button { margin-left: auto; }

/* parques */
.parkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 6px 0 10px; }
.parkcard { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--soft); text-decoration: none; color: var(--ink); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.parkcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 18, 20, .06), 0 14px 28px -12px rgba(15, 18, 20, .3); }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; }
.pc-bar { height: 6px; border-radius: 6px; background: var(--sunk-2); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: 6px; background: var(--band-mid); min-width: 0; }
.pc-bar i.band-low { background: var(--band-low); } .pc-bar i.band-done { background: var(--band-done); }
.pc-foot { display: flex; justify-content: space-between; font-size: 14px; }
.map { max-height: 520px; }
.park-lbl { font-size: 13px; }
.attrib { display: block; margin-top: 2px; font-size: 12px; opacity: .8; }
.rule { background: transparent; border: 0; padding: 0; color: var(--muted); font-size: 14.5px; margin: 0 0 10px; }
.gantt-empty .muted { padding: 18px 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--soft); }

/* parque */
.park-head { align-items: center; margin: 4px 0 6px; }
.park-progress { min-width: 220px; gap: 8px; align-items: stretch; }
.pp-n { text-align: right; }
.park-progress .big { font-size: 36px; }
.tabs { border-bottom: 0; gap: 6px; margin: 22px 0 18px; padding: 4px; background: var(--sunk); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabs a { border-bottom: 0; border-radius: 999px; padding: 8px 16px; color: var(--muted); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--soft); }
.dooritem { grid-template-columns: 5.5rem minmax(0, 1fr) auto auto; align-items: center; gap: 6px 16px; padding: 14px 18px; }
.dooritem .meta { grid-column: auto; font-size: 14.5px; }
.dooritem .ic { color: var(--muted); }
.thumbs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb { border-radius: 12px; }
.thumb img { height: 130px; }
.thumb.off img { opacity: .35; filter: grayscale(1); }
.thumb .cap:empty { display: none; }
.thumb .cap { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.doc-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 130px; background: var(--sunk); color: var(--muted); font-weight: 600; text-decoration: none; }
.doc-tile .ic { width: 32px; height: 32px; }

/* maqueta */
.seal-fold { margin: 0 0 12px; }
.seal-toggle { background: none; border: 0; min-height: 0; padding: 4px 0; border-radius: 6px; font: 400 14px var(--sans); color: var(--muted); gap: 8px; }
.seal-toggle:hover { background: none; color: var(--ink); }
.seal-toggle::before { content: "i"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--sunk-2); font: 600 11px var(--serif); color: var(--ink); }
/* El sello sigue en la página (lectores de pantalla y pruebas lo leen); a la vista, solo al pulsar. */
.seal-fold .seal:not(.open) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; border: 0; }
.seal-fold .seal.open { display: block; margin-top: 8px; }
.stage { border: 0; box-shadow: var(--soft); }
.gcell { border-radius: 12px; }

/* ficha de puerta */
.doorhead { align-items: center; margin-bottom: 6px; }
.doorhead h1 { font-size: 40px; }
.doorhead .sub { font-size: 16px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 22px 8px; margin: 18px 0 8px; background: var(--surface); border-radius: 22px; box-shadow: var(--soft); }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 6px; }
.steps li + li::before { content: ""; position: absolute; top: 17px; right: calc(50% + 24px); left: calc(-50% + 24px); height: 2px; background: var(--sunk-2); }
.steps li.done + li::before { background: var(--ok); }
.steps .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.steps li.done .dot { background: var(--ok); color: #fff; }
.steps li.half .dot { background: var(--tone-progress); color: var(--on-accent); }
.steps li.bad .dot { background: var(--signal); color: #fff; }
.steps .k { font-size: 13px; color: var(--muted); }
.steps .v { font-weight: 600; font-size: 15px; }
.worklist { list-style: none; padding: 0; margin: 10px 0 4px; }
.worklist li { padding: 4px 0 4px 18px; position: relative; }
.worklist li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.warnline { color: var(--signal); }
.event { padding: 16px 20px; }
.event .actions { margin: 10px 0 0; }
.fold { margin: 22px 0 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--soft); padding: 0 20px; }
.fold > summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: 4px; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold[open] { padding-bottom: 18px; }
.fold h3 { margin-top: 18px; color: var(--brand-ink); }
.fold.small-fold { box-shadow: none; background: var(--bg); padding: 0 14px; margin-top: 10px; }
.fold.more { margin-top: 34px; }
.oblist { list-style: none; padding: 0; margin: 0; }
.oblist li { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.oblist .req { margin: 0; }
.oblist .small { margin: 2px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards .issue { margin: 0; }

/* contrato */
.facts-list { list-style: none; padding: 0; margin: 10px 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--soft); }
.facts-list li { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.facts-list li:last-child { border-bottom: 0; }
.f-main { min-width: 0; }
.f-k { margin: 0; font-size: 14px; color: var(--muted); }
.f-v { margin: 2px 0; font: 600 18px/1.35 var(--sans); overflow-wrap: anywhere; }
.f-v .muted { font-weight: 400; }
.f-main .small { margin: 2px 0 0; }
.f-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
details.src { margin-top: 4px; }
details.src summary { cursor: pointer; font-size: 13.5px; color: var(--muted); width: fit-content; }
details.src p { margin: 4px 0 0; }

/* historial */
.activity { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--soft); overflow: hidden; }
.activity li { padding: 14px 18px; }
.activity li:last-child { border-bottom: 0; }

/* diálogo */
dialog { border-radius: 22px; }
dialog .dh, dialog .df { border: 0; }
dialog .dh { padding: 18px 22px 8px; }
dialog .db { padding: 10px 22px 18px; }
dialog .df { padding: 14px 22px 18px; box-shadow: 0 -10px 20px -18px rgba(0, 0, 0, .4); }
.lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--bg); cursor: pointer; font-weight: 500; margin: 0; }
.file-drop:hover { border-color: var(--accent-ink); background: var(--accent-soft); }
.file-drop .ic { width: 30px; height: 30px; color: var(--accent-ink); }
.file-drop b { display: block; font-size: 16px; }
.file-drop small { color: var(--muted); font-weight: 400; }
.field:focus-within .file-drop { outline: 2px solid var(--focus); outline-offset: 2px; }
.uplist li { display: flex; align-items: center; gap: 8px; border-bottom: 0; color: var(--ok); }
.uplist li span { color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.uplist li.err { color: var(--signal); }
.doorres-list { display: flex; flex-direction: column; gap: 6px; }
.doorres { padding: 6px 10px; border: 0; border-radius: 12px; background: var(--bg); }
.doorres.on { background: var(--accent-soft); }
.doorres .check { gap: 10px; }
.doorres select { width: auto; min-width: 150px; }
.workitem { grid-template-columns: minmax(0, 1fr) 7rem 6rem auto; border: 0; border-radius: 14px; padding: 12px; }
.wi-line { grid-column: 1 / -1; }
.dlg-photo { max-width: 100%; max-height: 300px; display: block; margin: 0 0 12px; border-radius: 12px; }

/* acceso */
.login { border: 0; box-shadow: var(--soft); border-radius: 22px; padding: 36px 34px; }
.login h1 { font-size: 28px; }

#toast { border-radius: 999px; padding: 12px 22px; }

@media (max-width: 1180px) {
  .hero-card { gap: 28px; }
}
@media (max-width: 900px) {
  .top { padding: 10px 14px; flex-wrap: nowrap; }
  .top .who { display: none; }
  .crumbs { padding: 14px 16px 0; }
  .page { padding: 16px 16px 96px; }
  h1 { font-size: 28px; }
  .doorhead h1 { font-size: 32px; }
  .lede { font-size: 17px; }
  .hero-card { flex-direction: column; align-items: stretch; gap: 18px; padding: 22px 20px; text-align: center; }
  .pring { margin: 0 auto; width: 132px; height: 132px; }
  .stats { gap: 10px; }
  .stat .v { font-size: 26px; }
  .stat .k { font-size: 13.5px; }
  .next-card { padding: 20px; }
  .next-id { font-size: 28px; }
  .doorhead .actions { width: 100%; }
  .doorhead .actions .big { flex: 1 1 100%; }
  .steps { padding: 18px 2px; }
  .steps .v { font-size: 13px; }
  .steps .k { font-size: 12px; }
  .steps li + li::before { right: calc(50% + 20px); left: calc(-50% + 20px); }
  .dooritem { grid-template-columns: minmax(0, 1fr) auto; }
  .dooritem .meta { grid-column: 1 / -1; grid-row: 2; }
  .dooritem .chips { grid-column: 1 / -1; grid-row: 3; }
  .dooritem > .ic { grid-row: 1; grid-column: 2; }
  .park-progress { min-width: 0; width: 100%; }
  .pp-n { text-align: left; }
  .tabs { width: auto; }
  .facts-list li { flex-direction: column; align-items: stretch; }
  .f-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .workitem { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .workitem .wi-what { grid-column: 1 / -1; }
  .doorres { grid-template-columns: minmax(0, 1fr) 9.5rem; }
  .doorres select { width: 100%; min-width: 0; }
  .mobilebar button { border-radius: 999px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
