/* Robin — Mobile-first CSS */

:root {
  --coral: #f98277;
  --coral-dark: #e8706a;
  --coral-light: #fef2f1;
  --charcoal: #2d2d2d;
  --charcoal-soft: #4a4a4a;
  --white: #ffffff;
  --grey-50: #fafafa;
  --grey-100: #f3f4f6;
  --grey-200: #e5e7eb;
  --grey-300: #d1d5db;
  --grey-500: #6b7280;
  --grey-700: #374151;
  --green: #22c55e;
  --green-light: #dcfce7;
  --green-dark: #166534;
  --red: #ef4444;
  --amber-bg: #fef3c7;
  --amber-text: #92400e;
  --red-bg: #fee2e2;
  --red-text: #991b1b;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

/* Login */
.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.75rem;
  max-width: 360px;
  margin: 0 auto;
  width: 100%;
}

/* Mascot */
.mascot-wrap {
  text-align: center;
  margin-bottom: 0.5rem;
}

.mascot-img {
  width: 160px;
  height: auto;
}

/* Settings mascot with client name overlay */
.settings-mascot-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.settings-mascot-wide {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.mascot-screen-text {
  position: absolute;
  left: 6%;
  top: 36%;
  width: 50%;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--charcoal);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--coral);
  text-align: center;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}

.tagline {
  text-align: center;
  color: var(--grey-500);
  margin-bottom: 1.75rem;
  font-size: 0.8125rem;
}

/* Forms */
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

input::placeholder, textarea::placeholder {
  font-weight: 600;
  opacity: 0.7;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(249, 130, 119, 0.1);
}

label {
  display: block;
  margin-bottom: 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

label input, label textarea, label select {
  margin-top: 4px;
}

.hint {
  font-weight: 400;
  color: var(--grey-300);
  text-transform: none;
  letter-spacing: 0;
}

.field-group {
  margin-bottom: 0.75rem;
}

.field-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--charcoal-soft);
  margin-bottom: 6px;
}

.tone-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tone-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--grey-200);
  background: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-500);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tone-btn.active {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}

#login-form input {
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-align: center;
  letter-spacing: 0.1px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--coral);
  color: var(--white);
}
.btn-primary:active {
  background: var(--coral-dark);
}

.btn-secondary {
  background: var(--grey-100);
  color: var(--charcoal-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--coral);
  padding: 8px;
}

.btn-large {
  padding: 14px 11px;
  font-size: 0.875rem;
  border-radius: var(--radius);
  margin-top: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  display: block;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: var(--grey-500);
  padding: 4px;
}

/* Hamburger button */
.btn-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 28px;
}

.btn-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
}

/* Avatar button */
.btn-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  border: none;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 90;
  transition: opacity 0.2s;
}

.menu-overlay.hidden {
  display: none;
}

/* Menu drawer */
.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--white);
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.menu-drawer.open {
  transform: translateX(0);
}

.menu-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--grey-100);
}

.menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-user-email {
  font-size: 0.6875rem;
  color: var(--grey-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-items {
  flex: 1;
  padding: 8px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal);
  cursor: pointer;
  text-align: left;
}

.menu-item:hover, .menu-item:active {
  background: var(--grey-50);
}

.menu-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

.menu-footer {
  border-top: 1px solid var(--grey-100);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-footer .usage-badge {
  align-self: flex-start;
}

.menu-logout {
  color: var(--grey-500);
  padding: 12px 0;
}

.btn-settings-link {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  padding: 4px 8px;
}

.btn-back {
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  color: var(--charcoal);
  padding: 4px 8px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--grey-100);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

header h2 {
  font-size: 0.9375rem;
  font-weight: 700;
}

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.header-mascot-lg {
  width: 40px;
  height: auto;
}

.card-brand-stacked {
  text-align: center;
  margin-bottom: 16px;
}

.card-mascot-lg {
  width: 80px;
  height: auto;
  margin-bottom: 4px;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.content-area > .tab-bar {
  padding-top: 14px;
  flex-shrink: 0;
}

/* Usage badge */
.usage-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--grey-100);
  color: var(--grey-500);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.usage-badge.warning {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.usage-badge.limit {
  background: var(--red-bg);
  color: var(--red-text);
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--grey-100);
}

.tab {
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-300);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.2s, border-color 0.2s;
}

.tab.active {
  color: var(--charcoal);
  border-bottom-color: var(--charcoal);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
#tab-chat.active {
  overflow: hidden;
}

.hero-intro {
  font-size: 0.875rem;
  color: var(--grey-500);
  text-align: left;
  margin: 0 0 1.5rem;
  line-height: 1.5;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--grey-100);
}

