:root {
  --bg: #05070a;
  --panel: #0e141b;
  --panel-2: #111a23;
  --text: #e7eef6;
  --muted: #9fb0c3;
  --accent: #28d17c;
  --accent-2: #45a3ff;
  --border: rgba(255,255,255,.12);
  --shadow: 0 22px 70px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(40, 209, 124, .16), transparent 36rem),
    radial-gradient(circle at top right, rgba(69, 163, 255, .14), transparent 32rem),
    var(--bg);
  color: var(--text);
}
a { color: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 10, .86);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .05em;
}
.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(40, 209, 124, .22), rgba(69, 163, 255, .2));
  display: grid;
  place-items: center;
  color: var(--accent);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: .55rem .8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: .18s ease;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: var(--border);
}
main { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 5vw, 4rem) 0; }
.hero { display: grid; gap: 1.2rem; margin-bottom: 2rem; }
.hero h1 { margin: 0; font-size: clamp(2rem, 6vw, 4.5rem); line-height: .95; letter-spacing: -.04em; }
.hero p { margin: 0; max-width: 760px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.032));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1.2rem; }
.station-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card h2, .card h3 { margin-top: 0; }
.card p, .card li { color: var(--muted); line-height: 1.7; }
.image-card { overflow: hidden; padding: 0; }
.image-card img { display: block; width: 100%; height: auto; }
.qth-page main { width: 100%; padding: 0; }
.hamclock-shell {
  width: 100%;
  height: calc(100vh - 74px - 54px);
  min-height: 680px;
  background: #000;
}
.hamclock-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.site-footer {
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 1rem;
  font-size: .95rem;
}
.kbd {
  display: inline-block;
  padding: .12rem .45rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: rgba(255,255,255,.06);
  color: var(--text);
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .hamclock-shell { height: calc(100vh - 132px - 54px); min-height: 620px; }
}


.hamclock-shell { position: relative; min-height: calc(100vh - 120px); }
.hamclock-frame { width: 100%; height: calc(100vh - 120px); min-height: 760px; border: 0; display: block; }
.hamclock-help { position: absolute; left: 2rem; bottom: 2rem; max-width: 620px; padding: 1.25rem 1.5rem; background: rgba(5, 10, 18, 0.88); border: 1px solid rgba(255,255,255,0.16); border-radius: 16px; backdrop-filter: blur(10px); box-shadow: 0 18px 40px rgba(0,0,0,0.35); }
.hamclock-help h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
.hamclock-help p { margin: .55rem 0; line-height: 1.5; }
.hamclock-help code { background: rgba(255,255,255,0.12); padding: .12rem .32rem; border-radius: 5px; }
.button { display: inline-block; margin-top: .35rem; padding: .7rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 700; background: rgba(255,255,255,0.92); color: #06101f; }
@media (max-width: 720px) { .hamclock-help { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; } .hamclock-frame { min-height: 700px; } }

/* Static HamClock-style QTH dashboard */
.qth-dashboard-page main.dashboard-wrap {
  width: min(1420px, calc(100% - 2rem));
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 4vw, 4rem);
}
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  margin-bottom: 1.2rem;
}
.eyebrow {
  margin: 0 0 .75rem;
  color: var(--accent);
  font-size: .78rem;
  letter-spacing: .22em;
  font-weight: 800;
}
.dashboard-hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(2.1rem, 5vw, 5rem);
  line-height: .92;
  letter-spacing: -.06em;
}
.hero-copy {
  margin: 1rem 0 0;
  max-width: 860px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.station-plate {
  min-width: 260px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(40,209,124,.16), rgba(69,163,255,.10)),
    rgba(255,255,255,.045);
  box-shadow: var(--shadow);
  display: grid;
  align-content: center;
  gap: .35rem;
}
.station-call {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.05em;
}
.station-grid {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.station-location { color: var(--muted); }
.dashboard-grid { display: grid; gap: 1rem; }
.top-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.main-grid { grid-template-columns: minmax(0, 1.55fr) minmax(360px, .75fr); align-items: stretch; }
.link-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; }
.dashboard-stack { display: grid; gap: 1rem; }
.dash-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.03)),
    rgba(10,16,24,.92);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2vw, 1.35rem);
  overflow: hidden;
}
.card-label {
  display: block;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}
.clock-card strong {
  display: block;
  font-size: clamp(1.9rem, 3vw, 3.4rem);
  line-height: .95;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.clock-card small, .qth-card small, .metric small, .mini-note { color: var(--muted); }
.qth-card strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}
.card-heading h2, .link-grid h3 {
  margin: 0;
  letter-spacing: -.03em;
}
.status-pill {
  flex: 0 0 auto;
  max-width: 260px;
  padding: .48rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-card { min-height: 510px; }
.greyline-canvas {
  display: block;
  width: 100%;
  height: 370px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: #030812;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: .85rem;
  color: var(--muted);
  font-size: .92rem;
}
.map-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.map-legend i { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.26); }
.legend-day { background: #236d9a; }
.legend-night { background: #050b18; }
.legend-qth { background: var(--accent); }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.metric {
  padding: .95rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
}
.metric span { display: block; color: var(--muted); font-size: .9rem; }
.metric strong {
  display: block;
  margin: .3rem 0 .15rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mini-note { margin: .9rem 0 0; font-size: .88rem; line-height: 1.55; }
.sun-card { display: grid; gap: .65rem; }
.sun-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sun-row:last-child { border-bottom: 0; }
.sun-row span { color: var(--muted); }
.sun-row strong { font-variant-numeric: tabular-nums; }
.link-grid .dash-card h3 { margin-bottom: .75rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  font-size: .9rem;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.link-button:hover {
  transform: translateY(-1px);
  border-color: rgba(40,209,124,.55);
  background: rgba(40,209,124,.10);
}
@media (max-width: 1180px) {
  .top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-grid { grid-template-columns: 1fr; }
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dashboard-hero { grid-template-columns: 1fr; }
  .station-plate { min-width: 0; }
  .top-grid, .link-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .card-heading { flex-direction: column; }
  .status-pill { max-width: 100%; }
  .greyline-canvas { height: 300px; }
  .map-card { min-height: auto; }
}
