/* Train view (shared screens, stage 2): the list | board | coach-card page used by Today, Drills and Tactics on both
   sites. Chess Lab's look is the reference: these values are the ones its pages already use (its own rules stay too,
   so its pages don't change). Everything is scoped to .tv, the grid's class.
   Home: chess-lab-open/site/shared/ (MIT). The private kit pulls a pinned copy; edit it here, never there. */

/* Page spacing and board sizes (v82): one copy for both sites, Chess Lab's values (the page width and its side padding,
   the space above and below a page, a card, a board's default width and Settings -> Board size). A page's own layout
   (.tv, .tv3, .tvplay below, the opening trainer) still sizes its board from these. */
.inner{max-width:1500px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
main.inner{padding-block:24px 56px}
.card{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px}
.boardwrap{width:100%;max-width:min(580px,100%)}
body[data-size="small"] .boardwrap{max-width:min(420px,100%)}
body[data-size="large"] .boardwrap{max-width:min(760px,100%)}
.tv,.grid.tv{display:grid;grid-template-columns:minmax(0,300px) minmax(0,1fr);gap:22px;align-items:start}   /* 17 Nov 2026: the opening trainer's columns and gaps (was 344 px, 24 px; the panel's 20 px) */
.tv .panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,370px);gap:22px;align-items:start}
.tv .side{display:flex;flex-direction:column;gap:12px;min-width:0}
.tv .boardwrap{width:100%;--bmax:max(320px,calc(100vh - 150px));max-width:min(100%,720px,max(300px,calc(100vh - 170px)),var(--bfit,9999px));justify-self:center}
.tv .board,.tv .evalbar{max-width:min(100%,var(--bmax))}
.tv .boardtools .btn.primary{order:-1}