.hero-intro p {
  margin: 0 0 4px;
}

.hero-intro p:first-child {
  font-weight: 700;
  color: var(--charcoal);
}

/* How it works dropdown */
.how-it-works {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.825rem;
  color: var(--grey-500);
}
.how-it-works summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--coral);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.how-it-works summary::-webkit-details-marker { display: none; }
.how-it-works summary::before {
  content: "▸";
  font-size: 0.75rem;
  transition: transform 0.2s;
}
.how-it-works[open] summary::before {
  transform: rotate(90deg);
}
.how-it-works ol {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  line-height: 1.6;
}
.how-it-works ol li {
  margin-bottom: 0.35rem;
}
.how-it-works ol li strong {
  color: var(--charcoal);
}

/* Format picker — pill toggle */
.format-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  background: var(--grey-100);
  border-radius: var(--radius);
  padding: 3px;
}

.format-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-500);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.format-btn.active {
  color: var(--white);
  box-shadow: var(--shadow);
}

.format-btn[data-format="quick_reel"].active {
  background: var(--coral);
}

.format-btn[data-format="reel"].active {
  background: #4ea59c;
}

.format-btn[data-format="carousel"].active {
  background: #ff8b59;
}

/* Source toggle — underline style */
.source-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 0.75rem;
  padding-left: 2px;
}

.toggle-btn {
  flex: none;
  padding: 0 0 5px;
  border: none;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-300);
  cursor: pointer;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toggle-btn.active {
  color: var(--charcoal);
  border-bottom-color: var(--charcoal);
}

.source-input {
  margin-bottom: 0;
}

/* Format-tinted input backgrounds */
.source-input.tint-quick_reel input,
.source-input.tint-quick_reel textarea {
  background: #fef2f1;
  border-color: rgba(249, 130, 119, 0.3);
}

.source-input.tint-reel input,
.source-input.tint-reel textarea {
  background: #eef9f8;
  border-color: rgba(78, 165, 156, 0.3);
}

.source-input.tint-carousel input,
.source-input.tint-carousel textarea {
  background: #fff4ee;
  border-color: rgba(255, 139, 89, 0.3);
}

/* Voice input */
.textarea-wrap {
  position: relative;
}

.textarea-wrap textarea {
  width: 100%;
  padding-right: 48px;
}

.btn-mic {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--grey-200);
  background: white;
  color: var(--grey-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-mic:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.btn-mic.recording {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
  animation: pulse-mic 1.5s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 130, 119, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(249, 130, 119, 0); }
}

.btn-mic.unsupported {
  display: none;
}

/* Tone chips */
.tone-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tone-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--grey-300);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-right: 2px;
}

.tone-chip {
  padding: 4px 10px;
  border: 1.5px solid var(--grey-200);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-500);
  cursor: pointer;
  transition: all 0.15s;
}

.tone-chip:active {
  transform: scale(0.96);
}

.tone-chip.active {
  border-color: var(--coral);
  background: var(--coral-light);
  color: var(--coral-dark);
}

/* Template bar */
.template-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.5rem;
}

.template-bar select {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.btn-delete-tpl {
  background: none;
  border: 1px solid #e5534b;
  color: #e5534b;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 32px;
  white-space: nowrap;
}

/* Result sections */
.result-section {
  margin-bottom: 0.5rem;
}

.result-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.result-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.btn-copy-section {
  background: none;
  border: none;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--coral);
  cursor: pointer;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-copy-section:active {
  opacity: 0.6;
}

.result-section pre {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.8125rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  max-height: 50vh;
  overflow-y: auto;
}

/* Refine bar */
.refine-bar {
  display: flex;
  gap: 8px;
  margin-top: 0.75rem;
}

.refine-bar input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8125rem;
}

.refine-bar .btn {
  width: auto;
  padding: 8px 16px;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Progress */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--grey-200);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 1.5rem auto 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#gen-progress {
  text-align: center;
  padding: 0.5rem 0;
}

#gen-status {
  color: var(--grey-500);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Result */
