:root {
  --bg: #050607;
  --panel: #101214;
  --panel-2: #1f2125;
  --panel-3: #2b2e34;
  --line: #3a3d43;
  --line-soft: #24272c;
  --text: #e8ebee;
  --muted: #98a0aa;
  --yellow: #efff00;
  --blue: #0b4f9e;
  --blue-2: #1671d8;
  --red: #ff3b18;
  --green: #00ff4a;
  --amber: #ffc400;
  --cyan: #35c9ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(22, 113, 216, 0.18), transparent 28rem),
    linear-gradient(180deg, #0a0c0f 0%, #050607 56%);
  color: var(--text);
  font-family: "Yu Gothic UI", "Meiryo", "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.view-nav a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #181b20;
  color: #cfd6df;
  padding: 5px 10px;
  white-space: nowrap;
}

.view-nav a.is-current,
.view-nav a:hover {
  border-color: var(--blue-2);
  background: #0d376c;
  color: #fff;
}

.page-lede {
  color: var(--muted);
  line-height: 1.7;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(680px, 1.4fr);
  gap: 18px;
  align-items: start;
}

.home-header {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: calc(100vh - 36px);
}

.home-title h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
}

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

.mockup-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12151a;
  padding: 14px;
}

.mockup-card strong {
  color: #fff;
  font-size: 16px;
}

.mockup-card span {
  color: var(--muted);
  line-height: 1.55;
}

.mockup-card:hover {
  border-color: var(--blue-2);
}

.home-preview {
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}

.home-preview .section-heading {
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
}

.section-heading h2,
.section-heading h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.terminal-shell {
  min-height: 100vh;
  background: #070809;
  color: var(--yellow);
  padding: 10px 16px 16px;
}

.terminal-top {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.ranking-tabs,
.market-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
}

.ranking-tabs a,
.market-tabs button {
  border: 1px solid #4a4d53;
  border-radius: 4px;
  background: #2e3035;
  color: #dce0e5;
  min-height: 24px;
  padding: 2px 12px;
  white-space: nowrap;
}

.ranking-tabs a:first-child,
.market-tabs button.is-active {
  border-color: var(--blue);
  background: #092c59;
  color: #55b8ff;
}

.terminal-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fixed-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f4f4f4;
  white-space: nowrap;
}

.toolbar-button,
.csv-button,
.icon-button {
  border: 1px solid #555a63;
  border-radius: 4px;
  background: #333740;
  color: #fff;
  min-height: 24px;
  padding: 2px 9px;
}

.icon-button {
  width: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.terminal-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 3px;
}

.updated-time {
  color: #d7ff00;
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 2px 0 8px;
  color: #fff;
}

.filters label,
.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.filters input,
.check-row input,
.fixed-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--blue-2);
}

.board-panel {
  border: 1px solid var(--line);
  background: #08090a;
}

.board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 31px;
  border-bottom: 1px solid var(--line);
  background: #24262a;
  color: #c2c8cf;
  padding: 3px 8px;
}

.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 140px);
}

.quote-table {
  width: 100%;
  min-width: 1110px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.quote-table th,
.quote-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3px 6px;
  line-height: 1.35;
  vertical-align: middle;
}

.quote-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #202226;
  color: #aeb6c2;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.quote-table tr:nth-child(even) td {
  background: #202123;
}

.quote-table tr:nth-child(odd) td {
  background: #090a0b;
}

.quote-table tr:hover td {
  background: #17263c;
}

.rank-cell,
.market-cell,
.icon-cell {
  text-align: center;
  white-space: nowrap;
}

.rank-cell {
  width: 34px;
}

.code-cell {
  width: 48px;
  white-space: nowrap;
  font-weight: 700;
}

.name-cell {
  width: 168px;
  max-width: 168px;
}

.name-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.num-cell {
  text-align: right;
  white-space: nowrap;
}

.sector-cell {
  white-space: nowrap;
}

.emphasis {
  color: var(--yellow);
  font-weight: 700;
}

.tone-up {
  color: var(--red);
}

.tone-down {
  color: var(--green);
}

.tone-flat {
  color: var(--amber);
}

.tick {
  display: inline-block;
  width: 14px;
  text-align: center;
  margin-left: 2px;
}

.close-mark {
  color: #e8ebee;
  margin-left: 2px;
}

.mini-badge,
.swap-badge,
.warn-badge {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
}

.mini-badge {
  border: 1px solid #cfd5dc;
  color: #fff;
}

