/* BiruNet — panel. Tinta sobre papel, líneas finas y sombras apiladas; Geist para leer, Geist Mono para lo técnico. */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

[hidden] { display: none !important; }
:root {
  --bg: #fafafa; --surface: #ffffff; --surface-2: #f5f5f5; --surface-3: #ededed;
  --line: #eaeaea; --line-2: #d9d9d9;
  --text: #171717; --muted: #666666; --faint: #8f8f8f;
  --ink: #171717; --on-ink: #ffffff; --ink-hover: #383838;
  --blue: #0068d6; --green: #16794a; --amber: #a35200; --red: #cb2a2f; --violet: #7928ca; --teal: #067a6e;
  --green-dot: #1fa463; --amber-dot: #f5a623; --red-dot: #e5484d;
  --red-soft: #fdecec; --amber-soft: #fff6e0;
  --ring: 0 0 0 1px rgb(0 0 0 / .08);
  --e1: var(--ring), 0 1px 1px rgb(0 0 0 / .02), 0 2px 2px rgb(0 0 0 / .04);
  --e3: var(--ring), 0 1px 1px rgb(0 0 0 / .02), 0 8px 16px -4px rgb(0 0 0 / .06), 0 24px 32px -8px rgb(0 0 0 / .08);
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #0a0a0a; --surface-2: #151515; --surface-3: #1f1f1f;
  --line: #1f1f1f; --line-2: #2e2e2e;
  --text: #ededed; --muted: #a1a1a1; --faint: #707070;
  --ink: #ededed; --on-ink: #0a0a0a; --ink-hover: #cfcfcf;
  --blue: #52a8ff; --green: #5ccf97; --amber: #f5b14c; --red: #ff6369; --violet: #bf7af0; --teal: #45d6c3;
  --green-dot: #3ecf8e; --amber-dot: #f5a623; --red-dot: #ff5a61;
  --red-soft: #2a1114; --amber-soft: #2a1d08;
  --ring: 0 0 0 1px rgb(255 255 255 / .1);
  --e1: var(--ring);
  --e3: var(--ring), 0 8px 16px -4px rgb(0 0 0 / .5), 0 24px 48px -8px rgb(0 0 0 / .6);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #000000; --surface: #0a0a0a; --surface-2: #151515; --surface-3: #1f1f1f;
  --line: #1f1f1f; --line-2: #2e2e2e;
  --text: #ededed; --muted: #a1a1a1; --faint: #707070;
  --ink: #ededed; --on-ink: #0a0a0a; --ink-hover: #cfcfcf;
  --blue: #52a8ff; --green: #5ccf97; --amber: #f5b14c; --red: #ff6369; --violet: #bf7af0; --teal: #45d6c3;
  --green-dot: #3ecf8e; --amber-dot: #f5a623; --red-dot: #ff5a61;
  --red-soft: #2a1114; --amber-soft: #2a1d08;
  --ring: 0 0 0 1px rgb(255 255 255 / .1);
  --e1: var(--ring);
  --e3: var(--ring), 0 8px 16px -4px rgb(0 0 0 / .5), 0 24px 48px -8px rgb(0 0 0 / .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/20px var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { min-height: 100vh; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--ink); color: var(--on-ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
strong { font-weight: 600; }
.skip { position: fixed; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---- estructura ---- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px 12px; border-right: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; }
.brand .mark { width: 26px; height: 26px; flex: none; color: var(--text); }
.brand b { display: block; font-weight: 600; letter-spacing: -.02em; font-size: 15px; line-height: 18px; }
.brand small { display: block; color: var(--faint); font: 11px/14px var(--mono); margin-top: 1px; }
.find { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; margin-bottom: 10px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--ring); color: var(--faint); cursor: pointer; text-align: left; }
.find:hover { color: var(--muted); background: var(--surface-2); }
.find span { flex: 1; }
kbd { font: 11px/16px var(--mono); padding: 0 5px; border-radius: 4px; background: var(--surface-2); box-shadow: var(--ring); color: var(--muted); }
.nav a.item, .nav button.item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: none; text-decoration: none; color: var(--muted); cursor: pointer; width: 100%; text-align: left; }
.nav .item:hover { background: var(--surface-2); color: var(--text); }
.nav .item[aria-current="page"] { background: var(--surface-3); color: var(--text); font-weight: 500; }
.nav svg, .find svg { width: 16px; height: 16px; flex: none; }
.nav .spacer { flex: 1; }
.nav .foot { display: flex; align-items: center; gap: 4px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--line); }
.nav .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 4px; font-weight: 500; }
.nav .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.icon-btn { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

main { padding: 32px 40px 80px; max-width: 1240px; width: 100%; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.head-main { min-width: 0; }
.head h1 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0; letter-spacing: -.04em; text-wrap: balance; overflow-wrap: anywhere; }
.head p { margin: 4px 0 0; color: var(--muted); }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--text); }
.crumb svg { width: 14px; height: 14px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 6px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.meta li { display: inline-flex; align-items: center; gap: 6px; }
.meta li + li { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line-2); }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.02em; }
.sec { margin-top: 40px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.note { color: var(--muted); font-size: 13px; margin: 10px 0 0; max-width: 72ch; }

/* ---- superficies ---- */
.card { background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-md); padding: 20px; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* instrumentos: un solo panel partido por líneas, no tarjetas sueltas */
.meters { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-md); overflow: hidden; }
.meter { position: relative; padding: 16px 20px 18px; min-width: 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.meter:first-child { border-left: 0; }
.meter .label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.meter .label > span + span { color: var(--faint); font: 12px/20px var(--mono); white-space: nowrap; }
.meter .value { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.meter .value small { font-size: 14px; font-weight: 500; letter-spacing: -.01em; color: var(--muted); margin-left: 2px; }
.meter .value.sm { font-size: 18px; line-height: 28px; letter-spacing: -.02em; white-space: normal; overflow-wrap: anywhere; }
.meter .value.sm.mono { font: 500 14px/22px var(--mono); letter-spacing: 0; margin-top: 10px; }
.meter .value.ok { color: var(--green); } .meter .value.bad { color: var(--red); }
.meter .sub { color: var(--muted); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.meter .sub.mono { font-size: 12px; }
.bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 2px; transform-origin: left; }
.bar > i.warn { background: var(--amber-dot); } .bar > i.crit { background: var(--red-dot); }
.spark { display: block; width: 100%; height: 32px; margin-top: auto; overflow: visible; color: var(--faint); }
.meter > :has(+ .spark) { margin-bottom: 14px; }
.net { display: grid; gap: 2px; margin-top: 6px; }
.net div { display: flex; align-items: baseline; gap: 8px; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.net svg { width: 14px; height: 14px; align-self: center; }
.net .rx svg { color: var(--blue); } .net .tx svg { color: var(--violet); }

.chart-card { padding: 16px 20px 12px; }
.chart-card .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.chart-card .top strong { font-weight: 500; }
.chart { width: 100%; height: 132px; display: block; overflow: visible; touch-action: pan-y; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--faint); font: 10px var(--mono); }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 2px; border-radius: 1px; margin-right: 6px; vertical-align: middle; }
.tip { position: fixed; pointer-events: none; background: var(--surface); box-shadow: var(--e3); border-radius: var(--r-sm); padding: 8px 10px; font-size: 12px; line-height: 18px; z-index: 20; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip .when { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.tip i { display: inline-block; width: 8px; height: 2px; border-radius: 1px; margin-right: 6px; vertical-align: middle; }

/* avisos */
.notices { list-style: none; margin: 0 0 24px; padding: 0; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-md); overflow: hidden; }
.notices li { display: flex; gap: 10px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--line); }
.notices li:first-child { border-top: 0; }
.notices li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--amber-dot); transform: translateY(-1px); }
.notices li.bad::before { background: var(--red-dot); }
.notices li.bad { background: var(--red-soft); }

