/* ===================================================================
   Color Palette -- Solarpunk Biological Luminous
   =================================================================== */
:root {
  --moss-deep: #1a2e22;
  --moss-deeper: #0f1d14;
  --lichen-grey: #6b7d6b;
  --clay: #c4956a;
  --leaf-green: #7ec8a0;
  --solar-gold: #e8c547;
  --mycelial-white: rgba(255, 255, 255, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.12);
  --amber: #d4a847;
  --teal: #5ab8a0;
  --teal-dim: rgba(90, 184, 160, 0.3);
  --teal-glow: rgba(90, 184, 160, 0.15);
  --fg: #d0d8d0;
  --fg-dim: #6b7d6b;
  --fg-muted: #4a5c4a;
  --panel-bg: rgba(15, 29, 20, 0.85);
  --autumn-rust: #c76b5a;
  --da-blue: #5b9bd5;
  --ne-red: #d47070;
  --sht-green: #7ec8a0;
  --ot-pink: #d4a0c4;
}

/* ===================================================================
   Reset & Base
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--moss-deep);
  color: rgba(255, 255, 255, 0.85);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  animation: bgShift 30s ease-in-out infinite;
}

@keyframes bgShift {
  0%, 100% { background-color: #1a2e22; }
  33% { background-color: #1c3024; }
  66% { background-color: #182c20; }
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background: repeating-conic-gradient(rgba(255,255,255,0.08) 0% 25%, transparent 0% 50%) 0 0 / 4px 4px;
}

code, .mono { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace; font-size: 0.85rem; }
h2, h3 { letter-spacing: 0.02em; }

/* ===================================================================
   Background Canvas (HDC waveform)
   =================================================================== */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

/* ===================================================================
   Hero Section (compact)
   =================================================================== */
.hero {
  position: relative;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 1rem 1.5rem;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(126, 200, 160, 0.08) 0%, transparent 70%);
  animation: heroGlow 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  z-index: 1;
  position: relative;
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 200;
  letter-spacing: 0.12em;
  color: var(--fg);
  margin-bottom: 0.3rem;
  text-shadow: 0 0 30px rgba(126, 200, 160, 0.15);
  z-index: 1;
  position: relative;
}
.immune-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.6rem;
  font-family: 'SF Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
}
.immune-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: onlinePulse 2s ease-in-out infinite;
}
.immune-label { color: var(--fg-dim); }
.hero-subtitle {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--lichen-grey);
  z-index: 1;
  position: relative;
  letter-spacing: 0.02em;
}

/* ===================================================================
   Tab Bar
   =================================================================== */
.tab-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 48px;
  background: rgba(15, 29, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.tab {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 0 1.2rem;
  height: 48px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--leaf-green); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--leaf-green);
  border-radius: 1px 1px 0 0;
}
.tab:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

/* ===================================================================
   Tab Content
   =================================================================== */
.tab-content {
  display: none;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: calc(100vh - 188px);
}
.tab-content.active { display: block; }

/* ===================================================================
   Glass Panels
   =================================================================== */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
}
.panel-title {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* ===================================================================
   Tab 1: SOMA -- Chat + Telemetry
   =================================================================== */
.soma-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

/* Chat */
.chat-container { position: relative; }
.chat-messages {
  max-height: 450px;
  overflow-y: auto;
  margin-bottom: 1rem;
  scroll-behavior: smooth;
  contain: content;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-message {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 85%;
  animation: fadeSlideIn 0.4s ease-out;
}
.chat-message.user {
  background: rgba(126, 200, 160, 0.04);
  border: 1px solid rgba(126, 200, 160, 0.1);
  border-right: 2px solid rgba(126, 200, 160, 0.4);
  margin-left: auto;
  text-align: right;
}
.chat-message.symthaea {
  background: rgba(232, 197, 71, 0.04);
  border: 1px solid rgba(232, 197, 71, 0.1);
  border-left: 2px solid rgba(232, 197, 71, 0.4);
}
.chat-message .text { font-size: 0.9rem; line-height: 1.5; }
.chat-message .meta {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-top: 0.3rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-input-form { display: flex; gap: 0.5rem; }
.chat-input-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--leaf-green);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--leaf-green);
}
.chat-input-form input:focus {
  border-color: var(--leaf-green);
  box-shadow: 0 0 10px rgba(126, 200, 160, 0.2);
}
.chat-input-form input::placeholder { color: var(--fg-muted); }
.chat-input-form button {
  background: transparent;
  border: 1px solid var(--leaf-green);
  border-radius: 8px;
  color: var(--leaf-green);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.25s ease;
  min-height: 44px;
}
.chat-input-form button:hover {
  background: rgba(126, 200, 160, 0.15);
  transform: rotate(45deg);
}
.chat-input-form button:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-glyph {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 80px; height: 80px;
  opacity: 0.6;
  transition: opacity 0.5s ease;
}

/* Thinking indicator */
.thinking-indicator { padding: 0.75rem 1rem; margin-bottom: 1rem; max-width: 85%; }
.thinking-result {
  display: flex;
  gap: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--lichen-grey);
  padding: 0.5rem 1rem;
  flex-wrap: wrap;
}
.thinking-result .thinking-cycles { color: var(--leaf-green); }
.thinking-result .thinking-time { color: var(--solar-gold); }
.thinking-result .thinking-phi-val { color: var(--teal); }
.thinking-result .thinking-pe-val { color: var(--clay); }
.thinking-result .thinking-generating {
  color: var(--lichen-grey);
  font-style: italic;
  animation: thinkPulse 1.5s ease-in-out infinite;
}
@keyframes thinkPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1.0; }
}

/* Telemetry sidebar */
.telemetry-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.phi-meter {
  text-align: center;
  padding: 1rem 0;
}
.phi-meter .phi-big {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 2.8rem;
  font-weight: 200;
  transition: color 0.5s ease;
  text-shadow: 0 0 20px currentColor;
}
.phi-meter .phi-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.2rem;
}

.confidence-badge {
  display: inline-block;
  text-align: center;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(107, 125, 107, 0.2);
  color: var(--amber);
  border: 1px solid rgba(107, 125, 107, 0.3);
  width: 100%;
}

