/* HIVELAB Home (pass 6): the full-screen app shell around the hub pages.
   app-shell.mjs owns the frame and the Play page; beta.mjs the pages.
   Older hub rules are unlayered and scattered, so the frame's selectors carry
   html body #beta-hub.app-shell to outrank them rather than !important.

   Phones:  top bar · page (scrolls) · bottom navigation
   ≥900 px: navigation rail on the left · top bar · page, content ≤ 760 px */

html body #beta-hub.app-shell{
 --shell-top:calc(56px + env(safe-area-inset-top));--shell-nav:64px;--shell-max:760px;
 position:fixed;inset:0;box-sizing:border-box;width:100%;max-width:none;height:100%;height:100dvh;max-height:none;
 margin:0;padding:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;
 background:var(--bg);color:var(--ink);font-family:inherit;
}
html body #beta-hub.app-shell[open]{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--shell-top) minmax(0,1fr) calc(var(--shell-nav) + env(safe-area-inset-bottom));grid-template-areas:"top" "main" "nav";gap:0}
html body #beta-hub.app-shell::backdrop{background:var(--bg)}

/* Top bar */
html body #beta-hub.app-shell>.shell-top{grid-area:top;display:flex;align-items:center;gap:var(--space-1);box-sizing:border-box;min-width:0;padding:0 var(--space-2) 0 var(--space-2);padding-top:env(safe-area-inset-top);border-bottom:1px solid var(--line);background:var(--panel)}
#beta-hub.app-shell .shell-brand{display:flex;align-items:center;flex:1;min-width:0;height:100%;padding-left:var(--space-1)}
#beta-hub.app-shell .shell-brand .brand-wordmark{width:128px;height:auto;aspect-ratio:930/192;fill:currentColor;color:var(--ink)}
#beta-hub.app-shell .shell-actions{display:flex;align-items:center;gap:2px}
html body #beta-hub.app-shell .shell-back{display:inline-flex;align-items:center;gap:2px;min-height:var(--touch);padding:0 10px 0 4px;border:0;border-radius:var(--radius-pill);background:color-mix(in srgb,var(--ink) 7%,transparent);color:var(--ink);font:inherit;font-size:var(--text-sm);font-weight:var(--weight-strong);cursor:pointer}
html body #beta-hub.app-shell .shell-back[hidden]{display:none}
#beta-hub.app-shell .shell-back svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html body #beta-hub.app-shell .shell-icon{position:relative;display:grid;place-items:center;width:var(--touch);height:var(--touch);min-width:0;min-height:0;padding:0;border:0;border-radius:var(--radius-pill);background:transparent;color:var(--ink);cursor:pointer}
#beta-hub.app-shell .shell-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#beta-hub.app-shell .shell-icon[data-count]:not([data-count=''])::after{content:attr(data-count);position:absolute;top:4px;right:3px;display:grid;place-items:center;min-width:17px;height:17px;padding:0 4px;box-sizing:border-box;border-radius:9px;background:#d9483b;color:#fff;font-size:10.5px;font-weight:700;line-height:1}
html body #beta-hub.app-shell .shell-avatar{display:grid;place-items:center;width:var(--touch);height:var(--touch);min-height:0;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer}
#beta-hub.app-shell #shell-avatar{display:grid;place-items:center;width:34px;height:34px;overflow:hidden;border-radius:50%;background:color-mix(in srgb,var(--ink) 9%,transparent);color:var(--ink)}
#beta-hub.app-shell #shell-avatar svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}
#beta-hub.app-shell #shell-avatar img{width:100%;height:100%;object-fit:cover}
#beta-hub.app-shell #shell-avatar>svg:only-child:not([viewBox="0 0 24 24"]){width:100%;height:100%}
#beta-hub.app-shell .shell-top :is(button):hover{background:color-mix(in srgb,var(--ink) 8%,transparent)}

/* Navigation: bottom bar on phones */
html body #beta-hub.app-shell>.shell-nav{grid-area:nav;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;box-sizing:border-box;padding:4px 4px env(safe-area-inset-bottom);border-top:1px solid var(--line);background:var(--panel)}
html body #beta-hub.app-shell .shell-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:0;height:auto;margin:0;padding:6px 0;border:0;border-radius:var(--radius-md);background:transparent;color:var(--muted);font:inherit;font-size:min(11px,3.25vw);font-weight:var(--weight-strong);letter-spacing:0;cursor:pointer;box-shadow:none}
#beta-hub.app-shell .shell-nav svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
html body #beta-hub.app-shell .shell-nav button[aria-current=page]{color:var(--ink);background:transparent}
#beta-hub.app-shell .shell-nav button[aria-current=page] svg{stroke-width:2.1}
#beta-hub.app-shell .shell-nav button[aria-current=page]::before{content:'';display:block;width:28px;height:3px;margin:-6px 0 3px;border-radius:0 0 3px 3px;background:var(--ui-nav-mark)}
#beta-hub.app-shell .shell-nav button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.015em}
#beta-hub.app-shell :is(.shell-nav button,.shell-top button,.shell-page button,.shell-page a):focus-visible{outline:none;box-shadow:var(--ui-focus)}