#gen-result {
  margin-top: 1rem;
}

.result-header {
  margin-bottom: 0.625rem;
}

.result-header h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  line-height: 1.4;
  color: var(--charcoal);
}

.scores {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.6875rem;
}

.score-pill {
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--grey-100);
  font-weight: 600;
  color: var(--grey-500);
}

.score-pill.good {
  background: var(--green-light);
  color: var(--green-dark);
}


#btn-copy-all {
  margin-bottom: 0;
}

/* Result action buttons — wrap on mobile */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-actions .btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  padding: 10px 8px;
  font-size: 0.75rem;
}

/* App launch icons */
.app-launch {
  text-align: center;
  margin-top: 0.75rem;
}

.app-launch-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  display: block;
  margin-bottom: 8px;
}

.app-launch-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  transition: transform 0.15s;
}

.app-icon:active {
  transform: scale(0.92);
}

/* History */
.history-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-100);
  cursor: pointer;
}

.history-item:last-child {
  border-bottom: none;
}

.history-title {
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 2px;
  line-height: 1.35;
}

.history-meta {
  font-size: 0.6875rem;
  color: var(--grey-500);
}

.history-script {
  display: none;
  margin-top: 10px;
}

.history-script.expanded {
  display: block;
}

.history-script pre {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  max-height: 50vh;
  overflow-y: auto;
}

.history-source {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--grey-100);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.history-source-label {
  font-weight: 700;
  color: var(--grey-500);
  display: block;
  margin-bottom: 2px;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.history-source a {
  color: var(--coral);
  word-break: break-all;
}

.history-source-text {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  color: var(--grey-700);
  max-height: 120px;
  overflow-y: auto;
}

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-copy-inline {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--coral);
  cursor: pointer;
  padding: 6px 12px;
  white-space: nowrap;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-copy-inline:active {
  background: var(--coral-light);
  border-color: var(--coral);
}

/* Read time pill — sits inline with score pills */
.readtime-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.readtime-pill.green {
  background: var(--green-light);
  color: var(--green-dark);
}

.readtime-pill.amber {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.readtime-pill.red {
  background: var(--red-bg);
  color: var(--red-text);
}

/* Source warning banner */
.source-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  color: var(--amber-text);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.source-warning .btn-icon {
  color: var(--amber-text);
  font-size: 1.125rem;
  padding: 4px 6px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Hooks panel */
.hooks-panel {
  margin-top: 0.75rem;
}

.hooks-title {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.hooks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hook-card {
  padding: 12px 14px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.8125rem;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.hook-card:active {
  transform: scale(0.98);
}

.hook-card.selected {
  border-color: var(--coral);
  background: var(--coral-light);
}

.hooks-loading {
  text-align: center;
  color: var(--grey-500);
  font-size: 0.75rem;
  padding: 12px 0;
}

/* Utilities */
.hidden { display: none !important; }
.error { color: var(--red); font-size: 0.75rem; margin-top: 0.375rem; }
.success { color: var(--green); font-size: 0.75rem; margin-top: 0.375rem; }
.muted { color: var(--grey-300); font-size: 0.8125rem; text-align: center; padding: 2rem 0; }

/* Login card */
.login-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-height: 420px;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--grey-100);
}

.auth-tab {
  flex: 1;
  padding: 10px 4px;
  background: none;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-300);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}

.auth-tab.active {
  color: var(--charcoal);
  border-bottom-color: var(--coral);
}

.auth-tab-content {
  display: none;
}
.auth-tab-content.active {
  display: block;
}

.auth-divider {
  text-align: center;
  margin: 1.25rem 0;
  position: relative;
  color: var(--grey-300);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--grey-200);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--charcoal);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-google:hover {
  background: var(--grey-50);
}

.btn-google:active {
  background: var(--grey-100);
  border-color: var(--grey-300);
}

.legal-links {
  text-align: center;
  font-size: 0.75rem;
  color: var(--grey-400);
  margin-top: 1.25rem;
}
.legal-links a {
  color: var(--grey-400);
  text-decoration: none;
}
.legal-links a:hover {
  color: var(--coral);
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.btn-link {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  padding: 4px 0;
}

.btn-link:hover {
  color: var(--coral-dark);
}

/* Settings cards */
.settings-card {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.settings-card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.settings-row-2 {
  display: flex;
  gap: 8px;
}

.settings-row-2 > label {
  flex: 1;
  min-width: 0;
}

/* Keep old class for compat */
.settings-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.settings-hint {
  font-size: 0.75rem;
  color: var(--grey-500);
  margin-bottom: 0.75rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--charcoal-soft);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.toggle-label input[type="checkbox"] {
  width: auto;
  -webkit-appearance: checkbox;
  appearance: checkbox;
  accent-color: var(--coral);
  cursor: pointer;
}

/* Name row (first + last side by side) */
.name-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.name-row input {
  flex: 1;
  min-width: 0;
}

.name-row label {
  flex: 1;
  min-width: 0;
}

/* Settings sections (legacy) */
.settings-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-100);
}

/* Team member rows */
.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
}

