/* China Trend Radar Tracker — light, dense, offline-first */
:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --border: #dfe3e9;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: #eff4ff;
  --rising: #16a34a;
  --breakout: #ea580c;
  --dead: #dc2626;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 10px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.brand .logo { font-size: 22px; }
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; }
.brand .tagline { margin: 0; font-size: 11px; color: var(--muted); }
.nav { display: flex; gap: 4px; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.nav-item {
  flex: 0 0 auto; padding: 7px 13px; border-radius: 7px; color: var(--text);
  font-size: 13px; font-weight: 600;
}
.nav-item:hover { background: #eef2f7; text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.topbar-actions { display: flex; flex: 0 0 auto; gap: 6px; flex-wrap: nowrap; margin-left: auto; align-items: center; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  cursor: pointer; font-size: 17px; line-height: 1;
}
.icon-btn:hover, .icon-btn.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.settings-subnav { display: flex; gap: 7px; flex-wrap: wrap; margin: -2px 0 14px; }
.settings-subnav-link {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); background: #fff; font-size: 13px; font-weight: 600;
}
.settings-subnav-link:hover { text-decoration: none; background: #f8fafc; }
.settings-subnav-link.active { color: var(--primary); border-color: #b7c8f7; background: var(--primary-soft); }
.settings-diagnostics { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.settings-diagnostics > summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; }

.validity-progress-card { background: #fff; }
.validity-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.validity-progress-track { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #edf0f3; }
.validity-progress-track span { display: block; height: 100%; border-radius: inherit; background: #16a34a; transition: width .2s ease; }
.validity-filter-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.validity-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.validity-card-head h3 { margin-bottom: 4px; }
.validity-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.validity-video-card { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe; }
.validity-video-frame { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.validity-video { width: 240px; max-width: 100%; max-height: 210px; border-radius: 8px; background: #111827; }
.validity-video-card img, .validity-thumb-placeholder { width: 100%; height: 170px; object-fit: cover; display: block; border-radius: 8px; background: #eef1f4; }
.validity-thumb-placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.validity-media-placeholder, .validity-video-fallback { padding: 5px 8px; border-radius: 6px; background: #fff7ed; color: #9a3412; font-size: 12px; text-align: center; }
.validity-original-link { margin-top: 6px; }
.validity-video-card h4 { margin: 6px 0 0; font-size: 14px; line-height: 1.4; }
.validity-ai-reason { margin: 12px 0; padding: 9px 11px; border: 1px solid #e5e1d9; border-radius: 8px; background: #fcfbf8; }
.validity-ai-reason summary { cursor: pointer; font-weight: 700; }
.validity-ai-reason p { margin: 8px 0 0; white-space: pre-wrap; }
.validity-human-reason { display: grid; gap: 5px; margin: 10px 0; }
.validity-human-reason textarea { width: 100%; resize: vertical; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.validity-verdict-actions { margin-top: 12px; }
.validity-annotated-list > summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.validity-metrics .stat-grid { margin-bottom: 14px; }
.validity-matrix-table { max-width: 620px; }
.validity-metric-lines { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; font-size: 13px; }
.validity-mismatches { margin-top: 12px; }
.validity-mismatches > summary { cursor: pointer; font-weight: 700; }
.validity-mismatch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.validity-mismatch > div { flex-basis: 100%; }
.settings-diagnostics > .card { margin-top: 10px; }

.btn {
  display: inline-block; padding: 6px 12px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
  cursor: pointer; line-height: 1.35;
}
.btn:hover { border-color: #c3cad3; background: #f8fafc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #15803d; border-color: #15803d; color: #fff; }
.btn-success:hover { background: #166534; }
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 3px 8px; font-size: 12px; border-radius: 5px; }
.btn-danger-ghost { color: var(--dead); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; border-color: var(--border); }
.btn-primary:disabled:hover { background: var(--primary); border-color: var(--primary); }

.app { max-width: 1520px; margin: 0 auto; padding: 16px 18px 60px; }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 2px 0 12px; }
.page-head h2 { margin: 0; font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat-card .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-card .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
/* Phase 19B：Seed 卡片信息方块（文本型数值用小号字，红绿灯点用统一尺寸） */
.stat-card .num.sm { font-size: 15px; font-weight: 700; line-height: 1.3; margin-top: 3px; }
.stat-card .num.sm .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.num-craw { color: #6b7280; }
.num-cwatch { color: #b45309; }
.num-ccandidate { color: #2563eb; }
.num-breakout { color: #ea580c; }
.num-rising { color: #16a34a; }
.num-watch { color: #d97706; }
.num-dead { color: #dc2626; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-input {
  padding: 6px 9px; font-size: 13px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text);
}
.filter-input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.table-wrap { overflow-x: auto; padding: 0; }
table.dense { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dense th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 8px 9px; border-bottom: 1px solid var(--border);
  background: #fafbfc; white-space: nowrap;
}
table.dense td { padding: 7px 9px; border-bottom: 1px solid #eef1f4; vertical-align: middle; white-space: nowrap; }
table.dense tbody tr:hover { background: #f8fafc; }
table.dense tr:last-child td { border-bottom: 0; }
.wrap-col { white-space: normal !important; min-width: 180px; max-width: 340px; }
.ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

.discovery-pool-card .discovery-table-wrap {
  width: 100%; max-width: 100%; overflow-x: hidden;
}
.discovery-observation-table {
  width: 100%; min-width: 0; table-layout: fixed;
}
.discovery-observation-table th,
.discovery-observation-table td {
  min-width: 0; padding: 6px 8px; font-size: 12px; overflow: hidden;
}
.discovery-observation-table .obs-col-check { width: 40px; }
.discovery-observation-table .obs-col-trend { width: 25%; }
.discovery-observation-table .obs-col-metrics { width: 128px; }
.discovery-observation-table .obs-col-published { width: 96px; }
.discovery-observation-table .obs-col-badges { width: 96px; }
.discovery-observation-table .obs-col-potential { width: 104px; }
.discovery-observation-table .obs-col-trend-status { width: 132px; }
.discovery-observation-table .obs-col-captured { width: 72px; }
.discovery-observation-table .obs-col-actions { width: 160px; }
.discovery-observation-table tbody tr.row-reviewed-owner { background: #fdf4f6; }
.discovery-observation-table tbody tr.row-reviewed-assistant { background: #f3f8fb; }
.discovery-observation-table tbody tr.row-reviewed-both {
  background: linear-gradient(90deg, #fdf4f6 50%, #f3f8fb 50%);
}
.discovery-observation-table tbody tr.row-reviewed-other { opacity: 0.85; }
.discovery-observation-table tbody tr.row-reviewed-owner td,
.discovery-observation-table tbody tr.row-reviewed-assistant td,
.discovery-observation-table tbody tr.row-reviewed-both td { color: #555; }
.discovery-observation-table tbody tr.row-reviewed-owner .badge,
.discovery-observation-table tbody tr.row-reviewed-assistant .badge,
.discovery-observation-table tbody tr.row-reviewed-both .badge { opacity: 0.8; }
.discovery-observation-table tbody tr.row-reviewed-owner:hover { background: #fbe9ed; }
.discovery-observation-table tbody tr.row-reviewed-assistant:hover { background: #e9f3f8; }
.discovery-observation-table tbody tr.row-reviewed-both:hover {
  background: linear-gradient(90deg, #fbe9ed 50%, #e9f3f8 50%);
}
.discovery-observation-table tbody tr.obs-attached-evidence {
  box-shadow: inset 3px 0 0 #16a34a;
}
.obs-trend-cell { min-width: 0; white-space: normal; }
.obs-trend-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.obs-trend-title img { width: 32px !important; height: 32px !important; flex-basis: 32px !important; }
.obs-trend-title strong { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-trend-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-metrics, .obs-published, .obs-captured { display: inline-block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; vertical-align: middle; }
.obs-score-trend { white-space: normal; line-height: 1.45; }
.discovery-observation-table .obs-growth-periods { white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.discovery-observation-table .obs-icon-actions { flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.discovery-observation-table .obs-action-icon {
  width: 28px; height: 28px; flex-basis: 28px; font-size: 15px;
}
.discovery-source-mode { margin: -4px 0 12px; }
.obs-action-icon {
  width: 28px; height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 28px; font-size: 16px; line-height: 1; border-radius: 6px;
}
.obs-action-icon:disabled { opacity: .38; cursor: not-allowed; }
.obs-action-primary { color: var(--primary); }
.obs-action-remove { color: #b91c1c; border-color: #fecaca; }
.obs-action-reviewed { color: #15803d; font-weight: 800; }
.obs-action-reviewed.is-reviewed { color: #6b7280; background: #f3f4f6; }
.obs-action-attach { color: #0f766e; border-color: #99f6e4; }
.obs-review-toolbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin: 4px 0 8px; padding: 7px 10px; border: 1px solid #dbeafe;
  border-radius: 8px; background: #eff6ff; color: #1e40af; font-size: 12px;
}
.obs-review-toolbar[hidden] { display: none; }
body.obs-drag-selecting { user-select: none; }
.obs-cleanup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.obs-cleanup-preview { white-space: nowrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; margin-right: 4px; }
.pool-raw { background: #e5e7eb; color: #374151; }
.pool-watch { background: #fef3c7; color: #92400e; }
.pool-candidate { background: #dbeafe; color: #1d4ed8; }
.status-dead { background: #fee2e2; color: #b91c1c; }
.status-watch { background: #fef3c7; color: #92400e; }
.status-rising { background: #dcfce7; color: #15803d; }
.status-steady { background: #dbeafe; color: #1d4ed8; }
.ev-badge-human-confirmed { background: #ffedd5; color: #c2410c; }
.status-breakout { background: #ffedd5; color: #c2410c; }
.lifecycle-rejected { background: #f3f4f6; color: #6b7280; border: 1px dashed #9ca3af; }
.late { background: #fff7ed; color: #ea580c; border: 1px solid #fdba74; }
.selected-badge { background: #e0e7ff; color: #4338ca; }

.score-up { color: var(--rising); font-weight: 700; }
.score-down { color: var(--dead); font-weight: 700; }
.score-flat { color: var(--muted); }

.actions { display: flex; gap: 5px; flex-wrap: wrap; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow: auto;
}
.modal { background: #fff; border-radius: 12px; width: min(880px, 96vw); padding: 18px 20px; box-shadow: 0 20px 60px rgba(15,23,42,.25); }
.modal-wide { width: min(1100px, 97vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 7px 9px; font-size: 13px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text); font-family: inherit;
}
.field textarea { min-height: 54px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

.metric-block { padding: 10px 0; border-bottom: 1px solid #eef1f4; }
.metric-block:last-of-type { border-bottom: 0; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.metric-name { font-weight: 700; font-size: 13px; }
.metric-weight { font-size: 11px; color: var(--muted); }
.radio-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: flex; flex-direction: column; align-items: center; min-width: 76px;
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px 5px; cursor: pointer; background: #fff;
}
.pill span b { font-size: 15px; line-height: 1.2; }
.pill span small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.pill.on span { border-color: var(--primary); background: var(--primary-soft); }
.pill.on span small { color: var(--primary); }
.pill.on span b { color: var(--primary); }

.score-total {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--primary-soft); border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
}
.score-total .big { font-size: 26px; font-weight: 800; color: var(--primary); }
.score-total .hint2 { font-size: 12px; color: #1e40af; }

.rec-box { border: 1px solid #d9f99d; background: #f7fee7; border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.rec-box strong { color: #3f6212; }
.rec-box.reject { border-color: #fecaca; background: #fef2f2; }
.rec-box.reject strong { color: #991b1b; }
.rec-box.keep { border-color: #fde68a; background: #fffbeb; }
.rec-box.keep strong { color: #92400e; }
.action-radio { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.action-radio label {
  flex: 1; min-width: 150px; border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px;
  cursor: pointer; font-size: 13px; display: flex; gap: 7px; align-items: center;
}
.action-radio label.on { border-color: var(--primary); background: var(--primary-soft); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; }
.info-item .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.info-item .v { font-size: 13.5px; font-weight: 600; word-break: break-word; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 20px; font-weight: 800; margin-top: 2px; }
.notice { border-radius: 8px; padding: 10px 13px; font-size: 13px; margin-bottom: 12px; }
.notice.warn { background: #fefce8; border: 1px solid #fde68a; color: #854d0e; }
.notice.danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.workspace-skeleton { display: grid; gap: 14px; width: 100%; }
.skeleton-loading-label { margin-top: -6px; color: #7d766c; font-size: 12px; }
.skeleton-page-title, .skeleton-toolbar, .skeleton-card, .skeleton-panel {
  position: relative;
  overflow: hidden;
  background: #eee9df;
  border: 1px solid #e4ded3;
}
.skeleton-page-title::after, .skeleton-toolbar::after, .skeleton-card::after, .skeleton-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .68), transparent);
  animation: skeleton-sweep 1.35s ease-in-out infinite;
}
.skeleton-page-title { width: min(360px, 72%); height: 30px; border-radius: 8px; }
.skeleton-toolbar { height: 54px; border-radius: 10px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.skeleton-card { height: 132px; border-radius: 12px; }
.skeleton-panel { height: 260px; border-radius: 12px; }
@keyframes skeleton-sweep {
  to { transform: translateX(100%); }
}
@media (max-width: 900px) {
  .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .skeleton-grid { grid-template-columns: 1fr; }
  .skeleton-card { height: 104px; }
  .skeleton-panel { height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-page-title::after, .skeleton-toolbar::after, .skeleton-card::after, .skeleton-panel::after {
    animation: none;
  }
}

[data-action-busy="1"] {
  cursor: wait !important;
  opacity: .62;
  pointer-events: none;
}
.btn.action-busy::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: action-spin .7s linear infinite;
}
.route-more-card { padding: 10px 14px; }
.route-more-card .actions { justify-content: center; }
@keyframes action-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.action-busy::after { animation: none; }
}

.discovery-integrity-card > summary { cursor: pointer; }
.integrity-grid { display: grid; gap: 10px; margin-top: 10px; }
.integrity-platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e7e0d6;
  border-radius: 8px;
  background: #fcfbf8;
}
.integrity-platform .actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 760px) {
  .integrity-platform { align-items: flex-start; flex-direction: column; }
}
.after-sales-alert {
  width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer;
  border: 1px solid #f4c430; border-radius: 9px; background: #fff8d8; color: #654b00;
  padding: 10px 13px; margin: 0 0 12px; font: inherit;
}
.after-sales-alert:hover { background: #fff2b8; }
.after-sales-alert-icon { font-size: 16px; }
.after-sales-alert strong { flex: 1; }

.timeline { margin: 0; padding: 4px 0 4px 4px; }
.tl-item { display: flex; gap: 10px; padding-bottom: 12px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: #e5e7eb; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px; margin-top: 2px; border: 2px solid #fff; box-shadow: 0 0 0 2px #d1d5db; }
.tl-dot.tl-raw { background: #9ca3af; }
.tl-dot.tl-watch { background: #f59e0b; }
.tl-dot.tl-candidate { background: #2563eb; }
.tl-dot.tl-score { background: #0d9488; }
.tl-dot.tl-status-breakout { background: #ea580c; }
.tl-dot.tl-status-rising { background: #16a34a; }
.tl-dot.tl-status-watch { background: #f59e0b; }
.tl-dot.tl-status-dead { background: #dc2626; }
.tl-date { font-size: 11px; color: var(--muted); font-weight: 600; }
.tl-title { font-size: 13px; font-weight: 600; }
.tl-detail { font-size: 12px; color: var(--muted); }

.score-chart { width: 100%; height: auto; }
.chart-line { fill: none; stroke: #2563eb; stroke-width: 2.2; }
.chart-dot { fill: #2563eb; stroke: #fff; stroke-width: 1.5; }
.chart-value { font-size: 10.5px; fill: #374151; font-weight: 600; }
.axis-label { font-size: 11px; fill: #6b7280; }
.grid { stroke: #e5e7eb; stroke-width: 1; }
.spark-line { fill: none; stroke: #2563eb; stroke-width: 1.6; }
.spark-dot { fill: #2563eb; }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 13px; }

#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #111827; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast-error { background: #b91c1c; }

/* ===== V2: sync pill, highlights, login, quick actions ===== */
.sync-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.sync-synced { background: #dcfce7; color: #15803d; }
.sync-saving { background: #dbeafe; color: #1d4ed8; }
.sync-offline { background: #fee2e2; color: #b91c1c; }
.sync-reconnecting { background: #fef3c7; color: #92400e; }
.sync-idle { background: #f3f4f6; color: #6b7280; }

.hl-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); vertical-align: baseline; }
.hl-yellow { background: #facc15; }
.hl-blue { background: #3b82f6; }
.hl-green { background: #22c55e; }
.hl-orange { background: #f97316; }
.hl-red { background: #ef4444; }
.hl-purple { background: #a855f7; }
tr.hl-yellow, .card.hl-yellow, .tl-dot.hl-yellow { border-left: 4px solid #facc15; }
tr.hl-blue, .card.hl-blue { border-left: 4px solid #3b82f6; }
tr.hl-green, .card.hl-green { border-left: 4px solid #22c55e; }
tr.hl-orange, .card.hl-orange { border-left: 4px solid #f97316; }
tr.hl-red, .card.hl-red { border-left: 4px solid #ef4444; }
tr.hl-purple, .card.hl-purple { border-left: 4px solid #a855f7; }

.login-card { max-width: 520px; margin: 40px auto; }
.quick-actions { gap: 8px; }
.obs-note summary { cursor: pointer; color: var(--primary); font-size: 12px; }
.obs-note .wrap-col { margin-top: 4px; white-space: normal; }
.obs-change { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }

/* ===== Phase 2: Cluster Workspace (Morandi palette) ===== */
.cluster-card { border-left-width: 6px; }
.morandi-0 { background: #f4f1ee; border-color: #d8d2c8; border-left-color: #a8a29e; }
.morandi-1 { background: #f2f1ee; border-color: #dcd5c8; border-left-color: #b8a99a; }
.morandi-2 { background: #eef1f0; border-color: #cfdbd6; border-left-color: #8fa8a0; }
.morandi-3 { background: #f1f0f2; border-color: #d8d2e0; border-left-color: #a49cb8; }
.morandi-4 { background: #f2f0ee; border-color: #dcd2cc; border-left-color: #b39a8f; }
.morandi-5 { background: #eef0f1; border-color: #cfd6da; border-left-color: #8fa0a8; }
.cluster-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.cluster-head h3 { margin: 0; font-size: 16px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.video-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff;
  display: flex; flex-direction: column; gap: 4px;
}
.video-card .video-title { font-weight: 700; font-size: 13px; }
.related-box { border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }

/* ===== Phase 7 unified video viewer ===== */
.video-viewer { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 16px; }
.video-viewer-player { min-width: 0; }
.video-viewer-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.video-viewer-title { font-size: 15px; font-weight: 800; }
.player-frame { position: relative; width: 100%; background: #0f172a; border-radius: 10px; overflow: hidden; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.video-loading {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(15, 23, 42, .88); font-size: 13px; pointer-events: none;
}
.video-load-error {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px; padding: 20px; color: #fee2e2; background: #111827; text-align: center;
}
.video-load-error[hidden], .video-loading[hidden], .player-frame video[hidden] { display: none; }
.xhs-carousel { position: relative; border-radius: 12px; overflow: hidden; background: #111827; }
.xhs-carousel-viewport { position: relative; min-height: 320px; display: flex; align-items: center; justify-content: center; }
.xhs-carousel-slide { display: none; width: 100%; margin: 0; }
.xhs-carousel-slide.active { display: flex; align-items: center; justify-content: center; }
.xhs-carousel-slide img { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; cursor: zoom-in; }
.xhs-carousel-nav {
  position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 36px; height: 48px;
  border: 0; border-radius: 8px; background: rgba(17, 24, 39, .72); color: #fff; font-size: 28px; cursor: pointer;
}
.xhs-carousel-prev { left: 8px; }
.xhs-carousel-next { right: 8px; }
.xhs-carousel-count { position: absolute; right: 10px; bottom: 10px; padding: 3px 8px; border-radius: 999px; background: rgba(17, 24, 39, .72); color: #fff; font-size: 11px; }
.xhs-carousel-lightbox {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 30px; background: rgba(0, 0, 0, .9);
}
.xhs-carousel-lightbox[hidden] { display: none; }
.xhs-carousel-lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.xhs-carousel-lightbox-close {
  position: absolute; top: 16px; right: 20px; border: 0; background: transparent; color: #fff; font-size: 34px; cursor: pointer;
}
.evidence-manual-seed-panel > summary { cursor: pointer; font-size: 15px; }
.evidence-manual-seed-panel[open] > summary { margin-bottom: 12px; }
.manual-seed-url-row { display: flex; gap: 8px; align-items: center; }
.manual-seed-url-row .filter-input { flex: 1; min-width: 220px; }
.manual-seed-status { min-height: 18px; margin-top: 8px; color: #4b5563; font-size: 12px; }
.manual-seed-preview { margin-top: 10px; }
.manual-seed-preview-card {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  border: 1px solid #d8e1ea; border-radius: 10px; background: #f8fafc;
}
.manual-seed-preview-card > img {
  width: 96px; height: 72px; object-fit: cover; flex: 0 0 96px;
  border-radius: 8px; background: #e5e7eb;
}
.manual-seed-preview-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.manual-seed-preview-copy > strong { color: #1f2937; font-size: 15px; overflow-wrap: anywhere; }
.manual-seed-preview-copy .actions { margin-top: 5px; }
.seed-source-metrics {
  display: flex; flex-wrap: wrap; gap: 7px 16px; margin: 4px 0 10px;
  padding: 7px 9px; border-radius: 7px; background: #f7f4ee; color: #4b453d; font-size: 12px;
}
.seed-source-metrics b { color: #756b5e; font-size: 10px; letter-spacing: .04em; margin-right: 3px; }
.manual-seed-status:not(:empty) { padding: 7px 10px; border-radius: 7px; background: #f3f4f6; }
@media (max-width: 640px) {
  .manual-seed-url-row { align-items: stretch; flex-direction: column; }
}
.discovery-sources-card { padding-bottom: 12px; }
.discovery-sources-note { margin: -4px 0 10px; }
.discovery-source-table th, .discovery-source-table td { vertical-align: middle; }
.discovery-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.discovery-summary-card { display: flex; align-items: center; gap: 12px; min-height: 86px; }
.discovery-summary-icon { font-size: 25px; line-height: 1; }
.discovery-summary-subtext { margin-top: 3px; color: #4b5563; font-size: 11px; white-space: nowrap; }
.discovery-summary-today { background: #e8f5e9; border-color: #c8e6c9; }
.discovery-summary-platforms { background: #e3f2fd; border-color: #bbdefb; }
.discovery-summary-pool { background: #fce4ec; border-color: #f8bbd0; }
.discovery-radar-card { padding-bottom: 12px; background: #fff; border: 1px solid #e0e0e0; }
.discovery-radar-table td { font-variant-numeric: tabular-nums; }
.discovery-radar-table td:not(:first-child) { text-align: center; }
.radar-platform { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700; }
.radar-platform.platform-douyin { background: #7f1d1d; }
.radar-platform.platform-xiaohongshu { background: #ff2442; }
.radar-platform.platform-bilibili { background: #00a1d6; }
.radar-auto-note { display: inline-block; margin-left: 7px; color: #6b7280; font-size: 11px; }
.discovery-radar-note { margin-top: 7px; }
.discovery-radar-empty { padding: 18px 10px; color: #6b7280; text-align: center; }
@media (max-width: 760px) {
  .discovery-summary-grid { grid-template-columns: 1fr; }
}
.aspect-landscape { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 9 / 16; max-height: 74vh; }
.aspect-responsive { aspect-ratio: 4 / 3; max-height: 74vh; }
.video-preview { width: 100%; border-radius: 10px; overflow: hidden; background: #eef0f3; display: flex; align-items: center; justify-content: center; min-height: 200px; }
.video-preview img { width: 100%; display: block; }
.video-preview-note { text-align: center; font-size: 11px; color: var(--muted); padding: 6px; }
.video-placeholder { flex-direction: column; gap: 6px; font-size: 30px; color: #b8bfc8; }
.player-fallback { margin-top: 6px; font-size: 12px; }
.source-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; width: fit-content; }
.source-badge.src-manual { background: #ffedd5; color: #9a3412; }
.source-badge.src-scan { background: #e0e7ff; color: #3730a3; }
.source-badge.src-anomaly { background: #fee2e2; color: #991b1b; }
.source-badge.src-monitor { background: #dcfce7; color: #166534; }
.source-badge.src-rank { background: #fef9c3; color: #854d0e; }
.video-viewer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.info-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; border-bottom: 1px dashed var(--border); padding: 3px 0; }
.info-line span { color: var(--muted); }
.scan-items-row td { background: #fafbfc; }

@media (max-width: 820px) {
  .video-grid { grid-template-columns: 1fr; }
  .video-viewer { grid-template-columns: 1fr; }
  .aspect-portrait { max-height: 78vh; }
  .aspect-responsive { max-height: 60vh; }
}

/* ===== Phase 4 dashboard redesign ===== */
.health-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.health-card {
  min-width: 0; background: #fff; border: 1px solid var(--border); border-top: 3px solid #16a34a;
  border-radius: 10px; padding: 10px 12px; box-shadow: 0 2px 8px rgba(90, 80, 70, .05);
}
.health-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #6f685f; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.health-card-head b { flex: 0 0 auto; border-radius: 999px; padding: 2px 7px; font-size: 10px; background: #f3f4f6; color: #6b7280; }
.health-value { margin-top: 6px; color: #34302b; font-size: 17px; font-weight: 850; line-height: 1.2; overflow-wrap: anywhere; }
.health-meta { margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.health-ok { border-top-color: #16a34a; }
.health-ok .health-card-head b { background: #dcfce7; color: #166534; }
.health-card-seeds { border-color: #cce5d5; border-top-color: #16a34a; background: #f7fcf8; }
.health-card-seeds .health-card-head b { background: #dcfce7; color: #166534; }
.health-card-ready { border-color: #ddd0f2; border-top-color: #7c3aed; background: #fbf8ff; }
.health-card-ready .health-card-head b { background: #ede9fe; color: #6d28d9; }
.health-warning { border-top-color: #d97706; background: #fffdf5; }
.health-warning .health-card-head b { background: #fef3c7; color: #92400e; }
.health-critical { border-top-color: #dc2626; background: #fffafa; }
.health-critical .health-card-head b { background: #fee2e2; color: #b91c1c; }
.health-insufficient { border-top-color: #9ca3af; background: #fafafa; }
.health-insufficient .health-card-head b { background: #e5e7eb; color: #4b5563; }
.health-unavailable, .health-loading { border-top-color: #9ca3af; background: #fafafa; }
.health-unavailable .health-value, .health-loading .health-value { color: #7d766c; font-size: 14px; }
.health-unavailable .health-card-head b, .health-loading .health-card-head b { background: #e5e7eb; color: #4b5563; }
.cost-monitor { margin: 0 0 12px; }
.cost-monitor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #6f685f; font-size: 11px; letter-spacing: .06em; }
.cost-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cost-card { background: #fff; border: 1px solid var(--border); border-top: 3px solid #16a34a; border-radius: 10px; padding: 10px 12px; min-width: 0; }
.cost-card.cost-yellow { border-top-color: #d97706; background: #fffdf5; }
.cost-card.cost-red { border-top-color: #dc2626; background: #fffafa; }
.cost-card.cost-critical { animation: costPulse 1.4s ease-in-out infinite; }
.cost-label { color: #746d64; font-size: 11px; font-weight: 750; }
.cost-value { color: #34302b; font-size: 18px; font-weight: 850; margin-top: 5px; }
.cost-today { color: #34302b; font-size: 24px; font-weight: 850; margin-top: 4px; }
.cost-progress { height: 7px; background: #eee9e2; border-radius: 999px; overflow: hidden; margin-top: 7px; }
.cost-progress i { display: block; height: 100%; border-radius: inherit; background: #16a34a; }
.cost-progress i.cost-yellow { background: #d97706; }
.cost-progress i.cost-red { background: #dc2626; }
.cost-meta { color: var(--muted); font-size: 10.5px; margin-top: 5px; }
.cost-spark { display: block; width: 100%; height: 70px; margin-top: 2px; }
.cost-alert { margin-bottom: 8px; }
@keyframes costPulse { 0%, 100% { box-shadow: 0 0 0 rgba(220, 38, 38, 0); } 50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); } }
@media (max-width: 820px) { .cost-grid { grid-template-columns: 1fr; } }
@media (max-width: 1050px) {
  .health-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .health-bar { grid-template-columns: 1fr; }
}
.dash-hero { background: #f6f4f1; border: 1px solid #e3ddd4; border-radius: 14px; padding: 18px 20px 14px; margin-bottom: 12px; }
.dash-title { font-size: 22px; font-weight: 800; letter-spacing: .14em; color: #5f5a52; }
.dash-sub { font-size: 12px; color: #9a9287; margin-top: 2px; }
.dash-date { font-size: 12px; color: #9a9287; margin-top: 2px; }
.dash-monitor { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 8px; }
.dash-monitor .mon-cell { display: inline-flex; align-items: center; gap: 5px; }
.dash-monitor .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: #16a34a; }
.dot-bad { background: #dc2626; }
.dot-warn { background: #d97706; }
.dot-teal { background: #14b8a6; }
.dash-ai { margin-top: 10px; border-top: 1px solid #e3ddd4; padding-top: 8px; }
.dash-ai .ai-head { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: #7d766c; margin-bottom: 6px; }
.dash-ai .ai-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.dash-ai .ai-platform { width: 74px; font-size: 12px; font-weight: 700; color: #4b453d; }
.dash-ai .ai-steps { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.dash-ai .ai-step { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #7d766c; }
.dash-ai .ai-step .dot { width: 7px; height: 7px; }
.dash-ai .ai-step.ok { color: #166534; }
.dash-ai .ai-step.bad { color: #b91c1c; }
.dash-ai .ai-foot { margin-top: 5px; font-size: 10px; color: #9a9287; }
.dash-ai .ai-fail { margin-top: 4px; font-size: 12px; color: #b91c1c; }
.dash-ai .ai-fail .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.intel-pipeline { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; margin: 10px 0 14px; }
.pipe-node { flex: 1 1 90px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 6px; text-align: center; }
.pipe-num { font-size: 20px; font-weight: 800; color: var(--text); }
.pipe-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.pipe-arrow { align-self: center; color: #c2b9ae; font-weight: 700; }
.intel-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.metric-node { flex: 1 1 110px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.cluster-tier-card {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.cluster-tier-card:hover,
.cluster-tier-card:focus-visible {
  transform: translateY(-1px);
  border-color: #9b9184;
  box-shadow: 0 5px 14px rgba(70, 62, 52, 0.1);
  outline: none;
}
.cluster-tier-card.tier-hot { border-top: 3px solid #c2410c; }
.cluster-tier-card.tier-warm { border-top: 3px solid #b45309; }
.cluster-tier-card.tier-cold { border-top: 3px solid #1d4ed8; }
.cluster-tier-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.cluster-tier-progress { height: 5px; margin: 7px 0 5px; overflow: hidden; border-radius: 999px; background: #eee9e1; }
.cluster-tier-progress i { display: block; height: 100%; border-radius: inherit; background: currentColor; opacity: 0.65; }
.cluster-tier-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cluster-filter-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #625b52;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
}
.cluster-filter-chip:hover,
.cluster-filter-chip.active { border-color: #7f7468; background: #f3efe8; color: #2f2a24; }
button.cluster-tier-filter {
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
button.cluster-tier-filter.active { box-shadow: inset 0 0 0 2px currentColor; }
.discovery-report-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 12px;
  color: #625b52;
  font-size: 13px;
}
.discovery-report-line strong { color: #2f2a24; }
.discovery-engine-line { display: inline-flex; align-items: center; gap: 6px; }
.metric-num { font-size: 18px; font-weight: 800; color: var(--text); }
.metric-label { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.dash-flow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: 12px; color: #7d766c; }
.dash-flow span { font-weight: 700; }
.dash-flow i { color: #b8afa3; font-style: normal; }
.need-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* Need Action */
.need-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.need-item {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff;
  font-size: 13px; color: var(--text);
}
.need-item:hover { border-color: #c3cad3; background: #f8fafc; }
.need-item small { color: var(--muted); font-size: 11px; }
.need-item .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.dot-red { background: #c97b7b; }
.dot-orange { background: #d29a6b; }
.dot-yellow { background: #cbb06a; }
.dot-blue { background: #7f9fb5; }

@media (max-width: 820px) {
  .need-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .dash-title { font-size: 18px; }
}

@media (max-width: 820px) {
  .nav { overflow-x: auto; justify-content: flex-start; }
  .nav-item { flex: 0 0 auto; min-width: 62px; }
  .quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .quick-actions .btn { width: 100%; }
}

@media (max-width: 1100px) {
  .form-grid { grid-template-columns: 1fr; }
  .app { padding: 12px; }
}

/* ===== Mobile app mode (<= 820px) ===== */
@media (max-width: 820px) {
  body { font-size: 14px; }
  .topbar { padding: 8px 10px; gap: 8px; position: static; }
  .brand .logo { font-size: 19px; }
  .brand h1 { font-size: 15px; }
  .tagline { display: none; }
  .topbar-actions {
    width: 100%;
    order: 4;
    justify-content: flex-start;
    margin-left: 0;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions .btn { white-space: nowrap; padding: 7px 11px; }

  /* bottom app navigation */
  .nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid var(--border);
    border-radius: 0;
    justify-content: flex-start;
    gap: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 14px rgba(15, 23, 42, .06);
    -webkit-overflow-scrolling: touch;
  }
  .nav-item { flex: 0 0 auto; min-width: 72px; text-align: center; padding: 8px 6px; font-size: 11px; border-radius: 8px; line-height: 1.25; }
  .app { padding: 10px 10px calc(78px + env(safe-area-inset-bottom, 0px)); }

  /* dense tables -> card list */
  table.dense thead { display: none; }
  table.dense, table.dense tbody { display: block; width: 100%; }
  table.dense tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 0 0 12px;
    padding: 6px 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  }
  table.dense td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dashed #eef1f4;
    padding: 8px 0;
    white-space: normal;
    text-align: right;
  }
  table.dense td:last-child { border-bottom: 0; }
  table.dense td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 42%;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    text-align: left;
  }
  table.dense td[data-label=""]::before { display: none; }
  table.dense td .actions { justify-content: flex-end; }
  .discovery-observation-table .obs-icon-actions { justify-content: flex-end; margin-top: 2px; }
  .discovery-observation-table .obs-trend-cell { max-width: 100%; }
  .obs-cleanup { width: 100%; margin-left: 0; }
  .obs-cleanup-preview { white-space: normal; }
.discovery-observation-table tr.obs-blacklisted { opacity: 0.48; background: #f6f2ed; }
.obs-action-icon.obs-vote-active { border-color: #b98a45; background: #fff4dc; }
.obs-badge-stack { display: flex; flex-wrap: wrap; gap: 4px; }
.discovery-potential { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.discovery-potential strong { color: #3f3a35; font-size: 15px; }
.discovery-potential-badge { white-space: nowrap; }
.discovery-potential-badge.potential-rising_potential { background: #fff1e6; color: #b45309; border: 1px solid #fdba74; }
.discovery-potential-badge.potential-burst_heat { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.discovery-potential-badge.potential-worth_watching { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge.obs-viral-badge { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge.obs-low-follower-badge { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge.obs-high-engagement-badge { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.badge.status-accumulating,
.badge.obs-trend-unknown { background: #f0f0f0; color: #666; border: 1px solid #d9d9d9; }
.obs-trend-status { display: flex; flex-direction: column; gap: 3px; }
  .validity-pair { grid-template-columns: 1fr; }
  .validity-video-frame { min-height: 210px; }
  .validity-video-card img, .validity-thumb-placeholder { height: 210px; }
  .ellipsis { max-width: none; }
  .wrap-col { max-width: none; }
  .card { padding: 12px; }
  .card h3 { font-size: 12px; }

  /* touch-friendly controls */
  .btn { padding: 8px 13px; font-size: 13px; }
  .btn-sm { padding: 7px 10px; font-size: 12.5px; border-radius: 7px; }
  .filter-bar { gap: 7px; }
  .filter-input { padding: 8px 10px; font-size: 14px; min-height: 38px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-card .num { font-size: 22px; }

  .modal { padding: 14px; }
  .modal-overlay { padding: 12px 8px; align-items: stretch; }
  .pill span { min-width: 60px; padding: 7px 6px 6px; }
  .action-radio label { min-width: 100%; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }

  .score-total { position: static; }
  .page-head { align-items: flex-start; }
  .page-head h2 { font-size: 17px; }
  .top10-note { font-size: 11px; }

}

/* ===== AI Pre-Cluster Suggestions（低饱和 Morandi，AI 建议 ≠ 正式 Cluster） ===== */
.pc-card { background: linear-gradient(135deg, rgba(233, 228, 244, .25), rgba(250, 250, 252, .6)); }
.pc-map { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pc-level { display: flex; flex-direction: column; gap: 6px; }
.pc-down { text-align: center; color: #b8afa3; font-weight: 800; font-size: 16px; line-height: 1; }
.pc-root-node, .pc-seed, .pc-evidence { background: rgba(255, 255, 255, .7); border: 1px dashed #c4b6dc; border-radius: 12px; padding: 10px 12px; }
.pc-hypothesis { font-size: 15px; font-weight: 800; color: #4b453d; }
.pc-level-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: #9a9287; text-transform: uppercase; }
.pc-seeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.pc-seed summary { cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.pc-seed summary::-webkit-details-marker { display: none; }
.pc-seed[open] { border-style: solid; border-color: #a99cc8; }
.pc-seed-title { font-weight: 700; color: #5f5a52; }
.pc-seed-head { border-bottom: 1px dashed rgba(120, 110, 100, .2); padding-bottom: 8px; margin-bottom: 8px; }
.pc-seed-head:hover { background: rgba(233, 228, 244, .18); }
.pc-evidence-wrap, .pc-evidence-list { display: flex; flex-direction: column; gap: 6px; }
.pc-evidence { border-color: #d7e6dd; background: rgba(240, 248, 244, .65); }
.pc-ev-count { color: #6f685f; }
.pc-evidence .pc-evidence-note { font-size: 11px; color: #8a8177; }
.pc-creators { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-creator { background: #eef0f4; color: #6f685f; border: 1px solid #dde1e8; font-weight: 600; }
.pc-card .cluster-head { margin-bottom: 6px; }

@media (max-width: 720px) {
  .pc-seeds { grid-template-columns: 1fr; }
}

/* ===== Candidate Phase B ===== */
.cand-stopped, .cand-archived { background: #f1f1f0; filter: saturate(.55); }
.cand-stopped .cluster-head, .cand-archived .cluster-head { opacity: .85; }
.cand-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.cand-controls textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font: inherit; }
.cand-lifecycle-stop, .cand-lifecycle-archive { border-color: #b7aca1; color: #7c7166; background: #f6f4f1; }
.cand-lifecycle-resume { border-color: #a9c9c7; color: #48716e; background: #f0f7f6; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.report-chart-card { background: #fff; }
.report-chart { width: 100%; height: auto; }
.report-chart .grid { stroke: #ece9e4; stroke-width: 1; }
.report-chart .axis-label { font-size: 10px; fill: #9a9287; }
.report-chart .chart-value { font-size: 10px; fill: #8a8177; }
.rep-line { stroke: #7f9fb5; fill: none; stroke-width: 2; }
.rep-scheduled { fill: #7f9fb5; }
.rep-manual { fill: #d29a6b; }
.score-evo-line { stroke: #7fa89b; fill: none; stroke-width: 2; }
.score-evo-dot { fill: #7fa89b; }
.legend { font-size: 11px; color: #6f685f; margin: 4px 0 8px; display: flex; gap: 14px; align-items: center; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.legend-dot.scheduled { background: #7f9fb5; }
.legend-dot.manual { background: #d29a6b; border-radius: 0; transform: rotate(45deg); width: 8px; height: 8px; }
.seed-group.fam-0 { background: linear-gradient(135deg, #e7f0e8, #f4f9f4); border-color: #b9d3c0; }
.seed-group.fam-1 { background: linear-gradient(135deg, #f4e9df, #fbf4ee); border-color: #d9bfa7; }
.seed-group.fam-2 { background: linear-gradient(135deg, #ece9f3, #f6f4fa); border-color: #c4b6dc; }
.seed-group.fam-3 { background: linear-gradient(135deg, #e7f0ef, #f4faf9); border-color: #a9c9c7; }
.seed-group .related-box.fam-0 { background: #e9f2ea; border-color: #c3d7c7; }
.seed-group .related-box.fam-1 { background: #f6ecdf; border-color: #e0c7ad; }
.seed-group .related-box.fam-2 { background: #efecf6; border-color: #cdc2e1; }
.seed-group .related-box.fam-3 { background: #eaf2f1; border-color: #bfd7d4; }
.seed-group .ev-item summary { cursor: pointer; font-size: 15px; }
.seed-group .ev-item summary::-webkit-details-marker { display: none; }
.seed-group .seed-expanded h4 { margin: 14px 0 6px; font-size: 16px; color: #5f5a52; }
.seed-group .seed-expanded > .empty { margin: 8px 0; }
.evo-related { stroke: #7f9fb5; fill: none; stroke-width: 2; }
.evo-new-evidence { stroke: #7fa89b; fill: none; stroke-width: 2; }
.evo-new-creators { stroke: #d29a6b; fill: none; stroke-width: 2; }
.evo-related-dot { fill: #7f9fb5; }
.evo-new-evidence-dot { fill: #7fa89b; }
.evo-new-creators-dot { fill: #d29a6b; }
@media (max-width: 900px) {
  .report-grid, .cand-controls { grid-template-columns: 1fr; }
}

/* ===== Candidate Demo / Preview ===== */
.candemo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.candemo-card { border: 1px solid; border-radius: 16px; padding: 14px 16px; transition: transform .08s ease; }
.candemo-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(90, 80, 70, .1); }
.candemo-card .candemo-score { font-size: 26px; font-weight: 800; margin: 8px 0 4px; color: #4f4a43; }
.demo-tone-high { background: linear-gradient(135deg, #e6efe8, #f2f7f2); border-color: #b9d3c0; }
.demo-tone-medium { background: linear-gradient(135deg, #f2e7dd, #faf3ec); border-color: #d9bfa7; }
.demo-tone-low { background: linear-gradient(135deg, #f3edda, #faf7ea); border-color: #d7ca9f; }
.demo-tone-stopped { background: linear-gradient(135deg, #ececeb, #f5f5f4); border-color: #c8c6c2; filter: saturate(.5); }
@media (max-width: 720px) {
  .candemo-grid { grid-template-columns: 1fr; }
}

/* ===== Phase 16.3.3 Evidence Card Grid (UI only) ===== */
.cat-chip { display: inline-flex; align-items: center; gap: 3px; background: #f1ede6; color: #6b6152; border-radius: 999px; padding: 2px 6px 2px 8px; margin-right: 4px; }
.cat-chip-x { border: 0; background: transparent; color: #8a7f6d; cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; }
.cat-chip-x:hover { color: #b4553f; }
.seed-playbook-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 6px 0 8px; }
.playbook-line-label { color: #6d6254; font-size: 11px; font-weight: 700; margin-right: 2px; }
.playbook-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; background: #e7f6ec; color: #17683a; border: 1px solid #b8e3c5; font-size: 11px; }
.playbook-chip button { border: 0; padding: 0 1px; color: #477657; background: transparent; cursor: pointer; font-size: 12px; line-height: 1; }
.playbook-chip button:hover { color: #b42318; }
.playbook-editor { padding: 11px; border: 1px solid #d8d1c5; border-radius: 9px; background: #fffdf9; }
.playbook-title { display: block; font-weight: 750; color: #4d453a; margin-bottom: 7px; }
.playbook-selected { display: flex; flex-wrap: wrap; gap: 5px; min-height: 27px; align-items: center; margin-bottom: 8px; }
.playbook-groups { display: grid; gap: 5px; max-height: 190px; overflow-y: auto; padding-right: 3px; }
.playbook-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.playbook-group-label { width: 55px; flex: 0 0 55px; color: #756b5e; font-size: 11px; font-weight: 700; }
.playbook-choice { border: 1px solid #d9d1c5; border-radius: 999px; background: #fff; color: #5f564a; padding: 3px 8px; font-size: 11px; cursor: pointer; }
.playbook-choice:hover { border-color: #8cb89a; color: #17683a; }
.playbook-choice.on { background: #dcfce7; color: #166534; border-color: #86efac; }
.playbook-choice.dynamic { border-color: #f0c36b; background: #fffaf0; color: #9a5b0a; }
.playbook-choice.dynamic.on { background: #fef3c7; border-color: #e5a91d; color: #854d0e; }
.playbook-hot-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid #f1d28a;
  border-radius: 8px;
  background: #fff9e8;
  color: #7a4b08;
  font-size: 11px;
}
.playbook-required-warning {
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid #f1a7a7;
  border-radius: 8px;
  background: #fff1f1;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}
.playbook-custom { display: flex; gap: 6px; margin-top: 9px; }
.playbook-custom input { flex: 1; min-width: 0; }
.ct-wrap { position: relative; }
.ct-svg { width: 100%; height: auto; background: #fffdf9; border: 1px solid var(--border); border-radius: 10px; }
.ct-line { cursor: pointer; }
.ct-line.ct-dim { opacity: .18; }
.ct-legend-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 10px; }
.ct-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.ct-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ct-tooltip { position: absolute; display: none; max-width: 340px; background: rgba(63,58,53,.94); color: #fff; font-size: 11.5px; line-height: 1.5; padding: 7px 9px; border-radius: 7px; pointer-events: none; z-index: 5; }
/* ===== Phase 17.1 Candidate Detail refinement ===== */
.cand-workspace { padding: 16px 18px; }
.cand-summary { display: flex; flex-wrap: wrap; gap: 18px; padding: 2px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; font-size: 13px; color: #5f5a52; }
.cand-summary b { color: #3f3a35; margin-right: 4px; }
.cand-h { margin: 18px 0 8px; font-size: 15px; letter-spacing: .02em; color: #4a453f; }
.cand-dims { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cand-dim { padding: 12px 14px 14px; border: 1px solid #e9e4da; border-radius: 10px; background: #fffdfa; }
.cand-dim-en { font-weight: 700; font-size: 14.5px; letter-spacing: .01em; }
.cand-dim-cn { font-size: 12.5px; color: #6b6152; margin-top: 3px; }
.cand-dim-desc { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin: 6px 0 8px; }
.cand-dim-weight { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cand-dim-weight b { color: #4a453f; }
.cand-dim-rate { display: flex; gap: 6px; }
.cand-rating-btn { width: 44px; height: 40px; border: 1px solid #ddd6c8; background: #fff; border-radius: 9px; cursor: pointer; font-size: 15px; font-weight: 600; color: #6b6152; transition: border-color .08s, background .08s; }
.cand-rating-btn:hover { border-color: #b9a98d; background: #faf6ee; }
.cand-rating-btn:focus-visible { outline: 2px solid #b9a98d; outline-offset: 2px; }
.cand-rating-btn.is-on { background: #e4efe7; border-color: #8fb69d; color: #2f5c45; box-shadow: inset 0 0 0 1px #8fb69d; }
.cand-dim-val { font-size: 13px; font-weight: 600; color: #3f3a35; margin-top: 8px; }
.cand-human-total { display: flex; align-items: center; gap: 14px; margin: 2px 0 12px; font-size: 15px; color: #3f3a35; }
.cand-human-bar { flex: 1; height: 8px; background: #efece5; border-radius: 999px; overflow: hidden; max-width: 420px; }
.cand-human-bar i { display: block; height: 100%; background: #9dbfa9; border-radius: 999px; }
.cand-why { margin-top: 6px; }
.cand-why .small { color: #5f5a52; }
.cluster-card { background: #f4f6f3; border-color: #dfe6de; }
.cluster-card .cluster-head h3 { color: #3f4a3f; }
.cand-controls { padding: 10px 14px; }
.cand-row { display: flex; align-items: center; gap: 14px; padding: 10px 2px; border-top: 1px solid #eee9e0; }
.cand-row:first-of-type { border-top: 0; }
.cand-row-main { flex: 1; min-width: 0; }
.cand-row-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 2px; }
.cand-row-actions { display: flex; gap: 6px; }
.cand-sup { border: 1px solid #eee9e0; border-radius: 8px; padding: 8px 10px; margin: 8px 0; background: #fffdfa; }
.cand-sup h3 { font-size: 12px; margin: 0 0 4px; }
.cand-system { font-size: 13px; color: #4a453f; }
.cand-support { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; margin: 10px 0 2px; }
.cand-support i { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cand-support b { font-size: 13px; color: #45403a; }
.cand-ai-meta { font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; margin: 8px 0 12px; }
.ai-item-h { font-weight: 700; font-size: 12.5px; color: #45403a; margin-bottom: 3px; }
@media (max-width: 900px) {
  .cand-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cand-support { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-grid { grid-template-columns: 1fr; }
}
.seed-group .cluster-head { flex-wrap: wrap; gap: 6px; }
.table-wrap table.dense th, .table-wrap table.dense td { padding: 6px 8px; font-size: 12px; }
.ev-toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; margin: 8px 0 12px; }
.ev-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ev-tool-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
.ev-seg { padding: 3px 8px; font-size: 12px; }
.ev-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 10px;
  align-items: stretch;
}
.ev-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.ev-card-body {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; flex: 1;
  min-width: 0; max-width: 100%; overflow-wrap: anywhere;
}
.ev-card-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 7px 12px 0; }
.ev-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-rank { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ev-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #eef0f2; margin-top: 7px; overflow: hidden; }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-thumb img.image-fallback, img.image-fallback { object-fit: contain; background: #f1f0ed; }
.ev-thumb-no { display: flex; align-items: center; justify-content: center; color: #a7a29a; font-size: 30px; font-weight: 800; }
.btn[data-busy="1"], .btn.ev-busy { opacity: .62; cursor: wait; }
.ev-title { font-weight: 700; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-meta { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.ev-score-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 2px; }
.ev-score { display: inline-flex; align-items: baseline; gap: 7px; }
.ev-score-num { font-size: 24px; font-weight: 800; line-height: 1; color: #3f3a35; }
.ev-signature-note { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 7px; border: 1px solid #e6d8c5; border-radius: 999px; background: #f7f1e8; color: #755f45; font-size: 10.5px; line-height: 1.35; }
.ev-rel { display: flex; flex-direction: column; gap: 1px; }
.ev-rel-label { font-size: 9.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.ev-rel-val { font-size: 12px; font-weight: 700; color: #5b564f; }
.ev-sub { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ev-sub b { color: #3f3a35; }
.ev-metrics { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-metric { display: inline-flex; flex-direction: column; background: #f5f3ef; border: 1px solid #e7e2d9; border-radius: 7px; padding: 3px 7px; line-height: 1.15; }
.ev-metric i { font-style: normal; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ev-metric b { font-size: 12px; color: #4a453f; }
.ev-reason { font-size: 12px; color: #5f5a52; background: #f7f4ee; border-left: 3px solid #d8c7a8; padding: 5px 8px; border-radius: 0 6px 6px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ev-err { color: #9a4b42; }
.ev-more summary { cursor: pointer; font-size: 12px; color: #7a7368; }
.ev-more-body { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; padding: 6px 8px; background: #f7f6f4; border-radius: 7px; }
.ev-full-reason { font-size: 12px; color: #4a453f; line-height: 1.5; }
.ev-actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto;
  padding-top: 4px; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
}
.ev-actions .btn, .ev-actions a.btn {
  margin: 0; max-width: 100%; min-width: 0; white-space: normal; text-align: center; overflow-wrap: anywhere;
}
.template-breakdown { border: 1px solid #e5e1d9; border-radius: 9px; background: #fcfbf8; padding: 8px 9px; }
.template-breakdown-strong { margin-top: 2px; }
.template-breakdown-title { font-size: 12px; font-weight: 800; color: #5f5a52; margin-bottom: 6px; }
.template-breakdown-possible { padding: 0; background: transparent; border-style: dashed; }
.template-breakdown-possible > summary {
  cursor: pointer; list-style: none; padding: 6px 8px; color: #8a806f; font-size: 11px; line-height: 1.35;
}
.template-breakdown-possible > summary::-webkit-details-marker { display: none; }
.template-breakdown-possible > summary::before { content: '▸'; display: inline-block; margin-right: 5px; transition: transform .12s ease; }
.template-breakdown-possible[open] > summary::before { transform: rotate(90deg); }
.template-breakdown-content { padding: 2px 8px 8px; }
.template-breakdown-empty { color: #8a8175; font-size: 11px; padding: 4px 0; }
.tb-grid { display: grid; gap: 7px; }
.tb-dimension { border-top: 1px dashed #e6e0d6; padding-top: 6px; }
.tb-dimension-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #5f5a52; }
.tb-same { font-size: 10px; white-space: nowrap; }
.tb-same-yes { color: #15803d; }
.tb-same-no { color: #b91c1c; }
.tb-same-unknown { color: #7d766c; }
.tb-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 3px; font-size: 10.5px; line-height: 1.42; color: #625c54; }
.tb-compare span { min-width: 0; overflow-wrap: anywhere; }
.tb-compare i { display: block; color: #9a9287; font-style: normal; font-size: 9.5px; font-weight: 700; }
.tb-keywords { margin-top: 4px; color: #8a806f; font-size: 10px; }
.tb-keywords span { display: inline-block; background: #f1ece3; border-radius: 999px; padding: 1px 6px; margin: 2px 4px 0 0; }
.tb-reason { margin-top: 7px; padding-top: 6px; border-top: 1px solid #e6e0d6; color: #5f5a52; font-size: 10.5px; line-height: 1.45; }
.tb-human-alert { background: #fff8df; border: 1px solid #efd98a; color: #765a12; border-radius: 8px; padding: 6px 8px; font-size: 10.5px; line-height: 1.45; margin-bottom: 6px; }
@media (max-width: 560px) {
  .tb-compare { grid-template-columns: 1fr; }
}
.badge.ev-badge-suggestion { background: #efe9e0; color: #7a6a55; }
.badge.ev-badge-confirmed { background: #e3ecea; color: #33645e; }
.badge.ev-badge-ok { background: #e5efe9; color: #3d6b52; }
.badge.ev-badge-human { background: #f0e9f2; color: #6b5175; }   /* 人工覆盖，与 AI 结论区分 */
.badge.ev-badge-pending { background: #ecece9; color: #75736e; }
.badge.ev-badge-fail { background: #f3e4e1; color: #92584f; }
.badge.ev-badge-ineligible { background: #f1e6e2; color: #8a5b4f; }
.badge.sim-strong { background: #e3ece6; color: #3e6a50; }
.badge.sim-possible { background: #efe8d8; color: #7c6a38; }
.badge.sim-reject { background: #f0e2de; color: #8d574c; }
.badge.sim-confirmed { background: #e3ecea; color: #33645e; }
.badge.sim-pending { background: #ecece9; color: #75736e; }
.ev-card-candidate { border-top: 3px solid #dcc7a4; }
.ev-card-confirmed { border-top: 3px solid #9fc1ba; }
.ev-card.fam-0 { background: linear-gradient(180deg, rgba(247, 226, 214, .12), rgba(255, 255, 255, .9)); }
.ev-card.fam-1 { background: linear-gradient(180deg, rgba(233, 228, 244, .14), rgba(255, 255, 255, .9)); }
.ev-card.fam-2 { background: linear-gradient(180deg, rgba(222, 236, 235, .16), rgba(255, 255, 255, .9)); }
.ev-card.fam-3 { background: linear-gradient(180deg, rgba(245, 234, 210, .18), rgba(255, 255, 255, .9)); }
.ev-mini { display: flex; flex-direction: column; gap: 4px; background: #fffdf9; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.ev-mini-head strong { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-mini-score { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; color: var(--muted); }
.ev-mini-score b { font-size: 18px; color: #4a453f; }
.ev-top-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1240px) {
  .ev-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-top-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .ev-card-grid { grid-template-columns: 1fr; }
  .ev-top-grid { grid-template-columns: 1fr; }
  .ev-actions .btn, .ev-actions a.btn { flex: 1 1 120px; }
}

/* ---------- P0-2：可打印简报 ----------
 * 屏幕上隐藏，只在使用「打印简报」时出现；打印时隐藏导航/按钮/折叠控件，
 * Cluster 卡片单列、完整展开，字号缩小以尽量塞进 A4 一页。 */
.print-brief { display: none; }

/* P0-2 增强：Evidence 导出工具条 + Seed 勾选 */
.ev-export-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.ev-export-menu { position: relative; display: inline-block; }
.ev-export-menu > summary { cursor: pointer; list-style: none; }
.ev-export-menu > summary::-webkit-details-marker { display: none; }
.ev-export-items {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
  display: flex; flex-direction: column; gap: 4px; min-width: 230px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}
.ev-export-items .btn { text-align: left; }
.ev-export-items .btn[disabled] { opacity: .5; cursor: not-allowed; }
.ev-seed-pick { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; cursor: pointer; }
.ev-seed-pick input { cursor: pointer; }
.seed-strong-summary {
  margin: 8px 0 10px;
  border: 1px solid #d9e4e1;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.seed-strong-summary > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #3f4b47;
  background: #f7faf9;
}
.seed-strong-counts { color: var(--muted); font-size: 11px; font-weight: 500; }
.seed-strong-list { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.seed-strong-expand-all { width: calc(100% - 12px); margin: 2px 6px 6px; }
.seed-strong-item {
  width: 100%;
  min-width: 0;
  border: 1px solid #ece9e3;
  border-radius: 8px;
  background: #fffdf9;
  color: inherit;
  font: inherit;
  overflow: hidden;
}
.seed-strong-item:hover { border-color: #b9d3c0; background: #fff; box-shadow: 0 2px 8px rgba(50, 45, 38, .08); }
.seed-strong-item.is-read { border-color: #e4e4e4; background: #f5f5f5; color: #666; }
.seed-strong-toggle {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  cursor: pointer;
  list-style: none;
  text-align: left;
}
.seed-strong-toggle::-webkit-details-marker { display: none; }
.seed-strong-toggle::after {
  content: '▶';
  color: #7a8580;
  font-size: 10px;
  text-align: center;
}
.seed-strong-item[open] > .seed-strong-toggle::after { content: '▼'; }
.seed-strong-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 38px;
  overflow: hidden;
  border-radius: 6px;
  background: #eef2f1;
  color: #8a948f;
  font-weight: 800;
}
.seed-strong-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seed-strong-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.seed-strong-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; }
.seed-strong-metrics { display: flex; gap: 10px; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.seed-strong-sources { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; max-width: 260px; }
.seed-strong-play { padding: 2px 7px; color: #37685d; }
.seed-strong-detail {
  margin: 0 7px 7px;
  padding: 10px;
  border: 1px solid #ececec;
  border-radius: 7px;
  background: #fafafa;
  color: #555;
}
.seed-strong-detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.seed-strong-human-reason {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border-left: 3px solid #9fc1ba;
  border-radius: 0 6px 6px 0;
  background: #f1f7f5;
}
.seed-strong-human-reason strong { color: #3e675e; }
.seed-strong-analysis { font-size: 11.5px; }
.seed-strong-analysis-title { margin-bottom: 7px; color: #374151; font-size: 12.5px; font-weight: 800; }
.strong-analysis-list { display: flex; flex-direction: column; gap: 5px; }
.strong-analysis-row {
  display: grid;
  grid-template-columns: 88px 48px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #fff;
}
.strong-analysis-label { color: #777; }
.strong-analysis-score { font-weight: 800; }
.strong-analysis-score.strong-score-good { color: #1a7f37; }
.strong-analysis-score.strong-score-mid { color: #a16207; }
.strong-analysis-score.strong-score-low { color: #b42318; }
.strong-analysis-row small { color: #777; line-height: 1.45; }
.strong-analysis-barrier { margin-top: 8px; }
.strong-analysis-barrier .barrier-zero { color: #1a7f37; }
.strong-analysis-barrier .barrier-low { color: #a16207; }
.strong-analysis-barrier .barrier-high { color: #b42318; }
.strong-analysis-elements { margin-top: 8px; }
.strong-analysis-elements ul { margin: 4px 0 0; padding-left: 20px; }
.strong-analysis-elements li { margin: 2px 0; }
.strong-analysis-summary {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid #e7e7e7;
  color: #4b5563;
  font-style: italic;
  font-weight: 700;
}
.seed-strong-analysis-empty {
  padding: 8px 9px;
  border-radius: 6px;
  background: #fff;
  color: #777;
  font-size: 11.5px;
}
.strong-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.strong-source-human { background: #e8f5e9; border-color: #a9d7b1; color: #1a7f37; }
.strong-source-ai { background: #e3f2fd; border-color: #90c8eb; color: #1e6fa8; }
.seed-strong-more { border-top: 1px solid #eef0ed; }
.seed-strong-more > summary {
  padding: 6px 10px;
  cursor: pointer;
  color: #52756a;
  font-size: 11.5px;
  font-weight: 700;
}
.seed-strong-empty { padding: 9px 10px; color: var(--muted); font-size: 12px; }
.seed-ai-analysis-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  min-width: 190px;
  min-height: 32px;
  margin-left: 2px;
  padding: 4px 10px;
  overflow: hidden;
  isolation: isolate;
}
.seed-ai-analysis-btn[disabled]:not(.is-running) { opacity: .55; cursor: default; }
.seed-ai-analysis-btn.is-running {
  border-color: #a8c9aa;
  background: #e0e0e0;
  color: #173c1d;
  cursor: wait;
  opacity: 1;
}
.seed-ai-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  pointer-events: none;
  background: #4caf50;
  transition: width .2s ease;
}
.seed-ai-progress-track {
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  background: #e0e0e0;
}
.seed-ai-progress-label {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev-card.evidence-reviewed.ev-card-read,
.ev-card.evidence-reviewed.row-reviewed-owner,
.ev-card.evidence-reviewed.row-reviewed-assistant,
.ev-card.evidence-reviewed.row-reviewed-both,
.ev-card.evidence-reviewed.row-reviewed-other {
  background: #f5f5f5;
  opacity: 1;
}
.ev-card.evidence-reviewed.row-reviewed-owner,
.ev-card.evidence-reviewed.row-reviewed-assistant,
.ev-card.evidence-reviewed.row-reviewed-both,
.ev-card.evidence-reviewed.ev-card-read { color: #666; }
.ev-card.evidence-reviewed.ev-card-read .badge { opacity: .8; }
.ev-read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #d9d5cc;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
  cursor: pointer;
}
.ev-read-toggle input { cursor: pointer; margin: 0; }
.ev-read-toggle input:disabled { cursor: default; }
.ev-deep-analysis {
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #cfe1ea;
  border-radius: 9px;
  background: #f6fbfd;
}
.ev-deep-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: #1e6fa8; }
.ev-deep-head span { color: var(--muted); font-size: 10.5px; }
.ev-deep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.ev-deep-score {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  min-width: 0;
  padding: 6px 7px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #e1ebef;
  font-size: 11px;
}
.ev-deep-score span { color: #4b5c65; }
.ev-deep-score strong { color: #1e6fa8; }
.ev-deep-score small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ev-deep-meta { margin-top: 6px; }
.ev-replication-barrier {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}
.ev-replication-barrier.barrier-zero { background: #e8f5e9; color: #1a7f37; }
.ev-replication-barrier.barrier-low { background: #fff8e1; color: #9a6700; }
.ev-replication-barrier.barrier-high { background: #fde8e8; color: #b42318; }
.ev-deep-elements { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; font-size: 10.5px; }
.ev-deep-elements b { color: #4b5c65; }
.ev-deep-elements span { padding: 2px 6px; border-radius: 6px; background: #e3f2fd; color: #1e6fa8; }
.ev-deep-summary { margin-top: 7px; padding-top: 6px; border-top: 1px solid #dce9ef; color: #374151; font-size: 11.5px; }
@media (max-width: 640px) {
  .seed-strong-toggle { grid-template-columns: 46px minmax(0, 1fr) 18px; }
  .seed-strong-thumb { width: 46px; height: 34px; }
  .seed-strong-sources { grid-column: 2; justify-content: flex-start; max-width: none; }
  .strong-analysis-row { grid-template-columns: 82px 44px minmax(0, 1fr); }
  .ev-deep-grid { grid-template-columns: 1fr; }
}

/* Phase 59：Cluster / Trend integrated visual report */
.trend-visual-report { margin: 14px 0 18px; }
.trend-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trend-chart-card { margin: 0; min-width: 0; }
.trend-chart-card h4 { margin: 0 0 8px; }
.trend-chart-wide { grid-column: 1 / -1; }
.trend-chart-wrap { width: 100%; overflow: hidden; }
.trend-svg { display: block; width: 100%; height: auto; min-height: 180px; }
.trend-stack { display: flex; height: 30px; overflow: hidden; border-radius: 8px; background: #eee9df; }
.trend-stack-seg { display: block; min-width: 2px; height: 100%; }
.trend-bars { display: flex; flex-direction: column; gap: 8px; }
.trend-bar-row { display: grid; grid-template-columns: minmax(170px, 44%) 1fr; gap: 10px; align-items: center; }
.trend-bar-label { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.trend-bar-label strong, .trend-bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-bar-label span { color: var(--muted); font-size: 10px; }
.trend-bar-track { height: 12px; border-radius: 99px; background: #ece8df; overflow: hidden; }
.trend-bar-track i { display: block; height: 100%; border-radius: inherit; background: #4f8378; }
.trend-template-item { border-top: 1px solid var(--border); padding: 8px 0; }
.trend-template-item summary { cursor: pointer; font-weight: 600; }
.trend-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.trend-template-dim { padding: 8px; border-radius: 8px; background: #f8f5ef; font-size: 11px; }
.trend-template-dim > span { float: right; }
.trend-template-dim i { color: var(--muted); font-style: normal; }
.trend-category-editor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.trend-category-editor label { font-size: 12px; font-weight: 600; color: var(--muted); }
.trend-category-editor select { min-width: 130px; }

.ev-seed-clustered { padding: 0; overflow: hidden; }
.ev-seed-clustered > summary { cursor: pointer; padding: 16px 18px; list-style-position: inside; }
.clustered-seed-item { border-top: 1px solid var(--border); background: #fffdf9; }
.clustered-seed-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  overflow-x: auto;
}
.clustered-seed-summary strong { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.clustered-seed-body { padding: 0 12px 12px; }
.clustered-seed-body > .seed-group { margin: 0; }
.evidence-seed-focus { animation: evidence-seed-focus 2s ease-out; }
@keyframes evidence-seed-focus {
  0%, 30% { outline: 3px solid #f4c430; outline-offset: 3px; background-color: #fff9d6; }
  100% { outline: 0 solid transparent; outline-offset: 0; background-color: transparent; }
}
.cluster-lifecycle-block { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px; }
.cluster-lifecycle-chart-wrap { width: 100%; overflow: hidden; }
.cluster-lifecycle-chart { display: block; width: 100%; height: auto; min-height: 220px; }
.cluster-creator-profile-bar {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8df;
}
.cluster-creator-profile-bar span { min-width: 0; height: 100%; }
.candidate-category-chart-wrap { width: 100%; overflow-x: auto; }
.candidate-category-chart { display: block; width: 100%; min-width: 520px; height: auto; }
.candidate-category-bar { cursor: pointer; }
.candidate-category-bar.active rect:first-child { stroke: #1a202c; stroke-width: 2; }
.candidate-table { min-width: 1280px; }
.candidate-table th:nth-child(1) { width: 36px; }
.candidate-table th:nth-child(2) { width: 250px; }
.candidate-table th:nth-child(3) { width: 90px; }
.candidate-table th:nth-child(4) { width: 80px; }
.candidate-table th:nth-child(5) { width: 140px; }
.candidate-table th:nth-child(6), .candidate-table th:nth-child(7),
.candidate-table th:nth-child(8), .candidate-table th:nth-child(9) { width: 76px; }
.candidate-table th:nth-child(10) { width: 80px; }
.candidate-table th:nth-child(11), .candidate-table th:nth-child(12) { width: 90px; }
.candidate-table th:nth-child(13) { width: 70px; }
.table-sort-btn { border: 0; background: transparent; padding: 0; color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.candidate-row-sparkline { width: 100px; height: 32px; display: block; }
.candidate-trend-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  word-break: break-word;
}
.candidate-table .confidence-compact { white-space: nowrap; }
.candidate-inline-detail { margin: 8px 0; padding: 8px 0; }
.candidate-print-report { display: none; }
.candidate-monitoring-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.candidate-row-report-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.candidate-report-history { margin: 6px 0 0; padding: 7px 9px; border-left: 3px solid #e3b341; background: #fffbeb; border-radius: 4px; }
.candidate-report-period { font-size: 12px; margin-top: 3px; }
.candidate-monitoring-panel { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #eadfbf; border-radius: 8px; background: #fffdf6; }
.candidate-monitoring-summary { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.candidate-monitoring-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.after-sales-reminder { color: #854d0e; background: #fef3c7; border: 1px solid #f4c430; }
.after-sales-stopped, .after-sales-stopped-text { color: #6b7280; background: #f3f4f6; }
.after-sales-active { color: #4b5563; background: #f3f4f6; }
.after-sales-reported { color: #1d4ed8; background: #dbeafe; }
.after-sales-paused { color: #92400e; background: #fef3c7; }
.traffic-light {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; cursor: help;
}
.traffic-light-green { background: #e6f4ea; color: #1a7f37; }
.traffic-light-yellow { background: #fff8e1; color: #b45309; }
.traffic-light-red { background: #fde8e8; color: #c53030; }
.traffic-light-gray { background: #f0f0f0; color: #666; }
.life-stage-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.life-stage-badge.stage-emerging { background: #e8f4fd; color: #1e6fa8; }
.life-stage-badge.stage-exploding { background: #fde8e8; color: #c53030; }
.life-stage-badge.stage-spreading { background: #fff8e1; color: #b45309; }
.life-stage-badge.stage-declining { background: #fff0e0; color: #c05621; }
.life-stage-badge.stage-ended { background: #f0f0f0; color: #666; }
.cluster-coverage-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: -3px 0 10px; font-size: 12px; color: var(--muted); }
.confidence-details { position: relative; display: inline-block; }
.confidence-details > summary { list-style: none; cursor: pointer; }
.confidence-details > summary::-webkit-details-marker { display: none; }
.confidence-tooltip {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 340px;
  padding: 9px 11px; border: 1px solid #d8d1c5; border-radius: 8px; background: #fff;
  box-shadow: 0 8px 22px rgba(50, 45, 38, .14); color: var(--text); font-size: 12px; line-height: 1.65;
}
.confidence-badge { cursor: pointer; }
.confidence-high { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.confidence-medium { color: #92400e; background: #fef3c7; border: 1px solid #facc15; }
.confidence-low { color: #4b5563; background: #e5e7eb; border: 1px solid #cbd5e1; }
.confidence-insufficient { color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; }
.candidate-print-confidence, .pb-confidence { margin: 3px 0 7px; font-size: 12px; font-weight: 600; color: #374151; }
.candidate-print-life-stage { margin: 3px 0 5px; font-size: 12px; color: #4b5563; }
.candidate-print-action, .pb-actions { margin: 3px 0 9px; font-size: 12px; line-height: 1.55; color: #374151; }
.metric-badge { cursor: help; white-space: nowrap; }
.difficulty-low { color: #1a7f37; background: #e6f4ea; border: 1px solid #a7d9b4; }
.difficulty-medium { color: #b45309; background: #fff8e1; border: 1px solid #f5cf72; }
.difficulty-high { color: #c53030; background: #fde8e8; border: 1px solid #f3aaaa; }
.difficulty-unknown { color: #666; background: #f0f0f0; border: 1px solid #ddd; }
.action-follow-now { color: #1a7f37; background: #e6f4ea; border: 1px solid #a7d9b4; }
.action-follow-fast { color: #0f6b72; background: #e6f7f8; border: 1px solid #9ed9dd; }
.action-follow-careful { color: #b45309; background: #fff8e1; border: 1px solid #f5cf72; }
.action-watch { color: #666; background: #f0f0f0; border: 1px solid #ddd; }
.action-not-recommended { color: #c53030; background: #fde8e8; border: 1px solid #f3aaaa; }
.action-early-watch { color: #6b46c1; background: #f1eafe; border: 1px solid #c9b6ee; }
.candidate-metric-separator { display: inline-block; margin: 0 3px; color: #9a948a; }
.retrieval-source-badge { font-size: 10px; }
.retrieval-source-playbook { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.retrieval-source-core { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.retrieval-source-variant { color: #1d4ed8; background: #dbeafe; border: 1px solid #93c5fd; }
.trend-insight-card, .trend-template-card {
  box-sizing: border-box;
  border: 1px solid #d8d1c5;
  border-radius: 12px;
  background: #fffdf8;
  padding: 18px 20px;
  margin: 12px 0;
}
.insight-eyebrow { font-size: 12px; color: #7d766c; letter-spacing: .02em; }
.trend-insight-card h3 { margin: 8px 0 12px; font-size: 24px; line-height: 1.25; }
.insight-conclusion { font-size: 20px; font-weight: 800; line-height: 1.4; color: #26352f; margin-bottom: 16px; }
.insight-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.insight-metric { border: 1px solid #e5ded3; border-radius: 8px; background: #fff; padding: 11px 12px; }
.insight-metric span { display: block; font-size: 11px; color: #8a8378; text-transform: uppercase; letter-spacing: .04em; }
.insight-metric strong { display: block; margin-top: 4px; font-size: 17px; color: #2f3a35; }
.insight-support { margin-top: 14px; padding-top: 11px; border-top: 1px solid #e5ded3; font-size: 13px; color: #5f5a52; }
.template-card-title { font-size: 20px; font-weight: 800; color: #2f3a35; margin-bottom: 12px; }
.template-field { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid #ede7dd; font-size: 14px; line-height: 1.55; }
.template-field:first-of-type { border-top: 0; }
.template-field-label { font-weight: 700; color: #4b453d; }
.template-copyable-list { margin: 0; padding-left: 18px; }
.template-copyable-list li { margin: 2px 0; }

@media (max-width: 860px) {
  .trend-chart-grid { grid-template-columns: 1fr; }
  .trend-chart-wide { grid-column: auto; }
  .trend-bar-row { grid-template-columns: 1fr; gap: 4px; }
  .clustered-seed-summary { white-space: normal; flex-wrap: wrap; overflow-x: visible; }
  .candidate-category-chart { min-width: 460px; }
  .candidate-monitoring-filters { align-items: flex-start; }
  .confidence-tooltip { min-width: 260px; max-width: calc(100vw - 40px); }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #111; }
  .topbar, nav, button, .btn, .actions, .filter-bar, .ev-actions, .toast, .modal, .modal-backdrop,
  .health-bar, .dash-hero, .no-print, .page-head .actions, .ev-export-bar { display: none !important; }
  .print-hidden { display: none !important; }
  details > summary { display: none !important; }
  details > *:not(summary) { display: block !important; }
  .trend-visual-report, .trend-chart-card, .trend-svg { display: block !important; }
  .candidate-live-ui { display: none !important; }
  .candidate-print-report { display: block !important; }
  .candidate-print-category { break-inside: auto; page-break-inside: auto; margin-bottom: 18px; }
  .candidate-print-cluster { break-inside: auto; page-break-inside: auto; margin-bottom: 16px; }
  .candidate-print-insight {
    break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always;
    min-height: 0; font-size: 13px;
  }
  .candidate-print-template {
    break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always;
    min-height: 0; font-size: 13px;
  }
  .candidate-print-insight .insight-conclusion { font-size: 18px; }
  .candidate-print-insight .insight-metric strong { font-size: 15px; }
  .candidate-print-original { break-after: page; page-break-after: always; }
  .candidate-print-category + .candidate-print-category { break-before: page; page-break-before: always; }
  .cluster-card { border: 1px solid #999 !important; box-shadow: none !important; margin: 0 0 10px !important; padding: 8px !important; page-break-inside: avoid; break-inside: avoid; }
  .cluster-card > *:not(.print-brief) { display: none !important; }
  .print-brief { display: block !important; font-size: 11px; line-height: 1.45; color: #111; }
  .print-brief h2 { font-size: 16px; margin: 0 0 2px; }
  .print-brief h3 { font-size: 14px; margin: 6px 0 2px; }
  .print-brief h4 { font-size: 12px; margin: 8px 0 2px; }
  .print-brief .pb-meta { font-size: 10px; color: #555; }
  .print-brief ul, .print-brief ol { margin: 2px 0 0 18px; padding: 0; }
  .print-brief li { margin: 0; }
  .print-brief .pb-empty { color: #666; font-style: italic; }
}
