:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --ink: #17211c;
  --muted: #63706b;
  --line: #d7ddd6;
  --panel: #ffffff;
  --accent: #12715f;
  --accent-strong: #0c5548;
  --gold: #c58b1c;
  --bad: #b33d32;
  --good: #0f7a53;
  --grid: #eef2ee;
  --scroll-track: #eef2ee;
  --scroll-thumb: #b8c4bd;
  --scroll-thumb-hover: #91a097;
  --radius: 8px;
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1412;
  --ink: #edf4f0;
  --muted: #9aa8a2;
  --line: #2a3631;
  --panel: #151d19;
  --accent: #37b58f;
  --accent-strong: #6bd1b3;
  --gold: #d6a84b;
  --bad: #ff7468;
  --good: #58c99a;
  --grid: #23302b;
  --scroll-track: #111814;
  --scroll-thumb: #3b4a44;
  --scroll-thumb-hover: #53635c;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid var(--scroll-track);
  border-radius: 999px;
  background: var(--scroll-thumb);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

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

.app-shell {
  display: grid;
  grid-template-columns: clamp(320px, 17vw, 400px) minmax(520px, 1.15fr) minmax(600px, 0.85fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: 100vw;
  height: 100vh;
  padding: 10px 12px 12px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 40px;
  padding: 0;
}

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

.top-search {
  display: grid;
  grid-template-columns: 136px 62px;
  gap: 6px;
  align-items: center;
}

.top-search input,
.top-search button {
  height: 30px;
  font-size: 12px;
}

.top-search input {
  padding: 0 9px;
}

.eyebrow {
  margin: 0 0 1px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.05;
}

h2 {
  font-size: 16px;
}

.status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(18, 113, 95, 0.24);
  color: var(--accent-strong);
  background: #eaf5f1;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.muted {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
}

.info-strip,
.chart-section,
.table-section {
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
}

.workspace,
.side-rail,
.table-section {
  min-height: 0;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.side-rail {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(260px, 420px);
  gap: 14px;
  padding: 12px 0 2px;
}

.field {
  min-width: 0;
}

label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.input-action {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 8px;
}

input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  outline: none;
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 113, 95, 0.12);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

button {
  height: 38px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--accent-strong);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.segmented.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--ink);
  color: #fff;
}

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

.metric {
  min-height: 68px;
  padding: 12px 14px;
  background: var(--panel);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.basis-band {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.basis-band strong {
  color: var(--ink);
  font-size: 18px;
}

.basis-band span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-section,
.table-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head > span,
.table-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.watchlist-head {
  min-height: 48px;
  padding: 8px;
}

.watchlist-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  justify-content: space-between;
  gap: 6px;
}

.watchlist-title {
  flex: 0 0 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.watchlist-select {
  flex: 1 1 106px;
  min-width: 92px;
  max-width: 126px;
  height: 28px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 900;
}

.watchlist-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.count-pill {
  color: var(--accent-strong);
}

.connection-pill.live {
  border-color: color-mix(in srgb, var(--bad) 42%, var(--line));
  color: var(--bad);
}

.connection-pill.offline {
  border-color: color-mix(in srgb, var(--good) 42%, var(--line));
  color: var(--good);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 16%, transparent);
}

.connection-pill.live .status-dot {
  background: var(--bad);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 18%, transparent);
}

.connection-pill.offline .status-dot {
  background: var(--good);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 18%, transparent);
}

