:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --line: #dbe3ef;
  --line-strong: #c7d2e2;
  --text: #172033;
  --muted: #617089;
  --muted-2: #8793a8;
  --teal: #82b366;
  --blue: #6c8ebf;
  --violet: #9673a6;
  --amber: #d79b00;
  --green: #82b366;
  --red: #b85450;
  --blue-ink: #3f5f8f;
  --green-ink: #4f713e;
  --amber-ink: #795600;
  --red-ink: #7b3a36;
  --blue-soft: #edf3fb;
  --green-soft: #eef6eb;
  --amber-soft: #fff7df;
  --red-soft: #f8eeee;
  --shadow: 0 18px 42px rgba(38, 50, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Arial Unicode MS", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding: 18px 20px 28px;
}

.standalone-topic {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 22px 32px;
}

.standalone-topic .tab-bar,
.standalone-topic .entity-selector {
  display: none;
}

.standalone-topic .terms-panel {
  margin-top: 10px;
}

.standalone-topic .top-detail-stack {
  margin-top: 14px;
}

.standalone-topic #top-details .evidence-table {
  min-width: 820px;
}

.standalone-topic #top-details .evidence-table th,
.standalone-topic #top-details .evidence-table td {
  white-space: nowrap;
  word-break: normal;
}

.standalone-topic .workspace {
  padding-top: 16px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 14px 4px 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.range-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.range-presets,
.custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-btn,
.apply-btn,
.tab-btn,
.entity-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.range-btn.active,
.tab-btn.active,
.entity-btn.active {
  border-color: rgba(108, 142, 191, 0.38);
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-weight: 700;
}

.apply-btn {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.date-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.date-field span {
  flex: 0 0 auto;
}

.date-field input {
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 8px;
}

.tab-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0;
}

.tab-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tab-btn {
  flex: 0 0 auto;
  min-width: 110px;
}

.tabs.sorting .tab-btn {
  cursor: grab;
}

.tabs.sorting .tab-item {
  touch-action: none;
  user-select: none;
}

.tab-item.dragging .tab-btn {
  opacity: 0.46;
}

.tab-item.drag-over .tab-btn {
  border-color: rgba(108, 142, 191, 0.48);
  box-shadow: inset 0 0 0 1px rgba(108, 142, 191, 0.24), 0 8px 18px rgba(108, 142, 191, 0.14);
}

.tab-move-controls {
  display: none;
  align-items: center;
  gap: 3px;
}

.tabs.sorting .tab-move-controls {
  display: inline-flex;
}

.tab-move-btn,
.tab-order-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}

.tab-move-btn {
  width: 30px;
  min-width: 30px;
  height: 34px;
  padding: 0;
  font-weight: 760;
}

.tab-move-btn:disabled,
.tab-order-btn:disabled {
  cursor: default;
  opacity: 0.42;
}

.tab-order-actions {
  display: flex;
  gap: 6px;
}

.tab-order-btn {
  min-height: 34px;
  padding: 7px 11px;
  white-space: nowrap;
}

.tab-order-btn[aria-pressed="true"] {
  border-color: rgba(108, 142, 191, 0.38);
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-weight: 700;
}

.tab-order-btn.muted {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  padding-top: 18px;
}

