/* The picture palace: the 1930s layer over app.css's silver palette. Didone capitals for titles and figures,
   letterspaced condensed capitals for section labels (a cinema programme), Art Deco title cards with stepped
   corners, a sunburst behind Bubs, thick-and-thin rules, diamonds for marks, square-cut controls, and an iris
   between sections as 1930s cartoons cut. Layout, words and behaviour are app.css's. */

@font-face { font-family: "Bodoni Moda"; src: url("fonts/bodonimoda-latin.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url("fonts/bodonimoda-italic-latin.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --rays: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22300%22%20height%3D%22300%22%20viewBox%3D%22-150%20-150%20300%20300%22%3E%3Cpath%20d%3D%22M0%200L149.9%20-5.2L149.9%205.2ZM0%200L148.0%2024.1L146.0%2034.4ZM0%200L140.5%2052.5L136.5%2062.2ZM0%200L127.6%2078.9L121.7%2087.6ZM0%200L109.7%20102.3L102.3%20109.7ZM0%200L87.6%20121.7L78.9%20127.6ZM0%200L62.2%20136.5L52.5%20140.5ZM0%200L34.4%20146.0L24.1%20148.0ZM0%200L5.2%20149.9L-5.2%20149.9ZM0%200L-24.1%20148.0L-34.4%20146.0ZM0%200L-52.5%20140.5L-62.2%20136.5ZM0%200L-78.9%20127.6L-87.6%20121.7ZM0%200L-102.3%20109.7L-109.7%20102.3ZM0%200L-121.7%2087.6L-127.6%2078.9ZM0%200L-136.5%2062.2L-140.5%2052.5ZM0%200L-146.0%2034.4L-148.0%2024.1ZM0%200L-149.9%205.2L-149.9%20-5.2ZM0%200L-148.0%20-24.1L-146.0%20-34.4ZM0%200L-140.5%20-52.5L-136.5%20-62.2ZM0%200L-127.6%20-78.9L-121.7%20-87.6ZM0%200L-109.7%20-102.3L-102.3%20-109.7ZM0%200L-87.6%20-121.7L-78.9%20-127.6ZM0%200L-62.2%20-136.5L-52.5%20-140.5ZM0%200L-34.4%20-146.0L-24.1%20-148.0ZM0%200L-5.2%20-149.9L5.2%20-149.9ZM0%200L24.1%20-148.0L34.4%20-146.0ZM0%200L52.5%20-140.5L62.2%20-136.5ZM0%200L78.9%20-127.6L87.6%20-121.7ZM0%200L102.3%20-109.7L109.7%20-102.3ZM0%200L121.7%20-87.6L127.6%20-78.9ZM0%200L136.5%20-62.2L140.5%20-52.5ZM0%200L146.0%20-34.4L148.0%20-24.1Z%22%20fill%3D%22rgba(22%2C23%2C26%2C0.075)%22%2F%3E%3C%2Fsvg%3E");
  --vignette: rgb(22 23 26 / .07);
  /* A thick rule over a thin one (a Scotch rule), under headings. */
  --scotch: linear-gradient(var(--text), var(--text)) left bottom / 100% 1px no-repeat, linear-gradient(var(--text), var(--text)) left calc(100% - 5px) / 100% 3px no-repeat;
  --scotch-top: linear-gradient(var(--text), var(--text)) left top / 100% 3px no-repeat, linear-gradient(var(--text), var(--text)) left 6px / 100% 1px no-repeat;
  --cut: 18px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rays: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22300%22%20height%3D%22300%22%20viewBox%3D%22-150%20-150%20300%20300%22%3E%3Cpath%20d%3D%22M0%200L149.9%20-5.2L149.9%205.2ZM0%200L148.0%2024.1L146.0%2034.4ZM0%200L140.5%2052.5L136.5%2062.2ZM0%200L127.6%2078.9L121.7%2087.6ZM0%200L109.7%20102.3L102.3%20109.7ZM0%200L87.6%20121.7L78.9%20127.6ZM0%200L62.2%20136.5L52.5%20140.5ZM0%200L34.4%20146.0L24.1%20148.0ZM0%200L5.2%20149.9L-5.2%20149.9ZM0%200L-24.1%20148.0L-34.4%20146.0ZM0%200L-52.5%20140.5L-62.2%20136.5ZM0%200L-78.9%20127.6L-87.6%20121.7ZM0%200L-102.3%20109.7L-109.7%20102.3ZM0%200L-121.7%2087.6L-127.6%2078.9ZM0%200L-136.5%2062.2L-140.5%2052.5ZM0%200L-146.0%2034.4L-148.0%2024.1ZM0%200L-149.9%205.2L-149.9%20-5.2ZM0%200L-148.0%20-24.1L-146.0%20-34.4ZM0%200L-140.5%20-52.5L-136.5%20-62.2ZM0%200L-127.6%20-78.9L-121.7%20-87.6ZM0%200L-109.7%20-102.3L-102.3%20-109.7ZM0%200L-87.6%20-121.7L-78.9%20-127.6ZM0%200L-62.2%20-136.5L-52.5%20-140.5ZM0%200L-34.4%20-146.0L-24.1%20-148.0ZM0%200L-5.2%20-149.9L5.2%20-149.9ZM0%200L24.1%20-148.0L34.4%20-146.0ZM0%200L52.5%20-140.5L62.2%20-136.5ZM0%200L78.9%20-127.6L87.6%20-121.7ZM0%200L102.3%20-109.7L109.7%20-102.3ZM0%200L121.7%20-87.6L127.6%20-78.9ZM0%200L136.5%20-62.2L140.5%20-52.5ZM0%200L146.0%20-34.4L148.0%20-24.1Z%22%20fill%3D%22rgba(236%2C236%2C234%2C0.06)%22%2F%3E%3C%2Fsvg%3E"); --vignette: rgb(0 0 0 / .5); } }
:root[data-theme="dark"] { --rays: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22300%22%20height%3D%22300%22%20viewBox%3D%22-150%20-150%20300%20300%22%3E%3Cpath%20d%3D%22M0%200L149.9%20-5.2L149.9%205.2ZM0%200L148.0%2024.1L146.0%2034.4ZM0%200L140.5%2052.5L136.5%2062.2ZM0%200L127.6%2078.9L121.7%2087.6ZM0%200L109.7%20102.3L102.3%20109.7ZM0%200L87.6%20121.7L78.9%20127.6ZM0%200L62.2%20136.5L52.5%20140.5ZM0%200L34.4%20146.0L24.1%20148.0ZM0%200L5.2%20149.9L-5.2%20149.9ZM0%200L-24.1%20148.0L-34.4%20146.0ZM0%200L-52.5%20140.5L-62.2%20136.5ZM0%200L-78.9%20127.6L-87.6%20121.7ZM0%200L-102.3%20109.7L-109.7%20102.3ZM0%200L-121.7%2087.6L-127.6%2078.9ZM0%200L-136.5%2062.2L-140.5%2052.5ZM0%200L-146.0%2034.4L-148.0%2024.1ZM0%200L-149.9%205.2L-149.9%20-5.2ZM0%200L-148.0%20-24.1L-146.0%20-34.4ZM0%200L-140.5%20-52.5L-136.5%20-62.2ZM0%200L-127.6%20-78.9L-121.7%20-87.6ZM0%200L-109.7%20-102.3L-102.3%20-109.7ZM0%200L-87.6%20-121.7L-78.9%20-127.6ZM0%200L-62.2%20-136.5L-52.5%20-140.5ZM0%200L-34.4%20-146.0L-24.1%20-148.0ZM0%200L-5.2%20-149.9L5.2%20-149.9ZM0%200L24.1%20-148.0L34.4%20-146.0ZM0%200L52.5%20-140.5L62.2%20-136.5ZM0%200L78.9%20-127.6L87.6%20-121.7ZM0%200L102.3%20-109.7L109.7%20-102.3ZM0%200L121.7%20-87.6L127.6%20-78.9ZM0%200L136.5%20-62.2L140.5%20-52.5ZM0%200L146.0%20-34.4L148.0%20-24.1Z%22%20fill%3D%22rgba(236%2C236%2C234%2C0.06)%22%2F%3E%3C%2Fsvg%3E"); --vignette: rgb(0 0 0 / .5); }

/* ---------- film: a soft vignette and grain, only on the title moments ---------- */
/* Sign-in and setup's opening and finished cards are the show; the dashboard and setup's steps are work,
   so nothing dims their edges or lies over their figures. */
:root:is(:has(.door), :has(.cfg-main > .stage)) body::before { content: ""; position: fixed; inset: 0; z-index: 89; pointer-events: none; background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 62%, var(--vignette) 100%); }
:root:not(:has(.door)):not(:has(.cfg-main > .stage)) body::after { display: none; }

/* ---------- type: titles and figures in Didone capitals ---------- */
.page-head h1, .caption, .step-title h1, .config-name h2, .empty h2, .help-head h2, .brand-word { font-family: var(--serif); font-weight: 800; letter-spacing: .015em; }
.page-head h1 { font-size: clamp(40px, 4.4vw, 62px); line-height: 1; }
.caption { font-size: clamp(36px, 3.7vw, 56px); line-height: 1.04; letter-spacing: 0; text-wrap: balance; }
.cfg-title { font-size: clamp(38px, 4.2vw, 60px); line-height: 1.08; }
.door .caption { font-size: clamp(34px, 4.4vw, 56px); }
.step-title h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; }
.config-name h2 { font-size: 34px; line-height: 1; }
.empty h2 { font-size: 24px; }
.help-head h2 { font-size: 22px; }
.brand-word { font-size: 24px; letter-spacing: .005em; }
/* The name is always BttrSubs, never re-cased; in the wordmark "Bttr" is gold (butter, and better).
   Butter on dark grounds; a deeper gold (#8C6210, 4.5:1 or more) on light ones. */
:root { --gold-ink: #8C6210; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gold-ink: #E6B43A; } }
:root[data-theme="dark"] { --gold-ink: #E6B43A; }
.brand-word { text-transform: none; }
.brand-word .bw-gold { color: var(--gold-ink); }
.side .brand-word .bw-gold { color: #E6B43A; }

.it-sub { font-family: var(--serif); font-style: italic; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: clamp(24px, 2.4vw, 32px); }
.ledger dd, .readout-item .big, .figs dd, .meter-top b, .err .when b { font-family: var(--serif); font-weight: 700; letter-spacing: 0; font-variant-numeric: lining-nums proportional-nums; font-optical-sizing: none; font-variation-settings: "opsz" 11; }
.ledger dd { font-size: 42px; line-height: 1; }
.readout-item .big { font-size: 42px; line-height: 1; }
.figs dd { font-size: 32px; line-height: 1; }
.meter-top b { font-size: 24px; }
.err .when b { font-size: 26px; }

/* ---------- section labels: letterspaced condensed capitals, a diamond before, a Scotch rule under ---------- */
.block-head h2, .group-head h2, .set-group > h2, .chart h3, .features h2, .cfg-group, .log-day, .drawer-kind { font-family: var(--display); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.block-head h2, .group-head h2, .set-group > h2 { font-size: 20px; }
.chart h3, .features h2, .drawer-kind { font-size: 17px; }
.cfg-group { font-size: 19px; }
.log-day { font-size: 16px; }
.block-head h2::before, .group-head h2::before, .set-group > h2::before, .cfg-group::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 12px 0 1px; background: currentColor; transform: rotate(45deg); vertical-align: .22em; }
/* The Scotch rule marks only a page's main sections and setup's title; lesser heads and dividers take one
   thin rule, so a page doesn't read as stripes. */
.block-head, .step-head { border-bottom: 0; background: var(--scotch); padding-bottom: 18px; }
.group-head, .set-group > h2, .log-day { border-bottom: 1.5px solid var(--text); padding-bottom: 14px; }
.demo, .foot { border-top: 0; background: var(--scotch-top); padding-top: 30px; }
.config, .err:first-child, .review, .step-nav { border-top: 1.5px solid var(--text); padding-top: 26px; }
.ledger dt, .readout-item h3, .figs dt, thead th, .log-cols span, .side-label, .player p { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; }

/* ---------- the title card: Art Deco cut corners, a stepped double frame, a faint flicker like old stock ---------- */
.intertitle { border-radius: 0; clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)); }
.intertitle::before { inset: 10px; border: 40px solid transparent; border-radius: 0; border-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20stroke%3D%22%23F8F8F6%22%3E%20%3Cpath%20d%3D%22M40%206H80M40%20114H80M6%2040V80M114%2040V80%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%221.5%22%2F%3E%20%3Cpath%20d%3D%22M40%2011H80M40%20109H80M11%2040V80M109%2040V80%22%20stroke-opacity%3D%22.3%22%2F%3E%20%3Cg%3E%3Cpath%20d%3D%22M40%206H20V20H6V40%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M40%2011H25V25H11V40%22%20stroke-opacity%3D%22.3%22%2F%3E%3Cpath%20d%3D%22M13%209.5L16.5%2013L13%2016.5L9.5%2013Z%22%20fill%3D%22%23F8F8F6%22%20fill-opacity%3D%22.7%22%20stroke%3D%22none%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(120%200)%20scale(-1%201)%22%3E%3Cpath%20d%3D%22M40%206H20V20H6V40%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M40%2011H25V25H11V40%22%20stroke-opacity%3D%22.3%22%2F%3E%3Cpath%20d%3D%22M13%209.5L16.5%2013L13%2016.5L9.5%2013Z%22%20fill%3D%22%23F8F8F6%22%20fill-opacity%3D%22.7%22%20stroke%3D%22none%22%2F%3E%3C%2Fg%3E%20%3Cg%20transform%3D%22translate(0%20120)%20scale(1%20-1)%22%3E%3Cpath%20d%3D%22M40%206H20V20H6V40%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M40%2011H25V25H11V40%22%20stroke-opacity%3D%22.3%22%2F%3E%3Cpath%20d%3D%22M13%209.5L16.5%2013L13%2016.5L9.5%2013Z%22%20fill%3D%22%23F8F8F6%22%20fill-opacity%3D%22.7%22%20stroke%3D%22none%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(120%20120)%20scale(-1%20-1)%22%3E%3Cpath%20d%3D%22M40%206H20V20H6V40%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M40%2011H25V25H11V40%22%20stroke-opacity%3D%22.3%22%2F%3E%3Cpath%20d%3D%22M13%209.5L16.5%2013L13%2016.5L9.5%2013Z%22%20fill%3D%22%23F8F8F6%22%20fill-opacity%3D%22.7%22%20stroke%3D%22none%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 40 stretch; }
/* The card's light flickers faintly, as old film stock did: a 3.5% white wash in three brief flashes every
   4.2 s, far under any flash threshold. Reduced motion stops it. */
.intertitle::after { inset: 0; border: 0; border-radius: 0; background: rgb(255 255 255 / .035); opacity: 0; animation: flicker 4.2s steps(1) infinite; }
@keyframes flicker { 0%, 100% { opacity: 0; } 6% { opacity: 1; } 7% { opacity: 0; } 41% { opacity: .6; } 42% { opacity: 0; } 73% { opacity: .9; } 74% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html:not(.moving) .intertitle::after { animation: none; } }
html.calm .intertitle::after { animation: none; }
.caption::after { width: 140px; height: 16px; border-radius: 0; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22140%22%20height%3D%2216%22%20viewBox%3D%220%200%20140%2016%22%20fill%3D%22none%22%20stroke%3D%22%23E6B43A%22%3E%20%3Cpath%20d%3D%22M0%208H56M84%208H140%22%20stroke-width%3D%222%22%2F%3E%3Cpath%20d%3D%22M70%201.5L76.5%208L70%2014.5L63.5%208Z%22%20stroke-width%3D%221.3%22%2F%3E%20%3Cpath%20d%3D%22M70%204.5L73.5%208L70%2011.5L66.5%208Z%22%20fill%3D%22%23E6B43A%22%20stroke%3D%22none%22%2F%3E%3C%2Fsvg%3E") left center / contain no-repeat; margin-top: 22px; }
.level-bad .caption::after { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22140%22%20height%3D%2216%22%20viewBox%3D%220%200%20140%2016%22%20fill%3D%22none%22%20stroke%3D%22%23F8F8F6%22%3E%20%3Cpath%20d%3D%22M0%208H56M84%208H140%22%20stroke-width%3D%222%22%2F%3E%3Cpath%20d%3D%22M70%201.5L76.5%208L70%2014.5L63.5%208Z%22%20stroke-width%3D%221.3%22%2F%3E%20%3Cpath%20d%3D%22M70%204.5L73.5%208L70%2011.5L66.5%208Z%22%20fill%3D%22%23F8F8F6%22%20stroke%3D%22none%22%2F%3E%3C%2Fsvg%3E") left center / contain no-repeat; }
.player, .url-box, .inline-form { border-radius: 2px; }

/* ---------- a sunburst behind Bubs, as cartoon openings had ---------- */
#bubs-host::before { content: ""; position: absolute; z-index: -1; left: -14%; right: -14%; top: 50%; aspect-ratio: 1; translate: 0 -54%; pointer-events: none;
  background: var(--rays) center / 100% 100% no-repeat;
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 100%); mask: radial-gradient(closest-side, #000 18%, transparent 100%); }
.door { position: relative; }
.door::before { content: ""; position: absolute; left: -50px; bottom: -30px; width: 400px; aspect-ratio: 1; pointer-events: none;
  background: var(--rays) center / 100% 100% no-repeat;
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 100%); mask: radial-gradient(closest-side, #000 18%, transparent 100%); }

/* ---------- marks and controls: diamonds for ornament, lamps for status, square cuts instead of round pills ---------- */
/* Diamonds are ornament only (headings, the title rule, the sidebar's pointer). Status is a lamp, as on a projection
   booth's panel: hollow for quiet or worth a look, solid red for wrong; "fine" shows no mark, its words say it. */
.dot, .err-dot { border-radius: 50%; transform: none; }
.dot { width: 8px; height: 8px; }
.dot:not(.warn):not(.bad):not(.quiet) { display: none; }
.tab-marker::before { border-radius: 0; transform: rotate(45deg); }
.btn { border-radius: 3px; }
.btn.small { border-radius: 3px; }
.btn.big { border-radius: 3px; }
.field, .select { border-radius: 3px; }
.seg, .cfg-page .tabs.cfg-steps { border-radius: 3px; }
.seg button { border-radius: 2px; }
.chip, .chip-toggle, .tag, .status-pill, .unsaved, kbd, .err-raw code { border-radius: 2px; }
.switch { border-radius: 3px; }
.switch::after { border-radius: 2px; }
.tube, .tube > i { border-radius: 1px; }
.stick i { border-radius: 1px 1px 0 0; }
.drawer, .help-dialog, .cfg-dialog, .savebar, .toast, .info-pop, .src-chip img, .src img, .src-ic, .err-src img { border-radius: 3px; }
.tab, .tab-marker, .side .side-link, .text-btn, .icon-btn, .info-btn, .skip, .brand, .picks li, .cfg-steps .step-num, :focus-visible { border-radius: 3px; }
/* Buttons, the sidebar and choices keep normal case: capitals are for titles, section labels and table heads. */

/* ---------- motion: an iris on the content between sections and setup steps; the full iris at sign-in ---------- */
/* Sections and setup steps cut as 1930s cartoons did, with an iris, but on the content only: the sidebar (on
   phones the top bar and the dock) is its own still layer. Like a camera's shutter, the circle closes to film
   black on the old view (0.24 s), then opens from black on the new one (0.34 s), so the two never overlap. The iris
   works on the screen as it is (the page's own snapshot is the viewport), centred on the content column, and
   its radius reaches the content's farthest corner at every width. */
/* The content has no layer of its own (app.css gives it a cross-fade): it irises with the screen. */
main { view-transition-name: none; }
:root { --iris-x: calc(50% + 126px); }
@media (max-width: 860px) { :root { --iris-x: 50%; } }
/* A name makes the sidebar a stacking layer of its own; on phones it holds the fixed dock, so the layer sits at
   the dock's own level (50: over the page, under the scrim and the detail sheet) and the dock stays on top. */
.side { view-transition-name: side; }
@media (max-width: 860px) { .side { position: relative; z-index: 50; } .tabs { view-transition-name: dock; } }
::view-transition { background: #0B0C0E; }
::view-transition-group(side), ::view-transition-group(dock), ::view-transition-new(side), ::view-transition-new(dock) { animation: none; }
::view-transition-old(side), ::view-transition-old(dock) { display: none; }
::view-transition-group(root) { animation: none; }
::view-transition-old(root) { animation: iris-close .24s cubic-bezier(.6, 0, .9, .4) both; }
::view-transition-new(root) { animation: iris-open .34s .24s cubic-bezier(.2, .6, .3, 1) both; }
@keyframes iris-close { from { clip-path: circle(max(62vw, 78vh) at var(--iris-x) 45%); } to { clip-path: circle(0px at var(--iris-x) 45%); } }
@keyframes iris-open { from { clip-path: circle(0px at var(--iris-x) 45%); } to { clip-path: circle(max(62vw, 78vh) at var(--iris-x) 45%); } }
/* The section mark moves at once, so the new view arrives with it already in place. */
.tab-marker { transition: none; }
@keyframes iris-in { from { clip-path: circle(0% at 50% 42%); } to { clip-path: circle(150% at 50% 42%); } }
@keyframes iris-out { to { clip-path: circle(0% at 50% 45%); } }
html.iris-in body { animation: iris-in .8s cubic-bezier(.5, 0, .2, 1) both; }
html.iris-out { background: #0B0C0E; }
html.iris-out body { animation: iris-out .7s cubic-bezier(.7, 0, .8, .3) forwards; }

/* ---------- the usher (usher.js): a tip of the cap, a nod, and his torch lighting the start button ---------- */
.bubs-poke.tip .bubs-cap-lift { animation: cap-tip .95s cubic-bezier(.3, .7, .3, 1); transform-box: fill-box; transform-origin: 20% 100%; }
@keyframes cap-tip { 35% { transform: translate(-6px, -18px) rotate(-24deg); } 65% { transform: translate(-4px, -14px) rotate(-20deg); } }
.bubs-poke.tip .bubs-upper { animation: usher-nod .95s cubic-bezier(.3, .7, .3, 1); transform-origin: 200px 266px; }
@keyframes usher-nod { 35% { transform: rotate(3deg) translateY(5px); } }
.usher-beam { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 84; animation: usher-beam 1.9s ease both; }
@keyframes usher-beam { 0% { opacity: 0; } 16%, 72% { opacity: 1; } 100% { opacity: 0; } }
/* The lit button: a crisp gold ring a few pixels out, no blur. */
.spotlit { outline: 3px solid transparent; outline-offset: 2px; animation: spotlit 1.9s ease both; }
@keyframes spotlit { 20%, 72% { outline-color: #E6B43A; outline-offset: 6px; } }
@media (prefers-reduced-motion: reduce) { html:not(.moving) .spotlit { animation: none; outline-color: #E6B43A; outline-offset: 6px; } }
html.calm .spotlit { animation: none; outline-color: #E6B43A; outline-offset: 6px; }

/* ---------- badges, tags and help notes ---------- */
/* The Errors badge: ink on the red in dark, where white text on it falls under 4.5:1. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge { color: #16171A; } }
:root[data-theme="dark"] .badge { color: #16171A; }
/* "Set here" is a filled ink tag; butter is for synced, today, now and the main action. Unsaved stays outlined. */
.tag.here { background: var(--text); color: var(--paper); border-color: var(--text); }
/* Help notes in dark: a raised surface with an edge, so they separate from the page. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .info-pop { background: #24262A; box-shadow: var(--float), 0 0 0 1px rgb(236 236 234 / .16); } }
:root[data-theme="dark"] .info-pop { background: #24262A; box-shadow: var(--float), 0 0 0 1px rgb(236 236 234 / .16); }
/* Between 861 and 1180 px the card is narrow: a smaller headline that always fits, and room for the frame. */
@media (max-width: 1180px) and (min-width: 861px) {
  .caption { font-size: clamp(28px, 3.1vw, 44px); }
  .intertitle { padding-top: 44px; padding-right: 46px; padding-bottom: 44px; }
  /* Setup's cards stack here, as on phones: beside the sidebar there is no room for Bubs and the card side by side. */
  .cfg-main > .stage { grid-template-columns: 1fr; }
  .cfg-main > .stage #bubs-host { width: 170px; margin: 0 0 -8px 12px; }
  .cfg-main > .stage .intertitle { padding: 44px 46px; }
}

/* ---------- type sizes, charts and the finished card ---------- */
/* Didone titles at a text optical size: at the display size the browser picks for 34 to 62 px, the hairlines
   render as 1 px of 1.3:1 grey and letters break up (an N reads as I\). Calibration (1x and 2x renders of the
   real titles, 34 to 62 px): opsz 14 keeps every hairline at 1x (at 18 an N's strokes still fray at 46 px), opsz 24
   at 2x and up, and both stay high-contrast Didone. */
.page-head h1, .caption, .step-title h1, .config-name h2, .empty h2, .cfg-title { font-optical-sizing: none; font-variation-settings: "opsz" 14; }
@media (min-resolution: 2dppx) { .page-head h1, .caption, .step-title h1, .config-name h2, .empty h2, .cfg-title { font-variation-settings: "opsz" 24; } }
/* Section titles: one size step down, so the figures under them lead. */
.page-head h1 { font-size: clamp(38px, 3.4vw, 48px); }
/* The day charts' bars at 3:1 or more against the page, like any other mark that carries a value. */
:root { --stick: #84878C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --stick: #64676D; } }
:root[data-theme="dark"] { --stick: #64676D; }
.stick i { background: var(--stick); }
/* The week's ledger on wide screens: a dotted leader runs from each label to its figure, as in a programme. */
@media (min-width: 861px) {
  .ledger .row { grid-template-areas: "label value" "note note" "meter meter"; align-items: baseline; }
  .ledger dd { align-self: baseline; }
  .ledger dt { display: flex; align-items: baseline; gap: 14px; }
  .ledger dt::after { content: ""; flex: 1; min-width: 24px; border-bottom: 2px dotted var(--rule-strong); }
}
/* A source's logo sits on its white tile everywhere, the detail sheet included. */
.picks li img { background: #fff; box-shadow: 0 0 0 1px var(--rule-strong); border-radius: 3px; }
/* Setup's finished card: the three steps are numbered in ink Didone; butter is never text on paper. */
.after li::before { color: var(--text); -webkit-text-stroke: 0; font-family: var(--serif); font-weight: 700; font-optical-sizing: none; font-variation-settings: "opsz" 11; }
/* The player picture on setup's intro: a menu as your player shows it, a tick on the chosen track and
   no radio buttons, so nothing in it looks like it can be pressed. */
.player { cursor: default; user-select: none; }
.player span { grid-template-columns: 1fr auto; }
.player i { display: none; }
.player span.ic { display: block; padding: 0; width: 18px; height: 18px; }
/* The usher's torch: outside the card it lights the page; inside, it lights the card behind its words. */
.usher-beam-in { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; animation: usher-beam 1.9s ease both; }
.cfg-main .intertitle > :not(.usher-beam-in) { position: relative; z-index: 1; }
/* Sign out asks once more: the first press says "Sign out?" in words, the second signs out. */
/* The sidebar and the phone top bar are graphite in both themes. */
.signout.confirm { color: #F8F8F6; background: rgb(248 248 246 / .12); white-space: nowrap; }

/* ---------- heads, units, switches and dark mode ---------- */
/* Lesser heads keep the thin rule wherever they sit: Keys' "No calls this week" is a group, not a section. */
.block-head:has(#h-idle) { background: none; border-bottom: 1.5px solid var(--text); padding-bottom: 14px; }
/* Units beside Didone figures read as words, not subscripts ("2 h 10 min"). */
.ledger dd .unit, .readout-item .big .unit { font-size: 15px; margin: 0 7px 0 3px; }
/* Setup's step numbers in Didone figures: a 1 with a flag, never read as an I. */
.cfg-steps .step-num { font-family: var(--serif); font-weight: 700; font-optical-sizing: none; font-variation-settings: "opsz" 11; }
/* A switch that is on looks the same in both themes: a butter track with an ink edge and an ink knob. */
.switch:checked { background: var(--butter); box-shadow: inset 0 0 0 1.5px #16171A; }
.switch:checked::after { background: #16171A; }
/* Activity: the result's mark sits with the result, and the result column has room for its words (the kind
   column holds only List or Download). */
.log-row .res .cue { margin-right: 8px; vertical-align: -3px; }
@media (min-width: 1181px) { .log-row, .log-cols { grid-template-columns: 52px minmax(0, 1fr) 84px minmax(0, 240px) 100px 64px; } }
/* Configuration domains and other small mono at 12.5 px. */
.uses-row .vals .mono { font-size: 12.5px; }
/* Setup's intro: the six perks under one line on phones; wide screens show them open. */
.perks-more > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--rule); font-weight: 650; list-style: none; }
.perks-more > summary::-webkit-details-marker { display: none; }
.perks-more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--text); border-radius: 3px; font-weight: 700; line-height: 1; }
.perks-more[open] > summary::before { content: "−"; }
@media (min-width: 861px) { .perks-more > summary { display: none; } }
/* The shortcuts dialog's two preferences. */
.prefs { margin-top: 18px; border-top: 1.5px solid var(--text); }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.pref label { font-weight: 650; cursor: pointer; }
.pref p { margin: 3px 0 0; color: var(--smoke); font-size: 13px; line-height: 1.45; }
/* Dark: Bubs stands in a soft pool of footlight, so his shoes are on a lit floor, never on bare graphite. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.bubs-spot, .noir-live)::before { left: -10%; right: -10%; bottom: -4%; height: 14%; background: radial-gradient(closest-side, rgb(236 236 234 / .34), rgb(236 236 234 / .12) 55%, rgb(236 236 234 / 0)); } }
:root[data-theme="dark"] :is(.bubs-spot, .noir-live)::before { left: -10%; right: -10%; bottom: -4%; height: 14%; background: radial-gradient(closest-side, rgb(236 236 234 / .34), rgb(236 236 234 / .12) 55%, rgb(236 236 234 / 0)); }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  /* Focus never lands under the dock: anything scrolled to by the keyboard stops 16 px above it. */
  html { scroll-padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
  .signout.confirm span:not(.ic) { display: inline; }
  /* While it asks, the update time steps aside to make room for the words. */
  .side:has(.signout.confirm) .updated { display: none; }
  .door .intertitle { border-radius: 0; }
  /* The save bar: one full-width line just above the dock; help notes stack above it while it shows. */
  .savebar { left: 12px; right: 12px; transform: none; padding: 6px 6px 6px 16px; gap: 6px; }
  .savebar .btn { padding: 0 13px; }
  .savebar-text { flex: 1; min-width: 0; margin-right: 4px; line-height: 1.3; }
  body:has(#savebar:not([hidden])) .info-pop { bottom: calc(env(safe-area-inset-bottom, 0px) + 146px); }
  /* Configurations' figures as a short list with leaders, so no label wraps. */
  .figs { grid-template-columns: 1fr; gap: 0; }
  .figs div { display: flex; align-items: baseline; gap: 12px; padding: 5px 0; }
  .figs dt { order: 1; flex: 1; display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
  .figs dt::after { content: ""; flex: 1; min-width: 16px; border-bottom: 2px dotted var(--rule-strong); }
  .figs dd { order: 2; font-size: 26px; }
  /* Bubs smaller over the verdict, so more of the page is in view. */
  #bubs-host { width: 108px; }
  .badge { font-size: 12px; min-width: 19px; height: 19px; }
  :root { --cut: 12px; }
  .page-head h1 { font-size: 34px; }
  .caption { font-size: 34px; }
  .cfg-title { font-size: 34px; }
  .door .caption { font-size: 34px; }
  .step-title h1 { font-size: 27px; }
  .config-name h2 { font-size: 28px; }
  .brand-word { font-size: 19px; letter-spacing: 0; }
  .ledger dd, .readout-item .big { font-size: 36px; }
  .ledger .row.small dd { font-size: 24px; }
  .intertitle::before, .door .intertitle::before { inset: 6px; border-width: 28px; }
  .intertitle, .cfg-main > .stage .intertitle, .door .intertitle { padding: 34px 30px 30px; }
  .tab, .tab-marker { border-radius: 3px; }
  .block-head h2, .group-head h2, .set-group > h2 { font-size: 18px; letter-spacing: .12em; }
}
