/* AETHER — design system for the AI app studio.
 *
 * Codename: Aether. Identity: midnight + electric violet + cyan accent.
 * Replaces the prior gold/Cinzel cinematic theme with something that feels
 * like a living AI lab — glass surfaces, soft neon, type-on motion.
 *
 * One file, scoped via :root tokens + .ae-* classes. Drop-in via
 *     <link rel="stylesheet" href="/static/aether.css">
 */

/* ───────── tokens ───────── */
:root {
  --ae-abyss: #050613;
  --ae-bg: #0a0d1c;
  --ae-surface: rgba(255,255,255,0.03);
  --ae-surface-2: rgba(255,255,255,0.05);
  --ae-surface-3: rgba(255,255,255,0.08);
  --ae-stroke: rgba(255,255,255,0.08);
  --ae-stroke-strong: rgba(124,92,255,0.32);
  --ae-violet: #7c5cff;
  --ae-violet-glow: rgba(124,92,255,0.35);
  --ae-violet-soft: rgba(124,92,255,0.12);
  --ae-cyan: #3affd4;
  --ae-cyan-glow: rgba(58,255,212,0.35);
  --ae-amber: #ffba3a;
  --ae-text: #f1ecde;
  --ae-text-2: #c5c2b6;
  --ae-text-dim: #7a7e8a;
  --ae-radius: 16px;
  --ae-radius-sm: 10px;
  --ae-radius-xl: 24px;
  --ae-grad: linear-gradient(135deg,#7c5cff 0%,#3affd4 110%);
  --ae-grad-soft: linear-gradient(135deg,rgba(124,92,255,0.18),rgba(58,255,212,0.10));
  --ae-shadow: 0 30px 80px -30px rgba(124,92,255,0.45),
               0 8px 24px -8px rgba(0,0,0,0.5);
}

/* ───────── reset + base ───────── */
*,*::before,*::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--ae-abyss);
  color: var(--ae-text);
  font-family: 'Geist','Inter',ui-sans-serif,system-ui,sans-serif;
  font-size: 15px; line-height: 1.55;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
body.ae {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(124,92,255,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(58,255,212,0.10) 0%, transparent 50%),
    var(--ae-abyss);
  background-attachment: fixed;
}
.mono { font-family: 'JetBrains Mono','SF Mono',Menlo,monospace; font-feature-settings: 'ss01' 1; }
::selection { background: var(--ae-violet); color: var(--ae-abyss); }

/* film-grain noise overlay — adds the analog cinematic feel */
body.ae::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.6; mix-blend-mode: overlay;
}
body.ae > * { position: relative; z-index: 1; }

/* ───────── nav ───────── */
.ae-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.6rem;
  background: rgba(5,6,19,0.6); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ae-stroke);
}
.ae-brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ae-text);
  text-decoration: none;
}
.ae-brand-glyph {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--ae-grad);
  box-shadow: 0 0 24px var(--ae-violet-glow);
  display: inline-block;
}
.ae-nav-links { display: flex; align-items: center; gap: 1.2rem; }
.ae-nav-link {
  color: var(--ae-text-dim); font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; transition: color 0.18s;
}
.ae-nav-link:hover { color: var(--ae-text); }
.ae-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.32rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--ae-stroke);
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ae-text-2); background: var(--ae-surface);
}
.ae-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ae-cyan); box-shadow: 0 0 8px var(--ae-cyan-glow);
  animation: ae-pulse 2.4s infinite;
}
@keyframes ae-pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ───────── hero / prompt ───────── */
.ae-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 5rem 1.5rem 2rem;
  text-align: center;
}
.ae-eyebrow {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.7rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ae-cyan); margin-bottom: 1.4rem;
  text-shadow: 0 0 14px var(--ae-cyan-glow);
}
.ae-h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 0%, #c8c2ff 60%, #7c5cff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 0.6rem 0;
  max-width: 680px;
}
.ae-h1 .ae-cursor {
  display: inline-block; width: 0.55ch; height: 1em; vertical-align: -0.12em;
  background: var(--ae-cyan); margin-left: 0.06em;
  animation: ae-blink 1s steps(1) infinite;
  -webkit-text-fill-color: var(--ae-cyan);
}
@keyframes ae-blink { 50% { opacity: 0; } }
.ae-sub {
  color: var(--ae-text-dim); font-size: 0.95rem;
  max-width: 520px; margin: 0 auto;
}

