/* ════════════════════════════════════════════════════════════════════════════
   68-blotter.css  the PORTFOLIO BLOTTER (static/js/wallet/blotter.js,
   wallet/portfolio.js) and its compact PORT workspace pane.
   ----------------------------------------------------------------------------
   Since 2026-10-08 the page and the pane are drawn on the SHARED table
   layout (66-table.css .mpt-*, lib/table.js MPTable): the one 36px bar, the
   24px controls, the sticky column head, zebra, group rows, the empty line,
   the pane's 28px bar and 20px rows all come from there. This file keeps
   only what the blotter has and the layout does not: the account strip
   under the bar, the Performance tab's host, the sortable head buttons, the
   option group toggle and indent, the pinned Total row, Cancel, the "More"
   row, the PORT pane header, and the account dropdown at control height.

   Owns the `.blt-*` namespace (no other file uses it). House rules:
   tokens.css colours only (both themes follow), rings are inset box
   shadows never 1px borders, NO accent lines anywhere (active = a filled
   background), colour only on P/L.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Page host (#pf-wrap inside #wallet-view's .pf-scroll) ─────────────── */
#wallet-view .pf-wrap.blt-wrap{height:100%;min-height:0;}
#wallet-view .pf-wrap.blt-wrap > .blt-mpt{flex:1 1 auto;height:100%;}
.blt-segh{display:contents;}

/* The account dropdown (wallet/accounts.js) at the layout's control size. */
.blt-mpt .acct-pick-wallet{flex:none;width:auto;}
.blt-mpt .acct-pick-wallet .acct-btn{
  height:var(--mpt-ctl);padding:0 8px;gap:6px;border-radius:var(--radius);
  background:var(--bg-secondary);box-shadow:inset 0 0 0 1px var(--border-default);
  font-size:var(--mpt-fs);font-weight:400;color:var(--text-primary);
}
.blt-mpt .acct-pick-wallet .acct-btn:hover,.blt-mpt .acct-pick-wallet.is-open .acct-btn{background:var(--bg-hover);}
.blt-mpt .acct-pick-wallet .acct-chev{width:8px;height:8px;}
.blt-mpt .acct-pick-wallet .acct-menu{right:auto;width:max(22rem, 100%);}
.blt-meta{display:inline-flex;align-items:center;gap:var(--mpt-gap);}
#blt-cancel-all:hover{color:var(--red);}
/* Narrow pages: Columns keeps its icon, the word gives way. */
@container mptpage (max-width:980px){
  .blt-mpt .blt-w{display:none;}
}

/* ── Account strip: one row under the bar, each number once; the account
      controls at its right end. ───────────────────────────────────────── */
.blt-strip{
  flex:none;display:flex;align-items:center;justify-content:space-between;gap:4px 16px;flex-wrap:wrap;
  min-height:var(--mpt-head);padding:0 var(--mpt-padx);box-sizing:border-box;
  background:var(--bg-secondary);box-shadow:inset 0 1px 0 var(--border-default);
}
.blt-figs{display:flex;align-items:center;flex-wrap:wrap;gap:4px 24px;min-width:0;}
.blt-fig{display:inline-flex;align-items:baseline;gap:8px;white-space:nowrap;}
.blt-k{color:var(--text-muted);}
.blt-v{font-size:max(13px, 0.9235rem);font-weight:600;color:var(--text-primary);}
.blt-acts{display:flex;align-items:center;gap:2px;margin-left:auto;}
.blt-act b{font-weight:600;color:var(--text-secondary);}
.blt-act[aria-pressed="true"] b{color:var(--text-primary);}
@container mptpage (max-width:1180px){
  .blt-figs{column-gap:16px;}
  .blt-fig{gap:6px;}
}
/* Laptop widths (the 1024 page): every figure and the three account
   controls stay on ONE row, six digit figures included; only the air and
   the strip's type step down. */
@container mptpage (max-width:940px){
  .blt-strip{column-gap:8px;padding:0 10px;}
  .blt-figs{column-gap:8px;}
  .blt-fig{gap:4px;}
  .blt-k,.blt-act.mpt-btn{font-size:11px;}
  .blt-v{font-size:11.5px;}
  .blt-acts{gap:0;}
  .blt-act.mpt-btn{padding:0 4px;}
}

/* ── Performance tab: the account's graphs (wallet/performance.js) in
      place of the table, scrolling inside the page. ─────────────────── */
