:root {
  color-scheme: light;
  --sidebar-width: clamp(240px, 18vw, 280px);
  --bg: #f7f5ef;
  --ink: #1d252c;
  --muted: #5b646b;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-soft: #d9f0ec;
  --border: #d9d3c7;
  --nav: #15232e;
  --nav-muted: #9ba7b2;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  padding: 28px 22px;
  color: #ffffff;
  background: var(--nav);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.brand h1 {
  margin-bottom: 0;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.topic-nav {
  display: grid;
  gap: 8px;
}

.topic-link {
  display: block;
  padding: 11px 12px;
  color: #e8eef2;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.topic-link.is-active {
  color: #062f2a;
  background: #c9f0e7;
}

.topic-link.is-disabled {
  color: var(--nav-muted);
}

.status-card {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.status-card h2 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.status-card p {
  margin-bottom: 0;
  color: var(--nav-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  color: #c9f0e7;
  font-size: 0.85rem;
  font-weight: 800;
}

.system-status-pill::before {
  width: 7px;
  height: 7px;
  content: "";
  background: currentColor;
  border-radius: 999px;
}

.system-status-pill[data-state="error"] {
  color: #f3b29d;
}

.content {
  display: grid;
  align-content: start;
  gap: 28px;
  min-width: 0;
  margin-right: var(--sidebar-width);
  padding: 32px;
}

.topic-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 1240px);
  max-width: 1240px;
  min-width: 0;
  margin: 0 auto;
}

.topic-panel > * {
  min-width: 0;
}

.topic-panel[hidden] {
  display: none;
}

.topic-heading,
.filters-panel,
.aggregate-panel,
.chart-panel,
.table-panel,
.narrative-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.topic-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.topic-heading h2 {
  margin-bottom: 10px;
  font-size: 2rem;
  line-height: 1.1;
}

.topic-heading p,
.narrative-block p,
.section-heading p,
.chart-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.narrative-block {
  display: grid;
  gap: 10px;
  padding: 18px 22px;
}

.narrative-block h3 {
  margin-bottom: 0;
  color: #2f4f87;
  font-size: 1.08rem;
}

.source-note {
  color: #3f4b55 !important;
  font-size: 0.92rem;
}

.background-copy {
  font-size: 1.04rem;
}

.narrative-block a {
  color: #2563eb;
  font-weight: 800;
}

.narrative-block a:hover {
  color: #1d4ed8;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  color: #064e3b;
  background: var(--accent-soft);
  border: 1px solid #9bd5ca;
  border-radius: 999px;
  font-weight: 800;
}

.status-pill[data-state="error"] {
  color: #8a1f11;
  background: #fde8df;
  border-color: #f3b29d;
}

.filters-panel,
.chart-panel,
.table-panel,
.people-stories-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.section-heading,
.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3,
.chart-heading h3 {
  margin-bottom: 0;
  color: #2f4f87;
  font-size: 1.25rem;
}

.text-button {
  min-height: 34px;
  padding: 0 12px;
  color: #0a554f;
  background: #effaf7;
  border: 1px solid #b9ded7;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

#casualties-filters {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.casualties-range-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.casualties-range-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.chart-mode-field {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

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

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 4px;
  min-height: 40px;
  padding: 4px;
  background: #f6f4ee;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.segmented-control button {
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  color: #44515c;
  background: #fffdf8;
  border: 1px solid #d8d1c4;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
}

.segmented-control button:hover {
  color: #173a63;
  border-color: #b8c5d8;
}

.segmented-control button[aria-pressed="true"] {
  color: #ffffff;
  background: #2f4f87;
  border-color: #2f4f87;
  box-shadow:
    0 0 0 1px #2f4f87,
    0 2px 6px rgba(29, 37, 44, 0.16);
}

.casualties-range-grid input,
.casualties-range-grid select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.filter-field {
  position: relative;
  min-width: 0;
}

.filter-field summary {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.filter-field summary::-webkit-details-marker {
  display: none;
}

.filter-summary {
  color: #2f4f87;
  font-size: 0.82rem;
  font-weight: 800;
}

.filter-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 10px;
  width: min(340px, 88vw);
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(29, 37, 44, 0.16);
}

.filter-search {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.filter-actions button {
  flex: 1;
  min-height: 30px;
  color: #0a554f;
  background: #effaf7;
  border: 1px solid #b9ded7;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.filter-options {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow: auto;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  color: var(--ink);
  font-weight: 700;
}

.filter-option[hidden] {
  display: none;
}

.filter-option input {
  flex: 0 0 auto;
}

.aggregate-panel {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 20px;
}

.aggregate-value {
  margin-bottom: 6px;
  color: var(--ink) !important;
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
}

.aggregate-label {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.facet-list {
  display: grid;
  gap: 8px;
}

.facet-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.facet-chip {
  max-width: 100%;
  padding: 5px 9px;
  color: #21323a;
  background: #eef3f2;
  border: 1px solid #cfddda;
  border-radius: 999px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 800;
}

.chart-list {
  display: grid;
  gap: 12px;
  min-height: 560px;
  direction: ltr;
}

.plotly-chart {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.chart-notes {
  display: grid;
  gap: 5px;
  max-width: 72rem;
  margin: 0 auto !important;
  color: #2e353b !important;
  direction: rtl;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: right;
}

.chart-notes p {
  margin: 0;
}

.caption-status {
  font-weight: 900;
}

.chart-notes a {
  color: #2563eb;
  font-weight: 800;
}

.gaza-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gaza-impact-grid article {
  min-width: 0;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.gaza-impact-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.gaza-impact-grid strong {
  display: block;
  margin-bottom: 8px;
  color: #8f1d38;
  font-size: 1.85rem;
  line-height: 1.05;
}

.gaza-impact-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.gaza-chart {
  width: 100%;
  min-height: 520px;
  direction: ltr;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.opinion-chart {
  width: 100%;
  min-height: 540px;
  direction: ltr;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.evacuee-chart {
  width: 100%;
  min-height: 520px;
  direction: ltr;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.evacuee-key-grid strong {
  color: #2f4f87;
}

.opinion-chart-compact {
  min-height: 500px;
}

.evacuee-chart-compact {
  min-height: 390px;
}

.evacuee-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  direction: rtl;
}

.evacuee-map-panel {
  display: grid;
  gap: 8px;
}

.evacuee-map-panel h4 {
  margin: 0;
  color: #2f4f87;
  font-size: 1.02rem;
}

.evacuee-leaflet-map {
  width: 100%;
  min-height: 560px;
  direction: ltr;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.evacuee-leaflet-tooltip {
  direction: rtl;
  text-align: right;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.evacuee-leaflet-summary,
.evacuee-leaflet-legend {
  padding: 8px 10px;
  color: #1d252c;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(29, 37, 44, 0.18);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: right;
}

.evacuee-leaflet-legend {
  display: grid;
  gap: 5px;
}

.evacuee-leaflet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.evacuee-leaflet-legend i {
  display: inline-block;
  width: 18px;
  height: 4px;
}

.evacuee-leaflet-legend .formal {
  background: #071f63;
}

.evacuee-leaflet-legend .informal {
  background: #606975;
}

.chart-figure {
  display: grid;
  gap: 12px;
  margin: 0;
}

.gaza-chart-bars {
  min-height: 500px;
}

.gaza-chart-compact {
  min-height: 330px;
}

.operation-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.operation-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  align-items: start;
}

.operation-controls > label,
.operation-checks {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--muted);
  border: 0;
  font-size: 0.92rem;
  font-weight: 900;
}

.operation-controls input[type="date"],
.operation-controls select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.operation-checks {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  grid-column: 1 / -1;
  padding: 10px;
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.operation-checks legend {
  padding: 0 0 8px;
  color: var(--muted);
}

.operation-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

.chart-status {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.operation-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  direction: ltr;
}

.operation-chart {
  min-width: 0;
}

.operation-chart h4 {
  margin: 0 0 8px;
  color: #2f4f87;
  direction: rtl;
  font-size: 1rem;
  text-align: right;
}

.operation-facet-list {
  display: grid;
  gap: 12px;
}

.operation-facet {
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}

.operation-facet-title {
  min-height: 24px;
  padding: 3px 8px;
  color: #ffffff;
  background: #000000;
  direction: ltr;
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: center;
}

.operation-plot {
  width: 100%;
  min-height: 92px;
  overflow: hidden;
  background: #ffffff;
}

.operation-source-note {
  margin: 12px 4px 0;
  color: var(--muted);
  direction: rtl;
  font-size: 0.88rem;
  font-weight: 800;
}

.alarm-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
  padding: 18px;
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.alarm-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.alarm-multi-filter {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.alarm-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.alarm-filter-heading span:last-child {
  display: inline-flex;
  gap: 4px;
}

.alarm-filter-heading button {
  min-height: 24px;
  padding: 2px 7px;
  color: #2f4f87;
  background: #ffffff;
  border: 1px solid #d8d1c4;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
}

.alarm-filter-heading button:hover {
  background: #eaf2ff;
  border-color: #2f4f87;
}

.alarm-filter-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 5px;
  max-height: 112px;
  padding: 6px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.alarm-area-filter {
  grid-column: span 2;
}

.alarm-filter-search {
  min-height: 34px;
  width: 100%;
  padding: 5px 9px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.alarm-area-filter .alarm-filter-options {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  max-height: 150px;
}

.alarm-filter-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 6px;
  color: var(--ink);
  background: #fbfaf7;
  border: 1px solid #ece6dc;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 800;
}

.alarm-filter-options input {
  width: 15px;
  height: 15px;
  accent-color: #2f4f87;
}

.alarm-controls select,
.alarm-controls > label input {
  min-height: 38px;
  width: 100%;
  padding: 6px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.alarm-controls select {
  min-height: 38px;
  width: 100%;
  padding: 6px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.alarm-mode-control {
  grid-column: 1 / -1;
}

.alarm-advanced-controls {
  grid-column: 1 / -1;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.alarm-advanced-controls summary {
  width: fit-content;
  color: #2f4f87;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 900;
}

.alarm-advanced-controls > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.alarm-chart {
  display: grid;
  gap: 18px;
  min-height: 520px;
  direction: ltr;
}

.alarm-facet-panel {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0;
}

.alarm-facet-title {
  min-height: 28px;
  padding: 4px 10px;
  color: #ffffff;
  background: #000000;
  direction: ltr;
  font-size: 0.9rem;
  line-height: 1.25;
  text-align: center;
}

.alarm-facet-plot {
  min-height: 180px;
}

.operation-after {
  background: #fbfaf7;
}

.people-stories-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.people-stories-grid {
  display: grid;
  gap: 22px;
}

.people-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.person-story-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background: #fbfaf7;
  border: 1px solid #e2dbd0;
  border-radius: 8px;
}

.person-story-portrait {
  display: grid;
  place-items: center;
  width: 78px;
  aspect-ratio: 1;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(47, 79, 135, 0.92)),
    #0f766e;
  border: 1px solid rgba(15, 35, 46, 0.14);
  border-radius: 8px;
  overflow: hidden;
  font-size: 1.35rem;
  font-weight: 950;
}

.person-story-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-story-portrait[data-crop] {
  position: relative;
  display: block;
}

.person-story-portrait[data-crop] img {
  position: absolute;
  top: 0;
  left: 0;
  width: 300%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}

.person-story-portrait[data-crop="left"] img {
  transform: translateX(0);
}

.person-story-portrait[data-crop="center"] img {
  transform: translateX(-33.333%);
}

.person-story-portrait[data-crop="right"] img {
  transform: translateX(-66.666%);
}

.person-story-body {
  min-width: 0;
}

.person-story-body h5 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.person-story-classification {
  margin: 0 0 7px;
  color: #2f4f87;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.35;
}

.person-story-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.people-stories-note {
  margin: 0;
}

.people-image-attribution {
  color: #6b747c;
  font-size: 0.76rem;
}

.people-image-attribution summary {
  width: fit-content;
  color: #6b747c;
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
}

.people-image-attribution summary:focus-visible {
  outline: 2px solid #9bb8d8;
  outline-offset: 2px;
}

.people-image-attribution div {
  margin-top: 5px;
  line-height: 1.5;
}

.people-image-attribution a {
  color: inherit;
  text-decoration: none;
}

.people-image-attribution a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.city-votes-notes {
  width: min(100%, 66rem);
  padding: 0 8px 2px;
}

.table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.table-toolbar,
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.table-toolbar select,
.table-toolbar input {
  min-height: 34px;
  padding: 5px 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.table-toolbar input {
  width: min(260px, 42vw);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.95rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #ece6dc;
  text-align: right;
  white-space: nowrap;
}

td[data-column="story"] {
  min-width: 520px;
  max-width: 760px;
  white-space: normal;
  line-height: 1.55;
}

th[data-column="condition_changes"],
td[data-column="condition_changes"] {
  min-width: 240px;
}

th[data-column="held_days"],
td[data-column="held_days"] {
  min-width: 96px;
}

td[data-column="held_days"] {
  direction: ltr;
  text-align: left;
}

td[data-column="event_date"],
td[data-column="age"] {
  direction: ltr;
  text-align: left;
}

td[data-column="condition_changes"] {
  white-space: pre;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
}

th {
  color: #3f4b55;
  background: #f4f1ea;
  font-weight: 900;
}

th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.sort-mark {
  color: #9a8f7f;
  font-size: 0.78rem;
}

tbody tr:hover {
  background: #faf8f3;
}

.table-pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pagination-buttons button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  color: #26343c;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

.pagination-buttons button[aria-current="page"] {
  color: #ffffff;
  background: #2f4f87;
  border-color: #2f4f87;
}

.pagination-buttons button:disabled {
  cursor: default;
  opacity: 0.45;
}

.metadata-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px 18px;
  margin: 0;
  padding: 0 4px 24px;
}

.metadata-list dt {
  color: var(--muted);
  font-weight: 800;
}

.metadata-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.timeline-filter-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(210px, 1.35fr) minmax(260px, 1.65fr) minmax(190px, 1.1fr);
  gap: 14px;
  align-items: end;
}

.timeline-filter-grid label,
.timeline-control {
  display: grid;
  grid-template-rows: 18px 42px;
  gap: 5px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.timeline-control {
  min-width: 0;
}

.timeline-control-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 18px;
}

.timeline-filter-grid select,
.timeline-filter-grid input[type="search"] {
  width: 100%;
  min-height: 42px;
  height: 42px;
  padding: 7px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
}

.timeline-multi-select {
  position: relative;
  min-width: 0;
}

.timeline-multi-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  height: 42px;
  padding: 7px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  list-style: none;
}

.timeline-multi-select summary::-webkit-details-marker {
  display: none;
}

.timeline-multi-select summary::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-color: currentColor;
  border-style: solid;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg) translateY(-2px);
}

.timeline-multi-select[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.timeline-multi-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 5px;
  width: min(280px, 86vw);
  max-height: 290px;
  padding: 8px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(29, 37, 44, 0.16);
}

.timeline-multi-actions {
  display: flex;
  gap: 6px;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
}

.timeline-multi-actions button {
  min-height: 30px;
  padding: 4px 9px;
  color: var(--accent-strong);
  background: #f4f8f7;
  border: 1px solid #cfe2df;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.timeline-multi-actions button:hover {
  background: #e8f2f0;
}

.timeline-multi-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 850;
}

.timeline-multi-menu label:hover {
  background: #f4f8f7;
}

.timeline-multi-menu input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.timeline-importance-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  min-height: 42px;
  height: 42px;
}

.timeline-importance-options label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.timeline-importance-options input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.timeline-importance-options label:has(input:checked) {
  color: #073b35;
  background: #e4f6f2;
  border-color: #9bd5ca;
  box-shadow: inset 0 0 0 1px #b8e4dc;
}

.timeline-summary {
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
}

.timeline-chart {
  width: 100%;
  min-height: 540px;
  direction: ltr;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.timeline-chart-compact {
  min-height: 390px;
}

.timeline-chart-labels {
  min-height: 500px;
}

.timeline-events-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.timeline-event-list {
  display: grid;
  gap: 10px;
}

.timeline-event-card {
  display: grid;
  grid-template-columns: minmax(132px, max-content) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: #fbfaf7;
  border: 1px solid #e5ded2;
  border-radius: 8px;
}

.timeline-event-date {
  align-self: start;
  color: #2f4f87;
  direction: ltr;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  line-height: 1.35;
  text-align: right;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.timeline-event-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.timeline-event-card h4 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.timeline-event-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.timeline-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.timeline-chip {
  max-width: 100%;
  padding: 4px 8px;
  color: #22313a;
  background: #eef3f2;
  border: 1px solid #cfddda;
  border-radius: 999px;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 900;
}

.timeline-chip[data-kind="foundation"] {
  color: #ffffff;
  background: #8f1d38;
  border-color: #8f1d38;
}

.timeline-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.timeline-source-links a {
  max-width: 100%;
  padding: 4px 8px;
  color: #0b4c75;
  background: #edf6fb;
  border: 1px solid #c9dfef;
  border-radius: 999px;
  overflow-wrap: anywhere;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 900;
}

.timeline-source-links a:hover {
  color: #06344f;
  background: #dff0fa;
}

.timeline-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 800;
}

.war-goals-intro {
  font-size: 1.02rem;
}

.war-goals-counterpoint,
.war-goals-dashboard,
.war-goals-details {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.counterpoint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.counterpoint-grid article {
  padding: 16px;
  background: #fbfaf7;
  border: 1px solid #e5ded2;
  border-radius: 8px;
}

.counterpoint-grid h4 {
  margin: 0 0 10px;
  color: #2f4f87;
  font-size: 1rem;
}

.counterpoint-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.goal-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.failure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.goal-score-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
  background: #fbfaf7;
  border: 1px solid #e5ded2;
  border-top: 5px solid #64748b;
  border-radius: 8px;
}

.goal-score-card[data-score="high"] {
  border-top-color: #15803d;
}

.goal-score-card[data-score="medium"] {
  border-top-color: #b45309;
}

.goal-score-card[data-score="low"] {
  border-top-color: #b91c1c;
}

.goal-score-label {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 0.9rem;
  font-weight: 900;
}

.goal-score-card strong {
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.2;
}

.goal-score-card span {
  color: var(--muted);
  line-height: 1.45;
}

.government-failure-intro {
  font-size: 1.02rem;
}

.accountability-list ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0 1.35rem 0 0;
}

.accountability-list li {
  color: var(--muted);
  line-height: 1.65;
}

.accountability-list strong {
  color: var(--ink);
}

.goal-progress-list {
  display: grid;
  gap: 12px;
}

.goal-progress-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(140px, 1fr) 40px;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.goal-progress-row span {
  min-width: 0;
  color: #273640;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.goal-progress-row strong {
  direction: ltr;
  text-align: left;
}

.goal-progress-row meter {
  width: 100%;
  height: 18px;
}

.war-goals-table td {
  vertical-align: top;
  white-space: normal;
  line-height: 1.5;
}

.war-goals-table th:nth-child(2),
.war-goals-table td:nth-child(2),
.war-goals-table th:nth-child(4),
.war-goals-table td:nth-child(4) {
  min-width: 260px;
}

.war-goals-table th:nth-child(5),
.war-goals-table td:nth-child(5) {
  min-width: 190px;
}

.goal-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.goal-status-official {
  color: #064e3b;
  background: #d9f0ec;
  border: 1px solid #9bd5ca;
}

.goal-status-principle {
  color: #5a3508;
  background: #fff3d7;
  border: 1px solid #e7c56d;
}

.goal-status-operational {
  color: #173b6c;
  background: #e4edf8;
  border: 1px solid #a9c4e4;
}

.goal-status-derived {
  color: #4b5563;
  background: #eef1f4;
  border: 1px solid #cbd5e1;
}

.war-goals-details details {
  background: #fbfaf7;
  border: 1px solid #e5ded2;
  border-radius: 8px;
}

.war-goals-details summary {
  padding: 14px 16px;
  color: #2f4f87;
  cursor: pointer;
  font-weight: 950;
}

.war-goals-details p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.6;
}

.war-goals-summary {
  border-color: #9bd5ca;
  background: #f4fcf9;
}

.war-cost-intro {
  font-size: 1.02rem;
}

.war-cost-dashboard,
.war-cost-details {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cost-score-grid,
.cost-layer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.cost-score-card,
.cost-layer-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #fbfaf7;
  border: 1px solid #e5ded2;
  border-radius: 8px;
}

.cost-score-card {
  min-height: 150px;
  border-top: 5px solid #64748b;
}

.cost-score-card[data-cost="measured"] {
  border-top-color: #0f766e;
}

.cost-score-card[data-cost="future"] {
  border-top-color: #b45309;
}

.cost-score-card[data-cost="social"] {
  border-top-color: #7c3aed;
}

.cost-score-card[data-cost="strategic"] {
  border-top-color: #b91c1c;
}

.cost-score-label {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 0.9rem;
  font-weight: 900;
}

.cost-score-card strong {
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.2;
}

.cost-score-card span,
.cost-layer-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.cost-layer-grid h4 {
  margin: 0;
  color: #2f4f87;
  font-size: 1rem;
}

.war-cost-table td {
  vertical-align: top;
  white-space: normal;
  line-height: 1.5;
}

.war-cost-table th:nth-child(2),
.war-cost-table td:nth-child(2),
.war-cost-table th:nth-child(3),
.war-cost-table td:nth-child(3) {
  min-width: 250px;
}

.war-cost-details details {
  background: #fbfaf7;
  border: 1px solid #e5ded2;
  border-radius: 8px;
}

.war-cost-details summary {
  padding: 14px 16px;
  color: #2f4f87;
  cursor: pointer;
  font-weight: 950;
}

.war-cost-details p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  line-height: 1.6;
}

.war-cost-summary {
  border-color: #d6b56b;
  background: #fffaf0;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow-y: visible;
    padding: 20px 16px;
  }

  .topic-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .topic-link {
    flex: 0 0 auto;
  }

  .content {
    margin-right: 0;
    padding: 18px 12px 28px;
  }

  .topic-heading,
  .section-heading,
  .chart-heading,
  .aggregate-panel {
    grid-template-columns: 1fr;
  }

  .topic-heading,
  .section-heading,
  .chart-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    width: 100%;
  }

  .chart-list,
  .plotly-chart {
    min-height: 420px;
  }

  .gaza-impact-grid {
    grid-template-columns: 1fr;
  }

  .gaza-chart {
    min-height: 440px;
  }

  .evacuee-chart {
    min-height: 440px;
  }

  .gaza-chart-compact {
    min-height: 330px;
  }

  .evacuee-chart-compact {
    min-height: 360px;
  }

  .evacuee-map-grid {
    grid-template-columns: 1fr;
  }

  .evacuee-leaflet-map {
    min-height: 500px;
  }

  .timeline-chart {
    min-height: 460px;
  }

  .timeline-chart-compact {
    min-height: 360px;
  }

  .timeline-filter-grid {
    grid-template-columns: 1fr;
  }

  .timeline-filter-grid label,
  .timeline-control {
    grid-template-rows: auto auto;
  }

  .timeline-importance-options {
    height: auto;
    grid-template-columns: 1fr;
  }

  .filter-grid,
  .casualties-range-grid,
  .alarm-controls,
  .alarm-advanced-controls > div {
    grid-template-columns: 1fr;
  }

  .alarm-area-filter {
    grid-column: span 1;
  }

  .operation-controls,
  .operation-chart-grid {
    grid-template-columns: 1fr;
  }

  .operation-checks {
    grid-template-columns: 1fr;
  }

  .operation-plot {
    min-height: 460px;
  }

  #casualties-filters {
    grid-template-columns: 1fr;
  }

  .chart-mode-field {
    grid-column: span 1;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .timeline-event-card {
    grid-template-columns: 1fr;
  }

  .goal-progress-row {
    grid-template-columns: 1fr 54px;
  }

  .goal-progress-row span {
    grid-column: 1 / -1;
  }

  .metadata-list {
    grid-template-columns: 1fr;
  }

  .table-toolbar,
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .table-toolbar label {
    justify-content: space-between;
  }

  .table-toolbar input {
    width: 100%;
  }

  .people-card-list {
    grid-template-columns: 1fr;
  }

  .person-story-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .person-story-portrait {
    width: 64px;
    font-size: 1.08rem;
  }
}
