/* ============================================================
   WICK · Trade terminal — same design system as the app.
   duo.css owns the tokens; this file lays out the terminal with
   them. Solid fills only, 2px lines, hard 3D lips, warm dark.
   The chart itself stays technical (its own dark canvas).
   ============================================================ */

.trade-body { background: var(--bg); }
.tt-page { min-width: 0; display: flex; flex-direction: column; }

/* ---------- topbar ---------- */
.tt-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(14px, 2vw, 24px);
  border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
}
.tt-search-wrap { flex: 1; max-width: 430px; }
.tt-search {
  width: 100%; min-height: 46px; padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--panel); border: 2px solid var(--line);
  color: var(--ink-strong); font: inherit; font-weight: 700; font-size: 14.5px;
}
.tt-search::placeholder { color: var(--faint); font-weight: 600; }
.tt-search:focus { outline: none; border-color: var(--green); }
.tt-top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* pill chips (replaces the old glass pills) */
.tpill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--muted); font-weight: 800; font-size: 11.5px; letter-spacing: .8px;
  padding: 7px 13px; min-height: 36px; text-transform: uppercase;
}
button.tpill { cursor: pointer; }
.tt-delay { color: var(--faint); }
.plan-badge.pro { color: var(--flame); border-color: var(--flame-lip); background: var(--gold-soft); }
.account-chip { position: relative; }
.account-me { cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink-strong); }
.chip-av { font-size: 16px; }
.acct-caret { color: var(--faint); }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r-sm);
  padding: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.account-email { color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 4px 6px 10px; border-bottom: 2px solid var(--line); margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; }
.account-menu button { width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font-weight: 800; font-size: 13.5px; color: var(--ink-strong); }
.account-menu button:hover { background: var(--panel); }

/* ---------- learn gate ---------- */
.tt-gate { flex: 1; display: grid; place-items: center; padding: 40px 16px 80px; }
.tt-gate-card {
  width: min(430px, 100%); text-align: center; padding: 38px 32px;
  background: var(--card); border: 2px solid var(--line); border-radius: 24px;
}
.tt-gate-card .brand-line { display: flex; justify-content: center; margin-bottom: 6px; }
.tt-gate-card .brand-line .node-candle { filter: drop-shadow(0 0 13px rgba(255,152,56,.5)); }
.tt-gate-card h2 { font-family: var(--fdisplay); font-weight: 700; font-size: 26px; letter-spacing: -.015em; margin: 8px 0 10px; }
.tt-gate-card p { color: var(--muted); font-weight: 600; font-size: 15px; line-height: 1.6; margin-bottom: 22px; }
.tt-gate-card .db { margin-top: 4px; }
.gate-progress { margin: 0 0 20px; }
.gate-progress .pbar { height: 18px; }
.gate-progress span { display: block; margin-top: 8px; color: var(--muted); font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.tt-gate-back { display: block; margin-top: 16px; color: var(--faint); font-size: 13px; font-weight: 700; text-decoration: none; }
.tt-gate-back:hover { color: var(--muted); }

/* ---------- layout ---------- */
.tt-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 320px; gap: 14px;
  padding: 14px clamp(14px, 2vw, 24px) 34px;
  max-width: 1600px; width: 100%; margin: 0 auto;
}
.tt-card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 16px; }

/* one-time welcome strip */
.tt-welcome {
  display: flex; align-items: center; gap: 14px;
  border: 2px solid var(--blue-border); background: var(--blue-soft);
  border-radius: var(--r); padding: 12px 16px; margin-bottom: 2px;
  color: var(--blue-ink); font-weight: 600; font-size: 14px;
}
.tt-welcome b { color: var(--ink-strong); }
.tt-welcome .db { min-height: 40px; padding: 6px 14px; font-size: 12.5px; flex: none; }

/* helper hints under panel titles */
.tt-hint { color: var(--faint); font-size: 12.5px; font-weight: 600; line-height: 1.45; margin: 2px 0 10px; }

