/* Idea Box — chassis styles.
   Brand tokens are rewritten by `appfactory new`; everything else is structure. */

/* >>> tokens */
:root {
  --bg: #1A1F2E;
  --surface: #232838;
  --surface-2: #2a3144;
  --text: #f2f2f7;
  --dim: #9a9aa8;
  --accent: #FF6B4A;
  --accent-glow: rgba(255, 107, 74, 0.35);
  --radius: 16px;
  --pad: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* <<< tokens */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: var(--app-height, 100dvh);
  overflow: hidden;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(255, 107, 74, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 100%, rgba(100, 120, 220, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(255, 140, 100, 0.1), transparent 45%),
    linear-gradient(180deg, #1e2436 0%, var(--bg) 45%, #141824 100%);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 107, 74, 0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(120, 140, 255, 0.06), transparent 35%);
  animation: bgDrift 14s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes bgDrift {
  from { opacity: 0.7; transform: scale(1) translateY(0); }
  to { opacity: 1; transform: scale(1.05) translateY(-8px); }
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

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

#appBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pad);
  padding: var(--pad);
  flex: 0 0 auto;
}

#appTitle {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.screen { flex: 1 1 auto; overflow-y: auto; padding: 0 var(--pad) var(--pad); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--pad);
}
.card h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.card p { margin: 0 0 .75rem; }
.dim { color: var(--dim); }
code { background: rgba(255,255,255,.07); padding: .1em .4em; border-radius: 6px; font-size: .9em; }

.icon-btn {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.06);
  color: inherit;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  line-height: 0;
  transition: background 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}
.icon-btn:active { background: rgba(255,255,255,.12); transform: scale(0.94); }

/* --- sheets --------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  z-index: 40;
  animation: fadeIn 0.3s var(--ease-out);
}
.sheet-backdrop[hidden] { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  width: 100%;
  border-radius: 24px 24px 0 0;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom));
  max-height: 85%;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-spring);
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.4);
}
.sheet.is-open,
.sheet-backdrop:not([hidden]) .sheet {
  transform: translateY(0);
}

.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.sheet-foot { margin-top: var(--pad); display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.sheet-foot a { color: var(--dim); transition: color 0.2s; }
.sheet-foot a:hover { color: var(--text); }
#appVersion { margin-left: auto; font-variant-numeric: tabular-nums; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.row:last-of-type { border-bottom: 0; }

/* --- floating pills ------------------------------------------------------- */
.pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  animation: pillIn 0.4s var(--ease-spring);
}
.pill[hidden] { display: none; }

@keyframes pillIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.update-toast { bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--accent); color: #fff; }
.install-hint {
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: auto;
  transform: none;
  background: var(--surface);
  color: var(--text);
  animation-name: installHintIn;
}

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

#toast, #syncStatus {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top));
  background: rgba(0,0,0,.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: .9rem;
  z-index: 70;
  pointer-events: none;
  animation: toastIn 0.3s var(--ease-spring);
}
#toast[hidden], #syncStatus[hidden] { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Idea Box app --------------------------------------------------------- */

