: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; }
}

@media screen {
  :root {
    --background: #09141b;
    --surface: #11232c;
    --inset: #0c1b24;
    --border: #29434e;
    --text: #f0faf8;
    --muted: #a9bec6;
    --accent: #82e9cc;
    --primary: #087452;
  }
  .site-header { background: #0d1b23; }
  .masthead { padding-block: 17px 12px; }
  nav { gap: 5px; }
  nav button { padding-inline: 12px; }
  nav button:hover { background: #172e39; }
  .hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 290px;
    display: grid;
    align-items: center;
    padding: clamp(22px, 5vw, 58px);
    border: 1px solid #345864;
    border-radius: 20px;
    background: linear-gradient(112deg, #10242d 24%, #12343e 66%, #143e47);
  }
  .hero-content { position: relative; z-index: 1; }
  .hero h1 { font-size: clamp(2rem, 5vw, 4.4rem); letter-spacing: -.055em; max-width: 16ch; }
  .hero h1 span { display: block; color: var(--accent); }
  .hero p { max-width: 45ch; color: #c6dbdc; }
  .hero .actions { margin-top: 20px; }
  .hero [data-go="captura"] { background: var(--accent); color: #102a25; }
  .hero-secondary, .secondary { background: #172f3a; border-color: #42626b; }
  .hero-contours {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background: repeating-linear-gradient(90deg, transparent 0 47px, #81dac110 47px 48px),
                repeating-linear-gradient(0deg, transparent 0 47px, #81dac110 47px 48px);
    mask-image: linear-gradient(90deg, transparent 34%, #000 67%);
  }
  .hero-contours i {
    position: absolute;
    top: 49%;
    left: 78%;
    width: calc(var(--size) * 1px);
    height: calc(var(--size) * .64px);
    transform: translate(-50%, -50%) rotate(-37deg);
    border: 1px solid #81dac15e;
    border-radius: 56% 44% 67% 33% / 47% 58% 42% 53%;
  }
  .hero-contours i:nth-child(1) { --size: 145; background: #88e3c622; }
  .hero-contours i:nth-child(2) { --size: 206; }
  .hero-contours i:nth-child(3) { --size: 268; }
  .hero-contours i:nth-child(4) { --size: 333; }
  .hero-contours i:nth-child(5) { --size: 406; }
  .hero-contours i:nth-child(6) { --size: 486; }
  .metrics { gap: 12px; margin-block: 16px; }
  .metrics article { min-width: 0; border-top: 2px solid #69cbb0; }
  .metrics article:nth-child(2) { border-top-color: #ffd17e; }
  .metrics article:nth-child(3) { border-top-color: #8dcaff; }
  .metrics small { display: block; font: 650 .84rem/1.3 system-ui, sans-serif; }
  .metrics strong { margin-top: 9px; }
  .dashboard { gap: 16px; }
  .panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
  .panel-heading h2 { margin: 0; }
  .text-button { color: var(--accent); background: transparent; padding: 5px 8px; }
  #recent .record-card { padding: 12px 14px; }
  #recent .empty { margin: 0; padding: 12px 14px; background: var(--inset); border: 1px dashed var(--border); border-radius: 8px; }
  input, select, textarea { padding: 10px 12px; }
  #gps { margin-bottom: 12px; }
}
@media screen and (max-width: 700px) {
  nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  nav button { white-space: normal; min-height: 44px; }
  .hero-contours { opacity: .55; mask-image: linear-gradient(90deg, transparent 53%, #000); }
}
@media screen and (max-width: 500px) {
  .hero { min-height: auto; }
  .hero .actions { flex-direction: column; align-items: stretch; }
  .metrics { gap: 6px; }
  .metrics small { font-size: .73rem; }
  .metrics article { padding: 9px; }
}

.brand { gap: clamp(8px, 2vw, 16px); min-width: 0; }
.brand-logo-frame {
  position: relative;
  display: block;
  flex: 0 0 clamp(96px, 13vw, 150px);
  aspect-ratio: 1.7;
  overflow: hidden;
  border: 1px solid #dce8e2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 12px #0004;
}
.brand-logo {
  position: absolute;
  inset: 50% auto auto 50%;
  display: block;
  width: 122%;
  height: auto;
  transform: translate(-50%, -50%);
}
.masthead > button { flex-shrink: 0; }
@media screen and (max-width: 420px) {
  .brand strong { font-size: .98rem; }
  .brand p { font-size: .72rem; line-height: 1.25; }
  .masthead { gap: 6px; }
}
.session-layout { display:grid; justify-items:center; padding-block:clamp(10px,5vw,54px); }
.session-panel { width:min(100%, 510px); padding:clamp(18px,4vw,34px); }
.session-panel .grid { grid-template-columns:1fr; }
.session-panel form { margin-bottom:12px; }
.session-panel #logout { margin-right:8px; }
.research-link { color: var(--accent); text-underline-offset: .2em; }
#gemini-prompt { margin-top: 8px; }
