:root{
  --bg:#f5f7fa; --surface:#ffffff; --fg:#17202b; --muted:#5b6878; --line:#d5dce5; --chip:#e6ebf1;
  --accent:#0b57c2; --on-accent:#ffffff; --warn:#a4470a; --warn-bg:#fdf1e4; --ok:#14653f; --ok-bg:#e4f5ec; --board:#11151b;
  --display:"Space Grotesk",system-ui,sans-serif; --body:"Inter",system-ui,sans-serif;
  --digits-a:#777; --digits-b:#111;      /* the two ends of the fade on big italic times */
}
/* Dark colors are neutral charcoal grays, with blue kept for the accent only. They are listed twice: once for "follow the device" when the device is dark, once for when dark was chosen by hand
   (theme.js sets data-theme on <html>). Keep the two lists the same. */
@media (prefers-color-scheme: dark){ :root:not([data-theme]){
  --bg:#121212; --surface:#1b1b1b; --fg:#ebebeb; --muted:#a3a3a3; --line:#333333; --chip:#272727;
  --accent:#6ea8ff; --on-accent:#0d0d0d; --warn:#f0a868; --warn-bg:#33240f; --ok:#7fd3a6; --ok-bg:#12301f; --board:#080808;
  --digits-a:#b0b0b0; --digits-b:#f4f4f4; color-scheme:dark } }
:root[data-theme="dark"]{
  --bg:#121212; --surface:#1b1b1b; --fg:#ebebeb; --muted:#a3a3a3; --line:#333333; --chip:#272727;
  --accent:#6ea8ff; --on-accent:#0d0d0d; --warn:#f0a868; --warn-bg:#33240f; --ok:#7fd3a6; --ok-bg:#12301f; --board:#080808;
  --digits-a:#b0b0b0; --digits-b:#f4f4f4; color-scheme:dark }
/* A picture with a light and a dark version is two images; the one that does not fit is taken out. */
:root[data-theme="light"] .only-dark,:root[data-theme="dark"] .only-light{display:none!important}
@media not all and (prefers-color-scheme: dark){ :root:not([data-theme]) .only-dark{display:none!important} }
@media (prefers-color-scheme: dark){ :root:not([data-theme]) .only-light{display:none!important} }
*{box-sizing:border-box}
html{padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px)}
body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.5 var(--body)}
img{max-width:100%;height:auto}
[hidden]{display:none!important}
.in{max-width:64rem;margin-inline:auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
h1,h2,h3{font-family:var(--display);line-height:1.2;margin:0;text-wrap:balance}
h1{font-size:1.5rem} h2{font-size:1.1rem} h2.sec{margin:1.4rem 0 .6rem}
a{color:var(--accent)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
header.top{position:sticky;top:0;z-index:5;background:var(--surface);border-bottom:1px solid var(--line)}
.top .in{display:flex;align-items:center;gap:.5rem 1rem;padding-block:.5rem;min-height:3.1rem}
.sections{display:flex;gap:.2rem;flex:1;min-width:0}
.sections a{padding:.35rem .7rem;border-radius:8px;color:var(--muted);text-decoration:none;font-weight:500;white-space:nowrap}
.sections a:hover{color:var(--fg)}
.sections a.on{color:var(--fg);background:var(--chip)}
.acct{display:flex;gap:.4rem;align-items:center;flex:none;margin-left:auto}
.acct .btn{max-width:10rem;overflow:hidden;text-overflow:ellipsis;display:inline-block}
/* The two menus in the header: the sections (phones only) and the account. Plain <details>, so they open without
   any script; app.js closes them on a click elsewhere. */
.menu{position:relative}
.menu>summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none}
.menu>summary::-webkit-details-marker{display:none}
.menu>summary.icon{display:inline-flex;align-items:center;justify-content:center;width:2.3rem;padding:.38rem 0}
.menu>summary svg{width:1.15rem;height:1.15rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-.2em}
.menu[open]>summary{background:var(--chip)}
.menu-panel{position:absolute;top:calc(100% + .45rem);right:0;z-index:40;min-width:14rem;display:flex;flex-direction:column;gap:.1rem;padding:.4rem;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 40px rgba(0,0,0,.28)}
.navmenu .menu-panel{left:0;right:auto}
.menu-panel a,.menu-panel .linkbtn{display:block;width:100%;text-align:left;padding:.5rem .7rem;border-radius:8px;color:var(--fg);text-decoration:none;font-weight:500;font-size:.95rem;white-space:nowrap}
.menu-panel a:hover,.menu-panel .linkbtn:hover,.menu-panel a.on{background:var(--chip)}
.menu-panel form{margin:0}
.menu-panel hr{border:0;border-top:1px solid var(--line);margin:.3rem .2rem}
.menu-who{margin:0;padding:.3rem .7rem .1rem;font-size:.8rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:16rem}
.themes{display:grid;grid-template-columns:repeat(3,1fr);gap:.25rem;padding:.2rem}
.themes button{display:flex;flex-direction:column;align-items:center;gap:.15rem;border:1px solid var(--line);background:var(--bg);color:var(--muted);border-radius:8px;padding:.4rem .2rem;font-size:.74rem;font-weight:500}
.themes button svg{width:1.1rem;height:1.1rem;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.themes button:hover{color:var(--fg)}
.themes button[aria-pressed="true"]{border-color:var(--accent);color:var(--fg);box-shadow:inset 0 0 0 1px var(--accent)}
.navmenu{display:none}
/* The header and the section bar under it stick to the top of the window as one block, so the section's links
   and its search box stay in reach on a long page. Alone (the studio), the header sticks by itself. */
.topwrap{position:sticky;top:0;z-index:5}
:where(main :target){scroll-margin-top:7rem}
.topwrap>header.top{position:static}
.subbar{background:var(--surface);border-bottom:1px solid var(--line)}
.subbar .in{display:flex;gap:.5rem;align-items:center;padding-block:.45rem;flex-wrap:wrap}
.subnav{display:flex;gap:.1rem;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:none;margin-left:-.45rem}
.subnav::-webkit-scrollbar{display:none}
.subnav a{padding:.25rem .6rem;border-radius:7px;color:var(--muted);text-decoration:none;font-size:.92rem;white-space:nowrap}
.subnav a:hover{color:var(--fg)}
.subnav a.on{color:var(--fg);box-shadow:inset 0 -2px 0 var(--accent);border-radius:7px 7px 0 0}
.hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.withrail{display:grid;grid-template-columns:12rem minmax(0,1fr);gap:1.5rem;align-items:start}
.rail{position:sticky;top:6.5rem;display:flex;flex-direction:column;gap:.1rem;padding-top:.4rem}
.rail a{padding:.4rem .7rem;border-radius:8px;color:var(--muted);text-decoration:none;border-left:2px solid var(--line)}
.rail a:hover{color:var(--fg)}
.rail a.on{color:var(--fg);border-left-color:var(--accent);background:var(--chip);font-weight:500}
@media (max-width:820px){
  .withrail{display:block}
  .rail{position:static;flex-direction:row;flex-wrap:wrap;gap:.3rem;padding:0 0 .8rem}
  .rail a{border-left:0;background:var(--chip);padding:.25rem .6rem;font-size:.9rem}
  .rail a.on{box-shadow:inset 0 0 0 1.5px var(--accent)}
}
.logo{display:flex;align-items:center;flex:none;text-decoration:none}
.logo img{display:block;height:30px;width:auto}
.logo .mark{display:none}
.logo .g{display:grid;grid-template-columns:repeat(3,7px);gap:1px}
.logo .g i{width:7px;height:7px;border-radius:1px}
.searchf{flex:1;min-width:0;display:flex}
.subbar .advlink{color:var(--muted);white-space:nowrap}
.subbar .searchf{flex:1 1 9rem;min-width:9rem;max-width:22rem}
.search{flex:1;min-width:0;width:100%;padding:.45rem .7rem;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.subbar .search{padding-left:2.05rem;background:var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a9099' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E") no-repeat .6rem center/1.05rem}
/* On a phone the section bar is one row: short labels, and the search box takes the room that is left. */
@media (max-width:640px){
  .subbar .in{flex-wrap:nowrap;gap:.4rem}
  .subbar [data-short] span{display:none}
  .subbar [data-short]::after{content:attr(data-short)}
  .subbar .subnav{flex:0 1 auto}
  .subbar .searchf{flex:1 1 5rem;min-width:4.5rem;max-width:none}
  .subbar .search{text-overflow:ellipsis;font-size:16px}      /* 16px: an iPhone zooms the page for a smaller field */
  .subbar .btn{flex:none}
  .subbar .advlink{display:none}
  .row.filters .advline{display:inline}     /* one class more than the rule that hides it, which comes later in this file */
}
/* While the box is in use on a phone the tabs step aside, so there is room to type. A rule of its own: a browser
   that does not know :has() skips it and keeps the row as it is. */
@media (max-width:640px){
  .subbar .in:has(.searchf:focus-within) .subnav{display:none}
}
/* On the narrowest phones the box can be too small for a word, so it shows its magnifier alone until it is used. */
@media (max-width:359px){
  .subbar .search:not(:focus)::placeholder{color:transparent}
}
@media (max-width:700px){.logo .full{display:none}.logo .mark{display:block}}
/* No room for the section links: they move behind a menu button at the left of the bar. */
@media (max-width:640px){.sections{display:none}.navmenu{display:block}.top .in{gap:.5rem}.acct .btn{max-width:8rem}}
.btn{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:.45rem .8rem;font-weight:500;white-space:nowrap;text-decoration:none;color:var(--fg);display:inline-flex;align-items:center;justify-content:center;gap:.35rem}
.btn.p{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.on{border-color:var(--accent);color:var(--accent)}
.btn.warn{border-color:var(--warn);color:var(--warn)}
.btn.sm{padding:.3rem .6rem;font-size:.85rem}
.btn:disabled{opacity:.45;cursor:default}
.linkbtn{border:0;background:none;color:var(--muted);padding:0;text-decoration:underline;font-size:.85rem}
form.inline{display:inline-flex}
a.back,a.quiet{color:var(--muted);font-size:.88rem}
a.back{display:inline-block;margin-bottom:.4rem;text-decoration:none}
main{padding-block:1rem 3rem;min-height:70vh}
footer{border-top:1px solid var(--line);padding-block:1rem 2rem;font-size:.85rem;color:var(--muted)}
footer a{margin-right:1rem;color:var(--muted)}
.flash{padding:.5rem .8rem;border-radius:8px;margin:0 0 .8rem}
.flash.ok{background:var(--ok-bg);color:var(--ok)}
.flash.bad{background:var(--warn-bg);color:var(--warn)}
.row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.confirmbar{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;justify-content:space-between}
.confirmbar form{margin:0}
.row.spread{justify-content:space-between}
.muted{color:var(--muted)} .small{font-size:.85rem} .tight{margin:.2rem 0 0}
.chips{display:flex;gap:.4rem;overflow-x:auto;padding-bottom:.3rem;margin:.8rem 0 .4rem}
.chip{border:0;background:var(--chip);border-radius:999px;padding:.3rem .8rem;white-space:nowrap;font-size:.88rem;color:var(--fg);text-decoration:none}
.chip.on{background:var(--accent);color:var(--on-accent)}
.cubesf{margin-top:.2rem}
.cubesn{display:flex;align-items:center;gap:.3rem;color:var(--muted);font-size:.88rem;white-space:nowrap}
.cubesn input[type=number]{width:4.5rem;padding:.25rem .4rem}
.chiplabel{align-self:center;color:var(--muted);font-size:.88rem;white-space:nowrap}
.chips.wrap{flex-wrap:wrap;overflow:visible}
.coll{scroll-margin-top:7rem}
.filters{justify-content:space-between;margin-bottom:.8rem;color:var(--muted);font-size:.88rem;gap:.3rem 1rem}
.filters .active{display:flex;flex-wrap:wrap;gap:.2rem .9rem;color:var(--fg)}
.filters a{color:var(--muted)} .filters a.cur{color:var(--fg);font-weight:600;text-decoration:none}
.filters .advline{display:none}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:.9rem}
.card{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.5rem;min-width:0;position:relative;display:flex;flex-direction:column;gap:.3rem}
.card:hover{border-color:var(--accent)}
/* One link per card (the title), stretched over the whole card. The star and delete sit above it, at the end of
   the title line, so nothing covers the picture and no row is spent on them. */
.cardh{display:flex;align-items:flex-start;gap:.25rem;min-width:0}
.card .cl{text-decoration:none;color:var(--fg);min-width:0;flex:1 1 auto}
.card .cl::after{content:"";position:absolute;inset:0;border-radius:10px}
.card .cl:focus-visible{outline:none}
.card .cl:focus-visible::after{outline:2px solid var(--accent);outline-offset:1px}
.carda{display:flex;align-items:center;gap:.05rem;position:relative;z-index:1;margin:-.25rem -.3rem -.2rem 0;flex:none}
.favf,.signinf,.cardxf{margin:0}
.fav{display:flex;align-items:center;justify-content:center;gap:.15rem;border:0;background:none;color:var(--muted);min-width:28px;height:28px;border-radius:999px;line-height:1;padding:0 .2rem;cursor:pointer}
.fav .star{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.fav.on .star{fill:#f7d417;stroke:#c99700}
.fav:hover,.fav:focus-visible{background:var(--chip);color:var(--fg)}
.fav .n{font-size:.75rem;font-variant-numeric:tabular-nums}
.fav .n:empty{display:none}
.fav.cardx:hover,.fav.cardx:focus-visible{background:#c8232c;color:#fff}
/* A short message that slides up from the bottom when something could not be done. */
.toast{position:fixed;left:50%;bottom:1.2rem;transform:translateX(-50%);z-index:60;max-width:min(30rem,calc(100vw - 2rem));padding:.6rem 1rem;border-radius:10px;background:var(--fg);color:var(--bg);font-size:.92rem;box-shadow:0 10px 30px rgba(0,0,0,.35)}
.card img{width:100%;aspect-ratio:1;border-radius:6px;display:block;image-rendering:pixelated;object-fit:contain;background:var(--board)}
.card b{font-weight:600;font-size:.9rem;overflow-wrap:anywhere}
.sub{color:var(--muted);font-size:.8rem;display:flex;justify-content:space-between;gap:.4rem}
.sub>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sub>span+span{white-space:nowrap}
.badge{font-size:.7rem;border:1px solid var(--line);border-radius:4px;padding:0 .3rem;color:var(--muted);white-space:nowrap}
.badge.st{border-color:var(--warn);color:var(--warn)}
.pager{justify-content:center;margin-top:1.2rem}
.kit{background:var(--surface);border:1px dashed var(--line);border-radius:10px;padding:.8rem 1rem;margin:1.2rem 0;display:flex;gap:.8rem;align-items:center;justify-content:space-between;flex-wrap:wrap}
.kit small{color:var(--muted);display:block}
.empty{color:var(--muted);padding:2rem 0;text-align:center}
.detail{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,20rem);gap:1.5rem}
.build{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,16rem);gap:1.2rem;align-items:start}
@media (max-width:720px){.detail,.build{grid-template-columns:minmax(0,1fr)}}
.build canvas.big{cursor:pointer}
/* Row and column side by side with their names above them, so the three parts fit the narrow panel on one line. */
.build .jump{display:grid;grid-template-columns:4.5rem 4.5rem auto;justify-content:start;align-items:center;gap:.15rem .5rem}
.build .jump label{font-size:.8rem;color:var(--muted)}
.build .jump input{width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:.3rem .4rem;color:var(--fg);font:inherit}
.build-fail{color:var(--warn)}
.big{width:100%;max-width:min(34rem,72vh);height:auto;border-radius:10px;display:block;margin-inline:auto}
img.big{max-height:76vh;width:auto;max-width:100%}
canvas.big{max-height:76vh;object-fit:contain}
/* A board of a few cubes is a small picture. It is shown at a whole multiple of its size (set inline), so the stickers stay crisp. */
img.big.tiny{image-rendering:pixelated;max-height:none;max-width:100%}
img.thumb{width:9rem;border-radius:8px;image-rendering:pixelated}
img.thumb.big{width:min(22rem,100%);margin:0}
.own{border:1px solid var(--line);border-radius:10px;padding:.7rem .8rem;display:flex;flex-direction:column;gap:.45rem;background:var(--surface)}
.modbox{border:1px dashed var(--line);border-radius:10px;padding:.5rem .8rem;font-size:.9rem}
.modbox summary{cursor:pointer;color:var(--muted)}
.modbox .row{margin-top:.5rem}
.pals{display:grid;grid-template-columns:repeat(auto-fill,minmax(13rem,1fr));gap:.8rem;margin:1rem 0}
.pal{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.8rem;display:flex;flex-direction:column;gap:.5rem;align-items:flex-start;margin:0}
.pal.on{border-color:var(--accent)}
.palrow{display:flex;gap:4px}
.palrow i{width:26px;height:26px;border-radius:5px;border:1px solid var(--line)}
.palpick{display:grid;grid-template-columns:repeat(auto-fill,minmax(6.5rem,1fr));gap:.6rem;align-self:stretch}
.palpick label{display:flex;align-items:center;gap:.4rem;font-size:.88rem}
.palpick input{width:42px;height:34px;padding:0;border:1px solid var(--line);border-radius:6px;background:none}
.form.wide{max-width:40rem;margin-inline:0}
.tbl{border-collapse:collapse;width:100%;font-size:.92rem;margin:.6rem 0}
.tbl th,.tbl td{text-align:left;padding:.35rem .6rem;border-bottom:1px solid var(--line)}
.prose .btn{margin:.2rem .3rem .2rem 0}
.pro-plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.8rem;margin:1rem 0}
.pro-plan{border:1px solid var(--line);border-radius:10px;padding:.8rem 1rem;background:var(--surface)}
.pro-plan h3{margin:0 0 .3rem}
.pro-price{font-size:1.4rem;font-weight:700;margin:.2rem 0 .6rem}
.pro-price span{font-size:.9rem;font-weight:400;color:var(--muted)}
.pro-status{font-weight:700}
.pro-plan.best{border-color:var(--accent);border-width:2px}
.pro-best{margin:0 0 .2rem;font-size:.85rem;font-weight:700}
.pro-switch{margin-top:1rem}
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(7rem,1fr));gap:.6rem;margin:.8rem 0}
.tiles div{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.6rem .8rem}
.tiles span{display:block;color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.06em}
.tiles b{font-size:1.25rem;font-variant-numeric:tabular-nums}
.solves td{font-variant-numeric:tabular-nums;vertical-align:top}
.solves .scr{font:400 .78rem/1.4 "JetBrains Mono",ui-monospace,monospace;color:var(--muted);overflow-wrap:anywhere;white-space:pre-line}
@media (max-width:640px){.solves .wide{display:none}}
.tiles a.tile{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.6rem .8rem;text-decoration:none;color:var(--fg);display:block}
.tiles a.tile:hover{border-color:var(--accent)}
/* Phones: the three ways to start a mosaic sit in one row, and the build guide fits on one screen with
   the buttons always in reach. */
@media (max-width:640px){
  .starts{grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}
  .start{padding:.6rem .5rem;text-align:center;justify-content:center}
  .start b{font-size:.88rem}
  .start span{display:none}
}
@media (max-width:720px){
  .build{gap:.6rem}
  .build canvas.big{max-width:min(100%,40vh)}
  .build .panel{padding:.7rem .8rem;gap:.5rem}
  .build .face{max-width:7.5rem}
  .build .panel>.row:has(#next){position:sticky;bottom:0;z-index:2;align-self:stretch;background:var(--surface);padding:.5rem 0 calc(.5rem + env(safe-area-inset-bottom,0px))}
  .build #prev,.build #next{flex:1;min-height:48px}
}
select{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:.5rem .7rem;color:var(--fg)}
input[type=email]{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:.5rem .7rem;width:100%;color:var(--fg)}
.panel+.panel,.panel+form.panel{margin-top:1rem}
.strip{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(132px,150px);gap:.8rem;overflow-x:auto;padding-bottom:.4rem}
.coll{margin:1.4rem 0}
.coll .row{justify-content:space-between;margin-bottom:.5rem}
.coll p{margin:0;color:var(--muted);font-size:.88rem}
/* The designer on the gallery front page: the picture and the words side by side, stacked on a phone. */
.designer{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:1.2rem;align-items:center;margin:1.2rem 0;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:1rem}
.designer img{width:100%;height:auto;border-radius:8px;display:block}
.designer h2{margin:0 0 .4rem}
.designer p{margin:0 0 .9rem}
@media (max-width:640px){.designer{grid-template-columns:minmax(0,1fr)}}
.advsearch{display:grid;gap:.9rem;max-width:34rem}
.advsearch label{display:grid;gap:.25rem;font-weight:600}
.advsearch input[type=search],.advsearch input[type=number],.advsearch select{width:100%;font-weight:400}
.advsearch fieldset{border:0;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:.3rem 1rem}
.advsearch legend{font-weight:600;padding:0;margin-bottom:.25rem}
.advsearch fieldset label{display:inline-flex;grid-auto-flow:column;align-items:center;gap:.35rem;font-weight:400}
.starts{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:.7rem;margin:1rem 0}
.start{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.8rem 1rem;text-decoration:none;color:var(--fg);display:flex;flex-direction:column;gap:.15rem}
.start b{font-family:var(--display)}
.start span{color:var(--muted);font-size:.85rem}
.start:hover{border-color:var(--accent)}
.side{display:flex;flex-direction:column;gap:.9rem;min-width:0}
.counts{display:grid;grid-template-columns:repeat(3,1fr);gap:.4rem;font-variant-numeric:tabular-nums;font-size:.88rem}
.counts.two{grid-template-columns:1fr 1fr}
.counts span{display:flex;align-items:center;gap:.35rem}
.sw{width:14px;height:14px;border-radius:3px;border:1px solid var(--line);flex:none;display:inline-block}
.face{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:var(--board);padding:6px;border-radius:10px;width:100%;max-width:11rem;aspect-ratio:1}
.face i{border-radius:5px}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:1rem;display:flex;flex-direction:column;gap:.8rem;align-items:flex-start}
.form{max-width:30rem;margin:1rem auto}
.form label.f,.form .row{align-self:stretch}
label.f{display:flex;flex-direction:column;gap:.25rem;font-size:.88rem;color:var(--muted)}
label.chk{display:flex;gap:.5rem;align-items:flex-start;font-size:.9rem}
input[type=text],input[type=password],textarea{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:.5rem .7rem;width:100%;color:var(--fg)}
.row input[type=text]{width:auto;flex:1;min-width:8rem;padding:.3rem .6rem}
.ok{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:1.5rem;text-align:center;max-width:30rem;margin:2rem auto;display:flex;flex-direction:column;gap:.8rem;align-items:center}
.qrow{display:flex;gap:.8rem;padding:.7rem 0;border-bottom:1px solid var(--line);align-items:flex-start}
.qrow img{width:7rem;border-radius:6px;flex:none}
.qbody{min-width:0;flex:1;display:flex;flex-direction:column;gap:.3rem}
.prose{max-width:40rem;line-height:1.6}
.prose h2{margin-top:1.4rem}
/* Solving tutorial */
.solve .toc{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.6rem 1rem;margin:1rem 0}
.solve .toc h2{margin:.2rem 0 .3rem;font-size:1rem}
.solve .toc ol{margin:0;padding-left:1.3rem}
.solve section{scroll-margin-top:7rem}
.cubes{display:flex;flex-wrap:wrap;gap:.9rem 1.1rem;margin:1rem 0;align-items:flex-end}
.cubefig{margin:0;display:flex;flex-direction:column;align-items:center;gap:.35rem;max-width:100%}
.cubefig figcaption{font-size:.85rem;color:var(--muted);text-align:center;max-width:12rem}
.cubefig figcaption code{white-space:normal}
svg.cube{display:block;max-width:100%;height:auto}
.solve .alg code{display:inline-block;background:var(--chip);border-radius:6px;padding:.3rem .6rem;font-size:1.05rem;white-space:normal}
.solve details{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.6rem 1rem;margin:1rem 0}
.solve summary{cursor:pointer}
.solve section>h2{font-size:1.35rem;margin-top:2.2rem;padding-top:.9rem;border-top:1px solid var(--line)}
.solve h3{margin-top:1.3rem}
.solve h2+h3{margin-top:.6rem}
.prose .starts{grid-template-columns:repeat(2,minmax(0,1fr))}
.scrollx{overflow-x:auto;-webkit-overflow-scrolling:touch}
.scrollx .tbl{min-width:36rem}
.pz{display:flex;flex-direction:column;gap:1rem;max-width:52rem}
.pz-group{border:1px solid var(--line);border-radius:12px;padding:.6rem 1rem .9rem;margin:0;background:var(--surface)}
.pz-group legend{font-family:var(--display);font-weight:600;padding:0 .4rem}
.pz-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));gap:.15rem .8rem}
.pz-item{display:flex;gap:.55rem;align-items:flex-start;padding:.35rem 0;cursor:pointer}
.pz-item input{width:1.1rem;height:1.1rem;margin-top:.2rem;flex:none}
.pz-item small{color:var(--muted)}
.pz-add{display:flex;flex-direction:column;gap:.3rem;margin-top:.6rem;font-weight:500}
.pz-add input{max-width:26rem;padding:.5rem .7rem;border:1px solid var(--line);border-radius:8px;background:var(--bg);font-weight:400}
h1 .handle{font:400 .95rem var(--body);color:var(--muted);margin-left:.4rem}
/* The × in the corner of every dialog (added by script). It stays in reach while a tall dialog scrolls. */
.dlg-x{position:sticky;top:0;z-index:2;flex:none;width:2rem;height:2rem;min-height:0;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:50%;
  background:var(--surface);color:var(--muted);font:400 1.35rem/1 var(--body);cursor:pointer}