/* ---------- watchlist ---------- */
.tt-watch { min-width: 0; }
.tt-panel-title { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; margin: 4px 0 2px 4px; }
.watch-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px; margin-bottom: 6px;
  background: transparent; border: 2px solid transparent; border-radius: var(--r-sm);
  color: var(--ink); cursor: pointer; text-align: left; font: inherit;
}
.watch-row:hover { background: var(--panel); }
.watch-row.on { background: var(--green-soft); border-color: var(--green); }
.watch-sym { font-weight: 800; font-size: 13.5px; color: var(--ink-strong); }
.watch-quote { text-align: right; }
.watch-price { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.watch-chg { font-size: 11.5px; font-weight: 800; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ---------- chart column ---------- */
.tt-chart-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tt-quote-strip { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 2px 4px; flex-wrap: wrap; }
.tt-symbol { display: flex; align-items: baseline; gap: 10px; }
#tt-sym { font-size: 24px; font-weight: 900; letter-spacing: -.02em; color: var(--ink-strong); }
.tt-name { color: var(--muted); font-size: 13px; font-weight: 600; }
.tt-price-block { display: flex; align-items: center; gap: 10px; }
.tt-price { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.tt-price.tick-up { animation: tickG .4s; }
.tt-price.tick-down { animation: tickR .4s; }
@keyframes tickG { 0% { color: var(--green); } 100% { color: var(--ink-strong); } }
@keyframes tickR { 0% { color: var(--red); } 100% { color: var(--ink-strong); } }
.tt-chg { font-size: 14px; font-weight: 800; }
.tt-mktstate { font-size: 10.5px; min-height: 30px; }
.tt-mktstate.live { color: var(--green); border-color: var(--green); }

.tt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tt-tfs, .tt-overlays, .tt-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tt-tfs button, .tt-overlays button, .tt-tools button {
  padding: 8px 13px; min-height: 40px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line);
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 2px 0 var(--line);
}
.tt-tfs button:active, .tt-overlays button:active, .tt-tools button:active { transform: translateY(2px); box-shadow: none; }
.tt-tfs button.on, .tt-overlays button.on { color: var(--green); background: var(--green-soft); border-color: var(--green); box-shadow: 0 2px 0 var(--green-lip); }
.tt-tools button.armed { color: var(--flame); background: var(--gold-soft); border-color: var(--flame); box-shadow: 0 2px 0 var(--flame-lip); }
.lock { display: inline-flex; opacity: .85; }
.lock .dico { width: 14px; height: 14px; }
.is-pro .lock { display: none; }

.tt-chart-wrap {
  position: relative; border-radius: var(--r); overflow: hidden;
  border: 2px solid var(--line); background: var(--chart-bg);
  height: clamp(380px, 58vh, 620px);
}
#tt-chart { position: absolute; inset: 0; }
.draw-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }

/* ---------- right rail ---------- */
.tt-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.tt-acct-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.tt-profile-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.tt-profile-switch button {
  padding: 8px 12px; min-height: 38px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line);
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 800;
}
.tt-profile-switch button.on { color: var(--ember); background: var(--gold-soft); border-color: var(--flame-lip); }
.tt-reset {
  min-height: 38px; border-radius: 10px; cursor: pointer; padding: 6px 12px;
  background: var(--card); border: 2px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .6px;
}
.tt-reset:hover { color: var(--red); border-color: var(--red); }
.tt-equity { font-size: 30px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink-strong); margin-bottom: 2px; }
.tt-acct-row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.tt-acct-row b { color: var(--ink-strong); font-variant-numeric: tabular-nums; font-weight: 800; }

