* { box-sizing: border-box; }

:root {
  color: #1c1a17;
  background: #f4f1ec;
  font-family: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; min-width: 1100px; }
button { color: inherit; font: inherit; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(194, 65, 12, .38); outline-offset: 2px; }

.app-shell { width: 100%; height: 100vh; min-height: 720px; display: flex; flex-direction: column; overflow: hidden; background: #f4f1ec; }
.topbar { height: 56px; flex: 0 0 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #ddd6ca; }
.brand, .topbar-actions, .button { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark { fill: #c2410c; stroke: #c2410c; }
.brand-name { font-family: 'Instrument Serif', Georgia, serif; font-size: 22px; letter-spacing: -.01em; }
.brief-name { margin-left: 8px; color: #6b645b; font-size: 13px; }
.topbar-actions { gap: 8px; }
.picked-count { margin-right: 8px; color: #6b645b; font-size: 13px; }
.button { height: 36px; gap: 8px; padding: 0 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.button:hover, .step-button:hover { opacity: .85; }
.button-outline { border: 1px solid #1c1a17; background: transparent; }
.button-dark { border: 1px solid #1c1a17; background: #1c1a17; color: #f4f1ec; }
.button-ghost { border: 0; background: transparent; color: #6b645b; }
.pitwall-bar { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 16px; padding: 6px 24px; border-bottom: 1px solid #ddd6ca; background: #ebe6de; color: #6b645b; font-size: 13px; }
.pitwall-bar strong { color: #1c1a17; font-weight: 500; }
.pitwall-bar .is-error { color: #8f2e08; }
.link-button { align-self: flex-start; padding: 0; border: 0; background: none; color: #c2410c; font-size: 13px; cursor: pointer; text-decoration: underline; }
.presets-dialog { width: 600px; max-width: calc(100vw - 48px); max-height: calc(100vh - 96px); padding: 0; border: 1px solid #ddd6ca; border-radius: 12px; background: #f4f1ec; color: inherit; box-shadow: 0 24px 60px rgba(28, 26, 23, .22); }
.presets-dialog[open] { display: flex; flex-direction: column; }
.presets-dialog::backdrop { background: rgba(28, 26, 23, .45); }
.presets-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 12px; }
.presets-header h2 { margin: 0 0 4px; font-family: 'Instrument Serif', Georgia, serif; font-size: 26px; font-weight: 400; letter-spacing: -.01em; }
.presets-header p, .preset-empty { margin: 0; color: #6b645b; font-size: 13px; line-height: 1.5; }
.presets-close { padding: 0 6px; border: 0; background: none; color: #6b645b; font-size: 24px; line-height: 1; cursor: pointer; }
.presets-status { min-height: 20px; margin: 0; padding: 0 24px; color: #6b645b; font-size: 13px; }
.presets-status.is-error { color: #8f2e08; }
.presets-body { min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow: auto; padding: 8px 24px 24px; }
.presets-body[inert] { opacity: .55; }
.presets-body > .button { align-self: flex-start; }
.preset-form { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1.5px solid #c2410c; border-radius: 10px; background: #fbfaf7; }
.preset-form h3 { margin: 0; font-size: 14px; font-weight: 600; }
.preset-form .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.preset-form .field > span, .preset-form legend { padding: 0; font-size: 12px; font-weight: 600; }
.preset-form legend { margin-bottom: 6px; }
.preset-form input[type="text"] { width: 100%; padding: 9px 10px; border: 1px solid #ddd6ca; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.preset-steps { display: flex; flex-direction: column; gap: 6px; }
.preset-steps .check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; }
.preset-steps .check input { margin: 2px 0 0; }
.preset-form-actions { display: flex; gap: 8px; }
.preset-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.preset-list:empty { display: none; }
.preset-row { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1.5px solid #ddd6ca; border-radius: 10px; background: #fbfaf7; }
.preset-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.preset-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.preset-summary { color: #6b645b; font-size: 12px; line-height: 1.45; }
.preset-actions { display: flex; align-items: center; gap: 14px; }
.preset-actions .button { height: 30px; padding: 0 12px; }
.preset-actions .button:disabled { opacity: .4; cursor: default; }
.preset-actions .link-button { align-self: center; color: #4d463e; }

.workspace { min-height: 0; flex: 1; display: flex; }
.phase-rail { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 20px; border-right: 1px solid #ddd6ca; }
.rail-group { padding: 14px 12px 6px; color: #6b645b; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.phase-list { min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.phase-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.phase-button:hover, .phase-button.active { background: #ebe6de; }
.phase-number { width: 22px; height: 22px; flex: 0 0 22px; display: flex; align-items: center; justify-content: center; border: 1px solid #8f877a; border-radius: 50%; color: #6b645b; font-size: 11px; font-weight: 600; }
.phase-button.active .phase-number { color: #1c1a17; }
.phase-button.complete .phase-number { border-color: #1c1a17; background: #1c1a17; color: #f4f1ec; }
.phase-copy { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.phase-name { overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.phase-status { overflow: hidden; color: #6b645b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rail-help { margin-top: auto; padding: 12px; border-top: 1px solid #ddd6ca; color: #6b645b; font-size: 12px; line-height: 1.5; }
#storage-warning { color: #8f2e08; }

.options-panel { width: 470px; flex: 0 0 470px; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #ddd6ca; }
.options-header { display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 16px; }
.phase-progress { color: #c2410c; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.options-header h1 { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-size: 30px; font-weight: 400; letter-spacing: -.01em; }
.options-header p { margin: 0; color: #6b645b; font-size: 14px; line-height: 1.5; }
.select-label { align-self: flex-start; padding: 3px 8px; border: 1px solid #ddd6ca; border-radius: 999px; color: #6b645b; font-size: 11px; }
.select-label:empty { display: none; }
.options-scroll { min-height: 0; flex: 1; overflow: auto; padding: 0 24px 24px; }
.option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option-list-wide { grid-template-columns: minmax(0, 1fr); }
.option-card { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1.5px solid #ddd6ca; border-radius: 10px; background: #fbfaf7; text-align: left; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.option-card:hover { transform: translateY(-1px); border-color: #1c1a17; }
.option-card.selected { border-color: #c2410c; box-shadow: 0 0 0 3px rgba(194, 65, 12, .15); }
.option-swatch { height: 72px; display: flex; align-items: flex-end; justify-content: space-between; overflow: hidden; padding: 10px; border: 1px solid rgba(0,0,0,.06); border-radius: 6px; }
.option-aa { font-size: 22px; line-height: 1; }
.swatch-dots { display: flex; gap: 4px; }
.swatch-dots span { width: 14px; height: 14px; }
.swatch-dots span:last-child { opacity: .55; }
.option-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 2px 2px; }
.option-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.option-name { font-size: 14px; font-weight: 600; }
.option-desc { color: #6b645b; font-size: 12px; line-height: 1.4; }
.option-check { width: 18px; height: 18px; flex: 0 0 18px; display: flex; align-items: center; justify-content: center; margin-top: 1px; border: 1.5px solid #8f877a; border-radius: 50%; background: transparent; }
.option-check svg { opacity: 0; }
.selected .option-check { border-color: #c2410c; background: #c2410c; }
.selected .option-check svg { opacity: 1; }
.option-card-text { padding: 14px 12px; }

/* option previews: live Osmo buttons */
.option-swatch-button { height: 92px; padding: 0; }
.button-half { flex: 1; display: flex; align-items: center; justify-content: center; height: 100%; font-size: 14px; }

.phase-input { margin-bottom: 14px; }
.phase-input label, .client-panel .field > span, .client-panel legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.phase-input input, .client-panel input[type="text"], .client-panel textarea { width: 100%; padding: 9px 10px; border: 1px solid #ddd6ca; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.client-panel { display: flex; flex-direction: column; gap: 18px; }
.client-panel .field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.client-panel legend { padding: 0; margin-bottom: 6px; }
.client-panel .check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; }
.client-panel .check input { margin: 0; }
.logo-upload { font-size: 13px; }
.logo-preview:empty { display: none; }
.logo-preview { display: flex; align-items: center; justify-content: center; padding: 14px; border: 1px dashed #ddd6ca; border-radius: 8px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-preview img { max-height: 90px; max-width: 100%; object-fit: contain; }
.color-fields { display: flex; gap: 12px; margin-top: 6px; }
.color { flex: 1; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 6px 8px; align-items: center; font-size: 12px; font-weight: 600; }
.color > span { grid-column: 1 / -1; }
.color input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid #ddd6ca; border-radius: 6px; background: none; }
.field-hint { color: #6b645b; font-size: 12px; font-weight: 400; line-height: 1.4; }
.field-error { margin: 6px 0 0; color: #8f2e08; font-size: 12px; }

.info-panel { display: flex; flex-direction: column; gap: 10px; }
.info-card { padding: 14px 16px; border: 1.5px solid #ddd6ca; border-radius: 10px; background: #fbfaf7; }
.info-card strong { display: block; margin-bottom: 4px; font-size: 14px; }
.info-card p { margin: 0; color: #4d463e; font-size: 13px; line-height: 1.5; }

.ideas-panel { display: flex; flex-direction: column; gap: 12px; }
.ideas-label { margin: 0; color: #6b645b; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.idea-suggestions { display: flex; flex-direction: column; gap: 6px; }
.idea-suggestions:empty { display: none; }
.idea-chip { padding: 8px 10px; border: 1px dashed #b9b0a3; border-radius: 8px; background: transparent; color: #4d463e; font-size: 12px; line-height: 1.4; text-align: left; cursor: pointer; }
.idea-chip:hover { border-color: #1c1a17; background: #fbfaf7; }
.idea-form { display: flex; gap: 8px; }
.idea-form input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #ddd6ca; border-radius: 6px; font: inherit; font-size: 13px; }
.idea-empty { margin: 0; color: #6b645b; font-size: 13px; }
.idea-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.idea-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1.5px solid #ddd6ca; border-radius: 10px; background: #fbfaf7; }
.idea-row.chosen { border-color: #c2410c; }
.idea-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.idea-row.chosen .idea-toggle { color: #c2410c; }
.idea-text { margin: 0; font-size: 13px; line-height: 1.45; }
.idea-remove { padding: 0 4px; border: 0; background: none; color: #6b645b; font-size: 18px; line-height: 1; cursor: pointer; }

.options-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-top: 1px solid #ddd6ca; }
.step-button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; }
.step-back { padding: 8px 0; color: #6b645b; }
.step-next { height: 36px; gap: 8px; padding: 0 16px; border-radius: 6px; background: #c2410c; color: #fff; }

/* ---------- live site preview ---------- */
.preview-panel { min-width: 0; flex: 1; display: flex; flex-direction: column; background: #e9e4dc; }
.preview-toolbar { height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: #6b645b; font-size: 12px; }
.preview-modes { display: flex; gap: 14px; }
.preview-modes button { padding: 0; border: 0; background: transparent; color: #6b645b; font-size: 12px; cursor: pointer; }
.preview-modes button[aria-pressed="true"] { color: #1c1a17; font-weight: 500; }
.preview-content { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 0 20px 20px; }
.site-preview { --pad: 56px; min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: auto; border-radius: 10px; background: var(--preview-bg); color: var(--preview-fg); box-shadow: 0 8px 30px rgba(28, 26, 23, .10); font-family: var(--preview-body); }
.site-nav { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 var(--pad); background: var(--preview-bg); border-bottom: 1px solid var(--preview-line); transition: height .35s ease; }
.site-logo { display: flex; align-items: center; height: 100%; font-family: var(--preview-head); font-size: 20px; font-weight: 700; transition: transform .35s ease, height .35s ease, font-size .35s ease; }
.site-logo img { max-height: 36px; max-width: 200px; object-fit: contain; transition: max-height .35s ease, max-width .35s ease; }
.site-links { display: flex; gap: 26px; font-size: 14px; }
.site-links span { position: relative; cursor: pointer; }
.site-links span:last-child { color: var(--preview-accent); }
.site-links span::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.site-links span:hover::after { transform: scaleX(1); }
.site-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 88px var(--pad) 64px; }
.site-kicker { color: var(--preview-accent); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.site-title { max-width: 720px; margin: 0; font-family: var(--preview-head); font-size: var(--preview-h1); font-weight: var(--preview-head-weight); letter-spacing: -.02em; line-height: 1.05; }
.site-subtitle { max-width: 560px; margin: 0; color: var(--preview-muted); font-size: 19px; line-height: 1.55; }
.site-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; font-size: 15px; }
.site-fallback-button { display: inline-block; padding: 13px 24px; border-radius: var(--preview-radius); font-size: 14px; font-weight: 600; transition: transform .2s ease, opacity .2s ease; cursor: pointer; }
.site-fallback-button:hover { transform: translateY(-1px); opacity: .9; }
.site-primary { background: var(--preview-accent); color: var(--preview-on-accent); }
.site-text-link { font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.site-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 0 var(--pad) 72px; }
.site-cards article { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 26px 24px; border: 1px solid var(--preview-line); border-radius: min(var(--preview-radius), 24px); background: var(--preview-card); transition: border-color .25s ease; cursor: pointer; }
.site-cards article:hover { border-color: var(--preview-accent); }
.site-cards strong { font-family: var(--preview-head); font-size: 18px; font-weight: 600; }
.site-cards article span { font-size: 14px; line-height: 1.55; color: var(--preview-muted); }
.site-band { display: grid; grid-template-columns: minmax(0, 1fr) 40%; grid-template-rows: auto auto; gap: 12px 40px; align-items: center; margin: 0 var(--pad) 72px; padding: 48px; border-radius: min(var(--preview-radius), 24px); background: var(--preview-card); }
.site-band .site-kicker { grid-column: 1; }
.site-band strong { grid-column: 1; max-width: 420px; font-family: var(--preview-head); font-size: 28px; font-weight: var(--preview-head-weight); line-height: 1.15; letter-spacing: -.01em; }
.site-photo { grid-column: 2; grid-row: 1 / 3; aspect-ratio: 4 / 3; border-radius: min(var(--preview-radius), 16px); background: linear-gradient(135deg, var(--preview-accent-soft), var(--preview-line)); }
.site-footer { display: flex; justify-content: space-between; margin-top: auto; padding: 22px var(--pad); border-top: 1px solid var(--preview-line); font-size: 12px; color: var(--preview-muted); }
@media (prefers-reduced-motion: reduce) { .site-preview * { transition-duration: .01ms !important; } }

.brief-strip { height: 132px; flex: 0 0 132px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 14px 18px; border: 1px solid #ddd6ca; border-radius: 10px; background: #fbfaf7; }
.brief-strip header { display: flex; align-items: center; justify-content: space-between; color: #6b645b; font-size: 12px; }
.brief-strip header span:first-child { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brief-strip pre { margin: 0; overflow: hidden; color: #3d3833; font-family: 'JetBrains Mono', Menlo, monospace; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.load-error { grid-column: 1 / -1; padding: 14px; border: 1px solid #c2410c; border-radius: 8px; color: #8f2e08; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }

/* preview modes */
.preview-content[data-mode="mobile"] .site-preview { --pad: 24px; width: 390px; max-width: 100%; margin: 0 auto; }
.preview-content[data-mode="mobile"] .site-links { display: none; }
.preview-content[data-mode="mobile"] .site-title { font-size: min(var(--preview-h1), 36px); }
.preview-content[data-mode="mobile"] .site-hero { padding-top: 48px; }
.preview-content[data-mode="mobile"] .site-cards { grid-template-columns: minmax(0, 1fr); }
.preview-content[data-mode="mobile"] .site-band { grid-template-columns: minmax(0, 1fr); padding: 28px; }
.preview-content[data-mode="mobile"] .site-photo { grid-column: 1; grid-row: auto; }
.preview-content[data-mode="brief"] .site-preview { display: none; }
.preview-content[data-mode="brief"] .brief-strip { height: auto; flex: 1; }
.preview-content[data-mode="brief"] .brief-strip pre { overflow: auto; }

@media (max-width: 1280px) {
  .phase-rail { width: 200px; flex-basis: 200px; }
  .options-panel { width: 420px; flex-basis: 420px; }
  .site-preview { --pad: 32px; }
  .site-title { font-size: min(var(--preview-h1), 44px); }
}
