/* OTA Standalone Page Styles */
:root {
  --bg:#0f1115; --panel:#1e242d; --accent:#3fa9f5; --accent-glow:#3fa9f588; --danger:#ff5555; --warn:#ffb347; --ok:#4caf50; --text:#e6eef7; --muted:#708090; --border:#2c3541;
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
body { background:var(--bg); color:var(--text); margin:0; }
header { padding:16px 20px; background:#161b22; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:18px; }
header h1 { font-size:20px; margin:0; font-weight:600; letter-spacing:.5px; }
.small-note { font-size:12px; color:var(--muted); margin-top:2px; }
main { max-width:1180px; margin:0 auto; padding:18px 22px 60px; }
section { background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:18px 20px 22px; margin-bottom:20px; position:relative; }
section h2 { margin:0 0 12px; font-size:16px; font-weight:600; letter-spacing:.4px; }
.grid { display:grid; gap:14px; }
.grid.cols-2 { grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); }
label.inline { display:flex; flex-direction:column; font-size:12px; text-transform:uppercase; letter-spacing:.8px; gap:4px; }
input[type=file], input[type=number], select, button, .fake-input { background:#12161c; color:var(--text); border:1px solid #2a333e; border-radius:6px; padding:10px 12px; font-size:14px; font-family:inherit; }
input[type=file] { padding:6px 10px; }
button { cursor:pointer; font-weight:600; letter-spacing:.5px; transition:.15s background, .15s color, .15s transform; display:inline-flex; align-items:center; gap:6px; }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
button.primary:hover:not(:disabled) { filter:brightness(1.1); }
button.danger { background:var(--danger); border-color:var(--danger); color:#fff; }
button:disabled { opacity:.45; cursor:not-allowed; }
.status-badge { display:inline-block; padding:4px 8px 5px; background:#202a34; border:1px solid #32404d; font-size:11px; font-weight:600; letter-spacing:.6px; border-radius:20px; line-height:1; }
.status-badge[data-state=connected]{ background:var(--ok); border-color:var(--ok); color:#fff; }
.status-badge[data-state=disconnected]{ background:#3a414a; }
#deviceInfo table { width:100%; border-collapse:collapse; font-size:13px; }
#deviceInfo th, #deviceInfo td { text-align:left; padding:4px 6px; border-bottom:1px solid rgba(255,255,255,.06); }
#deviceInfo th { font-weight:600; color:var(--muted); width:140px; }
.progress-wrap { position:relative; background:#13181d; border:1px solid #2c3742; border-radius:8px; height:28px; overflow:hidden; }
.progress-bar { position:absolute; inset:0; width:0%; background:linear-gradient(90deg,var(--accent),#5fd4ff); box-shadow:0 0 0 1px var(--accent-glow),0 0 18px -3px var(--accent); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; letter-spacing:.5px; transition:width .15s linear; }
.progress-bar[data-state=error]{ background:linear-gradient(90deg,#ff0048,#ff7b00); }
#log { height:320px; overflow:auto; background:#0d1015; border:1px solid #232d37; border-radius:8px; font:12px/1.45 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; padding:8px 10px; white-space:pre-wrap; word-break:break-word; }
.log-line { margin:0; padding:2px 0; }
.log-line time { color:var(--muted); margin-right:6px; }
.log-line .tag { display:inline-block; padding:1px 6px 2px; border-radius:4px; background:#24313d; color:#6bb3ff; font-size:10px; font-weight:600; letter-spacing:.5px; margin-right:6px; }
.log-line .tag.err { background:#3b1d24; color:#ff89a1; }
.log-line .tag.rx { background:#1e3623; color:#8ae69e; }
.log-line .tag.tx { background:#352820; color:#ffce7b; }
.inline-actions { display:flex; gap:10px; flex-wrap:wrap; }
.flex { display:flex; gap:14px; align-items:center; }
.shrink { flex-shrink:0; }
.grow { flex:1; }
.separator { height:1px; background:#25303b; margin:14px 0 10px; border-radius:1px; }
.badge { background:#24313d; color:#8fb6d2; padding:2px 8px 4px; border-radius:14px; font-size:11px; font-weight:600; letter-spacing:.5px; }
.note { font-size:11px; color:var(--muted); margin-top:4px; }
.mono { font-family:ui-monospace, monospace; }
.fade { opacity:.6; }
footer { text-align:center; font-size:11px; color:var(--muted); padding:26px 0 40px; }
#speedStats { font-size:12px; margin-top:6px; color:var(--muted); }
#otaSummary { font-size:12px; margin-top:4px; }
#fileMeta { font-size:12px; color:var(--muted); margin-top:4px; }
#reconnectHint { font-size:12px; color:var(--warn); margin-top:6px; display:none; }
#logFilters { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
#logFilters button { background:#1a2129; border-color:#2e3943; font-size:11px; padding:4px 10px 5px; }
#logFilters button.active { background:var(--accent); color:#fff; }
