/* Per-stock 估值 page (valuation-{code}.html) — Longbridge quote/valuation.
   Layout measured from the live page: capsule pills 36px, cards 12px radius with a
   1px border, section titles 20/600, the value line 14/400 muted, tables 12px head. */

.sv-main {
  --sv-accent: var(--cl-brand, #624dbb);
  --sv-track: #e4e5e7;
  --sv-band: rgba(98, 77, 187, 0.08);
  --sv-band-dot: rgba(98, 77, 187, 0.45);
  --sv-median: #a9abae;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px var(--cl-panel-inline, 40px) 0;
}

.sv-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sv-pills::-webkit-scrollbar { display: none; }

.sv-pills button {
  flex: none;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: #f0f2f4;
  color: #696e77;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}

.sv-pills button[aria-selected="true"] {
  background: var(--cl-ink, #070a13);
  color: #fff;
  font-weight: 600;
}

.sv-panel {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.sv-panel[hidden] { display: none; }

.sv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 16px;
}

@media (min-width: 1100px) {
  .sv-grid { grid-template-columns: 1fr 1fr; }
}

.sv-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sv-section h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--cl-ink, #070a13);
}

.sv-card {
  padding: 20px;
  border: 0.5px solid #dbdde1;
  border-radius: 12px;
  background: #fff;
}

/* Current-value card: Longbridge's 520x230 canvas, dial centred at x=260/top=40,
   price block on the left (170 wide) with a 24px rule, the per-share leg to the
   upper right on a leader that steps 20px. */
.sv-current {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 272px;
}

.sv-dial-canvas {
  position: relative;
  width: 520px;
  height: 230px;
  max-width: 100%;
}

.sv-dial-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sv-dial {
  position: absolute;
  left: 170px;
  top: 40px;
  width: 180px;
  height: 180px;
}

.sv-dial-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sv-dial-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cl-ink, #070a13);
}

.sv-dial-label {
  font-size: 14px;
  font-weight: 500;
  color: #696e77;
}

.sv-dial-side {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.sv-dial-side.is-price {
  left: 0;
  top: 40px;
  height: 180px;
  width: 170px;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
}

.sv-dial-rule {
  position: absolute;
  right: -24px;
  top: 50%;
  width: 24px;
  height: 1px;
  background: #5c74ff;
}

.sv-dial-side-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cl-ink, #070a13);
}

.sv-dial-side-label {
  font-size: 14px;
  font-weight: 500;
  color: #696e77;
}

.sv-dial-side.is-leg { align-items: flex-start; }

/* History card */
.sv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 20px;
  color: #696e77;
}

.sv-legend-item { display: flex; align-items: center; gap: 4px; }

.sv-dot { width: 8px; height: 8px; border-radius: 9999px; }
.sv-dot.is-line { background: #5c74ff; }
.sv-dot.is-band { background: rgba(92, 116, 255, 0.45); }
.sv-dash { width: 12px; height: 0; border-top: 1px dashed #a9abae; }

.sv-chart { width: 100%; height: 200px; }

.sv-ranges {
  display: flex;
  width: 375px;
  max-width: 100%;
  margin: 16px auto 0;
  align-items: center;
  justify-content: space-between;
}

.sv-ranges button {
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #696e77;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.sv-ranges button[aria-selected="true"] { background: #f0f2f4; color: var(--cl-ink, #070a13); }
.sv-ranges button:disabled { opacity: 0.4; cursor: default; }

/* Longbridge keeps the band facts in the accessibility tree only. */
.sv-band-facts {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sv-tip {
  margin: 0;
  padding: 12px 20px;
  border-radius: 8px;
  background: #f0f2f4;
  font-size: 14px;
  line-height: 18px;
  color: #696e77;
}

/* Peer bars: 28px tip space above, the median line plus a hatched band, 36px rows
   with 8px gaps, the value printed on the bar or in a card beside it. */
.sv-bars-wrap {
  position: relative;
  padding-top: 28px;
  --sv-median: 0%;
}

.sv-median {
  position: absolute;
  top: 0;
  left: var(--sv-median);
  transform: translateX(-100%);
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: #ff7029;
  white-space: nowrap;
}

.sv-bars-area { position: relative; }

.sv-median-band {
  position: absolute;
  left: var(--sv-median);
  right: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(255, 112, 41, 0.05);
  background-image: repeating-linear-gradient(135deg, rgba(255, 112, 41, 0.14) 0, rgba(255, 112, 41, 0.14) 1px, transparent 1px, transparent 6px);
}

.sv-median-line {
  position: absolute;
  left: var(--sv-median);
  top: -6px;
  bottom: 0;
  width: 1px;
  background: #ff7029;
}

.sv-bars {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sv-bar-row { position: relative; height: 36px; }

.sv-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: #5c74ff;
}

.sv-bar-row.is-current .sv-bar-fill { background: #ffa51f; }

.sv-bar-label {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sv-bar-label.is-on { left: 0; padding: 0 8px; color: #fff; overflow: hidden; }
.sv-bar-label.is-on .sv-bar-code,
.sv-bar-label.is-on .sv-bar-name { color: rgba(255, 255, 255, 0.8); }

.sv-bar-label.is-out { color: var(--cl-ink, #070a13); }
.sv-bar-tick { width: 8px; height: 1px; background: #dbdde1; flex: none; }

.sv-bar-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid #dbdde1;
  border-radius: 6px;
  background: #fff;
}

.sv-bar-code, .sv-bar-name { font-size: 14px; color: #696e77; }
.sv-bar-name { overflow: hidden; text-overflow: ellipsis; }

.sv-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: #696e77;
  font-variant-numeric: tabular-nums;
}

/* Industry histogram: 208px field on a bottom border, the median line and hatch,
   bucket labels every other column at 12px. */
.sv-hist-wrap {
  position: relative;
  padding-top: 28px;
  --sv-median: 0%;
}

.sv-hist-field {
  position: relative;
  height: 208px;
  border-bottom: 1px solid #dbdde1;
}

.sv-hist-grid {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
}

.sv-hist-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}

.sv-hist-bar {
  width: 80%;
  border-radius: 0;
  background: #5c74ff;
  min-height: 0;
}

.sv-hist-col.is-current .sv-hist-bar { background: #ffa51f; }

.sv-hist-field .sv-median-line { top: 0; bottom: 0; }

.sv-axis.is-hist {
  margin-top: 8px;
  font-size: 12px;
  line-height: 16px;
}

.sv-axis.is-hist span {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.sv-empty { margin: 0; font-size: 14px; color: #696e77; }

body.eva .sv-card,
body.eva .sv-pills button,
body.eva .sv-tip,
body.eva .sv-hist-bar,
body.eva .sv-bar-fill { border-radius: 0; }
