/* Trading design system (Position Planner, Paper Trading, Journal, Brandon Moments).
   Bybit-like dark tokens; only active with body.trade-mode, the archive / app shell stays Discord-style. */

body.trade-mode {
  --t-bg: #0f1014; --t-panel: #17181e; --t-raised: #1f2027; --t-hover: #25262e; --t-border: #2a2b33; --t-border-strong: #363741;
  --t-text: #eaecef; --t-text2: #a3a6af; --t-text3: #6b6e78;
  --t-accent: #f7a600; --t-accent-hover: #ffb81f; --t-accent-tint: rgba(247, 166, 0, .14);
  --t-buy: #20b26c; --t-sell: #ef454a; --t-buy-tint: rgba(32, 178, 108, .14); --t-sell-tint: rgba(239, 69, 74, .14);
  --t-warn: #f0b232; --t-warn-tint: rgba(240, 178, 50, .14);
  --t-font: "Inter", "IBM Plex Sans", system-ui, sans-serif;
}
body.trade-mode .chat-body, body.trade-mode .chat-body .scroller { background: var(--t-bg); }
body.trade-mode .chat-body { font-family: var(--t-font); color: var(--t-text); font-size: 13px; }
body.trade-mode .chat-body * { font-variant-numeric: tabular-nums; }
body.trade-mode .chat-body .messages { padding: 0; }
body.trade-mode .scroller::-webkit-scrollbar-thumb, body.trade-mode .t-scroll::-webkit-scrollbar-thumb { background: var(--t-border-strong); }
.t-scroll { scrollbar-width: thin; scrollbar-color: var(--t-border-strong) transparent; }
.t-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.t-scroll::-webkit-scrollbar-thumb { border-radius: 3px; }

/* ---------- primitives */
.t-panel { background: var(--t-panel); border: 1px solid var(--t-border); border-radius: 8px; min-width: 0; min-height: 0; }
.t-panel-head { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--t-border); }
.t-title { color: var(--t-text); font-size: 14px; font-weight: 600; }
.t-h1 { color: var(--t-text); font-size: 20px; font-weight: 600; margin: 0; }
.t-muted { color: var(--t-text2); }
.t-dim { color: var(--t-text3); }
.t-small { font-size: 12px; }
.t-pos { color: var(--t-buy) !important; }
.t-neg { color: var(--t-sell) !important; }
.t-num { font-weight: 500; font-variant-numeric: tabular-nums; }
.t-label { color: var(--t-text3); font-size: 12px; }
.t-sep { height: 1px; background: var(--t-border); margin: 12px 0; }

/* buttons */
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid transparent;
  border-radius: 6px; background: var(--t-raised); color: var(--t-text); font: 500 13px var(--t-font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.t-btn:hover { background: var(--t-hover); text-decoration: none; }
.t-btn:disabled { opacity: .45; cursor: default; }
.t-btn.sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 4px; }
.t-btn.lg { height: 40px; font-size: 14px; font-weight: 600; }
.t-btn.block { width: 100%; }
.t-btn.primary { background: var(--t-accent); color: #121214; font-weight: 600; }
.t-btn.primary:hover { background: var(--t-accent-hover); }
.t-btn.buy { background: var(--t-buy); color: #fff; font-weight: 600; }
.t-btn.buy:hover { background: #26c479; }
.t-btn.sell { background: var(--t-sell); color: #fff; font-weight: 600; }
.t-btn.sell:hover { background: #f5595d; }
.t-btn.ghost { background: transparent; border-color: var(--t-border-strong); color: var(--t-text2); }
.t-btn.ghost:hover { color: var(--t-text); background: var(--t-raised); }
.t-btn.danger { background: transparent; border-color: rgba(239, 69, 74, .45); color: var(--t-sell); }
.t-btn.danger:hover { background: var(--t-sell-tint); }
.t-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 4px;
  background: var(--t-raised); color: var(--t-text2); cursor: pointer; }
.t-icon-btn:hover { background: var(--t-hover); color: var(--t-text); }
.t-icon-btn svg { width: 14px; height: 14px; }

/* badges / chips */
.t-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; background: var(--t-raised); color: var(--t-text2);
  font-size: 11px; font-weight: 500; white-space: nowrap; }
.t-badge.buy { background: var(--t-buy-tint); color: var(--t-buy); }
.t-badge.sell { background: var(--t-sell-tint); color: var(--t-sell); }
.t-badge.accent { background: var(--t-accent-tint); color: var(--t-accent); }
.t-badge.warn { background: var(--t-warn-tint); color: var(--t-warn); }
.t-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border: 1px solid var(--t-border-strong); border-radius: 11px;
  background: transparent; color: var(--t-text2); font: 500 12px var(--t-font); white-space: nowrap; cursor: pointer; }
.t-chip:hover { border-color: var(--t-text3); color: var(--t-text); }
.t-chip.sl { border-color: rgba(239, 69, 74, .4); color: var(--t-sell); }
.t-chip.tp { border-color: rgba(32, 178, 108, .4); color: var(--t-buy); }
.t-chip.inv { border-color: rgba(255, 152, 0, .4); color: #ff9800; }
.t-chip.add { border-style: dashed; color: var(--t-text3); }
.t-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; margin-left: 4px; padding: 0 5px;
  border-radius: 8px; background: var(--t-raised); color: var(--t-text2); font-size: 11px; font-weight: 600; }

/* tabs */
.t-tabs { display: flex; align-items: stretch; gap: 22px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--t-border); }
.t-tab { position: relative; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: var(--t-text2);
  font: 500 13px var(--t-font); cursor: pointer; white-space: nowrap; }
.t-tab:hover { color: var(--t-text); }
.t-tab.on { color: var(--t-text); font-weight: 600; }
.t-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 1px; background: var(--t-accent); }
.t-tab.on .t-count { background: var(--t-accent-tint); color: var(--t-accent); }
.t-tabs-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* segmented control (also the shared .segmented.planner-seg markup) */
.t-seg, body.trade-mode .chat-body .segmented { display: flex; gap: 2px; padding: 2px; border: 0; border-radius: 6px; background: var(--t-raised); }
.t-seg button, body.trade-mode .chat-body .segmented button { flex: 1; height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent;
  color: var(--t-text2); font: 500 12px var(--t-font); cursor: pointer; white-space: nowrap; }