.swap-badge {
  background: #535861;
  color: #fff;
  font-weight: 700;
}

.warn-badge {
  background: #5a3335;
  color: #ff5d62;
  font-weight: 900;
}

.workbench-shell,
.compact-shell {
  min-height: 100vh;
  background: #0b0d10;
  padding: 16px;
}

.workbench-header,
.compact-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

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

.status-line {
  color: var(--muted);
  min-height: 22px;
  max-width: 520px;
  text-align: right;
}

.status-line[data-tone="ok"] {
  color: var(--cyan);
}

.status-line[data-tone="loading"] {
  color: var(--amber);
}

.status-line[data-tone="error"] {
  color: #ff8d7f;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue-2);
  border-radius: 6px;
  background: #0d376c;
  color: #fff;
  min-height: 34px;
  padding: 6px 12px;
  white-space: nowrap;
}

.refresh-button:hover {
  background: #124e95;
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b22;
  color: #d9e0e7;
  min-height: 34px;
  padding: 6px 12px;
  white-space: nowrap;
}

.secondary-button:hover {
  border-color: var(--blue-2);
}

.refresh-button:disabled {
  border-color: var(--line);
  background: #2a2e36;
  color: var(--muted);
  cursor: wait;
}

.file-input {
  display: none;
}

.brand-block {
  display: grid;
  gap: 4px;
}

.brand-block span {
  color: var(--muted);
}

.brand-block h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12161c;
  padding: 12px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  color: #fff;
  font-size: 23px;
  line-height: 1.2;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--cyan);
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111419;
  overflow: hidden;
}

.panel .quote-table {
  min-width: 940px;
}

.panel .quote-table th,
.panel .quote-table td {
  padding: 8px 10px;
}

.stacked-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stacked-name strong {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stacked-name span {
  color: var(--muted);
  font-size: 12px;
}

.stock-shell {
  min-height: 100vh;
  padding: 16px;
  background: #0b0d10;
}

.stock-shell-wide {
  padding: 14px;
}

.stock-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.stock-title-block {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.stock-title-block h1 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.25;
}

.stock-code,
.stock-back-link {
  color: var(--cyan);
}

.stock-back-link {
  width: fit-content;
  font-size: 12px;
}

.stock-back-link:hover {
  color: #fff;
}

.stock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stock-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stock-kpi,
.stock-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111419;
}

.stock-kpi {
  min-height: 92px;
  padding: 12px;
}

.stock-kpi span,
.stock-kpi small {
  display: block;
  color: var(--muted);
}

.stock-kpi strong {
  display: block;
  margin: 8px 0 4px;
  color: #fff;
  font-size: 24px;
  line-height: 1.15;
}

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

.stock-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.stock-panel {
  overflow: hidden;
}

.stock-panel-heading {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
}

.stock-panel-heading h2,
.stock-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
}

.stock-panel-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b22;
  color: var(--cyan);
  padding: 3px 8px;
  white-space: nowrap;
}

.stock-chart {
  display: block;
  width: 100%;
  height: auto;
  background: #090b0f;
}

.chart-axis {
  stroke: #59606b;
  stroke-width: 1;
}

.muted-axis {
  stroke-dasharray: 4 5;
  opacity: 0.6;
}

.chart-grid line {
  stroke: #242a33;
  stroke-width: 1;
}

.volume-bars rect {
  fill: #1c74d8;
  opacity: 0.78;
}

.soft-bars rect {
  fill: #1b5f9e;
  opacity: 0.62;
}

.monitor-bars rect {
  fill: #24a3ff;
  opacity: 0.8;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.thick-line {
  stroke-width: 4;
}

.yellow-line {
  stroke: var(--yellow);
}

.cyan-line {
  stroke: var(--cyan);
}

.chart-area {
  fill: rgba(239, 255, 0, 0.13);
}

.chart-last-point {
  fill: var(--yellow);
  stroke: #0b0d10;
  stroke-width: 3;
}

.chart-point-markers .price-marker-dot {
  fill: #f6ff75;
  stroke: #0b0d10;
  stroke-width: 1.5;
  opacity: 0.9;
}

.chart-point-markers .price-hit-area {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.chart-point-markers .price-hit-area:focus-visible {
  outline: none;
  stroke: rgba(53, 201, 255, 0.8);
  stroke-width: 1.5;
}

.chart-hover-guide {
  stroke: rgba(255, 255, 255, 0.42);
  stroke-dasharray: 5 5;
  stroke-width: 1.2;
  pointer-events: none;
}

.chart-hover-point {
  fill: var(--yellow);
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(239, 255, 0, 0.85));
  pointer-events: none;
}

.chart-point-markers .price-marker-dot:hover,
.volume-bars rect:hover {
  opacity: 1;
}

.chart-labels text {
  fill: var(--muted);
  font-size: 13px;
}

.chart-callout line {
  stroke: rgba(255, 255, 255, 0.24);
  stroke-dasharray: 4 4;
}

.chart-callout rect {
  fill: #171b22;
  stroke: var(--line);
}

.chart-callout text {
  fill: #fff;
  font-size: 14px;
}

.stock-hover-tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 280px;
  max-width: 340px;
  border: 1px solid rgba(53, 201, 255, 0.55);
  border-radius: 6px;
  background: rgba(12, 16, 22, 0.97);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.stock-hover-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stock-tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
}

