@import url('dashboard.css');
@import url('responsive.css');

:root {
  color-scheme: dark;
  --bg: #0a1118;
  --surface: #101a23;
  --surface-raised: #14202a;
  --surface-soft: #17232d;
  --ink: #edf1eb;
  --muted: #8c9ba5;
  --faint: #5d6d78;
  --line: #25333e;
  --line-soft: #1c2933;
  --accent: #d9f277;
  --accent-ink: #17200b;
  --minor: #72c8bc;
  --moderate: #d9f277;
  --strong: #efad68;
  --major: #f17b72;
  --sans: 'DM Sans', sans-serif;
  --display: 'Space Grotesk', sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5ef;
  --surface: #ffffff;
  --surface-raised: #f7f9f3;
  --surface-soft: #e9eee5;
  --ink: #17231e;
  --muted: #617068;
  --faint: #829087;
  --line: #d8dfd4;
  --line-soft: #e7ece3;
  --accent: #c5e751;
  --accent-ink: #1b260d;
  --minor: #147b70;
  --moderate: #627813;
  --strong: #a85512;
  --major: #bf4038;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.topbar { height: 78px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; padding: 0 42px; gap: 30px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 29px; letter-spacing: -1.5px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--accent); border-radius: 9px; color: var(--accent-ink); }
.brand-mark svg { width: 26px; stroke-width: 2.2; }
.brand-dot { color: var(--accent); }
.topbar-context { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.context-line { height: 17px; width: 1px; background: var(--line); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 19px; }
.live-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.live-status.offline .status-dot { background: var(--strong); box-shadow: none; }
.header-divider { width: 1px; height: 20px; background: var(--line); }
.icon-button, .small-icon-button { border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); padding: 7px; border-radius: 6px; }
.icon-button:hover, .small-icon-button:hover { background: var(--surface-soft); color: var(--ink); }
.icon-button svg { width: 18px; height: 18px; }
.sun-icon { display: none; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }
.about-button { border: 0; background: transparent; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding: 8px 0; }
.about-button:hover { color: var(--ink); }
.about-button svg { width: 15px; }

main { max-width: 1600px; margin: 0 auto; padding: 43px 42px 25px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.eyebrow { text-transform: uppercase; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .17em; display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.eyebrow-line { display: inline-block; width: 21px; height: 1px; background: var(--accent); }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(32px, 3.4vw, 48px); letter-spacing: -.045em; line-height: 1.08; margin: 0 0 12px; }
.intro p { color: var(--muted); margin: 0; font-size: 14px; }
.feed-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 11px; flex-shrink: 0; }
.feed-meta > span { color: var(--faint); font-size: 11px; }
.refresh-button { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 9px 13px; font-size: 12px; }
.refresh-button:hover { border-color: var(--muted); background: var(--surface); }
.refresh-button svg { width: 15px; height: 15px; }
.refresh-button.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; z-index: 2000; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: min(90vw, 500px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 7px; box-shadow: 0 8px 30px #0004; font-size: 13px; text-align: center; }
dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 13px; width: min(92vw, 550px); padding: 36px; box-shadow: 0 30px 100px #0007; max-height: 88vh; overflow-y: auto; }
dialog::backdrop { background: #050b10cc; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: 15px; top: 13px; border: 0; background: var(--surface-soft); color: var(--muted); border-radius: 50%; width: 30px; height: 30px; font-size: 22px; line-height: 1; }
dialog h2 { font-family: var(--display); font-size: 28px; line-height: 1.15; letter-spacing: -.035em; margin: 8px 0 17px; }
dialog p { color: var(--muted); line-height: 1.65; font-size: 13px; }
.info-block { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 17px; }
.info-block h3 { font-size: 13px; margin: 0; }
.info-block p { margin-bottom: 0; }
.source-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); margin-top: 22px; font-weight: 600; text-decoration: none; font-size: 13px; }
.source-link svg { width: 17px; }
.magnitude-guide { margin: 22px 0; }
.magnitude-guide > div { display: grid; grid-template-columns: 85px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.guide-mag { font-family: var(--display); font-size: 16px; font-weight: 600; }
.magnitude-guide p { margin: 0; }
.magnitude-guide strong { display: block; color: var(--ink); margin-bottom: 3px; }
.minor { color: var(--minor); } .moderate { color: var(--moderate); } .strong { color: var(--strong); } .major { color: var(--major); }
.guide-note { font-size: 12px !important; }
.loader { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }


/* kc-contrast-resolver: one ink block, measured fg vs painted ground (S57); rewritten in place, never stacked */
/* k=light|*|span#list-count */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span#list-count { color: rgb(255, 255, 255) !important; } }
/* k=light|*|div#range-caption.metric-foot */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) div#range-caption.metric-foot { color: rgb(255, 255, 255) !important; } }
/* k=light|*|div#largest-place.metric-foot.truncate */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) div#largest-place.metric-foot.truncate { color: rgb(255, 255, 255) !important; } }
/* k=light|*|div.metric-foot */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) div.metric-foot { color: rgb(255, 255, 255) !important; } }
/* k=light|*|span#chart-total.chart-total */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span#chart-total.chart-total { color: rgb(255, 255, 255) !important; } }
/* k=light|*|span#chart-start */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span#chart-start { color: rgb(255, 255, 255) !important; } }
/* k=light|*|div.chart-labels span */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) div.chart-labels span { color: rgb(255, 255, 255) !important; } }
/* k=light|*|footer.footer span */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) footer.footer span { color: rgb(255, 255, 255) !important; } }
/* k=light|*|span#map-subtitle */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span#map-subtitle { color: rgb(255, 255, 255) !important; } }
/* k=light|*|span#activity-subtitle */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span#activity-subtitle { color: rgb(255, 255, 255) !important; } }
/* k=light|*|span#last-updated */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span#last-updated { color: rgb(255, 255, 255) !important; } }
/* k=light|*|span.control-label */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) span.control-label { color: rgb(255, 255, 255) !important; } }
/* k=light|*|label.control-label */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) label.control-label { color: rgb(255, 255, 255) !important; } }
/* k=light|*|footer.footer a */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) footer.footer a { color: rgb(255, 255, 255) !important; } }
/* k=light|*|div.map-source a */ @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) div.map-source a { color: rgb(114, 133, 147) !important; } }
/* kc-contrast-resolver end */
