/* LaSorsa-inspired brand system for EP-News */
:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-strip: #e2e6ec;
  --text: #4d4042;
  --text-muted: #6b6360;
  --border: #e2e6ec;
  --charcoal: #333333;
  --charcoal-deep: #2a2425;
  --accent: #e74c3c;
  --accent-hover: #c0392b;
  --accent-soft: rgba(231, 76, 60, 0.1);
  --neutral: #b2aea0;
  --yellow: #fed700;
  --high: #e74c3c;
  --moderate: #c47a1a;
  --emerging: #2d6a5a;
  --shadow: 0 2px 12px rgba(77, 64, 66, 0.06);
  --radius: 4px;
  --radius-sm: 2px;
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --mono: "Space Grotesk", ui-monospace, monospace;
  --max: 1280px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1a1617;
  --bg-elevated: #242021;
  --bg-soft: #2c2728;
  --bg-strip: #2a2425;
  --text: #e8e4e2;
  --text-muted: #a89f9b;
  --border: #3d3637;
  --charcoal: #e8e4e2;
  --charcoal-deep: #f5f2f0;
  --accent: #e74c3c;
  --accent-hover: #ff6b5a;
  --accent-soft: rgba(231, 76, 60, 0.18);
  --neutral: #8a8578;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--charcoal-deep);
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--text); }

img { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* —— Top chrome (ticker + header) —— */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* —— Headline ticker (TSCMNews-style, LaSorsa) —— */
.headline-ticker {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 40px;
  background: #1a1617;
  color: #d8d4d2;
  font-family: var(--font);
  overflow: hidden;
  border-bottom: 1px solid #2a2425;
}

.ticker-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.95rem 0 1rem;
  background: #e74c3c;
  color: #ffffff;
  z-index: 2;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.28);
}

.ticker-bullet {
  font-size: 0.55rem;
  line-height: 1;
  color: #ffffff;
  opacity: 0.95;
}

.ticker-live {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1;
}

.ticker-viewport {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll var(--ticker-duration, 90s) linear infinite;
}

.headline-ticker:hover .ticker-track,
.headline-ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0 0.1rem;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #e8e4e2;
  line-height: 1;
}

.ticker-item .ticker-meta {
  font-size: 0.72rem;
  font-weight: 400;
  color: #9a9390;
  letter-spacing: 0.02em;
}

.ticker-sep {
  display: inline-flex;
  align-items: center;
  padding: 0 1.15rem;
  color: #e74c3c;
  font-size: 0.55rem;
  line-height: 1;
  opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

@media (max-width: 560px) {
  .headline-ticker { height: 34px; }
  .ticker-label { padding: 0 0.65rem 0 0.7rem; }
  .ticker-live { font-size: 0.62rem; letter-spacing: 0.06em; }
  .ticker-item { font-size: 0.74rem; }
  .ticker-item .ticker-meta { font-size: 0.64rem; }
  .ticker-sep { padding: 0 0.8rem; }
}

/* Presentation / news-wall: ticker stays under chrome (header may hide) */
body.presentation .headline-ticker {
  height: 42px;
  border-bottom: 2px solid #e74c3c;
}
body.presentation .ticker-item { font-size: 0.95rem; }
body.presentation .ticker-live { font-size: 0.78rem; }
body.presentation .ticker-label { padding: 0 1.1rem; }

/* —— Header —— */
.site-header {
  position: relative;
  background: var(--charcoal-deep);
  border-bottom: 3px solid var(--accent);
}

[data-theme="dark"] .site-header {
  background: #121011;
  border-bottom-color: var(--accent);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .brand-mark {
  background: var(--accent);
  color: #fff;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0;
  color: #ffffff;
}
.brand-text span {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* —— Buttons —— */
.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #ffffff;
  border-radius: var(--radius);
  padding: 0.48rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons outside dark header (admin forms, section actions) */
.wrap .btn,
.site-footer .btn,
.login-panel .btn,
.admin-card .btn,
.admin-bar .btn {
  border-color: var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}
.wrap .btn:hover,
.site-footer .btn:hover,
.login-panel .btn:hover,
.admin-card .btn:hover,
.admin-bar .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-elevated);
}

.btn-primary {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  color: #ffffff !important;
  filter: none;
}

.btn-gold {
  background: var(--accent) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600;
  border-radius: var(--radius);
}
.btn-gold:hover {
  background: var(--accent-hover) !important;
  color: #ffffff !important;
}

.btn-ghost {
  background: transparent;
}
.wrap .btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.wrap .btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* —— Hero (LaSorsa: clean white + red underline) —— */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem 1.25rem;
  align-items: start;
  margin: 0.65rem 0 0.85rem;
  padding: 0.7rem 0 0.75rem;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  position: relative;
  overflow: visible;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 3px;
  background: var(--accent);
  pointer-events: none;
}
.hero-lead {
  min-width: 0;
  width: 100%;
}
.hero-aside {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0.75rem 1.5rem;
  align-items: center;
}
.hero-kicker {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 1;
  margin: 0 0 0.2rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3.2vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: none;
  width: 100%;
  color: var(--charcoal-deep);
}
.hero p {
  margin: 0;
  max-width: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0;
  justify-content: flex-end;
}
.hero-meta .pill {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.hero-meta .pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 860px) {
  .hero-aside {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .hero-meta { justify-content: flex-start; }
  .hero h1 { font-size: clamp(1.45rem, 6vw, 1.9rem); }
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

/* —— Stats —— */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.6rem;
}
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  box-shadow: none;
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--charcoal-deep);
}
.stat span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.8rem 0 0.9rem;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 0.35rem;
}
.section-head h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-top: 0.4rem;
}
.section-head p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* —— Chips / filters —— */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}
.chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 0.38rem 0.78rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip:hover {
  color: var(--text);
  border-color: var(--accent);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
[data-theme="dark"] .chip.active {
  color: #ffffff;
  background: var(--accent);
}

/* —— Story cards —— */
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.story-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.05rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.story-card:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.08);
}
.story-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
}
.badge-demo {
  background: color-mix(in srgb, var(--moderate) 14%, var(--bg));
  color: var(--moderate);
  border-color: color-mix(in srgb, var(--moderate) 30%, var(--border));
}
.story-date {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.story-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.story-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}
.story-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  font-size: 0.88rem;
}
.story-foot .source { color: var(--text-muted); }
.story-foot a { font-weight: 600; }

