:root {
  --bg: #030507;
  --bg-bottom: #0a1422;
  --panel: rgba(8, 12, 18, 0.92);
  --panel-soft: rgba(10, 15, 22, 0.84);
  --screen: #05131c;
  --line: rgba(113, 146, 182, 0.22);
  --line-strong: rgba(147, 178, 210, 0.38);
  --text: #edf3fb;
  --muted: #8fa3bb;
  --accent: #6fa6ff;
  --accent-soft: rgba(111, 166, 255, 0.18);
  --critical: #d75b52;
  --high: #c98945;
  --medium: #d2b35c;
  --low: #4f9e84;
  --radius-sm: var(--sd-radius-sm, 6px);
  --radius-md: var(--sd-radius-md, 8px);
  --radius-lg: var(--sd-radius-lg, 12px);
  --panel-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --monitor-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
  font-family: var(--sd-font-sans, "Lato", "Segoe UI", sans-serif);

  /* ── Design-System: Dark Theme (Lato / Sharp) ─────────────────────── */
  --bg:             #0f172a;
  --bg-surface:     #1e293b;
  --bg-secondary:   #1e293b;
  --bg-tertiary:    #334155;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inv:       #0f172a;
  --primary:        #818cf8;
  --primary-h:      #a5b4fc;
  --primary-light:  #1e1b4b;
  --success:        #34d399;
  --success-h:      #6ee7b7;
  --success-light:  #064e3b;
  --warning:        #fbbf24;
  --warning-h:      #fcd34d;
  --warning-light:  #451a03;
  --danger:         #f87171;
  --danger-h:       #fca5a5;
  --danger-light:   #450a0a;
  --info:           #38bdf8;
  --info-h:         #7dd3fc;
  --info-light:     #0c4a6e;
  --border:         #334155;
  --border-focus:   #818cf8;
  --radius-xs:      var(--sd-radius-xs, 4px);
  --radius:         var(--sd-radius-md, 8px);
  --radius-xl:      var(--sd-radius-xl, 16px);
  --radius-pill:    var(--sd-radius-pill, 999px);
  --transition:     0.18s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 120%, rgba(25, 58, 103, 0.48), transparent 34%),
    linear-gradient(180deg, #020305 0%, var(--sd-bg, #05080d) 50%, #08111a 100%);
}

body {
  min-height: 100vh;
}

body.situation-app.sd-has-global-header {
  padding-top: 44px;
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  height: calc(100vh - 44px);
  min-height: calc(100vh - 44px);
  padding: 10px 12px 6px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 2px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .app-shell {
    height: calc(100vh - 46px);
    min-height: calc(100vh - 46px);
  }
}

.deck-grid {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(640px, 1fr) minmax(280px, 320px);
  gap: 2px;
  align-items: stretch;
  min-height: 0;
}

.panel,
.sidebar {
  border: 1px solid var(--sd-border, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--sd-panel, rgba(11, 16, 23, 0.96)) 86%, rgba(7, 11, 17, 0.94));
  box-shadow: var(--sd-shadow-sm, var(--panel-shadow));
}

.sidebar {
  position: relative;
  z-index: 20;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(7, 11, 17, 0.96);
  color: var(--text);
  box-shadow: var(--panel-shadow);
}

.sidebar-toggle--hidden {
  opacity: 0;
  pointer-events: none;
}

.sidebar-header,
.section-header,
.source-card,
.event-card__meta,
.detail-panel__header,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-header {
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(111, 166, 255, 0.14);
}

.sidebar-header__controls {
  display: grid;
  gap: 10px;
  justify-items: end;
  flex-shrink: 0;
}

.language-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.language-switch__button {
  min-width: 42px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.language-switch__button + .language-switch__button {
  border-left: 1px solid var(--line);
}

.language-switch__button.is-active {
  background: rgba(111, 166, 255, 0.12);
  color: var(--text);
}

.sidebar-header__copy,
.detail-panel__heading,
.source-card > div:first-child {
  min-width: 0;
}

.brand-mark,
.section-header h2,
.event-card__type,
.stat-card__label,
.detail-field span,
.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #8ab4ff;
}

