/* ─── TOKENS ──────────────────────────────────────────────────────── */
:root {
  --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --radius:    14px;
  --radius-sm: 9px;
  /* Fallback palette to keep UI visible even if theme attr/storage is invalid */
  --bg:           #0a0c14;
  --glass:        rgba(16, 20, 38, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shine:  rgba(255, 255, 255, 0.05);
  --surface:      rgba(18, 22, 38, 0.72);
  --surface-hov:  rgba(24, 29, 50, 0.88);
  --nav:          rgba(9, 11, 20, 0.94);
  --border:       rgba(255, 255, 255, 0.07);
  --border-soft:  rgba(255, 255, 255, 0.04);
  --div:          rgba(255, 255, 255, 0.06);
  --text:         #e8eaf2;
  --text-soft:    #717998;
  --text-dim:     #3d4260;
  --gold:         #c5a24a;
  --gold-dim:     rgba(197, 162, 74, 0.12);
  --gold-line:    rgba(197, 162, 74, 0.24);
  --green:        #3ec99a;
  --green-dim:    rgba(62, 201, 154, 0.10);
  --red:          #e06070;
  --red-dim:      rgba(224, 96, 112, 0.10);
  --blue:         #6090e8;
  --blue-dim:     rgba(96, 144, 232, 0.10);
  --sh-sm:        0 2px 14px rgba(0, 0, 0, 0.35);
}

/* ─── DARK THEME ──────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0a0c14;
  --glass:        rgba(16, 20, 38, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shine:  rgba(255, 255, 255, 0.05);
  --surface:      rgba(18, 22, 38, 0.72);
  --surface-hov:  rgba(24, 29, 50, 0.88);
  --nav:          rgba(9, 11, 20, 0.94);
  --border:       rgba(255, 255, 255, 0.07);
  --border-soft:  rgba(255, 255, 255, 0.04);
  --div:          rgba(255, 255, 255, 0.06);

  --text:         #e8eaf2;
  --text-soft:    #717998;
  --text-dim:     #3d4260;

  --gold:         #c5a24a;
  --gold-dim:     rgba(197, 162, 74, 0.12);
  --gold-line:    rgba(197, 162, 74, 0.24);

  --green:        #3ec99a;
  --green-dim:    rgba(62, 201, 154, 0.10);
  --red:          #e06070;
  --red-dim:      rgba(224, 96, 112, 0.10);
  --blue:         #6090e8;
  --blue-dim:     rgba(96, 144, 232, 0.10);

  --sh-sm:        0 2px 14px rgba(0, 0, 0, 0.35);
}

/* ─── LIGHT THEME ─────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #f0ede6;
  --glass:        rgba(255, 252, 246, 0.84);
  --glass-border: rgba(160, 140, 100, 0.22);
  --glass-shine:  rgba(255, 255, 255, 0.70);
  --surface:      rgba(255, 252, 248, 0.88);
  --surface-hov:  rgba(248, 244, 238, 0.96);
  --nav:          rgba(240, 237, 230, 0.96);
  --border:       rgba(0, 0, 0, 0.09);
  --border-soft:  rgba(0, 0, 0, 0.05);
  --div:          rgba(0, 0, 0, 0.07);

  --text:         #18160e;
  --text-soft:    #6a5e4a;
  --text-dim:     #b0a488;

  --gold:         #8a6220;
  --gold-dim:     rgba(138, 98, 32, 0.10);
  --gold-line:    rgba(138, 98, 32, 0.22);

  --green:        #25866a;
  --green-dim:    rgba(37, 134, 106, 0.10);
  --red:          #bb3c58;
  --red-dim:      rgba(187, 60, 88, 0.10);
  --blue:         #2e58be;
  --blue-dim:     rgba(46, 88, 190, 0.10);

  --sh-sm:        0 2px 14px rgba(0, 0, 0, 0.08);
}

/* ─── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background var(--t), color var(--t);
}

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 14px;
}

h3 {
  font-size: 0.82rem;
  font-weight: 500;
  margin: 16px 0 8px;
  color: var(--text-soft);
}

a { color: inherit; text-decoration: none; }

/* ─── MARBLE CANVAS ───────────────────────────────────────────────── */
#marbleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ─── TYPOGRAPHY UTILITIES ────────────────────────────────────────── */
.eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.muted  { color: var(--text-soft); }
.hint   { font-size: 0.75rem; color: var(--text-soft); }
.meta   { font-size: 0.72rem; color: var(--text-soft); }
.error  { color: var(--red); font-size: 0.82rem; min-height: 18px; margin-top: 6px; }

.value-pos { color: var(--green); font-weight: 500; }
.value-neg { color: var(--red);   font-weight: 500; }

/* ─── CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--sh-sm), inset 0 1px 0 var(--glass-shine);
  transition: background var(--t), border-color var(--t);
}

/* ─── BADGE ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-ok      { background: var(--green-dim); color: var(--green); }
.badge-warning { background: var(--gold-dim);  color: var(--gold); }
.badge-error   { background: var(--red-dim);   color: var(--red); }
.badge-empty,
.badge-unknown { background: rgba(255,255,255,0.05); color: var(--text-soft); }

[data-theme="light"] .badge-empty,
[data-theme="light"] .badge-unknown { background: rgba(0,0,0,0.05); }

/* ─── CHIP ────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 12px;
  white-space: nowrap;
}

/* ─── FORM ELEMENTS ───────────────────────────────────────────────── */
button, input, select { font: inherit; }

button {
  border: 1px solid var(--gold-line);
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
  letter-spacing: 0.02em;
}

button:hover {
  background: rgba(197, 162, 74, 0.22);
  border-color: rgba(197, 162, 74, 0.42);
}

button:disabled {
  opacity: 0.40;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}

button.secondary:hover {
  background: var(--surface-hov);
  border-color: var(--border);
  color: var(--text);
}

input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--t), background var(--t);
  font-size: 0.84rem;
}