.tagline { margin: 0 0 14px; font-size: .95rem; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,.1);
  color: var(--text);
  transition: transform 0.15s var(--ease-out), opacity 0.15s, background 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.96); opacity: .9; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-quiet { background: rgba(255,255,255,.08); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-danger { background: #c0392b; color: #fff; }

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--dim);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.chip:active { transform: scale(0.95); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.featured-band {
  background: linear-gradient(135deg, rgba(255,107,74,.22), rgba(255,107,74,.06));
  border: 1px solid rgba(255,107,74,.3);
  border-radius: var(--radius);
  padding: 16px var(--pad);
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
  animation: cardIn 0.4s var(--ease-out);
}
.featured-band:active { transform: scale(0.98); }
.featured-band:hover { box-shadow: 0 4px 20px rgba(255,107,74,.15); }
.featured-band h3 { margin: 0 0 4px; font-size: 1.02rem; }
.featured-band p { margin: 0; font-size: .9rem; color: var(--dim); }
.featured-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.idea-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 90px; }

.idea-card {
  --card-accent: rgba(255,255,255,.18);
  --card-tint: transparent;
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  background:
    linear-gradient(180deg, var(--card-tint), transparent 72%),
    linear-gradient(145deg, var(--surface) 0%, rgba(35, 40, 56, 0.95) 100%);
  border-radius: var(--radius);
  padding: 14px 14px 14px 12px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
  animation: cardIn 0.45s var(--ease-out) both;
  animation-delay: var(--stagger, 0ms);
  overflow: hidden;
}
.idea-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--card-accent);
  opacity: .9;
}
.idea-card:active { transform: scale(0.98); }
.idea-card:hover {
  border-color: color-mix(in srgb, var(--card-accent) 45%, transparent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* Status identity */
.idea-card--new { --card-accent: #7aa2ff; --card-tint: rgba(122,162,255,.07); }
.idea-card--review { --card-accent: #c9a227; --card-tint: rgba(201,162,39,.08); }
.idea-card--building { --card-accent: var(--accent); --card-tint: rgba(255,107,74,.1); }
.idea-card--built { --card-accent: #6dd99a; --card-tint: rgba(109,217,154,.08); }
.idea-card--archived { --card-accent: #8b93a7; --card-tint: rgba(139,147,167,.05); }

/* Subtle rhythm so adjacent cards don't feel identical */
.idea-card--tone2 { border-radius: 18px 14px 18px 14px; }
.idea-card--tone3 { border-radius: 14px 20px 14px 20px; }
.idea-card--tone4 { border-radius: 16px 16px 20px 12px; }
.idea-card.is-pinned {
  border-color: rgba(255,107,74,.35);
  box-shadow: 0 4px 20px rgba(255,107,74,.12);
}
.idea-card.is-hot .vote-count { color: var(--accent); }
.idea-card.is-voted .idea-main h3 { color: #fff; }

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

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.vote-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 14px;
  min-height: 72px;
  width: 100%;
  padding: 8px 4px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  position: relative;
  z-index: 1;
}
.vote-btn:hover {
  border-color: rgba(255,107,74,.45);
  background: rgba(255,107,74,.1);
  color: var(--accent);
}
.vote-btn:active { transform: scale(0.94); }
.vote-btn.is-voted {
  background: rgba(255,107,74,.22);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.vote-btn.vote-pop {
  animation: votePop 0.3s var(--ease-spring);
}

.vote-caret {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid currentColor;
  margin-bottom: 1px;
}
.vote-count {
  font-size: 1rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.vote-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .72;
  line-height: 1;
}
.vote-btn.is-voted .vote-label { opacity: 1; }

@keyframes votePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.idea-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.idea-main h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 650;
  flex: 1;
  min-width: 0;
}
.idea-excerpt { margin: 0 0 10px; font-size: .9rem; color: var(--dim); line-height: 1.45; }
.idea-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  font-size: .78rem;
  color: var(--dim);
}
.idea-author { font-weight: 550; color: rgba(232,236,248,.78); }
.idea-meta-dot { opacity: .45; }
.idea-replies {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: .9;
}
.idea-replies svg { opacity: .7; }
.idea-hidden-tag {
  color: #f0a0a0;
  font-weight: 600;
}
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-weight: 600;
  font-size: .75rem;
}
.status-pill.is-new { background: rgba(122,162,255,.16); color: #9bb8ff; }
.status-pill.is-review { background: rgba(201,162,39,.18); color: #e0c35a; }
.status-pill.is-building { background: rgba(255,107,74,.2); color: var(--accent); }
.status-pill.is-built { background: rgba(80,200,120,.15); color: #6dd99a; }
.status-pill.is-archived { background: rgba(139,147,167,.16); color: #a8b0c2; }
.pin-mark {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.35;
}

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--dim);
  animation: cardIn 0.5s var(--ease-out);
}
.empty p { margin: 0 0 16px; }

/* --- tab bar with center FAB ---------------------------------------------- */

#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  background: rgba(20, 24, 36, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 6px 16px calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

#tabbar::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(20, 24, 36, 0.94);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
#tabbar[hidden] { display: none; }

.tab {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  font: inherit;
  font-size: .7rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.2s, transform 0.15s var(--ease-out);
}
.tab:active:not(.tab-fab) { transform: scale(0.92); }
.tab.is-active { color: var(--accent); }

.tab-fab {
  position: relative;
  margin-top: -36px;
  color: #fff;
  flex: 0 0 auto;
  z-index: 2;
}

.fab-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7a55, var(--accent) 45%, #ff5533);
  box-shadow:
    0 8px 32px rgba(255, 107, 74, 0.55),
    0 0 0 5px rgba(20, 24, 36, 0.98),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.fab-ring--pulse {
  animation: fabIdlePulse 2.8s ease-in-out infinite;
}

.fab-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.45), transparent 70%);
  animation: fabGlow 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fabIdlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes fabGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}

.tab-fab:active .fab-ring {
  transform: scale(0.94);
  animation: none;
  box-shadow:
    0 4px 16px rgba(255, 107, 74, 0.45),
    0 0 0 5px rgba(20, 24, 36, 0.98);
}
.tab-fab:hover .fab-ring {
  box-shadow:
    0 12px 40px rgba(255, 107, 74, 0.65),
    0 0 0 5px rgba(20, 24, 36, 0.98);
}

.tab-label { line-height: 1; }

/* --- admin screen --------------------------------------------------------- */

.admin-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-head h2 { margin: 0; font-size: 1.1rem; }

.admin-settings { margin-top: 8px; }
.admin-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: .85rem; color: var(--dim); margin-bottom: 6px; }
.text-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.25);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.idea-input { min-height: 100px; }

.sheet-hint { margin: 0 0 12px; font-size: .9rem; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.sheet-tall { max-height: 92%; }
.sheet-voice { max-height: 88%; }
.sheet-interview {
  display: flex;
  flex-direction: column;
  max-height: 94%;
  padding-bottom: 0;
  overflow: hidden;
}
.sheet-interview .sheet-head {
  flex: 0 0 auto;
  padding-bottom: 8px;
}
.sheet-head--submit {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sheet-head--submit h2 {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-head--submit .icon-btn { justify-self: start; }
.sheet-head--submit #submitSave {
  justify-self: end;
  min-width: 78px;
  transition: opacity .2s, transform .2s var(--ease-spring), box-shadow .2s;
}
.sheet-head--submit #submitSave:not(:disabled) {
  box-shadow: 0 5px 18px rgba(255,107,74,.28);
}
.sheet-head--submit #submitSave:not(:disabled):active { transform: scale(.96); }
.sheet-head--submit #submitSave:disabled { opacity: .38; }
.sheet-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom));
}

