
/* --- CSS VARIABLES --------------------------------------- */
:root {
  --bg:       #0a0c10;
  --bg2:      #10141c;
  --bg3:      #161b26;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);
  --text:     #e8eaf0;
  --text2:    #8891a8;
  --text3:    #4a5568;
  --accent:   #00d4aa;
  --accent2:  #0099ff;
  --red:      #ff4560;
  --green:    #00d4aa;
  --gold:     #f5c842;
  --purple:   #8b5cf6;
  --radius:   12px;
  --radius-sm:8px;
  --shadow:   0 4px 24px rgba(0,0,0,0.4);
  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --font-body:    'DM Sans', sans-serif;
  --sidebar-w:    240px;
  --header-h:     60px;
}
[data-theme="light"] {
  --bg:       #f0f2f7;
  --bg2:      #ffffff;
  --bg3:      #e8ebf2;
  --border:   rgba(0,0,0,0.08);
  --border2:  rgba(0,0,0,0.14);
  --text:     #1a1f2e;
  --text2:    #5a6480;
  --text3:    #9aa0b8;
  --shadow:   0 4px 24px rgba(0,0,0,0.08);
}

/* --- RESET ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; transition: background .3s, color .3s; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }
ul { list-style: none; }

/* --- SCROLLBAR ------------------------------------------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* --- PAGES ----------------------------------------------- */
.page { display: none; }
.page.active { display: flex; }
body.booting-auth #page-login,
body.booting-auth #page-app { display: none !important; }
body.authenticated #page-login { display: none !important; }
body.authenticated #page-app { display: flex !important; }
body:not(.authenticated):not(.booting-auth) #page-app { display: none !important; }

/* ------------------------------------------------------------
   LOGIN PAGE
-------------------------------------------------------------- */
#page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 14% 16%, rgba(63, 204, 105, 0.12), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(0, 92, 183, 0.14), transparent 26%),
    linear-gradient(180deg, #edf4fa 0%, #f8fafc 46%, #eef3f8 100%);
  position: relative;
  overflow: hidden;
  background-color: #edf4fa;
}
.auth-standalone {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 16%, rgba(63, 204, 105, 0.12), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(0, 92, 183, 0.14), transparent 26%),
    linear-gradient(180deg, #edf4fa 0%, #f8fafc 46%, #eef3f8 100%);
  background-color: #edf4fa;
}
.auth-page {
  width: min(1220px, 100%);
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.auth-shell-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  min-height: min(760px, calc(100vh - 56px));
  background: #ffffff;
  border: 1px solid rgba(12, 44, 79, 0.08);
  border-radius: 28px;
  box-shadow: 0 32px 80px rgba(18, 42, 77, 0.14);
  overflow: hidden;
}
.auth-shell-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0));
}
.auth-showcase,
.auth-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.auth-showcase {
  padding: 44px 42px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at top right, rgba(0, 92, 183, 0.13), transparent 36%),
    radial-gradient(circle at bottom left, rgba(63, 204, 105, 0.14), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f1f8ff 100%);
  border-right: 1px solid rgba(12, 44, 79, 0.08);
}
.auth-kicker,
.auth-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(63, 204, 105, 0.12);
  border: 1px solid rgba(63, 204, 105, 0.22);
  color: #2f8b4e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}
.auth-brand-copy {
  min-width: 0;
}
.auth-brand-name {
  font-family: var(--font-body);
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f2442;
}
.auth-brand-caption {
  margin-top: 8px;
  color: #5f738d;
  font-size: 14px;
  line-height: 1.5;
}
.auth-hero-title {
  margin-top: 30px;
  font-family: var(--font-body);
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #15365e;
  max-width: 11ch;
}
.auth-hero-copy {
  margin-top: 18px;
  max-width: 56ch;
  color: #617690;
  font-size: 15px;
  line-height: 1.75;
}
.auth-feature-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.auth-feature-card {
  min-width: 0;
  padding: 18px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,252,255,0.92));
  border: 1px solid rgba(12, 44, 79, 0.08);
  box-shadow: 0 10px 24px rgba(22, 50, 90, 0.06);
}
.auth-feature-label {
  display: inline-block;
  color: #2f8b4e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-feature-title {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.35;
  color: #183254;
}
.auth-feature-text {
  margin-top: 8px;
  color: #697f98;
  font-size: 13px;
  line-height: 1.6;
}
.auth-showcase-footer {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.auth-mini-stat {
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(12, 44, 79, 0.08);
  box-shadow: inset 0 3px 0 rgba(0, 92, 183, 0.12);
}
.auth-mini-stat strong {
  display: block;
  font-family: var(--font-body);
  font-size: 18px;
  color: #15365e;
}
.auth-mini-stat span {
  display: block;
  margin-top: 6px;
  color: #71859c;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-panel {
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(0, 92, 183, 0.06), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.auth-panel-wide {
  padding-block: 34px;
}
.auth-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.auth-panel-title {
  margin-top: 18px;
  font-family: var(--font-body);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #15365e;
}
.auth-panel-copy {
  margin-top: 12px;
  color: #6f8398;
  font-size: 14px;
  line-height: 1.7;
}
.auth-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 92, 183, 0.16);
  color: #005cb7;
  font-size: 13px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.auth-inline-link:hover {
  border-color: rgba(0, 92, 183, 0.34);
  background: #f4f9ff;
  transform: translateY(-1px);
}
.auth-inline-link-muted {
  width: 100%;
  justify-content: center;
  background: transparent;
  color: #3c5877;
}
.auth-form-stack {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}
.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  margin-top: 24px;
}
.form-group-span-2 {
  grid-column: 1 / -1;
}
.logo-icon.has-image {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border2);
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
.auth-page .logo-icon,
.auth-standalone .logo-icon {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f4f8fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 72, 144, 0.08);
}

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 12px 16px;
  background: #ffffff; border: 1px solid rgba(13, 44, 79, 0.14);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.auth-page .form-input,
.auth-standalone .form-input {
  min-height: 50px;
  color: #123050;
  box-shadow: inset 0 1px 2px rgba(13, 44, 79, 0.02);
}
.form-input:focus { border-color: #005cb7; box-shadow: 0 0 0 3px rgba(0,92,183,0.12); }
.form-input::placeholder { color: var(--text3); }
select.form-input,
select.order-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238891a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 14px) 50%;
  background-size: 100% 100%, 16px 16px;
}
select.form-input:hover,
select.order-input:hover {
  border-color: color-mix(in oklab, var(--accent2) 28%, var(--border2));
}
select.form-input::-ms-expand,
select.order-input::-ms-expand {
  display: none;
}
select.form-input option,
select.order-input option {
  background: var(--bg2);
  color: var(--text);
}

