/* Tidemark — two screens: the 'dual' layout (the AYN Thor; see runtime/layout.js). Every rule that changes anything is
   scoped to body.l-dual, so the desktop and touch layouts are untouched. Both documents load this file:
     top screen    index.html, body.l-dual: the desktop design's stage, shown whole. #topui holds interface over the
                   scene, sized in screen pixels through --inv (stage pixels per screen pixel, set by the layout).
     lower screen  lower.html, body.l-dual.touch.lower: the touch interface (touch.css) on one panel, about 538 x 468
                   CSS pixels on the Thor, with the adjustments below. */

/* ---------- outside the layout ---------- */
.padnote, #nextpad { display: none; }
#topui { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
#lowerframe { position: fixed; border: 0; z-index: 5; background: #000; }       /* desktop preview (?dual) only */
body.lower { background: #000; }
body.lower .lowerhint { display: none; }
body.lower.single .lowerhint { display: flex; position: fixed; inset: 0; align-items: center; justify-content: center; text-align: center; padding: 24px;
  color: #8a7e66; font: italic calc(18.4px * var(--ts-settings))/1.6 Georgia, serif; }

/* =============================== top screen =============================== */
/* the scene dims while a full-screen panel is open below (desktop covers the scene with the panel) */
body.l-dual #topui::before { content: ''; position: absolute; inset: 0; background: rgba(3,4,5,.8); opacity: 0; transition: opacity 180ms; }
body.l-dual.dimtop #topui::before { opacity: 1; }
body.l-dual #examine .hint { display: none; }                      /* the lower screen says how examining works */
body.l-dual #stage::after { display: none; }   /* print grain: invisible at this density, and a full-screen blend costs GPU memory */

/* text over the scene: no smaller on this screen than the touch layouts' text */
body.l-dual #subs { bottom: 150px; max-width: 1680px; font-size: calc(21.85px * var(--inv) * var(--ts-subtitles)); }
body.l-dual #subs .sname { font-size: calc(13.8px * var(--inv) * var(--ts-names)); margin-bottom: calc(3px * var(--inv)); }
body.l-dual #card .c1 { font-size: calc(31.05px * var(--inv) * var(--ts-notices)); letter-spacing: .34em; }
body.l-dual #card .c2 { font-size: calc(19.55px * var(--inv) * var(--ts-notices)); margin-top: calc(8px * var(--inv)); }
body.l-dual #card .rule { width: calc(360px * var(--inv)); margin: calc(14px * var(--inv)) 0; }
body.l-dual #titlecard .t2 { font-size: calc(16.675px * var(--inv) * var(--ts-notices)); }
body.l-dual #toast { right: 40px; top: 120px; }
body.l-dual #dlbar { left: auto; right: 44px; top: 8px; gap: calc(6px * var(--inv)); }
body.l-dual #dlbar .pct { font-size: calc(10px * var(--inv) * var(--ts-notices)); }
body.l-dual #dlbar .track { width: calc(80px * var(--inv)); height: calc(2.5px * var(--inv)); }
body.l-dual #toast .t { font-size: calc(16.675px * var(--inv) * var(--ts-notices)); padding: calc(8px * var(--inv)) calc(18px * var(--inv)) calc(8px * var(--inv)) calc(10px * var(--inv)); gap: calc(10px * var(--inv)); }
body.l-dual #toast .t img, body.l-dual #toast .t .ico { width: calc(40px * var(--inv)); height: calc(40px * var(--inv)); border-width: calc(2px * var(--inv)); }
body.l-dual #toast .t .lbl { font-size: calc(11.04px * var(--inv) * var(--ts-notices)); }

/* examine spots: lines and ticks the same size on screen as in the touch layouts */
body.l-dual #examine { cursor: default; }
body.l-dual #examine .hs { border-width: calc(2.5px * var(--inv)); }
body.l-dual #examine .hs.done::after { width: calc(22px * var(--inv)); height: calc(22px * var(--inv)); font-size: calc(14.95px * var(--inv) * var(--ts-examine)); right: calc(4px * var(--inv)); top: calc(4px * var(--inv)); }
body.l-dual #examine .hs.picked { border-color: var(--brass); background: rgba(230,200,120,.14); box-shadow: 0 0 calc(18px * var(--inv)) rgba(230,200,120,.45); }
body.l-dual #examine .cursorlabel { font-size: calc(16.1px * var(--inv) * var(--ts-examine)); padding: calc(4px * var(--inv)) calc(10px * var(--inv)); border-width: calc(1px * var(--inv)); }

/* the title: art and wordmark up here, the menu below */
#titletop { position: absolute; inset: 0; background-size: cover; background-position: center; }
#titletop .shade { position: absolute; inset: 0; background: radial-gradient(ellipse 700px 300px at 50% 50%, rgba(8,12,12,.65), rgba(8,12,12,0)); }
#titletop .logo { position: absolute; left: 570px; top: 417px; width: 780px; }
#titletop .logo img { width: 100%; }
#titletop .sub { position: absolute; left: 460px; top: 627px; width: 1000px; --cap: min(calc(max(35.5px, 13.8px * var(--inv)) * var(--ts-title)), calc(1000px / 21)); }

/* the exhibit chosen in the Court Record, large (pinch to zoom a picture or chart) */
#exhibit { position: absolute; inset: 0; z-index: 2; background: #090b0c; pointer-events: auto; }   /* (covers the whole screen: the scene and the testimony box don't show through) */
#exhibit .xstage { position: absolute; left: 0; right: 0; top: 0; height: 800px; display: flex; align-items: center; justify-content: center; }
#exhibit .xbox { position: relative; flex: none; width: 980px; height: 470px; transform: scale(1.62); background: #0c0e0f; border: 1px solid #3a3a33; overflow: hidden;
  box-shadow: 0 6px 40px rgba(0,0,0,.85); pointer-events: auto; }
#exhibit .xinner { position: absolute; inset: 0; transform-origin: 0 0; }
#exhibit .xinner > .doc { overflow-x: hidden; }   /* (a document wraps to its page; only its height may scroll) */
#exhibit img.full { width: 100%; height: 100%; object-fit: contain; }
#exhibit .xcap { position: absolute; left: 26px; right: 26px; bottom: 26px; height: 250px; overflow: hidden; padding: calc(10px * var(--inv)) calc(36px * var(--inv)) calc(10px * var(--inv)) calc(16px * var(--inv));
  display: flex; flex-direction: column; pointer-events: auto; background: rgba(8,10,11,.88); border-top: 1px solid rgba(200,160,74,.5); }