.ranking-table {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.compact-table {
  min-width: 420px;
}

.compact-table th,
.compact-table td {
  padding: 7px 4px;
}

.watchlist-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.watchlist-table th,
.watchlist-table td {
  padding: 6px 3px;
  font-size: 11px;
}

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

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

.watchlist-table th:nth-child(3),
.watchlist-table td:nth-child(3) {
  width: 58px;
}

.watchlist-table th:nth-child(4),
.watchlist-table td:nth-child(4) {
  width: 42px;
}

.watchlist-table th:nth-child(5),
.watchlist-table td:nth-child(5) {
  width: 56px;
}

.ranking-sort-button {
  height: 18px;
  font-size: 10.5px;
}

.link-button {
  display: block;
  width: 100%;
  height: auto;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

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

.link-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.price-change {
  color: var(--muted);
  font-weight: 900;
}

.price-change.up {
  color: var(--bad);
}

.price-change.down {
  color: var(--good);
}

.pattern-placeholder {
  display: grid;
  align-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
}

.pattern-placeholder strong {
  font-size: 28px;
  line-height: 1;
}

.pattern-placeholder span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.is-hidden {
  display: none !important;
}

.table-section {
  margin-top: 0;
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.chart-section {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
}

.candle-chart {
  height: 100%;
  min-height: 0;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}

.candle-legend {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(520px, calc(58% - 24px));
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(215, 221, 214, 0.84);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.candle-legend span,
.candle-legend strong {
  flex: 0 0 auto;
}

.candle-legend .legend-symbol {
  overflow: hidden;
  max-width: 150px;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
}

.candle-legend .legend-period {
  color: var(--muted);
}

.candle-legend .legend-price {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.candle-legend.up .legend-change,
.candle-legend.up .legend-pct {
  color: var(--bad);
}

.candle-legend.down .legend-change,
.candle-legend.down .legend-pct {
  color: var(--good);
}

.candle-meta {
  display: none;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 0.72fr)) minmax(250px, 1.4fr);
  gap: 6px;
  border-top: 0;
}

.info-strip .metric,
.basis-box {
  min-height: 46px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.info-strip .metric span {
  font-size: 11px;
}

.info-strip .metric strong {
  margin-top: 4px;
  font-size: 17px;
}

.basis-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.basis-box strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
}

.basis-box span:first-child {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.basis-box span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-titlebar {
  align-items: flex-start;
  min-height: 78px;
  padding: 8px;
  flex-wrap: wrap;
}

.table-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 1 100%;
  min-width: 0;
}

.table-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-title-filters {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  flex: 1 1 100%;
}

.dte-filter {
  display: grid;
  grid-template-columns: auto minmax(88px, 1fr);
  gap: 6px;
  align-items: center;
}

.checkbox-filter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 30px;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.maker-filter {
  display: grid;
  grid-template-columns: auto minmax(88px, 1fr);
  gap: 6px;
  align-items: center;
}

.control-label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.dropdown-filter {
  position: relative;
}

.dropdown-filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.dropdown-filter summary::-webkit-details-marker {
  display: none;
}

.dropdown-filter summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 11px;
}

.dropdown-filter[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 113, 95, 0.12);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  z-index: 5;
  width: min(300px, 72vw);
  max-height: 320px;
  margin-top: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(23, 33, 28, 0.12);
}

.dropdown-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.dropdown-option:hover {
  background: #f8faf7;
}

.dropdown-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dropdown-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-content {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.warrant-table {
  table-layout: fixed;
  min-width: 620px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--grid);
  color: var(--muted);
  font-size: 12px;
}

.warrant-table th,
.warrant-table td {
  padding: 6px 5px;
  font-size: 12px;
}

.warrant-table th {
  font-size: 11px;
}

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

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

.warrant-table th:nth-child(3),
.warrant-table td:nth-child(3) {
  width: 42px;
}

.warrant-table th:nth-child(4),
.warrant-table td:nth-child(4),
.warrant-table th:nth-child(5),
.warrant-table td:nth-child(5) {
  width: 62px;
}

.warrant-table th:nth-child(6),
.warrant-table td:nth-child(6),
.warrant-table th:nth-child(9),
.warrant-table td:nth-child(9) {
  width: 54px;
}

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

.warrant-table th:nth-child(8),
.warrant-table td:nth-child(8) {
  width: 64px;
}

.warrant-table th:nth-child(10),
.warrant-table td:nth-child(10) {
  width: 50px;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.warrant-table .sort-button {
  height: 20px;
  font-size: 11px;
}

.sort-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

td:first-child,
th:first-child {
  text-align: left;
}

th:first-child .sort-button {
  justify-content: flex-start;
}

tbody tr:hover {
  background: #f8faf7;
}

.warrant-row {
  cursor: pointer;
}

.warrant-row:focus {
  outline: 2px solid rgba(18, 113, 95, 0.3);
  outline-offset: -2px;
}

.warrant-row.selected {
  background: #edf7f2;
}

.warrant-row.selected:hover {
  background: #e4f1ec;
}

.code {
  font-weight: 900;
}

.warrant-table .code {
  font-size: 12px;
}

.sub {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.warrant-table .sub {
  font-size: 10px;
}

.state {
  font-weight: 800;
  color: var(--good);
}

.state.warn {
  color: var(--gold);
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.calculator-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.calculator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

.calculator-title {
  flex: 1 1 170px;
  min-width: 0;
}

.calculator-head h2 {
  font-size: 15px;
}

.calculator-title span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 1 1 420px;
  min-width: 0;
  max-width: 510px;
}

.calculator-stats div {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg);
}

.calculator-stats span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-stats strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.calculator-note {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.calculator-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.calculator-metrics div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--panel);
}

.calculator-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calculator-metrics strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-table {
  min-width: 0;
  table-layout: fixed;
}

.calculator-table.price-matrix {
  width: 100%;
  min-width: 760px;
}

.calculator-table th,
.calculator-table td {
  min-width: 32px;
  padding: 6px 3px;
  font-size: 10.5px;
}

.calculator-table th:first-child,
.calculator-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 54px;
  width: 54px;
  background: var(--panel);
  color: var(--accent-strong);
  font-weight: 900;
  text-align: right;
}