/* prompt card */
.ae-prompt-card {
  margin: 2.4rem auto 0;
  width: min(100%, 720px);
  background: var(--ae-surface-2);
  border: 1px solid var(--ae-stroke);
  border-radius: var(--ae-radius-xl);
  padding: 1.1rem;
  box-shadow: var(--ae-shadow);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.ae-prompt-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px; background: var(--ae-grad);
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.5; pointer-events: none;
}
.ae-prompt-input {
  width: 100%; min-height: 5.4rem; resize: vertical;
  background: transparent; border: 0; outline: 0;
  color: var(--ae-text); font: inherit; font-size: 1.02rem; line-height: 1.5;
  padding: 0.7rem 0.8rem;
}
.ae-prompt-input::placeholder { color: var(--ae-text-dim); }
.ae-prompt-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; margin-top: 0.6rem; padding: 0 0.4rem;
}
.ae-prompt-meta {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--ae-text-dim); font-size: 0.75rem;
}
.ae-prompt-color {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--ae-stroke);
  background-color: #6750A4; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  padding: 0; outline: 0;
}
.ae-prompt-color::-webkit-color-swatch-wrapper { padding: 0; border-radius: 6px; }
.ae-prompt-color::-webkit-color-swatch { border: 0; border-radius: 6px; }

/* primary CTA */
.ae-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: var(--ae-grad); color: var(--ae-abyss);
  box-shadow: 0 6px 20px var(--ae-violet-glow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.ae-btn:hover { transform: translateY(-1px);
  box-shadow: 0 10px 30px var(--ae-violet-glow); }
.ae-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ae-btn.ghost {
  background: var(--ae-surface-2); color: var(--ae-text);
  border: 1px solid var(--ae-stroke); box-shadow: none;
}
.ae-btn.ghost:hover { background: var(--ae-surface-3); border-color: var(--ae-stroke-strong); }

/* hint chips */
.ae-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 1.1rem auto 0; max-width: 720px;
  justify-content: center;
}
.ae-chip {
  padding: 0.4rem 0.85rem; border-radius: 999px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-stroke);
  color: var(--ae-text-2); font-size: 0.78rem;
  cursor: pointer; transition: all 0.15s;
}
.ae-chip:hover {
  border-color: var(--ae-violet);
  color: var(--ae-text);
  background: var(--ae-violet-soft);
  transform: translateY(-1px);
}
.ae-chip.live {
  border-color: var(--ae-cyan); color: var(--ae-cyan);
  background: rgba(58,255,212,0.06);
}

/* ───────── single-column workspace ───────── */
.ae-single {
  max-width: 720px; margin: 1.4rem auto 4rem;
  padding: 0 1.5rem;
}
.ae-grid {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 1.5rem; max-width: 1280px; margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}
@media (max-width: 900px) { .ae-grid { grid-template-columns: 1fr; } }

.ae-section-title {
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ae-text-dim);
  margin: 0 0 0.9rem 0;
  display: flex; align-items: center; gap: 0.5rem;
}
.ae-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--ae-stroke), transparent);
}

.ae-card {
  background: var(--ae-surface);
  border: 1px solid var(--ae-stroke);
  border-radius: var(--ae-radius);
  padding: 1.1rem;
}