.t-seg button:hover, body.trade-mode .chat-body .segmented button:hover { color: var(--t-text); }
.t-seg button.on, body.trade-mode .chat-body .segmented button.selected { background: var(--t-hover); color: var(--t-text); box-shadow: none; }
body.trade-mode .chat-body .planner-seg button.selected { background: var(--t-hover); color: var(--t-text); }
/* long / short / do nothing */
body.trade-mode .chat-body .dir-seg { padding: 0; gap: 8px; background: transparent; }
body.trade-mode .chat-body .dir-seg button { height: 36px; border-radius: 6px; background: var(--t-raised); color: var(--t-text2); font-size: 13px; font-weight: 600; }
body.trade-mode .chat-body .dir-seg button[data-value="long"], body.trade-mode .chat-body .dir-seg button[data-value="buy"] { color: var(--t-buy); background: var(--t-buy-tint); }
body.trade-mode .chat-body .dir-seg button[data-value="short"], body.trade-mode .chat-body .dir-seg button[data-value="sell"] { color: var(--t-sell); background: var(--t-sell-tint); }
body.trade-mode .chat-body .dir-seg button[data-value="long"].selected, body.trade-mode .chat-body .dir-seg button[data-value="buy"].selected { background: var(--t-buy); color: #fff; }
body.trade-mode .chat-body .dir-seg button[data-value="short"].selected, body.trade-mode .chat-body .dir-seg button[data-value="sell"].selected { background: var(--t-sell); color: #fff; }
body.trade-mode .chat-body .dir-seg button[data-value="nothing"] { background: var(--t-raised); color: var(--t-text2); }
body.trade-mode .chat-body .dir-seg button[data-value="nothing"].selected { background: #4a4c57; color: #fff; }

/* inputs (also .pl-input / .pl-num steppers) */
body.trade-mode .chat-body .pl-input, .t-input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--t-border); border-radius: 6px;
  background: var(--t-raised); color: var(--t-text); font: 500 13px var(--t-font); outline: none; box-sizing: border-box; }
body.trade-mode .chat-body textarea.pl-input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
body.trade-mode .chat-body .pl-input:hover, .t-input:hover { border-color: var(--t-border-strong); }
body.trade-mode .chat-body .pl-input:focus, .t-input:focus { border-color: var(--t-accent); }
body.trade-mode .chat-body .pl-input::placeholder, .t-input::placeholder { color: var(--t-text3); }
body.trade-mode .chat-body .pl-num { display: flex; align-items: stretch; height: 36px; border: 1px solid var(--t-border); border-radius: 6px; background: var(--t-raised); overflow: hidden; }
body.trade-mode .chat-body .pl-num:hover { border-color: var(--t-border-strong); }
body.trade-mode .chat-body .pl-num:focus-within { border-color: var(--t-accent); }
body.trade-mode .chat-body .pl-num .pl-input { height: 34px; border: 0; background: transparent; text-align: center; }
body.trade-mode .chat-body .pl-step { width: 30px; border: 0; background: transparent; color: var(--t-text3); font-size: 15px; cursor: pointer; }
body.trade-mode .chat-body .pl-step:hover { color: var(--t-text); background: var(--t-hover); }
.t-field { position: relative; }
.t-field .t-unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--t-text3); font-size: 12px; pointer-events: none; }
.t-field .pl-num .pl-step[data-step="1"] { order: 3; }
.t-field.has-unit .pl-input { padding-right: 44px; }
.t-field.has-unit .pl-num .pl-step[data-step="1"] { margin-right: 40px; }
.t-field-label { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; color: var(--t-text3); font-size: 12px; }
.t-field-label .hint-target { color: var(--t-text2); }

/* labels, blocks, key-value rows */
body.trade-mode .chat-body .pl-label { margin: 12px 0 6px; color: var(--t-text2); font-size: 12px; font-weight: 500; }
body.trade-mode .chat-body .hint-target { text-decoration: underline dotted var(--t-text3); text-underline-offset: 3px; cursor: help; }
body.trade-mode .chat-body .pl-block { margin-top: 12px; padding: 12px; border: 1px solid var(--t-border); border-left-width: 1px; border-radius: 8px; background: var(--t-panel); }
body.trade-mode .chat-body .pl-block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; color: var(--t-text); font-size: 13px; font-weight: 600;
  text-transform: none; letter-spacing: 0; }
body.trade-mode .chat-body .pl-marker { width: 3px; height: 14px; border-radius: 2px; }
body.trade-mode .chat-body .blk-stop, body.trade-mode .chat-body .blk-tp, body.trade-mode .chat-body .blk-entry, body.trade-mode .chat-body .blk-risk { background: var(--t-panel); }
body.trade-mode .chat-body .pl-heading { margin: 20px 0 8px; color: var(--t-text); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; }
body.trade-mode .chat-body .pl-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 0; font-size: 12px; }
body.trade-mode .chat-body .pl-kv span:first-child { color: var(--t-text3); }
body.trade-mode .chat-body .pl-kv span:last-child { color: var(--t-text); font-weight: 500; text-align: right; }
body.trade-mode .chat-body button.pl-link, body.trade-mode .chat-body a.pl-link { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--t-border-strong);
  border-radius: 4px; background: transparent; color: var(--t-text2); font: 500 12px var(--t-font); text-decoration: none; cursor: pointer; }
