:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #18222d;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }

.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  background: #fff;
  border-bottom: 1px solid #dfe5ea;
}

.brand { color: #17212b; font-weight: 750; text-decoration: none; }
.stage-label, .eyebrow, .hint, .optional, .save-note, .ai-note { color: #687785; }
.stage-label { font-size: 14px; }
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav a { color: #435464; font-size: 14px; font-weight: 650; text-decoration: none; }
.main-nav a:hover { color: #125dc8; }
.main-nav form { margin: 0; }
.logout-button { padding: 5px 9px; border: 1px solid #c9d1d8; border-radius: 6px; background: #fff; color: #344554; font: inherit; font-size: 13px; cursor: pointer; }
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 32px auto 64px; }

.panel {
  background: #fff;
  border: 1px solid #dde4e9;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgb(25 42 62 / 7%);
}

.hero, .completion-panel { max-width: 760px; margin: 64px auto; padding: 48px; }
.login-panel { max-width: 460px; margin: 64px auto; padding: 40px; }
.history-panel { max-width: 900px; margin: 24px auto; padding: 40px; }
.artifact-panel { max-width: 980px; margin: 24px auto; padding: 40px; }
.interview-panel, .preview-panel { max-width: 840px; margin: 24px auto; padding: 40px; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 750; }
h1 { margin: 0 0 14px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
.lead { margin: 0; color: #4f5e6b; font-size: 17px; }
.feature-list { margin: 28px 0; padding-left: 22px; }
.feature-list li { margin: 7px 0; }
.hero-actions, .form-actions, .suggestion-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-actions form, .form-actions form { margin: 0; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { background: #1769e0; color: #fff; }
.button.secondary { background: #fff; color: #263747; border-color: #bfc9d1; }
.button.danger { background: #b93636; color: #fff; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 14px; background: #1769e0; color: #fff; }
.button:disabled, .text-button:disabled { opacity: .6; cursor: wait; }

.progress-nav {
  max-width: 840px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.progress-item { color: #6c7984; text-decoration: none; font-size: 12px; }
.progress-item span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  border: 1px solid #cbd3da;
  border-radius: 50%;
  background: #fff;
}
.progress-item strong { font-weight: 600; }
.progress-item.active { color: #125dc8; }
.progress-item.active span { background: #1769e0; color: #fff; border-color: #1769e0; }
.progress-item.done span { background: #e6f2eb; color: #18733c; border-color: #9ec7ad; }
.progress-item.locked { opacity: .55; cursor: default; }

.step-heading { padding-bottom: 28px; border-bottom: 1px solid #e3e8ec; }
.current-project { margin: 0 0 8px; color: #536474; font-size: 14px; }
.question { margin: 0; padding: 28px 0; border: 0; border-bottom: 1px solid #e3e8ec; }
.question legend { width: 100%; padding: 0; font-size: 17px; font-weight: 730; }
.required, .optional { float: right; margin-left: 12px; font-size: 12px; font-weight: 600; }
.required { color: #a63838; }
.hint { margin: 6px 0 12px; font-size: 14px; }

textarea, input[type="text"] {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #b8c3cc;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}
input[type="password"] {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #b8c3cc;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}
input[type="password"]:focus { outline: 3px solid #cfe2ff; border-color: #1769e0; }
.login-form { margin-top: 26px; }
.login-form label { display: block; margin: 16px 0 7px; font-weight: 700; }
.login-button { width: 100%; margin-top: 22px; }
.login-error { margin: 14px 0 0; color: #a72d2d; font-size: 14px; font-weight: 650; }
textarea { min-height: 118px; resize: vertical; }
textarea:focus, input[type="text"]:focus { outline: 3px solid #cfe2ff; border-color: #1769e0; }
.has-error textarea, .has-error input[type="text"] { border-color: #b94141; }
.field-error { color: #a72d2d; margin: 8px 0 0; font-size: 14px; font-weight: 650; }

.choice-list { display: grid; gap: 9px; }
.choice { display: flex; gap: 10px; padding: 11px 12px; border: 1px solid #d4dbe1; border-radius: 8px; cursor: pointer; }
.choice:has(input:checked) { border-color: #1769e0; background: #eef5ff; }
.choice input { margin-top: 4px; }

.ai-tools { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.text-button { padding: 0; border: 0; background: none; color: #125dc8; font: inherit; font-weight: 650; cursor: pointer; }
.ai-note { font-size: 12px; }
.suggestion { margin-top: 14px; padding: 16px; border: 1px solid #b9d2f5; border-radius: 8px; background: #f1f6fd; }
.suggestion-label { margin: 0 0 6px; color: #125dc8; font-size: 12px; font-weight: 750; text-transform: uppercase; }
.suggestion [data-suggestion-text] { margin: 0 0 12px; white-space: pre-wrap; }
.form-actions { justify-content: space-between; margin-top: 28px; }
.save-note { margin: 12px 0 0; text-align: right; font-size: 12px; }

.preview-section { padding: 28px 0; border-bottom: 1px solid #e1e7eb; }
.preview-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.preview-heading h2 { margin: 0; font-size: 21px; }
.preview-heading a { color: #125dc8; }
.preview-section dl { margin: 18px 0 0; }
.answer-row { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 24px; padding: 12px 0; }
.answer-row dt { color: #5c6a76; }
.answer-row dd { margin: 0; white-space: pre-wrap; }
.empty-answer { color: #8a959d; font-style: italic; }
.preview-panel > .form-actions { margin-top: 32px; }

.breadcrumb { margin-bottom: 24px; color: #71808c; font-size: 13px; }
.breadcrumb a { color: #125dc8; }
.notice { margin: 0 0 24px; padding: 13px 15px; border-radius: 8px; font-size: 14px; }
.notice.success { background: #e6f4eb; border: 1px solid #a8cfb6; color: #176637; }
.notice.warning { background: #fff5dc; border: 1px solid #e3c77f; color: #755716; }
.toolbar, .artifact-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 24px 0; }
.artifact-actions form { margin: 0; }
.project-list, .version-list { display: grid; gap: 12px; margin-top: 30px; }
.project-card, .version-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px; border: 1px solid #dbe2e7; border-radius: 10px; color: inherit; text-decoration: none; }
.project-card:hover, .version-card:hover { border-color: #8ab3ec; background: #f8fbff; }
.project-card h2, .version-card h2 { margin: 0 0 4px; font-size: 18px; }
.project-card p, .version-card p { margin: 0; color: #71808c; font-size: 13px; }
.version-count { padding: 5px 9px; border-radius: 999px; background: #edf2f6; font-size: 13px; white-space: nowrap; }
.artifact-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status-pill { padding: 5px 8px; border-radius: 999px; background: #f0f2f4; color: #697680; font-size: 12px; }
.status-pill.ready { background: #e3f2e8; color: #176637; }
.empty-state { margin-top: 30px; padding: 34px; border: 1px dashed #bcc8d1; border-radius: 10px; text-align: center; }
.empty-state h2 { margin-top: 0; }
.continue-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 26px 0; padding: 18px; border: 1px solid #ccd8e0; border-radius: 10px; background: #f8fafb; }
.continue-card p { margin: 4px 0 0; color: #687785; font-size: 14px; }
.sticky-actions { position: sticky; top: 12px; z-index: 2; padding: 12px; border: 1px solid #dbe3e8; border-radius: 10px; background: rgb(255 255 255 / 95%); box-shadow: 0 8px 20px rgb(20 35 50 / 8%); }
.markdown-document { margin-top: 28px; font-size: 15px; line-height: 1.65; }
.markdown-document h1 { margin-top: 0; font-size: 30px; }
.markdown-document h2 { margin-top: 30px; padding-bottom: 7px; border-bottom: 1px solid #e1e7eb; font-size: 20px; }
.markdown-document code { padding: 2px 4px; border-radius: 4px; background: #eef2f5; }
.prompt-document { margin-top: 28px; padding: 24px; border: 1px solid #dce3e8; border-radius: 10px; background: #f8fafb; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy-source { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: pre-wrap; }
.copy-status { flex-basis: 100%; color: #a33a2b; font-size: 13px; }
.copy-status:empty { display: none; }

.starter-panel { max-width: 820px; margin: 36px auto; padding: 44px; }
.starter-welcome { text-align: center; }
.starter-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0 20px; }
.starter-choice-grid form { margin: 0; }
.starter-choice {
  position: relative; width: 100%; min-height: 180px; padding: 24px; border: 1px solid #b9c9d5;
  border-radius: 12px; background: #fff; color: #18222d; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.starter-choice:hover { border-color: #1769e0; background: #f5f9ff; }
.starter-choice.is-disabled { cursor: default; color: #687785; background: #f7f8f9; border-color: #d7dde2; }
.starter-choice.is-disabled:hover { border-color: #d7dde2; background: #f7f8f9; }
.coming-soon { position: absolute; top: 12px; right: 12px; padding: 3px 8px; border-radius: 999px; background: #e8edf1; color: #596875; font-size: 12px; font-weight: 700; }
.starter-choice-icon { font-size: 36px; }
.starter-choice strong { font-size: 19px; }
.starter-choice small { color: #687785; }
.starter-intro-steps { max-width: 610px; margin: 30px auto; padding-left: 24px; text-align: left; }
.starter-intro-steps li { margin: 12px 0; }
.starter-intro-action { margin-top: 30px; }
.starter-intro-action .button { min-width: 180px; }
.field-hint { margin: 5px 0 10px; color: #687785; font-size: 14px; }
.starter-hint { color: #687785; font-size: 14px; }
.starter-return { display: inline-block; margin-top: 16px; }
.starter-progress { margin: 0 0 8px; color: #687785; font-size: 13px; font-weight: 700; }
.starter-form { margin-top: 28px; }
.starter-form > textarea { min-height: 260px; font-size: 17px; line-height: 1.6; }
.starter-actions { margin-top: 24px; }
.voice-placeholder { margin-top: 32px; padding: 38px; border: 1px dashed #aebdca; border-radius: 12px; text-align: center; background: #f8fafb; }
.voice-placeholder > span { font-size: 42px; }
.voice-placeholder h2 { margin: 10px 0 6px; font-size: 20px; }
.voice-placeholder p { margin: 0 0 22px; color: #687785; }
.voice-recorder { margin-top: 30px; padding: 30px; border: 1px solid #b9c9d5; border-radius: 12px; text-align: center; background: #f8fafb; }
.voice-state { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; }
.voice-state-icon { font-size: 30px; }
.voice-timer { min-width: 56px; font-variant-numeric: tabular-nums; color: #536474; }
.voice-message { margin: 14px auto 20px; color: #596875; }
.voice-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.voice-text-fallback { display: inline-block; margin-top: 18px; }
.voice-recorder[data-state="recording"] { border-color: #d96a6a; background: #fff5f5; }
.voice-recorder[data-state="recording"] .voice-state-icon { animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-recorder[data-state="processing"] { border-color: #82aee8; background: #f3f8ff; }
.voice-recorder[data-state="success"] { border-color: #80bb94; background: #f1f9f4; }
.voice-recorder[data-state="error"] { border-color: #d2a06d; background: #fff9f2; }
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: .65; }
}
.understanding-card { margin: 26px 0; padding: 18px; border-radius: 10px; background: #f1f6fd; }
.understanding-card p { margin: 7px 0 0; white-space: pre-wrap; }
.clarification-question { margin: 0; padding: 24px 0; border: 0; border-bottom: 1px solid #e1e7eb; }
.clarification-question legend { margin-bottom: 12px; font-size: 18px; font-weight: 730; }
.clarification-question textarea { min-height: 76px; }
.clarification-question .text-button { margin-top: 8px; }
.starter-result .prompt-document { margin-top: 10px; }
.prompt-preview { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.prompt-preview.is-collapsed { max-height: 230px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
.prompt-preview.is-collapsing { transition: max-height .32s ease; }
.prompt-preview-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 28px; }
.prompt-preview-heading h2 { margin: 0; font-size: 20px; }
.prompt-preview-heading span { color: #687785; font-size: 13px; }
.prompt-toggle { display: inline-block; margin-top: 10px; }
.copy-instruction { margin: 26px 0 0; color: #425362; }
.starter-copy-actions { margin-top: 24px; }
.starter-copy-button { min-width: 250px; font-size: 17px; }
.next-steps { margin-top: 28px; padding: 24px; border: 1px solid #a8cfb6; border-radius: 10px; background: #f0f8f3; }
.next-steps h2 { margin: 0 0 14px; font-size: 22px; }
.next-steps li { margin: 7px 0; }
.next-steps p { margin: 18px 0 0; font-weight: 650; }
.starter-secondary-actions { display: flex; gap: 16px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #cee0d4; align-items: center; }
.starter-secondary-actions form { margin: 0; }
.starter-secondary-actions a, .starter-secondary-actions button { padding: 0; border: 0; background: none; color: #66766d; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.agent-video-guide { margin-top: 18px; padding: 24px; border: 1px solid #d5e0e7; border-radius: 12px; background: #fff; opacity: 0; transform: translateY(10px); transition: opacity .28s ease, transform .28s ease; }
.agent-video-guide.is-visible { opacity: 1; transform: translateY(0); }
.agent-video-guide h2 { margin: 0 0 8px; font-size: 22px; }
.agent-video-guide p { margin: 0 0 18px; color: #596875; }
.agent-video-guide video { display: block; width: 100%; height: auto; border-radius: 10px; background: #111; }
@media (prefers-reduced-motion: reduce) {
  .prompt-preview.is-collapsing, .agent-video-guide { transition: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.completion-panel { text-align: center; }
.completion-panel .hero-actions { justify-content: center; margin-top: 28px; }
.success-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%; background: #dff3e6; color: #18733c; font-size: 28px; font-weight: 800; }

@media (max-width: 720px) {
  .site-header { padding: 0 16px; }
  .stage-label { display: none; }
  .main-nav { gap: 9px; }
  .main-nav a { font-size: 12px; }
  .page-shell { margin-top: 18px; }
  .hero, .completion-panel, .interview-panel, .preview-panel { margin: 0 auto; padding: 24px 20px; }
  .progress-nav { overflow-x: auto; grid-template-columns: repeat(5, minmax(105px, 1fr)); }
  .answer-row { grid-template-columns: 1fr; gap: 5px; }
  .required, .optional { float: none; display: block; margin: 4px 0 0; }
  .form-actions .button { flex: 1; }
  .project-card, .version-card, .continue-card { align-items: flex-start; flex-direction: column; }
  .artifact-status { justify-content: flex-start; }
  .starter-panel { margin: 0 auto; padding: 26px 20px; }
  .starter-choice-grid { grid-template-columns: 1fr; }
  .starter-choice { min-height: 140px; }
  .starter-secondary-actions { align-items: flex-start; flex-direction: column; }
}
