:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17201c;
  --muted: #65706b;
  --line: #d9e0dd;
  --teal: #1f7a68;
  --teal-soft: #dceee9;
  --amber: #b57a1c;
  --amber-soft: #f4ead7;
  --red: #ad3d35;
  --red-soft: #f2dedb;
  --indigo: #4f5f9f;
  --green: #2c8a4a;
  --shadow: 0 16px 48px rgba(23, 32, 28, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  border-right: 1px solid var(--line);
  background: #eef3f1;
  padding: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 20px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

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

.report-item {
  width: 100%;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.report-item.is-active {
  border-color: var(--teal);
  box-shadow: inset 4px 0 0 var(--teal);
}

.report-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.report-item span {
  display: inline-flex;
  margin-right: 6px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf0f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.top-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.status-cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 560px;
}

.chip,
.data-badge,
.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.chip {
  background: #e8edf4;
  color: var(--indigo);
}

.data-badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.data-badge.muted {
  background: #edf0f4;
  color: var(--muted);
}

.score-pill {
  background: var(--teal-soft);
  color: var(--teal);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eeee;
  width: fit-content;
}

.tab {
  min-width: 76px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(23, 32, 28, 0.08);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.75fr) minmax(240px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.decision-panel,
.quote-panel,
.pipeline-panel,
.score-section,
.radar-section,
.thesis-section,
.perspective-card,
.kline-card,
.table-wrap,
.risk-layout > section,
.markdown-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.decision-panel,
.quote-panel,
.pipeline-panel {
  min-height: 186px;
  padding: 18px;
}

.panel-heading,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  margin-bottom: 16px;
}

.section-title p,
.quote-meta,
.pipeline-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.verdict-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 16px;
}

.verdict-row div {
  min-height: 86px;
  padding: 14px;
  border-radius: 8px;
  background: #f4f7f6;
}

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

.verdict-row strong {
  font-size: 22px;
}

.reason {
  margin-bottom: 0;
  color: #34413b;
  line-height: 1.7;
}

.quote-number {
  margin: 28px 0 8px;
  color: var(--teal);
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  margin-top: 34px;
  border-radius: 999px;
  background: #e7ebe8;
}

.progress-track span {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--teal));
}

.visual-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 0.85fr) minmax(300px, 0.9fr);
  gap: 14px;
}

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

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

.dca-icon-card,
.dca-card {
  min-height: 168px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--indigo);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.dca-icon-card {
  grid-row: span 2;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 350px;
  border-left-color: var(--teal);
  background: #f6faf8;
}

.dca-icon-card.guard {
  border-left-color: var(--red);
}

.dca-icon-card.opportunity {
  border-left-color: var(--green);
}

.dca-card.starter {
  border-left-color: var(--teal);
}

.dca-card.opportunity {
  border-left-color: var(--green);
}

.dca-card.guard {
  border-left-color: var(--red);
}

.dca-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dca-head h4 {
  margin: 0;
  font-size: 18px;
}

.dca-head span {
  border-radius: 999px;
  background: #edf0f4;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.dca-card.starter .dca-head span {
  background: var(--teal-soft);
  color: var(--teal);
}

.dca-card.opportunity .dca-head span {
  background: #dfeee4;
  color: var(--green);
}

.dca-card.guard .dca-head span {
  background: var(--red-soft);
  color: var(--red);
}

.dca-icon-visual {
  display: grid;
  place-items: center;
}