.btn-primary {
  width: 100%; padding: 13px 16px;
  background: linear-gradient(180deg, #0a67c8, #005cb7);
  border-radius: var(--radius-sm); color: #fff;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  letter-spacing: .02em; transition: opacity .2s, transform .1s, box-shadow .2s, border-color .2s;
  margin-top: 8px;
  border: 1px solid rgba(0, 92, 183, 0.12);
  box-shadow: 0 12px 26px rgba(0, 92, 183, 0.18), inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-primary:hover { opacity: .98; box-shadow: 0 16px 34px rgba(0, 92, 183, 0.22), inset 0 1px 0 rgba(255,255,255,0.16); }
.btn-primary:active { transform: scale(.99); }
.btn-secondary,
.btn-ghost {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}
.btn-secondary {
  background: linear-gradient(180deg, #f7fff9, #edf9f1);
  border: 1px solid rgba(63, 204, 105, 0.24);
  color: #2f8b4e;
}
.btn-secondary:hover {
  border-color: rgba(63, 204, 105, 0.34);
  background: linear-gradient(180deg, #ffffff, #e8f8ee);
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(0, 92, 183, 0.14);
  color: #33516f;
}
.btn-ghost:hover {
  border-color: rgba(0, 92, 183, 0.24);
  background: #f5f9ff;
}
.btn-secondary:active,
.btn-ghost:active {
  transform: scale(.99);
}
.auth-main-btn {
  min-height: 52px;
  margin-top: 0;
}
.auth-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.auth-action-btn {
  margin-top: 0;
}
.auth-reset-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fbff, #f2f8ff);
  border: 1px solid rgba(0, 92, 183, 0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.auth-reset-head strong {
  display: block;
  font-size: 15px;
  color: #16355d;
}
.auth-reset-head span {
  display: block;
  margin-top: 6px;
  color: #71849a;
  font-size: 13px;
  line-height: 1.6;
}
.auth-reset-fields {
  margin-top: 14px;
}
.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.login-demo { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text2); }
.login-demo span { color: var(--accent); font-family: var(--font-mono); }
.login-error {
  display: none;
  margin-top: 18px;
  background: #fff3f4;
  border: 1px solid rgba(235, 23, 23, 0.18);
  color: #b21e2d;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}

/* ------------------------------------------------------------
   MAIN APP LAYOUT
-------------------------------------------------------------- */
#page-app {
  flex-direction: row;
  min-height: 100vh;
}

/* --- SIDEBAR ----------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: background .3s;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.sidebar-logo .logo-text {
  font-family: var(--font-display); font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section { margin-bottom: 24px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text3); padding: 0 8px; margin-bottom: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .15s;
  position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(0,212,170,0.1); color: var(--accent); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--accent);
}
.nav-icon { width: 18px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 13px; border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.16), transparent 42%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg3) 86%, #0b1220 14%), var(--bg3));
  cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--border2) 78%, white 22%);
  box-shadow: 0 14px 34px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.user-card:hover {
  border-color: rgba(50,209,255,.34);
  box-shadow: 0 18px 40px rgba(0,0,0,.24), 0 0 0 1px rgba(0,153,255,.2) inset;
  transform: translateY(-2px);
}
.user-card > div:last-child {
  min-width: 0;
  flex: 1;
}
.user-avatar {
  position: relative;
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent2), #32d1ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(50,209,255,.28), 0 10px 22px rgba(0,153,255,.24);
}
.user-avatar::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00d26a;
  border: 2px solid var(--bg3);
  box-shadow: 0 0 10px rgba(0,210,106,.65);
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text2);
  font-family: var(--font-mono);
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* --- MAIN CONTENT ------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(0,153,255,.06), transparent 26%),
    radial-gradient(circle at top right, rgba(0,212,170,.05), transparent 22%),
    var(--bg);
}

/* --- TOP HEADER ----------------------------------------------- */
.top-header {
  height: var(--header-h);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg2) 88%, #0f172a 12%), var(--bg2));
  border-bottom: 1px solid color-mix(in oklab, var(--border) 72%, white 28%);
  display: flex; align-items: center;
  justify-content: flex-start;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  backdrop-filter: blur(16px);
}
.header-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.header-search-wrap {
  flex: 1;
  min-width: 160px;
  max-width: 420px;
  position: relative;
}
.header-search-input {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 90%, #0b1220 10%), var(--bg3));
  color: var(--text);
  padding: 0 14px;
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .18s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.header-search-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(0, 153, 255, 0.14), 0 10px 24px rgba(0, 153, 255, 0.1);
  transform: translateY(-1px);
}
.header-search-input::placeholder { color: var(--text2); }
.header-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--bg2);
  box-shadow: var(--shadow);
  z-index: 120;
  padding: 6px;
}
.header-search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.header-search-item:hover,
.header-search-item.active {
  background: var(--bg3);
}
.header-search-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.header-search-sym {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.header-search-name {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-search-hint {
  margin-left: auto;
  font-size: 10px;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}
.header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  margin-left: auto;
}
.mobile-menu-toggle,
.mobile-sidebar-close,
.mobile-sidebar-backdrop {
  display: none;
}
.header-btn {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 88%, #0f172a 12%), var(--bg3));
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
  color: var(--text2); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s;
  box-shadow: 0 10px 20px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.03);
}
.header-btn:hover {
  color: var(--text);
  border-color: rgba(50,209,255,.28);
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(0,0,0,.16), 0 0 0 1px rgba(50,209,255,.12) inset;
}
.header-live {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,212,170,.18);
  background: rgba(0,212,170,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

/* Ticker bar */
.ticker-bar {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  overflow: hidden; white-space: nowrap; padding: 8px 0;
}
.ticker-inner {
  display: inline-flex; gap: 40px;
  animation: ticker 80s linear infinite;
  will-change: transform;
}
.ticker-bar:hover .ticker-inner { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  border-radius: 8px;
  padding: 2px 6px;
}
.ticker-item.loading {
  gap: 10px;
  opacity: .9;
}
.ticker-skeleton {
  display: inline-block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--bg3) 92%, white 8%), color-mix(in oklab, var(--bg3) 72%, white 28%), color-mix(in oklab, var(--bg3) 92%, white 8%));
  background-size: 220% 100%;
  filter: blur(.45px);
  animation: tickerSkeleton 1.35s ease-in-out infinite;
}
.ticker-sym-skeleton { width: 44px; }
.ticker-price-skeleton { width: 56px; }
.ticker-chg-skeleton { width: 38px; }
.ticker-sym { font-family: var(--font-mono); font-weight: 500; color: var(--text); }
.ticker-price { font-family: var(--font-mono); }
.ticker-chg { font-family: var(--font-mono); font-size: 11px; }
.ticker-chg.up { color: var(--green); }
.ticker-chg.down { color: var(--red); }
.ticker-item.flash-up { animation: tickerFlashUp .55s ease-out; }
.ticker-item.flash-down { animation: tickerFlashDown .55s ease-out; }

