/* weatherpatch — "synoptic chart" theme.
   Fonts are embedded in the binary; no external requests. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(/static/fonts/ibm-plex-sans-var.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/static/fonts/ibm-plex-mono-400.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/static/fonts/ibm-plex-mono-500.woff2) format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/static/fonts/ibm-plex-mono-600.woff2) format("woff2");
}

:root {
  --paper:      #F4F7F6;   /* chart paper (cool, not cream) */
  --card:       #FCFDFD;
  --ink:        #22303A;   /* slate ink */
  --ink-muted:  #5C6B70;
  --line:       #D9E2E0;   /* card borders */
  --rule:       #C9D4D2;   /* input borders, hairlines */
  --contour:    #33636F;   /* isobar blue — links, JSON chip */
  --accent:     #D95B10;   /* RSS orange */
  --accent-deep:#9C4708;
  --chip-rss-bg:   #FBEEE2;
  --chip-rss-line: #F0CDB0;
  --chip-json-bg:  #E5EFF1;
  --chip-json-line:#C3D8DC;
  --danger:     #A3392F;
  --danger-bg:  #F9E7E4;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--contour); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.wrap { max-width: 780px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ── Header ──────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 13px; padding-bottom: 13px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 15px/1 var(--mono); letter-spacing: .01em;
  color: var(--ink); text-decoration: none;
}
.wordmark svg { display: block; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { font-size: 14px; color: var(--ink-muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); text-decoration: underline; }
.topnav form { margin: 0; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border: 1px solid #B9C6C4; border-radius: 8px;
  background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: #EDF2F1; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #33444F; border-color: #33444F; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #FFF; }
.btn-danger-solid:hover { background: #8C2F27; border-color: #8C2F27; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

/* ── Hero: inbound address as station call-sign ──────────────── */
.station {
  position: relative;
  overflow: hidden;
  margin: 28px 0 0;
  padding: 26px 28px 24px;
  background: linear-gradient(135deg, #E9F1EF 0%, #F7FAF9 70%);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.station > * { position: relative; z-index: 1; }
.contours {
  position: absolute; z-index: 0; top: -70px; right: -90px;
  width: 480px; height: 320px;
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 10px;
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted);
}
.callsign-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.callsign {
  font: 500 clamp(1.15rem, 3.4vw, 1.7rem)/1.25 var(--mono);
  letter-spacing: -.01em;
  word-break: break-all;
}
.station .hint { margin: 12px 0 0; font-size: 14px; color: var(--ink-muted); max-width: 46ch; }

/* ── Feed list ───────────────────────────────────────────────── */
.feeds { padding: 28px 0 56px; }
.feeds-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.feeds-head .eyebrow { margin: 0; }
.feeds-head .count { font: 400 12px/1 var(--mono); color: var(--ink-muted); }
.section-note { margin: -4px 0 16px; font-size: 14px; color: var(--ink-muted); }

.feed {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px 10px;
}
.feed + .feed { margin-top: 12px; }
.feed-plain { padding-bottom: 16px; }
.feed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.feed-title { margin: 0; font-size: 16.5px; font-weight: 600; flex: 1 1 auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid;
  font: 500 13px/1 var(--mono);
  text-decoration: none;
  cursor: pointer;
  min-width: 76px; justify-content: center;
  transition: filter .12s;
}
.chip:hover { filter: brightness(.97); }
.chip-rss  { background: var(--chip-rss-bg);  border-color: var(--chip-rss-line);  color: var(--accent-deep); }
.chip-json { background: var(--chip-json-bg); border-color: var(--chip-json-line); color: var(--contour); }
.chip svg { flex: none; }

/* ── Feed action line ────────────────────────────────────────── */
.feed-actions {
  display: flex; align-items: center; gap: 2px;
  margin-top: 12px; padding-top: 6px;
  border-top: 1px solid var(--line);
}
.feed-actions .spacer { flex: 1; }
.action {
  border: 0; background: none;
  padding: 6px 9px; border-radius: 6px;
  font: 500 13px/1 var(--mono);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color .12s, color .12s;
}
.action:hover { color: var(--ink); background: #EDF2F1; }
.action-danger { color: var(--danger); }
.action-danger:hover { color: var(--danger); background: var(--danger-bg); }

/* ── Dialogs ─────────────────────────────────────────────────── */
dialog {
  border: 0; border-radius: 12px; padding: 0;
  width: 400px; max-width: calc(100vw - 32px);
  background: var(--card); color: var(--ink);
  box-shadow: 0 20px 60px rgba(34,48,58,.35);
}
dialog::backdrop { background: rgba(34,48,58,.45); }
.dialog-body { padding: 22px 24px; }
dialog h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
dialog p { margin: 0 0 14px; font-size: 14px; color: var(--ink-muted); }
dialog p strong { color: var(--ink); font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.field {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--card);
}
.field:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217,91,16,.15);
}

/* Merge target: a visible select list, not a drop-down. With many feeds
   the box gets a fixed height + filter, so the dialog never resizes. */
.merge-filter { margin-bottom: 10px; padding: 7px 11px; font-size: 14px; }
.option-box { position: relative; }
.option-box.scrolls { height: min(264px, 40vh); }
.option-box.scrolls .option-list {
  height: 100%; overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.option-list {
  display: grid; gap: 6px; align-content: start;
  margin: 0;
}
.option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--rule); border-radius: 8px;
  font-size: 14.5px;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.option:hover { background: #EDF2F1; }
.option:has(input:checked) { border-color: var(--accent); background: var(--chip-rss-bg); }
.option input { accent-color: var(--accent); margin: 0; }
.option[hidden] { display: none; }
.option-none {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 0;
  font-size: 13.5px; color: var(--ink-muted);
}
.option-none[hidden] { display: none; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty {
  border: 1px dashed var(--rule); border-radius: 10px;
  padding: 28px 24px; text-align: center;
  color: var(--ink-muted); font-size: 14.5px;
}

/* ── Login ───────────────────────────────────────────────────── */
.login-viewport {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 360px; max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 28px;
}
.login-card .wordmark { margin-bottom: 6px; }
.login-card .sub { margin: 0 0 18px; font-size: 14px; color: var(--ink-muted); }
.login-card label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; }
.alert {
  margin: 0 0 16px; padding: 9px 12px;
  background: var(--danger-bg); color: #7E2B23;
  border: 1px solid #ECC6C0; border-radius: 8px;
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .station { padding: 20px 18px; }
  .contours { opacity: .5; }
}
