:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: #111827;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

.decision-workspace {
  display: grid;
  gap: 0.9rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 22rem);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.55);
}

.segmented button {
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.segmented button.active {
  color: #f8fafc;
  background: #1d4ed8;
}

.decision-layer {
  min-width: 0;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.decision-group {
  min-width: 0;
  padding-left: 0.85rem;
  border-left: 3px solid #38bdf8;
}

.decision-group h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.decision-group p,
.decision-group li {
  overflow-wrap: anywhere;
}

.research-mode-banner {
  padding: 0.75rem 0.9rem;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  font-weight: 700;
}

.issue-level {
  display: inline-block;
  min-width: 5.4rem;
  margin-right: 0.45rem;
  font-weight: 800;
}

.issue-critical { color: #f87171; }
.issue-block { color: #fb923c; }
.issue-warning { color: #facc15; }
.issue-info { color: #7dd3fc; }

@media (max-width: 800px) {
  .decision-workspace .card-title-row {
    align-items: stretch;
  }

  .segmented,
  .decision-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

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

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  background: linear-gradient(145deg, #07090d, var(--bg));
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  color: #04111f;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.18);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

button.ghost {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  box-shadow: none;
}

button.danger {
  color: #fecaca;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(15, 23, 42, 0.74);
  color: var(--text);
  outline: none;
}

code {
  color: #bae6fd;
}

.hidden {
  display: none !important;
}

.shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 2rem;
  overflow-x: clip;
}

.login-card {
  width: min(460px, calc(100vw - 2rem));
  margin: 12vh auto 0;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #020617;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.brand-mark.warning {
  background: linear-gradient(135deg, #fbbf24, #fb7185);
}

.login-card h1 {
  margin: 1.25rem 0 0.5rem;
  font-size: 2rem;
}

.login-card p {
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.error-text {
  min-height: 1.5rem;
  color: #fecaca !important;
}

.app {
  display: grid;
  gap: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.4rem;
  min-width: 0;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  margin: 0.1rem 0;
  font-size: 2.45rem;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.top-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 850;
}

.muted {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.insight-note {
  margin: 0.9rem 0 0;
  color: #cbd5e1;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.quick-guide {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 18px;
  background: rgba(14, 165, 233, 0.08);
}

.quick-guide strong {
  color: #e0f2fe;
}

.quick-guide p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.help-card {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.help-card strong {
  display: block;
  color: #bae6fd;
  margin-bottom: 0.25rem;
}

.help-card span {
  display: block;
  color: #cbd5e1;
  line-height: 1.55;
  font-size: 0.92rem;
}

.field-hint,
.button-note {
  margin: 0.35rem 0 0;
  color: #a7b3c5;
  font-size: 0.86rem;
  line-height: 1.5;
}

.button-note {
  margin-top: 0.65rem;
}

.macro-factors {
  margin: 1rem 0 0;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 1rem;
  background: rgba(2, 6, 23, 0.28);
  padding: 0.85rem;
}

.macro-factors summary {
  cursor: pointer;
  color: #bae6fd;
  font-weight: 850;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.macro-factors summary small {
  color: #a7f3d0;
  font-weight: 750;
}

.macro-factor-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.macro-factor-row {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.55);
  padding: 0.75rem;
}

.macro-factor-head,
.macro-factor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.macro-factor-head {
  justify-content: space-between;
}

.macro-factor-meta {
  margin-top: 0.45rem;
  color: #cbd5e1;
  font-size: 0.88rem;
}

.macro-factor-meta span {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  background: rgba(15, 23, 42, 0.55);
}

.macro-factor-row p {
  margin: 0.55rem 0 0.25rem;
  color: #e2e8f0;
  line-height: 1.55;
}

.macro-factor-row small {
  color: var(--muted);
}

.research-profile {
  margin: 1rem 0 0;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 1rem;
  background: rgba(2, 6, 23, 0.24);
  padding: 0.85rem;
}

.research-profile summary {
  cursor: pointer;
  color: #bae6fd;
  font-weight: 850;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.research-profile summary small {
  color: #a7f3d0;
  font-weight: 750;
}

.research-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.research-missing-summary {
  margin-top: 0.85rem;
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 0.95rem;
  padding: 0.8rem;
  background: rgba(113, 63, 18, 0.12);
  color: #fde68a;
}

.research-missing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.research-missing-tags span {
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  background: rgba(15, 23, 42, 0.5);
  font-size: 0.92rem;
  line-height: 1.35;
}

.research-missing-summary ul {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.research-missing-summary li {
  display: grid;
  grid-template-columns: minmax(4rem, auto) minmax(3rem, auto) 1fr;
  gap: 0.55rem;
  align-items: start;
  border-top: 1px solid rgba(250, 204, 21, 0.12);
  padding-top: 0.55rem;
}

.research-missing-summary li strong {
  color: #fef3c7;
}

.research-missing-summary li span {
  color: #bae6fd;
}

.research-missing-summary li small {
  color: #fde68a;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .research-missing-summary li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.research-profile-section {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.95rem;
  padding: 0.8rem;
  background: rgba(15, 23, 42, 0.48);
}

.research-profile-section h4 {
  margin: 0 0 0.65rem;
  color: #e0f2fe;
  font-size: 1rem;
}

.research-field-grid {
  display: grid;
  gap: 0.55rem;
}

.research-field {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0.75rem;
  padding: 0.65rem;
  background: rgba(15, 23, 42, 0.6);
}

.research-field div {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.research-field span {
  color: #94a3b8;
  font-weight: 750;
}

.research-field strong {
  color: #f8fafc;
  text-align: right;
}

.research-field small,
.research-field em {
  display: block;
  margin-top: 0.25rem;
  color: #94a3b8;
  font-style: normal;
  line-height: 1.45;
}

.research-field.ready {
  border-color: rgba(34, 197, 94, 0.32);
}

.research-field.computed {
  border-color: rgba(56, 189, 248, 0.34);
}

.research-field.pending {
  border-color: rgba(245, 158, 11, 0.3);
}

.research-field.pending strong {
  color: #facc15;
}

.research-field.not-applicable {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.38);
}

.research-field.not-applicable strong {
  color: #94a3b8;
}

.source-plan {
  margin-top: 0.9rem;
  color: #cbd5e1;
  line-height: 1.65;
}

.source-plan ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

.single-stock-progress-table-wrap {
  width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.8rem;
}

.single-stock-progress-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.single-stock-progress-table th,
.single-stock-progress-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
  vertical-align: top;
}

.single-stock-progress-table th {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.52);
  font-size: 0.8rem;
}

.single-stock-progress-table th:nth-child(1),
.single-stock-progress-table td:nth-child(1) { width: 28%; }
.single-stock-progress-table th:nth-child(2),
.single-stock-progress-table td:nth-child(2) { width: 20%; white-space: nowrap; }
.single-stock-progress-table tbody tr:last-child td { border-bottom: 0; }

.tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.65rem;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab {
  flex: 0 0 auto;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.11);
  box-shadow: none;
  padding: 0.65rem 0.85rem;
}

.tab.active {
  color: #02111f;
  background: linear-gradient(135deg, var(--accent), #93c5fd);
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

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

.compact-grid {
  margin-top: 1rem;
}

.compact-grid h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #dbeafe;
}

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.2rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(167, 139, 250, 0.16)),
    var(--panel-strong);
}

.card h2 {
  margin: 0.35rem 0 0.5rem;
  letter-spacing: -0.03em;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.38rem 0.65rem;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.65);
  font-size: 0.85rem;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.badge.good,
.pill.good {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
}

.badge.warn,
.pill.warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.pill.bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}

.pill.neutral {
  color: #dbeafe;
}

.metric-list,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.32);
  min-width: 0;
}

.metric.wide {
  grid-column: 1 / -1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.metric small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.metric.warn-metric {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(120, 53, 15, 0.18);
}

.metric.warn-metric span,
.metric.warn-metric small {
  color: #fde68a;
}

.metric.good-metric {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(20, 83, 45, 0.14);
}

.metric.good-metric span,
.metric.good-metric small {
  color: #bbf7d0;
}

.clean-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #cbd5e1;
  line-height: 1.75;
}

.pick-list {
  display: grid;
  gap: 0.85rem;
}

.pick {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.26);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.research-section {
  scroll-margin-top: 1rem;
}

.research-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.34);
}

.research-card .pick {
  background: rgba(2, 6, 23, 0.32);
}

.research-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.research-source {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  color: var(--muted);
}

.research-source strong {
  color: #e0f2fe;
  font-size: 1.05rem;
}

.research-issues {
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 18px;
  padding: 0.75rem 0.85rem;
  background: rgba(251, 191, 36, 0.06);
}

.research-issues summary {
  cursor: pointer;
  color: #fde68a;
  font-weight: 850;
}

.research-issues ul {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
  color: #e5e7eb;
  line-height: 1.65;
}

.pick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 0;
}

.pick-head > div:first-child {
  min-width: 0;
}

.pick h3 {
  margin: 0;
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.pick .code {
  color: var(--muted);
  font-size: 0.95rem;
}

.pick .score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  color: #bbf7d0;
  font-weight: 850;
  min-width: 8.5rem;
  text-align: right;
}

.score-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #dbeafe;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(147, 197, 253, 0.22);
}

.score-strong {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.28);
}

.score-watch {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.28);
}

