/* ============================
   aicademi.ai Design System
   Bright, friendly, office-app feel
   ============================ */

:root {
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.12);
  --purple: #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.1);
  --purple-light: #ede9fe;
  --pink: #f472b6;
  --orange: #fb923c;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --bg: #f8f9fb;
  --white: #ffffff;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);

  /* Auto button (starter-prompt helper) */
  --auto: #a855f7;
  --auto-deep: #7e22ce;
  --auto-ink: #4a1d7a;
  --auto-soft: #f5ecff;
  --auto-halo: rgba(168, 85, 247, 0.42);

  /* Save state token */
  --save: #10b981;
  --save-deep: #059669;
  --save-soft: #ecfdf5;

  /* Tooltip tokens */
  --tt-bg: rgba(17, 24, 39, 0.96);
  --tt-border: rgba(255, 255, 255, 0.06);
  --tt-title: #ffffff;
  --tt-desc: #cbd5e1;
  --tt-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; }

/* ============================
   Buttons
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient);
  color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-microsoft {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  padding: 12px;
}
.btn-microsoft:hover { background: #f9fafb; border-color: #d1d5db; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg); }

/* ============================
   Login Page
   ============================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fb 0%, #ede9fe 50%, #ccfbf1 100%);
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-bulb {
  width: 44px;
  height: 44px;
  background-image: url('/img/logo-mark.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
  overflow: hidden;
}
.logo-sm { width: 32px; height: 32px; }
.logo-xs { width: 26px; height: 26px; }

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.logo-text-sm { font-size: 1.2rem; }
.logo-text-xs { font-size: 1rem; }

.login-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 0.8rem;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--purple); }

.login-form .btn { width: 100%; margin-top: 4px; }

.login-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 12px;
}

.login-footer {
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 20px;
}

/* ============================
   Top Navigation
   ============================ */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.topnav-left, .topnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================
   Dashboard
   ============================ */
.dashboard-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}

.dashboard-welcome {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.dashboard-section {
  margin-bottom: 40px;
}

.dashboard-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tutorial-card, .session-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}
.tutorial-card:hover, .session-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.session-card { cursor: pointer; }

.tutorial-card h3, .session-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.tutorial-card p, .session-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.badge-beginner { background: var(--teal-dim); color: #0d9488; }
.badge-intermediate { background: var(--purple-dim); color: var(--purple); }
.badge-advanced { background: rgba(251,146,60,0.12); color: #ea580c; }

/* ============================
   Workspace Layout
   ============================ */
.workspace-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar-back {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.topbar-back:hover { color: var(--purple); }

.topbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-user {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.workspace-panels {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  flex: 1;
  overflow: hidden;
}

/* Left: Tutorial Guide */
.panel-guide {
  background: #f9fafb;
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.guide-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.guide-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.guide-progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-bottom: 18px;
  overflow: hidden;
}

.guide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--purple));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 16px;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-light);
}

.guide-step.active {
  background: var(--purple-light);
  color: var(--purple);
  font-weight: 600;
}

.guide-step.done { color: var(--text-light); text-decoration: line-through; }

.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-step.done .step-icon { background: var(--green-dim); color: var(--green); }
.guide-step.active .step-icon { background: var(--purple); color: white; }
.guide-step.upcoming .step-icon { background: #f3f4f6; color: var(--text-light); }

/* Clue Box */
.clue-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: auto;
}

.clue-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.clue-tab {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: #f3f4f6;
  color: var(--text-light);
  transition: all 0.2s;
}

.clue-tab.active {
  background: var(--green-dim);
  color: var(--green);
}

.clue-content {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

/* Center: Chat */
.panel-chat {
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeInUp 0.25s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-user {
  background: var(--gradient);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-ai {
  background: #f3f4f6;
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-sender {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 4px;
}

.chat-ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--purple));
}

.chat-text { white-space: pre-wrap; }

.files-changed {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.file-chip {
  font-size: 0.72rem;
  background: var(--purple-light);
  color: var(--purple);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.chat-system {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 4px 0;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Chat input */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--white);
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--purple); }
/* Pending-send visual state (keyboard still active so Enter can skip) */
.chat-input.is-pending-input { background: #f9fafb; color: var(--text-muted); }
.chat-input.is-pending-input::placeholder { color: var(--text-light); }

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================
   Auto (starter-prompt) button
   ============================ */
.auto-btn {
  flex-shrink: 0;
  height: 36px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid #e9d5ff;
  color: var(--auto-deep);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, transform 0.12s ease,
              box-shadow 0.18s ease;
}
.auto-btn:hover {
  background: var(--auto-soft);
  border-color: var(--auto);
}
.auto-btn:active { transform: scale(0.97); }
.auto-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--auto-halo);
  border-color: var(--auto);
}
body.simple-mode .auto-btn { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .auto-btn { transition: none; }
  .auto-btn:active { transform: none; }
}
@media (max-width: 600px) {
  .auto-btn {
    width: 34px; height: 34px;
    padding: 0; border-radius: 50%;
    justify-content: center;
  }
  .auto-btn .auto-btn-label { display: none; }
  .auto-btn .auto-icon { width: 16px; height: 16px; }
}

