:root {
  color-scheme: light;
  --nav-bg: #08121c;
  --nav-bg-2: #0d1a27;
  --topbar: #070d14;
  --workspace: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --line: #dce2ea;
  --line-soft: #e9edf2;
  --text: #162032;
  --muted: #738094;
  --muted-2: #9aa5b4;
  --green: #00a86b;
  --blue: #2477d4;
  --red: #e43f46;
  --amber: #c98510;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--nav-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

.terminal {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  background: var(--workspace);
}

.sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: 64px auto auto minmax(170px, 1fr);
  gap: 16px;
  padding: 0 10px 12px;
  color: #dce6f2;
  background:
    linear-gradient(180deg, rgba(42, 58, 77, 0.35), transparent 38%),
    var(--nav-bg);
  border-right: 1px solid #1b2a39;
}

.brand {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #f4f8fc;
  text-decoration: none;
}

.brand-lockup {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 3px;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.primary-nav button,
.saved-screens button {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #c6d2df;
  text-align: left;
}

.primary-nav button {
  height: 37px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
}

.primary-nav button span {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 1px solid #8a9bad;
  border-radius: 3px;
}

.primary-nav button.active {
  color: #ffffff;
  background: linear-gradient(90deg, #24425f, rgba(36, 66, 95, 0.35));
  box-shadow: inset 3px 0 0 var(--blue);
}

.primary-nav button.active span {
  border-color: #b9d7ff;
  background: rgba(36, 119, 212, 0.28);
}

.primary-nav b {
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 10px;
  background: var(--red);
  color: #ffffff;
  font-size: 9px;
  line-height: 1;
}

.saved-screens {
  padding: 8px 0;
  border-top: 1px solid #21303f;
  border-bottom: 1px solid #21303f;
}

.saved-screens h2 {
  padding: 0 12px 8px;
  color: #8fa0b4;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.saved-screens button {
  height: 31px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.saved-screens button::before {
  content: "+";
  display: inline-block;
  width: 15px;
  color: #9dafc2;
}

.market-state {
  align-self: end;
  padding: 12px;
  border: 1px solid #243445;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.market-state div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.market-state span,
.market-state dt {
  color: #9dafc2;
  font-size: 11px;
  font-weight: 800;
}

.market-state strong {
  color: var(--green);
  font-size: 11px;
}

.market-state dl {
  display: grid;
  gap: 7px;
}

.market-state dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-state dd {
  color: #d6e0ec;
  font-size: 11px;
  font-weight: 700;
}

.app-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 36px;
}

.topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: 400px minmax(430px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  background: var(--topbar);
  border-bottom: 1px solid #1b2633;
  color: #d8e0ea;
}

.topbar-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.topbar-title strong {
  color: #f3f7fb;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
}

.topbar-title span {
  color: #8f9eb0;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.search-box {
  height: 38px;
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid #253446;
  border-radius: 4px;
  background: #111b27;
}

.search-box span {
  width: 13px;
  height: 13px;
  border: 1.8px solid #9ba9bb;
  border-radius: 50%;
  position: relative;
}

.search-box span::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.8px;
  background: #9ba9bb;
  transform: rotate(45deg);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eef4fb;
  font-size: 13px;
  font-weight: 700;
}

.search-box input::placeholder {
  color: #7f8d9f;
}

.search-box kbd {
  display: grid;
  place-items: center;
  height: 20px;
  border: 1px solid #344559;
  border-radius: 3px;
  color: #9fafc2;
  font-size: 11px;
}

.section-tabs {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}

.section-tabs button,
.top-actions span,
.top-actions strong,
.top-actions em {
  white-space: nowrap;
}

.section-tabs button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #cfd8e4;
  font-size: 13px;
  font-weight: 800;
}

.section-tabs button.active {
  color: #ffffff;
  border-color: var(--blue);
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
}

.top-actions span {
  color: #b9c5d3;
}

.top-actions b {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.top-actions strong {
  display: inline-block;
  width: 76px;
  padding-left: 12px;
  border-left: 1px solid #2a3849;
  color: #f3f7fb;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.top-actions em {
  color: #8795a8;
  font-style: normal;
}

.panel-badge {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--blue);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 100px 380px 188px minmax(260px, 1fr);
  gap: 12px;
  padding: 12px 14px;
  overflow: hidden;
  background: var(--workspace);
}

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

.detail-workspace {
  grid-template-rows: minmax(0, 1fr);
}

.detail-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.feature-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 900;
}