.stock-tooltip-head strong {
  color: #fff;
  font-size: 15px;
}

.stock-tooltip-head span {
  border: 1px solid var(--blue-2);
  border-radius: 5px;
  background: #0d376c;
  color: #fff;
  padding: 3px 8px;
  font-weight: 700;
}

.stock-tooltip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
}

.stock-tooltip-grid div {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
}

.stock-tooltip-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.stock-tooltip-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.stock-tooltip-grid dd {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.stock-mini-table th,
.stock-mini-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  text-align: right;
  white-space: nowrap;
}

.stock-mini-table th:first-child,
.stock-mini-table td:first-child {
  text-align: left;
}

.stock-mini-table th {
  background: #20242a;
  color: var(--muted);
  font-weight: 500;
}

.stock-mini-table td {
  background: #0c0f13;
}

.stock-note-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.stock-note-list p {
  margin: 0;
  color: #dce4ec;
  line-height: 1.55;
}

.stock-note-list strong {
  color: var(--cyan);
}

.compact-stock-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.stock-price-strip {
  display: grid;
  min-width: 190px;
  justify-items: end;
  gap: 2px;
}

.stock-price-strip span {
  color: var(--muted);
}

.stock-price-strip strong {
  font-size: 30px;
  line-height: 1.1;
}

.stock-price-strip em {
  font-style: normal;
  color: var(--green);
}

.stock-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: start;
}

.stock-focus-layout-refined {
  grid-template-columns: minmax(720px, 1fr) 340px;
}

.focus-chart-panel {
  min-width: 0;
}

.large-stock-chart {
  min-height: 430px;
}

.refined-chart-panel {
  background: #0f1318;
  overflow-x: auto;
}

.refined-chart-heading {
  align-items: flex-start;
  background: #141922;
}

.stock-chart-toolbar {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0e13;
  padding: 3px;
}

.chart-density {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #10151c;
  color: var(--muted);
  padding: 4px 9px;
  white-space: nowrap;
}

.period-button {
  min-width: 64px;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #c7d0dc;
  padding: 4px 10px;
  white-space: nowrap;
}

.period-button:hover,
.period-button.is-active {
  background: #0d376c;
  color: #fff;
}

.chart-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.chart-summary-grid div {
  min-height: 76px;
  background: #11161d;
  padding: 12px;
}

.chart-summary-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 7px;
}

.chart-summary-grid strong {
  color: #fff;
  font-size: 18px;
}

.refined-legend {
  justify-content: flex-end;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 12px;
  background: #0d1117;
}

.legend-average {
  background: #8d96a3;
}

.refined-main-chart {
  min-height: 430px;
  min-width: 1120px;
}

.chart-average-line {
  stroke: #89919d;
  stroke-width: 1.5;
  stroke-dasharray: 8 8;
  opacity: 0.72;
}

.chart-y-labels text {
  fill: #9ea8b5;
  font-size: 13px;
}

.refined-callout rect {
  fill: #18202a;
}

.ranking-trend-block {
  border-top: 1px solid var(--line-soft);
  background: #0d1117;
}

.ranking-trend-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.ranking-trend-heading h3 {
  margin: 0;
  color: #fff;
  font-size: 15px;
}

.ranking-trend-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ranking-trend-heading strong {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--blue-2);
  border-radius: 6px;
  background: #0d376c;
  color: #fff;
  padding: 4px 10px;
  white-space: nowrap;
}

.ranking-trend-chart {
  min-width: 1120px;
  min-height: 520px;
  border-top: 1px solid var(--line-soft);
}

