/* =========================================================
   Deogyusan Live CCTV & Weather Guide — 7-Tier Portal UI
   ========================================================= */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-tinted: #eef3f5;
  --border: #dde5ec;
  --border-strong: #c6d3de;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #e6f4f1;
  --good-bg: #ecfdf5;
  --good-text: #065f46;
  --warn-bg: #fffbeb;
  --warn-text: #92400e;
  --alert-bg: #fef2f2;
  --alert-text: #991b1b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06);
  --container: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

html[data-font-scale="1.12"] {
  font-size: 18px;
}

html[data-font-scale="1.24"] {
  font-size: 20px;
}

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* 1. 3-Tier Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.utility-bar {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.8125rem;
}

.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 20px;
  flex-wrap: wrap;
}

.utility-bar a {
  color: #5eead4;
  font-weight: 600;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.header-search {
  flex: 1 1 320px;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 4px 6px 4px 12px;
}

.header-search:focus-within {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.header-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 7px 0;
  font-size: 0.9375rem;
  outline: none;
  min-width: 0;
}

.btn-clear {
  border: 0;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-search-submit {
  border: 0;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-search-submit:hover {
  background: var(--primary-hover);
}

.font-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.font-control select {
  padding: 7px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.875rem;
  min-height: 38px;
}

.nav-bar {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.site-nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

/* 2. 2-Column Hero */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}

.hero-lead {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.hero-banner {
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  border: 1px solid #cce7e3;
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-primary {
  background: var(--primary);
  color: #ffffff;
}

.badge-neutral {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.hero-summary {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-reading {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.reading-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.reading-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.reading-head a {
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-reading ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-reading li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

.hero-reading li a:hover {
  background: var(--primary-soft);
  text-decoration: none;
}

.read-tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--primary);
}

.unofficial-note {
  margin: auto 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* 3. Flow Box */
.section {
  padding: 36px 0;
}

.section-compact {
  padding: 24px 0 12px;
}

.section-tinted {
  background: var(--surface-tinted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.flow-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.flow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.flow-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.flow-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.flow-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flow-step a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.flow-step a:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  text-decoration: none;
}

.flow-no {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  margin-top: 2px;
}

.flow-step[data-tone="teal"] .flow-no { background: #0f766e; }
.flow-step[data-tone="blue"] .flow-no { background: #1d4ed8; }
.flow-step[data-tone="amber"] .flow-no { background: #b45309; }
.flow-step[data-tone="slate"] .flow-no { background: #334155; }

.flow-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flow-text strong {
  font-size: 0.9rem;
}

.flow-text span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* 4. SVG Quick Nav */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  padding-bottom: 16px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quick-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

.quick-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  display: inline-flex;
}

.quick-icon svg {
  width: 100%;
  height: 100%;
}

/* Status Strip */
.status-strip {
  background: var(--primary-soft);
  color: #0f3f3a;
  border: 1px solid #b5dfd8;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Section Head & Filter Bar */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  letter-spacing: -0.015em;
}

.section-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 720px;
}

.result-meta,
.weather-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.count-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 5px 12px;
  border-radius: 999px;
}

.meta-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 42px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
  min-height: 36px;
}

.btn-text {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}

.btn-text:hover {
  text-decoration: underline;
}

/* Hub Cards */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-category {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.hub-altitude {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hub-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.hub-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.hub-specs {
  margin: 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 0.8rem;
}

.hub-specs dt {
  color: var(--text-muted);
  font-weight: 700;
}

.hub-specs dd {
  margin: 0;
  color: var(--text-secondary);
}

.hub-card-footer {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hub-source {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.source-note-bar {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
}

/* Weather Dashboard */
.status-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-banner.is-error {
  background: var(--alert-bg);
  color: var(--alert-text);
  border: 1px solid #fecaca;
}

.elevation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.weather-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.weather-card.is-highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2), var(--shadow-sm);
}

.weather-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.weather-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.elev-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.temp-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.temp-main {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.temp-desc {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.weather-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.weather-metric {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.weather-metric dt {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.weather-metric dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.condition-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.condition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.condition-head h3 {
  margin: 0;
  font-size: 1rem;
}

.condition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.condition-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg);
}

.condition-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.condition-item strong {
  font-size: 0.88rem;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-good { background: var(--good-bg); color: var(--good-text); }
.status-warn { background: var(--warn-bg); color: var(--warn-text); }
.status-alert { background: var(--alert-bg); color: var(--alert-text); }

.condition-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footnote {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Skeletons */
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 12px;
}

.skeleton-line.lg { height: 30px; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 85%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Planner */
.planner-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
  align-items: start;
}

.planner-controls,
.planner-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-group select,
.form-group input[type="time"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.9rem;
  min-height: 44px;
}

.time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.time-preset-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.time-preset-btn:hover,
.time-preset-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.verdict-banner {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.verdict-banner strong {
  display: block;
  font-size: 0.96rem;
  margin-bottom: 4px;
}

.verdict-banner.is-good {
  background: var(--good-bg);
  color: var(--good-text);
  border-color: #a7f3d0;
}

.verdict-banner.is-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: #fde68a;
}

.verdict-banner.is-alert {
  background: var(--alert-bg);
  color: var(--alert-text);
  border-color: #fecaca;
}

.timeline-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.timeline-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.timeline-step.is-summit {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.timeline-time {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.timeline-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.arrival-forecast-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.arrival-forecast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.arrival-forecast-head strong {
  font-size: 0.92rem;
}

.arrival-forecast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.arrival-forecast-grid div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.arrival-forecast-grid dt {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.arrival-forecast-grid dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.gear-tags-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gear-tags-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.gear-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gear-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.gear-tag.is-critical {
  background: var(--alert-bg);
  border-color: #fecaca;
  color: var(--alert-text);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.planner-tip-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.85rem;
}

.planner-tip-box strong {
  display: block;
  margin-bottom: 6px;
}

.planner-tip-box ol {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.metric-box span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.metric-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  color: var(--text);
}

.route-note-box {
  background: var(--primary-soft);
  color: #0f3f3a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.86rem;
  margin-bottom: 18px;
}

.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.checklist-head h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checklist-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  background: var(--surface);
}

.checklist-item label:hover {
  border-color: var(--primary);
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checklist-item.is-checked label {
  background: var(--bg);
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Guide, Table & 2-Column Help */
.guide-grid,
.help-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.guide-grid {
  margin-bottom: 20px;
}

.guide-card,
.table-card,
.help-card,
.subpage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.guide-card h3,
.table-card h3,
.help-card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.guide-card p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.bullet-list {
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.bullet-list li {
  margin-bottom: 8px;
}

.source-note {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 0 !important;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-easy { background: var(--good-bg); color: var(--good-text); }
.tag-mid { background: var(--warn-bg); color: var(--warn-text); }
.tag-hard { background: var(--alert-bg); color: var(--alert-text); }

/* Glossary & FAQ */
.glossary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.glossary-list li {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.glossary-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.glossary-list strong {
  display: block;
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.glossary-list p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.faq-list details {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.faq-list details:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.faq-list summary {
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-list summary::after {
  content: "+";
  font-size: 1.15rem;
  color: var(--primary);
  flex-shrink: 0;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.footer-nav a {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-bottom strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.footer-bottom p {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.noscript-bar {
  margin: 0;
  padding: 14px 20px;
  background: var(--warn-bg);
  color: var(--warn-text);
  text-align: center;
  font-size: 0.9rem;
}

/* Subpages */
.subpage-main {
  padding: 36px 0 48px;
}

.subpage-card h1 {
  margin: 0 0 14px;
  font-size: 1.55rem;
}

.subpage-card h2 {
  margin: 22px 0 8px;
  font-size: 1.1rem;
}

.subpage-card p,
.subpage-card li {
  font-size: 0.94rem;
  color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hero-lead,
  .planner-layout {
    grid-template-columns: 1fr;
  }

  .flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-grid,
  .elevation-grid,
  .condition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header-main {
    gap: 10px;
  }

  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
  }

  .site-nav {
    gap: 4px;
  }

  .site-nav a {
    padding: 6px 8px;
    font-size: 0.84rem;
  }

  .flow-grid,
  .hub-grid,
  .elevation-grid,
  .condition-grid,
  .guide-grid,
  .help-layout,
  .summary-metrics,
  .checklist-items {
    grid-template-columns: 1fr;
  }

  .arrival-forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 28px 0;
  }
}

@media (max-width: 390px) {
  .container {
    padding: 0 14px;
  }

  .utility-inner {
    padding: 7px 14px;
  }

  .quick-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-banner,
  .hero-reading,
  .hub-card,
  .weather-card,
  .planner-controls,
  .planner-result,
  .guide-card,
  .table-card,
  .help-card {
    padding: 16px;
  }
}