.score-neutral {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.24);
}

.score-caution {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.24);
}

.score-muted {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
}

.score-help {
  margin: 0.2rem 0 1rem;
  color: #a7f3d0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.report-time {
  margin: -0.55rem 0 1rem;
  font-size: 0.88rem;
}

.reason-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: #cbd5e1;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.review-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: -0.35rem 0 1rem;
}

.review-summary > .muted {
  flex: 1 1 100%;
  display: block;
  max-width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 20px;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.08);
  font-size: 1.02rem;
  line-height: 1.85;
  white-space: normal;
  overflow-wrap: anywhere;
}

.event-list {
  display: grid;
  gap: 0.75rem;
}

.event-item {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  background: rgba(15, 23, 42, 0.62);
}

.event-item div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #bae6fd;
  font-size: 0.92rem;
}

.event-item p {
  margin: 0.45rem 0 0;
  color: #e2e8f0;
  line-height: 1.7;
}

.review-readable {
  width: 100%;
  display: grid;
  gap: 0.95rem;
  padding: 1.05rem;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 22px;
  background: rgba(120, 53, 15, 0.1);
}

.review-readable-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.review-readable-title {
  margin: 0;
  color: #fde68a;
  font-weight: 850;
  font-size: 1.15rem;
  line-height: 1.65;
}

