:root{color-scheme:light;--bg:#f3f5f9;--surface:#fff;--surface-2:#f7f9fc;--text:#1c2940;--muted:#54647c;--border:#dce3ed;--accent:#235bdd;--accent-soft:#eaf0ff;--accent-text:#174cbf;--shadow:0 4px 20px #172b4d06;--green:#166344;--green-bg:#e7f5ed;--red:#aa303c;--red-bg:#ffedf0;--amber:#80500a;--amber-bg:#fff3d9;--focus:#5385f5;font:15px/1.5 'Segoe UI',system-ui,sans-serif;background:var(--bg);color:var(--text)}
:root[data-theme=dark]{color-scheme:dark;--bg:#101620;--surface:#192231;--surface-2:#202c3e;--text:#e7edf6;--muted:#aab8cc;--border:#344258;--accent:#4a82f5;--accent-soft:#22385c;--accent-text:#adcbff;--shadow:0 4px 20px #00000018;--green:#8fe0b5;--green-bg:#1c3a31;--red:#ffb0b9;--red-bg:#472b35;--amber:#f7d18b;--amber-bg:#413522;--focus:#8ab1ff}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}header,main{width:100%;max-width:1920px;margin:auto;padding:24px}header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:18px;position:relative;z-index:4;background:var(--surface);border-bottom:1px solid var(--border)}main{padding-top:12px;padding-bottom:64px}h1,h2,h3{line-height:1.25;letter-spacing:-.025em}h1{font-size:25px;margin:0 0 5px;font-weight:750}h2{font-size:21px;margin:0 0 18px}h3{font-size:17px;margin:24px 0 12px}p{line-height:1.65;color:var(--muted);margin:12px 0}a{color:var(--accent-text);text-underline-offset:3px}nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.muted{color:var(--muted);font-size:13px}
button,input,select,textarea{font:inherit;color:var(--text);border:1px solid var(--border);border-radius:8px;background:var(--surface);padding:10px 12px;max-width:100%;min-height:40px}input,select,textarea{background:var(--surface-2)}input[type=checkbox]{width:18px;height:18px;min-height:0;accent-color:var(--accent)}textarea{width:100%;line-height:1.7;resize:vertical}button{cursor:pointer;font-weight:600;white-space:nowrap}button:hover{background:var(--accent-soft);border-color:var(--accent)}button:disabled{opacity:.5;cursor:not-allowed}button.primary{background:var(--accent);color:white;border-color:var(--accent)}button.danger{color:var(--red)}button.danger:hover{background:var(--red-bg);border-color:var(--red)}:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.theme-switch{display:inline-flex;align-items:center;gap:3px;padding:3px;background:var(--surface-2);border:1px solid var(--border);border-radius:10px}.theme-switch button{font-size:13px;padding:6px 10px;min-height:32px;border-color:transparent;background:transparent;color:var(--muted)}.theme-switch button[aria-pressed=true]{background:var(--surface);color:var(--accent-text);border-color:var(--border);box-shadow:var(--shadow)}.tabs{flex-basis:100%;gap:6px;overflow-x:auto;flex-wrap:nowrap;padding:4px 0 0}.tabs a{white-space:nowrap;text-decoration:none;color:var(--muted);font-weight:600;padding:10px 16px;border-radius:8px}.tabs a:hover{background:var(--surface-2);color:var(--text)}.tabs a.active{background:var(--accent-soft);color:var(--accent-text)}.job-tabs{display:flex;flex-direction:column;flex-wrap:nowrap;gap:4px;margin:0;width:230px;min-width:220px;position:sticky;top:96px}.job-tabs button{font-size:13px;padding:8px 12px;min-height:36px;width:100%;text-align:left}.job-tabs button.active{background:var(--accent-soft);color:var(--accent-text);border-color:var(--accent)}
#job-editor.job-shell{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
#job-editor.job-shell .job-shell-main{flex:1 1 100%}
#job-editor.job-shell #job-form{flex:1;min-width:260px}
#catalog-card{margin:0 0 20px}
.card{border:1px solid var(--border);border-radius:14px;padding:24px;margin:20px 0;background:var(--surface);box-shadow:var(--shadow)}.scroll{overflow:auto;border:1px solid var(--border);border-radius:10px}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;border-bottom:1px solid var(--border);padding:16px;vertical-align:top}th{background:var(--surface-2);font-size:12px;letter-spacing:.02em;font-weight:700;color:var(--muted);white-space:nowrap}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:var(--surface-2)}td button{padding:7px 10px;min-height:34px;font-size:12px;margin:3px}#devices td:first-child{min-width:120px;font-weight:650}#devices td:last-child{min-width:340px;width:38%;position:relative;z-index:6}.device-actions{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:7px;position:relative;z-index:6}.device-actions-secondary{border-top:1px solid var(--border);padding-top:7px}.device-access{margin:8px 3px}.device-access summary{font-size:12px;color:var(--muted)}.device-confirm{margin-top:10px;padding:12px;border:1px solid var(--red);background:var(--red-bg);border-radius:10px;display:grid;gap:8px;max-width:380px;position:relative;z-index:7}.device-confirm p{margin:0;color:var(--text)}.device-confirm small{color:var(--muted)}.device-confirm label{display:grid;gap:6px}
.status-badge{display:inline-flex;align-items:center;margin-top:6px;padding:5px 9px;border-radius:6px;border:1px solid transparent;white-space:nowrap;font-size:12px;font-weight:650}.status-online{color:var(--green);background:var(--green-bg)}.status-offline{color:var(--red);background:var(--red-bg)}.status-waiting{color:var(--amber);background:var(--amber-bg)}.status-stopped,.status-unknown{color:var(--muted);background:var(--surface-2);border-color:var(--border)}.status-detail{display:block;margin-top:8px;color:var(--muted);max-width:290px;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
form{display:flex;gap:16px;align-items:end;flex-wrap:wrap}label{display:grid;gap:8px;font-size:14px;font-weight:600}.filters label{min-width:160px;flex:1}.filters{padding:16px;background:var(--surface-2);border:1px solid var(--border);border-radius:10px;margin-bottom:20px}.filters input,.filters select{background:var(--surface)}.metrics{display:flex;flex-wrap:wrap;gap:14px}.metric{padding:18px;border-radius:10px;background:var(--surface-2);border:1px solid var(--border);min-width:145px;flex:1;font-size:13px;color:var(--muted)}.metric b{display:block;font-size:29px;letter-spacing:-.03em;color:var(--text);margin-top:8px;font-variant-numeric:tabular-nums}.pager{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:16px;margin-top:20px;color:var(--muted);font-size:13px}
#job-form{display:block}#job-fields{display:block}.settings-group{border:1px solid var(--border);border-radius:10px;padding:20px;margin:0 0 24px;width:100%;background:var(--surface)}.settings-group legend{font-weight:700;padding:0 8px}.settings-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:22px}#job-form>label{margin:22px 0}#job-lists textarea{margin:12px 0}#job-save{margin-top:16px}#job-state,#catalog-status{color:var(--accent-text)}details{margin:10px 0}summary{cursor:pointer;font-weight:600;padding:5px 0}details>p{font-size:13px}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;background:var(--surface-2);padding:12px;border-radius:8px}code{overflow-wrap:anywhere;user-select:all;font-size:18px}#analytics-events a{word-break:break-word}#message:empty{display:none}#message:not(:empty){padding:14px 18px;border:1px solid var(--border);background:var(--amber-bg);color:var(--amber);border-radius:10px}
.settings-fields{align-items:start}.settings-fields label{align-content:start}.settings-fields input:not([type=checkbox]),.settings-fields select{width:100%;height:44px}section,h2{scroll-margin-top:16px}
.login{max-width:460px;margin:8vh auto;padding:32px;background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow)}.login form,.login label{display:grid;width:100%}.login form{gap:20px}.login>h1{margin-top:20px}.login .theme-switch{display:flex;width:max-content;margin-left:auto}.login form button{background:var(--accent);color:white;border-color:var(--accent)}
@media(max-width:900px){header,main{padding-left:16px;padding-right:16px}header{gap:12px}.card{padding:18px}th,td{padding:12px}.filters label{min-width:200px}#job-editor.job-shell{flex-direction:column}.job-tabs{flex-direction:row;flex-wrap:wrap;width:auto;position:static}}
@media(max-width:600px){header,main{padding-left:12px;padding-right:12px}header{position:static}h1{font-size:22px}header>nav:not(.tabs){width:100%}.tabs a{padding:9px 12px}.card{padding:16px;margin:14px 0}.settings-fields{grid-template-columns:1fr}.filters{display:block}.filters label{margin-bottom:12px}.login{margin:24px 12px;padding:24px}.metric{min-width:130px}#devices td:last-child{min-width:300px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
#job-editor.app-shell{display:flex;align-items:stretch;max-width:none;min-height:calc(100vh - 200px);margin:12px 0 0;padding:0;overflow:hidden;background:var(--surface);border:1px solid var(--surface-2);border-radius:12px;color:var(--text);box-shadow:none}
#job-editor.app-shell .app-sidebar{width:240px;min-width:240px;display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--surface-2)}
#job-editor.app-shell .app-brand{display:flex;gap:10px;align-items:center;padding:16px;border-bottom:1px solid var(--surface-2)}
#job-editor.app-shell .app-logo{flex:0 0 40px;width:40px;height:40px;border-radius:8px;background:#fff url(/static/logo.png) center/contain no-repeat}
#job-editor.app-shell .app-brand strong{display:block;font-size:13px;color:var(--text)}
#job-editor.app-shell .app-brand span{display:block;font-size:12px;color:var(--muted)}
#job-editor.app-shell .app-nav{flex:1;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:2px}
#job-editor.app-shell .app-nav button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;background:transparent;color:var(--muted);font-weight:500;padding:10px 12px;min-height:40px;border-radius:8px}
#job-editor.app-shell .app-nav button:hover{background:var(--surface-2);color:var(--text);border-color:transparent}
#job-editor.app-shell .app-nav button.active{background:var(--surface-2);color:var(--text)}
#job-editor.app-shell .app-dot{width:8px;height:8px;border-radius:99px;flex:0 0 auto}
#job-editor.app-shell .app-ico{width:18px;height:18px;flex:0 0 auto;display:inline-flex}
#job-editor.app-shell .app-ico svg{width:18px;height:18px;display:block}
#job-editor.app-shell .app-ico.cyan{color:#22d3ee}
#job-editor.app-shell .app-ico.purple{color:#c084fc}
#job-editor.app-shell .app-ico.blue{color:#60a5fa}
#job-editor.app-shell .app-ico.amber{color:#fbbf24}
#job-editor.app-shell .app-ico.pink{color:#f472b6}
#job-editor.app-shell .app-ico.emerald{color:#34d399}
#job-editor.app-shell .app-ico.gray{color:var(--muted)}
#job-editor.app-shell .app-modal-card{width:min(720px,94vw)}
#job-editor.app-shell #job-fields{display:none!important}
#job-editor.app-shell .app-dot.cyan{background:#22d3ee}#job-editor.app-shell .app-dot.purple{background:#c084fc}#job-editor.app-shell .app-dot.blue{background:#60a5fa}#job-editor.app-shell .app-dot.amber{background:#fbbf24}#job-editor.app-shell .app-dot.pink{background:#f472b6}#job-editor.app-shell .app-dot.emerald{background:#34d399}#job-editor.app-shell .app-dot.gray{background:var(--muted)}
#job-editor.app-shell .app-side-foot{padding:12px;border-top:1px solid var(--surface-2)}
#job-editor.app-shell .app-run{display:flex;align-items:center;gap:8px;padding:10px;border-radius:8px;background:var(--surface-2);border:1px solid var(--border);color:var(--muted);font-size:12px}
#job-editor.app-shell .app-run i{width:8px;height:8px;border-radius:99px;background:var(--muted)}
#job-editor.app-shell .app-run.running{background:var(--green-bg);border-color:#065f46;color:#34d399}
#job-editor.app-shell .app-run.running i{background:#34d399}
#job-editor.app-shell .app-main{flex:1;min-width:0;overflow:auto;padding:24px 28px 40px;background:var(--surface)}
#job-editor.app-shell .app-main-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap;margin-bottom:20px}
#job-editor.app-shell .app-main-head h2{margin:0;color:var(--text);font-size:24px}
#job-editor.app-shell .app-main-head p{margin:6px 0 0;color:var(--muted)}
#job-editor.app-shell .app-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#job-editor.app-shell #job-state{color:var(--accent-text);font-size:13px;margin:0 8px 0 0}
#job-editor.app-shell .app-btn,#job-editor.app-shell button.primary,#job-editor.app-shell #job-add,#job-editor.app-shell #job-save{background:var(--surface-2);color:var(--text);border:1px solid var(--border)}
#job-editor.app-shell .app-btn:hover,#job-editor.app-shell button.primary:hover{background:var(--border);border-color:var(--muted)}
#job-editor.app-shell #job-start{background:#0891b2;border-color:#0891b2}
#job-editor.app-shell #job-stop.danger{background:#7f1d1d;border-color:#991b1b;color:#fecaca}
#job-editor.app-shell #job-form{display:block}
#job-editor.app-shell .settings-group{background:var(--surface-2);border-color:var(--border);color:var(--text)}
#job-editor.app-shell .settings-group legend{color:var(--text)}
#job-editor.app-shell input,#job-editor.app-shell select,#job-editor.app-shell textarea{background:var(--surface);border-color:var(--border);color:var(--text)}
#job-editor.app-shell .app-dash{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin-bottom:20px}
#job-editor.app-shell .app-card{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:16px}
#job-editor.app-shell .app-card b{display:block;font-size:28px;color:var(--text);margin-top:6px}
#job-editor.app-shell .app-card span{color:var(--muted);font-size:13px}
#job-editor.app-shell #job-log-list{margin:0;padding-left:20px;color:var(--text)}
#job-editor.app-shell #job-log-list li{margin:8px 0}
#job-editor.app-shell #catalog-card{background:var(--surface-2);border-color:var(--border)}
#job-editor.app-shell #job-lists-wrap h3{color:var(--text);margin-top:0}
@media(max-width:900px){#job-editor.app-shell{flex-direction:column}#job-editor.app-shell .app-sidebar{width:auto;min-width:0}#job-editor.app-shell .app-nav{flex-direction:row;flex-wrap:wrap}}
#job-editor.app-shell .app-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}
#job-editor.app-shell .app-btn.amber{background:#d97706;border-color:#d97706}
#job-editor.app-shell .app-btn.purple{background:#7c3aed;border-color:#7c3aed}
#job-editor.app-shell .app-empty{text-align:center;padding:48px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);color:var(--muted)}
#job-editor.app-shell .app-empty b{display:block;color:var(--text);margin-bottom:6px}
#job-editor.app-shell .app-card-row{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:16px;margin:0 0 12px}
#job-editor.app-shell .app-card-row.off{opacity:1}
#job-editor.app-shell .app-card-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
#job-editor.app-shell .app-card-top strong{color:var(--text)}
#job-editor.app-shell .app-chip{display:inline-block;font-size:12px;padding:2px 8px;border-radius:999px;background:var(--border);color:var(--text);margin:0 6px 0 0}
#job-editor.app-shell .app-chip.yandex{background:var(--red-bg);color:var(--red)}
#job-editor.app-shell .app-chip.google{background:var(--accent-soft);color:var(--accent-text)}
#job-editor.app-shell .app-chip.both{background:var(--amber-bg);color:var(--amber)}
#job-editor.app-shell .app-phrases{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
#job-editor.app-shell .app-phrases span{background:var(--border);color:var(--text);border-radius:6px;padding:2px 8px;font-size:12px}
#job-editor.app-shell .app-modal{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;background:#0008}
#job-editor.app-shell .app-modal[hidden]{display:none!important}
#job-editor.app-shell .app-modal-card{width:min(560px,92vw);max-height:86vh;overflow:auto;background:var(--surface-2);border:1px solid var(--border);border-radius:14px;padding:18px}
#job-editor.app-shell .app-modal-head,#job-editor.app-shell .app-modal-foot{display:flex;justify-content:space-between;align-items:center;gap:10px}
#job-editor.app-shell .app-modal-head h3{margin:0;color:var(--text)}
#job-editor.app-shell .app-modal-foot{margin-top:16px}
#job-editor.app-shell .app-modal-body label{margin:10px 0;color:var(--text)}
#job-editor.app-shell .app-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
#job-editor.app-shell .app-btn.pink{background:#db2777;border-color:#db2777}
#job-editor.app-shell .app-btn.blue{background:#2563eb;border-color:#2563eb}
#job-editor.app-shell .app-inline{display:flex;flex-wrap:wrap;min-width:0;align-items:center;gap:8px;color:var(--text)}
#job-editor.app-shell .app-inline input[type=number]{width:80px}
#job-editor.app-shell .app-inline select{min-width:0;width:auto;flex:1 1 180px}
#job-editor.app-shell #job-dash{display:block}
#job-editor.app-shell .app-alert{display:flex;flex-direction:column;gap:4px;margin:0 0 12px;padding:14px 16px;border-radius:12px;border:1px solid var(--amber);background:var(--amber-bg);color:var(--amber)}
#job-editor.app-shell .app-alert b{color:var(--amber)}
#job-editor.app-shell .app-alert span{color:var(--amber);font-size:12px}
#job-editor.app-shell .app-card.blue{background:var(--surface-2)}
#job-editor.app-shell .app-card.purple{background:var(--surface-2)}
#job-editor.app-shell .app-card.amber{background:var(--surface-2)}
#job-editor.app-shell .app-card.emerald{background:linear-gradient(180deg,var(--green-bg),var(--surface))}
#job-editor.app-shell .app-card small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
#job-editor.app-shell .app-days{display:flex;gap:6px;flex-wrap:wrap}
#job-editor.app-shell .app-days button{width:40px;height:40px;padding:0;min-height:40px;border-radius:8px;background:var(--border);color:var(--muted);border:1px solid var(--muted)}
#job-editor.app-shell .app-days button.on{background:var(--accent-soft);border-color:#22d3ee;color:var(--accent-text)}
#job-editor.app-shell .app-panel{border:1px solid var(--border);border-radius:12px;padding:14px;background:var(--surface-2);margin:0 0 14px}
#job-editor.app-shell .app-panel>h4{margin:0 0 12px;color:var(--text);font-size:15px}
#job-editor.app-shell .app-toggles{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
#job-editor.app-shell .app-toggles .app-toggle{flex:0 1 300px;width:300px;max-width:100%;margin:0}
#job-editor.app-shell .app-panel .app-grid label,#job-editor.app-shell .app-toggle .app-grid label,#job-editor.app-shell .app-toggle.on .app-grid label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:13px}
#job-editor.app-shell .app-panel input[type=number],#job-editor.app-shell .app-panel input[type=text],#job-editor.app-shell .app-toggle input[type=number],#job-editor.app-shell .app-toggle input[type=text]{background:var(--surface);border:1px solid var(--border);color:var(--text);border-radius:8px;padding:8px}
#job-editor.app-shell .app-toggle{display:block;width:auto;min-width:0;text-align:left;white-space:normal;font-weight:500;color:var(--text);border:1px solid var(--muted);border-radius:12px;padding:14px;background:var(--surface);opacity:1;cursor:pointer}
#job-editor.app-shell button.app-toggle:hover{background:var(--surface-2);border-color:var(--muted)}
#job-editor.app-shell .app-toggle.on{border-color:#34d399;background:var(--green-bg);opacity:1;box-shadow:inset 0 0 0 1px #34d39988}
#job-editor.app-shell .app-toggle h4{margin:0;color:var(--text);font-size:14px}
#job-editor.app-shell .app-toggle .app-card-top h4{flex:1}
#job-editor.app-shell .app-switch-wrap{display:flex;align-items:center;gap:8px;flex:0 0 auto}
#job-editor.app-shell .app-state{font-size:12px;font-weight:700;color:var(--muted);min-width:2.6em;text-align:right}
#job-editor.app-shell .app-toggle.on .app-state,#job-editor.app-shell .app-choice.on .app-state{color:var(--green)}
#job-editor.app-shell .app-state:empty{display:none}
#job-editor.app-shell .app-switch{width:36px;height:20px;border-radius:999px;background:var(--muted);position:relative;display:inline-block;flex:0 0 auto}
#job-editor.app-shell .app-switch-dot{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:999px;background:#fff;display:block;transition:left .15s}
#job-editor.app-shell .app-toggle.on .app-switch{background:#10b981}
#job-editor.app-shell .app-toggle.on .app-switch-dot{left:18px}
#job-editor.app-shell .app-chip.app-status-on{background:#065f46;color:var(--green)}
#job-editor.app-shell .app-chip.app-status-off{background:var(--border);color:var(--muted)}
#job-editor.app-shell .app-table{width:100%;border-collapse:collapse;font-size:13px}
#job-editor.app-shell .app-table th{color:var(--muted);text-align:left;padding:8px;border-bottom:1px solid var(--border)}
#job-editor.app-shell .app-table td{padding:8px;border-bottom:1px solid var(--surface-2);color:var(--text);word-break:break-all}
#job-editor.app-shell .app-choice{flex:1;border:1px solid var(--muted);border-radius:12px;padding:14px;cursor:pointer;background:var(--surface);color:var(--text);text-align:left;white-space:normal;font-weight:500;opacity:1}
#job-editor.app-shell .app-choice.on{opacity:1;border-color:#a78bfa;background:var(--accent-soft);box-shadow:inset 0 0 0 1px #a78bfa88}
#job-editor.app-shell .app-choice h4{margin:0}
#job-editor.app-shell .app-toggle .muted,#job-editor.app-shell .app-choice .muted,#job-editor.app-shell .app-panel .muted{color:var(--muted);font-size:12px;margin:8px 0 0}
#job-editor.app-shell .app-progress{height:6px;background:var(--surface-2);border-radius:999px;overflow:hidden;margin-top:10px}
#job-editor.app-shell .app-progress i{display:block;height:100%;background:#22d3ee}
#job-editor.app-shell .app-svc-top{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
#job-editor.app-shell .app-svc-top h4{margin:0 0 6px;color:var(--text);font-size:16px}
#job-editor.app-shell .app-pills{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;max-width:48%}
#job-editor.app-shell .app-pill{font-size:11px;font-weight:700;border-radius:999px;padding:3px 8px;white-space:nowrap}
#job-editor.app-shell .app-pill.on{background:#064e3b;color:var(--green)}
#job-editor.app-shell .app-pill.off{background:var(--border);color:var(--muted)}
#job-editor.app-shell .app-pill.ready{background:#164e63;color:var(--accent-text)}
#job-editor.app-shell .app-pill.empty{background:var(--surface-2);color:var(--muted)}
#job-editor.app-shell .app-pill.ok{background:#14532d;color:#86efac}
#job-editor.app-shell .app-pill.bad{background:#7f1d1d;color:#fecaca}
#job-editor.app-shell .app-svc-status{margin:10px 0 12px;color:var(--text);font-size:13px}
#job-editor.app-shell .app-svc-toggle{display:flex;align-items:center;gap:8px;color:var(--text);font-size:13px;margin:8px 0 4px;cursor:pointer}
#job-editor.app-shell .app-svc input[type=password]{width:100%;background:var(--surface);border:1px solid var(--border);color:var(--text);border-radius:8px;padding:10px 12px}
.enroll-role{flex:1 1 100%;border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin:0;background:var(--surface-2)}
.enroll-role legend{font-weight:700;padding:0 6px}
.enroll-role-opt{display:flex;align-items:center;gap:8px;font-weight:600}
.enroll-role .muted{margin:8px 0 0}
.device-ui-tabs{margin-top:10px;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);max-width:440px}
.device-ui-tabs h3{margin:0 0 6px;font-size:13px}
.device-ui-tabs .muted{margin:0 0 10px;font-size:12px}
.device-ui-tabs-presets{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.device-ui-tabs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:6px 10px;margin:0 0 10px}
.device-ui-tabs-grid label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600}
#devices td:last-child{min-width:220px;width:auto;max-width:460px}
#devices .device-actions{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 4px;align-items:center}
#devices .device-actions button,#devices .device-extra>button,#devices .device-more{margin:0;padding:5px 8px;min-height:30px;font-size:12px}
#devices .device-more{font-weight:700}
#devices .device-extra{margin-top:8px;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);display:flex;flex-wrap:wrap;gap:4px;align-items:flex-start}
#devices .device-extra[hidden]{display:none!important}
#devices .device-extra-tabs,#devices .device-extra .device-ui-tabs{flex:1 1 100%;margin-top:6px;max-width:100%}
#devices .device-extra .status-detail{flex:1 1 100%;margin-top:4px;max-width:none}

/* Shared shell and editor geometry. Narrow forms are constrained inside the same shell. */
header>*{min-width:0}.tabs{max-width:100%}main{min-width:0}
[data-view=access].card,[data-view=account].card{max-width:720px}
#job-selector{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;padding:16px 20px;margin:12px 0}
#job-selector h2{font-size:18px;margin:0;flex:1 1 260px}
#job-selector label{flex:1 1 280px;min-width:0}
#job-selector p{flex:1 1 100%;margin:0;font-size:13px}
#job-editor.app-shell .app-main-head>div{min-width:0}
#job-editor.app-shell .app-main-head p,#job-editor.app-shell .app-brand span{overflow-wrap:anywhere}
#job-editor.app-shell .app-panel,#job-editor.app-shell .app-card-row{min-width:0;overflow-wrap:anywhere}
#job-editor.app-shell .app-choice.on{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
#job-editor.app-shell .app-toggle.on{border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
#job-editor.app-shell .app-btn.amber{background:#985006;border-color:#985006;color:white}
#job-editor.app-shell .app-btn.purple,#job-editor.app-shell .app-btn.pink,#job-editor.app-shell .app-btn.blue{color:white}
#job-editor.app-shell #job-start{background:#06738d;border-color:#06738d;color:white}
#job-editor.app-shell .app-pill.on,#job-editor.app-shell .app-pill.ok,#job-editor.app-shell .app-chip.app-status-on{background:var(--green-bg);color:var(--green)}
#job-editor.app-shell .app-pill.ready{background:var(--accent-soft);color:var(--accent-text)}
#job-editor.app-shell .app-pill.bad{background:var(--red-bg);color:var(--red)}
#job-editor.app-shell .app-svc-top{flex-wrap:wrap}
#job-editor.app-shell .app-pills{max-width:100%;justify-content:flex-start}
#job-editor.app-shell .app-table th{background:var(--surface-2)}
.job-panel-picker{display:none}
@media(max-width:900px){
 #job-editor.app-shell .app-sidebar{border-right:0;border-bottom:1px solid var(--border);display:grid;grid-template-columns:1fr auto;align-items:center}
 #job-editor.app-shell .app-brand{padding:12px;border:0;min-width:0}
 #job-editor.app-shell .app-nav{display:none}
 #job-editor.app-shell .app-side-foot{padding:8px 12px;border:0}
 #job-editor.app-shell .job-panel-picker{display:grid;grid-column:1/-1;padding:0 12px 12px;gap:4px}
 #job-editor.app-shell .app-main{padding:18px 16px 24px;overflow:visible}
 #job-editor.app-shell .app-main-head h2{font-size:21px}
}
@media(max-width:600px){
 header{padding-top:14px;padding-bottom:10px;gap:10px}
 header h1{font-size:20px}header>nav:not(.tabs){gap:6px}
 header>nav:not(.tabs)>button{font-size:13px;padding:8px}
 .tabs a{padding:8px 10px;min-height:40px}
 #job-selector{padding:12px;gap:8px;margin:8px 0}
 #job-selector h2{font-size:17px}#job-selector p{font-size:12px}
 #job-editor.app-shell .app-main{padding:14px 12px 24px}
 #job-editor.app-shell .app-main-head{gap:8px;margin-bottom:16px}
 #job-editor.app-shell .app-head-actions{gap:6px}
 #job-editor.app-shell .app-main-head p{font-size:12px}
 #job-editor.app-shell .app-brand strong{font-size:12px}
 #job-editor.app-shell .app-side-foot{padding:6px}
 #job-editor.app-shell .app-run{padding:6px}
 #job-editor.app-shell .app-toggles .app-toggle{flex:1 1 100%;width:auto}
 #job-editor.app-shell .app-card-top{flex-wrap:wrap}
 #job-editor.app-shell .app-inline{width:100%}
 #job-editor.app-shell .app-inline select{width:100%}
}
@media(pointer:coarse){button,select,input:not([type=checkbox]):not([type=radio]),.tabs a{min-height:44px}}

/* Keep long filter option labels inside their flex item. */
#analytics-filter label{flex:1 1 160px;min-width:160px}
#analytics-filter input,#analytics-filter select{width:100%;min-width:0;box-sizing:border-box}
#analytics-filter button{flex:0 0 auto}


/* Bounded diagnostic chart: width follows the admin content column. */
.diagnostic-chart{margin:16px 0;padding:16px;border:1px solid var(--border,#dbe3ef);border-radius:12px;min-width:0;overflow:hidden}.diagnostic-chart svg{display:block;width:100%;max-height:250px;min-height:140px}.diagnostic-chart select{max-width:100%}