@keyframes tickerSkeleton {
  0% { background-position: 100% 50%; opacity: .6; }
  50% { background-position: 0% 50%; opacity: 1; }
  100% { background-position: -100% 50%; opacity: .6; }
}

/* --- VIEWS --------------------------------------------------- */
.view { display: none; flex: 1; padding: 24px; flex-direction: column; gap: 20px; overflow-y: auto; min-width: 0; }
.view.active { display: flex; }

.view-intro {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid color-mix(in oklab, var(--border2) 78%, white 22%);
  background:
    radial-gradient(circle at top right, rgba(0,212,170,.12), transparent 26%),
    radial-gradient(circle at bottom left, rgba(0,153,255,.1), transparent 28%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg2) 90%, #0c1527 10%), var(--bg2));
  box-shadow: 0 20px 36px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.03);
}
.view-intro::after {
  content: '';
  position: absolute;
  inset: auto -12% -42% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,153,255,.12) 0%, rgba(0,153,255,0) 68%);
  pointer-events: none;
}
.view-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 8px;
}
.view-intro-title,
.dashboard-hero-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.02;
  letter-spacing: -.03em;
  margin-bottom: 8px;
}
.view-intro-subtitle,
.dashboard-hero-subtitle {
  max-width: 760px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text2);
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .95fr);
  gap: 18px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid color-mix(in oklab, var(--border2) 82%, white 18%);
  background:
    radial-gradient(circle at top right, rgba(0,212,170,.14), transparent 22%),
    radial-gradient(circle at 12% 18%, rgba(0,153,255,.12), transparent 26%),
    linear-gradient(135deg, color-mix(in oklab, var(--bg2) 92%, #0d1526 8%), color-mix(in oklab, var(--bg2) 86%, #101d35 14%));
  box-shadow: 0 28px 54px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.04);
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -62px;
  right: -38px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,.18) 0%, rgba(0,212,170,0) 72%);
  pointer-events: none;
}
.dashboard-hero-main,
.dashboard-hero-side {
  position: relative;
  z-index: 1;
}
.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-action-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 90%, #0b1220 10%), var(--bg3));
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
  box-shadow: 0 14px 26px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.03);
}
.hero-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(50,209,255,.26);
  box-shadow: 0 18px 32px rgba(0,0,0,.14), 0 0 0 1px rgba(50,209,255,.08) inset;
}
.hero-action-primary {
  background: linear-gradient(135deg, rgba(0,212,170,.26), rgba(0,153,255,.22));
  border-color: rgba(0,212,170,.28);
  color: #e8fffb;
}
.dashboard-hero-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}
.hero-metric {
  position: relative;
  overflow: hidden;
  min-height: 110px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border2) 74%, white 26%);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent),
    color-mix(in oklab, var(--bg3) 90%, #0e1728 10%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.hero-metric::after {
  content: '';
  position: absolute;
  right: -22px;
  top: -22px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,153,255,.16) 0%, rgba(0,153,255,0) 74%);
}
.hero-metric-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text2);
}
.hero-metric-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1;
  letter-spacing: -.02em;
}

.trade-hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
  gap: 18px;
  padding: 20px 24px;
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--border2) 78%, white 22%);
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.1), transparent 24%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg2) 90%, #0d1627 10%), var(--bg2));
  box-shadow: 0 22px 42px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.03);
}
.trade-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.trade-hero-chip {
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border2) 72%, white 28%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 92%, #0b1220 8%), var(--bg3));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.trade-hero-chip-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text2);
}
.trade-hero-chip-value {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.trade-panel-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in oklab, var(--border2) 80%, white 20%);
}
.trade-panel-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0,212,170,.08), transparent 30%);
  pointer-events: none;
}

/* --- CARDS --------------------------------------------------- */
.card {
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.07), transparent 34%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg2) 92%, #0b1220 8%), var(--bg2));
  border: 1px solid color-mix(in oklab, var(--border) 76%, white 24%);
  border-radius: 20px; padding: 20px;
  box-shadow: 0 22px 44px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.03);
  transition: background .3s, border-color .2s, transform .2s, box-shadow .2s;
  min-width: 0;
}
.card:hover {
  border-color: color-mix(in oklab, var(--accent2) 24%, var(--border2));
  transform: translateY(-2px);
  box-shadow: 0 28px 52px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.04);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.card-action {
  font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 700;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(0,212,170,.08);
  border: 1px solid rgba(0,212,170,.14);
}
.card-action:hover { opacity: .8; }
.empty-state-card {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 176px;
  padding: 24px 20px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed color-mix(in oklab, var(--border2) 72%, white 28%);
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.08), transparent 28%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg3) 92%, #0b1220 8%), var(--bg3));
}
.empty-state-card.compact {
  min-height: 0;
  padding: 18px;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,153,255,.12);
  color: var(--accent2);
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -.02em;
}
.empty-state-subtitle {
  max-width: 420px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
}
.empty-state-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,212,170,.22);
  background: linear-gradient(135deg, rgba(0,212,170,.16), rgba(0,153,255,.16));
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.hot-markets-head {
  gap: 10px;
  flex-wrap: wrap;
}
.hot-markets-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(420px, 100%);
}
.hot-markets-search-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  outline: none;
}
.hot-markets-search-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.14);
}
.hot-markets-search-btn {
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(0,153,255,.22);
  background: linear-gradient(135deg, rgba(0,212,170,.18), rgba(0,153,255,.18));
  color: #eaf8ff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

/* --- GRID LAYOUTS --------------------------------------------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
.trade-only-grid { grid-template-columns: minmax(0, 1fr); }

/* --- STAT CARDS ----------------------------------------------- */
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; overflow: hidden;
  min-width: 0;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card.blue::before { background: var(--accent2); }
.stat-card.gold::before { background: var(--gold); }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text2); margin-bottom: 8px; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.stat-sub { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.stat-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 2px 7px; border-radius: 99px;
}
.stat-badge.up { background: rgba(0,212,170,0.12); color: var(--green); }
.stat-badge.down { background: rgba(255,69,96,0.12); color: var(--red); }
.stat-icon {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 32px; opacity: 0.07;
}