.ranking-minor-grid line {
  stroke: rgba(255, 255, 255, 0.035);
  stroke-width: 1;
}

.ranking-major-grid line {
  stroke: rgba(53, 201, 255, 0.18);
  stroke-width: 1;
}

.ranking-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ranking-markers .ranking-marker-dot {
  fill: var(--cyan);
  stroke: #0b0d10;
  stroke-width: 2;
}

.ranking-markers .ranking-hit-area {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.ranking-markers .ranking-hit-area:focus-visible {
  outline: none;
  stroke: rgba(239, 255, 0, 0.85);
  stroke-width: 1.5;
}

.ranking-hover-guide {
  stroke: rgba(53, 201, 255, 0.52);
}

.ranking-hover-point {
  fill: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(53, 201, 255, 0.9));
}

.stock-hover-tooltip.is-ranking-tooltip {
  border-color: rgba(53, 201, 255, 0.75);
}

.stock-hover-tooltip.is-ranking-tooltip .stock-tooltip-head span {
  border-color: rgba(53, 201, 255, 0.8);
  background: #063b55;
}

.ranking-y-labels text {
  fill: var(--muted);
  font-size: 13px;
}

.refined-side-metrics {
  align-self: stretch;
}

.side-card-primary {
  background: #111922;
}

.stock-compact-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.stock-compact-table td {
  border-top: 1px solid var(--line-soft);
  padding: 9px 0;
  color: #dce4ec;
  white-space: nowrap;
}

.stock-compact-table td:last-child {
  text-align: right;
}

.refined-performance {
  margin-top: 14px;
}

.stock-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.stock-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stock-legend i {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
}

.legend-price {
  background: var(--yellow);
}

.legend-volume {
  background: #1b74d8;
}

.stock-side-metrics {
  display: grid;
  gap: 14px;
}

.stock-side-metrics .stock-panel {
  padding: 14px;
}

.stock-stat-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.stock-stat-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.stock-stat-list dt {
  color: var(--muted);
}

.stock-stat-list dd {
  margin: 0;
  color: #fff;
  font-weight: 700;
}

.performance-bars {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.performance-bars div {
  display: grid;
  grid-template-columns: 42px 1fr 58px;
  align-items: center;
  gap: 8px;
}

.performance-bars span {
  color: var(--muted);
}

.performance-bars i {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue-2) var(--bar), #222832 var(--bar));
}

.performance-bars strong {
  text-align: right;
}

.stock-monitor-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: #0b0d10;
}

.stock-watchlist {
  border-right: 1px solid var(--line);
  background: #0f1217;
  padding: 14px;
}

.watchlist-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.watchlist-heading h1 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.watch-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 8px;
}

.watch-item:hover,
.watch-item.is-active {
  border-color: var(--blue-2);
  background: #102844;
}

.watch-item strong {
  color: #fff;
}

.watch-item span {
  overflow: hidden;
  color: #dce4ec;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-item em {
  font-style: normal;
  text-align: right;
}

.stock-monitor-main {
  min-width: 0;
  padding: 14px;
}

.monitor-header {
  margin-bottom: 12px;
}

.monitor-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.monitor-summary-row div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111419;
  padding: 10px 12px;
}

.monitor-summary-row span {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
}

.monitor-summary-row strong {
  color: #fff;
  font-size: 20px;
}

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

.monitor-chart {
  max-height: 230px;
}

.monitor-bottom-table {
  margin-top: 12px;
}

.rank-pill {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border-radius: 4px;
  background: #243040;
  color: #dce7f3;
}

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

.bar-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 12px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #dbe1e8;
  font-size: 12px;
  margin-bottom: 5px;
}

.bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label strong {
  color: var(--yellow);
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: #252b34;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-2), var(--yellow));
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px;
}

.chip-cloud span,
.market-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1a1e25;
  color: #dce3ea;
  padding: 4px 8px;
}

.chip-cloud strong {
  color: var(--yellow);
}

.calendar-heading {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
}

.calendar-heading h2 {
  text-align: center;
}

.icon-nav-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b22;
  color: #dce3ea;
  font-size: 20px;
  line-height: 1;
}

.icon-nav-button:hover {
  border-color: var(--blue-2);
  background: #0d376c;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 12px 12px 4px;
}