.blt-perfhost{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;}
.blt-perfhost::-webkit-scrollbar{width:8px;height:8px;}
.blt-perfhost::-webkit-scrollbar-track{background:transparent;}
.blt-perfhost::-webkit-scrollbar-thumb{background:var(--border-default);border-radius:99px;border:2px solid transparent;background-clip:padding-box;}
/* The Total equity card's stats grid: at laptop widths a long figure
   (Holdings $120,326.14) ran into the next cell. Each cell may shrink, its
   value steps down with the grid's width and, as a last resort, wraps;
   wide screens keep the 1.3rem value and the 1.4rem gutters. */
.blt-perfhost .wc-eqacct-card .pf-figs{container-type:inline-size;container-name:bltfigs;}
.blt-perfhost .wc-eqacct-card .pf-fig{min-width:0;}
/* Only where the overlap starts (the grid under ~520px, the 1280 page and
   narrower); 1440 and wider render exactly as before. */
@container bltfigs (max-width:520px){
  .blt-perfhost .wc-eqacct-card .pf-fig{padding:0 1.5cqi;}
  .blt-perfhost .wc-eqacct-card .pf-fig:nth-child(4n+1){padding-left:0;}
  .blt-perfhost .wc-eqacct-card .pf-fig .v{font-size:2.8cqi;overflow-wrap:anywhere;}
}

/* ── The table (.mpt-t from the layout; the blotter's own parts) ───────── */
/* Auto layout: an option label or a seven figure value is never clipped;
   the scroller scrolls sideways if the page is narrower than the book. */
.mpt-t.blt-t{table-layout:auto;}
/* Sortable heads are buttons (keyboard); they read as the plain head. */
.blt-sb{display:inline-flex;align-items:center;gap:0;width:100%;height:100%;padding:0;border:0;
  background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap;}
.mpt-n .blt-sb{justify-content:flex-end;}
.blt-sb .mpt-arr{margin:0 0 0 3px;}
.mpt-n .blt-sb .mpt-arr{margin:0 3px 0 0;}
/* Option group rows (an underlying holding options): the layout's group
   row, opened and closed by its caret, a click opens the chart. */
.mpt-t.blt-t > tbody > tr.blt-grp > td{cursor:pointer;}
.blt-tog{display:inline-flex;align-items:center;gap:6px;margin:0;padding:0;border:0;background:transparent;
  color:var(--text-primary);font:inherit;font-weight:600;cursor:pointer;}
.blt-car{display:inline-block;width:0;height:0;border-style:solid;border-width:4px 0 4px 5px;
  border-color:transparent transparent transparent var(--text-muted);}
.blt-car.blt-car-open{border-width:5px 4px 0 4px;border-color:var(--text-muted) transparent transparent transparent;}
.mpt-t td.blt-kid{padding-left:calc(var(--mpt-padx) + 17px);color:var(--text-secondary);}

/* Pinned Total row. */
.mpt-t.blt-t > tfoot td{position:sticky;bottom:0;z-index:2;height:var(--mpt-row);font-weight:600;
  background:var(--bg-tertiary);box-shadow:inset 0 1px 0 var(--border-default);}

/* Fills paging. */
.mpt-t.blt-t > tbody > tr.blt-morerow > td{text-align:center;cursor:default;}

/* Cancel: a small ringed button per working order (USER CLICK ONLY). */
.mpt-t .blt-c-x{width:1%;text-align:right;}
.blt-cancel{height:20px;padding:0 9px;border:0;border-radius:var(--radius-sm);cursor:pointer;
  background:var(--bg-tertiary);box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--text-secondary);font:inherit;}
.blt-cancel:hover{color:var(--red);background:var(--bg-elevated);}
.blt-cancel:disabled{opacity:.5;cursor:default;}
.blt-cancel-x{width:16px;height:16px;padding:0;display:inline-flex;align-items:center;justify-content:center;
  background:transparent;box-shadow:none;color:var(--text-muted);line-height:1;}
.blt-cancel-x:hover{background:var(--bg-row-hover);}
.blt-tog:focus-visible,.blt-sb:focus-visible,.blt-cancel:focus-visible{outline:1px solid var(--accent);outline-offset:-1px;}

/* ── PORT workspace pane: the layout's pane mode; its header (the
      workspace pane bar) carries the account word, Equity and Day. ───── */
.mpt-pane .mpt-t td.blt-kid{padding-left:calc(var(--mpt-padx) + 10px);}
.blt-ph-acct{color:var(--text-muted);white-space:nowrap;}
.blt-ph-k{margin:0 5px 0 12px;color:var(--text-muted);white-space:nowrap;}
.blt-ph-v{font-weight:600;white-space:nowrap;}

