/* ── Weather suite — page & tool styles ──────────────────────────────
   Builds on css/shared.css (tokens, header, footer, Orbitron). Family
   look: dark accent icon-chip hero + card/section/faq/trust pattern.
   Each tool sets <body data-tool="…"> for its own accent; the hub uses
   the suite brand (sky-blue). Moon + Sun run offline (no API); Forecast
   calls Open-Meteo. */

main { max-width: 900px; margin: 0 auto; padding: 20px; }

/* ── Tool hero: dark accent icon chip + Orbitron h1 + subtitle ──── */
.tool-hero { max-width: 900px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; }
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 700px; }
.tool-hero .subtitle a { color: var(--accent); text-decoration: none; }
.tool-hero .subtitle a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Card ───────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; font-family: inherit; font-size: .95rem; font-weight: 700; border: none; border-radius: var(--radius); cursor: pointer; background: var(--accent); color: #fff; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--accent-h); } .btn:active { transform: scale(.98); } .btn svg { width: 16px; height: 16px; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--muted); }

/* ── Location bar (shared by moon/sun/forecast) ─────────────────── */
.loc-bar { position: relative; }
.loc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-input { flex: 1 1 220px; min-width: 0; font-family: inherit; font-size: 1rem; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.loc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }
.loc-row .btn-ghost { min-height: 44px; }
.loc-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.loc-opt { display: block; width: 100%; text-align: left; padding: 12px 16px; font-family: inherit; font-size: .95rem; color: var(--text); background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; }
.loc-opt:last-child { border-bottom: none; }
.loc-opt:hover { background: var(--accent-bg); color: var(--accent-fg); }
.loc-status { min-height: 20px; margin-top: 10px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.loc-status.error { color: #b42318; }
.loc-hint { color: var(--muted); font-size: .92rem; margin-top: 14px; }

/* ── Trust row ──────────────────────────────────────────────────── */
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.trust-item svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; flex-shrink: 0; }

/* ── Content sections (how-it-works / faq) ──────────────────────── */
.section { max-width: 900px; margin: 16px auto; padding: 24px 20px; }
.section > h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.step-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; }
.step-body a { color: var(--accent); }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.faq .faq-body a { color: var(--accent); }

/* ── Hub grid (index) ───────────────────────────────────────────── */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); gap: 18px; margin-top: 8px; }
.hub-card { display: block; text-decoration: none; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 24px; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s; }
.hub-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.hub-card .hub-tag { position: absolute; top: 18px; right: 18px; font-size: .72rem; font-weight: 700; color: var(--accent-fg); background: var(--accent-bg); padding: 2px 9px; border-radius: 999px; }
.hub-card .hub-icon { width: 52px; height: 52px; border-radius: 12px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.hub-card .hub-icon svg { width: 27px; height: 27px; stroke: var(--accent); fill: none; }
.hub-card h2 { font-size: 1.2rem; color: var(--text); margin-bottom: 7px; }
.hub-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.hub-card .hub-open { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--accent); }

/* ── Moon tool ──────────────────────────────────────────────────── */
:root { --moon-light: #eef1ff; --moon-dark: #23264d; }
.moon-now { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.moon-disc { flex-shrink: 0; line-height: 0; filter: drop-shadow(0 4px 14px rgba(0,0,0,.18)); }
.moon-meta { flex: 1 1 220px; min-width: 0; }
.moon-meta #phaseName { font-family: 'Orbitron', sans-serif; font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.moon-meta #phasePct { font-size: 1.05rem; font-weight: 600; color: var(--accent-fg); margin-top: 4px; }
.moon-meta #phaseTrend { color: var(--muted); font-size: .92rem; margin-top: 8px; }
.moon-events { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.moon-event { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.moon-event .ev-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.moon-event .ev-date { display: block; font-weight: 700; font-size: 1.02rem; margin-top: 4px; }
.moon-event .ev-rel { font-size: .85rem; color: var(--accent-fg); }
.moon-times { display: grid; gap: 8px; margin-top: 8px; }
.mt-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); }
.mt-label { font-weight: 600; color: var(--muted); }
.mt-val { font-weight: 700; }

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.cal-cell { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 6px; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--ring),.18); }
.cal-day { font-size: .76rem; font-weight: 600; color: var(--muted); }
.cal-moon { line-height: 0; margin: 6px 0; display: flex; justify-content: center; }
.cal-pct { font-family: var(--mono); font-size: .78rem; color: var(--text); }

