/* Arknights PRTS workbench. All overrides are scoped; the original theme stays intact. */
html:has(> body.theme-ark) {
 --ark-bg:#151719;
 color-scheme:only dark;
 background-color:var(--ark-bg);
}
body.theme-ark {
 --ark-bg-2:#222629;--ark-bg-3:#2c3135;
 --ark-ink:#f0f1f2;--ark-ink-2:#adb5bb;--ark-ink-3:#8e999f;
 --ark-line:#41484d;--ark-line-2:#41484d;--ark-accent:#83afc1;--ark-red:#e58d89;
 --ark-success:#a5c5b1;--ark-warning:#d5bd8e;
 --notice-success:var(--ark-bg-3);--notice-error:var(--ark-bg-3);--notice-warning:var(--ark-bg-3);--notice-info:var(--ark-bg-3);--notice-color:var(--ark-ink);--notice-radius:0px;--notice-shadow:none;
 --ark-display:"Bahnschrift","DIN Alternate","Microsoft YaHei",sans-serif;
 --ark-body:"Bahnschrift","Microsoft YaHei","PingFang SC",sans-serif;--ark-mono:Consolas,"Microsoft YaHei",monospace;
 --cream:var(--ark-bg);--cream-2:var(--ark-bg-2);--paper:var(--ark-bg-2);--ink:var(--ark-ink);--ink-soft:var(--ark-ink-2);
 --lemon:var(--ark-accent);--coral:var(--ark-accent);--sky:var(--ark-accent);--mint:var(--ark-accent);--sun:var(--ark-accent);
 --r:0px;--r-xs:0px;--r-sm:0px;--r-lg:0px;--sh-1:none;--sh-2:none;--sh-3:none;--line:1px;
 --font-display:var(--ark-display);--font-body:var(--ark-body);--font-num:var(--ark-mono);--font-mono:var(--ark-mono);
 --log-bg:var(--ark-bg);--log-ink:var(--ark-ink-2);
 --focus-ink:var(--ark-accent);--control-accent:var(--ark-accent);
 --progress-height:4px;--progress-radius:0px;--progress-track:var(--ark-line);--progress-value:var(--ark-accent);--progress-border:0;
 background:var(--ark-bg);color:var(--ark-ink);font-family:var(--ark-body);
}
.ark-brand{display:none}
body.theme-ark .container{background:transparent}
body.theme-ark .app-head{background:transparent;border:0;border-bottom:1px solid var(--ark-line);box-shadow:none;gap:20px;padding:24px 0;flex-wrap:wrap}
body.theme-ark #appTitle{color:var(--ark-ink);font:600 clamp(26px,3vw,40px)/1.15 var(--ark-display);letter-spacing:.04em;margin:0}
body.theme-ark .app-foot{color:var(--ark-ink-3);font-family:var(--ark-mono);letter-spacing:.08em;border-top:1px solid var(--ark-line);margin-top:24px;padding-top:14px}
body.theme-ark .app-foot a:hover{color:var(--ark-ink)}
body.theme-ark .ark-brand{display:flex;align-items:center;gap:12px;color:var(--ark-ink);font:700 11px/1.4 var(--ark-mono);letter-spacing:.12em}
body.theme-ark .ark-brand img{width:36px;height:42px;object-fit:contain;filter:brightness(0) invert(1)}
body.theme-ark .ark-brand small{display:block;color:var(--ark-ink-2);font-size:9px;margin-top:4px}
body.theme-ark .batt-chip{background:transparent;color:var(--ark-ink);border:1px solid var(--ark-line);border-radius:0;box-shadow:none;margin-left:auto}
body.theme-ark .battery-outline{stroke:var(--ark-ink)}
body.theme-ark .battery-fill-icon,body.theme-ark .battery-cap{fill:var(--ark-ink)}
body.theme-ark :focus-visible{outline:2px solid var(--ark-accent);outline-offset:3px}
body.theme-ark .card{background:var(--ark-bg-2);border:1px solid var(--ark-line);border-radius:0;box-shadow:none;padding:24px;margin-bottom:20px}
body.theme-ark .card__title{font:600 19px/1.35 var(--ark-display);letter-spacing:.05em;color:var(--ark-ink);gap:12px;padding-bottom:16px;border-bottom:1px solid var(--ark-line);margin-bottom:20px}
body.theme-ark .ic-wrap{background:var(--ark-ink);color:var(--ark-bg);width:28px;height:28px;min-width:28px;border:0;border-radius:0;box-shadow:none;rotate:0}
body.theme-ark .ic-wrap .ic{stroke:var(--ark-bg);width:17px;height:17px}
body.theme-ark .divider{background:var(--ark-line);height:1px;border:0;margin:20px 0}
body.theme-ark :is(.primary-button,.secondary-button,.icon-button,.mode-button,.detail-back,.disconnect-btn,.batch-remove,.kb-key,.kb-event-tab,.anim-tool){border-radius:0;box-shadow:none;font-family:var(--ark-body);font-weight:600;transform:none;transition:background .15s,color .15s,border-color .15s}
body.theme-ark :is(.primary-button,.secondary-button){min-height:44px;font-size:13px;letter-spacing:.06em}
body.theme-ark .primary-button{background:var(--ark-ink);color:var(--ark-bg);border:1px solid var(--ark-ink)}
body.theme-ark .primary-button .ic{stroke:currentColor}
body.theme-ark :is(.secondary-button,.icon-button,.mode-button,.detail-back,.disconnect-btn,.batch-remove,.kb-key,.kb-event-tab,.anim-tool){background:transparent;color:var(--ark-ink);border:1px solid var(--ark-line)}
body.theme-ark :is(.primary-button,.secondary-button,.icon-button,.mcard,.mode-button,.detail-back,.kb-key,.anim-tool):hover:not(:disabled){transform:none;box-shadow:none;filter:none;border-color:var(--ark-ink);background:var(--ark-bg-3);color:var(--ark-ink)}
body.theme-ark :is(.primary-button,.secondary-button,.icon-button,.mode-button,.detail-back,.disconnect-btn):active:not(:disabled){transform:none;box-shadow:none;background:var(--ark-bg-3);border-color:var(--ark-accent);color:var(--ark-ink)}
body.theme-ark :is(.primary-button,.secondary-button):disabled{opacity:.35;box-shadow:none;cursor:not-allowed}
body.theme-ark .disconnect-btn{min-height:44px}
body.theme-ark :is(.device-info strong,.device-hint,.transfer-status,.batch-meta b){overflow-wrap:anywhere}
body.theme-ark :is(.danger,.disconnect-btn){color:var(--ark-red)}
body.theme-ark :is(.status,.device-item,.file-item,.batch-row,.action-item,.transfer-container,.result,.custom-quote-panel,.keyboard-key-summary,.anim-frame,.anim-stat,.anim-warn){background:var(--ark-bg);color:var(--ark-ink);border:1px solid var(--ark-line);border-radius:0;box-shadow:none}
body.theme-ark :is(.status.connected,.connected-device,.file-item.displaying,.batch-row[data-state="busy"],.anim-frame.on){border-color:var(--ark-accent);box-shadow:inset 3px 0 var(--ark-accent)}
body.theme-ark :is(.device-item,.file-item):hover{background:var(--ark-bg-3)}
body.theme-ark :is(.device-info strong,.file-name,.batch-meta b,.action-header,.switch-row__label){font-family:var(--ark-body);color:var(--ark-ink)}
body.theme-ark :is(.info,.device-hint,.device-id,.device-resolution,.field-hint,.switch-row__hint,.empty-state,.file-size,.file-id,.batch-meta small,.batch-state,.transfer-status,.transfer-progress,.anim-hint,.anim-stat__lbl,.kb-tip,.zoom-hint-row,.no-devices,.wifi-status-row,.download-status-text){color:var(--ark-ink-2)}
body.theme-ark :is(.device-type-badge,.value-chip,.batch-count,.anim-chip,.kb-chip,.anim-frame__no,.anim-stage__badge){background:var(--ark-ink);color:var(--ark-bg);border:0;border-radius:0;font:600 11px/1.5 var(--ark-mono);padding:4px 8px}
body.theme-ark :is(.field label,.field--tight label,.slider-container label){font-size:12px;letter-spacing:.05em;color:var(--ark-ink-2);font-family:var(--ark-body)}
body.theme-ark :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),select,textarea,.quote-input){background-color:var(--ark-bg);color:var(--ark-ink);border:1px solid var(--ark-line);border-radius:0;box-shadow:none;font-family:var(--ark-body)}
body.theme-ark :is(input,select,textarea)::placeholder{color:var(--ark-ink-3)}
body.theme-ark :is(input,select,textarea):focus{border-color:var(--ark-accent);box-shadow:none}
body.theme-ark input[type="file"]::file-selector-button{background:var(--ark-bg-2);border:1px solid var(--ark-line)}
body.theme-ark .slider-toggle{background:var(--ark-line);border:0;border-radius:0;box-shadow:none}
body.theme-ark .slider-toggle::before{background:var(--ark-ink);border:0;border-radius:0;box-shadow:none}
body.theme-ark .switch input:checked + .slider-toggle{background:var(--ark-accent)}
body.theme-ark .switch-row{border-color:var(--ark-line)}
body.theme-ark .panel{background:var(--ark-bg);border:1px solid var(--ark-line);border-radius:0}
body.theme-ark .panel__head{background:var(--ark-ink);color:var(--ark-bg);border:0;border-radius:0;font-weight:600}
body.theme-ark .panel__content{background:var(--ark-bg)}
body.theme-ark .frame-cards{gap:12px}
body.theme-ark .mcard{background:var(--ark-bg);border:1px solid var(--ark-line);border-radius:0;rotate:0;box-shadow:none;color:var(--ark-ink);padding:24px 18px}
body.theme-ark .mcard:nth-child(n){rotate:0}
body.theme-ark .mcard__name{font:600 18px/1.3 var(--ark-display);color:var(--ark-ink);letter-spacing:.06em}
body.theme-ark .mcard__sub{color:var(--ark-ink-2)}
body.theme-ark .mcard__emo{display:none}
body.theme-ark .mcard__new{background:var(--ark-ink);color:var(--ark-bg);border:0;border-radius:0;font-family:var(--ark-mono)}
body.theme-ark .detail-bar{background:transparent;border:0;border-bottom:1px solid var(--ark-line);border-radius:0;padding:0 0 16px;margin-bottom:20px}
body.theme-ark .detail-name{color:var(--ark-ink-2);font-family:var(--ark-mono);letter-spacing:.12em}
body.theme-ark .polaroid-frame{background:var(--ark-bg);padding:12px;border:1px solid var(--ark-line);border-radius:0;box-shadow:none}
body.theme-ark .polaroid-frame::after{display:none}
body.theme-ark :is(.polaroid-inner,.anim-stage-inner){background:#fff;border:1px solid var(--ark-line);border-radius:0}
body.theme-ark :is(#frameVideo,#animVideo,.anim-draw-box,.batch-thumb){border:1px solid var(--ark-line);border-radius:0}
body.theme-ark .batch-row[data-state="fail"]{border-color:var(--ark-red)}
body.theme-ark :is(.mode-button.active,.kb-event-tab.active,.kb-key.active,.anim-tool.active,.anim-imgtools__all.is-on){background:var(--ark-accent);color:var(--ark-bg);border-color:var(--ark-accent);box-shadow:none;transform:none}
body.theme-ark :is(.mode-button.active,.kb-event-tab.active,.kb-key.active,.anim-tool.active) .ic{stroke:var(--ark-bg)}
body.theme-ark .debug-log{background:var(--ark-bg);color:var(--ark-ink-2);border:1px solid var(--ark-line);border-radius:0}
body.theme-ark .kb-modal-mask{background:#000b}
body.theme-ark .kb-modal-panel{background:var(--ark-bg-2);color:var(--ark-ink);border:1px solid var(--ark-line);border-radius:0;box-shadow:none}
body.theme-ark .kb-modal-header{border-color:var(--ark-line)}
body.theme-ark .anim-swatch{border-radius:0}
body.theme-ark .anim-swatch.on{box-shadow:0 0 0 2px var(--ark-bg),0 0 0 3px var(--ark-accent)}
body.theme-ark .anim-stat b.warn,body.theme-ark .anim-stat b.over{color:var(--ark-red)}
body.theme-ark .bottom-nav{background:var(--ark-bg);border:0;border-top:1px solid var(--ark-line);border-radius:0;box-shadow:none}
body.theme-ark .nav-item{color:var(--ark-ink-2);border:0;border-radius:0;box-shadow:none;font:600 11px/1.4 var(--ark-body);letter-spacing:.04em;transform:none}
body.theme-ark .nav-item:hover{background:var(--ark-bg-3);color:var(--ark-ink);box-shadow:none;transform:none;border:0}
body.theme-ark .nav-item.active{background:var(--ark-ink);color:var(--ark-bg);box-shadow:none;transform:none;border:0}
body.theme-ark .nav-item.active span{color:inherit}
body.theme-ark .nav-item .ic{stroke:currentColor}
body.theme-ark .nav-item.active::after{display:none}
body.theme-ark .page.active > *,body.theme-ark .frame-tab-content.active > *{animation:none}
/* Shared controls used by Frame, Film, animation and settings. */
body.theme-ark input[type="range"]::-webkit-slider-runnable-track{height:4px;background:var(--ark-line);border:0;border-radius:0}
body.theme-ark input[type="range"]::-webkit-slider-thumb{width:16px;height:22px;margin-top:-9px;background:var(--ark-ink);border:1px solid var(--ark-bg);border-radius:0;box-shadow:none}
body.theme-ark input[type="range"]::-moz-range-track{height:4px;background:var(--ark-line);border:0;border-radius:0}
body.theme-ark input[type="range"]::-moz-range-thumb{width:16px;height:22px;background:var(--ark-ink);border:1px solid var(--ark-bg);border-radius:0;box-shadow:none}
body.theme-ark .switch-row{border-bottom-style:solid;border-bottom-width:1px}
body.theme-ark .slider-toggle::before{top:5px}
body.theme-ark :is(.error,.log-entry.error,.anim-stat__warn){color:var(--ark-red)}
body.theme-ark :is(.success,.log-entry.success){color:var(--ark-success)}
body.theme-ark .log-entry.info{color:var(--ark-accent)}
body.theme-ark .secondary-button.warning{color:var(--ark-warning)}
body.theme-ark .message{max-width:calc(100vw - 32px);width:max-content;box-sizing:border-box;overflow-wrap:anywhere;border:1px solid var(--ark-line);border-left:3px solid var(--ark-accent);font:500 13px/1.6 var(--ark-body)}
body.theme-ark .message.success{border-left-color:var(--ark-success)}
body.theme-ark .message.error{border-left-color:var(--ark-red)}
body.theme-ark .message.warning{border-left-color:var(--ark-warning)}
body.theme-ark .no-devices{border:1px dashed var(--ark-line);border-radius:0}
body.theme-ark .device-type-info{background:var(--ark-bg);border:1px solid var(--ark-line);border-radius:0}
body.theme-ark .batch-state{background:var(--ark-bg-3);color:var(--ark-ink-2);border:1px solid var(--ark-line);border-radius:0}
body.theme-ark .batch-row[data-state="done"]{border-color:var(--ark-success)}
body.theme-ark .batch-row[data-state="fail"] .batch-state{color:var(--ark-red)}
body.theme-ark .batch-row[data-state="done"] .batch-state{color:var(--ark-success)}
body.theme-ark .batt-chip:is(:hover,:active){transform:none;box-shadow:none}
body.theme-ark .loading{border-color:var(--ark-line);border-top-color:var(--ark-accent)}
body.theme-ark .file-list{border:1px solid var(--ark-line);border-radius:0;background:var(--ark-bg)}
body.theme-ark .file-id{background:var(--ark-bg-3);color:var(--ark-ink-2);border:1px solid var(--ark-line);border-radius:0}
body.theme-ark .action-item{padding:16px}
body.theme-ark .panel__content{padding-top:16px}
/* Animation tooling keeps its actual pixel palette and preview canvas colors. */
body.theme-ark .anim-stat__lbl{opacity:1}
body.theme-ark .anim-frame__tag{border-radius:0;background:var(--ark-accent);color:var(--ark-bg)}
body.theme-ark .anim-imgtools__all{border:1px solid var(--ark-line);background:transparent;color:var(--ark-ink);box-shadow:none;transform:none}
body.theme-ark :is(.anim-zoom.active,.anim-play.is-playing,.anim-imgtools__all.is-on){background:var(--ark-accent);border-color:var(--ark-accent);color:var(--ark-bg);box-shadow:none;transform:none}
body.theme-ark :is(.anim-zoom,.anim-play) .ic{stroke:currentColor}
body.theme-ark .anim-imgtools__all.is-on input{accent-color:var(--ark-bg)}
body.theme-ark .anim-imgtools__all:active{transform:none;box-shadow:none}
body.theme-ark :is(.anim-tool,.anim-swatch):hover{transform:none}
body.theme-ark .anim-tool{min-width:44px;min-height:44px}
body.theme-ark .anim-frame-move{flex-wrap:wrap}
/* Shared keyboard dialog follows the same shell when present. */
body.theme-ark .kb-modal-header{background:var(--ark-bg);color:var(--ark-ink)}
body.theme-ark .kb-modal-footer{background:var(--ark-bg);border-color:var(--ark-line)}
body.theme-ark .kb-chips{background:var(--ark-bg);border:1px solid var(--ark-line)}
body.theme-ark .kb-current-clear{background:transparent;color:var(--ark-red);border:1px solid var(--ark-line);min-height:44px;box-shadow:none;transform:none}
body.theme-ark .kb-key.kb-key-mod{background:var(--ark-bg-3);color:var(--ark-accent)}
body.theme-ark .kb-key.kb-key-mod.active{background:var(--ark-accent);color:var(--ark-bg)}
body.theme-ark :is(.mode-button.active,.kb-event-tab.active,.kb-key.active,.anim-tool.active,.anim-zoom.active,.anim-play.is-playing,.anim-imgtools__all.is-on):is(:hover,:active){background:var(--ark-accent);border-color:var(--ark-accent);color:var(--ark-bg);transform:none;box-shadow:none}
@media(min-width:900px){
 body.theme-ark{padding:40px 36px 64px}
 body.theme-ark .container{max-width:1440px;grid-template-columns:184px minmax(0,1fr);gap:24px 36px}
 body.theme-ark .app-head{padding:0 0 24px;min-height:86px}
 body.theme-ark .bottom-nav{position:sticky;top:40px;border:0;border-left:1px solid var(--ark-line);padding:0;gap:2px}
 body.theme-ark .nav-item{padding:20px 16px;justify-content:flex-start;flex-direction:row;gap:12px;font-size:13px;min-height:60px}
 body.theme-ark .nav-item.active{border-left:3px solid var(--ark-accent)}
 body.theme-ark .page.active{column-count:1;display:block;max-width:none}
 body.theme-ark .page.active > *{margin-bottom:20px}
 body.theme-ark #convert-page.active{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.85fr);gap:20px;column-count:1}
 body.theme-ark #convert-page.active > .card:has(> .polaroid-frame){grid-column:2;grid-row:1 / span 2}
 body.theme-ark .frame-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
 body.theme-ark .frame-detail.is-open{max-width:none}
 body.theme-ark .frame-detail.is-open .frame-tab-content.active{gap:20px;grid-template-columns:minmax(0,1fr) minmax(280px,.85fr)}
 body.theme-ark .frame-detail.is-open .frame-tab-content.active > .card:has(> .polaroid-frame),body.theme-ark .frame-detail.is-open #frame-batch.active > .card:last-of-type{grid-row:1 / span 2}
}
@media(max-width:899px){
 body.theme-ark .app-head{padding:18px 20px;gap:12px;display:flex;flex-wrap:wrap;flex-shrink:0}
 body.theme-ark .ark-brand{order:0;flex:1}
 body.theme-ark .batt-chip{order:1}
 body.theme-ark #appTitle{order:2;width:100%;font-size:28px}
 body.theme-ark #page-content{padding:20px 16px calc(88px + env(safe-area-inset-bottom))}
 body.theme-ark .card{padding:20px 16px}
 body.theme-ark .bottom-nav{padding:4px 4px max(4px,env(safe-area-inset-bottom));gap:0}
 body.theme-ark .nav-item{min-height:58px;gap:5px;font-size:10px;padding:8px 3px}
 body.theme-ark .nav-item .ic{width:20px;height:20px}
 body.theme-ark :is(input[type="text"],input[type="password"],input[type="number"],select,textarea){font-size:16px}
}
@media(prefers-reduced-motion:reduce){body.theme-ark :is(button,a,input,select,textarea){transition:none}}
@media(min-width:900px) and (max-width:1100px){body.theme-ark #convert-page.active,body.theme-ark .frame-detail.is-open .frame-tab-content.active{display:block}body.theme-ark .frame-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