.neuro-bar-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.neuro-bar-row .nb-label {
  font-size: 0.55rem;
  color: var(--fg-dim);
  width: 2.2rem;
  text-align: right;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.neuro-bar-row .nb-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.neuro-bar-row .nb-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.neuro-bar-row .nb-val {
  font-size: 0.55rem;
  color: var(--fg-muted);
  width: 2rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Harmony radar SVG */
.harmony-radar { display: flex; justify-content: center; padding: 0.5rem 0; }
.harmony-radar svg { max-width: 180px; max-height: 180px; }

.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  padding: 0.25rem 0;
}
.telemetry-row .t-label { color: var(--fg-muted); }
.telemetry-row .t-value { color: var(--fg); font-family: 'SF Mono', 'Fira Code', monospace; }

.glyph-display {
  text-align: center;
  padding: 0.5rem 0;
}
.glyph-display .glyph-id {
  font-family: 'SF Mono', monospace;
  font-size: 0.65rem;
  color: var(--fg-muted);
}
.glyph-display .glyph-echo {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(232, 197, 71, 0.7);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Honesty disclosure */
.honesty-disclosure {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--lichen-grey);
}
.honesty-disclosure summary {
  cursor: pointer;
  color: var(--leaf-green);
  opacity: 0.7;
  font-size: 0.75rem;
}
.honesty-disclosure summary:hover { opacity: 1; }
.honesty-content {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  line-height: 1.6;
  font-size: 0.78rem;
}
.honesty-content ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.honesty-content li { margin-bottom: 0.3rem; }
.honesty-content strong { color: var(--leaf-green); }
.honesty-content em { color: var(--solar-gold); }

.online-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--leaf-green);
  border-radius: 50%;
  animation: onlinePulse 2s ease-in-out infinite;
  margin-left: 0.3rem;
  vertical-align: middle;
}
@keyframes onlinePulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 4px rgba(126, 200, 160, 0.3); }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(126, 200, 160, 0.6); }
}

/* ===================================================================
   Tab 2: TOPOLOGY
   =================================================================== */
#topo-canvas {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  display: block;
}
.topo-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.betti-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.betti-item {
  text-align: center;
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}
.betti-item .betti-val {
  font-family: 'SF Mono', monospace;
  font-size: 1.8rem;
  font-weight: 200;
  color: var(--leaf-green);
}
.betti-item .betti-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}
.wave-packet-list {
  max-height: 200px;
  overflow-y: auto;
  font-family: 'SF Mono', monospace;
  font-size: 0.7rem;
  color: var(--fg-dim);
}
.wave-packet-item {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.btn-action {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--leaf-green);
  background: transparent;
  border: 1px solid var(--leaf-green);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 40px;
}
.btn-action:hover {
  background: rgba(126, 200, 160, 0.08);
  box-shadow: 0 0 20px rgba(126, 200, 160, 0.1);
}
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-action:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn-action.gold { color: var(--solar-gold); border-color: var(--solar-gold); }
.btn-action.gold:hover { background: rgba(232, 197, 71, 0.08); }

/* ===================================================================
   Tab 3: EXPERIMENTS
   =================================================================== */
.experiment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.experiment-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}
.experiment-card h3 {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 0.3rem;
}
.experiment-card .exp-desc {
  font-size: 0.78rem;
  color: var(--fg-dim);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}
.experiment-card .exp-result {
  font-family: 'SF Mono', monospace;
  font-size: 0.72rem;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-top: 0.8rem;
  min-height: 2rem;
}
.exp-chart-container {
  height: 140px;
  margin: 0.8rem 0;
  position: relative;
}
.exp-chart-container canvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: rgba(0,0,0,0.15);
  display: block;
}
.exp-bars {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  height: 120px;
  margin: 0.8rem 0;
  padding: 0.5rem;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
}
.exp-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.exp-bar-col .bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 2px;
}
.exp-bar-col .bar-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-align: center;
}
.exp-bar-col .bar-value {
  font-size: 0.65rem;
  font-family: 'SF Mono', monospace;
  color: var(--fg);
}

.substrate-compare-section {
  margin-top: 1.5rem;
}
.substrate-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.substrate-controls select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  outline: none;
}
.substrate-controls select:focus { border-color: var(--leaf-green); }
.substrate-controls select option { background: var(--moss-deep); }

.run-all-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.battery-progress {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-family: 'SF Mono', monospace;
  color: var(--fg-muted);
}
.battery-progress .bp-item { transition: color 0.3s; }
.battery-progress .bp-item.done { color: var(--leaf-green); }
.battery-progress .bp-item.running { color: var(--solar-gold); animation: thinkPulse 1s infinite; }
.battery-progress .bp-item.error { color: var(--autumn-rust); }

/* ===================================================================
   Tab 4: DREAMS
   =================================================================== */
.dream-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.dream-controls input[type="number"] {
  width: 60px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--fg);
  font-family: 'SF Mono', monospace;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  text-align: center;
}
.dream-controls input[type="number"]:focus { border-color: var(--leaf-green); }

.dream-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.dream-stat {
  text-align: center;
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}
.dream-stat .ds-val {
  font-family: 'SF Mono', monospace;
  font-size: 1.4rem;
  font-weight: 200;
  color: var(--solar-gold);
}
.dream-stat .ds-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

.wisdom-journal {
  max-height: 300px;
  overflow-y: auto;
}
.wisdom-entry {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.8rem;
  line-height: 1.5;
}
.wisdom-entry .w-context { color: var(--fg-dim); }
.wisdom-entry .w-action { color: var(--leaf-green); margin-top: 0.2rem; }
.wisdom-entry .w-meta {
  font-size: 0.65rem;
  color: var(--fg-muted);
  font-family: 'SF Mono', monospace;
  margin-top: 0.2rem;
}
.wisdom-empty {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-style: italic;
  padding: 2rem;
}

