/* PC Agent additions inherit the existing modal and active theme. */
#work-agent-modal.pc-agent-enhanced { width: 560px; }
#work-agent-modal.pc-agent-enhanced .wa-header { position:sticky; top:0; z-index:2; background:inherit; }
#work-agent-modal.pc-agent-enhanced [hidden] { display:none !important; }
.pc-agent-panel { display:flex; flex-direction:column; gap:14px; color:inherit; font-size:13px; }
.pc-agent-panel *, .pc-remote-controls * { box-sizing:border-box; }
.pc-agent-panel h3 { font-size:13px; margin:0; font-weight:600; }
.pc-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.pc-connection { border:1px solid rgba(128,128,150,.25); border-radius:14px; padding:20px; background:rgba(128,128,150,.05); gap:14px; }
.pc-connection-name { margin:0; font-size:13px; opacity:.75; overflow-wrap:anywhere; }
.pc-agent-panel .pc-connection h3 { font-size:25px; line-height:1.2; letter-spacing:-.4px; }
.pc-connection h3::before { content:''; display:inline-block; width:13px; height:13px; border-radius:50%; margin-right:10px; vertical-align:2px; background:#8d9099; }
.pc-connection[data-mode=online] { border-color:rgba(49,158,95,.4); background:rgba(49,158,95,.06); }
.pc-connection[data-mode=online] h3::before { background:#299052; box-shadow:0 0 0 4px rgba(49,158,95,.13); }
.pc-connection[data-mode=pending] h3::before,.pc-connection[data-mode=paused] h3::before,.pc-connection[data-mode=stopping] h3::before { background:#bf8425; }
.pc-connection[data-mode=error] h3::before,.pc-connection[data-mode=offline] h3::before,.pc-connection[data-mode=pairing] h3::before { background:#ba5444; }
.pc-connection .pc-note { font-size:14px; line-height:1.55; opacity:.85; }
#work-agent-modal .pc-main-button,#work-agent-modal .pc-setup-download { min-height:46px; width:100%; border-radius:9px; font-size:14px; font-weight:600; background:#285c46 !important; color:#fff !important; }
.pc-probe-status { margin:0; border-left:3px solid #8b939e; padding:8px 11px; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.pc-probe-status[data-phase=done] { border-color:#299052; background:rgba(49,158,95,.08); }
.pc-probe-status[data-phase=error] { border-color:#ba5444; background:rgba(190,60,50,.08); }
.pc-connected-choice { border-top:1px solid rgba(128,128,150,.2); padding-top:12px; }
.pc-connected-choice button { min-height:40px; white-space:normal; }
#pc-tools > .pc-stack { gap:14px; }
#pc-settings > .pc-stack { padding-top:2px; }
#pc-tools .wa-label { display:none; }
.pc-agent-panel label { display:flex; flex-direction:column; gap:5px; flex:1; min-width:0; font-size:12px; }
.pc-agent-panel input, .pc-agent-panel select, .pc-agent-panel textarea { width:100%; min-width:0; font-family:inherit; }
.pc-agent-panel textarea { resize:vertical; min-height:68px; }
.pc-agent-panel select { appearance:auto; }
.pc-agent-panel button:disabled { opacity:.45; cursor:not-allowed; }
.pc-agent-panel button:focus-visible, .pc-agent-panel input:focus-visible, .pc-agent-panel select:focus-visible, .pc-agent-panel summary:focus-visible, .pc-agent-panel textarea:focus-visible { outline:2px solid #7eb8f7; outline-offset:3px; }
.pc-row { display:flex; align-items:flex-end; gap:8px; flex-wrap:wrap; }
.pc-row > button { flex-shrink:0; }
.pc-health { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
.pc-health > div { background:rgba(128,128,160,.09); border:1px solid rgba(128,128,160,.18); border-radius:9px; padding:10px; min-width:0; }
.pc-health dt { font-size:11px; opacity:.7; margin-bottom:5px; }
.pc-health dd { margin:0; font-size:12px; overflow-wrap:anywhere; }
.pc-details { border:1px solid rgba(128,128,160,.24); border-radius:10px; padding:12px; }
.pc-details > summary { cursor:pointer; font-size:13px; font-weight:600; }
.pc-details[open] > summary { margin-bottom:12px; }
.pc-stack { display:flex; flex-direction:column; gap:10px; }
.pc-note { opacity:.75; font-size:12px; line-height:1.5; margin:0; overflow-wrap:anywhere; }
.pc-setup { padding:2px 0; }
.pc-agent-panel .pc-setup h3 { font-size:18px; }
.pc-setup-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; list-style:none; padding:0; margin:3px 0; counter-reset:setup; }
.pc-setup-steps li { counter-increment:setup; display:grid; grid-template-columns:22px 1fr; gap:3px 6px; min-width:0; font-size:12px; line-height:1.4; }
.pc-setup-steps li::before { content:counter(setup); grid-row:span 2; display:flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:rgba(126,150,220,.2); font-weight:700; }
.pc-setup-steps span { grid-column:2; opacity:.8; overflow-wrap:anywhere; }
.pc-agent-panel .pc-setup-download { width:100%; min-height:44px; font-size:14px; font-weight:600; background:#5361ad; color:#fff; }
.pc-setup .pc-details { padding:8px 10px; }
.pc-setup .pc-details > summary { font-size:12px; font-weight:400; }
.pc-setup-status { margin:0; padding:10px; border-radius:8px; background:rgba(126,150,220,.12); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.pc-setup-error { background:rgba(190,60,50,.14); border:1px solid rgba(190,60,50,.4); }
.pc-setup-retry { color:inherit; text-decoration:underline; text-underline-offset:3px; font-size:12px; line-height:1.5; }
.pc-error { padding:10px 12px; background:rgba(190,60,50,.12); border:1px solid rgba(220,100,80,.35); border-radius:8px; color:#ed9a8f; overflow-wrap:anywhere; }
.pc-error[hidden], .pc-agent-panel [hidden], .pc-remote-controls [hidden] { display:none !important; }
.pc-task-list { display:flex; flex-direction:column; gap:8px; max-height:320px; overflow:auto; }
.pc-task { padding:10px; border:1px solid rgba(128,128,160,.2); border-radius:9px; }
.pc-task-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.pc-task-head strong { font-size:12px; }
.pc-task-status { opacity:.75; font-size:11px; white-space:nowrap; }
.pc-task progress { display:block; width:100%; height:6px; margin:9px 0; accent-color:#8796df; }
.pc-task .pc-note { margin:6px 0; }
.pc-task button { font-size:11px; padding:5px 9px; }
.pc-task-result { margin-top:8px; }
.pc-task-result summary { cursor:pointer; font-size:12px; }
.pc-task-result p { white-space:pre-wrap; overflow-wrap:anywhere; max-height:180px; overflow:auto; font-size:12px; }
.pc-task-result img { width:100%; border-radius:6px; }
.pc-results { display:flex; flex-direction:column; gap:6px; max-height:230px; overflow:auto; }
.pc-result-item { padding:8px; border-radius:7px; background:rgba(128,128,160,.07); overflow-wrap:anywhere; font-size:12px; }
.pc-result-item button { margin-top:6px; }
.pc-step-list { padding-left:22px; margin:2px 0; line-height:1.7; }
.pc-divider { margin:3px 0; border:0; border-top:1px solid rgba(128,128,160,.2); }
.pc-remote-controls { color:#eee; background:#171717; padding:8px 12px; display:flex; gap:12px; flex-wrap:wrap; align-items:center; font-size:12px; }
.pc-remote-controls label { display:flex; align-items:center; gap:6px; }
.pc-remote-controls select, .pc-remote-controls input[type=text] { background:#292929; color:#eee; border:1px solid #555; border-radius:6px; padding:7px; min-width:0; }
.pc-remote-controls input[type=range] { width:90px; }
.pc-remote-controls form { display:flex; gap:6px; flex:1 1 240px; }
.pc-remote-controls form input { flex:1; }
.pc-remote-controls button { background:#333; color:#eee; border:1px solid #555; border-radius:6px; padding:7px 10px; cursor:pointer; }
#rd-canvas.pc-pointer { touch-action:none; }
@media (max-width:540px) {
  #work-agent-modal.pc-agent-enhanced { width:96vw; max-height:94dvh; }
  .pc-health { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pc-row > label { flex-basis:100%; }
  .pc-row > button { flex:1; }
  .pc-setup { padding:2px 0; }
  .pc-connection { padding:16px; }
  .pc-agent-panel .pc-connection h3 { font-size:22px; }
  .pc-setup-steps { grid-template-columns:1fr; gap:8px; }
  .pc-remote-controls { gap:8px; }
}

.pc-device-item { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid rgba(128,128,150,.18); }
.pc-device-item:last-child { border-bottom:0; }
.pc-device-info { flex:1; min-width:0; overflow-wrap:anywhere; }
.pc-device-info strong { display:block; font-size:13px; margin-bottom:4px; }
.pc-device-info .pc-note { font-size:11px; }
#work-agent-modal .pc-remove-device { flex:0 0 auto; min-height:44px; padding:9px 12px; color:inherit; border:1px solid rgba(185,65,55,.5); }
#pc-clean-pending { min-height:42px; white-space:normal; color:inherit; text-decoration:underline; text-underline-offset:3px; }
#work-agent-modal .pc-remove-device:not(:disabled), #work-agent-modal #pc-clean-pending:not(:disabled) { color:var(--c-title, inherit) !important; opacity:1; }