/* --- voice-first submit --------------------------------------------------- */

.voice-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 16px;
  gap: 16px;
}

.voice-mic {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  width: 140px;
  height: 140px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

.voice-mic-icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  padding: 0;
  line-height: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7a55, var(--accent) 45%, #ff5533);
  color: #fff;
  box-shadow: 0 12px 40px rgba(255, 107, 74, 0.55), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform 0.2s var(--ease-spring);
}

.voice-mic-icon > svg {
  display: block;
  flex: 0 0 auto;
  transform: translateY(1px);
}

.voice-mic-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  transform: scale(0.8);
}
.voice-mic-ring--2 { animation-delay: 0.6s; }

.voice-mic.is-listening .voice-mic-icon {
  transform: scale(1.08);
  box-shadow: 0 8px 40px rgba(255, 107, 74, 0.5);
}

.voice-mic.is-listening .voice-mic-ring {
  animation: micPulse 1.8s var(--ease-out) infinite;
}

@keyframes micPulse {
  0% { opacity: 0.6; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.4); }
}

.voice-mic:active .voice-mic-icon { transform: scale(0.95); }
.voice-mic:disabled { opacity: 0.4; cursor: not-allowed; }
.voice-mic:disabled .voice-mic-icon { background: rgba(255,255,255,.15); box-shadow: none; }