/* a picture or a document: a square at full height on the left, its name and description in the column to its right */
#exhibit.side .xstage { left: 26px; top: 26px; bottom: 26px; width: 1028px; height: auto; right: auto; }
#exhibit.pic .xbox { width: 100%; height: 100%; transform: none; }
#exhibit.doc .xbox { width: 680px; height: 680px; transform: scale(1.51); }   /* (a document's text at about the size it had before) */
#exhibit.side .xcap { left: 1080px; top: 26px; height: auto; border-top: 0; border-left: 1px solid rgba(200,160,74,.5); }
#exhibit .xname { font-family: var(--display-font); font-weight: 600; font-size: calc(19.55px * var(--inv) * var(--ts-record)); color: #f0e2bd; }
#exhibit .xdesc { margin-top: calc(4px * var(--inv)); font-size: calc(16.1px * var(--inv) * var(--ts-record)); line-height: 1.35; color: var(--bone); }
/* a description longer than its box scrolls (a tap or a drag) under the arrows at the box's right */
#exhibit .xdesc { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
#exhibit .xdesc::-webkit-scrollbar { display: none; }
#exhibit :is(.xcap, .xbox) > .more { position: absolute; right: calc(4px * var(--inv)); width: calc(30px * var(--inv)); height: calc(30px * var(--inv)); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--brass); opacity: 0; visibility: hidden; transition: opacity 180ms, visibility 180ms; z-index: 2; }
#exhibit :is(.xcap, .xbox) > .more.up { top: calc(6px * var(--inv)); color: #7f7869; } #exhibit :is(.xcap, .xbox) > .more.down { bottom: calc(6px * var(--inv)); }
#exhibit :is(.xcap, .xbox).up > .more.up, #exhibit :is(.xcap, .xbox).down > .more.down { opacity: 1; visibility: visible; }
#exhibit :is(.xcap, .xbox) > .more i { display: flex; filter: drop-shadow(0 1px 3px #000); }
#exhibit :is(.xcap, .xbox) > .more svg { width: calc(24px * var(--inv)); height: calc(24px * var(--inv)); fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
#exhibit :is(.xcap, .xbox).down > .more.down i { animation: morebob 1.3s ease-in-out 3 forwards; }
@media (prefers-reduced-motion: reduce) { #exhibit :is(.xcap, .xbox).down > .more.down i { animation: none; } }
#exhibit.side .xname { font-size: calc(23px * var(--inv) * var(--ts-record)); }
#exhibit.side .xdesc { margin-top: calc(8px * var(--inv)); font-size: calc(18.4px * var(--inv) * var(--ts-record)); line-height: 1.45; }
#exhibit.law .xcap { top: 120px; bottom: 120px; height: auto; }
#exhibit.law .xdesc { font-size: calc(18.4px * var(--inv) * var(--ts-record)); }
/* pointing at the proof: the exhibit fills the screen; tap (or aim with the d-pad) up here, confirm below */
#pointtop { position: absolute; inset: 0; background: rgba(5,6,7,.94); pointer-events: auto; }
#pointtop .pointview { left: 50px; right: 50px; top: 50px; bottom: 50px; cursor: default; touch-action: none; }
#pointtop .pointer-cross { width: calc(28px * var(--inv)); height: calc(28px * var(--inv)); border-width: calc(2.2px * var(--inv)); box-shadow: 0 0 0 calc(2px * var(--inv)) rgba(0,0,0,.55); }

/* what is said, on the top screen: the dialogue box and the testimony (the desktop design, text at touch size) */
body.l-dual #dlg { left: 30px; right: 30px; bottom: 30px; height: 330px; }
body.l-dual #dlg .nameplate { left: 40px; top: 8px; height: calc(24px * var(--inv)); padding: 0 calc(26px * var(--inv)) 0 calc(12px * var(--inv)); }
body.l-dual :is(#dlg, #ceplate) .name { font-size: calc(14.375px * var(--inv) * var(--ts-names)); }   /* (and the statements') */
body.l-dual :is(#dlg, #cebox) .text { font-size: calc(22.08px * var(--inv) * var(--ts-dialogue)); line-height: 1.3; }
body.l-dual #dlg .text, body.l-dual #dlg.noverbs .text { top: calc(8px + 30px * var(--inv)); left: 64px; right: 70px;
  bottom: 22px; overflow: hidden; }
body.l-dual #dlg .adv, body.l-dual #dlg.noverbs .adv { right: 40px; bottom: 22px; border-left-width: calc(7px * var(--inv)); border-right-width: calc(7px * var(--inv)); border-top-width: calc(9px * var(--inv)); }
body.l-dual #patience { right: 44px; top: 30px; gap: calc(5px * var(--inv)); }
body.l-dual #patience svg { filter: drop-shadow(0 1px 3px #000); }
body.l-dual #patience svg { width: calc(18px * var(--inv)); height: calc(18px * var(--inv)); }
body.l-dual #recordbtn { display: none; }                       /* the Court Record is a button on the lower screen */
body.l-dual #cebox { left: 30px; right: 30px; width: auto; bottom: 30px; height: 330px; }
body.l-dual #cebox .text { left: 64px; right: 70px; top: calc(20px + 8px * var(--inv)); }
body.l-dual #cebox .rule { display: none; }
body.l-dual #ceplate { left: 70px; bottom: 359px; height: calc(24px * var(--inv)); padding: 0 calc(30px * var(--inv)) 0 calc(14px * var(--inv)); }

/* ============================== lower screen ============================== */
body.l-dual.lower #dock { background: linear-gradient(180deg, #0d1011, #07090a 60%); }
body.l-dual .panarrow { display: none !important; }                /* the whole scene is always on the top screen */
body.l-dual.lower .padnote { display: block; }
body.l-dual.lower .settings .notes.touch-only { margin-top: calc(var(--u) * 1.2); }
/* controller hints: shown once the controller is in use (the other touch layouts never show them) */
body.l-dual.lower[data-input=pad] .kh { display: inline-flex !important; }
body.l-dual.lower .kh kbd { font-size: calc(13.8px * var(--ts-keys)); padding: 2px 5px 1px; }
body.l-dual.lower #tbar .tb { position: relative; }
body.l-dual.lower #tbar .tb .kh { position: absolute; right: -6px; bottom: -7px; margin: 0; }
body.l-dual.lower #tbar .tb .kh kbd.g { background: #0b0e0f; color: var(--bone); border-color: rgba(200,160,74,.6); }
body.l-dual.lower .exdock .exrow .btn .kh, body.l-dual.lower .pointbar .btn .kh { margin-left: 6px; }

/* the title menu, on a quiet ground (the art is on the top screen) */
body.l-dual.lower #title { background-image: none !important; background: radial-gradient(ellipse at 50% 38%, #141b1c 0%, #080a0b 72%);
  align-content: center; grid-template-areas: "items"; padding: var(--gut); }
body.l-dual.lower #title .shade { display: none; }
body.l-dual.lower #title .items { border-top: 1px solid rgba(200,160,74,.35); border-bottom: 1px solid rgba(200,160,74,.35); padding: calc(var(--u) * .5) calc(var(--u) * 3); }

/* The lower screen laid out after the DS, in the game's own style: the scene above, dimmed, as its ground; big buttons
   on it (the game's matte panels, brass hairline, chamfered corners). While a line is up, one big ▶ (A); in a hub, the
   four verbs; in cross-examination, Press and Present as tabs and a big ◀ and ▶. The one-screen layouts laid out as two
   (body.ds, touch.css) give their panel the same rules. */
body.l-dual.lower.insession:not(.cine)::before { content: ''; position: fixed; inset: 0; z-index: 0; background: var(--lowbg, none) center / cover no-repeat;
  filter: saturate(.8) brightness(.3); }
body.l-dual.lower #dock { background: none; }
:is(body.l-dual.lower, body.ds) #nextpad .np, :is(body.l-dual.lower, body.ds) .verb, :is(body.l-dual.lower, body.ds) #cebtns .btn {
  background: var(--panel); border: 1px solid rgba(200,160,74,.55); color: var(--bone); box-shadow: 0 2px 12px rgba(0,0,0,.5);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)); }
