:root {
  --paper: #fbf7ef;
  --paper-panel: #fffdf9;
  --paper-strong: #f3ecdf;
  --ink: #171412;
  --muted: #6d685f;
  --rule: #ddd5c8;
  --accent: #2f6a56;
  --accent-soft: rgba(47, 106, 86, 0.1);
  --watch-accent: #a36d37;
  --watch-soft: rgba(163, 109, 55, 0.1);
  --danger-soft: rgba(122, 58, 47, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
    var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.editorial-masthead {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-panel);
}

.masthead-branding {
  display: grid;
  gap: 8px;
}

.masthead-kicker,
.panel-kicker,
.topic-hero-kicker,
.rail-section-header span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editorial-masthead h1,
.topic-hero h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 600;
}

.editorial-masthead h1 {
  font-size: 34px;
  line-height: 1.05;
}

.masthead-subtitle,
.topic-hero-summary,
.empty-state,
.topic-card-meta,
.story-chip-meta,
.desk-note p,
.topic-dropzone p {
  margin: 0;
  color: var(--muted);
}

.masthead-controls {
  display: grid;
  gap: 12px;
  min-width: 380px;
}

.masthead-status {
  min-height: 20px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.masthead-status-main {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.masthead-status.is-busy {
  color: var(--accent);
}

.runtime-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.runtime-source-pill.is-preview {
  border-color: rgba(163, 109, 55, 0.28);
  background: rgba(163, 109, 55, 0.1);
  color: #8a5d29;
}

.runtime-source-pill.is-live {
  border-color: rgba(47, 106, 86, 0.24);
  background: rgba(47, 106, 86, 0.1);
  color: var(--accent);
}

.busy-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(47, 106, 86, 0.25);
  animation: busy-pulse 1.4s ease-in-out infinite;
}

@keyframes busy-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(47, 106, 86, 0.2);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(47, 106, 86, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(47, 106, 86, 0);
  }
}

#topic-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: #fffdf8;
  color: var(--ink);
}

.masthead-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.masthead-actions button,
.merge-candidate-button,
.batch-merge-button,
.detach-story-button {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
}

#archive-topic-button {
  background: var(--danger-soft);
}

#merge-apply-button,
.merge-candidate-button.is-primary,
.confirm-writeback-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #f8f5ef;
}

.merge-candidate-button.is-merge,
.batch-merge-button {
  background: #c7582a;
  border-color: #c7582a;
  color: #fff8f3;
}

.detach-story-button {
  background: var(--danger-soft);
}

.manual-topic-app {
  display: grid;
  grid-template-columns: 320px minmax(560px, 1.12fr) minmax(500px, 0.88fr);
  gap: 0;
  min-height: calc(100vh - 120px);
}

.topic-rail,
.topic-feature-pane,
.news-desk-sidebar {
  min-width: 0;
}

.topic-rail {
  padding: 24px 20px;
  border-right: 1px solid var(--rule);
  background: var(--paper-panel);
}

.rail-section + .rail-section {
  margin-top: 28px;
}

.live-section,
.watchlist-section {
  padding: 14px 12px 2px;
  border: 1px solid var(--rule);
}

.suggested-section {
  padding: 14px 12px 2px;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(24, 82, 123, 0.09), rgba(24, 82, 123, 0.02));
}

.live-section {
  background: linear-gradient(180deg, rgba(47, 106, 86, 0.09), rgba(47, 106, 86, 0.02));
}

.watchlist-section {
  background: linear-gradient(180deg, rgba(163, 109, 55, 0.09), rgba(163, 109, 55, 0.02));
}

.rail-section-header,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

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

.rail-toggle-button {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
}

.rail-topic-list {
  max-height: min(62vh, 720px);
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail-topic-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rail-topic-list.is-collapsed {
  display: none;
}

.rail-section-header h2,
.section-header h3,
.candidate-pool-header h3,
.detail-drawer h3,
.topic-dropzone h3 {
  margin: 0;
  font-size: 16px;
}

.topic-card {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px;
  border: 0;
  border-top: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.32);
  color: var(--ink);
  text-align: left;
}

.topic-card:last-child {
  border-bottom: 1px solid var(--rule);
}

.topic-card-live {
  border-left: 3px solid var(--accent);
}

.topic-card-watchlist {
  border-left: 3px solid var(--watch-accent);
  background: rgba(255, 250, 242, 0.82);
}

.topic-card-suggested {
  border-left: 3px solid #18527b;
  background: rgba(244, 250, 255, 0.88);
}

.suggestion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.topic-card.active {
  color: var(--accent);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(47, 106, 86, 0.12);
}

.topic-card.active .topic-card-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.topic-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topic-card-status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.suggestion-why {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.suggestion-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.suggestion-evidence-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(24, 82, 123, 0.16);
  background: rgba(24, 82, 123, 0.06);
  color: #154867;
  font-size: 11px;
  line-height: 1.35;
}

.suggestion-actions {
  display: grid;
  gap: 8px;
  align-self: start;
}

.suggestion-actions button {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
}

.suggestion-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.topic-card-title,
.topic-card-title-zh {
  font-weight: 700;
  line-height: 1.35;
}

.topic-card-title-zh {
  font-size: 16px;
  line-height: 1.28;
}

.topic-card-title-en {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topic-card-meta {
  font-size: 12px;
  line-height: 1.3;
}

.topic-card-chevron {
  color: var(--muted);
}

.topic-feature-pane {
  padding: 28px 28px 36px;
  background: var(--paper);
}

.topic-board-pane {
  display: grid;
  gap: 18px;
}

.topic-hero {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.topic-board-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.topic-hero h2,
.topic-title-zh {
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.08;
  font-weight: 700;
}

.topic-title-stack {
  display: grid;
  gap: 6px;
  max-width: min(920px, 100%);
}

.topic-title-zh {
  margin: 0;
}

.topic-title-en {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.topic-status-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topic-stat-chip {
  padding: 5px 10px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.topic-overview-card,
.topic-operations-card,
.topic-ledger-card {
  padding: 18px 20px;
  border: 1px solid var(--rule);
  background: var(--paper-panel);
}

.topic-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.overview-panel {
  min-width: 0;
}

.branch-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.72);
}

.branch-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.branch-panel-header span,
.topic-feedback-label,
.topic-feedback-line,
.modal-status-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.topic-branch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  max-width: 100%;
}

.topic-operations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.topic-branch-board {
  display: grid;
  gap: 20px;
}

.topic-branch-card {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
  border: 1px solid var(--rule);
  border-left: 4px solid rgba(47, 106, 86, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 239, 0.88));
  box-shadow: 0 14px 28px rgba(23, 20, 18, 0.05);
}

.topic-branch-card.is-empty {
  border-left-color: rgba(163, 109, 55, 0.28);
}

.topic-branch-card.is-ready {
  border-left-color: rgba(47, 106, 86, 0.52);
}

.branch-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(221, 213, 200, 0.9);
}

.branch-card-title-stack {
  display: grid;
  gap: 4px;
}

.branch-card-title-stack strong {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

.branch-card-title-stack span,
.branch-card-count {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.branch-card-meta-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.branch-card-state {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.branch-card-state.is-empty {
  background: rgba(163, 109, 55, 0.12);
  color: #8a5d29;
}

.branch-card-state.is-ready {
  background: rgba(47, 106, 86, 0.12);
  color: var(--accent);
}

.branch-card-section {
  border-radius: 12px;
}

.topic-branch-dropzone {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px dashed rgba(163, 109, 55, 0.35);
  background: linear-gradient(180deg, rgba(245, 238, 225, 0.88), rgba(248, 242, 233, 0.7));
}

.topic-branch-dropzone strong {
  font-size: 16px;
}

.topic-branch-dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.branch-primary-story {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.92);
}

.branch-primary-story.is-empty {
  border-style: dashed;
  background: rgba(255, 253, 249, 0.88);
}

.branch-primary-story.is-ready {
  border-color: rgba(47, 106, 86, 0.22);
  box-shadow: inset 0 0 0 1px rgba(47, 106, 86, 0.06);
}

.branch-primary-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(221, 213, 200, 0.82);
}

.branch-primary-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  flex: 1;
  min-width: 220px;
}

