/* =========================================================
   海特洛市证券交易 · visual system
   A fictional exchange, built for play.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #0b0f0e;
  --bg-deep: #080b0a;
  --panel: #111714;
  --panel-2: #151d19;
  --panel-3: #1a231e;
  --ink: #f0eee2;
  --ink-soft: #d9dccf;
  --muted: #9da59a;
  --muted-2: #7e897f;
  --line: rgba(232, 238, 218, 0.10);
  --line-strong: rgba(232, 238, 218, 0.18);
  --line-bright: rgba(232, 238, 218, 0.28);
  --acid: #d9f36b;
  --acid-bright: #e7ff86;
  --acid-soft: rgba(217, 243, 107, 0.10);
  --up: #ff817a;
  --up-strong: #ff655e;
  --up-soft: rgba(255, 129, 122, 0.12);
  --down: #63d8b3;
  --down-strong: #42c99f;
  --down-soft: rgba(99, 216, 179, 0.10);
  --pink: #f2acc4;
  --pink-bright: #ffc2d7;
  --pink-deep: #bd456f;
  --pink-ink: #2d151d;
  --gold: #e7c987;
  --danger: #ff7d77;
  --serif: "Iowan Old Style", "Baskerville", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: "Aptos", "Segoe UI", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Berkeley Mono", "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Consolas", "Liberation Mono", monospace;
  --radius: 18px;
  --page-pad: clamp(16px, 2.3vw, 34px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-panel: 0 24px 70px rgba(0, 0, 0, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 9% 6%, rgba(180, 211, 83, 0.075), transparent 25rem),
    radial-gradient(circle at 92% 22%, rgba(242, 172, 196, 0.055), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: var(--acid);
  color: var(--bg-deep);
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(232, 238, 218, 0.16);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 99px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  flex: 0 0 auto;
  fill: currentColor;
  vertical-align: -0.15em;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 46vw;
  height: 46vw;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.34;
  border-radius: 50%;
}

.ambient-one {
  top: -28vw;
  left: -18vw;
  background: rgba(196, 225, 111, 0.11);
  animation: ambientDriftOne 28s ease-in-out infinite alternate;
}

.ambient-two {
  top: 28vh;
  right: -30vw;
  background: rgba(242, 172, 196, 0.08);
  animation: ambientDriftTwo 34s ease-in-out infinite alternate;
}

.grain {
  position: fixed;
  z-index: 1000;
  inset: 0;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

.app-shell {
  width: 100%;
  max-width: 1760px;
  min-height: 100vh;
  margin: 0 auto;
  padding-inline: var(--page-pad);
}

/* =========================================================
   Header
   ========================================================= */

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-mark {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  filter: drop-shadow(0 8px 18px rgba(217, 243, 107, 0.1));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-cn {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-en {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.3;
  white-space: nowrap;
}

.brand-en i {
  color: var(--pink);
  font-style: normal;
}

.market-clock {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-left: 2px;
}

.market-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 4px rgba(217, 243, 107, 0.08), 0 0 12px rgba(217, 243, 107, 0.4);
  animation: signalPulse 2.3s ease-in-out infinite;
}

.clock-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.session-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.session-day {
  font-size: 11px;
}

.session-day b {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 600;
}

.session-time {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.icon-button,
.quiet-button,
.reset-button,
.bank-top-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms var(--ease-out);
}

.icon-button {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.quiet-button .icon {
  width: 14px;
  height: 14px;
}

.speed-button span {
  min-width: 18px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 600;
}

.bank-top-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  border-color: rgba(242, 172, 196, 0.28);
  background: rgba(242, 172, 196, 0.07);
  color: var(--pink);
  text-align: left;
}

.bank-top-button > .icon {
  width: 17px;
  height: 17px;
}

.bank-top-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bank-top-copy > span {
  font-size: 11px;
  font-weight: 600;
  color: var(--pink-bright);
  letter-spacing: 0.02em;
}

.bank-top-copy small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-color: rgba(255, 129, 122, 0.25);
  color: var(--up);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.reset-button .icon {
  width: 14px;
  height: 14px;
}

.icon-button:hover,
.quiet-button:hover {
  border-color: var(--line-strong);
  background: rgba(232, 238, 218, 0.05);
  color: var(--ink);
}

.bank-top-button:hover {
  border-color: rgba(242, 172, 196, 0.5);
  background: rgba(242, 172, 196, 0.12);
  transform: translateY(-1px);
}

.reset-button:hover {
  border-color: var(--up);
  background: var(--up-soft);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

/* =========================================================
   Ticker strip
   ========================================================= */

.ticker-strip {
  height: 43px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  margin-inline: calc(var(--page-pad) * -1);
  padding-inline: var(--page-pad);
  overflow: hidden;
  background: rgba(8, 12, 10, 0.34);
}

.ticker-index {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 270px;
  padding-right: 22px;
}

.ticker-index-label {
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.ticker-index strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.ticker-index-change {
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ticker-divider {
  flex: 0 0 1px;
  margin-block: 11px;
  background: var(--line);
}

.ticker-quotes {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
}

.ticker-quotes::-webkit-scrollbar {
  display: none;
}

.ticker-quote {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-left: 1px solid var(--line);
  flex: 0 0 auto;
  height: 21px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1;
  transition: background-color 160ms ease;
}

.ticker-quote:hover {
  background: rgba(232, 238, 218, 0.04);
}

.ticker-quote .tq-code {
  color: var(--muted);
  letter-spacing: 0.02em;
}

.ticker-quote .tq-price {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.ticker-quote .tq-change {
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.ticker-breadth {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
  padding-left: 17px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.ticker-breadth b {
  color: var(--ink-soft);
  font-weight: 500;
}

.ticker-breadth > span:first-child b {
  color: var(--up);
}

.ticker-breadth > span:nth-child(2) b {
  color: var(--down);
}

.ticker-breadth .turnover-stat {
  padding-left: 13px;
  border-left: 1px solid var(--line);
}

/* =========================================================
   Account bar
   ========================================================= */

.page-main {
  padding-top: 20px;
}

.account-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(0, 3.2fr);
  gap: 26px;
  padding: 22px 27px 25px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, rgba(217, 243, 107, 0.055), transparent 32%),
    radial-gradient(circle at 85% -40%, rgba(242, 172, 196, 0.08), transparent 37%),
    linear-gradient(145deg, #151c18, #101512 72%);
  box-shadow: var(--shadow-panel);
  animation: riseIn 700ms var(--ease-out) both;
}

.account-bar::before {
  content: "ACCOUNT / 008";
  position: absolute;
  top: 14px;
  right: 20px;
  color: rgba(232, 238, 218, 0.18);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.account-bar::after {
  content: "";
  position: absolute;
  top: -60%;
  right: 8%;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(242, 172, 196, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.account-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 26px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.account-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.micro-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border: 1px solid rgba(217, 243, 107, 0.22);
  border-radius: 3px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.account-net {
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(28px, 2.55vw, 39px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 1.2;
  white-space: nowrap;
}

.account-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 9px;
}

.save-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--down);
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  min-width: 0;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 3px 18px;
  border-left: 1px solid var(--line);
}

.metric-cell:first-child {
  border-left: none;
}

.metric-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.metric-cell strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(15px, 1.28vw, 18px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-cell em {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-cell em.is-up,
.metric-cell strong.is-up {
  color: var(--up);
}

.metric-cell em.is-down,
.metric-cell strong.is-down {
  color: var(--down);
}

.metric-cell em.is-warning,
.metric-cell strong.is-warning {
  color: var(--gold);
}

.debt-metric strong {
  color: var(--pink);
}

.leverage-gauge {
  position: absolute;
  right: 27px;
  bottom: 10px;
  left: 27px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.gauge-track {
  position: relative;
  display: block;
  flex: 1;
  height: 2px;
  overflow: hidden;
  background: rgba(232, 238, 218, 0.08);
}

.gauge-track i {
  display: block;
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, var(--acid), var(--pink));
  transition: width 600ms var(--ease-out), background-color 300ms ease;
}

.gauge-track i.is-warning {
  background: linear-gradient(90deg, var(--gold), var(--up));
}

.gauge-caption {
  color: rgba(232, 238, 218, 0.22);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.17em;
}

/* =========================================================
   Dashboard shared
   ========================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(450px, 2.08fr) minmax(320px, 1.03fr);
  grid-template-areas:
    "market chart order"
    "market holdings bank";
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.02), transparent 44%),
    var(--panel);
  box-shadow: var(--shadow-panel);
  animation: riseIn 720ms var(--ease-out) both;
}

.market-panel {
  grid-area: market;
  animation-delay: 60ms;
}

.chart-panel {
  grid-area: chart;
  min-height: 505px;
  animation-delay: 110ms;
}

.order-panel {
  grid-area: order;
  animation-delay: 160ms;
}

.holdings-panel {
  grid-area: holdings;
  min-height: 236px;
  animation-delay: 210ms;
}

.bank-card {
  grid-area: bank;
  animation-delay: 260ms;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.section-index {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.panel-title h2 {
  margin: -1px 0 2px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.3;
}

.panel-title p {
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.eyebrow {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

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

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

.is-warning {
  color: var(--gold) !important;
}

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

/* =========================================================
   Market panel
   ========================================================= */

.market-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.market-head {
  align-items: flex-start;
}

.filter-tabs,
.range-tabs,
.tab-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 10, 0.3);
}

.filter-tabs button,
.range-tabs button,
.tab-switch button {
  min-height: 25px;
  padding: 0 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}

.filter-tabs button:hover,
.range-tabs button:hover,
.tab-switch button:hover {
  color: var(--ink-soft);
}

.filter-tabs button.active,
.range-tabs button.active,
.tab-switch button.active {
  background: rgba(232, 238, 218, 0.09);
  color: var(--ink);
  box-shadow: none;
}

.market-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 46px minmax(64px, 0.78fr);
  gap: 7px;
  padding: 9px 15px 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.market-columns span:last-child {
  text-align: right;
}

.stock-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.stock-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 46px minmax(64px, 0.78fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  border-top: 1px solid rgba(232, 238, 218, 0.055);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background-color 160ms ease;
}

@media (min-width: 821px) {
  .stock-list {
    display: flex;
    flex-direction: column;
  }

  .stock-row {
    flex: 1 1 0;
    max-height: 76px;
  }
}

.stock-row:first-child {
  border-top: none;
}

.stock-row::before {
  content: "";
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: 0;
  width: 2px;
  background: transparent;
  transition: background-color 160ms ease;
}

.stock-row:hover {
  background: rgba(232, 238, 218, 0.035);
}

.stock-row[aria-selected="true"] {
  background: linear-gradient(90deg, rgba(217, 243, 107, 0.09), rgba(217, 243, 107, 0.015));
}

.stock-row[aria-selected="true"]::before {
  background: var(--acid);
}

.stock-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stock-token {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(232, 238, 218, 0.035);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.stock-row[aria-selected="true"] .stock-token {
  border-color: rgba(217, 243, 107, 0.32);
  background: var(--acid-soft);
  color: var(--acid);
}

.stock-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.stock-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stock-code {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.stock-spark {
  width: 46px;
  height: 20px;
  overflow: visible;
  opacity: 0.9;
}

.stock-spark path {
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.stock-quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 0;
  text-align: right;
}

.stock-price {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.35;
  white-space: nowrap;
  transition: color 180ms ease;
}

.stock-change {
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  white-space: nowrap;
}

.stock-change small {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 400;
}

.market-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.01em;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-label i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--acid);
}

/* =========================================================
   Chart panel
   ========================================================= */

.chart-panel {
  display: flex;
  flex-direction: column;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 17px 20px 11px;
}

.chart-heading {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.chart-heading-copy {
  min-width: 0;
}

.chart-type {
  margin-top: 1px;
}

.chart-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.chart-name-row h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
}

.code-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.chart-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 5px;
}

.chart-price-row strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.change-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--up-soft);
  color: var(--up);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.change-pill.is-down {
  background: var(--down-soft);
  color: var(--down);
}

.change-pill.is-flat {
  background: rgba(232, 238, 218, 0.06);
  color: var(--muted);
}

.chart-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  flex: 0 0 auto;
}

.range-tabs button {
  padding-inline: 9px;
}

.text-button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted-2);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: rgba(232, 238, 218, 0.2);
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--ink-soft);
  text-decoration-color: var(--acid);
}

.text-button:disabled {
  cursor: default;
  opacity: 0.3;
  text-decoration: none;
}

.bank-submit:disabled,
.bank-quick-amounts button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.bank-submit:disabled:hover {
  background: var(--pink-ink);
}

.bank-submit.repay:disabled:hover {
  background: var(--pink-deep);
}

.chart-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin: 0 20px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}