.fep-display {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.fep-big {
  text-align: center;
}
.fep-big .fep-val {
  font-family: 'SF Mono', monospace;
  font-size: 2.4rem;
  font-weight: 200;
  color: var(--clay);
}
.fep-big .fep-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}
.fep-big .fep-mode {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  display: inline-block;
}
.fep-mode.exploring {
  background: rgba(126, 200, 160, 0.1);
  color: var(--leaf-green);
  border: 1px solid rgba(126, 200, 160, 0.2);
}
.fep-mode.exploiting {
  background: rgba(196, 149, 106, 0.1);
  color: var(--clay);
  border: 1px solid rgba(196, 149, 106, 0.2);
}
.motor-log {
  max-height: 200px;
  overflow-y: auto;
  font-family: 'SF Mono', monospace;
  font-size: 0.7rem;
  color: var(--fg-dim);
}
.motor-entry {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* ===================================================================
   Tab 5: INOCULATE — Fractal Variants + Consciousness Tiers
   =================================================================== */
.fractal-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fractal-variant {
  padding: 1rem 1.2rem;
  border-left: 2px solid rgba(126, 200, 160, 0.15);
  position: relative;
  transition: border-color 0.3s, background 0.3s;
}
.fractal-variant:hover {
  border-left-color: var(--leaf-green);
  background: rgba(126, 200, 160, 0.03);
}
.fractal-variant.fractal-current {
  border-left-color: var(--solar-gold);
  background: rgba(232, 197, 71, 0.04);
}
.fv-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.fv-icon { font-size: 1.2rem; }
.fv-title-group { display: flex; align-items: baseline; gap: 0.4rem; flex: 1; }
.fv-name {
  font-size: 1rem;
  font-weight: 400;
  color: var(--fg);
}
.fv-scale {
  font-size: 0.65rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fv-status {
  font-size: 0.55rem;
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'SF Mono', monospace;
}
.fv-status-live {
  background: rgba(126, 200, 160, 0.15);
  color: var(--leaf-green);
  border: 1px solid rgba(126, 200, 160, 0.3);
}
.fv-status-built {
  background: rgba(90, 184, 160, 0.1);
  color: var(--teal);
  border: 1px solid rgba(90, 184, 160, 0.2);
}
.fv-status-constitutional {
  background: rgba(232, 197, 71, 0.08);
  color: var(--amber);
  border: 1px solid rgba(232, 197, 71, 0.2);
}
.fv-substrate {
  font-size: 0.7rem;
  color: var(--fg-dim);
  font-family: 'SF Mono', monospace;
  margin-bottom: 0.3rem;
}
.fv-desc {
  font-size: 0.78rem;
  color: var(--fg-dim);
  line-height: 1.5;
  margin-bottom: 0.3rem;
}
.fv-detail {
  font-size: 0.7rem;
  color: var(--fg-muted);
  line-height: 1.4;
  margin-bottom: 0.3rem;
}
.fv-crate {
  font-size: 0.6rem;
  font-family: 'SF Mono', monospace;
}
.fv-crate-label { color: var(--fg-muted); }
.fv-crate-path { color: var(--teal); }
.fv-connector {
  text-align: center;
  color: rgba(126, 200, 160, 0.3);
  font-size: 0.8rem;
  padding: 0.1rem 0;
}

/* Consciousness tiers */
.tier-list { display: flex; flex-direction: column; gap: 0.3rem; }
.tier-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.tier-row:hover { background: rgba(255, 255, 255, 0.04); }
.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tier-name {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--fg);
  width: 5.5rem;
}
.tier-threshold {
  font-size: 0.7rem;
  font-family: 'SF Mono', monospace;
  color: var(--fg-dim);
  width: 3.5rem;
}
.tier-weight {
  font-size: 0.7rem;
  font-family: 'SF Mono', monospace;
  color: var(--leaf-green);
  width: 2.5rem;
  text-align: right;
}
.tier-desc {
  font-size: 0.7rem;
  color: var(--fg-muted);
  flex: 1;
}

.inoc-section { margin-bottom: 1.5rem; }
.inoc-section h3 {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 1rem;
}

/* Probe grid */
.probe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.probe-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 1rem;
}
.probe-item .pi-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.probe-item .pi-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  color: var(--fg);
}
.probe-item .pi-note {
  font-size: 0.55rem;
  color: var(--fg-muted);
  opacity: 0.7;
  margin-top: 0.2rem;
  line-height: 1.4;
}
.probe-loading {
  text-align: center;
  padding: 2rem;
  color: var(--fg-muted);
  font-size: 0.8rem;
}
.probe-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.thinking-bar {
  max-width: 200px;
  margin: 0.8rem auto 0;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}
.thinking-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--leaf-green), var(--solar-gold));
  border-radius: 2px;
  width: 60%;
  animation: probeProgress 2s ease-in-out infinite;
}
@keyframes probeProgress {
  0% { width: 10%; transform: translateX(0); }
  50% { width: 60%; }
  100% { width: 10%; transform: translateX(300%); }
}

.probe-recommendation {
  background: rgba(90, 184, 160, 0.05);
  border: 1px solid rgba(90, 184, 160, 0.15);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  animation: recPulse 4s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { border-color: rgba(90, 184, 160, 0.15); }
  50% { border-color: rgba(90, 184, 160, 0.35); box-shadow: 0 0 12px rgba(90, 184, 160, 0.08); }
}
.probe-recommendation h3 {
  font-size: 0.7rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
}
.probe-rec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.8rem;
}
.probe-rec-item .rec-key { color: var(--fg-dim); }
.probe-rec-item .rec-val {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--leaf-green);
  font-size: 0.75rem;
}

.nix-config-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.6rem 0;
  font-size: 0.75rem;
  color: var(--fg-dim);
  border: none;
  background: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: color 0.2s;
}
.nix-config-toggle:hover { color: var(--fg); }
.nix-config-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.nix-config-toggle .arrow { transition: transform 0.2s; font-size: 0.6rem; }
.nix-config-toggle.open .arrow { transform: rotate(90deg); }
.nix-config-body {
  display: none;
  background: var(--moss-deeper);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
  overflow-x: auto;
}
.nix-config-body.open { display: block; }
.nix-config-body pre {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre;
  margin: 0;
}
.nix-config-body .nix-comment { color: var(--leaf-green); opacity: 0.7; }
.nix-config-body .nix-value { color: var(--solar-gold); }
.nix-config-body .nix-key { color: var(--teal); }
.nix-config-body .nix-brace { color: var(--fg-dim); }