.clear-branch-primary-button {
  border: 1px solid rgba(163, 109, 55, 0.42);
  background: rgba(245, 238, 225, 0.92);
  color: #7d5221;
  padding: 7px 12px;
  font-size: 12px;
}

.branch-primary-body {
  display: grid;
  gap: 8px;
}

.branch-primary-body h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.branch-story-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(221, 213, 200, 0.82);
  background: rgba(255, 255, 255, 0.74);
}

.branch-story-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.branch-story-list-body {
  display: grid;
  gap: 10px;
}

.branch-story-list-header {
  align-items: center;
}

.branch-story-list-body.is-collapsed,
.branch-story-list.is-collapsed .branch-story-list-body {
  display: none;
}

.branch-story-row {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(240px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.branch-story-row-main {
  min-width: 0;
}

.branch-story-row-main strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.branch-story-actions {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  gap: 10px;
  justify-self: end;
  justify-content: end;
  width: auto;
  align-self: center;
}

.branch-story-action-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(221, 213, 200, 0.92);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--ink);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(23, 20, 18, 0.04);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.branch-story-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(23, 20, 18, 0.08);
}

.branch-story-action-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.branch-merge-button {
  border-color: rgba(47, 106, 86, 0.24);
  background: rgba(47, 106, 86, 0.12);
  color: #225745;
}

.set-branch-primary-button {
  border-color: rgba(177, 133, 44, 0.24);
  background: rgba(177, 133, 44, 0.14);
  color: #7a5a12;
}

.branch-remove-button {
  border-color: rgba(122, 58, 47, 0.2);
  background: rgba(122, 58, 47, 0.12);
  color: #7a3a2f;
}

.branch-story-action-placeholder {
  width: 40px;
  height: 40px;
}

.primary-story {
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.64);
}

.primary-story.is-empty {
  border-style: dashed;
}

.candidate-runtime-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.candidate-runtime-note.is-preview {
  color: #8a5d29;
}

.primary-story-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-story strong,
.confirm-writeback-button {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.topic-branch-label,
.story-chip-branch,
.story-chip-primary,
.candidate-score {
  padding: 3px 8px;
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.topic-branch-label {
  display: inline-grid;
  gap: 3px;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  padding: 7px 10px;
  border-radius: 12px;
  border-color: rgba(163, 109, 55, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 233, 0.9));
}

.topic-branch-label strong {
  font-size: 14px;
  font-weight: 700;
}

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

.topic-writeback-feedback {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.82);
}

.topic-writeback-feedback.is-busy {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.topic-writeback-feedback.is-error {
  border-color: #b56b5e;
  background: rgba(181, 107, 94, 0.08);
}

.topic-feedback-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.topic-feedback-header strong {
  font-size: 15px;
}

.topic-feedback-state {
  padding: 4px 9px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.topic-feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.topic-feedback-cell {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.92);
}

.topic-feedback-cell strong {
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
}

.topic-feedback-line,
.modal-status-line {
  margin: 0;
}

.editorial-action-strip {
  height: 100%;
  padding: 16px 18px;
  border: 1px dashed var(--rule);
  background: rgba(255, 255, 255, 0.56);
}

.editorial-action-strip.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.story-ledger {
  display: grid;
  gap: 0;
}

.story-ledger-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}

.story-ledger-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.story-chip {
  background: transparent;
}

.story-chip-main {
  display: grid;
  gap: 6px;
}

.story-chip-main strong {
  font-size: 17px;
  line-height: 1.4;
}

.news-desk-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.7fr);
  border-left: 1px solid var(--rule);
  background: var(--paper-panel);
}

.candidate-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 22px 0;
  border-bottom: 1px solid var(--rule);
}

.candidate-mode-button {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.candidate-mode-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #f8f5ef;
}

#candidate-mode-suggested {
  background: rgba(214, 165, 56, 0.16);
  border-color: rgba(214, 165, 56, 0.34);
  color: #8a6212;
}

#candidate-mode-suggested.active {
  background: #d6a538;
  border-color: #d6a538;
  color: #fffaf0;
}

.candidate-mode-count {
  display: inline-flex;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  justify-content: center;
  border: 1px solid currentColor;
  font-size: 11px;
  line-height: 1.2;
}

.candidate-pool-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.batch-merge-button {
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.2;
}

.candidate-pool-pane,
.detail-drawer,
.merge-preview-modal .modal-card {
  padding: 24px 22px;
}

.candidate-pool-pane {
  border-bottom: 1px solid var(--rule);
  overflow: auto;
}

.review-queue-pane {
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  overflow: auto;
}

.audit-stream {
  gap: 12px;
}

.audit-note {
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.74);
}

.candidate-history-search input,
.topic-create-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #fffdf8;
  color: var(--ink);
}

.candidate-history-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 14px 12px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.46);
}

.candidate-history-field,
.candidate-history-range {
  display: grid;
  gap: 6px;
}

.candidate-history-field input,
.candidate-history-field select,
.candidate-history-range input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #fffdf8;
  color: var(--ink);
}

.candidate-history-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.candidate-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.candidate-history-actions button {
  border: 1px solid var(--rule);
  background: transparent;
  padding: 8px 12px;
  color: var(--ink);
}

.candidate-history-page {
  color: var(--muted);
  font-size: 12px;
}

.candidate-mode-description {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.candidate-stream,
.suggested-stream,
.desk-notes,
.modal-summary-list {
  display: grid;
  gap: 10px;
}

.candidate-row,
.desk-note {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.candidate-row:last-child,
.desk-note:last-child {
  border-bottom: 1px solid var(--rule);
}

.candidate-row {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(240px, 0.82fr);
  gap: 22px;
  align-items: flex-start;
  padding-bottom: 14px;
}

.candidate-row.is-attached {
  background: rgba(47, 106, 86, 0.07);
  box-shadow: inset 3px 0 0 rgba(47, 106, 86, 0.58);
}

.candidate-row-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.candidate-checkbox-label {
  padding-top: 2px;
}

.candidate-checkbox-label input,
.candidate-select-all-toggle input {
  width: 20px;
  height: 20px;
}

.candidate-text-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.candidate-meta-line {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.candidate-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(163, 109, 55, 0.28);
  background: rgba(245, 238, 225, 0.92);
  color: #7d5221;
  font-size: 13px;
  line-height: 1.2;
}

.candidate-branch-chip strong {
  color: var(--ink);
  font-size: 14px;
}

.candidate-branch-chip-label {
  color: #8a5d29;
  letter-spacing: 0.02em;
}

.candidate-branch-chip.is-attached {
  border-color: rgba(47, 106, 86, 0.3);
  background: rgba(233, 243, 238, 0.9);
  color: var(--accent);
}

.candidate-branch-chip.is-neutral {
  border-color: rgba(109, 101, 92, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
}

.candidate-select-all-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.candidate-time-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.candidate-time-label {
  color: var(--muted);
}

.candidate-metric {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.candidate-metric strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.candidate-action-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.candidate-title {
  display: block;
  min-width: 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
}

.merge-candidate-button {
  border: 1px solid var(--rule);
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.merge-candidate-button.is-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
}

.candidate-inline-preview,
.candidate-loading-card,
.candidate-preview-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.86);
  width: min(100%, 312px);
  justify-self: end;
}

.candidate-preview-error {
  border-color: rgba(199, 88, 42, 0.32);
  background: rgba(199, 88, 42, 0.05);
}

.candidate-loading-card strong,
.candidate-preview-column strong {
  font-size: 13px;
}

.candidate-loading-card p,
.candidate-preview-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.candidate-preview-column {
  display: grid;
  gap: 8px;
}

.candidate-preview-column ul {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.candidate-preview-column li {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.candidate-news-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.candidate-news-title {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.candidate-preview-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.candidate-inline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.candidate-more-button,
.candidate-preview-retry-button {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.01em;
}

.candidate-row:hover,
.topic-card:hover,
.story-ledger-item:hover {
  background: rgba(255, 255, 255, 0.24);
}

.merge-preview-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 18, 0.28);
}

.merge-preview-modal[hidden] {
  display: none !important;
}

.topic-create-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 18, 0.24);
}

.candidate-detail-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 18, 0.32);
}