input:focus, select:focus {
  border-color: var(--gold-line);
  background: var(--surface-hov);
}

input::placeholder { color: var(--text-dim); }

label {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

select option { background: #111622; }
[data-theme="light"] select option { background: #f5f0e8; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--blue-dim);
  border: 1px solid rgba(96, 144, 232, 0.18);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.82em;
  color: var(--blue);
}

/* ─── LAYOUT PRIMITIVES ───────────────────────────────────────────── */
.stack { display: grid; gap: 10px; }

.row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

/* ─── SHELL ───────────────────────────────────────────────────────── */
.shell {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-areas: "side main";
  }
}

@media (min-width: 1280px) {
  .shell { grid-template-columns: 230px 1fr; }
}

/* ─── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar { display: none; }

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    grid-area: side;
    flex-direction: column;
    justify-content: space-between;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 26px 0 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: background var(--t);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px 24px;
  border-bottom: 1px solid var(--div);
  margin-bottom: 10px;
}

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-size: 0.9rem;
}

.brand-name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .brand-name { display: none; }
  .brand { justify-content: center; padding: 0 0 24px; }
}

.snav { flex: 1; padding: 0 8px; }

.snav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }

.snav a,
.snav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--t);
  white-space: nowrap;
}

.snav a:hover,     .snav a.active,
.snav li a:hover,  .snav li.active a {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--gold-line);
}

.snav a i,
.snav li a i { width: 16px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .snav a span,    .snav li a span    { display: none; }
  .snav a,         .snav li a         { justify-content: center; }
}

/* ─── SIDEBAR FOOTER ──────────────────────────────────────────────── */
.sbot {
  padding: 14px 8px 0;
  border-top: 1px solid var(--div);
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  width: 100%;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: all var(--t);
  letter-spacing: 0;
}

.theme-btn:hover {
  background: var(--gold-dim);
  border-color: var(--gold-line);
  color: var(--gold);
}

.theme-btn i { width: 16px; text-align: center; font-size: 0.9rem; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .theme-btn span { display: none; }
  .theme-btn { justify-content: center; }
}

/* ─── SESSION BAR ─────────────────────────────────────────────────── */
.session-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 0.77rem;
  color: var(--text-soft);
}

.session-bar i { opacity: 0.5; font-size: 0.8rem; flex-shrink: 0; }
.session-bar strong { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .session-bar .session-name { display: none; }
  .session-bar { justify-content: center; }
}

/* ─── MOBILE TOPBAR ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--div);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--t);
}

@media (min-width: 1024px) { .topbar { display: none; } }

.topbar-brand {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text);
}

.topbar-r { display: flex; gap: 8px; }

/* ─── MOBILE BOTTOM NAV ───────────────────────────────────────────── */
.mob-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  justify-content: space-around;
  transition: background var(--t);
}

@media (min-width: 1024px) { .mob-nav { display: none; } }

.mob-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 20px;
  text-decoration: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 500;
  transition: color var(--t);
  background: none;
  border: none;
  cursor: pointer;
}

.mob-item.active, .mob-item:hover { color: var(--gold); }
.mob-item i  { font-size: 1.15rem; }
.mob-item span { font-size: 0.62rem; }

/* ─── ICON BUTTON ─────────────────────────────────────────────────── */
.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-soft);
  cursor: pointer;
  transition: all var(--t);
  flex-shrink: 0;
}

.ibtn:hover {
  background: var(--gold-dim);
  border-color: var(--gold-line);
  color: var(--gold);
}

.ibtn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.ibtn i { font-size: 0.82rem; }

/* ─── LIVE DOT ────────────────────────────────────────────────────── */
.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: livepulse 2s infinite;
}

@keyframes livepulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.3; transform:scale(1.6); }
}

/* ─── SECTION LABEL ───────────────────────────────────────────────── */
.sec-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 13px;
}

/* ─── SECTION HEAD ────────────────────────────────────────────────── */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.sec-title {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

.sec-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--t);
}

.sec-link:hover { opacity: 1; }