/* Pages */
html body #beta-hub.app-shell>[data-beta-page]{grid-area:main;display:block;box-sizing:border-box;min-height:0;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:var(--space-4) max(var(--space-4),calc((100% - var(--shell-max))/2)) var(--space-6);scrollbar-gutter:stable}
html body #beta-hub.app-shell>[data-beta-page][hidden]{display:none}
html body #beta-hub.app-shell>#beta-status{grid-area:main;align-self:end;justify-self:center;z-index:5;max-width:min(560px,calc(100% - 32px));margin:0 0 var(--space-3);padding:10px 14px;border-radius:var(--radius-md);background:var(--ink);color:var(--panel);font-size:var(--text-sm);box-shadow:var(--ui-shadow);pointer-events:none}
html body #beta-hub.app-shell>#beta-status:empty{display:none}
#beta-hub.app-shell .shell-page{display:flex;flex-direction:column;gap:var(--space-5)}
#beta-hub.app-shell .shell-page[hidden]{display:none}
#beta-hub.app-shell .shell-block{display:flex;flex-direction:column;gap:var(--space-2);margin:0}
#beta-hub.app-shell .shell-block[hidden]{display:none}
html body #beta-hub.app-shell .shell-heading{margin:0;font-size:17px;font-weight:700;letter-spacing:-.01em;color:var(--ink)}
#beta-hub.app-shell .shell-heading-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}
html body #beta-hub.app-shell .shell-link{min-height:36px;padding:0 var(--space-2);border:0;border-radius:var(--radius-sm);background:transparent;color:var(--accent);font:inherit;font-size:var(--text-sm);font-weight:var(--weight-strong);cursor:pointer}
#beta-hub.app-shell .shell-muted{margin:0;color:var(--muted);font-size:var(--text-sm)}
#beta-hub.app-shell .shell-muted[hidden]{display:none}

/* Continue */
#beta-hub.app-shell .shell-continue-list{display:flex;flex-direction:column;gap:var(--space-2)}
html body #beta-hub.app-shell .shell-continue-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-3);width:100%;min-height:64px;margin:0;padding:var(--space-3) var(--space-3) var(--space-3) var(--space-4);box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);color:var(--ink);font:inherit;text-align:left;cursor:pointer;box-shadow:0 1px 2px #0000000f}
#beta-hub.app-shell .shell-continue-row[data-state=yours]{border-color:color-mix(in srgb,var(--accent) 55%,var(--line));box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
#beta-hub.app-shell .shell-continue-row strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:700}
#beta-hub.app-shell .shell-continue-row small{display:block;margin-top:2px;color:var(--muted);font-size:13px}
#beta-hub.app-shell .shell-continue-row[data-state=yours] small{color:var(--ink);font-weight:var(--weight-strong)}
#beta-hub.app-shell .shell-turn-dot{width:12px;height:12px;border-radius:50%;border:1.5px solid var(--ink);background:#f6f2e7}
#beta-hub.app-shell .shell-turn-dot[data-side=b]{background:#20252b}
#beta-hub.app-shell .shell-turn-dot[data-side='']{border-style:dashed;background:transparent}
#beta-hub.app-shell .shell-go{padding:8px 14px;border-radius:var(--radius-pill);background:var(--ui-primary);color:var(--ui-on-primary);font-size:13.5px;font-weight:700;white-space:nowrap}
#beta-hub.app-shell .shell-continue-row[data-state=finished] .shell-go{background:color-mix(in srgb,var(--ink) 9%,transparent);color:var(--ink)}

/* The course, until it is finished */
html body #beta-hub.app-shell .shell-banner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-4);border-radius:var(--radius-lg);background:color-mix(in srgb,var(--accent) 14%,var(--panel));border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));color:var(--ink);text-decoration:none}
html body #beta-hub.app-shell .shell-banner[hidden]{display:none}
#beta-hub.app-shell .shell-banner>svg{width:28px;height:28px;fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#beta-hub.app-shell .shell-banner strong{display:block;font-size:16px}
#beta-hub.app-shell .shell-banner small{display:block;margin-top:2px;color:var(--muted);font-size:13px}
#beta-hub.app-shell :is(.shell-banner,.shell-row,.shell-feature)>b{font-size:24px;font-weight:400;color:var(--muted)}

