/* ---------- Fonts (self-hosted, SIL Open Font License; see fonts/) ---------- */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Colors: light (default) ---------- */
:root {
  --brand: #0B1F3A;
  --brand-ink: #FFFFFF;
  --accent: #C8102E;
  --accent-text: #C8102E;
  --ink: #0E1726;
  --muted: #5B6577;
  --line: #E1E6EF;
  --ground: #FFFFFF;
  --page: #E9EDF3;
  --soft: #F4F6FA;
  --soft-2: #EAEEF5;
  --chip-line: #8A94A6;
  --skeleton: #E7EBF2;
  --skeleton-shine: #F5F7FB;
  --mark: #FFE9A8;
  --focus: #1F5EFF;
  --shadow: 0 10px 30px rgba(11, 31, 58, 0.18);
  --ocean: #EEF2F8;
  --land: #D9DFE8;
  --land-line: #FFFFFF;
  --night: rgba(14, 23, 38, 0.14);
  --link-line: #0B1F3A;
  --pulse-bar: #B9C3D3;
  --shade-1: #F4B4BF;
  --shade-2: #EA8294;
  --shade-3: #DC4A63;
  --shade-4: #C8102E;
  --shade-5: #7A0A1C;
  --display: 'Archivo', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabs-height: 64px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

/* ---------- Colors: dark ---------- */
:root[data-theme='dark'] {
  --brand: #08172C;
  --accent: #D7263D;
  --accent-text: #FF7A8C;
  --ink: #E8EDF5;
  --muted: #9AA6BA;
  --line: #24314A;
  --ground: #0E1626;
  --page: #050B14;
  --soft: #16213A;
  --soft-2: #1C2944;
  --chip-line: #5E6B82;
  --skeleton: #1A2640;
  --skeleton-shine: #24324F;
  --mark: #5A4A12;
  --focus: #7AA2FF;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --ocean: #0A1222;
  --land: #253149;
  --land-line: #0E1626;
  --night: rgba(0, 0, 0, 0.42);
  --link-line: #F3F6FB;
  --pulse-bar: #3A4864;
  --shade-1: #4A2533;
  --shade-2: #7C2739;
  --shade-3: #B4253E;
  --shade-4: #E3384F;
  --shade-5: #FF8C9B;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand: #08172C;
    --accent: #D7263D;
    --accent-text: #FF7A8C;
    --ink: #E8EDF5;
    --muted: #9AA6BA;
    --line: #24314A;
    --ground: #0E1626;
    --page: #050B14;
    --soft: #16213A;
    --soft-2: #1C2944;
    --chip-line: #5E6B82;
    --skeleton: #1A2640;
    --skeleton-shine: #24324F;
    --mark: #5A4A12;
    --focus: #7AA2FF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --ocean: #0A1222;
    --land: #253149;
    --land-line: #0E1626;
    --night: rgba(0, 0, 0, 0.42);
  --link-line: #F3F6FB;
    --pulse-bar: #3A4864;
    --shade-1: #4A2533;
    --shade-2: #7C2739;
    --shade-3: #B4253E;
    --shade-4: #E3384F;
    --shade-5: #FF8C9B;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 100%; }
html[data-text='large'] { font-size: 112.5%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font-family: inherit; color: inherit; }
.icon { display: inline-flex; flex-shrink: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--ground); color: var(--ink); padding: 10px 14px; border-radius: 6px;
  font-weight: 700; text-decoration: none; box-shadow: none;
}
.skip-link:focus { top: 8px; box-shadow: var(--shadow); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom, 0px));
}