/* ticket */
.tt-side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.tt-side-tabs button {
  padding: 11px; min-height: 46px; border-radius: var(--r-sm); cursor: pointer; font: inherit; font-weight: 800; font-size: 14px;
  background: var(--card); border: 2px solid var(--line); color: var(--muted); box-shadow: 0 3px 0 var(--line);
}
.tt-side-tabs button:active { transform: translateY(3px); box-shadow: none; }
.tt-side-tabs button.buy.on { background: var(--green-soft); border-color: var(--green); color: var(--green); box-shadow: 0 3px 0 var(--green-lip); }
.tt-side-tabs button.sell.on { background: var(--red-soft); border-color: var(--red); color: var(--red-ink); box-shadow: 0 3px 0 var(--red-lip); }
.tt-qty-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.tt-qty-label input {
  width: 100%; margin-top: 6px; padding: 12px 14px; min-height: 48px; border-radius: var(--r-sm); box-sizing: border-box;
  background: var(--panel); border: 2px solid var(--line);
  color: var(--ink-strong); font: inherit; font-size: 16px; font-weight: 800;
}
.tt-qty-label input:focus { outline: none; border-color: var(--green); }
.tt-qty-quick { display: flex; gap: 6px; margin-top: 8px; }
.tt-qty-quick button {
  flex: 1; padding: 7px; min-height: 36px; border-radius: 9px; cursor: pointer; font-size: 11.5px; font-weight: 800;
  background: var(--card); border: 2px solid var(--line); color: var(--muted); font-family: inherit;
}
.tt-qty-quick button:hover { color: var(--ink-strong); background: var(--panel); }
.tt-est { display: flex; justify-content: space-between; margin: 12px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.tt-est b { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tt-submit {
  width: 100%; padding: 14px; min-height: 52px; border: none; border-radius: var(--r); cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #fff;
  transition: filter .12s, transform .1s, box-shadow .1s;
}
.tt-submit.buy { background: var(--green); box-shadow: 0 4px 0 var(--green-lip); }
.tt-submit.sell { background: var(--red); box-shadow: 0 4px 0 var(--red-lip); }
.tt-submit:active { transform: translateY(4px); box-shadow: none; }
.tt-submit.confirming { filter: brightness(1.12); }
.tt-submit:disabled { background: var(--line); color: var(--faint); box-shadow: 0 4px 0 var(--line-strong); cursor: default; }
.tt-ticket-note { margin-top: 10px; color: var(--faint); font-size: 11.5px; font-weight: 700; text-align: center; }
.tt-flatten {
  width: 100%; margin-top: 8px; padding: 9px; min-height: 40px; border-radius: 11px; cursor: pointer;
  background: var(--red-soft); border: 2px solid var(--red-lip);
  color: var(--red-ink); font: inherit; font-size: 12px; font-weight: 800;
}
.tt-flatten:hover { filter: brightness(1.1); }

/* positions / history */
.tt-tab-head { display: flex; gap: 6px; margin-bottom: 12px; }
.tt-tab-head button {
  padding: 8px 13px; min-height: 38px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line);
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 800;
}
.tt-tab-head button.on { color: var(--ink-strong); background: var(--panel); border-color: var(--line-strong); }
.pos-row { padding: 10px 4px; border-bottom: 2px solid var(--line); }
.pos-row:last-child { border-bottom: none; }
.pos-top { display: flex; justify-content: space-between; align-items: center; }
.pos-sym { font-weight: 800; font-size: 13.5px; color: var(--ink-strong); }
.pos-side { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; margin-left: 6px; }
.pos-side.long { background: var(--green-soft); color: var(--green-ink); }
.pos-side.short { background: var(--red-soft); color: var(--red-ink); }
.pos-pnl { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.pos-detail { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.pos-close {
  padding: 4px 10px; min-height: 30px; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 800;
  background: var(--card); border: 2px solid var(--line); color: var(--muted); font-family: inherit;
}
.pos-close:hover { color: var(--red); border-color: var(--red); }
.hist-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px; border-bottom: 2px solid var(--line); font-size: 12px; font-weight: 600; }
.hist-row:last-child { border-bottom: none; }
.hist-side { font-weight: 800; }
.hist-meta { color: var(--muted); }
.tt-empty { color: var(--faint); font-size: 12.5px; font-weight: 600; text-align: center; padding: 18px 6px; }

/* ---------- competitions ---------- */
.tt-compete h4 { font-size: 15px; }
.tt-compete-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.btn-mini {
  cursor: pointer; border-radius: 10px; padding: 7px 12px; min-height: 36px; font-size: 12px; font-weight: 800;
  font-family: inherit; color: #fff; background: var(--green); border: none; box-shadow: 0 2px 0 var(--green-lip);
  letter-spacing: .4px; text-transform: uppercase;
}
.btn-mini:active { transform: translateY(2px); box-shadow: none; }
.btn-mini.ghost { background: var(--card); color: var(--muted); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); }
.comp-join-row { display: flex; gap: 6px; margin-bottom: 10px; }
.comp-join-row input, .comp-input {
  flex: 1; min-width: 0; min-height: 40px; background: var(--panel); border: 2px solid var(--line);
  border-radius: 10px; padding: 8px 10px; color: var(--ink-strong); font: inherit; font-size: 13px; font-weight: 700;
  text-transform: uppercase;
}
.comp-input { width: 100%; text-transform: none; margin-bottom: 12px; }
.comp-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; min-height: 44px; border-radius: 10px; cursor: pointer; margin-bottom: 4px;
  background: var(--panel); border: 2px solid transparent; color: var(--ink);
  font: inherit; font-size: 13px;
}
.comp-row:hover { border-color: var(--flame-lip); background: var(--gold-soft); }
.comp-row-name { font-weight: 800; color: var(--ink-strong); }
.comp-row-meta { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.comp-ev-label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 10px 0 6px; }
.comp-board-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.comp-board-head b { color: var(--ink-strong); }
.comp-board-head span { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.comp-lb-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.comp-lb-row.me { background: var(--green-soft); border: 2px solid var(--green); }
.comp-lb-rank { width: 18px; text-align: right; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.comp-lb-who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-lb-eq { font-weight: 800; font-variant-numeric: tabular-nums; }
.comp-board-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.comp-days-row { display: flex; gap: 6px; align-items: center; margin: 12px 0; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.comp-days-row button {
  cursor: pointer; padding: 7px 12px; min-height: 38px; border-radius: 10px; font-size: 12px; font-weight: 800;
  background: var(--card); border: 2px solid var(--line); color: var(--ink); font-family: inherit;
}
.comp-days-row button.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
#tt-comp-chip {
  cursor: pointer; border-radius: 10px; padding: 6px 10px; min-height: 38px; font-size: 11px; font-weight: 800;
  background: var(--gold-soft); border: 2px solid var(--flame-lip); color: var(--ember); font-family: inherit;
}

/* ---------- modals ---------- */
.tt-modal {
  position: fixed; inset: 0; z-index: 80;
  background: var(--scrim);
  display: grid; place-items: center; animation: fadeIn .2s; padding: 16px;
}
@keyframes fadeIn { from { opacity: 0; } }
.tt-modal[hidden] { display: none; }
.tt-modal-card {
  width: min(400px, 100%);
  background: var(--card); border: 2px solid var(--line); border-radius: 24px;
  padding: 30px 28px; text-align: center;
  animation: cardPop .35s cubic-bezier(.2, 1.4, .3, 1);
}
@keyframes cardPop { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.tt-modal-card h3 { font-family: var(--fdisplay); font-size: 22px; letter-spacing: -.015em; margin-bottom: 8px; }
.acct-sub { color: var(--muted); font-weight: 600; font-size: 14.5px; }
.fund-amount { font-size: 38px; font-weight: 900; letter-spacing: -.02em; margin: 20px 0 10px; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.tt-modal-card input[type="range"] { width: 100%; accent-color: var(--green); min-height: 40px; }
.fund-scale { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; font-weight: 700; margin: 2px 2px 20px; }
.tt-modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.tt-danger {
  padding: 13px 22px; min-height: 48px; border: none; border-radius: var(--r); cursor: pointer;
  background: var(--red); color: #fff; font: inherit; font-weight: 800; font-size: 14px;
  letter-spacing: .6px; text-transform: uppercase; box-shadow: 0 4px 0 var(--red-lip);
}
.tt-danger:active { transform: translateY(4px); box-shadow: none; }
.acct-err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 18px; }

/* ---------- toast ---------- */
.tt-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 90; padding: 13px 22px; border-radius: 14px;
  background: var(--ink-strong); color: var(--bg); border: 0;
  font-size: 14px; font-weight: 800; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: toastUp .3s cubic-bezier(.2, 1.4, .3, 1); max-width: min(92vw, 480px); text-align: center;
}
@keyframes toastUp { from { transform: translate(-50%, 20px); opacity: 0; } }
.tt-toast.good { color: var(--green-lip); }
.tt-toast.bad { color: var(--red-lip); }

/* ---------- plan / paywall ---------- */
.plan-card { width: min(480px, 100%); position: relative; text-align: center; }
.plan-card .lesson-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 12px; font-size: 20px; color: var(--faint); }
.plan-card .lesson-close:hover { background: var(--panel); color: var(--muted); }
.plan-pro-word { color: var(--flame); font-family: var(--fdisplay); font-style: italic; }
.plan-trigger { color: var(--flame); font-size: 13px; font-weight: 700; min-height: 18px; margin: 6px 0 14px; }
.plan-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin-bottom: 16px; }
.plan-col { border: 2px solid var(--line); border-radius: var(--r); padding: 16px; }
.plan-col.pro { border-color: var(--flame-lip); background: var(--gold-soft); }
.plan-name { font-weight: 800; font-size: 13px; margin-bottom: 10px; color: var(--ink-strong); }
.plan-col ul { list-style: none; margin: 0; padding: 0; }
.plan-col li { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 0; }
.plan-col li b { color: var(--ink-strong); }
.plan-buy { width: 100%; }
.dev-row { display: flex; gap: 8px; margin-top: 12px; }
.dev-row input {
  flex: 1; min-height: 44px; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--panel); border: 2px solid var(--line);
  color: var(--ink-strong); font: inherit; font-size: 13px; font-weight: 700;
}
.dev-row .btn-ghost { padding: 11px 18px; font-size: 13px; }

