/* ============================================================
   ChicaneFlow Flasher — Standalone Flashing Page Styles
   "Telemetry Noir" Design System — Consistent with style.css
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  /* Depth layers */
  --bg-abyss: #06060c;
  --bg-deep: #0a0b14;
  --bg-surface: #11131f;
  --bg-elevated: #181b2c;
  --bg-field: #1e2137;

  /* Neon accents */
  --cyan: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.35);
  --cyan-dim: rgba(0, 229, 255, 0.12);
  --amber: #ff6d00;
  --amber-glow: rgba(255, 109, 0, 0.4);
  --amber-dim: rgba(255, 109, 0, 0.1);
  --red: #ff1744;
  --red-glow: rgba(255, 23, 68, 0.35);
  --green: #00e676;
  --green-glow: rgba(0, 230, 118, 0.3);

  /* Typography */
  --text-primary: #e8eaed;
  --text-secondary: #9aa0b4;
  --text-muted: #5c6178;
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --content-max: 1200px;
  --nav-height: 64px;

  /* Borders & Effects */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --border-glow: 1px solid rgba(0, 229, 255, 0.35);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-abyss);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* Selection */
::selection {
  background: var(--cyan);
  color: var(--bg-abyss);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(10, 11, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border-subtle);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--cyan), #0091ea);
  clip-path: polygon(50% 0%, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--bg-abyss);
}

.nav-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

.nav-back:hover {
  color: var(--cyan);
}

/* --- Browser Compatibility Warning --- */
.browser-warning {
  display: none;
  padding: 3rem 1.5rem;
}

.browser-warning-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem;
  background: rgba(255, 23, 68, 0.08);
  border: 1px solid rgba(255, 23, 68, 0.2);
  border-radius: var(--radius-md);
  color: var(--red);
}

.browser-warning-inner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.browser-warning-inner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.browser-warning-inner p {
  font-size: 0.85rem;
  color: #ff8a80;
  margin-top: 0.2rem;
}

/* --- Main Content --- */
.main {
  flex: 1;
  padding: 2rem 1.5rem 4rem;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* --- Server Config --- */
.server-config {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
}

.server-config-inner {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.server-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  display: block;
  width: 100%;
}

.server-input {
  flex: 1;
  min-width: 280px;
  padding: 0.65rem 0.9rem;
  background: var(--bg-field);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.server-input:focus {
  border-color: var(--cyan);
}

.server-input::placeholder {
  color: var(--text-muted);
}

.server-input--code {
  flex: 0 1 220px;
  min-width: 180px;
  letter-spacing: 0.15em;
}

/* --- Vehicle Selector --- */
.vehicle-select-row {
  margin-bottom: 1rem;
}

.vehicle-select-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  display: block;
}

.vehicle-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-field);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.vehicle-select:focus {
  border-color: var(--cyan);
}

/* --- Buttons --- */
.btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.5rem;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0088cc);
  color: var(--bg-abyss);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--cyan-glow);
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-glow);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.btn-outline:hover:not(:disabled) {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.btn-amber {
  background: linear-gradient(135deg, var(--amber), #e65100);
  color: #fff;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.btn-amber:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--amber-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  clip-path: none;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--cyan);
  border-color: var(--cyan-glow);
  background: var(--cyan-dim);
}

.btn-cyan-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-glow);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  font-size: 0.72rem;
  clip-path: none;
  width: 100%;
}

.btn-cyan-outline:hover:not(:disabled) {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.btn-cyan-outline.selected {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-dim);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-glow);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 23, 68, 0.12);
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--red-glow);
}

/* --- Erase-before-flash checkbox --- */
.flash-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-field);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  transition: border-color 0.2s ease;
}

.flash-checkbox:hover {
  border-color: var(--amber-glow);
}

.flash-checkbox input {
  margin-top: 0.15rem;
  width: 16px;
  height: 16px;
  accent-color: var(--amber);
  flex-shrink: 0;
  cursor: pointer;
}

.flash-checkbox em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.78rem;
}

/* --- Local firmware flash address --- */
.local-addr-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.local-addr-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.local-addr-input {
  width: 110px;
  padding: 0.5rem 0.7rem;
  background: var(--bg-field);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.local-addr-input:focus {
  outline: none;
  border-color: var(--cyan-glow);
}

.local-addr-hint {
  flex: 1 1 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- Advanced / device operations --- */
.advanced-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.advanced-actions .btn {
  flex: 1 1 auto;
  min-width: 130px;
}

.advanced-desc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.advanced-desc strong {
  color: var(--text-secondary);
}

/* --- Layout --- */
.flash-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

/* --- Instructions Panel --- */
.flash-instructions {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}

.flash-instructions h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--amber);
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.instruction-step {
  display: flex;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.instruction-step:last-child {
  border-bottom: none;
}

.step-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-dim);
  border: 1px solid rgba(255, 109, 0, 0.2);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber);
  font-weight: 700;
  margin-top: 1px;
}

