:root{--sm-bg:#fafaf8;--sm-ink:#1c1c1a;--sm-dim:#5f5f5b;--sm-line:#e6e5e1}
@media (prefers-color-scheme:dark){:root{--sm-bg:#19191b;--sm-ink:#e8e8e4;--sm-dim:#a0a09a;--sm-line:#323236}}
.sm-bar.sm-l{--sm-bg:#fafaf8;--sm-ink:#1c1c1a;--sm-dim:#5f5f5b;--sm-line:#e6e5e1}
nav.sm-bar{display:flex;align-items:center;gap:0 24px;flex-wrap:wrap;padding:0 20px;background:var(--sm-bg)!important;color:var(--sm-ink)!important;
border:0;border-bottom:1px solid var(--sm-line);font:500 14px/1.3 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;position:relative;z-index:9999;margin:0;box-shadow:none}
nav.sm-bar a{color:var(--sm-dim)!important;text-decoration:none;display:inline-flex;align-items:center;min-height:48px;background:none;transition:color .18s ease-out}
nav.sm-bar a:hover,nav.sm-bar a:focus-visible{color:var(--sm-ink)!important}
nav.sm-bar .sm-nav a{box-shadow:inset 0 -2px 0 transparent;transition:color .18s ease-out,box-shadow .18s ease-out}
nav.sm-bar .sm-nav a:hover,nav.sm-bar .sm-nav a[aria-current]{box-shadow:inset 0 -2px 0 currentColor}
:root.sm a,:root.sm button,:root.sm input,:root.sm select,:root.sm textarea{transition:color .18s ease-out,background-color .18s ease-out,border-color .18s ease-out,box-shadow .18s ease-out,transform .12s ease-out}
:root.sm button:active,:root.sm .btn:active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition-duration:0s!important;animation-duration:0s!important;animation-iteration-count:1!important}}
.sm-bar a:focus-visible{outline:2px solid var(--sm-ink);outline-offset:3px;border-radius:3px}
nav.sm-bar .sm-brand{color:var(--sm-ink)!important;font-weight:700;font-size:15px;letter-spacing:-.01em;margin-right:auto}
.sm-nav{display:flex;gap:0 18px;flex-wrap:wrap}nav.sm-bar .sm-nav a[aria-current]{color:var(--sm-ink)!important;font-weight:650}
@media (max-width:640px){nav.sm-bar{padding:0 16px 4px}nav.sm-bar .sm-brand{min-height:48px;order:0}nav.sm-bar .sm-region{order:1}nav.sm-bar .sm-share{order:1;margin-left:auto}
.sm-nav{order:2;width:100%;flex-wrap:wrap;gap:0 16px}nav.sm-bar .sm-nav a{white-space:nowrap;min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center}}
:root.sm{--bg:#fafaf8;--card:#fff;--field:#fff;--ink:#1c1c1a;--dim:#5f5f5b;--line:#e6e5e1;--red:#b3261e;--ok:#2a7035;
--paper:#fafaf8;--soft:#6b6b67;--accent:#1c1c1a;--pin:#1c1c1a;--sky:#fafaf8;--chalk:#1c1c1a}
@media (prefers-color-scheme:dark){:root.sm{--bg:#19191b;--card:#212124;--field:#1d1d20;--ink:#e8e8e4;--dim:#a0a09a;--line:#323236;--red:#f08b81;--ok:#6fbf7c;
--paper:#19191b;--soft:#a0a09a;--accent:#e8e8e4;--pin:#e8e8e4;--sky:#19191b;--chalk:#e8e8e4}}
.sm body,.sm h1,.sm h2,.sm h3,.sm .big,.sm .big b,.sm button,.sm input,.sm select,.sm textarea{font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.sm h1,.sm h2,.sm h3{letter-spacing:-.015em}
.sm .eyebrow,.sm .kicker{color:var(--dim);letter-spacing:0;text-transform:none;font-weight:600;font-size:13px}
.sm button.primary,.sm .cta{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.sm input:focus-visible,.sm select:focus-visible,.sm textarea:focus-visible,.sm button:focus-visible,.sm a:focus-visible{outline-color:var(--ink)}
.sm .card{border-radius:10px}

nav.sm-bar .sm-share,nav.sm-bar .sm-region{margin-left:6px;min-height:44px;padding:0 10px;font:600 13px/1 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--sm-ink);background:none;
border:1px solid var(--sm-line);border-radius:999px;cursor:pointer;transition:border-color .18s ease-out}
nav.sm-bar .sm-region:hover,nav.sm-bar .sm-region:focus-visible,nav.sm-bar .sm-share:hover,nav.sm-bar .sm-share:focus-visible{border-color:var(--sm-ink)}
#sm-region-dlg{border:1px solid var(--sm-line);border-radius:12px;padding:0;max-width:min(420px,calc(100vw - 32px));background:var(--sm-bg);color:var(--sm-ink)}
#sm-region-dlg::backdrop{background:rgba(0,0,0,.35)}
.sm-dlg{display:grid;gap:8px;padding:20px;font:15px/1.5 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}.sm-dlg h2{margin:0 0 4px;font-size:18px}
.sm-dlg select{font:inherit;padding:10px;border:1px solid var(--sm-line);border-radius:8px;background:var(--sm-bg);color:var(--sm-ink);min-height:44px}
.sm-dlg p{margin:6px 0 0;color:var(--sm-dim);font-size:14px}.sm-dlg-b{display:flex;gap:10px;justify-content:flex-end;margin-top:8px}
.sm-dlg-b button{min-height:44px;padding:0 16px;font:600 14px ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;border-radius:8px;border:1px solid var(--sm-line);background:none;color:var(--sm-ink);cursor:pointer}
.sm-dlg-b #sm-ok{background:var(--sm-ink);color:var(--sm-bg);border-color:var(--sm-ink)}

:root{--sm-gold:#b9821f;--sm-gold-t:#8a5c0c;--cc:var(--sm-ink);--cc-on:#fff}
@media (prefers-color-scheme:dark){:root{--sm-gold:#e6b65a;--sm-gold-t:#e6b65a;--cc-on:#141416}}
.sm-bar.sm-l{--sm-gold:#b9821f;--sm-gold-t:#8a5c0c;--cc:#1c1c1a}
:root[data-cat=games]{--cc:#6d45c4}:root[data-cat=health]{--cc:#cc3366}:root[data-cat=hobbies]{--cc:#b84c0b}:root[data-cat=money]{--cc:#1e8250}
:root[data-cat=planning]{--cc:#0f7590}:root[data-cat=study]{--cc:#3653d0}:root[data-cat=utilities]{--cc:#946400}
@media (prefers-color-scheme:dark){:root[data-cat=games]{--cc:#b59bf2}:root[data-cat=health]{--cc:#f48aac}:root[data-cat=hobbies]{--cc:#f6a06a}:root[data-cat=money]{--cc:#6fd3a0}
:root[data-cat=planning]{--cc:#5ccde2}:root[data-cat=study]{--cc:#97abf8}:root[data-cat=utilities]{--cc:#e9c05a}}
nav.sm-bar{border-bottom:3px solid var(--cc)}
nav.sm-bar .sm-brand{gap:9px}
nav.sm-bar .sm-brand svg{flex:none;color:var(--sm-gold)}
nav.sm-bar .sm-brand b{color:var(--sm-gold-t);font-weight:800}
nav.sm-bar .sm-brand:hover svg{transform:rotate(45deg)}nav.sm-bar .sm-brand svg{transition:transform .4s cubic-bezier(.34,1.4,.64,1)}
nav.sm-bar .sm-nav a[aria-current]{color:var(--cc)!important}
.sm .eyebrow,.sm .kicker{color:var(--cc)}
.sm[data-cat] button.primary,.sm[data-cat] .cta{background:var(--cc);border-color:var(--cc);color:var(--cc-on)}
.sm[data-cat] input:focus-visible,.sm[data-cat] select:focus-visible,.sm[data-cat] textarea:focus-visible{outline-color:var(--cc)}
@media (max-width:640px){nav.sm-bar .sm-brand{font-size:14px;gap:7px}}
.sm[data-cat] .eyebrow{display:inline-block;padding:4px 11px;border-radius:999px;background:var(--cc);color:var(--cc-on);font-weight:700}
/* 19 Nov audit: white text on the light dark-mode red/green fills was 2.2-2.4:1; use the page colour instead */
@media (prefers-color-scheme:dark){.sm .tabs button[aria-selected=true],.sm button.done{color:var(--bg)}}
:root[data-sm-theme=light],:root[data-sm-theme=light] .sm-bar.sm-l{--sm-bg:#fafaf8;--sm-ink:#1c1c1a;--sm-dim:#6b6b67;--sm-line:#e6e5e1}
:root[data-sm-theme=dark],:root[data-sm-theme=dark] .sm-bar.sm-l{--sm-bg:#19191b;--sm-ink:#e8e8e4;--sm-dim:#a0a09a;--sm-line:#323236}
:root[data-sm-theme=paper],:root[data-sm-theme=paper] .sm-bar.sm-l{--sm-bg:#f7f1e3;--sm-ink:#2a2217;--sm-dim:#5c5040;--sm-line:#ddd0b6;--sm-gold:#9a6a12;--sm-gold-t:#7a520a}
:root[data-sm-theme=night],:root[data-sm-theme=night] .sm-bar.sm-l{--sm-bg:#000;--sm-ink:#f1ede4;--sm-dim:#aaa69c;--sm-line:#2c2c30;--sm-gold:#e6b65a;--sm-gold-t:#e6b65a}
:root[data-sm-theme=contrast],:root[data-sm-theme=contrast] .sm-bar.sm-l{--sm-bg:#fff;--sm-ink:#000;--sm-dim:#2b2b2b;--sm-line:#000;--sm-gold:#000;--sm-gold-t:#000;--cc:#000}
:root.sm[data-sm-theme=paper]{--bg:#f7f1e3;--card:#fffaf0;--field:#fffaf0;--ink:#2a2217;--dim:#5c5040;--line:#ddd0b6;--red:#a3221b;--ok:#2a6e35;--paper:#f7f1e3;--soft:#5c5040;--accent:#2a2217;--pin:#2a2217;--sky:#f7f1e3;--chalk:#2a2217}
:root.sm[data-sm-theme=night]{--bg:#000;--card:#0e0e10;--field:#0a0a0c;--ink:#f1ede4;--dim:#aaa69c;--line:#2c2c30;--red:#ff8f85;--ok:#74cf83;--paper:#000;--soft:#aaa69c;--accent:#f1ede4;--pin:#f1ede4;--sky:#000;--chalk:#f1ede4}
:root.sm[data-sm-theme=contrast]{--bg:#fff;--card:#fff;--field:#fff;--ink:#000;--dim:#2b2b2b;--line:#000;--red:#8b0000;--ok:#0b5a1a;--paper:#fff;--soft:#2b2b2b;--accent:#000;--pin:#000;--sky:#fff;--chalk:#000}

:root[data-sm-theme=paper][data-cat=health]{--cc:#b02a57}:root[data-sm-theme=paper][data-cat=money]{--cc:#17703f}
:root[data-sm-theme=contrast] a{text-decoration-thickness:2px}
:root[data-sm-theme=contrast].sm button,:root[data-sm-theme=contrast].sm input,:root[data-sm-theme=contrast].sm select,:root[data-sm-theme=contrast].sm textarea{border-color:#000}
:root[data-sm-motion=reduce] *,:root[data-sm-motion=reduce] *::before,:root[data-sm-motion=reduce] *::after{transition-duration:0s!important;animation-duration:0s!important;animation-iteration-count:1!important;scroll-behavior:auto!important}
nav.sm-bar .sm-look{margin-left:6px;min-height:44px;min-width:44px;padding:0 10px;font:700 14px/1 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--sm-ink);background:none;border:1px solid var(--sm-line);border-radius:999px;cursor:pointer}
nav.sm-bar .sm-look:hover,nav.sm-bar .sm-look:focus-visible{border-color:var(--sm-ink)}
@media (max-width:640px){nav.sm-bar .sm-look{order:1}}
#sm-look-dlg{border:1px solid var(--sm-line);border-radius:12px;padding:0;max-width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;background:var(--sm-bg);color:var(--sm-ink)}
#sm-look-dlg::backdrop{background:rgba(0,0,0,.35)}
.sm-ths{border:0;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(124px,1fr));gap:8px}.sm-ths legend{padding:0;margin-bottom:6px;font-weight:600}
.sm-th{position:relative;display:flex;align-items:center;gap:8px;min-height:44px;padding:6px 10px;border:1px solid var(--sm-line);border-radius:10px;cursor:pointer;font-size:14px}
.sm-th:has(input:checked){border-color:var(--sm-ink);box-shadow:inset 0 0 0 1px var(--sm-ink)}
.sm-th input{position:absolute;opacity:0;width:1px;height:1px}.sm-th:has(input:focus-visible){outline:2px solid var(--sm-ink);outline-offset:2px}
.sm-sw{flex:none;width:22px;height:22px;border-radius:50%;border:1px solid #777;background:linear-gradient(135deg,#fafaf8 50%,#19191b 50%)}
.sm-th[data-m=light] .sm-sw{background:#fafaf8}.sm-th[data-m=dark] .sm-sw{background:#19191b}.sm-th[data-m=paper] .sm-sw{background:#f7f1e3}
.sm-th[data-m=night] .sm-sw{background:radial-gradient(circle,#e6b65a 0 28%,#000 30%)}.sm-th[data-m=contrast] .sm-sw{background:linear-gradient(135deg,#fff 50%,#000 50%);border-color:#000}
.sm-dlg #sm-look-ok{background:var(--sm-ink);color:var(--sm-bg);border-color:var(--sm-ink)}
.sm-local{max-width:1100px;margin:16px auto;padding:14px 16px;border:1px solid var(--line,#e6e5e1);border-radius:12px;box-sizing:border-box}
.sm-local h2{margin:0 0 8px;font-size:17px}.sm-local ul{list-style:none;margin:0 0 10px;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.sm-local li a{display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border:1px solid var(--line,#e6e5e1);border-radius:999px;color:inherit;text-decoration:none}
.sm-allbtn{min-height:44px;padding:0 14px;font:600 14px ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;border:1px solid var(--line,#e6e5e1);border-radius:8px;background:none;color:inherit;cursor:pointer}
.sm-rtag{display:inline-block;margin-left:6px;padding:1px 7px;font-size:11px;font-weight:700;border:1px solid currentColor;border-radius:999px;vertical-align:middle}

:is(main,header,footer,section,form,dialog,.card,.wrap,.app,body>div) :is(button,select,summary,[role=button],input[type=button],input[type=submit],input[type=reset],input[type=file],input[type=color]):not(.sm-bar *){min-height:44px!important;min-width:44px!important}
:is(main,header,footer,section,form,dialog,.card,.wrap,.app,body>div) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),textarea):not(.sm-bar *){min-height:44px!important}
summary{display:list-item;line-height:44px}
label:has(input[type=checkbox]),label:has(input[type=radio]){min-height:44px!important;display:inline-flex;align-items:center;gap:8px}
input[type=checkbox],input[type=radio]{min-width:22px;min-height:22px}
input[type=range]:not(.sm-bar *){min-height:44px}
:is(input[type=checkbox],input[type=radio]):not(label *){width:44px!important;height:44px!important;margin:0}
a[href]:not(.sm-bar *):not(:is(p,li,small,figcaption,td,dd,dt,blockquote,h1,h2,h3,h4) a){display:inline-flex;align-items:center;min-height:44px;min-width:44px}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
main :is(p,div,li,span,td,pre,output,h2,h3){overflow-wrap:anywhere}

/* Owner bug B3 (22 Nov 2026): phones held sideways, and wide screens. build_site.py appends this file to site.css, so it reaches every page.
   Every rule sits inside the "short landscape" query below (a screen that is wider than tall and at most 540px high), so upright
   phones, tablets and desktops cannot change. Rules for one tool use html[data-tool="<folder>"], which build_site.py adds to each page.
   Wide screens needed no rule: every page centres itself at its own maximum width (checked by tests/b123_test.py at 1920 and 2560 px).
   WRITTEN WITHOUT A BROWSER (the AI that wrote it could not run one): tests/b123_test.py opens every tool at 4 sizes and must pass before a deploy. */
@media (orientation:landscape) and (max-height:540px){
/* top bar: one row. The shelf links scroll sideways instead of wrapping into 2-3 rows that eat a 360-430px-high screen */
nav.sm-bar{flex-wrap:nowrap;gap:0 10px;padding:0 14px}
nav.sm-bar .sm-brand{flex:none;order:0;min-height:44px;margin-right:0}
nav.sm-bar .sm-nav{order:0;width:auto;flex:1 1 0;min-width:0;flex-wrap:nowrap;gap:0 16px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
nav.sm-bar .sm-nav::-webkit-scrollbar{display:none}
nav.sm-bar .sm-nav a{flex:none;white-space:nowrap;min-height:44px}
nav.sm-bar .sm-share,nav.sm-bar .sm-region{flex:none;order:0;margin-left:0;min-height:40px}
/* pop-ups are never taller than the screen */
dialog{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow:auto}
/* full-screen stages (Breathing Pacer, Decision Coin): content that is taller than the screen starts at the top and scrolls,
   instead of being centred with its top cut off; shorter content is still centred by the two auto margins */
.fsx,#stage:fullscreen{justify-content:flex-start}
.fsx>:first-child,#stage:fullscreen>:first-child{margin-top:auto}
.fsx>:last-child,#stage:fullscreen>:last-child{margin-bottom:auto}
/* square boards take their height from their width: cap the width so the whole board fits on the short screen */
html[data-tool="memory"] .grid,html[data-tool="noughts-and-crosses"] .grid,html[data-tool="number-slide"] .grid{max-width:calc(100vh - 28px);max-width:calc(100dvh - 28px);margin-left:auto;margin-right:auto}
html[data-tool="games"] .board-frame{max-width:calc(100vh - 70px);max-width:calc(100dvh - 70px);margin-left:auto;margin-right:auto}
html[data-tool="phone-to-phone"] .cam{max-width:min(340px,calc(100vh - 24px));max-width:min(340px,calc(100dvh - 24px))}
/* Meme Maker: the picture you drag text on must fit the screen, or it cannot be scrolled past (it captures touches) */
html[data-tool="meme-maker"] #c{width:auto!important;max-width:100%;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);margin-left:auto;margin-right:auto}
/* 3D stages keep their controls on screen: 300px minimum was most of a sideways phone */
html[data-tool="3d-lab"] #stage,html[data-tool="3d-viewer"] #stageWrap{min-height:220px}
/* home page: the suggestions list under the search box stays inside the screen */
#sug{max-height:calc(100vh - 90px);max-height:calc(100dvh - 90px)}
}