.team-member-row:last-child {
  border-bottom: none;
}

.team-member-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.team-member-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--charcoal);
}

.team-you {
  font-weight: 400;
  color: var(--grey-500);
  font-size: 0.75rem;
}

.team-member-email {
  font-size: 0.6875rem;
  color: var(--grey-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-remove-member {
  background: none;
  border: none;
  font-size: 1.125rem;
  color: var(--grey-300);
  cursor: pointer;
  padding: 4px 8px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.btn-remove-member:hover {
  color: var(--red);
}

/* Team invite bar */
.team-invite-bar {
  display: flex;
  gap: 8px;
  margin-top: 0.75rem;
}

.team-invite-bar input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8125rem;
}

.team-invite-bar .btn {
  width: auto;
  padding: 8px 16px;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Set password section */
.set-password-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-100);
}

.set-password-section input {
  margin-bottom: 0.5rem;
}

/* Install app screen */
.install-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.install-instructions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--charcoal-soft);
}

.install-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-icon {
  font-weight: 700;
  font-size: 1.1em;
}

.install-instructions p {
  font-size: 0.9rem;
  color: var(--grey-500);
  line-height: 1.5;
  text-align: center;
}

/* Plan picker */
.plan-picker-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.plan-trial-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--grey-500);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.plan-cards {
  display: flex;
  gap: 12px;
  width: 100%;
}

.plan-card {
  flex: 1;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  background: var(--white);
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card.popular {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.plan-popular-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--coral);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.plan-card-header {
  margin-bottom: 1rem;
}

.plan-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.plan-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--charcoal);
}

.plan-period {
  font-size: 0.75rem;
  color: var(--grey-500);
}

.plan-features {
  list-style: none;
  margin-bottom: 1rem;
  flex: 1;
}

.plan-features li {
  font-size: 0.75rem;
  color: var(--charcoal-soft);
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
  line-height: 1.3;
}

.plan-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 0.75rem;
}

.btn-start-trial {
  margin-top: auto;
}

/* Trial banner */
.trial-banner {
  padding: 8px 16px;
  background: var(--coral-light);
  border-bottom: 1px solid rgba(249, 130, 119, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--coral-dark);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trial-banner.hidden { display: none; }

.btn-end-trial {
  padding: 4px 12px;
  border: 1.5px solid var(--coral);
  background: var(--white);
  color: var(--coral);
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}

/* Subscription blocked */
.blocked-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.blocked-card p {
  font-size: 0.875rem;
  color: var(--grey-500);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Billing info in settings */
.billing-info {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.billing-row + .billing-row {
  border-top: 1px solid var(--grey-200);
}

.billing-label {
  font-size: 0.75rem;
  color: var(--grey-500);
  font-weight: 600;
}

.billing-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--charcoal);
}

.billing-value.status-trialing {
  color: var(--coral);
}

.billing-value.status-active {
  color: var(--green-dark);
}

.billing-value.status-past_due {
  color: var(--amber-text);
}

.billing-value.status-cancelled {
  color: var(--red);
}

/* Polling overlay */
.checkout-polling {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.checkout-polling .spinner {
  margin-bottom: 1rem;
}

.checkout-polling p {
  font-size: 0.875rem;
  color: var(--grey-500);
  font-weight: 600;
}

/* Decorative wave lines */
.wave-decor {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.wave-bl {
  bottom: -40px;
  left: -60px;
  width: 280px;
  height: 280px;
}

.wave-tr {
  top: -50px;
  right: -60px;
  width: 300px;
  height: 300px;
}

/* Ensure all content sits above waves */
#app {
  position: relative;
  z-index: 1;
}

/* Content Pillars */
.pillars-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.75rem;
  min-height: 28px;
}

.pillar-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--coral-light);
  color: var(--coral-dark);
  border: 1px solid rgba(249, 130, 119, 0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pillar-remove {
  background: none;
  border: none;
  font-size: 0.875rem;
  color: var(--coral);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.pillars-add-bar {
  display: flex;
  gap: 8px;
}

.pillars-add-bar input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.8125rem;
}

.pillars-add-bar .btn {
  width: auto;
  padding: 6px 14px;
  font-size: 0.75rem;
}

/* School holiday state checkboxes */
.state-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.state-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--charcoal);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.state-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin-top: 0;
  accent-color: var(--coral);
  cursor: pointer;
  -webkit-appearance: checkbox;
}

