:root {
  --page: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --surface-3: #e4e8e1;
  --ink: #20231f;
  --ink-soft: #4f574f;
  --muted: #737b72;
  --line: #d7ddd3;
  --line-strong: #bfc8bb;
  --green: #2f6f55;
  --green-soft: #e0eee7;
  --blue: #365b9d;
  --blue-soft: #e3e9f5;
  --amber: #a85f14;
  --amber-soft: #f4e6d3;
  --red: #b33a2e;
  --red-soft: #f4dedb;
  --violet: #6e4a8f;
  --shadow: 0 16px 40px rgba(31, 35, 31, .08);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
}

[data-theme="dark"] {
  --page: #171914;
  --surface: #20231e;
  --surface-2: #282c25;
  --surface-3: #34392f;
  --ink: #eff3ea;
  --ink-soft: #c0c8ba;
  --muted: #8f998b;
  --line: #3b4237;
  --line-strong: #53604f;
  --green: #86c6a5;
  --green-soft: #253b31;
  --blue: #93aee6;
  --blue-soft: #25314a;
  --amber: #e3a05b;
  --amber-soft: #463522;
  --red: #e88a80;
  --red-soft: #4b2927;
  --violet: #c5a1e3;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(96px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-weight: 800;
  line-height: 1.1;
}

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