.voice-status {
  font-size: .92rem;
  color: var(--dim);
  text-align: center;
  min-height: 1.4em;
  max-width: 280px;
  line-height: 1.4;
  transition: color 0.2s;
}
.voice-mic.is-listening ~ .voice-status,
.voice-hero:has(.voice-mic.is-listening) .voice-status {
  color: var(--accent);
}

.type-fallback {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 12px;
}
.type-fallback summary {
  cursor: pointer;
  font-size: .88rem;
  color: var(--dim);
  padding: 6px 0;
  list-style: none;
  transition: color 0.2s;
}
.type-fallback summary::-webkit-details-marker { display: none; }
.type-fallback summary::before { content: '▸ '; }
.type-fallback[open] summary::before { content: '▾ '; }
.type-fallback summary:hover { color: var(--text); }
.type-fallback .field { margin-top: 10px; margin-bottom: 0; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; font-size: .85rem; color: var(--dim); }
.detail-body {
  white-space: pre-wrap;
  line-height: 1.55;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(0,0,0,.2);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
}

.prompt-card {
  background: rgba(255,107,74,.1);
  border: 1px solid rgba(255,107,74,.25);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  animation: cardIn 0.35s var(--ease-out);
}
.prompt-card h4 { margin: 0 0 6px; font-size: .95rem; }
.prompt-card p { margin: 0 0 10px; font-size: .85rem; color: var(--dim); }

/* --- drill timeline (Cursor-style guided Q&A) ----------------------------- */
.submit-drill,
.detail-drill {
  margin-top: 12px;
  margin-bottom: 0;
}

.drill-timeline {
  animation: cardIn 0.35s var(--ease-out);
}

.drill-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.drill-hint {
  margin: 0;
  font-size: .85rem;
  color: var(--dim);
  line-height: 1.45;
  flex: 1;
}