/* ---------- Tap feedback ---------- */
.pressable {
  transition: transform 140ms var(--ease), background-color 160ms ease, opacity 160ms ease;
}
.pressable:active { transform: scale(0.97); }
.row.pressable:active, .lead.pressable:active, .also-link.pressable:active { transform: none; background: var(--soft); }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: calc(6px + env(safe-area-inset-top, 0px)) 6px 6px 16px;
}
.wordmark {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wordmark-mark { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
/* The name, drawn in a 1700s typeface (outlines in icons/wordmark.svg), in the masthead's ink colour. */
.wordmark-name {
  display: block;
  width: 83px;
  max-width: 100%;
  height: 24px;
  flex-shrink: 1;
  min-width: 0;
  margin-top: 3px;
  background: currentColor;
  -webkit-mask: url(icons/wordmark.svg) no-repeat left center / contain;
  mask: url(icons/wordmark.svg) no-repeat left center / contain;
}
@supports not ((-webkit-mask-image: url(x)) or (mask-image: url(x))) {
  .wordmark-name { display: none; }
  .wordmark #wordmark-text.sr-only { position: static; width: auto; height: auto; clip: auto; clip-path: none; overflow: visible; white-space: nowrap; margin: 0; }
}
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.icon-button:hover { background: rgba(255, 255, 255, 0.1); }
.icon-button[aria-current='page'] { background: rgba(255, 255, 255, 0.16); }

/* ---------- Screens and transitions ---------- */
.view { flex: 1; outline: none; }
.screen { animation: screen-in 260ms var(--ease) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.status {
  margin: 0;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}
.sample-banner {
  margin: 0;
  padding: 6px 16px;
  background: var(--mark);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}
.offline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  background: var(--soft-2);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---------- Loading skeletons ---------- */
.skeleton { padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 45%, var(--skeleton) 90%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.kicker { width: 22%; height: 11px; }
.skeleton-line.big { height: 26px; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.meta { width: 40%; height: 11px; }
.skeleton-row { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ---------- Breaking bar ---------- */
.breaking {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 16px;
  background: var(--accent);
  color: #FFFFFF;
  text-decoration: none;
}
.breaking-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #FFFFFF;
  color: #C8102E;
  padding: 3px 7px;
  border-radius: 3px;
}
.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C8102E;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #C8102E;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(0.5); opacity: 0.9; }
  to { transform: scale(1.6); opacity: 0; }
}
.breaking-text {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- Chip rows (trending, regions, topics) ---------- */
.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Keeps screen-reader-only text inside the row, so it cannot widen the page. */
  position: relative;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row-label {
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  flex-shrink: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1.5px solid var(--chip-line);
  background: var(--ground);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 140ms var(--ease);
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}
:root[data-theme='dark'] .chip[aria-pressed='true'] { background: #E8EDF5; border-color: #E8EDF5; color: #0E1726; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chip[aria-pressed='true'] { background: #E8EDF5; border-color: #E8EDF5; color: #0E1726; }
}
.chip-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--soft-2);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Briefs entry card ---------- */
.briefs-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 16px 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--brand);
  color: #FFFFFF;
  text-decoration: none;
  overflow: hidden;
}
.briefs-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 92% 20%, rgba(200, 16, 46, 0.55), transparent 45%),
    radial-gradient(circle at 70% 120%, rgba(31, 94, 255, 0.35), transparent 50%);
  pointer-events: none;
}
.briefs-stack { position: relative; width: 44px; height: 52px; flex-shrink: 0; }
.briefs-stack span {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}
.briefs-stack span:nth-child(1) { transform: translate(8px, -6px) rotate(8deg); opacity: 0.45; }
.briefs-stack span:nth-child(2) { transform: translate(4px, -3px) rotate(4deg); opacity: 0.7; }
.briefs-stack span:nth-child(3) { background: #C8102E; border-color: #FFFFFF; }
.briefs-card:hover .briefs-stack span:nth-child(1) { transform: translate(11px, -8px) rotate(12deg); }
.briefs-stack span { transition: transform 260ms var(--ease); }
.briefs-text { position: relative; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.briefs-title { font-family: var(--display); font-size: 1.0625rem; font-weight: 800; }
.briefs-sub { font-size: 0.8125rem; color: #C9D2E0; }

/* ---------- Lead story and rows ---------- */
.lead {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  text-decoration: none;
}
.kicker {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.lead-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 800;
}
.meta { font-size: 0.75rem; font-weight: 600; color: var(--muted); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 8px 6px 16px;
  border-top: 3px solid var(--brand);
}
:root[data-theme='dark'] .section-head { border-top-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .section-head { border-top-color: var(--line); } }
.section-heading {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 20px;
  background: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.refresh:hover { background: var(--soft); }
.refresh.spinning .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.row-meta {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.row-meta .section-name { color: var(--accent-text); }
.row-title { font-size: 1rem; line-height: 1.3; font-weight: 700; }
.visited .row-title, .visited .lead-title { color: var(--muted); }
.lead:hover .lead-title, .row:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.more-button {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 20px;
}
.row-enter { animation: row-in 320ms var(--ease) both; }
@keyframes row-in {
  from { opacity: 0; transform: translateY(-6px); background: var(--mark); }
  to { opacity: 1; transform: none; }
}

/* ---------- New stories pill ---------- */
.new-pill {
  position: fixed;
  left: 50%;
  top: calc(66px + env(safe-area-inset-top, 0px));
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translate(-50%, -16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 300ms var(--ease), opacity 240ms ease;
}
.new-pill.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--brand);
  color: #FFFFFF;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
:root[data-theme='dark'] .button { background: #E8EDF5; color: #0E1726; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .button { background: #E8EDF5; color: #0E1726; } }
.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--chip-line);
  min-height: 44px;
}
.button.small { min-height: 40px; font-size: 0.875rem; padding: 6px 14px; }
.button-row { display: flex; gap: 10px; }
.button-row > * { flex: 1; }
.saved-on .icon svg { fill: currentColor; }
.pop { animation: pop 320ms var(--ease); }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ---------- Story page ---------- */
.story { padding: 6px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: -8px;
  padding: 0 10px 0 4px;
  border-radius: 22px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.back:hover { background: var(--soft); }
.story-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.story-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 800;
}
.credit { margin: 0; font-size: 0.875rem; font-weight: 600; }
.note { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.block-heading {
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* Coverage timeline */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-track {
  position: relative;
  height: 28px;
  margin: 0 8px;
}
.timeline-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 13px;
  height: 2px;
  background: var(--line);
  border-radius: 1px;
}
.timeline-fill {
  position: absolute;
  left: 0;
  top: 13px;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  animation: grow 700ms var(--ease) both;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.timeline-dot {
  position: absolute;
  top: 8px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--ground);
  border: 3px solid var(--accent);
  animation: dot-in 400ms var(--ease) both;
}
.timeline-dot.first { background: var(--accent); }
@keyframes dot-in { from { transform: scale(0); } to { transform: scale(1); } }
.timeline-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 0.75rem; color: var(--muted); }
.timeline-legend strong { color: var(--ink); font-weight: 700; }

.also-list { list-style: none; margin: 0; padding: 0; }
.also-list li { border-top: 1px solid var(--line); }
.also-list li:first-child { border-top: 0; }
.also-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 6px;
  margin: 0 -6px;
  border-radius: 6px;
  min-height: 44px;
  text-decoration: none;
}
.also-source { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.also-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.also-link:hover .also-title { text-decoration: underline; }

/* ---------- Mini map (locator) ---------- */
.mini-map {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ocean);
}
.mini-map svg { display: block; width: 100%; height: auto; }
.mini-map path { fill: var(--land); stroke: var(--land-line); stroke-width: 0.4; }
.mini-map path.hit { fill: var(--accent); }
.mini-map circle.hit { fill: var(--accent); stroke: var(--ground); stroke-width: 1.5; }
.mini-map .ping {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

/* ---------- Pages (My Feed, About, Search, Place) ---------- */
.page { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.page-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 800;
}
.page p { margin: 0; }
.page h2 {
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 3px solid var(--brand);
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
:root[data-theme='dark'] .page h2 { border-top-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .page h2 { border-top-color: var(--line); } }
.feed-list { margin: 0 -16px; }
.sheet .feed-list { margin: 0; }
.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { padding: 2px 0; }
.link { color: inherit; font-weight: 700; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; font-weight: 600; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--chip-line);
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.search-form { display: flex; gap: 8px; align-items: flex-end; }
.search-form .field { flex: 1; }
.add-form { display: flex; gap: 8px; align-items: flex-end; }
.add-form .field { flex: 1; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--soft-2);
  gap: 3px;
}
.segmented button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.segmented button[aria-pressed='true'] { background: var(--ground); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); font-weight: 800; }
.setting { display: flex; flex-direction: column; gap: 8px; }
.setting-label { font-size: 0.875rem; font-weight: 700; }

.bars { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 0.875rem; }
.bar-name { font-weight: 600; }
.bar-count { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--soft-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; animation: grow 700ms var(--ease) both; }

/* Empty states */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
}
.empty-art { width: 120px; height: 96px; color: var(--muted); }
.empty-art .accent { color: var(--accent); }
.empty-title { margin: 0; font-family: var(--display); font-size: 1.125rem; font-weight: 800; }
.empty-text { margin: 0; max-width: 300px; font-size: 0.9375rem; color: var(--muted); }

/* ---------- Map screen ---------- */
.map-screen { display: flex; flex-direction: column; }
.map-head { padding: 18px 16px 4px; display: flex; flex-direction: column; gap: 4px; }
.map-card {
  position: relative;
  margin: 10px 16px 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ocean);
  border: 1px solid var(--line);
}
.map-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.map-svg.dragging { cursor: grabbing; }
.map-svg .land { fill: var(--land); stroke: var(--land-line); stroke-width: 0.5; vector-effect: non-scaling-stroke; transition: fill 400ms ease; }
.map-svg .s1 { fill: var(--shade-1); }
.map-svg .s2 { fill: var(--shade-2); }
.map-svg .s3 { fill: var(--shade-3); }
.map-svg .s4 { fill: var(--shade-4); }
.map-svg .s5 { fill: var(--shade-5); }
.map-svg .hot { cursor: pointer; }
.map-svg .hot:hover { filter: brightness(1.08); }
.map-svg .selected { stroke: var(--ink); stroke-width: 2; }
.map-svg .dot { stroke: var(--land-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-svg .dot.s0 { fill: var(--land); }
.map-svg [role='button']:focus { outline: none; }
.map-svg [role='button']:focus-visible .land, .map-svg [role='button']:focus-visible .dot { stroke: var(--focus); stroke-width: 3; }
.map-controls {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-controls button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ground);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.legend-swatches { display: inline-flex; gap: 3px; }
.legend-swatches span { width: 22px; height: 10px; border-radius: 2px; }
.legend { flex-wrap: wrap; }
.legend-night { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.legend-night-swatch { width: 16px; height: 10px; border-radius: 2px; background: var(--night); border: 1px solid var(--line); }
.map-note { padding: 6px 16px 0; font-size: 0.75rem; color: var(--muted); }

/* Day and night on the map */
.map-svg .sky { pointer-events: none; }
.map-svg .night { fill: var(--night); transition: d 600ms ease; }
.map-svg .sun { fill: #F6B40E; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; animation: sun-glow 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sun-glow { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.75; transform: scale(1.25); } }

/* World clocks */
.clocks {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 2px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
}
.clocks::-webkit-scrollbar { display: none; }
.clock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground);
  scroll-snap-align: start;
}
.clock-city { display: inline-flex; align-items: center; gap: 5px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.clock.day .clock-city .icon { color: #D99A00; }
.clock.night .clock-city .icon { color: var(--navy-soft, #5B6B8C); }
.clock-time { font-family: var(--display); font-size: 1.0625rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }

/* News pulse chart */
.pulse { margin: 18px 16px 0; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--ground); }
.pulse-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pulse-head h2 { margin: 0; font-family: var(--display); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pulse-total { font-size: 0.75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pulse .note { margin: 4px 0 10px; }
.pulse-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pulse-axis { stroke: var(--line); stroke-width: 1; }
.pulse-bar { fill: var(--pulse-bar); transform-box: fill-box; transform-origin: bottom; animation: bar-up 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.pulse-bar.peak { fill: var(--ink); }
.pulse-bar.now { fill: var(--accent); }
.pulse-label { font-size: 9px; fill: var(--muted); font-family: var(--body); font-weight: 600; }
.pulse-summary { margin: 8px 0 0; font-size: 0.75rem; color: var(--muted); }
@keyframes bar-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(5, 11, 20, 0.45);
  opacity: 0;
  transition: opacity 240ms ease;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 31;
  width: 100%;
  max-width: 480px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow);
  transform: translate(-50%, 100%);
  transition: transform 320ms var(--ease);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 2px; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px 16px; }
.sheet-title { flex: 1; margin: 0; font-family: var(--display); font-size: 1.25rem; font-weight: 800; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; }
.sheet .icon-button { color: var(--ink); }
.sheet .icon-button:hover { background: var(--soft); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-height) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: #0E1726;
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: transform 260ms var(--ease), opacity 200ms ease;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Briefs (full screen, swipe) ---------- */
.briefs {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: #050B14;
  color: #FFFFFF;
  animation: briefs-in 280ms var(--ease) both;
}
.briefs.closing { animation: briefs-out 220ms ease both; }
@keyframes briefs-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes briefs-out { to { opacity: 0; transform: scale(0.98); } }
.briefs-inner { position: relative; max-width: 480px; height: 100%; margin: 0 auto; }
.briefs-track {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.briefs-track::-webkit-scrollbar { display: none; }
.brief {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(76px + env(safe-area-inset-top, 0px)) 22px calc(28px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
.brief-bg { position: absolute; inset: 0; z-index: 0; }
.brief-bg.world { background: radial-gradient(120% 70% at 85% 10%, #1F4F8F 0%, transparent 55%), radial-gradient(90% 60% at 0% 100%, #6E0F22 0%, transparent 60%), #0B1F3A; }
.brief-bg.business { background: radial-gradient(120% 70% at 90% 0%, #0F6B5B 0%, transparent 55%), radial-gradient(80% 60% at 0% 100%, #2A3F8F 0%, transparent 60%), #0B1F3A; }
.brief-bg.tech { background: radial-gradient(120% 70% at 85% 5%, #5B2A9A 0%, transparent 55%), radial-gradient(90% 60% at 10% 100%, #0F5F8F 0%, transparent 60%), #0B1F3A; }
.brief-bg.other { background: radial-gradient(120% 70% at 85% 5%, #8A4B0F 0%, transparent 55%), #0B1F3A; }
.brief-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.brief-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 520ms var(--ease);
}
.brief.active .brief-content { opacity: 1; transform: none; }
.brief-tag {
  align-self: flex-start;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #C8102E;
  color: #FFFFFF;
  padding: 5px 8px;
  border-radius: 4px;
}
.brief-title { margin: 0; font-family: var(--display); font-size: 2rem; line-height: 1.1; font-weight: 800; }
.brief-meta { font-size: 0.875rem; font-weight: 600; color: #D5DCE8; }
.brief-map { border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.brief-map svg { display: block; width: 100%; height: auto; }
.brief-map path { fill: rgba(255, 255, 255, 0.16); stroke: none; }
.brief-map path.hit { fill: #FF5C72; }
.brief-map circle.hit { fill: #FF5C72; }
.brief-map .ping { fill: none; stroke: #FF5C72; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ping 1.8s ease-out infinite; }
.brief-places { font-size: 0.8125rem; color: #C9D2E0; }
.brief-actions { display: flex; gap: 10px; }
.brief-actions .read {
  flex: 1;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  background: #FFFFFF;
  color: #0E1726;
  font-weight: 800;
  font-size: 0.9375rem;
  text-decoration: none;
}
.brief-actions .round {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.brief-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #D5DCE8;
}
.brief-hint .icon { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.briefs-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.briefs-progress { display: flex; gap: 4px; }
.briefs-progress span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.briefs-progress span::after { content: ''; display: block; height: 100%; width: 100%; background: #FFFFFF; transform: scaleX(var(--fill, 0)); transform-origin: left; transition: transform 300ms var(--ease); }
.briefs-bar { display: flex; align-items: center; justify-content: space-between; pointer-events: auto; }
.briefs-bar .icon-button { color: #FFFFFF; }
.briefs-count { font-size: 0.8125rem; font-weight: 700; padding-right: 8px; }
/* A file photo from the app's own library fills the top of a Briefs card. */
.brief-photo { position: absolute; left: 0; right: 0; top: 0; height: 56%; z-index: 0; overflow: hidden; }
.brief-photo > img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.02); transition: transform 7s ease-out; }
.brief.active .brief-photo > img { transform: scale(1.09); }
/* Dark at the very top (for the bar) and from the middle down (for the headline). */
.brief-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 11, 20, 0.62) 0%, rgba(5, 11, 20, 0) 26%, rgba(5, 11, 20, 0) 46%, rgba(8, 18, 34, 0.86) 84%, #0B1F3A 100%);
}
.brief.has-photo .brief-bg { top: 50%; }
.brief.has-photo .brief-bg::after { display: none; }
.brief.has-photo .brief-title { text-shadow: 0 1px 12px rgba(5, 11, 20, 0.55); }
.brief-chapter { font-family: var(--display); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #FFD166; }
.brief-credit { font-size: 0.6875rem; line-height: 1.35; color: #C9D2E0; }
.brief-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .brief-photo > img, .brief.active .brief-photo > img { transform: none; transition: none; }
}
/* On a short screen or with large text, everything on a card stays reachable: the
   headline is capped by the screen's height, the optional lines go, and as a last
   resort the card's text scrolls on its own. */
.brief-content { min-height: 0; max-height: 100%; overflow-y: auto; scrollbar-width: none; }
.brief-content::-webkit-scrollbar { display: none; }
.brief-title { font-size: min(2rem, 5.2vh); }
@media (max-height: 640px) {
  .brief-places, .brief-hint { display: none; }
  .brief-content { gap: 10px; }
}
.briefs-count { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.brief-end { justify-content: center; align-items: center; text-align: center; }
.brief-end .brief-content { align-items: center; }

/* ---------- Bottom feed buttons ---------- */
.tabs {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabs-height) + env(safe-area-inset-bottom, 0px));
  display: flex;
  background: var(--ground);
  border-top: 1px solid var(--line);
  padding: 0 0 env(safe-area-inset-bottom, 0px);
}
.tab-indicator {
  position: absolute;
  top: -1px;
  left: 0;
  width: 20%;
  height: 3px;
  padding: 0 14px;
  transition: transform 320ms var(--ease), opacity 200ms ease;
}
.tab-indicator::before { content: ''; display: block; height: 100%; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab-indicator.hidden { opacity: 0; }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 200ms ease;
}
.tab .icon { transition: transform 200ms var(--ease); }
.tab:active .icon { transform: scale(0.86); }
.tab[aria-current='page'] { color: var(--ink); font-weight: 800; }
.tab[aria-current='page'] .icon { transform: translateY(-1px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton-line { background: var(--skeleton); }
  .brief-content { opacity: 1; transform: none; }
  .live-dot::after, .ping { display: none; }
}

/* Only the outer screen animates when screens are nested. */
.screen .screen { animation: none; }

/* ---------- Pull to refresh ---------- */
html { overscroll-behavior-y: contain; }
.pull-badge {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  z-index: 9;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ground);
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translate(-50%, -10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 260ms var(--ease), opacity 200ms ease, background-color 160ms ease, color 160ms ease;
}
.pull-badge.dragging { transition: background-color 160ms ease, color 160ms ease; }
.pull-badge.ready { background: var(--accent); color: #fff; }
.pull-badge.loading { opacity: 1; background: var(--ground); color: var(--accent); }
.pull-badge.loading .icon { animation: spin 0.8s linear infinite; }
.pull-badge .icon { display: grid; }

/* ---------- New since your last visit ---------- */
.new-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
  box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.5);
  animation: new-dot 2.4s ease-out 2;
}
@keyframes new-dot { 0% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(200, 16, 46, 0); } }

/* ---------- Related stories ---------- */
.feed-list.related { margin-top: 2px; }

/* ---------- Page transitions (where supported) ---------- */
.masthead { view-transition-name: masthead; }
.tabs { view-transition-name: tabs; }
.tab-indicator { view-transition-name: tab-indicator; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 230ms; animation-timing-function: var(--ease); }
html[data-vt='forward']::view-transition-old(root) { animation-name: vt-out-left; }
html[data-vt='forward']::view-transition-new(root) { animation-name: vt-in-right; }
html[data-vt='back']::view-transition-old(root) { animation-name: vt-out-right; }
html[data-vt='back']::view-transition-new(root) { animation-name: vt-in-left; }
::view-transition-group(headline) { animation-duration: 340ms; animation-timing-function: var(--ease); }
::view-transition-group(tab-indicator) { animation-duration: 260ms; animation-timing-function: var(--ease); }
@keyframes vt-in-right { from { transform: translateX(32px); opacity: 0; } }
@keyframes vt-out-left { to { transform: translateX(-32px); opacity: 0; } }
@keyframes vt-in-left { from { transform: translateX(-32px); opacity: 0; } }
@keyframes vt-out-right { to { transform: translateX(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
  .map-svg .sun { animation: none; }
  .pulse-bar { animation: none; }
}

/* ---------- Loading bar ---------- */
.load-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  z-index: 11;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  transition: opacity 200ms ease;
}
.load-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  transform: translateX(-100%);
}
.load-bar.active { opacity: 1; }
.load-bar.active::before { animation: load-slide 1.1s var(--ease) infinite; }
.load-bar.done::before { animation: none; transform: none; background: var(--accent); transition: transform 300ms ease; }
.load-bar.done { opacity: 0; transition: opacity 300ms ease 120ms; }
@keyframes load-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------- Developing ---------- */
.developing { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-text); font-weight: 800; }
.developing .live-dot { width: 7px; height: 7px; }
.live-page { font-weight: 800; color: var(--accent-text); letter-spacing: .02em; }
.rising-heading { display: flex; align-items: center; gap: 6px; }
.rising-heading .icon { color: var(--accent-text); display: inline-flex; }

/* ---------- Where the coverage comes from ---------- */
.origins { margin-top: 4px; }
.origin-bar { display: flex; gap: 3px; height: 12px; margin: 10px 0 10px; border-radius: 6px; overflow: hidden; }
.origin-seg { flex-basis: 0; min-width: 6px; transform-origin: left; animation: grow 560ms var(--ease) both; }
.origin-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.origin-legend li { display: inline-flex; align-items: center; gap: 6px; }
.origin-legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.origin-key { width: 10px; height: 10px; border-radius: 3px; }
.o0 { background: var(--brand-strong, #0B1F3A); }
.o1 { background: var(--accent); }
.o2 { background: #5B7DB1; }
.o3 { background: #E58A9A; }
.o4 { background: #9AA6BA; }
[data-theme='dark'] .o0 { background: #8FA9D6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .o0 { background: #8FA9D6; } }

/* ---------- Keyboard shortcuts ---------- */
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; padding: 4px 16px 16px; align-items: center; }
.shortcuts dt { margin: 0; }
.shortcuts dd { margin: 0; color: var(--ink); }
kbd {
  display: inline-block;
  min-width: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--soft);
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
}
#view a.row:focus-visible, #view a.lead:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 6px; }

/* ---------- Welcome ---------- */
.welcome { padding: 0 16px 16px; }
.welcome-points { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 10px; }
.welcome-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.welcome-points .icon { color: var(--accent); flex: none; margin-top: 1px; }
.welcome h3 { margin: 16px 0 8px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.welcome .button { width: 100%; margin-top: 18px; }
.search-filters { padding-left: 0; padding-right: 0; margin: 4px 0 2px; }

/* ---------- Briefs: listen ---------- */
.briefs-bar .listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.briefs-bar .listen[aria-pressed='true'] { background: #FFFFFF; color: var(--brand); border-color: #FFFFFF; }
.briefs-bar .listen[aria-pressed='true'] .icon { animation: pulse-soft 1.6s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- Most covered ---------- */
.covered { padding: 14px 16px 6px; border-top: 3px solid var(--ink); }
.covered .section-heading { margin: 0 0 6px; }
.covered-list { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.covered-list li + li { border-top: 1px solid var(--line); }
.covered-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; color: inherit; text-decoration: none; }
.covered-rank { flex: none; width: 26px; font-family: var(--display); font-size: 1.5rem; font-weight: 800; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.covered-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.covered-meter { position: relative; display: flex; align-items: center; height: 16px; }
.covered-fill { height: 4px; border-radius: 2px; background: var(--accent); transform-origin: left; animation: grow 700ms var(--ease) both; }
.covered-count { margin-left: 8px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.covered { border-top-color: var(--brand); }
:root[data-theme='dark'] .covered { border-top-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .covered { border-top-color: var(--line); } }

/* ---------- Wide screens: feed + side panel ---------- */
.rail { display: none; }
@media (min-width: 1080px) {
  body { background: var(--page); }
  .app {
    max-width: 1060px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }
  .masthead { grid-column: 1 / -1; padding-left: 24px; padding-right: 16px; }
  .view { grid-column: 1; min-width: 0; border-right: 1px solid var(--line); min-height: calc(100vh - 56px); }
  .rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    grid-column: 2;
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 56px - var(--tabs-height));
    overflow-y: auto;
    padding: 16px 16px 24px;
    scrollbar-width: thin;
  }
  .app.full .view { grid-column: 1 / -1; border-right: 0; }
  .app.full .rail { display: none; }
  .tabs { max-width: 1060px; }
  .tab-indicator { width: 20%; }
  .load-bar { left: 50%; right: auto; width: 1060px; max-width: 100%; transform: translateX(-50%); }
  .app.full .map-card { width: calc(100% - 32px); max-width: 940px; align-self: center; margin: 10px 0 0; }
  .app.full .legend, .app.full .map-note, .app.full .clocks { width: 100%; max-width: 972px; align-self: center; }
  .app.full .map-extras { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; width: 100%; max-width: 972px; align-self: center; }
  .app.full .map-extras .pulse { margin-top: 18px; }
  .app.full .most-mentioned { padding-top: 0 !important; }
  /* Country and state pages: a comfortable reading width on a wide screen. */
  .app.full .page.screen { max-width: 820px; width: 100%; margin: 0 auto; box-sizing: border-box; }
}
.rail .bar-row, .rail-bars a { text-decoration: none; color: inherit; }
.rail-card { display: flex; flex-direction: column; gap: 10px; }
.rail .pulse { margin: 0; }
.rail .clocks { flex-wrap: wrap; overflow: visible; padding: 0; }
.rail .clock { min-width: 0; flex: 1 1 calc(50% - 4px); }
.rail-bars { padding: 0; margin: 0; }
.rail-note { margin: 0; font-size: 0.75rem; color: var(--muted); }
.glance-map {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--ocean);
  color: inherit;
  text-decoration: none;
}
.glance-map svg { display: block; width: 100%; height: auto; }
.glance-map .land { fill: var(--land); stroke: var(--land-line); stroke-width: 0.5; }
.glance-map .s1 { fill: var(--shade-1); } .glance-map .s2 { fill: var(--shade-2); } .glance-map .s3 { fill: var(--shade-3); }
.glance-map .s4 { fill: var(--shade-4); } .glance-map .s5 { fill: var(--shade-5); }
.glance-map .night { fill: var(--night); pointer-events: none; }
.glance-map .dot { stroke: var(--land-line); stroke-width: 1; }
.glance-caption { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--ground); border-top: 1px solid var(--line); }
.glance-open { color: var(--accent-text); font-weight: 700; white-space: nowrap; }
.rail { view-transition-name: rail; }

/* ---------- Map: lines between countries in the same story ---------- */
.map-svg .links { pointer-events: none; opacity: 0; transition: opacity 240ms ease; }
.map-svg .links.on { opacity: 1; pointer-events: auto; }
.map-svg .link {
  fill: none;
  stroke: var(--link-line);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.map-svg .links.on .link { animation: link-draw 900ms var(--ease) forwards; }
.map-svg .link:hover { stroke: var(--accent); }
@keyframes link-draw { to { stroke-dashoffset: 0; } }
.map-controls .links-toggle[aria-pressed='true'] { background: var(--brand); color: #FFFFFF; }
.map-note .icon { display: inline-flex; vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .map-svg .link { stroke-dashoffset: 0; } }
.page > .pulse { margin-left: 0; margin-right: 0; }

/* ---------- Saved stories with newer reports ---------- */
.saved-item { border-bottom: 1px solid var(--line); }
.saved-item > .row { border-bottom: 0; padding-bottom: 6px; }
.saved-update {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--accent-text);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
}
.saved-update .live-dot { flex: none; }
.pulse .pulse-head h2 { margin: 0; padding: 0; border: 0; }

/* ---------- Map: rising countries ---------- */
.map-svg .pings { pointer-events: none; }
.map-svg .ping-core { fill: var(--accent); stroke: #FFFFFF; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map-svg .ping-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: ping 2s ease-out infinite;
}
.rising-row { padding-top: 10px; }
.rising-row .chip-row-label { display: inline-flex; align-items: center; gap: 4px; }
.chip-count.rise { background: var(--accent); color: #FFFFFF; }
@media (prefers-reduced-motion: reduce) { .map-svg .ping-ring { animation: none; opacity: 0.5; } }
.map-note { margin: 0; }
.map-note + .map-note { padding-top: 4px; }

/* ---------- Small touches ---------- */
/* The tapped tab's icon gives a little bounce. */
.tab[aria-current='page'] .icon { animation: tab-pop 360ms var(--ease); }
@keyframes tab-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18) translateY(-1px); } 100% { transform: scale(1); } }
/* The red dot in the logo pulses while new stories are waiting. */
.wordmark-mark .signal { transform-box: fill-box; transform-origin: center; }
.wordmark.has-new .wordmark-mark .signal { animation: logo-dot 1.4s ease-in-out infinite; }
@keyframes logo-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) {
  .tab[aria-current='page'] .icon, .wordmark.has-new .wordmark-mark .signal { animation: none; }
}

/* ---------- Compare wording ---------- */
.compare-toggle { align-self: flex-start; margin: 2px 0 4px; }
.compare-note { margin: 0 0 4px; }
mark.diff { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; animation: diff-in 260ms var(--ease); }
@keyframes diff-in { from { background: transparent; } }
.briefs-card.catch-up { background: linear-gradient(120deg, #7A0A1C, var(--brand) 70%); }
button.back { border: 0; background: none; font-family: inherit; color: var(--ink); cursor: pointer; }
button.back:hover, a.back:hover { background: var(--soft); }

/* ---------- World / United States map ---------- */
.scope-toggle { align-self: flex-start; margin: 6px 0 4px; }
.map-svg.us-svg { aspect-ratio: 1026 / 606; cursor: default; touch-action: auto; }
.us-mini svg { aspect-ratio: 1026 / 606; }

/* ---------- Search shortcut to a country, state or topic page ---------- */
.search-shortcut {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  margin: 12px 0 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
}
.search-shortcut-kind { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.search-shortcut-name { grid-row: 2; font-weight: 700; }
.search-shortcut .icon { grid-row: 1 / span 2; grid-column: 2; transform: rotate(180deg); color: var(--muted); }
.publisher-chips .chip[aria-pressed='false'] { text-decoration: line-through; color: var(--muted); }
.publisher-chips .chip[aria-pressed='true'] { background: var(--ground); color: var(--ink); border-color: var(--chip-line); }
.publisher-chips .chip[aria-pressed='true']::before { content: '✓'; margin-right: 6px; color: var(--accent-text); font-weight: 800; }
.publisher-chips .chip[aria-pressed='false'] { border-style: dashed; }
/* On narrow phones the map is short, so its buttons sit two by two. */
@media (max-width: 400px) {
  .map-controls { display: grid; grid-template-columns: repeat(2, 40px); gap: 6px; }
}
.map-svg .link-hit { fill: none; stroke: transparent; stroke-width: 16px; vector-effect: non-scaling-stroke; cursor: pointer; pointer-events: stroke; }
.map-svg .links:not(.on) .link-hit { pointer-events: none; }
.map-svg .link-hit:hover + .link, .map-svg .link:hover { stroke: var(--accent); }

/* ---------- Hover (mouse only) ---------- */
@media (hover: hover) {
  .chip:not([aria-pressed='true']):hover { background: var(--soft); }
  .covered-item:hover .row-title, a.bar-row:hover .bar-name, .saved-update:hover, .glance-map:hover .glance-open { text-decoration: underline; text-underline-offset: 3px; }
  .search-shortcut:hover, .glance-map:hover { border-color: var(--chip-line); }
  .briefs-card:hover { filter: brightness(1.06); }
  .clock:hover { border-color: var(--chip-line); }
}

/* ---------- Map replay: the last 24 hours ---------- */
.replay {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 16px 0;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground);
}
@media (min-width: 1080px) { .app.full .replay { width: calc(100% - 32px); max-width: 940px; align-self: center; box-sizing: border-box; margin: 10px 0 0; } }
.replay-play {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font: 700 0.8125rem/1 var(--body);
  cursor: pointer;
}
.replay-play .icon { display: inline-flex; }
:root[data-theme='dark'] .replay-play { background: #E8EDF5; color: #0E1726; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .replay-play { background: #E8EDF5; color: #0E1726; } }
.replay.playing .replay-play { background: var(--accent); color: #FFFFFF; }
.replay-range {
  flex: 1;
  min-width: 0;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.replay-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--fill, 100%), var(--soft-2) var(--fill, 100%));
}
.replay-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--soft-2); }
.replay-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.replay-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--ground);
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(11, 31, 58, 0.25);
  transition: transform 160ms var(--ease);
}
.replay-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ground);
  border: 2px solid var(--accent);
}
.replay-range:active::-webkit-slider-thumb { transform: scale(1.2); }
.replay-range:focus { outline: none; }
.replay-range:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.replay-readout {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 92px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.replay-clock { font: 800 0.875rem/1.2 var(--display); }
.replay.past .replay-clock { color: var(--accent-text); }
.replay-count { font-size: 0.75rem; color: var(--muted); }
/* While an earlier time is shown, the live-only layers step aside. */
.map-card.replaying .pings,
.map-card.replaying .links { opacity: 0 !important; transition: opacity 200ms ease; }
.map-svg .dot { transition: r 300ms var(--ease), fill 400ms ease; }
@media (max-width: 360px) {
  .replay-play span:not(.icon):not(.replay-icon) { display: none; }
  .replay-play { padding: 0 10px; }
  .replay-readout { min-width: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-svg .dot { transition: none; }
}

/* ---------- Globe view ---------- */
:root { --globe-sea: #DCE6F3; --globe-grid: rgba(11, 31, 58, 0.07); --shine-a: rgba(255, 255, 255, 0.45); --shine-c: rgba(11, 31, 58, 0.16); }
:root[data-theme='dark'] { --globe-sea: #0F1D35; --globe-grid: rgba(232, 237, 245, 0.06); --shine-a: rgba(255, 255, 255, 0.10); --shine-c: rgba(0, 0, 0, 0.45); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --globe-sea: #0F1D35; --globe-grid: rgba(232, 237, 245, 0.06); --shine-a: rgba(255, 255, 255, 0.10); --shine-c: rgba(0, 0, 0, 0.45); }
}
.map-svg.globe-svg { aspect-ratio: 1 / 1; max-height: min(68vh, 620px); }
@media (min-width: 1080px) { .app.full .map-svg.globe-svg { aspect-ratio: 16 / 10; max-height: 64vh; } }
.map-card:not(.globe-on) .globe-svg { display: none; }
.map-card.globe-on .map-svg:not(.globe-svg) { display: none; }
.globe-svg .globe-sea { fill: var(--globe-sea); }
.globe-svg .globe-grid { fill: none; stroke: var(--globe-grid); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.globe-svg .globe-night { transition: none; pointer-events: none; }
.globe-svg .globe-shine { pointer-events: none; }
.globe-svg .globe-rim { fill: none; stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.globe-svg .shine-a { stop-color: var(--shine-a); }
.globe-svg .shine-b { stop-color: rgba(255, 255, 255, 0); }
.globe-svg .shine-c { stop-color: var(--shine-c); }
.globe-svg .land { transition: fill 400ms ease; }
.map-card.globe-on { animation: globe-in 420ms var(--ease); }
@keyframes globe-in { from { opacity: 0.4; } to { opacity: 1; } }
.map-card.globe-loading .view-toggle button[aria-busy='true'] { opacity: 0.6; }
.view-toggle {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ground);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.view-toggle button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 700 0.8125rem/1 var(--body);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.view-toggle button[aria-pressed='true'] { background: var(--brand); color: #FFFFFF; }
:root[data-theme='dark'] .view-toggle button[aria-pressed='true'] { background: #E8EDF5; color: #0E1726; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .view-toggle button[aria-pressed='true'] { background: #E8EDF5; color: #0E1726; } }
@media (prefers-reduced-motion: reduce) { .map-card.globe-on { animation: none; } }

/* The news pulse follows the replay: hours still to come are dimmed. */
.pulse-bar { transition: opacity 200ms ease, fill 200ms ease; }
.pulse-bar.later { opacity: 0.2; }
.pulse-bar.replay-at { fill: var(--accent); }

/* The haze around the globe's edge. */
:root { --glow: rgba(31, 94, 255, 0.22); }
:root[data-theme='dark'] { --glow: rgba(122, 162, 255, 0.28); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --glow: rgba(122, 162, 255, 0.28); } }
.globe-svg .globe-glow { pointer-events: none; }
.globe-svg .glow-a { stop-color: var(--glow); stop-opacity: 0; }
.globe-svg .glow-b { stop-color: var(--glow); }
.globe-svg .glow-c { stop-color: var(--glow); stop-opacity: 0; }

/* ---------- Leading stories for the chosen map region ---------- */
.region-stories { margin: 16px 16px 0; animation: screen-in 260ms var(--ease); }
.region-stories .section-heading { margin: 0 0 2px; color: var(--accent-text); }
.region-stories .feed-list { margin: 0 -16px; }
@media (min-width: 1080px) {
  .app.full .region-stories { width: calc(100% - 32px); max-width: 940px; align-self: center; margin: 16px 0 0; }
  .app.full .region-stories .feed-list { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .region-stories { animation: none; } }

/* While the globe's outlines load: a round placeholder that gently breathes. */
.map-card.globe-loading { min-height: min(358px, 68vh); }
.map-card.globe-loading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72%, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 36% 30%, var(--skeleton-shine), var(--skeleton) 70%);
  animation: globe-breathe 1.2s ease-in-out infinite;
}
@keyframes globe-breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ---------- One-time tip (home screen) ---------- */
.hint-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 14px 16px 4px;
  padding: 12px 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  animation: screen-in 300ms var(--ease);
  transition: opacity 240ms ease, transform 240ms var(--ease);
}
.hint-card.leaving { opacity: 0; transform: scale(0.97); }
.hint-icon { display: inline-flex; width: 36px; height: 36px; border-radius: 10px; align-items: center; justify-content: center; background: var(--brand); color: #FFFFFF; }
.hint-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; color: var(--muted); }
.hint-text strong { color: var(--ink); font-size: 0.9375rem; }
.hint-actions { display: flex; align-items: center; gap: 4px; }
.hint-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.hint-close:hover { background: var(--soft-2); color: var(--ink); }

/* Country page: the small map opens the big one, turned to this country. */
.mini-map-link { position: relative; display: block; color: inherit; text-decoration: none; border-radius: 10px; }
.mini-map-cta {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ground);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.mini-map-cta .icon { display: inline-flex; }
@media (hover: hover) { .mini-map-link:hover .mini-map-cta { border-color: var(--chip-line); } }
.mini-map-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* During the replay the clocks show the replayed moment. */
.clocks.past .clock-time { color: var(--accent-text); }
.news-card .hint-icon { background: var(--accent); }

/* Country names written on the map (and globe). */
.map-svg .labels { pointer-events: none; transition: opacity 200ms ease; }
.map-label {
  font-family: var(--body);
  fill: var(--ink);
  stroke: var(--ground);
  stroke-linejoin: round;
  paint-order: stroke;
}
.map-label-name { font-weight: 800; }
.map-label-count { font-weight: 600; fill: var(--accent-text); }
.map-card.replaying .labels { opacity: 0; }

/* Map loading shape */
.skeleton-map-screen { padding-top: 22px; }
.skeleton-chips { display: flex; gap: 8px; margin: 6px 0 2px; }
.skeleton-line.skeleton-chip { width: 84px; height: 34px; border-radius: 999px; flex: none; }
.skeleton-line.skeleton-map { height: auto; aspect-ratio: 16 / 10; border-radius: 14px; }
.skeleton-line.skeleton-bar { height: 52px; border-radius: 12px; }
@media (min-width: 1080px) { .app.full .skeleton-map-screen { max-width: 972px; margin: 0 auto; } }
.skeleton-story { padding-top: 22px; }
.skeleton-line.skeleton-button { height: 50px; border-radius: 8px; margin-top: 8px; }

/* Tap feedback for every kind of button: a quick press-in. */
.button, .icon-button, .map-controls button, .view-toggle button, .scope-toggle button, .segmented button, .hint-close, .replay-play, .refresh, .more-button {
  transition: transform 120ms var(--ease), background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}
.button:active, .icon-button:active, .map-controls button:active, .view-toggle button:active, .scope-toggle button:active, .segmented button:active, .hint-close:active, .replay-play:active, .refresh:active, .more-button:active {
  transform: scale(0.95);
}

/* First visit to the map: shading starts plain and fills in. */
.map-svg.map-intro .hot .land, .map-svg.map-intro .hot .dot { fill: var(--land); }
.map-svg.map-intro .labels { opacity: 0; }
.map-svg .labels { transition: opacity 400ms ease 500ms; }
.map-card.replaying .labels { transition-delay: 0s; }
.follow-map { margin: 4px 0 12px; }
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: none;
}
.more-link .icon { transform: rotate(180deg); display: inline-flex; }

/* Top feed on phones: the small map that opens the Map screen. */
.feed-map-card { padding-bottom: 14px; }
.feed-map-card .glance-map { margin-top: 4px; }
@media (min-width: 1080px) { .feed-map-card { display: none; } }

/* Animations drawn inside maps make the browser redraw the whole map each frame, so
   they play a few times and then rest, instead of running all the time. */
.mini-map .ping, .brief-map .ping, .map-svg .ping-ring { animation-iteration-count: 4; }
.map-svg .sun { animation-iteration-count: 3; }
.wordmark.has-new .wordmark-mark .signal { animation-iteration-count: 6; }

/* ---------- Less motion, chosen in About ----------
   The same as the phone's own Reduce Motion setting, for people who want the app
   calmer without changing the whole phone. */
html[data-motion='reduced'] *, html[data-motion='reduced'] *::before, html[data-motion='reduced'] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
html[data-motion='reduced'] .skeleton-line { background: var(--skeleton); }
html[data-motion='reduced'] .brief-content { opacity: 1; transform: none; }
html[data-motion='reduced'] .live-dot::after, html[data-motion='reduced'] .ping { display: none; }
html[data-motion='reduced']::view-transition-group(*),
html[data-motion='reduced']::view-transition-old(*),
html[data-motion='reduced']::view-transition-new(*) { animation: none !important; }
html[data-motion='reduced'] .map-svg .sun, html[data-motion='reduced'] .pulse-bar { animation: none; }
html[data-motion='reduced'] .map-svg .link { stroke-dashoffset: 0; }
html[data-motion='reduced'] .map-svg .ping-ring { animation: none; opacity: 0.5; }
html[data-motion='reduced'] .tab[aria-current='page'] .icon,
html[data-motion='reduced'] .wordmark.has-new .wordmark-mark .signal { animation: none; }
html[data-motion='reduced'] .map-svg .dot { transition: none; }
html[data-motion='reduced'] .map-card.globe-on, html[data-motion='reduced'] .region-stories { animation: none; }


/* ================= Tidewire look ================= */
:root { --tile: #E7EDF7; --tile-ink: #0B1F3A; --sail: #F6EEDD; --sea: #1F4A82; }
:root[data-theme='dark'] { --tile: #17233B; --tile-ink: #F6EEDD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --tile: #17233B; --tile-ink: #F6EEDD; } }

/* ---- story cards: a small country outline drawn by the app (never a publisher's image) ---- */
.tile {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--tile);
  color: var(--tile-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.tile > svg { width: 100%; height: 100%; display: block; }
.tile > svg path, .tile > svg circle { fill: var(--tile-ink); }
.tile.hot > svg path, .tile.hot > svg circle { fill: var(--accent); }
.tile-glyph .icon { display: inline-flex; opacity: 0.8; }
.tile-glyph.hot { color: var(--accent-text); }
.row.has-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
}
.row.has-tile .tile { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.row.has-tile .row-meta, .row.has-tile .row-title { grid-column: 1; }
.row.visited .tile { opacity: 0.6; }
.lead-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile-lead { width: 48px; height: 48px; border-radius: 12px; }
.lead .lead-top { min-height: 48px; }

/* The one-tap app-store question. */
.ask-choices { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ask-choices .button { min-width: 64px; min-height: 40px; }

.error-code { margin: 14px 0 0; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- photos from the app's own free-licence library (never a publisher's image) ---- */
.tile-photo { background: var(--tile); }
.tile-photo > img { width: 100%; height: 100%; display: block; object-fit: cover; }
/* Portraits are tall: keep the face, not the tie. */
.photo-portrait > img { object-position: 50% 18%; }
.row.has-tile.has-photo { grid-template-columns: minmax(0, 1fr) 84px; }
.row.has-tile .tile-photo { width: 84px; height: 64px; border-radius: 10px; }
.row.visited .tile-photo { opacity: 0.75; }
.lead-photo {
  position: relative;
  display: block;
  margin: -6px -4px 4px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--tile);
}
.lead-photo > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 16, 28, 0.72);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead.has-photo .lead-top { min-height: 0; }
.story-photo { margin: 4px 0 0; }
.story-photo > img {
  width: 100%;
  height: auto;
  max-height: 46vh;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--tile);
}
.story-photo > figcaption { margin-top: 6px; font-size: 0.75rem; line-height: 1.4; color: var(--muted); }
.photo-credits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.photo-credit { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.photo-credit .tile-photo { width: 64px; height: 48px; border-radius: 8px; }
.photo-credit .tile-missing > img { visibility: hidden; }
.photo-credit-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.photo-credit-shows { font-weight: 700; }
.photo-credit-by { font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---- the home screen's opening card ---- */
.world-now {
  position: relative;
  margin: 12px 12px 6px;
  padding: 16px 0 30px;
  border-radius: 18px;
  overflow: hidden;
  color: #FFFFFF;
  background: linear-gradient(180deg, #0B1F3A 0%, #12305A 100%);
  box-shadow: 0 8px 22px rgba(11, 31, 58, 0.22);
}
.world-now-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; }
.world-now-text { min-width: 0; }
.world-now-date { margin: 0; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sail); }
.world-now-title { margin: 4px 0 6px; font-family: var(--display); font-size: 1.5rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; color: #FFFFFF; }
.world-now-line { margin: 0; font-size: 0.8125rem; color: #D5DEEC; }
.world-now-globe {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: block;
  background: radial-gradient(circle at 38% 34%, #2A5A99 0%, #1F4A82 55%, #173A68 100%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.07);
}
.world-now-globe.ready { background: none; box-shadow: none; }
.mini-globe { display: block; width: 100%; height: 100%; animation: tile-in 500ms var(--ease); }
.mini-globe-halo { fill: rgba(255, 255, 255, 0.08); }
.mini-globe-sea { fill: var(--sea); }
.mini-globe .land { fill: var(--sail); stroke: var(--sea); stroke-width: 0.4; }
.mini-globe .s1 { fill: #F4B4BF; } .mini-globe .s2 { fill: #EA8294; } .mini-globe .s3 { fill: #E0546C; }
.mini-globe .s4 { fill: #D11F3D; } .mini-globe .s5 { fill: #A80F28; }
.mini-globe-shade { fill: none; stroke: rgba(4, 12, 28, 0.28); stroke-width: 10; pointer-events: none; }
@keyframes tile-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.world-now-chips { padding: 14px 16px 2px; }
.world-now .chip { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.5); color: #FFFFFF; }
.world-now .chip-count { background: rgba(255, 255, 255, 0.18); color: #FFFFFF; }
.world-now .chip.rising .icon { display: inline-flex; color: #FFB3BF; }
/* Rough water along the bottom edge, echoing the logo. It drifts for a while, then rests. */
.world-now-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='22' viewBox='0 0 128 22'%3E%3Cpath d='M0 12C8 2 20 2 28 10C38 19 50 17 58 8C66 0 78 1 86 10C94 19 106 19 114 10C119 5 124 6 128 12V22H0Z' fill='%231F4A82'/%3E%3Cpath d='M0 12C8 2 20 2 28 10C38 19 50 17 58 8C66 0 78 1 86 10C94 19 106 19 114 10C119 5 124 6 128 12' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x 0 0 / 128px 22px;
  animation: waves-drift 7s linear 5;
}
@keyframes waves-drift { from { background-position-x: 0; } to { background-position-x: -128px; } }
@media (prefers-reduced-motion: reduce) { .world-now-waves, .mini-globe { animation: none; } }
html[data-motion='reduced'] .world-now-waves, html[data-motion='reduced'] .mini-globe { animation: none; }
:root[data-theme='dark'] .world-now { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .world-now { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07); } }
/* Wide screens show rising names and places beside the feed already. */
@media (min-width: 1080px) { .world-now-chips { display: none; } .world-now { padding-bottom: 34px; } }
.covered.five { margin-top: 2px; }
@media (max-width: 359px) { .world-now-globe { width: 92px; height: 92px; } .world-now-title { font-size: 1.375rem; } }

/* ---- more sections ---- */
.sections-row { padding-top: 10px; padding-bottom: 6px; }
.sections-row .chip .icon { display: inline-flex; color: var(--muted); }
.sections-row .chip[aria-current='page'] { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.sections-row .chip[aria-current='page'] .icon { color: #FFFFFF; }
:root[data-theme='dark'] .sections-row .chip[aria-current='page'] { background: #E8EDF5; border-color: #E8EDF5; color: #0E1726; }
:root[data-theme='dark'] .sections-row .chip[aria-current='page'] .icon { color: #0E1726; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .sections-row .chip[aria-current='page'] { background: #E8EDF5; border-color: #E8EDF5; color: #0E1726; }
  :root:not([data-theme='light']) .sections-row .chip[aria-current='page'] .icon { color: #0E1726; }
}
.section-title { padding: 16px 16px 0; margin: 0; }

/* ================= themes ================= */
/* Black: the dark theme on true black (set with data-theme='dark' and data-night='black'). */
:root[data-night='black'] {
  --brand: #000000;
  --ground: #000000;
  --page: #000000;
  --soft: #0B0F17;
  --soft-2: #121824;
  --line: #1C2434;
  --skeleton: #0F141E;
  --skeleton-shine: #19202E;
  --tile: #111A2C;
  --ocean: #05080E;
  --land: #1B2436;
  --land-line: #000000;
}
:root[data-night='black'] .world-now { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); }

/* Accent colours. Each has a colour for filled bars (white text on it passes contrast),
   a text colour for light and dark backgrounds, and a five-step map shade. */
:root[data-accent='brass'] { --accent: #9A5B00; --accent-text: #8A5100; --shade-1: #F4DDA8; --shade-2: #EABF63; --shade-3: #D99A1E; --shade-4: #9A5B00; --shade-5: #5E3700; }
:root[data-accent='sea'] { --accent: #0B6E6E; --accent-text: #0B6E6E; --shade-1: #BDE6E2; --shade-2: #86D0CA; --shade-3: #3BAAA2; --shade-4: #0B6E6E; --shade-5: #064343; }
:root[data-theme='dark'][data-accent='brass'] { --accent: #9A5B00; --accent-text: #F2B544; --shade-1: #3D2E12; --shade-2: #6B4A10; --shade-3: #9A6A0C; --shade-4: #D9981E; --shade-5: #FFD27A; }
:root[data-theme='dark'][data-accent='sea'] { --accent: #0B6E6E; --accent-text: #5FD0C5; --shade-1: #123B3B; --shade-2: #145A58; --shade-3: #17807B; --shade-4: #2FB5AC; --shade-5: #8FEDE4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light'])[data-accent='brass'] { --accent: #9A5B00; --accent-text: #F2B544; --shade-1: #3D2E12; --shade-2: #6B4A10; --shade-3: #9A6A0C; --shade-4: #D9981E; --shade-5: #FFD27A; }
  :root:not([data-theme='light'])[data-accent='sea'] { --accent: #0B6E6E; --accent-text: #5FD0C5; --shade-1: #123B3B; --shade-2: #145A58; --shade-3: #17807B; --shade-4: #2FB5AC; --shade-5: #8FEDE4; }
}
/* The home globe sits on a navy sea in every theme, so it has its own bright steps. */
:root[data-accent='brass'] .mini-globe .s1 { fill: #F2CF7E; } :root[data-accent='brass'] .mini-globe .s2 { fill: #EDB640; }
:root[data-accent='brass'] .mini-globe .s3 { fill: #E09A12; } :root[data-accent='brass'] .mini-globe .s4 { fill: #C27A00; } :root[data-accent='brass'] .mini-globe .s5 { fill: #8F5600; }
:root[data-accent='sea'] .mini-globe .s1 { fill: #A9E6DF; } :root[data-accent='sea'] .mini-globe .s2 { fill: #6FD3C9; }
:root[data-accent='sea'] .mini-globe .s3 { fill: #35B5AA; } :root[data-accent='sea'] .mini-globe .s4 { fill: #12908A; } :root[data-accent='sea'] .mini-globe .s5 { fill: #0A6661; }
:root[data-accent] .world-now .chip.rising .icon { color: var(--sail); }
/* Parts that were always red now follow the accent. */
.breaking-label { color: var(--accent); }
.live-dot { background: var(--accent); }
.live-dot::after { border-color: var(--accent); }
.breaking .live-dot { background: var(--accent); }
.brief-tag { background: var(--accent); }

/* ---- share card ---- */
.card-button { width: 100%; margin-top: 10px; }
.share-card-sheet { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.share-card-holder { display: grid; place-items: center; min-height: 200px; }
.share-card { display: block; width: min(100%, 360px); height: auto; aspect-ratio: 1; border-radius: 14px; box-shadow: var(--shadow); }

/* ---- themed pictures on story cards: flags and symbols as plain text (emoji) ---- */
.tile-theme {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.tile-solo .tile-symbol { font-size: 27px; }
.tile-solo.two-symbols .tile-symbol { font-size: 20px; letter-spacing: 1px; }
.tile-pair .tile-flags { font-size: 17px; letter-spacing: 2px; margin-right: -2px; }
.tile-pair .tile-symbol { font-size: 20px; }
.tile-pair.three .tile-flags { font-size: 13px; letter-spacing: 1px; margin-right: -1px; }
.tile-row .tile-flags { font-size: 21px; letter-spacing: 2px; margin-right: -2px; }
.tile-row.three .tile-flags { font-size: 14px; letter-spacing: 1px; margin-right: -1px; }
.tile-lead.tile-row .tile-flags { font-size: 19px; }
.tile-lead.tile-row.three .tile-flags, .tile-lead.tile-pair.three .tile-flags { font-size: 12px; }
.tile-badge .tile-symbol { font-size: 25px; }
.tile-badge .tile-flags { position: absolute; right: 3px; bottom: 3px; font-size: 14px; }
.tile-lead.tile-theme { transform: none; }
.tile-lead.tile-pair .tile-flags { font-size: 15px; }
.tile-lead.tile-pair .tile-symbol { font-size: 18px; }
.tile-lead.tile-solo .tile-symbol, .tile-lead.tile-badge .tile-symbol { font-size: 23px; }
.tile-lead.tile-badge .tile-flags { font-size: 12px; right: 2px; bottom: 2px; }
.row.visited .tile-theme { opacity: 0.75; }

/* ---- missed in the US ---- */
.missed .section-heading { display: flex; align-items: center; gap: 6px; }
.missed .section-heading .icon { display: inline-flex; color: var(--accent-text); }
.missed-note { margin: -4px 16px 6px; }
.missed .more-link { margin: 6px 16px 0; }
/* ---- my reading mix ---- */
.mix { border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px 14px; margin: 14px 0 6px; background: var(--page); }
.mix h2 { margin-top: 12px; }
.mix-bars { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 8px; }
.mix-bars li { display: grid; grid-template-columns: minmax(96px, 34%) 1fr 3.2em; align-items: center; gap: 10px; font-size: 0.875rem; }
.mix-name { font-weight: 600; overflow-wrap: anywhere; }
.mix-track { height: 8px; border-radius: 4px; background: var(--soft-2); overflow: hidden; }
.mix-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.mix-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-sub { font-size: 0.8125rem; margin: 14px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.mix-nudge { margin: 16px 0 12px; font-size: 0.9375rem; }
.mix .chips { margin-bottom: 4px; }
.mix .button { margin-top: 8px; }

/* ---- signals: notices from official feeds ---- */
.signals .section-heading { display: flex; align-items: center; gap: 6px; }
.signals .section-heading .icon { display: inline-flex; color: var(--accent-text); }
.signals-note { margin: -4px 16px 6px; }
.signals .more-link { margin: 6px 16px 0; }
.signal-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; column-gap: 14px; row-gap: 4px; align-items: start; }
.signal-row .row-meta, .signal-row .row-title { grid-column: 1; }
.signal-icon {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  width: 52px; height: 52px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--ink);
}
.signal-icon.kind-earthquake, .signal-icon.kind-tsunami, .signal-icon.kind-weather { color: var(--accent-text); }
.page .signal-filter { margin: 4px 0 8px; padding-left: 0; padding-right: 0; }

.signal-item { border-top: 1px solid var(--line); }
.signal-item .signal-row { border-top: 0; padding-bottom: 6px; }
.signal-follow {
  display: flex; align-items: center; gap: 6px;
  margin: 0 16px 12px; padding: 8px 10px; border-radius: 10px;
  background: var(--soft); color: var(--ink);
  font-size: 0.8125rem; font-weight: 600; text-decoration: none;
}
.signal-follow .icon { display: inline-flex; color: var(--accent-text); flex: none; }
.signal-follow .icon:last-child { transform: rotate(180deg); margin-left: auto; color: var(--muted); }
.place-signals { margin: 8px 0 12px; }
.place-signals .feed-list { margin: 0 -16px; }
.place-signals .more-link { margin-top: 6px; }

.map-signals { padding-top: 6px; padding-bottom: 4px; }
.map-signals .chip .icon { display: inline-flex; color: var(--accent-text); }
/* A very long word in a headline wraps instead of pushing the page sideways (small phones, large text). */
.story-title, .lead-title, .row-title { overflow-wrap: break-word; }
