:root {
  color-scheme: dark;
  --background: #0a1020;
  --surface: #141e30;
  --inset: #101829;
  --border: #2b3951;
  --text: #edf5ff;
  --muted: #a5b5cc;
  --accent: #62e5bc;
  --primary: #087452;
  --mono: ui-monospace, Consolas, monospace;
  font: 15px/1.55 system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.status-strip { background: var(--background); border-bottom: 1px solid var(--border); }
.status-strip .shell { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 7px; font: 12px/1.55 var(--mono); color: var(--muted); }
#connection { color: var(--accent); white-space: nowrap; }
#connection[data-offline] { color: #ffd17e; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px 10px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { font-size: 1.3rem; letter-spacing: .055em; }
.brand p { margin: 0; color: var(--muted); font-size: .82rem; }
.brand-mark { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; background: #193b41; border: 1px solid #2b665d; color: var(--accent); font-size: 24px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-bottom: 10px; }
button { font: inherit; font-weight: 700; cursor: pointer; border: 1px solid transparent; border-radius: 8px; background: var(--primary); color: white; padding: 9px 13px; min-height: 42px; }
button:hover { filter: brightness(1.17); }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
nav button { color: var(--muted); background: transparent; text-align: left; font-size: .88rem; }
nav button[aria-current] { color: var(--accent); background: #173637; border-color: #2c645c; }
.secondary, .hero-secondary { background: #202e44; border-color: #3a4b66; color: var(--text); }
.content { padding-block: 24px 60px; }
h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.035em; }
h2 { margin: 0 0 10px; font-size: 1.12rem; }
h3 { margin: 0; font-size: 1rem; }
p { color: var(--muted); margin-block: .6em 1em; }
.hero, .panel, article { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 19px; }
.hero { border-left: 3px solid #44b49a; padding: clamp(17px, 3vw, 27px); background: linear-gradient(105deg, #142a38, var(--surface) 68%); }
.hero p { max-width: 68ch; }
.eyebrow { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border: 1px solid #2a6158; border-radius: 5px; background: #153736; color: var(--accent); font: 700 .75rem/1.55 var(--mono); letter-spacing: .06em; }
#status:empty { display: none; }
#status { padding: 9px 12px; border: 1px solid #2b665d; background: #173537; border-radius: 8px; color: var(--text); }
.metrics, .wireframes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-block: 14px; }
.metrics small, .record-card small { color: var(--muted); font: .77rem/1.55 var(--mono); }
.metrics strong { display: block; font: 700 1.8rem/1.2 var(--mono); margin-top: 5px; color: var(--accent); }
.metrics article:nth-child(2) strong { color: #ffd17e; }
.metrics article:nth-child(3) strong { color: #8dcaff; }
.dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.panel { margin-block: 14px; }
.dashboard > .panel { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
label { display: grid; gap: 5px; font-weight: 650; margin-bottom: 12px; }
input, select, textarea { font: inherit; color: var(--text); border: 1px solid #435671; border-radius: 7px; padding: 9px; width: 100%; min-width: 0; background: var(--inset); }
textarea { min-height: 100px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.records, #recent { display: grid; gap: 10px; }
#explore-results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
.record-card { background: var(--inset); overflow-wrap: anywhere; }
.record-card p { margin: 4px 0; white-space: pre-wrap; }
.record-card .reading, .record-card summary { color: var(--accent); font-weight: 700; }
.record-card details { margin-top: 9px; }
.record-card summary { cursor: pointer; }
.wireframes article { display: grid; gap: 8px; }
.wireframes span, .wireframes b, .flow p { background: var(--inset); border: 1px solid var(--border); padding: 8px; border-radius: 6px; }
.flow li { padding-block: 4px; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .dashboard, .wireframes { grid-template-columns: 1fr; }
  nav { flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px 9px; }
  nav button { white-space: nowrap; }
}
@media (max-width: 500px) {
  .grid { grid-template-columns: 1fr; }
  .metrics { gap: 6px; }
  .metrics article { padding: 8px; }
  .metrics small { font-size: .66rem; overflow-wrap: anywhere; }
  .status-strip .shell { font-size: .7rem; }
  .masthead button { font-size: .78rem; padding-inline: 7px; }
}
@media print {
  :root { color-scheme: light; --text: black; --muted: #303030; --surface: white; --inset: white; --border: #bbb; background: white; }
  .site-header, #status, #reportes > .panel, #reportes .section-intro p, .record-card summary { display: none !important; }
  .content { width: 100%; padding: 0; }
  .record-card { break-inside: avoid; }
  .record-card .reading { color: black; }
}