/* --- TABLE --------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text2);
  padding: 14px 12px 12px; text-align: left; border-bottom: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
}
.tbl td {
  padding: 13px 12px; border-bottom: 1px solid color-mix(in oklab, var(--border) 78%, white 22%); font-size: 13px; vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: color-mix(in oklab, var(--bg3) 88%, #07101f 12%); }
.tbl .mono { font-family: var(--font-mono); }
.tbl .up { color: var(--green); }
.tbl .down { color: var(--red); }

/* --- BADGES --------------------------------------------------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em;
}
.badge-buy     { background: rgba(0,212,170,0.12);  color: var(--green); }
.badge-sell    { background: rgba(255,69,96,0.12);   color: var(--red); }
.badge-filled  { background: rgba(0,212,170,0.1);    color: var(--green); }
.badge-pending { background: rgba(245,200,66,0.12);  color: var(--gold); }
.badge-cancel  { background: rgba(255,255,255,0.05); color: var(--text2); }
.badge-approved { background: rgba(0,212,170,0.14); color: var(--green); }
.badge-waiting  { background: rgba(245,158,11,0.16); color: #f59e0b; }
.badge-rejected { background: rgba(255,69,96,0.14); color: var(--red); }
.badge-stock   { background: rgba(0,153,255,0.1);    color: var(--accent2); }
.badge-crypto  { background: rgba(245,200,66,0.1);   color: var(--gold); }
.badge-forex   { background: rgba(0,212,170,0.1);    color: var(--green); }
.badge-commodity { background: rgba(139,92,246,0.1); color: var(--purple); }

/* --- TYPE FILTERS --------------------------------------------- */
.filter-tabs {
  display: flex; gap: 6px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 92%, #0b1220 8%), var(--bg3));
  border-radius: 16px;
  padding: 6px;
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.filter-tab {
  padding: 8px 14px; border-radius: 11px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .15s;
}
.filter-tab.active {
  background: linear-gradient(135deg, rgba(0,212,170,.14), rgba(0,153,255,.16));
  color: var(--text); box-shadow: 0 8px 18px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,.04);
}

.table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  border-radius: 16px;
  background: color-mix(in oklab, var(--bg2) 94%, #0b1220 6%);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}
.pagination button.active {
  background: rgba(0,212,170,0.16);
  border-color: rgba(0,212,170,0.3);
  color: var(--accent);
}
.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pagination-info {
  margin-right: auto;
  color: var(--text2);
  font-size: 12px;
}
.pagination-dots {
  padding: 0 2px;
  color: var(--text3);
  font-weight: 700;
}

/* --- ORDER FORM ----------------------------------------------- */
.order-form { display: flex; flex-direction: column; gap: 14px; }
.order-type-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 92%, #0b1220 8%), var(--bg3));
  border-radius: 16px;
  padding: 5px; gap: 5px;
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
}
.order-type-btn {
  padding: 11px 10px; border-radius: 12px; font-size: 13px; font-weight: 800;
  text-align: center; cursor: pointer; transition: all .15s;
  color: var(--text2);
}
.order-type-btn.buy.active  {
  background: linear-gradient(135deg, rgba(0,212,170,.22), rgba(0,153,255,.16));
  color: var(--green);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 20px rgba(0,212,170,.08);
}
.order-type-btn.sell.active {
  background: linear-gradient(135deg, rgba(255,69,96,.22), rgba(255,132,132,.14));
  color: var(--red);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 20px rgba(255,69,96,.08);
}
.order-type-btn:not(.active):hover { background: var(--bg2); color: var(--text); }
.order-input-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: 5px; }
.order-input {
  width: 100%; padding: 11px 14px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 92%, #0b1220 8%), var(--bg3));
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
  border-radius: 14px; color: var(--text);
  font-family: var(--font-mono); font-size: 14px;
  outline: none; transition: border-color .2s, box-shadow .2s, transform .18s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.order-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,212,170,.12), 0 10px 22px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.order-input[readonly] {
  border-color: var(--border);
  color: var(--text2);
  background: color-mix(in oklab, var(--bg3) 82%, #94a3b8 18%);
  cursor: not-allowed;
}
select.order-input:hover {
  border-color: var(--border);
}

.header-btn.text-btn {
  width: auto;
  min-width: 52px;
  padding: 0 14px;
  font-size: 12px;
  font-family: var(--font-display);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg3) 88%, #10192c 12%), var(--bg3));
}
.pwa-install-btn {
  gap: 7px;
}
.btn-primary.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pwa-btn-icon {
  font-size: 16px;
  line-height: 1;
}
.pwa-btn-label {
  line-height: 1;
}
.order-summary {
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.08), transparent 36%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg3) 92%, #0b1220 8%), var(--bg3));
  border-radius: 16px; padding: 14px 15px;
  border: 1px solid color-mix(in oklab, var(--border2) 74%, white 26%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.order-summary-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.order-summary-row:last-child { margin-bottom: 0; font-weight: 700; font-size: 13px; }
.order-summary-row span:first-child { color: var(--text2); }
.order-summary-row span:last-child { font-family: var(--font-mono); }
.btn-buy  {
  width: 100%; padding: 13px; border-radius: 14px; font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: .03em;
  background: linear-gradient(135deg, rgba(0,212,170,.24), rgba(0,153,255,.16));
  color: #dffef3; border: 1px solid rgba(0,212,170,0.32); transition: all .18s;
  box-shadow: 0 16px 28px rgba(0,212,170,.08), inset 0 1px 0 rgba(255,255,255,.04);
}
.btn-buy:hover  { background: linear-gradient(135deg, rgba(0,212,170,.32), rgba(0,153,255,.2)); transform: translateY(-1px); }
.btn-sell {
  width: 100%; padding: 13px; border-radius: 14px; font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: .03em;
  background: linear-gradient(135deg, rgba(255,69,96,.24), rgba(255,132,132,.14));
  color: #ffe5eb; border: 1px solid rgba(255,69,96,0.32); transition: all .18s;
  box-shadow: 0 16px 28px rgba(255,69,96,.08), inset 0 1px 0 rgba(255,255,255,.04);
}
.btn-sell:hover { background: linear-gradient(135deg, rgba(255,69,96,.32), rgba(255,132,132,.2)); transform: translateY(-1px); }

.sell-ratio-wrap {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.sell-ratio-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(0,212,170,0.92) 0%,
      rgba(0,153,255,0.92) var(--ratio, 0%),
      rgba(255,255,255,0.14) var(--ratio, 0%),
      rgba(255,255,255,0.08) 100%
    );
  border: 1px solid rgba(0,153,255,0.25);
  outline: none;
  transition: background .2s ease;
}
.sell-ratio-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}
.sell-ratio-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}
.sell-ratio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid rgba(0,153,255,0.9);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,153,255,0.22);
}
.sell-ratio-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,153,255,0.9);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,153,255,0.22);
}

.sell-ratio-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
}

