:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-raised: #ffffff;
  --soft: #f6f8fa;
  --soft-strong: #eef2f5;
  --text: #111820;
  --text-strong: #070b0f;
  --muted: #687483;
  --muted-strong: #4d5967;
  --line: #dde3e9;
  --line-strong: #cbd3db;
  --accent: #111820;
  --accent-contrast: #ffffff;
  --green: #07966f;
  --green-soft: rgba(7, 150, 111, .1);
  --red: #d84f5e;
  --red-soft: rgba(216, 79, 94, .1);
  --amber: #c88413;
  --amber-soft: rgba(200, 132, 19, .11);
  --blue: #3f70dd;
  --chart-grid: rgba(104, 116, 131, .15);
  --shadow: 0 1px 2px rgba(15, 23, 42, .025), 0 14px 38px rgba(15, 23, 42, .055);
  --topbar: rgba(255, 255, 255, .88);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #0e131b;
  --panel-raised: #111821;
  --soft: #131a23;
  --soft-strong: #18212c;
  --text: #e9edf2;
  --text-strong: #ffffff;
  --muted: #8591a1;
  --muted-strong: #a4afbd;
  --line: #222c38;
  --line-strong: #303b49;
  --accent: #f2f5f8;
  --accent-contrast: #0a0e13;
  --green: #27c69a;
  --green-soft: rgba(39, 198, 154, .11);
  --red: #f06d7b;
  --red-soft: rgba(240, 109, 123, .11);
  --amber: #e4a33c;
  --amber-soft: rgba(228, 163, 60, .12);
  --blue: #7da2f4;
  --chart-grid: rgba(133, 145, 161, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 18px 50px rgba(0, 0, 0, .18);
  --topbar: rgba(8, 11, 16, .86);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
select { font: inherit; }

button,
a,
select { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.guarded { min-height: 100vh; }

.access-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.access-screen[hidden] { display: none; }

.access-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: min(390px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.access-card div { display: grid; gap: 4px; }
.access-card b { color: var(--text-strong); }
.access-card small { color: var(--muted); }

.spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.spinner.small { width: 18px; height: 18px; }

@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(20px) saturate(150%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(1540px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
}

.topbar-spacer { flex: 1 1 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand > div { display: grid; line-height: 1.1; }
.brand b { color: var(--text-strong); font-size: .93rem; letter-spacing: .02em; }
.brand span:last-child { margin-top: 4px; color: var(--muted); font-size: .68rem; letter-spacing: .055em; text-transform: uppercase; }

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 3px;
  place-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--text-strong);
}

.brand-mark i { border-radius: 1px; background: var(--bg); }

.icon-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
}

.icon-button:hover { border-color: var(--line-strong); background: var(--soft); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back-link { text-decoration: none; }

.primary-button {
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: .79rem;
  font-weight: 750;
}

.primary-button:hover { opacity: .88; }
.primary-button:disabled { cursor: wait; opacity: .55; }
.primary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary-button.is-loading svg { animation: spin .8s linear infinite; }

.read-only-badge,
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.read-only-badge i,
.connection-pill i,
.watchlist-footer i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.read-only-badge { border-color: color-mix(in srgb, var(--green) 22%, var(--line)); color: var(--green); }
.connection-pill.is-live { color: var(--green); }
.connection-pill.is-delayed { color: var(--amber); }
.connection-pill.is-offline { color: var(--red); }
.connection-pill.is-connecting { color: var(--muted); }
.connection-pill.is-live i { animation: status-pulse 2.2s ease-out infinite; }

@keyframes status-pulse {
  0%, 55%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
  75% { box-shadow: 0 0 0 6px transparent; }
}

.select-control,
.refresh-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px 5px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}

.select-control select,
.refresh-control select {
  min-height: 28px;
  padding: 2px 26px 2px 8px;
  border: 0;
  border-radius: 6px;
  outline: 0;
  background: var(--soft);
  color: var(--text);
  font-size: .73rem;
  font-weight: 750;
  cursor: pointer;
}

.eye-closed { display: none; }
.is-private-hidden .eye-open { display: none; }
.is-private-hidden .eye-closed { display: block; }

.dashboard-main {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .15em;
}

.page-heading h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.65rem, 2.6vw, 2.35rem);
  letter-spacing: -.035em;
}

.page-heading > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }

