:root {
  color-scheme: dark;
  --bg: #100e15;
  --panel: #18151f;
  --line: #2f293a;
  --text: #f5eef7;
  --muted: #b3a7bf;
  --pink: #f3a6cd;
  --green: #a1dfc5;
  --gold: #f3c995;
  --red: #f3a4ad;
  --sans: Inter, 'Segoe UI', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, .settings input:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
h1, h2, p { margin: 0; }
svg { width: 1em; height: 1em; flex: none; vertical-align: -0.14em; }
.shell { width: min(1184px, calc(100% - 72px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #282230; background: #131018; }
.topbar-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 650; letter-spacing: -0.03em; }
.brand-icon { display: grid; place-items: center; border: 1px solid #57344b; border-radius: 12px; width: 35px; height: 35px; color: var(--pink); background: #2d1c2b; font-size: 22px; }
.demo { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #503449; border-radius: 100px; padding: 5px 11px; color: #f1b6d6; background: #2b1c29; font-size: 12px; font-weight: 600; white-space: nowrap; }
.demo i, .legend i, .condition-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--pink); display: inline-block; }

.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 258px; display: flex; align-items: center; margin-top: 26px; border: 1px solid #483246; border-radius: 22px; background: #201421 url('assets/nebuleuse.jpg') center 51% / cover; }
.hero::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #120e17f5 0%, #160f19df 26%, #1b11245c 58%, #160d200d 100%), linear-gradient(0deg, #100c17ab 0%, transparent 60%); }
.hero-content { padding: 40px 49px; }
.location { color: #f5b8d6; font-size: 12px; font-weight: 650; letter-spacing: .105em; text-transform: uppercase; }
.location [data-icon] { font-size: 15px; margin-right: 3px; }
.hero h1 { font: 400 clamp(42px, 6.1vw, 79px)/1.06 var(--serif); letter-spacing: -.055em; margin: 11px 0 12px; color: #fff5f9; text-wrap: balance; }
.hero h1 span { color: var(--pink); }
.hero-description { color: #e4cfe2; font-size: 16px; }

.toolbar, .night-controls, .refresh-controls { display: flex; align-items: center; }
.toolbar { gap: 14px; justify-content: space-between; margin-block: 22px 15px; flex-wrap: wrap; }
.night-controls, .refresh-controls { gap: 13px; }
.segmented { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.segmented button { border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; min-height: 36px; color: var(--muted); background: transparent; font-size: 13px; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented [aria-pressed='true'] { background: #392638; color: #ffdbec; border-color: #5b3b55; }
.night-date, .updated { color: var(--muted); font-size: 12px; }
.refresh { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid #594054; background: #241b29; color: #f3c6e0; font-size: 13px; white-space: nowrap; }
.refresh:hover { background: #382638; }
.refresh:disabled { opacity: .65; cursor: wait; }
.refresh svg { font-size: 15px; }
.heater-control { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.heater-control input { accent-color: var(--pink); width: 16px; height: 16px; margin: 0; }
.settings { margin-top: 14px; padding: 12px 14px; font-size: 13px; }
.site-picker { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.site-picker label { font-weight: 650; }
.site-picker select {
  width: min(290px, 100%); min-height: 44px; border: 1px solid #594054; border-radius: 10px;
  background: #241b29; color: var(--text); padding: 7px 10px; font: inherit; font-size: 16px; cursor: pointer;
}
.site-picker .metric-note { margin: 0; }
.settings details { margin-top: 7px; }
.settings summary { width: fit-content; padding-block: 4px; cursor: pointer; color: var(--pink); }
.settings form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; }
.settings form label { display: grid; gap: 4px; color: var(--muted); }
.settings input { width: 120px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); padding: 8px; font: inherit; font-size: 16px; }
.settings input[name='label'] { width: min(230px, 100%); }
.forecast-message { background: var(--panel); color: var(--gold); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 10px 14px; }
#window-comparison { margin-top: 4px; color: var(--pink); }
footer a { color: var(--muted); }

.summary { display: grid; grid-template-columns: 1.18fr repeat(3, 1fr); gap: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.summary .card { padding: 17px 18px 16px; min-width: 0; }
.window-card { background: linear-gradient(135deg, #2b1d2e, #1f1827); border-color: #60415b; }
.frost-card { background: linear-gradient(150deg, #271e25, var(--panel) 85%); }
.card-heading, .optics-heading { display: flex; align-items: center; gap: 10px; }
.card-heading h2 { font-size: 13px; font-weight: 600; color: #e0d3e5; }
.tile-icon { width: 34px; height: 34px; display: grid; flex: none; place-items: center; border-radius: 9px; font-size: 17px; }
.pink { background: #4a2842; color: #fdb6d9; }
.purple { background: #362c4d; color: #d0baff; }
.blue { background: #233249; color: #a9ccfa; }
.gold { background: #42312c; color: var(--gold); }
.metric { font-size: clamp(23px, 3vw, 34px); font-weight: 650; letter-spacing: -.045em; line-height: 1.16; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.window-time { color: #fbd1e6; }
.frost-card .metric { color: var(--gold); }
.metric-note { color: var(--muted); font-size: 12px; }

.timeline-card, .optics-card { margin-top: 16px; padding: 20px 21px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-heading h2 { font-weight: 650; font-size: 20px; letter-spacing: -.025em; }
.section-heading p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.legend { display: flex; gap: 13px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .low, .condition-dot.low { background: var(--green); }
.legend .medium, .condition-dot.medium { background: var(--gold); }
.legend .high, .condition-dot.high { background: var(--red); }
.timeline { display: flex; gap: 6px; }
.row-labels { display: grid; flex: 0 0 116px; grid-template-rows: repeat(6, 37px); color: var(--muted); font-size: 12px; }
.row-labels > span { display: flex; align-items: center; gap: 7px; border-bottom: 1px solid #282332; white-space: nowrap; }
.row-labels > span:last-child { border: 0; }
.row-labels svg { color: #b4a0c8; font-size: 14px; }
.hours-scroll { flex: 1; min-width: 0; overflow-x: auto; scrollbar-color: #634660 #211b2b; }
.hours { display: grid; grid-template-columns: repeat(var(--hour-count, 11), minmax(62px, 1fr)); gap: 4px; }
.hour { width: 100%; min-width: 0; display: grid; grid-template-rows: repeat(6, 37px); padding: 0; text-align: center; border: 0; border-radius: 9px; outline: 1px solid transparent; outline-offset: -1px; background: transparent; font-size: 13px; color: #dfd3e8; font-variant-numeric: tabular-nums; }
.hour > span { display: grid; place-items: center; border-bottom: 1px solid #282332; }
.hour > span:last-child { border: 0; }
.hour .hour-time { font-weight: 700; color: var(--text); }
.hour.in-window { background: #251c30; }
.hour:hover { background: #332339; }
.hour[aria-pressed='true'] { background: #39263e; outline-color: #aa719f; }
.hour[aria-pressed='true'] .hour-time { color: #ffd4e9; }
.hour:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; }
.subzero { color: #bbd5ff; }

.optics-heading .tile-icon { width: 40px; height: 40px; font-size: 21px; }
.optics-status { border-radius: 100px; padding: 5px 10px; border: 1px solid currentColor; line-height: 1.2; font-size: 12px; }
.optics-status.low { color: var(--green); }.optics-status.medium { color: var(--gold); }.optics-status.high { color: var(--red); }
.optics-values { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); padding-top: 13px; gap: 14px; }
.optics-reading span { display: block; color: var(--muted); font-size: 12px; }
.optics-reading strong { font-size: 21px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.optics-explanation { font-size: 13px; color: #e0cfe6; margin-top: 14px; }
.method { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 11px; font-size: 13px; color: var(--muted); }
.method summary { display: list-item; width: fit-content; cursor: pointer; color: #e5b5d4; }
.method p { margin-top: 9px; max-width: 84ch; }
footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; padding-block: 18px 26px; }

@media (max-width: 850px) {
  .shell { width: calc(100% - 40px); }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .metric { font-size: 30px; }
  .hours-scroll { padding-bottom: 6px; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { min-height: 59px; }
  .brand { font-size: 17px; }
  .brand-icon { width: 32px; height: 32px; }
  .demo { font-size: 11px; padding-inline: 8px; }
  .hero { min-height: 208px; margin-top: 15px; border-radius: 16px; background-position: 60% 50%; }
  .hero::before { background: linear-gradient(90deg, #140e19ed, #1b112388 76%, #160d2059), linear-gradient(0deg, #100c17af 0%, transparent 65%); }
  .hero-content { padding: 25px 19px; }
  .location { font-size: 10px; }
  .hero h1 { font-size: clamp(30px, 9.5vw, 51px); }
  .hero-description { font-size: 13px; }
  .site-picker { display: grid; }
  .site-picker select { width: 100%; }
  .toolbar { gap: 8px; margin-block: 14px 11px; }
  .night-controls { width: 100%; justify-content: space-between; gap: 5px; }
  .refresh-controls { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 5px 8px; }
  .refresh-controls .updated { order: 1; width: 100%; text-align: right; }
  .night-date, .updated { font-size: 10px; }
  .segmented button { padding-inline: 10px; }
  .refresh { min-height: 44px; }
  .summary { gap: 8px; }
  .summary .card { padding: 11px; }
  .card-heading { gap: 7px; min-height: 29px; }
  .card-heading h2 { font-size: 11px; line-height: 1.2; }
  .tile-icon { width: 28px; height: 28px; font-size: 15px; }
  .metric { font-size: clamp(19px, 5.5vw, 27px); margin-top: 8px; }
  .metric-note { font-size: 11px; }
  .timeline-card, .optics-card { margin-top: 11px; padding: 14px 12px; }
  .section-heading h2 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .legend { gap: 9px; }
  .row-labels { flex-basis: 77px; font-size: 11px; }
  .row-labels > span { gap: 4px; }
  .row-labels svg { font-size: 12px; }
  .optics-values { grid-template-columns: repeat(3, 1fr); }
  .optics-reading strong { font-size: 18px; }
  footer { font-size: 10px; }
}

