/* ==========================================================================
   MEXC Crypto — Meridian Terminal
   A daylight-chart / night-cockpit identity. Cobalt is the instrument light;
   brass is reserved for the market. Surfaces are flat, edges are precise.
   ========================================================================== */

:root {
  --display: "Bahnschrift", "DIN Alternate", "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #07111f;
  --bg-side: #050d18;
  --panel: #0d1a2b;
  --panel2: #14253a;
  --line: rgba(188, 216, 244, .12);
  --line2: rgba(188, 216, 244, .20);
  --tx: #eef5ff;
  --tx2: #c4d4e8;
  --mut: #91a6bf;
  --dim: #7f95af;

  --accent: #63a9e8;
  --accent-strong: #8cc4f2;
  --accent-soft: rgba(99, 169, 232, .14);
  --dex: #63a9e8;
  --dex-soft: rgba(99, 169, 232, .14);
  --dex-line: rgba(99, 169, 232, .40);
  --up: #4fd1a5;
  --up2: #74dfba;
  --down: #f08a8f;
  --down2: #f5a5a9;
  --amber: #d9b478;
  --btc: #f7931a;
  --eth: #8fa8f0;
  --danger-soft: rgba(240, 138, 143, .12);

  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;
  --r: 5px;
  --r-lg: 7px;
  --r-pill: 999px;
  --pad-card: 18px;
  --pad-page: 26px;
  --side-w: 228px;
  --side-rail: 68px;
  --top-h: 58px;
  --nav-row: 38px;
  --page-max: 1560px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-hover: .16s;
  --dur-menu: .2s;
  --dur-enter: .24s;

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f7fd;
  --bg-side: #eaf1fb;
  --panel: #ffffff;
  --panel2: #e7effa;
  --line: rgba(31, 95, 174, .14);
  --line2: rgba(31, 95, 174, .22);
  --tx: #0e2340;
  --tx2: #35506e;
  --mut: #536982;
  --dim: #5d7189;

  --accent: #1f5fae;
  --accent-strong: #164a87;
  --accent-soft: rgba(31, 95, 174, .08);
  --dex: #1f5fae;
  --dex-soft: rgba(31, 95, 174, .08);
  --dex-line: rgba(31, 95, 174, .30);
  --up: #0c7a58;
  --up2: #0c7a58;
  --down: #b23a48;
  --down2: #9e303e;
  --amber: #946118;
  --btc: #b45c00;
  --eth: #4254b5;
  --danger-soft: rgba(189, 52, 70, .08);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Base / shell
   -------------------------------------------------------------------------- */

html { background: var(--bg); }
html[data-i18n-ready="0"] body { visibility: hidden; }
body {
  background: var(--bg);
  color: var(--tx);
  font: 14px/1.5 var(--sans);
  transition: background-color .18s ease, color .18s ease;
}
.lang-select {
  height: 30px;
  max-width: 112px;
  padding: 0 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--tx2);
  font-family: var(--mono);
  font-size: 11px;
  outline: none;
}
.lang-select:focus { border-color: var(--accent); }
.login-lang { position: absolute; top: 22px; left: 22px; }
html[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", var(--sans); }
html[dir="rtl"] .app { flex-direction: row-reverse; }
html[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .nav a.on::before { left: auto; right: 0; }
html[dir="rtl"] .crumb, html[dir="rtl"] .top .right { direction: rtl; }
html[dir="rtl"] .settings-nav button { text-align: right; border-left: 0; border-right: 2px solid transparent; }
html[dir="rtl"] .settings-nav button.on { border-left: 0; border-right-color: var(--accent); }
html[dir="rtl"] .card > h3::before { order: 2; }
html[dir="rtl"] .note { border-left: 0; border-right: 3px solid var(--accent); border-radius: var(--r-sm) 0 0 var(--r-sm); }
html[dir="rtl"] .dep-address, html[dir="rtl"] .mono, html[dir="rtl"] code { direction: ltr; text-align: left; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--mut); }
::-webkit-scrollbar-track { background: transparent; }

.side {
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  padding: 18px 12px 14px;
}
.brand {
  gap: 11px;
  padding: 2px 7px 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.logo {
  width: 32px; height: 32px; flex-basis: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand b {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .015em;
}
.brand .subbrand {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
  color: var(--mut);
  text-transform: uppercase;
}
.nav { gap: 2px; }
.nav a {
  height: var(--nav-row);
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--tx2);
}
.nav a:hover { background: var(--panel2); color: var(--tx); }
.nav a.on {
  background: var(--panel2);
  color: var(--tx);
  border-color: var(--line);
}
.nav a.on::before {
  left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0;
  background: var(--accent);
}
.nav .ico { color: var(--mut); }
.nav a.on .ico { color: var(--accent); }
.nav-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: var(--nav-row);
  min-height: 0;
  margin-top: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--tx2);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav-sec:hover { background: var(--panel2); color: var(--tx); }
.nav-sec .sec-lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-sec .sec-ico { width: 16px; height: 16px; flex: 0 0 16px; color: var(--mut); }
.nav-sec:hover .sec-ico { color: var(--tx); }
.nav-group.has-active > .nav-sec { color: var(--tx); }
.nav-group.has-active > .nav-sec .sec-ico { color: var(--accent); }
.nav-group.has-active > .nav-sec .nav-chev { color: var(--accent); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-items { display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav-items::before { display: none; }
.nav-group.collapsed .nav-items { display: none; }
.nav-group.collapsed .nav-chev { transform: rotate(-90deg); }
.nav-chev { flex: 0 0 auto; color: var(--mut); transition: transform .16s ease, color var(--dur-hover) var(--ease); }
.nav-sec:hover .nav-chev { color: var(--tx); }
.nav-sec em {
  margin-left: 4px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: .02em;
  color: var(--accent);
  text-transform: none;
}
.nav a.sub {
  height: var(--nav-row);
  padding-inline-start: 10px;
  font-size: 13px;
}
.nav a.sub .ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 13%, transparent);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.nav a.off { opacity: .45; pointer-events: none; }
.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .01em;
  color: var(--mut);
}
.side-foot .stamp { font-family: var(--mono); color: var(--tx2); font-size: 10px; }
.guide-link { color: var(--mut); font-size: 10px; }

.main { min-width: 0; }
.top {
  height: var(--top-h);
  padding-left: max(var(--pad-page), calc((100% - var(--page-max)) / 2 + var(--pad-page)));
  padding-right: max(var(--pad-page), calc((100% - var(--page-max)) / 2 + var(--pad-page)));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.crumb { font-family: var(--mono); font-size: 11px; color: var(--mut); }
.crumb b {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--tx);
}
.crumb em { color: var(--dim); }
.clock { font-size: 11px; letter-spacing: .04em; color: var(--mut); }
.top .right { gap: 8px; }
.riskpill {
  border-radius: var(--r-sm);
  background: transparent;
  border-color: var(--line);
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 10px;
}
.riskpill .lbl { font-family: var(--sans); font-size: 10px; }
.riskpill b { font-size: 12px; }

.theme-toggle {
  width: 32px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--tx2);
  padding: 0;
  transition: border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--panel2); }
