:root{color-scheme:dark;--bg:#080e1b;--panel:#101b2c;--border:#263750;--muted:#8b9bb2;--text:#eaf0fa;--accent:#32ccbd;--shadow:0 14px 48px rgba(0,0,0,.19);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 15% 0%,#192c44 0,transparent 32%),var(--bg);color:var(--text);min-height:100vh}button,input,a{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}a{color:inherit}input{color:var(--text)}.app-shell{max-width:1510px;margin:auto;padding:0 28px}.topbar{display:flex;align-items:center;gap:16px;padding:27px 0 30px;border-bottom:1px solid var(--border)}.brandmark{display:grid;place-items:center;width:50px;height:50px;background:#153a3e;border:1px solid #2d686e;color:#d5fffb;font-weight:850;font-size:22px;letter-spacing:-3px;border-radius:14px}.brandmark span{color:var(--accent)}.brandcopy h1{font-size:22px;line-height:1.2;font-weight:720;letter-spacing:-.6px;margin:5px 0 0}.eyebrow{color:#56ccbf;text-transform:uppercase;letter-spacing:1.4px;font-weight:800;font-size:10px}.topbadge{margin-left:auto;border:1px solid #2e5a59;border-radius:28px;padding:8px 14px;color:#b6e8e1;font-size:12px;white-space:nowrap}.status-dot{display:inline-block;background:#2cd5ad;border-radius:50%;width:7px;height:7px;box-shadow:0 0 10px #2cd5ad;margin-right:6px}.workspace{display:grid;grid-template-columns:minmax(340px,.85fr) minmax(480px,1.65fr);align-items:start;gap:22px;margin-top:28px}.panel{background:rgba(15,27,45,.96);border:1px solid var(--border);border-radius:17px;box-shadow:var(--shadow);min-width:0}.devices-panel{padding:23px;position:sticky;top:18px}.section-top{display:flex;gap:14px;align-items:flex-start;margin-bottom:26px}.section-top.compact{margin-bottom:0}.step{flex:0 0 35px;height:35px;border:1px solid #326b68;border-radius:11px;display:flex;align-items:center;justify-content:center;color:var(--accent);background:#143336;font-weight:750;font-size:13px}.section-top h2{font-size:17px;margin:0 0 6px;font-weight:720}.section-top p,.dialog-heading p{color:var(--muted);font-size:12px;margin:0;line-height:1.55}.section-top code,.footer code{color:#a4ebdc}.label-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;gap:8px}label{font-size:12px;font-weight:700;color:#ccd8e9}.text-action{border:0;background:transparent;color:#6fe0d0;font-size:12px;font-weight:700;padding:5px 0}.text-action:hover{text-decoration:underline}.search-wrap,.viewer-search{position:relative}.search-wrap svg,.viewer-search svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:16px;height:16px;fill:none;stroke:#7891ab;stroke-width:2;stroke-linecap:round}.search-wrap input,.query-controls input,.viewer-search input{height:44px;background:#0b1627;border:1px solid #31455c;border-radius:9px;padding:0 14px;outline:none;width:100%}.search-wrap input,.viewer-search input{padding-left:41px}.search-wrap input:focus,.query-controls input:focus,.viewer-search input:focus{border-color:#2bd1bb;box-shadow:0 0 0 2px rgba(43,209,187,.11)}input::placeholder{color:#73849c}.selection-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:15px 0 20px}.outline-btn{border:1px solid #335269;background:#142538;border-radius:8px;color:#b5eae2;padding:9px 12px;font-size:11px;font-weight:750;text-decoration:none;white-space:nowrap}.outline-btn:hover{border-color:#45ae9e;background:#1a3647}.outline-btn.subtle{color:#acbdd0;background:#162337}.selection-toolbar .text-action{margin-left:auto}.device-table-head{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);padding:10px 5px 12px}.select-head{display:flex;align-items:center;gap:12px;font-size:10px;letter-spacing:.9px;color:#8499b0}.select-head input,.device-item input,.case-toggle input{accent-color:var(--accent);width:15px;height:15px;cursor:pointer}.tiny-pill{font-size:10px;color:#90abc4;border:1px solid #34475e;padding:5px 7px;border-radius:20px}.device-list{height:430px;max-height:52vh;overflow:auto;scrollbar-color:#2b425d transparent}.device-item{padding:12px 8px 12px 5px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #213149;cursor:pointer}.device-item:hover{background:#14243b}.device-item.checked{background:#132e37}.device-item input{flex:0 0 auto}.device-text{display:flex;flex-direction:column;min-width:0;gap:4px}.device-name{font-size:12px;color:#e6f0fa;font-weight:730;overflow-wrap:anywhere}.device-ip{color:#8fa7bb;font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}.device-footer{display:flex;justify-content:space-between;margin-top:16px;color:#8ea2b9;font-size:12px}.device-footer #selectionSummary{color:#70ead4;font-weight:730}.empty-state{padding:38px 8px;text-align:center;color:var(--muted);font-size:13px}.operations{display:flex;flex-direction:column;gap:20px}.query-panel{padding:24px}.query-panel form>label{display:block;margin-bottom:10px}.query-controls{display:flex;gap:10px}.query-controls input{min-width:0;flex:1}.primary-btn{display:flex;align-items:center;justify-content:center;gap:26px;white-space:nowrap;padding:0 19px;border:1px solid #53ddc6;border-radius:9px;background:#2bc5b4;color:#062d2e;font-size:12px;font-weight:850;min-height:44px}.primary-btn:hover:not(:disabled){background:#54e3d2}.run-arrow{font-size:19px;font-weight:400}.settings-line{display:flex;flex-wrap:wrap;gap:7px;margin-top:15px}.config-chip{padding:7px 9px;background:#17283c;border:1px solid #2a4056;border-radius:6px;color:#94acc1;font-size:10px;font-weight:660}.alert-box{margin:17px 0 0;border:1px solid #8c4444;background:#3c2226;color:#ffd6d1;border-radius:8px;padding:12px;font-size:12px;white-space:pre-wrap}.results-panel{padding:23px;min-height:450px}.result-header{display:flex;justify-content:space-between;align-items:center;gap:12px}.job-status{border-radius:20px;padding:7px 12px;font-size:11px;font-weight:780;white-space:nowrap}.job-status.neutral{background:#20304a;color:#aab9c9}.job-status.running{background:#143f47;color:#64e1d2}.job-status.done{background:#183d32;color:#81e2a8}.progress-wrap{margin:23px 0 20px}.progress-top{display:flex;justify-content:space-between;color:#b5c8d8;font-size:12px;margin-bottom:10px}.progress-top strong{font-weight:740}.progress-track{height:7px;background:#20334a;overflow:hidden;border-radius:6px}.progress-fill{height:100%;width:0;background:linear-gradient(90deg,#198b87,#47e5be);transition:width .3s}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:22px}.stat{border:1px solid #2b3c52;background:#111e30;border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:5px}.stat strong{font-size:20px}.stat span{font-size:11px;color:#8a9fb6}.results-list{margin-top:18px;display:flex;flex-direction:column;gap:11px}.placeholder-box{border:1px dashed #35475d;border-radius:12px;text-align:center;padding:42px 15px;color:#92a7bc}.placeholder-icon{font-size:40px;font-weight:400;color:#6ec7be}.placeholder-box strong{display:block;font-size:14px;color:#d2dfec;margin:8px 0}.placeholder-box p{font-size:12px;margin:0}.result-card{border:1px solid #2a3c54;border-radius:11px;background:#101e30;padding:14px}.result-card-top{display:flex;justify-content:space-between;gap:12px;align-items:center}.result-name{font-size:13px;font-weight:750;overflow-wrap:anywhere}.result-ip{font-size:11px;color:#879bb2;margin-top:5px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.result-state{font-size:10px;font-weight:790;white-space:nowrap;padding:6px 8px;border-radius:6px;background:#243248;color:#b2c1cf}.result-state.found{background:#1c493d;color:#7cefc4}.result-state.error{background:#52272c;color:#ffb1b1}.result-state.running{background:#23414b;color:#83dbe4}.result-state.no_match,.result-state.no_log{background:#384052;color:#bdc7d2}.result-message{color:#9db0c4;font-size:11px;margin-top:9px;overflow-wrap:anywhere}.file-link-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:13px}.file-link{border:0;background:transparent;color:#73e7d7;text-align:left;text-decoration:underline;text-underline-offset:3px;font-size:12px;font-weight:770;padding:0;overflow-wrap:anywhere}.download-link{color:#95b4c5;font-size:11px}.inline-preview{margin:14px 0 0;padding:13px;background:#091321;border:1px solid #293c53;color:#b2cae3;border-radius:9px;max-height:190px;overflow:auto;white-space:pre-wrap;word-break:break-word;font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}.footer{font-size:11px;color:#788ba0;padding:24px 0 35px;text-align:center}.log-dialog{padding:0;max-width:min(1280px,96vw);width:min(1280px,96vw);height:min(900px,92vh);max-height:92vh;background:#0c1625;color:var(--text);border:1px solid #476079;border-radius:14px;box-shadow:0 20px 90px rgba(0,0,0,.75)}.log-dialog::backdrop{background:rgba(1,6,14,.83);backdrop-filter:blur(4px)}.dialog-shell{height:100%;display:flex;flex-direction:column;min-height:0}.dialog-head{padding:19px 22px;border-bottom:1px solid #283e58;display:flex;justify-content:space-between;gap:15px;align-items:flex-start}.dialog-heading{min-width:0}.dialog-heading h2{font-size:16px;margin:7px 0}.dialog-heading p{overflow-wrap:anywhere}.dialog-head-actions{display:flex;align-items:center;gap:10px}.icon-btn{border:1px solid #334760;border-radius:8px;background:#18283a;color:#b9cee3;height:36px;width:36px;font-size:24px;line-height:0}.viewer-tools{padding:12px 18px;background:#122237;border-bottom:1px solid #2d4058;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.viewer-search{width:320px;max-width:100%}.viewer-search input{height:37px;font-size:12px}.viewer-search svg{width:14px;height:14px}.case-toggle{display:flex;align-items:center;white-space:nowrap;gap:6px;font-size:11px}.match-position{font-size:11px;font-variant-numeric:tabular-nums;color:#93b3c9;padding:5px 7px;white-space:nowrap}.nav-btn{padding:9px 10px}.viewer-container{flex:1;min-height:0;overflow:auto;padding:20px 23px;scrollbar-color:#2b5061 transparent}.viewer-container pre{margin:0;color:#cedded;font:12px/1.78 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;white-space:pre-wrap;overflow-wrap:anywhere;tab-size:4}.viewer-container .match{color:#171c13;background:#edd166;border-radius:2px}.viewer-container .match.active{color:#fff;background:#c54e35;outline:2px solid #fbd6ab;outline-offset:0}.dialog-footer{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;color:#7d96af;border-top:1px solid #263951;padding:9px 19px;font-size:10px}@media(max-width:1020px){.workspace{grid-template-columns:1fr}.devices-panel{position:static}.device-list{height:260px;max-height:none}}@media(max-width:650px){.app-shell{padding:0 12px}.topbar{padding:17px 0;gap:10px}.brandcopy h1{font-size:16px}.topbadge{display:none}.panel,.query-panel,.results-panel,.devices-panel{padding:16px}.workspace{margin-top:15px;gap:14px}.query-controls{flex-direction:column}.query-controls .primary-btn{min-height:44px}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dialog-head{padding:12px}.viewer-tools{gap:6px}.viewer-search{width:100%}.log-dialog{width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0}.viewer-container{padding:13px}.viewer-container pre{font-size:11px}.selection-toolbar .text-action{margin-left:0}}

/* ---- v3 additions: stop button, settings panel, results filter ---- */
:focus-visible{outline:2px solid #54e3d2;outline-offset:2px}
.danger-btn{border:1px solid #b45a52;background:#4a2427;color:#ffd0c9;border-radius:9px;padding:0 18px;min-height:44px;font-size:12px;font-weight:800;white-space:nowrap}
.danger-btn:hover:not(:disabled){background:#5c2b2f}
.primary-btn.small{min-height:38px;gap:8px;padding:0 16px}
.warning-box{margin:12px 0 0;border:1px solid #7d6a2f;background:#33301c;color:#f2e2a8;border-radius:8px;padding:10px 12px;font-size:12px;white-space:pre-wrap}
.settings-panel{margin-top:18px;border:1px solid var(--border);border-radius:12px;background:#0d1828}
.settings-panel>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:13px 15px;font-size:13px;font-weight:720;color:#d8e4f1}
.settings-panel>summary::-webkit-details-marker{display:none}
.settings-panel>summary::before{content:'▸';color:var(--accent);transition:transform .15s}
.settings-panel[open]>summary::before{transform:rotate(90deg)}
.settings-panel[open]>summary{border-bottom:1px solid var(--border)}
.summary-hint{margin-left:auto;color:var(--muted);font-size:11px;font-weight:500;overflow-wrap:anywhere}
.summary-hint code{color:#a4ebdc}
.dirty-pill{font-size:10px;font-weight:780;color:#f2d98a;border:1px solid #7a6a34;background:#2e2a17;border-radius:20px;padding:4px 8px}
.settings-form{padding:15px}
.settings-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.settings-group{margin:0;border:1px solid #243650;border-radius:10px;padding:12px 13px 4px;min-width:0}
.settings-group legend{padding:0 6px;color:#7fe3d5;font-size:11px;font-weight:780}
.field-row{margin-bottom:11px;display:flex;flex-direction:column;gap:5px}
.field-row label{font-size:11px}
.field-row input[type=text],.field-row input[type=number],.field-row input[type=password],.field-row select,.results-toolbar select{height:36px;background:#0b1627;border:1px solid #31455c;border-radius:8px;padding:0 10px;color:var(--text);font-size:12px;width:100%;outline:none}
.field-row input:focus,.field-row select:focus,.results-toolbar select:focus{border-color:#2bd1bb;box-shadow:0 0 0 2px rgba(43,209,187,.11)}
.field-bool label{display:flex;align-items:center;gap:8px;cursor:pointer}
.field-bool input{accent-color:var(--accent);width:15px;height:15px}
.field-help{color:#7f93aa;font-size:10.5px;line-height:1.45}
.field-error{color:#ffaba3;font-size:11px}
.field-error:empty{display:none}
.field-row.invalid input,.field-row.invalid select{border-color:#c4645b}
.settings-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:14px}
.settings-status{color:#8fd8c8;font-size:11px}
.job-status.stopped{background:#3d3220;color:#f0cf8a}
.result-state.cancelled,.result-state.pending{background:#343a46;color:#c9ced6}
.results-toolbar{display:flex;align-items:center;gap:10px;margin-top:18px}
.results-toolbar label{white-space:nowrap}
.results-toolbar select{width:auto;min-width:190px}
.results-toolbar .tiny-pill{margin-left:auto}
@media(max-width:1020px){.settings-groups{grid-template-columns:1fr}}
@media(max-width:650px){.summary-hint{margin-left:0}.results-toolbar{flex-wrap:wrap}.results-toolbar .tiny-pill{margin-left:0}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
.case-option{display:inline-flex;align-items:center;gap:8px;margin-top:11px;font-size:12px;cursor:pointer;color:#ccd8e9}
.case-option input{accent-color:var(--accent);width:15px;height:15px;cursor:pointer}
.case-option span{color:var(--muted);font-weight:500}
.fulllog-panel{border-bottom:1px solid #2d4058;background:#0f1d30;padding:14px 18px;max-height:46%;overflow:auto;flex:0 0 auto}
.fulllog-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.fulllog-head strong{font-size:13px}
.fulllog-head p{margin:4px 0 0;color:var(--muted);font-size:11px}
.fulllog-body{margin-top:10px}
.fulllog-table{width:100%;border-collapse:collapse;font-size:12px}
.fulllog-table th{text-align:left;color:#8499b0;font-weight:700;font-size:10.5px;padding:6px 8px;border-bottom:1px solid var(--border)}
.fulllog-table td{padding:7px 8px;border-bottom:1px solid #1d2d43;color:#d5e1ee}
.fulllog-table td.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.fulllog-table th.num{text-align:right}
.fulllog-table tr.has-hits td:first-child+td{color:#7cefc4;font-weight:700}
.fulllog-table input{accent-color:var(--accent);width:15px;height:15px;cursor:pointer}
.hit-tag{font-size:10px;font-weight:780;color:#7cefc4;background:#1c493d;border-radius:5px;padding:2px 6px;margin-left:6px}
.fulllog-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:12px}
.fulllog-summary{color:#9db0c4;font-size:11px}
.fulllog-summary.over{color:#ffaba3}
.danger-btn.small{min-height:38px}
.fulllog-progress{margin-top:12px}
.fulllog-ready{margin-top:12px;border:1px solid #2d6b58;background:#13342b;color:#c8f5e3;border-radius:9px;padding:10px 12px;font-size:12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.fulllog-ready.error{border-color:#8c4444;background:#3c2226;color:#ffd6d1}
.fulllog-ready a{color:#73e7d7;font-weight:780}
@media(max-width:650px){.fulllog-panel{max-height:60%}.fulllog-table th:nth-child(4),.fulllog-table td:nth-child(4){display:none}}
.query-controls{align-items:flex-start}
.keyword-list{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.keyword-row{display:flex;align-items:center;gap:8px}
.keyword-row input{flex:1;min-width:0;height:44px;background:#0b1627;border:1px solid #31455c;border-radius:9px;padding:0 14px;outline:none;color:var(--text)}
.keyword-row input:focus{border-color:#2bd1bb;box-shadow:0 0 0 2px rgba(43,209,187,.11)}
.kw-step{flex:0 0 26px;height:26px;border-radius:8px;display:grid;place-items:center;background:#143336;border:1px solid #326b68;color:var(--accent);font-size:11px;font-weight:800}
.kw-remove{flex:0 0 34px;height:34px;border:1px solid #334760;border-radius:8px;background:#18283a;color:#b9cee3;font-size:18px;line-height:0}
.kw-remove:hover{border-color:#b45a52;color:#ffd0c9}
.run-buttons{display:flex;gap:10px}
.keyword-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:10px}
.keyword-hint{color:var(--muted);font-size:11px}
.search-options{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.search-options .case-option{margin-top:0}
.option-group{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;font-size:12px}
.option-label{font-size:12px;font-weight:700;color:#ccd8e9}
.seg{display:inline-flex;align-items:center;gap:6px;border:1px solid #2a4056;background:#122236;border-radius:8px;padding:7px 10px;cursor:pointer;font-weight:650}
.seg input{accent-color:var(--accent);margin:0}
.seg small,.option-note{color:var(--muted);font-weight:500;font-size:11px}
.seg:has(input:checked){border-color:#45ae9e;background:#16323a}
.small-input,.small-select{height:34px;background:#0b1627;border:1px solid #31455c;border-radius:8px;padding:0 10px;color:var(--text);font-size:12px;outline:none}
.small-input{width:110px}
.small-input:focus,.small-select:focus{border-color:#2bd1bb}
@media(max-width:650px){.run-buttons{width:100%}.run-buttons .primary-btn{flex:1}.seg{width:100%}}
.kw-legend{display:flex;flex-wrap:wrap;gap:6px;flex-basis:100%}
.kw-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid #335269;background:#142538;border-radius:20px;padding:5px 11px 5px 7px;color:#d5e1ee;font-size:11px;font-weight:700;max-width:100%}
.kw-chip .swatch{width:12px;height:12px;border-radius:4px;flex:0 0 12px}
.kw-chip .kw-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
.kw-chip .kw-count{color:var(--muted);font-weight:600}
.kw-chip[aria-pressed=false]{opacity:.45;text-decoration:line-through}
.kw-chip:hover{border-color:#45ae9e}
.viewer-container .match.kw-1,.kw-chip .swatch.kw-1{background:#5fd6c6}
.viewer-container .match.kw-2,.kw-chip .swatch.kw-2{background:#e7a6ff}
.viewer-container .match.kw-3,.kw-chip .swatch.kw-3{background:#ffb27a}
.viewer-container .match.kw-4,.kw-chip .swatch.kw-4{background:#9fc6ff}
.viewer-container .match.kw-5,.kw-chip .swatch.kw-5{background:#b9ee7c}
.viewer-container .match[class*=kw-]{color:#10161f}
.viewer-container .match.active{color:#fff!important;background:#c54e35!important;outline:2px solid #fbd6ab;outline-offset:0}
.viewer-container pre[contenteditable]{outline:none;caret-color:#54e3d2;cursor:text}
.viewer-container pre[contenteditable]:focus{box-shadow:inset 3px 0 0 #2bd1bb}
.filter-help{margin:7px 2px 0;color:var(--muted);font-size:10.5px;line-height:1.5}
.filter-help code{color:#a4ebdc;background:#132236;border-radius:4px;padding:0 4px}

/* ---- v4: login, user menu, history, small dialogs ---- */
.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh}
.login-shell{width:min(420px,92vw);padding:24px 0}
.login-brand{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.login-panel{padding:24px;display:flex;flex-direction:column;gap:8px}
.login-panel h2{margin:0 0 6px;font-size:18px}
.login-panel input{height:44px;background:#0b1627;border:1px solid #31455c;border-radius:9px;padding:0 14px;outline:none;color:var(--text);margin-bottom:6px}
.login-panel input:focus{border-color:#2bd1bb;box-shadow:0 0 0 2px rgba(43,209,187,.11)}
.login-panel .primary-btn{margin-top:8px}
.login-panel code{color:#ffe1dc}
.login-foot{color:var(--muted);font-size:11px;text-align:center;margin-top:14px}
.user-menu{margin-left:auto;display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.user-badge{border:1px solid #2e5a59;border-radius:28px;padding:8px 14px;color:#b6e8e1;font-size:12px;white-space:nowrap}
.history-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px}
.history-bar select{height:36px;background:#0b1627;border:1px solid #31455c;border-radius:8px;padding:0 10px;color:var(--text);font-size:12px;min-width:min(420px,100%);max-width:100%}
.history-note{color:var(--muted);font-size:11px}
.small-dialog{padding:0;border:1px solid #476079;border-radius:14px;background:#0c1625;color:var(--text);width:min(440px,94vw);box-shadow:0 20px 90px rgba(0,0,0,.75)}
.small-dialog.wide{width:min(820px,96vw)}
.small-dialog::backdrop{background:rgba(1,6,14,.83);backdrop-filter:blur(4px)}
.small-dialog-body{padding:20px 22px;display:flex;flex-direction:column;gap:8px}
.small-dialog-body h2{margin:0 0 6px;font-size:16px}
.small-dialog-body input,.small-dialog-body select{height:38px;background:#0b1627;border:1px solid #31455c;border-radius:8px;padding:0 10px;color:var(--text);font-size:12px;outline:none}
.small-dialog-body input:focus,.small-dialog-body select:focus{border-color:#2bd1bb}
.small-dialog-actions{display:flex;gap:10px;margin-top:6px}
.dialog-status{min-height:16px;margin:4px 0 0;font-size:12px;color:#8fd8c8}
.dialog-status.error{color:#ffaba3}
.dialog-title-row{display:flex;justify-content:space-between;align-items:center}
.users-table-wrap{overflow-x:auto}
.users-table{width:100%;border-collapse:collapse;font-size:12px}
.users-table th{text-align:left;color:#8499b0;font-size:10.5px;padding:6px 8px;border-bottom:1px solid var(--border)}
.users-table td{padding:7px 8px;border-bottom:1px solid #1d2d43;white-space:nowrap}
.users-table td.actions{display:flex;gap:6px;justify-content:flex-end}
.users-table .you{color:var(--muted);font-size:10.5px;margin-left:6px}
.add-user-form{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
.add-user-form strong{font-size:12px;margin-right:4px}
.add-user-form input{flex:1;min-width:140px}
@media(max-width:650px){.user-menu{width:100%;justify-content:flex-start}.topbar{flex-wrap:wrap}}

/* ---- v4.1: left menu + L3 monitoring ---- */
.app-frame{display:flex;min-height:100vh}
.side-nav{position:sticky;top:0;align-self:flex-start;height:100vh;width:92px;flex:0 0 92px;background:#07101f;border-right:1px solid var(--border);display:flex;flex-direction:column;gap:6px;padding:96px 8px 16px}
.nav-item{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 4px;border-radius:12px;color:#8ea4bd;text-decoration:none;font-size:10.5px;font-weight:750;text-align:center;line-height:1.25}
.nav-item svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nav-item:hover{background:#12223a;color:#d5e5f5}
.nav-item[aria-current=page]{background:#143336;color:#7cefdc;box-shadow:inset 3px 0 0 var(--accent)}
.app-frame .app-shell{flex:1;min-width:0}
.view[hidden]{display:none!important}
.l3-view{display:grid;grid-template-columns:minmax(320px,.75fr) minmax(480px,1.9fr);gap:22px;margin-top:28px;align-items:start}
.l3-controls{padding:23px;position:sticky;top:18px}
.l3-result{padding:23px;min-height:420px}
.l3-asof{border:0;padding:0;margin:0 0 6px;display:flex;flex-wrap:wrap;gap:8px}
.l3-asof legend{font-size:12px;font-weight:700;color:#ccd8e9;margin-bottom:8px;padding:0}
.l3-custom{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%;margin-top:4px}
.l3-custom input{height:38px;background:#0b1627;border:1px solid #31455c;border-radius:8px;padding:0 10px;color:var(--text);font-size:13px;color-scheme:dark}
.l3-preview{color:#9db0c4;font-size:12px;line-height:1.55;margin:12px 0 14px;background:#0d1828;border:1px solid var(--border);border-radius:9px;padding:10px 12px}
.l3-preview strong{color:#dce8f5}
.l3-controls .primary-btn{width:100%}
.l3-history{margin-top:22px}
.l3-history h3{font-size:13px;margin:0 0 8px}
.l3-history-list{display:flex;flex-direction:column;gap:6px}
.l3-history-item{display:flex;justify-content:space-between;align-items:center;gap:8px;text-align:left;border:1px solid #2a3c54;background:#101e30;color:var(--text);border-radius:9px;padding:9px 11px;font-size:12px}
.l3-history-item:hover{border-color:#45ae9e}
.l3-history-item[aria-current=true]{border-color:var(--accent);background:#132e37}
.l3-history-item small{color:var(--muted)}
.dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px}
.dot.healthy{background:#3ddc84}.dot.warning{background:#f5b84b}.dot.critical{background:#ff6b5e}.dot.unknown{background:#8a9bb0}
.job-status.healthy{background:#183d32;color:#81e2a8}.job-status.warning{background:#3d3220;color:#f0cf8a}
.job-status.critical{background:#4a2427;color:#ffb1aa}.job-status.unknown{background:#20304a;color:#aab9c9}
.l3-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:16px 0}
.l3-image-wrap{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#041434}
.l3-image-wrap img{display:block;width:100%;height:auto}
.l3-numbers{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:9px;margin-top:16px}
.l3-num{border:1px solid #2b3c52;background:#111e30;border-radius:10px;padding:11px 12px}
.l3-num span{display:block;font-size:11px;color:#8a9fb6}
.l3-num strong{font-size:19px;font-variant-numeric:tabular-nums}
.l3-num .up{color:#81e2a8}.l3-num .down{color:#ffb1aa}
.l3-text{margin-top:14px;border:1px solid var(--border);border-radius:10px;background:#0d1828}
.l3-text summary{cursor:pointer;padding:10px 12px;font-size:12px;font-weight:700}
.l3-text pre{margin:0;padding:0 12px 12px;white-space:pre-wrap;font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;color:#cfe0f0}
.l3-integration{margin-top:20px}
.l3-integration-body{padding:14px 15px;font-size:12px;color:#b9c9da;line-height:1.55}
.l3-integration-body p{margin:0 0 10px}
.l3-urls{display:flex;flex-direction:column;gap:6px;margin-bottom:6px}
.l3-url{display:flex;gap:6px;align-items:center}
.l3-url code{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#0b1627;border:1px solid #31455c;border-radius:7px;padding:7px 9px;color:#a4ebdc;font-size:11px}
@media(max-width:1020px){.l3-view{grid-template-columns:1fr}.l3-controls{position:static}}
@media(max-width:760px){.app-frame{flex-direction:column}.side-nav{position:sticky;top:0;z-index:5;height:auto;width:auto;flex:none;flex-direction:row;padding:6px 10px;border-right:0;border-bottom:1px solid var(--border)}
.nav-item{flex-direction:row;font-size:12px;padding:9px 12px}.nav-item[aria-current=page]{box-shadow:inset 0 -3px 0 var(--accent)}}
[hidden]{display:none!important}
.l3-url{flex-wrap:wrap}
.l3-url .history-note{flex-basis:100%}
.l3-custom select{height:38px;background:#0b1627;border:1px solid #31455c;border-radius:8px;padding:0 10px;color:var(--text);font-size:13px}
.l3-custom small{flex-basis:100%}
