:root {
  --bg: #FAF7F2;
  --fg: #1a1a1a;
  --accent: #C4683A;
  --muted: #7a6f64;
  --rule: #e8e0d5;
  --surface: #f3ede4;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 6rem 2rem 5rem;
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(196, 104, 58, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 104, 58, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  max-width: 820px;
  position: relative;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 300;
  line-height: 1.0;
  color: var(--fg);
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 540px;
  font-weight: 300;
  line-height: 1.7;
}

.hero-examples-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.hero-examples-link:hover { border-bottom-color: var(--accent); }

/* Hero paste form — embedded above the fold */
.hero-paste-form {
  margin-top: 2.5rem;
  max-width: 580px;
}

.hero-input-row {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  border: 1.5px solid var(--rule);
  background: #fff;
}

.hero-url-input {
  flex: 1;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  min-width: 0;
}

.hero-url-input::placeholder {
  color: #bbb;
}

.hero-cta-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.9rem 1.4rem;
  font-family: inherit;
  font-size: 0.975rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.hero-cta-btn:hover { background: #a85530; }
.hero-cta-btn:disabled { background: #c4a090; cursor: not-allowed; }

.hero-microcopy {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
}

.hero-trust {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #aaa;
}

.hero-form-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #c0392b;
}

/* Mobile: stack the button below the input */
@media (max-width: 480px) {
  .hero-input-row {
    flex-direction: column;
    border-radius: 10px;
  }
  .hero-cta-btn {
    padding: 0.85rem 1.4rem;
    text-align: center;
    border-top: 1.5px solid var(--rule);
    font-size: 1rem;
  }
}

/* Section label */
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 3rem;
}

/* How it works */
.howitworks {
  padding: 6rem 2rem;
  border-top: 1px solid var(--rule);
}

.howitworks-inner {
  max-width: 900px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.step {
  padding: 2.5rem 2rem 2.5rem 0;
  border-right: 1px solid var(--rule);
}

.step:last-child {
  border-right: none;
  padding-right: 0;
  padding-left: 2rem;
}

.step:nth-child(2) {
  padding-left: 2rem;
}

.step-num {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.step h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.step p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 300;
}

/* The Brief */
.thebrief {
  padding: 6rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--rule);
}

.thebrief-inner {
  max-width: 900px;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.brief-item {
  padding: 2rem 2rem 2rem 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.brief-item:nth-child(3n) {
  border-right: none;
  padding-right: 0;
  padding-left: 2rem;
}

.brief-item:nth-child(3n-2) {
  padding-left: 0;
  padding-right: 2rem;
}

.brief-item:nth-child(3n-1) {
  padding-left: 2rem;
}

.brief-item:nth-child(n+4) {
  border-bottom: none;
}

.brief-item-wide {
  grid-column: 1 / -1;
  border-right: none;
  padding-left: 0;
  padding-right: 0;
  border-top: 1px solid var(--rule);
  margin-top: 0;
}

.brief-icon {
  width: 20px;
  height: 20px;
  background: var(--accent);
  opacity: 0.25;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.brief-item h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.brief-item p {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
}

/* Manifesto */
.manifesto {
  padding: 7rem 2rem;
  border-top: 1px solid var(--rule);
}

.manifesto-inner {
  max-width: 680px;
}

blockquote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.35;
  color: var(--fg);
  margin-bottom: 2rem;
  border-left: 2px solid var(--accent);
  padding-left: 1.75rem;
}

.manifesto p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 1rem;
}

.manifesto-note {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 2rem;
  opacity: 0.8;
}

/* Footer */
.footer {
  padding: 4rem 2rem 3rem;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  max-width: 900px;
}

.footer-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--fg);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-nav {
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.footer-nav a:hover { color: var(--accent); }

/* ── Generator Section ─────────────────────────────────────────────── */
.generator-section {
  padding: 0 2rem 6rem;
  background: var(--bg);
}

.generator-inner {
  max-width: 680px;
  margin: 0 auto;
}

/* Label */
.gen-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

/* Form */
.brief-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.input-row {
  display: flex;
  gap: 0;
}

.input-row input[type="url"] {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  border: 1px solid var(--rule);
  border-right: none;
  background: var(--surface);
  color: var(--fg);
  border-radius: 4px 0 0 4px;
  outline: none;
  transition: border-color 0.15s;
}

.input-row input[type="url"]:focus {
  border-color: var(--accent);
  background: white;
}

.input-row input[type="url"]::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.gen-btn {
  padding: 1rem 1.75rem;
  background: var(--fg);
  color: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gen-btn:hover { background: var(--accent); }
.gen-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.spinner {
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
}

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

/* Fallback toggle */
.fallback-row {
  margin-top: 0.75rem;
  text-align: center;
}

.fallback-toggle {
  background: none;
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.fallback-toggle:hover { color: var(--fg); }

/* Fallback panel */
.fallback-panel {
  margin-top: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.fallback-tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
}

.fb-tab {
  flex: 1;
  padding: 0.75rem;
  background: var(--surface);
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.fb-tab.active {
  background: white;
  color: var(--fg);
  font-weight: 500;
}

.fb-url-input {
  width: 100%;
  padding: 0.75rem;
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--fg);
  background: white;
  outline: none;
}

.fb-url-input::placeholder { color: var(--muted); }

/* Screenshot drop zone */
.screenshot-drop-zone {
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.screenshot-drop-zone.dragover,
.screenshot-drop-zone:hover {
  background: rgba(196, 104, 58, 0.06);
}

.screenshot-drop-icon {
  display: block;
  margin: 0 auto 0.75rem;
  color: var(--accent);
  opacity: 0.7;
}

.screenshot-drop-label {
  font-size: 0.875rem;
  color: var(--fg);
  margin-bottom: 0.35rem;
}

.screenshot-drop-browse {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.screenshot-drop-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Screenshot preview */
.screenshot-preview-list {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  flex-wrap: wrap;
}

.screenshot-preview-list:empty { display: none; }

.screenshot-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.screenshot-thumb img {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

.screenshot-thumb-name {
  font-size: 0.65rem;
  color: var(--muted);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screenshot-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  color: white;
  border: none;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Unified fallback submit button */
.fb-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s;
  margin-top: 0.75rem;
}

.fb-submit-btn:hover { background: #b05a2e; }
.fb-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.fb-panel { padding: 1rem; background: white; }

.fb-panel textarea,
.fb-panel input[type="url"] {
  width: 100%;
  padding: 0.75rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
  resize: vertical;
  outline: none;
}

.fb-panel textarea:focus,
.fb-panel input[type="url"]:focus { border-color: var(--accent); }

.fb-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Screenshot drop zone */
.screenshot-drop-zone {
  border: 2px dashed var(--rule);
  border-radius: 6px;
  background: var(--surface);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.screenshot-drop-zone:hover,
.screenshot-drop-zone:focus,
.screenshot-drop-zone.dragover {
  border-color: var(--accent);
  background: #fff8f4;
}

.screenshot-drop-icon {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.screenshot-drop-label {
  font-size: 0.9rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.screenshot-drop-browse {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.screenshot-drop-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Thumbnail preview row */
.screenshot-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.screenshot-thumb {
  position: relative;
  width: 80px;
  text-align: center;
}

.screenshot-thumb img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  display: block;
}

.screenshot-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 0.75rem;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
}

.screenshot-thumb-name {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Error */
.gen-error {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff0eb;
  border: 1px solid #e8a090;
  border-radius: 4px;
  color: #8b3a1e;
  font-size: 0.875rem;
}

/* ── Brief Output ────────────────────────────────────────────────────── */
.brief-output {
  padding-top: 1rem;
}

.brief-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 0;
}

.sk-line {
  height: 16px;
  background: var(--rule);
  border-radius: 3px;
  animation: pulse 1.5s ease-in-out infinite;
}

.sk-title { width: 40%; height: 32px; margin-bottom: 0.5rem; }
.sk-sub { width: 25%; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 1rem; }
.sk-card { height: 120px; border-radius: 4px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Brief header */
.brief-body {
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.brief-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.brief-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.brief-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.2;
}

.reset-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.reset-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Key chips */
.key-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.key-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Brief cards */
.brief-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.brief-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem;
}

.brief-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.brief-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Rows */
.brief-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brief-row-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.brief-row-val {
  font-size: 0.875rem;
  color: var(--fg);
}

.brief-row-val a {
  color: var(--accent);
  text-decoration: none;
}

.brief-row-val a:hover { text-decoration: underline; }

/* Schedule */
.sched-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.sched-time {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  padding-top: 2px;
}

.sched-event {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
}

.sched-loc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.sched-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
  font-style: italic;
}

/* Dress code */
.dress-code-val {
  font-size: 1.1rem;
  color: var(--fg);
  font-weight: 400;
}

/* Registry */
.registry-link {
  display: inline-block;
  margin-right: 1rem;
  color: var(--accent);
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 500;
}

.registry-link:hover { text-decoration: underline; }

/* ── Confidence Banner (MEDIUM) ───────────────────────────────────── */
.confidence-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.confidence-banner--medium {
  background: #fff8eb;
  border: 1px solid #e8c87a;
  color: #7a5510;
}

/* ── Fallback UI (LOW confidence) ─────────────────────────────────── */
.fallback-ui-wrap {
  padding: 3rem 0;
  text-align: center;
}

.fallback-ui-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--muted);
  opacity: 0.5;
}

.fallback-ui-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.fallback-ui-body {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

.fallback-ui-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.fallback-ui-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fallback-ui-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}

.fallback-ui-section textarea,
.fallback-ui-section input[type="url"] {
  width: 100%;
  padding: 0.75rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
  resize: vertical;
  outline: none;
}

.fallback-ui-section textarea:focus,
.fallback-ui-section input[type="url"]:focus {
  border-color: var(--accent);
  background: white;
}

.fallback-ui-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.5rem;
}

.fallback-ui-divider span {
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.6;
}

.fallback-ui-btn {
  padding: 0.65rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.fallback-ui-btn:hover { background: var(--accent); }

.fallback-ui-reset {
  background: none;
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  margin-top: 0.5rem;
}

.fallback-ui-reset:hover { color: var(--fg); }

@media (max-width: 640px) {
  .fallback-ui-inputs {
    grid-template-columns: 1fr;
  }
  .fallback-ui-divider {
    padding: 0.25rem 0;
  }
}

/* ── Responsive ─────────────────────────────────────────────────────── */
/* ── Pricing ──────────────────────────────────────────────────────────── */
.pricing {
  padding: 5rem 2rem;
  border-top: 1px solid var(--rule);
}
.pricing-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.pricing-header { margin-bottom: 2.5rem; }
.pricing-header h2 { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 500; }
.pricing-header p { color: var(--muted); margin-top: 0.5rem; }
.pricing-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 2.5rem 2rem;
}
.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}
.pricing-plan-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.pricing-price { margin-bottom: 0.25rem; }
.pricing-amount { font-size: 3rem; font-weight: 300; }
.pricing-period { color: var(--muted); }
.pricing-sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
  text-align: left;
  display: inline-block;
}
.pricing-features li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
}
.pricing-features li::before {
  content: '✓';
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: 500;
}
.pricing-cta {
  width: 100%;
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.pricing-cta:hover { opacity: 0.85; }
.pricing-cta:disabled { opacity: 0.5; cursor: not-allowed; }
.pricing-error {
  margin-top: 0.75rem;
  color: #c00;
  font-size: 0.85rem;
}
.pricing-secure {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* ── Success Page ──────────────────────────────────────────────────────── */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.success-inner {
  text-align: center;
  max-width: 480px;
}
.success-icon { margin-bottom: 1.5rem; color: var(--accent); }
.success-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.success-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.success-body { color: var(--muted); margin-bottom: 2rem; }
.success-cta {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.success-cta:hover { opacity: 0.85; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 4rem 1.5rem 3.5rem; }
  .hero-headline { font-size: 3rem; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { border-right: none; border-bottom: 1px solid var(--rule); padding: 1.5rem 0; }
  .step:last-child { border-bottom: none; padding-left: 0; }
  .step:nth-child(2) { padding-left: 0; }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-item { border-right: none; padding-left: 0 !important; padding-right: 0 !important; }
  .brief-item-wide { grid-column: 1; }
  .howitworks, .thebrief, .manifesto, .generator-section { padding: 4rem 1.5rem; }
  .input-row { flex-direction: column; }
  .input-row input[type="url"] { border-right: 1px solid var(--rule); border-radius: 4px 4px 0 0; }
  .gen-btn { border-radius: 0 0 4px 4px; padding: 1rem; }
  .brief-sections { grid-template-columns: 1fr; }
}

/* Per-field confidence badges */
.conf-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
}
.conf-medium {
  background: #fff3cd;
  color: #856404;
}
.conf-low {
  background: #f8d7da;
  color: #842029;
}

/* Cache indicator badge */
.cache-badge {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
  display: inline-block;
}

/* ── Live Brief (SSE streaming) ────────────────────────────────── */
/* The brief layout that appears immediately on submit and populates field by field */

.live-brief {
  padding-top: 1rem;
}

.lb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.lb-eyebrow { margin-bottom: 0.35rem; }

.lb-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.2;
}

.lb-facts {
  margin-bottom: 2rem;
}

/* Searching state — muted/italic placeholder while waiting */
.lb-searching {
  color: var(--muted);
  font-style: italic;
  font-size: 0.875rem;
}

/* Found state — field is populated, slide in from left */
@keyframes lb-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.lb-found {
  animation: lb-slide-in 0.3s ease-out forwards;
}

/* Typewriter cursor */
@keyframes lb-type-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Section reveal — fade + slight upward translate */
@keyframes lb-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Completion pulse on the whole live-brief card */
@keyframes lb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(196, 104, 58, 0.35); }
  70%  { box-shadow: 0 0 0 12px rgba(196, 104, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 104, 58, 0); }
}

.lb-pulse {
  animation: lb-pulse 0.8s ease-out forwards;
}

/* Typewriter cursor character */
.lb-type-cursor {
  display: inline;
  animation: lb-type-cursor 0.8s step-end infinite;
}

/* Section reveal animation class */
.lb-section-reveal {
  animation: lb-reveal 0.4s ease-out forwards;
}

/* Personalized intro line */
.lb-intro {
  margin-bottom: 1.25rem;
}

.lb-intro-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.4;
  min-height: 1.4em;
}

/* Guest illustration wrapper in live brief */
.lb-guest-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.lb-guest-svg {
  width: 90px;
  height: 100px;
  flex-shrink: 0;
}

/* Check mark / status indicator */
.lb-check {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 500;
}

.lb-check--searching {
  color: var(--muted);
  font-style: normal;
  opacity: 0.5;
}

.lb-check--found::before {
  content: '✓';
  color: var(--accent);
}

.lb-check--missing::before {
  content: '—';
  color: var(--muted);
}

/* Section card transitions */
.lb-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem;
  transition: opacity 0.3s, transform 0.3s;
}