/* New game: four clear choices */
#beta-hub.app-shell .shell-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-2)}
html body #beta-hub.app-shell .shell-mode{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px;min-width:0;min-height:106px;height:auto;margin:0;padding:var(--space-4);box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);color:var(--ink);font:inherit;text-align:left;cursor:pointer;box-shadow:0 1px 2px #0000000f;transition:transform .12s,box-shadow .12s,border-color .12s}
/* Each choice takes one colour of the theme's combination (tokens.css: --chip-N). */
#beta-hub.app-shell .shell-mode:nth-child(4n+1){--chip-bg:var(--chip-1-bg);--chip-fg:var(--chip-1-fg)}
#beta-hub.app-shell .shell-mode:nth-child(4n+2){--chip-bg:var(--chip-2-bg);--chip-fg:var(--chip-2-fg)}
#beta-hub.app-shell .shell-mode:nth-child(4n+3){--chip-bg:var(--chip-3-bg);--chip-fg:var(--chip-3-fg)}
#beta-hub.app-shell .shell-mode:nth-child(4n+4){--chip-bg:var(--chip-4-bg);--chip-fg:var(--chip-4-fg)}
#beta-hub.app-shell .shell-mode svg{width:26px;height:26px;margin-bottom:2px;padding:7px;box-sizing:content-box;border-radius:14px;background:var(--chip-bg);fill:none;stroke:var(--chip-fg);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#beta-hub.app-shell .shell-mode strong{margin-top:2px;font-size:16px;font-weight:700;line-height:1.2}
#beta-hub.app-shell .shell-mode span{color:var(--muted);font-size:13px;line-height:1.35}
@media(hover:hover){#beta-hub.app-shell .shell-mode:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--accent) 45%,var(--line));box-shadow:0 6px 18px #0000001a}#beta-hub.app-shell .shell-continue-row:hover,#beta-hub.app-shell .shell-row:hover{border-color:color-mix(in srgb,var(--accent) 40%,var(--line))}}
#beta-hub.app-shell .shell-chips{display:flex;flex-wrap:wrap;gap:var(--space-2)}
html body #beta-hub.app-shell .shell-chips button{display:inline-flex;align-items:center;gap:6px;min-height:40px;margin:0;padding:0 14px 0 10px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--panel);color:var(--ink);font:inherit;font-size:var(--text-sm);font-weight:var(--weight-strong);cursor:pointer}
html body #beta-hub.app-shell .shell-chips button[hidden]{display:none}
#beta-hub.app-shell .shell-chips svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Your games (online) */
#beta-hub.app-shell .shell-games-list{display:flex;flex-direction:column;gap:6px}
html body #beta-hub.app-shell .shell-room{display:flex;align-items:center;width:100%;min-height:56px;margin:0;padding:var(--space-2) var(--space-3);box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);color:var(--ink);font:inherit;text-align:left}
#beta-hub.app-shell .shell-room[data-turn=yours]{border-color:color-mix(in srgb,var(--accent) 55%,var(--line))}

/* Rows (Learn, Puzzles, Profile) and the course card */
#beta-hub.app-shell .shell-list,#beta-hub.app-shell .shell-card-list{display:flex;flex-direction:column;gap:6px;margin:0 0 var(--space-5)}
#beta-hub.app-shell .shell-card-list:empty{display:none}
html body #beta-hub.app-shell .shell-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-3);width:100%;min-height:60px;margin:0;padding:var(--space-2) var(--space-3) var(--space-2) var(--space-4);box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel);color:var(--ink);font:inherit;text-align:left;cursor:pointer}
#beta-hub.app-shell .shell-row>svg{width:22px;height:22px;fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#beta-hub.app-shell .shell-row strong{display:block;font-size:15px}
#beta-hub.app-shell .shell-row small{display:block;margin-top:2px;color:var(--muted);font-size:13px;line-height:1.35}
html body #beta-hub.app-shell .shell-feature{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-4);padding:var(--space-5) var(--space-4);border-radius:var(--radius-lg);border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 18%,var(--panel)),var(--panel));color:var(--ink);text-decoration:none}
#beta-hub.app-shell .shell-feature>svg{width:34px;height:34px;padding:10px;box-sizing:content-box;border-radius:16px;background:color-mix(in srgb,var(--accent) 16%,transparent);fill:none;stroke:var(--accent);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#beta-hub.app-shell .shell-feature strong{display:block;font-size:19px;font-weight:700}
#beta-hub.app-shell .shell-feature span{display:block;margin-top:4px;color:var(--muted);font-size:14px;line-height:1.4}
#beta-hub.app-shell .shell-progress{display:block;height:6px;margin-top:var(--space-3);border-radius:3px;background:color-mix(in srgb,var(--ink) 10%,transparent);overflow:hidden}
#beta-hub.app-shell .shell-progress>i{display:block;height:100%;width:0;border-radius:3px;background:var(--accent);transition:width .3s}
#beta-hub.app-shell .shell-language-slot:empty{display:none}
#beta-hub.app-shell .shell-language-slot>.shell-row>svg{width:22px;height:22px;fill:none;stroke:var(--accent);stroke-width:1.8}

/* Play a bot / Pass & play set-up: a page of its own */
#beta-hub.app-shell #beta-setup:not([hidden]){display:flex;flex-direction:column;gap:var(--space-4)}

/* Wide screens: one compact header keeps the page available to the content. */
@media(min-width:900px) and (min-height:501px){
 html body #beta-hub.app-shell[open]{grid-template-columns:minmax(0,1fr);grid-template-rows:64px minmax(0,1fr);grid-template-areas:"top" "main";--shell-top:64px}
 html body #beta-hub.app-shell>.shell-top{padding-left:20px;padding-right:20px}
 html body #beta-hub.app-shell>.shell-nav{grid-area:top;z-index:1;align-self:center;display:flex;flex-direction:row;justify-content:center;gap:4px;margin:0 170px 0 260px;padding:0;border:0;background:transparent}
 html body #beta-hub.app-shell .shell-nav button{flex-direction:row;justify-content:center;gap:7px;min-height:44px;padding:0 12px;font-size:14px;color:var(--muted)}
 html body #beta-hub.app-shell .shell-nav button[aria-current=page]{background:color-mix(in srgb,var(--ink) 7%,transparent);color:var(--ink);box-shadow:inset 0 -2px var(--ui-nav-mark)}
 #beta-hub.app-shell .shell-nav button[aria-current=page]::before{display:none}
 #beta-hub.app-shell .shell-nav svg{width:19px;height:19px}
 #beta-hub.app-shell .shell-modes{grid-template-columns:repeat(4,minmax(0,1fr))}
 html body #beta-hub.app-shell>[data-beta-page]{padding-top:var(--space-6)}
 html body #beta-hub.app-shell .shell-heading{font-size:19px}
 #beta-hub.app-shell .shell-brand .brand-wordmark{width:140px}
}
@media(min-width:900px) and (max-width:1100px) and (min-height:501px){
 html body #beta-hub.app-shell>.shell-nav{margin-left:225px;margin-right:160px;gap:0}
 html body #beta-hub.app-shell .shell-nav button{padding:0 10px}
 #beta-hub.app-shell .shell-nav svg{display:none}
}

/* Phone landscape: the navigation moves to a slim left rail to keep height for content */
@media(max-height:500px) and (orientation:landscape){
 html body #beta-hub.app-shell[open]{grid-template-columns:84px minmax(0,1fr);grid-template-rows:48px minmax(0,1fr);grid-template-areas:"nav top" "nav main";--shell-top:48px}
 html body #beta-hub.app-shell>.shell-nav{display:flex;flex-direction:column;justify-content:center;gap:2px;padding:var(--space-1) 4px;padding-left:max(4px,env(safe-area-inset-left));border-top:0;border-right:1px solid var(--line)}
 html body #beta-hub.app-shell .shell-nav button{flex:1;max-height:64px;font-size:10.5px}
 #beta-hub.app-shell .shell-nav button[aria-current=page]::before{display:none}
 html body #beta-hub.app-shell .shell-nav button[aria-current=page]{background:color-mix(in srgb,var(--ui-nav-mark) 13%,transparent)}
 #beta-hub.app-shell .shell-modes{grid-template-columns:repeat(4,minmax(0,1fr))}
 html body #beta-hub.app-shell .shell-mode{min-height:112px}
}
@media(max-width:360px){html body #beta-hub.app-shell .shell-mode{padding:var(--space-3);min-height:120px}#beta-hub.app-shell .shell-brand .brand-wordmark{width:104px}}
@media(prefers-reduced-motion:reduce){#beta-hub.app-shell .shell-mode{transition:none}}
html body #beta-hub.app-shell .start-game-icon{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;min-height:52px;font-size:16px;font-weight:700}
html body #beta-hub.app-shell .start-game-icon svg{width:20px;height:20px}

/* Daily puzzle and weekly challenge */
#beta-hub.app-shell .shell-daily-list,#beta-hub.app-shell .shell-daily{display:flex;flex-direction:column;gap:var(--space-2)}
#beta-hub.app-shell .shell-daily:empty{display:none}
html body #beta-hub.app-shell .shell-daily-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--space-3);width:100%;min-height:68px;margin:0;padding:var(--space-3) var(--space-3) var(--space-3) var(--space-3);box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);color:var(--ink);font:inherit;text-align:left;cursor:pointer;box-shadow:0 1px 2px #0000000f}
html body #beta-hub.app-shell .shell-daily-card.large{min-height:96px;padding:var(--space-4)}
#beta-hub.app-shell .shell-daily-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:color-mix(in srgb,#d5a938 22%,transparent);color:#9a6b0c}
#beta-hub.app-shell .shell-daily-card[data-kind=weekly] .shell-daily-icon{background:color-mix(in srgb,#7a58c4 20%,transparent);color:#6a48b4}
#beta-hub.app-shell .shell-daily-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#beta-hub.app-shell .shell-daily-text strong{display:block;font-size:16px;font-weight:700}
#beta-hub.app-shell .shell-daily-text small{display:block;margin-top:2px;color:var(--muted);font-size:13px;line-height:1.35}
#beta-hub.app-shell .shell-daily-text .shell-streak{color:#9a6b0c;font-weight:var(--weight-strong)}
#beta-hub.app-shell .shell-go.done{background:color-mix(in srgb,#2c7651 16%,transparent);color:#2c7651}
html[data-theme=dark] #beta-hub.app-shell .shell-daily-icon{color:#f0c65a}
html[data-theme=dark] #beta-hub.app-shell .shell-daily-card[data-kind=weekly] .shell-daily-icon{color:#b9a0f0}
html[data-theme=dark] #beta-hub.app-shell .shell-daily-text .shell-streak{color:#f0c65a}
html[data-theme=dark] #beta-hub.app-shell .shell-go.done{color:#7fd3a3}

/* Community (community-ui.mjs): moderation cards and the Creator card. */
#beta-hub.app-shell .mod-card{display:flex;flex-direction:column;gap:6px;box-sizing:border-box;padding:var(--space-3);border:1px solid var(--line);border-radius:var(--radius-md);background:var(--panel)}
#beta-hub.app-shell .mod-card strong{font-size:var(--text-md,15px);color:var(--ink)}
#beta-hub.app-shell .mod-card small{color:var(--muted);font-size:var(--text-xs,12.5px)}
#beta-hub.app-shell .mod-card p{margin:0;color:var(--ink);font-size:var(--text-sm);line-height:1.45;overflow-wrap:anywhere;white-space:pre-line}
#beta-hub.app-shell .mod-card p:empty{display:none}
html body #beta-hub.app-shell .mod-card a.shell-link{display:inline-flex;align-items:center;align-self:flex-start;padding:0;text-decoration:none}
html body #beta-hub.app-shell .mod-card button.shell-link{align-self:flex-start;padding:0}
#beta-hub.app-shell .mod-decide{display:flex;flex-direction:column;gap:var(--space-2);margin-top:4px}
html body #beta-hub.app-shell .mod-note,html body #beta-hub.app-shell .mod-grant input,html body #beta-hub.app-shell .mod-grant select{box-sizing:border-box;width:100%;min-height:var(--touch);margin:0;padding:0 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg);color:var(--ink);font:inherit;font-size:var(--text-sm)}
#beta-hub.app-shell .mod-actions{display:flex;flex-wrap:wrap;gap:var(--space-2)}
html body #beta-hub.app-shell .mod-actions .ui-button,html body #beta-hub.app-shell .mod-team .ui-button{min-height:40px;padding:0 var(--space-3)}
html body #beta-hub.app-shell :is(.mod-actions,.mod-team) .ui-button.ghost{border:1px solid var(--line);background:transparent;color:var(--ink)}
html body #beta-hub.app-shell .mod-team .ui-button{align-self:flex-start}
#beta-hub.app-shell .mod-grant{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:var(--space-2);align-items:center}
@media (max-width:480px){#beta-hub.app-shell .mod-grant{grid-template-columns:minmax(0,1fr) auto}#beta-hub.app-shell .mod-grant input{grid-column:1/-1}}

/* Dialogs over Home and the board: Become a Creator, Report, Publish as a puzzle. */
:is(.creator-request,.content-report,.publish-puzzle) form{display:flex;flex-direction:column;gap:var(--space-3);margin:0}
:is(.creator-request,.content-report,.publish-puzzle) p{margin:0;color:var(--muted);font-size:var(--text-sm);line-height:1.45}
:is(.creator-request,.content-report,.publish-puzzle) label{display:flex;flex-direction:column;gap:6px;color:var(--ink);font-size:var(--text-sm);font-weight:var(--weight-strong)}
:is(.creator-request,.content-report,.publish-puzzle) :is(textarea,input:not([type=radio])){box-sizing:border-box;width:100%;min-height:var(--touch);padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg);color:var(--ink);font:inherit;font-size:16px;font-weight:400;resize:vertical}
:is(.creator-request,.content-report,.publish-puzzle) :is(textarea,input:not([type=radio])):focus-visible,html body #beta-hub.app-shell :is(.mod-note,.mod-grant input,.mod-grant select):focus-visible{outline:none;border-color:var(--accent);box-shadow:var(--ui-focus)}
:is(.creator-request,.content-report,.publish-puzzle) [role=status]:empty{display:none}
.publish-puzzle .publish-puzzle-help{margin-top:-2px;color:var(--muted);font-size:var(--text-xs,12.5px);font-weight:400}
:is(.creator-request,.content-report,.publish-puzzle) [role=status]{color:var(--ink);font-weight:var(--weight-strong)}
.content-report fieldset{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;border:0}
.content-report legend{margin-bottom:6px;color:var(--ink);font-size:var(--text-sm);font-weight:var(--weight-strong)}
.content-report fieldset label{flex-direction:row;align-items:center;gap:10px;min-height:40px;font-weight:400}
.content-report fieldset input{width:20px;height:20px;margin:0;accent-color:var(--accent)}
:is(.creator-request-actions,.content-report-actions,.publish-puzzle-actions){display:flex;justify-content:flex-end;gap:var(--space-2);flex-wrap:wrap}
.publish-puzzle .publish-puzzle-verdict{padding:10px 12px;border-radius:var(--radius-sm);background:color-mix(in srgb,var(--accent) 12%,var(--panel));color:var(--ink);font-weight:var(--weight-strong)}
.publish-puzzle[data-valid=false] .publish-puzzle-verdict{background:color-mix(in srgb,#d9534f 12%,var(--panel))}
.publish-puzzle .ui-button[disabled]{opacity:.45;cursor:not-allowed}

/* A community puzzle's credit line and Report link on the puzzle card. */
#puzzle-card .puzzle-source .puzzle-credit{margin-right:8px}
#puzzle-card .puzzle-report{display:inline;min-height:0;padding:0;border:0;background:none;color:var(--accent);font:inherit;font-weight:var(--weight-strong,600);text-decoration:underline;text-underline-offset:2px;cursor:pointer}

.creator-request .creator-guidelines{padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:color-mix(in srgb,var(--ink) 3%,var(--panel))}
.creator-request .creator-guidelines summary{color:var(--ink);font-size:var(--text-sm);font-weight:var(--weight-strong);cursor:pointer}
.creator-request .creator-guidelines ul{margin:8px 0 0;padding-left:18px;display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:var(--text-sm);line-height:1.45}
.creator-request .creator-guidelines strong{color:var(--ink)}
.creator-request label.creator-request-agree{flex-direction:row;align-items:center;gap:10px;font-weight:400}
.creator-request .creator-request-agree input{width:20px;height:20px;margin:0;accent-color:var(--accent)}

/* Rows that are links (community lessons, the studio) look like the other rows. */
html body #beta-hub.app-shell a.shell-row,html body #beta-hub.app-shell a.shell-row :is(strong,small){text-decoration:none;color:inherit}
html body #beta-hub.app-shell a.shell-row small{color:var(--muted)}
/* One primary colour across Home: moderation decisions match Solve and Start. */
html body #beta-hub.app-shell :is(.mod-actions,.mod-grant) .ui-button.primary{border-color:transparent;background:var(--ui-primary);color:var(--ui-on-primary)}
/* A practice deck with cards due shows the count as a badge. */
#beta-hub.app-shell .shell-due{display:inline-grid;place-items:center;min-width:22px;height:22px;margin-right:8px;padding:0 6px;border-radius:11px;background:var(--accent);color:var(--panel);font-size:12px;font-weight:700;vertical-align:middle}

/* Fair play cases (community-ui.mjs): evidence, not verdicts. */
#beta-hub.app-shell .fp-case:empty{display:none}
#beta-hub.app-shell .fp-case{display:flex;flex-direction:column;gap:6px;margin-top:6px;padding-top:8px;border-top:1px dashed var(--line)}
#beta-hub.app-shell .fp-line{margin:0;font-size:13.5px;color:var(--ink)}
html body #beta-hub.app-shell .fp-sub{margin:8px 0 2px;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
#beta-hub.app-shell .fp-games{display:flex;flex-direction:column;gap:8px}
#beta-hub.app-shell .fp-game{display:flex;flex-direction:column;gap:4px;padding:10px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg)}
#beta-hub.app-shell .fp-game strong{font-size:14px}#beta-hub.app-shell .fp-game small{color:var(--muted);font-size:12.5px}
#beta-hub.app-shell .fp-who{margin-top:4px;font-weight:700}
#beta-hub.app-shell .fp-bars{display:flex;align-items:flex-end;gap:1px;height:34px;padding:2px 0;border-bottom:1px solid var(--line)}
#beta-hub.app-shell .fp-bars i{flex:1 1 0;min-width:2px;max-width:8px;background:color-mix(in srgb,var(--accent) 70%,transparent);border-radius:1px 1px 0 0}
#beta-hub.app-shell .fp-bars i[data-fast]{background:#d1812f}
#beta-hub.app-shell .fp-void{margin:4px 0 0;padding:6px 8px;border-left:4px solid #d1812f;background:color-mix(in srgb,#d1812f 12%,transparent);border-radius:6px;font-size:13px}

.shell-study-tools>button{margin:0 8px 8px 0}.shell-modes>#beta-invite{border-color:var(--accent,#d5b974)}

/* Contextual Help starts compact, then opens only the topic requested. */
#phone-help{height:auto;max-height:calc(100dvh - 32px);width:min(460px,calc(100% - 24px));border-radius:16px;overflow:auto}
#phone-help .help-topics{display:grid;gap:6px}
#phone-help .help-topic{border:1px solid var(--line);border-radius:10px;padding:0 12px}
#phone-help .help-topic>summary{cursor:pointer;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:16px;list-style:none}
#phone-help .help-topic>summary::after{content:'+';color:var(--muted)}
#phone-help .help-topic[open]>summary::after{content:'−'}
#phone-help .help-topic h3{font-size:15px;margin:14px 0 4px;text-transform:none;letter-spacing:normal}
#phone-help .help-topic p,#phone-help .help-bugs li{font-size:15px;line-height:1.45;margin:0 0 12px}
#phone-help .help-bugs{margin:6px 0 12px}
#phone-help .help-links{grid-template-columns:1fr}
#phone-help .help-links .ui-button{font-size:14px;padding:8px;justify-content:center}
#beta-hub .shell-study-tools .shell-chips{margin-bottom:0}

/* A calendar week, shared by Play and Puzzles. */
.daily-week{padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--ink)}
.daily-week-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:13px}.daily-week-heading span{color:var(--muted)}
.daily-week-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin:0;padding:0;list-style:none}
.daily-week-days li{display:flex;flex-direction:column;align-items:center;gap:6px;color:var(--muted);font-size:12px}
.daily-week-mark{display:grid;place-items:center;position:relative;width:28px;height:30px;box-sizing:border-box;color:var(--muted);font-size:18px;font-weight:700}
.daily-week-mark>svg{width:100%;height:100%;fill:none;stroke:var(--line);stroke-width:1.5}
.daily-week-mark>b{position:absolute;line-height:1;font-size:16px}
.daily-week-days [data-solved=true] .daily-week-mark{color:var(--panel)}
.daily-week-days [data-solved=true] .daily-week-mark>svg{fill:var(--ink);stroke:var(--ink)}
.daily-week-days [aria-current=date]{color:var(--ink);font-weight:700}.daily-week-days [aria-current=date] .daily-week-mark>svg{stroke:var(--accent);stroke-width:2.5}
.daily-week-days [data-future=true] .daily-week-mark>svg{stroke-dasharray:2 2}
.puzzle-streak-summary .daily-week{margin:8px 0;padding:12px 0;border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0}
.calculation-feature .shell-row{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--panel))}
.puzzle-streak-summary{display:flex;flex-direction:column;gap:5px;margin-bottom:12px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.puzzle-streak-summary>strong{font-size:23px}.puzzle-streak-summary>span{font-size:14px;color:var(--muted)}
.puzzle-streak-summary>small{font-size:14px;line-height:1.4}.puzzle-streak-summary .puzzle-local-note{font-size:12px;color:var(--muted)}
.puzzle-milestones summary{font-size:14px;min-height:40px;line-height:40px;cursor:pointer}.puzzle-milestones p{font-size:14px;color:var(--muted)}
.puzzle-streak-badges{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.puzzle-streak-badge{display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px;border:1px solid var(--line);border-radius:12px;color:var(--muted)}
.puzzle-streak-badge[data-earned=true]{border-color:var(--accent);color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,var(--panel))}
.puzzle-streak-badge svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.6}.puzzle-streak-badge strong{font-size:14px}.puzzle-streak-badge small{font-size:12px}
#beta-hub .challenge-tiers{margin-bottom:12px;min-height:44px}