/* Choice cards */
.choice-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.choice-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.choice-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  border-radius: 1px;
}
.choice-card.inoculate::before { background: linear-gradient(90deg, transparent, var(--leaf-green), transparent); }
.choice-card.attune::before { background: linear-gradient(90deg, transparent, var(--solar-gold), transparent); }
.choice-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(126, 200, 160, 0.12);
}
.choice-card.attune:hover { box-shadow: 0 8px 32px rgba(232, 197, 71, 0.12); }

.card-icon { font-size: 1.2rem; color: var(--teal); margin-bottom: 0.8rem; }
.sovereign-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--leaf-green);
  background: rgba(126, 200, 160, 0.08);
  border: 1px solid rgba(126, 200, 160, 0.2);
  margin-left: 0.5rem;
  vertical-align: middle;
  font-style: normal;
  font-weight: 400;
}
.card-icon .connector { color: var(--fg-muted); font-size: 0.8rem; }
.card-title { font-size: 1.15rem; font-weight: 400; margin-bottom: 0.2rem; color: var(--fg); }
.card-role {
  font-size: 0.7rem; font-weight: 300; color: var(--lichen-grey);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.8rem;
}
.card-desc { font-size: 0.82rem; line-height: 1.6; color: var(--fg-dim); margin-bottom: 1rem; }
.card-glyph {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic; font-size: 0.78rem;
  color: rgba(232, 197, 71, 0.7);
  line-height: 1.5; padding: 0.6rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 1rem;
}
.card-glyph .glyph-id {
  font-style: normal;
  font-family: 'SF Mono', monospace;
  font-size: 0.6rem;
  color: var(--fg-muted);
  opacity: 0.6;
}

/* Next steps */
.step-option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 0.8rem;
  transition: border-color 0.2s;
}
.step-option:hover { border-color: var(--glass-border); }
.step-icon { font-size: 1.2rem; color: var(--teal); flex-shrink: 0; width: 2rem; text-align: center; }
.step-content h3 { font-size: 0.85rem; font-weight: 400; color: var(--fg); margin-bottom: 0.3rem; }
.step-content p { font-size: 0.75rem; color: var(--fg-dim); line-height: 1.5; }
.step-glyph {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic; font-size: 0.7rem;
  color: rgba(232, 197, 71, 0.5);
  margin-top: 0.4rem;
}
.step-unavailable { opacity: 0.4; }
.step-unavailable .step-content h3::after {
  content: ' (not available in this browser)';
  font-size: 0.65rem; color: var(--autumn-rust); font-weight: 300;
}

/* Boot glyph sequence */
.boot-glyphs {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 0;
}
.boot-glyph-item {
  text-align: center;
  width: 80px;
}
.boot-glyph-item .bg-phase {
  font-size: 0.55rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.boot-glyph-item .bg-id {
  font-family: 'SF Mono', monospace;
  font-size: 0.65rem;
  color: var(--leaf-green);
}
.boot-glyph-item .bg-echo {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.6rem;
  color: rgba(232, 197, 71, 0.5);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* ===================================================================
   WASM Fallback
   =================================================================== */
.wasm-fallback {
  display: none;
  text-align: center;
  padding: 1rem;
  font-size: 0.7rem;
  color: var(--fg-muted);
  border: 1px solid rgba(199, 107, 90, 0.2);
  background: rgba(199, 107, 90, 0.05);
  border-radius: 8px;
  margin-top: 1rem;
}
.wasm-fallback.visible { display: block; }

/* ===================================================================
   Narration Stream (bottom overlay)
   =================================================================== */
.narration-stream {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(transparent, rgba(15, 29, 20, 0.95) 30%);
  padding: 3rem 1.5rem 1.2rem;
  max-height: 20vh;
  overflow-y: auto;
  display: none;
  pointer-events: none;
  scroll-behavior: smooth;
}
.narration-stream.visible { display: block; }
.narration-stream .narration-inner { max-width: 600px; margin: 0 auto; }
.narration-line {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  color: var(--fg-dim);
  line-height: 1.7;
  padding: 0.15rem 0;
  opacity: 0;
  animation: narration-fade 0.5s ease forwards;
}
.narration-line.glyph-echo {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 0.82rem;
  color: rgba(232, 197, 71, 0.7);
  opacity: 0;
  animation: narration-fade 0.8s ease forwards;
}
@keyframes narration-fade { to { opacity: 1; } }

/* ===================================================================
   Footer
   =================================================================== */
.portal-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  color: var(--lichen-grey);
  line-height: 1.8;
  border-top: 1px solid var(--glass-border);
  margin-top: 2rem;
}
.footer-glyph {
  font-family: Georgia, serif;
  font-style: italic;
  margin-top: 0.5rem;
  color: rgba(232, 197, 71, 0.4);
  font-size: 0.75rem;
}

/* ===================================================================
   Screen reader only
   =================================================================== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 768px) {
  .hero-title { font-size: 1.8rem; }
  .hero-title-row { flex-wrap: wrap; justify-content: center; }
  .soma-layout { grid-template-columns: 1fr; }
  .experiment-grid { grid-template-columns: 1fr; }
  .topo-bottom { grid-template-columns: 1fr; }
  .dream-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .fep-display { grid-template-columns: 1fr; }
  .choice-cards { grid-template-columns: 1fr; }
  .probe-grid { grid-template-columns: 1fr; }
  .tab { font-size: 0.72rem; padding: 0 0.7rem; }
  .narration-stream { max-height: 20vh; padding: 2rem 1rem 1rem; }
  .tier-row { flex-wrap: wrap; gap: 0.3rem; }
  .tier-name { width: auto; }
  .tier-threshold { width: auto; }
  .tier-weight { width: auto; text-align: left; }
  .fractal-variant { padding: 0.8rem; }
  .fv-header { flex-wrap: wrap; }
  .dream-controls { flex-direction: column; align-items: stretch; }
  .ws-contents .neuro-bar-row .nb-label { width: 3.5rem; }
  .mode-cards { flex-direction: column; align-items: center; }
  .mode-card { width: 100%; max-width: 300px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem; letter-spacing: 0.08em; }
  .tab-content { padding: 1rem; }
  .tab { font-size: 0.65rem; padding: 0 0.5rem; }
  .dream-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===================================================================
   Reduced motion
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; opacity: 0.4; }
  .online-dot { animation: none; opacity: 1; }
  .chat-message { animation: none; opacity: 1; }
  .narration-line, .narration-line.glyph-echo { animation: none; opacity: 1; }
  body { animation: none; }
  .probe-recommendation { animation: none; }
  .thinking-fill { animation: none; width: 50%; }
  .thinking-result .thinking-generating { animation: none; }
}

/* ===================================================================
   Help Expanders (inline explanations for non-technical users)
   =================================================================== */
.help-expander {
  margin-top: 0.3rem;
}
.help-toggle {
  font-size: 0.75rem;
  color: var(--teal);
  cursor: pointer;
  list-style: none;
}
.help-toggle::-webkit-details-marker { display: none; }
.help-toggle::before {
  content: "\25B8 ";
}
details[open] .help-toggle::before {
  content: "\25BE ";
}
.help-text {
  font-size: 0.78rem;
  color: var(--fg-dim);
  line-height: 1.5;
  padding: 0.4rem 0 0.2rem 0.8rem;
  border-left: 2px solid var(--glass-border);
  margin-top: 0.3rem;
}
.help-text strong {
  color: var(--autumn-rust);
}
.nixos-intro {
  text-align: center;
  margin-top: 0.5rem;
}
.nixos-intro .help-text {
  text-align: left;
  max-width: 600px;
  margin: 0.5rem auto;
  border-left: none;
  padding-left: 0;
}

/* ===================================================================
   Remote Install — First-boot guide & Resume banner
   =================================================================== */
.first-boot-guide {
  margin-top: 1.5rem;
  text-align: left;
}
.first-boot-guide h4 {
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 0.8rem;
}
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.guide-step {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}
.guide-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(90, 184, 160, 0.15);
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
}
.guide-step strong {
  display: block;
  color: var(--fg);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.guide-step p {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin: 0.15rem 0;
  display: inline;
}
.guide-step code {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--teal);
  margin: 0.3rem 0;
  font-family: monospace;
}