:is(body.l-dual.lower, body.ds) #cebtns .btn.gold { background: linear-gradient(180deg, #d8b25a, #b88f3c); color: #16130c; border-color: #f0d38c; }
:is(body.l-dual.lower, body.ds).dlgline:not(.cine) #nextpad { display: flex; order: 2; flex: 1 1 auto; align-items: center; justify-content: center; min-height: 0;
  padding: calc(var(--u) * 1.4) calc(var(--u) * 1.2) calc(var(--u) * 2.2); }
:is(body.l-dual.lower, body.ds) #nextpad .np { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; max-height: 17em; }
:is(body.l-dual.lower, body.ds) #nextpad svg { width: calc(var(--u) * 4.4); height: calc(var(--u) * 4.4); fill: var(--bone); }
:is(body.l-dual.lower, body.ds) #nextpad .kh { position: absolute; right: 10px; bottom: 10px; }
:is(body.l-dual.lower, body.ds) #nextpad:active .np { filter: brightness(1.35); }
:is(body.l-dual.lower, body.ds) #verbs { order: 1; flex: 1 1 auto; min-height: 0; border-top: 0; padding: 0; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr 1fr; gap: var(--gut); }
:is(body.l-dual.lower, body.ds):not(.dlgverbs) #verbs { display: none; }     /* with the hub's panel only (not while examining) */
:is(body.l-dual, body.ds) #dlg:not(.noverbs) { display: none; }         /* a hub keeps the top screen clear: the room is what you look at */
:is(body.l-dual.lower, body.ds) #verbs::before { content: attr(data-lead); grid-column: 1 / -1; padding: calc(var(--u) * .2) calc(var(--u) * .3) 0; color: var(--think);
  font-style: italic; font-size: calc(var(--fs) * var(--ts-dialogue)); line-height: 1.35; text-shadow: 0 1px 4px #000; }