/* The Play hub fits the next game and today's challenge into one rhythm. */
html body #beta-hub.app-shell .shell-play{gap:18px}
html body #beta-hub.app-shell .shell-play .shell-heading{font-size:17px;margin-bottom:8px}
html body #beta-hub.app-shell .shell-mode{padding:12px;gap:3px;border-radius:14px;display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;align-content:center;column-gap:9px;min-height:100px;box-shadow:none}
#beta-hub.app-shell .shell-mode svg{grid-column:1;grid-row:1;width:21px;height:21px;padding:5px;margin:0;border-radius:8px}
#beta-hub.app-shell .shell-mode strong{grid-column:2;grid-row:1;align-self:center;margin:0;font-size:15px}
#beta-hub.app-shell .shell-mode span{grid-column:1/-1;grid-row:2;font-size:14px;line-height:1.3;margin-top:5px}
#beta-hub.app-shell #shell-new .shell-heading-row{align-items:center;margin-bottom:8px}
#beta-hub.app-shell #shell-new .shell-heading{margin:0}
#beta-hub.app-shell #beta-scan-qr{display:inline-flex;align-items:center;gap:5px;min-height:34px;padding:4px 8px;border:0;background:transparent;color:var(--ink);font-size:13px}
#beta-hub.app-shell #beta-scan-qr svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7}
#beta-hub.app-shell .shell-chips:empty{display:none}
#beta-hub.app-shell #shell-today-list{gap:0;border:1px solid var(--line);border-radius:14px;background:var(--panel);overflow:hidden}
html body #beta-hub.app-shell #shell-today-list .shell-daily-card{border:0;box-shadow:none;border-radius:0;padding:12px;min-height:80px}
#beta-hub.app-shell #shell-today-list .daily-week{margin:0;padding:10px 12px;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent}
#beta-hub.app-shell #shell-today-list .daily-week-heading{font-size:13px;margin-bottom:7px}
#beta-hub.app-shell #shell-today-list .daily-week-mark{width:24px;height:24px}
#beta-hub.app-shell #shell-today-list .daily-week-days{gap:4px}
#beta-hub.app-shell .shell-continue-row{min-height:62px;padding:10px 12px;border-radius:14px;box-shadow:none}
#beta-hub.app-shell .shell-continue-row strong{font-size:16px}
/* Learn uses real course positions and a single, clear route into each course. */
html body #beta-hub.app-shell[data-page=learn]{--shell-max:1040px}
#beta-hub.app-shell [data-beta-page=learn] .shell-page{gap:22px}
#beta-hub.app-shell .learn-home-heading{margin:0}
#beta-hub.app-shell .learn-home-heading h2{margin:0 0 4px;font-size:28px;letter-spacing:-.035em}
#beta-hub.app-shell .learn-home-heading p{margin:0;color:var(--muted);font-size:15px}
#beta-hub.app-shell .learn-entry{display:grid;grid-template-columns:1fr 1.1fr;min-height:240px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--ink);overflow:hidden;text-decoration:none;margin-bottom:0}
#beta-hub.app-shell .learn-entry-copy{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:12px;padding:24px;min-width:0}
#beta-hub.app-shell .learn-level{font-size:11px;letter-spacing:.05em;font-weight:650;color:var(--muted)}
#beta-hub.app-shell .learn-entry-copy>strong{font-size:25px;line-height:1.15;letter-spacing:-.025em}
#beta-hub.app-shell #learn-entry-detail{font-size:15px;line-height:1.5;color:var(--muted)}
#beta-hub.app-shell .learn-entry .shell-progress{width:100%;margin:0;height:4px}
#beta-hub.app-shell .learn-entry[data-state=new] .shell-progress{display:none}
#beta-hub.app-shell .learn-card-action{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:14px;font-weight:650;color:var(--ink)}
#beta-hub.app-shell .learn-entry .learn-card-action{padding:10px 14px;border-radius:8px;background:var(--ui-primary);color:var(--ui-on-primary);min-height:44px;box-sizing:border-box}
#beta-hub.app-shell :is(.learn-entry-board,.learn-track-board){min-width:0;overflow:hidden;background:var(--bg)}
#beta-hub.app-shell :is(.learn-entry-board,.learn-track-board)>.position-preview{display:block;width:100%;height:100%}
#beta-hub.app-shell .learn-entry-board{min-height:240px}
#beta-hub.app-shell .shell-skill-tracks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#beta-hub.app-shell .shell-skill-track{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel);text-decoration:none;color:var(--ink)}
#beta-hub.app-shell .learn-track-board{height:168px}
#beta-hub.app-shell .learn-track-copy{display:flex;flex-direction:column;gap:7px;padding:16px;flex:1}
#beta-hub.app-shell .learn-track-copy>small{font-size:11px;letter-spacing:.03em;font-weight:650;color:var(--muted)}
#beta-hub.app-shell .learn-track-copy>strong{font-size:18px;line-height:1.3;letter-spacing:-.02em}
#beta-hub.app-shell .learn-track-copy>span{font-size:14px;line-height:1.45;color:var(--muted)}
#beta-hub.app-shell .learn-track-copy .learn-card-action{padding-top:8px;margin-top:auto}
#beta-hub.app-shell :is(.learn-entry,.shell-skill-track):hover{border-color:var(--accent)}
#beta-hub.app-shell :is(.learn-entry,.shell-skill-track):focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media(max-width:600px){
 #beta-hub.app-shell .learn-entry{grid-template-columns:1fr;margin-bottom:0}
 #beta-hub.app-shell .learn-entry-board{grid-row:1;height:190px;min-height:0}
 #beta-hub.app-shell .learn-entry-copy{padding:18px;gap:10px}
 #beta-hub.app-shell .shell-skill-tracks{grid-template-columns:1fr}
 #beta-hub.app-shell .shell-skill-track{display:grid;grid-template-columns:116px minmax(0,1fr)}
 #beta-hub.app-shell .learn-track-board{height:100%;min-height:174px}
 #beta-hub.app-shell .learn-track-copy{padding:14px;gap:6px}
 #beta-hub.app-shell .learn-track-copy>strong{font-size:16px}
}

#beta-setup .lesson-practice-note{border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--panel)}
#beta-setup .lesson-practice-note strong{font-size:14px}#beta-setup .lesson-practice-note p{font-size:14px;line-height:1.5;margin:6px 0 8px}#beta-setup .lesson-practice-note small{display:block;color:var(--muted);font-size:12px;line-height:1.5}#beta-setup .lesson-practice-note a{display:inline-block;padding:10px 0 0;font-size:13px;color:var(--ink);text-underline-offset:3px}