body.trade-mode .chat-body button.pl-link:hover, body.trade-mode .chat-body a.pl-link:hover { color: var(--t-text); background: var(--t-raised); }
body.trade-mode .chat-body .pl-x { width: 26px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: var(--t-text3); cursor: pointer; }
body.trade-mode .chat-body .pl-x:hover { background: var(--t-raised); color: var(--t-sell); }
body.trade-mode .chat-body .pl-mini, body.trade-mode .chat-body .pl-unit { color: var(--t-text3); font-size: 12px; }
body.trade-mode .chat-body .button-primary { height: 36px; border: 0; border-radius: 6px; background: var(--t-accent); color: #121214; font: 600 13px var(--t-font); cursor: pointer; }
body.trade-mode .chat-body .button-primary:hover { background: var(--t-accent-hover); }
body.trade-mode .chat-body .button-secondary { height: 32px; border: 1px solid var(--t-border-strong); border-radius: 6px; background: transparent; color: var(--t-text); font: 500 13px var(--t-font); cursor: pointer; }
body.trade-mode .chat-body .button-secondary:hover { background: var(--t-raised); }
body.trade-mode .chat-body .modal-error, .t-error { color: var(--t-sell); font-size: 12px; min-height: 0; margin-top: 8px; }
body.trade-mode .chat-body .modal-error:empty, .t-error:empty { display: none; }

/* custom checkbox */
.t-check { display: inline-flex; align-items: center; gap: 8px; color: var(--t-text2); font-size: 12px; cursor: pointer; user-select: none; }
.t-check input { position: absolute; opacity: 0; pointer-events: none; }
.t-check .t-box { width: 14px; height: 14px; border: 1px solid var(--t-border-strong); border-radius: 3px; background: var(--t-raised); display: inline-flex; align-items: center; justify-content: center; }
.t-check input:checked + .t-box { background: var(--t-accent); border-color: var(--t-accent); }
.t-check input:checked + .t-box::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border-left: 2px solid #121214; border-bottom: 2px solid #121214; transform: rotate(-45deg); }
.t-check:hover .t-box { border-color: var(--t-text3); }

/* slider with snap diamonds */
.t-slider { position: relative; height: 26px; margin: 10px 6px 2px; cursor: pointer; touch-action: none; }
.t-slider-track { position: absolute; left: 0; right: 0; top: 11px; height: 3px; border-radius: 2px; background: var(--t-border-strong); }
.t-slider-fill { position: absolute; left: 0; top: 11px; height: 3px; border-radius: 2px; background: var(--t-accent); }
.t-slider-mark { position: absolute; top: 8px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg); border: 1px solid var(--t-border-strong); background: var(--t-panel); }
.t-slider-mark.on { background: var(--t-accent); border-color: var(--t-accent); }
.t-slider-thumb { position: absolute; top: 5px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); border: 2px solid var(--t-accent); background: var(--t-panel); border-radius: 2px; }
.t-slider-labels { position: relative; height: 14px; margin: 0 6px; color: var(--t-text3); font-size: 11px; }
.t-slider-labels span { position: absolute; transform: translateX(-50%); }

/* tables */
.t-table-wrap { overflow-x: auto; overflow-y: auto; min-height: 0; }
.t-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.t-table th { position: sticky; top: 0; z-index: 2; height: 32px; padding: 0 12px; background: var(--t-panel); color: var(--t-text3); font-weight: 400;
  text-align: left; white-space: nowrap; border-bottom: 1px solid var(--t-border); }
.t-table td { height: 44px; padding: 0 12px; color: var(--t-text); white-space: nowrap; border-bottom: 1px solid rgba(42, 43, 51, .6); background: var(--t-panel); }
.t-table tr:hover td { background: var(--t-raised); }
.t-table tr.clickable { cursor: pointer; }
.t-table .num { text-align: right; font-weight: 500; }
.t-table .sticky { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--t-border); }
.t-table th.sticky { z-index: 3; }
.t-table .actions { position: sticky; right: 0; z-index: 1; width: 1%; text-align: right; box-shadow: -1px 0 0 var(--t-border); }
.t-table th.actions { z-index: 3; }
.t-table .sub { display: block; margin-top: 2px; color: var(--t-text3); font-size: 11px; font-weight: 400; }
.t-table .sym { display: flex; align-items: center; gap: 6px; }
.t-table .sym strong { font-size: 13px; font-weight: 600; }
.t-table .chips { display: flex; flex-wrap: nowrap; gap: 4px; }

/* popover, menu */
.t-pop-wrap { position: relative; display: inline-flex; }
.t-popover { position: absolute; z-index: 40; min-width: 160px; padding: 6px; border: 1px solid var(--t-border-strong); border-radius: 8px; background: var(--t-raised);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.t-popover[hidden] { display: none; }
.t-menu-item { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 30px; padding: 0 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--t-text); font: 500 12px var(--t-font); text-align: left; cursor: pointer; white-space: nowrap; }
.t-menu-item:hover { background: var(--t-hover); }
.t-menu-item.on { color: var(--t-accent); }
.t-menu-item span { color: var(--t-text3); font-size: 11px; }
.t-menu-sep { height: 1px; margin: 4px 0; background: var(--t-border); }
.t-floating { position: fixed; z-index: 60; width: 300px; padding: 14px; border: 1px solid var(--t-border-strong); border-radius: 8px; background: var(--t-panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45); font-family: var(--t-font); color: var(--t-text); font-size: 13px; }
.t-floating .t-floating-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 14px; font-weight: 600; }
.t-floating-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* dropdown filter pill */
.t-pill, body.trade-mode .mo-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--t-border);
  border-radius: 6px; background: var(--t-panel); color: var(--t-text2); font: 500 12px var(--t-font); cursor: pointer; }