.workspace.full-width {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.full-width .side-rail {
  display: none;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-block,
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-block {
  padding: 14px;
}

.section-title {
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.summary-block h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.summary-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
  font-size: 13px;
}

#tab-subtitle {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

#tab-summary {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

#tab-subtitle:empty,
#tab-summary:empty {
  display: none;
}

.metric-list {
  display: grid;
  gap: 11px;
}

.readout-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.basic-card {
  border-color: #d7e8fb;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.tight-grid {
  gap: 7px;
}

.readout-cell {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #edf2f7;
  border-radius: 7px;
  background: #ffffff;
}

.readout-cell.primary-cell,
.readout-cell.wide-cell {
  grid-column: 1 / -1;
}

.readout-cell span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.readout-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.readout-cell strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.readout-cell.primary-cell strong {
  font-size: 18px;
}

.readout-cell small {
  margin-top: 3px;
}

.bound-card-v2 {
  border-color: rgba(108, 142, 191, 0.22);
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
}

.bound-row-v2 {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.bound-row-v2 + .bound-row-v2 {
  padding-top: 10px;
  border-top: 1px solid #e5eef6;
}

.bound-row-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.bound-row-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bound-row-head span {
  flex: 0 0 auto;
  max-width: 120px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 760;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compact-track {
  margin: 7px 2px 2px;
}

.boundary-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.boundary-extra span {
  display: inline-flex;
  gap: 5px;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 720;
}

.boundary-extra em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.metric-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e3ebf5;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.price-metric {
  border-color: #d7e8fb;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.metric-label {
  color: var(--muted-2);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.metric-date {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.metric-value {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 750;
}

.metric-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.valuation-card {
  padding: 12px;
}

.valuation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.valuation-cell {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #edf2f7;
  border-radius: 7px;
  background: #ffffff;
}

.valuation-cell.market-cap-cell {
  grid-column: 1 / -1;
}

.valuation-cell span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.valuation-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.valuation-cell strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.valuation-cell small {
  margin-top: 3px;
}

.bound-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(108, 142, 191, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bound-card.partial {
  border-color: #d7e3f1;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.bound-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bound-kind {
  flex: 0 0 auto;
  max-width: 110px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.partial .bound-kind {
  background: #eef4fb;
  color: #475569;
}

.bound-summary {
  margin-top: 3px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.bound-track {
  position: relative;
  height: 9px;
  margin: 15px 2px 8px;
  border-radius: 999px;
  background: #e7eef7;
  overflow: visible;
}

.bound-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pos);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--blue) 100%);
}

.bound-marker {
  position: absolute;
  top: 50%;
  left: var(--pos);
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  transform: translate(-50%, -50%);
}

.bound-scale,
.bound-missing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.bound-scale span,
.bound-missing span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bound-scale span:nth-child(2),
.bound-missing span:nth-child(2) {
  text-align: center;
}

.bound-scale span:nth-child(3),
.bound-missing span:nth-child(3) {
  text-align: right;
}

.bound-missing {
  grid-template-columns: 1fr;
  padding: 9px 10px;
  border: 1px dashed #cbd8e8;
  border-radius: 8px;
  background: #f8fbff;
}

.bound-missing span:nth-child(2),
.bound-missing span:nth-child(3) {
  text-align: left;
}

.bound-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.bound-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 760;
}

.bound-chip.muted {
  background: #f1f5f9;
  color: #475569;
}

.bound-chip em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.bound-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.deviation-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.deviation-title {
  margin-top: 3px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.deviation-row,
.deviation-table-block {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #e8eef6;
}

.deviation-kind {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

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

.deviation-values span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f1f6fb;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.deviation-values em {
  display: inline;
  margin-bottom: 0;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
}

.deviation-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: hidden;
  border-radius: 8px;
  background: #f1f6fb;
  font-size: 12px;
}

.deviation-table th,
.deviation-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e3ebf5;
  text-align: left;
  white-space: nowrap;
}

.deviation-table th {
  color: var(--muted);
  font-weight: 650;
}

.deviation-table td {
  color: var(--text);
  font-weight: 760;
}

.deviation-table tr:last-child td {
  border-bottom: 0;
}

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

.entity-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}

.entity-selector:empty {
  display: none;
}

.traffic-light-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(38, 50, 56, 0.07);
}

.traffic-light-panel:not(.hidden) + .workspace {
  padding-top: 4px;
}

.traffic-main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.traffic-dot {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.24);
  background: #94a3b8;
}

.traffic-copy {
  min-width: 0;
}

.traffic-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.traffic-title-row strong {
  font-size: 16px;
  line-height: 1.2;
}

.traffic-title-row small,
.traffic-drivers {
  color: var(--muted);
  font-size: 12px;
}

.traffic-scores,
.traffic-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.traffic-chip,
.traffic-drivers span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  line-height: 1.2;
}

.traffic-chip em {
  color: var(--muted);
  font-style: normal;
  font-weight: 680;
}

