#esp-hardware{white-space:nowrap;border-radius:8px}
#esp-hardware.device-ready{color:#13734c;border-color:#b5dac8;background:#f0faf4}
#esp-hardware.device-attention{color:#8d5710;border-color:#e1c28e;background:#fff8e9}
#esp-modal{width:calc(100vw - 24px);max-width:none;height:calc(100dvh - 24px);max-height:none;padding:22px;overflow:hidden;font-family:inherit}
#esp-modal[open]{display:flex;flex-direction:column;gap:14px}
#esp-modal::backdrop{background:rgba(31,28,43,.4);backdrop-filter:none}
#esp-modal [hidden]{display:none!important}
#esp-modal .modal-head{flex-shrink:0;gap:12px;align-items:center}
#esp-modal h2{font-family:inherit;margin:0;font-size:22px}
#esp-title.esp-title-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#esp-modal .esp-device-tabs{display:flex;flex:1;min-width:0;gap:20px;overflow-x:auto;overscroll-behavior:contain;border-bottom:1px solid var(--line);padding:0}
#esp-modal .esp-device-tabs button{display:flex;flex-direction:column;justify-content:center;gap:4px;flex-shrink:0;width:auto;height:auto;min-height:56px;max-width:100%;padding:8px 2px;border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;color:var(--muted);text-align:left;font-size:14px;font-weight:600;white-space:nowrap}
#esp-modal .esp-device-tabs button:hover{color:var(--ink);background:#faf9fd}
#esp-modal .esp-device-tabs button[aria-selected="true"]{color:var(--purple);border-bottom-color:var(--purple)}
.esp-device-tabs small{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:400;color:var(--muted)}
.esp-device-tabs small::before{content:"";width:6px;height:6px;border-radius:50%;background:#aaa9b5}
.esp-device-tabs [data-connected="true"] small::before{background:#16a37a}
#esp-modal #esp-close{width:40px;height:40px;flex-shrink:0}
#esp-modal button:disabled{opacity:.55;cursor:default}
#esp-modal button:focus-visible,#esp-modal summary:focus-visible,#esp-log:focus-visible{outline:2px solid var(--purple);outline-offset:3px}
#esp-modal .esp-note{font-size:12px;color:#68716e;line-height:1.5;margin:4px 0 0;overflow-wrap:anywhere}
#esp-modal #esp-project{max-width:100%;overflow-wrap:anywhere;margin:0 0 8px}
.esp-overview{flex-shrink:0;max-height:42dvh;overflow:auto;overscroll-behavior:contain;padding-top:0}
.esp-connection{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.esp-connection-copy{min-width:0}
#esp-status{margin:0;line-height:1.5;overflow-wrap:anywhere}
#esp-modal .esp-actions{display:flex;align-items:flex-start;gap:8px;flex-shrink:0}
#esp-modal summary{cursor:pointer;font-size:12px;font-weight:700;padding:10px 0}
#esp-device-options>summary{padding:11px 14px;border:1px solid var(--line);border-radius:8px;list-style-position:inside}
.esp-device-menu{display:flex;flex-direction:column;gap:8px;padding:10px 0;max-width:240px}
#esp-task{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-top:10px;padding:10px 12px;border-radius:8px;background:var(--purple-soft)}
#esp-task-status{margin:0;line-height:1.5;font-size:13px;overflow-wrap:anywhere}
#esp-task-retry{flex-shrink:0}
#esp-progress{display:block;width:100%;height:6px;margin-top:10px;accent-color:var(--purple)}
#esp-firmware{margin-top:10px;padding:10px 12px;border:1px solid #e0dccf;border-radius:8px;background:#faf8f2;font-size:12px;line-height:1.5}
#esp-firmware[data-state="ready"]{border-color:#b5dac8;background:#f0faf4}
#esp-firmware[data-state="history"]{border-color:var(--line);background:#f7f7fa}
#esp-boot-steps ol{padding-left:20px;margin:4px 0 12px}
#esp-boot-steps li+li{margin-top:7px}
#esp-boot-steps button{max-width:100%;white-space:normal}
#esp-console{display:flex;flex:1;min-height:180px;flex-direction:column;border-top:1px solid var(--line);padding-top:12px}
.esp-console-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
#esp-console-title{font-size:14px;margin:0}
#esp-modal #esp-console-feedback{color:var(--ink);font-weight:700}
.esp-console-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#esp-modal .esp-console-actions label{display:flex;flex-direction:row;gap:6px;align-items:center;font-size:12px;min-height:36px;cursor:pointer}
#esp-follow{accent-color:var(--purple);width:16px;height:16px;padding:0;margin:0}
.esp-console-actions button{font-size:12px;padding:8px 12px;min-height:36px}
#esp-log{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;white-space:pre-wrap;overflow-wrap:anywhere;background:#f3f6f3;color:#253c31;border:1px solid #e4eae5;border-radius:8px;margin:10px 0 0;padding:14px;font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:2}
.esp-log-prefix{font-weight:700}
.esp-log-key{color:#5b4382;font-weight:700}
.esp-log-value{color:#245c65;font-weight:600}
.esp-log-string{color:#346a55}
.esp-log-number{color:#9a4f12;font-weight:650}
.esp-log-address{color:#69509a}
.esp-log-url{color:#205f91;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}
.esp-log-value-success{color:#0f6a40;font-weight:700}
.esp-log-value-error{color:#a32531;font-weight:700}
.esp-log-value-warning{color:#835706;font-weight:700}
.esp-log-null{color:#6f7872;font-style:italic;font-weight:500}
.esp-log-time{color:#6f7872;font-style:italic}
.esp-log-error{color:#a12b34;font-weight:700}
.esp-log-warning{color:#855807;font-weight:650}
.esp-log-success{color:#176743;font-weight:650}
.esp-log-progress{color:#1e628d}
.esp-log-command{color:#69409b;font-weight:700}
.esp-log-telemetry{color:#5d4486}
.esp-log-system{color:#315f78}
.esp-log-debug{color:#66736d;font-style:italic}
@media(max-width:650px){
  #esp-hardware{max-width:145px;overflow:hidden;text-overflow:ellipsis}.topbar-actions{gap:6px}
  #esp-modal{width:100vw;height:100dvh;padding:14px;border-radius:0;margin:0}
  #esp-modal[open]{gap:10px}
  #esp-modal h2{font-size:19px}
  .esp-connection{flex-wrap:wrap}
  #esp-modal .esp-actions{flex-wrap:wrap}
  #esp-task{align-items:flex-start;flex-direction:column;gap:8px}
  .esp-console-head{gap:6px}
  .esp-console-actions{gap:6px}
  .esp-console-actions button{padding:8px 10px;min-height:40px}
  #esp-modal .esp-console-actions label{min-height:40px}
  #esp-log{padding:10px;font-size:11px}
}
@media(max-height:500px){#esp-modal{padding:8px}.esp-overview{max-height:18dvh}#esp-console{min-height:100px}#esp-modal[open]{gap:3px}#esp-console{padding-top:6px}}