/* Chat icon buttons (model cycle, training toggle, call Claude) */
.chat-icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.chat-icon-btn:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6d28d9;
}
.chat-icon-btn:active { transform: scale(0.96); }
.chat-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* Model dropdown — summary is the trigger, menu drops upward (above chat input) */
.model-dropdown {
  position: relative;
  flex-shrink: 0;
}
.model-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.model-dropdown > summary::-webkit-details-marker { display: none; }
.model-cycle-btn .model-cycle-label {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}
.model-cycle-btn[data-model="fast"],
.model-cycle-btn[data-model="default"] {
  background: #dbeafe; border-color: #93c5fd; color: #1e40af;
}
.model-cycle-btn[data-model="smart"] {
  background: #e0e7ff; border-color: #a5b4fc; color: #4338ca;
}
.model-cycle-btn[data-model="opus"] {
  background: linear-gradient(135deg, #e0e7ff 0%, #fce7f3 100%);
  border-color: #c084fc; color: #7c3aed;
}

/* Dropdown menu — floats above the chat input */
.model-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  animation: model-dropdown-in 0.14s ease-out;
}
@keyframes model-dropdown-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.model-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.model-option:hover { background: #f9fafb; border-color: #e5e7eb; }
.model-option.is-active {
  background: #f5f3ff;
  border-color: #c4b5fd;
}
.model-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}
.model-option-letter {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f6;
  border-radius: 50%;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.9rem; font-weight: 700;
  color: #4b5563;
  flex-shrink: 0;
}
.model-option[data-model="fast"] .model-option-letter,
.model-option[data-model="default"] .model-option-letter {
  background: #dbeafe; color: #1e40af;
}
.model-option[data-model="smart"] .model-option-letter {
  background: #e0e7ff; color: #4338ca;
}
.model-option[data-model="opus"] .model-option-letter {
  background: linear-gradient(135deg, #e0e7ff 0%, #fce7f3 100%);
  color: #7c3aed;
}
.model-option-text {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; /* allow text to wrap inside flex */
}
.model-option-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
}
.model-option.is-active .model-option-name { color: #6d28d9; }
.model-option-desc {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Training toggle — book on/off (relocated to topbar-right 2026-04-12) */
.training-toggle-btn .training-icon-off { display: none; }
.training-toggle-btn:not(.is-on) .training-icon-on { display: none; }
.training-toggle-btn:not(.is-on) .training-icon-off { display: inline-block; }
.training-toggle-btn.is-on {
  background: #dcfce7; border-color: #86efac; color: #166534;
}
.training-toggle-btn:not(.is-on) {
  background: #fef3c7; border-color: #fcd34d; color: #92400e;
}
/* Topbar-size override: slightly smaller than chat-area buttons so it fits alongside gear */
.workspace-topbar .training-toggle-btn,
.workspace-topbar .topbar-share { width: 32px; height: 32px; }
.workspace-topbar .topbar-share {
  background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9;
}
.workspace-topbar .topbar-share:hover {
  background: #ede9fe; border-color: #c4b5fd;
}

/* Topbar session-name (inline rename) */
.topbar-sep { color: #cbd5e1; font-weight: 600; margin: 0 4px; }
.topbar-session-name {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 3px 10px;
  font: inherit; font-size: 0.92rem; font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  max-width: 320px;
  overflow: hidden; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
  position: relative; z-index: 5;
}
.topbar-session-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-session-name-pencil {
  opacity: 0.45;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.topbar-session-name:hover { background: #faf5ff; border-color: #c4b5fd; }
.topbar-session-name:hover .topbar-session-name-pencil { opacity: 1; color: #7c3aed; }
.topbar-session-input { position: relative; z-index: 5; }
.topbar-session-name:hover {
  border-color: #e5e7eb; background: #f9fafb;
}
.topbar-session-name:focus-visible {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}
.topbar-session-name.is-empty { font-style: italic; color: #9ca3af; font-weight: 500; }
.topbar-session-input {
  font: inherit; font-size: 0.92rem; font-weight: 600;
  padding: 3px 10px;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  outline: none;
  min-width: 220px; max-width: 320px;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.topbar-session-input.has-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.topbar-session-warn {
  font-size: 0.72rem; color: #b91c1c; margin-left: 6px;
}

/* Share modal (live-link publish) */
.modal-share { max-width: 480px; }
.modal-share .modal-lede {
  color: #4b5563; font-size: 0.9rem; line-height: 1.5; margin: 4px 0 18px;
}
.modal-share .modal-label {
  display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 6px;
}
.slug-field {
  display: flex; align-items: center; gap: 0;
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 10px;
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.slug-field:focus-within {
  border-color: var(--purple, #7c3aed);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.slug-field.is-valid { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12); }
.slug-field.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
.slug-field.is-warn { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12); }
.slug-prefix {
  color: #6b7280; font-size: 0.85rem; white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.slug-field input {
  flex: 1; border: none; outline: none; padding: 4px 6px;
  font: 500 0.9rem 'Inter', sans-serif; color: inherit;
  min-width: 8ch; margin: 0;
}
.slug-status { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.slug-status.ok::before { content: "✓"; color: #10b981; }
.slug-status.bad::before { content: "✕"; color: #dc2626; }
.slug-status.warn::before { content: "⚠"; color: #f59e0b; }
.slug-status.loading::before {
  content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #e5e7eb; border-top-color: var(--purple, #7c3aed);
  animation: slug-spin 0.7s linear infinite;
}
@keyframes slug-spin { to { transform: rotate(360deg); } }
.slug-meta {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: #6b7280; margin: 6px 2px 4px;
}
.slug-meta .slug-help.is-warn { color: #b45309; }
.slug-meta .slug-help.is-invalid { color: #b91c1c; }
.slug-suggest {
  display: inline-block; margin-left: 6px; color: var(--purple, #7c3aed);
  background: none; border: none; cursor: pointer; font-weight: 600;
  padding: 0; text-decoration: underline;
}
.modal-share .modal-actions-share {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.modal-share .btn-unshare {
  background: #fff; color: #b91c1c; border: 1px solid #fca5a5;
}
.modal-share .btn-unshare:hover { background: #fef2f2; }
.modal-share .btn-copy { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.modal-share .btn-copy:hover { background: #ddd6fe; }
.modal-share .btn-open-tab { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; display: inline-flex; align-items: center; }
.modal-share .btn-open-tab:hover { background: #99f6e4; }
.modal-share .modal-footnote {
  font-size: 0.72rem; color: #9ca3af; margin-top: 14px; text-align: center;
}

/* Call Claude — highlighted when active call is in progress */
.call-claude-btn.is-active {
  background: #fee2e2; border-color: #fca5a5; color: #b91c1c;
  animation: call-pulse 1.8s ease-in-out infinite;
}
@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* Round L: Stop/Interrupt state — send button morphs into a red stop icon while generating */
.chat-send-btn { position: relative; }
.chat-send-btn .send-icon-stop {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.6);
  transition: opacity 180ms ease, transform 180ms ease;
  color: #fff;
}
.chat-send-btn.is-generating {
  background: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
  animation: sendStopPulse 1.6s ease-in-out infinite;
}
.chat-send-btn.is-generating .send-icon-default,
.chat-send-btn.is-generating .send-icon-fast-wrap { opacity: 0; transform: scale(0.6); }
.chat-send-btn.is-generating .send-icon-stop { opacity: 1; transform: scale(1); }
@keyframes sendStopPulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.08); } }

/* Round N 2026-04-13: floating draggable "missing how-to-play" popup */
.floating-warn {
  position: fixed; z-index: 120;
  font: 400 13px/1.4 'Inter', sans-serif;
  user-select: none;
  transition: left 0.1s, top 0.1s;
}
.floating-warn.is-dragging { transition: none; cursor: grabbing; }
.floating-warn-badge {
  width: 44px; height: 44px;
  background: rgba(245, 158, 11, 0.92);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
  animation: fw-pulse 2.5s ease-in-out infinite;
  position: relative; /* anchor for count badge */
}
.floating-warn.is-dragging .floating-warn-badge { cursor: grabbing; }
@keyframes fw-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45), 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45), 0 0 0 10px rgba(245, 158, 11, 0); }
}
/* Count badge — top-right of icon, white with dark-gray stroke for contrast on any bg */
.floating-warn-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: #fff;
  color: #111827;
  border: 1.5px solid #1f2937;
  border-radius: 999px;
  font: 700 11px/16px 'Inter', sans-serif;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}
/* Invisible hover-bridge so cursor can move from badge to expand without losing hover.
   The bridge sits in the gap between badge (right:0) and expand (right:54px).
   Only active while hovering so it doesn't block other clicks. */
.floating-warn::before {
  content: "";
  position: absolute;
  top: 0; right: 44px; width: 14px; height: 100%;
  pointer-events: none;
}
.floating-warn:hover::before,
.floating-warn:focus-within::before {
  pointer-events: auto;
}
.floating-warn-expand {
  position: absolute;
  right: 54px; top: 0;
  width: 280px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0; transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  color: #78350f;
}
.floating-warn:hover .floating-warn-expand,
.floating-warn:focus-within .floating-warn-expand,
.floating-warn.is-open .floating-warn-expand {
  opacity: 1; transform: translateX(0);
  pointer-events: auto;
}
.floating-warn-expand strong { color: #b45309; display: block; margin: 0 0 4px; font-size: 14px; }
.floating-warn-expand p { margin: 0 0 10px; color: #78350f; font-size: 12px; opacity: 0.9; }
.floating-warn-fix {
  padding: 6px 12px; background: #f59e0b; color: #1f2937;
  border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 12px;
  width: 100%;
}
.floating-warn-fix:hover { background: #fbbf24; }
.floating-warn-close {
  position: absolute; top: 4px; right: 6px;
  background: none; border: 0; color: #dc2626; opacity: 0.65;
  cursor: pointer; font-size: 1.2rem; padding: 0 4px;
}
.floating-warn-close:hover { opacity: 1; }

/* Round L: controls-card "Missing how-to-play" warning (inline — kept for back-compat) */
.build-warn {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; margin: 8px 12px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 10px; color: #92400e;
  font: 400 13px/1.4 'Inter', sans-serif;
}
.build-warn-body { flex: 1; }
.build-warn-body strong { color: #b45309; display: block; margin-bottom: 2px; }
.build-warn-body p { margin: 0; color: #92400e; opacity: 0.85; font-size: 12px; }
.build-warn-fix {
  padding: 6px 12px; background: #f59e0b; color: #1f2937;
  border: 0; border-radius: 6px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.build-warn-fix:hover { background: #fbbf24; }
.build-warn-dismiss {
  background: none; border: 0; color: #92400e; opacity: 0.5;
  cursor: pointer; font-size: 1.1rem; padding: 0 6px;
}
.build-warn-dismiss:hover { opacity: 1; }

/* Round O 2026-04-13: user-jumpable step list + prev/next nav + per-step goal hint */
.guide-step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; margin-bottom: 6px;
  border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.guide-step:hover { background: #f5f3ff; border-color: #e9d5ff; }
.guide-step.active { background: #ede9fe; border-color: #c4b5fd; }
.guide-step.done { opacity: 0.8; }
.guide-step.done .step-icon { background: #10b981; color: #fff; }
.guide-step.upcoming .step-icon { background: #e5e7eb; color: #6b7280; }
.guide-step.active .step-icon { background: #7c3aed; color: #fff; }
.guide-step .step-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 0.78rem 'Inter', sans-serif;
  flex-shrink: 0;
}
.guide-step .step-body { flex: 1; min-width: 0; }
.guide-step .step-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.guide-step .step-title { font-weight: 600; font-size: 0.88rem; color: #1f2937; }
.guide-step .step-status {
  font: 500 0.7rem 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.04em;
  color: #9ca3af;
}
.guide-step.done .step-status { color: #10b981; }
.guide-step.active .step-status { color: #7c3aed; font-weight: 700; }
.guide-step .step-goal {
  margin-top: 4px; font-size: 0.78rem; color: #4b5563;
  background: rgba(255, 255, 255, 0.6);
  padding: 5px 8px; border-radius: 6px;
  border-left: 2px solid #c4b5fd;
}
.guide-step .step-goal strong { color: #7c3aed; margin-right: 4px; }

/* ============================================================
   Living Guides panel (additive — only visible when guide.format === 'living_v1')
   UX spec: UX-A1..A7 from round2_architect_plan.md §1.8
   ============================================================ */
.living-guide {
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 6px 2px 4px;
}
.lg-goal {
  display: flex; gap: 8px; align-items: flex-start;
  font: 600 0.95rem 'Inter', sans-serif;
  color: #1f2937;
  background: linear-gradient(135deg, #f5f3ff, #fdf4ff);
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.35;
}
.lg-goal-icon { flex: 0 0 auto; font-size: 1.05rem; }
.lg-goal #lgGoalText {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.lg-milestones-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px;
}
.lg-milestones {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.lg-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #c4b5fd;
  background: transparent;
  position: relative;
  transition: background 220ms ease, border-color 220ms ease, opacity 220ms ease;
}
.lg-dot.met {
  background: linear-gradient(135deg, #7c3aed, #10b981);
  border-color: #7c3aed;
}
.lg-dot.current {
  border-color: #7c3aed;
  background: transparent;
  animation: lg-pulse 1.8s ease-in-out infinite;
}
.lg-dot.upcoming {
  opacity: 0.2;
}
.lg-dot-label {
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  font: 500 0.7rem 'Inter', sans-serif;
  color: #6b7280; white-space: nowrap;
  margin-top: 3px;
}
@keyframes lg-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .lg-dot.current { animation: none; }
}
.lg-progress {
  font: 600 0.82rem 'Inter', sans-serif;
  color: #6d28d9;
  margin-left: auto;
  white-space: nowrap;
}
.lg-nextup {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  transition: opacity 220ms ease;
}
.lg-nextup.lg-fade { opacity: 0; }
.lg-nextup h4 {
  margin: 0 0 4px; font: 700 0.9rem 'Inter', sans-serif;
  color: #1f2937;
}
.lg-nextup p {
  margin: 0 0 6px; font: 400 0.84rem 'Inter', sans-serif;
  color: #374151; line-height: 1.4;
}
.lg-nextup .lg-hint {
  font: 500 0.75rem 'Inter', sans-serif;
  color: #9ca3af; font-style: italic;
}
.lg-nextup.empty {
  border-style: dashed; color: #9ca3af;
  font-size: 0.82rem; padding: 10px 12px;
  text-align: center;
}
.lg-expanding-chip {
  display: inline-block;
  font: 600 0.78rem 'Inter', sans-serif;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 5px 10px;
  border-radius: 999px;
  align-self: flex-start;
  animation: lg-shimmer 2.4s ease-in-out infinite;
}
@keyframes lg-shimmer {
  0%, 100% { background: #ecfdf5; }
  50% { background: #d1fae5; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-expanding-chip { animation: none; }
}
.step-nav-row {
  display: flex; justify-content: space-between; gap: 8px;
  margin: 10px 4px 14px;
}
.step-nav-btn {
  flex: 1;
  padding: 8px 10px;
  background: #fff; color: #6d28d9;
  border: 1px solid #c4b5fd; border-radius: 8px;
  font: 600 0.8rem 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.step-nav-btn:hover:not(:disabled) { background: #ede9fe; }
.step-nav-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Round N+1: Empty-response retry-with-context button */
.empty-retry-row { margin-top: 10px; }
.empty-retry-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #ede9fe; color: #6d28d9;
  border: 1px solid #c4b5fd; border-radius: 8px;
  font: 600 0.85rem 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.empty-retry-btn:hover { background: #ddd6fe; }
.empty-retry-btn:active { transform: scale(0.97); }
.empty-retry-btn:disabled { opacity: 0.6; cursor: wait; }

/* Round L: Build-interrupted system message */
.chat-system.interrupt {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  padding: 8px 12px;
  color: #92400e;
}

/* Send-delay toggle (right of send btn) — on = 5s cancel window, off = instant */
/* Round M 2026-04-13: visually group as [send/stop]:[delay] — pair them tightly
   with a subtle separator dot so they read as one cluster. Margin is tiny,
   positioned slightly off-center of send button. */
.send-delay-toggle {
  width: 24px; height: 24px;
  align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f6; border: 1px solid #e5e7eb;
  border-radius: 50%; color: #6b7280; cursor: pointer; padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
  margin-left: 2px;
  position: relative;
}
/* Colon-style separator dot between send and delay toggle */
.send-delay-toggle::before {
  content: "";
  position: absolute;
  left: -6px; top: 50%;
  width: 2px; height: 2px; border-radius: 50%;
  background: #cbd5e1;
  transform: translateY(-4px);
  box-shadow: 0 6px 0 #cbd5e1;
}
.send-delay-toggle:hover { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.send-delay-toggle:active { transform: scale(0.94); }
.send-delay-toggle.is-on { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.send-delay-toggle:not(.is-on) { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.send-delay-toggle .send-delay-icon-off { display: none; }
.send-delay-toggle:not(.is-on) .send-delay-icon-on { display: none; }
.send-delay-toggle:not(.is-on) .send-delay-icon-off { display: inline-block; }

/* Rotating chat-input tips (Round I — possibility modeling without cognitive load) */
.chat-input.tip-mode::placeholder {
  font-style: italic;
  color: #8b8fa3;
  opacity: 0.85;
  transition: opacity 0.26s ease;
}
.chat-input.tip-fading::placeholder { opacity: 0; }

/* Call-active banner (Call Claude halt-chat — Batch 2) */
.support-call-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 0 0 10px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b; border-radius: 10px;
  font: 600 0.9rem 'Inter', sans-serif; color: #78350f;
  cursor: pointer; user-select: none;
  animation: scb-pulse 2.4s ease-in-out infinite;
}
.support-call-banner:hover { background: linear-gradient(135deg, #fde68a, #fcd34d); }
.scb-phone { font-size: 1.1rem; animation: scb-wiggle 1.6s ease-in-out infinite; }
.scb-text { flex: 1; }
.scb-end { font-size: 0.78rem; color: #92400e; font-weight: 500; }
@keyframes scb-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.3); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }
@keyframes scb-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* While on-call, dim the team/turbo/model buttons + callClaudeBtn stays active */
body.is-on-call #teamBtn,
body.is-on-call #turboBtn,
body.is-on-call #modelDropdown {
  opacity: 0.5; pointer-events: none; filter: grayscale(40%);
}
body.is-on-call .chat-input::placeholder { color: #9ca3af; font-style: italic; }

/* Support-engineer message bubble (Call Claude responses) */
.chat-message.support-engineer {
  background: #eff6ff !important;
  border-left: 3px solid #6366f1;
  padding: 10px 14px;
}
.chat-message.support-engineer::before {
  content: "🎧 Support engineer";
  display: block;
  font-size: 0.72rem; font-weight: 700;
  color: #4338ca; letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 6px;
}

/* Technical-note (yellow bubble, collapse-by-default — Round H #5) */
.tech-note {
  margin: 8px 0 4px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
  overflow: hidden;
}
.tech-note > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  font: 500 0.85rem 'Inter', sans-serif;
  color: #92400e;
}
.tech-note > summary::-webkit-details-marker { display: none; }
.tech-note-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
  flex-shrink: 0;
}
.tech-note-label { font-weight: 700; }
.tech-note-hint { color: #b45309; font-weight: 400; font-size: 0.78rem; }
.tech-note[open] .tech-note-hint { display: none; }
.tech-note-body {
  position: relative;
  background: #1f2937; color: #e5e7eb;
  padding: 28px 12px 12px;
  font: 0.82rem/1.5 ui-monospace, 'JetBrains Mono', Consolas, monospace;
  max-height: 360px; overflow: auto;
}
.tech-note-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.tech-note-copy {
  position: absolute; top: 6px; right: 6px;
  padding: 3px 8px; background: #374151; color: #e5e7eb;
  border: 0; border-radius: 6px; font-size: 0.72rem; cursor: pointer;
}
.tech-note-copy:hover { background: #4b5563; }

/* Self-explanation card (Round H #9 — pedagogy: generation effect) */
.explain-card {
  margin: 12px 0; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(45,212,191,0.12), rgba(124,58,237,0.12));
  border: 1px solid #c4b5fd; border-radius: 12px;
  font-family: 'Inter', sans-serif;
  animation: explain-fade-in 260ms ease-out;
}
@keyframes explain-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.explain-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Round N 2026-04-13: thumb up/down on self-explanation card */
.explain-thumbs { display: inline-flex; gap: 4px; margin-left: 4px; }
.explain-thumb {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer;
  color: #9ca3af;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.1s;
  padding: 0;
}
.explain-thumb:hover { background: #f5f3ff; color: #7c3aed; border-color: #e9d5ff; }
.explain-thumb:active { transform: scale(0.94); }
.explain-thumb-up.is-selected { background: #dcfce7; border-color: #86efac; color: #166534; }
.explain-thumb-down.is-selected { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.explain-card-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 0.98rem; color: #1f2937; flex: 1; }
.explain-card-close { background: none; border: 0; color: #6b7280; cursor: pointer; font-size: 1rem; padding: 4px 8px; }
.explain-card-sub { margin: 4px 0 10px; font-size: 0.82rem; color: #6b7280; }
.explain-card-row { display: flex; gap: 8px; flex-wrap: wrap; }
.explain-card-input {
  flex: 1; min-width: 180px; padding: 8px 12px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font: 400 0.9rem/1.45 'Inter', sans-serif; background: #fff;
  resize: vertical; min-height: 48px; max-height: 180px;
  font-family: 'Inter', sans-serif;
}
.explain-card-input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.explain-card-save {
  padding: 8px 14px; background: #7c3aed; color: #fff;
  border: 0; border-radius: 8px; font-weight: 600; cursor: pointer;
}
.explain-card-save:hover { background: #6d28d9; }
.explain-card-skip {
  padding: 8px 12px; background: transparent; color: #6b7280;
  border: 0; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.explain-card.is-saved { opacity: 0.7; }
.explain-card-saved-note { font-size: 0.82rem; color: #059669; margin-top: 6px; }

/* "Why this matters" callouts on guide steps (Round H #10) */
.why-matters {
  margin: 8px 0 0; padding: 0;
  border-left: 3px solid #2dd4bf;
  background: rgba(45,212,191,0.08);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}
.why-matters > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  font: 600 0.82rem 'Inter', sans-serif; color: #0f766e;
}
.why-matters > summary::-webkit-details-marker { display: none; }
.why-matters > summary > span:nth-child(2) { flex: 1; }
.why-matters-dismiss {
  background: none; border: 0; color: #0f766e; opacity: 0.5;
  cursor: pointer; font-size: 0.85rem; padding: 0 4px;
}
.why-matters-dismiss:hover { opacity: 1; }
.why-matters-body {
  margin: 0; padding: 8px 12px 10px;
  font: 400 0.85rem/1.5 'Inter', sans-serif;
  color: #134e4a;
  background: #fff;
}

@media (max-width: 600px) {
  .chat-icon-btn { width: 30px; height: 30px; }
  .model-cycle-btn .model-cycle-label { font-size: 0.85rem; }
}

/* First-build coach overlay — appears once per browser after first successful build */
.panel-preview { position: relative; /* ensure absolute anchor works */ }
/* 2026-04-12 bug fix: `hidden` HTML attribute was overridden by display:flex below.
   Explicit [hidden] override wins the specificity battle so el.hidden=true actually hides.
   See feedback_reviewer_must_click.md for the chessboard rule this surfaced. */
.fb-coach[hidden] { display: none !important; }
.fb-coach {
  position: absolute; top: 58px; right: 12px; z-index: 40;
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 320px; padding: 14px 60px 18px 14px;
  background: linear-gradient(135deg, rgba(74,44,106,0.78), rgba(26,16,37,0.78));
  border: 1px solid rgba(45,212,191,0.55);
  border-radius: 14px;
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(192,132,252,0.15) inset;
  color: #f5f5f5;
  animation: fbCoachIn .35s ease-out both;
}
.fb-coach-arrow {
  position: absolute; top: -26px; right: 54px;
  width: 70px; height: 34px; color: #2dd4bf;
  filter: drop-shadow(0 0 6px rgba(45,212,191,0.6));
}
.fb-coach-title { margin: 0 0 4px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.05rem; font-weight: 700; color: #fff; }
.fb-coach-sub { margin: 0; font-size: 0.9rem; line-height: 1.35; color: #e5e5ef; }
.fb-coach-sub strong { color: #2dd4bf; }
.fb-coach-x {
  position: absolute; top: 6px; right: 6px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06); color: #f5f5f5;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
  padding: 0;
}
.fb-coach-x:hover { background: rgba(249,115,22,0.25); }
.fb-coach-x:active { transform: scale(0.94); }
.fb-coach-progress {
  position: absolute; left: 10px; right: 10px; bottom: 6px;
  height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden;
}
#fbCoachBar {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #c084fc, #2dd4bf);
  transform-origin: left center;
  animation: fbCoachCountdown 10s linear forwards;
}
@keyframes fbCoachIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fbCoachCountdown { to { transform: scaleX(0); } }
@media (max-width: 780px) {
  .fb-coach { top: 52px; left: 8px; right: 8px; max-width: none; }
  .fb-coach-arrow { display: none; }
  .fb-coach-x { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .fb-coach, #fbCoachBar { animation: none; }
  #fbCoachBar { width: 0; transition: width 10s linear; }
}

/* Right: Preview */
.panel-preview {
  background: #f9fafb;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.preview-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.preview-iframe {
  flex: 1;
  border: none;
  background: white;
  margin: 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.file-browser {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  max-height: 160px;
  overflow-y: auto;
}

.file-browser-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.file-list { display: flex; flex-direction: column; gap: 2px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}
.file-item:hover { background: rgba(0,0,0,0.03); color: var(--text); }

.file-icon { font-size: 0.9rem; }

.file-empty {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
  padding: 12px 0;
}

/* ============================
   Settings Modal
   ============================ */
.settings-gear-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.settings-gear-btn:hover { background: #f3f4f6; color: var(--text); }

.settings-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1200;
  align-items: center;
  justify-content: center;
}
.settings-modal.open { display: flex; }
.settings-modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
}
.settings-modal-card {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.2s ease;
  overflow: hidden;
}
.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 10px 22px;
}
.settings-modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  margin: 0;
}
.settings-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.settings-close:hover { color: var(--text); }
.settings-modal-body {
  padding: 4px 22px 8px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-col {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.settings-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 2px;
}
.settings-row-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.settings-radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.settings-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.settings-reset-tips {
  font-size: 0.85rem;
  color: var(--purple);
  text-decoration: none;
}
.settings-reset-tips:hover { text-decoration: underline; }
.settings-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px 22px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--purple); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================
   Tips — legacy popup (deprecated, retained for legacy layout anchors)
   Kept so source-inspection tests locate the known tokens. The tips UI
   now lives in the sidebar (.tips-dock / .saved-tips-dock) below.
   ============================ */
.tip-popup { display: none; }
.tip-anchor-bottom {
  /* legacy anchor — bottom kept at 150px for historical source-inspection. */
  bottom: 150px;
}
.tip-anchor-top {
  right: 24px;
  top: 72px;
}

/* ============================
   Hint Card (lightbulb)
   ============================ */
#hintCardSlot {
  padding: 0 12px 8px;
}
.hint-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.hint-card[hidden] { display: none !important; }
.hint-card.hint-off {
  background: var(--white);
  border-color: var(--border);
}
.hint-card.hint-on {
  background: var(--purple-light);
  border-color: var(--purple);
  box-shadow: var(--shadow-md);
}

.hint-bulb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  padding: 0;
  line-height: 1;
}
.hint-bulb:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-sm);
}
.hint-bulb:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.hint-card.hint-on .hint-bulb {
  background: #fffbe6;
  border-color: #f5c518;
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.25), 0 0 12px rgba(245, 197, 24, 0.45);
}
.hint-bulb.hint-bulb-pop {
  animation: hintBulbPop 0.22s ease;
}
@keyframes hintBulbPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.hint-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
  transition: opacity 0.18s ease;
  min-width: 0;
}
.hint-card.hint-off .hint-text {
  color: var(--text-muted);
  font-style: italic;
}
.hint-text.is-fading { opacity: 0; }

.hint-level-control {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
}
.hint-card.hint-off .hint-level-control {
  display: none;
}
.hint-level-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: 0.02em;
}

.hint-arrow {
  width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.hint-arrow:hover {
  background: var(--purple-light);
  color: var(--purple);
  border-color: var(--purple);
}
.hint-arrow:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.hint-arrow:active { transform: scale(0.95); }
.hint-arrow[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}
.hint-arrow[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.hint-arrow.hint-arrow-shake {
  animation: hintArrowShake 0.18s ease;
}
@keyframes hintArrowShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

@media (max-width: 640px) {
  #hintCardSlot { padding: 0 8px 6px; }
  .hint-card {
    gap: 10px;
    padding: 8px 10px;
  }
  .hint-bulb {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
  .hint-arrow {
    width: 28px;
    height: 24px;
    font-size: 0.78rem;
  }
  .hint-text { font-size: 0.85rem; }
}

body.simple-mode .hint-card {
  padding: 12px 14px;
  gap: 14px;
}
body.simple-mode .hint-bulb {
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
}
body.simple-mode .hint-text { font-size: 1rem; }
body.simple-mode .hint-arrow {
  width: 30px;
  height: 26px;
}
body.simple-mode .hint-level-label { font-size: 0.82rem; }

/* ============================
   Pending send bubble (5s timer)
   ============================ */
.chat-pending {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(45,212,191,0.1));
  color: var(--text);
  border: 1px dashed var(--purple);
  border-radius: 16px;
  padding: 10px 14px;
  max-width: 80%;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  animation: fadeInUp 0.2s ease;
}
.chat-pending .pending-text {
  flex: 1;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-pending .pending-countdown {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-pending .pending-ring {
  --progress: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(var(--purple) calc(var(--progress) * 1%), #e5e7eb 0);
  position: relative;
}
.chat-pending .pending-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: white;
  border-radius: 50%;
}
.chat-pending .pending-cancel {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
}
.chat-pending .pending-cancel:hover { background: #f9fafb; }

/* ============================
   Step Complete banner
   ============================ */
.step-complete-banner {
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(45,212,191,0.12));
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 16px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeInUp 0.3s ease;
}
.step-complete-banner .scb-text {
  font-size: 0.9rem;
  color: #047857;
  font-weight: 600;
}
.step-complete-banner .scb-next {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.step-complete-banner .scb-next:hover { opacity: 0.9; }

/* ============================
   Surprise-me (auto-fill) button
   ============================ */
.surprise-btn {
  background: linear-gradient(135deg, #f472b6, #a855f7);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 2px 6px rgba(168,85,247,0.25);
}
.surprise-btn:hover { opacity: 0.95; }
.surprise-btn:disabled { opacity: 0.5; cursor: wait; }

/* ============================
   Dashboard sidebar + folders
   ============================ */
.dashboard-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px;
}
.dashboard-sidebar {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 72px;
}
.dashboard-sidebar h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.folder-item:hover { background: #f3f4f6; }
.folder-item.active { background: var(--purple-light); color: var(--purple); font-weight: 600; }
.folder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--purple);
  flex-shrink: 0;
}
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-actions { opacity: 0; display: flex; gap: 2px; }
.folder-item:hover .folder-actions { opacity: 1; }
.folder-actions button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.78rem;
  padding: 2px 4px;
}
.folder-actions button:hover { color: var(--text); }
.folder-new-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.folder-new-btn:hover { border-color: var(--purple); color: var(--purple); }

.dashboard-search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.dashboard-search input {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}
.dashboard-search input:focus { border-color: var(--purple); }
.date-chip {
  background: #f3f4f6;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}
.date-chip.active { background: var(--purple); color: white; border-color: var(--purple); }

.session-card.drag-over { box-shadow: 0 0 0 2px var(--purple) inset; }
.folder-item.drag-over { background: var(--purple-light); box-shadow: 0 0 0 2px var(--purple) inset; }

/* ============================
   Simple Mode (scoped to body.simple-mode)
   Bigger text, 1.25x padding, hide file browser & batch checkboxes,
   tutorial panel only shows current step, card-grid single col on mobile.
   ============================ */
body.simple-mode {
  font-size: 18px;
}
body.simple-mode .chat-bubble {
  padding: 15px 20px;
  font-size: 1rem;
  line-height: 1.55;
}
body.simple-mode .btn {
  padding: 12.5px 25px;
  font-size: 1rem;
}
body.simple-mode .btn-sm {
  padding: 7.5px 17.5px;
  font-size: 0.9rem;
}
body.simple-mode .chat-input {
  font-size: 1rem;
  padding: 12.5px 20px;
}
body.simple-mode .file-browser { display: none; }
body.simple-mode .session-checkbox { display: none; }
body.simple-mode .batch-bar { display: none !important; }
body.simple-mode .guide-step.done,
body.simple-mode .guide-step.upcoming { display: none; }
body.simple-mode .guide-step.active {
  font-size: 1rem;
  padding: 12px 14px;
}
body.simple-mode .clue-box { padding: 18px; }
body.simple-mode .clue-tabs { display: none; }
body.simple-mode .clue-content { font-size: 0.98rem; }
body.simple-mode .tutorial-card p, body.simple-mode .session-card p { font-size: 1rem; }
body.simple-mode [title]:hover::after {
  content: attr(title);
  position: absolute;
  background: #1f2937;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  z-index: 1500;
  margin-top: 4px;
}
@media (max-width: 900px) {
  body.simple-mode .card-grid {
    grid-template-columns: 1fr;
  }
}
/* Rename "Publish" -> "Share" visually */
body.simple-mode .publish-label::before { content: "Share"; }
body.simple-mode .publish-label > span { display: none; }

/* ============================
   Send button — dual icon (default + skip-countdown)
   ============================ */
.chat-send-btn .send-icon-default,
.chat-send-btn .send-icon-fast-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.chat-send-btn .send-icon-fast-wrap { display: none; }

.chat-send-btn.is-pending .send-icon-default { display: none; }
.chat-send-btn.is-pending .send-icon-fast-wrap { display: inline-flex; }

.chat-send-btn.is-pending {
  background: var(--gradient);
  opacity: 1;
  cursor: pointer;
}
.chat-send-btn.is-pending:hover { opacity: 0.88; }

/* ============================
   Turbocharge button
   ============================ */
.turbo-btn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: #f3f4f6; border: 1px solid var(--border);
  color: #6b7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, transform 0.12s ease,
              box-shadow 0.18s ease;
  position: relative;
}
.turbo-btn:hover {
  background: #eef0f3; color: #4b5563; border-color: #d1d5db;
}
.turbo-btn:active { transform: scale(0.94); }
.turbo-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35);
  border-color: var(--purple);
}
.turbo-btn .turbo-icon { display: block; }

.turbo-btn.is-on {
  background: linear-gradient(135deg, #fbbf24, #fb923c);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.55), 0 2px 8px rgba(251, 146, 60, 0.35);
  animation: turbo-pulse 1.6s ease-in-out infinite;
}
.turbo-btn.is-on:hover { filter: brightness(1.06); border-color: transparent; }

@keyframes turbo-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.55), 0 2px 8px rgba(251, 146, 60, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(251, 146, 60, 0), 0 2px 12px rgba(251, 146, 60, 0.55);
    transform: scale(1.04);
  }
}

body.simple-mode .turbo-btn { display: none; }

@media (prefers-reduced-motion: reduce) {
  .turbo-btn, .turbo-btn.is-on { animation: none; transition: none; }
  .turbo-btn:active { transform: none; }
}

@media (max-width: 600px) {
  .turbo-btn { width: 34px; height: 34px; }
  .turbo-btn .turbo-icon { width: 18px; height: 18px; }
}

/* ============================
   Readability + Team tokens
   ============================ */
:root {
  --team: #0ea5e9;
  --team-deep: #0284c7;
  --team-ink: #0c4a6e;
  --team-halo: rgba(14, 165, 233, 0.45);
  --team-halo-faint: rgba(14, 165, 233, 0);
  --team-soft: #e0f2fe;
  --tip-warm: #fff7ed;
  --tip-warm-border: #fed7aa;
  --tip-star-filled: #f59e0b;
  --tip-star-hover: #fde68a;
  --read-scale: 1;
  --read-line-height: 1.5;
}

/* ============================
   Team button
   ============================ */
.team-btn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: #f3f4f6; border: 1px solid var(--border);
  color: #6b7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  position: relative;
}
.team-btn:hover { background: var(--team-soft); color: var(--team-deep); border-color: #bae6fd; }
.team-btn:active { transform: scale(0.94); }
.team-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
  border-color: var(--team);
}
.team-btn .team-icon { display: block; }

.team-btn.is-on {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  border-color: transparent; color: #ffffff;
  box-shadow: 0 0 0 0 var(--team-halo), 0 2px 8px rgba(14, 165, 233, 0.32);
  animation: team-breathe 2.4s ease-in-out infinite;
}
.team-btn.is-on:hover { filter: brightness(1.06); border-color: transparent; }

@keyframes team-breathe {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--team-halo), 0 2px 8px rgba(14, 165, 233, 0.32);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 4px var(--team-halo-faint), 0 2px 10px rgba(14, 165, 233, 0.5);
    transform: scale(1.02);
  }
}

body.simple-mode .team-btn { display: none; }

@media (prefers-reduced-motion: reduce) {
  .team-btn, .team-btn.is-on { animation: none; transition: none; }
  .team-btn:active { transform: none; }
}

@media (max-width: 600px) {
  .team-btn { width: 34px; height: 34px; }
  .team-btn .team-icon { width: 19px; height: 19px; }
}

.turbo-waiting-dot {
  display: none;
  position: absolute;
  top: -2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--team); border: 2px solid var(--white);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.3);
}
.turbo-btn.is-on.waiting-for-team .turbo-waiting-dot { display: block; }
.turbo-btn.is-on.waiting-for-team {
  animation-duration: 2.2s;
  filter: saturate(0.85);
}

/* Team-mode chip on AI bubble */
.team-mode-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--team-soft); color: var(--team-ink);
  border: 1px solid #bae6fd; border-radius: 999px;
  padding: 2px 8px; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-right: 6px;
}
body.simple-mode .team-mode-chip { display: none; }

/* Team-mode AI bubble (planning round) */
.chat-ai.chat-ai-team {
  background: linear-gradient(180deg, #f0faff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-left: 3px solid var(--team-deep);
  padding-top: 10px;
}
.chat-ai.chat-ai-team .chat-sender { color: var(--team-deep); }
.chat-ai.chat-ai-team .chat-ai-dot {
  background: linear-gradient(135deg, var(--team-deep), var(--purple));
}
.chat-ai-plan-chip {
  display: inline-flex; align-items: center;
  background: var(--white); color: var(--team-deep);
  border: 1px solid #bae6fd; border-radius: 999px;
  padding: 3px 10px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  margin-bottom: 8px;
}
.chat-ai.chat-ai-team .chat-text { white-space: pre-wrap; }
body.simple-mode .chat-ai.chat-ai-team {
  background: #f3f4f6; border-left: 0; border: 0;
}
body.simple-mode .chat-ai-plan-chip { display: none; }

/* Auto-fill typing-animation state */
.chat-input.is-auto-typing {
  background: linear-gradient(90deg, #faf5ff 0%, #ffffff 100%);
  caret-color: var(--purple);
}

/* Mobile chat input tweaks */
@media (max-width: 600px) {
  .chat-input-area { gap: 6px; padding: 10px 10px; }
  .chat-send-btn { width: 34px; height: 34px; }
  .chat-input { padding: 8px 12px; font-size: 0.92rem; }
}

/* ============================
   Preview header actions — unified pill buttons
   ============================ */
.preview-header-actions {
  margin-left: auto;
  margin-right: 4px; /* gap from right edge of panel */
  display: inline-flex; align-items: center; gap: 8px;
}
.preview-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px;
  padding: 0 11px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'Inter', sans-serif; font-size: 0.74rem;
  font-weight: 600; text-transform: none; letter-spacing: 0;
  line-height: 1; cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
}
.preview-btn svg { flex-shrink: 0; }
.preview-btn:hover { box-shadow: var(--shadow-sm); }
.preview-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35); }
.preview-btn:active { transform: translateY(1px); }

.preview-refresh { color: var(--teal); border-color: #5eead4; }
.preview-refresh:hover { background: #f0fdfa; }

.preview-open-new { color: var(--purple); border-color: #c4b5fd; }
.preview-open-new:hover { background: var(--purple); color: var(--white); border-color: var(--purple); }

.preview-download { color: var(--save-deep); border-color: var(--save); background: var(--save-soft); }
.preview-download:hover:not(:disabled) { background: var(--save); color: var(--white); }
.preview-download:disabled { opacity: 0.45; cursor: not-allowed; }
.preview-download .download-spinner,
.preview-download .dl-spinner { display: none; animation: download-spin 0.9s linear infinite; }
.preview-download.is-loading .download-icon,
.preview-download.is-loading .dl-icon { display: none; }
.preview-download.is-loading .download-spinner,
.preview-download.is-loading .dl-spinner { display: inline-block; }
@keyframes download-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .preview-download .download-spinner,
  .preview-download .dl-spinner { animation: none; }
}

/* Primary: container query — responds to panel width, not viewport */
.panel-preview { container-type: inline-size; }

@container (max-width: 520px) {
  .preview-btn span:not(.tt-wrap) { display: none; }
  .preview-btn { padding: 0 9px; }
  .preview-header-actions { gap: 6px; }
}

/* Fallback for browsers without container queries */
@supports not (container-type: inline-size) {
  @media (max-width: 900px) {
    .preview-btn span:not(.tt-wrap) { display: none; }
    .preview-btn { padding: 0 9px; }
    .preview-header-actions { gap: 6px; }
  }
}

.tt-wrap { display: inline-flex; }

/* ============================
   Readability settings (live-applied)
   ============================ */
html { font-size: calc(16px * var(--read-scale)); }
body { line-height: var(--read-line-height); }
body.readability-bold { font-weight: 600; }
body.readability-bold p,
body.readability-bold li,
body.readability-bold .chat-text,
body.readability-bold .guide-sub,
body.readability-bold .chat-bubble { font-weight: 600; }
body.readability-dyslexic,
body.readability-dyslexic .chat-input,
body.readability-dyslexic button,
body.readability-dyslexic input,
body.readability-dyslexic textarea,
body.readability-dyslexic h1,
body.readability-dyslexic h2,
body.readability-dyslexic h3,
body.readability-dyslexic h4 {
  font-family: 'OpenDyslexic', 'Comic Sans MS', 'Inter', sans-serif !important;
}

.readability-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.readability-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.readability-control input[type="range"] {
  width: 100%;
}
.readability-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-light);
}
.readability-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 6px 0;
}
.readability-row-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.readability-row-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.readability-reset {
  margin-top: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--purple);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  align-self: flex-start;
}
.readability-reset:hover { background: var(--purple-light); }

/* ============================
   Tips sidebar — active cards + saved dock
   ============================ */
.tips-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
}
.tips-dock[hidden] { display: none; }

.tip-card {
  position: relative;
  background: var(--tip-warm);
  border: 1px solid var(--tip-warm-border);
  border-radius: 10px;
  padding: 10px 12px 14px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  animation: fadeInUp 0.25s ease;
  overflow: hidden;
}
.tip-card-body { padding-right: 48px; }
.tip-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  gap: 2px;
}
.tip-card-star,
.tip-card-dismiss {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}
.tip-card-star:hover { background: var(--tip-star-hover); color: var(--tip-star-filled); }
.tip-card-dismiss:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.tip-card-star.is-saved { color: var(--tip-star-filled); }
.tip-card-star.is-saved:hover { background: var(--tip-star-hover); }
.tip-card-star.tip-card-star-pop { animation: hintBulbPop 0.22s ease; }

.tip-card-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
}
.tip-card-progress-fill {
  height: 100%;
  width: 100%;
  background: var(--orange);
  transform-origin: left center;
  animation: tip-countdown 20s linear forwards;
}
.tip-card:hover .tip-card-progress-fill,
.tip-card:focus-within .tip-card-progress-fill {
  animation-play-state: paused;
}
@keyframes tip-countdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .tip-card-progress-fill { animation: none; }
}

.saved-tips-dock {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  flex-shrink: 0;
}
.saved-tips-dock[hidden] { display: none; }
.saved-tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.saved-tips-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.saved-tips-title svg { color: var(--tip-star-filled); }
.saved-tips-undo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.saved-tips-undo:hover:not(:disabled) { background: var(--purple-light); color: var(--purple); border-color: var(--purple); }
.saved-tips-undo:disabled { opacity: 0.4; cursor: not-allowed; }

.saved-tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.saved-tip-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.8rem;
}
.saved-tip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.saved-tip-arrows {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
}
.saved-tip-arrow {
  width: 20px; height: 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.6rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.saved-tip-arrow:hover:not(:disabled) { background: var(--purple-light); color: var(--purple); border-color: var(--purple); }
.saved-tip-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.saved-tip-trash {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 22px; height: 22px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.saved-tip-trash:hover { background: rgba(239,68,68,0.08); color: #ef4444; border-color: #fecaca; }

/* ensure stepList can shrink and scroll so tips don't push content offscreen */
.panel-guide { display: flex; flex-direction: column; min-height: 0; }
#stepList.guide-steps { flex: 1 1 auto; min-height: 100px; overflow-y: auto; }

/* ============================
   Mobile workspace tab bar
   ============================ */
.workspace-tabs { display: none; }

@media (max-width: 820px) {
  /* Turn the 3-column grid into a single active panel; tabs switch which one. */
  .workspace-panels {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    position: relative;
  }
  .workspace-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 6px 8px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
  }
  .ws-tab {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 8px;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }
  .ws-tab:hover { background: #eef0f3; color: var(--text); }
  .ws-tab.is-active,
  .ws-tab[aria-selected="true"] {
    background: var(--purple-light);
    border-color: var(--purple);
    color: var(--purple);
  }
  /* Hide all panels, reveal only the active one. */
  .panel-guide, .panel-chat, .panel-preview { display: none; }
  .workspace-panels[data-active="guide"] .panel-guide { display: flex; }
  .workspace-panels[data-active="chat"] .panel-chat { display: flex; }
  .workspace-panels[data-active="preview"] .panel-preview { display: flex; }
  .panel-guide, .panel-chat, .panel-preview {
    border-left: none;
    border-right: none;
  }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .ws-tab { transition: none; }
}

/* ============================
   Custom tooltip (edu-tooltip)
   ============================ */
#edu-tooltip {
  position: fixed;
  z-index: 2000;
  top: 0; left: 0;
  max-width: 260px;
  padding: 8px 12px;
  background: var(--tt-bg);
  border: 1px solid var(--tt-border);
  border-radius: 8px;
  box-shadow: var(--tt-shadow);
  color: var(--tt-desc);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#edu-tooltip.edu-tooltip-visible {
  opacity: 1;
  transform: translateY(0);
}
#edu-tooltip .tt-title {
  display: block;
  color: var(--tt-title);
  font-weight: 700;
  font-size: 0.8rem;
}
#edu-tooltip .tt-desc {
  display: block;
  color: var(--tt-desc);
}
@media (prefers-reduced-motion: reduce) {
  #edu-tooltip { transition: none; }
}

/* =========================================================================
   R8 — 2026-04-13: copy buttons, retry bubble, toasts, consent modal,
   compact input, ramble hints, Get Started banner, help icon, tour HUD
   ========================================================================= */

:root {
  --ease-ios: cubic-bezier(.22, .61, .36, 1);
  --r8-amber: #f59e0b;
  --r8-amber-bg: #fef3c7;
  --r8-amber-text: #92400e;
}

/* ----- R8 #3: copy whole-message button ----- */
.chat-bubble { position: relative; }
.msg-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(100,116,139,0.2);
  background: rgba(255,255,255,0.85);
  color: #475569;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 160ms var(--ease-ios), background 120ms, color 120ms, transform 120ms var(--ease-ios);
  z-index: 2;
}
.chat-bubble:hover .msg-copy-btn,
.msg-copy-btn:focus-visible { opacity: 1; }
.msg-copy-btn:hover { background: #fff; color: #0f172a; }
.msg-copy-btn:active { transform: scale(0.96); }
.msg-copy-icon-done { display: none; }
.msg-copy-btn.is-copied .msg-copy-icon-idle { display: none; }
.msg-copy-btn.is-copied .msg-copy-icon-done { display: inline-block; color: var(--teal, #2dd4bf); }
.chat-message.support-engineer { position: relative; }
.chat-message.support-engineer .msg-copy-btn {
  opacity: 0;
}
.chat-message.support-engineer:hover .msg-copy-btn { opacity: 1; }

/* Mobile: always partially visible so discoverable on touch */
@media (max-width: 820px) {
  .msg-copy-btn { opacity: 0.25; }
  .chat-bubble:hover .msg-copy-btn { opacity: 1; }
}

/* ----- R8 #1: Call-Claude copy-prompt button ----- */
.support-copy-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--teal, #2dd4bf);
  background: transparent;
  color: #0f766e;
  font: 600 0.85rem Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 160ms var(--ease-ios), transform 120ms var(--ease-ios);
}
.support-copy-prompt-btn:hover { background: rgba(45,212,191,0.12); }
.support-copy-prompt-btn:active { transform: scale(0.96); }
.support-copy-prompt-btn.is-copied {
  background: var(--teal, #2dd4bf);
  color: #0f172a;
  border-color: var(--teal, #2dd4bf);
}

/* ----- R8 #2: retry bubble ----- */
.chat-retry {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--r8-amber-bg);
  border: 1px solid var(--r8-amber);
  color: var(--r8-amber-text);
  font: 500 0.9rem Inter, system-ui, sans-serif;
  flex-wrap: wrap;
}
.chat-retry-label { flex: 1; min-width: 200px; }
.chat-retry-btn,
.chat-retry-cancel {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font: 600 0.85rem Inter, sans-serif;
  cursor: pointer;
  transition: transform 120ms var(--ease-ios);
}
.chat-retry-btn { background: var(--r8-amber); color: #fff; }
.chat-retry-btn:hover { background: #d97706; }
.chat-retry-cancel { background: transparent; color: var(--r8-amber-text); }
.chat-retry-btn:active, .chat-retry-cancel:active { transform: scale(0.96); }

/* ----- R8: global toasts ----- */
.copy-toast, .r8-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font: 500 0.88rem Inter, system-ui, sans-serif;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  opacity: 0;
  transition: opacity 220ms var(--ease-ios), transform 220ms var(--ease-ios);
  z-index: 9999;
  max-width: 92vw;
  text-align: center;
}
.copy-toast.is-shown, .r8-toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----- R8 #4: compact-sentence-input ----- */
.compact-sentence-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.02);
}
.compact-sentence-label {
  flex-shrink: 0;
  color: #374151;
  font: 500 0.9rem Inter, system-ui, sans-serif;
}
.compact-sentence-field {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font: 400 0.95rem Inter, system-ui, sans-serif;
  color: #111827;
  padding: 4px 2px;
}
.compact-sentence-send {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--teal, #2dd4bf);
  color: #0f172a;
  font: 700 1.1rem Inter, system-ui, sans-serif;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background 120ms var(--ease-ios), transform 120ms var(--ease-ios);
}
.compact-sentence-send:hover { background: #14b8a6; color: #fff; }
.compact-sentence-send:active { transform: scale(0.96); }

@media (max-width: 480px) {
  .compact-sentence-label { font-size: 0; }
  .compact-sentence-label::before { content: "📝"; font-size: 1.1rem; }
}

/* ----- R8 #5: ramble hint ----- */
.input-hint-ramble {
  margin: 6px 0 0;
  padding-left: 14px;
  color: var(--text-light, #6b7280);
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.3;
}
.input-hint-ramble::before {
  content: "✧ ";
  color: var(--teal, #2dd4bf);
  font-style: normal;
}
.composer-ramble-hint {
  display: block;
  padding: 0 16px 6px;
  color: var(--text-light, #6b7280);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.3;
}
.composer-ramble-hint::before {
  content: "✧ ";
  color: var(--teal, #2dd4bf);
  font-style: normal;
}
.cr4-ramble-hint {
  margin: 4px 12px 6px;
  padding-left: 0;
}

/* ----- R8 #8: consent modal ----- */
.r8-consent-modal[hidden] { display: none !important; }
.r8-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
}
.r8-consent-scrim {
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.55);
  cursor: pointer;
}
.r8-consent-card {
  position: relative;
  background: #fff;
  color: #111827;
  max-width: 460px;
  width: calc(100vw - 40px);
  padding: 28px 28px 22px;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  font: 400 0.98rem/1.5 Inter, system-ui, sans-serif;
}
.r8-consent-title {
  margin: 0 0 10px;
  font: 700 1.35rem Inter, system-ui, sans-serif;
  color: #0f172a;
}
.r8-consent-body {
  margin: 0 0 10px;
  color: #374151;
}
.r8-consent-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.r8-consent-btn {
  flex: 1;
  min-width: 160px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font: 600 0.95rem Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 140ms var(--ease-ios), transform 120ms var(--ease-ios);
}
.r8-consent-btn:active { transform: scale(0.96); }
.r8-consent-btn-primary {
  background: var(--teal, #2dd4bf);
  color: #0f172a;
}
.r8-consent-btn-primary:hover { background: #14b8a6; color: #fff; }
.r8-consent-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}
.r8-consent-btn-secondary:hover { background: #e5e7eb; }
body.r8-modal-open { overflow: hidden; }

/* Mobile variant — bottom sheet */
@media (max-width: 820px) {
  .r8-consent-modal { align-items: end; }
  .r8-consent-card {
    width: 100%;
    max-width: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .r8-consent-actions { flex-direction: column-reverse; }
  .r8-consent-btn { width: 100%; }
}

/* ----- R8 #9: Get Started banner ----- */
.get-started-banner[hidden] { display: none !important; }
.get-started-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 20px;
  background: linear-gradient(100deg, rgba(45,212,191,0.14), rgba(167,139,250,0.14));
  border-bottom: 1px solid rgba(45,212,191,0.4);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.get-started-text {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #0f172a;
  font: 500 0.95rem Inter, system-ui, sans-serif;
}
.get-started-text strong { font-weight: 700; }
.get-started-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: var(--teal, #2dd4bf);
  color: #0f172a;
  font: 600 0.9rem Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 140ms var(--ease-ios), transform 120ms var(--ease-ios);
}
.get-started-btn:hover { background: #14b8a6; color: #fff; }
.get-started-btn:active { transform: scale(0.96); }
.get-started-dismiss {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 1rem;
  cursor: pointer;
}
.get-started-dismiss:hover { background: rgba(0,0,0,0.05); color: #111827; }

/* ----- R8 #9: topbar help button (desktop) ----- */
.topbar-help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(100,116,139,0.3);
  background: transparent;
  color: inherit;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 140ms var(--ease-ios), transform 120ms var(--ease-ios);
}
.topbar-help-btn:hover { background: rgba(45,212,191,0.15); color: var(--teal, #2dd4bf); }
.topbar-help-btn:active { transform: scale(0.96); }