:is(body.l-dual.lower, body.ds) #verbs[data-lead=""]::before { display: none; }
:is(body.l-dual.lower, body.ds) .verb { min-height: 0; gap: calc(var(--u) * .5); font-size: calc(var(--u) * 1.6815 * var(--ts-menus)); }
/* Examine, Move on top; Talk, Present below (the hub's d-pad moves across the grid as drawn) */
:is(body.l-dual.lower, body.ds) .verb[data-i="1"] { order: 1; } :is(body.l-dual.lower, body.ds) .verb[data-i="3"] { order: 2; }
:is(body.l-dual.lower, body.ds) .verb[data-i="0"] { order: 3; } :is(body.l-dual.lower, body.ds) .verb[data-i="2"] { order: 4; }
:is(body.l-dual.lower, body.ds) .verb svg { width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); }
:is(body.l-dual.lower, body.ds) .verb .dot { width: 9px; height: 9px; right: 12px; top: 12px; }
:is(body.l-dual.lower, body.ds)[data-input=pad] .verb.sel { border-color: var(--brass); background: linear-gradient(180deg, rgba(200,160,74,.22), rgba(200,160,74,.06)), var(--panel); color: #f0e2bd; }
/* Talk, Move, Present to: the list takes the whole panel in place of the verbs (hub.js list), its choices big buttons */
:is(body.l-dual.lower, body.ds).docklist #verbs { display: none; }
:is(body.l-dual.lower, body.ds) .menu.docklist { position: relative; inset: auto; order: 1; flex: 1 1 auto; min-height: 0; width: auto; padding: 0; translate: none;
  display: flex; flex-direction: column; gap: calc(var(--u) * .5); background: none; clip-path: none; animation: panelin 160ms ease-out; }
:is(body.l-dual.lower, body.ds) .menu.docklist::before { display: none; }
:is(body.l-dual.lower, body.ds) .docklist .dlhead { flex: none; padding: 0 calc(var(--u) * .3); text-shadow: 0 1px 4px #000; }
:is(body.l-dual.lower, body.ds) .docklist .mkicker { color: var(--brass); font-size: calc(max(13.8px, calc(var(--u) * .828)) * var(--ts-menus)); letter-spacing: .3em; }
:is(body.l-dual.lower, body.ds) .docklist .mtitle { padding: 0; font-family: var(--display-font); font-weight: 600; font-size: calc(var(--u) * 2.0175 * var(--ts-menus)); line-height: 1.2; color: #f0e2bd; letter-spacing: .02em; }
:is(body.l-dual.lower, body.ds) .docklist .mscroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
:is(body.l-dual.lower, body.ds) .docklist .mitems { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: calc(var(--u) * .45);
  padding: 2px 0; }
:is(body.l-dual.lower, body.ds) .docklist .item { flex: none; display: flex; align-items: center; min-height: calc(var(--tap) * 1.3); padding: calc(var(--u) * .35) calc(var(--u) * 1) calc(var(--u) * .35) calc(var(--u) * 4.035 * max(1, var(--ts-menus)));
  font-size: calc(var(--u) * 1.547 * var(--ts-menus)); line-height: 1.25; color: var(--bone); background: var(--panel); border: 1px solid rgba(200,160,74,.55); box-shadow: 0 2px 12px rgba(0,0,0,.5);
  clip-path: polygon(calc(var(--chamfer) * .6) 0, 100% 0, 100% calc(100% - calc(var(--chamfer) * .6)), calc(100% - calc(var(--chamfer) * .6)) 100%, 0 100%, 0 calc(var(--chamfer) * .6)); }
:is(body.l-dual.lower, body.ds) .docklist .item.seen { color: #a39a88; border-color: rgba(200,160,74,.3); }
:is(body.l-dual.lower, body.ds) .docklist .item:active { filter: brightness(1.35); }
:is(body.l-dual.lower, body.ds) .docklist .item .new { left: calc(var(--u) * .7); font-size: calc(max(13.8px, calc(var(--u) * .713)) * var(--ts-menus)); }
:is(body.l-dual.lower, body.ds) .docklist .item .tick { left: calc(var(--u) * 1.1); }
:is(body.l-dual.lower, body.ds)[data-input=pad] .docklist .item.sel, :is(body.l-dual.lower, body.ds)[data-input=kbd] .docklist .item.sel { border-color: var(--brass);
  background: linear-gradient(180deg, rgba(200,160,74,.22), rgba(200,160,74,.06)), var(--panel); color: #f0e2bd; }
:is(body.l-dual.lower, body.ds) .docklist .back { flex: none; position: static; margin: 0; min-height: calc(var(--tap) * 1.1); display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--u) * 1.2105 * var(--ts-menus)); color: var(--bone); background: rgba(9,11,12,.85); border: 1px solid rgba(230,219,195,.3); }
:is(body.l-dual.lower, body.ds) .docklist .back:active { filter: brightness(1.35); }
/* the top bar (Auto, Skip, History, Court Record, Menu) sits in the middle of the top row; in cross-examination Press and
   Present are tabs either side of it, as on the DS, with a big ◀ and ▶ under them */
:is(body.l-dual.lower, body.ds) #tbar.docked { justify-content: center; align-self: center; }   /* (only as wide as its buttons: the tabs beside it take their taps) */
:is(body.l-dual.lower, body.ds) #tbar .pill { width: var(--pillw); padding: 0; justify-content: center; }
/* the bar's width: two pills (Auto, Skip: as wide as the design, or as their words at a large Fonts size), three rounds, the gaps */
/* (the row is never wider than the panel: past that the pills' words stop growing) */
:is(body.l-dual.lower, body.ds) #hud { --pillw: clamp(calc(var(--u) * 4.1), calc(max(13.8px, calc(var(--u) * 0.897)) * var(--ts-buttons) * 3.8 + var(--u) * .7),
    calc((var(--dw) - var(--tap) * 3 - var(--u) * .35 * 4 - var(--gut) * 2) / 2));
  --tbw: calc(var(--pillw) * 2 + var(--tap) * 3 + var(--u) * .35 * 4); }
:is(body.l-dual.lower, body.ds) #tbar .pill { font-size: min(calc(max(13.8px, calc(var(--u) * 0.897)) * var(--ts-buttons)), calc((var(--pillw) - var(--u) * .7) / 3.8)); }
:is(body.l-dual.lower, body.ds) #cebtns { position: static; }
:is(body.l-dual.lower, body.ds) #cebtns.on { order: 2; flex: 1 1 auto; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: calc(var(--u) * 1.3);
  padding: calc(var(--u) * .8) 0 calc(var(--u) * 1.2); }