.drill-progress {
  font-size: .78rem;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.interview-seed {
  margin: 0 0 18px 40px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.interview-seed-label {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.interview-seed p,
.interview-seed-input {
  margin: 0;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.interview-seed-input {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  resize: vertical;
}

.interview-seed-input:focus {
  outline: none;
}

.interview-seed.is-editing {
  border-color: rgba(255,107,74,.45);
  box-shadow: 0 0 0 3px rgba(255,107,74,.12);
}

.timeline-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 4px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s var(--ease-out);
}
.timeline-item:hover .timeline-q { color: var(--text); }
.timeline-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.timeline-item.is-entering .timeline-answer {
  animation: timelineAnswerIn 0.45s var(--ease-out);
}

.timeline-item.is-active {
  animation: timelineActiveIn 0.35s var(--ease-out);
}

.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.timeline-dot.is-done {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-dot.is-active {
  border-color: var(--accent);
  background: rgba(255,107,74,.2);
  box-shadow: 0 0 0 4px rgba(255,107,74,.15);
  animation: timelinePulse 1.8s ease-in-out infinite;
}

.timeline-line {
  flex: 1;
  width: 2px;
  min-height: 12px;
  margin: 4px 0;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border-radius: 1px;
}

.timeline-body {
  padding-bottom: 16px;
  min-width: 0;
}

.timeline-q {
  margin: 0 0 8px;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
}

.timeline-item.is-upcoming .timeline-q {
  font-weight: 500;
  color: rgba(154, 154, 168, 0.55);
  font-size: .82rem;
  margin-bottom: 0;
}

.timeline-item.is-upcoming .timeline-dot {
  border-color: rgba(255,255,255,.08);
  background: transparent;
}

.timeline-item.is-upcoming .timeline-line {
  background: rgba(255,255,255,.05);
}

.timeline-answer {
  margin: 0;
  padding: 10px 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: var(--text);
}

.timeline-answer--implicit {
  font-style: italic;
  color: var(--dim);
  font-size: .82rem;
}

.timeline-item.is-active .timeline-q {
  color: var(--accent);
}

.timeline-item.is-active .timeline-body {
  margin: -8px 0 10px;
  padding: 10px 12px 12px;
  background: rgba(255,107,74,.1);
  border: 1px solid rgba(255,107,74,.3);
  border-radius: 14px;
}

.timeline-composer {
  margin-top: 4px;
  padding: 12px;
  background: rgba(255,107,74,.08);
  border: 1px solid rgba(255,107,74,.22);
  border-radius: 14px;
  animation: cardIn 0.3s var(--ease-out);
}

.timeline-composer--freeform {
  margin-top: 12px;
}

.timeline-composer .timeline-q {
  margin-bottom: 10px;
  color: var(--text);
}

.drill-input { min-height: 72px; margin-bottom: 10px; }

.drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.drill-mic.is-listening {
  background: rgba(255,107,74,.25);
  border-color: var(--accent);
  color: var(--accent);
}

.drill-done {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.06);
}

@keyframes timelinePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,107,74,.12); }
  50% { box-shadow: 0 0 0 7px rgba(255,107,74,.22); }
}

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

@keyframes timelineActiveIn {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.detail-drill {
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(255,107,74,.06);
  border: 1px solid rgba(255,107,74,.18);
  border-radius: var(--radius);
}

.detail-drill.is-interview {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 360px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.detail-drill .drill-timeline--docked,
.submit-drill .drill-timeline--docked {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.drill-timeline-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 2px calc(238px + env(safe-area-inset-bottom));
  scroll-padding-top: 10px;
  -webkit-overflow-scrolling: touch;
}

.drill-dock.voice-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
  padding: 14px 16px 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(255,107,74,.16), transparent 52%),
    linear-gradient(180deg, rgba(38,44,60,.98), rgba(21,25,37,.99));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.3), 0 16px 44px rgba(0,0,0,.48);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.drill-dock-label {
  margin: 0 0 2px;
  font-size: .86rem;
  color: var(--dim);
  text-align: center;
}
.drill-dock-label strong { color: var(--text); }

.voice-hero--dock {
  padding: 4px 0 0;
  gap: 6px;
}

.voice-hero--dock .voice-mic {
  width: 96px;
  height: 96px;
}

.voice-hero--dock .voice-mic-icon {
  width: 64px;
  height: 64px;
}

