:root {
  --canvas: #f4f5f2;
  --surface: #ffffff;
  --ink: #171a18;
  --muted: #69706b;
  --line: #d9ded9;
  --line-strong: #aeb7af;
  --green: #2f6e50;
  --green-soft: #dfece4;
  --coral: #d95b41;
  --coral-soft: #f6e2dc;
  --blue: #4169c1;
  --blue-soft: #e2e9f7;
  --yellow: #e3b94d;
  --sidebar: #171a18;
  --sidebar-muted: #9da49e;
  --shadow: 0 18px 50px rgb(18 30 22 / 12%);
  --sidebar-width: 252px;
}

.footer-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.data-policy {
  max-width: 680px;
  margin-left: auto;
  text-align: right;
}

.data-policy summary {
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 650;
  list-style-position: inside;
}

.data-policy p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgb(23 26 24 / 3%) 1px, transparent 1px),
    var(--canvas);
  background-size: 100% 48px;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.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;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  background: var(--sidebar);
  color: #f6f7f5;
}

.brand-block {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 22px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand strong,
.mobile-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: rgb(255 255 255 / 24%);
}

.brand-mark::before {
  width: 1px;
  height: 100%;
}

.brand-mark::after {
  width: 100%;
  height: 1px;
}

.brand-mark span {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8bd0a5;
  box-shadow: 0 0 0 4px rgb(139 208 165 / 18%);
}

.side-section {
  padding: 22px 16px 0;
}