.view-tabs,
.segmented {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.tab-button,
.segment {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.tab-button.active,
.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(31, 35, 31, .08);
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.role-select {
  width: auto;
  min-width: 92px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px 28px 48px;
}

.app-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
}

.app-notice.success {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: var(--green-soft);
  color: var(--green);
}

.app-notice.warn {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
  background: var(--amber-soft);
  color: var(--amber);
}

.app-notice.error {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: var(--red-soft);
  color: var(--red);
}

.notice-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 24px;
  align-items: stretch;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.briefing {
  min-width: 0;
  padding: 8px 0;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.briefing p {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.lead-pick {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-empty {
  grid-column: 1 / -1;
  color: var(--muted);
}

.cover {
  position: relative;
  width: 100%;
  max-width: 112px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3));
  box-shadow: 0 10px 22px rgba(31, 35, 31, .14);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  word-break: break-word;
}

.cover-fallback::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 4px;
  pointer-events: none;
}

.lead-body {
  min-width: 0;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
}

.lead-title {
  margin: 10px 0 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.lead-meta,
.book-meta,
.source-meta,
.report-date {
  color: var(--muted);
  font-size: 12px;
}

.lead-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.lead-reasons .chip {
  height: auto;
  min-height: 24px;
  white-space: normal;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.metric {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-value {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
}

.metric-value.accent {
  color: var(--green);
}

.metric-value.warn {
  color: var(--red);
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.primary-pane,
.side-pane,
.source-view,
.report-view {
  min-width: 0;
}

.toolbar {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filters {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(150px, 220px) 120px 120px;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--green);
  outline: 2px solid color-mix(in srgb, var(--green) 22%, transparent);
}

.result-line {
  min-height: 32px;
  padding: 12px 2px 8px;
  color: var(--muted);
  font-size: 13px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.book-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.book-card:hover {
  border-color: var(--green);
  box-shadow: 0 10px 24px rgba(31, 35, 31, .08);
  transform: translateY(-1px);
}

.book-card.excluded {
  opacity: .68;
}

.book-card .cover {
  max-width: 82px;
  align-self: start;
}

.book-body {
  min-width: 0;
}

.book-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
}

.book-title {
  margin: 8px 0 4px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.28;
}

.book-author {
  color: var(--ink-soft);
  font-size: 13px;
}

.book-description {
  display: -webkit-box;
  margin-top: 9px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-reason {
  color: var(--ink-soft);
  font-weight: 700;
}

.book-summary + .book-reason {
  margin-top: 5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.green {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: var(--green-soft);
  color: var(--green);
}

.chip.blue {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: var(--blue-soft);
  color: var(--blue);
}

.chip.amber {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.red {
  border-color: color-mix(in srgb, var(--red) 30%, var(--line));
  background: var(--red-soft);
  color: var(--red);
}

.chip.violet {
  border-color: color-mix(in srgb, var(--violet) 30%, var(--line));
  color: var(--violet);
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.source-chip {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-meter {
  display: grid;
  gap: 5px;
  min-width: 76px;
}

.score-number {
  justify-self: end;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 850;
  color: var(--green);
}

.meter-track {
  width: 76px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.side-pane {
  display: grid;
  gap: 14px;
}

.side-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.side-heading {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 850;
}

.health-stack,
.watchlist,
.report-mini,
.ai-stack {
  display: grid;
  gap: 9px;
}

.ai-row {
  display: grid;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ai-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ai-summary {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.ai-mode {
  color: var(--muted);
  font-size: 11px;
}

.health-row,
.watch-row,
.report-row,
.source-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.health-row {
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.active,
.status-dot.healthy {
  background: var(--green);
}

.status-dot.error {
  background: var(--red);
}

.status-dot.never {
  background: var(--amber);
}

.row-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-value {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.watch-row,
.report-row {
  padding: 0 0 9px;
  border-bottom: 1px solid var(--line);
}

.watch-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.watch-row:hover .row-title {
  color: var(--green);
}

.watch-row:last-child,
.report-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 64px;
}

.page-button {
  min-width: 38px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.page-button:disabled {
  cursor: default;
  opacity: .45;
}

.page-info {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.source-view,
.report-view,
.preference-view,
.operation-view {
  margin-top: 24px;
}

.preference-grid,
.operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.preference-panel,
.operation-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-heading {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 850;
}

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

.preference-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.preference-stat strong {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
}

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

.preference-import {
  display: grid;
  gap: 10px;
}

.preference-import textarea {
  width: 100%;
  min-height: 180px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 13px/1.5 var(--mono);
}

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

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

.task-card {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.task-title {
  font-size: 13px;
  font-weight: 850;
}

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

.run-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.run-row:last-child {
  border-bottom: 0;
}

.run-row:hover .row-title {
  color: var(--green);
}

.run-status {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
}

.run-status.success {
  color: var(--green);
}

.run-status.failed {
  color: var(--red);
}

.run-status.running {
  color: var(--amber);
}

.operation-output {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.operation-output pre {
  max-height: 260px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink-soft);
  font: 12px/1.45 var(--mono);
}

.config-status {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.text-button.primary {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: var(--green-soft);
  color: var(--green);
}

.text-button:disabled {
  cursor: default;
  opacity: .5;
}

.preference-hint {
  color: var(--muted);
  font-size: 12px;
}

.meeting-pack-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.meeting-pack-head,
.meeting-candidate-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.meeting-pack-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.meeting-pack-head span,
.meeting-candidate-top span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green-soft);
  padding: 5px 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.meeting-pack-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.meeting-pack-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.meeting-candidate {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.meeting-candidate h4 {
  margin: 3px 0;
  font-size: 15px;
  line-height: 1.28;
}

.meeting-candidate p {
  margin: 0;
}

.meeting-copy {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.meeting-copy.strong {
  color: var(--ink-soft);
  font-weight: 750;
}

.meeting-next {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.source-table,
.report-table,
.preference-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.source-table th,
.source-table td,
.report-table th,
.report-table td,
.preference-table th,
.preference-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.source-table th,
.report-table th,
.preference-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.source-table tr:last-child td,
.report-table tr:last-child td,
.preference-table tr:last-child td {
  border-bottom: 0;
}

.source-name-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 180px;
}

.source-health-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.source-health-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.empty-state,
.loading-state {
  grid-column: 1 / -1;
  padding: 64px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 17, 14, .58);
  backdrop-filter: blur(10px);
}

.detail-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(820px, 88vh);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.detail-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
}

.detail-layout .cover {
  max-width: 140px;
}

.detail-title {
  margin: 34px 0 8px;
  font-size: 25px;
  line-height: 1.2;
}

.detail-description {
  margin-top: 16px;
  color: var(--ink-soft);
}

.detail-copy-block {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-copy-block h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.detail-copy-block .detail-description {
  margin: 0;
  line-height: 1.65;
}

.detail-copy-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.detail-copy-list li + li {
  margin-top: 4px;
}

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

.title-option-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.title-option-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.title-option-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.title-option-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 1120px) {
  .summary-band,
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
  }

  .view-tabs {
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
  }

  .tab-button {
    flex: 1;
  }

  .app-shell {
    padding: 18px 16px 36px;
  }

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

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

  .side-pane {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand-subtitle {
    display: none;
  }

  h1 {
    font-size: 32px;
  }

  .lead-pick,
  .book-card,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .lead-pick .cover,
  .book-card .cover,
  .detail-layout .cover {
    width: 96px;
  }

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

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

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

  .source-table,
  .report-table,
  .preference-table {
    display: block;
    overflow-x: auto;
  }

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

  .preference-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.runtime-diagnostics-panel {
  display: grid;
  gap: 12px;
  margin-block: 18px;
  padding: 16px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  background: var(--surface, #ffffff);
}

.runtime-diagnostics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runtime-diagnostics-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.runtime-diagnostics-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.runtime-diagnostic-card {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  padding: 11px;
  background: var(--surface-raised, #ffffff);
}

.runtime-diagnostic-card > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  background: var(--muted, #64748b);
}

.runtime-diagnostic-card[data-status="pass"] > span {
  background: #0f766e;
}

.runtime-diagnostic-card[data-status="warn"] > span,
.runtime-diagnostic-card[data-status="pending"] > span {
  background: var(--warning, #b45309);
}

.runtime-diagnostic-card[data-status="fail"] > span {
  background: var(--danger, #b42318);
}

.runtime-diagnostic-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.runtime-diagnostic-card p {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.4;
}

.lifecycle-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--muted-surface, #f3f4f6);
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
}

[data-lifecycle-status="focus"] > .lifecycle-badge {
  border-color: var(--accent, #2563eb);
  background: var(--accent-soft, #eef4ff);
  color: var(--accent, #2563eb);
}

[data-lifecycle-status="review"] > .lifecycle-badge {
  border-color: var(--warning, #b45309);
  background: var(--warning-soft, #fff7ed);
  color: var(--warning, #b45309);
}

[data-lifecycle-status="excluded"] > .lifecycle-badge {
  background: #f8fafc;
  color: #94a3b8;
}

[data-lifecycle-status="reported"] > .lifecycle-badge {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.daily-digest-panel {
  display: grid;
  gap: 12px;
  margin-block: 16px;
  padding: 16px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  background: var(--surface, #ffffff);
}

.daily-digest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-digest-head h3 {
  margin: 2px 0 0;
  font-size: 19px;
}

.daily-digest-head [data-digest-date] {
  border-radius: 999px;
  background: var(--accent-soft, #eef4ff);
  padding: 4px 9px;
  color: var(--accent, #2563eb);
  font-size: 12px;
  font-weight: 700;
}

.daily-digest-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-digest-summary span {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.daily-digest-status {
  color: var(--muted, #64748b);
  font-size: 13px;
}

.daily-digest-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.daily-digest-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-raised, #ffffff);
}

.daily-digest-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-digest-card-head p {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.daily-digest-card-head h4 {
  margin: 4px 0 0;
  font-size: 15px;
}

.daily-digest-card-head span {
  border-radius: 999px;
  background: var(--accent-soft, #eef4ff);
  padding: 4px 8px;
  color: var(--accent, #2563eb);
  font-size: 12px;
  font-weight: 700;
}

.daily-digest-reason {
  margin: 0;
  color: var(--text, #111827);
  font-size: 13px;
  line-height: 1.5;
}

.daily-digest-summary-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.daily-digest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.daily-digest-tags span {
  border-radius: 999px;
  background: var(--muted-surface, #f3f4f6);
  padding: 3px 8px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.daily-digest-tags span[data-risk="true"] {
  background: var(--warning-soft, #fff7ed);
  color: var(--warning, #b45309);
}

.daily-digest-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.daily-digest-next a {
  color: var(--accent, #2563eb);
  text-decoration: none;
}

@media (max-width: 760px) {
  .daily-digest-head {
    flex-direction: column;
  }
}

.report-candidates-panel {
  display: grid;
  gap: 14px;
  margin-block: 18px;
  padding: 16px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  background: var(--surface, #ffffff);
}

.report-candidates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-candidates-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.section-kicker,
.candidate-reason {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.report-candidate-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
}

.report-candidate-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.report-candidate-controls input {
  min-height: 36px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--input-bg, #ffffff);
  color: var(--text, #111827);
}

.report-candidate-controls .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.report-candidate-controls .inline-check input {
  min-height: auto;
}

.report-candidate-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-candidate-summary span {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.report-candidate-status {
  color: var(--muted, #64748b);
  font-size: 13px;
}

.report-candidate-status[data-state="error"] {
  color: var(--danger, #b42318);
}

.report-candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.report-candidate-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-raised, #ffffff);
}

.report-candidate-card[data-status="focus"] {
  border-color: var(--accent, #2563eb);
}

.report-candidate-card[data-status="excluded"] {
  opacity: 0.58;
}

.candidate-card-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.candidate-card-main h4 {
  margin: 4px 0;
  font-size: 15px;
}

.candidate-card-main p {
  margin: 0;
}

.candidate-score {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent-soft, #eef4ff);
  color: var(--accent, #2563eb);
  font-weight: 700;
}

.candidate-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-card-meta span {
  border-radius: 999px;
  background: var(--muted-surface, #f3f4f6);
  padding: 3px 8px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.candidate-summary {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1.55;
}

.candidate-recommendation {
  color: var(--text, #111827);
  font-weight: 700;
}

.candidate-source-link {
  color: var(--accent, #2563eb);
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 760px) {
  .report-candidates-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-candidate-controls {
    grid-template-columns: 1fr 1fr;
  }
}