.empty {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* —— Risks —— */
.risks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.risk-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.risk-card h3 {
  margin: 0.35rem 0 0.45rem;
  font-size: 1.02rem;
}
.risk-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.risk-level {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.risk-level.high { background: color-mix(in srgb, var(--high) 14%, transparent); color: var(--high); }
.risk-level.moderate { background: color-mix(in srgb, var(--moderate) 14%, transparent); color: var(--moderate); }
.risk-level.emerging { background: color-mix(in srgb, var(--emerging) 14%, transparent); color: var(--emerging); }
.risk-signs {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.risk-signs strong { color: var(--text); }

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem 2rem;
  align-items: end;
}
.footer-main {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.footer-redone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  text-decoration: none;
  justify-self: end;
  max-width: 300px;
}
.footer-redone img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #0a0a0a;
}
.footer-redone-caption {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
}
.footer-redone:hover .footer-redone-caption { color: var(--accent); }
.footer-redone:hover img { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
@media (max-width: 800px) {
  .footer-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .footer-redone {
    justify-self: start;
    align-items: flex-start;
  }
  .footer-redone-caption { text-align: left; }
}
.footer-inner strong {
  font-family: var(--font-display);
  color: var(--charcoal-deep);
}
.footer-inner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 70ch;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.92rem;
}
.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--accent); }

/* —— Live 5W Incident Feed —— */
.incident-section {
  margin: 0.4rem 0 1.8rem;
}

.live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.55);
  animation: live-pulse 1.6s ease-out infinite;
  vertical-align: middle;
  position: relative;
  top: -0.08em;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

.incident-viewport {
  position: relative;
  height: 460px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-strip);
  box-shadow: none;
}

.incident-viewport::before,
.incident-viewport::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 2;
  pointer-events: none;
}
.incident-viewport::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-strip), transparent);
}
.incident-viewport::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-strip), transparent);
}

.incident-track {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem 1rem;
  will-change: transform;
}

.incident-viewport.is-paused .incident-track,
.incident-viewport:hover .incident-track,
.incident-viewport:focus-within .incident-track {
  animation-play-state: paused !important;
}

.incident-card {
  flex: 0 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.78rem 0.95rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.42rem;
}

.incident-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.incident-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip-tactic,
.chip-venue,
.chip-principal,
.chip-location {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
}