.t-pill:hover, body.trade-mode .mo-pill:hover { border-color: var(--t-border-strong); color: var(--t-text); background: var(--t-panel); }
.t-pill.active, body.trade-mode .mo-pill.active { border-color: rgba(247, 166, 0, .5); color: var(--t-text); background: var(--t-panel); }
body.trade-mode .mo-pill strong { color: var(--t-accent); font-weight: 600; }

/* toast */
.t-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.t-toast { min-width: 260px; max-width: 380px; padding: 10px 14px; border: 1px solid var(--t-border-strong, #363741); border-left: 3px solid #a3a6af; border-radius: 6px;
  background: #1f2027; color: #eaecef; font: 13px "Inter", system-ui, sans-serif; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); pointer-events: auto;
  animation: t-toast-in .18s ease-out; }
.t-toast.ok { border-left-color: #20b26c; }
.t-toast.err { border-left-color: #ef454a; }
.t-toast.warn { border-left-color: #f7a600; }
.t-toast strong { display: block; margin-bottom: 2px; font-weight: 600; }
@keyframes t-toast-in { from { transform: translateY(8px); opacity: 0; } }

/* empty state, skeleton */
.t-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 36px 16px; color: var(--t-text3); text-align: center; }
.t-empty svg { width: 40px; height: 40px; color: var(--t-border-strong); margin-bottom: 4px; }
.t-empty-title { color: var(--t-text2); font-size: 13px; font-weight: 600; }
.t-empty-text { font-size: 12px; }
.t-sk { display: inline-block; height: 10px; border-radius: 5px; background: var(--t-raised); animation: t-pulse 1.2s ease-in-out infinite; }
@keyframes t-pulse { 50% { opacity: .45; } }

/* KPI cards */
.t-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.t-kpi { padding: 14px 16px; border: 1px solid var(--t-border); border-radius: 8px; background: var(--t-panel); min-width: 0; }
.t-kpi-label { color: var(--t-text3); font-size: 12px; }
.t-kpi-value { margin-top: 6px; color: var(--t-text); font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-kpi-sub { margin-top: 2px; color: var(--t-text3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* review lists (planner, journal, moments) */
body.trade-mode .chat-body .review-verdict { padding: 10px 12px; border-radius: 6px; border: 0; font-size: 13px; font-weight: 600; }
body.trade-mode .chat-body .review-verdict.status-good { background: var(--t-buy-tint); color: var(--t-buy); }
body.trade-mode .chat-body .review-verdict.status-warn { background: var(--t-warn-tint); color: var(--t-warn); }
body.trade-mode .chat-body .review-verdict.status-bad { background: var(--t-sell-tint); color: var(--t-sell); }
body.trade-mode .chat-body .review-item { display: flex; gap: 10px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--t-border); border-radius: 6px; background: var(--t-panel); }
body.trade-mode .chat-body .review-item.status-bad { border-color: rgba(239, 69, 74, .35); background: rgba(239, 69, 74, .05); }
body.trade-mode .chat-body .review-item.status-warn { border-color: rgba(240, 178, 50, .3); background: rgba(240, 178, 50, .04); }
body.trade-mode .chat-body .review-dot { width: 18px; height: 18px; font-size: 11px; line-height: 18px; }
body.trade-mode .chat-body .status-good .review-dot { background: var(--t-buy); }
body.trade-mode .chat-body .status-bad .review-dot { background: var(--t-sell); }
body.trade-mode .chat-body .status-warn .review-dot { background: var(--t-warn); color: #121214; }
body.trade-mode .chat-body .status-info .review-dot { background: var(--t-hover); color: var(--t-text2); }
body.trade-mode .chat-body .review-title { color: var(--t-text); font-size: 13px; font-weight: 600; }
body.trade-mode .chat-body .review-text { color: var(--t-text2); font-size: 12px; line-height: 1.5; }
body.trade-mode .chat-body .review-heuristic { margin-left: 6px; padding: 0 5px; border-radius: 3px; background: var(--t-raised); color: var(--t-text3); font-size: 10px; font-weight: 600; }
body.trade-mode .chat-body .review-quote { margin: 8px 0 0; padding: 8px 10px; border-left: 2px solid var(--t-accent); border-radius: 0 4px 4px 0; background: var(--t-raised);
  color: var(--t-text2); font-size: 12px; }
body.trade-mode .chat-body .review-quote a { color: var(--t-accent); }

/* chart header (symbol bar) */
body.trade-mode .chart-head { gap: 6px 14px; min-height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--t-border); background: var(--t-panel); }
body.trade-mode .ch-symbol { color: var(--t-text); font-size: 16px; }
body.trade-mode .ch-symbol:hover { background: var(--t-raised); }
body.trade-mode .ch-badge { background: var(--t-raised); color: var(--t-text2); }
body.trade-mode .ch-price { color: var(--t-text); font-size: 15px; }
body.trade-mode .ch-change.pos { color: var(--t-buy); }
body.trade-mode .ch-change.neg { color: var(--t-sell); }
body.trade-mode .ch-tfs button, body.trade-mode .ch-frames button { color: var(--t-text3); font-family: var(--t-font); }
body.trade-mode .ch-tfs button.on { background: transparent; color: var(--t-accent); }
body.trade-mode .ch-tfs button:hover, body.trade-mode .ch-frames button:hover { background: var(--t-raised); color: var(--t-text); }
body.trade-mode .ch-frames button { border-color: var(--t-border); border-radius: 4px; }
body.trade-mode .ch-frames button.on { background: var(--t-raised); color: var(--t-text); }
body.trade-mode .ch-search { background: var(--t-raised); border: 1px solid var(--t-border-strong); }
body.trade-mode .ch-list button { color: var(--t-text); }
body.trade-mode .ch-list button:hover { background: var(--t-hover); }
body.trade-mode .ch-status { color: var(--t-text3); }

/* modal + tooltip while a trading tool is open */
body.trade-mode .modal { background: var(--t-panel); border: 1px solid var(--t-border-strong); border-radius: 10px; color: var(--t-text); font-family: var(--t-font); }
body.trade-mode .modal-footer { background: var(--t-panel); border-top: 1px solid var(--t-border); }
body.trade-mode .modal-title { color: var(--t-text); font-size: 16px; font-weight: 600; }
body.trade-mode .modal-text, body.trade-mode .fill-rules { color: var(--t-text2); font-size: 13px; }
body.trade-mode .modal-input { background: var(--t-raised); border: 1px solid var(--t-border); border-radius: 6px; color: var(--t-text); }
body.trade-mode .modal-input:focus { border-color: var(--t-accent); }
body.trade-mode #modal-submit { background: var(--t-accent); color: #121214; border-radius: 6px; font-weight: 600; }
body.trade-mode #modal-submit.danger { background: var(--t-sell); color: #fff; }
body.trade-mode .button-link { color: var(--t-text2); }
body.trade-mode .tooltip { background: var(--t-raised); border: 1px solid var(--t-border-strong); color: var(--t-text); font-family: var(--t-font); }

/* ======================================================= Paper Trading */
.tp-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(320px, 1fr) 300px; gap: 4px; padding: 4px;
  height: calc(100vh - 48px); box-sizing: border-box; }
.tp-bar { grid-column: 1 / 3; display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 16px; overflow: hidden; }
.tp-bar .ch-symbol-wrap { flex: none; }
.tp-sym { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border: 0; border-radius: 6px; background: transparent;
  color: var(--t-text); font: 600 18px var(--t-font); cursor: pointer; }
.tp-sym:hover { background: var(--t-raised); }
.tp-sym .t-badge { font-size: 10px; }
.tp-last { font-size: 20px; font-weight: 600; min-width: 110px; }
.tp-stat { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.tp-stat span:first-child { color: var(--t-text3); font-size: 11px; }
.tp-stat span:last-child { color: var(--t-text); font-size: 12px; font-weight: 500; }
.tp-chart { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; overflow: hidden; }
.tp-chart .chart-head { border-radius: 8px 8px 0 0; }
.tp-chart-body { position: relative; flex: 1; min-height: 0; }
.tp-order { grid-column: 2; grid-row: 2 / 4; display: flex; flex-direction: column; overflow: hidden; }
.tp-order-scroll { flex: 1; overflow-y: auto; padding: 12px 16px 16px; }
.tp-bottom { grid-column: 1; grid-row: 3; display: flex; flex-direction: column; overflow: hidden; }
.tp-bottom .t-table-wrap { flex: 1; }
.tp-mode-row { display: flex; gap: 8px; }
.tp-mode-row .t-btn { flex: 1; height: 30px; font-size: 12px; }
.tp-mode-row .t-btn strong { color: var(--t-accent); font-weight: 600; }
.tp-order .t-tabs { padding: 0; margin-top: 12px; height: 36px; gap: 20px; }
.tp-avail { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; }
.tp-avail span:first-child { color: var(--t-text3); }
.tp-qty-row { display: flex; gap: 8px; }
.tp-qty-row .t-field { flex: 1; }
.tp-qty-row .t-seg { flex: none; }
.tp-toggles { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; }
.tp-sub { margin-top: 10px; padding: 12px; border: 1px solid var(--t-border); border-radius: 8px; background: var(--t-bg); }
.tp-sub-head { display: flex; align-items: center; gap: 6px; color: var(--t-text); font-size: 12px; font-weight: 600; }
.tp-sub-head i { width: 3px; height: 12px; border-radius: 2px; }
.tp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-tp-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px 26px; gap: 6px; align-items: center; margin-top: 6px; }
.tp-summary { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--t-border); }
.tp-summary .pl-kv { padding: 3px 0; }
.tp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.tp-buttons .t-btn { height: 44px; flex-direction: column; gap: 0; line-height: 1.2; }
.tp-buttons .t-btn small { font-size: 11px; font-weight: 500; opacity: .85; }
.tp-account { border-top: 1px solid var(--t-border); padding: 12px 16px; background: var(--t-panel); }
.tp-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 8px; }
.tp-account-grid div span { display: block; color: var(--t-text3); font-size: 11px; }
.tp-account-grid div strong { color: var(--t-text); font-size: 13px; font-weight: 500; }
.tp-account-actions { display: flex; gap: 8px; margin-top: 12px; }
.tp-alert { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--t-border); background: rgba(255, 152, 0, .08); font-size: 12px; }
.tp-alert strong { color: #ff9800; }
.tp-alert .t-btn { margin-left: auto; }
.tp-lev { font-size: 28px; font-weight: 600; text-align: center; margin: 8px 0 4px; }

/* ======================================================= Journal */
.tj-page { padding: 16px 20px 40px; max-width: 1400px; }
.tj-top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.tj-top .t-seg { width: auto; }
.tj-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.tj-equity { height: 300px; position: relative; }
.tj-tooltip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; border: 1px solid var(--t-border-strong); border-radius: 6px; background: var(--t-raised);
  color: var(--t-text); font-size: 12px; white-space: nowrap; }
.tj-tooltip[hidden] { display: none; }
.tj-bars td { height: 38px; }
.tj-bar { position: relative; width: 120px; height: 6px; border-radius: 3px; background: var(--t-raised); }
.tj-bar i { position: absolute; top: 0; height: 6px; border-radius: 3px; }
.tj-list { margin-top: 12px; }
.tj-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 16px; color: var(--t-text3); font-size: 12px; }
.tj-detail { padding: 16px 20px 40px; max-width: 1400px; }
.tj-hero { display: flex; align-items: center; gap: 24px; padding: 18px 20px; flex-wrap: wrap; }
.tj-hero-main { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.tj-hero-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; }
.tj-hero-result { font-size: 28px; font-weight: 600; }
.tj-hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px 20px; flex: 1; }
.tj-hero-stats div span { display: block; color: var(--t-text3); font-size: 11px; }
.tj-hero-stats div strong { font-size: 13px; font-weight: 500; }
.tj-chart { height: 380px; position: relative; }
.tj-timeline { padding: 8px 16px 16px; }
.tj-ev { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; }
.tj-ev::before { content: ""; position: absolute; left: 6px; top: 22px; bottom: -8px; width: 1px; background: var(--t-border); }
.tj-ev:last-child::before { display: none; }
.tj-ev i { width: 9px; height: 9px; margin: 4px 0 0 2px; border-radius: 50%; background: var(--t-text3); }
.tj-ev i.buy { background: var(--t-buy); }
.tj-ev i.sell { background: var(--t-sell); }
.tj-ev-title { color: var(--t-text); font-size: 12px; font-weight: 600; }
.tj-ev-sub { color: var(--t-text3); font-size: 11px; }
.tj-ev-val { text-align: right; font-size: 12px; font-weight: 500; }
.tj-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.tj-section { padding: 4px 16px 16px; }
.tj-notes .pl-label { margin-top: 14px; }