.resume-banner {
  padding: 0.8rem 1rem;
  background: rgba(232, 197, 71, 0.08);
  border: 1px solid rgba(232, 197, 71, 0.2);
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.resume-banner p {
  font-size: 0.85rem;
  color: var(--solar-gold);
}

/* ===================================================================
   Remote Install — Backup, Migration & OS Detection (Tier 1)
   =================================================================== */
.backup-section, .migration-section, .os-detection {
  margin: 1rem 0;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}
.backup-section h4, .migration-section h4, .os-detection h4 {
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.success-msg {
  color: var(--leaf-green);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ===================================================================
   USB Creator (NixForHumanity Tauri app)
   =================================================================== */
.usb-creator {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  position: relative;
  z-index: 1;
}

.usb-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}
.usb-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--leaf-green);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.usb-sub {
  font-size: 1rem;
  color: var(--fg-dim);
  font-weight: 400;
}

/* Sections — glass panel style */
.usb-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
}
.usb-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}
.usb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.usb-section-header h2 { margin-bottom: 0; }
.section-desc {
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Device list */
.usb-device-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.usb-no-devices {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: center;
  padding: 1.5rem 0;
}

/* Device radio cards */
.usb-device {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.usb-device:hover {
  background: rgba(255, 255, 255, 0.06);
}
.usb-device-selected {
  border-color: var(--teal);
  background: var(--teal-glow);
}
.usb-device-small {
  opacity: 0.5;
  cursor: not-allowed;
}
.usb-device input[type="radio"] {
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.usb-device-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}
.usb-device-name {
  font-size: 0.9rem;
  color: var(--fg);
  font-weight: 500;
}
.usb-device-size {
  font-size: 0.75rem;
  color: var(--fg-dim);
}
.usb-device-warn {
  font-size: 0.75rem;
  color: var(--autumn-rust);
  white-space: nowrap;
}

/* Refresh button */
.usb-refresh-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.usb-refresh-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
}
.usb-refresh-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Optional badge */
.optional-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

/* Scan button + status */
.usb-scan-btn {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--teal-dim);
  background: rgba(90, 184, 160, 0.1);
  color: var(--teal);
  cursor: pointer;
  transition: background 0.2s;
}
.usb-scan-btn:hover:not(:disabled) {
  background: rgba(90, 184, 160, 0.2);
}
.usb-scan-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.usb-scan-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
  padding: 0.5rem 0;
}
.usb-scan-result {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.usb-scan-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--leaf-green);
}
.usb-scan-summary {
  font-size: 0.8rem;
  color: var(--fg-dim);
  flex: 1;
}

/* Spinner */
.usb-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: usbSpin 0.8s linear infinite;
}
@keyframes usbSpin {
  to { transform: rotate(360deg); }
}

/* Flash button */
.usb-flash-btn {
  display: block;
  width: 100%;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--teal), var(--leaf-green));
  color: var(--moss-deeper);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}
.usb-flash-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}
.usb-flash-btn:active:not(:disabled) {
  transform: translateY(0);
}
.usb-flash-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.usb-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--fg);
  font-size: 0.85rem;
  width: auto;
  display: inline-block;
  margin-top: 1rem;
}
.usb-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.usb-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-align: center;
  margin-top: 0.6rem;
}

/* Progress bars */
.usb-progress-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.usb-progress-label {
  font-size: 0.85rem;
  color: var(--fg);
}
.usb-progress-pct {
  font-size: 0.75rem;
  color: var(--fg-dim);
  text-align: right;
}
.progress-download,
.progress-flash {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-download .progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--leaf-green));
  transition: width 0.3s ease;
}
.progress-flash .progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--solar-gold), var(--clay));
  transition: width 0.3s ease;
}
.progress-fill-pulse {
  animation: progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Success / Complete */
.usb-complete {
  text-align: center;
  padding: 1rem 0;
}
.usb-complete h3 {
  font-size: 1.3rem;
  color: var(--leaf-green);
  margin-bottom: 1rem;
}
.next-steps {
  background: rgba(126, 200, 160, 0.08);
  border: 1px solid rgba(126, 200, 160, 0.2);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  text-align: left;
}
.next-steps p {
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.8;
}
.next-steps a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}
.next-steps a:hover {
  text-decoration: underline;
}

