/* Debug drawer lives in the parent dashboard so it stays in front of iframes/modal overlays. */
#rhcDebugRoot{position:fixed;bottom:0;left:0;right:0;z-index:2147483000;font:13px/1.45 system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:#dce7fa;pointer-events:none}
#rhcDebugRoot *{box-sizing:border-box}
#rhcDebugBar{pointer-events:auto;background:#101a29;border-top:1px solid #344a66;box-shadow:0 -9px 36px rgba(0,0,0,.22);display:flex;align-items:center;gap:12px;padding:7px 16px;min-height:43px}
#rhcDebugToggle{background:#1b324b;border:1px solid #395473;color:white;padding:6px 13px;border-radius:9px;cursor:pointer;font-weight:750}
#rhcDebugToggle:hover{background:#2c4b6b}
#rhcDebugLive{color:#91aac5;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#rhcDebugDot{width:7px;height:7px;border-radius:50%;display:inline-block;background:#63d6a3;margin-right:6px}
#rhcDebugDrawer{pointer-events:auto;height:350px;background:#0c1524;border-top:1px solid #2d425d;display:flex;flex-direction:column;box-shadow:0 -20px 55px rgba(0,0,0,.25)}
#rhcDebugDrawer[hidden]{display:none!important}
#rhcDebugToolbar{padding:10px 15px;border-bottom:1px solid #263b55;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#rhcDebugDrawer button,#rhcDebugDrawer select,#rhcDebugDrawer textarea{font:inherit;border:1px solid #345070;background:#15263c;color:#edf4ff;border-radius:8px;padding:7px 10px}
#rhcDebugDrawer button{cursor:pointer;font-weight:650}
#rhcDebugDrawer button:hover{background:#25415f}
#rhcDebugVm{min-width:235px}
#rhcDebugTabs{display:flex;gap:7px;align-items:center}
#rhcDebugDrawer button.rhcActive{background:#316b58;border-color:#5baf8b}
#rhcDebugMain{min-height:0;flex:1;overflow:auto;padding:12px 16px}
.rhcDebugPane[hidden]{display:none!important}
#rhcDebugLogs{max-height:100%;overflow:auto}
.rhcDebugEntry{border-bottom:1px solid #233750;padding:10px 3px;display:flex;gap:10px;justify-content:space-between;align-items:flex-start}
.rhcDebugEntry:hover{background:#14263b}
.rhcDebugItemTitle{font-weight:700;color:#e4efff}
.rhcDebugSub{font-size:12px;color:#9cb0c7;margin-top:3px}
.rhcDebugFail{color:#ff9ba9}
.rhcDebugOk{color:#81dbb1}
.rhcDebugMini{font-size:11px;color:#aebed1}
#rhcDebugSql{width:100%;height:90px;resize:vertical;font:13px/1.5 Consolas,monospace!important;white-space:pre;tab-size:2}
#rhcDebugQueryResult,#rhcDebugJobDetail{background:#07101e;border:1px solid #30425b;padding:12px;border-radius:9px;white-space:pre-wrap;overflow:auto;max-height:270px;user-select:text;font:12px/1.45 Consolas,monospace}
#rhcDebugJobDetail{max-height:62vh}
.rhcDebugTableWrap{overflow:auto;max-height:240px;border-radius:8px;border:1px solid #344b6d;margin-top:8px}
.rhcDebugTable{border-collapse:collapse;width:100%}.rhcDebugTable th,.rhcDebugTable td{padding:7px 10px;border-bottom:1px solid #273c55;text-align:left;white-space:pre-wrap;max-width:380px;vertical-align:top}.rhcDebugTable th{position:sticky;top:0;background:#1c324a}
#rhcDebugDetailMask{pointer-events:auto;position:fixed;inset:0;background:rgba(3,8,16,.55);display:grid;place-items:center;z-index:2147483001;padding:15px}
#rhcDebugDetailMask[hidden]{display:none!important}
#rhcDebugDetailCard{background:#111d2e;border:1px solid #405574;border-radius:15px;padding:16px;width:min(1050px,96vw);max-height:86vh;overflow:auto;box-shadow:0 22px 80px #0008}
#rhcDebugDetailCard header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
#rhcDebugDetailCard button{border:1px solid #416384;background:#213b55;color:white;border-radius:8px;padding:8px 12px;cursor:pointer}
#rhcDebugRoot .rhcHint{color:#8fa7c2;font-size:12px}
@media(max-width:650px){#rhcDebugBar{padding:6px 8px}#rhcDebugToolbar{gap:6px;padding:8px}#rhcDebugVm{min-width:150px}}

/* V26: Debug pane is resizable and never hides the UniShop iframe footer. */
#rhcDebugBar{min-height:43px}
#rhcDebugLive{flex:1}
#rhcDebugHeightControl{pointer-events:auto;display:flex;align-items:center;gap:9px;white-space:nowrap;color:#b9cee7;font-size:12px}
#rhcDebugHeightControl[hidden]{display:none!important}
#rhcDebugHeight{width:clamp(95px,12vw,190px);height:22px;cursor:pointer;accent-color:#70c6a1;padding:0;margin:0;background:transparent;border:0}
#rhcDebugHeightValue{font-variant-numeric:tabular-nums;min-width:52px;text-align:right;color:#e2f2ff}
/* Preserve room at the bottom for the fixed bar even when collapsed. */
body .content{padding-bottom:calc(24px + var(--rhc-debug-space, 43px))!important}
/* The dashboard creates UniShop as a fixed-height iframe. Shrink its viewport
   with the drawer so its internal scrollbar can still reach the bottom. */
#unishop-tool-panel{
  height:max(280px,calc(100dvh - 135px - var(--rhc-debug-space, 43px)))!important;
  min-height:280px!important;
}
#unishop-tool-panel > iframe{height:100%!important;min-height:0!important}
@media(max-width:650px){
  #rhcDebugBar{flex-wrap:wrap}
  #rhcDebugHeightControl{margin-left:auto}
  #rhcDebugHeight{width:100px}
  #unishop-tool-panel{height:max(230px,calc(100dvh - 160px - var(--rhc-debug-space, 43px)))!important;min-height:230px!important}
}

/* V27: true split viewport. All dashboard content ends ABOVE the debug surface. */
#rhcDebugGrip{position:absolute;left:0;right:0;top:-5px;height:10px;z-index:5;pointer-events:auto;cursor:ns-resize;touch-action:none;background:transparent}
#rhcDebugGrip[hidden]{display:none!important}
#rhcDebugGrip:hover,#rhcDebugGrip:focus-visible{background:rgba(105,202,169,.42);outline:0}
html.rhc-debug-dragging,html.rhc-debug-dragging *{cursor:ns-resize!important;user-select:none!important}
#rhcDebugHeightControl{display:none!important}
html.rhc-debug-docked,html.rhc-debug-docked body{height:100%!important;min-height:0!important;overflow:hidden!important}
html.rhc-debug-docked .app{height:calc(100dvh - var(--rhc-debug-space,43px))!important;min-height:0!important;max-height:calc(100dvh - var(--rhc-debug-space,43px))!important;overflow:hidden!important}
html.rhc-debug-docked .sidebar{height:100%!important;min-height:0!important}
html.rhc-debug-docked .main{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
html.rhc-debug-docked .topbar{position:relative!important;flex:none!important;top:auto!important}
html.rhc-debug-docked main.content{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:24px!important;overscroll-behavior:contain}
html.rhc-debug-docked #unishop-tool-panel{height:max(330px,calc(100dvh - var(--rhc-debug-space,43px) - 175px))!important;min-height:330px!important;max-height:none!important}
html.rhc-debug-docked #unishop-tool-panel > iframe{height:100%!important;min-height:0!important}
@media(max-width:920px){html.rhc-debug-docked .sidebar{overflow-y:auto!important}html.rhc-debug-docked .app{display:flex!important;flex-direction:column!important}html.rhc-debug-docked .main{flex:1!important}}

#rhcDebugClear{border-color:#855166!important;color:#ffc0ca!important;background:#332032!important}
#rhcDebugClear:hover{background:#512c40!important}