.theme-toggle svg { display: none; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
html[data-theme="light"] .theme-toggle .ico-moon { display: block; }

.accountbtn {
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border-color: var(--line);
}
.accountbtn .av {
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  border-color: var(--dex-line);
  color: var(--accent);
}
.accountmenu {
  border-radius: var(--r-sm);
  background: var(--panel);
  border-color: var(--line2);
  padding: 5px;
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
}
.accountmenu button { border-radius: var(--r-xs); font-size: 12px; }

/* --------------------------------------------------------------------------
   Page frame / type
   -------------------------------------------------------------------------- */

.views {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 26px var(--pad-page) 52px;
  width: 100%;
}
h2.pg {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  transition: color var(--dur-hover) var(--ease);
}
h2.pg::before {
  content: "";
  width: 5px; height: 24px;
  background: var(--accent);
  flex: 0 0 5px;
}
h2.pg .dim {
  margin-left: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--mut);
}
.g { gap: 14px; }
.mt { margin-top: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--pad-card);
  box-shadow: none;
}
.card > h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .015em;
  color: var(--tx);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 13px;
}
.card > h3::before {
  content: "";
  width: 12px; height: 2px;
  background: var(--accent);
  flex: 0 0 12px;
}
.card > h3 .r {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .01em;
  color: var(--mut);
}
.hint { font-size: 12px; color: var(--mut); line-height: 1.65; }
.sub { color: var(--mut); }