/* Left panel: a rating line, labelled chip rows, the list */
.tv .trate{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;margin:0 0 6px}.tv .trate b{font-size:1.2rem;color:var(--head)}
.tv .filters{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}
.tv .chips{display:flex;gap:4px;flex-wrap:wrap;align-items:center;position:relative;padding-left:62px}
.tv .chips.nolabel{padding-left:0}
.tv .chip{padding:3px 8px;font-size:.75rem;white-space:nowrap;flex:0 0 auto;border-radius:var(--radius)}
.tv .chip[aria-pressed="true"]{background:var(--navy);color:var(--on-navy);border-color:var(--head)}
.tv .flabel{position:absolute;left:0;top:5px;font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.tv .tvlabel{margin:2px 0 6px}
.tv .list{display:flex;flex-direction:column;gap:5px;overflow:auto;padding:2px;max-height:calc(100vh - 330px);min-height:200px}
.tv .list.long{max-height:calc(100vh - 210px)}.tv .list.longest{max-height:calc(100vh - 130px)}
.tv .list .empty{margin:0}
.tv .list.isempty{min-height:0}
.tv .drill{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;text-align:left;width:100%;background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:7px 10px;cursor:pointer;color:var(--ink);text-decoration:none}
.tv .drill:hover{border-color:var(--blue)}
.tv .drill[aria-current="true"]{border-color:var(--head);box-shadow:inset 3px 0 0 var(--navy)}
.tv .drill .opp{font-weight:600;font-size:.9rem;line-height:1.25;color:var(--head)}
.tv .drill .meta{color:var(--muted);font-size:.76rem;line-height:1.35}
.tv .drill.done{opacity:.6}
.tv .evalchip{font-size:.78rem;font-weight:600;padding:2px 6px;border-radius:3px;background:var(--callout);color:var(--head);white-space:nowrap}
.tv .src{font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;font-weight:600;color:var(--brass-text)}
.tv .tag{display:inline-block;font-size:.6rem;text-transform:uppercase;letter-spacing:.08em;font-weight:700;padding:1px 6px;border-radius:3px;background:var(--bad-soft);color:var(--bad);margin-left:4px;vertical-align:1px}
.tv .tag.conv{background:var(--good-soft);color:var(--good)}.tv .tag.punish{background:var(--good-soft);color:var(--good)}
.tv .tag.info{background:var(--callout);color:var(--blue)}
.tv .dots{display:flex;gap:4px}
.tv .dot{width:9px;height:9px;border-radius:50%;background:var(--line)}
.tv .dot.good{background:var(--good)}.tv .dot.warn{background:var(--brass)}.tv .dot.bad{background:var(--bad)}

/* Search box over the list (Drills) */
.tv .vh{position:absolute;left:0;top:0;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tv .osearch{margin:0 0 8px}
.tv .osearch input{width:100%;border:1px solid var(--border-strong);border-radius:var(--radius);padding:7px 10px 7px 32px;font-size:.9rem;background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23536175' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px 50%}
.tv .osearch input:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 3px var(--callout)}

/* The navy session bar (Today) and the small cards under it */
.tv .session{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--navy);color:var(--on-navy);border-radius:var(--radius);padding:12px 14px;margin-bottom:12px}
.tv .session .label{color:var(--blue-on-navy)}
.tv .session b{font-family:var(--serif);font-weight:400;font-size:1.25rem}
.tv .progressbar{height:6px;border-radius:3px;background:rgba(255,255,255,.18);overflow:hidden;flex:1;min-width:120px}
.tv .progressbar i{display:block;height:100%;background:var(--brass-light)}

/* Right: the coach card (kicker, title, small pills), then the status and the rest */
:is(.tv,.tv3,.tvplay) .ohead{padding:10px 14px 12px}
:is(.tv,.tv3,.tvplay) .ohtop{display:flex;align-items:center;gap:8px}:is(.tv,.tv3,.tvplay) .ohtop .label{margin-right:auto;white-space:nowrap;letter-spacing:.1em;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
:is(.tv,.tv3,.tvplay) .ohtop .label.wrap{white-space:normal;line-height:1.45}
:is(.tv,.tv3,.tvplay) .ohead h2{font-size:1.2rem;margin:0;min-width:0}
:is(.tv,.tv3,.tvplay) .ohead .elo{font-size:.8rem;color:var(--muted);font-weight:400}
:is(.tv,.tv3,.tvplay) .ohchips{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}:is(.tv,.tv3,.tvplay) .ohchips>span{font-size:.72rem;font-weight:600;color:var(--muted);background:var(--band);border:1px solid var(--line);border-radius:999px;padding:0 8px}
:is(.tv,.tv3,.tvplay) .ohead .seg.mini{display:inline-flex;margin-top:10px}
:is(.tv,.tv3,.tvplay) .dfoot{font-size:.76rem;margin:0}

/* Narrower windows: the coach card goes under the board; phones: one column, the board first */
@media (max-width:1180px){.tv,.grid.tv{grid-template-columns:minmax(0,280px) minmax(0,1fr)}.tv .panel{grid-template-columns:minmax(0,1fr)}}
@media (max-width:860px){.tv,.grid.tv{grid-template-columns:minmax(0,1fr)!important}.tv>div:first-child{order:2}.tv>.panel{order:1}
  .tv .list,.tv .list.long,.tv .list.longest{max-height:none;min-height:0}   /* 18 Nov 2026: part of the page, not a box (no height
     limit, so it never scrolls); 19 Nov 2026: overflow stays auto, since overflow:visible on the long list hung WebKit on Linux
     at 320 px (the private Chess Lab's Drills page never finished loading) */
  .tv .list>.lm-hide{display:none!important}
  .tv .lmore{display:block;width:100%;margin-top:8px}}

/* Report pages (Progress): a title with its controls at the right, a one-paragraph summary, tiles, then sections */
.report{margin-bottom:28px}
.report h2{font-size:1.5rem;margin:0 0 4px}
.report h3{font-size:1.1rem;margin:22px 0 8px}
.report .lead{margin:0 0 14px;max-width:70ch}
.rhead{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin-bottom:6px}
.rhead h2{margin:0}
.rbar{display:flex;flex-wrap:wrap;gap:8px}
body[data-view="progress"] main.inner{padding-top:14px}

/* Lobby (Calculation, Guess the move): a card with the intro, filters, Start and a summary table | the list.
   Chess Lab's .gmlobby values. */
.tvlobby{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.tvlobby h2{margin:4px 0 6px}
.tvlobby .tvlist .list{max-height:calc(100vh - 200px);margin-top:8px}
.tvlobby .tvfilters{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;align-items:flex-start}
.tvlobby .tvfilters select{flex:1;min-width:180px}
.tvlobby .chips{margin-top:10px}
.tvlobby .tvstats td,.tvlobby .tvstats th{padding:4px 8px;font-size:.84rem}
.tvlobby .tvstats .num{text-align:right}
.tvlobby .drill{padding:9px 12px}
.tvlobby .evalchip.ok,.tv3 .evalchip.ok{background:var(--success-soft);color:var(--success)}.tvlobby .evalchip.part,.tv3 .evalchip.part{background:var(--warn-soft);color:var(--warn)}.tvlobby .evalchip.bad,.tv3 .evalchip.bad{background:var(--error-soft);color:var(--error)}
@media (max-width:860px){.tvlobby{grid-template-columns:minmax(0,1fr)}}

/* Three columns (Calculation, Guess the move): the exercise, its verdict and Back | the board | your work and the
   solution. Two columns below 1180px (board | everything else), one on phones. Chess Lab's #cc-train values. */
.tv3{display:grid;grid-template-columns:minmax(0,300px) minmax(0,1fr) minmax(0,370px);gap:12px 22px;align-items:start}   /* 17 Nov 2026: the opening trainer's columns and gaps, so every three-column board page lines up with it */
.tv3>.tvleft{display:flex;flex-direction:column;gap:10px;min-width:0}.tv3>.tvleft .tvback{align-self:flex-start}
.tv3>.boardwrap{min-width:0;width:100%;justify-self:center;max-width:min(100%,calc(100vh - 150px),720px,var(--bfit,9999px))}
.tv3>.side{display:flex;flex-direction:column;gap:12px;min-width:0}
@media (max-width:1180px){
  .tv3{grid-template-columns:minmax(0,1fr) minmax(0,340px);grid-template-rows:repeat(7,auto) 1fr;gap:10px 18px}
  .tv3>.tvleft,.tv3>.side{display:contents}
  .tv3>.boardwrap{grid-column:1;grid-row:1/span 8}
  .tv3>.tvleft>*,.tv3>.side>*{grid-column:2}
  .tv3>.tvleft>.tvback{order:9;justify-self:start}}
@media (max-width:860px){
  .tv3{grid-template-columns:minmax(0,1fr);grid-template-rows:none;gap:12px}
  .tv3>.boardwrap{grid-column:1;grid-row:auto;order:0;max-width:none}.tv3>.tvleft>*,.tv3>.side>*{grid-column:1}}

/* Play: the board | status, New game, moves, the setup as segmented rows, your games. Chess Lab's .pgrid / #bf-mod values. */
.seg.mini{padding:2px;gap:2px}.seg.mini button{flex:0 0 auto;padding:4px 9px;font-size:.8rem}
.tvplay{display:grid;grid-template-columns:minmax(0,min(calc(100% - 362px),calc(100vh - 150px),720px)) minmax(0,340px);gap:22px;align-items:start;justify-content:start}   /* board then panel from the page's left edge (12 Nov 2026) */
.tvplay>.boardwrap{min-width:0;width:100%;justify-self:center;max-width:min(100%,calc(100vh - 150px),720px,var(--bfit,9999px))}
.tvplay>.side{display:flex;flex-direction:column;gap:12px;min-width:0}
:is(.tvplay,.tv3) .prow{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;align-items:center;margin-top:8px}
:is(.tvplay,.tv3) .pwrap{flex-wrap:wrap}:is(.tvplay,.tv3) .pwrap button{flex:0 0 auto}
:is(.tvplay,.tv3) .pnote{margin:8px 0 0;font-size:.78rem}
:is(.tvplay,.tv3) .vh{position:absolute;left:0;top:0;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:860px){.tvplay{grid-template-columns:minmax(0,1fr);gap:12px}.tvplay>.boardwrap{max-width:none}}

/* Watch: one row of filters (view, kind, state, topic, search), then Add a video, then the library. Chess Lab's #wa-mod values. */
.tvwatch .wafilters{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:12px}
.tvwatch .wafilters .chips{padding-left:0}
.tvwatch .wafilters select{border:1px solid var(--border-strong);border-radius:6px;padding:6px 8px;background:var(--white);color:var(--ink);font:inherit;font-size:.86rem;max-width:200px}
.tvwatch .wasearch{flex:1 1 180px;min-width:150px;margin:0}.tvwatch .wasearch input{width:100%;border:1px solid var(--border-strong);border-radius:var(--radius);padding:7px 10px;font-size:.9rem;background:var(--white);color:var(--ink)}
.tvwatch .waadd{margin-bottom:12px}.tvwatch .waadd summary{cursor:pointer;font-weight:600;color:var(--head)}
.tvwatch #wa-count{margin:0 0 6px}
body[data-view="play"] main.inner{max-width:1200px}body[data-view="calc"] main.inner{max-width:1440px}

/* Option cards on a lobby (Guess the move: where the games come from). Chess Lab's .gmopts / .gmopt values. */
.tvlobby .gmopts{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;margin-top:6px}
.tvlobby .gmopts.three{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:480px){.tvlobby .gmopts,.tvlobby .gmopts.three{grid-template-columns:minmax(0,1fr)}}
.tvlobby .gmopt{display:flex;gap:8px;align-items:flex-start;border:1px solid var(--line);border-radius:var(--radius);padding:9px 11px;cursor:pointer;background:var(--white)}
.tvlobby .gmopt:hover{border-color:var(--blue)}.tvlobby .gmopt.on{border-color:var(--head);box-shadow:inset 0 0 0 1px var(--navy);background:var(--callout)}
.tvlobby .gmopt input{margin-top:4px;accent-color:var(--head)}.tvlobby .gmopt b{display:block;color:var(--head);font-weight:600;font-size:.92rem}.tvlobby .gmopt .note{display:block;font-size:.78rem;line-height:1.35}
body[data-view="guess"] main.inner{max-width:1200px}   /* 17 Nov 2026: the same top as every board page (was 14 px, 10 px higher) */

/* .tvcontents: a wrapper a page redraws as a whole (Players), laid out as if its children were the grid's own */
.tv3>.tvcontents{display:contents}
.tv3>.tvcontents>.boardwrap{min-width:0;width:100%;justify-self:center;max-width:min(100%,calc(100vh - 150px),720px,var(--bfit,9999px))}
.tv3>.tvcontents>.side{display:flex;flex-direction:column;gap:12px;min-width:0}
@media (max-width:1180px){.tv3>.tvcontents>.side{display:contents}.tv3>.tvcontents>.boardwrap{grid-column:1;grid-row:1/span 8}.tv3>.tvcontents>.side>*{grid-column:2}}
@media (max-width:860px){.tv3>.tvcontents>.boardwrap{grid-column:1;grid-row:auto;order:0;max-width:none}.tv3>.tvcontents>.side>*{grid-column:1}}

/* Settings: groups of rows with segmented buttons | a preview board. Chess Lab's .setwrap values. */
.tvset.setwrap{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,300px);gap:20px;align-items:start;max-width:1000px}
.tvset .setgroup{font-size:1.15rem;margin:22px 0 2px}
.tvset .setrow{display:grid;grid-template-columns:minmax(min(220px,100%),1fr) minmax(0,max-content);gap:6px 18px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}   /* the label keeps 220px; a long choice row wraps instead of crushing it (iPad widths, 22 Nov 2026) */
.tvset .setrow:last-child{border-bottom:0}
.tvset .setname{font-weight:600;color:var(--head)}
.tvset .setrow .seg{display:inline-flex;flex-wrap:wrap}
@media (max-width:560px){.tvset .setrow .seg{display:flex}.tvset .setrow .seg button{flex:1 1 auto}}   /* phones: a choice row fills the width when it wraps (13 Nov 2026) */
.tvset .setrow .seg button{flex:0 0 auto;padding:7px 12px}
.tvset .setpreview{position:sticky;top:calc(env(safe-area-inset-top,0px) + 64px)}
.tvset .setpreview .board{margin-top:10px}
.tvset .setrow{position:relative}
.tvset .vh{position:absolute;left:0;top:0;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:860px){.tvset.setwrap{grid-template-columns:minmax(0,1fr)}.tvset .setpreview{position:static;order:-1;max-width:300px}.tvset .setpreview .board{max-width:220px}}
@media (max-width:560px){.tvset .setrow{grid-template-columns:minmax(0,1fr)}}
/* TV.pick: a .field select keeps shared.css's chevron (.field select resets the background on both sites) */
.field.tvpick select{background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23889' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center/11px 8px;padding-right:30px}
/* Yearly.section (shared/yearly.js): Year by year on the report cards; pool lines under each year */
.ytable td{vertical-align:top}
.ytable th,.ytable td{padding-left:10px;padding-right:10px}
@media (min-width:641px){.ytable .ygl{display:block;font-size:.78rem}}
.ytable th .note{font-weight:400}
.ytable td.yname{white-space:nowrap}
.ytable td.yname .note{font-size:.78rem;white-space:nowrap}
.ydelta{display:inline-block;margin-left:4px;font-size:.78rem;white-space:nowrap}
.ymulti tr.yrow td{border-bottom:0;font-weight:600}
.ymulti tr.yrow td .note{font-weight:400}
.ymulti tr.ypoolrow td{border-top:0;padding-top:3px;padding-bottom:3px;font-size:.92rem}
.ymulti tr.ypoolrow td.ypname{padding-left:22px;color:var(--muted);white-space:nowrap}
.ymulti tr.ypoolrow+tr.yrow td{border-top:1px solid var(--line)}
.ytable td.ycomb{text-align:center}
.stat .yperf{margin-top:2px;line-height:1.35;white-space:nowrap}.stat .yperf b{font-size:1.15rem}
@media (max-width:640px){.ymulti tr.yrow{border-bottom:0;padding-bottom:2px}.ymulti tr.ypoolrow{padding:4px 12px 4px 26px;border-bottom:0}.ymulti tr.ypoolrow td.ypname{padding-left:0}.ymulti tr.ypoolrow td:empty,.ytable td.ycomb{display:none}.ymulti tr.yrow{border-top:1px solid var(--line)}}

/* One page frame (12 Nov 2026): the tab row, every page and the footer share the same left and right edges. Pages used
   to be 1180, 1200, 1440 or 1500 px wide depending on the tab, so the content jumped against the tab row from tab to tab.
   (html body[data-view] beats each site's per-tab main.inner widths.) */
html body[data-view] main.inner{max-width:1500px}
/* Phones (12 Nov 2026): a row of board buttons fills the width evenly (no lone button on a second line), stat tiles
   two to a row, the Settings preview as wide as the cards under it. */
@media (max-width:640px){
  .boardtools>.btn{flex:1 1 auto;justify-content:center;text-align:center}
  :where(.actions,.controls) .boardtools>.btn{flex:0 0 auto}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tvset .setpreview{max-width:none}.tvset .setpreview .board{max-width:240px;margin-inline:auto}
}
/* Numbers line up in columns (tabular figures), and on touch screens every control is comfortably tappable:
   buttons 44 px tall (WCAG 2.5.5 / Apple's 44 pt), filter chips and the "?" at least 24 px with space between them
   (WCAG 2.2's 2.5.8 minimum). 12 Nov 2026. */
table,.stat b,.mono,.num,.chip,.evalchip,.trate b{font-variant-numeric:tabular-nums}
th.num{text-align:right}
@media (pointer:coarse){
  .btn{min-height:44px}
  .btn.sm,.btn.small{min-height:40px}
  .chip{min-height:32px}
  .tv .chips,.chips{row-gap:6px}
  .qhelp{width:24px;height:24px}
  /* 15 Nov 2026: a link or label styled as a button (Lichess ↗, Cheat sheet, Watch ↗) centres its words in the 44 px like a
     real button does; inline-block put them at the top */
  a.btn,label.btn,summary.btn,span.btn{display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:middle}
}

/* ---------- Bottom bar (14 Nov 2026, phone fix run): one bar for every board page on phones and iPads ----------
   Rules (written out in the private kit's HANDOFF, "Layout rules"): thumb reach, so the page's buttons sit in a bar fixed to
   the bottom of the screen; ‹ Previous is always the far left corner and › Next the far right one (they step through the
   line or solution on the board and are dimmed, never moved, when there is nothing to step through); the page's main
   action is the one filled button, beside ›; everything is 44 px tall with 4 px between; less-used tools fold into ⋯ on
   phones and sit in the row on iPads. A page turns its own button row into the bar with TV.bar(row, {...}) (trainview.js):
   the buttons keep their ids, handlers and place in the document, so laptops and the tests see no change.
   "Touch" below = a touch screen of any size, or a narrow / upright window (the phone layout). */
.bb-morebtn,.btn.bb-morebtn,.bb-only,.btn.bb-only{display:none}
@media (hover:none) and (pointer:coarse),(max-width:1099.98px) and (orientation:portrait),(max-height:499.98px) and (orientation:landscape){
  .bbar.bbar{position:fixed!important;left:0;right:0;bottom:0;top:auto;z-index:40;margin:0!important;display:flex!important;flex-wrap:wrap-reverse!important;align-items:center;justify-content:center;gap:0 4px!important;
    width:auto;max-width:none!important;min-height:0;box-sizing:border-box;
    padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))!important;
    background:var(--white);border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:0 -8px 16px -12px rgba(19,40,74,.35)}
  .bbar.bbar .navgrp,.bbar.bbar .boardtools,.bbar.bbar .bb-in{display:contents!important}
  :where(.boardwrap,.panel,.tv):has(.bbar){container-type:normal!important;contain:none!important}   /* a size container would hold the fixed bar inside itself */
  .bbar.bbar .cspacer{display:none}
  .bbar.bbar .btn.rd-open{display:none!important}   /* Read: only where the reader is offered (phones, upright iPads), as outside the bar */
  .bbar.bbar .bb-in[hidden]{display:contents!important}.bbar.bbar .bb-in[hidden]>.bb-prev,.bbar.bbar .bb-in[hidden]>.bb-next{opacity:.32;pointer-events:none}
  .bbar.bbar .bb-only{display:inline-flex}
  .bbar.bbar .btn{order:0!important;margin:0!important;flex:1 1 44px!important;min-width:44px;min-height:44px;max-width:168px;padding:4px 8px!important;display:inline-flex;align-items:center;justify-content:center;text-align:center;
    white-space:normal;font-size:.82rem;line-height:1.15;border-color:transparent;background:transparent;box-sizing:border-box}
  .bbar.bbar [hidden]:not(.bb-prev):not(.bb-next):not(.bb-in){display:none!important}
  .bbar.bbar .btn.primary{background:var(--navy);border-color:var(--navy);color:var(--on-navy)}
  .bbar.bbar .btn.primary:disabled{background:transparent;border-color:transparent;color:var(--muted)}
  .bbar.bbar .btn[aria-pressed="true"],.bbar.bbar .btn.on{background:var(--callout);border-color:var(--blue)}
  .bbar.bbar kbd,.bbar.bbar .pinlab{display:none}
  .bbar.bbar .bb-prev,.bbar.bbar .bb-next{display:inline-flex!important;flex:0 0 52px!important;max-width:52px;font-size:1.6rem;line-height:1;padding:0 0 3px!important;border-color:var(--line);background:var(--white);color:var(--head)}
  .bbar.bbar .bb-prev{order:-10!important;margin-right:auto!important}
  .bbar.bbar .bb-next{order:10!important;margin-left:auto!important}
  .bbar.bbar .bb-prev[hidden],.bbar.bbar .bb-next[hidden]{opacity:.32;pointer-events:none}
  .bbar.bbar .bb-prev:disabled,.bbar.bbar .bb-next:disabled{opacity:.32}
  .bbar.bbar .bb-primary{order:9!important}
  .bbar.bbar .bb-morebtn{display:inline-flex;order:8!important;flex:0 0 44px!important;font-size:1.25rem;letter-spacing:.05em}
  .bbar.bbar .bb-morebtn[aria-expanded="true"]{background:var(--callout);border-color:var(--blue)}
  .bbar.bbar::before{content:'';order:15;flex:0 0 100%;height:0}
  .bbar.bbar .bb-x{order:20!important;display:none!important}
  .bbar.bbar [data-t="more"]{display:none!important}   /* a page's own "more" toggle (the opening trainer's): the bar's ⋯ replaces it */
  .bbar.bbar.bb-open .bb-x:not([hidden]){display:inline-flex!important;flex:1 1 auto!important;margin-bottom:6px!important;border-color:var(--line);background:var(--white);padding:4px 12px!important}
  .bbar.bbar .bb-note{order:30!important;flex:0 0 100%;text-align:center;font-size:.78rem;color:var(--muted);background:none;border:0;padding:0 0 4px;white-space:normal}
  /* the room for the fixed bar goes at the very end of the page (18 Nov 2026), so whatever follows the page (a site's
     footer) is never under the bar either; it used to be the page's own bottom padding */
  body:has(.bbar-host:not([hidden])){padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
}
@media (orientation:portrait) and (max-width:1099.98px),(orientation:landscape) and (max-height:499.98px){.bbar.bbar .btn.rd-open{display:inline-flex!important}}
/* 17 Nov 2026: only where the row is the bar (the touch layouts above); this block used to reach laptops' button rows too */
@media (min-width:600px) and (hover:none) and (pointer:coarse),(min-width:600px) and (max-width:1099.98px) and (orientation:portrait),(min-width:600px) and (max-height:499.98px) and (orientation:landscape){
  .bbar.bbar{gap:0 8px!important}
  .bbar.bbar .btn{font-size:.9rem;padding:4px 14px!important;max-width:220px;white-space:nowrap}
  .bbar.bbar .bb-prev,.bbar.bbar .bb-next{flex-basis:64px!important;max-width:64px}
}
@media (max-width:359.98px) and (hover:none) and (pointer:coarse),(max-width:359.98px) and (orientation:portrait),(max-width:359.98px) and (max-height:499.98px) and (orientation:landscape){
  .bbar.bbar{gap:0 2px;padding-left:4px;padding-right:4px}
  .bbar.bbar .btn{padding:4px 5px!important;font-size:.78rem}
  .bbar.bbar .bb-prev,.bbar.bbar .bb-next{flex-basis:44px!important;max-width:44px}
}
@media (hover:none) and (pointer:coarse) and (min-width:900px),(min-width:900px) and (max-width:1099.98px) and (orientation:portrait){   /* wide touch screens (iPads on their side, the big iPad upright): room for every button, no ⋯ */
  .bbar.bbar{gap:0 8px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .bbar.bbar .btn{flex:0 1 auto!important;padding:4px 16px!important;font-size:.9rem;white-space:nowrap}
  .bbar.bbar .bb-x:not([hidden]),.bbar.bbar.bb-open .bb-x:not([hidden]){display:inline-flex!important;order:0!important;flex:0 1 auto!important;margin-bottom:0!important;border-color:transparent;background:transparent;padding:4px 16px!important}
  .bbar.bbar .bb-morebtn{display:none}
  .bbar.bbar .bb-prev,.bbar.bbar .bb-next{flex:0 0 64px!important;max-width:64px}
}

/* 23 Nov 2026 (his iPad 9th gen, on its side): on a touch screen in landscape the buttons are the fixed bar at the bottom,
   so every board's size limit takes off the tab row, the bar (about 88 px) and a margin as well; the old limits
   (window − 150 to 200 px) only fitted under the 720 px cap of a 13" iPad. --bbroom = the height left for a board. */
@media (hover:none) and (pointer:coarse) and (orientation:landscape){
  :root{--bbroom:max(280px,calc(100dvh - env(safe-area-inset-top,0px) - var(--navh,56px) - 88px - env(safe-area-inset-bottom,0px) - 44px))}
  :is(.tv,.tv3,.tvplay,.otrain,.tvcontents)>.boardwrap,.tv .boardwrap{max-width:min(100%,720px,var(--bbroom),var(--bfit,9999px))!important}
  .tvplay{grid-template-columns:minmax(0,min(calc(100% - 362px),var(--bbroom),720px)) minmax(0,340px)}
}
/* His recheck (23 Nov 2026): an iPad on its side (1000 to 1180 px wide) gets the desktop's three columns, narrower,
   instead of board | one long column: the left and right columns share the page's text, so it all fits in one view
   without scrolling (the board gives up some width for that; it is capped by --bbroom's height anyway).
   .tv: list | board | panel; .tv3 (and .tvcontents): left | board | side. The opening trainer's own grid: style.css. */
@media (hover:none) and (pointer:coarse) and (orientation:landscape) and (min-width:1000px) and (max-width:1180px){
  .tv,.grid.tv{grid-template-columns:minmax(0,270px) minmax(0,1fr);gap:16px}
  .tv .panel{grid-template-columns:minmax(0,1fr) minmax(0,250px);gap:16px}
  .tv3{grid-template-columns:minmax(0,240px) minmax(0,1fr) minmax(0,280px);grid-template-rows:none;gap:12px 16px}
  .tv3>.tvleft,.tv3>.side,.tv3>.tvcontents>.side{display:flex}
  .tv3>.boardwrap,.tv3>.tvcontents>.boardwrap{grid-column:auto;grid-row:auto}
  .tv3>.tvleft>*,.tv3>.side>*,.tv3>.tvcontents>.side>*{grid-column:auto}
  .tv3>.tvleft>.tvback{order:0}
  :is(.tv,.tv3) .ohtop{align-items:flex-start}:is(.tv,.tv3) .ohtop .label{white-space:normal;line-height:1.45}   /* the narrower side column: a long title wraps, */
  :is(.tv,.tv3) .ohchips>span{white-space:normal}:is(.tv,.tv3) .rng{min-width:0}   /* so does a long opening name in a chip, and the rating slider fits */
}

/* ---------- Pinned board (14 Nov 2026): on phones and upright iPads the board stays under the tab row while the page's
   status, notation and notes scroll underneath, as in the opening trainer. TV.pin(section, boardColumn) (trainview.js).
   The board gives up height so that about 220 px of text is always in view between it and the bottom bar. */
@media (orientation:portrait) and (max-width:1099.98px){
  .tvpin{position:sticky!important;top:calc(env(safe-area-inset-top,0px) + var(--navh,44px));z-index:25;background:var(--band);padding:4px 0 8px;
    box-shadow:0 8px 10px -10px rgba(19,40,74,.45);max-width:none!important;width:auto;justify-self:stretch}
  .tvpin>.board{max-width:min(100%,calc(100vh - var(--navh,44px) - 300px));max-width:min(100%,calc(100dvh - var(--navh,44px) - 300px));margin-inline:auto}
  .tvpinned>.tvpin{order:-1}
  .tvpinned .tvpin{justify-self:stretch!important}   /* 15 Nov: a page's own justify-self:center made a pinned column shrink to its board's 0 px */
  .tvpin{transition:top .22s ease}html.navhid .tvpin{top:env(safe-area-inset-top,0px)}   /* 15 Nov: the header slid away (nav.js), the board follows it up */
  .tvpinned .pscroll{max-height:none!important;min-height:0!important;overflow:visible!important}
  .tvpinned .status{padding:8px 12px;font-size:.9rem;line-height:1.4}
  .tvpinned .status strong{display:inline;margin-right:4px}
}

/* 15 Nov 2026: see trainview.js padNow (scroll-padding under a pinned board; the board itself goes under the tab row) */
.tvpin,.tvpin *,[data-pinpad],[data-pinpad] *{scroll-margin-top:var(--pinback,0px)!important}

/* ---------- One chip (14 Nov 2026): the facts under a title ("White · 2210", "1/2-1/2 · date", "+1.6 ?") ----------
   Every chip is the same height with its text centred on one line; a "?" bubble or a link inside a chip never makes
   it taller or gives it a second outline. 24 px, 28 px on touch screens (the "?" keeps a 36 px tap area around it). */
.ohchips{align-items:center}
.ohchips>span{display:inline-flex;align-items:center;gap:4px;min-height:24px;box-sizing:border-box;line-height:1.15;padding:2px 9px;white-space:nowrap;max-width:100%}
.ohchips>span>*{line-height:1.15}
.ohchips>span span{border:0;background:none;padding:0;border-radius:0;font:inherit;color:inherit}
.ohchips>span .qhelp{width:18px;height:18px;margin:0 -3px 0 0;flex:0 0 auto;font-size:10.5px}
.ohchips>span a{color:inherit}
@media (pointer:coarse){
  .ohchips{gap:6px}
  .ohchips>span{min-height:28px;padding:2px 11px;font-size:.78rem}
  .ohchips>span .qhelp{width:20px;height:20px}
}