/* ======================================================= Brandon Moments */
body.trade-mode .mo-lobby { padding: 16px 20px 40px; max-width: 1200px; }
body.trade-mode .mo-card { background: var(--t-panel); border-color: var(--t-border); }
body.trade-mode .mo-card-label { color: var(--t-text3); font-weight: 400; }
body.trade-mode .mo-card-value { color: var(--t-text); font-weight: 600; }
body.trade-mode .mo-card-sub { color: var(--t-text3); }
body.trade-mode .mo-card .pos, body.trade-mode .mo-r.pos { color: var(--t-buy); }
body.trade-mode .mo-card .neg, body.trade-mode .mo-r.neg { color: var(--t-sell); }
body.trade-mode .mo-random { background: var(--t-accent); color: #121214; border-radius: 6px; font-weight: 600; }
body.trade-mode .mo-help { background: var(--t-raised); color: var(--t-text3); }
body.trade-mode .mo-count { color: var(--t-text3); font-size: 12px; }
body.trade-mode .mo-menu { background: var(--t-raised); border: 1px solid var(--t-border-strong); }
body.trade-mode .mo-opt { color: var(--t-text); font-family: var(--t-font); font-size: 12px; }
body.trade-mode .mo-opt:hover { background: var(--t-hover); }
body.trade-mode .mo-opt.on { background: transparent; color: var(--t-accent); }
body.trade-mode .mo-opt.on span { color: var(--t-accent); }
body.trade-mode .mo-list { border: 1px solid var(--t-border); border-radius: 8px; background: var(--t-panel); overflow: hidden; }
body.trade-mode .mo-row { border-bottom: 1px solid var(--t-border); padding: 10px 16px; color: var(--t-text); }
body.trade-mode .mo-row:last-child { border-bottom: 0; }
body.trade-mode a.mo-row:hover { background: var(--t-raised); }
body.trade-mode .mo-tk { color: var(--t-text); font-size: 14px; }
body.trade-mode .mo-quote, body.trade-mode .mo-sub { color: var(--t-text3); }
body.trade-mode .mo-tf { background: var(--t-raised); color: var(--t-text2); }
body.trade-mode .mo-date { color: var(--t-text2); font-size: 12px; }
body.trade-mode .mo-chip { background: var(--t-raised); color: var(--t-text3); border-radius: 4px; font-size: 11px; }
body.trade-mode .mo-chip.good { background: var(--t-buy-tint); color: var(--t-buy); }
body.trade-mode .mo-chip.warn { background: var(--t-warn-tint); color: var(--t-warn); }
body.trade-mode .mo-chip.bad { background: var(--t-sell-tint); color: var(--t-sell); }
body.trade-mode .mo-badge-strategy, body.trade-mode .mo-av-strategy { background: var(--t-accent-tint); color: var(--t-accent); }
body.trade-mode .mo-empty-title { color: var(--t-text); }
body.trade-mode .mo-pager { color: var(--t-text3); }
body.trade-mode .mo-label { border-left-color: var(--t-accent); background: var(--t-accent-tint); color: var(--t-text); border-radius: 4px; }
body.trade-mode .mo-reveal { background: var(--t-accent); color: #121214; }
body.trade-mode .mo-posts { border-color: var(--t-border); background: var(--t-panel); }
.mo-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 4px; padding: 4px; height: calc(100vh - 48px); box-sizing: border-box; }
.mo-chartpanel { display: flex; flex-direction: column; overflow: hidden; }
.mo-chartpanel .chart-head { border-radius: 8px 8px 0 0; }
.mo-side { display: flex; flex-direction: column; overflow: hidden; }
.mo-side-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }
.mo-momentcard { display: flex; align-items: center; gap: 10px; }
.mo-momentcard .mo-av { width: 36px; height: 36px; }
.mo-momentcard div { display: flex; flex-direction: column; gap: 2px; }
.mo-result { padding: 14px; border: 1px solid var(--t-border); border-radius: 8px; background: var(--t-bg); }
.mo-result-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mo-result-big { font-size: 24px; font-weight: 600; margin-top: 8px; }
.mo-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mo-vs div { padding: 8px 10px; border-radius: 6px; background: var(--t-raised); }
.mo-vs span { display: block; color: var(--t-text3); font-size: 11px; }
.mo-vs strong { font-size: 13px; }
.mo-moves { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 10px; }
.mo-moves div { padding: 6px 4px; border-radius: 4px; background: var(--t-raised); text-align: center; }
.mo-moves span { display: block; color: var(--t-text3); font-size: 10px; }
.mo-moves strong { font-size: 12px; font-weight: 600; }
.mo-postcard { margin-top: 10px; border: 1px solid var(--t-border); border-radius: 8px; background: var(--t-panel); overflow: hidden; }
.mo-postcard-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--t-border); color: var(--t-text2); font-size: 12px; }
.mo-postcard .mo-post { font-family: var(--font); }
.mo-postcard .msg { background: transparent !important; }
.mo-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }

/* ======================================================= Position Planner */
body.trade-mode .planner { gap: 4px; padding: 4px; height: calc(100vh - 48px); box-sizing: border-box; grid-template-columns: minmax(0, 1fr) 380px; }
body.trade-mode .planner-main { background: var(--t-panel); border: 1px solid var(--t-border); border-radius: 8px; overflow: hidden; }
body.trade-mode .planner-side { background: var(--t-panel); border: 1px solid var(--t-border); border-radius: 8px; padding: 4px 16px 24px; }
body.trade-mode .pl-events { border-top: 1px solid var(--t-border); color: var(--t-text2); font-size: 12px; }
body.trade-mode .pl-event strong { color: var(--t-text); font-weight: 500; }
body.trade-mode .pl-plans .pl-plan, body.trade-mode .pl-plans > * { border-color: var(--t-border); }

@media (max-width: 1400px) {
  .tp-page { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto minmax(280px, 1fr) 260px; }
  .tp-bar { gap: 20px; }
  .tp-bar .tp-hide-narrow { display: none; }
  .mo-page { grid-template-columns: minmax(0, 1fr) 340px; }
  body.trade-mode .planner { grid-template-columns: minmax(0, 1fr) 340px; }
  .tj-grid { grid-template-columns: minmax(0, 1fr); }
}