.chip-tactic {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.chip-venue {
  background: color-mix(in srgb, var(--charcoal) 8%, var(--bg));
  color: var(--charcoal);
  border-color: var(--border);
}
.chip-principal {
  background: color-mix(in srgb, var(--neutral) 22%, var(--bg));
  color: var(--text);
  border-color: color-mix(in srgb, var(--neutral) 40%, var(--border));
}
[data-theme="dark"] .chip-principal { color: var(--text); }
.chip-location {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 500;
}


.incident-headline {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0.55rem 0 0.75rem;
  letter-spacing: -0.01em;
}
body.presentation .incident-headline {
  font-size: 1.2rem;
  margin: 0.65rem 0 0.85rem;
}
.incident-5w {
  display: grid;
  gap: 0.18rem;
  margin: 0;
}
.incident-5w div {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.9rem;
  line-height: 1.32;
}
.incident-5w dt {
  margin: 0;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.15rem;
}
[data-theme="dark"] .incident-5w dt { color: var(--accent); }
.incident-5w dd {
  margin: 0;
  color: var(--text);
}
.incident-5w dd.why {
  color: var(--text-muted);
  font-style: italic;
}

.incident-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.incident-foot a { font-weight: 600; }

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

.chips-incident { margin-bottom: 0.85rem; }

/* CSS seamless scroll (duplicated content in JS) */
@keyframes incident-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.incident-track.auto-scroll {
  animation: incident-scroll var(--scroll-duration, 48s) linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .incident-track.auto-scroll {
    animation: none !important;
  }
  .incident-viewport {
    overflow-y: auto;
  }
}

body.presentation #todays-edition .section-head p,
body.presentation #risks,
body.presentation .stats {
  /* keep incident feed star in presentation */
}
body.presentation .incident-viewport {
  height: min(62vh, 560px);
}
body.presentation #todays-edition .story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .incident-viewport { height: 420px; }
  .incident-5w div { grid-template-columns: 3.6rem 1fr; }
}

/* Presentation / news wall */
body.presentation .site-header,
body.presentation .site-footer,
body.presentation .stats,
body.presentation #risks,
body.presentation #todays-edition .chips,
body.presentation #todays-edition .section-head p,
body.presentation .incident-footnote {
  display: none !important;
}
body.presentation .hero {
  margin-bottom: 1rem;
  padding: 1.1rem 0 1.2rem;
}
body.presentation .hero h1 { max-width: none; font-size: 1.6rem; }
body.presentation .wrap { max-width: 1400px; padding-top: 0.6rem; }
body.presentation .story-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.presentation .story-card p { font-size: 0.92rem; }

/* Admin */
.admin-shell { min-height: 100vh; }
.login-panel {
  max-width: 420px;
  margin: 12vh auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.login-panel h1 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
}
.login-panel p { margin: 0 0 1rem; color: var(--text-muted); }
.field { display: grid; gap: 0.35rem; margin-bottom: 0.9rem; }
.field label { font-size: 0.88rem; font-weight: 600; }
.field input,
.field select,
.field textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field textarea { min-height: 110px; resize: vertical; }
.note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  margin-top: 0.8rem;
}
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tab {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  font-weight: 500;
}
.tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
[data-theme="dark"] .tab.active {
  background: var(--accent);
  color: #ffffff;
}
.panel { display: none; }
.panel.active { display: block; }
.admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.admin-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.admin-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.7rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.form-grid .full { grid-column: 1 / -1; }
.toast {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--charcoal-deep);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s ease;
  pointer-events: none;
  z-index: 100;
}
[data-theme="dark"] .toast {
  background: #121011;
}
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .story-grid,
  .risks-grid,
  .form-grid { grid-template-columns: 1fr; }
  body.presentation .story-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-inner { padding: 0.75rem 1rem; }
  .brand-text span { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .btn-label { display: none; }
}

.footer-credit {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.footer-credit a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.footer-credit a:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.footer-tagline {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.01em;
}
.footer-training {
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}
.footer-training a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.footer-training a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.brand-text .brand-tm {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.25;
  font-family: var(--font);
}

.footer-logo {
  display: inline-block;
  margin: 0 0 0.85rem;
  opacity: 1;
  transition: opacity 0.15s ease;
  background: none;
  padding: 0;
  border-radius: 0;
}
.footer-logo:hover { opacity: 0.85; }
.footer-logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
}
/* Dark mode: light pad so logo stays readable */
[data-theme="dark"] .footer-logo {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
}

a.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a.source-link:hover {
  border-bottom-color: var(--text);
  color: var(--text);
}
.incident-foot, .story-foot {
  margin-top: 0.75rem;
}