.chart-facts > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.chart-facts span {
  color: var(--muted-2);
  font-size: 8px;
}

.chart-facts b {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 260px;
  margin: 1px 9px 0;
  overflow: hidden;
  border-radius: 11px;
  background:
    linear-gradient(rgba(232, 238, 218, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 238, 218, 0.014) 1px, transparent 1px);
  background-size: 100% 48px, 56px 100%;
}

.chart-canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(17, 23, 20, 0.05), rgba(17, 23, 20, 0.22));
}

#priceChart {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  cursor: crosshair;
  touch-action: pan-y;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  min-width: 92px;
  padding: 7px 8px;
  border: 1px solid rgba(217, 243, 107, 0.24);
  border-radius: 6px;
  background: rgba(8, 13, 10, 0.94);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  pointer-events: none;
  transform: translate(-50%, -110%);
  backdrop-filter: blur(8px);
}

.chart-tooltip span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
}

.chart-tooltip strong {
  display: block;
  margin: 1px 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
}

.chart-tooltip em {
  font-style: normal;
}

.chart-end-label {
  display: none;
}

.chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px 15px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.chart-legend i {
  width: 10px;
  height: 2px;
  flex: 0 0 10px;
  background: var(--acid);
}

.chart-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-hint {
  text-align: right;
  white-space: nowrap;
}

/* =========================================================
   Holdings / trades
   ========================================================= */

.holdings-panel {
  display: flex;
  flex-direction: column;
}

.holdings-head {
  padding-top: 14px;
  padding-bottom: 12px;
}

.tab-switch {
  flex: 0 0 auto;
}

.tab-switch button span {
  margin-left: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.ledger-view {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.positions-table th {
  padding: 9px 12px 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: right;
}

.positions-table th:first-child,
.positions-table td:first-child {
  padding-left: 19px;
  text-align: left;
}

.positions-table th:last-child,
.positions-table td:last-child {
  padding-right: 19px;
}

.positions-table td {
  padding: 9px 12px;
  border-top: 1px solid rgba(232, 238, 218, 0.055);
  color: var(--muted);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.positions-table tr:first-child td {
  border-top: none;
}

.positions-table tr:hover td {
  background: rgba(232, 238, 218, 0.025);
}

.pos-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
}

.pos-identity .stock-token {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  font-size: 10px;
}

.pos-identity strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.pos-identity small {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.pos-available {
  display: block;
  color: var(--muted-2);
  font-size: 7px;
}

.mini-sell {
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(232, 238, 218, 0.13);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  transition: 150ms ease;
}

.mini-sell:hover {
  border-color: var(--down);
  background: var(--down-soft);
  color: var(--down);
}

.empty-ledger {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px 24px;
  text-align: center;
}

.empty-symbol {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  margin-bottom: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-2);
  font-size: 17px;
}

.empty-ledger strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.empty-ledger p {
  max-width: 260px;
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
}

.trades-list {
  padding: 0 18px;
}

.trade-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 0.8fr 0.9fr 0.9fr;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(232, 238, 218, 0.055);
}

.trade-row:first-child {
  border-top: none;
}

.trade-main {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.trade-side {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 20px;
  flex: 0 0 27px;
  border-radius: 4px;
  background: var(--up-soft);
  color: var(--up);
  font-size: 8px;
  font-weight: 600;
}

.trade-side.sell {
  background: var(--down-soft);
  color: var(--down);
}

.trade-side.force {
  background: rgba(231, 201, 135, 0.12);
  color: var(--gold);
}

.trade-main strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
}

.trade-main small {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.trade-cell {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.trade-cell.trade-fee {
  color: var(--muted-2);
  font-size: 8px;
}

.trade-cell.trade-pnl {
  font-weight: 500;
}

/* =========================================================
   Order panel
   ========================================================= */

.order-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  background:
    radial-gradient(circle at 95% 0%, rgba(217, 243, 107, 0.045), transparent 15rem),
    var(--panel);
}

.order-head {
  align-items: flex-start;
}

.exchange-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.order-stock {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 19px 13px;
  border-bottom: 1px solid var(--line);
}

.order-stock-copy,
.order-stock-quote {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.order-stock-copy strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.order-stock-copy span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.order-stock-quote {
  align-items: flex-end;
  text-align: right;
}

.order-stock-quote strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1.2;
  white-space: nowrap;
}

.order-stock-quote span {
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.side-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 14px 19px 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(8, 12, 10, 0.26);
}

.side-switch button {
  min-height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: 180ms var(--ease-out);
}

.side-switch button:hover {
  color: var(--ink-soft);
}

.side-switch button.active.buy {
  background: var(--up-soft);
  color: var(--up);
  box-shadow: inset 0 0 0 1px rgba(255, 129, 122, 0.18);
}

.side-switch button.active.sell {
  background: var(--down-soft);
  color: var(--down);
  box-shadow: inset 0 0 0 1px rgba(99, 216, 179, 0.18);
}

.quantity-field {
  padding: 14px 19px 0;
}

.field-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.field-topline label {
  color: var(--ink-soft);
  font-size: 10px;
}

.field-topline span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.quantity-control {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 10, 0.3);
  transition: border-color 180ms ease;
}

.quantity-control:focus-within {
  border-color: var(--line-bright);
}

.quantity-control button {
  min-height: 42px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 300;
  transition: background-color 150ms ease, color 150ms ease;
}

.quantity-control button:hover {
  background: rgba(232, 238, 218, 0.05);
  color: var(--ink);
}

.quantity-input-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.quantity-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.quantity-input-wrap input::-webkit-inner-spin-button,
.quantity-input-wrap input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.quantity-input-wrap span {
  color: var(--muted-2);
  font-size: 9px;
}

.quick-quantity {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 7px;
}

.quick-quantity button {
  min-height: 26px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 8px;
  transition: 150ms ease;
}

.quick-quantity button:hover {
  border-color: var(--line-strong);
  background: rgba(232, 238, 218, 0.04);
  color: var(--ink-soft);
}

.availability-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 12px 19px 0;
  padding: 8px 9px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted-2);
  font-size: 8px;
  flex-wrap: wrap;
}

.availability-row strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.availability-row .max-buy {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.order-breakdown {
  margin: 12px 19px 0;
  padding: 0;
}

.order-breakdown > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 3px 0;
  color: var(--muted-2);
  font-size: 9px;
}