/* ─── DIVIDER ─────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-soft); margin: 18px 0; }

/* ─── LOGIN / AUTH ────────────────────────────────────────────────── */
.auth-shell {
  position: relative; z-index: 1;
  min-height: 100vh;
  width: min(1000px, 100% - 32px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 32px 0;
}

.auth-aside, .auth-card { padding: 28px; }

.auth-aside h2 {
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  margin: 10px 0 12px;
}

.feature-list {
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--text-soft);
  display: grid;
  gap: 9px;
  font-size: 0.86rem;
}

.feature-list li::before {
  content: '—';
  margin-right: 8px;
  color: var(--gold);
  opacity: 0.6;
}

.auth-main { display: grid; place-items: center; }
.auth-card  { width: min(440px, 100%); }
.auth-card h1 { margin: 8px 0 6px; }
.auth-card .muted { margin-bottom: 20px; font-size: 0.86rem; }

/* ─── MAIN AREA ───────────────────────────────────────────────────── */
.main {
  grid-area: main;
  padding-bottom: 80px;
}

@media (min-width: 1024px) {
  .main {
    display: grid;
    grid-template-columns: 1fr 360px;
    padding-bottom: 0;
    min-height: 100vh;
    align-items: start;
  }
}

@media (min-width: 1440px) {
  .main { grid-template-columns: 1fr 400px; }
}

.col-l {
  padding: 24px 20px 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.col-r {
  padding: 24px 18px 24px;
  border-left: 1px solid var(--div);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── TOP PANEL ───────────────────────────────────────────────────── */
.top-panel {
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.top-panel h1 { margin: 4px 0 6px; }

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

/* ─── TICKER STRIP ────────────────────────────────────────────────── */
.strip {
  overflow: hidden;
  border: 1px solid var(--div);
  border-radius: 10px;
  background: rgba(8, 10, 20, 0.40);
}

[data-theme="light"] .strip { background: rgba(248, 245, 240, 0.50); }

.strip-track {
  display: flex;
  gap: 26px;
  width: max-content;
  padding: 9px 0;
  animation: strip-scroll 32s linear infinite;
}

.strip-track:hover { animation-play-state: paused; }

.strip-track .t-sym { color: var(--text); font-weight: 600; font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.strip-track .t-px  { color: var(--text-soft); font-size: 0.65rem; }
.strip-track .t-up  { color: var(--green); font-size: 0.65rem; }
.strip-track .t-dn  { color: var(--red);   font-size: 0.65rem; }
.strip-track .t-sep { color: var(--text-dim); font-size: 0.65rem; }

@keyframes strip-scroll { to { transform: translateX(-50%); } }

/* ─── SUMMARY CARDS ───────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.summary-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color var(--t);
}

.summary-card:hover { border-color: var(--gold-line); }

.summary-card .label {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.summary-card .value {
  font-size: 1.55rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ─── PANEL ───────────────────────────────────────────────────────── */
.panel { padding: 20px 22px; }

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

.panel .muted { margin-bottom: 14px; font-size: 0.82rem; }

/* ─── FILTER ──────────────────────────────────────────────────────── */
.spread-filter { min-width: 170px; }

/* ─── TABLE ───────────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
  font-size: 0.81rem;
}

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

th {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.015);
}

[data-theme="light"] th { background: rgba(0, 0, 0, 0.025); }

tbody tr { transition: background var(--t); }
tbody tr:hover { background: var(--surface-hov); }

/* ─── PAIR CARD ───────────────────────────────────────────────────── */
.pair-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 80px;
  transition: border-color var(--t);
}

.pair-card:hover { border-color: var(--gold-line); }

.pair-card .pair-title {
  font-size: 0.96rem;
  font-weight: 600;
  margin-bottom: 7px;
}

.pair-card .pair-meta {
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.7;
}

/* ─── FILES LIST ──────────────────────────────────────────────────── */
.files-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.files-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color var(--t);
}

.files-list li:hover { border-color: var(--gold-line); }
.files-list .meta    { margin-top: 4px; }
.files-list .file-open { margin-top: 8px; width: 100%; }

/* ─── CODE VIEW ───────────────────────────────────────────────────── */
.code-view {
  padding: 14px;
  min-height: 120px;
  max-height: 380px;
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(96, 144, 232, 0.15);
  background: rgba(4, 7, 18, 0.80);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #b0c8f0;
  line-height: 1.6;
}

[data-theme="light"] .code-view {
  background: rgba(240, 237, 230, 0.90);
  border-color: rgba(46, 88, 190, 0.20);
  color: #2e3860;
}

#run-result:empty { display: none; }

/* ─── PAGE FADE ───────────────────────────────────────────────────── */
.page-fade { animation: pagefade 0.4s ease; }

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

/* ─── SCROLLBARS ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--div); border-radius: 3px; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .col-l { padding: 16px 14px 14px; gap: 12px; }
  .col-r { padding: 16px 14px 14px; border-left: none; border-top: 1px solid var(--div); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-panel { flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .spread-filter { min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(520px, 100% - 24px);
    gap: 10px;
    padding: 14px 0;
  }
  .auth-aside, .auth-card { padding: 16px; }
  .panel { padding: 14px; }
  .top-panel { padding: 14px; }
  .row { grid-template-columns: 1fr; }
}