/* ── Sun tool ───────────────────────────────────────────────────── */
.sun-place { font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; }
.sun-note { background: var(--accent-bg); color: var(--accent-fg); border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.sun-grid { display: grid; gap: 8px; }
.sun-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); }
.sun-label { font-weight: 600; }
.sun-label .sun-sub { font-weight: 500; color: var(--muted); font-size: .82rem; }
.sun-val { font-family: var(--mono); font-weight: 600; }
.season-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.season-cell { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.season-cell.past { opacity: .55; }
.season-name { font-weight: 700; }
.season-date { font-family: var(--mono); font-size: .9rem; color: var(--accent-fg); margin: 4px 0; }
.season-sub { font-size: .82rem; color: var(--muted); }

/* ── Forecast tool ──────────────────────────────────────────────── */
.unit-toggle { display: inline-flex; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.unit-btn { min-width: 44px; min-height: 36px; padding: 6px 12px; font-family: inherit; font-weight: 700; font-size: .9rem; border: none; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.unit-btn.active { background: var(--accent); color: #fff; }
.unit-row { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.fc-current { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.fc-cur-icon svg { width: 64px; height: 64px; stroke: var(--accent); }
.fc-cur-main { flex: 1 1 auto; min-width: 0; }
.fc-cur-temp { font-family: 'Orbitron', sans-serif; font-size: 2.6rem; font-weight: 700; line-height: 1; }
.fc-cur-desc { font-weight: 600; color: var(--accent-fg); margin-top: 4px; }
.fc-cur-place { color: var(--muted); font-size: .9rem; }
.fc-cur-stats { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 26px; }
.fc-stat { display: flex; flex-direction: column; }
.fc-stat span { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fc-stat strong { font-size: 1.05rem; }

.fc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 18px; }
.fc-day { text-align: center; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 4px; }
.fc-day-name { font-weight: 700; font-size: .85rem; }
.fc-day-icon { line-height: 0; margin: 8px 0; display: flex; justify-content: center; }
.fc-day-icon svg { width: 30px; height: 30px; stroke: var(--accent); }
.fc-day-desc { font-size: .72rem; color: var(--muted); min-height: 2.2em; line-height: 1.2; }
.fc-day-temps { margin-top: 6px; font-size: .9rem; }
.fc-day-temps strong { font-weight: 700; }
.fc-day-temps span { color: var(--muted); }
.fc-day-pop { font-size: .76rem; color: var(--accent-fg); margin-top: 4px; }
@media (max-width: 640px) {
  .fc-days { grid-template-columns: repeat(3, 1fr); }
  .fc-cur-temp { font-size: 2.1rem; }
}
@media (max-width: 380px) { .fc-days { grid-template-columns: repeat(2, 1fr); } .moon-events { grid-template-columns: 1fr; } }

/* ── Per-tool accent theming ────────────────────────────────────── */
body[data-tool="moon"]     { --accent:#6366f1; --accent-h:#4f46e5; --accent-bg:#e0e7ff; --accent-fg:#3730a3; --ring:99,102,241; }
body[data-tool="sun"]      { --accent:#f59e0b; --accent-h:#d97706; --accent-bg:#fef3c7; --accent-fg:#92400e; --ring:245,158,11; }
body[data-tool="forecast"] { --accent:#0ea5e9; --accent-h:#0284c7; --accent-bg:#e0f2fe; --accent-fg:#075985; --ring:14,165,233; }

.hub-card.t-moon     { --accent:#6366f1; --accent-bg:#e0e7ff; --accent-fg:#3730a3; }
.hub-card.t-sun      { --accent:#f59e0b; --accent-bg:#fef3c7; --accent-fg:#92400e; }
.hub-card.t-forecast { --accent:#0ea5e9; --accent-bg:#e0f2fe; --accent-fg:#075985; }

/* ── Per-tool sub-nav ([Tool] | Articles | Blogs) ───────────────── */
.sub-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.sub-nav-inner { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; }
.sub-link { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--muted); border: 1.5px solid var(--border); background: var(--surface); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.sub-link:hover { color: var(--accent-fg); background: var(--accent-bg); border-color: var(--accent); text-decoration: none; }
.sub-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Tool pages: single contextual bar in the header (logo = back to the hub).
   The .sub-link pills live in .site-nav and stay visible at every width;
   the header grows/wraps on small screens instead of collapsing to a burger. */
body.tool-page .site-header { height: auto; min-height: 56px; flex-wrap: wrap; row-gap: 8px; padding-top: 8px; padding-bottom: 8px; }
body.tool-page .site-nav { flex-wrap: wrap; gap: 8px; }
body.tool-page .site-nav .sub-link { min-height: 36px; }
/* "Weather" hub link sits a touch apart from the section tabs. */
.sub-link-home { margin-left: 6px; }
@media (min-width: 560px) { .sub-link-home { margin-left: 14px; } }

/* Tool sub-pages on mobile: a single hamburger is the only nav. Hide the section
   pill bar (its links live inside the hamburger menu); desktop (>=720px) hides the
   burger and shows the pills inline as before. */
@media (max-width: 719px) {
  body.tool-page .site-nav { display: none; }
}
/* Divider between the tool switcher and the current tool's section links. */
.nav-mobile-sep { height: 1px; background: var(--border); margin: 6px 2px; }

/* ── Articles / Blogs index + article body ──────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.page-main { padding: 36px 0 64px; }
.page-head { margin-bottom: 28px; }
.page-head .page-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 3px 11px; border-radius: 999px; margin-bottom: 12px; }
.page-head h1 { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1.5rem, 4.2vw, 2.1rem); letter-spacing: -.4px; line-height: 1.2; margin-bottom: 10px; }
.page-head p { color: var(--muted); font-size: 1.02rem; max-width: 680px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.post-card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s; }
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.post-card .card-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 2px 9px; border-radius: 999px; margin-bottom: 10px; }
.post-card h2 { font-size: 1.12rem; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.post-card p { font-size: .92rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.post-card .read-more { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; font-weight: 700; color: var(--accent); }
.post-card .read-more::after { content: '→'; }
.related { margin-top: 28px; color: var(--muted); font-size: .95rem; }
.related a { color: var(--accent); }

.article-body { max-width: 720px; margin: 0 auto; }
.article-body .post-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 3px 11px; border-radius: 999px; margin-bottom: 12px; }
.article-body h1 { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1.5rem, 4.2vw, 2.1rem); letter-spacing: -.4px; line-height: 1.2; margin-bottom: 8px; }
.article-body .article-meta { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.article-body h2 { font-size: 1.3rem; font-weight: 800; margin: 28px 0 10px; line-height: 1.25; }
.article-body p { font-size: 1.02rem; color: var(--text); line-height: 1.8; margin-bottom: 16px; }
.article-body ul { padding-left: 22px; margin-bottom: 16px; }
.article-body li { font-size: 1.02rem; color: var(--text); line-height: 1.8; margin-bottom: 8px; }
.article-body a { color: var(--accent); }
.article-body a:hover { text-decoration: underline; text-underline-offset: 2px; }
.article-body code { font-family: var(--mono); font-size: .88em; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.article-cta { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 20px 24px; margin: 28px 0; }
.article-cta p { color: var(--accent-fg); font-weight: 600; margin-bottom: 12px; }
.article-cta a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 22px; background: var(--accent); color: #fff; border-radius: var(--radius); font-weight: 700; font-size: .9rem; text-decoration: none; }
.article-cta a:hover { background: var(--accent-h); }

/* ── References hub (tables) ─────────────────────────────────────── */
body[data-tool="references"] { --accent:#0d9488; --accent-h:#0f766e; --accent-bg:#ccfbf1; --accent-fg:#115e59; --ring:13,148,136; }

.ref-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.ref-yearnav { display: inline-flex; align-items: center; gap: 6px; }
.ref-yearnav button { width: 40px; height: 40px; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius); cursor: pointer; font-size: 1.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.ref-yearnav button:hover { background: var(--accent-bg); border-color: var(--accent); }
.ref-year { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1.15rem; min-width: 72px; text-align: center; }
.ref-filter { flex: 1 1 220px; min-width: 0; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: .95rem; background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.ref-filter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }

.ref-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); max-height: 560px; overflow-y: auto; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
.ref-table th, .ref-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ref-table th { background: var(--surface2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; z-index: 1; }
.ref-table tbody tr:last-child td { border-bottom: none; }
.ref-table tbody tr:hover { background: var(--accent-bg); }
.ref-table .mono { font-family: var(--mono); }
.ref-table td.num { font-family: var(--mono); text-align: right; }
.ref-phase { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.ref-phase svg { width: 22px; height: 22px; flex-shrink: 0; }
.ref-code-icon svg { width: 26px; height: 26px; stroke: var(--accent); fill: none; }
.ref-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.ref-badge.solar { color: #92400e; background: #fef3c7; }
.ref-badge.lunar { color: #3730a3; background: #e0e7ff; }
.ref-moon-name { font-weight: 700; color: var(--accent-fg); }
.ref-note { font-size: .85rem; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.ref-note a { color: var(--accent); }

/* References hero: stacked reference cards on the suite hub link */
.ref-hub-link { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-decoration: none; transition: transform .18s, border-color .18s, box-shadow .18s; }
.ref-hub-link:hover { transform: translateY(-3px); border-color: #0d9488; box-shadow: var(--shadow-lg); text-decoration: none; }
.ref-hub-link .rh-icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; }
.ref-hub-link .rh-icon svg { width: 24px; height: 24px; stroke: #0d9488; fill: none; }
.ref-hub-link .rh-body { min-width: 0; }
.ref-hub-link .rh-body strong { display: block; font-size: 1.05rem; color: var(--text); }
.ref-hub-link .rh-body span { font-size: .9rem; color: var(--muted); }
.ref-hub-link .rh-go { margin-left: auto; color: #0d9488; font-weight: 700; flex-shrink: 0; }

/* ── Weather Alerts (NWS) ────────────────────────────────────────── */
body[data-tool="alerts"] { --accent:#dc2626; --accent-h:#b91c1c; --accent-bg:#fee2e2; --accent-fg:#991b1b; --ring:220,38,38; }
.hub-card.t-alerts { --accent:#dc2626; --accent-bg:#fee2e2; --accent-fg:#991b1b; }

.al-controls { margin-bottom: 4px; }
.al-label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.al-row { display: flex; gap: 8px; flex-wrap: wrap; }
.al-select { flex: 1 1 220px; min-width: 0; font-family: inherit; font-size: 1rem; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.al-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }
.al-row .btn-ghost { min-height: 44px; }
.al-region-note { font-size: .82rem; color: var(--muted); margin-top: 8px; }

/* Filter chips */
.al-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.al-chip { min-height: 38px; padding: 6px 16px; border-radius: 999px; font-family: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; transition: background .15s, color .15s, border-color .15s; touch-action: manipulation; }
.al-chip:hover { color: var(--accent-fg); background: var(--accent-bg); border-color: var(--accent); }
.al-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Result region */
.al-result { margin-top: 18px; }
.al-loading { padding: 28px 0; text-align: center; color: var(--muted); font-weight: 600; }
.al-count { font-weight: 700; margin-bottom: 14px; }
.al-empty-filter { color: var(--muted); padding: 14px 0; }

.al-none { text-align: center; padding: 30px 16px; }
.al-none-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: #dcfce7; color: #15803d; font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; }
.al-none p { color: var(--muted); font-weight: 600; }

/* Severity tokens */
.sev-extreme { --sv:#991b1b; --svbg:#fee2e2; }
.sev-severe  { --sv:#dc2626; --svbg:#fee2e2; }
.sev-moderate{ --sv:#ea580c; --svbg:#ffedd5; }
.sev-minor   { --sv:#ca8a04; --svbg:#fef9c3; }
.sev-unknown { --sv:#475569; --svbg:#e2e8f0; }

.al-group { margin-bottom: 22px; }
.al-group-title { font-family: 'Orbitron', sans-serif; font-size: .95rem; font-weight: 700; letter-spacing: .02em; color: var(--sv); margin-bottom: 10px; }

.al-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--sv); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px; }
.al-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.al-sev { flex-shrink: 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sv); background: var(--svbg); padding: 3px 9px; border-radius: 999px; }
.al-event { font-size: 1.08rem; font-weight: 700; color: var(--text); }
.al-area { font-size: .9rem; color: var(--text); margin-top: 8px; overflow-wrap: anywhere; }
.al-expires { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-top: 6px; }
.al-detail { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.al-detail summary { cursor: pointer; font-size: .9rem; font-weight: 700; color: var(--sv); list-style: none; }
.al-detail summary::-webkit-details-marker { display: none; }
.al-detail summary::after { content: '+'; float: right; color: var(--sv); font-weight: 700; }
.al-detail[open] summary::after { content: '\2013'; }
.al-detail-body { margin-top: 10px; font-size: .9rem; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.al-sender { font-size: .78rem; color: var(--muted); margin-top: 10px; font-style: italic; }

/* Safety banner */
.al-safety { margin-top: 16px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; color: #7c2d12; line-height: 1.6; }
.al-safety strong { color: #9a3412; }

/* US alerts choropleth map */
.al-map-card .card-title { margin-bottom: 4px; }
.al-map-sub { color: var(--muted); font-size: .92rem; margin-bottom: 14px; }
.al-map-wrap { width: 100%; }
.al-map { width: 100%; height: auto; display: block; }
.al-st { fill: #dcfce7; stroke: #ffffff; stroke-width: 1; cursor: pointer; transition: fill .15s, filter .12s; outline: none; touch-action: manipulation; }
.al-st:hover { filter: brightness(.9); }
.al-st:focus-visible { stroke: var(--text); stroke-width: 2; }
.al-st.selected { stroke: #0f0f2e; stroke-width: 2.4; }
.al-st.sw-none { fill: #dcfce7; }
.al-st.sw-minor { fill: #fde047; }
.al-st.sw-moderate { fill: #fb923c; }
.al-st.sw-severe { fill: #ef4444; }
.al-st.sw-extreme { fill: #991b1b; }
.al-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; font-size: .82rem; color: var(--muted); }
.al-map-note { margin-top: 10px; font-size: .78rem; color: var(--muted); line-height: 1.55; }
.al-map-note a { color: var(--accent); }
.al-leg { display: inline-flex; align-items: center; gap: 6px; }
.al-leg .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.08); flex-shrink: 0; }
.al-leg .sw-none { background: #dcfce7; }
.al-leg .sw-minor { background: #fde047; }
.al-leg .sw-moderate { background: #fb923c; }
.al-leg .sw-severe { background: #ef4444; }
.al-leg .sw-extreme { background: #991b1b; }

/* Mobile tuning for the alerts tool (verified at 375px): reclaim width for the
   map + cards, and give the filter chips a full 44px tap target. */
@media (max-width: 600px) {
  body[data-tool="alerts"] main { padding: 14px; }
  body[data-tool="alerts"] .card { padding: 16px 14px; }
  body[data-tool="alerts"] .al-map-card { padding: 14px 8px; }
  body[data-tool="alerts"] .al-map-sub { padding: 0 6px; }
  body[data-tool="alerts"] .al-chip { min-height: 44px; padding: 9px 16px; }
  body[data-tool="alerts"] .al-card { padding: 14px; }
  body[data-tool="alerts"] .al-event { font-size: 1rem; }
}