.review-readable-subtitle {
  margin: -0.35rem 0 0;
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.65;
}

.rejected-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.rejected-card {
  min-width: 0;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.62);
}

.rejected-card h4 {
  margin: 0 0 0.65rem;
  color: #fef3c7;
  font-size: 1.12rem;
  line-height: 1.45;
}

.rejected-card h4 span {
  color: #cbd5e1;
  font-weight: 750;
}

.rejected-card ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #dbeafe;
  line-height: 1.78;
  font-size: 1rem;
}

.rejected-card li {
  margin: 0.28rem 0;
}

.summary-lines {
  margin: 0;
  padding-left: 1.25rem;
  color: #dbeafe;
  font-size: 1.02rem;
  line-height: 1.82;
}

.summary-lines li {
  margin: 0.3rem 0;
}

.vote-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.vote-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.1);
  font-size: 0.78rem;
  font-weight: 850;
}

.vote-chip.good,
.vote-opinion.good {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
}

.vote-chip.bad,
.vote-opinion.bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}

.vote-chip.neutral,
.vote-opinion.neutral {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.reason-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.reason-columns section,
.ai-review,
.vote-details {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem;
  background: rgba(15, 23, 42, 0.55);
  min-width: 0;
  overflow-wrap: anywhere;
}

.reason-columns h4 {
  margin: 0 0 0.35rem;
  color: #bae6fd;
  font-size: 0.86rem;
}

.reason-columns ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #cbd5e1;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reason-columns.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.6rem;
}

.decision-box {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.09), rgba(167, 139, 250, 0.08));
}

.decision-box.compact-box {
  background: rgba(15, 23, 42, 0.55);
}

.decision-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.decision-title strong,
.decision-box > strong {
  color: #bae6fd;
}

.decision-box ul {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.ai-review {
  margin-top: 0.85rem;
}

.ai-review strong {
  color: #bbf7d0;
}

.muted-panel strong {
  color: var(--muted);
}

.muted-panel span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
}

.vote-details {
  margin-top: 0.85rem;
}

.market-votes {
  margin-bottom: 1rem;
}

.vote-details summary {
  cursor: pointer;
  color: #7dd3fc;
  font-weight: 850;
}

.vote-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.vote-row {
  display: grid;
  grid-template-columns: 2rem 3.2rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.36);
  min-width: 0;
}

.vote-no {
  color: var(--muted);
  font-weight: 800;
}

.vote-opinion {
  font-weight: 900;
}

.vote-row small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.accuracy-table {
  display: grid;
  gap: 0.45rem;
}

.overview-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.overview-detail-grid section {
  min-width: 0;
}

.section-head h3 {
  margin: 0;
  color: #f8fafc;
}

