/* Hide the old review dock before scripts run, then relocate it into Settings. */
body[data-preview-tools] main > #focus-controls,
body[data-preview-tools] main > .control-strip{display:none}
body[data-preview-tools] #wall{height:calc(100dvh - 84px)}
body[data-preview-tools] footer{min-height:72px;height:auto;padding:10px 24px;gap:10px 24px;flex-wrap:wrap}
body[data-preview-tools] footer > span{order:-1;margin-right:auto}
.page-actions{display:flex;align-items:center;gap:20px}
.page-actions button{font-size:11px;min-height:34px}
.page-actions [hidden]{display:none!important}
#settings-toggle{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid #34433d35;border-radius:3px}
#settings-toggle:hover,#settings-toggle[aria-expanded=true]{background:#e7e5db}
body[data-preview-tools] .analytics-choice{flex-basis:auto;margin:0;padding:0;border:0}
body[data-preview-tools] .analytics-choice[open]{flex-basis:100%;border-top:1px solid #34433d25;padding-top:8px}
#preview-settings{position:fixed;z-index:50;right:20px;bottom:74px;width:min(410px,calc(100vw - 24px));max-height:calc(100dvh - 100px);overflow:auto;overscroll-behavior:contain;background:#f2eee7;color:#34433d;border:1px solid #34433d30;border-radius:5px;padding:22px;box-shadow:0 12px 60px #17221930;font:12px/1.5 'DM Sans',sans-serif}
#preview-settings[hidden]{display:none}
.settings-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.settings-heading p{font-size:9px;letter-spacing:.12em;margin:0 0 5px;opacity:.6}
.settings-heading h2{font:500 28px/1.1 'DM Sans',sans-serif;letter-spacing:-1px;margin:0}
#settings-close{width:32px;height:32px;padding:0;background:transparent;border:1px solid #34433d30;border-radius:3px;font-size:24px;line-height:1}
.settings-intro{font-size:12px;line-height:1.5;opacity:.7;margin:12px 0 22px;max-width:290px}
#preview-settings h3{font-size:11px;letter-spacing:.02em;font-weight:600;margin:18px 0 12px;padding-top:16px;border-top:1px solid #34433d25}
#preview-settings #focus-controls{display:grid;position:static;transform:none;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;padding:0;margin:0;gap:15px 22px;border:0;background:none;box-shadow:none;min-height:0;z-index:auto}
#preview-settings #focus-controls label{font-size:11px;width:100%;gap:5px}
#preview-settings #focus-controls input[type=range]{height:20px;width:100%}
#preview-settings #focus-controls .focus-options{grid-column:1/-1;justify-content:flex-start;gap:12px 16px;padding-top:3px}
#preview-settings #focus-controls .focus-toggle{display:flex;width:auto;font-size:11px;gap:6px}
#preview-settings #focus-controls .focus-toggle input{width:14px;height:14px}
#preview-settings #focus-hint{display:block;font-size:10px;line-height:1.5;opacity:.65;flex-basis:100%}
#preview-settings .controls{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:12px 16px;align-items:center}
#preview-settings .controls button{border:1px solid #34433d35;padding:9px 10px;text-align:left;border-radius:2px;font-size:11px;min-height:36px}
#preview-settings .entrance-toggle,#preview-settings .video-speed-control{font-size:11px;gap:7px}
#preview-settings .video-speed-control select{font:inherit;background:transparent;padding:5px;border:1px solid #34433d35;border-radius:2px}
.settings-reference{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;border-top:1px solid #34433d25;margin-top:20px;padding-top:16px}
#preview-settings .settings-reference button,#preview-settings .settings-reference a{border:0;background:none;padding:5px 0;text-align:left;font:11px/1.5 'DM Sans',sans-serif;color:inherit;text-decoration:none}
#preview-settings .settings-reference a:hover{text-decoration:underline}
@media(max-width:650px){
 body[data-preview-tools] #wall{height:calc(100dvh - 104px)}
 body[data-preview-tools] footer{min-height:92px;padding:8px 14px;gap:4px 16px;justify-content:space-between}
 .page-actions{gap:16px;width:100%;justify-content:flex-end}
 .page-actions #capability-back{margin-right:auto}
 body[data-preview-tools] .analytics-choice{font-size:10px}
 #preview-settings{bottom:96px;right:12px;max-height:calc(100dvh - 112px);padding:18px}
}

/* The page is the wall. Mode changes never resize its viewport or card grid. */
html,body[data-preview-tools]{width:100%;height:100%;overflow:hidden}
body[data-preview-tools] main{padding:0;width:100%;margin:0}
body[data-preview-tools] #wall,
body[data-preview-tools] #wall[data-expanded="true"]{width:100%;height:100dvh;min-height:0;max-height:100dvh;padding:0;border:0;border-radius:0}
body[data-preview-tools] footer,.wall-corner{display:none}
#settings-toggle{position:fixed;z-index:51;right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));width:38px;height:38px;justify-content:center;padding:0;border:0;border-radius:50%;background:#f2eee7df;color:#34433d;box-shadow:0 2px 12px #0002}
#settings-toggle svg{width:18px;height:18px}
#settings-toggle span{display:none}
#settings-toggle[hidden]{display:none}
#preview-settings{bottom:64px;right:14px;max-height:calc(100dvh - 80px)}
#preview-settings .analytics-choice{margin-top:20px;padding-top:14px;border-top:1px solid #34433d25;font-size:11px}
#preview-settings #signup-note{font-size:11px;margin:14px 0 0}
#intake-support{position:fixed;z-index:20;bottom:16px;left:50%;transform:translateX(-50%);width:min(600px,calc(100% - 120px));margin:0;padding:0;pointer-events:none}
#intake-support #signup-status:empty{display:none}
#intake-support #signup-status:not(:empty){padding:10px 16px;margin:0;background:#f2eee7;color:#34433d;pointer-events:auto}
#intake-support #optional-profile:not([hidden]){background:#f2eee7;padding:16px;pointer-events:auto;max-height:70dvh;overflow:auto}
/* Keep six readable islands within the same viewport on smaller displays. */
@media(max-width:650px){
 .cap-front{padding:clamp(9px,5cqh,14px) clamp(10px,7cqw,18px);gap:4px}
 .cap-title{font-size:clamp(14px,min(10cqw,8cqh),27px)}
 .cap-verb{font-size:clamp(10px,min(7cqw,5.2cqh),18px);line-height:1.3}
 .cap-visual svg{max-height:min(20cqh,65px)}
 .cap-learn{font-size:clamp(9px,min(6.5cqw,4.8cqh),15px);padding:4px 6px;min-height:26px}
 .cap-eyebrow{padding-bottom:0}
}
@media(max-height:600px){
 .cap-front{padding:8px 12px;gap:3px}
 .cap-title{font-size:clamp(13px,min(7cqw,13cqh),30px)}
 .cap-verb{font-size:clamp(9px,min(3.8cqw,7cqh),16px);line-height:1.25}
 .cap-index,.cap-tag{font-size:7px}
 .cap-visual svg{max-height:28cqh}
 .cap-learn{min-height:24px;padding:3px 6px;font-size:10px}
 .cap-eyebrow{padding-bottom:0}
}