/* data hierarchy */
.stat, .kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.stat .l, .kpi .kh { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--mut); }
.stat .n, .kpi .v {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.stat .s, .kpi .f { font-size: 11px; color: var(--mut); }
.kpi .kh .brand-ic { border-radius: var(--r-xs); color: #fff; }
.kv { border-bottom-color: var(--line); }
.kv span { color: var(--mut); font-size: 12px; }

/* Detail quote */
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  padding: 0;
  overflow: hidden;
}
.dh-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 22px 24px;
}
.dh-id { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.dh-icon {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: #fff;
  font-family: var(--display);
  font-size: 18px;
}
.dh-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 9px; }
.dh-title b { font-family: var(--display); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.dh-title .nm { font-size: 13px; color: var(--mut); }
.dh-title .chip { font-size: 10px; padding: 1px 7px; }
.dh-meta {
  display: flex; flex-wrap: wrap; gap: 5px 0;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mut);
}
.dh-meta span { padding: 0 10px; border-left: 1px solid var(--line); }
.dh-meta span:first-child { padding-left: 0; border-left: 0; }
.dh-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dh-fact { min-width: 0; padding: 9px 12px; }
.dh-fact + .dh-fact { border-left: 1px solid var(--line); }
.dh-fact span { display: block; font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-fact b { display: block; margin-top: 3px; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dh-quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  padding: 22px 24px;
  background: var(--panel2);
  border-left: 1px solid var(--line);
}
.dh-live {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--mut);
}
.dh-live i { width: 5px; height: 5px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--accent-soft); }
.dh-price {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.dh-delta { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 12px; }
.dh-delta span:last-child { font-family: var(--sans); font-size: 10px; color: var(--mut); }
.dh-range { margin-top: 4px; }
.dh-range-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--mut); }
.dh-track { position: relative; height: 3px; margin: 9px 2px 0; background: var(--line); }
.dh-track i {
  position: absolute; top: 50%;
  width: 9px; height: 9px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--panel2);
  border-radius: 50%;
  background: var(--accent);
}
.dh-periods { display: flex; gap: 14px; margin-top: 2px; font-family: var(--mono); font-size: 10px; color: var(--mut); }
.dh-periods b { font-weight: 500; }

