/* STABLE shared UI — one source of truth for both pages (terminal + /launch). */
:root { --bg:#050505; --panel:#0e0e0e; --panel2:#131313;
        --line:rgba(242,242,242,.09); --line-strong:rgba(242,242,242,.16);
        --ink:#f2f2f2; --ink2:rgba(242,242,242,.62); --ink3:rgba(242,242,242,.42);
        --accent:#CBFF00; --data:#7FA215; --pos:#A9D608; --neg:#ff6b6b;
        --pos-bg:rgba(169,214,8,.13); --neg-bg:rgba(255,107,107,.12); --accent-bg:rgba(203,255,0,.10);
        --skel:rgba(242,242,242,.05);
        --r-card:14px; --r-btn:10px; --r-pill:999px;
        --shadow-card:0 2px 14px rgba(0,0,0,.45);
        --edge:inset 0 1px rgba(255,255,255,.045);   /* top highlight — the depth cue */
        --glow:0 6px 20px rgba(203,255,0,.16); }
* { box-sizing:border-box; }
body { background:var(--bg); color:var(--ink); font-family:"JetBrains Mono",ui-monospace,Menlo,monospace; margin:0; min-height:100vh; }
header { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; flex-wrap:wrap; gap:12px; }
.brand { color:var(--accent); letter-spacing:.28em; font-size:13px; }
.brand span { color:var(--ink3); }
.brand a { color:var(--ink3); text-decoration:none; font-size:11px; letter-spacing:.1em; margin-left:14px; border-bottom:1px solid var(--line); }
.brand a:hover { color:var(--accent); }

button { background:var(--accent); color:#050505; border:none; font:inherit; font-weight:700;
  padding:12px 16px; border-radius:var(--r-btn); cursor:pointer; box-shadow:var(--edge); }
button:not(:disabled):hover { box-shadow:var(--edge), var(--glow); }
button:disabled { background:rgba(242,242,242,.07); color:rgba(242,242,242,.30); cursor:default; box-shadow:none; }
button.ghost { background:transparent; color:var(--ink2); border:1px solid var(--line); box-shadow:none; }
button.ghost:hover { border-color:var(--line-strong); color:var(--ink); box-shadow:none; }
button.mini { padding:6px 12px; font-size:11px; border-radius:var(--r-pill); }
.btn-sell, .frac { background:transparent; color:var(--neg); border:1px solid rgba(255,107,107,.35); }
.btn-sell:hover:not(:disabled), .frac:hover:not(:disabled) { background:var(--neg-bg); }
.frac:disabled, .btn-sell:disabled { background:transparent; border-color:var(--line); color:#555; }
.preset { flex:1; padding:9px 0; font-size:11px; background:rgba(169,214,8,.07); color:var(--pos);
  border:1px solid rgba(169,214,8,.20); border-radius:var(--r-btn); font-weight:700; box-shadow:none; }
.preset:hover { background:var(--pos-bg); box-shadow:none; }

input, select { background:rgba(242,242,242,.035); border:1px solid var(--line); color:var(--ink);
  font:inherit; padding:12px 14px; border-radius:var(--r-btn); width:100%; }
input:focus, select:focus { outline:none; border-color:var(--accent); }

.num { font-variant-numeric:tabular-nums; }
.k { font-size:10px; color:var(--ink3); letter-spacing:.14em; text-transform:uppercase; font-style:normal; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--r-card);
  padding:17px; box-shadow:var(--shadow-card), var(--edge); }
.card h3, .side h3 { font-size:10.5px; letter-spacing:.2em; color:var(--ink3); margin:0 0 14px; font-weight:400; }
.row { display:flex; gap:10px; }
.stack { display:flex; flex-direction:column; gap:10px; }
.status { font-size:12px; color:var(--ink2); min-height:16px; word-break:break-all; }
a { color:var(--accent); }
.meta { font-size:12px; color:var(--ink3); line-height:1.7; }
.divider { border-top:1px solid var(--line); margin:12px 0; }
.balline { display:flex; justify-content:space-between; align-items:baseline; font-size:13px; color:var(--ink2); }
.balline b { color:var(--ink); font-size:14px; }
.balline.total b { font-size:20px; }
details summary { cursor:pointer; font-size:11px; color:var(--ink3); letter-spacing:.15em; }