:is(body.l-dual.lower, body.ds) #cebtns .btn svg { display: none; }
:is(body.l-dual.lower, body.ds) #cebtns [data-a=press], :is(body.l-dual.lower, body.ds) #cebtns [data-a=present] { position: absolute; top: var(--gut); height: var(--tap); min-height: 0; width: auto;
  font-size: calc(var(--u) * 1.614 * var(--ts-buttons)); padding: 0 calc(var(--u) * .7); white-space: nowrap; }
:is(body.l-dual.lower, body.ds) #cebtns [data-a=press] { left: var(--gut); right: calc(50% + var(--tbw) / 2 + 6px); justify-content: flex-start;
  clip-path: polygon(0 0, 100% 0, calc(100% - .9em) 100%, 0 100%); }
:is(body.l-dual.lower, body.ds) #cebtns [data-a=present] { right: var(--gut); left: calc(50% + var(--tbw) / 2 + 6px); justify-content: flex-end;
  clip-path: polygon(0 0, 100% 0, 100% 100%, .9em 100%); }
:is(body.l-dual.lower, body.ds) #cebtns [data-a=press] .kh { margin-left: 6px; } :is(body.l-dual.lower, body.ds) #cebtns [data-a=present] .kh { margin-left: 6px; }
:is(body.l-dual.lower, body.ds) #cebtns [data-a=prev], :is(body.l-dual.lower, body.ds) #cebtns [data-a=next] { grid-row: 1; height: auto; font-size: 0; }
:is(body.l-dual.lower, body.ds) #cebtns [data-a=prev] { grid-column: 1; } :is(body.l-dual.lower, body.ds) #cebtns [data-a=next] { grid-column: 2; }
:is(body.l-dual.lower, body.ds) #cebtns .btn.sq::before { content: ''; width: calc(var(--u) * 3.2); height: calc(var(--u) * 3.7); background: var(--bone); clip-path: polygon(0 0, 100% 50%, 0 100%); }
:is(body.l-dual.lower, body.ds) #cebtns .btn.sq[data-a=prev]::before { clip-path: polygon(100% 0, 0 50%, 100% 100%); }   /* (.btn.sq: outranks the rule above) */
:is(body.l-dual.lower, body.ds) #cebtns [data-a=prev].first::before { visibility: hidden; }   /* nothing before the first statement, as on the DS */
:is(body.l-dual.lower, body.ds) #cebtns .btn:active { filter: brightness(1.35); }
/* a panel narrower than the Thor's (a phone): no room for the tabs beside the bar, so they are a row under it
   (body.touch.ds: as specific as the rules above, which it follows) */