.telemetry {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.telemetry > div {
  display: grid;
  gap: 3px;
  min-width: 92px;
  padding: 8px 11px;
  border-left: 1px solid var(--line);
}

.telemetry span { color: var(--muted); font-size: .65rem; }
.telemetry strong { color: var(--text); font-size: .75rem; font-variant-numeric: tabular-nums; }

.environment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted-strong) !important;
  font-size: .68rem !important;
  font-weight: 750;
  white-space: nowrap;
}

.environment-badge.is-demo { border-color: color-mix(in srgb, var(--amber) 32%, var(--line)); background: var(--amber-soft); color: var(--amber) !important; }

.warning-list {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--red) 34%, var(--line));
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: .79rem;
  line-height: 1.65;
  white-space: pre-line;
}

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

.panel,
.portfolio-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portfolio-card {
  position: relative;
  min-width: 0;
  min-height: 284px;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at 94% 8%, color-mix(in srgb, var(--green) 8%, transparent), transparent 32%),
    var(--panel);
}

.portfolio-card::after {
  position: absolute;
  right: -72px;
  bottom: -115px;
  width: 260px;
  height: 260px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.portfolio-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.portfolio-card-head > div { display: grid; gap: 5px; }
.portfolio-card-head span { color: var(--muted-strong); font-size: .76rem; font-weight: 700; }
.portfolio-card-head small { color: var(--muted); font-size: .68rem; }

.status-tag {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--muted) !important;
  font-size: .62rem !important;
  letter-spacing: .04em;
}

.portfolio-total {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 75px;
  margin: 20px 0 22px;
  white-space: nowrap;
}

.portfolio-total strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-strong);
  font-size: clamp(2.15rem, 4.7vw, 3.55rem);
  font-weight: 680;
  letter-spacing: -.055em;
  line-height: 1.15;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.portfolio-total span { color: var(--muted); font-size: .77rem; font-weight: 750; }

.summary-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.summary-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 17px 14px 0;
  border-left: 1px solid var(--line);
}

.summary-grid > div:first-child { padding-left: 0; border-left: 0; }
.summary-grid span { color: var(--muted); font-size: .69rem; }
.summary-grid strong { overflow: hidden; color: var(--text-strong); font-size: 1.06rem; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-grid small { color: var(--muted); font-size: .62rem; }

.allocation-panel { min-width: 0; min-height: 284px; padding: 21px; }

.panel-head,
.chart-head,
.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-head h2,
.chart-head h2,
.records-head h2 { margin: 0; color: var(--text-strong); font-size: .98rem; letter-spacing: -.01em; }
.panel-head > span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.panel-head.compact { align-items: flex-start; }

.allocation-content {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 195px;
  padding-top: 14px;
}

.allocation-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--soft-strong) 0 100%);
}

.allocation-donut::after {
  position: absolute;
  width: 88px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  content: "";
}

.allocation-donut > div { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; }
.allocation-donut strong { color: var(--text-strong); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.allocation-donut span { color: var(--muted); font-size: .65rem; }

.allocation-list { display: grid; gap: 9px; min-width: 0; }
.allocation-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.allocation-item i { width: 7px; height: 7px; border-radius: 2px; background: var(--allocation-color); }
.allocation-item b { overflow: hidden; color: var(--text); font-size: .73rem; text-overflow: ellipsis; }
.allocation-item span { color: var(--muted); font-size: .68rem; font-variant-numeric: tabular-nums; }
.empty-copy { margin: 0; color: var(--muted); font-size: .75rem; }

.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(330px, .72fr);
  gap: 14px;
  margin-top: 14px;
}

.chart-panel { min-width: 0; padding: 21px 22px 16px; }
.instrument-title { display: flex; align-items: center; gap: 9px; }
.instrument-title span { padding: 4px 7px; border-radius: 5px; background: var(--soft); color: var(--muted); font-size: .62rem; font-weight: 700; }

.range-switch,
.record-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.range-switch button,
.record-tabs button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .68rem;
  font-weight: 750;
}

.range-switch button { min-width: 38px; padding: 6px 8px; }
.range-switch button:hover,
.record-tabs button:hover { color: var(--text); }
.range-switch button.is-active,
.record-tabs button.is-active { background: var(--panel-raised); color: var(--text-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.market-stats {
  display: grid;
  grid-template-columns: minmax(165px, 1.3fr) repeat(4, minmax(90px, .68fr));
  gap: 9px;
  align-items: end;
  min-height: 72px;
  margin-top: 12px;
}

.market-stats > div { display: grid; gap: 5px; min-width: 0; }
.market-stats span { color: var(--muted); font-size: .64rem; }
.market-stats strong { overflow: hidden; color: var(--text); font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.market-stats .market-price { display: flex; align-items: baseline; gap: 7px; }
.market-price strong { color: var(--text-strong); font-size: clamp(1.65rem, 3vw, 2.25rem); font-weight: 670; letter-spacing: -.04em; }
.market-price span { font-size: .67rem; font-weight: 750; }

.chart-stage {
  position: relative;
  width: 100%;
  height: 330px;
  min-height: 330px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--soft) 34%, transparent), transparent 24%);
  touch-action: none;
}

