:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-soft: #eef2f1;
  --text: #17201c;
  --muted: #60706a;
  --line: #d9e0dc;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff3ef;
  --warning: #a16207;
  --shadow: 0 18px 48px rgba(23, 32, 28, 0.08);
}

body.dark {
  color-scheme: dark;
  --bg: #101416;
  --panel: #171d20;
  --panel-soft: #20282b;
  --text: #eef4f1;
  --muted: #9caaa5;
  --line: #2b3639;
  --accent: #47b7a9;
  --accent-strong: #6ed8cc;
  --accent-soft: #173734;
  --warning: #e3b341;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--panel-soft);
}

.nav-count {
  min-width: 28px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  text-align: center;
}

.sidebar-panel {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.sidebar-panel strong {
  display: block;
  margin: 6px 0;
}

.sidebar-panel p,
.feedback p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.topbar,
.section-head,
.toolbar,
.feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.menu-button {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-box,
.select-box,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  flex: 1 1 280px;
}

.search-box span,
.select-box span {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

input,
select {
  min-height: 38px;
  padding: 0 10px;
}

.search-box input {
  width: 100%;
}

textarea {
  resize: vertical;
  padding: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.content-view {
  display: none;
}

.content-view.active {
  display: block;
}

.section-head {
  align-items: flex-end;
  margin-bottom: 14px;
}

.section-head > span,
#selected-result-count,
#all-result-count {
  color: var(--muted);
  font-size: 14px;
}

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

.news-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.news-card.read {
  opacity: 0.58;
}

.card-top,
.card-meta,
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card-top {
  justify-content: space-between;
}

.score {
  color: var(--accent-strong);
  font-weight: 800;
}

.card-title {
  display: inline-block;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.card-title:hover {
  color: var(--accent-strong);
}

.summary,
.reason {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reason {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.pill,
.meta-pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.pill {
  background: var(--panel-soft);
  color: var(--muted);
}

.meta-pill {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.compact .news-card {
  box-shadow: none;
}

.daily-report,
.source-grid,
.roadmap,
.feedback {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.daily-report h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

.daily-report p {
  color: var(--muted);
  line-height: 1.7;
}

.daily-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.daily-section ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

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

.source-card,
.roadmap-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.source-card h3,
.roadmap-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.source-card p,
.roadmap-card li {
  color: var(--muted);
  line-height: 1.6;
}

.roadmap {
  display: grid;
  gap: 12px;
}

.roadmap-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.roadmap-card li {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel-soft);
  font-size: 13px;
}

.feedback {
  align-items: flex-start;
  margin-top: 26px;
}

.feedback form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto;
  gap: 10px;
  flex: 1;
}

.empty {
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: min(320px, 86vw);
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
  }

  .main {
    padding: 20px;
  }

  .stats-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback,
  .feedback form {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
    align-items: start;
  }

  .toolbar {
    display: grid;
  }

  .select-box,
  .search-box {
    display: grid;
    width: 100%;
  }
}