.traffic-yellow {
  border-color: rgba(215, 155, 0, 0.38);
  background: linear-gradient(180deg, #fffdf3 0%, var(--amber-soft) 100%);
}

.traffic-yellow .traffic-dot {
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(215, 155, 0, 0.24);
}

.traffic-yellow .traffic-title-row strong {
  color: var(--amber-ink);
}

.traffic-green {
  border-color: rgba(130, 179, 102, 0.36);
  background: linear-gradient(180deg, #fbfff8 0%, var(--green-soft) 100%);
}

.traffic-green .traffic-dot {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(130, 179, 102, 0.24);
}

.traffic-green .traffic-title-row strong {
  color: var(--green-ink);
}

.traffic-neutral {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.terms-panel {
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 28px rgba(38, 50, 56, 0.06);
}

.terms-title {
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 760;
}

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

.term-chip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.term-chip em {
  flex: 0 0 auto;
  color: var(--text);
  font-style: normal;
  font-weight: 780;
}

.top-detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.chart-stack {
  display: grid;
  gap: 14px;
}

.chart-card {
  overflow: hidden;
  scroll-margin-top: 16px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
}

.chart-title {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 16px;
  font-weight: 760;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chart-note {
  flex: 1 1 280px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.anchor-btn {
  flex: 0 0 auto;
  justify-self: start;
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid #d7e3f1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.anchor-btn:hover,
.anchor-btn:focus-visible {
  border-color: rgba(108, 142, 191, 0.42);
  color: var(--blue-ink);
  outline: none;
}

.anchor-highlight {
  box-shadow: 0 0 0 2px rgba(108, 142, 191, 0.26), var(--shadow);
}

.series-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.series-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #d7e3f1;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.chart-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 9px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.chart-badge-row.hidden {
  display: none;
}

.chart-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #d7e3f1;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.chart-badge em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.series-toggle i {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  flex: 0 0 auto;
}

.series-toggle.off {
  color: var(--muted);
  background: #f4f7fb;
  opacity: 0.62;
}

.series-toggle.off i {
  background: #94a3b8 !important;
}

.chart-box {
  position: relative;
  height: 372px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.chart-card-large .chart-box {
  height: 486px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.cycle-band {
  fill: rgba(108, 142, 191, 0.10);
  stroke: none;
}

.confidence-band {
  fill: rgba(150, 115, 166, 0.10);
  stroke: none;
  pointer-events: none;
}

.bar-rect {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 1;
  shape-rendering: geometricPrecision;
}

.bar-label {
  fill: #475569;
  font-size: 10.5px;
  font-weight: 760;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.vertical-bar-label {
  fill: #334155;
  font-size: 9px;
  stroke-width: 2.4px;
}

.bar-growth-label {
  fill: #64748b;
  font-size: 9.5px;
  font-weight: 720;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.pie-slice {
  cursor: pointer;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.pie-slice:hover,
.pie-slice:focus-visible {
  filter: brightness(1.04);
  outline: none;
  stroke: rgba(15, 23, 42, 0.36);
  stroke-width: 1.8;
}

.pie-leader-line {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 1;
}

.pie-label {
  fill: #334155;
  font-size: 11px;
  font-weight: 760;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-linejoin: round;
  stroke-width: 3.2px;
}

.pie-footnote {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.cycle-band-label {
  fill: rgba(71, 85, 105, 0.78);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.axis-title {
  fill: #475569;
  font-size: 11px;
  font-weight: 760;
  pointer-events: none;
}

.right-axis-title {
  text-anchor: start;
}

.right-axis-label {
  fill: #475569;
  text-anchor: start;
}

.right-axis-line {
  stroke: #cbd5e1;
}

.grid-line {
  stroke: #e8eef6;
  stroke-width: 1;
}

.axis-line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.zero-line {
  stroke: #9aa8ba;
  stroke-width: 1;
  stroke-dasharray: 5 5;
  opacity: 0.8;
}

.right-zero-line {
  stroke: #cbd5e1;
  stroke-dasharray: 2 5;
  opacity: 0.82;
}

.hidden-zero {
  display: none;
}

.hover-line {
  stroke: #94a3b8;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.reference-line,
.event-line {
  stroke-width: 1;
  opacity: 0.92;
}

.current-value-line {
  stroke-width: 1.15;
  stroke-dasharray: 6 5;
  opacity: 0.96;
  pointer-events: none;
}

.current-value-axis-label {
  font-size: 10.5px;
  font-weight: 760;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.reference-label,
.event-label,
.marker-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.point-value-label {
  font-size: 10.5px;
  font-weight: 760;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 3.4px;
}

.chart-caption {
  padding: 9px 14px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  background: #fbfdff;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chart-caption-list ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-caption-list li {
  position: relative;
  padding-left: 12px;
}

.chart-caption-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.63em;
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: #94a3b8;
}

.tooltip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 14px 9px;
  border-top: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  font-size: 12px;
  pointer-events: none;
}

.tooltip.hidden {
  display: none;
}

.tooltip-date {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.tooltip-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  line-height: 1.45;
  white-space: nowrap;
}

.tooltip-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-row strong {
  font-weight: 760;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 99px;
  margin-right: 6px;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.load-error {
  display: grid;
  gap: 12px;
  align-items: start;
}

.retry-btn {
  width: fit-content;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.retry-btn:hover {
  background: var(--panel-strong);
}

.detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 16px;
}

.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 760;
}

.detail-title span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-note {
  padding: 8px 14px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.judgment-detail-card,
.progress-detail-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.judgment-detail-card.judgment-top {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.judgment-detail-card.judgment-bottom {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf4 100%);
}

.judgment-scale-note {
  margin: 8px 14px 0;
  padding: 7px 9px;
  border: 1px solid #dbe6f4;
  border-radius: 7px;
  background: #f7fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.judgment-top .judgment-scale-note {
  border-color: rgba(215, 155, 0, 0.32);
  background: #fff8e8;
  color: var(--amber-ink);
}

.judgment-bottom .judgment-scale-note {
  border-color: rgba(130, 179, 102, 0.34);
  background: #f4fbef;
  color: var(--green-ink);
}

.progress-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px 4px;
}

.progress-summary-cell {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #dbe6f4;
  border-radius: 8px;
  background: #ffffff;
}

.progress-summary-cell span,
.progress-summary-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.progress-summary-cell strong {
  display: block;
  margin: 3px 0 2px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.progress-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 14px 14px;
}

.progress-group {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e1e9f5;
  border-radius: 8px;
  background: #ffffff;
}

.progress-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-group-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.progress-group-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.progress-row-stack {
  display: grid;
  gap: 8px;
}

.progress-row {
  min-width: 0;
}

.progress-row-top,
.progress-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-row-top span {
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.progress-row-top strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
}

.progress-track {
  position: relative;
  height: 10px;
  margin: 14px 0 4px;
  border-radius: 999px;
  background: #e7eef7;
  overflow: visible;
}

.progress-track i {
  display: block;
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: inherit;
  background: #6c8ebf;
}

.progress-marker {
  position: absolute;
  z-index: 3;
  top: -17px;
  bottom: -5px;
  width: 34px;
  transform: translateX(-50%);
  pointer-events: none;
}

.progress-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
}

.progress-marker b {
  position: absolute;
  left: 50%;
  top: 0;
  padding: 1px 4px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 800;
  transform: translateX(-50%);
  white-space: nowrap;
}

.judgment-top .progress-track i {
  background: var(--amber);
}

.judgment-bottom .progress-track i {
  background: var(--green);
}

.progress-row-foot span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.table-wrap {
  overflow-x: auto;
}

.evidence-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

.evidence-table th,
.evidence-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.evidence-table th {
  color: #334155;
  background: #f7fafc;
  font-weight: 760;
  white-space: nowrap;
}

.evidence-table td {
  color: var(--muted);
  max-width: 320px;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-detail .evidence-table {
  min-width: 980px;
}

.compact-detail .evidence-table th,
.compact-detail .evidence-table td {
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.35;
}

.evidence-table td.multiline-cell {
  min-width: 260px;
  max-width: 420px;
  text-align: left !important;
  white-space: normal !important;
  line-height: 1.55;
}

.compact-detail .evidence-table td.multiline-cell {
  font-size: 12px;
  line-height: 1.58;
}

.matrix-detail .evidence-table {
  min-width: 1180px;
}

.matrix-detail .evidence-table td:not(:first-child),
.matrix-detail .evidence-table th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.matrix-detail .evidence-table td:first-child,
.matrix-detail .evidence-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.matrix-detail .evidence-table th:first-child {
  z-index: 2;
  background: #f7fafc;
}

.matrix-detail .evidence-table .probability-max {
  background: #e8f3ff;
  color: #0f4f94;
  font-weight: 700;
}

.detail-list {
  margin: 0;
  padding: 12px 18px 14px 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 960px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .range-panel {
    justify-content: flex-start;
  }

  .tab-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tab-order-actions {
    justify-content: flex-start;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .side-rail {
    order: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .main-panel {
    order: 2;
  }

  .progress-summary-grid,
  .progress-groups {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    gap: 10px;
    padding: 8px 2px 10px;
  }

  .eyebrow {
    font-size: 12px;
    margin-bottom: 3px;
  }

  h1 {
    font-size: 25px;
  }

  .range-panel {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 7px;
  }

  .progress-summary-grid,
  .progress-groups {
    grid-template-columns: 1fr;
    padding-left: 10px;
    padding-right: 10px;
  }

  .progress-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .progress-group-head span {
    text-align: left;
    white-space: normal;
  }

  .chart-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
    padding: 12px 12px 7px;
  }

  .chart-title {
    white-space: normal;
    line-height: 1.25;
    font-size: 15px;
  }

  .chart-note {
    text-align: left;
    font-size: 11px;
  }

  .chart-box {
    height: 336px;
  }

  .chart-card-large .chart-box {
    height: 390px;
  }

  .range-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .custom-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 64px;
    gap: 6px;
    width: 100%;
    align-items: end;
  }

  .date-field {
    display: grid;
    gap: 3px;
    min-width: 0;
    width: 100%;
    font-size: 11px;
  }

  .date-field input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 4px 6px;
    font-size: 13px;
  }

  .apply-btn,
  .range-btn {
    width: 100%;
    min-height: 34px;
    padding: 6px 7px;
    font-size: 14px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 6px 0 4px;
  }

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

  .tab-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .tabs.sorting .tab-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
  }

  .tab-btn {
    min-width: 0;
    width: 100%;
    padding: 7px 6px;
    font-size: 14px;
  }

  .tab-move-controls {
    gap: 2px;
  }

  .tab-move-btn {
    width: 25px;
    min-width: 25px;
    height: 34px;
    border-radius: 7px;
    font-size: 12px;
  }

  .tab-order-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .tab-order-btn {
    width: 100%;
  }

  .workspace {
    gap: 12px;
    padding-top: 12px;
  }

  .entity-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }

  .traffic-light-panel {
    padding: 11px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .traffic-main {
    gap: 9px;
  }

  .traffic-title-row strong {
    font-size: 15px;
  }

  .traffic-chip,
  .traffic-drivers span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .terms-panel {
    max-height: none;
    overflow-y: visible;
    padding: 10px;
    margin-top: 10px;
  }

  .terms-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .term-chip {
    align-items: flex-start;
    white-space: normal;
  }

  .entity-btn {
    min-width: 0;
    padding: 7px 5px;
    font-size: 13px;
  }

  .chart-stack {
    gap: 10px;
  }

  .chart-head {
    padding: 11px 12px 7px;
    gap: 8px;
  }

  .chart-title {
    font-size: 15px;
  }

  .chart-note {
    font-size: 11px;
  }

  .chart-box {
    height: 256px;
  }

  .chart-card-large .chart-box {
    height: 320px;
  }

  .axis-label {
    font-size: 10px;
  }

  .pie-label,
  .pie-footnote {
    font-size: 10px;
  }

  .tooltip {
    gap: 5px 10px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .tooltip-row {
    max-width: 100%;
  }

  .chart-caption {
    padding: 8px 11px 10px;
    font-size: 11px;
  }

  .side-rail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-block {
    padding: 14px;
  }

  .summary-block h2 {
    font-size: 19px;
  }

  .summary-block p {
    font-size: 13px;
    line-height: 1.35;
  }

  .detail-stack {
    gap: 10px;
    margin-top: 12px;
  }

  .detail-title {
    padding: 10px 12px 8px;
    font-size: 13px;
  }

  .evidence-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 11px;
  }

  .evidence-table th,
  .evidence-table td {
    padding: 8px 9px;
  }

  .standalone-topic #top-details .evidence-table {
    min-width: 0;
    table-layout: auto;
  }

  .standalone-topic #top-details .evidence-table th,
  .standalone-topic #top-details .evidence-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .matrix-detail .evidence-table {
    min-width: 900px;
    table-layout: auto;
  }
}
