:root {
  color-scheme: light;
  --font: Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
  font-family:var(--font); font-size:16px; font-synthesis:none;
}
:root,.theme-preview {
  --paper:#f6f8f4; --surface:#fff; --sidebar-paper:#fcfdfb; --ink:#182c23; --muted:#51665a; --ui-ink:#344b3d;
  --accent:#245740; --accent-hover:#194631; --accent-border:#cddbd0; --focus-ring:#568c63;
  --line:#dfe7dd; --line-soft:#edf1eb; --soft:#edf3ea; --nav-active:#e9f1e7; --row-hover:#f2f6ef;
  --ball-fill:#e7f0e6; --ball-ink:#1f523a; --chart-fill:#d9edda; --chart-line:#306c48; --chart-bar:#679a71;
  --hero-bg:radial-gradient(ellipse at 81% 28%,#326c49 0%,#235a3f 39%,#1d4b37 78%);
  --login-bg:radial-gradient(ellipse at 70% 15%,#39774e,#23573d 47%,#183f2f 86%);
  --hero-ink:#fff; --hero-note:#e1f0e3; --hero-highlight:#e2efa9; --hero-outline:#b4cab8;
  --hero-glass:#fff1; --hero-glass-hover:#fff2;
  --hero-action:#e3f0a5; --hero-action-hover:#f0f8ba; --hero-action-ink:#214632;
  --art-line:#e1f4c34d; --nav-overlay:#163c2e65; --shadow:0 8px 28px #2347340b;
  --title-font:var(--font); --panel-radius:14px; --banner-radius:17px;
}
:root[data-theme="chinese-red"],.theme-preview[data-preview="chinese-red"] {
  --paper:#fff6f2; --surface:#fffdfb; --sidebar-paper:#fffaf7; --ink:#3d171c; --muted:#734951; --ui-ink:#5e2731;
  --accent:#a12334; --accent-hover:#7e1324; --accent-border:#e6c9c7; --focus-ring:#b23543;
  --line:#efd9d5; --line-soft:#f7e8e4; --soft:#f9e7e4; --nav-active:#f7dddc; --row-hover:#fff0eb;
  --ball-fill:#f7e0dc; --ball-ink:#8a2734; --chart-fill:#f4cacc; --chart-line:#a12334; --chart-bar:#ce6670;
  --hero-bg:#fcebe5; --login-bg:var(--hero-bg);
  --hero-ink:#5d222b; --hero-note:#75434a; --hero-highlight:#942d40; --hero-outline:#bf8890;
  --hero-action:#f6d0ca; --hero-action-hover:#f0bfb7; --hero-action-ink:#672532;
  --hero-glass:#fffc; --hero-glass-hover:#fff;
  --theme-illustration:url("/themes/chinese-red-wash.webp");
  --nav-overlay:#541b286f; --shadow:0 8px 28px #87203712;
  --title-font:"Songti SC","Noto Serif CJK SC","SimSun",serif; --panel-radius:12px; --banner-radius:15px;
}
:root[data-theme="fortune"],.theme-preview[data-preview="fortune"] {
  --paper:#fdf3f7; --surface:#fffafd; --sidebar-paper:#fffbfd; --ink:#351b31; --muted:#70495d; --ui-ink:#63354f;
  --accent:#8a2954; --accent-hover:#682044; --accent-border:#e4c4d4; --focus-ring:#9c4565;
  --line:#eed7e1; --line-soft:#f6e6ed; --soft:#f7e6ef; --nav-active:#f3dced; --row-hover:#fcf0f6;
  --ball-fill:#f1ddea; --ball-ink:#6f2a54; --chart-fill:#eed0e2; --chart-line:#8a2954; --chart-bar:#bd638e;
  --hero-bg:#f9e9e9; --login-bg:var(--hero-bg);
  --hero-ink:#542b46; --hero-note:#6f455e; --hero-highlight:#873652; --hero-outline:#ba899e;
  --hero-action:#f4dbad; --hero-action-hover:#edce98; --hero-action-ink:#603b32;
  --hero-glass:#fffc; --hero-glass-hover:#fff;
  --theme-illustration:url("/themes/fortune-wash.webp");
  --nav-overlay:#421d406e; --shadow:0 8px 28px #7b2a5412;
  --panel-radius:18px; --banner-radius:23px;
}
:root[data-theme="auspicious-gold"],.theme-preview[data-preview="auspicious-gold"] {
  --paper:#fcf7e9; --surface:#fffdf6; --sidebar-paper:#fefaf1; --ink:#362713; --muted:#6e5938; --ui-ink:#584424;
  --accent:#785016; --accent-hover:#593909; --accent-border:#dccbaa; --focus-ring:#8e6423;
  --line:#ebdfc6; --line-soft:#f0e7d3; --soft:#f7ecd4; --nav-active:#f3e5c7; --row-hover:#f9f1de;
  --ball-fill:#f4e5c3; --ball-ink:#664718; --chart-fill:#f0d99b; --chart-line:#785016; --chart-bar:#b48945;
  --hero-bg:#fcf1d9; --login-bg:var(--hero-bg);
  --hero-ink:#51381d; --hero-note:#695132; --hero-highlight:#77501e; --hero-outline:#b09469;
  --hero-action:#f3dcaa; --hero-action-hover:#ecd098; --hero-action-ink:#523715;
  --hero-glass:#fffc; --hero-glass-hover:#fff;
  --theme-illustration:url("/themes/auspicious-gold-wash.webp");
  --nav-overlay:#3727196e; --shadow:0 8px 28px #66471816;
  --title-font:"Songti SC","Noto Serif CJK SC","SimSun",serif; --panel-radius:12px; --banner-radius:13px;
}
*,*::before,*::after {box-sizing:border-box}
body {margin:0; color:var(--ink); background:var(--paper); min-width:300px}
button,input,select,textarea {font:inherit; color:inherit}
button {cursor:pointer}
button:disabled {cursor:wait; opacity:.65}
a {color:var(--accent); text-underline-offset:.19em}
a:hover {color:var(--accent-hover)}
:focus-visible {outline:3px solid var(--focus-ring); outline-offset:3px}
h1,h2,h3,p {margin-top:0}
h1 {font-size:clamp(1.85rem,3.1vw,2.65rem); line-height:1.22; letter-spacing:-.045em; margin-bottom:.55rem}
h2 {font-size:1.24rem; letter-spacing:-.025em; margin-bottom:.35rem}
h3 {font-size:1.06rem; margin-bottom:.42rem}
p {line-height:1.65}
small,.small {font-size:.82rem}
.muted {color:var(--muted)}
.mt {margin-top:1.15rem}
.icon {width:19px; height:19px; flex:none; vertical-align:middle}
.skip {position:absolute; top:1rem; left:1rem; transform:translateY(-500%); z-index:20; background:var(--surface); padding:.75rem}
.skip:focus {transform:none}
.initial {display:grid; place-items:center; min-height:100vh; color:var(--muted)}
.layout {min-height:100vh; display:grid; grid-template-columns:228px minmax(0,1fr)}
.sidebar {background:var(--sidebar-paper); border-right:1px solid var(--line); position:sticky; top:0; height:100dvh; display:flex; flex-direction:column; padding:27px 16px 18px; z-index:5; overflow:auto}
.brand {display:flex; gap:.7rem; align-items:center; color:var(--ink); text-decoration:none; min-width:0}
.sidebar .brand {margin:0 .35rem 2.1rem}
.brand .brand-mark {display:grid; place-items:center; flex:none; width:42px; height:42px; border-radius:13px; margin:0; background:var(--accent); color:#fff}
.brand strong {display:block; font-size:1.23rem; letter-spacing:.02em; line-height:1.1}
.brand span {display:block; font-size:.71rem; color:var(--muted); margin-top:.32rem; letter-spacing:.07em}
.nav-group {margin-bottom:1.28rem}
.nav-label {font-size:.76rem; color:var(--muted); padding:.28rem .67rem .52rem; margin:0; letter-spacing:.06em}
.nav-item {display:flex; width:100%; gap:.65rem; align-items:center; padding:.64rem .65rem; min-height:42px; border-radius:9px; text-decoration:none; color:var(--ui-ink); font-size:.9rem; margin:.14rem 0; font-weight:550}
.nav-item .caret {margin-left:auto; width:14px; height:14px}
.nav-item.active,.nav-item:hover {background:var(--nav-active); color:var(--accent-hover)}
.nav-item.active {font-weight:700}
.subnav {margin:.15rem 0 .35rem 1.13rem; padding-left:.76rem; border-left:1px solid var(--line)}
.subnav .nav-item {font-size:.86rem; min-height:36px; padding:.42rem .58rem}
.sidebar-foot {margin-top:auto; border-top:1px solid var(--line); padding:1rem .35rem 0}
.sidebar-foot .nav-item {padding:.55rem .45rem}
.updates-unread {display:grid; place-items:center; flex:none; margin-inline-start:auto; min-width:1.25rem; height:1.25rem; padding:0 .2rem; border-radius:999px; background:#b91c30; color:#fff; font-size:.68rem; font-weight:750; line-height:1; font-variant-numeric:tabular-nums}
.updates-unread[hidden] {display:none}
.shell {min-width:0}
.topbar {height:72px; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:0 clamp(1rem,3vw,2.5rem); background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:4}
.topbar-actions {display:flex; align-items:center; gap:.65rem; flex:none}
.button.desktop-phone {color:var(--accent); white-space:nowrap}
.desktop-phone .icon {height:17px;width:17px}
.crumb {display:flex; align-items:center; gap:.6rem; font-size:.88rem; color:var(--muted)}
.crumb a {text-decoration:none; color:var(--muted)}
.crumb strong {color:var(--ink)}
.user-chip {display:flex; align-items:center; gap:.65rem; background:none; border:0; padding:.22rem; text-align:left; border-radius:12px}
.user-chip span:last-child {font-size:.85rem; font-weight:650}
.avatar {border-radius:50%; width:32px; height:32px; background:var(--soft); color:var(--accent); display:grid; place-items:center; font-size:.88rem; font-weight:750}
.topbar .mobile-toggle,.mobile-scrim,.mobile-game-picker {display:none}
.workspace {padding:clamp(1rem,3vw,2.5rem); max-width:1570px; margin-inline:auto}
.page-head {display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1.18rem}
.page-head p {margin:0; color:var(--muted)}
.kicker {margin:0 0 .48rem; color:var(--accent); font-size:.8rem; font-weight:720; letter-spacing:.11em}
.hero {min-height:245px; display:flex; align-items:center; position:relative; isolation:isolate; overflow:hidden; border-radius:var(--banner-radius); padding:clamp(1.3rem,3.1vw,2.45rem); color:var(--hero-ink); background:var(--hero-bg)}
.hero-copy {max-width:min(66%,660px); position:relative; z-index:1}
.hero h2 {font-family:var(--title-font); font-size:clamp(1.65rem,3.3vw,3rem); line-height:1.24; margin:.25rem 0 .65rem; letter-spacing:-.05em; font-weight:770}
.hero p {color:var(--hero-note); font-size:.96rem; margin-bottom:1.22rem}
.hero .kicker {color:var(--hero-highlight); display:flex; align-items:center; gap:.45rem; font-size:.8rem; margin-bottom:.58rem}
.orbit {position:absolute; inset:0 0 0 auto; width:44%; pointer-events:none; overflow:hidden}
.ring {position:absolute; width:355px; height:355px; top:-39px; right:10%; border-radius:50%; border:1px solid var(--art-line)}
.ring:nth-child(2) {transform:scale(.77)}
.ring:nth-child(3) {transform:scale(.54)}
.ring:nth-child(4) {transform:scale(1.24)}
.art-ball {position:absolute; border-radius:50%; display:grid; place-items:center; height:clamp(52px,7vw,92px); aspect-ratio:1; background:radial-gradient(circle at 33% 27%,#f1fbbc,#c5da76 80%); color:#234a37; font-size:clamp(1.25rem,2.6vw,2.2rem); font-weight:820; box-shadow:3px 10px 25px #092d2470, inset 0 1px 4px #f8ffb6; font-variant-numeric:tabular-nums}
.art-ball.first {top:22%; left:22%; transform:rotate(-17deg)}
.art-ball.second {top:41%; left:48%; background:radial-gradient(circle at 25% 20%,#fff7bc,#eabc59 83%); color:#51391e; transform:rotate(11deg); height:clamp(44px,5.5vw,76px)}
.art-ball.third {top:15%; left:68%; height:clamp(36px,4.5vw,61px); background:radial-gradient(circle at 24% 20%,#d8efcb,#8fc398 83%); transform:rotate(18deg); font-size:clamp(.95rem,1.7vw,1.5rem)}
.spark {position:absolute; color:var(--hero-highlight); font-size:1.22rem}
.spark.a {top:62%;left:26%}.spark.b {top:23%;left:54%}.spark.c {top:64%;left:79%}
.actions {display:flex; flex-wrap:wrap; align-items:center; gap:.58rem}
.button {display:inline-flex; align-items:center; justify-content:center; gap:.45rem; min-height:42px; padding:.56rem .86rem; font-weight:660; font-size:.87rem; border:1px solid transparent; border-radius:9px; text-decoration:none; line-height:1.25; background:var(--accent); color:#fff; white-space:nowrap}
.button:hover {background:var(--accent-hover); color:#fff}
.button.outline {background:var(--surface); border-color:var(--accent-border); color:var(--accent)}
.button.outline:hover,.button.quiet:hover {background:var(--soft)}
.button.quiet {background:transparent; color:var(--accent)}
.button.lime {color:var(--hero-action-ink); background:var(--hero-action)}
.button.lime:hover {background:var(--hero-action-hover)}
.button.glass {background:var(--hero-glass); border-color:var(--hero-outline); color:var(--hero-ink)}
.button.glass:hover {background:var(--hero-glass-hover)}
.button.danger {background:#fff4ee; color:#a12f21; border-color:#f3d4cb}
.button.danger:hover {background:#ffe8df}
.button.compact {padding:.43rem .65rem; min-height:36px}
.button.icon-only {padding:.45rem}
.metrics {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.85rem; margin:1rem 0 1.3rem}
.metric {display:flex; align-items:center; gap:.78rem; padding:1rem; background:var(--surface); border:1px solid var(--line); border-radius:13px}
.metric .glyph,.glyph {display:grid; place-items:center; width:42px; height:42px; border-radius:10px; background:var(--soft); color:var(--accent); flex:none}
.glyph.gold {color:#936229; background:#fbefdc}
.glyph.rose {color:#a44434; background:#fbece8}
.metric p {margin:0 0 .08rem; color:var(--muted); font-size:.82rem; line-height:1.35}
.metric strong {font-size:1.17rem; font-variant-numeric:tabular-nums}
.grid2 {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.9rem}
.grid-main {display:grid; grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); gap:.9rem}
.grid4 {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.85rem}
.card {padding:1.1rem; min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:var(--panel-radius); box-shadow:var(--shadow)}
.section-head {display:flex; justify-content:space-between; align-items:center; gap:.8rem; margin-bottom:.78rem}
.section-head h2,.section-head p {margin:0}
.analysis-head {flex-wrap:wrap}
.analysis-filters {display:flex; flex-wrap:wrap; align-items:flex-end; gap:.55rem .75rem}
.release-updates {max-width:860px}
.release-updates ol {list-style:none; margin:0; padding:0}
.release-updates li {padding:.95rem 0; border-bottom:1px solid var(--line-soft)}
.release-updates li:first-child {padding-top:0}
.release-updates li:last-child {padding-bottom:0; border-bottom:0}
.release-update-heading {display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:.3rem 1.25rem; margin-bottom:.35rem}
.release-update-heading h2 {margin:0; font-size:1.02rem}
.release-update-heading time {font-size:.8rem; color:var(--muted); font-variant-numeric:tabular-nums}
.release-updates p {margin:0; color:var(--muted); font-size:.91rem}
.today-sales {margin-top:1rem}
.sale-heading {flex-wrap:wrap; margin-bottom:.38rem}
.sale-heading h2 {display:flex; align-items:center; gap:.45rem}
.sale-heading .icon {color:var(--accent)}
.sale-heading time,.sale-note {color:var(--muted); font-size:.8rem}
.sale-note {margin:0 0 .65rem}
.sale-note:last-child {margin-bottom:0}
.sale-note a {margin-inline-start:.35rem}
.sale-grid {display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr)); gap:.48rem; list-style:none; padding:0; margin:0}
.sale-card {display:grid; gap:.28rem; min-height:100%; padding:.6rem .72rem; border:1px solid var(--line); border-radius:10px; color:var(--ink); text-decoration:none}
.sale-card:hover,.sale-card:focus-visible {background:var(--row-hover); border-color:var(--accent-border)}
.sale-name {display:flex; align-items:center; justify-content:space-between; gap:.28rem; font-size:.9rem; font-weight:700}
.sale-name .icon {width:14px; height:14px; color:var(--muted)}
.sale-time {font-size:.85rem; color:var(--accent); font-variant-numeric:tabular-nums; font-weight:700}
.sale-time small {color:var(--muted); font-size:.72rem; font-weight:500}
.sale-past .sale-time {color:var(--muted)}
.sale-upcoming {margin-top:.62rem; font-size:.83rem}
.sale-upcoming .sale-note {margin-top:.5rem}
.section {margin-top:1.3rem}
.draw-category + .draw-category {margin-top:.5rem}
.draw-category h3 {margin:0; padding:.37rem .65rem; border-radius:8px; background:var(--row-hover); color:var(--accent); font-size:.88rem}
.draw-list {list-style:none; padding:0; margin:0}
.draw-row {display:grid; grid-template-columns:7.1rem minmax(0,1fr); gap:.75rem; padding:.75rem 0; border-top:1px solid var(--line-soft); align-items:center}
.draw-row:first-child {border-top:0}
.draw-row a {color:var(--ink); font-size:.89rem; text-decoration:none; font-weight:700}
.draw-row a:hover {color:var(--accent); text-decoration:underline}
.draw-row small {display:block; margin-top:.21rem; font-variant-numeric:tabular-nums}
.draw-meta time {display:block}
.balls,.ball-group {display:flex; align-items:center; gap:.31rem; flex-wrap:wrap}
.balls {gap:.38rem}
.ball-group + .ball-group::before {content:""; height:1.03rem; width:1px; background:var(--line); margin:0 .12rem}
.ball {width:1.85rem;height:1.85rem;display:inline-grid;place-items:center;border-radius:50%;background:var(--ball-fill);color:var(--ball-ink);font-variant-numeric:tabular-nums;font-size:.79rem;font-weight:780;flex:none}
.ball.secondary {background:#e8eef9;color:#2b4a7f}
.ball.red,.history-table[data-game="dlt"] .ball-group:first-child .ball {background:#fae8e4;color:#9a3a30}
.ball.fixed {background:#f9ebc9;color:#744b16; border:1px solid #ead096}
.ball.pin {box-shadow:inset 0 0 0 1px var(--accent-border)}
.shortcut {display:flex; align-items:center; gap:.7rem; padding:.62rem .2rem; text-decoration:none; color:var(--ink); border-top:1px solid var(--line-soft)}
.shortcut:hover strong {text-decoration:underline}
.shortcut:first-of-type {border-top:0}
.shortcut strong,.shortcut small {display:block}
.shortcut small {color:var(--muted); margin-top:.15rem}
.shortcut .glyph {width:37px; height:37px}
.game-card .glyph {margin-bottom:.75rem}
.game-card h2 {margin:.15rem 0 .4rem}
.game-card p {font-size:.86rem; color:var(--muted)}
.game-card .balls {margin:.7rem 0}
.tag {display:inline-flex; align-items:center; flex:none; gap:.3rem; padding:.23rem .48rem; border-radius:99px; background:var(--soft); color:var(--accent); font-size:.75rem; font-weight:670}
.tag.warn {background:#fbefda;color:#865922}
.tag.error {background:#fae9e5;color:#973f30}
.tag.neutral {background:#f0f3ef;color:#526357}
.tabs {display:flex; gap:.24rem; overflow:auto; margin:.1rem 0 1rem; border-bottom:1px solid var(--line)}
.tab {flex:none; border:0; border-bottom:3px solid transparent; background:none; text-decoration:none; color:var(--muted); padding:.65rem .85rem .75rem; min-height:44px; font-size:.92rem}
.tab.selected {border-bottom-color:var(--accent); font-weight:750; color:var(--accent)}
.toolbar {display:flex;flex-wrap:wrap;align-items:end;gap:.7rem}
.toolbar label,.field {display:flex; flex-direction:column; gap:.34rem; font-size:.85rem; font-weight:640; color:var(--ui-ink)}
input,select,textarea {width:100%; border:1px solid var(--accent-border); border-radius:8px; background:var(--surface); min-height:42px; padding:.54rem .67rem}
select {appearance:none; padding-right:2.1rem; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:calc(100% - 14px) center,calc(100% - 9px) center; background-size:5px 5px; background-repeat:no-repeat}
textarea {min-height:126px; resize:vertical}
input[type=checkbox] {width:1.12rem; min-height:1.12rem; accent-color:var(--accent)}
.check {display:inline-flex; align-items:center; gap:.45rem; font-size:.86rem}
.form {display:grid; gap:.8rem}
.form-row {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem}
.form-row.three {grid-template-columns:repeat(3,minmax(0,1fr))}
.form-note {font-size:.86rem; color:var(--muted); margin:0}
.form-error,.history-check-error {color:#973b2c; margin:0; font-size:.88rem; line-height:1.5}
.form-error:empty,.history-check-error:empty {display:none}
.error-box,.notice {padding:.8rem .9rem; border-radius:9px; background:var(--soft); color:var(--ui-ink); font-size:.87rem; line-height:1.55}
.error-box {background:#fbeae5;color:#96372a}
.empty {padding:1.4rem .65rem; color:var(--muted); text-align:center; line-height:1.6}
.table-wrap {overflow:auto}
table {width:100%; text-align:left; border-collapse:collapse; font-size:.875rem}
th {color:var(--ui-ink); font-size:.8rem; font-weight:680; background:var(--row-hover)}
td,th {padding:.65rem .7rem; border-bottom:1px solid var(--line-soft)}
td:first-child,th:first-child {border-radius:3px}
td .balls {min-width:9.6rem}
td .actions {flex-wrap:nowrap}
tr:last-child td {border-bottom:0}
tr:focus-within {background:var(--row-hover)}
/* Keep the native date controls inside grid tracks, including on mobile WebKit. */
.history-filters,.history-dates {display:grid; align-items:end; gap:.65rem}
.history-filters {grid-template-columns:minmax(8rem,1fr) minmax(0,2fr) auto}
.history-dates {grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr))}
.history-filters .field,.history-filters input {min-width:0; max-width:100%}
.history-filters input[type="date"] {display:block; appearance:none; -webkit-appearance:none}
.history-filters input[type="date"]::-webkit-date-and-time-value {min-height:1.25em; text-align:start}
.history-filters .form-error {grid-column:1/-1}
.history-table :is(td,th) {padding:.48rem .6rem}
.history-table .history-date {white-space:nowrap; font-variant-numeric:tabular-nums}
.history-table .history-source {white-space:nowrap}
.history-table .button {min-height:36px; padding:.23rem .38rem}
.history-table .history-issue-button {color:#171717; font-weight:780; font-variant-numeric:tabular-nums}
.history-issue-button:hover {text-decoration:underline; text-underline-offset:.18em}
.history-table .history-numbers-button {min-width:0; width:100%; justify-content:flex-start; padding:.25rem; margin-inline:-.25rem}
.history-table .balls {min-width:0}
.history-sr-only {position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
@media(max-width:980px) {
  .history-filters {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:735px) {
  .history-filters input,.history-filters .button {min-height:44px}
  .history-table-wrap {overflow:visible}
  .history-table,.history-table tbody {display:block}
  .history-table thead {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%)}
  .history-table tbody tr {
    display:grid; grid-template-columns:max-content minmax(0,1fr) max-content;
    grid-template-areas:"issue date details" "issue source details" "numbers numbers numbers";
    column-gap:.65rem; align-items:center; padding:.48rem 0;
    border-bottom:1px solid var(--line-soft);
  }
  .history-table tbody tr:first-child {border-top:1px solid var(--line-soft)}
  .history-table tbody td {min-width:0; padding:0; border:0}
  .history-issue {grid-area:issue}
  .history-date {grid-area:date; align-self:end; color:var(--muted); font-size:.8rem}
  .history-source {grid-area:source; align-self:start}
  .history-source .tag {padding:.08rem .34rem; font-size:.7rem}
  .history-details {grid-area:details}
  .history-numbers {grid-area:numbers; container-type:inline-size}
  .history-table .button {min-height:44px}
  .history-table .history-numbers-button {padding-inline:0; margin-inline:0; border-inline-width:0}
  .history-table .balls {gap:.24rem .7rem}
  .history-table .ball-group {flex-wrap:nowrap; gap:.25rem}
  .history-table .ball-group + .ball-group::before {display:none}
  .history-table .ball {width:clamp(1.45rem,10.5cqi,1.7rem); height:auto; aspect-ratio:1}
  .history-table[data-game="kl8"] :is(.balls,.ball-group) {width:100%; max-width:28rem}
  .history-table[data-game="kl8"] .ball-group {display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:.24rem}
  .history-table[data-game="kl8"] .ball {width:100%}
  @container (min-width:21rem) {
    .history-table[data-game="kl8"] .ball-group {grid-template-columns:repeat(20,minmax(0,1fr)); gap:.12rem}
    .history-table[data-game="kl8"] .ball {font-size:clamp(.68rem,3.2cqi,.79rem)}
  }
}
.pagination {display:flex;justify-content:space-between;align-items:center;margin-top:.85rem}
.latest-detail {display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.6rem}
.latest-detail .balls .ball {width:2.15rem;height:2.15rem;font-size:.88rem}
.trend-chart {margin:1rem 0 0; container-type:inline-size}
.trend-caption {display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.65rem; margin-bottom:.75rem}
.trend-caption h3 {margin-bottom:.23rem}
.trend-caption p,.trend-axis-y,.trend-axis-x {margin:0; color:var(--muted); font-size:.77rem}
.trend-reading {display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.28rem .7rem; padding:.46rem .72rem; border:1px solid var(--line); border-radius:8px; background:var(--row-hover); font-size:.82rem; font-variant-numeric:tabular-nums}
.trend-reading strong {color:var(--accent)}
.trend-axis-y {margin:0 0 .7rem}
.trend-plot {position:relative; height:clamp(168px,24vw,270px); margin:0 .3rem 0 3rem; border-left:1px solid var(--accent-border); cursor:crosshair; touch-action:pan-y}
.trend-plot svg {display:block; width:100%; height:100%}
.trend-gridline {stroke:var(--line); stroke-width:1}
.trend-y-ticks,.trend-x-ticks {position:absolute; inset:0; pointer-events:none; font-size:.76rem; font-variant-numeric:tabular-nums; color:var(--muted)}
.trend-y-ticks span {position:absolute; top:var(--position); right:calc(100% + .5rem); transform:translateY(-50%); white-space:nowrap}
.trend-x-ticks span {position:absolute; left:var(--position); top:100%; padding-top:.46rem; transform:translateX(-50%); white-space:nowrap}
.trend-x-ticks span::before {content:""; position:absolute; top:0; left:50%; height:4px; width:1px; background:var(--accent-border)}
.trend-x-ticks .trend-first {transform:none}
.trend-x-ticks .trend-first::before {left:0}
.trend-x-ticks .trend-last {transform:translateX(-100%)}
.trend-x-ticks .trend-last::before {left:100%}
.trend-x-ticks :is(.trend-tick-middle,.trend-tick-quarters,.trend-tick-eighths) {display:none}
@container (min-width:320px) {.trend-x-ticks .trend-tick-middle {display:block}}
@container (min-width:490px) {.trend-x-ticks .trend-tick-quarters {display:block}}
@container (min-width:850px) {.trend-x-ticks .trend-tick-eighths {display:block}}
.trend-axis-x {margin:1.8rem .3rem 0 3rem; text-align:center}
.trend-marker {position:absolute; top:0; bottom:0; left:var(--point-x); width:1px; background:var(--chart-line); pointer-events:none}
.trend-marker i {position:absolute; left:.5px; top:var(--point-y); width:10px; height:10px; transform:translate(-50%,-50%); border:2px solid var(--surface); border-radius:50%; background:var(--chart-line); box-shadow:0 0 0 1px var(--chart-line)}
.insights-section {display:grid; gap:.65rem; min-width:0}
.insights-section > :is(h2,p) {margin:0}
.insights-section > h2 {margin-top:.25rem}
.insight-panel {padding:0}
.insight-panel > summary {display:flex; align-items:center; justify-content:space-between; gap:.7rem; padding:.8rem 1.05rem; min-height:47px; cursor:pointer; list-style:none; border-radius:var(--panel-radius)}
.insight-panel > summary::-webkit-details-marker {display:none}
.insight-panel > summary::after {content:""; width:.54rem; height:.54rem; flex:none; border:solid var(--chart-line); border-width:0 2px 2px 0; transform:rotate(45deg); margin:.1rem .2rem .35rem}
.insight-panel[open] > summary::after {transform:rotate(-135deg); margin:.35rem .2rem .1rem}
.insight-panel > summary:hover {background:var(--row-hover)}
.insight-panel h3 {margin:0; font-size:.97rem}
.insight-content {border-top:1px solid var(--line-soft); padding:.9rem 1.05rem 1rem; display:grid; gap:.75rem}
.insight-note {margin:0; line-height:1.6}
.insight-controls {display:flex; flex-wrap:wrap; gap:.55rem .85rem; margin-bottom:.25rem}
.insight-controls .field {min-width:8rem; flex:0 1 auto}
.insight-blocks {display:grid; gap:.95rem; min-width:0}
.insight-blocks > div {min-width:0}
.insight-table,.insight-heat {max-width:100%; border:1px solid var(--line); border-radius:8px; font-variant-numeric:tabular-nums}
.insight-table :is(th,td),.insight-heat :is(th,td) {padding:.43rem .55rem; white-space:nowrap}
.insight-table th[scope="row"] {background:var(--surface)}
.insight-heat {max-height:25rem}
.insight-heat table {border-collapse:separate; border-spacing:0; text-align:center}
.insight-heat thead th {position:sticky; top:0; z-index:2}
.insight-heat th:first-child {position:sticky; left:0; border-right:1px solid var(--line); z-index:1}
.insight-heat thead th:first-child {z-index:3; line-height:1.3}
.insight-heat td {background:color-mix(in srgb,var(--chart-bar) var(--heat-level),var(--surface)); border-right:1px solid var(--line-soft)}
.insight-heat .heat-excluded {color:var(--muted); background:var(--line-soft)}
.insight-heat-key {display:flex; align-items:center; flex-wrap:wrap; gap:.4rem; margin:.45rem 0 0}
.insight-heat-key span {width:3rem; height:.5rem; border:1px solid var(--line); border-radius:2px; background:linear-gradient(to right,var(--surface),var(--chart-bar))}
.insight-bar {display:block; min-width:2.4rem; padding:.14rem .23rem; border-radius:4px; background:linear-gradient(to right,var(--chart-fill) var(--insight-bar),transparent var(--insight-bar))}
.insight-pagination {margin-top:.55rem; gap:.5rem; flex-wrap:wrap}
.insight-palaces {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.4rem}
.insight-palaces > div {display:grid; gap:.24rem; align-content:start; padding:.55rem; min-width:0; border:1px solid var(--line); border-radius:8px; background:var(--row-hover)}
.insight-palaces strong {font-size:.92rem; color:var(--accent)}
.insight-palaces span {font-size:.79rem; line-height:1.35; color:var(--muted); overflow-wrap:anywhere}
.insight-palaces b {color:var(--ink)}
@media(max-width:520px) {
  .insight-panel > summary,.insight-content {padding-inline:.72rem}
  .insight-controls .field {min-width:0; flex:1 1 7rem}
  .insight-heat :is(th,td) {padding-inline:.39rem}
  .insight-palaces > div {padding:.35rem}
}
.bars {display:grid; grid-template-columns:repeat(auto-fit,minmax(25px,1fr)); gap:.42rem; align-items:end; margin-top:.75rem; min-width:0}
.bar-cell {display:grid; grid-template-rows:1rem 63px 1rem; gap:.2rem; justify-items:center; color:var(--ui-ink); font-size:.73rem; font-variant-numeric:tabular-nums}
.bar-track {display:flex; align-items:flex-end; justify-content:center; height:100%; width:100%; background:var(--row-hover); border-radius:4px}
.bar-track i {display:block; width:100%; max-width:18px; border-radius:4px; background:var(--chart-bar)}
.bar-track i.hot {background:var(--chart-line)}
.mini-list {display:grid; gap:.45rem}
.mini-item {display:flex; justify-content:space-between; gap:.8rem; font-size:.87rem; padding:.48rem 0; border-bottom:1px solid var(--line-soft)}
.generation {display:grid; grid-template-columns:minmax(240px, .8fr) minmax(0,1.3fr);gap:.9rem}
.number-line {display:flex; align-items:center; flex-wrap:wrap; gap:.65rem; border-bottom:1px solid var(--line-soft); padding:.58rem 0}
.number-line:last-child {border-bottom:0}
.number-line .line-label {min-width:3.4rem; color:var(--muted); font-size:.8rem}
#generation-result {scroll-margin-top:5.4rem}
.generation-version {display:flex; flex-wrap:wrap; align-items:center; gap:.18rem .65rem; color:var(--muted); font-size:.82rem; font-variant-numeric:tabular-nums; min-width:0; overflow-wrap:anywhere}
.generation-version code {display:inline-block; max-width:100%; font-size:.7rem}
.generation-price {display:flex; align-items:baseline; flex-wrap:wrap; gap:.35rem .85rem; margin:.65rem 0 .8rem; padding:.55rem .68rem; border-radius:8px; background:var(--row-hover); color:var(--muted); font-size:.86rem; font-variant-numeric:tabular-nums}
.generation-price strong {margin-inline-start:auto; color:var(--accent); font-size:.94rem}
.button[data-action="gen-additional"][aria-pressed=true] {background:var(--nav-active); color:var(--accent); border-color:var(--accent)}
.generation-history {list-style:none; margin:.65rem 0 0; padding:0}
.generation-history li {display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.58rem 0; border-bottom:1px solid var(--line-soft)}
.history-check-numbers {min-width:0; padding:.6rem .7rem; border:1px solid var(--line); border-radius:8px}
.history-check-numbers summary {width:fit-content; color:var(--accent); font-weight:680; cursor:pointer}
.history-check-numbers[open] > summary,.history-check-numbers .history-check-range {margin-bottom:.4rem}
.history-check-numbers .expansion-pagination[hidden] {display:none}
.history-check-line {min-height:44px; padding-inline:.3rem; cursor:pointer}
.history-check-line:has(input:checked) {background:var(--row-hover)}
.history-check-line-label {display:inline-flex; align-items:center; gap:.42rem}
#gen-actions {display:inline-flex; flex-wrap:wrap; gap:.38rem}
.generation > .card > .section-head {flex-wrap:wrap}
.expansion-range {margin-top:.35rem; font-variant-numeric:tabular-nums}
.expansion-toolbar {justify-content:space-between}
.expansion-lines {max-height:min(50dvh,32rem); margin:.55rem 0 0; padding:0 .35rem; overflow:auto; overscroll-behavior:contain; border-block:1px solid var(--line)}
.expansion-lines .line-label {flex:none; font-variant-numeric:tabular-nums}
.expansion-pagination {display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:.65rem; margin-top:.75rem}
.expansion-pagination input {width:min(9.6rem,46vw); margin:0; font-size:.88rem; font-variant-numeric:tabular-nums}
.export-actions {margin:.7rem 0 .5rem}
.export-actions [hidden],.generation-image-preview img[hidden] {display:none}
.generation-image-preview {max-height:min(53dvh,34rem); margin-top:.65rem; overflow:auto; overscroll-behavior:contain}
.generation-image-preview img {display:block; width:100%; height:auto; border:1px solid var(--line); border-radius:8px; -webkit-touch-callout:default}
.check-entry {display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; padding:.75rem 0; border-bottom:1px solid var(--line-soft)}
.check-entry p {margin:.35rem 0 0}
.check-title {display:flex; align-items:center; flex-wrap:wrap; gap:.25rem .6rem}
.check-entry .button {flex:none}
.check-result-draw {display:grid; gap:.45rem; margin:.65rem 0; padding:.6rem; border-radius:8px; background:var(--row-hover)}
.check-prize-levels {display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:.3rem .75rem; margin-bottom:.65rem}
.check-tickets {display:grid; gap:.55rem; margin-top:.6rem}
.check-ticket {display:grid; gap:.35rem; padding:.6rem; border:1px solid var(--line); border-radius:8px}
.check-ticket .check-title {justify-content:space-between; font-size:.85rem}
.ball.check-hit {background:var(--accent); color:var(--surface)}
.ball.check-special {background:#f9e9bc; color:#6b420c; box-shadow:inset 0 0 0 1px #aa702a}
.review-nav {display:flex; flex-wrap:wrap; gap:.45rem; margin:0 0 .8rem}
.review-nav .active {background:var(--nav-active); border-color:var(--accent-border); color:var(--accent)}
.review-purchase-fields {min-width:0; margin:0; padding:.6rem .7rem; border:1px solid var(--line); border-radius:8px; background:var(--row-hover)}
.review-purchase-fields .form-note {margin:.4rem 0 0}
.review-results {display:grid; gap:1rem}
.review-table :is(th,td) {font-variant-numeric:tabular-nums; white-space:nowrap}
.review-table td {min-width:5rem}
.review-table .review-expected {background:linear-gradient(to right,var(--soft) var(--insight-bar),transparent var(--insight-bar)); color:var(--ui-ink)}
.review-money {display:grid; grid-template-columns:repeat(auto-fit,minmax(9.2rem,1fr)); gap:.65rem; margin:.75rem 0 0}
.review-money > div {padding:.65rem; border-radius:8px; border:1px solid var(--line); min-width:0}
.review-money dt {color:var(--muted); font-size:.84rem}
.review-money dd {margin:.3rem 0 0; font-size:1rem; font-weight:680; font-variant-numeric:tabular-nums}
@media(max-width:435px) {
  #ticket-review-filters .form-row.three,.review-purchase-fields .form-row {grid-template-columns:minmax(0,1fr)}
}
.prose {white-space:pre-wrap; line-height:1.83; overflow-wrap:anywhere; font-size:.97rem}
.article-meta {display:flex; flex-wrap:wrap; gap:.4rem; margin:.6rem 0}
.article-summary {color:var(--muted); overflow-wrap:anywhere}
details summary {cursor:pointer; font-weight:650; color:var(--accent)}
.admin-sync {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem}
.sync-description {min-height:2.5rem; font-size:.82rem}
label.time-field {max-width:10rem}
.footer {color:var(--muted); font-size:.78rem; border-top:1px solid var(--line); padding-top:.95rem; margin-top:1.6rem}
.login {display:grid; grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr); min-height:100dvh}
.login-visual {display:flex; flex-direction:column; justify-content:center; min-height:100%; padding:clamp(2rem,7vw,7rem); position:relative; overflow:hidden; isolation:isolate; background:var(--login-bg); color:var(--hero-ink)}
.login-visual .brand {position:absolute; top:clamp(1.3rem,3vw,2.7rem); left:clamp(1.3rem,3vw,2.7rem); color:var(--hero-ink)}
.login-visual .brand span:not(.brand-mark) {color:var(--hero-note)}
.login-visual h1 {font-family:var(--title-font); font-size:clamp(2.4rem,5.9vw,5.45rem); font-weight:800; letter-spacing:-.075em; line-height:1.12; z-index:1}
.login-visual h1 em {font-style:normal; color:var(--hero-highlight)}
.login-visual p {color:var(--hero-note); max-width:28rem; z-index:1}
.login-visual .orbit {opacity:.42; width:93%; top:28%; right:-13%}
.login-visual .ring {width:540px;height:540px}
.login-visual .art-ball {display:none}
.login-form {display:grid; align-content:center; background:var(--paper); padding:2rem clamp(1.35rem,8vw,7.5rem); position:relative}
.login-phone-entry {position:absolute; top:clamp(1rem,2.3vw,2rem); right:clamp(1rem,3vw,2.5rem)}
.login-form form {max-width:28rem;width:100%;margin-inline:auto}
.login-form h2 {font-size:1.85rem;margin-bottom:.3rem}
.login-form form .button {width:100%;margin-top:.15rem}
dialog {padding:0; width:min(600px, calc(100% - 1.5rem)); max-height:calc(100dvh - 1.6rem); background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:15px; box-shadow:0 28px 100px #163c2e42}
dialog::backdrop {background:#152f246e}
.dialog-body {padding:1.2rem}
.dialog-head {display:flex; justify-content:space-between; gap:.8rem; align-items:center; margin-bottom:1rem}
.dialog-head h2 {margin:0}
dialog:has(.mobile-login-content) {width:min(430px,calc(100% - 1.5rem))}
.mobile-login-content {text-align:center; display:grid; justify-items:center; gap:.72rem}
.mobile-login-content p {margin:0}
.mobile-login-art {width:min(100%,350px); display:grid; place-items:center; padding:1.15rem; border:1px solid var(--accent-border); border-radius:var(--panel-radius); background:var(--soft) var(--theme-illustration,none) center / cover no-repeat}
.mobile-login-art img {display:block; width:min(246px,100%); height:auto; border-radius:10px; border:1px solid var(--line); box-shadow:var(--shadow)}
.mobile-login-content a {font-size:.93rem; font-weight:650}
#toast {position:fixed; right:1rem; bottom:1rem; max-width:min(430px,calc(100% - 2rem)); background:var(--accent-hover); color:#fff; border-radius:10px; padding:.7rem .9rem; font-size:.88rem; line-height:1.4; z-index:15; box-shadow:0 8px 25px #133b344d}
#toast:empty {display:none}
@media(max-width:1180px) { .grid4 {grid-template-columns:repeat(2,minmax(0,1fr))} .grid-main {grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)} .draw-row {grid-template-columns:6.2rem minmax(0,1fr)} }
@media(max-width:980px) { .layout {grid-template-columns:188px minmax(0,1fr)} .sidebar {padding-inline:10px} .workspace {padding:1.15rem} .topbar {padding-inline:1.15rem} .grid-main {grid-template-columns:1fr} .hero-copy {max-width:72%} .ring {right:0; width:280px; height:280px; top:0} .draw-row {grid-template-columns:7.5rem minmax(0,1fr)} }
@media(max-width:735px) {
  .layout {display:block} .hero-copy {max-width:82%} .orbit {opacity:.57; width:46%}
  .sidebar {position:fixed; inset:0 auto 0 0; width:242px; transform:translateX(-104%); transition:transform .22s ease; height:100dvh; z-index:8; visibility:hidden}
  .layout.open .sidebar {transform:none; visibility:visible} .layout.open .mobile-scrim {display:block;position:fixed;inset:0;background:var(--nav-overlay);border:0;z-index:7}
  .topbar .mobile-toggle {display:inline-flex} .topbar {height:59px;padding-inline:.8rem} .topbar .crumb .origin-crumb,.topbar .crumb .breadcrumb-separator {display:none}
  .workspace {padding:.9rem .78rem 1.1rem} .hero {min-height:225px} .hero .actions {gap:.45rem}
  .generation,.login {grid-template-columns:1fr}
  .login-visual {min-height:40vh;padding:5.4rem 1.25rem 2.15rem} .login-visual h1 {max-width:29rem} .login-form {padding:1.8rem 1.2rem}
  .login-visual .orbit {top:0;right:-29%}
}
@media(max-width:735px),(max-width:950px) and (hover:none) and (pointer:coarse) {
  .topbar .crumb {min-width:0}
  .topbar .desktop-game-crumb {display:none}
  .topbar .mobile-game-picker {
    display:block; width:auto; min-width:0; max-width:100%; min-height:44px;
    padding-block:.35rem; background-color:var(--row-hover); color:var(--ink); font-weight:650;
  }
}
@media(max-width:490px) {
  .generation-history li {align-items:flex-start; flex-direction:column; gap:.42rem}
  .metrics {gap:.42rem; margin:.65rem 0 1rem}.metric {padding:.52rem; gap:.35rem; flex-direction:column; align-items:flex-start}.metric .glyph {width:30px;height:30px}.metric .glyph .icon {width:16px;height:16px}
  .metric p {font-size:.72rem}.metric strong {font-size:.94rem}
  .grid2,.admin-sync {grid-template-columns:1fr}
  .grid4 {gap:.48rem}.game-card {padding:.7rem}.game-card .button {white-space:normal}
  .card {padding:.78rem}.page-head {align-items:flex-start}.page-head .tag {display:none}
  .hero {padding:1.15rem;min-height:225px}.hero-copy {max-width:94%}.hero h2 {max-width:16rem}.hero p {max-width:16rem}.orbit {opacity:.32;width:56%;right:-7%}
  .draw-row {grid-template-columns:1fr;gap:.36rem; padding:.57rem 0}.draw-label {display:flex;gap:.55rem;align-items:baseline;flex-wrap:wrap}.draw-row small {margin-top:0}.draw-meta time {display:inline; margin-inline-start:.35rem}
  .form-row.three {grid-template-columns:1fr 1fr}.tab {padding-inline:.57rem; font-size:.84rem}
  .user-chip span:last-child {display:none}.topbar .crumb {gap:.34rem}
}
@media(max-width:735px),(hover:none) and (pointer:coarse) {
  .button.desktop-phone,.login-phone-entry {display:none}
  /* A 16px input font prevents focus zoom in mobile WebKit. */
  input:not([type=checkbox]):not([type=radio]),select,textarea {font-size:16px}
}
@media(prefers-reduced-motion:reduce) {*,*::before,*::after {scroll-behavior:auto!important;transition:none!important}}

/* Fade the paper texture into the banner to keep the copy legible. */
:is(:root[data-theme]:not([data-theme="green"]) :is(.hero,.login-visual),
    .theme-preview[data-preview]:not([data-preview="green"]) .theme-preview-hero) > .orbit {
  z-index:-1; width:64%; right:0; opacity:1;
  background:var(--theme-illustration) right center / cover no-repeat;
  mask-image:linear-gradient(to right,transparent 2%,#000 61%);
}
:is(:root[data-theme]:not([data-theme="green"]) :is(.hero,.login-visual),
    .theme-preview[data-preview]:not([data-preview="green"]) .theme-preview-hero) > .orbit > * {display:none}
:root[data-theme]:not([data-theme="green"]) .login-visual > .orbit {
  inset:auto 0 0; width:100%; height:67%; opacity:.76;
  mask-image:linear-gradient(to bottom,transparent 5%,#000 70%);
}
@media(max-width:735px) {
  :root[data-theme]:not([data-theme="green"]) .hero > .orbit {opacity:.84; width:72%}
}
@media(max-width:490px) {
  :root[data-theme]:not([data-theme="green"]) .hero {padding-bottom:6.2rem}
  :root[data-theme]:not([data-theme="green"]) .hero > .orbit {
    top:auto; height:118px; width:100%;
    mask-image:linear-gradient(to bottom,transparent,#000 45%);
  }
}

.theme-toolbar {display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem}
.theme-toolbar strong {display:block; margin-top:.22rem}
.theme-toolbar .form-error {flex-basis:100%}
.theme-options {margin:.35rem 0 0; padding:0; border:0; min-inline-size:0}
.theme-options legend {font-weight:700; margin-bottom:.65rem}
.theme-grid {display:grid; grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}
.theme-option {position:relative; display:block; min-width:0; cursor:pointer}
.theme-option input {position:absolute; top:14px; left:14px; width:20px; min-height:20px; margin:0; accent-color:var(--accent)}
.theme-card {display:block; border:1px solid var(--line);background:var(--surface); border-radius:var(--panel-radius);padding:.6rem; box-shadow:var(--shadow)}
.theme-option:hover .theme-card {border-color:var(--accent-border)}
.theme-option input:checked + .theme-card {border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.theme-option input:focus-visible + .theme-card {outline:3px solid var(--focus-ring);outline-offset:2px}
.theme-option input {z-index:1}
.theme-preview {display:block;position:relative;height:142px;overflow:hidden;background:var(--paper);border:1px solid var(--line);border-radius:9px;padding-left:2.6rem; color:var(--ink)}
.theme-preview-nav {height:33px;display:flex;align-items:center;gap:.38rem;font-weight:700;font-size:.76rem;color:var(--ink)}
.theme-preview-nav .icon {width:15px;height:15px;color:var(--accent)}
.theme-preview-hero {display:flex;align-items:center;position:relative;isolation:isolate;overflow:hidden;height:67px;padding:.55rem .8rem;margin-right:.65rem;border-radius:6px;background:var(--hero-bg);color:var(--hero-ink);font:700 1.08rem var(--title-font)}
.theme-preview-hero .orbit {width:57%}
.theme-preview-hero .ring {width:128px;height:128px;top:-32px;right:11%}
.theme-preview-hero .art-ball {width:26px;height:26px;font-size:.56rem}
.theme-preview-hero .spark {font-size:.6rem}
.theme-preview-chips {display:flex;gap:.35rem;padding-top:.42rem}
.theme-preview-chips i {width:1.45rem;height:.7rem;border-radius:99px;background:var(--accent)}
.theme-preview-chips i:nth-child(2) {background:var(--hero-action);border:1px solid var(--line)}
.theme-preview-chips i:nth-child(3) {background:var(--nav-active);border:1px solid var(--line)}
.theme-card-copy {display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin:.68rem .25rem .25rem}
.theme-card-copy [hidden] {display:none}
.theme-description {display:block;margin:0 .25rem .25rem;color:var(--muted);font-size:.86rem;line-height:1.5}
@media(max-width:535px) {.theme-grid {grid-template-columns:1fr}}
