/* ═══════════════════════════════════════════════════════════════════════════
   AETERIA — app.css
   Core application styles: droplets, glass layers, chat layout, and form stage.
   Obeying the design law: zero blue backgrounds.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ DROPLETS & BUTTONS ═══ */
.droplet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill, 999px);
  background: var(--btn-bg, rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(8px);
  border: 1px solid var(--btn-border, var(--hairline, rgba(255, 255, 255, 0.08)));
  color: var(--btn-text, var(--text-primary, #EDEDEE));
  font-family: inherit;
  font-size: var(--text-sm, 13px);
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.droplet:hover {
  background: var(--btn-bg-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--line-strong, rgba(255, 255, 255, 0.18));
  transform: translateY(-1px);
}

.droplet:active {
  transform: translateY(0);
}

.droplet.primary {
  background: var(--accent, #E8641A);
  border-color: rgba(255, 179, 71, 0.5);
  color: #FFFFFF;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3),
              0 4px 18px rgba(232, 100, 26, 0.35);
}

.droplet.primary:hover {
  background: #F06E22;
  box-shadow: 0 6px 22px rgba(232, 100, 26, 0.45);
}

.droplet.danger {
  border-color: rgba(232, 106, 90, 0.5);
  color: #E86A5A;
  background: rgba(232, 106, 90, 0.08);
}

.water-ripple {
  position: absolute !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 70%);
  transform: scale(0);
  animation: water-ripple-bloom 600ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  z-index: 10;
}

@keyframes water-ripple-bloom {
  0% { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0; }
}

/* Light mode button overrides removed in favor of tokens in aeteria.css */

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line, var(--hairline, rgba(255, 255, 255, 0.08)));
  color: var(--text-secondary, #A7A7AC);
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  color: var(--text-primary, #EDEDEE);
  background: var(--hover-tint, rgba(255, 255, 255, 0.1));
  border-color: var(--line-strong, rgba(255, 255, 255, 0.18));
}

/* live state — the mic is hearing, the speaker is on */
.icon-btn.live {
  color: var(--accent, #E8641A);
  border-color: var(--accent, #E8641A);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(232, 100, 26, 0.15));
  animation: mic-breathe 2.4s var(--ease) infinite;
}

@keyframes mic-breathe {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-soft, rgba(232, 100, 26, 0.12)); }
  50% { box-shadow: 0 0 0 5px var(--accent-soft, rgba(232, 100, 26, 0.22)); }
}


/* ═══ THE CHAT — the dimmer satin glass column ═══ */

.chat-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg, 24px) var(--space-md, 16px);
  gap: var(--space-lg, 24px);
  min-height: calc(100vh - 60px);
}

@media (min-width: 1024px) {
  .chat-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "chat form";
  }
}

.chat-column {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl, 28px);
  background: radial-gradient(120% 120% at 50% 0%, var(--panel-sheen) 0%, var(--panel-shade) 100%),
              linear-gradient(155deg, var(--panel-grad-1) 0%, var(--panel-grad-2) 100%);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.09));
  box-shadow: var(--panel-shadow),
              var(--panel-inset-top),
              var(--panel-inset-deep);
  min-height: 400px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  position: relative;
}



/* THE CHAT HEADER — the being's live identity */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md, 16px) var(--space-lg, 24px);
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, 0.05));
}

.being-identity {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
}

.mood-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: hsl(var(--mood-hue, 30), 70%, 55%);
  animation: mood-pulse-dot 3s ease-in-out infinite;
}

@keyframes mood-pulse-dot {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.being-name {
  font-weight: 600;
  color: var(--text-primary, #EDEDEE);
  font-size: var(--text-base, 15px);
}

.being-phase {
  color: var(--text-tertiary, #8A8A8E);
  font-size: var(--text-sm, 13px);
}

.energy-bar {
  width: 80px;
  height: 4px;
  background: var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 999px;
  overflow: hidden;
}

.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #E8641A), #00C7BE);
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* THE FEED — the conversation */
.feed {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg, 24px);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* THE MESSAGES */
.msg {
  max-width: 75%;
  margin-bottom: var(--space-md, 16px);
  animation: msg-enter 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
  position: relative;
}

@keyframes msg-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.resident {
  margin-right: auto;
  padding: var(--space-md, 16px) var(--space-lg, 24px);
  border-radius: var(--radius-lg, 20px) var(--radius-lg, 20px) var(--radius-lg, 20px) 4px;
  background: var(--msg-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--msg-border, rgba(255, 255, 255, 0.05));
  border-left: 2px solid hsl(var(--mood-hue, 30), 70%, 55%);
  color: var(--text-primary, #EDEDEE);
  line-height: 1.6;
  font-size: var(--text-base, 15px);
}

.msg.user {
  margin-left: auto;
  color: var(--text-secondary, #A7A7AC);
  font-size: var(--text-base, 15px);
  line-height: 1.6;
  text-align: right;
}











/* THE DAY DIVIDERS — water-lines with mood glyphs */
.day-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md, 16px);
  margin: var(--space-xl, 32px) 0;
}

.day-divider::before, .day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line, rgba(255, 255, 255, 0.08)), transparent);
}