.feature-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.feature-status {
  min-width: 150px;
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.feature-status strong {
  color: var(--green);
  font-size: 16px;
}

.feature-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(126px, auto);
  gap: 12px;
  overflow: hidden;
}

.feature-card {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.feature-card.span-3 {
  grid-column: span 3;
}

.feature-card.span-4 {
  grid-column: span 4;
}

.feature-card.span-5 {
  grid-column: span 5;
}

.feature-card.span-6 {
  grid-column: span 6;
}

.feature-card.span-7 {
  grid-column: span 7;
}

.feature-card.span-8 {
  grid-column: span 8;
}

.feature-card.span-12 {
  grid-column: span 12;
}

.feature-card.tall {
  grid-row: span 2;
}

.feature-card h2 {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
}

.feature-card > span,
.feature-card .card-sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.metric-list,
.feature-list,
.timeline-list,
.report-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-line,
.feature-row,
.timeline-row,
.report-row {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.metric-line,
.feature-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.timeline-row {
  grid-template-columns: 70px minmax(0, 1fr) auto;
}

.report-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.metric-line:last-child,
.feature-row:last-child,
.timeline-row:last-child,
.report-row:last-child {
  border-bottom: 0;
}

.feature-row strong,
.metric-line strong,
.timeline-row strong,
.report-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-row span,
.metric-line span,
.timeline-row span,
.report-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.feature-row em,
.metric-line em,
.timeline-row em,
.report-row em {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.feature-kpi {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.feature-kpi strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
}

.feature-kpi em {
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}

.feature-kpi span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.feature-card .data-table {
  margin-top: 12px;
}

.feature-table-frame {
  margin-top: 12px;
  max-height: calc(100% - 34px);
  overflow: auto;
  scrollbar-width: thin;
}

.feature-card.tall .feature-table-frame,
.feature-card.wide-table .feature-table-frame {
  height: calc(100% - 34px);
}

.feature-card.wide-table {
  min-height: 430px;
}

.report-row span {
  grid-column: 1 / -1;
  margin-top: -4px;
}

.summary-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.06fr 1.06fr 1fr 1fr 0.82fr 1.24fr;
  gap: 10px;
}

.summary-card,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  overflow: hidden;
}

.summary-card span,
.panel-head span,
.data-table th,
.filter-strip button,
.segmented button,
.chip-row button,
.toolbar button,
.text-button {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 23px;
  line-height: 1;
  font-weight: 850;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card em {
  display: block;
  margin-top: 7px;
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  font-weight: 850;
}

.summary-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 750;
}

.fixed-watch canvas {
  width: 48%;
  height: 64px;
  flex: 0 0 48%;
}

.index-card {
  align-items: center;
  justify-content: space-between;
  padding-right: 14px;
}

.index-card .metric-copy {
  min-width: 0;
  flex: 1 1 54%;
}

.index-card canvas {
  width: 42%;
  height: 64px;
  flex: 0 0 42%;
}

.index-card strong {
  max-width: 100%;
  font-size: 23px;
}

.index-card em {
  position: static;
}

.compact-card {
  align-items: stretch;
  flex-direction: column;
  justify-content: center;
}

.compact-card dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 12px;
}

.compact-card dl div + div {
  border-left: 1px solid var(--line-soft);
  padding-left: 12px;
}

.compact-card dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.compact-card dd {
  margin-top: 5px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 850;
}

.volume-card {
  justify-content: center;
  padding-top: 7px;
  padding-bottom: 7px;
}