.sidebar-header h1,
.detail-panel h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.sidebar-header h1 {
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.sidebar-intro {
  margin: 6px 0 0;
  color: #c0cfdd;
  font-size: 0.8rem;
  line-height: 1.55;
}

.section-header h2 {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

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

.icon-button,
.text-button,
.primary-button,
.secondary-button {
  border: 1px solid var(--sd-border, var(--line));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.02));
  color: var(--sd-text, var(--text));
  text-decoration: none;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
}

.icon-button--compact {
  width: 30px;
  height: 30px;
  font-size: 1.05rem;
}

.text-button,
.primary-button,
.secondary-button {
  padding: 8px 11px;
  transition: border-color 160ms ease, background 160ms ease;
}

.text-button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--sd-border-strong, var(--line-strong));
  background: var(--sd-surface-2, rgba(255, 255, 255, 0.05));
}

.primary-button {
  background: var(--sd-accent, rgba(111, 166, 255, 0.12));
  border-color: color-mix(in srgb, var(--sd-accent, #6fa6ff) 60%, transparent);
  color: var(--sd-accent-ink, var(--text));
}

.sidebar-section,
.sources-panel__section,
.news-panel,
.markets-panel {
  display: grid;
  gap: 12px;
}

.sidebar-section {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.sidebar-section--grow {
  flex: 1;
  min-height: 0;
}

.sidebar-section--legal {
  margin-top: auto;
}

.time-range-row {
  display: flex;
}

.time-range-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--sd-border, var(--line));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.03));
  color: var(--sd-text, var(--text));
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238fa3bb'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.time-range-select:hover {
  border-color: var(--line-strong);
}

.time-range-select:focus {
  outline: none;
  border-color: var(--sd-accent, var(--accent));
  box-shadow: var(--sd-focus, none);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  width: fit-content;
  border: 1px solid var(--sd-border, var(--line));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.03));
  color: var(--sd-text, var(--text));
}

.status-badge[data-tone="live"] {
  border-color: rgba(79, 158, 132, 0.38);
  color: #9de0c9;
}

.status-badge[data-tone="loading"] {
  border-color: rgba(210, 179, 92, 0.38);
  color: #ead692;
}

.status-badge[data-tone="error"] {
  border-color: rgba(215, 91, 82, 0.42);
  color: #efaba5;
}

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

.stat-card {
  padding: 8px 10px;
  border: 1px solid var(--sd-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.018));
}

.stat-card__label {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
}

.stat-card__value {
  display: block;
  margin-top: 4px;
  font-size: 0.96rem;
}

.stat-card--critical {
  border-color: rgba(215, 91, 82, 0.38);
}

.stat-card--high {
  border-color: rgba(201, 137, 69, 0.34);
}

.stat-card--medium {
  border-color: rgba(210, 179, 92, 0.34);
}

.stat-card--low {
  border-color: rgba(79, 158, 132, 0.32);
}

.filter-groups,
.filter-options,
.sources-list,
.sidebar-legal-links,
.markets-grid {
  display: grid;
}

.filter-groups {
  gap: 14px;
}

.filter-group h3 {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: #d4dfeb;
}

.filter-options {
  gap: 8px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.filter-option--disabled {
  opacity: 0.5;
}

.filter-option input {
  margin: 0;
}

.filter-option--disabled input {
  cursor: not-allowed;
}

.layer-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #d4dfeb;
}

.layer-toggle input {
  margin: 0;
}

.range-filter {
  display: grid;
  gap: 8px;
}

.range-filter input {
  width: 100%;
}

.center-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
  height: 100%;
}

.monitor-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.monitor-frame {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  justify-items: stretch;
  gap: 0;
}

.monitor-screen {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 8px;
  border: 1px solid rgba(161, 181, 203, 0.28);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(22, 30, 39, 0.98), rgba(7, 10, 15, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 0 70px rgba(0, 0, 0, 0.4),
    var(--monitor-shadow);
}

.monitor-screen::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(111, 166, 255, 0.12);
  pointer-events: none;
}

.monitor-base {
  width: 34%;
  min-width: 180px;
  height: 16px;
  margin: 4px auto 0;
  border: 1px solid rgba(161, 181, 203, 0.22);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(17, 24, 33, 0.95), rgba(7, 10, 15, 0.98));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.map-canvas {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(111, 166, 255, 0.16);
  background: #07131d;
}