.day-label {
  font-size: var(--text-xs, 11px);
  color: var(--text-tertiary, #8A8A8E);
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.06));
}

/* THE FLASH INSET — a memory surfacing */
.flash-inset {
  margin: var(--space-sm, 8px) 0;
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  border-radius: var(--radius-md, 14px);
  border: 1px dashed hsla(var(--mood-hue, 30), 70%, 55%, 0.3);
  background: hsla(var(--mood-hue, 30), 70%, 55%, 0.04);
  font-size: var(--text-sm, 13px);
  color: var(--text-secondary, #A7A7AC);
  font-style: italic;
  animation: flash-settle 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes flash-settle {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* THE COMPOSER */
.composer {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: var(--space-md, 16px) var(--space-lg, 24px);
  border-top: 1px solid var(--line-soft, rgba(255, 255, 255, 0.05));
  position: relative;
}

.composer-tools {
  display: flex;
  gap: 4px;
}

#input {
  flex: 1;
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-md, 14px);
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  color: var(--text-primary, #EDEDEE);
  font-size: var(--text-base, 15px);
  font-family: inherit;
  outline: none;
  transition: border-color 300ms, box-shadow 300ms;
}

#input:focus {
  border-color: var(--accent, #E8641A);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(232, 100, 26, 0.15));
}

#input::placeholder {
  color: var(--placeholder, var(--text-tertiary, #8A8A8E));
}









/* THE BREATH LINE — the being breathing while composing */
.breath-line {
  position: absolute;
  bottom: 0;
  left: var(--space-lg, 24px);
  right: var(--space-lg, 24px);
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--mood-hue, 30), 70%, 55%), transparent);
  opacity: 0;
  transition: opacity 300ms;
}

.breath-line.active {
  opacity: 0.4;
  animation: breath 2s ease-in-out infinite;
}

@keyframes breath {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}

/* ═══ THE FORM PANEL — dimmer satin glass window ═══ */

.form-panel {
  grid-area: form;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl, 28px);
  background: radial-gradient(120% 120% at 50% 0%, var(--panel-sheen) 0%, var(--panel-shade) 100%),
              linear-gradient(155deg, var(--panel-grad-1) 0%, var(--panel-grad-2) 100%);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.09));
  box-shadow: var(--panel-shadow),
              var(--panel-inset-top),
              var(--panel-inset-deep);
  overflow: hidden;
  max-height: calc(100vh - 120px);
  position: relative;
}

/* ── S1.3 · the contained header — nothing escapes the frame ─────────── */

.form-header {
  padding: var(--space-md, 16px) var(--space-md, 16px) calc(var(--space-sm, 8px) + 4px);
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, 0.04));
  min-width: 0;                          /* the containment contract */
  flex: 0 0 auto;
}