.chart-stage svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis-label { fill: var(--muted); font-size: 10px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-area { opacity: .14; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line.is-entering { stroke-dasharray: 1; stroke-dashoffset: 1; animation: chart-draw .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.chart-last-dot { stroke: var(--panel); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-crosshair { opacity: 0; pointer-events: none; }
.chart-crosshair line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-crosshair circle { stroke: var(--panel); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-crosshair.is-visible { opacity: 1; }

@keyframes chart-draw { to { stroke-dashoffset: 0; } }

.chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 10px;
  min-width: 130px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
  color: var(--text);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.chart-tooltip b { display: block; font-size: .75rem; font-variant-numeric: tabular-nums; }
.chart-tooltip span { display: block; margin-top: 3px; color: var(--muted); font-size: .64rem; }

.chart-message {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--muted);
  font-size: .75rem;
  backdrop-filter: blur(3px);
}

.chart-message[hidden] { display: none; }
.chart-message.is-error { color: var(--red); }
.chart-message.is-error .spinner { display: none; }

.chart-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 11px; color: var(--muted); font-size: .64rem; }

.watchlist-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 21px;
}

.watchlist-panel .panel-head { align-items: flex-start; }
.watchlist-panel .refresh-control { display: grid; justify-items: end; gap: 3px; min-height: auto; padding: 0; border: 0; background: transparent; }
.watchlist-panel .refresh-control select { min-height: 28px; border: 1px solid var(--line); }

.ticker-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 308px;
  margin: 15px 0;
}

.ticker-placeholder { display: grid; min-height: 76px; place-items: center; color: var(--muted); font-size: .74rem; }

.ticker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(94px, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ticker:hover { background: var(--soft); }
.ticker.is-active { border-color: var(--line); background: var(--soft); }
.ticker-main,
.ticker-price { display: grid; gap: 6px; min-width: 0; }
.ticker-price { justify-items: end; }
.ticker-symbol { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.ticker-symbol b { overflow: hidden; color: var(--text-strong); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.ticker-symbol span { color: var(--muted); font-size: .6rem; }
.ticker-main small,
.ticker-price small { color: var(--muted); font-size: .61rem; font-variant-numeric: tabular-nums; }
.ticker-price strong { max-width: 100%; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ticker-change { font-weight: 750; }

.watchlist-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 37px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.watchlist-footer > span { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.watchlist-footer b { color: var(--muted-strong); font-size: .66rem; font-variant-numeric: tabular-nums; }
.watchlist-footer small { color: var(--muted); font-size: .59rem; text-align: right; }

.records-panel { min-width: 0; margin-top: 14px; padding: 21px; }
.records-head { align-items: flex-start; }
.record-tabs { max-width: 100%; overflow-x: auto; }
.record-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 10px; white-space: nowrap; }
.record-tabs span { display: inline-grid; min-width: 19px; height: 19px; place-items: center; padding: 0 5px; border-radius: 5px; background: var(--soft-strong); color: var(--muted-strong); font-size: .59rem; font-variant-numeric: tabular-nums; }
.record-panel { min-width: 0; padding-top: 17px; }
.record-panel[hidden] { display: none; }

.table-description { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 9px; color: var(--muted-strong); font-size: .72rem; }
.table-description small { color: var(--muted); font-size: .64rem; }

.table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th,
td { height: 49px; padding: 9px 13px; border-bottom: 1px solid var(--line); text-align: left; font-size: .75rem; font-variant-numeric: tabular-nums; }
th { position: sticky; z-index: 2; top: 0; height: 40px; background: var(--soft); color: var(--muted); font-size: .65rem; font-weight: 750; letter-spacing: .02em; }
td { color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--soft) 72%, transparent); }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: .62rem; }
.empty-row { height: 88px; color: var(--muted); text-align: center !important; }
.side-buy { color: var(--green); font-weight: 800; }
.side-sell { color: var(--red); font-weight: 800; }
.is-positive { color: var(--green) !important; }
.is-negative { color: var(--red) !important; }

.live-value {
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.value-flash-up { animation: value-up .62s ease-out; }
.value-flash-down { animation: value-down .62s ease-out; }

@keyframes value-up {
  0% { background: var(--green-soft); color: var(--green); text-shadow: 0 0 12px color-mix(in srgb, var(--green) 25%, transparent); }
  100% { background: transparent; text-shadow: none; }
}

@keyframes value-down {
  0% { background: var(--red-soft); color: var(--red); text-shadow: 0 0 12px color-mix(in srgb, var(--red) 22%, transparent); }
  100% { background: transparent; text-shadow: none; }
}

.is-private-hidden .private-value {
  filter: blur(8px);
  user-select: none;
}

@media (max-width: 1180px) {
  .topbar-inner,
  .dashboard-main { width: min(100% - 28px, 1540px); }
  .connection-pill { display: none; }
  .page-heading { align-items: flex-start; }
  .telemetry { display: grid; grid-template-columns: repeat(3, auto); }
  .telemetry > div { min-width: 105px; }
  .telemetry > div:nth-child(4) { display: none; }
  .environment-badge { justify-self: end; }
  .overview-grid { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr); }
  .market-layout { grid-template-columns: 1fr; }
  .ticker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
}

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 0; }
  .topbar-spacer { min-width: 20px; }
  .read-only-badge { display: none; }
  .select-control { margin-left: auto; }
  .page-heading { display: grid; }
  .telemetry { justify-content: start; width: 100%; overflow-x: auto; }
  .telemetry > div:first-child { border-left: 0; padding-left: 0; }
  .environment-badge { align-self: center; justify-self: start; }
  .overview-grid { grid-template-columns: 1fr; }
  .allocation-panel { min-height: 250px; }
  .allocation-content { grid-template-columns: 150px minmax(0, 1fr); min-height: 160px; }
  .market-stats { grid-template-columns: minmax(160px, 1.25fr) repeat(2, minmax(92px, .7fr)); }
  .market-stats > div:nth-child(4),
  .market-stats > div:nth-child(5) { display: none; }
  .records-head { display: grid; }
  .record-tabs { width: 100%; }
}