.sell-ratio-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sell-ratio-actions button {
  min-height: 28px;
  border: 1px solid rgba(0,153,255,0.3);
  background: rgba(0,153,255,0.1);
  color: #9cd4ff;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  transition: all .15s;
}
.sell-ratio-actions button:hover {
  background: rgba(0,153,255,0.2);
  color: #d4ecff;
}
.sell-ratio-actions button.active {
  border-color: rgba(0,212,170,0.55);
  background: linear-gradient(135deg, rgba(0,212,170,0.28), rgba(0,153,255,0.24));
  color: #e7fffb;
  box-shadow: 0 0 0 1px rgba(0,212,170,0.18) inset;
}

.chart-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.asset-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  object-fit: cover;
}

.asset-logo-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

/* --- MARKET ITEM ----------------------------------------------- */
.market-item {
  display: flex; align-items: center;
  padding: 11px 12px; border-radius: 14px;
  cursor: pointer; transition: background .16s, transform .16s, border-color .16s; gap: 10px;
  border: 1px solid transparent;
}
.market-item:hover { background: var(--bg3); transform: translateY(-1px); border-color: rgba(50,209,255,.16); }
.market-item.active { background: rgba(0,212,170,0.08); border-color: rgba(0,212,170,.18); }
.market-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.market-info { flex: 1; min-width: 0; }
.market-sym  { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.market-name { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-price-col { text-align: right; }
.market-price { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.market-chg   { font-family: var(--font-mono); font-size: 11px; }
.market-chg.up { color: var(--green); }
.market-chg.down { color: var(--red); }
.asset-mini-fav {
  margin-left: 8px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  border-radius: 8px;
  font-size: 12px;
  padding: 3px 6px;
  cursor: pointer;
}
.asset-mini-fav.active {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}
.asset-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.market-card {
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.market-card::after {
  content: '';
  position: absolute;
  inset: auto -18% -36% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,153,255,.12), transparent 66%);
  pointer-events: none;
  opacity: .45;
}
.market-card:hover .market-card-price,
.market-card:hover .market-card-symbol {
  color: #f8fbff;
}
.market-card.flash-up {
  animation: marketCardFlashUp .55s ease-out;
}
.market-card.flash-down {
  animation: marketCardFlashDown .55s ease-out;
}

.market-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
}
.market-card-logo {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.04);
}
.market-card-text {
  min-width: 0;
  flex: 1;
}
.market-card-symbol {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.market-card-name {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.market-card-badge-wrap {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.market-card-metrics {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}
.market-card-metrics-left {
  min-width: 0;
  flex: 1;
}
.market-card-price {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-card-hl {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-card-metrics-right {
  text-align: right;
  flex-shrink: 0;
}
.market-card-chg-pct {
  font-family: var(--font-mono);
  font-size: 16px;
  white-space: nowrap;
}
.market-card-chg-try {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.asset-fav-btn,
.asset-link-btn,
.asset-trade-btn {
  min-height: 40px;
  border: 1px solid color-mix(in oklab, var(--border2) 76%, white 24%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg2) 92%, #0b1220 8%), var(--bg2));
  color: var(--text);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s, color .18s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.asset-fav-btn.active {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}
.asset-link-btn:hover,
.asset-fav-btn:hover {
  background: var(--bg3);
  transform: translateY(-1px);
  border-color: rgba(50,209,255,.2);
}
.asset-trade-btn {
  margin-left: auto;
  color: #dffef3;
  border-color: rgba(0,212,170,0.32);
  background: linear-gradient(135deg, rgba(0,212,170,.2), rgba(0,153,255,.14));
}
.asset-trade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(0,212,170,.08);
}

/* --- CHART CONTAINER ------------------------------------------ */
.chart-wrap { position: relative; width: 100%; }
.tv-chart-wrap {
  width: 100%; border-radius: var(--radius); overflow: hidden;
  background: var(--bg3); border: 1px solid var(--border);
}
.chart-stage-surface {
  width: 100%;
  min-height: 280px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 82%, white 18%);
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.11), transparent 34%),
    linear-gradient(145deg, color-mix(in oklab, var(--bg3) 92%, #050b16 8%), color-mix(in oklab, var(--bg2) 90%, #081224 10%));
}
.chart-stage-frame {
  min-height: 100%;
  border-radius: inherit;
}
.chart-stage-frame.tone-buy {
  border-color: rgba(24,168,137,.28);
  box-shadow: inset 0 0 0 1px rgba(24,168,137,.06);
}
.chart-stage-frame.tone-sell {
  border-color: rgba(231,81,104,.28);
  box-shadow: inset 0 0 0 1px rgba(231,81,104,.06);
}
.chart-stage-frame.tone-neutral {
  border-color: rgba(91,103,234,.26);
  box-shadow: inset 0 0 0 1px rgba(91,103,234,.06);
}

.chart-main-grid {
  align-items: stretch;
}

.chart-stage-card {
  padding-bottom: 14px;
}

.chart-stage-header {
  align-items: flex-start;
  gap: 12px;
}

.chart-stage-copy {
  min-width: 0;
  flex: 1;
}

.chart-list-card .card-header {
  align-items: center;
}

.chart-list-card > .card-header:not(.chart-list-head) {
  display: none;
}

.chart-list-count {
  display: block;
  margin: -2px 16px 10px;
  font-size: 12px;
  color: var(--text2);
}

.chart-market-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 10px;
  max-height: min(68vh, 980px);
  overflow: auto;
  scrollbar-width: thin;
}

.chart-list-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text2);
  font-size: 13px;
  border-radius: 14px;
  border: 1px dashed color-mix(in oklab, var(--border) 76%, white 24%);
  background: rgba(255,255,255,.02);
}

.chart-market-item {
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background:
    linear-gradient(180deg, rgba(12, 20, 44, .92), rgba(10, 16, 35, .98));
  padding: 12px 12px 10px;
  transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
}

.chart-market-item:hover {
  transform: translateY(-1px);
  border-color: rgba(50, 209, 255, .26);
  box-shadow: 0 12px 22px rgba(5, 16, 34, .22);
}

.chart-market-item.is-active {
  border-color: rgba(50, 209, 255, .34);
  background: linear-gradient(180deg, rgba(24, 37, 76, .82), rgba(12, 22, 48, .92));
  box-shadow: inset 0 0 0 1px rgba(50, 209, 255, .08);
}

.chart-market-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.chart-market-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-market-copy {
  min-width: 0;
  flex: 1;
}

.chart-market-symbol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-market-symbol {
  font-size: 13px;
  font-weight: 700;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-market-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: var(--text2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chart-market-name {
  margin-top: 4px;
  color: var(--text2);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chart-market-meta-line {
  margin-top: 6px;
  color: var(--text3);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chart-market-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chart-market-price {
  font-size: 14px;
}

.chart-market-change {
  font-size: 12px;
  font-weight: 700;
}

.chart-market-subline {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text3);
  font-size: 11px;
  border-top: 1px solid rgba(255,255,255,.05);
  padding-top: 10px;
}

.chart-market-active-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(50, 209, 255, .22);
  background: rgba(50, 209, 255, .12);
  color: var(--accent2);
  font-weight: 700;
}

.chart-market-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.chart-market-actions .btn-primary,
.chart-market-actions .btn-secondary {
  width: 100%;
  min-height: 40px;
  margin-top: 0;
  padding: 10px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.chart-list-card .pagination {
  padding: 8px 16px 14px;
}

.chart-tech-card {
  margin-top: 18px;
}

.chart-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 18px;
  padding: 20px;
}

.chart-stage-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-stage-price-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chart-stage-price {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.chart-stage-change {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
}

.chart-stage-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chart-stage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--border2) 72%, white 28%);
  background: rgba(255,255,255,.04);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
}

.chart-stage-description {
  max-width: 720px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.75;
}

.chart-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-stage-action,
.chart-stage-action-secondary {
  width: auto;
  min-width: 132px;
  margin-top: 0;
  padding: 12px 18px;
  font-size: 13px;
  border-radius: 14px;
}

.chart-stage-panel {
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background: rgba(8, 18, 36, .24);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-stage-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text2);
}

.chart-stage-panel-head strong {
  font-size: 13px;
  color: var(--text);
}

.chart-stage-range {
  position: relative;
  height: 12px;
}

.chart-stage-range-track,
.chart-stage-range-progress {
  position: absolute;
  top: 50%;
  left: 0;
  height: 8px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.chart-stage-range-track {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
}

.chart-stage-range-progress {
  background: linear-gradient(90deg, rgba(231,81,104,.92), rgba(244,178,71,.96), rgba(26,182,140,.94));
}

.chart-stage-range-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid color-mix(in oklab, var(--bg2) 82%, white 18%);
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  transform: translate(-50%, -50%);
}

.chart-stage-range-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 11px;
  color: var(--text2);
}