.chip { display:inline-block; font-size:11px; padding:3px 9px; border-radius:var(--r-pill); white-space:nowrap; }
.chip.up { background:var(--pos-bg); color:var(--pos); }
.chip.down { background:var(--neg-bg); color:var(--neg); }
.chip.dim { background:rgba(242,242,242,.06); color:var(--ink2); cursor:pointer; }
.chip.dim:hover { background:rgba(242,242,242,.11); color:var(--ink); }
.flag { font-size:10.5px; padding:3px 9px; border-radius:var(--r-pill); white-space:nowrap; }
.flag.clean { background:rgba(169,214,8,.13); color:var(--pos); }
.flag.warn { background:rgba(255,107,107,.13); color:var(--neg); }
.up { color:var(--pos) !important; } .down { color:var(--neg) !important; }

.skel { color:transparent !important; background:var(--skel); border-radius:4px; position:relative; overflow:hidden; user-select:none; }
.skel::after { content:""; position:absolute; inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.05),transparent);
  animation:shimmer 1.2s infinite; }
@keyframes shimmer { from{transform:translateX(-100%)} to{transform:translateX(100%)} }
.flash-up   { animation:fup .6s ease-out; }
.flash-down { animation:fdn .6s ease-out; }
@keyframes fup { 0%{ background:var(--pos-bg); } 100%{ background:transparent; } }
@keyframes fdn { 0%{ background:var(--neg-bg); } 100%{ background:transparent; } }
.row-new { animation:slidein .35s ease-out; }
@keyframes slidein { from{ opacity:0; transform:translateY(-6px); background:var(--accent-bg); } to{ opacity:1; } }
@media (prefers-reduced-motion:reduce){ .skel::after,.flash-up,.flash-down,.row-new { animation:none; } }
@media (max-width:920px){ button, .mini, .preset, .frac { min-height:44px; } }

/* --- focus & selection (accessibility + polish) --- */
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline-offset:1px; }
::selection { background:var(--accent); color:#050505; }

/* --- scrollbars: thin, on-theme --- */
* { scrollbar-width:thin; scrollbar-color:#2a2a2a transparent; }
::-webkit-scrollbar { width:9px; height:9px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(242,242,242,.13); border-radius:var(--r-pill); border:2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background:rgba(242,242,242,.22); }

/* --- interactive feedback --- */
button:not(:disabled):active { transform:translateY(1px); }
button, .card, .chip, .scanrow { transition:background .12s ease, border-color .12s ease, color .12s ease; }
.card:hover { border-color:var(--line-strong); }
.copy { cursor:pointer; color:var(--ink3); font-size:11px; margin-left:8px; border-bottom:1px solid var(--line); }
.copy:hover { color:var(--accent); }

/* --- tx toasts --- */
#toasts { position:fixed; right:16px; bottom:16px; z-index:120; display:flex; flex-direction:column; gap:8px; max-width:340px; }
.toast { background:var(--panel2); border:1px solid var(--line); border-left:3px solid var(--ink3);
  border-radius:var(--r-card); padding:11px 13px; font-size:12px; color:var(--ink2); cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.5); transition:opacity .25s ease; animation:toastin .25s ease-out; }
.toast.pending { border-left-color:var(--accent); }
.toast.ok      { border-left-color:var(--pos); color:var(--ink); }
.toast.warn    { border-left-color:var(--neg); color:var(--ink); }
.toast a { margin-left:6px; }
@keyframes toastin { from { opacity:0; transform:translateY(8px); } to { opacity:1; } }
@media (prefers-reduced-motion:reduce){ .toast { animation:none; } button:not(:disabled):active { transform:none; } }
@media (max-width:560px){ #toasts { left:12px; right:12px; bottom:12px; max-width:none; } }
kbd { background:rgba(242,242,242,.06); border:1px solid var(--line); border-radius:5px; padding:1px 5px;
  font-family:inherit; font-size:10px; color:var(--ink2); margin:0 2px; }