.voice-hero--dock .drill-dock-status {
  min-height: 1.35em;
  max-width: none;
  margin: 0;
  color: var(--dim);
  font-size: .84rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.drill-dock-type {
  margin: 3px 0 0;
}
.drill-dock-type summary {
  cursor: pointer;
  list-style: none;
  font-size: .8rem;
  color: var(--dim);
  text-align: center;
  padding: 4px 0;
  user-select: none;
}
.drill-dock-type summary::-webkit-details-marker { display: none; }
.drill-dock-type[open] summary { margin-bottom: 8px; }

.drill-dock-input {
  display: block;
  width: 100%;
  min-height: 64px;
  margin: 8px 0;
  padding: 8px 10px;
  resize: vertical;
}

.drill-dock-type [data-drill-submit] {
  width: 100%;
}

.submit-drill {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.sheet-voice.is-interviewing {
  display: flex;
  flex-direction: column;
  width: min(100%, 620px);
  height: min(94dvh, 880px);
  max-height: 94dvh;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.sheet-voice.is-interviewing > .voice-hero,
.sheet-voice.is-interviewing > .type-fallback {
  display: none;
}

.sheet-voice.is-interviewing .submit-drill {
  display: flex;
}

.sheet-voice.is-interviewing .sheet-actions {
  display: none;
}

.sheet-voice.is-interviewing .drill-dock.voice-card {
  bottom: calc(10px + env(safe-area-inset-bottom));
}

.sheet-voice.is-interviewing .drill-timeline-scroll {
  padding-bottom: calc(340px + env(safe-area-inset-bottom));
}

.sheet-voice.is-interviewing .drill-timeline.is-dock-hidden .drill-timeline-scroll {
  padding-bottom: 12px;
}

.review-post {
  flex: 0 0 auto;
  padding: 12px 2px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(35,40,56,.92), rgba(26,31,46,.98));
}

.review-post .btn {
  min-height: 48px;
  font-size: 1rem;
}

.review-post-hint {
  margin: 8px 4px 0;
  color: var(--dim);
  font-size: .8rem;
  line-height: 1.4;
  text-align: center;
}

.sheet-interview .sheet-scroll {
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.sheet-interview .detail-drill.is-interview {
  display: block;
  min-height: 0;
  overflow: visible;
  margin-bottom: 20px;
}

.sheet-interview .detail-drill .drill-timeline--docked {
  display: block;
  min-height: 0;
}

.sheet-interview .detail-drill .drill-timeline-scroll {
  display: block;
  overflow: visible;
  padding: 4px 2px 12px;
  scroll-padding: 0;
}

.detail-drill.is-interview .drill-dock.voice-card {
  position: relative;
  inset: auto;
  max-width: none;
  margin: 4px 0 0;
  z-index: 1;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}

.detail-drill.is-interview .drill-timeline.is-dock-hidden .drill-timeline-scroll {
  padding-bottom: 12px;
}

.sheet-interview .comments-section {
  padding-bottom: 0;
}

.sheet-interview:has(.drill-timeline.is-dock-hidden) .comments-section,
.sheet-interview:not(:has(.detail-drill.is-interview .drill-dock)) .comments-section {
  padding-bottom: 0;
}

.admin-panel {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  background: rgba(255,255,255,.03);
}
.sheet-interview .admin-panel {
  position: static;
  margin-top: 4px;
  background: rgba(255,255,255,.035);
  box-shadow: none;
}
.admin-panel h3 { margin: 0 0 10px; font-size: .95rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-panel-head h3 { margin: 0; }
.admin-current-status {
  color: var(--dim);
  font-size: .78rem;
  font-weight: 650;
}
.admin-actions--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  margin-bottom: 0;
}
.admin-status-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--dim);
  font-size: .72rem;
  font-weight: 650;
}
.admin-status-select {
  width: 100%;
  min-height: 36px;
  padding: 6px 30px 6px 10px;
  font-size: .82rem;
}

.section-title { margin: 0 0 10px; font-size: .95rem; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment {
  background: rgba(0,0,0,.2);
  border-radius: 12px;
  padding: 10px 14px;
  animation: cardIn 0.3s var(--ease-out);
}
.comment.is-admin { border-left: 3px solid var(--accent); }
.comment.is-reply { margin-left: 16px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: .8rem; }
.comment-author { font-weight: 700; }
.comment-badge { color: var(--accent); font-weight: 600; }
.comment-body { margin: 0; white-space: pre-wrap; line-height: 1.45; font-size: .92rem; }
.comment-reply { margin-top: 8px; }

.row-btn { cursor: default; }
.row-btn small { display: block; margin-top: 2px; }
.inline-field { display: flex; gap: 8px; }
.inline-field .text-input { flex: 1; }

.admin-list .idea-card { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .idea-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  #adminList.idea-list { grid-template-columns: 1fr; }
}

/* >>> addon-styles */
/* <<< addon-styles */
