:root {
  color-scheme: dark;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  color: #e6edf6;
  background: #0b121c;
  --panel: #121e2c;
  --input: #0c1724;
  --border: #2b3b4d;
  --muted: #a4b4c7;
  --accent: #81e6cc;
  --accent-dark: #183c3c;
  --warm: #ffc68c;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, p, ul { margin: 0; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 680; letter-spacing: -.04em; }
h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: -.025em; }
h3 { font-size: 1.08rem; font-weight: 650; }
.container { width: min(100% - 48px, 1420px); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--border); background: #101b29; }
.masthead-inner { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead-note { font-size: .83rem; color: var(--muted); }
.masthead-home { font-size: .83rem; font-weight: 600; text-align: right; text-decoration: none; }
.masthead-home:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: clamp(300px, 27vw, 354px) minmax(0, 1fr); gap: 22px; align-items: start; padding-top: 25px; }
.settings, #results-body { display: grid; gap: 14px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.section-heading, .results-heading, .site-heading, .profile-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-heading { margin-bottom: 14px; }
.results-heading { margin: 1px 0 14px; }
.results-heading h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.045em; }
.results-heading p, .site-heading p, .profile-heading p { margin-top: 4px; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.full { grid-column: 1 / -1; }
label { display: block; font-size: .81rem; color: #c0cede; font-weight: 550; }
label input, label select { margin-top: 5px; }
input, select { border: 1px solid var(--border); min-height: 38px; padding: 6px 9px; border-radius: 7px; background: var(--input); color: inherit; width: 100%; min-width: 0; }
input::placeholder { color: #8f9eb1; }
button { cursor: pointer; border-radius: 8px; }
button:disabled { cursor: wait; opacity: .7; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary, .secondary { min-height: 38px; border: 1px solid transparent; padding: 7px 12px; font-weight: 650; white-space: nowrap; }
.primary { background: var(--accent); color: #09231f; }
.primary:hover { background: #a1f2dd; }
.secondary { background: #1b2a3b; color: #dce8f9; border-color: var(--border); }
.secondary:hover { background: #24384e; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 4px; font-size: .81rem; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.search-row { display: flex; gap: 7px; margin-top: 5px; }
.search-row input { flex: 1; }
.inline-status, .small-text { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.inline-status:empty { display: none; }
.inline-status:not(:empty) { margin-top: 6px; }
.error { color: var(--warm); }
.suggestions, .sites { list-style: none; padding: 0; }
.suggestions { margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.suggestions li + li { border-top: 1px solid var(--border); }
.suggestions button { width: 100%; text-align: left; padding: 8px; background: var(--input); color: inherit; border: 0; border-radius: 0; }
.suggestions button:hover { background: #203449; }
.suggestions small { display: block; margin-top: 2px; color: var(--muted); }
.coordinates { font-size: .83rem; margin-top: 10px; }
summary { color: var(--muted); cursor: pointer; }
.coordinates form { margin-top: 8px; }
.profile-settings { margin-top: 0; }
.profile-settings > .fields { margin-top: 10px; }
.sites { margin-top: 12px; display: grid; gap: 5px; }
.sites li { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; background: var(--input); border: 1px solid #253549; border-radius: 8px; }
.site-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .86rem; }
.site-name small { display: block; margin-top: 2px; color: var(--muted); font-size: .71rem; }
.remove { background: transparent; color: var(--muted); border: 0; min-width: 30px; min-height: 30px; font-size: 1.12rem; }
.remove:hover { background: #273749; color: #fff; }
.criteria-note { min-height: 2.4em; }
.scan-status:empty { display: none; }
.scan-status { padding: 11px 13px; margin-bottom: 14px; border-radius: 8px; color: var(--muted); background: #1b2736; font-size: .88rem; line-height: 1.5; }
.scan-status.error { color: var(--warm); }
.empty-state { min-height: 280px; display: grid; align-content: center; justify-items: center; gap: 9px; text-align: center; }
.empty-state p { color: var(--muted); max-width: 46ch; line-height: 1.5; }
.empty-profile { display: grid; gap: 6px; width: 56px; margin-bottom: 6px; justify-items: start; }
.empty-profile i { display: block; height: 3px; background: #5dada6; border-radius: 4px; }
.empty-profile i:nth-child(1) { width: 54px; }
.empty-profile i:nth-child(2) { width: 40px; }
.empty-profile i:nth-child(3) { width: 33px; }
.empty-profile i:nth-child(4) { width: 19px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { padding: 11px 14px; background: #101a28; border: 1px solid var(--border); border-radius: 11px; }
.metric strong { display: block; font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: .78rem; }
.metric:first-child strong { color: var(--accent); }
.site-report { min-width: 0; }
.site-heading { align-items: flex-start; }
.site-count { border-radius: 6px; background: var(--accent-dark); color: var(--accent); padding: 4px 7px; font-size: .76rem; white-space: nowrap; }
.site-count.zero { color: var(--muted); background: #1d2a39; }
.timeline { display: flex; gap: 3px; margin: 14px 0 8px; }
.timeline-day { min-width: 0; }
.timeline-cells { display: flex; gap: 1px; }
.timeline-cells i { flex: 1 0 0; height: 12px; min-width: 0; background: #33465a; }
.timeline-cells i.night { background: #23354a; }
.timeline-cells i.match { background: #72dcc4; }
.timeline-cells i.unavailable { background: #162131; }
.timeline-day span { display: block; color: var(--muted); font-size: .72rem; line-height: 1.5; margin-top: 3px; white-space: nowrap; overflow: hidden; }
.site-note { margin-block: 8px 11px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 8px; border-bottom: 1px solid #28394d; white-space: nowrap; }
th { font-weight: 550; color: var(--muted); font-size: .78rem; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.emphasis { color: var(--accent); font-weight: 650; }
.profile { margin-top: 14px; }
.profile[open] > summary { margin-bottom: 10px; }
.profile-heading { align-items: start; margin-bottom: 9px; }
.profile-heading label { width: min(100%, 250px); }
.profile-content { margin-top: 8px; }
.profile-content tr.selected { background: var(--accent-dark); }
.profile-content tr.selected td:first-child { padding-left: 5px; }
.wind-bar { display: inline-block; vertical-align: middle; height: 5px; width: var(--bar-width); margin-left: 8px; border-radius: 4px; background: #659eb6; }
tr.selected .wind-bar { background: var(--accent); }
.footer { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-block: 22px; color: var(--muted); font-size: .78rem; }

@media (max-width: 830px) {
  .container { width: min(100% - 28px, 660px); }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 16px; }
}

@media (max-width: 460px) {
  .masthead-note { display: none; }
  .masthead-inner { min-height: 62px; }
  .panel { padding: 13px; }
  .metric { padding: 9px; }
  .results-heading { align-items: flex-start; }
  .profile-heading { flex-direction: column; }
  .profile-heading label { width: 100%; }
}
