:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-raised: #18181b;
  --surface-hover: #1f1f23;
  --border: #27272a;
  --border-subtle: #1e1e22;
  
  --text-main: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  
  --accent: #ffffff;
  --accent-text: #09090b;
  
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 80px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Nav / Brand */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.version-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
}

.doc-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.doc-link:hover {
  color: var(--text-main);
}

/* Title Section */
.hero {
  text-align: center;
  padding: 4px 0 8px;
}

.hero h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.hero p {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.5;
}

/* Base Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Primary Flasher Box */
.flasher-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  gap: 16px;
}

.flasher-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 440px;
}

/* ESP Web Install Button Custom Styles */
esp-web-install-button {
  display: inline-block;
}

.btn-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}

.btn-install:hover {
  opacity: 0.92;
}

.btn-install:active {
  transform: scale(0.99);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-ghost:hover {
  background: var(--surface-raised);
  color: var(--text-main);
  border-color: #3f3f46;
}

/* Alert banner */
.alert-box {
  display: none;
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
}

/* Clean Hardware List */
.hardware-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13.5px;
}

.hw-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hw-name {
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hw-specs {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.pill-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.pill-primary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.pill-muted {
  background: transparent;
  color: var(--text-tertiary);
  border-color: var(--border);
}

/* Steps list */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.step-idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  width: 20px;
  flex-shrink: 0;
}

.step-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.step-body strong {
  color: var(--text-main);
  font-weight: 500;
}

.step-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-main);
}

/* Minimal Terminal / Serial Monitor */
.terminal-card {
  display: none;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  width: 100%;
  text-align: left;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #1f1f23;
  margin-bottom: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.terminal-view {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a1a1aa;
  height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding-top: 12px;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--text-main);
}