.ae-recent {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.ae-recent-item {
  display: block; padding: 0.7rem 0.85rem; border-radius: 12px;
  border: 1px solid var(--ae-stroke); color: var(--ae-text-2);
  text-decoration: none; transition: all 0.15s;
  background: var(--ae-surface);
}
.ae-recent-item:hover { border-color: var(--ae-violet); color: var(--ae-text);
  transform: translateX(2px); }
.ae-recent-name { font-weight: 600; font-size: 0.9rem; color: var(--ae-text); }
.ae-recent-meta { font-size: 0.72rem; color: var(--ae-text-dim);
  font-family: 'JetBrains Mono',monospace; margin-top: 0.18rem; }

/* live activity / build log */
.ae-log {
  background: var(--ae-abyss);
  border: 1px solid var(--ae-stroke);
  border-radius: var(--ae-radius);
  padding: 1rem; max-height: 280px; overflow-y: auto;
  font-family: 'JetBrains Mono',monospace; font-size: 0.78rem;
  line-height: 1.6;
}
.ae-log-line { color: var(--ae-text-2); }
.ae-log-line.info::before    { content: '▸ '; color: var(--ae-cyan); }
.ae-log-line.success::before { content: '✓ '; color: var(--ae-cyan); }
.ae-log-line.error::before   { content: '✗ '; color: #ff7b7b; }

/* ───────── preview page (3-column) ───────── */
.ae-preview-grid {
  display: grid; grid-template-columns: 360px minmax(0,1fr) 380px;
  gap: 1.4rem; max-width: 1480px; margin: 1.6rem auto 4rem;
  padding: 0 1.4rem;
}
@media (max-width: 1200px) {
  .ae-preview-grid { grid-template-columns: 1fr; }
}

/* ───────── phone mockup (used by preview-renderer.js) ───────── */
.pv-root {
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.pv-frame {
  width: 320px; height: 660px;
  background: linear-gradient(170deg, #0e1124 0%, #0a0d1c 100%);
  border: 1px solid var(--ae-stroke-strong);
  border-radius: 38px;
  box-shadow:
    0 0 0 6px #15182a,
    0 30px 80px -20px rgba(124,92,255,0.45),
    0 8px 24px -8px rgba(0,0,0,0.7),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;
}
.pv-frame::after {
  content: ''; position: absolute; top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 22px; border-radius: 14px;
  background: #0a0d1c; z-index: 5;
}
.pv-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px 8px; font-size: 11px;
  color: var(--ae-text-2);
  font-family: 'JetBrains Mono',monospace;
}
.pv-status-time { font-weight: 700; }
.pv-status-icons { display: flex; gap: 0.4rem; opacity: 0.7; }
.pv-body {
  flex: 1; overflow-y: auto;
  padding: 28px 16px 16px;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.pv-nav {
  display: flex; justify-content: center; gap: 0.7rem;
  padding: 0.5rem 0 0.7rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.pv-nav-pill {
  width: 18px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.18);
}
.pv-nav-pill:nth-child(2) { width: 30px; background: rgba(255,255,255,0.4); }

.pv-empty { color: var(--ae-text-dim); padding: 2rem; text-align: center;
  font-size: 0.85rem; }

.pv-header {
  position: relative; padding-bottom: 0.6rem; margin-bottom: 0.2rem;
}
.pv-header-title { font-size: 1.05rem; font-weight: 700; color: var(--ae-text); }
.pv-header-strip {
  height: 3px; width: 36px; border-radius: 2px;
  margin-top: 0.5rem;
  box-shadow: 0 0 12px currentColor;
}

.pv-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pv-row {
  display: flex; align-items: center; gap: 0.7rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px; padding: 0.7rem 0.85rem;
}
.pv-row-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px;
  box-shadow: 0 0 10px currentColor; }
.pv-row-txt { flex: 1; min-width: 0; }
.pv-row-title { color: var(--ae-text); font-weight: 600; font-size: 0.85rem; }
.pv-row-sub { color: var(--ae-text-dim); font-size: 0.72rem; margin-top: 0.15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-row-chev { color: var(--ae-text-dim); }

.pv-fab {
  position: absolute; right: 18px; bottom: 60px;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 600; color: var(--ae-abyss);
  box-shadow: 0 8px 24px rgba(124,92,255,0.5);
}

.pv-detail {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px; padding: 1rem;
}
.pv-detail-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.pv-detail-body { color: var(--ae-text-2); font-size: 0.82rem; line-height: 1.6; }

.pv-form { display: flex; flex-direction: column; gap: 0.6rem; }
.pv-field { display: flex; flex-direction: column; gap: 0.2rem; }
.pv-field-label { font-size: 0.7rem; color: var(--ae-text-dim);
  text-transform: uppercase; letter-spacing: 0.1em; }
.pv-field-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; height: 36px; padding: 0 0.7rem;
}
.pv-field-toggle { width: 44px; height: 26px; border-radius: 13px;
  display: flex; align-items: center; padding: 0 4px; color: var(--ae-text-dim); }

.pv-button {
  margin-top: 0.4rem; padding: 0.65rem 1rem;
  border-radius: 12px; text-align: center;
  color: var(--ae-abyss); font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 6px 18px rgba(124,92,255,0.45);
}

.pv-text { color: var(--ae-text-2); font-size: 0.85rem; line-height: 1.55; }
.pv-stub {
  font-family: 'JetBrains Mono',monospace; font-size: 0.7rem;
  color: var(--ae-text-dim); padding: 0.5rem 0.7rem;
  border: 1px dashed rgba(255,255,255,0.1); border-radius: 8px;
}
.pv-stub-card {
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px; padding: 0.7rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.pv-stub-kind { font-family: 'JetBrains Mono',monospace; font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ae-text-dim); }
.pv-stub-title { color: var(--ae-text); font-weight: 600; font-size: 0.86rem; }
.pv-stub-sub { color: var(--ae-text-dim); font-size: 0.74rem; }

/* Card */
.pv-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; padding: 0.85rem 0.95rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.pv-card-title { font-weight: 700; font-size: 0.92rem; color: var(--ae-text); }
.pv-card-sub { font-size: 0.76rem; color: var(--ae-text-dim); }

/* Switch */
.pv-switch-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px; padding: 0.7rem 0.85rem;
}
.pv-switch-label { font-size: 0.85rem; color: var(--ae-text); }
.pv-switch-track {
  width: 40px; height: 22px; border-radius: 13px;
  position: relative; transition: background 0.2s;
}
.pv-switch-track.on .pv-switch-thumb { left: 20px; background: #fff; }
.pv-switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,0.85); transition: left 0.2s;
}

/* Slider */
.pv-slider-wrap { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.4rem 0; }
.pv-slider-label { font-size: 0.78rem; color: var(--ae-text-2); }
.pv-slider-track {
  position: relative; height: 4px; background: rgba(255,255,255,0.12);
  border-radius: 2px;
}
.pv-slider-fill {
  height: 100%; border-radius: 2px;
  box-shadow: 0 0 10px currentColor;
}
.pv-slider-thumb {
  position: absolute; top: -6px; width: 16px; height: 16px;
  border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 0 10px currentColor;
}

/* Chips (mock — distinct from .ae-chip dashboard hints) */
.pv-chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.3rem 0; }
.pv-mock-chip {
  padding: 0.32rem 0.7rem; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: var(--ae-text-2); font-size: 0.74rem;
}
.pv-mock-chip.on { color: var(--ae-abyss); border: none; font-weight: 600; }