.chart-stage-range-labels span:nth-child(2) {
  text-align: center;
}

.chart-stage-range-labels span:last-child {
  text-align: right;
}

.chart-stage-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chart-stage-stat {
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.chart-stage-stat.is-buy,
.chart-stage-stat.is-positive {
  border-color: rgba(24,168,137,.24);
  background: rgba(24,168,137,.08);
}
.chart-stage-stat.is-sell,
.chart-stage-stat.is-negative {
  border-color: rgba(231,81,104,.24);
  background: rgba(231,81,104,.08);
}
.chart-stage-stat.is-neutral {
  border-color: rgba(91,103,234,.22);
  background: rgba(91,103,234,.06);
}

.chart-stage-stat-label {
  display: block;
  color: var(--text2);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chart-stage-stat-value {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
}

.chart-tech-card-header {
  align-items: flex-start;
  gap: 12px;
}

.chart-tech-copy {
  min-width: 0;
  flex: 1;
}

.chart-tech-subtitle {
  margin-top: 4px;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.6;
}

.chart-tech-symbol {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--border2) 72%, white 28%);
  background: color-mix(in oklab, var(--bg3) 86%, #07101f 14%);
}

.chart-tech-widget {
  min-height: 420px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background:
    radial-gradient(circle at top right, rgba(0,153,255,.08), transparent 34%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg3) 88%, #07101f 12%), var(--bg3));
  padding: 18px;
}

.chart-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
}

.chart-insight-panel {
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--border) 80%, white 20%);
  background: color-mix(in oklab, var(--bg2) 88%, transparent 12%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-overview {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: color-mix(in oklab, var(--bg3) 84%, transparent 16%);
}

.chart-overview-copy {
  min-width: 0;
  flex: 1;
}

.chart-overview.tone-buy {
  border-color: rgba(24, 168, 137, .25);
  background: linear-gradient(135deg, rgba(24,168,137,.16), rgba(24,168,137,.05));
}

.chart-overview.tone-sell {
  border-color: rgba(231, 81, 104, .25);
  background: linear-gradient(135deg, rgba(231,81,104,.14), rgba(231,81,104,.05));
}

.chart-overview.tone-neutral {
  border-color: rgba(91, 103, 234, .22);
  background: linear-gradient(135deg, rgba(91,103,234,.14), rgba(91,103,234,.05));
}

.chart-overview-kicker {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 6px;
}

.chart-overview-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.chart-overview-action {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
}

.chart-overview-note {
  margin-top: 6px;
  max-width: 420px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text2);
}

.chart-overview-meta {
  font-size: 12px;
  color: var(--text2);
  max-width: 180px;
  text-align: center;
}

.chart-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}

.chart-gauge {
  --gauge-rotation: 0deg;
  position: relative;
  width: 178px;
  height: 102px;
  overflow: hidden;
}

.chart-gauge-arc {
  position: absolute;
  inset: 0;
  border-radius: 180px 180px 0 0;
  background:
    conic-gradient(
      from 180deg,
      rgba(231,81,104,.96) 0deg 64deg,
      rgba(244,178,71,.94) 64deg 116deg,
      rgba(26,182,140,.96) 116deg 180deg
    );
}

.chart-gauge-arc::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: -18px;
  border-radius: 180px 180px 0 0;
  background: color-mix(in oklab, var(--bg2) 90%, #07101f 10%);
  border: 1px solid color-mix(in oklab, var(--border) 76%, white 24%);
}

.chart-gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 3px;
  height: 78px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.18));
  transform-origin: center bottom;
  transform: translateX(-50%) rotate(var(--gauge-rotation));
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}

.chart-gauge-hub {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(203,213,225,.72));
  border: 2px solid color-mix(in oklab, var(--bg2) 86%, black 14%);
}

.chart-gauge-score {
  position: absolute;
  inset: auto 0 18px 0;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  z-index: 1;
}

.chart-gauge-score strong {
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 1;
}

.chart-gauge-score span {
  font-size: 11px;
  color: var(--text2);
}

.chart-gauge-scale {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
}

.chart-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chart-signal-card {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid color-mix(in oklab, var(--border) 76%, white 24%);
  background: color-mix(in oklab, var(--bg3) 86%, transparent 14%);
}

.chart-signal-card.tone-buy {
  box-shadow: inset 0 0 0 1px rgba(24,168,137,.16);
}

.chart-signal-card.tone-sell {
  box-shadow: inset 0 0 0 1px rgba(231,81,104,.16);
}

.chart-signal-card.tone-neutral {
  box-shadow: inset 0 0 0 1px rgba(91,103,234,.14);
}

