:root{color-scheme:light;--bg:#f5f6f8;--surface:#fff;--ink:#172333;--muted:#586679;--border:#dce2e8;--accent:#244bd9;--side:#111f31;--focus:#bb6700;font:15px/1.6 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
:root[data-theme=dark]{color-scheme:dark;--bg:#101720;--surface:#19232f;--ink:#ecf0f6;--muted:#b1bdcc;--border:#354356;--accent:#a4b9ff;--focus:#ffcf7c}
@media(prefers-color-scheme:dark){:root[data-theme=system]{color-scheme:dark;--bg:#101720;--surface:#19232f;--ink:#ecf0f6;--muted:#b1bdcc;--border:#354356;--accent:#a4b9ff;--focus:#ffcf7c}}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}a{color:var(--accent);text-underline-offset:4px}button,input,select{font:inherit}button,select{cursor:pointer}button,.primary{border:1px solid var(--border);border-radius:8px;padding:10px 15px;background:var(--surface);color:var(--ink)}button:hover{filter:brightness(.94)}.primary{display:inline-block;background:#3459dc;color:#fff;border-color:#3459dc;text-decoration:none;font-weight:600}input,select{max-width:100%;border:1px solid var(--border);background:var(--surface);color:var(--ink);padding:10px 12px;border-radius:8px}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}h1,h2,p{margin-top:0}h1{font-size:32px;line-height:1.2;letter-spacing:-1px;margin-bottom:10px}h2{font-size:20px;line-height:1.4;letter-spacing:-.4px}small{font-size:12px}.muted{color:var(--muted)}.eyebrow{font-size:11px;letter-spacing:1.9px;font-weight:700;color:var(--muted)}.shell{display:flex;min-height:100vh}aside{width:264px;flex-shrink:0;background:var(--side);color:#c0cede;padding:30px 16px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:center;color:#fff;text-decoration:none;font-size:32px;font-weight:750;padding:0 10px;line-height:1.2}.brand>span{font-size:13px;letter-spacing:2px}.brand small{font-size:9px;letter-spacing:1.3px;font-weight:500;color:#c0cede}.nav-label{font-size:10px;letter-spacing:2px;padding:30px 14px 8px;margin:0;color:#a6b6ca}nav{display:grid;gap:4px}nav a{display:flex;align-items:center;gap:12px;font-size:13px;padding:11px 14px;border-radius:8px;text-decoration:none;color:#bdcada}nav a:hover{background:#203249;color:#fff}nav a[aria-current]{background:#304bc5;color:#fff}.nav-dot{height:7px;width:7px;flex-shrink:0;border:1px solid currentColor;border-radius:2px}.sidebar-foot{margin-top:auto;padding:30px 14px 0;font-size:11px;color:#a6b6ca}.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#94d6ba;margin-right:5px}.workspace{flex:1;min-width:0}header{min-height:86px;border-bottom:1px solid var(--border);background:var(--surface);display:flex;gap:16px;align-items:center;padding:16px 36px}header button,header select,header summary{font-size:12px}.search{display:flex;gap:6px;margin-right:auto;flex:1}.search input{width:100%;max-width:400px;border-color:transparent;background:var(--bg)}.popover{position:relative}summary{cursor:pointer;padding:10px;white-space:nowrap}.popover>div{position:absolute;right:0;top:100%;padding:20px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 40px #0002;width:270px;z-index:3}.popover form{margin-top:15px}.content{max-width:1600px;margin:auto;padding:40px}.page-title{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:26px}.page-title p{margin-bottom:0}.badge{display:inline-block;font-size:11px;font-weight:600;background:var(--bg);color:var(--muted);border:1px solid var(--border);padding:5px 10px;border-radius:20px;white-space:nowrap}.welcome{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:30px;padding:38px;border-radius:16px;background:linear-gradient(115deg,#142c49,#254c71);color:#fff;margin-bottom:24px}.welcome .eyebrow{color:#bdcfe6}.welcome h2{font-size:32px;line-height:1.25;letter-spacing:-1px}.welcome p{color:#d2deed}.welcome .primary{background:#fff;color:#203a65;border-color:#fff;margin-top:6px}.archive-mark{display:grid;text-align:center;min-width:200px;color:#ccdef0}.archive-mark span{font-size:100px;font-weight:800;line-height:1.2;letter-spacing:-10px}.archive-mark small{font-size:9px;letter-spacing:2px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin-bottom:24px}.card{background:var(--surface);border:1px solid var(--border);padding:26px;border-radius:12px;margin-bottom:22px}.metrics .card{padding:22px;margin:0}.metrics .card p{font-size:12px}.metrics strong{display:block;font-size:19px;line-height:1.4}.metric-note{color:var(--muted);margin-top:16px;margin-bottom:0;font-size:10px!important}.columns{display:grid;grid-template-columns:1.4fr 1fr;gap:24px}.readiness{list-style:none;padding:0;margin:0}.readiness li{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);padding:13px 0;font-size:13px}.readiness li:last-child{border-bottom:0}.empty{text-align:center;padding:70px 30px}.empty-icon{font-size:48px;color:var(--muted)}.empty p{max-width:650px;margin:0 auto 20px}footer{font-size:11px;color:var(--muted);display:flex;justify-content:space-between;gap:16px;padding:18px 0}.auth{display:grid;grid-template-columns:1fr 1fr;min-height:100vh}.auth-story{background:linear-gradient(145deg,#101e30,#22496c);color:#fff;padding:55px;display:flex;flex-direction:column;justify-content:space-between;gap:70px}.auth-story .eyebrow{color:#bbcee4}.auth-story h1{font-size:clamp(36px,4vw,60px);line-height:1.15}.auth-story p,.auth-story small{color:#bdcfe4}.auth-panel{display:flex;align-items:center;justify-content:center;padding:45px}.auth-card{width:100%;max-width:400px}.auth-card label{display:block;font-size:13px;margin:20px 0 7px}.auth-card input:not([type=checkbox]){width:100%}.auth-card .check{display:flex;gap:9px;align-items:center}.auth-card .primary{width:100%;margin:18px 0}.notice{padding:15px;background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:8px}.mobile-menu{display:none}.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip:focus{position:fixed;z-index:10;background:var(--surface);padding:12px}
@media(min-width:1500px){.content{padding:48px 60px}}
@media(max-width:1200px){header{padding:16px;gap:8px}.content{padding:28px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.archive-mark{display:none}aside{width:235px}.popover summary{max-width:130px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:900px){.columns{grid-template-columns:1fr}.auth{grid-template-columns:1fr}.auth-story{padding:30px;gap:35px}.auth-story h1{font-size:36px}.auth-story>small{display:none}header{flex-wrap:wrap}.search{min-width:180px}.auth-panel{padding:35px 24px}}
@media(max-width:700px){aside{display:none;position:absolute;top:130px;bottom:auto;left:0;z-index:4;box-shadow:10px 15px 30px #0004}aside.open{display:flex}.mobile-menu{display:block}header{min-height:130px}.search{order:5;flex-basis:100%}.search input{max-width:none}.content{padding:24px 16px}.page-title{align-items:flex-start;flex-direction:column;gap:12px}h1{font-size:27px}.welcome{padding:25px}.welcome h2{font-size:28px}.metrics{gap:12px}.metrics .card{padding:17px}.metrics strong{font-size:16px}header select{max-width:125px}.popover summary{max-width:100px}.popover>div{position:fixed;top:135px;left:16px;right:16px;width:auto}.auth-story{min-height:260px}.auth-story h1{font-size:30px}.auth-story .brand{font-size:24px}.auth-story p:not(.eyebrow){display:none}footer{flex-direction:column}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Phase 2 media screens. */
#media-app form{display:grid;gap:14px}#media-app label{display:grid;gap:6px;font-size:13px}#media-app label.check{display:flex;align-items:center;gap:9px}#media-app textarea{font:inherit;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--ink);padding:12px;min-height:90px;max-width:100%}.library-toolbar form{grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}.media-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:18px 0}.media-actions button[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}.asset-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.asset-card{padding:18px;min-width:0;overflow-wrap:anywhere}.asset-card img,.asset-placeholder{width:100%;height:160px;object-fit:contain;border-radius:8px;background:var(--bg);margin-bottom:12px}.asset-placeholder{display:grid;place-items:center;letter-spacing:3px;color:var(--muted);font-size:14px}.asset-card>button{display:block;text-align:left;margin:12px 0;max-width:100%;overflow-wrap:anywhere}.asset-card p{font-size:12px}.asset-grid.list-mode{grid-template-columns:1fr}.asset-grid.list-mode .asset-card{display:flex;flex-wrap:wrap;align-items:center;gap:15px}.asset-grid.list-mode img,.asset-grid.list-mode .asset-placeholder{width:80px;height:65px}.upload-drop{padding:35px;border:2px dashed var(--border);border-radius:12px;display:grid;gap:18px}.upload-drop.dragging{border-color:var(--accent);background:var(--bg)}.upload-row{padding:24px 0;border-bottom:1px solid var(--border)}.upload-row button{margin:0 8px 8px 0}.upload-row h3{overflow-wrap:anywhere}.upload-row progress{width:100%;height:16px}.user-card{border-top:1px solid var(--border);padding:18px 0}.user-card summary{font-size:16px;white-space:normal}.user-card form{padding:18px}.error{border-left-color:#bd3333}dialog{width:min(850px,calc(100% - 24px));max-height:90vh;overflow:auto;background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:15px;padding:28px}dialog::backdrop{background:#0008}.detail-preview{max-width:100%;max-height:400px;display:block;margin:20px auto}.checksum{overflow-wrap:anywhere;font-size:11px;color:var(--muted)}dl{display:grid;grid-template-columns:1fr 3fr;gap:10px}dt{text-transform:capitalize;font-weight:600}dd{margin:0;overflow-wrap:anywhere}#asset-dialog form{margin-top:24px}#asset-dialog>button{margin-bottom:20px}.asset-grid .empty{grid-column:1/-1}
@media(max-width:1100px){.asset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.library-toolbar form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.asset-grid,.library-toolbar form{grid-template-columns:1fr}.upload-drop{padding:20px}.upload-drop input{width:100%}dialog{padding:18px}dl{grid-template-columns:1fr}#media-app .metrics{grid-template-columns:1fr}}

button:disabled{opacity:.45;cursor:default}

.branded-player{display:block;width:100%;min-height:400px;border:0;border-radius:14px;background:#10151f}#media-app form textarea{max-width:100%}#media-app [readonly]{font-family:ui-monospace,monospace}

.editor-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.editor-fields label{min-width:0}.editor-comparison{display:grid;grid-template-columns:1fr 1fr;gap:16px}.editor-comparison figure{margin:0;min-width:0}.editor-comparison img,.editor-comparison video{width:100%;max-height:480px;object-fit:contain;background:#111;border-radius:10px}.editor-version{padding:20px 0;border-top:1px solid var(--border)}.editor-version a{display:inline-block;margin:12px}#editor-recipe fieldset{margin:20px 0;border:1px solid var(--border);border-radius:12px;padding:18px}#editor-recipe legend{font-weight:650}#editor-recipe p{font-size:.9rem;line-height:1.6}@media(max-width:600px){.editor-comparison{grid-template-columns:1fr}.editor-fields{grid-template-columns:1fr 1fr}}
#archive-analysis p{overflow-wrap:anywhere}#editor-recipe fieldset{min-inline-size:0;max-width:100%}#restoration-settings select{width:100%}.editor-fields{min-width:0}

.ai-transcript{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;line-height:1.6}#ai-inventory p,#ai-health,#ai-quota{overflow-wrap:anywhere}

/* Phase 8 keyboard focus and narrow-screen resilience. */
textarea:focus-visible,dialog:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
main:focus{outline:none}fieldset{min-inline-size:0}input,select,textarea{min-width:0}
@media(max-width:700px){aside.open{max-height:calc(100dvh - 140px);overflow-y:auto;overscroll-behavior:contain}header button,header summary,nav a{min-height:44px}.editor-fields{grid-template-columns:1fr}}

/* User directory names and addresses must fit narrow viewports. */
#media-users,.user-card{min-width:0}.user-card{overflow-wrap:anywhere}.user-card summary{overflow-wrap:anywhere}

.asset-video{width:100%;height:180px;object-fit:contain;border-radius:8px;background:var(--bg)}

.video-poster{min-height:80px}.video-poster-image{display:block;width:100%;max-height:360px;object-fit:contain;border-radius:8px}.asset-card>.poster-open{width:100%;padding:0;border:0;background:transparent}.poster-open .video-poster-image{height:180px;margin:0}.video-poster p{white-space:normal}.poster-open p{padding:12px}.asset-grid.list-mode .poster-open{width:100px}.asset-grid.list-mode .poster-open img{width:100px;height:70px}

.rmm-poster-decoder{position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;left:-10px;top:0}
.video-poster-image[hidden]{display:none}
.asset-card>.poster-open{min-height:180px}.asset-grid.list-mode .poster-open{min-height:70px}
.asset-card>.poster-open{position:relative}.poster-open::after{content:'▶';position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#000b;color:#fff;font-size:15px;pointer-events:none}
/* Visual editor: compact touch sliders and an anchored live picture. */
.editor-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr);gap:20px;align-items:start}.editor-live-panel{position:sticky;top:16px;z-index:2;min-width:0}.editor-live-panel h2{font-size:20px;overflow-wrap:anywhere;margin:0 0 12px}.editor-stage{position:relative;min-height:200px;border-radius:10px;overflow:hidden;background:repeating-conic-gradient(#b6bdc8 0% 25%,#e3e6ec 0% 50%) 50%/16px 16px}.editor-stage canvas{display:block;width:100%;height:320px;object-fit:contain}.editor-stage>p{position:absolute;inset:0;display:grid;place-items:center;margin:0;padding:16px;text-align:center;background:var(--surface)}.editor-stage>p[hidden],.editor-live [hidden]{display:none!important}.editor-live-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.editor-live-panel p{font-size:12px;line-height:1.5}.editor-live-panel #editor-draft-status{color:var(--ink);font-weight:600}.editor-adjustments{min-width:0;padding:18px}.editor-adjustments>label{margin-bottom:14px}#editor-recipe fieldset{margin:0;padding:14px 0;border:0}#editor-recipe legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.editor-group{border-top:1px solid var(--border);padding:8px 0}.editor-group>summary{white-space:normal;overflow-wrap:anywhere;font-weight:650;padding:10px 0;cursor:pointer;min-height:44px}.editor-group .editor-fields{grid-template-columns:1fr;gap:14px}#editor-recipe .editor-slider{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 8px;font-size:13px}.editor-slider>output{grid-column:2;grid-row:1;font-variant-numeric:tabular-nums;color:var(--ink);font-weight:650}.editor-slider>input[type=range],#editor-live-seek{grid-column:1/-1;appearance:none;-webkit-appearance:none;width:100%;min-width:0;height:44px;min-height:44px;margin:0;padding:0;border:0;background:transparent;cursor:ew-resize;touch-action:pan-y}.editor-slider>input[type=range]::-webkit-slider-runnable-track,#editor-live-seek::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:linear-gradient(to right,var(--accent) var(--range-fill,0%),var(--border) var(--range-fill,0%))}.editor-slider>input[type=range]::-webkit-slider-thumb,#editor-live-seek::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:20px;height:20px;border-radius:50%;margin-top:-8px;background:var(--accent);border:2px solid var(--surface);box-shadow:0 1px 4px #0003}.editor-slider>input[type=range]::-moz-range-track,#editor-live-seek::-moz-range-track{height:4px;background:var(--border);border-radius:4px}.editor-slider>input[type=range]::-moz-range-progress{height:4px;background:var(--accent)}.editor-slider>input[type=range]::-moz-range-thumb,#editor-live-seek::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:var(--accent);border:2px solid var(--surface)}#editor-recipe input[type=range]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.editor-exact>output{display:none}#save-editor-recipe{box-shadow:0 3px 16px #0002}#editor-playback{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center}#editor-playback>label{font-size:11px}#editor-live-time{font-size:11px;white-space:nowrap}.editor-live-panel .editor-live-actions button{font-size:12px;min-height:40px;padding:8px 10px}
@media(max-width:1000px){.editor-layout{grid-template-columns:1fr}.editor-stage canvas{height:200px}.editor-stage{min-height:140px}.editor-live-panel{top:6px;padding:14px}.editor-live-panel h2{font-size:16px;margin-bottom:8px}.editor-live-panel p{font-size:11px;margin:6px 0}.editor-live-panel #editor-live-note{font-size:10px}.editor-live-actions{margin:8px 0}.editor-adjustments{padding:16px}#editor-playback{gap:6px}}
@media(max-width:600px){.editor-stage canvas{height:165px}.editor-live-panel .editor-live-actions button{min-height:36px}#editor-workspace{scroll-margin-top:8px}}
@media(max-height:600px){.editor-live-panel{position:static}.editor-stage canvas{height:150px}}

/* Visible media tools and simultaneous original/live frames. */
.editor-pictures{--editor-zoom:1;--editor-preview-height:280px;display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.editor-pictures.comparing{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-pictures figure{margin:0;min-width:0}.editor-pictures figure[hidden]{display:none}.editor-pictures figcaption{font-size:12px;font-weight:650;margin-bottom:4px}.editor-picture{height:var(--editor-preview-height);min-height:0;overflow:auto;overscroll-behavior:contain;border-radius:8px;background:repeating-conic-gradient(#b6bdc8 0% 25%,#e3e6ec 0% 50%) 50%/16px 16px}.editor-picture canvas{display:block;max-width:none;width:calc(100% * var(--editor-zoom));height:calc(var(--editor-preview-height) * var(--editor-zoom));object-fit:contain}.editor-quick-tools{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}.editor-quick-tools button{font-size:12px;min-height:44px;padding:8px}.editor-view-zoom{display:grid;grid-template-columns:1fr auto;font-size:12px}.editor-view-zoom input{grid-column:1/-1;width:100%;height:44px;padding:0;accent-color:var(--accent);touch-action:pan-y}.editor-live-panel .editor-live-actions button{min-height:44px}
@media(max-width:1000px){.editor-pictures{--editor-preview-height:160px}.editor-live-panel{position:static}.editor-quick-tools{margin:4px 0}}
@media(max-width:600px){.editor-pictures{--editor-preview-height:145px}.editor-pictures.comparing{--editor-preview-height:130px}}

.editor-quick-tools[hidden]{display:none}.editor-picture{scrollbar-width:thin}

@media(max-width:1000px) and (min-height:700px){.editor-live-panel{position:sticky;top:6px}.editor-live-panel .editor-zoom-help{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}#editor-recipe input,#editor-recipe select,#editor-recipe button,#editor-recipe summary{scroll-margin-top:var(--editor-panel-offset,450px)}}
.editor-view-zoom input{appearance:none;-webkit-appearance:none;border:0;background:transparent;cursor:ew-resize}.editor-view-zoom input::-webkit-slider-runnable-track{height:4px;border-radius:4px;background:var(--border)}.editor-view-zoom input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:20px;height:20px;border-radius:50%;margin-top:-8px;background:var(--accent);border:2px solid var(--surface)}.editor-view-zoom input::-moz-range-track{height:4px;border-radius:4px;background:var(--border)}.editor-view-zoom input::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:var(--accent);border:2px solid var(--surface)}

.restoration-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding-left:20px}.restoration-steps li{padding:8px;font-size:13px}#neural-readiness{overflow-wrap:anywhere}@media(max-width:900px){.restoration-steps{grid-template-columns:1fr 1fr}}@media(max-width:500px){.restoration-steps{grid-template-columns:1fr}}#neural-consent[hidden]{display:none}

#media-app[data-section=restoration] .editor-comparison{grid-template-columns:repeat(2,minmax(0,1fr))}
#editor-recipe label.check{min-height:44px}#editor-recipe input[type=checkbox]{width:24px;height:24px;min-width:24px;min-height:24px;flex:0 0 24px;margin:0}