.t-table .chips.wrap { flex-wrap: wrap; max-width: 330px; white-space: normal; padding: 6px 0; }
.t-floating.t-menu-floating { padding: 6px; }
.t-menu-item span { margin-left: 16px; }

.t-table .tpsl-cell { display: flex; flex-direction: column; gap: 3px; padding: 5px 0; }
.t-table .tpsl-cell .t-chip { height: 20px; padding: 0 7px; font-size: 11px; border-radius: 10px; }
.t-table .tpsl-cell .t-chip b { font-weight: 600; opacity: .8; margin-left: 2px; }
.tp-bottom .t-table th, .tp-bottom .t-table td { padding: 0 10px; }
.t-tabs { overflow-x: auto; scrollbar-width: none; }
.t-tabs::-webkit-scrollbar { display: none; }
.t-panel .t-tabs { gap: 18px; }
.tj-bar { width: 72px; flex: none; }

.tj-bars { table-layout: fixed; }
.tj-bars th, .tj-bars td { padding: 0 8px; }
.tj-bars th:first-child, .tj-bars td:first-child { padding-left: 16px; }
.tj-bars th:last-child, .tj-bars td:last-child { padding-right: 16px; }
.tj-label { overflow: hidden; text-overflow: ellipsis; }
.tj-total { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tj-total .tj-bar { width: 40px; }

/* trade checks: reason field + warning card */
.t-reason { margin-top: 12px; }
.t-reason-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.t-reason-chips .t-chip { height: 24px; border-radius: 4px; font-size: 11px; }
.t-chip.on { border-color: var(--t-accent); background: var(--t-accent-tint); color: var(--t-accent); }
.t-check-card { margin-top: 12px; padding: 12px; border: 1px solid var(--t-border); border-left: 3px solid var(--t-warn); border-radius: 6px; background: var(--t-warn-tint); }
.t-check-card.bad { border-left-color: var(--t-sell); background: rgba(239, 69, 74, .08); }
.t-check-title { color: var(--t-text); font-size: 13px; font-weight: 600; }
.t-check-card.bad .t-check-title { color: var(--t-sell); }
.t-check-card ul { margin: 6px 0 0; padding-left: 16px; color: var(--t-text2); font-size: 12px; line-height: 1.5; }
.t-check-card li.bad::marker { color: var(--t-sell); }
.t-check-card li.warn::marker { color: var(--t-warn); }
.t-check-summary { margin-top: 8px; color: var(--t-text); font-size: 12px; font-weight: 500; line-height: 1.5; }
body.trade-mode .t-check-card .review-quote { margin-top: 8px; }
.tp-from-plan { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border-radius: 6px; background: var(--t-accent-tint); color: var(--t-text); font-size: 12px; }
.tp-from-plan a { color: var(--t-accent); font-weight: 600; }
.tp-from-plan .pl-x { margin-left: auto; }
.tp-bar .ch-symbol { font-size: 18px; }
.chart-countdown { position: absolute; right: 0; z-index: 3; height: 15px; color: #fff; font: 500 11px/15px var(--t-font, "Inter", sans-serif);
  font-variant-numeric: tabular-nums; text-align: center; pointer-events: none; }
.chart-countdown[hidden] { display: none; }

/* shared modal variants (app.js: openModal / openInfo / openFormModal) in the trading theme */
.modal-error:empty { display: none; }
body.trade-mode .modal-body { padding: 22px 20px 20px; }
body.trade-mode .modal-title { margin: 0 0 12px; }
body.trade-mode .modal-intro { margin: 0 0 14px; line-height: 1.5; }
body.trade-mode .modal-summary { margin: 0 0 16px; padding: 10px 12px 10px 28px; border-radius: 6px; background: var(--t-raised); color: var(--t-text2); font-size: 13px; line-height: 1.7; }
body.trade-mode .modal-summary strong { color: var(--t-text); font-weight: 600; }
body.trade-mode .modal-field + .modal-field { margin-top: 14px; }
body.trade-mode .modal-field-label { margin-bottom: 6px; color: var(--t-text2); font-size: 13px; font-weight: 500; }
body.trade-mode .modal-field-help { margin-top: 6px; color: var(--t-text3); font-size: 12px; }
body.trade-mode .modal-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.trade-mode .modal .pl-input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--t-border); border-radius: 6px; background: var(--t-raised);
  color: var(--t-text); font: 500 14px var(--t-font); outline: none; box-sizing: border-box; }