.section-head p {
  margin: 0.25rem 0 0.75rem;
  line-height: 1.55;
}

.market-overview {
  display: grid;
  gap: 1rem;
}

.freshness-list {
  display: grid;
  gap: 0.5rem;
}

.freshness-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.28);
  min-width: 0;
}

.freshness-row strong {
  color: #dbeafe;
  min-width: 0;
  overflow-wrap: anywhere;
}

.freshness-row span {
  justify-self: end;
  font-weight: 850;
}

.freshness-update {
  justify-self: end;
  align-self: start;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  font-size: 0.82rem;
  box-shadow: none;
}

.freshness-row span.good {
  color: #bbf7d0;
}

.freshness-row span.neutral {
  color: #fde68a;
}

.freshness-row span.bad {
  color: #fecaca;
}

.freshness-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
}

.accuracy-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.85fr 0.95fr 0.8fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.28);
  min-width: 0;
}

.accuracy-row span {
  color: #dbeafe;
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

.accuracy-row small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}

.accuracy-head {
  background: rgba(56, 189, 248, 0.1);
}

.accuracy-row .good {
  color: #bbf7d0;
}

.accuracy-row .bad {
  color: #fecaca;
}

.accuracy-row .neutral {
  color: #fde68a;
}

.accuracy-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.2);
  overflow: hidden;
}

.accuracy-detail summary {
  list-style: none;
  cursor: pointer;
  border: 0;
  border-radius: 0;
}

.accuracy-detail summary::-webkit-details-marker {
  display: none;
}

.accuracy-detail[open] summary {
  border-bottom: 1px solid var(--line);
}

.accuracy-detail-list {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
}

.accuracy-event {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
  min-width: 0;
  overflow-wrap: anywhere;
}

.accuracy-event div:nth-child(2) {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 700;
}

.accuracy-event strong.good {
  color: #bbf7d0;
}

.accuracy-event strong.bad {
  color: #fecaca;
}

.accuracy-event strong.neutral {
  color: #fde68a;
}

.accuracy-event small,
.accuracy-event p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.mini {
  padding: 0.65rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
}