.candidate-attach-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 18, 0.26);
}

.suggestion-reminder-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 18, 0.34);
}

.topic-create-modal[hidden] {
  display: none !important;
}

.candidate-detail-modal[hidden] {
  display: none !important;
}

.candidate-attach-modal[hidden] {
  display: none !important;
}

.suggestion-reminder-modal[hidden] {
  display: none !important;
}

.merge-preview-modal .modal-card {
  width: min(520px, calc(100vw - 32px));
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(23, 20, 18, 0.12);
}

.modal-card.is-busy {
  box-shadow: 0 20px 56px rgba(47, 106, 86, 0.16);
}

.topic-create-card {
  width: min(560px, calc(100vw - 32px));
  padding: 24px 22px;
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(23, 20, 18, 0.12);
}

.candidate-detail-card {
  width: min(760px, calc(100vw - 48px));
  padding: 24px 22px;
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(23, 20, 18, 0.12);
}

.candidate-attach-card {
  width: min(820px, calc(100vw - 40px));
  padding: 24px 22px;
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(23, 20, 18, 0.12);
}

.suggestion-reminder-card {
  width: min(760px, calc(100vw - 40px));
  max-height: min(78vh, 760px);
  padding: 24px 22px;
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  box-shadow: 0 22px 54px rgba(23, 20, 18, 0.18);
  overflow: hidden;
}

.suggestion-reminder-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
}

.suggestion-reminder-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(98, 80, 60, 0.16);
  background: rgba(255, 250, 242, 0.92);
}

.suggestion-reminder-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.suggestion-reminder-item-header strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.suggestion-reminder-item-header p,
.suggestion-reminder-item-meta {
  margin: 0;
  color: var(--muted);
}

.suggestion-reminder-item-time {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.suggestion-reminder-item-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.suggestion-reminder-actions button {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
}

.suggestion-reminder-view-button {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #f8f5ef !important;
}

.topic-create-form {
  display: grid;
  gap: 14px;
}

.candidate-attach-form {
  display: grid;
  gap: 14px;
}

.candidate-attach-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.candidate-branch-select {
  display: grid;
  gap: 10px;
}

.candidate-branch-picker-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.candidate-branch-picker-header strong {
  font-size: 18px;
  line-height: 1.3;
}

.candidate-branch-picker-header span {
  color: var(--muted);
  font-size: 13px;
}

.candidate-branch-option-list {
  display: grid;
  gap: 10px;
  max-height: min(44vh, 420px);
  overflow: auto;
  padding-right: 4px;
}

.candidate-branch-option {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(163, 109, 55, 0.22);
  background: rgba(255, 255, 255, 0.94);
  text-align: left;
  color: var(--ink);
}

.candidate-branch-option:hover {
  border-color: rgba(163, 109, 55, 0.42);
  background: rgba(248, 242, 233, 0.94);
}

.candidate-branch-option.is-selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 rgba(47, 106, 86, 0.72);
  background: rgba(233, 243, 238, 0.92);
}

.candidate-branch-option-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.candidate-branch-option-title {
  display: grid;
  gap: 3px;
}

.candidate-branch-option-title strong {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}

.candidate-branch-option-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.candidate-branch-option-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.candidate-branch-option-status.is-ready {
  background: rgba(47, 106, 86, 0.12);
  color: var(--accent);
}

.candidate-branch-option-status.is-empty {
  background: rgba(163, 109, 55, 0.12);
  color: #8a5d29;
}

.candidate-branch-option-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.candidate-branch-option-primary {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.topic-modal-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topic-create-form label {
  display: grid;
  gap: 6px;
}

.topic-create-form input,
.topic-create-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #fffdf8;
  color: var(--ink);
}

.topic-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.topic-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cancel-create-topic-button {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
}

.submit-create-topic-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #f8f5ef;
  padding: 8px 12px;
}

.create-topic-error {
  margin: 0;
  color: #8d3125;
  font-size: 13px;
}

.modal-header {
  margin-bottom: 8px;
}

.modal-winner-line {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 22px;
  line-height: 1.2;
}

.close-modal-button {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
}

.confirm-writeback-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #f8f5ef;
  padding: 10px 12px;
}

.confirm-writeback-button.is-busy {
  opacity: 1;
}

.modal-status-line.is-error {
  color: #8d3125;
}

.modal-status-line.is-busy {
  color: var(--accent);
}