@container dock (max-width: 480px) {
  body.touch.ds #cebtns [data-a=press] { top: calc(var(--gut) * 2 + var(--tap)); left: var(--gut); right: calc(50% + var(--gut) / 2); }
  body.touch.ds #cebtns [data-a=present] { top: calc(var(--gut) * 2 + var(--tap)); left: calc(50% + var(--gut) / 2); right: var(--gut); }
  body.touch.ds #cebtns.on { padding-top: calc(var(--tap) + var(--gut) + var(--u) * .6); }
}

/* the Court Record: the exhibit, its name and its description on the top screen; the whole lower screen is the grid's
   pages (big squares, their tracks set by record.js), the page arrows and Present */
body.l-dual.lower .fullpanel.record { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "head" "prompt" "tabs" "grid" "pager" "actions"; }
body.l-dual.lower .fullpanel.record .detail { display: none; }
body.l-dual.lower .fullpanel .grid { height: auto; border-top: 0; border-right: 0; }
/* pointing: the prompt and the buttons (the exhibit is on the top screen) */
body.l-dual.lower .fullpanel.pointing .pointhint { font-size: calc(var(--u) * 1.412 * var(--ts-record)); padding: 12px 14px; }
body.l-dual.lower .fullpanel.pointing .pointbar { margin-top: auto; }
body.l-dual.lower .fullpanel.pointing .pointbar::before { content: 'Tap the spot on the top screen, or aim with the d-pad.'; flex: 1 0 100%; font-size: calc(var(--u) * 1.2105 * var(--ts-record)); color: var(--bone-dim); font-style: italic; }
body.l-dual.lower .fullpanel.pointing .pointbar { flex-wrap: wrap; }
/* a menu or question over the panel: the panel behind it dims (the panel is the whole screen here), the menu is solid */
body.l-dual.lower #overlay:has(> .modal) { background: rgba(3,4,5,.74); pointer-events: auto; }   /* and taps beside it do nothing */
body.l-dual.lower .modal { background: #0d1011; }
body.l-dual.lower .menu .item .new { font-size: calc(13.8px * var(--ts-menus)); }
body.l-dual.lower .fullpanel { background: #08090a; }        /* the panel is the whole screen: nothing shows through */
body.l-dual.lower .slot img:not([src]) { visibility: hidden; }  /* an empty slot has no picture (not a broken-image box) */
