/* Samostatné tmavé diagnostické rozhraní, bez externích fontů. */
body{--debug-width:clamp(340px,32vw,520px);--app-height:100dvh}
.app-shell{width:100%;min-width:0;container:debug-host / inline-size}
body.debug-docked{display:grid;grid-template-columns:var(--debug-width) minmax(0,1fr);grid-template-rows:100dvh;height:100dvh;overflow:hidden}
.debug-docked .app-shell{grid-column:2;grid-row:1;overflow:auto;height:100%;position:relative}
.debug-panel[hidden]{display:none}
.debug-panel{grid-column:1;grid-row:1;position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;height:100dvh;overflow:hidden;background:#1b1e24;color:#d9e0e9;border-right:1px solid #424b58;color-scheme:dark;font:12px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;--line:#343c48;--muted:#a2adbc}
.debug-panel button,.debug-panel input,.debug-panel select{font-family:inherit}
.debug-heading{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--line);background:#242830;min-height:44px}
.debug-heading h2{font-size:13px;letter-spacing:.4px}.debug-heading .close-button{font-size:23px;color:#b7c2ce;min-width:32px;min-height:30px;background:none;border:0}
#debug-live{font-size:10px;letter-spacing:.6px;margin-left:12px;color:#a8b2c0}#debug-live.recording{color:#65d6a1}
.debug-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:10px 10px 6px}.debug-toolbar .button{font-size:11px;min-height:32px;padding:6px 9px;border-color:#495361;background:#2a3039;color:#e2e8ef;border-radius:4px}.debug-toolbar .primary{background:#214c3c;border-color:#357c5d;color:#baf3d6}.debug-toolbar .input{width:auto;flex:1;min-width:125px;margin:0;min-height:32px;padding:5px 8px;border:1px solid #495361;border-radius:4px;background:#21262e;color:#e2e8ef;font-size:11px}.debug-toolbar .input::placeholder{color:#a2adbc}
.debug-panel :focus-visible{outline:2px solid #8dbdff;outline-offset:1px}
.debug-notice,#debug-state,#debug-fault{margin:4px 10px;font-size:10px;overflow-wrap:anywhere}.debug-notice{color:#a2adbc}#debug-state{color:#b9c5d3}#debug-fault{color:#ff97a0}#debug-fault:empty{display:none}
.debug-chart{margin:8px 0 0;padding:7px 9px 9px;border-block:1px solid var(--line);background:#171a20;flex:none}.debug-chart-heading{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:11px}.debug-chart select{border:1px solid #424b58;border-radius:4px;padding:4px;font-size:10px;background:#242a33;color:#c8d4e3}.debug-chart canvas{display:block;width:100%;height:132px}.debug-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:10px;margin-top:5px}
.debug-panel .debug-ok{color:#65d6a1}.debug-panel .debug-waiting{color:#f1c66c}.debug-panel .debug-error{color:#ff7b86}.debug-panel .debug-cancelled{color:#a8b2c0}
.debug-list-heading{display:flex;justify-content:space-between;gap:6px;align-items:center;padding:7px 10px;color:#a2adbc;font-size:10px}.debug-list-heading p{margin:0}.debug-list-heading label{white-space:nowrap;display:flex;align-items:center;gap:5px}.debug-list-heading input{margin:0;accent-color:#81b9ff}
.debug-grid{display:grid;grid-template-rows:minmax(100px,1fr) minmax(90px,.6fr);min-height:0;flex:1;border-top:1px solid var(--line)}.debug-table-scroll{overflow:auto;min-width:0;overscroll-behavior:contain;scrollbar-color:#4a5361 #1b1e24}.debug-grid table{border-collapse:collapse;width:100%;font-size:11px;white-space:nowrap}.debug-grid th{position:sticky;top:0;background:#292e38;color:#c1cddd;text-align:left;z-index:1;font-weight:500}.debug-grid th,.debug-grid td{padding:5px 7px;border-bottom:1px solid #2e3540}.debug-grid td:nth-child(5){font-weight:600}.debug-grid td:not(:first-child){font-variant-numeric:tabular-nums}.debug-grid .text-button{color:inherit;font-size:11px;text-align:left;min-height:24px;padding:0;max-width:235px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}.debug-grid tr:hover{background:#283443}.debug-grid tr.selected{background:#253d59;box-shadow:inset 3px 0 #8dbdff}.debug-grid tr.debug-error{background:#3b242b}.debug-grid tr.debug-error.selected{background:#59313c}
#debug-detail{margin:0;padding:12px;border-top:1px solid var(--line);overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#15191f;color:#c7d5e7;font:11px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif;tab-size:2}
.debug-resize{position:absolute;right:0;top:0;bottom:0;width:5px;cursor:col-resize;touch-action:none;z-index:4}.debug-resize:hover,.debug-resize:focus-visible{background:#75a9eb}
@media(max-width:820px){body.debug-docked{grid-template-columns:minmax(0,1fr);grid-template-rows:50dvh minmax(0,1fr)}.debug-docked .app-shell{grid-column:1;grid-row:2}.debug-panel{height:50dvh;overflow:auto;border-right:0;border-bottom:1px solid #424b58}.debug-heading{position:sticky;top:0;z-index:5}.debug-notice{display:none}.debug-chart canvas{height:90px}.debug-grid{flex:none;height:260px;grid-template-rows:140px 120px}.debug-resize{display:none}}
/* Strom operací používá stejné kontrasty jako původní stavové řádky. */
.debug-toolbar a.button{text-decoration:none;display:inline-flex;align-items:center}.debug-node{display:flex;align-items:center;gap:4px;min-width:0}.debug-expand,.debug-expand-spacer{width:18px;min-width:18px;display:inline-grid;place-items:center}.debug-expand{height:22px;min-height:22px;padding:0;background:#252e3a;color:#c2d6ed;border:1px solid #425167;border-radius:4px;font:15px system-ui;cursor:pointer}.debug-expand:hover{background:#364b63}.debug-operation .text-button{font-weight:600}.debug-operation{background:#202630}.debug-grid td:first-child{max-width:430px}.debug-node .text-button{min-width:40px}#debug-connection{margin:3px 10px;font-size:10px;color:#86c6d5}#debug-connection:empty{display:none}
.debug-chart-heading>.input{width:auto;min-width:0;max-width:72%;flex:0 1 auto;margin:0}.debug-chart-heading>strong{white-space:nowrap}

/* Shared controls: both embedded panel and standalone viewer use this layer. */
.debug-panel,.debug-panel *{box-sizing:border-box}
.debug-panel button,.debug-panel input,.debug-panel select{font:inherit;letter-spacing:normal}
.debug-panel button{cursor:pointer;appearance:none}
.debug-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:12px 14px}
.debug-actions{display:flex;flex-wrap:wrap;align-items:center;gap:7px;min-width:0}
.debug-actions .button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;margin:0;padding:7px 11px;border:1px solid #465261;border-radius:6px;background:#29323e;color:#e5edf7;text-decoration:none;font-size:11px;font-weight:500;line-height:18px;white-space:nowrap;box-shadow:none;transition:background .12s,border-color .12s}
.debug-actions .button:hover{background:#354254;border-color:#667b94}
.debug-actions .button:active{background:#202a36}
.debug-actions .button.primary{background:#214d3d;border-color:#3b8565;color:#c8f3dc}
.debug-actions .button.primary:hover{background:#2b624d;border-color:#58a780}
.debug-actions .button:disabled{opacity:.45;cursor:default}
.debug-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,.55fr);gap:8px;min-width:0}
.debug-toolbar .debug-filters .input{display:block;width:100%;min-width:0;max-width:none;min-height:34px;margin:0;padding:7px 10px;border:1px solid #414d5e;border-radius:6px;background:#181e27;color:#e1e9f3;font-size:11px;line-height:18px;box-shadow:none}
.debug-toolbar .debug-filters select.input{padding-right:25px;cursor:pointer}
.debug-filters .input:hover{border-color:#66788e}
.debug-heading{padding:10px 14px;min-height:50px}
.debug-heading h2{margin:0;color:#e5edf7;font:650 13px/1.4 system-ui,sans-serif}
.debug-heading .close-button{display:grid;place-items:center;width:30px;height:30px;min-height:30px;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:#9fadc0;font-size:21px;line-height:1}
.debug-heading .close-button:hover{border-color:#465261;background:#303a48;color:#fff}
.debug-notice,#debug-state,#debug-fault,#debug-connection{margin:4px 14px;font-size:10px;line-height:1.65;overflow-wrap:anywhere}
.debug-list-heading{padding:10px 14px;gap:12px;flex-wrap:wrap}
.debug-list-heading p{color:#aebbcf;font-size:10px}
.debug-grid table{line-height:1.5}
.debug-grid th,.debug-grid td{height:35px;padding:5px 10px;vertical-align:middle}
.debug-grid th{font-size:10px;letter-spacing:.15px;color:#aebcd0}
.debug-grid th:first-child{min-width:210px}
.debug-panel .debug-grid .text-button{display:inline-block;appearance:none;min-height:26px;margin:0;padding:3px 1px;border:0;border-radius:3px;background:transparent;box-shadow:none;color:inherit;font:500 11px/20px system-ui,sans-serif;text-decoration:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.debug-panel .debug-grid .text-button:hover{color:#fff;text-decoration:underline;text-underline-offset:3px}
.debug-panel .debug-operation .text-button{font-weight:650}
.debug-node{gap:7px}
.debug-expand,.debug-expand-spacer{width:23px;min-width:23px}
.debug-panel .debug-expand{display:inline-grid;place-items:center;height:24px;min-height:24px;padding:0;border:1px solid #435268;border-radius:5px;background:#253144;color:#c0d1e8;font:400 15px/1 system-ui,sans-serif;box-shadow:none}
.debug-panel .debug-expand:hover{background:#354963;border-color:#7189aa;color:#fff}
.debug-grid tr.selected{background:#243c57;box-shadow:inset 3px 0 #82b9fa}
.debug-grid tr.debug-error{background:#34242c}
.debug-grid tr.debug-error:hover{background:#422b35}
.debug-grid tr.debug-error.selected{background:#4b2e3c;box-shadow:inset 3px 0 #ee899c}
@media(max-width:420px){.debug-toolbar{padding:10px;gap:8px}.debug-actions{gap:6px}.debug-actions .button{flex:1 1 auto;padding:6px 9px}.debug-filters{grid-template-columns:minmax(0,1fr) 110px}.debug-heading{padding:8px 10px}.debug-list-heading{padding:8px 10px}}
.debug-diagnosis{border-left:3px solid #ff7b86;padding:8px 12px;margin:10px 0;background:#34232b;white-space:normal}.debug-diagnosis h3{font-size:13px;margin:0 0 8px}.debug-diagnosis p{margin:6px 0}#debug-detail details{margin-top:12px}#debug-detail summary{cursor:pointer;color:#adc9e5}#debug-detail pre{white-space:pre-wrap;margin-top:8px;font:11px/1.5 monospace}
.debug-panel.debug-has-diagnosis .debug-chart canvas{height:70px}.debug-panel.debug-has-diagnosis .debug-grid{grid-template-rows:minmax(90px,.7fr) minmax(170px,1fr)}
.debug-grid tr.debug-ok td{background:#65d6a10b}.debug-grid tr.debug-waiting td{background:#ffd45c14;color:#ffe198}.debug-grid tr.debug-error td,.debug-grid tr.debug-cancelled td{background:#ff74871c;color:#ff9aa6}.debug-grid tr.selected td{background:#70405266}

html:not([data-tools-unlocked="true"]) body:not(.debug-full) [data-debug-ui]{display:none!important}html:not([data-tools-unlocked="true"]) body.debug-full>:not(#debug-lock-message):not(script){display:none!important}html[data-tools-unlocked="true"] #debug-lock-message{display:none}#debug-lock-message{padding:28px;color:#dce7f4;font:16px/1.6 system-ui}
