:root {
  --bg: #f2f0ea;
  --bg-alt: #f8f6f2;
  --surface: #fffdfb;
  --surface-alt: #f1efe9;
  --text: #111417;
  --text-soft: #49555d;
  --muted: #66737a;
  --line: #dfe0da;
  --accent: #1b7dd6;
  --accent-strong: #0e5ea7;
  --shadow: 0 10px 24px rgba(17, 20, 23, 0.05);
  --radius: 18px;
  --nav-height: 78px;
}

:root[data-theme="dark"] {
  --bg: #071821;
  --bg-alt: #0a1e29;
  --surface: #0f2630;
  --surface-alt: #122f3a;
  --text: #edf6f7;
  --text-soft: #bdd0d5;
  --muted: #8ea4aa;
  --line: #1f3741;
  --accent: #5bc2ff;
  --accent-strong: #8ad7ff;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .back-link,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .hero-panel,
:root[data-theme="dark"] .important-panel,
:root[data-theme="dark"] .lead-card,
:root[data-theme="dark"] .story-card,
:root[data-theme="dark"] .feed-row,
:root[data-theme="dark"] .story-summary,
:root[data-theme="dark"] .info-panel,
:root[data-theme="dark"] .source-item,
:root[data-theme="dark"] .more-link,
:root[data-theme="dark"] .pulse-bar {
  background: rgba(15, 38, 48, 0.9);
  border-color: var(--line);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 18px 120px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 0 10px;
  min-height: 76px;
}
.compact-topbar { padding-bottom: 4px; }
.brand-wrap { display: flex; align-items: center; }
.brand {
  font-size: clamp(1.9rem, 4vw, 2.45rem);
  font-weight: 950;
  letter-spacing: -0.09em;
}
.brand > span { color: var(--accent); }
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  border-radius: 14px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
}

.newsroom { padding-top: 8px; }
.hero-panel {
  margin-top: 8px;
  padding: 26px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(241,239,233,0.72));
  box-shadow: var(--shadow);
}
.eyebrow,
.section-label,
.section-header small {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.hero-panel h1 {
  margin: 10px 0 8px;
  font-size: clamp(2.7rem, 6vw, 4.55rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}
.hero-panel p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(27, 125, 214, 0.08);
  border: 1px solid rgba(27, 125, 214, 0.18);
  color: var(--accent-strong);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 18px 0 12px;
}
.chip-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #061a25;
}

.pulse-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
  margin-bottom: 22px;
}
.pulse-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(28,167,245,0.15);
}
.pulse-items {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  font-size: 0.74rem;
  color: var(--text-soft);
}
.pulse-items strong {
  color: var(--text);
}

.important-panel {
  margin: 0 0 28px;
  padding: 18px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.7);
}
.important-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.important-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.important-item:first-child {
  border-top: 0;
}
.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(28,167,245,0.12);
  color: var(--accent-strong);
  font-weight: 900;
  display: grid;
  place-items: center;
}
.important-item strong {
  display: block;
  line-height: 1.3;
  font-size: 1rem;
}
.important-item small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.72rem;
}

.lead-story,
.story-section {
  margin-bottom: 28px;
}
.lead-card {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  margin-top: 12px;
  background: rgba(255,255,255,0.76);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lead-media {
  min-height: 320px;
  background: var(--surface-alt);
}
.lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lead-placeholder,
.card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 200px;
  color: var(--muted);
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(28,167,245,0.08), rgba(255,255,255,0.2));
}
.lead-copy,
.story-body {
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
}
.meta-row.compact { letter-spacing: 0.05em; }
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid rgba(28,167,245,0.25);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(28,167,245,0.06);
}
.lead-copy h2,
.story-card h3,
.feed-row h3 {
  margin: 10px 0 8px;
  letter-spacing: -0.05em;
}
.lead-copy h2 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.02;
}
.lead-copy p,
.story-card p,
.feed-row p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.9rem;
}
.meta-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-header h2 {
  margin: 4px 0 0;
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  letter-spacing: -0.05em;
}
.section-header a,
.section-header span {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.story-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.74);
  overflow: hidden;
  min-width: 0;
}
.story-card.wide {
  grid-column: span 2;
}
.story-card.wide .story-thumb { aspect-ratio: 16 / 9; }
.story-thumb {
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
  overflow: hidden;
}
.story-thumb img,
.feed-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-card h3 {
  font-size: 1.15rem;
  line-height: 1.12;
}
.story-card .meta-foot {
  padding-top: 10px;
}

.feed-list {
  border-top: 1px solid var(--line);
}
.feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.feed-copy {
  min-width: 0;
}
.feed-row h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.14;
}
.feed-thumb {
  width: 150px;
  height: 96px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-alt);
}
.card-placeholder.small {
  min-height: 100%;
  font-size: 1.4rem;
}
.more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}
.more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
  font-size: 0.72rem;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1040px, calc(100% - 14px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(237,243,244,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -8px 22px rgba(15,36,48,0.08);
  z-index: 50;
}
:root[data-theme="dark"] .bottom-nav {
  background: rgba(7,24,33,0.88);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
}
.nav-item.active {
  background: rgba(28,167,245,0.12);
  color: var(--accent-strong);
}

.story-shell {
  padding-bottom: 90px;
}
.story-page {
  padding-top: 8px;
}
.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 800;
}
.story-page h1 {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.08em;
}
.story-hero {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  margin-bottom: 20px;
}
.story-hero img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}
.story-summary,
.info-panel {
  margin-top: 18px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
}
.summary-kicker {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.story-summary p {
  margin: 10px 0 0;
  line-height: 1.7;
  font-size: 1rem;
  color: var(--text-soft);
}
.detail-context {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 1rem;
}
.info-panel h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  letter-spacing: -0.05em;
}
.bullet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.bullet-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 0;
}
.bullet-list li span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(28,167,245,0.12);
  color: var(--accent-strong);
  font-weight: 900;
}
.bullet-list li div {
  color: var(--text-soft);
  line-height: 1.5;
}
.source-list {
  display: grid;
  gap: 8px;
}
.source-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(247,250,249,0.7);
  color: var(--text-soft);
}
.source-item strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }
  .hero-panel {
    padding: 20px 16px 16px;
  }
  .lead-card {
    grid-template-columns: 1fr;
  }
  .lead-media {
    min-height: 220px;
  }
  .story-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    margin-right: -6px;
  }
  .important-panel {
    padding: 16px 14px 10px;
  }
  .story-card {
    flex: 0 0 80%;
  }
  .story-card.wide {
    flex-basis: 88%;
    grid-column: auto;
  }
  .feed-row {
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 10px;
  }
  .feed-thumb {
    width: 110px;
    height: 86px;
  }
  .pulse-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pulse-items {
    width: 100%;
    padding-left: 0;
  }
}