/* ---------- Lil Wick ---------- */
.lw-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer;
  background: var(--card);
  border: 2px solid var(--flame-lip);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), var(--glow);
  transition: transform .15s;
}
.lw-fab:hover { transform: translateY(-2px) scale(1.05); }
.lw-logo { display: flex; flex-direction: column; align-items: center; }
.lw-logo .lw-wick-top { width: 3px; height: 7px; background: var(--flame); border-radius: 2px; animation: flicker 1.6s infinite; }
.lw-logo .lw-body { width: 14px; height: 20px; background: var(--green); border-radius: 4px; margin: 1px 0; }
.lw-logo .lw-wick-bot { width: 3px; height: 6px; background: var(--flame); border-radius: 2px; }
.lw-logo.sm .lw-body { width: 10px; height: 14px; }
.lw-logo.sm .lw-wick-top { height: 5px; }
.lw-logo.sm .lw-wick-bot { height: 4px; }
@keyframes flicker { 0%, 100% { transform: scaleY(1); opacity: 1; } 50% { transform: scaleY(1.5); opacity: .7; } }
.lw-panel {
  position: fixed; right: 22px; bottom: 90px; z-index: 120;
  width: min(360px, calc(100vw - 32px)); height: min(480px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  background: var(--card);
  border: 2px solid var(--line-strong); border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  animation: cardPop .3s cubic-bezier(.2, 1.4, .3, 1);
}
body.lw-open .lw-fab { display: none; }
.lw-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 2px solid var(--line); }
.lw-head b { display: block; font-size: 14px; color: var(--ink-strong); }
.lw-tag { color: var(--muted); font-size: 11px; font-weight: 700; }
.lw-head .lesson-close { margin-left: auto; width: 38px; height: 38px; font-size: 16px; flex: 0 0 auto; border-radius: 10px; color: var(--faint); }
.lw-head .lesson-close:hover { background: var(--panel); color: var(--muted); }
.lw-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.lw-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13px; font-weight: 600; line-height: 1.55; }
.lw-msg.lw { background: var(--panel); border: 2px solid var(--line); align-self: flex-start; }
.lw-msg.me { background: var(--green-soft); border: 2px solid var(--green); align-self: flex-end; color: var(--green-ink); }
/* the coach is thinking — three dots, so a real API round trip doesn't read as a freeze */
.lw-msg.thinking { padding: 12px 14px; }
.lw-dots { display: inline-flex; gap: 5px; align-items: center; }
.lw-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: lw-blink 1.1s infinite ease-in-out; }
.lw-dots i:nth-child(2) { animation-delay: .18s; }
.lw-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes lw-blink { 0%, 70%, 100% { opacity: .28; } 35% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lw-dots i { animation: none; opacity: .6; } }
.lw-verdict { font-weight: 800; font-size: 15px; }
.lw-verdict.up { color: var(--green); }
.lw-verdict.down { color: var(--red); }
.lw-sym { color: var(--muted); font-size: 11px; margin: 4px 0 6px; }
.lw-signals { margin: 0 0 4px 16px; color: var(--muted); font-size: 12px; padding: 0; }
.lw-signals li { padding: 1px 0; }
.lw-disclaim { color: var(--faint); font-size: 10.5px; margin-top: 6px; }
.lw-chips { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.lw-chip {
  padding: 7px 11px; min-height: 34px; border-radius: 99px; cursor: pointer; font-size: 11.5px; font-weight: 700;
  background: var(--panel); border: 2px solid var(--line); color: var(--muted); font-family: inherit;
}
.lw-chip:hover { color: var(--ink-strong); border-color: var(--flame-lip); }
.lw-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 2px solid var(--line); }
.lw-form input {
  flex: 1; min-height: 44px; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--panel); border: 2px solid var(--line);
  color: var(--ink-strong); font: inherit; font-size: 13px; font-weight: 600;
}
.lw-form input:focus { outline: none; border-color: var(--flame); }
.lw-form button {
  width: 44px; border-radius: var(--r-sm); cursor: pointer; font-size: 16px; font-weight: 800;
  background: var(--flame); border: none; color: #fff; box-shadow: 0 3px 0 var(--flame-lip);
}
.lw-form button:active { transform: translateY(3px); box-shadow: none; }