/* Icon glyph */
.pv-icon-glyph { font-size: 1.6rem; text-align: center; padding: 0.4rem; }

/* Result card (check / outcome) */
.pv-result-card {
  background: rgba(255,255,255,0.04); border: 1.5px solid currentColor;
  border-radius: 14px; padding: 1rem;
}
.pv-result-headline { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.pv-result-body { font-size: 0.82rem; color: var(--ae-text-2); line-height: 1.5; }

/* Map placeholder */
.pv-map {
  height: 140px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,92,255,0.15), rgba(58,255,212,0.10));
  border: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; color: var(--ae-text-dim);
}
.pv-map-pin { font-size: 1.6rem; color: var(--ae-violet); text-shadow: 0 0 14px var(--ae-violet-glow); }
.pv-map-label { font-size: 0.74rem; }

/* Camera preview */
.pv-camera {
  height: 180px; border-radius: 14px; padding: 6px;
  background: #000; border: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; color: var(--ae-text-dim);
}
.pv-camera-frame {
  width: 80%; height: 75%; border-radius: 10px;
  background: linear-gradient(180deg,#111,#222);
  border: 2px solid rgba(255,255,255,0.06);
}
.pv-camera-label { font-family: 'JetBrains Mono',monospace; font-size: 0.7rem; color: var(--ae-cyan); }

/* Loading */
.pv-loading { display: flex; flex-direction: column; align-items: center;
  gap: 0.6rem; padding: 2rem 0; color: var(--ae-text-dim); }
.pv-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--ae-cyan);
  animation: pv-spin 0.9s linear infinite;
}
@keyframes pv-spin { to { transform: rotate(360deg); } }
.pv-loading-label { font-size: 0.78rem; }

/* Empty state */
.pv-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  padding: 1.4rem 0.8rem; text-align: center; color: var(--ae-text-dim);
}
.pv-empty-icon { font-size: 1.8rem; opacity: 0.5; }
.pv-empty-title { color: var(--ae-text); font-weight: 600; font-size: 0.92rem; }
.pv-empty-sub { font-size: 0.78rem; }

/* Divider / spacer */
.pv-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 0.4rem 0; }
.pv-spacer { height: 16px; }
.pv-image-ph {
  height: 80px; border-radius: 12px;
  background: var(--ae-grad-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; opacity: 0.4;
}
.pv-sensor { display: flex; flex-direction: column; align-items: center;
  margin: 1rem 0; }
.pv-sensor-num { font-size: 3rem; font-weight: 700; color: var(--ae-cyan);
  text-shadow: 0 0 20px var(--ae-cyan-glow); font-family: 'JetBrains Mono',monospace; }
.pv-sensor-label { font-size: 0.72rem; letter-spacing: 0.2em;
  color: var(--ae-text-dim); margin-top: 0.3rem; }

.pv-tabs {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  justify-content: center; max-width: 360px;
}
.pv-tab {
  padding: 0.35rem 0.7rem; border-radius: 999px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-stroke);
  color: var(--ae-text-2); font-size: 0.72rem;
  cursor: pointer; transition: all 0.12s;
}
.pv-tab:hover { color: var(--ae-text); border-color: var(--ae-stroke-strong); }
.pv-tab.active {
  background: var(--ae-violet-soft); color: var(--ae-text);
  border-color: var(--ae-violet);
}