/* —— GSOC filters —— */
.gsoc-filters {
  margin: 0 0 1.35rem;
  padding: 1.15rem 1.2rem 1.05rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.gsoc-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.gsoc-filters-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.gsoc-filters-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.gsoc-keyword-label,
.gsoc-industry-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.gsoc-industry-label {
  margin-bottom: 0.45rem;
}
.gsoc-industry-label .hint {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  opacity: 0.85;
  font-size: 0.78rem;
  margin-left: 0.25rem;
}
.gsoc-keyword {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  min-height: 2.6rem;
}
.gsoc-keyword::placeholder { color: var(--text-muted); opacity: 0.75; }
.gsoc-keyword:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.chips-industry {
  margin-bottom: 0;
  gap: 0.4rem;
}
.chips-industry .industry-chip {
  min-height: 2.15rem;
  touch-action: manipulation;
}
.chip-industry,
.badge-industry {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid color-mix(in srgb, var(--charcoal) 18%, var(--border));
  background: color-mix(in srgb, var(--charcoal) 6%, var(--bg));
  color: var(--charcoal);
}
.badge-industry {
  background: var(--bg-soft);
  color: var(--text-muted);
  border-color: var(--border);
}
[data-theme="dark"] .chip-industry,
[data-theme="dark"] .badge-industry {
  color: var(--text);
  background: var(--bg-soft);
}

/* —— GSOC stage: matched feed + map panels —— */
.gsoc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
}
.gsoc-toolbar .chips-incident {
  margin: 0;
  flex: 1 1 auto;
}

.gsoc-stage {
  --gsoc-media-h: clamp(520px, 62vh, 720px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem 1.25rem;
  align-items: stretch;
  margin: 0 0 2rem;
}

.gsoc-panel {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem 0.9rem;
  box-shadow: var(--shadow);
  height: 100%;
}

.gsoc-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  min-height: 3.35rem;
  margin: 0 0 0.7rem;
}

.gsoc-panel-head h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.gsoc-panel-sub {
  margin: 0.28rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.gsoc-panel-sub a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.gsoc-panel-sub a:hover { color: var(--text); }

.wm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.wm-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.gsoc-media,
.gsoc-stage .incident-viewport,
.gsoc-stage .wm-frame {
  flex: 0 0 auto;
  width: 100%;
  height: var(--gsoc-media-h) !important;
  min-height: var(--gsoc-media-h) !important;
  max-height: var(--gsoc-media-h) !important;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-strip);
}

.gsoc-stage .wm-frame {
  background: #0b0d10;
}

.gsoc-stage .wm-frame iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
  background: #0b0d10;
}

.wm-section.wm-off .wm-frame { display: none !important; }

@media (max-width: 980px) {
  .gsoc-stage {
    grid-template-columns: 1fr;
    --gsoc-media-h: 420px;
  }
  .gsoc-filters-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 560px) {
  .gsoc-filters { padding: 0.95rem 0.9rem; }
  .gsoc-panel { padding: 0.8rem 0.75rem; }
  .gsoc-stage { --gsoc-media-h: 360px; }
  .gsoc-panel-head { flex-direction: column; min-height: 0; gap: 0.45rem; }
  .chips-industry .chip { font-size: 0.82rem; padding: 0.42rem 0.72rem; }
}

/* —— Presentation / news-wall (big screen) —— */
body.presentation {
  --max: 1760px;
}
body.presentation .wrap {
  max-width: var(--max);
  padding: 0.75rem 1.5rem 1.5rem;
}
body.presentation .gsoc-filters {
  margin-bottom: 0.75rem;
  padding: 0.8rem 1.05rem;
}
body.presentation .gsoc-stage {
  --gsoc-media-h: clamp(560px, 72vh, 800px);
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 1.35rem;
  margin-bottom: 1rem;
}
body.presentation .gsoc-panel-head h2 {
  font-size: 1.28rem;
}
body.presentation .incident-card {
  padding: 1.05rem 1.15rem;
}
body.presentation .incident-5w div {
  font-size: 1.02rem;
  line-height: 1.4;
}
body.presentation .incident-5w dt {
  font-size: 0.72rem;
}
body.presentation .chip {
  font-size: 0.92rem;
  padding: 0.45rem 0.9rem;
}
body.presentation .hero p,
body.presentation .hero-meta { display: none; }
body.presentation .hero {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0 0.7rem;
}
body.presentation .hero h1 {
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  max-width: none;
}
body.presentation .gsoc-filters,
body.presentation .gsoc-toolbar,
body.presentation #world-monitor,
body.presentation #incident-feed {
  display: flex;
}
body.presentation #incident-feed,
body.presentation #world-monitor {
  flex-direction: column;
}
body.presentation:not(.wm-map-on) .gsoc-stage {
  grid-template-columns: 1fr;
}
body.presentation #todays-edition {
  margin-top: 0.5rem;
}

@media (max-width: 1100px) {
  body.presentation .gsoc-stage {
    grid-template-columns: 1fr;
    --gsoc-media-h: min(48vh, 480px);
  }
}