.chart-signal-kicker {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.chart-signal-value {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.chart-signal-metric {
  font-size: 13px;
  font-family: var(--font-mono);
}

.chart-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chart-metric-row {
  border-radius: 12px;
  padding: 12px 13px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background: color-mix(in oklab, var(--bg3) 88%, transparent 12%);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text2);
}

.chart-metric-row strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.is-positive {
  color: var(--green) !important;
}

.is-negative {
  color: var(--red) !important;
}

.is-neutral {
  color: var(--text2) !important;
}

.chart-summary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 130px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg2) 88%, #07101f 12%), var(--bg3));
}

.chart-summary-card.tone-buy {
  box-shadow: inset 0 0 0 1px rgba(24,168,137,.14);
}

.chart-summary-card.tone-sell {
  box-shadow: inset 0 0 0 1px rgba(231,81,104,.14);
}

.chart-summary-card.tone-neutral {
  box-shadow: inset 0 0 0 1px rgba(91,103,234,.12);
}

.chart-summary-kicker {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chart-summary-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.chart-summary-meta {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
}

.chart-profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chart-profile-logo {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklab, var(--bg3) 88%, transparent 12%);
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  overflow: hidden;
}

.chart-profile-logo .asset-logo,
.chart-profile-logo .asset-logo-fallback {
  width: 40px;
  height: 40px;
}

.chart-profile-copy {
  min-width: 0;
}

.chart-profile-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.chart-profile-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text2);
}

.chart-profile-description {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text2);
}

.chart-profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chart-profile-fact {
  border-radius: 12px;
  padding: 12px 13px;
  border: 1px solid color-mix(in oklab, var(--border) 78%, white 22%);
  background: color-mix(in oklab, var(--bg3) 88%, transparent 12%);
}

.chart-profile-fact span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text2);
  margin-bottom: 6px;
}

.chart-profile-fact strong {
  display: block;
  color: var(--text);
  line-height: 1.5;
}

.chart-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--border2) 78%, white 22%);
  color: var(--accent2);
  text-decoration: none;
  background: color-mix(in oklab, var(--bg3) 86%, transparent 14%);
}

.chart-profile-links a:hover {
  transform: translateY(-1px);
}

.chart-tech-empty {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--text2);
  font-size: 13px;
}

@media (max-width: 980px) {
  .chart-stage-grid,
  .chart-insights-grid,
  .chart-signal-grid,
  .chart-profile-facts,
  .chart-metric-grid {
    grid-template-columns: 1fr;
  }

  .chart-stage-price-row,
  .chart-stage-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-market-main,
  .chart-market-subline {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-market-metrics {
    align-items: flex-start;
  }

  .chart-stage-chips {
    justify-content: flex-start;
  }

  .chart-stage-stat-grid,
  .chart-stage-range-labels,
  .chart-market-actions {
    grid-template-columns: 1fr;
  }

  .chart-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-gauge-wrap {
    width: 100%;
  }

  .chart-overview-meta {
    max-width: none;
    text-align: left;
  }
}

/* --- NOTIFICATIONS ------------------------------------------- */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s ease;
  max-width: 300px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent2); }

.price-move-toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.price-move-toast {
  min-width: 220px;
  max-width: 300px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease;
  animation: toastIn .2s ease;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}
.price-move-toast.hide {
  opacity: 0;
  transform: translateY(8px);
}
.price-move-toast.up {
  border-left: 3px solid var(--green);
  background: linear-gradient(135deg, rgba(16,185,129,.18), var(--bg2));
}
.price-move-toast.down {
  border-left: 3px solid var(--red);
  background: linear-gradient(135deg, rgba(239,68,68,.18), var(--bg2));
}
.price-move-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.price-move-toast-symbol {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.price-move-toast-state {
  font-size: 11px;
  font-weight: 700;
}
.price-move-toast.up .price-move-toast-state,
.price-move-toast.up .price-move-toast-price { color: var(--green); }
.price-move-toast.down .price-move-toast-state,
.price-move-toast.down .price-move-toast-price { color: var(--red); }
.price-move-toast-price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.market-loading-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ml-line {
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(148,163,184,.14) 0%, rgba(148,163,184,.34) 45%, rgba(148,163,184,.14) 100%);
  background-size: 220% 100%;
  animation: marketSkeleton 1.1s ease-in-out infinite;
}
.ml-line.w-40 { width: 40%; }
.ml-line.w-55 { width: 55%; }
.ml-line.w-70 { width: 70%; }
.ml-line.w-90 { width: 90%; }
@keyframes marketSkeleton {
  0% { background-position: 200% 0; opacity: .75; }
  100% { background-position: -20% 0; opacity: 1; }
}