/* ── IBKR connect state: the bar, then the connect surface. ────────────── */
.blt-connect-host{flex:1 1 auto;min-height:0;overflow:auto;box-shadow:inset 0 1px 0 var(--border-default);
  scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;}

/* ── PHONE (2026-10-14): the account strip as a figure grid ─────────────────
   Under :root.phone, the phone layout's switch (app.html's head; its own
   file is 77-phone.css). Kept here so .blt- stays owned by this file.
   The rules above pack Equity / Cash / Buying power / P/L onto one 11px row
   for a laptop. On a phone they are the first thing a user reads, so they
   become a two column grid of label-over-value figures, with the account
   actions (Margin, Deposit, Reset) on their own row under it. */
:root.phone .blt-strip{
  display:block;
  padding:10px 12px 6px;
}
:root.phone .blt-figs{
  display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;
}
:root.phone .blt-fig{flex-direction:column;align-items:flex-start;gap:2px;}
:root.phone .blt-k{font-size:12px;}
:root.phone .blt-v{font-size:17px;}
:root.phone .blt-acts{margin:8px -4px 0;gap:4px;flex-wrap:wrap;}
:root.phone .blt-act.mpt-btn{font-size:13px;height:36px;padding:0 10px;}

/* ── Currencies (Ticket 5, 2026-10-20; display switch 2026-10-20 fixes):
      the US$ / C$ switch, live order status. ─────────────────────────── */
/* The display switch (the shared .mpt-seg) and its (i) lead the account
   controls; in the PORT pane they sit at the bar's right end. */
.blt-acts .blt-ccy{margin-right:6px;}
.blt-acts .mpt-info{margin-right:6px;align-self:center;}
.blt-ccyh{display:inline-flex;align-items:center;gap:4px;flex:none;}
.blt-ccyh .mpt-seg-b{padding:0 6px;}
.blt-ccy .mpt-seg-b:disabled{opacity:.45;cursor:default;}
/* The 1280 page (and down to the laptop rule below): less air between the
   figures and around the account controls, same type size. */
@container mptpage (min-width:941px) and (max-width:1180px){
  .blt-strip{column-gap:8px;}
  .blt-figs{column-gap:8px;}
  .blt-fig{gap:4px;}
  .blt-acts{gap:0;}
  .blt-act.mpt-btn{padding:0 4px;}
}
.blt-na{color:var(--text-muted);font-weight:400;}
.blt-fig[title]{cursor:default;}
/* The strip fits ONE row at every desktop width (Ticket 5 polish,
   2026-10-21). With US$ / C$ on every figure and the currency switch in
   the controls, the inline "Label value" row outgrew the page below about
   1440 and the controls fell to a ragged second line. Wide pages keep the
   inline row with a little less air; at the 1280 page and down each figure
   stacks its label over its value (a quote board's stat cell), which halves
   its width, so figures and controls share one row down to the 1024 page.
   The phone keeps its own two column grid (:root.phone above wins). */
@container mptpage (min-width:1181px){
  .blt-figs{column-gap:20px;}
}
@container mptpage (max-width:1180px){
  .blt-strip{flex-wrap:nowrap;padding-top:3px;padding-bottom:3px;}
  .blt-figs{flex-wrap:nowrap;column-gap:16px;}
  .blt-fig{flex-direction:column;align-items:flex-start;gap:0;line-height:1.25;}
  .blt-acts{flex:none;}
}
/* Live order status: a reject's reason in muted text under the word. */
.mpt-t td.blt-ls{white-space:nowrap;}
.mpt-t td.blt-ls-rejected{color:var(--red);}
.mpt-t td.blt-ls-filled{color:var(--text-primary);}
.mpt-t td.blt-ls-cancelled{color:var(--text-muted);}
.blt-why{display:block;max-width:28rem;overflow:hidden;text-overflow:ellipsis;color:var(--text-muted);font-size:11px;}

/* T9 feel: a cancelled order strikes at once while the server answers. */
.mpt-t tr.blt-cancelling td:not(.blt-c-x){text-decoration:line-through;color:var(--text-muted);}

/* T10 presets (2026-10-24): the PORT pane header (account word left, Equity
   and Day right) cut the account word in a ~400px pane (Day trading preset
   at 1280 with the sidebar open). Under 420px of header the Day figure gives
   way (it stays in the board's figures); Equity and the account word stay. */
.wks-ph:has(.blt-ph-v){container-type:inline-size;container-name:bltph;}
@container bltph (max-width:420px){
  .blt-ph-k:nth-of-type(2),.blt-ph-v:nth-of-type(2){display:none;}
}