body.trade-mode .modal .pl-num { display: flex; align-items: stretch; height: 38px; border: 1px solid var(--t-border); border-radius: 6px; background: var(--t-raised); overflow: hidden; }
body.trade-mode .modal .pl-num:focus-within { border-color: var(--t-accent); }
body.trade-mode .modal .pl-num .pl-input { height: 36px; border: 0; background: transparent; text-align: center; }
body.trade-mode .modal .pl-step { width: 34px; border: 0; background: transparent; color: var(--t-text3); font-size: 16px; cursor: pointer; }
body.trade-mode .modal .pl-step:hover { color: var(--t-text); background: var(--t-hover); }
body.trade-mode .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; }
body.trade-mode #modal-cancel { height: 36px; padding: 0 16px; border: 1px solid var(--t-border-strong); border-radius: 6px; background: transparent; color: var(--t-text); font: 500 13px var(--t-font); }
body.trade-mode #modal-cancel:hover { background: var(--t-raised); text-decoration: none; }
body.trade-mode #modal-cancel[hidden] { display: none; }
body.trade-mode #modal-submit { height: 36px; padding: 0 18px; }
#modal-cancel[hidden] { display: none; }

/* sticky side-panel footers (Planner, Paper order panel): actions always visible while the form scrolls */
body.trade-mode .planner-side { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; }
.side-footer { flex: none; padding: 12px 16px; border-top: 1px solid var(--t-border); background: var(--t-panel); box-shadow: 0 -8px 16px rgba(0, 0, 0, .18); }
.side-footer-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.side-footer-stats span { display: block; color: var(--t-text3); font-size: 11px; }
.side-footer-stats strong { display: block; color: var(--t-text); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-footer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-footer-buttons > span { display: block; }
.side-footer-buttons .t-btn { height: 40px; }
.side-footer-link { display: block; margin: 8px auto 0; padding: 0; border: 0; background: none; color: var(--t-text3); font: 500 12px var(--t-font); cursor: pointer; }
.side-footer-link:hover { color: var(--t-text); text-decoration: underline; }
.tp-footer .tp-summary { margin-top: 0; padding-top: 0; border-top: 0; }
.tp-footer .tp-buttons { margin-top: 10px; }
/* the plan bar above the planner chart */
.pl-planbar { flex: none; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--t-border); overflow-x: auto; white-space: nowrap; }
.pl-planname { color: var(--t-text); font-size: 13px; font-weight: 600; }
.pl-plantrades { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.pl-plantrades .t-chip, .pl-drawer-trades .t-chip { height: 20px; font-size: 11px; text-decoration: none; }
.pl-drawer-list { max-height: 360px; overflow-y: auto; margin-top: 8px; }
.pl-drawer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 26px; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; cursor: pointer; }
.pl-drawer-row:hover { background: var(--t-raised); }
.pl-drawer-row.on { background: var(--t-accent-tint); }
.pl-drawer-main { display: flex; flex-direction: column; min-width: 0; }
.pl-drawer-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pl-drawer-trades { display: flex; gap: 4px; }
.t-floating .pl-input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--t-border); border-radius: 6px; background: var(--t-raised); color: var(--t-text); font: 500 13px var(--t-font); outline: none; box-sizing: border-box; }

/* the shared symbol picker: a popover above everything, also from Paper's symbol bar */
.tp-bar { position: relative; z-index: 6; overflow: visible; }
.tp-bar .ch-search { top: 42px; z-index: 50; }
body.trade-mode .ch-search { z-index: 50; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
body.trade-mode .ch-list button[hidden] { display: none; }
body.trade-mode .ch-list button.active { background: var(--t-accent-tint); color: var(--t-accent); }
.ch-mkt { display: flex; gap: 2px; padding: 2px; border-radius: 4px; background: var(--t-raised, #2b2d31); }
.ch-mkt button { height: 20px; padding: 0 8px; border: 0; border-radius: 3px; background: transparent; color: var(--t-text3, #949ba4); font: 600 11px var(--t-font, inherit); cursor: pointer; }
.ch-mkt button.on { background: var(--t-hover, #3f4147); color: var(--t-text, #fff); }

/* Brandon Moments: a strategy scenario's rule sources, kept apart from where a post-based scenario shows Brandon's post */
.mo-rulebox { padding: 12px; border: 1px dashed var(--t-border-strong); border-radius: 8px; background: var(--t-bg); }
.mo-rulebox-intro { margin-bottom: 4px; color: var(--t-text2); font-size: 12px; line-height: 1.5; }
.mo-rule-label { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--t-border); color: var(--t-text2); font-size: 12px; line-height: 1.45; }
.mo-rule-label .t-badge { flex: none; margin-top: 1px; }
