.esp-page{max-width:1060px;padding-top:20px;padding-bottom:24px}
.esp-panel{padding:28px;margin:20px 0;border:1px solid #26455c;border-radius:20px;background:#0c2131}
.esp-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.esp-section-head h2{font-size:20px;margin:0;line-height:1.5}
.esp-section-head h2 span{color:#62d8d3;font-size:14px;margin-right:12px}
.esp-badge{font-size:12px;padding:6px 12px;border-radius:20px;background:#21394b;color:#adc2d0;white-space:nowrap}
.esp-badge[data-connected=true]{background:#103d33;color:#74dfb8}
.esp-device-info{font-size:15px;line-height:1.8;overflow-wrap:anywhere;margin:22px 0;color:#a6bfce}
.esp-connect-actions,.esp-operation-actions{display:flex;gap:14px;margin-top:24px}
.esp-fields{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:24px;margin-top:12px}
.esp-fields .flash-field{min-width:0;font-size:14px}
.esp-fields input{box-sizing:border-box;width:100%;min-width:0;min-height:50px;padding:12px;border:1px solid #345164;border-radius:10px;background:#091a27;color:#e7f1fa;font-family:inherit;font-size:16px;line-height:1.5}
.esp-fields input[type=file]{font-size:14px;overflow:hidden}
.esp-fields input::file-selector-button{margin-right:12px;border:0;border-radius:6px;background:#21485b;color:#e7f1fa;padding:8px 12px;cursor:pointer}
.esp-help{font-size:13px;line-height:1.8;color:#8ca8bc;overflow-wrap:anywhere}
.esp-danger{color:#ffb3a8;border-color:#95504d;background:#38272a}
.esp-status{margin:22px 0 0;line-height:1.8;color:#b6d5df;overflow-wrap:anywhere}
.esp-status[data-error=true]{color:#ffb3a8}
#esp-log{background:#06131e;padding:16px;border-radius:12px;max-height:320px;overflow:auto;overscroll-behavior:contain;color:#8fc7c4;font:12px/1.7 monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.esp-page input:focus-visible{outline:3px solid #67d9d2;outline-offset:4px}
.esp-page button{min-height:50px}
html[data-theme=light] .esp-panel{background:#f8fcfe;border-color:#c4dce6}
html[data-theme=light] .esp-device-info,html[data-theme=light] .esp-help,html[data-theme=light] .esp-status{color:#526f83}
html[data-theme=light] .esp-fields input{background:#fff;color:#17384c;border-color:#c0d6e0}
html[data-theme=light] .esp-danger{color:#9c3027!important;border-color:#d99991!important;background:#fff4f1!important}
html[data-theme=light] .esp-status[data-error=true]{color:#9c3027}
@media(max-width:620px){
  .esp-panel{padding:24px 20px;margin:24px 0;border-radius:18px}
  .esp-section-head{gap:12px}
  .esp-section-head h2{font-size:18px}
  .esp-section-head h2 span{margin-right:9px}
  .esp-fields{grid-template-columns:1fr;gap:0;margin-top:16px}
  .esp-fields .flash-field{margin:16px 0;gap:12px}
  .esp-connect-actions,.esp-operation-actions{flex-direction:column;gap:14px}
  .esp-page .flash-button{flex:auto;width:100%;min-height:52px}
  .esp-device-info{font-size:14px;margin:20px 0}
  #esp-log{max-height:240px;padding:12px}
}

/* Compact workstation: keep connection, files and actions together. */
.esp-page .firmware-intro{margin:18px 0 20px}
.esp-page .firmware-intro h1{font-size:30px;margin:8px 0}
.esp-page .firmware-intro p{margin:0;font-size:14px}
.esp-page .esp-panel{padding:18px 20px;margin:12px 0;border-radius:12px}
.esp-page .esp-section-head h2{font-size:17px}
.esp-page .esp-device-info{margin:12px 0;font-size:14px}
.esp-page .esp-connect-actions,.esp-page .esp-operation-actions{margin-top:12px;gap:10px}
.esp-page .flash-button{flex:0 1 auto;padding:10px 18px;min-height:42px}
.esp-page .esp-help{margin:8px 0;font-size:12px;line-height:1.6}
.esp-file-row{display:grid;grid-template-columns:170px minmax(0,1fr) 40px;gap:14px;align-items:start;border-bottom:1px solid #26455c;padding:10px 0}
.esp-file-row .flash-field{margin:0;min-width:0;gap:6px;font-size:13px}
.esp-file-row input{width:100%;min-width:0;box-sizing:border-box;border:1px solid #345164;border-radius:8px;background:#091a27;color:#e7f1fa;min-height:42px;padding:9px 10px;font:14px/1.5 system-ui,sans-serif}
.esp-file-row input[type=file]{font-size:13px;padding:6px}
.esp-file-row input::file-selector-button{border:0;border-radius:5px;background:#21485b;color:#e7f1fa;padding:7px 10px;margin-right:10px;cursor:pointer}
.esp-file-row .esp-help{margin:0}
.esp-remove{margin-top:24px;min-height:42px;border:1px solid #345164;border-radius:8px;background:transparent;color:#a6bfce;font-size:23px;cursor:pointer}
.esp-remove:disabled{opacity:.35;cursor:not-allowed}
.esp-page .esp-add{margin-top:10px;background:transparent;font-size:13px}
.esp-page .esp-status{margin-top:12px;font-size:14px}
.esp-page .flash-log-toggle{margin-top:10px;min-height:32px}
.esp-page #esp-log{margin-bottom:0;max-height:180px}
@media(min-width:621px){
  .esp-page{display:block}
  .esp-page>.firmware-back{grid-area:back}
  .esp-page>.firmware-intro{grid-area:intro;margin:12px 0}
  .esp-page>.firmware-support{grid-column:1 / -1}
  .esp-page>.esp-panel:nth-of-type(1){grid-area:device}
  .esp-page>.esp-panel:nth-of-type(2){grid-area:files}
  .esp-page>.esp-panel:nth-of-type(3){grid-area:status}
  .esp-page>.firmware-browser-note{grid-area:note;margin:8px 0;font-size:12px}
  .esp-page .esp-panel{margin:6px 0;padding:14px 18px}
  .esp-page .firmware-intro h1{font-size:26px}
  .esp-page .flash-progress{margin:10px 0}
  .esp-file-row:not(:first-child) .flash-field{font-size:0;gap:0}
  .esp-file-row:not(:first-child) .esp-remove{margin-top:0}
  .esp-page #esp-log{max-height:140px}
}

/* Plain tool surface, without separate status cards. */
.esp-page .esp-panel{border:0;border-bottom:1px solid #26455c;border-radius:0;background:transparent;padding:14px 0;margin:0}
.esp-page .esp-panel:last-of-type{border-bottom:0}
.esp-page .esp-operation-actions{align-items:center;flex-wrap:wrap}
.esp-page .esp-operation-actions .flash-log-toggle{margin:0 0 0 8px;min-height:42px}
.esp-page .esp-device-info{margin:8px 0}
.esp-page .esp-connect-actions{margin-top:8px}
.esp-page .esp-status{margin-top:10px}
html[data-theme=light] .esp-page .esp-panel{background:transparent;border-color:#c4dce6}
@media(max-width:620px){
  .esp-page .esp-panel{padding:14px 0;margin:0}
  .esp-page .esp-operation-actions .flash-log-toggle{margin-left:0;flex-basis:100%}
}
html[data-theme=light] .esp-file-row{border-color:#c4dce6}
html[data-theme=light] .esp-file-row input{background:#fff;color:#17384c;border-color:#c0d6e0}
@media(max-width:620px){
  .esp-page{padding:20px 16px 24px}
  .esp-page .firmware-intro{margin:22px 0 18px}
  .esp-page .firmware-intro h1{font-size:26px}
  .esp-page .esp-panel{padding:16px;margin:14px 0}
  .esp-page .esp-connect-actions,.esp-page .esp-operation-actions{flex-direction:row;flex-wrap:wrap}
  .esp-page .flash-button{width:auto;flex:1;min-height:44px;padding:10px 12px;font-size:14px}
  .esp-file-row{grid-template-columns:minmax(0,1fr) 40px;gap:10px}
  .esp-file-row .flash-field:first-child{grid-column:1;grid-row:2}
  .esp-file-row .flash-field:nth-child(2){grid-column:1 / -1;grid-row:1}
  .esp-remove{margin-top:24px}
  .esp-file-row input{font-size:16px;min-height:44px}
  .esp-file-row input[type=file]{font-size:13px}
  .esp-page .esp-add{flex:none;width:100%}
}