.calculator-table th:first-child {
  z-index: 4;
  background: var(--grid);
}

.calculator-table .heat-cell {
  font-weight: 800;
}

.calculator-table th.scenario-down {
  color: var(--good);
}

.calculator-table th.scenario-up {
  color: var(--bad);
}

.calculator-table th.scenario-zero {
  color: var(--muted);
  font-weight: 800;
}

:root[data-theme="dark"] .status-pill {
  border-color: rgba(55, 181, 143, 0.3);
  background: rgba(55, 181, 143, 0.12);
  color: var(--accent-strong);
}

:root[data-theme="dark"] .status-pill.muted {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

:root[data-theme="dark"] .candle-meta {
  border-color: rgba(42, 54, 49, 0.9);
  background: rgba(21, 29, 25, 0.92);
}

:root[data-theme="dark"] .candle-legend {
  border-color: rgba(42, 54, 49, 0.9);
  background: rgba(21, 29, 25, 0.92);
}

:root[data-theme="dark"] .dropdown-option:hover,
:root[data-theme="dark"] tbody tr:hover {
  background: #1b2621;
}

:root[data-theme="dark"] .warrant-row.selected {
  background: #193529;
}

:root[data-theme="dark"] .warrant-row.selected:hover {
  background: #1f4234;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    width: 100%;
    height: auto;
    padding: 12px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .top-search {
    grid-template-columns: minmax(120px, 1fr) 62px;
    width: 100%;
  }

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

  .control-band,
  .summary-grid,
  .workspace,
  .side-rail {
    grid-template-columns: 1fr;
  }

  .workspace,
  .side-rail {
    margin-top: 12px;
  }

  .ranking-table {
    max-height: 420px;
  }

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

  .basis-box {
    grid-column: 1 / -1;
  }

  .chart-section {
    flex-basis: auto;
    min-height: 320px;
  }

  .candle-chart {
    height: 300px;
    min-height: 300px;
  }

  .table-titlebar {
    align-items: flex-start;
  }

  .table-title {
    flex-basis: 100%;
    min-width: 0;
  }

  .table-title-filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    justify-content: stretch;
  }

  .dte-filter,
  .maker-filter {
    grid-template-columns: 1fr;
  }

  .checkbox-filter {
    justify-content: flex-start;
  }

  .metric {
    min-height: 70px;
  }

  .metric strong {
    font-size: 24px;
  }

  .table-content {
    grid-template-columns: 1fr;
  }

  .calculator-panel {
    min-height: 360px;
  }
}
