/* Product entry points are scoped; the established board and review geometry stay untouched. */
[hidden]{display:none!important}
.brand-art{width:48px;height:48px;object-fit:contain;flex-shrink:0;border-radius:12px}
body[data-surface=home] header{display:flex!important;padding:16px 20px}
body[data-surface=home] main> :not(#product-home){display:none!important}
body[data-surface=home] main{display:block!important;padding:0 20px 24px}
body[data-surface=home] footer{display:none}
.product-home{max-width:860px;margin:0 auto;overflow:visible}
.home-hero{display:grid;grid-template-columns:1fr 130px;align-items:center;gap:8px;padding:20px 0 24px;border-bottom:1px solid #42392b}
.home-hero h1{font-size:clamp(2rem,6vw,3.8rem);line-height:1.08;letter-spacing:-.045em;margin:10px 0 12px;max-width:13ch}
.home-hero p{margin:0;color:var(--muted);line-height:1.5;max-width:34ch}
.home-hero .eyebrow{color:var(--gold);font-size:.7rem;letter-spacing:.13em}
.home-hero img{width:100%;height:auto;object-fit:contain}
.home-resume{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;text-align:left;padding:16px 18px;margin:18px 0;background:#192a22;border:1px solid #73b491;color:#f5f4ed}
.home-resume small,.home-resume strong{display:block}.home-resume small{color:#b7d7c6;font-size:.75rem;line-height:1.5}.home-resume strong{font-size:1.1rem;margin:3px 0}.home-resume b{font-size:1.6rem}
.home-start{padding:18px 0 0}.home-start h2{font-size:1.05rem;margin:0 0 12px}
.home-primary{display:grid;grid-template-columns:1fr 1fr;gap:10px}.home-primary button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;padding:18px;min-height:105px;border-radius:16px}
.home-primary strong{font-size:1.2rem}.home-primary small{font-size:.75rem;margin-top:7px;line-height:1.5;color:inherit;font-weight:400;opacity:.85}
.home-row{display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;width:100%;padding:16px;margin-top:10px}.home-row span strong,.home-row span small{display:block}.home-row small{font-size:.75rem;margin-top:5px;color:var(--muted);font-weight:400}
.home-inline{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px}.home-inline button{font-size:.8125rem;background:transparent;border-color:transparent;padding:10px 0;color:var(--gold)}
.home-privacy{font-size:.75rem;line-height:1.6;color:#b7b3aa;margin:16px 0 0;border-top:1px solid #332e25;padding-top:16px}
#capture-alert{margin:0 0 12px;border-left:3px solid var(--gold);background:#231e14;padding:12px;font-size:.875rem;line-height:1.45}
body[data-step=capture] .capture-guide{display:block!important;font-size:.8125rem;line-height:1.5}
body[data-step=capture] .page-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:end}
body[data-step=capture] .page-controls label{flex:1 1 180px}
body[data-step=capture] #add-page{flex:1 1 130px;font-size:.8125rem}
body[data-step=capture] .source-panel #capture-resume{order:-1}
.product-dialog{width:min(560px,calc(100% - 24px));padding:20px;max-height:calc(100dvh - 24px)}
.product-dialog .sheet-heading{display:flex;justify-content:space-between;gap:12px;align-items:center}.product-dialog h2{margin:0;font-size:1.4rem}.product-dialog .sheet-heading button{flex-shrink:0}
.product-dialog .hint{line-height:1.5}.product-dialog input[type=search]{width:100%}
.product-dialog .reread-previews[open]{max-height:min(42dvh,26rem);overflow:auto}
.game-metadata-dialog{overflow:hidden}.game-metadata-dialog[open]{display:flex;flex-direction:column;gap:12px}
.game-metadata-dialog form{display:flex;flex-direction:column;min-height:0;gap:12px}.game-metadata-fields{overflow:auto;min-height:0;padding:0 2px;overscroll-behavior:contain}
.game-metadata-fields label{display:block;margin:12px 0}.game-metadata-fields input{display:block;width:100%;min-width:0}.game-metadata-fields .hint{font-size:.8125rem;margin:8px 0}
.game-metadata-actions{display:grid;grid-template-columns:1fr 1.3fr;gap:8px;padding-top:8px;border-top:1px solid #42392b;flex-shrink:0}.game-metadata-actions button{min-height:48px;padding:12px 8px}
[data-game-error]{margin:0;color:#ffb4aa;font-size:.875rem;line-height:1.4}.game-data-export{grid-column:1/-1}.game-data-export .hint{overflow-wrap:anywhere}
.library-identity{display:block;font-size:.875rem;line-height:1.5;margin:6px 0;color:#e5d5ad;overflow-wrap:anywhere}
.library-backup{display:block;width:100%;margin:12px 0;color:#acd9f5;border-color:#6995af;font-size:.875rem;white-space:normal}
.backup-dialog{overflow:hidden}.backup-dialog[open]{display:flex;flex-direction:column;gap:12px}
.backup-dialog .sheet-heading{position:static;flex-shrink:0}.backup-dialog h2{font-size:1.25rem}
.backup-body{overflow:auto;min-height:0;overscroll-behavior:contain;padding:0 2px}
.backup-body section{margin:16px 0;padding:14px;border:1px solid #655741;border-radius:12px}
.backup-body h3{font-size:1.0625rem;margin:0 0 8px}.backup-body p{line-height:1.5;overflow-wrap:anywhere}
.backup-body .hint{font-size:.8125rem}.backup-body button{min-width:0;white-space:normal;overflow-wrap:anywhere;min-height:48px}
[data-backup-title]{font-weight:700;color:var(--gold)}[data-backup-notice]{color:#ffb4aa}
[data-library-list] button{overflow-wrap:anywhere}
#library-dialog :is([data-library-confirm],[data-library-delete-confirm]){display:flex;flex-direction:column;gap:12px;margin:16px 0;padding:16px;border:1px solid #655741;border-radius:12px;min-width:0}
#library-dialog :is([data-library-confirm],[data-library-delete-confirm]) p{margin:0;line-height:1.5;overflow-wrap:anywhere}
#library-dialog :is([data-library-confirm],[data-library-delete-confirm]) button{width:100%;min-width:0;min-height:48px;margin:0;padding:12px;white-space:normal;overflow-wrap:anywhere}
#library-dialog [data-library-delete-accept]{border:2px solid #ef9a92;background:#442421;color:#ffe9e5}
/* Export only: the measured dock reserves its full height even at larger text sizes. */
body:not([data-step=export]) #export-actions,body[data-surface=home] #export-actions{display:none}
body[data-step=export]:not([data-surface=home]){padding-bottom:calc(var(--export-actions-height,190px) + 16px)}
body[data-step=export]:not([data-surface=home]) header{padding:8px 16px}
body[data-step=export]:not([data-surface=home]) .brand-art{width:32px;height:32px}
body[data-step=export]:not([data-surface=home]) .brand small,body[data-step=export]:not([data-surface=home]) .intro{display:none}
.export-heading{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px}.export-heading h2{margin:0}.export-heading #export-status{flex-basis:100%}.export-heading #export-status:empty{display:none}
.export-panel{align-items:start;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr)}
.export-local,.export-controls{min-width:0;padding:18px;border:1px solid var(--line);border-radius:12px}
.export-panel>.export-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
.export-controls>.pgn-event{grid-column:1/-1}
.export-panel>.export-controls>:is(p,h3){grid-column:1/-1}
.export-local{background:#14231d;border-color:#4e8469}.export-local h3,.export-controls h3{margin:0;font-size:1.1rem}
.export-local .wide{margin-top:4px}.export-local #export-library-status:empty{min-height:0;margin:0}.export-local #export-library-open{width:100%;margin-top:8px}
.export-panel .check{scroll-margin-block:calc(var(--step-height,72px) + 16px) calc(var(--export-actions-height,190px) + 16px)}
.export-panel :is(input,button){scroll-margin-block:calc(var(--step-height,72px) + 28px) calc(var(--export-actions-height,190px) + 60px)}
#export-actions{position:fixed;inset:auto 0 0;z-index:20;padding:10px max(12px,env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));background:#14120f;border-top:1px solid #6c5934;box-shadow:0 -8px 24px #0006}
.export-dock-inner{max-width:1000px;margin-inline:auto;min-width:0}.export-dock-help{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:8px}
#export-action-help{font-size:.8125rem;line-height:1.4;margin:0;overflow-wrap:anywhere}.export-dock-help button{flex-shrink:0;min-height:44px;font-size:.75rem;padding:8px 10px}
.export-dock-buttons{display:flex;flex-wrap:wrap;gap:8px}.export-dock-buttons button{flex:1 1 250px;min-width:0;min-height:48px;font-size:.875rem;white-space:normal}
@media(max-width:760px){.export-panel{grid-template-columns:minmax(0,1fr);gap:16px}.export-local,.export-controls{padding:14px}.export-dock-help{gap:8px}#export-checks-jump{max-width:96px}}
@media(max-width:359px){.export-panel>.export-controls{grid-template-columns:minmax(0,1fr)}}
.library-list{display:grid;gap:10px;padding:12px 0}.library-item{border:1px solid #4e4536;border-radius:12px;padding:14px;background:#171511}
.library-item h3{margin:0 0 5px;font-size:1rem;overflow-wrap:anywhere}.library-item p{font-size:.75rem;color:var(--muted);margin:4px 0 12px}.library-item .actions{margin:0;display:flex;flex-direction:row;gap:8px}.library-item button{font-size:.8125rem;flex:1}
.product-status{font-size:.875rem;line-height:1.5;min-height:1.5em;color:var(--gold)}
.about-entry{background:transparent;border-color:transparent;color:var(--gold);font-size:.8125rem;min-height:44px;padding:10px 0}
#about-dialog p{line-height:1.55}#about-dialog details{padding:12px 0;border-top:1px solid #42392b}#about-dialog summary{min-height:44px;align-content:center;cursor:pointer}#about-dialog .sheet-heading{position:sticky;top:-20px;background:#171511;padding:12px 0;z-index:1}
/* Voice uses the same live board as review, restored when the dialog closes. */
#voice-dialog{overflow:auto;overscroll-behavior:contain;padding:16px}
#voice-dialog .sheet-heading{position:sticky;top:-16px;background:#171511;z-index:2;padding:8px 0}
#voice-dialog h2{font-size:1.125rem}
#voice-dialog #voice-turn{margin:8px 0;text-align:center}
#voice-position #position-pane{display:block;height:auto;min-height:0;container-type:normal;overflow:visible}
#voice-position #position-pane .board-wrap{width:min(100%,240px);min-width:0;max-width:none;padding:8px 7px 20px 20px;margin:auto}
#voice-position .board-controls{min-height:40px;margin:0 auto;max-width:300px}
#voice-dialog .voice-guide,#voice-dialog>.hint{font-size:.75rem;line-height:1.4;margin:8px 0}
#voice-dialog #voice-status{min-height:0;margin:8px 0}
#voice-dialog #voice-transcript:empty,#voice-dialog #voice-options:empty{display:none}
#voice-dialog #voice-service-consent-row{font-size:.8125rem;align-items:flex-start;line-height:1.45}
#voice-dialog #voice-service-consent-row input{flex:none;width:22px;height:22px}
#voice-dialog #voice-options{gap:8px;margin:8px 0}
#voice-dialog #voice-options button{min-height:48px;flex:1;min-width:0}
#voice-dialog #voice-manual{margin-top:8px}
.legal-downloads{display:grid;gap:10px}.legal-downloads a{display:block;min-height:44px;padding:12px;border:1px solid #655741;border-radius:10px;color:var(--gold)}.legal-downloads a[aria-disabled=true]{opacity:.5}
@media(max-width:380px){body[data-surface=home] main{padding:0 14px 20px}.home-hero{grid-template-columns:1fr 95px}.home-primary button{padding:14px}.home-hero h1{font-size:2rem}.home-inline{flex-wrap:wrap}}
@media(min-width:700px){.home-hero{grid-template-columns:1fr 230px;padding:30px 0}.home-primary button{min-height:120px}.home-primary strong{font-size:1.5rem}}
@media(prefers-reduced-motion:reduce){.product-home *{transition:none!important;animation:none!important}}
#about-dialog .privacy-contact{-webkit-user-select:text;user-select:text}