.sources-panel {
  height: 100%;
  max-height: 100%;
  padding: 12px 14px;
  overflow: auto;
  display: grid;
  gap: 12px;
}

.sources-panel__section {
  height: auto;
}

.sources-panel__section--collapsible {
  height: auto;
}

.sources-panel__section--collapsed .sources-list,
.sources-panel__section--collapsed .filter-options {
  display: none;
}

.collapse-button {
  min-width: 102px;
  text-align: center;
}

.sources-list {
  gap: 10px;
  align-content: start;
}

.source-card {
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--sd-border, var(--line));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.02));
}

.source-card strong,
.source-card span,
.source-card small {
  display: block;
}

.source-card strong {
  margin-bottom: 3px;
}

.source-card span,
.source-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.source-card__state {
  text-align: right;
}

.source-card--on {
  border-color: rgba(79, 158, 132, 0.28);
}

.source-card--off {
  border-color: rgba(215, 91, 82, 0.24);
}

.lower-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.95fr);
  gap: 2px;
  align-items: stretch;
}

.news-panel,
.markets-panel {
  padding: 10px 14px;
  height: 185px;
}

.event-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  max-height: 115px;
  overflow: auto;
}

.event-card {
  width: 100%;
  min-height: 68px;
  padding: 7px 8px;
  text-align: left;
  border: 1px solid var(--sd-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.02));
  color: inherit;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.event-card:hover {
  transform: translateY(-1px);
  border-color: var(--sd-border-strong, rgba(111, 166, 255, 0.3));
  background: var(--sd-surface-2, rgba(255, 255, 255, 0.04));
}

.event-card--active {
  border-color: rgba(111, 166, 255, 0.48);
  background: rgba(111, 166, 255, 0.1);
}

.event-card__type,
.event-card__meta {
  display: block;
  color: var(--muted);
}

.event-card__type {
  font-size: 0.58rem;
}

.event-card__title {
  display: block;
  margin: 5px 0 7px;
  line-height: 1.34;
  font-size: 0.82rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.68rem;
}

.markets-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 115px;
  overflow: auto;
  align-content: start;
}

.market-card {
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.market-card__label,
.market-card__meta {
  display: block;
}

.market-card__label {
  font-size: 0.56rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.market-card__value {
  display: block;
  margin-top: 3px;
  font-size: 0.88rem;
}

.market-card__change {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.64rem;
}

.market-card__change--up {
  border-color: rgba(79, 158, 132, 0.34);
  color: #93d6be;
}

.market-card__change--down {
  border-color: rgba(215, 91, 82, 0.34);
  color: #f0b0aa;
}

.market-card__change--flat {
  color: var(--muted);
}

.market-card__meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.62rem;
}

.group-event-list {
  display: grid;
  gap: 6px;
}

.group-event-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 9px 11px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  transition: border-color 160ms ease, background 160ms ease;
}