@media (max-width: 1180px) {
  .manual-topic-app {
    grid-template-columns: 260px 1fr;
  }

  .news-desk-sidebar {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .candidate-pool-pane {
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }

  .topic-overview-grid,
  .topic-operations-grid,
  .topic-feedback-grid,
  .candidate-preview-columns,
  .candidate-row {
    grid-template-columns: 1fr;
  }

  .branch-story-row {
    grid-template-columns: 1fr;
  }

  .branch-story-actions {
    justify-self: stretch;
    justify-content: start;
  }
}

@media (max-width: 900px) {
  .editorial-masthead {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .masthead-controls {
    min-width: 0;
  }

  .manual-topic-app {
    grid-template-columns: 1fr;
  }

  .topic-rail {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .news-desk-sidebar {
    grid-template-columns: 1fr;
  }

  .candidate-pool-pane {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .branch-story-actions {
    grid-template-columns: repeat(3, 40px);
  }
}

/* SaaS refresh */
:root {
  --paper: #f3f6fb;
  --paper-panel: #ffffff;
  --paper-strong: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --rule: #dbe2ec;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --watch-accent: #64748b;
  --watch-soft: rgba(100, 116, 139, 0.1);
  --danger-soft: rgba(220, 38, 38, 0.08);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.08);
  --sidebar-bg: #0f172a;
  --sidebar-panel: #111c33;
  --sidebar-text: #dbe7f7;
  --sidebar-muted: #91a4c3;
  --sidebar-border: rgba(148, 163, 184, 0.18);
}

body {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(238, 244, 252, 0.98)),
    var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
textarea,
select {
  border-radius: 12px;
}

button,
input,
textarea,
select,
.topic-card,
.topic-branch-card,
.candidate-row,
.story-ledger-item,
.candidate-branch-option,
.desk-note,
.audit-note,
.branch-story-action-button {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.topic-card:focus-visible,
.candidate-branch-option:focus-visible,
.branch-story-action-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.editorial-masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.masthead-branding {
  gap: 4px;
}

.masthead-kicker,
.panel-kicker,
.topic-hero-kicker,
.rail-section-header span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.editorial-masthead h1,
.topic-hero h2,
.modal-winner-line {
  font-family: inherit;
  font-weight: 700;
}

.editorial-masthead h1 {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.masthead-subtitle,
.topic-hero-summary,
.empty-state,
.topic-card-meta,
.story-chip-meta,
.desk-note p,
.topic-dropzone p {
  color: var(--muted);
}

.masthead-subtitle {
  font-size: 13px;
}

.masthead-controls {
  flex: 1;
  min-width: min(620px, 100%);
  grid-template-columns: minmax(240px, 360px) minmax(180px, 1fr) auto;
  align-items: center;
}

.masthead-status {
  justify-content: flex-start;
  min-height: auto;
  font-size: 12px;
}

.runtime-source-pill {
  border-color: rgba(148, 163, 184, 0.28);
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.runtime-source-pill.is-preview {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
}

.runtime-source-pill.is-live {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.busy-dot {
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.18);
}

@keyframes busy-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.16);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 9px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

#topic-search-input,
.candidate-history-field input,
.candidate-history-field select,
.candidate-history-range input,
.topic-create-form input,
.topic-create-form select,
.candidate-history-search input,
.topic-create-form textarea {
  border: 1px solid var(--rule);
  background: #f8fafc;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

#topic-search-input::placeholder,
.candidate-history-field input::placeholder,
.topic-create-form input::placeholder,
.topic-create-form textarea::placeholder {
  color: #94a3b8;
}

.masthead-actions {
  gap: 8px;
}

.masthead-actions button,
.merge-candidate-button,
.batch-merge-button,
.detach-story-button,
.clear-branch-primary-button,
.candidate-more-button,
.candidate-preview-retry-button,
.close-modal-button,
.cancel-create-topic-button,
.submit-create-topic-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.masthead-actions button:hover,
.merge-candidate-button:hover,
.batch-merge-button:hover,
.detach-story-button:hover,
.clear-branch-primary-button:hover,
.candidate-more-button:hover,
.candidate-preview-retry-button:hover,
.close-modal-button:hover,
.cancel-create-topic-button:hover,
.submit-create-topic-button:hover {
  border-color: #c7d2e3;
  background: #f8fafc;
}

#archive-topic-button {
  background: #ffffff;
  border-color: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

#merge-preview-button {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.16);
  color: var(--accent);
}

#merge-apply-button,
.merge-candidate-button.is-primary,
.confirm-writeback-button,
.batch-merge-button,
.submit-create-topic-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #eff6ff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

#merge-apply-button:hover,
.merge-candidate-button.is-primary:hover,
.confirm-writeback-button:hover,
.batch-merge-button:hover,
.submit-create-topic-button:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

#promote-topic-button {
  background: #ffffff;
  border-color: rgba(22, 163, 74, 0.16);
  color: var(--success);
}

.merge-candidate-button.is-secondary {
  background: #ffffff;
  color: #64748b;
}

.detach-story-button {
  background: rgba(220, 38, 38, 0.04);
  border-color: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.manual-topic-app {
  grid-template-columns: 288px minmax(620px, 1fr) minmax(420px, 0.94fr);
  min-height: calc(100vh - 83px);
}

.topic-rail {
  padding: 20px 14px;
  border-right: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.live-section,
.watchlist-section,
.suggested-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.rail-section + .rail-section {
  margin-top: 20px;
}

.rail-section-header {
  margin-bottom: 10px;
  padding: 0 8px;
  align-items: center;
}

.rail-section-header h2 {
  color: #f8fbff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-section-actions {
  gap: 8px;
}

.rail-section-actions span {
  color: var(--sidebar-muted);
  font-size: 11px;
}

.rail-toggle-button {
  border-color: var(--sidebar-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-muted);
  padding: 4px 8px;
  border-radius: 10px;
}

.rail-toggle-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
}

.rail-topic-list {
  max-height: min(74vh, 820px);
  padding-right: 2px;
}

.topic-rail .empty-state {
  color: var(--sidebar-muted);
}

.topic-card {
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--sidebar-border);
  border-radius: 14px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-panel);
  color: var(--sidebar-text);
}

.topic-card:last-child {
  border-bottom: 1px solid var(--sidebar-border);
}

.topic-card-live,
.topic-card-watchlist,
.topic-card-suggested {
  border-left: 1px solid var(--sidebar-border);
}

.topic-card-watchlist {
  background: rgba(17, 28, 51, 0.88);
}

.topic-card.active {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.04)),
    var(--sidebar-panel);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}

.topic-card.active .topic-card-title {
  text-decoration: none;
}

.topic-card:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    var(--sidebar-panel);
}

.topic-card-main {
  gap: 6px;
}

.topic-card-status-pill {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 600;
}

.topic-card-title-zh {
  font-size: 14px;
  line-height: 1.35;
}

.topic-card-title-en,
.topic-card-meta,
.topic-card-chevron {
  color: var(--sidebar-muted);
}

.topic-card.active .topic-card-title-en,
.topic-card.active .topic-card-meta,
.topic-card.active .topic-card-chevron {
  color: rgba(219, 231, 247, 0.82);
}