/* Error */
.usb-error {
  text-align: center;
  padding: 1rem 0;
}
.usb-error h3 {
  font-size: 1.1rem;
  color: var(--autumn-rust);
  margin-bottom: 0.5rem;
}
.usb-error-msg {
  font-size: 0.85rem;
  color: var(--fg-dim);
  background: rgba(199, 107, 90, 0.08);
  border: 1px solid rgba(199, 107, 90, 0.2);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ===================================================================
   NixOS Management Page
   =================================================================== */
.manage-page { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.manage-hero { text-align: center; padding: 2rem 0 1.5rem; }
.manage-hero h1 { font-size: 2.4rem; font-weight: 200; color: var(--fg); }
.manage-sub { font-size: 1rem; color: var(--teal); font-weight: 300; }
.manage-connect { padding: 1.5rem; margin-bottom: 1.5rem; }
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.manage-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--glass-border); margin-bottom: 1.5rem; }
.manage-tab {
  background: none; border: none; color: var(--fg-dim); font-size: 0.9rem;
  padding: 0.6rem 1.2rem; cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.manage-tab:hover { color: var(--fg); }
.manage-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.manage-panel { margin-bottom: 1.5rem; }
.manage-panel h3 { font-size: 1.1rem; font-weight: 400; color: var(--fg); margin-bottom: 0.3rem; }
.manage-actions { display: flex; gap: 0.6rem; margin: 0.8rem 0; flex-wrap: wrap; }
.manage-output {
  background: rgba(0, 0, 0, 0.3); padding: 0.8rem; border-radius: 6px;
  font-size: 0.78rem; font-family: 'JetBrains Mono', monospace; color: var(--fg-dim);
  max-height: 400px; overflow-y: auto; white-space: pre-wrap; line-height: 1.5;
  border: 1px solid var(--glass-border);
}
.action-status { font-size: 0.85rem; color: var(--teal); padding: 0.4rem 0; }
.config-editor {
  width: 100%; min-height: 400px; background: rgba(0, 0, 0, 0.35);
  color: var(--fg); border: 1px solid var(--glass-border); border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; padding: 0.8rem;
  resize: vertical; line-height: 1.6;
}
.config-editor:focus { outline: none; border-color: var(--teal); }
.rebuild-log { margin-top: 0.8rem; }
.rebuild-log summary { font-size: 0.82rem; color: var(--fg-muted); cursor: pointer; }
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}
.inventory-card {
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
}
.inventory-label { font-size: 0.72rem; color: var(--fg-muted); text-transform: uppercase; }
.inventory-value { font-size: 1rem; color: var(--fg); margin-top: 0.2rem; }

/* ===================================================================
   Installer: Profiles & Presets (Tier 2)
   =================================================================== */
.btn-sm { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
.profile-list { margin-top: 0.5rem; }
.profile-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}
.profile-item:last-child { border-bottom: none; }
.preset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem; margin-top: 0.5rem;
}
.preset-grid .desktop-card {
  cursor: pointer; text-align: left; background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: 8px; padding: 0.8rem;
  transition: border-color 0.2s, background 0.2s;
}
.preset-grid .desktop-card:hover {
  border-color: var(--teal); background: var(--teal-glow);
}

/* ===================================================================
   Accessibility
   =================================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
  :root {
    --glass-bg: rgba(0, 0, 0, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --fg-dim: #a0b0a0;
    --fg-muted: #8a9c8a;
  }
  .desktop-card, .app-card, .field-input, .app-search {
    border-width: 2px;
  }
}

/* ===================================================================
   Mode Selection (Express / Custom)
   =================================================================== */
.mode-select { text-align: center; padding: 3rem 0; }
.mode-select h2 { font-size: 1.8rem; font-weight: 200; color: var(--fg); margin-bottom: 2rem; }
.mode-cards { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.mode-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  padding: 2rem 2.5rem; background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
  border-radius: 16px; cursor: pointer; transition: all 0.2s; min-width: 220px;
  color: var(--fg);
}
.mode-card:hover { border-color: var(--teal); background: rgba(90,184,160,0.06); transform: translateY(-2px); }
.mode-icon { font-size: 2.5rem; }
.mode-title { font-size: 1.3rem; font-weight: 600; color: var(--fg); }
.mode-desc { font-size: 0.82rem; color: var(--fg-dim); text-align: center; max-width: 200px; }

/* ===================================================================
   Express Mode — larger preset cards
   =================================================================== */