/* Last pillar hint */
.last-pillar-hint {
  font-size: 0.7rem;
  color: var(--grey-500);
  margin-bottom: 0.5rem;
}

/* Pillar balance bar */
.pillar-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 8px 12px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
}

.pillar-bar-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.pillar-bar-chip {
  padding: 2px 8px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--grey-500);
}

.pillar-bar-chip strong {
  color: var(--coral);
  font-weight: 700;
  margin-left: 2px;
}

/* Pillar tags */
.pillar-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--coral-light);
  color: var(--coral-dark);
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.pillar-tag-sm {
  padding: 1px 6px;
  background: var(--coral-light);
  color: var(--coral-dark);
  border-radius: 12px;
  font-size: 0.625rem;
  font-weight: 600;
}

/* Performance logs */
.btn-perf-log {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: var(--grey-50);
  border: 1.5px dashed var(--grey-200);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-perf-log:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-light);
}

.perf-logged {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-top: 8px;
  background: var(--green-light);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.perf-metrics {
  font-weight: 600;
  color: var(--green-dark);
}

.btn-perf-edit {
  background: none;
  border: none;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-500);
  cursor: pointer;
  padding: 2px 6px;
}

.perf-form {
  margin-top: 8px;
  padding: 12px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
}

.perf-form select {
  margin-bottom: 8px;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.perf-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.perf-field {
  font-size: 0.625rem;
  margin-bottom: 0;
}

.perf-field input {
  padding: 6px 8px;
  font-size: 0.8125rem;
}

.perf-actions {
  display: flex;
  gap: 8px;
}

.perf-actions .btn {
  padding: 6px 16px;
  font-size: 0.75rem;
}

.perf-actions .btn-ghost {
  padding: 6px 8px;
}

/* Performance insights */
.perf-insights {
  margin-bottom: 1rem;
}

.insights-card {
  padding: 12px 14px;
  background: var(--green-light);
  border-radius: var(--radius-sm);
}

.insights-title {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.insights-line {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark);
  line-height: 1.5;
}

/* Inspiration panel */
.btn-inspiration {
  display: inline-block;
  background: none;
  border: 1.5px solid var(--grey-200);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.15s;
}

.btn-inspiration:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.inspiration-panel {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.inspiration-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.inspiration-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inspiration-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
}

.inspiration-event {
  padding: 10px;
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-sm);
}

.inspiration-event-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.inspiration-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.inspiration-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--charcoal);
}

.inspiration-desc {
  display: block;
  font-size: 0.6875rem;
  color: var(--grey-500);
  line-height: 1.3;
}

.angle-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.angle-pill {
  padding: 4px 10px;
  background: var(--coral-light);
  border: 1px solid rgba(249, 130, 119, 0.2);
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--coral-dark);
  cursor: pointer;
  transition: all 0.15s;
}

.angle-pill:hover {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}

/* Site footer — persistent privacy/terms links */
.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* -----------------------------------------------------------------------
   Chat UI
   ----------------------------------------------------------------------- */

/* Chat messages container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Message bubbles */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: chatFadeIn 0.25s ease-out;
  max-width: 100%;
}

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

/* Robin (left-aligned) */
.chat-msg.robin {
  flex-direction: row;
}

.chat-msg .chat-avatar {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-msg .chat-avatar img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: cover;
  display: block;
}

.chat-msg.robin .chat-bubble {
  background: var(--grey-50);
  border: 1px solid var(--grey-100);
  border-radius: 2px 14px 14px 14px;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--charcoal);
  max-width: 85%;
}