.side-label {
  padding: 0 9px 10px;
  color: var(--sidebar-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-link {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #b9c0ba;
  font-size: 13px;
  text-align: left;
}

.filter-link:hover {
  color: #ffffff;
  background: rgb(255 255 255 / 5%);
}

.filter-link.is-active {
  border-left-color: #8bd0a5;
  background: rgb(255 255 255 / 8%);
  color: #ffffff;
  font-weight: 600;
}

.filter-count {
  color: var(--sidebar-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.select-field {
  position: relative;
  display: block;
}

.select-field select {
  width: 100%;
  height: 38px;
  appearance: none;
  padding: 0 34px 0 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 4px;
  background: #222623;
  color: #f5f6f4;
  font-size: 12px;
}

.select-field svg {
  position: absolute;
  top: 11px;
  right: 10px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.window-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 4px;
}

.window-control button {
  height: 34px;
  border: 0;
  border-right: 1px solid rgb(255 255 255 / 14%);
  border-radius: 0;
  background: transparent;
  color: var(--sidebar-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.window-control button:last-child {
  border-right: 0;
}

.window-control button.is-active {
  background: #f4f5f2;
  color: var(--ink);
  font-weight: 700;
}

.sidebar-status {
  margin-top: auto;
  padding: 22px 24px 26px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d9ded9;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78c795;
  box-shadow: 0 0 0 4px rgb(120 199 149 / 12%);
}

.run-meta {
  margin-top: 9px;
  color: var(--sidebar-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  line-height: 1.6;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 36px clamp(28px, 4vw, 68px) 28px;
}

.page-header {
  display: flex;
  min-height: 72px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

.page-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.2;
}

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

.search-field {
  position: relative;
  display: flex;
  width: min(340px, 30vw);
  height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgb(255 255 255 / 72%);
}

.search-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(47 110 80 / 9%);
}

.search-field svg {
  width: 16px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.search-field kbd {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.refresh-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.refresh-button {
  height: 40px;
  gap: 7px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 600;
}

.refresh-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: #f9faf8;
}

.refresh-button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
}

.refresh-button.is-loading svg,
.icon-button.is-loading svg {
  animation: spin 800ms linear infinite;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.scope-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  padding: 15px 16px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 4px 14px rgb(22 36 26 / 5%);
}

.scope-heading {
  display: flex;
  min-width: 150px;
  align-items: center;
  gap: 10px;
}

.scope-heading > div {
  display: grid;
  gap: 2px;
}

.scope-heading strong {
  font-size: 13px;
  font-weight: 700;
}

.scope-heading > div > span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.scope-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.scope-icon svg {
  width: 17px;
  height: 17px;
}

.scope-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.source-scope {
  flex: 1 1 auto;
}

.window-scope {
  flex: 0 0 auto;
}

.scope-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-chips {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.source-chips::-webkit-scrollbar {
  display: none;
}

.source-chip {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: #4f5751;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.source-chip:hover {
  border-color: var(--line-strong);
  background: rgb(255 255 255 / 65%);
}

.source-chip strong {
  display: grid;
  min-width: 21px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  background: #eef1ed;
  color: #8a918b;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.source-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.source-chip.is-active strong {
  background: rgb(255 255 255 / 16%);
  color: #ffffff;
}

.window-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, auto));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgb(255 255 255 / 58%);
}

.window-control button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  white-space: nowrap;
}

.window-control button:last-child {
  border-right: 0;
}

.window-control button.is-active {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 48%);
}

.metric {
  position: relative;
  min-height: 132px;
  padding: 20px 22px 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  background: transparent;
}

.metric-primary::after {
  background: var(--green);
}

.metric-rising::after {
  background: var(--coral);
}

.metric:nth-child(3)::after {
  background: var(--blue);
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.metric-label svg {
  width: 15px;
  height: 15px;
}

.metric strong {
  display: block;
  margin: 6px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 10px;
}

.topic-pulse {
  padding: 34px 0 30px;
  border-bottom: 1px solid var(--line-strong);
}

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

.section-heading h2,
.results-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.section-heading > span {
  color: var(--muted);
  font-size: 10px;
}

.topic-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin-top: 22px;
}

.topic-bar {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.topic-bar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.topic-bar strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-bar-count {
  flex: 0 0 auto;
  font-family: Georgia, serif;
  font-size: 20px;
}

.topic-track {
  position: relative;
  display: block;
  height: 4px;
  overflow: hidden;
  background: #dfe3df;
}

.topic-fill {
  display: block;
  width: var(--bar-width);
  height: 100%;
  background: var(--green);
  transform-origin: left;
  animation: bar-in 600ms both;
}

.topic-bar:nth-child(2) .topic-fill {
  background: var(--blue);
}

.topic-bar:nth-child(3) .topic-fill {
  background: var(--coral);
}

.topic-bar:nth-child(4) .topic-fill {
  background: var(--yellow);
}

.topic-bar small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.feed-section {
  padding-top: 26px;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-label {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tabs button {
  position: relative;
  min-width: auto;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.tabs button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: transparent;
}

.tabs button.is-active {
  color: var(--green);
}

.tabs button.is-active::after {
  background: var(--green);
}

.feed-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.noise-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.noise-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--ink);
}

.sort-field {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-field select {
  height: 34px;
  appearance: none;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: 10px;
}

.sort-field svg {
  position: absolute;
  right: 9px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.results-heading span {
  max-width: 68%;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}

.signal-card {
  position: relative;
  display: grid;
  min-height: 252px;
  grid-template-rows: auto auto 1fr auto;
  padding: 18px 20px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(22 28 24 / 4%);
  cursor: pointer;
  animation: card-in 420ms both;
  animation-delay: calc(var(--index) * 30ms);
}

.signal-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--line);
}

.signal-card.is-high::before {
  background: var(--green);
}

.signal-card.is-rising::before {
  background: var(--coral);
}

.signal-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px rgb(22 36 26 / 8%);
  transform: translateY(-2px);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card-meta,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.source-badge,
.signal-id,
.freshness-badge,
.movement-badge,
.feedback-badge {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
}

.source-badge {
  color: var(--blue);
  text-transform: uppercase;
}

.card-origin {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.freshness-badge {
  padding-left: 7px;
  border-left: 1px solid var(--line);
  color: var(--green);
}

.signal-id {
  color: #9aa19b;
}

.score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 26px;
  line-height: 1;
}

.score small {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
}

.signal-card h3 {
  display: -webkit-box;
  min-height: 58px;
  margin: 14px 0 8px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.original-signal {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #4f5751;
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.original-signal span {
  margin-right: 7px;
  color: #929992;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
}

.evidence-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  min-height: 22px;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #eef1ee;
  color: #555d57;
  font-size: 9px;
}

.tag-money {
  background: var(--green-soft);
  color: var(--green);
}

.tag-pain,
.tag-replacement {
  background: var(--coral-soft);
  color: #9d3e2b;
}

.tag-launch {
  background: var(--blue-soft);
  color: var(--blue);
}

.card-footer {
  padding-top: 12px;
  border-top: 1px solid #edf0ed;
}

.topic-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-badge {
  flex: 0 0 auto;
  color: var(--coral);
}

.feedback-badge {
  flex: 0 0 auto;
  color: var(--green);
}

.loading-state {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 18px 0;
}

.loading-line {
  height: 62px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #ecefeb, #f8f9f7, #ecefeb);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  padding: 70px 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state svg,
.error-state svg {
  width: 26px;
  height: 26px;
  color: var(--muted);
}

.empty-state h3,
.error-state h3 {
  margin: 12px 0 5px;
  font-size: 14px;
}

.empty-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
}

.mobile-header,
.sidebar-close,
.sidebar-scrim {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  background: rgb(12 18 14 / 28%);
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  width: min(510px, 94vw);
  overflow-y: auto;
  background: #fbfcfa;
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 240ms cubic-bezier(.22, .7, .2, 1);
}

body.drawer-open {
  overflow: hidden;
}

body.drawer-open .drawer-backdrop {
  visibility: visible;
  opacity: 1;
}

body.drawer-open .detail-drawer {
  transform: translateX(0);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgb(251 252 250 / 94%);
  backdrop-filter: blur(12px);
}

.drawer-id {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.drawer-body {
  padding: 30px 28px 52px;
}

.drawer-topic {
  margin: 0 0 10px;
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.drawer-body h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.4;
}

.drawer-score-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
  padding: 18px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.drawer-score-row .score {
  font-size: 42px;
}

.drawer-score-copy strong {
  display: block;
  font-size: 11px;
}

.drawer-score-copy span {
  color: var(--muted);
  font-size: 10px;
}

.insight-panel {
  margin-top: 22px;
  padding: 16px 17px;
  border-left: 3px solid var(--green);
  background: #edf3ef;
}

.insight-panel > span,
.evidence-heading > span {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.insight-panel p {
  margin: 8px 0 7px;
  color: #28332c;
  font-size: 13px;
  line-height: 1.7;
}

.insight-panel small,
.evidence-heading small {
  color: var(--muted);
  font-size: 9px;
}

.evidence-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.evidence-copy {
  color: #424944;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.evidence-empty {
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-cell {
  min-height: 76px;
  padding: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-cell small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
}

.detail-cell strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.primary-link,
.secondary-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.primary-link {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}

.primary-link svg,
.secondary-button svg {
  width: 14px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
}

.feedback-panel {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.feedback-panel h3 {
  margin: 0 0 13px;
  font-size: 13px;
}

.read-only-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.read-only-panel > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--blue);
}

.read-only-panel > div {
  display: grid;
  gap: 3px;
}

.read-only-panel strong {
  font-size: 12px;
}

.read-only-panel span {
  color: var(--muted);
  font-size: 10px;
}

.feedback-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 4px;
}

.feedback-option {
  min-height: 42px;
  padding: 5px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: white;
  font-size: 10px;
}

.feedback-option:last-child {
  border-right: 0;
}

.feedback-option.is-active {
  background: var(--ink);
  color: white;
}

.feedback-note {
  width: 100%;
  min-height: 76px;
  margin-top: 10px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  font-size: 11px;
  line-height: 1.6;
}

.save-feedback {
  width: 100%;
  margin-top: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bar-in {
  from { transform: scaleX(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

@media (max-width: 1040px) {
  .scope-bar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .window-scope {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

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

  .signal-grid {
    grid-template-columns: 1fr;
  }

  .search-field {
    width: 260px;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 100% 42px;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: rgb(244 245 242 / 94%);
    backdrop-filter: blur(12px);
  }

  .mobile-header .brand-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-color: var(--ink);
  }

  .mobile-header .brand-mark::before,
  .mobile-header .brand-mark::after {
    background: rgb(23 26 24 / 22%);
  }

  .mobile-brand strong {
    font-size: 14px;
  }

  .sidebar {
    width: min(310px, 88vw);
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  body.sidebar-open {
    overflow: hidden;
  }

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

  .sidebar-close {
    display: inline-flex;
    border-color: rgb(255 255 255 / 14%);
    background: transparent;
    color: white;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    visibility: hidden;
    border: 0;
    border-radius: 0;
    background: rgb(10 15 11 / 38%);
    opacity: 0;
    transition: opacity 160ms ease, visibility 160ms ease;
  }

  body.sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .main-content {
    margin-left: 0;
    padding: 22px 16px 24px;
  }

  .page-header {
    min-height: auto;
    flex-direction: column;
    gap: 18px;
  }

  .page-header h1 {
    font-size: 25px;
  }

  .header-actions {
    width: 100%;
  }

  .search-field {
    width: auto;
    flex: 1;
  }

  .search-field kbd,
  .refresh-button {
    display: none;
  }

  .metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
  }

  .scope-bar {
    position: sticky;
    top: 66px;
    z-index: 20;
    display: block;
    margin-top: 18px;
    padding: 13px 12px 12px;
    border-left-width: 3px;
    box-shadow: 0 8px 22px rgb(22 36 26 / 8%);
  }

  .scope-heading {
    min-width: 0;
  }

  .scope-heading > div > span {
    white-space: normal;
  }

  .scope-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .source-scope {
    margin-top: 10px;
  }

  .window-scope {
    margin-top: 10px;
  }

  .source-scope,
  .source-chips,
  .window-scope,
  .window-control {
    width: 100%;
  }

  .source-chip {
    min-height: 40px;
  }

  .window-control {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .window-control button {
    min-height: 40px;
    padding: 0 5px;
  }

  .metric {
    min-height: 112px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(3),
  .metric:nth-child(4) {
    border-bottom: 0;
  }

  .metric strong {
    font-size: 34px;
  }

  .topic-pulse {
    padding: 28px 0;
  }

  .topic-bars {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .topic-bar-top {
    min-height: 30px;
  }

  .feed-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-switcher {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .tabs {
    width: 100%;
    gap: 20px;
    overflow-x: auto;
  }

  .tabs button {
    min-width: max-content;
    flex: 0 0 auto;
  }

  .feed-tools {
    width: 100%;
    justify-content: space-between;
  }

  .signal-card {
    min-height: 276px;
    padding: 16px 17px 14px;
  }

  .signal-card h3 {
    min-height: 78px;
    -webkit-line-clamp: 4;
  }

  .results-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .results-heading span {
    max-width: 58%;
    font-size: 8px;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .drawer-body {
    padding: 24px 20px 44px;
  }

  .drawer-header {
    padding: 0 20px;
  }

  .drawer-body h2 {
    font-size: 21px;
  }

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

  .feedback-option:nth-child(2) {
    border-right: 0;
  }

  .feedback-option:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Decision-workspace layout */
.main-content {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 30px clamp(24px, 4vw, 56px) 28px;
}

.page-header {
  min-height: 66px;
  align-items: center;
}

.page-header h1 {
  font-size: 28px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.queue-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 58%);
}

.queue-item {
  position: relative;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.queue-item:last-child {
  border-right: 0;
}

.queue-item::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  background: transparent;
}

.queue-item span {
  font-size: 12px;
  font-weight: 650;
}

.queue-item strong {
  color: var(--ink);
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
  font-weight: 400;
}

.queue-item:hover {
  background: rgb(255 255 255 / 72%);
  color: var(--ink);
}

.queue-item.is-active {
  background: var(--surface);
  color: var(--green);
}

.queue-item.is-active::after {
  background: var(--green);
}

.queue-item.is-active strong {
  color: var(--green);
}

.scope-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  margin-top: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: rgb(244 245 242 / 96%);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.scope-group {
  flex-direction: row;
  align-items: center;
}

.source-scope {
  flex: 1 1 auto;
}

.scope-label {
  font-size: 10px;
}

.source-chip {
  min-height: 34px;
  gap: 6px;
  padding: 0 10px;
  font-size: 10px;
}

.source-chip strong {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 8px;
}

.filter-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.compact-select,
.sort-field {
  position: relative;
  display: flex;
  align-items: center;
}

.compact-select select,
.sort-field select {
  height: 34px;
  appearance: none;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: 10px;
}

.compact-select select {
  width: 188px;
}

.compact-select svg,
.sort-field svg {
  position: absolute;
  right: 9px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.window-control {
  grid-template-columns: repeat(3, 42px);
}

.window-control button {
  min-height: 34px;
  padding: 0;
}

.advanced-filter {
  position: relative;
}

.advanced-filter summary {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

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

.advanced-filter summary svg {
  width: 14px;
  height: 14px;
}

.advanced-filter .noise-toggle {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 30;
  width: 170px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feed-section {
  padding-top: 18px;
}

.results-heading {
  margin-top: 0;
}

.signal-grid {
  gap: 12px;
  padding-top: 12px;
}

.signal-card {
  min-height: 224px;
  grid-template-rows: auto auto auto 1fr auto;
  padding: 17px 19px 15px;
}

.signal-card h3 {
  min-height: 68px;
  margin: 13px 0 8px;
  font-size: 16px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
}

.evidence-line,
.validation-line {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.validation-line {
  margin-top: 6px;
  color: #4e5a52;
}

.card-footer {
  align-items: flex-end;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.card-footer-left,
.card-footer-right {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.card-footer-left {
  overflow: hidden;
}

.topic-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-score {
  flex: 0 0 auto;
  color: #7b837d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
}

.page-footer {
  margin-top: 28px;
}

@media (max-width: 1040px) {
  .scope-bar {
    display: block;
  }

  .filter-controls {
    margin-top: 8px;
  }

  .compact-select {
    flex: 1;
  }

  .compact-select select {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .mobile-header {
    justify-content: space-between;
  }

  .main-content {
    padding: 16px 14px 22px;
  }

  .page-header {
    gap: 12px;
  }

  .page-header h1 {
    font-size: 23px;
  }

  .page-subtitle {
    font-size: 9px;
  }

  .queue-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 14px;
    overflow: visible;
  }

  .queue-item {
    min-width: 0;
    min-height: 62px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 5px 4px;
    text-align: center;
  }

  .queue-item span {
    min-height: 24px;
    font-size: 9px;
    line-height: 1.3;
  }

  .queue-item strong {
    font-size: 23px;
  }

  .scope-bar {
    top: 58px;
    margin-top: 0;
    padding: 9px 0;
    border-left: 0;
    box-shadow: none;
  }

  .scope-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .source-scope {
    margin-top: 0;
  }

  .source-chip {
    min-height: 36px;
  }

  .filter-controls {
    width: 100%;
    margin-top: 7px;
  }

  .compact-select {
    min-width: 0;
  }

  .compact-select select {
    min-width: 0;
  }

  .sort-field select {
    width: 74px;
    padding-left: 8px;
    color: transparent;
  }

  .sort-field svg {
    right: 29px;
  }

  .window-control {
    width: auto;
    grid-template-columns: repeat(3, 38px);
  }

  .feed-section {
    padding-top: 13px;
  }

  .results-heading {
    align-items: baseline;
  }

  .results-heading span {
    max-width: 66%;
  }

  .signal-card {
    min-height: 238px;
    padding: 15px 16px 14px;
  }

  .signal-card h3 {
    min-height: 74px;
    margin-top: 11px;
    -webkit-line-clamp: 4;
  }
}

.page-footer {
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 720px) {
  .page-footer,
  .footer-status {
    flex-direction: column;
  }

  .data-policy {
    margin-left: 0;
    text-align: left;
  }
}