.order-breakdown dt {
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-breakdown dd {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.order-breakdown .order-total {
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.order-breakdown .order-total dt {
  color: var(--ink-soft);
}

.order-breakdown .order-total dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.order-submit {
  min-height: 45px;
  margin: 13px 19px 0;
  padding: 0 15px;
  border: none;
  border-radius: 8px;
  background: var(--up);
  color: #1b0c0a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 24px rgba(255, 101, 94, 0.13);
  transition: filter 160ms ease, transform 160ms var(--ease-out), box-shadow 160ms ease;
}

.order-submit:hover {
  filter: brightness(1.07);
  box-shadow: 0 12px 30px rgba(255, 101, 94, 0.2);
  transform: translateY(-1px);
}

.order-submit.sell {
  background: var(--down);
  color: #061511;
  box-shadow: 0 10px 24px rgba(66, 201, 159, 0.12);
}

.order-submit:disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.order-footnote {
  margin: 9px 19px 15px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

/* =========================================================
   Bank promo card
   ========================================================= */

.bank-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 173px;
  overflow: hidden;
  padding: 17px 18px 15px;
  border: 1px solid rgba(58, 24, 35, 0.35);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 84% 14%, rgba(255, 246, 239, 0.32), transparent 28%),
    linear-gradient(145deg, #f3b6cb 0%, #eaa0b9 55%, #e598b4 100%);
  color: var(--pink-ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  animation: riseIn 720ms var(--ease-out) both;
  animation-delay: 260ms;
}

.bank-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.17;
  background-image: radial-gradient(rgba(45, 21, 29, 0.5) 0.65px, transparent 0.65px);
  background-size: 5px 5px;
  mask-image: linear-gradient(110deg, transparent 15%, #000 100%);
  -webkit-mask-image: linear-gradient(110deg, transparent 15%, #000 100%);
}

.bank-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
}

.bank-symbol {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border: 1px solid rgba(45, 21, 29, 0.22);
  border-radius: 50%;
  background: rgba(255, 248, 240, 0.2);
}

.bank-symbol .icon {
  width: 16px;
  height: 16px;
}

.bank-card-title {
  min-width: 0;
}

.bank-card-title span {
  display: block;
  color: rgba(45, 21, 29, 0.59);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.bank-card-title h2 {
  margin: 1px 0 0;
  color: var(--pink-ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.bank-open-button {
  width: 30px;
  height: 30px;
  margin-left: auto;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(45, 21, 29, 0.22);
  border-radius: 50%;
  background: transparent;
  color: rgba(45, 21, 29, 0.7);
  transition: 180ms ease;
}

.bank-open-button .icon {
  width: 14px;
  height: 14px;
}

.bank-open-button:hover {
  border-color: rgba(45, 21, 29, 0.5);
  background: rgba(255, 248, 240, 0.24);
  color: var(--pink-ink);
}

.bank-credit-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
}

.bank-credit-row > span {
  color: rgba(45, 21, 29, 0.68);
  font-size: 9px;
}

.bank-credit-row strong {
  color: var(--pink-ink);
  font-family: var(--mono);
  font-size: clamp(20px, 1.65vw, 24px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.bank-meter {
  position: relative;
  z-index: 1;
  height: 3px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(45, 21, 29, 0.18);
}

.bank-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--pink-ink);
  transition: width 500ms var(--ease-out);
}

.bank-card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: rgba(45, 21, 29, 0.63);
  font-size: 9px;
  white-space: nowrap;
}

.bank-card-foot b {
  color: rgba(45, 21, 29, 0.88);
  font-family: var(--mono);
  font-weight: 500;
}

.bank-card-offer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed rgba(45, 21, 29, 0.2);
  color: rgba(45, 21, 29, 0.56);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bank-card-offer span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pink-ink);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
}

.bank-card-offer .icon {
  width: 11px;
  height: 11px;
  transition: transform 160ms ease;
}

.bank-card:hover .bank-card-offer .icon {
  transform: translateX(2px);
}

.bank-watermark {
  position: absolute;
  right: -17px;
  bottom: -23px;
  width: 122px;
  height: 122px;
  color: rgba(59, 25, 36, 0.11);
  transform: rotate(-14deg);
  pointer-events: none;
}

.bank-watermark .icon {
  width: 100%;
  height: 100%;
}

/* =========================================================
   Wire strip
   ========================================================= */

.wire-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 51px;
  margin-top: 14px;
  padding: 0 16px 0 17px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 12, 0.38);
  animation: riseIn 720ms var(--ease-out) 310ms both;
}

.wire-label {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wire-label .icon {
  width: 14px;
  height: 14px;
  color: var(--acid);
}

.wire-label i {
  width: 4px;
  height: 4px;
  margin-left: 1px;
  border-radius: 50%;
  background: var(--up);
  animation: signalPulse 1.8s ease-in-out infinite;
}

.wire-latest {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  text-align: left;
}

.wire-time {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.wire-text {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.015em;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 160ms ease;
}

.wire-latest:hover .wire-text {
  color: var(--acid);
}

.wire-end {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 0 0 auto;
}

.wire-disclaimer {
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
}

.wire-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  transition: 160ms ease;
}

.wire-all .icon {
  width: 12px;
  height: 12px;
}

.wire-all:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.site-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 19px 2px 29px;
  color: rgba(157, 165, 154, 0.58);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.01em;
}

.footer-rule {
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}

.footer-seal {
  margin-left: auto;
  color: rgba(232, 238, 218, 0.2);
  font-size: 7px;
  letter-spacing: 0.14em;
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-stack {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--acid);
  border-radius: 8px;
  background: rgba(13, 19, 16, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  color: var(--ink);
  pointer-events: auto;
  backdrop-filter: blur(18px);
  animation: toastIn 300ms var(--ease-out) both;
}

.toast.is-leaving {
  animation: toastOut 220ms ease both;
}

.toast-error {
  border-left-color: var(--up);
}

.toast-warning {
  border-left-color: var(--gold);
}

.toast-bank {
  border-left-color: var(--pink);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--acid-soft);
  color: var(--acid);
  font-size: 11px;
}

.toast-error .toast-icon {
  background: var(--up-soft);
  color: var(--up);
}

.toast-warning .toast-icon {
  background: rgba(231, 201, 135, 0.12);
  color: var(--gold);
}

.toast-bank .toast-icon {
  background: rgba(242, 172, 196, 0.12);
  color: var(--pink);
}

.toast-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.toast-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

/* =========================================================
   Modals shared
   ========================================================= */

.modal {
  width: min(720px, calc(100vw - 30px));
  max-width: none;
  max-height: calc(100vh - 30px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.58);
  overscroll-behavior: contain;
}

.modal::backdrop {
  background: rgba(4, 7, 6, 0.76);
  backdrop-filter: blur(10px);
}

.modal[open] {
  animation: modalIn 320ms var(--ease-out) both;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: 160ms ease;
}

.modal-close .icon {
  width: 14px;
  height: 14px;
}

.modal-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* =========================================================
   Reset modal
   ========================================================= */

.reset-modal {
  width: min(560px, calc(100vw - 30px));
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 129, 122, 0.095), transparent 22rem),
    var(--panel);
}

.reset-shell {
  padding: 22px 24px 20px;
}

.reset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}

.reset-symbol {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(255, 129, 122, 0.24);
  border-radius: 12px;
  background: var(--up-soft);
  color: var(--up);
}

.reset-symbol .icon {
  width: 22px;
  height: 22px;
}