/* User (right-aligned) */
.chat-msg.user {
  flex-direction: row-reverse;
}

.chat-msg.user .chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-msg.user .chat-bubble {
  background: var(--coral);
  color: var(--white);
  border-radius: 14px 2px 14px 14px;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  max-width: 80%;
  word-break: break-word;
}

/* Thinking (animated dots) */
.chat-msg.thinking .chat-bubble {
  background: var(--grey-50);
  border: 1px solid var(--grey-100);
  border-radius: 2px 14px 14px 14px;
  padding: 10px 14px;
  max-width: 85%;
}

.thinking-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--grey-500);
}

.thinking-dots {
  display: flex;
  gap: 3px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  animation: thinkingBounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinkingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.thinking-status {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generation result card */
.chat-msg.generation-result {
  flex-direction: row;
}

.chat-result-card {
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: 14px;
  padding: 16px;
  max-width: 100%;
  width: 100%;
  box-shadow: var(--shadow);
}

.chat-result-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 6px;
  line-height: 1.4;
}

.chat-result-scores {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.chat-result-sections {
  margin-bottom: 12px;
}

.chat-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-result-actions .btn {
  flex: 1 1 calc(50% - 3px);
  min-width: 0;
  padding: 8px 6px;
  font-size: 0.7rem;
}

.chat-app-launch {
  text-align: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--grey-100);
}

.chat-app-launch .app-launch-label {
  margin-bottom: 6px;
}

/* Suggestion pills (tappable) */
.chat-msg.suggestion .chat-bubble {
  background: var(--grey-50);
  border: 1px solid var(--grey-100);
  border-radius: 2px 14px 14px 14px;
  padding: 10px 14px;
  max-width: 85%;
}

.suggestion-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.suggestion-pill {
  padding: 6px 14px;
  background: var(--white);
  border: 1.5px solid var(--coral);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.suggestion-pill:active {
  background: var(--coral);
  color: var(--white);
  transform: scale(0.96);
}

/* System message (centred, muted) */
.chat-msg.system {
  justify-content: center;
}

.chat-msg.system .chat-bubble {
  background: transparent;
  font-size: 0.6875rem;
  color: var(--grey-300);
  text-align: center;
  padding: 4px 8px;
}

/* Chat input bar */
.chat-input-bar {
  flex-shrink: 0;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--grey-100);
}

/* Format pills */
.format-pills {
  display: flex;
  gap: 6px;
  padding: 0 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.format-pills::-webkit-scrollbar { display: none; }

.format-pill {
  padding: 4px 12px;
  border: 1.5px solid var(--grey-200);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-500);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.format-pill.active {
  border-color: var(--coral);
  background: var(--coral);
  color: var(--white);
}

.format-pill[data-format="reel"].active {
  background: #4ea59c;
  border-color: #4ea59c;
}

.format-pill[data-format="carousel"].active {
  background: #ff8b59;
  border-color: #ff8b59;
}

/* Pillar pills */
.pillar-pills {
  display: flex;
  gap: 6px;
  padding: 0 0 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pillar-pills::-webkit-scrollbar { display: none; }
.pillar-pills:empty { display: none; }

.pillar-pill {
  padding: 3px 10px;
  border: 1.5px solid var(--grey-200);
  border-radius: 16px;
  background: var(--white);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--grey-500);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pillar-pill.active {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--white);
}

/* Pillar balance bar (Chat tab top) */
.pillar-balance {
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
  flex-shrink: 0;
}

.pillar-balance-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 10px;
}

.pillar-balance-title .hint {
  font-weight: 400;
  color: var(--grey-500);
}

.pillar-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pillar-bar-row.pillar-low .pillar-bar-label {
  color: var(--coral);
}

.pillar-bar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--charcoal);
  min-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pillar-bar-track {
  flex: 1;
  height: 8px;
  background: var(--grey-100);
  border-radius: 4px;
  overflow: hidden;
}

.pillar-bar-fill {
  height: 100%;
  background: var(--coral);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.pillar-bar-row.pillar-low .pillar-bar-fill {
  background: var(--grey-200);
}

.pillar-bar-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-500);
  min-width: 16px;
  text-align: right;
}

/* Chat input row */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 70px;
  max-height: 120px;
  padding: 9px 12px;
  border: 1.5px solid var(--grey-200);
  border-radius: 20px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--charcoal);
  background: var(--grey-50);
  resize: none;
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color 0.15s;
}