.volume-card strong {
  min-height: 17px;
  height: 17px;
  margin-top: 3px;
  white-space: nowrap;
  overflow-wrap: normal;
  display: block;
  font-size: 17px;
  line-height: 17px;
}

.volume-card em {
  min-height: 15px;
  height: 15px;
  margin-top: 3px;
  font-size: 15px;
  line-height: 15px;
}

.volume-card small {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1;
}

.operations-row {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(320px, 1fr) minmax(145px, 0.34fr) minmax(210px, 0.54fr);
  gap: 10px;
}

.analytics-row {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.9fr 1.18fr 1fr;
  gap: 10px;
}

@media (min-width: 1800px) {
  .operations-row {
    grid-template-columns: 500px minmax(0, 1fr) 210px 330px;
  }
}

.panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.panel-head h2 {
  color: #263348;
  font-size: 13px;
  line-height: 1;
  font-weight: 850;
}

.panel-head span {
  display: block;
  margin-top: 5px;
}

.small-head {
  min-height: 38px;
}

.small-head span {
  margin-top: 0;
}

.segmented,
.chip-row,
.toolbar,
.filter-strip,
.legend {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.segmented button,
.chip-row button,
.toolbar button,
.filter-strip button,
.text-button {
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
}

.segmented.small button {
  height: 23px;
  padding: 0 7px;
  font-size: 10px;
}

.segmented button.active,
.chip-row button.active,
.filter-strip button.active {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

.text-button {
  border-color: transparent;
  color: var(--blue);
}

.panel-head a {
  color: var(--blue);
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

#updated-at {
  display: inline-block;
  width: 40px;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.table-frame {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table thead {
  background: var(--surface-2);
}

.data-table th,
.data-table td {
  height: 29px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.alert-table th:nth-child(1),
.alert-table td:nth-child(1) {
  width: 72px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.alert-table th:nth-child(2),
.alert-table td:nth-child(2) {
  width: 30%;
}

.alert-table th:nth-child(3),
.alert-table td:nth-child(3),
.alert-table th:nth-child(4),
.alert-table td:nth-child(4) {
  width: 74px;
}

.alerts-panel .data-table th,
.alerts-panel .data-table td {
  height: 27px;
  padding: 0 8px;
  font-size: 11.5px;
}

.gainers-panel .data-table th,
.gainers-panel .data-table td {
  height: 22px;
  padding: 0 8px;
}

.gainers-panel .data-table td {
  font-size: 11.5px;
}

.gainers-panel .stock-cell,
.alerts-panel .stock-cell,
.screener-table .stock-cell {
  display: block;
}

.gainers-panel .stock-cell strong,
.alerts-panel .stock-cell strong,
.screener-table .stock-cell strong {
  display: block;
  line-height: 1;
}

.gainers-panel .stock-cell span,
.alerts-panel .stock-cell span,
.screener-table .stock-cell span {
  display: none;
}

.gainers-panel .data-table th:first-child,
.gainers-panel .data-table td:first-child {
  width: 44%;
}

.gainers-panel .data-table th:nth-child(2),
.gainers-panel .data-table td:nth-child(2),
.gainers-panel .data-table th:nth-child(3),
.gainers-panel .data-table td:nth-child(3) {
  width: 18%;
}

.data-table th:first-child,
.data-table td:first-child,
.alert-table th:nth-child(2),
.alert-table td:nth-child(2) {
  text-align: left;
}

.data-table td {
  color: #263348;
  font-size: 12px;
  font-weight: 750;
}

.data-table td.subtle,
.data-table .code {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.stock-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.stock-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a2537;
  font-size: 12px;
  font-weight: 850;
}

.stock-cell span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.spark {
  display: block;
  width: 72px;
  height: 20px;
  margin-left: auto;
}

.right-monitor-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 10px;
}

.youtube-panel {
  grid-template-rows: auto auto auto;
  align-content: start;
}

.featured-youtube-panel .video-placeholder {
  padding: 22px;
}

.featured-youtube-panel .video-placeholder strong {
  font-size: 24px;
}

.featured-youtube-panel .video-placeholder em {
  max-width: 320px;
  font-size: 12px;
}

.video-shell {
  position: relative;
  width: min(calc(100% - 20px), 500px);
  aspect-ratio: 16 / 9;
  justify-self: center;
  min-width: 0;
  min-height: 0;
  margin: 10px 10px 8px;
  overflow: hidden;
  border: 1px solid #223044;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(13, 26, 39, 0.45), rgba(4, 9, 14, 0.92)),
    #08121c;
}

.video-shell iframe,
.video-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-shell iframe {
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.video-shell.playing iframe {
  opacity: 1;
  pointer-events: auto;
}

.video-shell.playing .video-placeholder {
  opacity: 0;
  pointer-events: none;
}

.video-placeholder {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  padding: 18px;
  border: 0;
  color: #ffffff;
  text-align: left;
  background:
    radial-gradient(circle at 78% 22%, rgba(36, 119, 212, 0.32), transparent 28%),
    linear-gradient(135deg, rgba(36, 119, 212, 0.2), rgba(228, 63, 70, 0.13));
}

.video-placeholder span {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 2px;
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.video-placeholder strong {
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.video-placeholder em {
  max-width: 220px;
  color: #b9c7d8;
  font-size: 11px;
  line-height: 1.4;
  font-style: normal;
  font-weight: 750;
}

.channel-strip {
  width: min(calc(100% - 20px), 500px);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 0 0 10px;
}

.channel-strip button {
  min-width: 0;
  height: 25px;
  padding: 0 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-strip button.active {
  border-color: var(--blue);
  background: #eaf3ff;
  color: var(--blue);
}

.channel-strip button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.limits-stack {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.main-limits-stack {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.limit-card {
  min-width: 0;
  grid-template-rows: 34px minmax(0, 1fr);
}

.limit-card .panel-head {
  min-height: 34px;
  padding: 8px 9px 7px;
}

.limit-card .panel-head h2 {
  font-size: 12px;
}

.limit-card .panel-head span {
  font-size: 10px;
}

.mini-table {
  min-height: 0;
  overflow: hidden;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-bottom: 1px solid var(--line-soft);
}

.mini-row strong,
.mini-row span,
.mini-row b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.mini-row strong {
  color: #1f2b3d;
  font-size: 11px;
  font-weight: 850;
}

.mini-row span {
  color: #3b4658;
  font-size: 11px;
  font-weight: 750;
}

.mini-row b {
  font-size: 11px;
  font-weight: 850;
}

.heatmap-panel {
  grid-template-rows: 38px minmax(0, 1fr);
}

.heatmap-panel .panel-head {
  min-height: 38px;
  padding: 9px 10px 7px;
}

.heatmap-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  padding: 8px;
  overflow: hidden;
}

.sector-heatmap-tile {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  overflow: hidden;
}

.sector-heatmap-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(66px, 1fr);
  gap: 7px;
  overflow: hidden;
}

.sector-heatmap-tile {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px;
}

.sector-heatmap-tile strong,
.sector-heatmap-tile span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sector-heatmap-tile strong {
  color: #172238;
  font-size: 12px;
  font-weight: 900;
}

.sector-heatmap-tile em {
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sector-heatmap-tile span {
  color: #4e5b6d;
  font-size: 10.5px;
  line-height: 1.1;
  font-weight: 750;
}

.heat-up-1 {
  background: linear-gradient(135deg, #f6fffb, #e9f8f0);
}

.heat-up-2 {
  background: linear-gradient(135deg, #e9fbf3, #c9f0dd);
}

.heat-up-3 {
  background: linear-gradient(135deg, #d7f8e8, #9ae5c4);
}

.heat-down-1 {
  background: linear-gradient(135deg, #fff8f8, #fceced);
}

.heat-down-2 {
  background: linear-gradient(135deg, #fff0f1, #f8d4d8);
}

.heat-down-3 {
  background: linear-gradient(135deg, #ffe4e6, #f4a5ad);
}

.heat-flat {
  background: linear-gradient(135deg, #ffffff, #f3f6f9);
}

.momentum-panel,
.trend-panel {
  grid-template-rows: 42px minmax(0, 1fr);
}

.momentum-panel canvas,
.trend-panel canvas {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 6px 10px 10px;
}

.legend {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.legend span {
  width: 14px;
  height: 2px;
  margin: 0 3px 0 8px;
}

.legend .kospi {
  background: var(--blue);
}

.legend .kosdaq {
  background: var(--red);
}

.screener-panel {
  grid-template-rows: 36px 32px minmax(0, 1fr);
}

.screener-panel .panel-head {
  min-height: 36px;
  padding-top: 8px;
  padding-bottom: 7px;
}

.watchlist-workspace {
  grid-template-rows: minmax(0, 1fr);
}

.watchlist-page-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.7fr);
  gap: 10px;
}

.watchlist-page-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.watchlist-page-panel .data-table th,
.watchlist-page-panel .data-table td {
  height: 36px;
}

.watchlist-side-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.watchlist-brief {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.watchlist-brief div {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--surface-2);
}

.watchlist-brief span,
.watchlist-brief em {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  font-style: normal;
}

.watchlist-brief strong {
  color: var(--blue);
  font-size: 38px;
  line-height: 1;
  font-weight: 900;
}

.filter-strip {
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}

.filter-strip button {
  height: 22px;
}

.screener-table th,
.screener-table td {
  height: 24px;
  padding: 0 9px;
}

.screener-table th:nth-child(1),
.screener-table td:nth-child(1) {
  width: 44px;
}

.screener-table th:nth-child(2),
.screener-table td:nth-child(2) {
  width: 260px;
}

.screener-table th:nth-child(3),
.screener-table td:nth-child(3),
.screener-table th:nth-child(4),
.screener-table td:nth-child(4),
.screener-table th:nth-child(5),
.screener-table td:nth-child(5),
.screener-table th:nth-child(6),
.screener-table td:nth-child(6) {
  width: 92px;
}

.rank {
  color: var(--muted);
}

.grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 18px;
  border-radius: 3px;
  background: #eef4fb;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.ticker-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 14px;
  border-top: 1px solid #1b2633;
  background: var(--topbar);
}

.ticker {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
}

.ticker-item {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  color: #e6edf5;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ticker-label {
  color: #9dabbd;
}

.ticker-price {
  overflow: hidden;
  text-overflow: ellipsis;
}

.up {
  color: var(--green) !important;
}

.down {
  color: var(--red) !important;
}

.flat {
  color: var(--muted) !important;
}

@media (max-width: 1240px) {
  html,
  body {
    overflow: auto;
  }

  .terminal {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .app-area {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .section-tabs,
  .top-actions {
    justify-content: start;
    overflow: auto;
    scrollbar-width: none;
  }

  .section-tabs::-webkit-scrollbar,
  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 120px);
    grid-template-rows: auto auto auto auto;
    overflow: visible;
  }

  .summary-strip,
  .operations-row,
  .analytics-row,
  .right-monitor-stack,
  .limits-stack,
  .feature-grid,
  .watchlist-page-grid {
    grid-template-columns: 1fr;
  }

  .feature-card.span-3,
  .feature-card.span-4,
  .feature-card.span-5,
  .feature-card.span-6,
  .feature-card.span-7,
  .feature-card.span-8,
  .feature-card.span-12 {
    grid-column: span 1;
  }

  .feature-head {
    grid-template-columns: 1fr;
  }

  .feature-status {
    justify-items: start;
  }

  .right-monitor-stack {
    grid-template-rows: auto auto;
  }

  .youtube-panel {
    min-height: 260px;
  }

  .panel,
  .summary-card {
    min-height: 220px;
  }

  .summary-card {
    min-height: 108px;
  }

  .index-card {
    padding-right: 14px;
  }

  .index-card em {
    position: static;
    margin-top: 8px;
  }

  .ticker {
    min-height: 36px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