.reset-shell h2 {
  margin: 6px 0 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.reset-shell > p {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.reset-summary {
  display: grid;
  gap: 0;
  margin: 19px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reset-summary > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 10px;
}

.reset-summary > div + div {
  border-top: 1px dashed var(--line);
}

.reset-summary b {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

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

.secondary-action,
.danger-action,
.guide-start {
  min-height: 39px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 500;
  transition: 160ms ease;
}

.secondary-action {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.secondary-action:hover {
  color: var(--ink);
  background: rgba(232, 238, 218, 0.05);
}

.danger-action {
  border: 1px solid var(--up);
  background: var(--up);
  color: #1b0b09;
}

.danger-action:hover {
  filter: brightness(1.07);
}

.reset-tiny {
  margin-top: 14px !important;
  color: var(--muted-2) !important;
  font-size: 8px !important;
  line-height: 1.6 !important;
}

/* =========================================================
   Guide modal
   ========================================================= */

.guide-modal {
  width: min(980px, calc(100vw - 30px));
  background:
    radial-gradient(circle at 0% 0%, rgba(217, 243, 107, 0.07), transparent 22rem),
    #e9e7db;
  color: #161b17;
  border-color: rgba(17, 23, 19, 0.2);
}

.guide-modal::backdrop {
  background: rgba(4, 7, 6, 0.8);
}

.guide-shell {
  padding: 25px 28px 20px;
}

.guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(17, 23, 19, 0.16);
}

.guide-head .eyebrow {
  color: rgba(17, 23, 19, 0.48);
}

.guide-head h2 {
  margin: 7px 0 7px;
  color: #101511;
  font-family: var(--serif);
  font-size: clamp(31px, 5vw, 50px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.04;
}

.guide-head p {
  max-width: 520px;
  margin: 0;
  color: rgba(22, 27, 23, 0.62);
  font-size: 11px;
  line-height: 1.7;
}

.guide-head .modal-close {
  border-color: rgba(17, 23, 19, 0.2);
  color: rgba(17, 23, 19, 0.55);
}

.guide-head .modal-close:hover {
  color: #101511;
  border-color: rgba(17, 23, 19, 0.45);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 5px;
}

.guide-grid section {
  min-width: 0;
  padding: 17px 18px 18px 0;
  border-right: 1px solid rgba(17, 23, 19, 0.11);
  border-bottom: 1px solid rgba(17, 23, 19, 0.11);
}

.guide-grid section:nth-child(3n) {
  padding-right: 0;
  padding-left: 18px;
  border-right: none;
}

.guide-grid section:nth-child(3n + 2) {
  padding-left: 18px;
}

.guide-grid section:nth-child(n + 4) {
  border-bottom: none;
}

.guide-number {
  color: rgba(17, 23, 19, 0.3);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.guide-grid h3 {
  margin: 5px 0 5px;
  color: #151b16;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.guide-grid p {
  margin: 0;
  color: rgba(22, 27, 23, 0.63);
  font-size: 10px;
  line-height: 1.7;
}

.guide-grid p b {
  color: #151b16;
  font-weight: 650;
}

.guide-equation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 21px;
  padding: 13px 15px;
  border: 1px solid rgba(17, 23, 19, 0.17);
  border-radius: 8px;
  background: rgba(217, 243, 107, 0.32);
  color: rgba(17, 23, 19, 0.56);
  font-size: 10px;
}

.guide-equation strong {
  color: #121812;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

.guide-start {
  margin-left: auto;
  border: 1px solid #151b16;
  background: #151b16;
  color: #f0eee2;
}

.guide-start:hover {
  background: #263028;
}

.guide-legal {
  margin: 13px 0 0;
  color: rgba(17, 23, 19, 0.4);
  font-size: 8px;
  line-height: 1.7;
}

/* =========================================================
   News modal
   ========================================================= */

.news-modal {
  width: min(760px, calc(100vw - 30px));
  background:
    radial-gradient(circle at 100% 0%, rgba(242, 172, 196, 0.055), transparent 22rem),
    var(--panel);
}

.news-shell {
  padding: 23px 24px 18px;
}

.news-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.news-head h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.1;
}

.news-list {
  max-height: 54vh;
  overflow: auto;
}

.news-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-stamp {
  padding-top: 1px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
}

.news-item-stamp span {
  display: block;
  margin-top: 5px;
  color: rgba(242, 172, 196, 0.7);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.news-item-copy strong {
  display: block;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.news-item-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.news-impact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.news-impact span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
}

.news-impact span.up {
  border-color: rgba(255, 129, 122, 0.18);
  color: var(--up);
}

.news-impact span.down {
  border-color: rgba(99, 216, 179, 0.18);
  color: var(--down);
}

.news-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.65;
}

/* =========================================================
   Bank modal
   ========================================================= */

.bank-modal {
  width: min(1120px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  border-color: rgba(45, 21, 29, 0.24);
  background: #f1dce3;
  color: var(--pink-ink);
  color-scheme: light;
}

.bank-modal::backdrop {
  background: rgba(7, 9, 7, 0.71);
}

.bank-modal-shell {
  padding: 0 24px 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 251, 242, 0.55), transparent 25rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.18), transparent 45%),
    #f1dce3;
}

.bank-modal-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 17px;
  background: #f1dce3;
}

.bank-modal-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: rgba(45, 21, 29, 0.08);
  opacity: 0;
  transition: opacity 180ms ease;
}

.bank-modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bank-seal-small {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(45, 21, 29, 0.26);
  border-radius: 50%;
  background: rgba(255, 248, 240, 0.3);
}

.bank-seal-small .icon {
  width: 18px;
  height: 18px;
}

.bank-modal-brand span {
  display: block;
  color: rgba(45, 21, 29, 0.5);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.bank-modal-brand h2 {
  margin: 2px 0 0;
  color: var(--pink-ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}

.bank-close {
  border-color: rgba(45, 21, 29, 0.2);
  color: rgba(45, 21, 29, 0.6);
}

.bank-close:hover {
  border-color: rgba(45, 21, 29, 0.45);
  color: var(--pink-ink);
}

.bank-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 203px;
  gap: 20px;
  align-items: center;
  min-height: 175px;
  padding: 23px 26px;
  overflow: hidden;
  border-radius: 13px;
  background:
    radial-gradient(circle at 84% 20%, rgba(242, 172, 196, 0.24), transparent 15rem),
    linear-gradient(135deg, #351a24, #271319);
  color: #f9e8ed;
  box-shadow: 0 16px 38px rgba(45, 21, 29, 0.16);
}

.bank-overline {
  margin: 0;
  color: rgba(249, 232, 237, 0.45);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.bank-hero h3 {
  margin: 7px 0 6px;
  color: #f9e8ed;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 35px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.bank-hero-copy > p:last-child {
  max-width: 530px;
  margin: 0;
  color: rgba(249, 232, 237, 0.6);
  font-size: 9px;
  line-height: 1.7;
}

.bank-stamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 158px;
  height: 158px;
  border: 1px solid rgba(242, 172, 196, 0.42);
  border-radius: 50%;
  color: var(--pink);
  text-align: center;
  transform: rotate(-8deg);
}

.bank-stamp::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(242, 172, 196, 0.25);
  border-radius: 50%;
}

.bank-stamp span,
.bank-stamp small {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.16em;
}

.bank-stamp .icon {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
  margin: 7px 0 5px;
}

.bank-stamp strong {
  position: relative;
  z-index: 1;
  color: var(--pink-bright);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bank-stamp small {
  margin-top: 5px;
  color: rgba(242, 172, 196, 0.45);
}

.bank-feedback {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 9px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 21, 29, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.56);
  color: rgba(45, 21, 29, 0.7);
  animation: bankFeedbackIn 240ms var(--ease-out) both;
}

.bank-feedback[hidden] {
  display: none;
}

.bank-feedback.is-success {
  border-color: rgba(80, 117, 55, 0.28);
  background: rgba(232, 243, 211, 0.58);
}

.bank-feedback.is-error {
  border-color: rgba(169, 52, 94, 0.32);
  background: rgba(255, 224, 230, 0.68);
}

.bank-feedback-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(45, 21, 29, 0.12);
  color: var(--pink-ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.bank-feedback.is-success .bank-feedback-mark {
  background: #617f3f;
  color: #f8f3e5;
}

.bank-feedback.is-error .bank-feedback-mark {
  background: var(--pink-deep);
  color: #fff4f6;
}

.bank-feedback strong {
  display: block;
  color: var(--pink-ink);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
}

.bank-feedback small {
  display: block;
  margin-top: 2px;
  color: rgba(45, 21, 29, 0.52);
  font-size: 7px;
  line-height: 1.55;
}

@keyframes bankFeedbackIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bank-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 9px 0;
}

.bank-overview-card {
  min-width: 0;
  padding: 12px 13px 11px;
  border: 1px solid rgba(45, 21, 29, 0.11);
  border-radius: 8px;
  background: rgba(255, 248, 240, 0.34);
}

.bank-overview-card.primary {
  background: rgba(255, 250, 240, 0.62);
}

.bank-overview-card > span {
  display: block;
  color: rgba(45, 21, 29, 0.52);
  font-size: 8px;
  line-height: 1.35;
}

.bank-overview-card strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--pink-ink);
  font-family: var(--mono);
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-overview-card small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: rgba(45, 21, 29, 0.48);
  font-size: 7px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-overview-meter {
  height: 2px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(45, 21, 29, 0.13);
}

.bank-overview-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--pink-deep);
  border-radius: inherit;
  transition: width 500ms var(--ease-out);
}

.bank-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(280px, 0.87fr);
  gap: 9px;
}

.bank-form-panel {
  padding: 17px 18px 16px;
  border: 1px solid rgba(45, 21, 29, 0.12);
  border-radius: 10px;
  background: rgba(255, 250, 242, 0.57);
}

.bank-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(45, 21, 29, 0.12);
}

.bank-tabs button {
  position: relative;
  min-height: 23px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(45, 21, 29, 0.42);
  font-size: 10px;
  font-weight: 500;
  transition: color 160ms ease;
}

.bank-tabs button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -14px;
  left: 0;
  height: 2px;
  background: transparent;
  transition: background-color 160ms ease;
}

.bank-tabs button.active {
  color: var(--pink-ink);
}

.bank-tabs button.active::after {
  background: var(--pink-deep);
}

.bank-tabs button:hover {
  color: var(--pink-ink);
}

.bank-tab-panel {
  padding-top: 16px;
}

.bank-amount-label {
  display: block;
  margin-bottom: 5px;
  color: rgba(45, 21, 29, 0.58);
  font-size: 9px;
}

.bank-amount-input {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 11px;
  border: 1px solid rgba(45, 21, 29, 0.19);
  border-radius: 7px;
  background: rgba(255, 252, 246, 0.72);
  transition: border-color 160ms ease;
}

.bank-amount-input:focus-within {
  border-color: rgba(189, 69, 111, 0.7);
}

.bank-amount-input > span {
  color: rgba(45, 21, 29, 0.5);
  font-family: var(--mono);
  font-size: 14px;
}

.bank-amount-input input {
  width: 100%;
  min-width: 0;
  height: 47px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--pink-ink);
  font-family: var(--mono);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  appearance: textfield;
  -moz-appearance: textfield;
}

.bank-amount-input input::-webkit-inner-spin-button,
.bank-amount-input input::-webkit-outer-spin-button {
  appearance: none;
}

.bank-amount-input small {
  color: rgba(45, 21, 29, 0.42);
  font-size: 9px;
}

.bank-amount-input.repay input {
  font-size: 21px;
}

input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 8px 0 2px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--pink-deep) 0%,
    var(--pink-deep) var(--range-progress, 20%),
    rgba(45, 21, 29, 0.16) var(--range-progress, 20%),
    rgba(45, 21, 29, 0.16) 100%
  );
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: rgba(45, 21, 29, 0.16);
}

