:root {
  --ink: #262328;
  --muted: #706d72;
  --line: #ddd9d4;
  --paper: #fffefa;
  --canvas: #f4f2ed;
  --blue: #405de6;
  --blue-dark: #293ba6;
  --yellow: #ffbe49;
  --mint: #dcefe9;
  --green: #1d7c64;
  --coral: #f39a7b;
  --ds-primary: #405de6;
  --ds-accent: #ffbe49;
  --ds-text: #262328;
  --ds-surface: #fffefa;
  --ds-muted: #ece8df;
  --ds-border: #d6cfc2;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; overflow-x: hidden; background: var(--canvas); }
button, input { font: inherit; }
button { color: inherit; }

.concept-bar { height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: #d9d6dd; background: #201e22; font-size: 11px; letter-spacing: .02em; }
.shell { min-height: calc(100vh - 28px); }

main { min-width: 0; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 42px; background: white; border-bottom: 1px solid var(--line); }
.topbar a { text-decoration: none; }
.product-home { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.product-home > span:last-child { display: grid; gap: 2px; }
.product-home b { font-size: 14px; }
.product-home small { color: var(--muted); font-size: 10px; font-weight: 650; }
.mini-kit-mark { color: var(--ink); font-size: 27px; font-weight: 950; letter-spacing: -.09em; }
.topbar-links { display: flex; align-items: center; gap: 20px; }
.topbar-links a { color: var(--blue-dark); font-size: 12px; font-weight: 780; }
.topbar-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prototype-pill, .safe-badge { padding: 7px 10px; border-radius: 999px; color: #41564f !important; background: var(--mint); font-size: 11px; font-weight: 750; }
.content { max-width: 1420px; margin: 0 auto; padding: 38px 42px 60px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 50px; align-items: end; margin-bottom: 30px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--blue-dark); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; margin-bottom: 12px; font-size: clamp(36px, 4vw, 56px); letter-spacing: -.055em; line-height: .98; }
.hero > div:first-child > p { max-width: 840px; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.model-card { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px 10px; align-items: center; padding: 17px; border: 1px solid #cfcaf3; border-radius: 12px; background: #f0efff; }
.model-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(64,93,230,.13); }
.model-card div { display: grid; gap: 2px; }
.model-card b { font-size: 13px; }
.model-card small { color: #6c6880; font-size: 10px; }
.model-card strong { color: var(--blue-dark); font-size: 14px; }
.model-card > small { grid-column: 3; margin-top: -8px; text-align: right; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 16px; padding: 0; list-style: none; border-bottom: 1px solid #cbc6bf; }
.steps li { display: flex; gap: 11px; align-items: center; padding: 12px 15px 15px; border-bottom: 3px solid transparent; color: #858087; cursor: pointer; }
.steps li > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800; }
.steps li div { display: grid; gap: 2px; }
.steps b { font-size: 13px; }
.steps small { font-size: 10px; }
.steps li.active { color: var(--blue-dark); border-color: var(--blue); }

.stage { padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 32px rgba(38,35,40,.055); }
.stage[hidden] { display: none; }
.stage-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; margin-bottom: 24px; }
.stage-heading h2 { margin-bottom: 6px; font-size: 25px; letter-spacing: -.025em; }
.stage-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.source-grid { display: grid; grid-template-columns: minmax(520px, 1.45fr) minmax(320px, .7fr); gap: 18px; }
.dropzone { position: relative; min-height: 400px; display: grid; place-items: center; overflow: hidden; border: 1.5px dashed #aaa5ad; border-radius: 10px; background: #f8f6f1; cursor: pointer; }
.dropzone.dragover { border-color: var(--blue); background: #f0efff; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-empty { display: grid; place-items: center; text-align: center; }
.upload-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 50%; color: white; background: var(--ink); font-size: 27px; }
.upload-empty h3 { margin-bottom: 5px; font-size: 20px; }
.upload-empty p { margin-bottom: 17px; color: var(--muted); font-size: 12px; }
.choose-button { padding: 10px 15px; border: 1px solid #c6c1ba; border-radius: 7px; background: white; font-size: 12px; font-weight: 750; }
#source-preview { width: 100%; height: 100%; max-height: 520px; object-fit: contain; background: #eeeae3; }
.remove-image { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; color: white; background: rgba(32,30,34,.78); cursor: pointer; font-size: 20px; }
.analysis-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.example-reference { width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; margin: 12px 0 20px; padding: 8px; overflow: hidden; border: 1px solid #d8d3cc; border-radius: 9px; background: #f8f5ef; cursor: pointer; text-align: left; }
.example-reference:hover { border-color: var(--blue); background: #f3f1ff; }
.example-reference img { width: 100%; height: 138px; display: block; object-fit: cover; object-position: center; border-radius: 6px; }
.example-reference > span { display: grid; gap: 4px; }
.example-reference b { font-size: 12px; }
.example-reference small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.example-reference em { color: var(--blue-dark); font-size: 10px; font-style: normal; font-weight: 800; }
.extracts-label { margin-top: 2px; }
.analysis-card ul { display: grid; gap: 14px; margin: 14px 0 20px; padding: 0; list-style: none; }
.analysis-card li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; }
.analysis-card li > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #f0eee9; font-size: 13px; font-weight: 850; }
.analysis-card li div { display: grid; gap: 4px; }
.analysis-card li b { font-size: 13px; }
.analysis-card li small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.mini-swatch { background: linear-gradient(135deg, var(--blue) 0 33%, var(--yellow) 33% 66%, var(--green) 66%) !important; }
.shape-icon { border: 8px solid #f0eee9; border-radius: 15px !important; background: var(--coral) !important; }
.assumption-note { padding: 14px; border-radius: 8px; color: #6b5624; background: #fff3cf; }
.assumption-note b { font-size: 12px; }
.assumption-note p { margin: 4px 0 0; font-size: 11px; line-height: 1.45; }
.actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 20px; }
.actions.split { justify-content: space-between; }
.actions.split > div { display: flex; gap: 10px; }
.button { min-height: 42px; padding: 0 17px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 780; }
.button.primary { border: 1px solid var(--ink); color: white; background: var(--ink); }
.button.primary:hover { background: #39353c; }
.button.primary:disabled { border-color: #c8c4ca; background: #c8c4ca; cursor: not-allowed; }
.button.secondary { border: 1px solid #c6c1ba; background: white; }
.button.ghost { border: 0; color: var(--blue-dark); background: transparent; }
.status { min-height: 18px; margin: 10px 0 0; color: var(--muted); text-align: right; font-size: 11px; }
.status.error { color: #a33b31; }
.status.success { color: var(--green); }

.confidence { min-width: 120px; display: grid; place-items: center; padding: 12px 16px; border-radius: 10px; background: var(--mint); }
.confidence span { color: var(--green); font-size: 24px; font-weight: 850; }
.confidence small { color: #4d6a61; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.system-grid { display: grid; grid-template-columns: 1fr 1fr .62fr; gap: 14px; }
.panel { min-height: 360px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.panel-heading { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-heading h3 { margin-bottom: 4px; font-size: 16px; }
.panel-heading p, .panel-heading > span { margin: 0; color: var(--muted); font-size: 10px; }
.palette-list { display: grid; gap: 9px; }
.color-row { display: grid; grid-template-columns: 44px 1fr 92px; gap: 11px; align-items: center; padding: 9px; border: 1px solid #e2dfda; border-radius: 8px; }
.color-row .swatch { width: 44px; height: 44px; border: 1px solid rgba(38,35,40,.12); border-radius: 7px; background: var(--swatch); }
.color-row div { display: grid; gap: 2px; }
.color-row b { font-size: 12px; text-transform: capitalize; }
.color-row small { color: var(--muted); font-size: 9px; line-height: 1.25; }
.color-row label { display: grid; gap: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.color-row input { width: 100%; padding: 7px; border: 1px solid #d8d4ce; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.type-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.type-card { padding: 14px; border-radius: 8px; background: #f4f1eb; }
.type-card small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.type-card b { font-size: 15px; }
.hierarchy-list { display: grid; gap: 4px; }
.hierarchy-row { display: grid; grid-template-columns: 72px 1fr 56px; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid #ece9e4; }
.hierarchy-row small { color: var(--muted); font-size: 9px; }
.hierarchy-row b { font-size: 12px; }
.hierarchy-row span { font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--blue-dark); text-align: right; }
.system-notes { display: grid; gap: 22px; align-content: start; }
.system-notes dl { display: grid; gap: 8px; margin: 0; }
.system-notes dl div { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #ece9e4; }
.system-notes dt { color: var(--muted); font-size: 10px; }
.system-notes dd { margin: 0; font-size: 10px; font-weight: 750; text-align: right; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span { padding: 6px 8px; border-radius: 999px; background: #f0efff; color: var(--blue-dark); font-size: 9px; font-weight: 750; }
.warning-block { padding: 12px; border-radius: 7px; color: #775824; background: #fff3cf; font-size: 10px; line-height: 1.45; }

.surface-preview { display: grid; grid-template-columns: 1.2fr 1.2fr .85fr .95fr; gap: 12px; }
.preview-card { min-height: 410px; overflow: hidden; border: 1px solid var(--ds-border); border-radius: 9px; background: white; }
.preview-card > span { display: block; padding: 11px 13px; border-bottom: 1px solid #e5e1dc; color: var(--muted); background: #f7f5f0; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.preview-canvas { min-height: 360px; padding: 29px 24px; color: var(--ds-text); background: var(--ds-surface); }
.preview-canvas small { color: var(--ds-primary); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.preview-canvas h3 { margin: 28px 0 12px; font-family: Georgia, serif; font-size: 27px; line-height: 1.04; }
.preview-canvas p { color: color-mix(in srgb, var(--ds-text) 72%, white); font-size: 12px; line-height: 1.55; }
.preview-canvas button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 6px; color: var(--ds-surface); background: var(--ds-primary); font-size: 10px; font-weight: 800; }
.page-preview .preview-canvas { background: var(--ds-muted); }
.page-preview em { display: inline-block; padding: 5px 8px; border-radius: 999px; background: var(--ds-accent); font-size: 9px; font-style: normal; font-weight: 800; }
.form-preview .preview-canvas { display: flex; flex-direction: column; justify-content: center; }
.form-preview input { margin: 10px 0 7px; padding: 10px; border: 1px solid var(--ds-border); border-radius: 6px; color: #858087; background: white; font-size: 10px; }
.site-preview .preview-canvas h3 { margin-top: 22px; font-size: 22px; }
.post-row { display: grid; grid-template-columns: 44px 1fr; gap: 9px; align-items: center; margin-top: 12px; }
.post-row i { width: 44px; height: 38px; border-radius: 6px; background: linear-gradient(135deg, var(--ds-primary), var(--ds-accent)); }
.post-row div { display: grid; gap: 3px; }
.post-row b { font-size: 10px; }
.post-row small { color: var(--muted); font-size: 8px; }
.apply-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin-top: 16px; padding: 15px; border: 1px solid #d5d0ca; border-radius: 9px; background: #f7f5f0; }
.apply-bar div { display: grid; gap: 3px; }
.apply-bar b { font-size: 13px; }
.apply-bar small { color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  .topbar { padding-inline: 26px; }
  .topbar-links { gap: 12px; }
  .content { padding-inline: 26px; }
  .system-grid { grid-template-columns: 1fr 1fr; }
  .system-notes { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); min-height: auto; }
  .surface-preview { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .concept-bar { min-height: 32px; height: auto; gap: 10px; padding: 7px 14px; font-size: 9px; line-height: 1.25; }
  .concept-bar span:last-child { text-align: right; }
  .topbar { height: auto; min-height: 72px; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .product-home { align-self: flex-start; }
  .topbar-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .topbar-links a { min-height: 42px; display: grid; place-items: center; padding: 7px 10px; border: 1px solid #d8d4ce; border-radius: 7px; background: #fbfaf7; text-align: center; font-size: 10px; }
  .topbar-links .prototype-pill { grid-column: 1 / -1; text-align: center; }
  .content { padding: 26px 16px 44px; }
  .hero { grid-template-columns: 1fr; gap: 18px; align-items: stretch; margin-bottom: 24px; }
  h1 { font-size: clamp(35px, 10vw, 46px); line-height: 1; }
  .hero > div:first-child > p { font-size: 15px; }
  .model-card { width: 100%; }
  .steps li { gap: 7px; padding: 10px 7px 12px; }
  .steps li > span { width: 25px; height: 25px; flex: 0 0 25px; }
  .steps b { font-size: 10px; line-height: 1.15; }
  .steps small { display: none; }
  .stage { padding: 18px; border-radius: 10px; }
  .stage-heading { flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .stage-heading h2 { font-size: 22px; }
  .safe-badge { align-self: flex-start; }
  .source-grid { grid-template-columns: minmax(0, 1fr); }
  .dropzone { min-height: 300px; }
  .analysis-card { padding: 18px; }
  .system-grid { grid-template-columns: minmax(0, 1fr); }
  .system-notes { grid-column: auto; grid-template-columns: 1fr; }
  .panel { min-height: auto; padding: 17px; }
  .surface-preview { grid-template-columns: minmax(0, 1fr); }
  .preview-card { min-height: 350px; }
  .apply-bar { grid-template-columns: 1fr 1fr; }
  .apply-bar > div { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .concept-bar { align-items: flex-start; }
  .mini-kit-mark { font-size: 25px; }
  .product-home b { font-size: 13px; }
  .content { padding-inline: 12px; }
  h1 { font-size: 34px; letter-spacing: -.05em; }
  .model-card { grid-template-columns: 12px 1fr; }
  .model-card strong { grid-column: 2; }
  .model-card > small { grid-column: 2; margin-top: -4px; text-align: left; }
  .steps li { flex-direction: column; align-items: flex-start; gap: 6px; }
  .stage { padding: 14px; }
  .dropzone { min-height: 250px; }
  .example-reference img { height: 118px; }
  .actions, .actions.split, .actions.split > div { display: grid; grid-template-columns: 1fr; width: 100%; }
  .actions.split > div { gap: 10px; }
  .button { width: 100%; min-height: 44px; }
  .color-row { grid-template-columns: 38px minmax(0, 1fr) 86px; gap: 8px; padding: 8px; }
  .color-row .swatch { width: 38px; height: 38px; }
  .type-summary { grid-template-columns: 1fr; }
  .hierarchy-row { grid-template-columns: 60px minmax(0, 1fr) 48px; gap: 7px; }
  .apply-bar { grid-template-columns: 1fr; }
  .apply-bar > div { grid-column: auto; }
}