@media (max-width: 620px) {
  .topbar-inner,
  .dashboard-main { width: calc(100% - 20px); max-width: calc(100% - 20px); }
  .topbar-inner { display: grid; grid-template-columns: 38px auto minmax(0, 1fr) 38px; gap: 7px; min-width: 0; }
  .topbar-spacer { display: none; }
  .topbar { position: static; }
  .brand span:last-child { display: none; }
  #privacy-toggle { display: none; }
  .primary-button { width: 38px; padding: 0; }
  .primary-button span { display: none; }
  .select-control > span { display: none; }
  .select-control { justify-self: end; margin-left: 0; padding-left: 5px; }
  .select-control select { width: 72px; }
  .dashboard-main { padding-top: 22px; }
  .telemetry { grid-template-columns: repeat(3, max-content); }
  .telemetry > div { min-width: 94px; }
  .telemetry > div:nth-child(4),
  .environment-badge { display: none; }
  .portfolio-card,
  .allocation-panel,
  .chart-panel,
  .watchlist-panel,
  .records-panel { border-radius: 12px; padding: 16px; }
  .portfolio-card { min-height: 310px; }
  .portfolio-card .status-tag { display: none; }
  .portfolio-total { min-height: 62px; margin: 18px 0; }
  .portfolio-total strong { font-size: clamp(2rem, 10vw, 2.8rem); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid > div { padding: 13px 10px 0; }
  .summary-grid > div:nth-child(3) { margin-top: 12px; padding-left: 0; border-left: 0; }
  .summary-grid > div:nth-child(4) { margin-top: 12px; }
  .allocation-content { grid-template-columns: 120px minmax(0, 1fr); gap: 15px; }
  .allocation-donut { width: 116px; height: 116px; }
  .allocation-donut::after { width: 77px; height: 77px; }
  .chart-head { display: grid; align-items: start; justify-content: stretch; }
  .chart-head .range-switch { justify-self: start; }
  .range-switch { gap: 0; }
  .range-switch button { min-width: 34px; padding-inline: 6px; }
  .market-stats { grid-template-columns: 1fr 1fr; min-height: 92px; }
  .market-stats .market-price { grid-column: 1/-1; }
  .market-stats > div:nth-child(3) { display: grid; align-items: end; }
  .chart-stage { height: 270px; min-height: 270px; }
  .ticker-list { grid-template-columns: 1fr; }
  .watchlist-footer small { display: none; }
  .table-description { align-items: flex-start; }
  .table-description small { text-align: right; }
  th, td { padding-inline: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