input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 99px;
  background: var(--pink-deep);
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border: 2px solid rgba(255, 250, 242, 0.95);
  border-radius: 50%;
  background: var(--pink-deep);
  box-shadow: 0 1px 4px rgba(45, 21, 29, 0.2);
  appearance: none;
  -webkit-appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 250, 242, 0.95);
  border-radius: 50%;
  background: var(--pink-deep);
  box-shadow: 0 1px 4px rgba(45, 21, 29, 0.2);
}

.bank-quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.bank-quick-amounts button {
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(45, 21, 29, 0.14);
  border-radius: 4px;
  background: transparent;
  color: rgba(45, 21, 29, 0.54);
  font-size: 8px;
  transition: 150ms ease;
}

.bank-quick-amounts button:hover {
  border-color: rgba(189, 69, 111, 0.42);
  background: rgba(189, 69, 111, 0.06);
  color: var(--pink-deep);
}

.bank-preview {
  display: grid;
  gap: 1px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed rgba(45, 21, 29, 0.16);
}

.bank-preview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  color: rgba(45, 21, 29, 0.5);
  font-size: 8px;
}

.bank-preview b {
  color: var(--pink-ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bank-submit {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 1px solid var(--pink-ink);
  border-radius: 6px;
  background: var(--pink-ink);
  color: #f8e3e9;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: 170ms ease;
}

.bank-submit:hover {
  background: #4a2633;
}

.bank-submit:disabled {
  opacity: 0.4;
}

.bank-submit.repay {
  border-color: var(--pink-deep);
  background: var(--pink-deep);
}

.bank-submit.repay:hover {
  background: #a9345e;
}

.bank-form-footnote {
  margin: 8px 0 0;
  color: rgba(45, 21, 29, 0.4);
  font-size: 7px;
  line-height: 1.55;
  text-align: center;
}

.repay-debt-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(45, 21, 29, 0.16);
}

.repay-debt-line span {
  color: rgba(45, 21, 29, 0.5);
  font-size: 9px;
}

.repay-debt-line strong {
  color: var(--pink-ink);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
}

.repay-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  padding: 8px 0 12px;
  color: rgba(45, 21, 29, 0.46);
  font-size: 8px;
}

.repay-breakdown b {
  color: rgba(45, 21, 29, 0.76);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
}

.bank-repay-note {
  min-height: 25px;
  margin: 8px 0 0;
  color: rgba(45, 21, 29, 0.42);
  font-size: 7px;
  line-height: 1.55;
}

.bank-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bank-aside-block {
  padding: 12px 13px;
  border: 1px solid rgba(45, 21, 29, 0.11);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.32);
}

.bank-aside-label {
  display: block;
  color: rgba(45, 21, 29, 0.44);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bank-aside-block > strong {
  display: block;
  margin-top: 4px;
  color: var(--pink-ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bank-aside-block > p,
.bank-aside-block > div + p {
  margin: 4px 0 0;
  color: rgba(45, 21, 29, 0.47);
  font-size: 7px;
  line-height: 1.6;
}

.risk-scale {
  margin-top: 8px;
}

.risk-track {
  position: relative;
  height: 3px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #8bbd6c 0%, #e0ba68 62%, #d76462 100%);
  border-radius: 99px;
}

.risk-track i {
  position: absolute;
  top: 50%;
  left: 33%;
  width: 7px;
  height: 7px;
  border: 1.5px solid #fff8f0;
  border-radius: 50%;
  background: var(--pink-ink);
  box-shadow: 0 1px 3px rgba(45, 21, 29, 0.2);
  transform: translate(-50%, -50%);
  transition: left 500ms var(--ease-out);
}

.risk-labels {
  display: flex;
  justify-content: space-between;
  color: rgba(45, 21, 29, 0.38);
  font-family: var(--mono);
  font-size: 6px;
}

.bank-aside-block.warning {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  border-color: rgba(189, 69, 111, 0.17);
  background: rgba(189, 69, 111, 0.055);
}

.bank-aside-block.warning > .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--pink-deep);
}

.bank-aside-block.warning .bank-aside-label {
  color: rgba(45, 21, 29, 0.58);
}

.bank-log-block {
  min-height: 0;
  padding: 11px 13px;
  border: 1px solid rgba(45, 21, 29, 0.11);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.27);
}

.bank-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: rgba(45, 21, 29, 0.46);
  font-size: 8px;
}

.bank-log-head b {
  color: rgba(45, 21, 29, 0.32);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
}

.bank-log {
  max-height: 78px;
  margin-top: 5px;
  overflow: auto;
}

.bank-log p {
  margin: 0;
  color: rgba(45, 21, 29, 0.36);
  font-size: 7px;
  line-height: 1.6;
}

.bank-log-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-top: 1px solid rgba(45, 21, 29, 0.07);
  color: rgba(45, 21, 29, 0.46);
  font-size: 7px;
  line-height: 1.45;
}

.bank-log-item:first-child {
  border-top: none;
}

.bank-log-item b {
  color: rgba(45, 21, 29, 0.7);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  white-space: nowrap;
}

.bank-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 9px -24px 0;
  padding: 11px 24px 12px;
  border-top: 1px solid rgba(45, 21, 29, 0.1);
  color: rgba(45, 21, 29, 0.38);
  font-family: var(--mono);
  font-size: 7px;
}