.dlg-x:hover,.dlg-x:focus-visible{background:var(--chip);color:var(--fg)}
dialog>.dlg-x{align-self:flex-end;margin:-.45rem -.45rem -2rem auto}          /* dialogs laid out as a column */
dialog.lg-dlg:not(.lg-daydlg)>.dlg-x{float:right;margin:-.45rem -.45rem 0 .5rem}   /* dialogs laid out as plain blocks */
.facemap{display:grid;grid-template-columns:repeat(3,4.6rem);gap:4px;margin:1.1rem 0}
.facemap span{aspect-ratio:1;display:grid;place-items:center;border-radius:7px;border:1px solid var(--line);background:var(--chip);font-size:.74rem;font-weight:600;color:var(--muted)}
.facemap .m{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.facemap .e{color:var(--fg)}
.guides{list-style:none;padding:0;margin:.4rem 0 1rem}
.guides li{padding:.45rem 0;border-top:1px solid var(--line)}
.guides li a{font-weight:600}
.guides li span{color:var(--muted);margin-left:.3rem}
@media (max-width:560px){ .guides li span{display:block;margin-left:0} }
.gl-index{display:flex;flex-wrap:wrap;gap:.35rem .5rem;margin:1rem 0 1.4rem}
.gl-index a{background:var(--chip);border-radius:6px;padding:.1rem .5rem;text-decoration:none;font-size:.9rem}
.gl>div{padding:.7rem 0;border-top:1px solid var(--line);scroll-margin-top:7rem}
.gl>div:target{background:var(--chip);margin:0 -.6rem;padding:.7rem .6rem;border-radius:8px;border-top-color:transparent}
.gl dt{font-family:var(--display);font-weight:700;font-size:1.1rem}
.gl dt small{font:400 .8rem var(--body);color:var(--muted);margin-left:.4rem}
.gl dd{margin:.2rem 0 0}
/* OLL and PLL algorithm reference: a grid of cases at the full content width. Without script every cell lists its
   three algorithms; algs.js adds .algs-on, stacks the three in one grid area and shows one at a time. Hidden ones
   keep their space (visibility, not display) so the tallest sets the cell height and the grid does not jump.
   Where the browser says scripts will run (the scripting media query), the page is laid out that way from the
   first paint, with the first algorithm showing and the buttons in place, so nothing moves when algs.js starts.
   A browser without that query gets the same layout a moment later, when the script adds its class. */
.algsec{margin:0 0 1rem}
.algsec>h2{font-size:1.35rem;margin:2.2rem 0 .3rem;padding-top:.9rem;border-top:1px solid var(--line);scroll-margin-top:7rem}
.algrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,9.5rem),1fr));gap:.7rem}
.alggroup{grid-column:1/-1;margin-top:.9rem}
.alggroup h3{margin:0;font-size:1.05rem}
.alggroup h3 span{font:400 .85rem var(--body);color:var(--muted);margin-left:.4rem}
.algcell{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.6rem .5rem .7rem;display:flex;flex-direction:column;align-items:center;gap:.4rem;min-width:0;scroll-margin-top:7rem}
.algcell:target{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.algname{margin:0;font-size:1rem;text-align:center}
.algname span{font:400 .85rem var(--body);color:var(--muted);margin-left:.3rem}
/* The buttons sit at the bottom of the cell, so they line up along a row whatever the length of the algorithms. */
.algs{width:100%;min-width:0;flex:1;display:flex;flex-direction:column}
.alglist{margin:0;padding-left:1.3rem;display:flex;flex-direction:column;gap:.5rem}
.alglist code{font:1rem/1.5 "JetBrains Mono",ui-monospace,monospace;display:inline-block;background:var(--chip);border-radius:6px;padding:.25rem .45rem;white-space:normal;overflow-wrap:anywhere}
.algs-on .alglist{display:grid;list-style:none;padding:0;text-align:center}
.algs-on .alglist>li{grid-area:1/1;visibility:hidden}
.algs-on .alglist>li.on{visibility:visible}
@media (scripting:enabled){
  .alglist{display:grid;list-style:none;padding:0;text-align:center}
  .alglist>li{grid-area:1/1}
  .algs:not(.algs-on) .alglist>li:not(:first-child){visibility:hidden}
  .algctl[hidden]{display:flex}
}
.algctl{display:flex;align-items:center;justify-content:center;gap:.6rem;margin:auto 0 0;padding-top:.5rem}
.algctl button{display:inline-flex;align-items:center;justify-content:center;width:2.4rem;height:2.4rem;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--chip);color:var(--fg);cursor:pointer}
.algctl button:hover{border-color:var(--accent)}
.algctl svg{width:1.1rem;height:1.1rem;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.algpos{min-width:3.2rem;text-align:center;font-size:.85rem;color:var(--muted)}
.avg-row{display:flex;flex-wrap:wrap;gap:.4rem;margin:.5rem 0}
.avg-t{font-family:"JetBrains Mono",ui-monospace,monospace;background:var(--chip);border-radius:6px;padding:.2rem .55rem}
.avg-t.out{text-decoration:line-through;color:var(--muted);background:none;outline:1px solid var(--line)}
.avg-in{display:block;width:100%;box-sizing:border-box;font:1rem/1.5 "JetBrains Mono",ui-monospace,monospace;padding:.6rem .7rem;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);resize:vertical}
.avg-out{margin:.8rem 0;min-height:9rem}
.avg-nums{display:grid;grid-template-columns:repeat(auto-fill,minmax(7.5rem,1fr));gap:.5rem;margin:.6rem 0}
.avg-nums div{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:.4rem .6rem}
.avg-nums dt{font-size:.8rem;color:var(--muted)}
.avg-nums dd{margin:0;font:600 1.15rem "JetBrains Mono",ui-monospace,monospace}
/* Child profiles: "Who is cubing?" in the account menu, and the parent's section on the account page. */
.menu-panel .who-on{display:block;padding:.5rem .7rem;font-weight:600;font-size:.95rem}
.menu-panel .who-on::before{content:"\2713\00a0"}
.childdrawings{list-style:none;padding:0;margin:.4rem 0}
.childdrawings li{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.3rem 0;border-bottom:1px solid var(--line,rgba(127,127,127,.2))}
.childnotice{margin:1rem 0}
/* Ad slots (app/views/shared/_ad_slot.html.erb). The height is reserved so nothing moves when an ad arrives: 100px
   for a banner strip and 250px for a slot inside content, the same numbers as Ads::HEIGHTS, which sizes the ad
   itself in its own style attribute. */