.group-event-item:hover {
  border-color: rgba(111, 166, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.group-event-item__title {
  display: block;
  font-size: 0.88rem;
  line-height: 1.35;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(2, 5, 9, 0.66);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.detail-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.detail-panel {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 45;
  width: min(720px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.detail-panel--open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.detail-panel__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--sd-border-strong, var(--line));
  border-radius: var(--radius-lg);
  background: var(--sd-bg-raised, rgba(6, 10, 16, 0.98));
  box-shadow: var(--sd-shadow-md, var(--panel-shadow));
}

.detail-panel__header {
  align-items: flex-start;
}

.detail-panel h2 {
  font-size: 1.18rem;
  line-height: 1.28;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.66rem;
  color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-field {
  padding: 10px 11px;
  border: 1px solid var(--sd-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md);
  background: var(--sd-surface, rgba(255, 255, 255, 0.025));
}

.detail-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.64rem;
}

.detail-copy,
.detail-legal {
  color: #dce7f3;
  line-height: 1.58;
}

/* Aviation classification block */
.gov-classification {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(111, 166, 255, 0.18);
  background: rgba(111, 166, 255, 0.06);
}

.gov-classification--confirmed {
  border-color: rgba(79, 158, 132, 0.38);
  background: rgba(79, 158, 132, 0.08);
}

.gov-classification--probable {
  border-color: rgba(201, 137, 69, 0.38);
  background: rgba(201, 137, 69, 0.07);
}

.gov-classification--watchlist {
  border-color: rgba(210, 179, 92, 0.30);
  background: rgba(210, 179, 92, 0.06);
}

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

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

.gov-classification__badge {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gov-classification--confirmed .gov-classification__badge { color: #9de0c9; }
.gov-classification--probable  .gov-classification__badge { color: #e5b67a; }
.gov-classification--watchlist .gov-classification__badge { color: #ead692; }

.detail-grid--compact {
  gap: 4px;
  margin-top: 4px;
}

.detail-note {
  padding: 10px 11px;
  border: 1px solid rgba(111, 166, 255, 0.22);
  background: rgba(111, 166, 255, 0.08);
  color: #d7e8ff;
  font-size: 0.76rem;
  line-height: 1.45;
}

.detail-legal {
  display: grid;
  gap: 14px;
}

.detail-legal h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.detail-legal p,
.detail-legal ul {
  margin: 0;
}

.detail-legal ul {
  padding-left: 18px;
}

.detail-actions {
  flex-wrap: wrap;
}

.detail-actions > * {
  flex: 1 1 180px;
  text-align: center;
}

.detail-action-button {
  padding: 8px 10px;
  font-size: 0.84rem;
}

.legal-link-button {
  text-align: left;
}

.empty-state {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.event-list > .empty-state,
.markets-grid > .empty-state,
.sources-list > .empty-state {
  grid-column: 1 / -1;
}

.maplibregl-ctrl-group,
.maplibregl-popup-content {
  border-radius: var(--radius-sm) !important;
}

.maplibregl-ctrl-group {
  overflow: hidden;
  box-shadow: var(--panel-shadow);
}

@media (max-width: 1480px) {
  .deck-grid {
    grid-template-columns: minmax(280px, 320px) minmax(540px, 1fr) minmax(250px, 290px);
  }

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

@media (max-width: 1180px) {
  .app-shell {
    height: auto;
    overflow: auto;
    padding: 20px;
    grid-template-rows: auto;
  }

  .deck-grid {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    height: auto;
  }

  .sources-panel {
    grid-column: 1 / -1;
    min-height: 0;
    max-height: none;
  }

  .lower-deck {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body.situation-app.sd-has-global-header {
    padding-top: 46px;
  }

  .app-shell {
    padding: 16px;
  }

  .deck-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar-toggle {
    display: inline-flex;
    top: 60px;
  }

  .sidebar {
    position: fixed;
    inset: 60px auto 16px 16px;
    width: min(340px, calc(100vw - 32px));
    min-height: auto;
    max-height: calc(100vh - 76px);
    transform: translateX(0);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .sidebar--closed {
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-header .icon-button {
    display: inline-flex;
  }

  .center-stage {
    min-height: 300px;
    height: auto;
    max-height: none;
  }

  .sources-panel {
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .monitor-frame {
    width: 100%;
  }

  .event-list,
  .markets-grid,
  .detail-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    inset: 50% auto auto 50%;
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
  }

  .detail-panel__inner {
    max-height: calc(100vh - 32px);
  }

}

@media (max-width: 760px) {
  .sidebar {
    inset: 62px auto 16px 16px;
    max-height: calc(100vh - 78px);
  }

  .sidebar-toggle {
    top: 62px;
  }
}

@media (min-width: 981px) {
  .sidebar-header .icon-button,
  .sidebar-toggle {
    display: none;
  }
}

/* Shared platform theme bridge */
body.situation-app.sd-theme-light {
  --bg: var(--sd-bg);
  --bg-bottom: #eef4f0;
  --panel: var(--sd-panel);
  --panel-soft: var(--sd-surface);
  --screen: #e4ece7;
  --line: var(--sd-border);
  --line-strong: var(--sd-border-strong);
  --text: var(--sd-text);
  --muted: var(--sd-text-muted);
  --accent: var(--sd-accent);
  --accent-soft: color-mix(in srgb, var(--sd-accent) 14%, transparent);
  --critical: #a84038;
  --high: #98601d;
  --medium: #8a6a12;
  --low: #1f7550;
  --panel-shadow: var(--sd-shadow-sm);
  --monitor-shadow: 0 18px 44px rgba(24, 43, 35, 0.14);
  color-scheme: light;
  background:
    linear-gradient(180deg, rgba(35, 139, 75, 0.08), transparent 240px),
    var(--sd-bg);
}

body.situation-app.sd-theme-light .panel,
body.situation-app.sd-theme-light .sidebar,
body.situation-app.sd-theme-light .sources-panel,
body.situation-app.sd-theme-light .news-panel,
body.situation-app.sd-theme-light .markets-panel {
  background: var(--sd-panel);
  box-shadow: var(--sd-shadow-sm);
}

body.situation-app.sd-theme-light .sidebar-toggle {
  background: var(--sd-bg-raised);
  color: var(--sd-text);
  border-color: var(--sd-border-strong);
  box-shadow: var(--sd-shadow-md);
}

body.situation-app.sd-theme-light .brand-mark,
body.situation-app.sd-theme-light .eyebrow {
  color: var(--sd-accent-strong);
}

body.situation-app.sd-theme-light .sidebar-intro,
body.situation-app.sd-theme-light .detail-copy,
body.situation-app.sd-theme-light .detail-legal,
body.situation-app.sd-theme-light .filter-group h3,
body.situation-app.sd-theme-light .layer-toggle {
  color: var(--sd-text-soft);
}

body.situation-app.sd-theme-light .sidebar-header,
body.situation-app.sd-theme-light .sidebar-section {
  border-color: var(--sd-border);
}

body.situation-app.sd-theme-light .language-switch,
body.situation-app.sd-theme-light .stat-card,
body.situation-app.sd-theme-light .source-card,
body.situation-app.sd-theme-light .event-card,
body.situation-app.sd-theme-light .market-card,
body.situation-app.sd-theme-light .group-event-item,
body.situation-app.sd-theme-light .detail-field {
  background: var(--sd-surface);
  border-color: var(--sd-border);
}

body.situation-app.sd-theme-light .language-switch__button.is-active,
body.situation-app.sd-theme-light .event-card--active {
  background: color-mix(in srgb, var(--sd-accent) 12%, var(--sd-surface));
  color: var(--sd-text);
}

body.situation-app.sd-theme-light .status-badge[data-tone="live"],
body.situation-app.sd-theme-light .source-card--on,
body.situation-app.sd-theme-light .market-card__change--up,
body.situation-app.sd-theme-light .gov-classification--confirmed {
  color: #1f7550;
  background: rgba(35, 139, 75, 0.10);
  border-color: rgba(35, 139, 75, 0.28);
}

body.situation-app.sd-theme-light .status-badge[data-tone="loading"],
body.situation-app.sd-theme-light .gov-classification--watchlist {
  color: #77590f;
  background: rgba(213, 169, 73, 0.12);
  border-color: rgba(138, 106, 18, 0.28);
}

body.situation-app.sd-theme-light .status-badge[data-tone="error"],
body.situation-app.sd-theme-light .source-card--off,
body.situation-app.sd-theme-light .market-card__change--down {
  color: #a84038;
  background: rgba(168, 64, 56, 0.10);
  border-color: rgba(168, 64, 56, 0.28);
}

body.situation-app.sd-theme-light .monitor-screen {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 244, 240, 0.98));
  border-color: var(--sd-border-strong);
  box-shadow:
    inset 0 0 0 1px rgba(24, 43, 35, 0.04),
    0 18px 44px rgba(24, 43, 35, 0.14);
}

body.situation-app.sd-theme-light .monitor-screen::before,
body.situation-app.sd-theme-light .map-canvas {
  border-color: rgba(35, 139, 75, 0.16);
}

body.situation-app.sd-theme-light .map-canvas {
  background: #dfe9e3;
}

body.situation-app.sd-theme-light .monitor-base {
  background: linear-gradient(180deg, #ffffff, #dfe9e3);
  border-color: var(--sd-border);
  box-shadow: 0 12px 28px rgba(24, 43, 35, 0.12);
}

body.situation-app.sd-theme-light .detail-backdrop {
  background: rgba(20, 32, 27, 0.28);
}