/* =========================================================
   Motion
   ========================================================= */

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes flashUp {
  0% {
    background-color: rgba(255, 129, 122, 0.14);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes flashDown {
  0% {
    background-color: rgba(99, 216, 179, 0.11);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes ambientDriftOne {
  to {
    transform: translate(8vw, 5vh) scale(1.08);
  }
}

@keyframes ambientDriftTwo {
  to {
    transform: translate(-5vw, -5vh) scale(1.1);
  }
}

.flash-up {
  animation: flashUp 530ms ease-out both;
}

.flash-down {
  animation: flashDown 530ms ease-out both;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1380px) {
  .topbar {
    gap: 18px;
  }

  .market-clock {
    gap: 11px;
  }

  .session-meta {
    gap: 8px;
  }

  .bank-top-copy small {
    display: none;
  }

  .bank-top-button {
    padding-inline: 10px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(250px, 0.86fr) minmax(420px, 2.02fr) minmax(300px, 1.04fr);
  }

  .metric-cell {
    padding-inline: 14px;
  }

  .account-bar {
    gap: 18px;
    padding-inline: 23px;
  }

  .account-net {
    font-size: clamp(27px, 2.4vw, 35px);
  }

  .wire-disclaimer {
    display: none;
  }
}

@media (max-width: 1180px) {
  .market-clock {
    margin-left: auto;
  }

  .brand-en {
    font-size: 7px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(315px, 0.62fr);
    grid-template-areas:
      "chart order"
      "market order"
      "holdings holdings"
      "bank bank";
    gap: 13px;
  }

  .chart-panel {
    min-height: 488px;
  }

  .market-panel {
    min-height: 390px;
  }

  .order-panel {
    align-self: start;
  }

  .bank-card {
    min-height: 150px;
  }

  .bank-credit-row {
    margin-top: 13px;
  }

  .account-bar {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 2.8fr);
  }

  .account-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .metric-cell {
    padding-inline: 11px;
  }

  .metric-cell strong {
    font-size: 14px;
  }

  .metric-cell em {
    font-size: 8px;
  }

  .ticker-breadth {
    display: none;
  }

  .ticker-index {
    min-width: 245px;
  }

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

  .guide-grid section {
    border-right: none;
    border-bottom: 1px solid rgba(17, 23, 19, 0.11);
  }

  .guide-grid section:nth-child(2n) {
    padding-left: 18px;
    border-left: 1px solid rgba(17, 23, 19, 0.11);
  }

  .guide-grid section:nth-child(3n) {
    padding-left: 0;
  }

  .guide-grid section:nth-child(n + 4) {
    border-bottom: 1px solid rgba(17, 23, 19, 0.11);
  }

  .guide-grid section:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    padding-block: 13px;
    row-gap: 12px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .market-clock {
    order: 2;
    margin-left: 0;
    flex: 0 0 auto;
  }

  .top-actions {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .account-bar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 21px 24px;
  }

  .account-hero {
    padding-right: 0;
    padding-bottom: 13px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .account-net {
    font-size: clamp(28px, 4vw, 36px);
  }

  .account-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .leverage-gauge {
    right: 21px;
    left: 21px;
  }

  .bank-workspace {
    grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.92fr);
  }

  .bank-modal-shell {
    padding-inline: 19px;
  }

  .bank-modal-foot {
    margin-inline: -19px;
    padding-inline: 19px;
  }

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

@media (max-width: 820px) {
  :root {
    --radius: 15px;
  }

  .topbar {
    gap: 11px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand-cn {
    font-size: 18px;
  }

  .brand-en {
    font-size: 6.5px;
  }

  .top-actions {
    gap: 6px;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

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

  .quiet-button,
  .icon-button {
    flex: 0 0 auto;
  }

  .bank-top-button {
    flex: 0 0 auto;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "market"
      "chart"
      "order"
      "holdings"
      "bank";
    gap: 12px;
  }

  .market-panel {
    min-height: 0;
  }

  .market-head {
    align-items: center;
  }

  .market-columns {
    display: none;
  }

  .stock-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .stock-row {
    flex: 0 0 176px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "id quote"
      "spark change";
    gap: 7px 8px;
    min-height: 91px;
    padding: 12px;
    border-top: none;
    border-left: 1px solid rgba(232, 238, 218, 0.055);
    scroll-snap-align: start;
  }

  .stock-row:first-child {
    border-left: none;
  }

  .stock-row::before {
    top: auto;
    right: 12px;
    bottom: 0;
    left: 12px;
    width: auto;
    height: 2px;
  }

  .stock-identity {
    grid-area: id;
  }

  .stock-name {
    font-size: 10px;
  }

  .stock-spark {
    grid-area: spark;
    width: 58px;
    height: 22px;
  }

  .stock-quote {
    grid-area: quote;
  }

  .stock-price {
    font-size: 12px;
  }

  .stock-row .stock-change {
    grid-area: change;
    align-self: end;
    text-align: left;
  }

  .stock-change small {
    display: none;
  }

  .market-footer {
    padding-block: 8px;
  }

  .chart-panel {
    min-height: 470px;
  }

  .order-panel {
    align-self: stretch;
  }

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

  .bank-card {
    min-height: 170px;
  }

  .wire-strip {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    padding-block: 9px;
  }

  .wire-latest {
    order: 3;
    flex: 1 0 100%;
    padding-top: 7px;
  }

  .wire-end {
    order: 2;
    margin-left: auto;
  }

  .wire-label {
    order: 1;
  }

  .wire-all {
    order: 2;
  }

  .wire-text {
    font-size: 12px;
    white-space: normal;
  }

  .ticker-strip {
    height: 41px;
  }

  .ticker-index {
    min-width: 228px;
    padding-right: 15px;
  }

  .bank-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 20px 21px;
  }

  .bank-stamp {
    display: none;
  }

  .bank-workspace {
    grid-template-columns: 1fr;
  }

  .bank-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bank-log-block {
    grid-column: 1 / -1;
  }

  .guide-grid {
    grid-template-columns: 1fr 1fr;
  }

  .guide-shell {
    padding: 21px 20px 18px;
  }

  .guide-head h2 {
    font-size: 36px;
  }

  .news-shell {
    padding-inline: 19px;
  }

  .reset-shell {
    padding-inline: 19px;
  }

  .site-footer {
    padding-bottom: 22px;
  }

  .footer-seal {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .app-shell {
    padding-inline: 12px;
  }

  .topbar {
    min-height: 0;
    padding-block: 11px;
    gap: 9px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-cn {
    font-size: 16px;
    letter-spacing: 0.015em;
  }

  .brand-en {
    font-size: 6px;
    letter-spacing: 0.08em;
  }

  .market-clock {
    order: 2;
    margin-left: auto;
  }

  .market-status {
    font-size: 9px;
    gap: 6px;
  }

  .clock-divider,
  .session-day {
    display: none;
  }

  .session-time {
    font-size: 11px;
  }

  .top-actions {
    order: 3;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
    gap: 5px;
    padding-top: 8px;
  }

  .icon-button,
  .quiet-button,
  .reset-button {
    min-height: 34px;
    padding-inline: 9px;
  }

  .icon-button {
    width: 34px;
  }

  .quiet-button span {
    display: none;
  }

  .speed-button span {
    display: inline;
    min-width: 16px;
    font-size: 9px;
  }

  .bank-top-button {
    min-height: 34px;
    padding: 0 9px;
    gap: 6px;
  }

  .bank-top-copy > span {
    font-size: 10px;
  }

  .reset-button {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 10px;
    gap: 4px;
  }

  .ticker-strip {
    margin-inline: -12px;
    padding-inline: 12px;
    height: 39px;
  }

  .ticker-index {
    min-width: 202px;
    gap: 7px;
    padding-right: 11px;
  }

  .ticker-index-label {
    font-size: 7px;
    padding-inline: 5px;
  }

  .ticker-index strong {
    font-size: 11px;
  }

  .ticker-index-change {
    font-size: 8px;
  }

  .ticker-quote {
    padding-inline: 10px;
    font-size: 8px;
  }

  .page-main {
    padding-top: 12px;
  }

  .account-bar {
    padding: 16px 15px 22px;
    gap: 13px;
  }

  .account-bar::before {
    display: none;
  }

  .account-kicker {
    font-size: 9px;
  }

  .account-net {
    font-size: 29px;
  }

  .account-subline {
    gap: 8px;
    margin-top: 5px;
    font-size: 8px;
  }

  .save-state {
    font-size: 8px;
  }

  .account-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .metric-cell {
    padding: 10px 10px 9px 0;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .metric-cell:nth-child(odd) {
    padding-left: 0;
    padding-right: 11px;
    border-right: 1px solid var(--line);
  }

  .metric-cell:nth-child(even) {
    padding-left: 11px;
  }

  .metric-cell:first-child,
  .metric-cell:nth-child(2) {
    border-top: none;
  }

  .metric-cell:last-child {
    grid-column: 1 / -1;
    border-right: none;
    padding-left: 0;
    padding-right: 0;
  }

  .metric-cell strong {
    font-size: 15px;
  }

  .metric-cell em {
    font-size: 8px;
  }

  .leverage-gauge {
    right: 15px;
    left: 15px;
    bottom: 8px;
  }

  .dashboard-grid {
    margin-top: 11px;
    gap: 10px;
  }

  .panel-head {
    padding: 13px 14px;
  }

  .section-index {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
    font-size: 7px;
  }

  .panel-title {
    gap: 8px;
  }

  .panel-title h2 {
    font-size: 13px;
  }

  .panel-title p {
    font-size: 8px;
  }

  .filter-tabs button,
  .range-tabs button,
  .tab-switch button {
    min-height: 23px;
    padding-inline: 6px;
    font-size: 8px;
  }

  .market-head {
    align-items: flex-start;
  }

  .stock-row {
    flex-basis: 162px;
    min-height: 87px;
    padding: 10px;
  }

  .stock-row::before {
    right: 10px;
    left: 10px;
  }

  .stock-token {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    font-size: 10px;
  }

  .stock-name {
    font-size: 9.5px;
  }

  .market-footer {
    font-size: 7px;
  }

  .chart-panel {
    min-height: 440px;
  }

  .chart-head {
    padding: 13px 14px 9px;
    gap: 10px;
  }

  .chart-heading {
    gap: 8px;
  }

  .chart-name-row {
    gap: 6px;
  }

  .chart-name-row h2 {
    font-size: 20px;
  }

  .chart-price-row {
    gap: 7px;
    margin-top: 3px;
  }

  .chart-price-row strong {
    font-size: 24px;
  }

  .chart-toolbar {
    gap: 7px;
  }

  .range-tabs {
    gap: 0;
    padding: 1px;
  }

  .range-tabs button {
    padding-inline: 6px;
    font-size: 7.5px;
  }

  .text-button {
    font-size: 8px;
  }

  .chart-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px 10px;
    margin-inline: 14px;
    padding-block: 8px;
  }

  .chart-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 4px;
  }

  .chart-facts > div:nth-child(4),
  .chart-facts > div:nth-child(5) {
    min-width: 0;
  }

  .chart-canvas-wrap,
  #priceChart {
    min-height: 225px;
  }

  .chart-footer {
    padding: 8px 14px 13px;
    font-size: 7px;
  }

  .chart-hint {
    display: none;
  }

  .holdings-panel {
    min-height: 245px;
  }

  .holdings-head {
    align-items: flex-start;
    padding-block: 12px;
  }

  .positions-table {
    min-width: 560px;
  }

  .positions-table th:first-child,
  .positions-table td:first-child {
    padding-left: 14px;
  }

  .positions-table th:last-child,
  .positions-table td:last-child {
    padding-right: 14px;
  }

  .empty-ledger {
    min-height: 154px;
  }

  .order-head {
    padding-block: 13px;
  }

  .order-stock {
    padding: 12px 14px;
  }

  .order-stock-copy strong {
    font-size: 16px;
  }

  .side-switch {
    margin: 11px 14px 0;
  }

  .quantity-field {
    padding: 12px 14px 0;
  }

  .availability-row,
  .order-breakdown {
    margin-inline: 14px;
  }

  .order-submit {
    margin: 12px 14px 0;
  }

  .order-footnote {
    margin: 8px 14px 13px;
  }

  .bank-card {
    min-height: 164px;
    padding: 15px;
  }

  .bank-credit-row strong {
    font-size: 21px;
  }

  .wire-strip {
    margin-top: 10px;
    padding-inline: 12px;
  }

  .wire-time {
    font-size: 8px;
  }

  .wire-text {
    font-size: 11px;
  }

  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding-top: 14px;
    font-size: 7px;
    line-height: 1.55;
  }

  .footer-rule {
    display: none;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
  }

  .toast {
    grid-template-columns: 18px 1fr;
    padding: 10px 11px;
  }

  .modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  .bank-modal-shell {
    padding: 14px 12px 0;
  }

  .bank-modal-brand span {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bank-modal-brand h2 {
    font-size: 18px;
  }

  .bank-modal-head {
    padding-bottom: 12px;
  }

  .bank-hero {
    padding: 18px 17px;
    border-radius: 10px;
  }

  .bank-hero h3 {
    font-size: 24px;
  }

  .bank-hero-copy > p:last-child {
    font-size: 8px;
  }

  .bank-overview {
    gap: 5px;
    margin-block: 6px;
  }

  .bank-overview-card {
    padding: 9px 10px;
  }

  .bank-overview-card strong {
    font-size: 16px;
  }

  .bank-overview-card small {
    font-size: 6.5px;
  }

  .bank-form-panel {
    padding: 14px 13px;
  }

  .bank-aside {
    grid-template-columns: 1fr;
  }

  .bank-log-block {
    grid-column: auto;
  }

  .bank-modal-foot {
    margin-inline: -12px;
    padding-inline: 12px;
    font-size: 6.5px;
  }

  .bank-modal-foot span:last-child {
    display: none;
  }

  .guide-shell {
    padding: 18px 16px 15px;
  }

  .guide-head {
    gap: 13px;
    padding-bottom: 16px;
  }

  .guide-head h2 {
    font-size: 31px;
  }

  .guide-head p {
    font-size: 10px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .guide-grid section,
  .guide-grid section:nth-child(2n),
  .guide-grid section:nth-child(3n) {
    padding: 13px 0;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid rgba(17, 23, 19, 0.11);
  }

  .guide-grid section:nth-last-child(-n + 2) {
    border-bottom: 1px solid rgba(17, 23, 19, 0.11);
  }

  .guide-grid section:last-child {
    border-bottom: none;
  }

  .guide-equation {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-top: 13px;
  }

  .guide-equation strong {
    font-size: 14px;
  }

  .guide-start {
    width: 100%;
    margin-top: 4px;
  }

  .reset-shell {
    padding: 17px 15px 15px;
  }

  .reset-head {
    margin-bottom: 15px;
  }

  .reset-summary > div {
    padding-block: 7px;
  }

  .reset-actions {
    flex-direction: column-reverse;
  }

  .reset-actions button {
    width: 100%;
  }

  .news-shell {
    padding: 17px 14px 14px;
  }

  .news-head h2 {
    font-size: 27px;
  }

  .news-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 9px;
  }

  .news-item-copy strong {
    font-size: 13px;
  }

  .news-list {
    max-height: 60vh;
  }
}

@media (max-width: 390px) {
  .brand-cn {
    font-size: 15px;
  }

  .brand-en {
    font-size: 5.5px;
    letter-spacing: 0.04em;
  }

  .market-clock {
    display: none;
  }

  .top-actions {
    justify-content: space-between;
  }

  .reset-button span {
    display: none;
  }

  .reset-button {
    width: 34px;
    padding-inline: 0;
  }

  .ticker-index {
    min-width: 192px;
  }

  .account-net {
    font-size: 26px;
  }

  .chart-head {
    flex-wrap: wrap;
  }

  .chart-toolbar {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .bank-overview {
    grid-template-columns: 1fr;
  }

  .bank-overview-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 3px 8px;
  }

  .bank-overview-card > span {
    grid-column: 1;
  }

  .bank-overview-card strong {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .bank-overview-card small {
    grid-column: 1;
  }

  .bank-overview-meter {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* =========================================================
   Readability pass
   ========================================================= */

.panel-title p {
  font-size: 9.5px;
}

.chart-facts span {
  font-size: 8.5px;
}

.chart-facts b {
  font-size: 9.5px;
}

.market-footer {
  font-size: 8.5px;
}

.bank-modal-brand span {
  font-size: 7.5px;
}

.bank-hero-copy > p:last-child {
  font-size: 10px;
  line-height: 1.72;
}

.bank-overview-card > span {
  font-size: 8.5px;
}

.bank-overview-card small {
  font-size: 7.5px;
}

.bank-tabs button {
  font-size: 10.5px;
}

.bank-amount-label {
  font-size: 9.5px;
}

.bank-quick-amounts button {
  font-size: 8.5px;
}

.bank-preview > div {
  font-size: 8.5px;
}

.bank-preview b {
  font-size: 9.5px;
}

.bank-form-footnote {
  font-size: 7.5px;
}

.bank-aside-label {
  font-size: 7.5px;
}

.bank-aside-block > p,
.bank-aside-block > div + p {
  font-size: 8px;
  line-height: 1.65;
}

.bank-aside-block > strong {
  font-size: 19px;
}

.bank-log-head {
  font-size: 8.5px;
}

.bank-log p,
.bank-log-item {
  font-size: 7.5px;
  line-height: 1.6;
}

.bank-log-item b {
  font-size: 7.5px;
}

.bank-modal-foot {
  font-size: 7.5px;
}

.bank-card-offer {
  font-size: 8px;
}

@media (max-width: 820px) {
  .filter-tabs button,
  .range-tabs button,
  .tab-switch button {
    min-height: 30px;
  }

  .quick-quantity button {
    min-height: 32px;
  }

  .mini-sell {
    min-height: 32px;
    padding-inline: 10px;
  }

  .modal-close {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .bank-submit {
    min-height: 44px;
  }

  .stock-list {
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
  }
}

@media (max-width: 620px) {
  .icon-button,
  .quiet-button,
  .reset-button {
    min-height: 38px;
  }

  .bank-modal-body,
  .bank-modal-head {
    min-width: 0;
  }

  .bank-modal-shell {
    padding-top: 0;
  }

  .bank-modal-head {
    padding-top: 14px;
  }

  .bank-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .bank-overview-card {
    display: block;
    min-width: 0;
    padding: 10px;
  }

  .bank-overview-card > span,
  .bank-overview-card > small,
  .bank-overview-card > strong {
    display: block;
  }

  .bank-overview-card strong {
    margin-top: 3px;
  }

  .bank-overview-card small {
    margin-top: 3px;
  }

  .bank-overview-meter {
    grid-column: auto;
    width: auto;
  }

  .news-item-copy strong {
    font-size: 15px;
  }

  .news-item-copy p {
    font-size: 10.5px;
  }

  .news-item-stamp {
    font-size: 8.5px;
  }

  .micro-badge {
    font-size: 8px;
  }

  .icon-button {
    width: 38px;
  }

  .quiet-button {
    padding-inline: 10px;
  }

  .bank-top-button {
    min-height: 38px;
  }

  .reset-button {
    min-height: 38px;
    min-width: 56px;
    padding-inline: 8px;
    gap: 4px;
    font-size: 10px;
  }

  .top-actions {
    gap: 4px;
    justify-content: space-between;
  }

  .panel-title p {
    font-size: 9.5px;
  }

  .stock-row {
    flex-basis: 178px;
    min-height: 96px;
    padding: 11px;
  }

  .stock-name {
    font-size: 11px;
  }

  .stock-name.is-long {
    font-size: 10px;
  }

  .stock-code {
    font-size: 8.5px;
  }

  .stock-token {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 10.5px;
  }

  .stock-price {
    font-size: 13px;
  }

  .stock-change {
    font-size: 9.5px;
  }

  .market-footer {
    font-size: 8.5px;
  }

  .chart-name-row h2 {
    font-size: 21px;
  }

  .chart-price-row strong {
    font-size: 26px;
  }

  .range-tabs button {
    font-size: 8.5px;
  }

  .text-button {
    font-size: 9px;
  }

  .chart-facts span {
    font-size: 8.5px;
  }

  .chart-facts b {
    font-size: 9.5px;
  }

  .chart-footer {
    font-size: 8px;
  }

  .side-switch button {
    font-size: 13px;
    min-height: 38px;
  }

  .field-topline label {
    font-size: 11px;
  }

  .field-topline span {
    font-size: 8.5px;
  }

  .quantity-input-wrap input {
    font-size: 18px;
  }

  .quantity-control button {
    font-size: 17px;
  }

  .quick-quantity button {
    min-height: 32px;
    font-size: 9px;
  }

  .availability-row {
    font-size: 9px;
  }

  .availability-row strong,
  .availability-row .max-buy {
    font-size: 9px;
  }

  .order-breakdown > div {
    font-size: 10px;
  }

  .order-breakdown dd {
    font-size: 10px;
  }

  .order-breakdown .order-total dd {
    font-size: 13px;
  }

  .order-submit {
    min-height: 48px;
    font-size: 13px;
  }

  .order-footnote {
    font-size: 9px;
    line-height: 1.6;
  }

  .empty-ledger p {
    font-size: 10px;
    line-height: 1.7;
  }

  .empty-ledger strong {
    font-size: 12px;
  }

  .bank-card {
    min-height: 190px;
  }

  .bank-card-title h2 {
    font-size: 19px;
  }

  .bank-credit-row > span {
    font-size: 10px;
  }

  .bank-card-foot {
    font-size: 9.5px;
  }

  .bank-card-offer {
    font-size: 8.5px;
  }

  .bank-card-offer span:last-child {
    font-size: 10px;
  }

  .wire-label {
    font-size: 11px;
  }

  .wire-all {
    min-height: 31px;
    font-size: 10px;
  }

  .wire-text {
    font-size: 12px;
    line-height: 1.55;
  }

  .wire-time {
    font-size: 8.5px;
  }

  .site-footer {
    font-size: 8px;
  }

  .news-item-copy p {
    font-size: 10px;
  }

  .news-impact span {
    font-size: 8px;
  }

  .news-item-stamp {
    font-size: 8.5px;
  }

  .guide-grid p {
    font-size: 10.5px;
  }

  .guide-head p {
    font-size: 10.5px;
  }

  .reset-tiny {
    font-size: 8.5px !important;
  }

  .bank-modal-brand span {
    font-size: 7px;
  }

  .bank-hero-copy > p:last-child {
    font-size: 9.5px;
  }

  .bank-overview-card > span {
    font-size: 8.5px;
  }

  .bank-overview-card small {
    font-size: 7px;
  }

  .bank-preview > div {
    font-size: 8.5px;
  }

  .bank-form-footnote {
    font-size: 8px;
  }

  .bank-aside-block > p,
  .bank-aside-block > div + p {
    font-size: 8.5px;
  }

  .bank-modal-foot {
    font-size: 7px;
  }

  .bank-log p,
  .bank-log-item {
    font-size: 8px;
  }
}

@media (max-width: 390px) {
  .market-clock {
    display: flex;
  }

  .reset-button span {
    display: inline;
  }

  .reset-button {
    width: auto;
    padding-inline: 8px;
  }

  .top-actions {
    gap: 4px;
  }
}

/* =========================================================
   异象都市 · 今日头条
   ========================================================= */

.page-main {
  padding-top: 12px;
}

.headline-strip {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 66px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(23, 28, 22, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.28), transparent 52%),
    repeating-linear-gradient(
      0deg,
      rgba(23, 28, 22, 0.018) 0,
      rgba(23, 28, 22, 0.018) 1px,
      transparent 1px,
      transparent 4px
    ),
    #e9e6da;
  color: #171b16;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.17);
  animation: riseIn 680ms var(--ease-out) 35ms both;
}

.headline-flag {
  position: relative;
  display: flex;
  flex: 0 0 132px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 11px 17px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(242, 172, 196, 0.16), transparent 60%),
    #151a16;
  color: #f1ede0;
}

.headline-flag::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: var(--pink);
}

.headline-flag-en {
  color: var(--pink);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.3;
  white-space: nowrap;
}

.headline-flag strong {
  color: #f4efe1;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}

.headline-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: #171b16;
  text-align: left;
}

.headline-main:focus-visible {
  outline: 2px solid #171b16;
  outline-offset: -4px;
}

.headline-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  flex: 0 0 auto;
  padding: 0 7px;
  border: 1px solid rgba(23, 28, 22, 0.8);
  border-radius: 3px;
  background: #171b16;
  color: #f2eee1;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.headline-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #171b16;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 160ms ease;
}

.headline-main:hover .headline-text {
  color: #8a3137;
}

.headline-impact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(21, 67, 51, 0.18);
  border-radius: 3px;
  background: rgba(34, 107, 85, 0.07);
  color: #226b55;
  font-family: var(--mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.headline-impact[hidden] {
  display: none;
}

.headline-impact.is-up {
  border-color: rgba(151, 55, 49, 0.2);
  background: rgba(151, 55, 49, 0.08);
  color: #9f3933;
}

.headline-impact.is-down {
  border-color: rgba(34, 107, 85, 0.22);
  background: rgba(34, 107, 85, 0.08);
  color: #226b55;
}

.headline-impact .impact-label {
  max-width: 112px;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 8px;
  text-overflow: ellipsis;
}

.headline-impact b {
  font-weight: 700;
}

.headline-time {
  flex: 0 0 auto;
  color: rgba(23, 28, 22, 0.46);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.headline-side {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding: 0 13px;
  border-left: 1px solid rgba(23, 28, 22, 0.14);
}

.headline-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(23, 28, 22, 0.48);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.headline-note i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b4433d;
  animation: signalPulse 1.9s ease-in-out infinite;
}

.headline-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(23, 28, 22, 0.85);
  border-radius: 5px;
  background: #171b16;
  color: #f0ebdc;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.headline-all .icon {
  width: 11px;
  height: 11px;
}

.headline-all:hover {
  background: #313a30;
  transform: translateY(-1px);
}

.headline-strip.is-breaking .headline-flag {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 129, 122, 0.18), transparent 60%),
    #3b1b1d;
}

.headline-strip.is-breaking .headline-flag::after {
  background: var(--up);
}

.headline-strip.is-breaking .headline-category {
  border-color: #9d3534;
  background: #9d3534;
  color: #fff5ec;
}

.headline-strip.is-breaking .headline-main {
  background: linear-gradient(90deg, rgba(255, 129, 122, 0.075), transparent 62%);
}

.headline-strip.is-breaking .headline-text {
  color: #7e262c;
}

.headline-strip.is-fresh .headline-flag {
  animation: headlinePulse 1.4s var(--ease-out) both;
}

.headline-strip.is-fresh .headline-category {
  animation: headlineBadgePulse 1.5s var(--ease-out) both;
}

@keyframes headlinePulse {
  0% {
    box-shadow: inset 0 0 0 999px rgba(255, 129, 122, 0.28);
  }
  100% {
    box-shadow: inset 0 0 0 999px rgba(255, 129, 122, 0);
  }
}

@keyframes headlineBadgePulse {
  0% {
    transform: scale(0.92);
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* Headlines inside the archive dialog */

.news-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.025em;
}

.news-category {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.news-breaking {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--up);
  color: #1e0c0a;
  font-family: var(--sans);
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.3;
}

.news-item-featured {
  position: relative;
  background: linear-gradient(90deg, rgba(255, 129, 122, 0.055), transparent 60%);
  box-shadow: inset 2px 0 0 rgba(255, 129, 122, 0.45);
}

.news-item-featured .news-item-copy strong {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.35;
}

.news-item-featured .news-category {
  border-color: rgba(255, 129, 122, 0.26);
  color: var(--up);
}

.news-item-featured .news-item-stamp {
  padding-left: 4px;
}

/* A more urgent toast for breaking headlines */

.toast-breaking {
  border-color: rgba(255, 129, 122, 0.25);
  border-left-color: var(--up);
  background:
    linear-gradient(100deg, rgba(255, 129, 122, 0.09), transparent 55%),
    rgba(13, 19, 16, 0.97);
}

.toast-breaking .toast-icon {
  background: var(--up-soft);
  color: var(--up);
}

.toast-breaking .toast-copy strong {
  color: #ffe6df;
}

/* 17 rows do not stretch; the market tape is scrollable. */
@media (min-width: 821px) {
  .stock-list {
    display: flex;
    flex-direction: column;
    scrollbar-gutter: stable;
  }

  .stock-row {
    flex: 0 0 auto;
    min-height: 50px;
    max-height: none;
  }
}

.stock-name.is-long {
  font-size: 10.5px;
  letter-spacing: -0.015em;
}

.order-stock-copy strong.is-long {
  font-size: 15px;
}

@media (max-width: 1180px) {
  .headline-flag {
    flex-basis: 114px;
  }

  .headline-note {
    display: none;
  }

  .headline-side {
    padding-inline: 10px;
  }
}

@media (max-width: 820px) {
  .headline-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "flag side"
      "main main";
    min-height: 0;
    border-radius: 14px;
  }

  .headline-flag {
    grid-area: flag;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 13px;
    flex-basis: auto;
  }

  .headline-flag::after {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 2px;
  }

  .headline-flag strong {
    font-size: 15px;
  }

  .headline-side {
    grid-area: side;
    justify-content: flex-end;
    min-height: 42px;
    padding: 4px 10px;
    border-left: none;
    border-bottom: 1px solid rgba(23, 28, 22, 0.12);
  }

  .headline-main {
    grid-area: main;
    min-height: 48px;
    padding: 8px 12px;
    border-top: 1px dashed rgba(23, 28, 22, 0.16);
  }

  .headline-impact {
    max-width: 155px;
    overflow: hidden;
  }

  .headline-impact .impact-label {
    max-width: 68px;
  }

  .headline-all {
    min-height: 28px;
  }
}

@media (max-width: 620px) {
  .headline-strip {
    margin-bottom: 10px;
  }

  .headline-flag {
    min-height: 39px;
    padding: 7px 10px;
    gap: 6px;
  }

  .headline-flag-en {
    font-size: 5.5px;
  }

  .headline-flag strong {
    font-size: 14px;
  }

  .headline-side {
    min-height: 39px;
    padding: 4px 8px;
  }

  .headline-main {
    gap: 7px;
    min-height: 46px;
    padding: 8px 10px;
  }

  .headline-category {
    min-height: 18px;
    padding-inline: 6px;
    font-size: 7px;
  }

  .headline-text {
    font-size: 12.5px;
  }

  .headline-time {
    display: none;
  }

  .headline-impact {
    max-width: 112px;
    padding: 2px 5px;
    font-size: 7.5px;
  }

  .headline-impact .impact-label {
    display: none;
  }

  .headline-all {
    min-height: 27px;
    padding-inline: 8px;
    font-size: 8px;
  }

  .headline-all .icon {
    width: 10px;
    height: 10px;
  }

  .news-item-featured .news-item-copy strong {
    font-size: 18px;
  }
}

@media (max-width: 390px) {
  .headline-flag-en {
    display: none;
  }

  .headline-flag strong {
    font-size: 13px;
  }

  .headline-note {
    display: none;
  }
}

/* =========================================================
   K-line chart
   ========================================================= */

.chart-legend-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 11px;
  min-width: 0;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.chart-legend .candle-swatch {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 9px;
  flex: 0 0 6px;
  border-radius: 1px;
  background: var(--up);
  color: var(--up);
}

.chart-legend .candle-swatch::before {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: currentColor;
  transform: translateX(-50%);
}

.chart-ma {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}

.chart-ma i {
  display: block;
  width: 10px;
  height: 2px;
  flex: 0 0 10px;
  border-radius: 99px;
}

.chart-ma.ma5 i {
  background: #e7c987;
}

.chart-ma.ma10 i {
  background: #f2acc4;
}

.chart-tooltip {
  width: 170px;
  padding: 9px 10px;
  transform: translate(-50%, -112%);
}

.tooltip-time {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-close {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.tooltip-close strong {
  display: inline-block;
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.tooltip-close em {
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.tooltip-ohlc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.tooltip-ohlc > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.tooltip-ohlc span {
  display: inline;
  color: var(--muted-2);
  font-size: 8px;
}

.tooltip-ohlc b {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 500;
}

@media (max-width: 620px) {
  .chart-legend-group {
    max-width: 60%;
    gap: 5px 8px;
  }

  .chart-ma {
    font-size: 7.5px;
  }

  .chart-legend {
    max-width: 100%;
  }

  .chart-tooltip {
    width: 158px;
    padding: 8px 9px;
  }
}

@media (max-width: 390px) {
  .chart-legend-group {
    max-width: 100%;
  }

  .chart-tooltip {
    width: 150px;
  }
}

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