.lb-card.lb-card--appearing {
  display: block;
  animation: lb-slide-in 0.4s ease-out forwards;
}

/* Not found — subtle italic entry */
.lb-missing {
  color: var(--muted);
  font-style: italic;
  font-size: 0.875rem;
}

/* Fallback timing signals */
.lb-signal {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 1rem 0;
  font-style: italic;
}

.lb-fallback-link {
  background: none;
  border: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.lb-reset {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
  margin: 1.5rem auto 0;
}

.lb-reset:hover { border-color: var(--accent); color: var(--accent); }

/* Reduce-motion: no animations, just instant appear */
@media (prefers-reduced-motion: reduce) {
  .lb-found, .lb-card.lb-card--appearing, .lb-typewriter, .lb-section-reveal, .lb-pulse { animation: none; }
  .lb-type-cursor { display: none; }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .lb-title { font-size: 1.5rem; }
  .brief-sections { grid-template-columns: 1fr; }
}

/* ── Stats counter ── */
.stats-counter {
  text-align: center;
  margin: 0 auto 1.5rem;
  max-width: 400px;
}

.stats-counter__text {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 0.45rem;
}

.stats-counter__bar-wrap {
  height: 3px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}

.stats-counter__bar {
  height: 100%;
  background: var(--accent, #b8976c);
  border-radius: 999px;
  transition: width 0.6s ease;
  max-width: 100%;
}


/* ── Live brief audit trail — source quote disclosures ────────── */
/* These appear inside lb-body-* cards after each field is populated */

.lb-conf-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}

.lb-conf-pill--medium { background: #fff3cd; color: #856404; }
.lb-conf-pill--low    { background: #f8d7da; color: #842029; }

.lb-audit {
  margin-top: 0.55rem;
  font-size: 0.75rem;
}

.lb-audit-trigger {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  user-select: none;
}

.lb-audit-trigger::-webkit-details-marker { display: none; }
.lb-audit-trigger::before {
  content: '›';
  display: inline-block;
  transition: transform 0.15s;
}

details.lb-audit[open] .lb-audit-trigger::before { transform: rotate(90deg); }
details.lb-audit[open] .lb-audit-trigger { color: var(--accent); }

/* Audit quote — smaller than global blockquote, muted */
.lb-audit-quote {
  margin: 0.35rem 0 0.25rem 0.8rem;
  padding-left: 0.65rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  font-style: italic;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.lb-verify-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #842029;
}

.lb-verify-note a { color: #842029; text-decoration: underline; }

/* ── Cache-hit chip (shown on live-brief when result came from parse cache) ── */
.lb-cache-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent, #b8976c);
  background: rgba(184, 151, 108, 0.08);
  border: 1px solid rgba(184, 151, 108, 0.25);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-top: 0.4rem;
  cursor: default;
  user-select: none;
}

/* ── Free-tier upgrade prompt (shown when paid-tier fields sparse but free-tier ok) ── */
.lb-upgrade-prompt {
  margin: 1.5rem 0 0.5rem;
  background: rgba(196, 104, 58, 0.06);
  border: 1px solid rgba(196, 104, 58, 0.2);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.lb-upgrade-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.lb-upgrade-copy {
  flex: 1;
  min-width: 180px;
  font-size: 0.875rem;
  color: var(--fg);
}

.lb-upgrade-copy strong {
  display: block;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.lb-upgrade-copy span {
  color: var(--muted);
}

.lb-upgrade-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.lb-upgrade-btn:hover { opacity: 0.85; }