/* --- ANIMATIONS ----------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes tickerFlashUp {
  0% { background: rgba(16, 185, 129, .34); box-shadow: 0 0 0 rgba(16,185,129,0); }
  35% { background: rgba(16, 185, 129, .24); box-shadow: 0 0 12px rgba(16,185,129,.35); }
  100% { background: transparent; box-shadow: 0 0 0 rgba(16,185,129,0); }
}
@keyframes tickerFlashDown {
  0% { background: rgba(239, 68, 68, .34); box-shadow: 0 0 0 rgba(239,68,68,0); }
  35% { background: rgba(239, 68, 68, .24); box-shadow: 0 0 12px rgba(239,68,68,.35); }
  100% { background: transparent; box-shadow: 0 0 0 rgba(239,68,68,0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes marketCardFlashUp {
  0% { box-shadow: 0 0 0 rgba(0,212,170,0), inset 0 0 0 rgba(0,212,170,0); }
  35% { box-shadow: 0 0 0 1px rgba(0,212,170,.28), 0 0 24px rgba(0,212,170,.14); }
  100% { box-shadow: 0 0 0 rgba(0,212,170,0), inset 0 0 0 rgba(0,212,170,0); }
}
@keyframes marketCardFlashDown {
  0% { box-shadow: 0 0 0 rgba(255,69,96,0), inset 0 0 0 rgba(255,69,96,0); }
  35% { box-shadow: 0 0 0 1px rgba(255,69,96,.28), 0 0 24px rgba(255,69,96,.14); }
  100% { box-shadow: 0 0 0 rgba(255,69,96,0), inset 0 0 0 rgba(255,69,96,0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}

/* --- PORTFOLIO DONUT ------------------------------------------ */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* --- RESPONSIVE ----------------------------------------------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
  .chart-toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #page-login,
  .auth-standalone {
    padding: 16px;
  }
  #page-login {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top, 0px) + 18px);
    padding-bottom: 18px;
  }
  .auth-page,
  .auth-page-register {
    width: 100%;
    justify-content: flex-start;
  }
  .auth-shell-card {
    display: flex;
    flex-direction: column;
    min-height: auto;
    width: 100%;
  }
  .auth-panel,
  .auth-panel-wide {
    order: 1;
    padding: 28px 24px;
  }
  .auth-showcase {
    order: 2;
    padding: 26px 24px 22px;
    border-right: 0;
    border-top: 1px solid rgba(12, 44, 79, 0.06);
    border-bottom: 0;
  }
  .auth-feature-grid,
  .auth-showcase-footer {
    grid-template-columns: 1fr;
  }
  .auth-hero-title {
    max-width: none;
  }
  :root { --sidebar-w: 0px; }
  .sidebar {
    display: flex;
    width: min(84vw, 320px);
    transform: translateX(-110%);
    transition: transform .22s ease;
    z-index: 220;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  }
  #page-app.mobile-menu-open .sidebar {
    transform: translateX(0);
  }
  .mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    border: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 210;
    transition: opacity .18s ease;
  }
  #page-app.mobile-menu-open .mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .mobile-sidebar-close {
    display: inline-flex;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--text);
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
  }
  .sidebar-logo { padding-right: 56px; }
  .main-content { margin-left: 0; width: 100%; padding-bottom: 0; }
  .top-header {
    padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 0;
    min-height: calc(56px + env(safe-area-inset-top, 0px) + 6px);
    gap: 8px;
  }
  .mobile-menu-toggle {
    position: relative;
    top: 2px;
  }
  .ticker-bar { display: none; }
  .view { padding: 16px; }
  .view-intro,
  .dashboard-hero,
  .trade-hero-strip {
    padding: 18px;
  }
  .dashboard-hero,
  .trade-hero-strip {
    grid-template-columns: 1fr;
  }
  .dashboard-hero-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .trade-hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
  .stat-value { font-size: 19px; }
  .mobile-nav { display: none !important; }
  .header-live {
    min-height: 36px;
    padding: 0 10px;
  }
}
@media (display-mode: standalone) and (max-width: 900px) {
  .top-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    min-height: calc(60px + env(safe-area-inset-top, 0px));
  }
  .mobile-menu-toggle { top: 4px; }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  #page-login,
  .auth-standalone {
    padding: 12px;
  }
  #page-login {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
    padding-bottom: 14px;
  }
  .auth-page,
  .auth-page-register {
    width: 100%;
    justify-content: flex-start;
  }
  .auth-shell-card {
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    width: 100%;
  }
  .auth-panel,
  .auth-panel-wide {
    order: 1;
    padding: 18px 18px 22px;
  }
  .auth-showcase {
    order: 2;
    padding: 18px;
  }
  .auth-brand-row {
    align-items: flex-start;
  }
  .auth-brand-caption,
  .auth-hero-copy,
  .auth-feature-grid,
  .auth-showcase-footer {
    display: none;
  }
  .auth-hero-title {
    margin-top: 12px;
    max-width: none;
    font-size: 23px;
    line-height: 1.08;
  }
  .auth-panel-title {
    margin-top: 12px;
  }
  .auth-inline-actions,
  .auth-form-grid {
    grid-template-columns: 1fr;
  }
  .auth-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-inline-link,
  .auth-inline-link-muted {
    width: 100%;
  }
  .modal { width: calc(100vw - 24px); padding: 20px; }
  .top-header {
    min-height: calc(56px + env(safe-area-inset-top, 0px) + 6px);
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }
  .header-title { font-size: 15px; max-width: 42vw; }
  .header-search-wrap { grid-column: 1 / -1; max-width: none; min-width: 0; order: 4; }
  .header-search-input { height: 36px; font-size: 12px; }
  .header-live { display: none !important; }
  .header-actions { gap: 6px; margin-left: 0; justify-self: end; }
  .header-btn { width: 40px; height: 40px; }
  .view { padding: 12px; gap: 14px; }
  .view-intro {
    padding: 16px;
    border-radius: 18px;
  }
  .dashboard-hero,
  .trade-hero-strip {
    padding: 16px;
    border-radius: 20px;
  }
  .dashboard-hero-actions {
    flex-direction: column;
  }
  .hero-action-btn {
    width: 100%;
    justify-content: center;
  }
  .dashboard-hero-side,
  .trade-hero-metrics {
    grid-template-columns: 1fr;
  }
  .hero-metric,
  .trade-hero-chip {
    min-height: 0;
  }
  .trade-hero-chip-value {
    font-size: 16px;
  }
  .card-header { gap: 10px; flex-wrap: wrap; }
  .card-action { font-size: 11px; }
  .stat-value { font-size: 18px; }
  .pagination { justify-content: center; }
  .pagination-info { width: 100%; margin-right: 0; text-align: center; }
  .hot-markets-tools {
    margin-left: 0;
    width: 100%;
  }
  .market-card-metrics {
    align-items: flex-start;
    flex-direction: column;
  }
  .market-card-price {
    font-size: 18px;
  }
  .market-card-metrics-right {
    width: 100%;
    text-align: left;
  }
  .asset-card-actions {
    flex-direction: column;
  }
  .asset-trade-btn {
    margin-left: 0;
  }
  .market-card-badge-wrap .badge {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 420px) {
  .header-title { max-width: 38vw; }
  .mobile-nav-item { padding: 8px 10px; font-size: 11px; }
}

/* --- MODAL ----------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 28px; width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  animation: fadeUp .25s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.modal-close { font-size: 20px; color: var(--text2); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--text); }
.pwa-install-modal {
  width: min(460px, calc(100vw - 24px));
}
.pwa-install-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  border: 1px solid var(--border2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
}
.pwa-install-hint {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.45;
}
.pwa-install-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.pwa-install-actions .btn-primary {
  width: auto;
  min-width: 110px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- EMPTY STATE ----------------------------------------------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); }
.empty-state .icon { font-size: 36px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 13px; }

/* --- SPARKLINE ----------------------------------------------- */
.sparkline-canvas { display: block; }

button, .nav-item, .filter-tab, .order-type-btn, .card-action, .header-btn {
  min-height: 44px;
}
button:focus-visible,
.nav-item:focus-visible,
.filter-tab:focus-visible,
.order-type-btn:focus-visible,
.header-btn:focus-visible,
.asset-fav-btn:focus-visible,
.asset-trade-btn:focus-visible,
.btn-primary:focus-visible,
.btn-buy:focus-visible,
.btn-sell:focus-visible,
.hot-markets-search-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,153,255,.16);
}
.card-action {
  display: inline-flex;
  align-items: center;
}

.mobile-nav {
  display: none;
}
.mobile-nav-item {
  border: 0;
  background: transparent;
  color: var(--text2);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.mobile-nav-item.active {
  background: rgba(0,212,170,0.14);
  color: var(--accent);
}
@media (max-width: 900px) {
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  }
}