.calendar-weekday,
.calendar-empty,
.calendar-day {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  height: 31px;
  border-radius: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.calendar-weekday {
  height: 22px;
  font-size: 12px;
  color: #c2cad4;
}

.calendar-day {
  border: 1px solid transparent;
  background: transparent;
}

button.calendar-day {
  font: inherit;
  cursor: pointer;
}

.calendar-day.is-available {
  border-color: #315b8f;
  background: #10253e;
  color: #fff;
}

.calendar-day.is-available:hover,
.calendar-day.is-selected {
  border-color: var(--yellow);
  background: #303516;
  color: var(--yellow);
}

.calendar-note {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 12px;
}

.compact-shell {
  display: grid;
  grid-template-columns: 170px minmax(620px, 1fr) 310px;
  gap: 14px;
}

.left-rail,
.detail-rail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101319;
  align-self: stretch;
  overflow: hidden;
}

.left-rail {
  padding: 10px;
}

.left-rail h1 {
  margin: 4px 0 14px;
  font-size: 17px;
}

.rail-group {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.rail-group span {
  color: var(--muted);
  font-size: 12px;
}

.rail-button {
  display: flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #d7dde5;
  padding: 6px 8px;
}

.rail-button.is-active,
.rail-button:hover {
  border-color: var(--blue-2);
  background: #0b315f;
  color: #fff;
}

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

.compact-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11151b;
  color: var(--muted);
  padding: 0 10px;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #dbe2eb;
}

.compact-table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0e11;
  overflow: hidden;
}

.compact-table-panel .table-scroll {
  max-height: calc(100vh - 92px);
}

.compact-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.compact-table th,
.compact-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
}

.compact-table th {
  position: sticky;
  top: 0;
  background: #1b2028;
  color: var(--muted);
  text-align: left;
  z-index: 1;
  white-space: nowrap;
}

.compact-table tr:nth-child(even) td {
  background: #12151a;
}

.compact-table tr.is-selected td {
  background: #142b48;
}

.compact-stock {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.compact-stock strong {
  color: var(--yellow);
}

.compact-stock span {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-link {
  color: inherit;
  text-decoration: none;
}

.stock-link:hover,
.stock-link:focus-visible {
  color: var(--cyan);
}

.muted-stock-link {
  color: var(--muted);
}

.stock-page-status {
  min-height: 34px;
  padding: 8px 12px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #0d1117;
  color: var(--muted);
  font-size: 13px;
}

.stock-page-status[data-tone="ok"] {
  color: var(--cyan);
}

.stock-page-status[data-tone="loading"] {
  color: var(--amber);
}

.stock-page-status[data-tone="error"] {
  color: #ff8d7f;
}

.detail-rail {
  padding: 14px;
}

.detail-rail h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.detail-rail .sub {
  display: block;
  color: var(--muted);
  margin-bottom: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b22;
  min-height: 70px;
  padding: 10px;
}

.detail-cell span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.detail-cell strong {
  color: var(--yellow);
  font-size: 17px;
}

.note-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-list li {
  border-left: 3px solid var(--blue-2);
  background: #151920;
  color: #dce2ea;
  padding: 9px 10px;
}

@media (max-width: 1120px) {
  .home-layout,
  .analytics-layout,
  .compact-shell,
  .stock-overview-grid,
  .stock-detail-grid,
  .stock-focus-layout {
    grid-template-columns: 1fr;
  }

  .stock-kpi-strip,
  .monitor-summary-row,
  .chart-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-monitor-shell {
    grid-template-columns: 1fr;
  }

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

  .home-header {
    min-height: auto;
  }

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

  .left-rail {
    display: none;
  }

  .detail-rail {
    order: -1;
  }
}

@media (max-width: 700px) {
  .app-shell,
  .workbench-shell,
  .compact-shell,
  .stock-shell,
  .stock-monitor-main {
    padding: 10px;
  }

  .terminal-shell {
    padding: 8px;
  }

  .terminal-top,
  .workbench-header,
  .stock-header,
  .compact-toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-kpi-strip,
  .monitor-summary-row,
  .chart-summary-grid {
    grid-template-columns: 1fr;
  }

  .stock-chart-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .period-button {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
  }

  .stock-title-block h1 {
    font-size: 20px;
  }

  .ranking-trend-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-watchlist {
    padding: 10px;
  }

  .watch-item {
    grid-template-columns: 48px minmax(0, 1fr) 58px;
  }

  .data-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .status-line {
    text-align: left;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .home-title h1 {
    font-size: 24px;
  }

  .brand-block h1 {
    font-size: 19px;
  }

  .search-box {
    min-width: 100%;
  }
}