.suggestion-card {
  margin-bottom: 0;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.suggestion-card:hover {
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.suggestion-card .topic-card-title-en,
.suggestion-card .topic-card-meta,
.suggestion-card .suggestion-why {
  color: var(--muted);
}

.suggestion-card .topic-card-title-zh {
  color: var(--ink);
}

.suggestion-card .suggestion-evidence-chip {
  border-color: rgba(37, 99, 235, 0.12);
  background: #eff6ff;
  color: #1d4ed8;
}

.suggestion-actions button {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: #334155;
}

.suggestion-actions button:hover:not(:disabled) {
  border-color: #c7d2e3;
  background: #f8fafc;
}

.topic-feature-pane {
  padding: 24px;
  background: transparent;
}

.topic-board-pane {
  gap: 20px;
}

.topic-hero {
  gap: 14px;
  padding: 0;
  border: 0;
}

.topic-title-stack {
  gap: 8px;
}

.topic-hero h2,
.topic-title-zh {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.topic-title-en {
  max-width: 100%;
  font-size: 14px;
  line-height: 1.5;
}

.topic-status-strip {
  gap: 8px;
}

.topic-stat-chip,
.topic-branch-label,
.story-chip-branch,
.story-chip-primary,
.candidate-score,
.topic-feedback-state,
.candidate-mode-count {
  border-radius: 999px;
}

.topic-stat-chip {
  padding: 6px 12px;
  border-color: var(--rule);
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.topic-overview-card,
.topic-operations-card,
.topic-ledger-card,
.audit-note,
.desk-note,
.candidate-history-filters,
.candidate-inline-preview,
.candidate-loading-card,
.candidate-preview-panel,
.topic-writeback-feedback,
.branch-panel,
.primary-story,
.branch-primary-story,
.branch-story-list {
  border-radius: 18px;
  border: 1px solid var(--rule);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.topic-overview-card,
.topic-operations-card,
.topic-ledger-card {
  padding: 20px;
}

.section-header {
  align-items: center;
}

.section-header h3,
.candidate-pool-header h3,
.detail-drawer h3,
.topic-dropzone h3 {
  font-size: 15px;
  line-height: 1.3;
}

.branch-panel {
  gap: 12px;
  background: #f8fafc;
  box-shadow: none;
}

.branch-panel-header span,
.topic-feedback-label,
.topic-feedback-line,
.modal-status-line,
.candidate-mode-description,
.candidate-runtime-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.topic-branch-label {
  gap: 4px;
  padding: 8px 10px;
  border-color: #dbe2ec;
  background: #f8fafc;
}

.topic-branch-label strong {
  font-size: 13px;
}

.topic-branch-label span {
  font-size: 12px;
}

.topic-operations-grid {
  grid-template-columns: 1fr;
}

.topic-branch-board {
  gap: 16px;
}

.topic-branch-card {
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.topic-branch-card.is-empty,
.topic-branch-card.is-ready {
  border-left: 1px solid var(--rule);
}

.branch-card-header {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}

.branch-card-title-stack strong {
  font-size: 16px;
  line-height: 1.35;
}

.branch-card-title-stack span,
.branch-card-count {
  font-size: 12px;
}

.branch-card-meta-stack {
  gap: 6px;
}

.branch-card-state {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.branch-card-state.is-empty {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.branch-card-state.is-ready {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.branch-card-section,
.topic-branch-dropzone,
.branch-primary-story,
.branch-story-list {
  border-radius: 14px;
}

.topic-branch-dropzone {
  gap: 8px;
  padding: 14px 16px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.topic-branch-dropzone strong {
  font-size: 14px;
}

.topic-branch-dropzone p {
  font-size: 13px;
}

.branch-primary-story {
  padding: 14px 16px;
  background: #f8fafc;
  box-shadow: none;
}

.branch-primary-story.is-empty {
  border-style: dashed;
  background: #fbfdff;
}

.branch-primary-story.is-ready {
  border-color: #dbeafe;
  background: #f8fbff;
  box-shadow: none;
}

.branch-primary-body {
  gap: 8px;
}

.branch-primary-body h4 {
  font-size: 16px;
}

.branch-primary-actions {
  padding-top: 10px;
  border-top: 1px solid #e5edf7;
}

.branch-primary-actions p {
  font-size: 12px;
}

.clear-branch-primary-button {
  background: #ffffff;
  color: #475569;
}

.branch-story-list {
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  box-shadow: none;
}

.branch-story-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}

.branch-story-actions {
  grid-template-columns: repeat(3, 36px);
  gap: 8px;
  align-self: start;
}

.branch-story-action-button {
  width: 36px;
  height: 36px;
  border: 1px solid #dbe2ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.branch-story-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.branch-story-action-icon {
  font-size: 15px;
}

.branch-merge-button {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.set-branch-primary-button {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
}

.branch-remove-button {
  border-color: rgba(220, 38, 38, 0.16);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

.primary-story {
  padding: 16px 18px;
  background: #f8fafc;
  box-shadow: none;
}

.candidate-runtime-note.is-preview {
  color: #475569;
}

.primary-story strong,
.confirm-writeback-button {
  font-weight: 600;
}

.story-chip-branch,
.story-chip-primary,
.candidate-score {
  padding: 4px 9px;
  border-color: #dbe2ec;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.story-chip-primary {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.14);
  color: var(--accent);
}

.topic-writeback-feedback {
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  box-shadow: none;
}

.topic-writeback-feedback.is-busy {
  border-color: rgba(37, 99, 235, 0.18);
  background: #eef5ff;
}

.topic-writeback-feedback.is-error {
  border-color: rgba(220, 38, 38, 0.16);
  background: rgba(220, 38, 38, 0.05);
}

.topic-feedback-state {
  border-color: #dbe2ec;
  background: #ffffff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.topic-feedback-cell {
  border-radius: 14px;
  border: 1px solid #dbe2ec;
  background: #ffffff;
}

.editorial-action-strip {
  height: auto;
  padding: 16px 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
}

.editorial-action-strip.drag-over {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eef5ff;
}

.story-ledger {
  gap: 12px;
}

.story-ledger-item {
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #ffffff;
}

.story-ledger-item,
.story-ledger-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.story-chip-main strong {
  font-size: 15px;
}

.news-desk-sidebar {
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.9);
}

.candidate-mode-tabs {
  position: sticky;
  top: 82px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 16px 18px 0;
  background: rgba(255, 255, 255, 0.94);
}

.candidate-mode-button {
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.candidate-mode-button.active {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent);
}

#candidate-mode-suggested {
  background: #f8fafc;
  border-color: var(--rule);
  color: #475569;
}

#candidate-mode-suggested.active {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent);
}

.candidate-mode-count {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.82);
  font-size: 10px;
}

.candidate-pool-pane,
.detail-drawer,
.merge-preview-modal .modal-card,
.review-queue-pane {
  padding: 18px;
}

.candidate-pool-pane {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.86);
}

.review-queue-pane {
  background: #ffffff;
}

.audit-stream,
.candidate-stream,
.suggested-stream,
.desk-notes,
.modal-summary-list {
  gap: 12px;
}

.candidate-history-filters {
  margin-bottom: 18px;
  padding: 14px;
  background: #f8fafc;
  box-shadow: none;
}

.candidate-history-actions button {
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
}

.candidate-pool-header-actions {
  gap: 10px;
}

.batch-merge-button {
  font-size: 12px;
  font-weight: 600;
}

.candidate-row,
.desk-note {
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.candidate-row:last-child,
.desk-note:last-child {
  border-bottom: 1px solid var(--rule);
}

.candidate-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.candidate-row.is-attached {
  background:
    linear-gradient(0deg, rgba(22, 163, 74, 0.04), rgba(22, 163, 74, 0.04)),
    #ffffff;
  box-shadow: inset 4px 0 0 rgba(22, 163, 74, 0.68);
}

.candidate-row-main {
  gap: 12px;
}

.candidate-checkbox-label {
  padding-top: 0;
}

.candidate-text-stack {
  gap: 10px;
}

.candidate-meta-line {
  gap: 8px;
  align-items: center;
}

.candidate-branch-chip {
  gap: 6px;
  padding: 6px 10px;
  border-color: rgba(37, 99, 235, 0.16);
  background: #eff6ff;
  color: var(--accent);
  font-size: 12px;
}

.candidate-branch-chip strong {
  font-size: 12px;
  color: #1e293b;
}

.candidate-branch-chip-label {
  color: var(--accent);
  font-size: 11px;
}

.candidate-branch-chip.is-attached {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.candidate-branch-chip.is-neutral {
  border-color: rgba(148, 163, 184, 0.18);
  background: #f8fafc;
  color: #64748b;
}

.candidate-select-all-toggle {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.candidate-time-line {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.candidate-metric {
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.candidate-metric strong {
  font-size: 14px;
}

.candidate-action-line {
  justify-content: space-between;
  gap: 10px;
}

.candidate-title {
  font-size: 15px;
  line-height: 1.5;
}

.merge-candidate-button {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.candidate-inline-preview,
.candidate-loading-card,
.candidate-preview-panel {
  width: 100%;
  gap: 10px;
  padding: 14px;
  justify-self: stretch;
  background: #f8fafc;
  box-shadow: none;
}

.candidate-preview-error {
  border-color: rgba(220, 38, 38, 0.16);
  background: rgba(220, 38, 38, 0.04);
}

.candidate-loading-card strong,
.candidate-preview-column strong {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.candidate-loading-card p,
.candidate-preview-summary {
  font-size: 12px;
}

.candidate-preview-columns {
  gap: 12px;
}

.candidate-preview-column ul {
  padding-left: 16px;
}

.candidate-preview-column li,
.candidate-news-title {
  font-size: 12px;
}

.candidate-preview-meta {
  font-size: 11px;
}

.candidate-inline-actions {
  justify-content: flex-start;
}

.candidate-more-button,
.candidate-preview-retry-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.candidate-row:hover,
.story-ledger-item:hover,
.desk-note:hover,
.audit-note:hover {
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.merge-preview-modal,
.topic-create-modal,
.candidate-detail-modal,
.candidate-attach-modal {
  backdrop-filter: blur(4px);
}

.merge-preview-modal {
  background: rgba(15, 23, 42, 0.36);
}

.topic-create-modal,
.candidate-detail-modal,
.candidate-attach-modal {
  background: rgba(15, 23, 42, 0.28);
}

.merge-preview-modal .modal-card,
.topic-create-card,
.candidate-detail-card,
.candidate-attach-card {
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.candidate-detail-card,
.candidate-attach-card,
.topic-create-card {
  padding: 24px 22px;
}

.candidate-attach-summary {
  gap: 8px;
}

.candidate-branch-picker-header strong {
  font-size: 16px;
}

.candidate-branch-picker-header span {
  font-size: 12px;
}

.candidate-branch-option-list {
  gap: 10px;
  max-height: min(44vh, 420px);
}

.candidate-branch-option {
  gap: 10px;
  padding: 14px;
  border-color: #dbe2ec;
  border-radius: 14px;
  background: #ffffff;
}

.candidate-branch-option:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.candidate-branch-option.is-selected {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.72);
  background: #eff6ff;
}

.candidate-branch-option-title strong {
  font-size: 15px;
}

.candidate-branch-option-title span,
.candidate-branch-option-meta,
.candidate-branch-option-primary,
.topic-modal-note {
  font-size: 12px;
  color: var(--muted);
}

.candidate-branch-option-status {
  font-size: 11px;
  font-weight: 600;
}

.candidate-branch-option-status.is-ready {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.candidate-branch-option-status.is-empty {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.topic-create-form {
  gap: 14px;
}

.topic-create-form label,
.candidate-attach-form {
  gap: 8px;
}

.topic-create-grid {
  gap: 12px;
}

.topic-create-actions {
  gap: 10px;
}

.create-topic-error,
.modal-status-line.is-error {
  color: #b91c1c;
}

.modal-header {
  margin-bottom: 10px;
}

.modal-winner-line {
  font-size: 18px;
  line-height: 1.3;
}

.confirm-writeback-button.is-busy {
  opacity: 1;
}

.modal-status-line.is-busy {
  color: var(--accent);
}

@media (max-width: 1320px) {
  .manual-topic-app {
    grid-template-columns: 264px minmax(0, 1fr) minmax(360px, 0.92fr);
  }

  .masthead-controls {
    grid-template-columns: minmax(220px, 320px) minmax(160px, 1fr) auto;
  }
}

@media (max-width: 1180px) {
  .manual-topic-app {
    grid-template-columns: 260px 1fr;
  }

  .topic-feature-pane {
    padding: 20px;
  }

  .news-desk-sidebar {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .candidate-mode-tabs {
    top: auto;
    position: static;
  }

  .candidate-pool-pane {
    border-right: 1px solid var(--rule);
  }

  .topic-overview-grid,
  .topic-feedback-grid,
  .candidate-preview-columns {
    grid-template-columns: 1fr;
  }

  .branch-story-row {
    grid-template-columns: 1fr;
  }

  .branch-story-actions {
    justify-self: stretch;
    justify-content: start;
  }
}

@media (max-width: 900px) {
  .editorial-masthead {
    gap: 14px;
    padding: 14px 16px;
  }

  .masthead-controls {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .masthead-status {
    order: 3;
  }

  .masthead-actions {
    justify-content: flex-start;
  }

  .manual-topic-app {
    grid-template-columns: 1fr;
  }

  .topic-rail {
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .news-desk-sidebar {
    grid-template-columns: 1fr;
  }

  .candidate-mode-tabs {
    grid-template-columns: 1fr 1fr;
    padding: 14px 14px 0;
  }

  .candidate-pool-pane,
  .review-queue-pane {
    padding: 14px;
  }

  .candidate-pool-pane {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .candidate-row,
  .topic-overview-card,
  .topic-operations-card,
  .topic-ledger-card,
  .topic-branch-card {
    border-radius: 16px;
  }
}

/* Reference-inspired layout pass */
.editorial-masthead {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.masthead-page {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.masthead-page .masthead-kicker {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--accent);
}

.masthead-page h1 {
  font-size: 22px;
}

.masthead-controls {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.masthead-search {
  position: relative;
}

.masthead-search #topic-search-input {
  height: 42px;
  padding: 10px 78px 10px 14px;
  border-radius: 14px;
}

.masthead-search-hint {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: 3px 8px;
  border: 1px solid #dbe2ec;
  border-radius: 999px;
  background: #ffffff;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.masthead-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.masthead-status {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.masthead-status-main {
  min-width: 0;
}

.masthead-status-label {
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.status-dot.is-live {
  color: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);
}

.status-dot.is-preview {
  color: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.08);
}

.masthead-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.manual-topic-app {
  grid-template-columns: 260px minmax(0, 1fr) minmax(430px, 0.9fr);
  gap: 18px;
  padding: 18px;
  min-height: calc(100vh - 83px);
}

.topic-rail,
.topic-feature-pane,
.news-desk-sidebar {
  border-radius: 24px;
  overflow: hidden;
}

.topic-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
}

.topic-rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--sidebar-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.topic-rail-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #eff6ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topic-rail-brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topic-rail-brand-copy strong {
  color: #f8fbff;
  font-size: 14px;
  line-height: 1.2;
}

.topic-rail-brand-copy span {
  color: var(--sidebar-muted);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.topic-rail-nav-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.topic-rail-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fbff;
}

.topic-rail-nav-item.is-active {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.22);
  color: #dbeafe;
}

.topic-rail-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--sidebar-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.topic-rail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  color: #eff6ff;
  font-size: 12px;
  font-weight: 700;
}

.topic-rail-operator {
  display: grid;
  gap: 2px;
}

.topic-rail-operator strong {
  color: #f8fbff;
  font-size: 13px;
}

.topic-rail-operator span {
  color: var(--sidebar-muted);
  font-size: 11px;
}

.topic-card {
  align-items: center;
}

.topic-card-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.topic-card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #f8fbff;
  font-size: 11px;
  font-weight: 700;
}

.topic-card.active .topic-card-count {
  background: rgba(255, 255, 255, 0.12);
}

.topic-feature-pane,
.news-desk-sidebar {
  padding: 18px;
}

.topic-hero {
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 36%),
    #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.topic-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-hero-badge,
.topic-hero-id {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.topic-hero-badge {
  background: #eff6ff;
  color: var(--accent);
}

.topic-hero-id {
  border: 1px solid #dbe2ec;
  background: #f8fafc;
  color: #64748b;
}

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

.topic-summary-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.topic-summary-card.is-featured {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  border-color: #dbeafe;
}

.topic-summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.topic-summary-value {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.topic-summary-detail {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.topic-overview-card .section-header > span,
.topic-operations-card .section-header > span,
.topic-ledger-card .section-header > span,
.review-queue-pane .section-header > span,
.candidate-pool-header-actions > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.review-queue-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topic-overview-card,
.topic-operations-card,
.topic-ledger-card {
  padding: 18px;
}

.section-header {
  margin-bottom: 14px;
}

.news-desk-sidebar {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--rule);
}

.candidate-mode-tabs {
  top: 101px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: #f8fafc;
}

.candidate-mode-button {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.candidate-pool-pane,
.review-queue-pane {
  padding: 0;
  border: 0;
  background: transparent;
}

.candidate-pool-pane {
  margin-top: 14px;
}

.candidate-pool-header,
.candidate-history-filters,
.candidate-stream,
.suggested-stream,
.review-queue-pane .section-header,
.review-queue-pane .desk-notes {
  padding-left: 0;
  padding-right: 0;
}

.candidate-history-filters,
.candidate-row,
.suggestion-card,
.review-queue-pane .desk-note,
.audit-note {
  border-radius: 20px;
}

.review-queue-card {
  display: grid;
  gap: 10px;
}

.review-queue-pane .desk-notes.is-collapsed,
.review-queue-pane.is-collapsed .desk-notes {
  display: none;
}

.review-queue-card-head,
.review-queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.review-queue-type-pill,
.review-queue-status-pill,
.review-queue-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.review-queue-type-pill {
  font-weight: 700;
}

.review-queue-type-pill.is-attach {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.review-queue-type-pill.is-merge {
  background: rgba(180, 83, 9, 0.14);
  color: #b45309;
}

.review-queue-status-pill,
.review-queue-meta span {
  border: 1px solid var(--rule);
  color: var(--muted);
  background: rgba(248, 250, 252, 0.92);
}

.review-queue-story-title {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.review-queue-target,
.review-queue-guidance {
  margin: 0;
}

.review-queue-target {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.review-queue-target strong {
  color: var(--ink);
  font-size: 14px;
}

.review-queue-guidance {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.review-queue-open-button {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.review-queue-open-button:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.26);
}

.review-queue-toggle-button {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid #dbe2ec;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.review-queue-toggle-button:hover {
  border-color: #cbd5e1;
  color: var(--ink);
}

.candidate-row {
  grid-template-columns: minmax(0, 1.06fr) minmax(250px, 0.94fr);
  gap: 16px;
  align-items: stretch;
}

.candidate-row-main {
  display: grid;
  grid-template-columns: 12px auto minmax(0, 1fr);
  gap: 12px;
  align-content: start;
}

.candidate-drag-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 6px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.candidate-meta-line,
.candidate-summary-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.candidate-meta-chip,
.candidate-story-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.candidate-meta-chip strong,
.candidate-story-ref {
  color: var(--ink);
  font-weight: 700;
}

.candidate-score-chip {
  border-color: rgba(22, 163, 74, 0.16);
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
}

.candidate-score-chip strong {
  color: var(--success);
}

.candidate-summary-strip {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.candidate-metric {
  min-width: 104px;
  justify-content: space-between;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.candidate-metric strong {
  font-size: 16px;
}

.candidate-metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.candidate-action-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.candidate-inline-preview {
  display: grid;
  align-content: start;
  height: 100%;
}

.candidate-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.candidate-inline-header strong {
  font-size: 12px;
  color: #334155;
}

.candidate-news-list {
  list-style: none;
  padding-left: 0;
}

.candidate-news-list li {
  padding-left: 12px;
  border-left: 2px solid #dbe2ec;
}

.candidate-inline-actions {
  margin-top: auto;
}

@media (max-width: 1380px) {
  .editorial-masthead {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .manual-topic-app {
    grid-template-columns: 240px minmax(0, 1fr) minmax(390px, 0.92fr);
  }

  .masthead-controls {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .editorial-masthead {
    grid-template-columns: 1fr;
  }

  .masthead-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .masthead-status {
    justify-content: flex-start;
  }

  .manual-topic-app {
    grid-template-columns: 240px 1fr;
  }

  .topic-summary-grid {
    grid-template-columns: 1fr;
  }

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

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

  .topic-rail,
  .topic-feature-pane,
  .news-desk-sidebar {
    border-radius: 20px;
  }

  .topic-rail {
    gap: 14px;
  }

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

  .candidate-mode-tabs {
    top: auto;
  }

  .candidate-row-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

    .candidate-drag-indicator {
      display: none;
    }
}

/* Manual topic refinement */
.manual-topic-app {
  grid-template-columns: 312px minmax(0, 1fr) minmax(420px, 0.88fr);
}

.topic-rail {
  width: 312px;
  min-width: 312px;
  max-width: 312px;
  gap: 16px;
  padding: 18px 16px;
  background:
    linear-gradient(180deg, rgba(20, 31, 58, 0.98), rgba(15, 23, 42, 0.98)),
    var(--sidebar-bg);
}

.topic-rail-brand,
.topic-rail-footer {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.topic-rail-logo {
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.topic-rail-list-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.topic-rail-list-tab {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 700;
}

.topic-rail-list-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
}

.topic-rail-list-tab.is-active {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(37, 99, 235, 0.22);
  color: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
}

.rail-section.is-hidden {
  display: none;
}

.rail-section-header {
  padding: 0 2px;
}

.rail-section-header h2 {
  color: #eef4ff;
}

.rail-section-actions span {
  color: #a5b4cf;
}

.rail-toggle-button {
  display: none;
}

.topic-card {
  padding: 14px;
  border-color: rgba(96, 165, 250, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.topic-card:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(17, 28, 51, 0.96);
}

.topic-card.active {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0.1)),
    rgba(24, 38, 72, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(96, 165, 250, 0.45),
    inset 4px 0 0 rgba(99, 102, 241, 0.9);
}

.topic-card-title-zh {
  font-size: 16px;
  color: #f8fbff;
}

.topic-card-title-en,
.topic-card-meta,
.topic-card-chevron {
  color: #a7b5cf;
}

.topic-card-status-pill {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e5fb;
}

.topic-card-count {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.news-desk-sidebar {
  display: flex;
  flex-direction: column;
  align-self: start;
  padding: 14px 16px 18px;
  gap: 14px;
}

.candidate-mode-tabs {
  top: 96px;
  margin-top: 0;
}

.candidate-pool-pane {
  margin-top: 0;
}

.candidate-pool-header {
  margin-top: 0;
}

.candidate-row.is-attached {
  background:
    linear-gradient(0deg, rgba(22, 163, 74, 0.06), rgba(22, 163, 74, 0.06)),
    #ffffff;
  box-shadow: inset 4px 0 0 rgba(22, 163, 74, 0.68);
}

.candidate-row.is-attached:hover {
  background:
    linear-gradient(0deg, rgba(22, 163, 74, 0.06), rgba(22, 163, 74, 0.06)),
    #ffffff;
  box-shadow:
    inset 4px 0 0 rgba(22, 163, 74, 0.68),
    0 12px 28px rgba(15, 23, 42, 0.06);
}

.candidate-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.candidate-collapse-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe2ec;
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.candidate-attached-collapsed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(0deg, rgba(22, 163, 74, 0.06), rgba(22, 163, 74, 0.06)),
    #ffffff;
  color: var(--ink);
  text-align: left;
}

.candidate-attached-collapsed:hover {
  border-color: rgba(22, 163, 74, 0.28);
  background:
    linear-gradient(0deg, rgba(22, 163, 74, 0.08), rgba(22, 163, 74, 0.08)),
    #ffffff;
}

.candidate-attached-collapsed-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 700;
}

.candidate-attached-collapsed-meta {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.candidate-attached-collapsed-arrow {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.branch-primary-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.branch-story-actions {
  grid-template-columns: repeat(4, 36px);
}

.set-topic-primary-button {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

@media (max-width: 1380px) {
  .manual-topic-app {
    grid-template-columns: 296px minmax(0, 1fr) minmax(380px, 0.9fr);
  }

  .topic-rail {
    width: 296px;
    min-width: 296px;
    max-width: 296px;
  }
}

@media (max-width: 1180px) {
  .manual-topic-app {
    grid-template-columns: 280px 1fr;
  }

  .topic-rail {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
  }
}

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

  .topic-rail {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .topic-rail-list-tabs {
    grid-template-columns: 1fr;
  }

  .candidate-attached-collapsed {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Manual topic shell layout fix */
.manual-topic-shell {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  padding: 0;
  align-items: start;
}

.manual-topic-workspace {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}

.manual-topic-shell .editorial-masthead {
  display: block;
  top: 0;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0;
  padding: 8px 18px;
}

.manual-topic-shell .manual-topic-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.88fr);
  gap: 18px;
  min-height: 0;
  padding: 0;
}

.manual-topic-shell .masthead-controls {
  width: 100%;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
}

.manual-topic-shell .masthead-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.manual-topic-shell .masthead-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
}

.manual-topic-shell .masthead-status-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.manual-topic-shell .masthead-status-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-topic-shell .runtime-source-pill {
  white-space: nowrap;
}

.manual-topic-shell .masthead-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.manual-topic-shell .masthead-actions button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.manual-topic-shell .topic-rail {
  position: sticky;
  top: 0;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0;
  overflow: hidden;
}

.manual-topic-shell .topic-rail-scroll {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0;
  padding-bottom: 8px;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
}

.manual-topic-shell .topic-rail-scroll::-webkit-scrollbar {
  width: 8px;
}

.manual-topic-shell .topic-rail-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.manual-topic-shell .topic-rail-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.34);
  background-clip: padding-box;
}

.manual-topic-shell .topic-rail-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.48);
  background-clip: padding-box;
}

.manual-topic-shell .topic-rail-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

.manual-topic-shell .rail-topic-list {
  max-height: none;
}

.manual-topic-shell .topic-rail-footer {
  margin-top: 0;
  flex-shrink: 0;
}

.manual-topic-shell .topic-feature-pane,
.manual-topic-shell .news-desk-sidebar {
  min-height: 0;
}

.manual-topic-shell .news-desk-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
}

.manual-topic-shell .candidate-mode-tabs {
  position: static;
  top: auto;
  z-index: auto;
}

.manual-topic-shell .masthead-page {
  gap: 2px;
}

.manual-topic-shell .masthead-page h1 {
  font-size: 18px;
  line-height: 1.05;
}

.manual-topic-shell .masthead-subtitle {
  font-size: 11px;
}

@media (max-width: 1380px) {
  .manual-topic-shell {
    grid-template-columns: 296px minmax(0, 1fr);
  }

  .manual-topic-shell .manual-topic-app {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr);
  }

  .manual-topic-shell .topic-rail {
    width: 296px;
    min-width: 296px;
    max-width: 296px;
  }
}

@media (max-width: 1680px) {
  .manual-topic-shell .masthead-status-main {
    display: none;
  }
}

@media (max-width: 1180px) {
  .manual-topic-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .manual-topic-shell .masthead-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .manual-topic-shell .masthead-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .manual-topic-shell .manual-topic-app {
    grid-template-columns: 1fr;
  }

  .manual-topic-shell .topic-rail {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
  }

  .manual-topic-shell .news-desk-sidebar {
    position: static;
    top: auto;
  }
}

@media (max-width: 900px) {
  .manual-topic-shell {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .manual-topic-workspace {
    min-height: 0;
    gap: 12px;
  }

  .manual-topic-shell .editorial-masthead,
  .manual-topic-shell .topic-rail,
  .manual-topic-shell .news-desk-sidebar {
    position: static;
    top: auto;
    min-height: 0;
  }

  .manual-topic-shell .manual-topic-app {
    gap: 12px;
  }

  .manual-topic-shell .topic-rail {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* Manual topic follow-up refinements */
.manual-topic-shell .topic-summary-card,
.manual-topic-shell .topic-overview-card,
.manual-topic-shell .topic-operations-card,
.manual-topic-shell .branch-panel,
.manual-topic-shell .primary-story,
.manual-topic-shell .topic-writeback-feedback,
.manual-topic-shell .topic-branch-card,
.manual-topic-shell .branch-primary-story,
.manual-topic-shell .branch-story-list,
.manual-topic-shell .topic-branch-dropzone {
  border-radius: 12px;
}

.manual-topic-shell .topic-summary-card {
  padding: 16px 18px;
}

.manual-topic-shell .topic-overview-card .section-header > span,
.manual-topic-shell .topic-operations-card .section-header > span,
.manual-topic-shell .review-queue-pane .section-header > span,
.manual-topic-shell .candidate-pool-header-actions > span {
  border-radius: 8px;
}

.manual-topic-shell .topic-overview-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.manual-topic-shell .topic-overview-stack {
  gap: 12px;
}

.manual-topic-shell .overview-panel,
.manual-topic-shell .topic-overview-panel,
.manual-topic-shell .branch-panel {
  min-width: 0;
}

.manual-topic-shell .topic-overview-panel {
  min-height: 0;
}

.manual-topic-shell .topic-overview-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.manual-topic-shell .topic-overview-panel-head strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
}

.manual-topic-shell .topic-overview-panel-head span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.manual-topic-shell .branch-panel {
  gap: 12px;
  padding: 14px 16px;
}

.manual-topic-shell .primary-story {
  min-height: 0;
  gap: 12px;
  padding: 14px 16px;
}

.manual-topic-shell .primary-story-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
}

.manual-topic-shell .primary-story-band-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.manual-topic-shell .primary-story-band-title,
.manual-topic-shell .primary-story-band-note {
  margin: 0;
}

.manual-topic-shell .primary-story-band-title {
  color: #0f172a;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
}

.manual-topic-shell .primary-story-band-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.manual-topic-shell .primary-story.is-empty .primary-story-band {
  display: block;
}

.manual-topic-shell .primary-story .empty-state {
  margin: 0;
}

.manual-topic-shell .primary-story-meta {
  justify-content: flex-end;
  align-items: center;
}

.manual-topic-shell .topic-branch-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.manual-topic-shell .topic-branch-nav-grid {
  align-items: stretch;
}

.manual-topic-shell .topic-branch-label {
  appearance: none;
  border: 1px solid #dbe2ec;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 0;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: left;
  cursor: pointer;
}

.manual-topic-shell .topic-branch-nav-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.manual-topic-shell .topic-branch-label strong {
  width: auto;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
}

.manual-topic-shell .topic-branch-label span {
  font-size: 12px;
  line-height: 1.45;
}

.manual-topic-shell .topic-branch-nav-button:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08);
}

.manual-topic-shell .topic-branch-nav-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 700;
}

.manual-topic-shell .topic-branch-nav-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.manual-topic-shell .topic-branch-nav-key {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #dbe2ec;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.2;
}

.manual-topic-shell .topic-branch-nav-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.manual-topic-shell .topic-board-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.manual-topic-shell .topic-board-back-top {
  border: 1px solid #dbe2ec;
  background: #ffffff;
  color: #475569;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.manual-topic-shell .topic-board-back-top:hover {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.manual-topic-shell .topic-branch-board {
  gap: 14px;
}

.manual-topic-shell .topic-branch-card {
  gap: 16px;
  padding: 18px;
  border: 1px solid #dbe2ec;
  border-top: 3px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.manual-topic-shell .topic-branch-card.is-empty {
  border-top-color: rgba(180, 83, 9, 0.42);
}

.manual-topic-shell .topic-branch-card.is-ready {
  border-top-color: rgba(22, 163, 74, 0.52);
}

.manual-topic-shell .branch-card-header {
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
}

.manual-topic-shell .branch-card-title-stack {
  gap: 6px;
  min-width: 0;
}

.manual-topic-shell .branch-card-kicker {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #dbe2ec;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.manual-topic-shell .branch-card-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.manual-topic-shell .branch-card-title-stack strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.35;
  font-family: inherit;
  letter-spacing: 0;
}

.manual-topic-shell .branch-card-key {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #dbe2ec;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.2;
}

.manual-topic-shell .branch-card-summary,
.manual-topic-shell .branch-card-count {
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.manual-topic-shell .branch-card-meta-stack {
  align-items: flex-end;
  gap: 8px;
}

.manual-topic-shell .branch-card-state {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.manual-topic-shell .branch-card-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

@media (min-width: 1181px) {
  .manual-topic-shell {
    height: 100vh;
    overflow: hidden;
  }

  .manual-topic-workspace {
    height: 100vh;
    min-height: 0;
  }

  .manual-topic-shell .manual-topic-app {
    height: 100%;
    min-height: 0;
    align-items: stretch;
  }

  .manual-topic-shell .topic-rail-scroll {
    height: 100%;
  }

  .manual-topic-shell .topic-feature-pane {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .manual-topic-shell .news-desk-sidebar {
    position: sticky;
    top: 0;
    align-self: stretch;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }

  .manual-topic-shell .candidate-mode-tabs {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 16px 12px;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0;
    background: #fbfcfe;
  }

  .manual-topic-shell .candidate-mode-button {
    justify-content: center;
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
  }

  .manual-topic-shell .candidate-pool-pane {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    padding: 14px 16px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 0;
  }

  .manual-topic-shell .review-queue-pane {
    flex: 0 0 auto;
    max-height: 220px;
    padding: 12px 16px 16px;
    overflow-y: auto;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    border-bottom: 0;
    background: #ffffff;
  }

  .manual-topic-shell .candidate-stream,
  .manual-topic-shell .suggested-stream,
  .manual-topic-shell .audit-stream,
  .manual-topic-shell .review-queue-pane .desk-notes {
    padding-bottom: 10px;
  }
}

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

  .manual-topic-shell .primary-story-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .manual-topic-shell .primary-story-meta {
    justify-content: flex-start;
  }

  .manual-topic-shell .branch-card-header {
    flex-direction: column;
  }

  .manual-topic-shell .branch-card-meta-stack {
    align-items: flex-start;
  }
}