.instruction-step strong {
  display: block;
  font-size: 0.82rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.instruction-step p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.instruction-step kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--bg-field);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-primary);
}

/* --- Flash Interface --- */
.flash-interface {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- Step Cards --- */
.step-card {
  background: var(--bg-surface);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.step-card:hover {
  border-color: rgba(0, 229, 255, 0.1);
}

.step-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: var(--border-subtle);
}

.step-badge {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cyan), #0088cc);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--bg-abyss);
}

.step-card-header h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
}

.step-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.step-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  transition: background 0.3s ease;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.status-dot.busy {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber-glow);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.step-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* --- Chip Info --- */
.chip-info {
  display: none;
  padding: 1rem 1.25rem;
  background: rgba(0, 230, 118, 0.06);
  border: 1px solid rgba(0, 230, 118, 0.15);
  border-radius: var(--radius-sm);
}

.chip-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.chip-info-row span:last-child {
  color: var(--green);
}

/* --- Firmware Info --- */
.firmware-info {
  margin-bottom: 0.25rem;
}

.firmware-info-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
}

.firmware-info-placeholder p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.firmware-info-card {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: var(--radius-sm);
}

.firmware-info-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.firmware-version {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.04em;
}

.firmware-device {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-field);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  text-transform: uppercase;
}

.firmware-changelog {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.firmware-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.firmware-meta span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.firmware-meta strong {
  color: var(--text-secondary);
}

.firmware-components {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fw-comp {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.fw-comp:last-child {
  border-bottom: none;
}

.fw-comp-name {
  flex: 1;
  color: var(--text-primary);
}

.fw-comp-addr {
  color: var(--amber);
  min-width: 70px;
}

.fw-comp-size {
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
}

/* --- Firmware Actions --- */
.firmware-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- File Upload --- */
.file-upload-area {
  position: relative;
}

.file-upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-field);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.file-upload-label:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

.file-upload-label.has-file {
  border-color: var(--green);
  color: var(--green);
  background: rgba(0, 230, 118, 0.06);
  border-style: solid;
}

/* --- Progress Bar --- */
.progress-container {
  display: none;
  margin-top: 0.25rem;
}

.progress-bar-outer {
  width: 100%;
  height: 6px;
  background: var(--bg-field);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar-inner::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-align: right;
}

/* --- Flash Step Indicator --- */
.flash-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.75rem 0.5rem;
  background: var(--bg-field);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.flash-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.flash-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.flash-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.flash-step.active {
  color: var(--cyan);
}

.flash-step.active .flash-step-dot {
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
}

.flash-step.done {
  color: var(--green);
}

.flash-step.done .flash-step-dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
}

/* --- Elapsed Time --- */
.elapsed-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  text-align: center;
  min-height: 1.2em;
}

/* --- Log Terminal --- */
.log-terminal {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.log-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border-bottom: var(--border-subtle);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  letter-spacing: 0.05em;
  flex: 1;
}

.btn-clear-log {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.06em;
}

.btn-clear-log:hover {
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.15);
}

.log-body {
  padding: 0.75rem 1rem;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.log-body:empty {
  padding: 0;
}

.log-body::-webkit-scrollbar {
  width: 4px;
}

.log-body::-webkit-scrollbar-track {
  background: transparent;
}

.log-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.log-entry {
  padding: 0.12rem 0;
  animation: logSlide 0.2s ease both;
}

@keyframes logSlide {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log-entry.info  { color: var(--text-secondary); }
.log-entry.ok    { color: var(--green); }
.log-entry.warn  { color: var(--amber); }
.log-entry.error { color: var(--red); }

/* --- Footer --- */
.footer {
  background: var(--bg-surface);
  border-top: var(--border-subtle);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 0.35rem;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .flash-layout {
    grid-template-columns: 1fr;
  }

  .flash-instructions {
    position: static;
  }

  .server-config-inner {
    flex-direction: column;
  }

  .server-input {
    min-width: 100%;
  }

  .btn-ghost {
    width: 100%;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 56px;
  }

  .main {
    padding: 1.25rem 1rem 3rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .nav-title {
    font-size: 1rem;
  }

  .flash-steps {
    gap: 0.25rem;
  }

  .flash-step {
    padding: 0.25rem 0.3rem;
    font-size: 0.6rem;
  }

  .flash-step:not(:last-child)::after {
    width: 8px;
  }

  .firmware-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .step-card-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .step-status {
    margin-left: 0;
    width: 100%;
    margin-top: 0.25rem;
  }
}