/* ---- tablas ---- */
.table-wrap { overflow-x: auto; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: 12px; line-height: 16px; background: var(--surface-2); white-space: nowrap; padding-top: 8px; padding-bottom: 8px; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td, tbody tr.link:focus-within td { background: var(--surface-2); }
td a.row-link { text-decoration: none; font-weight: 500; }
td a.row-link:hover { text-decoration: underline; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.tight { white-space: nowrap; width: 1%; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.wrap-any { overflow-wrap: anywhere; }
.small { font-size: 12px; line-height: 18px; }
.filter { position: relative; flex: 1 1 220px; max-width: 320px; }
.filter svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.filter input[type=search] { padding-left: 34px; height: 32px; }

/* ---- estados ---- */
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.pill.ok::before { background: var(--green-dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-dot) 18%, transparent); }
.pill.warn::before { background: var(--amber-dot); }
.pill.bad::before { background: var(--red-dot); }
.pill.chip { height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--ring); font-family: var(--mono); font-size: 12px; }
.tag { display: inline-block; font: 11px/18px var(--mono); padding: 0 6px; border-radius: 4px; background: var(--surface-2); box-shadow: var(--ring); color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.txt-ok { color: var(--green); } .txt-warn { color: var(--amber); } .txt-bad { color: var(--red); }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; font-family: var(--mono); font-size: 13px; color: inherit; border-radius: 4px; }
.copy svg { width: 12px; height: 12px; color: var(--faint); }
.copy:hover svg { color: var(--text); }

/* ---- botones y formularios ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: var(--surface); box-shadow: var(--ring); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .12s, opacity .12s; }
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn.primary:hover { background: var(--ink-hover); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.danger.solid { background: var(--red-dot); color: #fff; box-shadow: none; }
.btn.danger.solid:hover { background: var(--red); color: #fff; }
:root[data-theme="dark"] .btn.danger.solid:hover { color: #000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin .6s linear infinite; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn svg { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; flex-wrap: nowrap; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r-md); background: var(--surface-2); box-shadow: var(--ring); }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 5px; cursor: pointer; color: var(--muted); font: 12px var(--mono); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--e1); }
form.stack, .stack { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-weight: 500; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; line-height: 18px; }
.err { color: var(--red); font-size: 13px; margin: 0; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--surface); border: 0; box-shadow: var(--ring); border-radius: var(--r-sm); padding: 0 12px; height: 36px; width: 100%; transition: box-shadow .12s; }
select { background-color: var(--surface); color: var(--text); }
textarea { font-family: var(--mono); font-size: 13px; line-height: 20px; height: auto; min-height: 96px; padding: 8px 12px; resize: vertical; }
textarea.prose { font-family: var(--sans); font-size: 14px; min-height: 64px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { box-shadow: 0 0 0 1px var(--line-2); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 1px var(--blue), 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); flex: none; }
input[type=file] { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; color: var(--text); height: 32px; padding: 0 12px; margin-right: 12px; border: 0; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--ring); cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; }
.otp { font: 500 20px/1 var(--mono) !important; letter-spacing: .4em !important; text-align: center; height: 44px !important; padding-left: calc(12px + .4em) !important; }
.types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.types label { position: relative; box-shadow: var(--ring); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; background: var(--surface); }
.types label:hover { background: var(--surface-2); }
.types label:has(input:checked) { box-shadow: 0 0 0 2px var(--ink); }
.types label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.types input { position: absolute; opacity: 0; }
.types strong { font-weight: 500; }
.types span { color: var(--muted); font-size: 12px; line-height: 18px; }
.form-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span2 { grid-column: span 2; }
.record-form { display: grid; grid-template-columns: 1fr 110px 2fr 100px auto; gap: 12px; align-items: end; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin: 4px -20px -20px; padding: 14px 20px; background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
details > summary { cursor: pointer; color: var(--muted); width: fit-content; border-radius: 4px; }
details > summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 12px; }
.narrow { max-width: 800px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

pre.log { background: var(--surface); box-shadow: var(--e1); border-radius: var(--r-md); padding: 14px 16px; font: 12px/20px var(--mono); overflow: auto; max-height: 460px; white-space: pre-wrap; word-break: break-all; margin: 0; tab-size: 4; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 0 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-selected="true"] { color: var(--text); border-color: var(--ink); font-weight: 500; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: var(--r-md); min-height: 120px; }
.skeleton.line { min-height: 0; height: 12px; width: 180px; border-radius: 4px; margin-top: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---- diálogos, paleta y avisos flotantes ---- */
dialog { background: var(--surface); color: var(--text); border: 0; box-shadow: var(--e3); border-radius: var(--r-lg); padding: 24px; max-width: 460px; width: calc(100% - 32px); overscroll-behavior: contain; }
dialog[open] { animation: pop .16s var(--ease); }
dialog::backdrop { background: rgb(0 0 0 / .4); animation: fade .16s linear; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
dialog h3 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
dialog p { margin: 0; }
dialog .actions { margin: 4px -24px -24px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }
dialog.pal { padding: 0; max-width: 560px; margin-top: 14vh; overflow: hidden; }
.pal input { height: 48px; box-shadow: none !important; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 15px; padding: 0 16px; background: transparent; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; overscroll-behavior: contain; }
.pal li { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); cursor: pointer; }
.pal li svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pal li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal li small { color: var(--faint); font-size: 12px; }
.pal li[aria-selected="true"] { background: var(--surface-2); }
.pal .none { padding: 20px; text-align: center; color: var(--muted); }
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: var(--on-ink); border-radius: var(--r-md); padding: 10px 14px; font-weight: 500; box-shadow: var(--e3); opacity: 0; transform: translateY(8px); transition: opacity .16s, transform .16s var(--ease); pointer-events: none; z-index: 60; max-width: min(420px, calc(100% - 32px)); }
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: var(--red-dot); color: #fff; }