.mini strong {
  display: block;
  margin-top: 0.1rem;
  color: var(--text);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.premium-mini small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.premium-mini.premium-over strong,
.premium-result.premium-over {
  color: #fecaca;
}

.premium-mini.premium-slight-over strong,
.premium-result.premium-slight-over {
  color: #fde68a;
}

.premium-mini.premium-under strong,
.premium-result.premium-under {
  color: #86efac;
}

.premium-mini.premium-slight-under strong,
.premium-result.premium-slight-under {
  color: #bbf7d0;
}

.premium-mini.premium-flat strong,
.premium-result.premium-flat {
  color: #dbeafe;
}

.premium-result {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

.premium-result-head {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.premium-result ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.premium-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

.log-box {
  overflow: auto;
  min-height: 420px;
  max-height: 68vh;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #020617;
  color: #dbeafe;
  line-height: 1.55;
  white-space: pre-wrap;
}

.log-box.compact {
  min-height: 220px;
}

.action-card {
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.manual-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.manual-form label {
  display: grid;
  gap: 0.35rem;
  color: #dbeafe;
  font-weight: 700;
}

.manual-form .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
}

.section-note {
  margin: 0.35rem 0 0;
  color: #7dd3fc;
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.recommendation-mode-details {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.mode-effective-note,
.mode-option-detail {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.48);
  color: var(--muted);
  line-height: 1.55;
}

.mode-effective-note strong,
.mode-option-detail strong {
  color: var(--text);
}

.mode-option-detail.is-selected {
  border-color: rgba(56, 189, 248, 0.58);
  background: rgba(14, 116, 144, 0.16);
}

.mode-status-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  font-size: 0.78rem;
  font-weight: 800;
}

.mode-status-badge.is-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.history-progress-list {
  display: grid;
  gap: 0.65rem;
}

.history-progress-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(180px, 1.4fr);
  gap: 0.25rem 0.8rem;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.history-progress-row:first-child {
  border-top: 0;
}

.history-progress-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.manual-list {
  display: grid;
  gap: 0.85rem;
}

.manual-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.26);
  min-width: 0;
  overflow-wrap: anywhere;
}

.manual-item.expired {
  border-color: rgba(239, 68, 68, 0.5);
}

.manual-item.sold {
  opacity: 0.72;
}

.manual-note {
  margin: 0.75rem 0 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.manual-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.report-mode {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  color: #dbeafe;
  font-weight: 800;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.report-actions button {
  flex: 1 1 12rem;
}

.mail-schedule-list {
  display: grid;
  gap: 0.8rem;
}

.mail-schedule-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(2, 6, 23, 0.22);
}

.mail-schedule-head {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.mail-schedule-head strong {
  color: #f8fafc;
}

.mail-schedule-head button {
  padding: 0.55rem 0.75rem;
}

.schedule-time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0;
}

.schedule-time-presets button {
  min-width: 4.4rem;
  padding: 0.5rem 0.7rem;
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.mail-schedule-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mail-schedule-save-row .mail-schedule-status {
  flex: 1 1 24rem;
  margin: 0;
}

.mail-schedule-save {
  flex: 0 0 auto;
}

.report-preview {
  margin-top: 1rem;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
  color: #111827;
  padding: 1rem;
}

.report-pdf-frame {
  display: block;
  width: 100%;
  min-height: 76vh;
  border: 0;
  border-radius: 14px;
  background: #fff;
}

.report-preview-loading {
  display: grid;
  gap: 0.8rem;
  min-height: 14rem;
  place-content: center;
  padding: 1.5rem;
  text-align: center;
  color: #1e3a5f;
  background: #eff6ff;
  border-radius: 14px;
}

.report-preview-loading strong { font-size: 1.2rem; }
.report-preview-loading p { margin: 0; }
.report-preview-progress {
  height: 0.5rem;
  border-radius: 1rem;
  background: linear-gradient(90deg, #38bdf8, #dbeafe, #38bdf8);
  background-size: 200% 100%;
  animation: report-preview-wait 2s linear infinite;
}
@keyframes report-preview-wait { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .report-preview-progress { animation: none; }
}

.report-preview-error {
  display: grid;
  gap: 0.65rem;
  min-height: 14rem;
  place-content: center;
  padding: 2rem;
  text-align: center;
  color: #7f1d1d;
  background: #fff7ed;
  border: 2px solid #f97316;
  border-radius: 14px;
}

.report-preview-error strong {
  font-size: 1.15rem;
}

.danger-ghost {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(127, 29, 29, 0.28);
}

.report-preview .print-cover,
.report-preview .print-section {
  background: #fff;
  border: 1px solid #d9dee8;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.report-preview .print-output {
  color: #152033;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.62;
}

.report-preview .print-cover {
  border-top: 6px solid #1769e0;
  box-shadow: 0 8px 20px rgba(25, 43, 70, 0.06);
}

.report-preview .print-cover h1 {
  margin: 0 0 0.6rem;
  color: #101828;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.28;
}

.report-preview .print-section h2 {
  margin: 0 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dbe7f5;
  color: #12345a;
  font-size: 1.35rem;
  line-height: 1.4;
}

.report-preview .print-subtitle,
.report-preview .print-meta,
.report-preview .print-disclaimer,
.report-preview .print-note,
.report-preview .print-line {
  margin: 0 0 0.55rem;
  font-size: 0.98rem;
  line-height: 1.68;
  font-weight: 600;
  word-break: normal;
  overflow-wrap: break-word;
}

.report-preview .print-meta {
  color: #52627a;
}

.report-preview .print-note {
  padding: 0.6rem 0.75rem;
  border: 0.8px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 6px;
  background: #fafafa;
  color: #64748b;
  font-weight: 600;
}

.report-preview .print-table td.status-block {
  color: #ffffff;
  background: #dc2626;
  font-weight: 850;
  box-shadow: none;
  border-radius: 4px;
}

.report-preview .print-table td.status-pass {
  color: #ffffff;
  background: #15803d;
  font-weight: 850;
  box-shadow: none;
  border-radius: 4px;
}

.report-preview .print-table td.status-research {
  color: #ffffff;
  background: #ea580c;
  font-weight: 800;
  box-shadow: none;
  border-radius: 4px;
}

.report-preview .print-table td.status-neutral {
  color: #64748b;
  background: #f1f5f9;
  font-weight: 700;
  border-radius: 4px;
}

.report-preview .report-status-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  vertical-align: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.report-preview .report-status-danger { background: #b91c1c; }
.report-preview .report-status-ok { background: #166534; }
.report-preview .report-status-note { background: #c2410c; }
.report-preview .report-status-neutral { background: #64748b; }

.report-preview .report-integrity,
.report-preview .report-end {
  margin: 0.65rem 0.15rem 1rem;
  color: #52627a;
  font-size: 0.82rem;
  font-weight: 750;
}

.report-preview .report-visual-block h3 {
  margin: 0 0 0.35rem;
  color: #12345a;
  font-size: 1.08rem;
  line-height: 1.45;
}

.report-preview .chart-note,
.report-preview .visual-empty {
  margin: 0 0 0.7rem;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.62;
  font-weight: 750;
}

.report-preview .chart-warning {
  padding: 0.55rem 0.7rem;
  border: 0.8px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 5px;
  background: #fafafa;
  color: #64748b;
}

.report-preview .research-chart-svg,
.report-preview .pnl-chart {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.report-preview .research-chart-svg text,
.report-preview .pnl-chart text {
  fill: #334155;
  font-size: 12px;
  font-weight: 750;
}

.report-preview .research-chart-svg .chart-legend {
  font-size: 13px;
  font-weight: 850;
}

.report-preview .research-chart-svg .chart-axis-label {
  font-size: 12px;
  font-weight: 800;
}

.report-preview .print-eyebrow {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-preview h1,
.report-preview h2,
.report-preview p {
  overflow-wrap: anywhere;
}

.print-report-panel {
  display: none;
}

.report-preview .print-table,
.print-report-panel .print-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1.25px solid #64748b;
  border-radius: 6px;
  overflow: hidden;
}

.report-preview .print-table th,
.report-preview .print-table td,
.print-report-panel .print-table th,
.print-report-panel .print-table td {
  border: 0.55px solid #cbd5e1;
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  background: #fff;
}

.report-preview .print-table th,
.print-report-panel .print-table th {
  width: 24%;
  background: #eef2f7;
  color: #1d3555;
}

.report-preview .report-visual-block,
.print-report-panel .report-visual-block {
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1.25px solid #64748b;
  border-radius: 8px;
  break-inside: avoid;
}

/* Phase 6V — TWT85U derived observation: Level-3 informational, never BLOCK chrome */
.report-preview .twt85u-derived-section.level-3-info,
.print-report-panel .twt85u-derived-section.level-3-info,
.print-output .twt85u-derived-section.level-3-info {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.75rem;
  border: 1.05px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: none;
}

.report-preview .twt85u-derived-section.level-3-info > h2,
.print-report-panel .twt85u-derived-section.level-3-info > h2,
.print-output .twt85u-derived-section.level-3-info > h2 {
  margin: 0 0 0.45rem;
  color: #111827;
  font-size: 1.02rem;
  font-weight: 750;
}

.report-preview .twt85u-derived-section.level-3-info .print-table td,
.print-report-panel .twt85u-derived-section.level-3-info .print-table td,
.print-output .twt85u-derived-section.level-3-info .print-table td {
  background: #fff;
  color: #111827;
  font-weight: 650;
}

.report-preview .twt85u-derived-section.level-3-info .print-table td.status-block,
.print-report-panel .twt85u-derived-section.level-3-info .print-table td.status-block,
.print-output .twt85u-derived-section.level-3-info .print-table td.status-block {
  /* Keep availability notes quiet — never inherit strategy BLOCK badge */
  color: #334155;
  background: #f8fafc;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #94a3b8;
  border-radius: 4px;
}

/* Phase 6X — per-symbol derived detail card on TWSE holdings */
.manual-item .twt85u-symbol-detail,
.report-preview .twt85u-symbol-detail {
  margin: 0.7rem 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border: 1.05px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
}

.manual-item .twt85u-symbol-detail > h4,
.report-preview .twt85u-symbol-detail > h4 {
  margin: 0 0 0.4rem;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 750;
}

.manual-item .twt85u-detail-line,
.report-preview .twt85u-detail-line {
  margin: 0.18rem 0;
  color: #1f2937;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 650;
}

/* On-screen holdings use the console theme; print previews retain their palette. */
.manual-item .twt85u-symbol-detail {
  background: var(--panel-strong);
  border-color: var(--line);
}

.manual-item .twt85u-symbol-detail > h4 {
  color: var(--text);
}

.manual-item .twt85u-detail-line {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.report-preview .holding-pie-layout,
.print-report-panel .holding-pie-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: center;
  margin: 1rem 0;
}

.report-preview .holding-pie,
.print-report-panel .holding-pie {
  position: relative;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1;
}

.report-preview .holding-pie-svg,
.print-report-panel .holding-pie-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.report-preview .holding-pie > span,
.print-report-panel .holding-pie > span {
  position: absolute;
  inset: 32%;
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.35;
}

.report-preview .holding-pie > span strong,
.print-report-panel .holding-pie > span strong {
  color: #111827;
  font-size: 0.78rem;
}

.report-preview .holding-pie-legend,
.print-report-panel .holding-pie-legend {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-preview .holding-pie-legend li,
.print-report-panel .holding-pie-legend li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 54px 92px;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.78rem;
}

.report-preview .holding-pie-legend li > span:not(.pie-swatch),
.report-preview .holding-pie-legend li small,
.print-report-panel .holding-pie-legend li > span:not(.pie-swatch),
.print-report-panel .holding-pie-legend li small {
  text-align: right;
}

.report-preview .pie-swatch,
.print-report-panel .pie-swatch {
  display: block;
  width: 12px;
  height: 12px;
}

.report-preview .allocation-track-svg,
.print-report-panel .allocation-track-svg {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .report-preview .holding-pie-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .report-preview .holding-pie-legend {
    width: 100%;
  }
}

.status-block {
  color: #dc2626;
  font-weight: 800;
}

.status-pass {
  color: #15803d;
  font-weight: 800;
}

.status-research {
  color: #ea580c;
  font-weight: 800;
}

.status-neutral {
  color: #64748b;
  font-weight: 700;
}

.report-integrity,
.report-end {
  margin: 0.5rem 0;
  color: #475569;
  font-size: 0.8rem;
}



.import-button {
  margin-top: 1rem;
  width: 100%;
}

.pool-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.pool-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.26);
}

.symbol-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.symbol-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem 0.35rem 0.65rem;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(14, 165, 233, 0.12);
  font-weight: 800;
}

.symbol-chip button {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 999px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  box-shadow: none;
}

@media (max-width: 980px) {
  .shell {
    width: 100%;
  }

  .topbar {
    display: grid;
  }

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

  .grid.two,
  .help-grid,
  .overview-detail-grid,
  .reason-columns,
  .reason-columns.compact,
  .rejected-grid {
    grid-template-columns: 1fr;
  }

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

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

  .accuracy-head {
    display: none;
  }
}

@media (max-width: 760px) {
  .shell {
    padding-inline: 0.8rem;
  }

  .topbar,
  .card-title-row {
    display: grid;
  }

  .grid.two,
  .help-grid,
  .metric-list,
  .stats-grid,
  .mini-grid,
  .overview-detail-grid,
  .accuracy-row,
  .reason-columns,
  .reason-columns.compact,
  .rejected-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .review-readable {
    padding: 0.8rem;
    border-radius: 16px;
  }

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

  .freshness-row span,
  .freshness-update {
    justify-self: start;
  }

  .review-readable-title,
  .rejected-card h4 {
    font-size: 1rem;
  }

  .rejected-card ul {
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .shell {
    padding-inline: 0.7rem;
  }

  .topbar h1 {
    font-size: 1.75rem;
    line-height: 1.1;
  }

  .card,
  .pick,
  .manual-item,
  .pool-card {
    border-radius: 20px;
    padding: 1rem;
  }

  .pick-head {
    display: grid;
  }

  .pick .score {
    align-items: flex-start;
    min-width: 0;
    text-align: left;
  }

  .vote-row {
    grid-template-columns: 1.6rem minmax(2.6rem, auto) minmax(0, 1fr);
    gap: 0.4rem;
  }

  .mini-grid,
  .metric-list,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .pill,
  .badge,
  .vote-chip {
    font-size: 0.8rem;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  * {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .top-actions,
  .tabs,
  .report-actions,
  .manual-actions,
  button {
    display: none !important;
  }

  body.printing-report .shell > *:not(#printReportPanel) {
    display: none !important;
  }

  body.printing-report .print-report-panel {
    display: block !important;
    width: 100%;
    padding: 0;
    border: 0;
  }

  .print-report-panel .holding-pie-layout {
    grid-template-columns: 48mm minmax(0, 1fr);
  }

  .print-report-panel .holding-pie {
    width: 48mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-cover {
    border-bottom: 2px solid #000;
    padding-bottom: 10mm;
    margin-bottom: 8mm;
    break-after: avoid;
  }

  .print-eyebrow {
    margin: 0 0 3mm;
    font-size: 9pt;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-cover h1 {
    margin: 0 0 3mm;
    font-size: 24pt;
    line-height: 1.2;
    letter-spacing: -0.03em;
  }

  .print-subtitle,
  .print-meta,
  .print-disclaimer,
  .print-note {
    margin: 1.8mm 0;
    font-size: 10.5pt;
    line-height: 1.55;
  }

  .print-note {
    padding: 2mm 3mm;
    border: 1px solid #000;
    border-radius: 0;
  }

  .print-section {
    margin: 0 0 7mm;
    padding: 4mm;
    border: 1px solid #000;
    break-inside: auto;
  }

  .print-break-soft {
    break-inside: auto;
  }

  .print-section h2 {
    margin: 0 0 3mm;
    break-after: avoid;
    padding-bottom: 2mm;
    border-bottom: 1px solid #000;
    font-size: 15pt;
    line-height: 1.25;
  }

  .print-section-body {
    columns: 1;
  }

  .print-table tr {
    break-inside: avoid;
  }

  .print-line {
    margin: 0 0 1.5mm;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
    font-size: 10.3pt;
    line-height: 1.5;
    font-weight: 520;
    letter-spacing: 0;
    color: #000 !important;
    background: #fff !important;
  }

  .print-line.indent-1 {
    margin-left: 4mm;
    font-size: 9.8pt;
  }

  .print-line.indent-2 {
    margin-left: 8mm;
    font-size: 9.4pt;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  body.printing-report .panel {
    display: none !important;
  }

  .panel {
    display: none !important;
  }

  body:not(.printing-report) #portfolio.panel {
    display: grid !important;
  }

  .card,
  .metric,
  .manual-item {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .muted,
  .metric span,
  .metric small,
  .manual-note {
    color: #111 !important;
  }

  .eyebrow,
  h1,
  h2,
  h3,
  .metric strong {
    color: #000 !important;
  }
}

/* Service/data states are separate from investment return colours. */
.status-text { font-weight: 700; }
.status-text-good { color: #4ade80; }
.status-text-bad { color: #f87171; }
.status-text-warn { color: #facc15; }
.status-text-neutral { color: var(--muted); }

/* Research report only: airy, white A4; application status colours unchanged. */
.report-preview .print-output, .print-report-panel { background:#fff; color:#1e293b; }
.report-preview .report-visual-block, .print-report-panel .report-visual-block { border:0; border-bottom:.5px solid #e2e8f0; border-radius:0; padding:18px 0; margin:0 0 26px; background:#fff; }
.report-preview .report-visual-block h3, .print-report-panel .report-visual-block h3 { background:#fff; border:0; padding:0; font-size:17px; color:#1e293b; }
.report-preview .chart-note, .print-report-panel .chart-note { color:#64748b; font-weight:400; line-height:1.6; }
.chart-summary { color:#475569; font-size:13px; line-height:1.6; margin:8px 0; font-variant-numeric:tabular-nums; }
.print-output .pnl-up, .report-preview .pnl-up { color:#c2413b; }
.print-output .pnl-down, .report-preview .pnl-down { color:#16825d; }
.print-output .pnl-flat, .report-preview .pnl-flat { color:#94a3b8; }
 .report-preview .print-table td.status-block { color:#7f1d1d; background:#fff7f7; }
.report-preview .print-table td.status-pass { color:#334155; background:#f8fafc; }
.report-preview .print-table td.status-research { color:#b45309; background:#fff7ed; }
.report-preview .report-status-danger { background:#7f1d1d; }
.report-preview .report-status-ok { background:#64748b; }
.report-preview .report-status-note { background:#b45309; }
@media print { .print-output { background:#fff; } .print-output .report-visual-block { break-inside:avoid; } }

/* Report-wide semantic overrides: warnings never use profit/loss tokens. */
.print-output .print-table td.status-block { color:#7f1d1d; background:#fff7f7; }
.print-output .print-table td.status-research { color:#b45309; background:#fff7ed; }
.print-output .report-status-danger { background:#7f1d1d; }
.print-output .report-status-note { background:#b45309; }

/* Allocation uses one neutral data color and direct labels, in both screen/PDF preview. */
.holding-allocation-bars { list-style:none; padding:0; margin:12px 0; display:grid; gap:12px; }
.holding-allocation-bars li { display:grid; grid-template-columns:minmax(120px,1.2fr) minmax(80px,1fr) 50px 105px; gap:12px; align-items:center; font-size:13px; }
.holding-allocation-bars li span,.holding-allocation-bars li small { text-align:right; color:#475569; }
.holding-allocation-bars .allocation-track-svg { width:100%; height:10px; margin:0; }
@media(max-width:600px) { .holding-allocation-bars li { grid-template-columns:minmax(0,1fr) 52px 100px; gap:6px; } .holding-allocation-bars .allocation-track-svg { grid-row:2; grid-column:1/-1; } }