.chat-input-row textarea:focus {
  outline: none;
  border-color: var(--coral);
  background: var(--white);
}

.chat-input-row textarea::placeholder {
  font-weight: 500;
  opacity: 0.6;
}

.btn-mic-chat, .btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-mic-chat {
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  color: var(--grey-500);
}

.btn-mic-chat:hover { border-color: var(--coral); color: var(--coral); }

.btn-mic-chat.recording {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
  animation: pulse-mic 1.5s ease-in-out infinite;
}

.btn-mic-chat.unsupported { display: none; }

.btn-send {
  background: var(--coral);
  color: var(--white);
}

.btn-send:disabled {
  background: var(--grey-200);
  color: var(--grey-300);
  cursor: default;
}

.btn-send:not(:disabled):active {
  transform: scale(0.92);
  background: var(--coral-dark);
}

/* -----------------------------------------------------------------------
   Content tab (card grid)
   ----------------------------------------------------------------------- */

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-bottom: 16px;
  overflow: hidden;
  max-width: 100%;
}

.content-card:nth-last-child(1) { opacity: 0.3; }
.content-card:nth-last-child(2) { opacity: 0.5; }
.content-card:nth-last-child(3) { opacity: 0.7; }
.content-card.expanded { opacity: 1; }

.content-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
}

.content-card:active {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.content-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.content-format-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  color: var(--white);
}

.content-format-badge.quick_reel { background: var(--coral); }
.content-format-badge.reel { background: #4ea59c; }
.content-format-badge.carousel { background: #ff8b59; }

.content-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  color: var(--grey-500);
  flex-wrap: wrap;
}

.content-card-score {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.625rem;
}

.content-card.expanded {
  border-color: var(--coral);
}

.content-card-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-100);
}

.content-section {
  margin-bottom: 10px;
}

.content-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.content-section-text {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--grey-700, #444);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.btn-copy-content {
  margin-top: 10px;
  font-size: 0.75rem;
  padding: 6px 16px;
}

/* -----------------------------------------------------------------------
   Brand tab
   ----------------------------------------------------------------------- */

.brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--grey-100);
  margin-bottom: 16px;
}

.brand-mascot {
  width: 40px;
  height: auto;
}

.brand-intro {
  font-size: 0.875rem;
  color: var(--grey-500);
  font-weight: 500;
}

#brand-form-container .settings-card {
  margin-bottom: 12px;
}

#brand-form-container .btn-large {
  margin-bottom: 16px;
}

/* -----------------------------------------------------------------------
   Onboarding in chat
   ----------------------------------------------------------------------- */

.onboarding-pill {
  padding: 8px 16px;
  background: var(--white);
  border: 1.5px solid var(--coral);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  transition: all 0.15s;
}

.onboarding-pill:active {
  background: var(--coral);
  color: var(--white);
}

/* Safe area for notch devices */
@supports (padding-top: env(safe-area-inset-top)) {
  header {
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .login-container {
    padding-top: calc(2rem + env(safe-area-inset-top));
  }
}

/* -----------------------------------------------------------------------
   Pre-signup onboarding
   ----------------------------------------------------------------------- */

.ob-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem 2rem;
  min-height: 100vh;
}

/* Progress row: back arrow — dots — (spacer) */
.ob-progress-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 28px;
  flex-shrink: 0;
  position: relative;
}

.ob-back {
  position: absolute;
  left: 0;
  background: none;
  border: none;
  color: var(--coral);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.ob-back.visible {
  opacity: 1;
  pointer-events: auto;
}

.ob-back:hover {
  background: var(--coral-light);
}

.ob-back:active {
  transform: scale(0.9);
}

.ob-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.ob-progress-segment {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--grey-200);
  transition: background 0.3s ease, transform 0.3s ease;
}

.ob-progress-segment.active {
  background: var(--coral);
}

/* Steps */
.ob-step {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: obFadeIn 0.35s ease-out;
}

.ob-step.active {
  display: flex;
}

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

.ob-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--charcoal);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.25;
}

.ob-subheading {
  text-align: center;
  color: var(--grey-500);
  font-size: 0.8125rem;
  margin-bottom: 1.75rem;
}

/* Role cards */
.ob-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 2rem;
}