/* ---- entrada ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 24px 24px; background-position: center;
  -webkit-mask-image: none; }
.login::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at center, transparent 15%, var(--bg) 70%); pointer-events: none; }
.login-box { position: relative; width: 100%; max-width: 360px; }
.login .mark { width: 40px; height: 40px; display: block; margin: 0 auto 20px; }
.login h1 { text-align: center; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.04em; margin: 0; }
.login .lead { text-align: center; color: var(--muted); margin: 6px 0 28px; }
.login .card { padding: 24px; box-shadow: var(--e3); border-radius: var(--r-lg); }
.login .btn { height: 40px; width: 100%; }
.login .legal { text-align: center; color: var(--faint); font: 11px/16px var(--mono); margin-top: 20px; }

/* ---- adaptación ---- */
@media (max-width: 1100px) {
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meter:nth-child(odd) { border-left: 0; }
  .meter:nth-child(n+3) { border-top: 1px solid var(--line); }
  .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-form { grid-template-columns: 1fr 1fr; }
  .record-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--line); z-index: 10; gap: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .brand { padding: 0 8px 0 4px; } .brand div, .nav .spacer, .nav .who { display: none; }
  .find { width: 40px; min-width: 40px; height: 40px; margin: 0; justify-content: center; padding: 0; box-shadow: none; background: none; } .find span, .find kbd { display: none; }
  .nav a.item, .nav button.item { height: 40px; padding: 0 10px; white-space: nowrap; width: auto; }
  .nav .foot { border: 0; margin: 0 0 0 auto; padding: 0; }
  .nav .icon-btn, .icon-btn { width: 40px; height: 40px; }
  main { padding: 20px max(16px, env(safe-area-inset-right)) calc(56px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); scroll-margin-top: 60px; }
  .g3, .g2, .form-cols { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .btn { height: 40px; } .btn.sm { height: 36px; }
  input[type=text], input[type=password], input[type=number], input[type=search], select { height: 40px; font-size: 16px; }
  textarea { font-size: 16px; }
  .hide-sm { display: none; }
  .sec { margin-top: 32px; }
  #toast { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: none; }
  .head h1 { font-size: 22px; line-height: 28px; }
}
@media (max-width: 520px) {
  .meters { grid-template-columns: minmax(0, 1fr); }
  .meter { border-left: 0; } .meter + .meter { border-top: 1px solid var(--line); }
  .types, .record-form { grid-template-columns: minmax(0, 1fr); }
  .meta { gap: 2px 14px; } .meta li + li { margin-left: 0; padding-left: 0; border-left: 0; }
  th, td { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .skeleton { animation: none; }
}