/* ───────── chat panel ───────── */
.ae-chat {
  display: flex; flex-direction: column; gap: 0.6rem;
  height: 100%; min-height: 460px;
}
.ae-chat-log {
  flex: 1; overflow-y: auto; padding: 0.4rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.ae-msg { padding: 0.6rem 0.85rem; border-radius: 14px;
  font-size: 0.83rem; line-height: 1.5; max-width: 92%; word-wrap: break-word; }
.ae-msg.user { align-self: flex-end; background: var(--ae-violet);
  color: var(--ae-abyss); font-weight: 500; }
.ae-msg.agent { align-self: flex-start; background: var(--ae-surface-2);
  color: var(--ae-text); border: 1px solid var(--ae-stroke); }
.ae-msg.system { align-self: center; background: transparent;
  color: var(--ae-text-dim); font-family: 'JetBrains Mono',monospace;
  font-size: 0.72rem; letter-spacing: 0.04em; opacity: 0.85; }
.ae-msg.system.tool { color: var(--ae-cyan); opacity: 1; }

.ae-msg-diff {
  background: var(--ae-abyss); border: 1px solid var(--ae-stroke);
  border-radius: 8px; padding: 0.5rem 0.7rem; margin-top: 0.45rem;
  font-family: 'JetBrains Mono',monospace; font-size: 0.72rem;
  line-height: 1.5; max-height: 220px; overflow: auto;
  white-space: pre;
}
.ae-msg-diff .add { color: #69ffb6; }
.ae-msg-diff .del { color: #ff7b7b; }
.ae-msg-diff .meta { color: var(--ae-text-dim); }

.ae-chat-input { display: flex; gap: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid var(--ae-stroke); }
.ae-chat-input textarea {
  flex: 1; min-height: 56px; max-height: 160px; resize: vertical;
  background: var(--ae-surface-2);
  border: 1px solid var(--ae-stroke);
  border-radius: 12px; color: var(--ae-text); font: inherit;
  font-size: 0.85rem; padding: 0.6rem 0.8rem; outline: 0;
  transition: border-color 0.15s;
}
.ae-chat-input textarea:focus { border-color: var(--ae-violet); }
.ae-chat-input textarea:disabled { opacity: 0.5; }

/* progress + qr */
.ae-progress-track {
  width: 100%; height: 6px; background: var(--ae-surface-3);
  border-radius: 3px; overflow: hidden;
}
.ae-progress-fill {
  height: 100%; background: var(--ae-grad);
  width: 0%; transition: width 0.4s ease;
  box-shadow: 0 0 12px var(--ae-violet-glow);
}
.ae-progress-meta {
  display: flex; justify-content: space-between; margin-top: 0.4rem;
  font-family: 'JetBrains Mono',monospace; font-size: 0.72rem;
  color: var(--ae-text-dim);
}
.ae-progress-msg { font-size: 0.78rem; color: var(--ae-text-2);
  margin-top: 0.4rem; min-height: 1.2em; }

.ae-qr {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.6rem; padding: 0.4rem 0;
}
.ae-qr img { width: 180px; height: 180px; padding: 8px; border-radius: 12px;
  background: #fff; }
.ae-qr-hint { font-size: 0.78rem; color: var(--ae-text-dim);
  text-align: center; line-height: 1.5; max-width: 240px; }
.ae-qr-link { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ae-cyan); text-decoration: none; }

/* download links (deliverables) */
.ae-dl { display: flex; flex-direction: column; gap: 0.5rem; }
.ae-dl a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.9rem; border-radius: 12px;
  background: var(--ae-surface); color: var(--ae-text);
  text-decoration: none; border: 1px solid var(--ae-stroke);
  font-size: 0.85rem; transition: all 0.15s;
}
.ae-dl a:hover:not(.disabled) { border-color: var(--ae-violet);
  background: var(--ae-violet-soft); }
.ae-dl a.disabled { opacity: 0.4; pointer-events: none; }

/* footer */
.ae-foot {
  text-align: center; padding: 2rem 1rem 1rem;
  font-family: 'JetBrains Mono',monospace;
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ae-text-dim);
}