.ob-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.ob-card:hover {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.ob-card:active {
  transform: scale(0.98);
  background: var(--coral-light);
  border-color: var(--coral);
}

.ob-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--coral-light);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--charcoal);
  display: block;
}

.ob-card-sub {
  font-size: 0.75rem;
  color: var(--grey-500);
  display: block;
  margin-top: 2px;
}

/* Footer link */
.ob-footer-link {
  text-align: center;
  font-size: 0.75rem;
  color: var(--grey-500);
  margin-top: auto;
  padding-top: 1rem;
}

/* Website form */
.ob-form {
  width: 100%;
}

.ob-url-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.ob-url-wrap:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(249, 130, 119, 0.15);
}

.ob-url-prefix {
  padding: 14px 0 14px 14px;
  font-size: 1rem;
  color: var(--grey-500);
  flex-shrink: 0;
  user-select: none;
}

.ob-url-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 1rem;
  padding: 14px 14px 14px 2px;
  background: transparent;
}

.ob-input-lg {
  font-size: 1rem !important;
  padding: 14px 16px !important;
  border-radius: var(--radius) !important;
  text-align: center;
}

.ob-skip-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
}

/* Honeypot — invisible to humans */
.ob-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

/* Turnstile widget */
.ob-turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0 0;
  min-height: 0;
}

/* Analysis card */
.ob-analysis-card {
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}

.ob-analysis-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 1rem 0;
}

.ob-analysis-spinner .spinner {
  margin: 0;
}

.ob-analysis-status {
  font-size: 0.8125rem;
  color: var(--grey-500);
  font-weight: 600;
}

/* Brand preview — extracted data appearing live */
.ob-brand-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ob-preview-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: obFieldSlide 0.4s ease-out;
}

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

.ob-preview-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-500);
}

.ob-preview-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.35;
}

.ob-hidden {
  display: none !important;
}

/* Robin reaction after analysis */
.ob-reaction {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  animation: obFieldSlide 0.5s ease-out;
}

.ob-reaction-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.ob-reaction-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--coral-dark);
  font-style: italic;
  margin: 0;
  line-height: 1.35;
}

/* Sample hook card */
.ob-sample-hook {
  background: var(--grey-50);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 1.5rem;
  max-width: 340px;
  width: 100%;
  animation: obFieldSlide 0.5s ease-out;
}

.ob-hook-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-500);
  margin: 0 0 6px;
}

.ob-hook-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0;
  line-height: 1.4;
}

/* Robin intro */
.ob-robin-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 1rem;
}

.ob-robin-img {
  width: 120px;
  height: auto;
  margin-bottom: 0.5rem;
}

.ob-robin-img-sm {
  width: 80px;
  height: auto;
  margin-bottom: 1rem;
}

/* Speech bubble */
.ob-speech-bubble {
  position: relative;
  background: var(--coral-light);
  border: 1.5px solid rgba(249, 130, 119, 0.25);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 1.5rem;
  max-width: 320px;
}

.ob-speech-bubble::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(249, 130, 119, 0.25);
}

.ob-speech-bubble::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--coral-light);
}

.ob-speech-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--coral-dark);
  line-height: 1.35;
  margin: 0;
}

.ob-features {
  list-style: none;
  text-align: left;
  margin: 0 0 2rem;
  padding: 0;
}

.ob-features li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 0.875rem;
  color: var(--charcoal-soft);
  line-height: 1.4;
}

.ob-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--coral);
  font-weight: 700;
  font-size: 0.875rem;
}

/* Inline signup form on step 4 */
.ob-signup-form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-name-row {
  display: flex;
  gap: 8px;
}

.ob-name-row input {
  flex: 1;
  min-width: 0;
}

.ob-plan-toggle {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ob-plan-btn {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ob-plan-btn.active {
  border-color: var(--coral);
  background: var(--coral-light);
  box-shadow: 0 0 0 1px var(--coral);
}

.ob-plan-btn:hover:not(.active) {
  border-color: var(--grey-300);
}

.ob-plan-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--charcoal);
}

.ob-plan-price {
  font-size: 0.75rem;
  color: var(--grey-500);
}

.ob-plan-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--coral);
  color: var(--white);
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ob-trial-note {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--grey-500);
  margin: 0;
}

@supports (padding-top: env(safe-area-inset-top)) {
  .ob-container {
    padding-top: calc(0px + env(safe-area-inset-top));
  }
}