/* ---------- responsive ---------- */
@media (max-width: 1250px) {
  .tt-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .tt-watch { display: none; }
}
@media (max-width: 900px) {
  /* the shell nav becomes a bottom tab bar (duo.css) — leave room for it */
  .tt-layout { grid-template-columns: 1fr; padding-bottom: 120px; }
  .tt-chart-wrap { height: 46vh; }
  .tt-search-wrap { max-width: none; }
  .tt-delay { display: none; }
  .tt-gate { padding-bottom: 130px; }
  .lw-fab { bottom: 92px; }
  .lw-panel { bottom: 158px; }
  .tt-welcome { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .lw-panel {
    right: 0; left: 0; bottom: 0; width: 100%;
    height: 78vh; max-height: 560px;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .lw-head { padding: 16px; }
  .lw-head .lesson-close { width: 44px; height: 44px; font-size: 17px; }
}

/* Round-trip cost quoted in the ticket. Deliberately plain and always visible —
   the whole point is that the toll stops being a surprise. */
.tt-cost {
  margin: 8px 0 0; padding: 8px 10px;
  border-left: 3px solid var(--flame); border-radius: 0 6px 6px 0;
  background: var(--panel); color: var(--muted);
  font-weight: 600; font-size: 12px; line-height: 1.45;
}
.tt-cost b { color: var(--ink-strong); font-weight: 900; }
