:root {
  --bg: #f6f9fc;
  --card: #ffffff;
  --text: #2b3644;
  --muted: #7b8a9c;
  --accent: #4f8ef7;
  --accent-soft: #eaf2fe;
  --accent-hot: #e5484d;
  --border: #e4ebf3;
  --shadow: 0 1px 2px rgba(38, 60, 92, .05), 0 8px 24px rgba(38, 60, 92, .07);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(38, 60, 92, .06);
  transition: box-shadow .15s, transform .1s;
}
.btn:hover { box-shadow: 0 3px 10px rgba(38, 60, 92, .12); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 6px 14px; font-size: 13px; }

/* Landing */
.landing { max-width: 760px; margin: 0 auto; padding: 72px 24px; }
.landing h1 { font-size: clamp(34px, 7vw, 56px); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 18px; }
.answer-first { font-size: 19px; color: var(--muted); max-width: 58ch; }
.cta-row { margin: 32px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 56px 0; }
.features div { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.features h3 { font-size: 16px; margin-bottom: 8px; }
.features p { color: var(--muted); font-size: 14px; }
.faq h2 { font-size: 18px; margin: 32px 0 8px; }
.faq p { color: var(--muted); }

/* App */
.app-body { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); }
.pill {
  font-size: 12px; color: var(--muted); background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px;
}
.pill.accent { color: var(--accent); background: var(--accent-soft); border-color: #cfe1fc; }
.google-btn { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.grow { flex: 1; }
.who { font-size: 13px; color: var(--muted); }
.app-main { max-width: 660px; width: 100%; margin: 0 auto; padding: 32px 20px 72px; }

.talk-section { text-align: center; padding: 32px 0; }
.talk-btn {
  width: min(220px, 60vw); aspect-ratio: 1; border-radius: 50%;
  border: 3px solid var(--accent); background: var(--card); color: var(--text);
  font-size: 18px; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 30px rgba(79, 142, 247, .18);
  transition: transform .1s, background .15s, border-color .15s, box-shadow .15s;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.talk-btn:hover { box-shadow: 0 14px 36px rgba(79, 142, 247, .26); }
.talk-btn.recording {
  background: var(--accent-hot); border-color: var(--accent-hot); color: #fff;
  transform: scale(1.06); animation: pulse 1.2s infinite;
}
.talk-btn.busy { opacity: .6; pointer-events: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px rgba(229, 72, 77, .12); } }
.options-row { margin-top: 22px; display: flex; gap: 20px; justify-content: center; font-size: 14px; color: var(--muted); }
.upload-row { margin-top: 16px; }
.upload-row label.busy { opacity: .6; pointer-events: none; }

/* Inline notice: upload progress + persistent, dismissible errors */
.notice {
  margin: 16px auto 0; max-width: 480px; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow);
}
.notice.error { border-color: #f3c4c6; background: #fdf2f2; color: #b3261e; }
.notice-row { display: flex; align-items: center; gap: 10px; }
#notice-text { flex: 1; overflow-wrap: anywhere; }
.notice-close {
  border: 0; background: none; cursor: pointer; color: inherit;
  font-size: 18px; line-height: 1; padding: 0 2px;
}
.progress { margin-top: 8px; height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .2s; }

/* First-run persona onboarding (activation — docs/01-MVP.md §5) */
.onboard { margin: 8px 0 16px; text-align: center; }
.onboard-title { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.persona-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  font-size: 13px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.chip:hover { box-shadow: 0 3px 10px rgba(38, 60, 92, .12); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.try-list { list-style: none; margin-top: 16px; display: grid; gap: 8px; }
.try-list li {
  background: var(--card); border: 1px dashed var(--border); border-radius: 12px;
  padding: 10px 16px; font-size: 14px; color: var(--muted); text-align: left;
}
.try-list li::before { content: "💬 "; }

.result-section { margin-top: 8px; }
.result-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.translation-card { margin-top: 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.translation-card p { white-space: pre-wrap; font-size: 17px; }
.result-card p[contenteditable] { outline: none; white-space: pre-wrap; font-size: 17px; }
.shared-text { white-space: pre-wrap; font-size: 18px; }
.result-meta { margin: 12px 0; font-size: 12px; color: var(--muted); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
select.btn { appearance: auto; }

.history-section { margin-top: 44px; }
.history-section h2 { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.history-list { list-style: none; }
.history-list li {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 8px; font-size: 14px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: box-shadow .15s;
}
.history-list li:hover { box-shadow: var(--shadow); }
.history-list li.muted { color: var(--muted); cursor: default; box-shadow: none; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(38, 60, 92, .16);
  padding: 10px 22px; border-radius: 999px; font-size: 14px; z-index: 10;
}
.watermark { margin-top: 24px; color: var(--muted); font-size: 14px; }
.shared-card { margin-top: 40px; }

/* Compact AEO answers below the app (the landing page's FAQ, kept on-page) */
.app-faq { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 24px; }
.app-faq h2 { font-size: 15px; margin: 16px 0 4px; }
.app-faq p { color: var(--muted); font-size: 14px; }