/* Overview data rail */
.statrail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.statcell { min-width: 0; padding: 16px 18px; }
.statcell + .statcell { border-left: 1px solid var(--line); }
.statcell .sl { font-size: 11px; color: var(--mut); }
.statcell .sv {
  margin-top: 6px;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.statcell .ss { margin-top: 5px; font-family: var(--mono); font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statcell .sv.up { color: var(--up); }
.statcell .sv.down { color: var(--down); }

/* Judgment */
.judge-head { display: flex; align-items: flex-end; gap: 10px; margin: 2px 0 7px; }
.judge-score { font-family: var(--display); font-size: 32px; line-height: 1; letter-spacing: -.03em; }
.judge-score small { font-family: var(--mono); font-size: 10px; color: var(--mut); letter-spacing: 0; }
.judge-track { height: 4px; margin: 0 0 13px; overflow: hidden; background: var(--panel2); }
.judge-track i { display: block; height: 100%; background: var(--accent); }
.judge-track i.down { background: var(--down); }
.judge-track i.up { background: var(--up); }

.kv b { font-size: 12px; }

/* buttons / chips / tabs */
.chip {
  border-radius: var(--r-xs);
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  border-color: var(--line);
}
.chip.g { background: rgba(59,198,155,.08); border-color: rgba(59,198,155,.22); }
.chip.r { background: var(--danger-soft); border-color: rgba(240,111,115,.22); }
.chip.a { background: rgba(224,174,95,.08); border-color: rgba(224,174,95,.22); }
.chip.b, .chip.v, .chip.n { background: var(--panel2); color: var(--tx2); border-color: var(--line); }
.btn {
  height: 34px; padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--tx);
  font-size: 12px;
  font-weight: 500;
}
.btn:hover { background: var(--panel); border-color: var(--accent); color: var(--accent); }
.btn.pri {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.pri:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { color: var(--down); border-color: rgba(240,111,115,.32); background: var(--danger-soft); }
.s-btn, .s-select, .s-input {
  border-radius: var(--r-sm);
  background: var(--panel2);
  border-color: var(--line);
}
.s-btn {
  border-color: var(--dex-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.s-input:focus, .s-select:focus { border-color: var(--accent); }
.tabs {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  gap: 2px;
}
.tabs button {
  height: 38px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 0 13px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--mut);
}
.tabs button:hover { color: var(--tx); background: var(--panel2); }
.tabs button.on {
  background: transparent;
  color: var(--tx);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.tf button { border-radius: var(--r-xs); background: transparent; }
.tf button.on { background: var(--accent-soft); border-color: var(--dex-line); color: var(--accent); }
.seg { border-radius: var(--r-sm); background: var(--bg); }
.seg button { border-radius: var(--r-xs); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

/* tables */
.tb th, table th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--mut);
  border-bottom: 1px solid var(--line2);
  padding-bottom: 9px;
}
.tb td, table td { border-bottom-color: var(--line); }
.tb tbody tr:hover td, tbody tr.click:hover { background: var(--panel2); }
.tb .ic, .ic { border-radius: var(--r-xs); color: #fff; }
.nm b { font-weight: 500; }

/* notes / overlays */
.note {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  border-left-width: 3px;
  background: var(--accent-soft);
  font-size: 12px;
}
.note.a { background: rgba(224,174,95,.08); }
.note.r { background: var(--danger-soft); }
.note.g { background: rgba(59,198,155,.07); }
.modal-bg { background: rgba(3, 8, 15, .64); backdrop-filter: blur(3px); }
html[data-theme="light"] .modal-bg { background: rgba(15,23,42,.28); }
.modal {
  border-radius: var(--r-sm);
  background: var(--panel);
  border-color: var(--line2);
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
#tip, #toast {
  border-radius: var(--r-sm);
  background: var(--panel);
  border-color: var(--line2);
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.bar { background: var(--panel2); border-radius: 1px; }
.bar > i { border-radius: 1px; }

/* --------------------------------------------------------------------------
   Login — editorial split, no decorative gradients
   -------------------------------------------------------------------------- */

.login-screen {
  background: var(--bg);
  color: var(--tx);
}
.login-left {
  padding: 44px 54px 38px;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  gap: 30px;
}
.login-left::before {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .55;
  mask-image: linear-gradient(180deg, #000 0, transparent 88%);
}
.login-brand .mark {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.login-brand b {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .04em;
}
.login-brand span { font-family: var(--mono); font-size: 8px; letter-spacing: .13em; }
.login-hero .chip { margin-bottom: 18px; border-radius: var(--r-xs); }
.login-hero h1 {
  font-family: var(--display);
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.035em;
  max-width: 680px;
}
.login-hero h1 em { color: var(--accent); font-style: normal; }
.login-hero p { color: var(--mut); }
.login-stats { max-width: 520px; gap: 8px; }
.login-stat {
  border-radius: var(--r-sm);
  border-color: var(--line);
  background: var(--panel);
  padding: 13px 14px;
}
.login-stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: .03em; }
.login-stat b { font-family: var(--display); font-size: 23px; letter-spacing: -.02em; }
.login-feats { font-family: var(--mono); font-size: 11px; gap: 16px; }
.login-feats i { border-radius: 0; width: 4px; height: 4px; }
.login-right {
  width: min(500px, 100%);
  padding: 46px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  position: relative;
}
.login-theme { position: absolute; top: 22px; right: 22px; }
.login-box { max-width: 350px; }
.login-box h2 { font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.login-box .sub { font-size: 12px; color: var(--mut); line-height: 1.7; }
.login-tabs { border-bottom-color: var(--line); margin: 24px 0 20px; }
.login-tabs button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  border-bottom-width: 2px;
}
.login-tabs button.on { border-color: var(--accent); color: var(--tx); }
.wallet-btn {
  border-radius: var(--r-sm);
  border-color: var(--dex-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.wallet-btn:hover { background: var(--panel2); }
.login-field label { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; }
.login-field input {
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--panel2);
  border-color: var(--line);
  color: var(--tx);
}
.login-field input:focus { border-color: var(--accent); }
.login-submit {
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.login-submit:hover { background: var(--accent-strong); }
.login-legal {
  color: var(--mut);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 22px;
  font-size: 10px;
}
.login-error { border-radius: var(--r-sm); }

/* --------------------------------------------------------------------------
   Settings / personal account
   -------------------------------------------------------------------------- */

.settings-grid { grid-template-columns: 188px minmax(0, 1fr); gap: 18px; }
.settings-nav { gap: 1px; }
.settings-nav button {
  height: 38px;
  border-radius: 0;
  border-left: 2px solid transparent;
  font-size: 13px;
  font-family: var(--sans);
}
.settings-nav button.on {
  background: var(--panel);
  border-left-color: var(--accent);
  color: var(--tx);
}
.settings-panel { gap: 14px; }
.set-account { border-radius: var(--r); border-left: 3px solid var(--accent); }
.set-avatar {
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.set-account .amt b { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.set-account .amt .chip { display: inline-flex; width: auto; }
.s-group { padding: 4px 18px; }
.s-row { border-bottom-color: var(--line); padding: 15px 0; }
.s-row .txt b { font-weight: 500; }
.switch em { border-radius: var(--r-pill); background: var(--panel2); }
.switch input:checked + em { background: var(--accent-soft); border-color: var(--dex-line); }
.switch input:checked + em::after { background: var(--accent); }
.set-note { border-radius: var(--r-sm); background: var(--panel2); }
.s-btn.ghost { background: transparent; }

/* wallet */
.wallet-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 20px;
}
.wallet-main > span { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.wallet-main > b {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -.035em;
}
.wallet-main > b em { font-family: var(--mono); font-size: 10px; }
.wallet-side span { font-family: var(--mono); font-size: 10px; letter-spacing: .03em; }
.wallet-side b { font-family: var(--display); font-size: 16px; letter-spacing: -.01em; }
.wallet-metrics .card {
  border-radius: var(--r-sm);
  padding: 13px 14px;
  background: var(--panel2);
}
.wallet-metrics span { font-family: var(--mono); font-size: 10px; letter-spacing: .03em; }
.wallet-metrics b { font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.deposit-grid { gap: 14px; }
.dep-chain, .dep-asset { border-radius: var(--r-sm); background: var(--panel2); }
.dep-chain.on, .dep-asset.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dep-address {
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  background: var(--panel2);
  font-size: 12px;
}
.dep-memo { border-radius: var(--r-sm); border-color: var(--line); }
.deposit-declare { grid-column: 1 / -1; }
.deposit-declare .input { width: 100%; }
.deposit-form {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 12px;
}
.deposit-form .field { margin: 0; min-width: 0; }
.deposit-form .field .input { width: 100%; }
.deposit-form .field label { display: block; margin-bottom: 6px; font-size: 11px; color: var(--mut); }
.dep-usdt {
  padding: 9px 11px;
  border-left: 2px solid var(--accent);
  background: var(--panel2);
  color: var(--tx);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.input-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.input-wrap .input { padding-right: 56px; }
.input-wrap span {
  position: absolute;
  right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mut);
  pointer-events: none;
}
.deposit-declare .actions { margin-top: 10px; }
.tbw { overflow-x: auto; }
.tbw table { width: 100%; border-collapse: collapse; }
.tbw th {
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--mut);
  font-size: 11px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}
.tbw td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--tx2);
  font-size: 13px;
  text-align: left;
}
.tbw th.num, .tbw td.num { text-align: right; }
.tbw tr:last-child td { border-bottom: 0; }
.tbw td .sub { display: block; margin-top: 2px; font-size: 11px; color: var(--mut); }
@media (max-width: 700px) {
  .deposit-form { grid-template-columns: minmax(0,1fr); }
  .wf-grid { grid-template-columns: minmax(0,1fr); }
  .withdraw-form .btn.pri { width: 100%; }
}
.kyc-upload .up, .kyc-upload img { border-radius: var(--r-sm); }

/* --------------------------------------------------------------------------
   Trading terminal
   -------------------------------------------------------------------------- */

.tr-grid { gap: 14px; grid-template-columns: minmax(0,1fr) 280px 344px; }
.tr-main, .tr-bookcol, .tr-form { gap: 14px; }
.trade-head { border-left: 3px solid var(--accent); }
.pairlist { gap: 6px; }
.pair {
  border-radius: var(--r-sm);
  background: var(--panel2);
  border-color: var(--line);
}
.pair:hover { border-color: var(--accent); }
.pair.on { border-color: var(--accent); background: var(--accent-soft); }
.pair .pic { border-radius: var(--r-xs); color: #fff; }
.tr-ticker { gap: 16px; }
.tr-sym b { font-family: var(--display); font-size: 16px; }
.tr-px {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -.035em;
}
.tr-stats { border-top-color: var(--line); }
.tr-stats .s span { font-family: var(--mono); font-size: 10px; }
.tr-stats .s b { font-size: 11px; }
.tr-seg { border-radius: var(--r-sm); background: var(--bg); }
.tr-seg button { border-radius: var(--r-xs); font-family: var(--mono); font-size: 10px; }
.tr-seg button.on { background: var(--accent-soft); color: var(--accent); }
.tr-field { border-radius: var(--r-sm); background: var(--panel2); border-color: var(--line); }
.tr-field:focus-within { border-color: var(--accent); }
.tr-btn { border-radius: var(--r-sm); font-size: 12px; }
.tr-btn.long { background: rgba(59,198,155,.13); border-color: rgba(59,198,155,.34); }
.tr-btn.short { background: var(--danger-soft); border-color: rgba(240,111,115,.34); }
.tr-eq b { font-family: var(--display); font-size: 28px; letter-spacing: -.03em; }
.bk-row, .tk-row { border-radius: var(--r-xs); }
.bk-mid { border-color: var(--line); }
.bk-mid b { font-family: var(--display); font-size: 18px; }
.pos-card { border-radius: var(--r-sm); background: var(--panel2); }
.tr-panel .tabs { display: flex; }
.lev-quick button, .pct-row button { border-radius: var(--r-xs); }

/* --------------------------------------------------------------------------
   Light-mode corrections for pieces that were authored for a night surface
   -------------------------------------------------------------------------- */

html[data-theme="light"] .login-left {
  background: #e7eef7;
}
html[data-theme="light"] .login-left::before {
  opacity: .65;
}
html[data-theme="light"] .login-right { background: var(--panel); }
html[data-theme="light"] .login-stat { background: rgba(255,255,255,.7); }
html[data-theme="light"] .wallet-hero { background: var(--panel); }
html[data-theme="light"] .btn:hover { background: var(--panel2); }
html[data-theme="light"] .btn.pri:hover { background: var(--accent-strong); }
html[data-theme="light"] .heat-legend .heat-scale {
  background: linear-gradient(90deg, rgba(189,52,70,.8), rgba(189,52,70,.12), rgba(15,23,42,.12), rgba(10,125,91,.12), rgba(10,125,91,.8));
}
html[data-theme="light"] #bootTip, html[data-theme="light"] #bootTipNs { color: var(--amber); }
html[data-theme="light"] .annotoggle.on .sw::after { background: #fff; }
html[data-theme="light"] .login-screen { background: var(--bg); }
html[data-theme="light"] .login-brand .mark { color: #fff; }
html[data-theme="light"] .login-hero h1 { color: var(--tx); }
html[data-theme="light"] .login-hero .chip { background: var(--panel); }
html[data-theme="light"] .set-note { background: var(--panel2); }

/* --------------------------------------------------------------------------
   Type scale
   One micro label, three body sizes, then four figure sizes.
   -------------------------------------------------------------------------- */
.crumb { font-size: 11px; }
.crumb b { font-size: 15px; }
.riskpill { font-size: 11px; }
.riskpill .lbl { font-size: 11px; }
.riskpill b { font-size: 12px; }
.clock { font-size: 11px; }
.nav a { font-size: 13px; }
.nav a.sub { font-size: 13px; }
.nav-sec { font-size: 13px; }
.side-foot { font-size: 11px; }
h2.pg { font-size: 28px; }
h2.pg .dim { font-size: 11px; }
.card > h3 { font-size: 15px; }
.card > h3 .r { font-size: 11px; }
.tabs button { font-size: 13px; }
.btn { font-size: 13px; }
.chip { font-size: 11px; font-family: var(--sans); }
.stat .l, .kpi .kh { font-size: 11px; font-family: var(--sans); }
.stat .n, .kpi .v { font-size: 28px; }
.stat .s, .kpi .f { font-size: 11px; }
.kv span, .kv b { font-size: 13px; }
.rowbar { font-size: 13px; }
.hint { font-size: 12px; }
.note { font-size: 13px; }
.dh-title b { font-size: 20px; }
.dh-title .nm { font-size: 13px; }
.dh-title .chip { font-size: 11px; }
.dh-fact span { font-size: 11px; }
.dh-fact b { font-size: 12px; }
.dh-delta { font-size: 12px; }
.dh-range-head, .dh-periods { font-size: 11px; }
.dh-live { font-size: 10px; }
.statcell .sl { font-size: 11px; }
.statcell .sv { font-size: 28px; }
.statcell .ss { font-size: 11px; }
.judge-score { font-size: 32px; }
.judge-score small { font-size: 11px; }
.settings-nav button { font-size: 13px; }
.s-row .txt b { font-size: 13px; }
.s-row .txt span { font-size: 12px; }
.s-btn, .s-select, .s-input { font-size: 13px; }
.accountbtn { font-size: 12px; }

/* Form controls — one visual language for every raw input */
.input,
.s-input,
.s-select,
textarea.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  background: var(--panel2);
  color: var(--tx);
  font: 13px/1.4 var(--sans);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease);
}
.input::placeholder,
.s-input::placeholder { color: var(--dim); }
.input:focus,
.s-input:focus,
.s-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled,
.s-input:disabled { opacity: .55; cursor: not-allowed; }
textarea.input {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
input.input[type="number"] { font-family: var(--mono); }
.s-input { width: 100%; max-width: 260px; }
.s-select {
  width: 100%;
  max-width: 260px;
  cursor: pointer;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%236f7f96' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select.input {
  cursor: pointer;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%236f7f96' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--mut);
  font-size: 11px;
}
.withdraw-form { display: flex; flex-direction: column; gap: 11px; }
.wf-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 10px; }
.wf-grid .field { min-width: 0; }
.amount-control { display: flex; align-items: center; gap: 8px; }
.amount-control .input-wrap { flex: 1; }
.amount-control .btn { flex: 0 0 auto; height: 40px; }
.withdraw-form .actions { margin-top: 2px; }
.withdraw-form .btn.pri { min-width: 180px; height: 40px; }
.withdraw-form .note { margin-top: 2px; }

/* responsive tuning */
@media (max-width: 1240px) {
  .settings-grid { grid-template-columns: 168px minmax(0,1fr); }
}
@media (max-width: 980px) {
  .side { background: var(--bg-side); }
  .theme-toggle { width: 30px; }
  .nav-sec { display: none; }
  .nav a.off { display: none; }
  .nav a.sub { padding: 0; justify-content: center; }
  .nav a.sub .ico { width: 16px; flex-basis: 16px; font-size: 10.5px; text-align: center; }
  .side-flyout { display: none; }
  .side:hover .side-flyout,
  .side:focus-within .side-flyout {
    display: block;
    position: absolute;
    left: 100%;
    top: 0;
    width: 232px;
    max-height: 100vh;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-side);
    border: 1px solid var(--line);
    border-left: 0;
    box-shadow: 18px 0 40px rgba(5, 11, 20, .16);
    z-index: 70;
  }
  .side-flyout .nav { flex: none; overflow: visible; }
  .side-flyout .nav-sec { display: flex !important; pointer-events: none; }
  .side-flyout .nav .label { display: inline !important; }
  .side-flyout .nav a {
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    padding: 0 10px;
  }
  .side-flyout .nav a.sub { padding-inline-start: 10px; }
  .side-flyout .nav a.off { display: flex; }
}
@media (max-width: 760px) {
  .views { padding: 18px 16px 84px; }
  .side-flyout { display: none !important; }
  .side { height: calc(68px + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom); }
  .nav-sec { display: none; }
  .nav-group { display: contents; }
  .nav-items { display: contents; }
  .nav-items::before { display: none; }
  .nav-group.collapsed .nav-items { display: contents; }
  .nav a { min-height: 54px; padding: 5px 1px; }
  .nav a.sub { min-height: 54px; padding: 5px 1px; }
  .nav a.off { display: none; }
  .nav .label { font-size: 11px; }
  .tabs button { font-size: 12px; padding: 0 10px; }
  .deposit-form, .wf-grid { grid-template-columns: minmax(0,1fr); }
  .withdraw-form .btn.pri { width: 100%; }
  .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  h2.pg { font-size: 22px; padding-bottom: 11px; }
  h2.pg::before { height: 19px; width: 4px; flex-basis: 4px; }
  .top { height: 52px; }
  .lang-select { max-width: 82px; font-size: 11px; }
  .theme-toggle { width: 30px; height: 28px; }
  .login-right { padding: 30px 22px; }
  .login-theme { top: 16px; right: 16px; }
  .wallet-main > b { font-size: 32px; }
  .tr-grid { gap: 12px; }
  .tr-px { font-size: 30px; }
}
@media (max-width: 1480px) {
  .tr-grid { grid-template-columns: minmax(0,1fr) 336px; grid-template-areas: "main form" "book form"; }
}
@media (max-width: 1080px) {
  .tr-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: "main" "form" "book"; }
}
@media (max-width: 900px) {
  .login-right { display: block; width: 100%; padding: 28px 24px; }
  .login-lang { position: static; display: block; margin: 0 0 12px; max-width: 110px; z-index: 3; }
  .login-mobile-brand { margin-top: 0; }
  .detail-hero { grid-template-columns: minmax(0,1fr); }
  .dh-main { padding: 18px; }
  .dh-quote { border-left: 0; border-top: 1px solid var(--line); padding: 18px; }
  .dh-price { font-size: 36px; }
  .dh-facts { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dh-fact:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .dh-fact:nth-child(4) { border-top: 1px solid var(--line); }
  .dh-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dh-actions .btn { width: 100%; justify-content: center; }
  .statrail { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .statcell + .statcell { border-left: 0; border-top: 1px solid var(--line); }
  .statcell:nth-child(2) { border-left: 1px solid var(--line); border-top: 0; }
  .statcell:nth-child(3) { border-left: 0; }
  .statcell:nth-child(4) { border-left: 1px solid var(--line); }
  .settings-grid { grid-template-columns: minmax(0,1fr); }
  .settings-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    position: static;
    gap: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
    width: 100%;
  }
  .settings-nav button {
    flex: none;
    width: auto;
    min-width: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    justify-content: center;
    font-size: 11px;
  }
  .settings-nav button.on {
    border-left: 0;
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .set-account .amt { width: 100%; margin-left: 0; text-align: left; }
  .set-account .amt .chip { display: inline-flex; width: auto; align-self: flex-start; }
}
@media (max-width: 480px) {
  .clock, .riskpill { display: none; }
  .theme-toggle { margin-left: 0; }
  .login-hero h1 { font-size: 40px; }
  .lang-select { max-width: 72px; }
  .login-lang { max-width: 100px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