.adslot{margin:2rem 0;clear:both}
.adslot-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;margin:0 0 .5rem;font-size:.72rem;color:var(--muted)}
.adslot-label{margin:0;letter-spacing:.04em;text-transform:uppercase}
.adslot-box{min-height:100px;overflow:hidden}
.adslot-preview{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;min-height:100px;border:1px dashed var(--line);background:var(--chip);color:var(--muted)}
.adslot-preview small{font-size:.75rem}
.adslot-pro{margin:0}
.adslot-pro a{color:var(--muted)}
.adslot-content .adslot-box,.adslot-content .adslot-preview{min-height:250px}
/* An ad that was not filled leaves no empty strip behind. This is the one case in which Google's help documents
   hiding an ad unit (https://support.google.com/adsense/answer/10762946). Nothing else may hide a slot or lay
   site content over it: Google's ad code rules name both (https://support.google.com/adsense/answer/1354736). */
.adslot:has(ins[data-ad-status="unfilled"]){display:none}
/* Our own card, shown where no ad fills a slot (app/views/shared/_house_card.html.erb). The spacing is the ad slot's.
   One compact row on a wide screen (about the height of a banner), stacked on a phone. */
.housecard{margin:2rem 0;clear:both;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.6rem .9rem .8rem}
.housecard-label{margin:0 0 .4rem;font-size:.72rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.housecard-body{display:flex;flex-wrap:wrap;align-items:center;gap:.8rem 1rem}
.housecard-pics{list-style:none;margin:0;padding:0;display:flex;gap:.5rem;flex:none}
.housecard-pics li{margin:0}
.housecard-pics a{display:block}
.housecard-pics img{display:block;height:64px;width:auto;max-width:96px;border-radius:6px;object-fit:contain}
.housecard-alg svg{display:block;width:64px;height:auto}
.housecard-words{flex:1 1 14rem;min-width:0}
.housecard-words h2{margin:0 0 .15rem;font-size:1.05rem}
.housecard-words p{margin:0;font-size:.92rem;color:var(--muted)}
@media (max-width:640px){.housecard-body{flex-direction:column;align-items:flex-start}.housecard-words{flex:none}}
/* The build guide: room above, so the sticky step buttons are never near it. */
.adslot[data-placement="build"]{margin-top:10rem}
/* The language list in the footer. The language in use is plain text; the others are links. */
footer .langs{margin:.6rem 0 0;display:flex;flex-wrap:wrap;gap:.2rem 1rem;align-items:baseline}
footer .langs [aria-current]{color:var(--fg)}
footer .langs form{margin:0}
footer .langs .linkbtn{font-size:inherit}
.langmenu .menu-panel{min-width:9.5rem}