.dca-icon-ring {
  position: relative;
  width: min(220px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(
      from -35deg,
      var(--teal) 0deg 88deg,
      var(--green) 88deg 168deg,
      var(--red) 168deg 272deg,
      var(--amber) 272deg 360deg
    );
  box-shadow:
    inset 0 0 0 1px rgba(23, 32, 28, 0.08),
    0 16px 38px rgba(23, 32, 28, 0.12);
}

.dca-icon-ring::before {
  position: absolute;
  inset: 20px;
  border-radius: inherit;
  background: var(--panel);
  content: "";
}

.dca-icon-center {
  position: absolute;
  inset: 42px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #f8fbfa;
  color: var(--ink);
  text-align: center;
}

.dca-icon-center span,
.dca-icon-center em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.dca-icon-center strong {
  margin: 6px 0;
  color: var(--teal);
  font-size: 28px;
  line-height: 1.05;
}

.dca-icon-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dca-icon-metric {
  border-radius: 8px;
  background: #f0f4f3;
  padding: 10px;
}

.dca-icon-metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dca-icon-metric strong {
  color: #26342e;
  font-size: 13px;
  line-height: 1.35;
}

.dca-icon-metric.starter {
  background: var(--teal-soft);
}

.dca-icon-metric.opportunity {
  background: #dfeee4;
}

.dca-icon-metric.guard {
  background: var(--red-soft);
}

.dca-icon-note {
  margin-bottom: 0;
  color: #3b4943;
  font-size: 13px;
  line-height: 1.6;
}

.dca-advice {
  margin-bottom: 10px;
  color: #24322c;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}

.dca-card:not(.primary) .dca-advice {
  font-size: 16px;
}

.dca-evidence {
  margin-bottom: 0;
  color: #3b4943;
  font-size: 14px;
  line-height: 1.65;
}

.market-signal-section {
  margin-bottom: 14px;
}

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

.market-signal-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.market-signal-card.bearish {
  border-top-color: var(--red);
}

.market-signal-card.bullish {
  border-top-color: var(--green);
}

.market-signal-card.combined {
  border-top-color: var(--indigo);
  background: #f7f9fb;
}

.market-signal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.market-signal-head span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.market-signal-head strong {
  border-radius: 999px;
  background: #edf0f4;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.market-signal-card.bearish .market-signal-head strong {
  background: var(--red-soft);
  color: var(--red);
}

.market-signal-card.bullish .market-signal-head strong {
  background: #dfeee4;
  color: var(--green);
}

.market-signal-card.combined .market-signal-head strong {
  background: #e8edf4;
  color: var(--indigo);
}

.market-signal-verdict {
  min-height: 52px;
  margin-bottom: 10px;
  color: #26342e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.market-signal-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.market-signal-evidence-item {
  border-radius: 8px;
  background: #f6f8f8;
  padding: 10px;
  color: #34413b;
  font-size: 13px;
  line-height: 1.5;
}

.market-signal-evidence-item strong {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
}

.market-signal-evidence-item.bull strong {
  background: var(--green);
}

.market-signal-evidence-item.bear strong {
  background: var(--red);
}

.market-signal-levels {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.score-section,
.radar-section,
.thesis-section {
  padding: 20px;
}

.score-bars {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(120px, 1fr) 42px;
  align-items: center;
  gap: 12px;
}

.score-row span:first-child {
  color: #34413b;
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #edf0f1;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.score-row span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.thesis-grid {
  display: grid;
  gap: 10px;
}

.radar-wrap {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
}

.radar-chart {
  display: block;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
}

.radar-grid-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.radar-axis {
  stroke: #c8d2cf;
  stroke-width: 1;
}

.radar-area {
  fill: rgba(31, 122, 104, 0.2);
  stroke: var(--teal);
  stroke-linejoin: round;
  stroke-width: 3;
}

.radar-point {
  fill: var(--teal);
  stroke: #fff;
  stroke-width: 2;
}

.radar-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.radar-legend {
  display: grid;
  gap: 8px;
}

.radar-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #34413b;
  font-size: 13px;
}

.radar-legend-item strong {
  overflow-wrap: anywhere;
}

.radar-legend-item span:last-child {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.radar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--teal);
}

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

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

.perspective-card {
  padding: 18px;
}

.kline-card {
  padding: 18px;
}

.perspective-header {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.perspective-header h4 {
  margin: 0;
  font-size: 20px;
}

.perspective-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.perspective-score {
  border-radius: 999px;
  background: #edf0f4;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.perspective-header span {
  display: block;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.perspective-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.perspective-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.perspective-block p {
  margin-bottom: 0;
  color: #34413b;
  font-size: 14px;
  line-height: 1.65;
}

.kline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kline-header h4 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
}

.kline-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

.kline-header code {
  border-radius: 5px;
  background: #eef2f1;
  padding: 1px 4px;
}

.kline-status {
  min-height: 76px;
  border-radius: 8px;
  background: #f4f7f6;
  margin-bottom: 14px;
  padding: 12px;
  color: #34413b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.kline-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kline-block {
  border-top: 3px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
}

.kline-block.bull {
  border-color: var(--green);
}

.kline-block.bear {
  border-color: var(--red);
}

.kline-block.levels {
  border-color: var(--indigo);
}

.kline-block.verdict {
  border-color: var(--amber);
}

.kline-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.kline-block p {
  margin-bottom: 0;
  color: #34413b;
  font-size: 14px;
  line-height: 1.6;
}

.thesis-card,
.risk-item,
.follow-item {
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f6f8f8;
  padding: 13px 14px;
}

.thesis-card h4,
.risk-item h4,
.follow-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.thesis-card p,
.risk-item p,
.follow-item p {
  margin-bottom: 0;
  color: #394740;
  font-size: 14px;
  line-height: 1.6;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.55;
}

th {
  position: sticky;
  top: 0;
  background: #f1f5f4;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td a,
.markdown-view a {
  color: var(--teal);
  overflow-wrap: anywhere;
}

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

.risk-layout > section {
  padding: 20px;
}

.risk-list,
.follow-list {
  display: grid;
  gap: 10px;
}

.risk-item {
  border-color: var(--red);
}

.follow-item {
  border-color: var(--indigo);
}

.markdown-view {
  padding: 24px;
  line-height: 1.75;
}

.markdown-view h1 {
  font-size: 28px;
}

.markdown-view h2 {
  margin-top: 32px;
  font-size: 22px;
}

.markdown-view ul {
  padding-left: 20px;
}

.markdown-view code {
  border-radius: 5px;
  background: #eef2f1;
  padding: 2px 5px;
}

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-grid,
  .dca-grid,
  .market-signal-grid,
  .visual-grid,
  .perspective-grid,
  .kline-grid,
  .risk-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .workspace,
  .side-panel {
    padding: 18px;
  }

  .top-strip,
  .panel-heading,
  .section-title {
    display: grid;
  }

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

  .tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .tab {
    width: 100%;
    min-width: 0;
    padding-inline: 4px;
  }

  .verdict-row,
  .score-row {
    grid-template-columns: 1fr;
  }

  .score-row span:last-child {
    text-align: left;
  }

  .market-signal-grid {
    gap: 10px;
  }

  .market-signal-card {
    padding: 14px;
  }

  .dca-icon-card {
    grid-row: auto;
    min-height: 0;
  }

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

  .dca-icon-ring {
    width: min(210px, 100%);
  }

  .dca-advice {
    font-size: 18px;
  }

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

  .radar-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .radar-legend {
    width: 100%;
  }

  .kline-header {
    display: grid;
  }

  .kline-header span {
    text-align: left;
  }

  .kline-detail-grid {
    grid-template-columns: 1fr;
  }
}