.form-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.form-label {
  font-weight: 600;
  color: var(--text-primary, #EDEDEE);
  font-size: var(--text-sm, 13px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;   /* long names end in … — never outside the panel */
  min-width: 0;
  flex: 0 1 auto;
}

.form-mood-glyph { flex: 0 0 auto; font-size: 12px; opacity: .8; }

.form-tools {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.form-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background: transparent;
  color: var(--text-tertiary, #8A8A8E);
  cursor: pointer;
  transition: color 240ms cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 240ms cubic-bezier(0.25, 0.1, 0.25, 1),
              background 240ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.form-tool-btn svg { width: 15px; height: 15px; }

.form-tool-btn:hover {
  color: var(--accent, #E8641A);
  border-color: var(--accent, #E8641A);
  background: var(--accent-soft, rgba(232, 100, 26, 0.10));
}

.form-tool-btn:focus-visible {
  outline: 2px solid var(--accent, #E8641A);
  outline-offset: 2px;
}

.form-reason {
  font-size: var(--text-xs, 11px);
  color: var(--text-tertiary, #8A8A8E);
  display: block;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;   /* the reason stays inside too */
  min-width: 0;
}

/* THE OPTIONS dropdown — density · morph speed · reflection */
.form-options {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: formOptIn 260ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes formOptIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-opt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary, #B9B9BE);
  letter-spacing: 0.04em;
  min-width: 0;
}

.form-opt span { display: flex; justify-content: space-between; white-space: nowrap; overflow: hidden; }
.form-opt b { color: var(--accent, #E8641A); font-weight: 500; font-variant-numeric: tabular-nums; }

.form-opt input[type="range"] {
  width: 100%;
  height: 22px;
  accent-color: var(--accent, #E8641A);
  cursor: pointer;
}

.form-opt--toggle {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.form-opt--toggle input[type="checkbox"] {
  width: 34px;
  height: 18px;
  accent-color: var(--accent, #E8641A);
  cursor: pointer;
}

/* THE INK MODES — one row, scrolls horizontally inside the panel */
.form-modes {
  display: flex;
  gap: 4px;
  margin-top: var(--space-sm, 8px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent, #E8641A) transparent;
  padding-bottom: 4px;
  min-width: 0;
  flex-wrap: nowrap;
  scroll-snap-type: x proximity;
}

.form-modes .mode-chip { flex: 0 0 auto; scroll-snap-align: start; }

.form-modes::-webkit-scrollbar { height: 4px; }
.form-modes::-webkit-scrollbar-track { background: transparent; }
.form-modes::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, rgba(255, 255, 255, 0.12));
  border-radius: 4px;
}
.form-modes::-webkit-scrollbar-thumb:hover { background: var(--accent, #E8641A); }

.mode-chip {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--text-tertiary, #8A8A8E);
  background: transparent;
  cursor: pointer;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
              background 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.mode-chip:hover {
  border-color: var(--accent, #E8641A);
  color: var(--accent, #E8641A);
}

.mode-chip.active {
  background: var(--accent-soft, rgba(232, 100, 26, 0.12));
  border-color: var(--accent, #E8641A);
  color: var(--accent, #E8641A);
}

.mode-chip:focus-visible,
.strip-chip:focus-visible {
  outline: 2px solid var(--accent, #E8641A);
  outline-offset: 1px;
}

.form-stage {
  flex: 1;
  position: relative;
  min-height: 220px;
  overflow: hidden;
  contain: layout paint;
  min-width: 0;
}

#form-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}

/* THE REFLECTION FLOOR — the being standing on water */
.stage-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--glass-bg, rgba(255,255,255,0.02)), transparent);
  border-top: 1px solid var(--line-soft, rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

.form-strip {
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--line-soft, rgba(255, 255, 255, 0.04));
  min-width: 0;
  flex: 0 0 auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 179, 71, 0.35) transparent;
  scroll-snap-type: x proximity;
}

.form-strip::-webkit-scrollbar { height: 5px; }
.form-strip::-webkit-scrollbar-track { background: transparent; }
.form-strip::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, rgba(255, 179, 71, 0.25));
  border-radius: 4px;
}
.form-strip::-webkit-scrollbar-thumb:hover { background: var(--accent, #E8641A); }

.strip-empty {
  font-size: 10px;
  color: var(--text-tertiary, #8A8A8E);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: stripEmptyPulse 3.2s ease-in-out infinite;
}

@keyframes stripEmptyPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.strip-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 16px;
  background: var(--line, rgba(255, 255, 255, 0.10));
  margin: 0 2px;
}

.strip-density { display: inline-flex; gap: 6px; }

.strip-chip {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  color: var(--text-tertiary, #8A8A8E);
  white-space: nowrap;
  flex: 0 0 auto;
  scroll-snap-align: start;
  cursor: pointer;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
              background 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.strip-chip:hover { border-color: var(--accent, #E8641A); color: var(--accent, #E8641A); }
.strip-chip.active { background: var(--accent-soft, rgba(232, 100, 26, 0.15)); color: var(--accent, #E8641A); border-color: var(--accent, #E8641A); }

/* ── S1.3 · THE FULLSCREEN FORM — the same being, expanded ───────────── */

.form-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: radial-gradient(120% 120% at 50% 0%, var(--panel-sheen) 0%, var(--panel-shade) 100%),
              linear-gradient(155deg, var(--panel-grad-1) 0%, var(--panel-grad-2) 100%);
  backdrop-filter: blur(28px) saturate(1.25);
  display: flex;
  flex-direction: column;
  animation: formFsIn 320ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.form-fullscreen[hidden] { display: none !important; }

@keyframes formFsIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.form-fullscreen-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  background: var(--glass-bg, rgba(255, 255, 255, 0.04));
  color: var(--text-secondary, #B9B9BE);
  cursor: pointer;
  transition: color 220ms cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 220ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.form-fullscreen-close svg { width: 18px; height: 18px; }

.form-fullscreen-close:hover {
  color: var(--accent, #E8641A);
  border-color: var(--accent, #E8641A);
}

.form-fullscreen-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
}

#form-canvas-fs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
}

.form-fullscreen-label {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-tertiary, #8A8A8E);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 24px;
}

/* ═══ THE CALL OVERLAY ═══ */

/* Enforce strict hidden rule: overrides display:flex */
.call-overlay[hidden],
.call-overlay.hidden,
[hidden] {
  display: none !important;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(120% 120% at 50% 30%, var(--overlay-grad-1) 0%, var(--overlay-grad-2) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: call-enter 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}



.call-close-top {
  position: absolute;
  top: var(--space-lg, 24px);
  right: var(--space-lg, 24px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.15));
  background: var(--glass-bg, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #EDEDEE);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 102;
  transition: all 200ms;
}

.call-close-top:hover {
  background: var(--hover-tint, rgba(255, 255, 255, 0.18));
  transform: scale(1.05);
}





@keyframes call-enter { from { opacity: 0; } to { opacity: 1; } }

.call-face { width: min(400px, 80vw); height: min(400px, 50vh); position: relative; }
#call-form-canvas { width: 100%; height: 100%; }

.call-waveform { width: min(300px, 60vw); height: 60px; margin-top: var(--space-xl, 32px); }
#call-wave-canvas { width: 100%; height: 100%; }

.call-transcript {
  margin-top: var(--space-lg, 24px);
  max-height: 100px;
  overflow-y: auto;
  font-size: var(--text-sm, 13px);
  color: var(--text-tertiary, #8A8A8E);
  text-align: center;
  max-width: 400px;
  line-height: 1.5;
  mask-image: linear-gradient(transparent, black 30%);
  -webkit-mask-image: linear-gradient(transparent, black 30%);
}

.call-timer {
  position: absolute;
  top: var(--space-xl, 32px);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-sm, 13px);
  color: var(--text-tertiary, #8A8A8E);
  font-variant-numeric: tabular-nums;
}

.call-controls {
  display: flex;
  gap: var(--space-lg, 24px);
  margin-top: var(--space-xl, 32px);
}

.call-controls .droplet { width: 56px; height: 56px; }
.call-controls .droplet.danger { border-color: #E86A5A; color: #E86A5A; }

/* Mobile: the form collapses to an orb */
@media (max-width: 1023px) {
  .form-panel { display: none; }
  .form-orb {
    display: flex;
    position: fixed;
    bottom: 88px;
    right: var(--space-md, 16px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg, rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(12px);
    border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  }
}

/* ═══ MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; }
  .mood-dot { animation: none; }
  .breath-line { animation: none; opacity: 0.3; }
  .call-overlay { animation: none; }
  .flash-inset { animation: none; }
}

/* ═══ CONTAINMENT ═══ */
img, svg, video, canvas {
  max-width: 100%;
}
.wrap, .row.wrap {
  flex-wrap: wrap !important;
}
.gen-img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════════════
   THE DEEP UPGRADES — the living form stage, the chat's small gestures
   ═══════════════════════════════════════════════════════════════════ */

/* F4 · THE MOOD RING — a 1px colored ring that pulses at the mood's rate */
.form-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid hsla(var(--mood-hue, 30), 72%, 56%, 0.22);
  animation: mood-ring-pulse calc(4s / var(--breath-rate, 1)) ease-in-out infinite;
  z-index: 2;
}
@keyframes mood-ring-pulse {
  0%, 100% { border-color: hsla(var(--mood-hue, 30), 72%, 56%, 0.16); }
  50% { border-color: hsla(var(--mood-hue, 30), 78%, 62%, 0.44); }
}

/* the mood glyph beside the form's label */
.form-mood-glyph {
  margin-left: 8px;
  font-size: 13px;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px hsla(var(--mood-hue, 30), 72%, 56%, 0.5));
}

.ink-divider,
.strip-divider {
  width: 1px;
  height: 16px;
  align-self: center;
  background: var(--line-soft, rgba(255, 255, 255, 0.06));
  margin: 0 2px;
  flex: none;
}
.strip-density { display: inline-flex; gap: 6px; }

/* F4 · THE MOBILE ORB — the panel collapses, the orb carries it (48px) */
.form-orb {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 84px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid hsla(var(--mood-hue, 30), 72%, 56%, 0.4);
  background: var(--glass-bg, rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(8px);
  z-index: 60;
  cursor: pointer;
  animation: orb-breathe 4s ease-in-out infinite;
}
.form-orb[hidden] { display: none; }
.form-orb .orb-core {
  display: block;
  width: 14px;
  height: 14px;
  margin: 16px auto;
  border-radius: 50%;
  background: radial-gradient(circle, #FFB347 0%, #E8641A 70%);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.6);
  transition: transform 260ms cubic-bezier(0.2, 1.2, 0.3, 1);
}
.form-orb.open .orb-core { transform: scale(1.35); }
@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 0 0 hsla(var(--mood-hue, 30), 72%, 56%, 0); }
  50% { box-shadow: 0 0 22px -2px hsla(var(--mood-hue, 30), 72%, 56%, 0.35); }
}
:root[data-theme="light"] .form-orb {
  border-color: hsla(var(--mood-hue, 30), 60%, 40%, 0.4);
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 900px) {
  .form-orb { display: block; }
  .form-panel.orb-collapsed {
    position: fixed;
    inset: auto 12px 8px 12px;
    top: 56px;
    z-index: 55;
    display: none;
  }
  .form-panel.orb-collapsed.orb-expanded { display: flex; }
}

/* S7 · the composer clears the phone's home bar */
@media (max-width: 768px) {
  .composer { padding-bottom: calc(var(--space-md, 16px) + env(safe-area-inset-bottom, 0px)); }
  .form-orb { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* S8 · TABLET (768–1024) — the form rides a 48px mini-rail, draggable open.
   The stage holds a 200px window on the being. */
@media (min-width: 768px) and (max-width: 1023px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr) 48px; grid-template-areas: "chat rail"; }
  .form-panel {
    grid-area: rail; display: flex; max-height: none; align-self: stretch;
    width: 48px; min-width: 48px; border-radius: 20px 0 0 20px;
    transition: width 240ms ease; position: relative;
  }
  .form-panel.orb-expanded { width: 300px; min-width: 300px; }
  .form-panel.orb-collapsed { display: flex; position: static; inset: auto; }
  .form-panel .form-rail-grip {
    display: flex; align-items: center; justify-content: center;
    writing-mode: vertical-rl; cursor: grab; touch-action: none;
    min-height: 48px; min-width: 48px; color: var(--text-secondary);
    font-size: 11px; letter-spacing: 0.14em; user-select: none;
  }
  .form-stage { min-height: 200px; }
}
@media (min-width: 1024px) { .form-panel .form-rail-grip { display: none; } }

/* ── the chat's small gestures (#1–#6) ─────────────────────────────────── */

/* #1 · the typing indicator — the being's mood glyph, pulsing */
.typing-glyph {
  display: inline-block;
  font-size: 15px;
  color: hsl(var(--mood-hue, 30), 72%, 58%);
  animation: typing-pulse 1.3s ease-in-out infinite;
}
@keyframes typing-pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0) scale(0.94); }
  50% { opacity: 1; transform: translateY(-2px) scale(1.08); }
}

/* #3 · THE UNSAID — a barely-visible trailing ellipsis */
.unsaid-trailing {
  display: inline;
  margin-left: 4px;
  color: var(--text-tertiary, #8A8A8E);
  opacity: 0.38;
  font-style: italic;
  letter-spacing: 0.14em;
  cursor: help;
  transition: opacity 600ms ease;
}
.unsaid-trailing:hover { opacity: 0.75; }

/* #5 · the being's bookmark — a tiny amber star */
.msg-bookmark {
  position: absolute;
  top: -7px;
  right: -4px;
  font-size: 10px;
  color: #FFB347;
  text-shadow: 0 0 6px rgba(255, 179, 71, 0.7);
  animation: bookmark-settle 700ms cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
@keyframes bookmark-settle {
  from { transform: scale(0) rotate(-40deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* #2 · the reaction heart */
.msg-reaction {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-tertiary, #8A8A8E);
  opacity: 0.45;
  cursor: pointer;
  transition: all 220ms ease;
  vertical-align: baseline;
}
.msg-reaction:hover { opacity: 0.9; transform: scale(1.2); }
.msg-reaction.hearted {
  color: hsl(var(--mood-hue, 30), 78%, 60%);
  opacity: 1;
  text-shadow: 0 0 8px hsla(var(--mood-hue, 30), 78%, 60%, 0.6);
  animation: heart-tap 420ms cubic-bezier(0.2, 1.6, 0.3, 1);
}
@keyframes heart-tap {
  0% { transform: scale(1); }
  45% { transform: scale(1.55); }
  100% { transform: scale(1); }
}

/* #4 · conversation chapters — a soft break between movements */
.chapter-break {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 22px;
}
.chapter-break::before, .chapter-break::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsla(var(--mood-hue, 30), 60%, 55%, 0.28), transparent);
}
.chapter-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-tertiary, #8A8A8E);
  font-style: italic;
}

/* #7 · recall provenance — the memories that shaped the reply */
.recall-provenance {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-tertiary, #8A8A8E);
  opacity: 0.65;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.recall-provenance:hover { opacity: 1; color: hsl(var(--mood-hue, 30), 66%, 58%); }

/* #6 · THE DÉJÀ VU — the old fragment ghost-overlaps the reply for 500ms */
.deja-vu-ghost {
  position: absolute;
  inset: 6px 14px auto 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid hsla(var(--mood-hue, 30), 70%, 60%, 0.3);
  color: var(--text-secondary, #A7A7AC);
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  background: var(--tooltip-bg, rgba(28, 28, 31, 0.92));
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 3;
  animation: deja-vu-haunt 500ms ease-out both;
  overflow: hidden;
}
:root[data-theme="light"] .deja-vu-ghost { background: rgba(255, 255, 255, 0.94); }
@keyframes deja-vu-haunt {
  0% { opacity: 0; transform: translateY(6px) scale(0.98); filter: blur(3px); }
  35% { opacity: 0.92; transform: translateY(0) scale(1); filter: blur(0.4px); }
  100% { opacity: 0; filter: blur(2px); }
}

/* R4 · THE FIRST BLOOM — the oldest imported memory, shown once */
.woke-bloom {
  max-width: 75%;
  margin: 0 auto 26px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid hsla(var(--mood-hue, 30), 72%, 60%, 0.35);
  background: linear-gradient(150deg, hsla(var(--mood-hue, 30), 72%, 50%, 0.10), transparent 70%);
  text-align: center;
  animation: woke-bloom-in 900ms cubic-bezier(0.2, 1.1, 0.3, 1) both;
}
.woke-bloom .bloom-label {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-tertiary, #8A8A8E);
}
.woke-bloom .bloom-fragment {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  font-style: italic;
  color: var(--text-primary, #EDEDEE);
}
@keyframes woke-bloom-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   SECTION 2 · THE CHAT (master upgrade order)
   ════════════════════════════════════════════════════════════════════════ */

/* ── 1 · MOOD-GRADIENT MESSAGES — the reply carries its mood ─────────────── */
.msg.resident {
  background:
    linear-gradient(180deg, hsla(var(--mood-hue, 36), 70%, 55%, 0.14) 0%, transparent 88%),
    var(--msg-bg, rgba(255,255,255,.04));
  border-left: 2px solid hsl(var(--mood-hue, 36), 70%, 58%);
}

/* ── 2 · THE ENERGY VIGNETTE — tired dims the periphery ──────────────────── */
body[data-tired="1"] .feed {
  box-shadow: inset 0 0 72px 12px rgba(8, 8, 10, 0.55);
  transition: box-shadow 1.2s var(--ease);
}
body[data-tired="1"] .chat-column { opacity: 0.96; }
[data-theme="light"] body[data-tired="1"] .feed { box-shadow: inset 0 0 72px 12px rgba(70, 60, 50, 0.18); }

/* ── 3 · PHASE-RESPONSIVE GLASS — each phase adds a depth layer ──────────── */
.chat-column { transition: box-shadow 1s var(--ease); }
body[data-phase="1"] .chat-column { box-shadow: 0 0 0 1px rgba(255,179,71,.05), var(--panel-shadow, 0 10px 40px rgba(0,0,0,.3)); }
body[data-phase="2"] .chat-column { box-shadow: 0 0 0 1px rgba(255,179,71,.09), 0 0 24px rgba(232,100,26,.05), var(--panel-shadow, 0 10px 40px rgba(0,0,0,.3)); }
body[data-phase="3"] .chat-column { box-shadow: 0 0 0 1px rgba(255,179,71,.13), 0 0 28px rgba(232,100,26,.08), inset 0 1px 0 rgba(255,255,255,.04), var(--panel-shadow, 0 10px 40px rgba(0,0,0,.3)); }
body[data-phase="4"] .chat-column { box-shadow: 0 0 0 1px rgba(255,179,71,.17), 0 0 34px rgba(232,100,26,.11), inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(255,179,71,.05), var(--panel-shadow, 0 10px 40px rgba(0,0,0,.3)); }

/* ── 4 · TEXTURAL DIFFERENTIATION — typography as provenance ─────────────── */
.dream-ref { font-style: italic; text-shadow: 0 0 12px rgba(63,169,165,.4); }
.memory-recall { text-decoration: underline; text-decoration-color: rgba(196,120,10,.5); text-decoration-style: dotted; text-underline-offset: 3px; }

/* ── 5 · THE CONTEXT STRIP — what the being currently knows ──────────────── */
.context-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-top: 1px solid var(--line-soft, var(--hairline));
  font-size: var(--t-11); color: var(--faint, #8A8A8E);
  letter-spacing: 0.04em; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; min-height: 30px;
}
.context-strip::-webkit-scrollbar { display: none; }
.context-strip .cs-glyph { color: hsl(var(--mood-hue, 36), 70%, 60%); }
.context-strip .cs-frag { padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--hairline); overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.context-strip .cs-phase { margin-left: auto; color: var(--muted, #B9B9BE); }

/* ── 9 · MESSAGE SEARCH — ⌘F searches the full diary ─────────────────────── */
.search-overlay {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(8,8,10,.62); backdrop-filter: blur(8px);
  display: grid; place-items: start center; padding-top: 12vh;
}
.search-overlay[hidden] { display: none; }
.search-box {
  width: min(640px, calc(100vw - 32px));
  background: var(--panel-bg, #1C1C1F); border: 1px solid var(--hairline-strong);
  border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.6); overflow: hidden;
}
.search-box input {
  width: 100%; box-sizing: border-box; padding: 16px 18px; font-size: 15px;
  background: transparent; border: 0; border-bottom: 1px solid var(--hairline);
  color: var(--ink, #EDEDEE); outline: none; font-family: var(--font);
}
.search-results { max-height: 46vh; overflow-y: auto; padding: 6px; }
.search-hit { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--ink, #EDEDEE); }
.search-hit:hover, .search-hit:focus { background: rgba(232,100,26,.09); }
.search-hit .sh-date { display: block; font-size: 10px; color: var(--faint, #8A8A8E); letter-spacing: .08em; margin-bottom: 3px; }
.search-hit .sh-snip { display: block; font-size: 13px; color: var(--muted, #B9B9BE); }
.search-hit .sh-snip mark { background: rgba(255,179,71,.22); color: var(--amber-bright, #FFB347); border-radius: 2px; padding: 0 1px; }

/* ── 10 · THE MOOD TIME MACHINE ───────────────────────────────────────────── */
.mood-spark { width: 86px; height: 22px; cursor: pointer; display: block; }
.mood-arc-overlay { position: fixed; inset: 0; z-index: 110; background: rgba(8,8,10,.66); backdrop-filter: blur(8px); display: grid; place-items: center; }
.mood-arc-overlay[hidden] { display: none; }
.mood-arc-box { width: min(680px, calc(100vw - 32px)); padding: 26px; border-radius: 18px; background: var(--panel-bg, #1C1C1F); border: 1px solid var(--hairline-strong); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.mood-arc-box h3 { margin: 0 0 4px; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-bright, #FFB347); }
.mood-arc-box p { margin: 0 0 14px; font-size: 12px; color: var(--faint, #8A8A8E); }
#moodArcCanvas { width: 100%; height: 180px; display: block; }

/* ── 11 · REPLY BRANCHING ─────────────────────────────────────────────────── */
.branch-chip {
  display: flex; align-items: center; gap: 8px; margin: 0 14px 6px; padding: 6px 12px;
  border-radius: 10px; background: rgba(74,111,165,.1); border: 1px dashed rgba(74,111,165,.4);
  font-size: var(--t-11); color: var(--muted, #B9B9BE);
}
.branch-chip button { margin-left: auto; border: 0; background: none; color: var(--faint, #8A8A8E); cursor: pointer; font-size: 14px; padding: 4px; }
.branch-mark { color: rgba(74,111,165,.8); font-size: 10px; letter-spacing: .06em; display: block; margin-bottom: 2px; }
.branch-picker { position: fixed; inset: 0; z-index: 110; background: rgba(8,8,10,.6); display: grid; place-items: center; }
.branch-picker[hidden] { display: none; }
.branch-picker .bp-list { width: min(520px, calc(100vw - 32px)); max-height: 50vh; overflow-y: auto; background: var(--panel-bg, #1C1C1F); border: 1px solid var(--hairline-strong); border-radius: 14px; padding: 8px; }
.branch-picker .bp-item { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; border-radius: 10px; color: var(--ink, #EDEDEE); cursor: pointer; font-size: 13px; }
.branch-picker .bp-item:hover { background: rgba(74,111,165,.12); }
.branch-picker .bp-item .who { font-size: 10px; letter-spacing: .08em; color: var(--faint, #8A8A8E); display: block; margin-bottom: 2px; }

/* ── 12 · QUICK ACTIONS — swipe a message ────────────────────────────────── */
.msg .qa-bar {
  position: absolute; right: 6px; top: -12px; display: none; gap: 4px; z-index: 5;
  background: var(--panel-bg, #1C1C1F); border: 1px solid var(--hairline-strong);
  border-radius: 12px; padding: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.msg.qa-open { transform: translateY(6px); }
.msg.qa-open .qa-bar { display: flex; }
.qa-btn { min-width: 40px; min-height: 40px; border: 0; background: none; color: var(--muted, #B9B9BE); border-radius: 9px; cursor: pointer; font-size: 15px; }
.qa-btn:hover { background: rgba(232,100,26,.12); color: var(--amber-bright, #FFB347); }
.qa-btn[title] { font-variant-emoji: none; }

/* ── 17 · THE FLASH RIPPLE — a memory fires, the column pulses ───────────── */
.chat-column.flash-ripple { animation: flash-ripple 900ms var(--ease); }
@keyframes flash-ripple {
  0% { box-shadow: inset 0 0 0 0 transparent; }
  30% { box-shadow: inset 0 0 90px 8px hsla(var(--flash-hue, 36), 80%, 60%, 0.25); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* ── 19 · MESSAGE ORIGAMI — paper boats arriving on the water ────────────── */
.msg { animation: msg-origami 480ms cubic-bezier(0.22,1,0.36,1); transform-origin: 0% 100%; }
.msg.user { transform-origin: 100% 100%; }
@keyframes msg-origami {
  from { opacity: 0; transform: translateY(6px) rotateX(38deg) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } }

/* S2 #9 · the jumped-to message, marked in amber */
.msg.marked { outline: 2px solid rgba(255,179,71,.5); outline-offset: 4px; border-radius: 12px; animation: marked-fade 3.2s var(--ease) forwards; }
@keyframes marked-fade { 0%, 60% { outline-color: rgba(255,179,71,.5); } 100% { outline-color: transparent; } }

/* ════════════════════════════════════════════════════════════════════════
   SECTION 3 · THE FORM PANEL (master upgrade order)
   ════════════════════════════════════════════════════════════════════════ */

/* ── #8 · the migration badge ─────────────────────────────────────────────── */
.migration-badge {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%) translateY(0);
  z-index: 20; padding: 7px 14px; border-radius: 999px;
  background: rgba(232,100,26,.14); border: 1px solid rgba(232,100,26,.4);
  color: var(--amber-bright, #FFB347); font-size: var(--t-11); letter-spacing: .06em;
  white-space: nowrap; transition: opacity .8s var(--ease), transform .8s var(--ease);
  pointer-events: none;
}
.migration-badge.gone { opacity: 0; transform: translateX(-50%) translateY(-6px); }

/* ── #6 · the form's history (the wardrobe's memory) ─────────────────────── */
.form-panel { position: relative; }
.form-history {
  position: absolute; top: 44px; left: 12px; right: 12px; z-index: 24;
  max-height: 240px; overflow-y: auto;
  background: var(--panel-bg, #1C1C1F); border: 1px solid var(--hairline-strong);
  border-radius: 12px; box-shadow: 0 16px 44px rgba(0,0,0,.5); padding: 6px;
}
.fh-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 8px; }
.fh-row:hover { background: rgba(232,100,26,.07); }
.fh-shape { font-size: var(--t-13); color: var(--ink, #EDEDEE); }
.fh-date { margin-left: auto; font-size: 10px; color: var(--faint, #8A8A8E); letter-spacing: .08em; }

/* ── #9 · form preview mode ──────────────────────────────────────────────── */
.form-preview {
  position: fixed; inset: 0; z-index: 130; background: rgba(8,8,10,.9);
  backdrop-filter: blur(10px); display: grid; grid-template-rows: 1fr auto;
}
.fp-stage { display: grid; place-items: center; perspective: 1100px; overflow: hidden; }
.fp-holder { transform-style: preserve-3d; transition: transform 40ms linear; }
.fp-holder canvas { width: min(86vw, 620px); height: min(66vh, 460px); }
.fp-hud { padding: 18px; text-align: center; }

/* ── #10 · the particle editor card ──────────────────────────────────────── */
.particle-card {
  position: fixed; z-index: 140; right: 18px; top: 18px; width: min(280px, calc(100vw - 36px));
  background: var(--panel-bg, #1C1C1F); border: 1px solid var(--hairline-strong);
  border-radius: 14px; padding: 14px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.particle-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.particle-card header strong { font-size: var(--t-13); color: var(--amber-bright, #FFB347); letter-spacing: .1em; text-transform: uppercase; }
.particle-card header button { border: 0; background: none; color: var(--faint); cursor: pointer; min-width: 44px; min-height: 44px; margin: -10px -8px -10px 0; }
.particle-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.particle-card dt { font-size: 10px; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; align-self: center; }
.particle-card dd { margin: 0; font-size: var(--t-13); color: var(--ink); }

/* ── #11 · drop-ready glow ───────────────────────────────────────────────── */
.form-panel.drop-ready { outline: 2px dashed rgba(255,179,71,.55); outline-offset: -6px; }

/* ── #12 · the recorder button ────────────────────────────────────────────── */
#form-record.recording { color: #E0704F; border-color: rgba(217,84,43,.5); animation: rec-blink 1s steps(2) infinite; }
@keyframes rec-blink { 50% { opacity: .55; } }
