:root{color-scheme:dark;font-family:system-ui,-apple-system,"Microsoft YaHei",sans-serif;background:#101a27;color:#f2f6fc;font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,a,input{touch-action:manipulation}button{font:inherit;cursor:pointer}button:disabled{cursor:wait;background:#344353;color:#d9e2ed}button:focus-visible,a:focus-visible{outline:3px solid #a9dcff;outline-offset:5px}[hidden]{display:none!important}
.layout{min-height:100dvh;display:grid;grid-template-columns:280px minmax(0,1fr)}.sidebar{background:#142335;border-right:1px solid #415a70;padding:40px 30px;display:flex;flex-direction:column;gap:32px}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:#f2f6fc;font-size:20px;font-weight:750}.brand small{display:block;color:#b9cada;font-size:12px;font-weight:400;margin-top:5px}.brand-mark{background:#bceadc;color:#10362d;padding:8px 12px;border-radius:12px}.intro{font-size:25px;line-height:1.7;font-weight:300;margin:15px 0}.intro strong{font-weight:650}.steps{list-style:none;padding:0;margin:0;display:grid;gap:14px}.steps li{padding:15px 12px;color:#b9cada;border-left:2px solid transparent;font-size:14px}.steps li span{margin-right:12px;font-variant-numeric:tabular-nums}.steps .current{border-color:#bceadc;color:#e8fff6;background:#1a3a3b;border-radius:0 7px 7px 0}.sidebar-note{margin-top:auto;color:#b9cada;line-height:1.9;font-size:13px}
main{min-width:0;padding:0 clamp(20px,5vw,84px);display:flex;flex-direction:column;background:radial-gradient(ellipse at 85% 10%,#203549 0,transparent 50%)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:88px;border-bottom:1px solid #415a70;color:#bdcbd9;font-size:13px}.badge{border:1px solid #7890a8;border-radius:20px;padding:8px 12px;white-space:nowrap}.badge.online{color:#d1ffef;border-color:#74baa2;background:#183f36}.gate{margin:auto 0;padding:64px 0;max-width:700px}.gate-symbol{font-size:84px;line-height:1;color:#bceadc;margin-bottom:28px}.eyebrow{font-size:12px;letter-spacing:.18em;color:#aacfc9;font-weight:700}h1{font-size:clamp(28px,3.5vw,46px);letter-spacing:-.03em;line-height:1.3;margin:14px 0 22px}p{line-height:1.8}.gate>p:not(.eyebrow){color:#c6d4e2;max-width:550px}.primary,.secondary{border-radius:10px;min-height:52px;padding:14px 24px;margin-top:20px;font-weight:650}.primary{background:#bceadc;color:#10362d;border:1px solid #bceadc;min-width:240px;display:flex;justify-content:space-between;gap:40px}.primary:hover{background:#d7f7ed}.secondary{background:#213b52;color:#f2f6fc;border:1px solid #8198ac}.secondary:hover{background:#2c4e6d}.privacy{font-size:12px;margin-top:25px}.error{color:#ffd2b9!important;border-left:3px solid #ffa56d;padding:8px 16px;background:#352921}.workspace{padding:50px 0;flex:1}.notice{padding:24px;background:#1a2c3e;border:1px solid #64809a;border-radius:14px;margin:32px 0;max-width:700px}.notice h2{font-size:20px;margin-top:0}.muted{color:#b9cada;font-size:13px}footer{padding:22px 0;border-top:1px solid #415a70;color:#b9cada;font-size:12px;display:flex;justify-content:space-between;gap:15px}
@media(min-width:1600px){.layout{max-width:1680px;margin:auto;border-inline:1px solid #415a70}}
@media(max-width:760px){.layout{display:block}.sidebar{padding:18px 20px;border-right:0;border-bottom:1px solid #415a70;gap:0}.brand{font-size:17px}.brand small{display:inline;margin-left:12px}.brand-mark{padding:5px 10px}.intro,.steps,.sidebar-note{display:none}main{min-height:calc(100dvh - 80px);padding:0 22px}.topbar{min-height:68px}.gate{padding:40px 0}.gate-symbol{font-size:64px}.primary{width:100%}footer{padding-bottom:max(22px,env(safe-area-inset-bottom))}footer span{max-width:145px;text-align:right}.workspace{padding:32px 0}.notice{padding:20px}}
@media(prefers-reduced-motion:no-preference){button{transition:background .15s ease}}
.catalog-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.catalog-toolbar input{flex:1;min-width:100px;max-width:360px;border:1px solid #8198ac;border-radius:8px;background:#10212d;color:#f2f6fc;padding:14px;font:inherit}.catalog-toolbar input::placeholder{color:#b9cada}.catalog-toolbar input:focus-visible{outline:3px solid #a9dcff;outline-offset:3px}.catalog-toolbar button{margin:0}#catalog-message{min-height:2em;color:#ffd2b9}.model-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:16px;min-height:100px}.model-card{border:2px solid #8198ac;background:#1a2c3e;color:#f2f6fc;border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:12px;text-align:left;overflow:hidden}.model-card img,.model-placeholder{width:100%;height:150px;object-fit:contain;background:#10212d;border-radius:7px}.model-placeholder{display:grid;place-items:center;color:#b9cada;font-size:13px}.model-card>span:last-child{overflow-wrap:anywhere;line-height:1.5}.model-card:hover{background:#2c4e6d}.model-card[aria-pressed=true]{border-color:#bceadc;background:#1a3a3b;box-shadow:0 0 0 2px #bceadc;font-weight:750}.capture-actions{display:flex;gap:12px;flex-wrap:wrap}.capture-actions .primary{min-width:120px}.photo-preview{width:100%;max-width:480px;max-height:520px;object-fit:contain;border:1px solid #8198ac;border-radius:8px;display:block;margin:16px 0}@media(max-width:760px){.model-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.model-card img,.model-placeholder{height:125px}.catalog-toolbar label{width:100%}.capture-actions{display:grid;grid-template-columns:1fr 1fr}.capture-actions button{min-width:0;padding:12px;font-size:14px;margin:0}}
/* The effective WPF assets own the appearance. No independent web branding. */
:root{background:#000;color:#fff;font-family:"Microsoft YaHei UI","Microsoft YaHei",sans-serif}.page-background{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2}.layout{display:block;max-width:none!important;min-height:100dvh;border:0!important;background:#0000005c}.layout main{padding:0 32px;background:none;min-height:100dvh}.topbar{height:64px;min-height:64px;border:0;position:relative;z-index:3}.brand-logo{max-width:180px;max-height:52px;object-fit:contain}.workspace{padding:0 0 28px}.workspace h1{text-align:center;font-size:28px;margin:14px 0}.image-button{background:transparent;border:0;color:white;padding:0;min-height:44px;cursor:pointer}.image-button img{width:156px;height:52px;object-fit:contain}.has-image>span{display:none}.has-image{background:transparent!important;border:0!important;padding:0!important}.primary.has-image img{max-width:240px;max-height:80px;object-fit:contain}#catalog-category{text-align:center}.catalog-toolbar{justify-content:center}.model-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:18px;padding:10px 0}.model-card{background:#081118e6;border:2px solid #476075;border-radius:8px;padding:4px;gap:0}.model-card img,.model-placeholder{height:auto;aspect-ratio:3/4;border-radius:4px;object-fit:cover}.model-card>span:last-child{background:#0a151cd8;text-align:center;padding:10px 4px;font-size:16px}.model-card[aria-pressed=true]{border-color:#b7ffc9;background:#111b18;box-shadow:0 0 0 1px #b7ffc9}.gate{background:#081118e8;padding:28px;border-radius:12px;margin:auto;max-width:680px}.gate h1{font-size:30px}.cover-page .layout{background:transparent}.cover-page .gate{position:absolute;inset:0;max-width:none;padding:0;margin:0;background:transparent;border-radius:0}.cover-page #gate-title,.cover-page #gate-description{display:none}.cover-page #start{position:absolute;inset:0;width:100%;height:100%;min-width:0;background:transparent;border:0;margin:0;padding:0;display:flex;justify-content:center;align-items:flex-end}.cover-page #start>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.cover-page #start-image{max-width:min(520px,80vw);max-height:240px;width:auto;height:auto;margin-bottom:7vh}.cover-page #error{position:absolute;bottom:20px;left:20px;right:20px}.cover-page .topbar{pointer-events:none}.capture-page #workspace-title,.capture-page #catalog-category,.capture-page .catalog-toolbar,.capture-page #catalog-message,.capture-page #models{display:none}.capture-page .notice{margin:20px auto;max-width:900px;background:#081118b5}.capture-page #home{display:inline-flex}.capture-page .photo-preview{margin:16px auto}.capture-actions{justify-content:center}#expires{text-align:center}#model-search{background:#081b2bb5}.secondary{background:#081b2bb5;border-color:#8ba9ba;color:#fff}
@media(max-width:760px){.layout main{padding:0 14px}.topbar{height:54px;min-height:54px}.workspace h1{font-size:24px}.model-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.model-card img,.model-placeholder{height:auto}.image-button img{width:120px;height:40px}.catalog-toolbar{gap:8px}.catalog-toolbar label{width:auto}.catalog-toolbar input{min-width:80px}.catalog-toolbar button{padding:12px}.gate{padding:22px}.capture-page .notice{padding:16px}.brand-logo{max-width:120px;max-height:44px}.cover-page #start-image{margin-bottom:7vh}}
.capture-actions>button{min-width:0;min-height:52px}.capture-actions .has-image img{display:block;width:100%;max-width:100%;height:auto;max-height:80px;object-fit:contain}
/* Model chooser follows the WPF screenshot: two filter rows, four columns and fixed next action. */
body:not(.cover-page) .layout main{padding:28px 40px 160px}.topbar{position:absolute;right:20px;top:8px;height:36px;min-height:36px}.workspace #workspace-title,.workspace #catalog-category,.workspace #expires{display:none}#home{display:block;margin-bottom:14px}.model-filters{display:grid;gap:10px;margin-bottom:42px}.filter-row{display:flex;gap:8px;flex-wrap:wrap}.filter-button{position:relative;min-width:116px;min-height:44px;padding:7px 18px;border:2px solid #00a9e5;background:#081b2bcf;color:#fff;font-weight:700;font-size:18px;box-shadow:0 0 8px #00b8ff45}.filter-button::after{content:"";position:absolute;inset:4px;border:1px solid #477482;pointer-events:none}.filter-button[aria-pressed=true]{color:#fff200;border-color:#ffe900;box-shadow:0 0 0 2px #00a9e5,0 0 8px #00b8ff65}.filter-button:hover{background:#0a263ae6}.filter-button:focus-visible{outline:3px solid #fff;outline-offset:3px}#catalog-message:empty{display:none}.model-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;padding:0}.model-card{border:2px solid #00e6df;border-radius:2px;padding:4px;background:#081118e6;box-shadow:none;min-width:0}.model-card img,.model-placeholder{aspect-ratio:1/1;border-radius:0;width:100%;height:auto;object-fit:cover}.model-card>span:last-child{display:flex;align-items:center;justify-content:center;min-height:50px;padding:10px 4px;font-size:13px;font-weight:650;background:#08151ce6}.model-card[aria-pressed=true]{border-color:#fff200;box-shadow:0 0 0 2px #fff200;background:#111b18}.model-footer{position:fixed;bottom:0;left:0;right:0;z-index:10;padding:12px 20px max(18px,env(safe-area-inset-bottom));text-align:center;background:linear-gradient(#02080dd9,#02080df5);border-top:1px solid #315465}#load-status{font-size:13px;color:#d1efff;margin:0 0 8px;line-height:1.6}#next-step{display:inline-flex;justify-content:center;align-items:center;width:360px;max-width:85vw;height:80px;background:#082330;border:1px solid #6affff;font-size:28px;font-weight:700}#next-step img{width:100%;height:100%;max-width:none;object-fit:contain}#next-step:disabled{opacity:.5;cursor:not-allowed}.back-top{position:fixed;right:24px;bottom:150px;z-index:12;width:48px;height:48px;border:2px solid #74ffff;background:#071a29e8;color:white;font-size:30px;line-height:1;border-radius:6px}.back-top:hover{background:#164860}#load-sentinel{height:1px}.capture-page #model-filters,.capture-page #model-footer,.capture-page #back-top{display:none}.capture-page .notice{margin-top:36px}.cover-page #home,.cover-page #back-top{display:none}
@media(max-width:760px){body:not(.cover-page) .layout main{padding:22px 14px 140px}.filter-row{flex-wrap:nowrap;overflow-x:auto;padding:4px 3px 7px;scrollbar-width:thin;scrollbar-color:#00a9e5 #081b2b}.filter-button{flex-shrink:0;min-width:88px;font-size:15px;min-height:42px;padding:7px 12px}.model-filters{margin-bottom:24px;gap:5px}.model-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.model-card>span:last-child{font-size:13px;min-height:44px}.model-footer{padding-top:10px}#next-step{height:64px;width:300px}.back-top{right:16px;bottom:132px}.topbar{right:12px;top:8px}#home{margin-bottom:14px}}

.model-grid{grid-template-columns:repeat(var(--model-columns,4),minmax(0,1fr))}
.model-card{font-family:inherit}.model-card>span:last-child{font-size:var(--model-title-size,12px);font-weight:var(--model-title-weight,700);color:var(--model-title-color,#fff)}
.model-header{display:block;margin:16px auto 36px;border:0;background:transparent;color:white;font-size:28px;font-weight:700;max-width:100%}.model-header img{max-width:100%;max-height:180px;object-fit:contain}
@media(max-width:760px){.model-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.frame-choice{min-width:0}.frame-choice .model-card{width:100%}.quantity-control{min-width:44px;min-height:44px;margin:8px 8px 0 0;background:#123448;color:#fff;border:1px solid #5cd8f5;border-radius:4px}.quantity-control:hover{background:#1c4d65}#confirm-frames{position:sticky;bottom:16px;margin:24px auto;background:#123448;color:#fff;border:2px solid #62eaf3}#group-scopes{flex-wrap:wrap}#group-title{color:#fff}#next-step:disabled{opacity:1;color:#d9e2ed}

.selected-models{margin:12px 0 24px;padding:12px;background:#07151fe8;border:1px solid #4adfe9}.selected-models p{margin:0 0 8px}.selected-models button{font-size:14px;margin:4px;min-height:44px;color:#fff}#selection-message{color:#fff1a8}

.capture-frames { display:flex; gap:12px; overflow-x:auto; padding:8px 2px 16px; }
.capture-frames .model-card { flex:0 0 112px; min-width:0; }
.capture-frames .model-card img { height:140px; object-fit:contain; }
.capture-frames .model-card:focus-visible { outline:3px solid #ffff00; outline-offset:2px; }

/* Shared responsive spacing; keep the machine's background and button artwork. */
:root { --page-gutter:20px; --panel:#0c1b28f5; --line:#7896a8; --accent:#6ce8e1; }
body { line-height:1.6; }
.layout { background:#00000070; }
body:not(.cover-page) .layout main {
  width:100%; max-width:1100px; margin-inline:auto;
  padding:76px var(--page-gutter) calc(36px + env(safe-area-inset-bottom));
}
.workspace { padding:0; }
.topbar { top:max(16px,env(safe-area-inset-top)); right:max(var(--page-gutter),env(safe-area-inset-right)); height:44px; min-height:44px; }
.badge { font-size:12px; line-height:20px; padding:5px 10px; background:#101f2e; }
.brand-logo { max-width:96px; max-height:32px; }
#home { position:absolute; top:max(16px,env(safe-area-inset-top)); left:max(var(--page-gutter),env(safe-area-inset-left)); margin:0; width:120px; height:44px; }
.image-button { display:inline-flex; align-items:center; justify-content:center; min-height:48px; border-radius:8px; }
.image-button img { display:block; max-width:100%; object-fit:contain; }
.primary,.secondary { min-width:0; min-height:48px; padding:12px 16px; margin-top:0; line-height:1.5; font-size:15px; font-weight:650; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.primary { background:#164c60; color:#fff; border:1px solid #6ce8e1; }
.primary:hover { background:#205f74; }
.secondary { background:#182f40; color:#f2f6fc; border:1px solid var(--line); }
.secondary:hover { background:#29465b; }
button:disabled,button:disabled:hover { background:#344353; color:#d9e2ed; border-color:#8198ac; cursor:not-allowed; }
button.has-image:disabled img { opacity:.5; filter:grayscale(.65); }
button:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.gate { width:100%; max-width:560px; background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:28px; box-shadow:0 16px 40px #0005; }
.gate h1 { font-size:26px; line-height:1.45; margin:0 0 12px; letter-spacing:0; }
.gate p { margin:0 0 24px; }
.gate .primary,.gate .secondary { width:100%; }
.cover-page .gate { border:0; box-shadow:none; }
.cover-page .topbar { width:auto; }
.cover-page .brand-logo { max-width:120px; }
.cover-page #start:focus-visible { outline-offset:-6px; }
.model-filters { gap:8px; margin:0 0 20px; }
.filter-row { gap:8px; padding:4px; }
.filter-button { min-width:0; min-height:44px; border:1px solid #7399ad; border-radius:8px; padding:9px 14px; background:#102535f5; color:#edf7ff; font-size:14px; line-height:24px; box-shadow:none; }
.filter-button::after { display:none; }
.filter-button[aria-pressed=true] { background:#164550; color:#dcfffa; border-color:var(--accent); box-shadow:inset 0 -3px var(--accent); }
.filter-button:hover { background:#21465a; }
.model-grid { gap:16px; align-items:stretch; }
.model-card { position:relative; border:1px solid #7199a7; border-radius:12px; padding:4px; background:#0c1b28; }
.model-card img,.model-placeholder { aspect-ratio:1/1; border-radius:8px; background:#102536; }
.model-placeholder { min-height:140px; color:#c5d8e5; }
.model-card>span:last-child { flex:1; min-height:48px; padding:10px 6px; line-height:1.5; background:transparent; }
.model-card[aria-pressed=true] { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); background:#12383e; }
.model-card[aria-pressed=true]::after { content:'✓'; position:absolute; right:10px; top:10px; display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#bceadc; color:#10362d; font-size:17px; font-weight:700; box-shadow:0 2px 8px #0006; }
#models { padding-bottom:148px; }
.model-header { margin:0 auto 24px; font-size:24px; }
.model-footer { left:50%; right:auto; transform:translateX(-50%); width:100%; max-width:1100px; padding:10px var(--page-gutter) max(12px,env(safe-area-inset-bottom)); background:#081722f5; border-color:#7896a8; box-shadow:0 -6px 24px #0004; }
#load-status { font-size:12px; color:#c0d3e2; margin-bottom:6px; }
#next-step { width:min(100%,320px); height:56px; min-height:56px; border-radius:10px; font-size:20px; }
.back-top { bottom:136px; right:20px; border-radius:50%; width:44px; height:44px; font-size:24px; }
.selected-models { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; padding:14px; background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.selected-models p { flex-basis:100%; margin:0; font-size:13px; color:#d0e0ec; line-height:1.7; }
.selected-models button { margin:0; max-width:100%; overflow-wrap:anywhere; text-align:left; }
#selection-message:empty,#catalog-message:empty { display:none; }
#selection-message,#catalog-message,#group-message { margin:0 0 16px; font-size:14px; line-height:1.75; color:#fff1bf; background:#0c1b28ee; padding:12px 14px; border-radius:10px; }
#group-title { margin:16px 0; font-size:22px; overflow-wrap:anywhere; }
#group-scopes { margin:0 0 16px; }
#back-groups,#back-models { width:112px; justify-content:flex-start; }
.frame-choice { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:1fr auto; gap:8px; }
.frame-choice .model-card { grid-column:1/-1; height:100%; }
.quantity-control { flex:1; margin:0; border:1px solid #7896a8; border-radius:8px; font-size:14px; }
#confirm-frames { position:static; width:100%; margin:20px 0 0; min-height:52px; border:1px solid var(--accent); border-radius:10px; }
.notice,.capture-page .notice { width:100%; max-width:560px; margin:0 auto; padding:20px; background:var(--panel); border:1px solid var(--line); border-radius:16px; box-shadow:0 12px 36px #0005; }
.notice h2 { margin:12px 0; font-size:22px; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.panel-heading h2 { margin:0; font-size:20px; }
#selected-model { color:#d2e1ed; font-size:13px; line-height:1.8; margin:0 0 20px; overflow-wrap:anywhere; }
.capture-actions,.photo-actions { display:flex; flex-wrap:wrap; gap:10px; }
.capture-actions>button,.photo-actions>button { flex:1 1 120px; width:0; min-width:0; min-height:52px; margin:0; }
.capture-actions .has-image img,.photo-actions .has-image img { width:100%; height:52px; max-height:52px; object-fit:contain; }
#confirm-photo:not(.has-image) { padding:10px; border:1px solid var(--accent); background:#164c60; font-size:14px; font-weight:650; }
#confirm-photo:disabled:not(.has-image) { background:#344353; border-color:#8198ac; color:#d9e2ed; }
#photo-message,#print-message { font-size:14px; line-height:1.8; color:#d5e5f1; margin:18px 0; overflow-wrap:anywhere; }
.photo-preview,.capture-page .photo-preview { width:100%; max-width:480px; height:auto; max-height:min(38dvh,360px); object-fit:contain; margin:16px auto; background:#061019; border:1px solid var(--line); border-radius:12px; }
.capture-page .photo-preview { max-height:min(34dvh,340px); }
#submit-print { display:flex; width:100%; min-height:56px; margin-top:12px; }
#submit-print img { width:100%; height:56px; }
.notice .muted { font-size:12px; line-height:1.75; margin:16px 0 0; }
.capture-frames { padding:4px 4px 14px; margin:0 -4px 12px; gap:12px; }
.capture-frames .model-card { flex-basis:124px; }
.capture-frames .model-card img { height:148px; }
#generation-message { margin:0; padding:2px 0 16px; font-size:17px; font-weight:650; line-height:1.8; }
#generation-panel { margin:8px auto 0; }
#generation-panel>.secondary,#print-controls>.primary,#print-controls>.secondary { display:flex; width:100%; margin-top:12px; }
#print-controls { margin-top:16px; padding-top:4px; border-top:1px solid #587487; }
#print-message { margin:12px 0; }
@media(max-width:760px) {
  :root { --page-gutter:16px; }
  body:not(.cover-page) .layout main { padding-top:max(76px,calc(env(safe-area-inset-top) + 60px)); }
  .filter-row { flex-wrap:wrap; overflow:visible; }
  .filter-button { flex-shrink:1; font-size:13px; padding:8px 10px; }
  .model-filters { margin-bottom:16px; }
  .model-grid { gap:14px; }
  .notice,.capture-page .notice { padding:16px; }
  .topbar { max-width:calc(100% - 160px); gap:8px; }
  .brand-logo { max-width:48px; }
  .gate { padding:24px 20px; }
  .gate h1 { font-size:24px; }
}
@media(max-width:359px) {
  :root { --page-gutter:12px; }
  .model-grid { gap:10px; }
  .capture-actions>button,.photo-actions>button { flex-basis:100px; font-size:13px; padding-inline:8px; }
  .brand-logo { max-width:28px; }
}

/* H5 navigation keeps home at the top and the previous step beside the next action. */
.step-actions { display:flex; align-items:center; justify-content:center; gap:16px; width:100%; max-width:560px; margin-inline:auto; }
.step-actions>.image-button { flex:1 1 0; min-width:0; width:0; max-width:240px; height:56px; min-height:56px; margin:0; font-size:18px; font-weight:650; }
.step-actions>.image-button:not(.has-image) { background:#182f40; border:1px solid #7896a8; color:#fff; }
.step-actions>.image-button img { width:100%; height:56px; }
.step-actions #next-step,.step-actions #back-models { width:0; margin:0; justify-content:center; }
.capture-step-actions { margin-top:20px; }
.generation-heading { display:flex; align-items:center; gap:14px; margin-bottom:24px; }
.generation-heading #generation-message { padding:0; }
.progress-caption { display:flex; justify-content:space-between; align-items:center; gap:12px; color:#d5e5f1; font-size:14px; margin-bottom:12px; }
.progress-caption strong { font-size:30px; line-height:1.2; color:#a1fff0; font-variant-numeric:tabular-nums; }
.progress-track { height:12px; overflow:hidden; border:1px solid #7896a8; border-radius:12px; background:#182f40; }
.progress-fill { width:0; height:100%; background:#6ce8e1; border-radius:12px; transition:width .45s ease; }
.progress-detail { font-size:13px; color:#d5e5f1; margin:16px 0 0; line-height:1.8; }
@media(prefers-reduced-motion:reduce) { .progress-fill { transition:none; } }

/* Capture is centered on the photo, with a stable preview before a file is chosen. */
#capture { padding:18px; }
#capture .panel-heading { margin-bottom:6px; }
#capture .panel-heading h2 { font-size:20px; }
.capture-step-label { font-size:11px; color:#b8cedb; white-space:nowrap; }
#capture #selected-model { margin:0 0 14px; font-size:12px; line-height:1.6; }
.capture-stage { position:relative; display:flex; align-items:center; justify-content:center; height:clamp(230px,36dvh,330px); overflow:hidden; border:1px solid #6a899a; border-radius:14px; background:radial-gradient(ellipse at center,#183747,#071722); margin-bottom:16px; }
.capture-preview-label { position:absolute; z-index:1; left:10px; top:10px; font-size:11px; line-height:1.5; color:#e7f6fa; background:#0a1c29ed; padding:5px 9px; border-radius:6px; }
#capture-frame-preview { display:block; max-width:100%; width:auto; height:100%; object-fit:contain; }
#capture .capture-stage #photo-preview { display:block; width:100%; height:100%; max-width:none; max-height:none; object-fit:contain; margin:0; border:0; border-radius:0; background:#071722; }
.capture-frame-caption { position:absolute; bottom:8px; left:10px; right:10px; padding:4px 8px; text-align:center; font-size:11px; color:#e7f6fa; background:#0a1c29ed; border-radius:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#capture .capture-workbench {
  display:flex;
  gap:8px;
  height:clamp(240px, 53vh, 570px);
  height:clamp(240px, 53svh, 570px);
  margin-bottom:14px;
}
#capture .capture-frames {
  flex:0 0 clamp(52px, 16vw, 92px);
  flex-direction:column;
  gap:8px;
  margin:0;
  padding:4px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
}
#capture .capture-frames .model-card { flex:none; width:100%; border-radius:8px; padding:2px; }
#capture .capture-frames .model-card img { width:100%; height:auto; min-height:0; aspect-ratio:2/3; object-fit:contain; }
#capture .capture-frames .model-card[aria-pressed=true]::after { width:18px; height:18px; top:5px; right:5px; font-size:12px; }
#capture #photo-message { font-size:12px; line-height:1.6; margin:10px 0; }
#capture-backgrounds { min-width:0; margin:0; padding:0; border:0; }
#composition-preview { display:block; width:100%; height:100%; object-fit:contain; }
.composition-feedback { position:absolute; max-width:90%; text-align:center; }
#composition-status:not(:empty) { background:#0a1c29ed; color:white; padding:8px; border-radius:6px; }
#composition-preview[hidden], #composition-status:empty { display:none; }
#capture #photo-message:empty { display:none; }
#capture button { -webkit-tap-highlight-color:transparent; touch-action:manipulation; transition:none; }
#capture .capture-stage { flex:1; min-width:0; height:100%; margin:0; }
@media(max-width:600px) { #capture.notice { padding-inline:10px; } }
#capture .capture-step-actions { margin-top:14px; }
#capture .muted { text-align:center; margin-top:10px; font-size:11px; }
@media(max-width:359px) { #capture { padding:12px; } .capture-step-label { font-size:10px; } #capture .panel-heading h2 { font-size:18px; } }

#camera-video { width:100%; height:100%; object-fit:contain; background:#071722; }
.camera-message { color:#ffedbd; background:#172a38; padding:10px 12px; border:1px solid #7896a8; border-radius:8px; font-size:12px; line-height:1.7; }
#system-camera { width:100%; margin-bottom:8px; }

/* Group and frame selection share the same bottom navigation as the model chooser. */
#group-picker { padding-bottom:100px; }
.group-step-actions { justify-content:space-between; }
.group-step-actions #back-groups { width:0; justify-content:center; }
.group-step-actions #confirm-frames { flex:1 1 0; width:0; max-width:240px; height:56px; min-height:56px; margin:0; }

#capture .capture-actions, #capture .capture-step-actions {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  width:100%;
  max-width:400px;
  margin-inline:auto;
}
#capture :is(.capture-actions, .capture-step-actions) > button {
  width:100%;
  min-width:0;
  max-width:none;
  height:auto;
  min-height:44px;
  aspect-ratio:320 / 111;
  margin:0;
}
#capture #choose-photo, #capture #confirm-photo { grid-column:2; }
#capture .capture-actions.camera-open {
  grid-template-columns:none;
  grid-auto-flow:column;
  grid-auto-columns:minmax(0, 1fr);
  gap:6px;
}
#capture .capture-actions.camera-open > button {
  aspect-ratio:auto;
  height:46px;
  padding:0 2px;
  font-size:clamp(12px, 3.5vw, 15px);
  white-space:nowrap;
}
#capture .camera-open #choose-photo { grid-column:auto; }
#capture-actions > button, #system-camera {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
}
.capture-icon {
  flex:none;
  width:1.15em;
  height:1.15em;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
@media(max-width:389px) {
  #capture .capture-actions.camera-open { grid-auto-columns:minmax(max-content, 1fr); }
  #capture-actions.camera-open > button { gap:2px; }
}
#capture :is(.capture-actions, .capture-step-actions) > .has-image img {
  display:block;
  width:100%;
  height:auto;
  max-width:none;
  max-height:none;
  aspect-ratio:320 / 111;
  object-fit:contain;
}
#submit-print.primary { background:#176072; color:#fff; border:1px solid #6ce8e1; min-height:56px; font-size:18px; }
#submit-print.primary:disabled { background:#344353; color:#d9e2ed; border-color:#8198ac; }

#capture-canvas { position:relative; flex:none; width:100%; height:100%; }
#capture-window { position:absolute; display:flex; align-items:center; justify-content:center; overflow:hidden; }
#capture-canvas #capture-frame-preview { position:absolute; inset:0; z-index:2; width:100%; height:100%; max-width:none; object-fit:fill; pointer-events:none; }
#capture-canvas.has-opening #camera-video,#capture .capture-stage #capture-canvas.has-opening #photo-preview { width:100%; height:100%; object-fit:cover; }
.capture-preview-label { z-index:3; }

.fullscreen-toggle { display:inline-flex; flex:0 0 44px; align-items:center; justify-content:center; width:44px; height:44px; padding:10px; border:1px solid #7896a8; border-radius:10px; background:#102535ed; color:#e7f6fa; pointer-events:auto; }
.fullscreen-toggle svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; }
.fullscreen-toggle:hover,.fullscreen-toggle[aria-pressed=true] { background:#164550; border-color:#6ce8e1; }
.fullscreen-message { position:fixed; top:68px; left:16px; right:16px; z-index:30; padding:12px; margin:0; border:1px solid #7896a8; border-radius:10px; background:#102535; color:#fff1bf; font-size:13px; }
.topbar { gap:8px; }
@media(max-width:360px) { .topbar .brand-logo { display:none; } }

/* The desktop's particle tunnel and floating percentage, scaled for a phone viewport. */
body.generation-loading { overflow:hidden; }
.generation-loading #home,.generation-loading .topbar { visibility:hidden; }
#generation-panel.is-loading {
  position:fixed; inset:0; z-index:20; width:100%; max-width:none; height:100dvh;
  margin:0; padding:0; border:0; border-radius:0; background:#06121d; box-shadow:none; overflow:hidden;
}
#generation-loading-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none; }
#generation-panel.is-loading #generation-progress {
  position:absolute; width:56.6vw; max-width:610px; left:50%; transform:translateX(-50%);
  bottom:max(10.7dvh,calc(24px + env(safe-area-inset-bottom)));
  --bubble-width:clamp(36px,5.4vw,58px); --bubble-height:clamp(24px,3.2vw,34px);
}
#generation-panel.is-loading .progress-caption { position:relative; height:calc(var(--bubble-height) + 10px); margin:0; }
#generation-panel.is-loading #progress-percent {
  position:absolute; left:clamp(0px,calc(var(--generation-progress) - var(--bubble-width) / 2),calc(100% - var(--bubble-width)));
  top:0; display:grid; place-items:center; width:var(--bubble-width); height:var(--bubble-height);
  border-radius:6px; background:#087a48; color:#fff; font-size:clamp(12px,1.4vw,20px); font-weight:650;
  box-shadow:0 0 12px #18c97880;
}
#generation-panel.is-loading #progress-percent::after {
  content:''; position:absolute; top:100%; left:calc(50% - 4px); border:4px solid transparent; border-top-color:#087a48;
}
#generation-panel.is-loading .progress-track { height:clamp(12px,2.05vw,22px); border:0; border-radius:20px; background:#f5f6f8; box-shadow:0 2px 16px #0006; }
#generation-panel.is-loading .progress-fill { width:var(--generation-progress,1%); transition:none; position:relative; overflow:hidden; background:linear-gradient(90deg,#f4be69,#f1ea80 34%,#61df82 68%,#25c986); }
#generation-panel.is-loading .progress-fill::after { content:''; position:absolute; inset:0; background:repeating-linear-gradient(122deg,transparent 0 13px,#ffffff57 13px 20px,transparent 20px 30px); }
#generation-panel.is-finishing #progress-percent,#generation-panel.is-finishing .progress-fill { transition:none; }
#generation-panel.is-loading .generation-heading,#generation-panel.is-loading #progress-label,#generation-panel.is-loading .progress-detail {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
#generation-panel.is-loading.is-delayed .progress-detail {
  width:100%; height:auto; margin:12px 0 0; padding:6px 8px; clip-path:none; white-space:normal;
  color:#fff; background:#06121de6; border-radius:6px; text-align:center; font-size:12px;
}
@media(orientation:landscape) { #generation-panel.is-loading #generation-progress { width:56.6vw; max-width:430px; } }
@media(prefers-reduced-motion:reduce) { #generation-panel.is-loading #progress-percent { transition:none; } }

/* Button feedback floats above the current step without moving its controls. */
.action-feedback {
  position:fixed;
  z-index:40;
  top:45%;
  left:50%;
  transform:translate(-50%, -50%);
  width:max-content;
  max-width:min(86vw, 28rem);
  box-sizing:border-box;
  margin:0;
  padding:12px 18px;
  border:1px solid #7096a8;
  border-radius:12px;
  background:#102533f7;
  color:#fff;
  box-shadow:0 4px 18px #0008;
  font-size:15px;
  line-height:1.6;
  text-align:center;
  overflow-wrap:anywhere;
  pointer-events:none;
}
/* Both viewport snapshots move together, using the desktop's 600 ms ease curve. */
html[data-slide]::view-transition-old(root),
html[data-slide]::view-transition-new(root) {
  animation-duration:600ms;
  animation-timing-function:ease;
  animation-fill-mode:both;
  mix-blend-mode:normal;
}
html[data-slide]::view-transition-old(root) { animation-name:slide-out-left; }
html[data-slide]::view-transition-new(root) { animation-name:slide-in-right; }
html[data-slide="back"]::view-transition-old(root) { animation-name:slide-out-right; }
html[data-slide="back"]::view-transition-new(root) { animation-name:slide-in-left; }
@keyframes slide-in-left { from { transform:translateX(-100%); } to { transform:none; } }
@keyframes slide-out-right { from { transform:none; } to { transform:translateX(100%); } }
@keyframes slide-in-right { from { transform:translateX(100%); } to { transform:none; } }
@keyframes slide-out-left { from { transform:none; } to { transform:translateX(-100%); } }

#scene-dialog { box-sizing:border-box; width:min(94vw,32rem); max-height:85vh; overflow:auto; padding:1.1rem; border:1px solid #537483; border-radius:14px; color:#edf8fc; background:#101e29; }
#scene-dialog::backdrop { background:rgba(2,10,16,.78); }
#scene-dialog h2 { margin:0 0 .4rem; color:#fff; }
#scene-dialog label,#scene-dialog h3 { color:#c5dfe8; font-size:.9rem; }
#scene-text { display:block; box-sizing:border-box; width:100%; margin-top:.65rem; padding:.7rem; color:#f1fafc; background:#0b1720; border:1px solid #648390; border-radius:6px; font:inherit; font-size:16px; }
#scene-examples { display:grid; gap:.35rem; }
#scene-dialog button,#edit-scene { background:#1b303f; color:#ecf5f7; border:1px solid #52707e; border-radius:7px; min-height:44px; }
#scene-examples button { display:grid; grid-template-columns:1.6rem 1fr; align-items:center; column-gap:.4rem; text-align:left; padding:.5rem .7rem; font-size:.85rem; }
#scene-examples button span { grid-row:span 2; font-size:1.2rem; }
#scene-dialog :focus-visible,#edit-scene:focus-visible { outline:2px solid #82ecde; outline-offset:1px; }
#scene-dialog button:active { background:#295565; }
.scene-actions { display:flex; justify-content:flex-end; gap:.5rem; margin-top:1rem; }
#scene-dialog #use-scene { background:#176773; }
#scene-dialog #use-scene:disabled { background:#344552; color:#cedae0; }
#scene-summary { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:75vw; color:#c5dfe8; }