.preset-grid-express {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.preset-grid-express .desktop-card {
  text-align: center;
  padding: 1.2rem 0.8rem;
}
.preset-emoji {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

/* ===================================================================
   Advanced Sections (collapsible)
   =================================================================== */
.advanced-section { margin-top: 0.8rem; }
.advanced-toggle {
  font-size: 0.88rem; color: var(--fg-dim); cursor: pointer; padding: 0.5rem 0;
  list-style: none;
}
.advanced-toggle::-webkit-details-marker { display: none; }
.advanced-toggle::before { content: "\25B8 "; }
details[open] > .advanced-toggle::before { content: "\25BE "; }

/* ===================================================================
   Config Summary (human-readable review)
   =================================================================== */
.config-summary { margin-bottom: 1.5rem; }
.config-summary h4 { font-size: 1rem; color: var(--fg); margin-bottom: 0.6rem; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; }
.summary-item { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.5rem; background: rgba(0,0,0,0.15); border-radius: 6px; }
.summary-label { font-size: 0.72rem; color: var(--fg-muted); text-transform: uppercase; }
.summary-value { font-size: 0.9rem; color: var(--fg); }

/* ===================================================================
   App Category Tabs
   =================================================================== */
.app-categories { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.category-tab {
  background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); border-radius: 20px;
  padding: 0.3rem 0.8rem; font-size: 0.78rem; color: var(--fg-dim); cursor: pointer;
  transition: all 0.15s;
}
.category-tab:hover { border-color: var(--teal-dim); }
.category-tab.active { background: rgba(90,184,160,0.15); border-color: var(--teal); color: var(--teal); }

/* ===================================================================
   Language Picker (i18n)
   =================================================================== */
.lang-picker {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
  z-index: 10;
}
.lang-picker:focus { outline: none; border-color: var(--teal); }

/* ===================================================================
   RTL Support (Arabic, Hebrew, etc.)
   =================================================================== */
[dir="rtl"] .wizard-nav { flex-direction: row-reverse; }
[dir="rtl"] .basics-grid { direction: rtl; }
[dir="rtl"] .field-input { text-align: right; }
[dir="rtl"] .wizard-buttons { flex-direction: row-reverse; }
[dir="rtl"] .desktop-card-body { text-align: right; }
[dir="rtl"] .app-nix { flex-direction: row-reverse; }
[dir="rtl"] .install-hero { direction: rtl; }
[dir="rtl"] .lang-picker { right: auto; left: 1.5rem; }

/* ===================================================================
   NixForHumanity — NixOS Installer Styles
   =================================================================== */

.install-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.install-hero {
  text-align: center;
  padding: 3rem 0 2rem;
  position: relative;
}

.install-title {
  font-size: 2.8rem;
  font-weight: 200;
  letter-spacing: 0.03em;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.install-sub {
  font-size: 1.05rem;
  color: var(--teal);
  font-weight: 300;
}

.install-section {
  margin-bottom: 1.5rem;
}

.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}
.hw-item { display: flex; flex-direction: column; gap: 0.2rem; }
.hw-label { font-size: 0.75rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.hw-value { font-size: 0.92rem; color: var(--fg); }

.basics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field-label { font-size: 0.78rem; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.field-input {
  padding: 0.55rem 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--fg);
  font-size: 0.92rem;
}
.field-input:focus { outline: none; border-color: var(--teal); }
.field-hint { font-size: 0.72rem; color: var(--fg-muted); }

.desktop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.desktop-card {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.desktop-card:hover { border-color: var(--teal-dim); background: rgba(90, 184, 160, 0.04); }
.desktop-card-selected { border-color: var(--teal); background: rgba(90, 184, 160, 0.1); }
.desktop-card input[type="radio"] { display: none; }
.desktop-name { font-weight: 600; font-size: 0.95rem; color: var(--fg); }
.desktop-card-selected .desktop-name { color: var(--teal); }
.desktop-desc { font-size: 0.78rem; color: var(--fg-dim); }
.desktop-preview { font-size: 0.72rem; color: var(--fg-muted); line-height: 1.4; margin-top: 0.2rem; }

.security-options { display: flex; flex-direction: column; gap: 0.8rem; }
.security-option {
  display: flex; gap: 0.7rem; align-items: flex-start;
  font-size: 0.9rem; color: var(--fg); cursor: pointer;
}
.security-option input[type="checkbox"] { margin-top: 0.25rem; accent-color: var(--teal); flex-shrink: 0; }
.security-option div { display: flex; flex-direction: column; gap: 0.15rem; }
.security-note { font-size: 0.75rem; color: var(--fg-muted); line-height: 1.3; }

.app-search {
  width: 100%; padding: 0.55rem 0.8rem;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--glass-border);
  border-radius: 6px; color: var(--fg); font-size: 0.88rem; margin-bottom: 0.8rem;
}
.app-search:focus { outline: none; border-color: var(--teal); }
.app-search::placeholder { color: var(--fg-muted); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem; margin-bottom: 1rem;
}
.app-card {
  display: flex; flex-direction: column;
  padding: 0.7rem 0.8rem;
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border);
  border-radius: 8px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; gap: 0.4rem;
}
.app-card:hover { border-color: var(--teal-dim); background: rgba(90, 184, 160, 0.04); }
.app-card-checked { border-color: var(--teal); background: rgba(90, 184, 160, 0.08); }
.app-card input[type="checkbox"] { display: none; }
.app-card-body { display: flex; gap: 0.6rem; align-items: center; }
.app-emoji { font-size: 1.4rem; width: 2rem; text-align: center; flex-shrink: 0; }
.app-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.app-name { font-size: 0.88rem; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-status { font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 10px; display: inline-block; width: fit-content; }
.app-nix { display: flex; gap: 0.4rem; align-items: center; font-size: 0.78rem; padding-left: 2.6rem; color: var(--fg-dim); }
.app-nix-name { color: var(--teal); font-family: monospace; }

.selected-summary { text-align: center; font-size: 0.88rem; color: var(--teal); padding: 0.5rem; }
.scan-bar { display: flex; align-items: center; gap: 0.8rem; justify-content: center; margin: 0.8rem 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--da-blue));
  color: #0f1d14; border: none; padding: 0.65rem 1.8rem;
  border-radius: 8px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

.btn-secondary {
  background: transparent; color: var(--fg-dim);
  border: 1px solid var(--glass-border); padding: 0.65rem 1.8rem;
  border-radius: 8px; font-size: 0.92rem; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--fg-dim); }
.btn-secondary.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

.btn-danger {
  background: linear-gradient(135deg, var(--autumn-rust), #c44);
  color: #fff; border: none; padding: 0.7rem 2rem;
  border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}

.config-buttons { display: flex; gap: 0.8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.config-warnings { margin: 0.8rem 0; padding: 0.6rem 0.8rem; background: rgba(232, 197, 71, 0.08); border: 1px solid rgba(232, 197, 71, 0.2); border-radius: 6px; }
.warning-msg { font-size: 0.82rem; color: var(--solar-gold); margin-bottom: 0.3rem; }
.error-msg { margin-top: 0.5rem; padding: 0.5rem 0.8rem; background: rgba(199, 107, 90, 0.1); border: 1px solid rgba(199, 107, 90, 0.3); border-radius: 6px; color: var(--autumn-rust); font-size: 0.85rem; }
.validation-errors { margin: 0.5rem 0; }

.config-code {
  background: rgba(0, 0, 0, 0.35); padding: 1rem; border-radius: 6px;
  font-size: 0.78rem; overflow-x: auto; max-height: 400px; overflow-y: auto;
  font-family: monospace; border: 1px solid var(--glass-border); white-space: pre; line-height: 1.6;
}

.wizard-nav {
  display: flex; justify-content: center; gap: 1.5rem;
  padding: 1rem 0 1.5rem; position: sticky; top: 0; z-index: 50;
  background: rgba(26, 46, 34, 0.9); backdrop-filter: blur(10px);
  margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem;
}
.wizard-step {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  background: none; border: none; cursor: default; opacity: 0.4; transition: opacity 0.2s; padding: 0;
}
.wizard-step-active { opacity: 1; }
.wizard-step-done { opacity: 0.65; cursor: pointer; }
.wizard-step-done:hover { opacity: 0.85; }
.wizard-step-num {
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid var(--glass-border); font-size: 0.82rem; color: var(--fg-dim);
}
.wizard-step-active .wizard-step-num { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 8px rgba(90, 184, 160, 0.3); }
.wizard-step-done .wizard-step-num { border-color: var(--teal-dim); color: var(--teal); }
.wizard-step-label { font-size: 0.72rem; color: var(--fg-dim); white-space: nowrap; }
.wizard-step-active .wizard-step-label { color: var(--teal); }
.wizard-buttons { display: flex; justify-content: space-between; margin-top: 1.5rem; padding-top: 1rem; }

.connect-form { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.8rem; }
.connect-form .field { flex: 1; min-width: 150px; }

.spinner { width: 1.2rem; height: 1.2rem; border: 2px solid var(--glass-border); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.progress-stage { font-size: 0.92rem; color: var(--fg); }
.progress-pct { font-size: 0.92rem; color: var(--teal); font-weight: 600; }
.progress-bar-outer { width: 100%; height: 8px; background: rgba(0, 0, 0, 0.3); border-radius: 4px; overflow: hidden; }
.progress-bar-inner { height: 100%; background: linear-gradient(90deg, var(--teal), var(--leaf-green)); border-radius: 4px; transition: width 0.5s ease; }

.auto-detect-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; background: rgba(90, 184, 160, 0.06);
  border: 1px solid rgba(90, 184, 160, 0.15); border-radius: 8px;
  margin-bottom: 1rem; font-size: 0.85rem; color: var(--teal);
}

.install-footer {
  text-align: center; padding: 2rem 0; font-size: 0.78rem;
  color: var(--fg-muted); border-top: 1px solid var(--glass-border); margin-top: 2rem;
}
.install-footer a { color: var(--fg-dim); text-decoration: none; }
.install-footer a:hover { color: var(--teal); }

/* ── Partition Editor ── */
.partition-editor { margin: 0.4rem 0 0.2rem; }
.partition-disk-label {
  font-size: 0.82rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}
.partition-bar {
  display: flex;
  height: 2.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}
.partition-segment {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 2rem;
  padding: 0 0.3rem;
  overflow: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  cursor: default;
  transition: opacity 0.15s;
}
.partition-segment:hover { opacity: 0.85; }
.partition-segment:last-child { border-right: none; }
.partition-seg-label {
  font-size: 0.65rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.partition-seg-size {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}
.partition-free {
  background: rgba(126, 200, 160, 0.3) !important;
  border: 1px dashed rgba(126, 200, 160, 0.5);
}
.partition-legend {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.partition-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--fg-dim);
}
.partition-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Disk option (with partition bar) */
.disk-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.5rem 0;
}
.disk-option {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.disk-option:hover { background: rgba(255, 255, 255, 0.06); }
.disk-option.disk-selected {
  border-color: var(--teal);
  background: var(--teal-glow);
}
.disk-option.disk-selected .partition-bar {
  border-color: var(--teal);
  box-shadow: 0 0 6px rgba(90, 184, 160, 0.2);
}
.disk-option-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.disk-option-header input[type="radio"] {
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.disk-option-label {
  font-size: 0.88rem;
  color: var(--fg);
  font-weight: 500;
}

/* Nixpkgs package search */
.nixpkg-search { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); }
.nixpkg-search h4 { font-size: 0.95rem; color: var(--fg); margin-bottom: 0.3rem; }
.nix-search-results { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; max-height: 300px; overflow-y: auto; }
.nix-search-result { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem; background: rgba(0,0,0,0.15); border-radius: 6px; font-size: 0.82rem; }
.nix-search-result:hover { background: rgba(0,0,0,0.25); }
.nix-search-info { display: flex; align-items: baseline; gap: 0.4rem; min-width: 0; overflow: hidden; }
.nix-search-name { color: var(--teal); font-family: monospace; white-space: nowrap; }
.nix-search-alias { color: var(--fg-dim, #888); font-size: 0.75rem; white-space: nowrap; }
.nix-search-count { font-size: 0.78rem; color: var(--fg-dim, #888); margin: 0.3rem 0 0; }
.nix-search-desc { color: var(--fg-dim, #888); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

/* Installer Mobile */
@media (max-width: 768px) {
  .install-title { font-size: 2rem; }
  .hw-grid { grid-template-columns: 1fr; }
  .basics-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .desktop-grid { grid-template-columns: 1fr; }
  .config-buttons { flex-direction: column; }
  .wizard-nav { gap: 0.8rem; }
  .wizard-step-num { width: 1.6rem; height: 1.6rem; font-size: 0.72rem; }
  .wizard-step-label { font-size: 0.62rem; }
  .connect-form { flex-direction: column; }
  .mode-cards { flex-direction: column; align-items: center; }
  .mode-card { width: 100%; max-width: 300px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .partition-bar { height: 2rem; }
  .partition-seg-label { font-size: 0.55rem; }
  .partition-seg-size { display: none; }
  .partition-legend { gap: 0.5rem; }
  .partition-legend-item { font-size: 0.65rem; }
}

@media (max-width: 480px) {
  .install-page { padding: 0 1rem 2rem; }
  .install-title { font-size: 1.6rem; }
  .wizard-step-label { display: none; }
}

@media (pointer: coarse) {
  .btn-primary, .btn-secondary, .field-input, .app-search, .security-option input { min-height: 44px; }
}
