:root {
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-synthesis: none;
  color: #ededed;
  background: #0a0a0a;
  --background: #0a0a0a;
  --surface: #101010;
  --border: #252525;
  --muted: #929292;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .55; }
button, a { color: inherit; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #ededed; outline-offset: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent-ink, #a3a3a3); outline-offset: 2px; }
[hidden] { display: none !important; }
.topbar { min-height: 65px; display: flex; align-items: stretch; border-bottom: 1px solid var(--border); padding: 0 28px; gap: 54px; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 14px; }
.brand > span:first-child { font-weight: 600; margin-right: 5px; }
.brand-separator { color: #555; }
.prototype-tabs { display: flex; align-items: stretch; gap: 28px; }
.prototype-tabs button { display: flex; align-items: center; gap: 10px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 14px; }
.prototype-tabs button span { color: #656565; font-size: 12px; }
.prototype-tabs button[aria-selected="true"] { color: #fafafa; border-bottom-color: #ededed; }
.prototype-tabs button[aria-selected="true"] span { color: #aaa; }
.prototype-tabs button:hover { color: #ededed; }
.workspace { display: grid; grid-template-columns: 370px minmax(0, 1fr); min-height: calc(100dvh - 65px); }
.composer { border-right: 1px solid var(--border); padding: 25px 24px; min-width: 0; }
.pane-label { color: #a3a3a3; font-size: 12px; font-weight: 400; letter-spacing: .02em; }
#prompt-form > label { display: block; margin-bottom: 21px; }
#prompt { display: block; width: 100%; min-height: 235px; max-height: 60dvh; resize: vertical; padding: 15px; line-height: 1.8; background: #101010; color: #e0e0e0; border: 1px solid #303030; border-radius: 5px; font-size: 14px; }
#prompt::placeholder { color: #737373; }
.generate { width: 100%; min-height: 42px; margin-top: 14px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #ededed; color: #0a0a0a; border: 1px solid #ededed; border-radius: 5px; font-weight: 500; }
.generate:hover { background: #d4d4d4; border-color: #d4d4d4; }
.generate kbd { color: #626262; font-size: 12px; font-family: inherit; font-weight: 400; }
.generate.running { justify-content: center; }
.example-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.example-chip { padding: 10px 11px; border: 1px solid #282828; border-radius: 5px; background: transparent; color: #aaa; font-size: 13px; text-align: left; }
.example-chip:hover { background: #171717; color: #ededed; border-color: #4b4b4b; }
.example-chip.selected { border-color: #626262; background: #181818; color: #ededed; }
.error { background: #221411; border: 1px solid #5e3026; color: #f5b3a5; border-radius: 5px; padding: 12px; margin-top: 16px; line-height: 1.7; font-size: 13px; overflow-wrap: anywhere; }
.workbench { min-width: 0; display: flex; flex-direction: column; }
.preview-toolbar { min-height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 13px; padding: 0 27px; }
.result-badge { color: #929292; font-size: 12px; padding: 2px 7px; border: 1px solid #303030; border-radius: 4px; }
.result-badge.live { display: none; }
.preview-tools { display: flex; gap: 16px; align-items: center; margin-left: auto; }
.viewport-controls { display: flex; gap: 3px; }
.icon-button { border: 1px solid transparent; border-radius: 4px; color: #888; background: transparent; min-width: 32px; height: 32px; padding: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.icon-button:hover { color: #ededed; background: #1b1b1b; }
.icon-button.active { color: #e5e5e5; border-color: #323232; background: #181818; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.inspect-button { font-size: 14px; }
.busy { color: #aaa; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.canvas { padding: 52px 36px; display: flex; justify-content: center; align-items: flex-start; flex: 1; min-width: 0; background: #0d0d0d; }
.generated-ui { --accent: #7055d8; --accent-ink: color-mix(in srgb, var(--accent) 55%, white); width: 100%; max-width: 730px; min-width: 0; border: 1px solid #303030; border-radius: 7px; background: #111; color: #e5e5e5; overflow: hidden; transition: max-width .16s ease; }
.generated-ui.mobile { max-width: 375px; }
.generated-header { padding: 24px 26px 20px; border-bottom: 1px solid #252525; }
.generated-header h3 { font-size: 16px; font-weight: 500; line-height: 1.5; margin: 0; }
.form-content { min-width: 0; }
.form-body { padding: 25px 26px; min-width: 0; }
.fields { display: grid; grid-template-columns: 1fr; gap: 21px 18px; }
.layout-columns .fields { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 9px; }
.field.wide { grid-column: 1 / -1; }
.field-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; font-size: 14px; line-height: 1.5; color: #c6c6c6; }
.required-marker { color: var(--accent-ink); }
.optional { color: #888; font-size: 12px; font-weight: 400; margin-left: auto; }
.field input:not([type="checkbox"], [type="radio"], [type="range"]), .field select, .field textarea { width: 100%; min-width: 0; min-height: 41px; border: 1px solid #333; border-radius: 4px; background: #171717; color: #ededed; padding: 10px 11px; font-size: 14px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #858585; }
.field textarea { min-height: 100px; resize: vertical; }
.field select { padding-right: 8px; }
.field input[type="file"] { font-size: 12px; }
.field input::file-selector-button { border: 1px solid #444; color: #d4d4d4; background: #222; border-radius: 3px; padding: 4px 7px; font: inherit; margin-right: 9px; cursor: pointer; }
.file-picker { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; border: 1px solid #333; border-radius: 4px; padding: 8px 10px; background: #171717; }
.file-picker .file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.file-picker:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.file-button { flex-shrink: 0; font-size: 12px; color: #ddd; padding: 4px 7px; border: 1px solid #444; border-radius: 3px; background: #222; }
.file-name { font-size: 12px; color: #999; overflow-wrap: anywhere; min-width: 0; }
.field input[type="range"] { width: 100%; accent-color: var(--accent-ink); }
.range-label { color: var(--accent-ink); font-size: 13px; align-self: flex-end; }
.choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-option { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border: 1px solid #333; border-radius: 4px; font-size: 13px; color: #bbb; }
.radio-option input, .check-line input { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.radio-option:has(input:checked) { color: #ededed; border-color: var(--accent-ink); }
.check-line { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.7; color: #b8b8b8; }
.check-line input { margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 25px; padding-top: 22px; border-top: 1px solid #282828; }
.submit-form { border: 1px solid transparent; border-radius: 4px; background: var(--accent); color: #fff; padding: 11px 14px; font-size: 13px; line-height: 1.5; }
.submit-form:hover { filter: brightness(1.14); }
.previous-step { padding: 10px 12px; border: 1px solid #404040; border-radius: 4px; background: transparent; color: #bbb; font-size: 13px; margin-right: auto; }
.form-content.has-summary { display: grid; grid-template-columns: minmax(0, 1fr) 190px; }
.form-summary { border-left: 1px solid #292929; background: #131313; padding: 26px 18px; min-width: 0; }
.form-summary h4 { font-size: 13px; font-weight: 400; color: #ccc; margin: 0 0 22px; }
.form-summary dl { margin: 0; }
.form-summary dt { color: #929292; font-size: 12px; margin-top: 18px; line-height: 1.6; }
.form-summary dd { color: #d0d0d0; margin: 5px 0 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.summary-empty { color: #888; font-size: 13px; }
.density-spacious .fields { gap: 30px 23px; }
.density-compact .fields { gap: 13px; }
.density-compact .form-body { padding-top: 19px; }
.density-compact .field input:not([type="checkbox"], [type="radio"], [type="range"]), .density-compact .field select { padding: 8px 10px; min-height: 37px; }
.generated-ui.mobile .fields { grid-template-columns: 1fr; }
.generated-ui.mobile .form-content.has-summary { grid-template-columns: 1fr; }
.generated-ui.mobile .form-summary { border-left: 0; border-top: 1px solid #292929; }
.generated-ui.mobile .generated-header, .generated-ui.mobile .form-body { padding-left: 19px; padding-right: 19px; }
.generated-ui.mobile .form-actions { align-items: stretch; }
.generated-ui.mobile .submit-form { flex-grow: 1; }
.stars { display: flex; gap: 11px; }
.star-option { position: relative; cursor: pointer; color: #888; font-size: 32px; }
.star-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.star-option:has(input:checked) { color: var(--accent-ink); }
.star-option:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.step-progress { display: flex; gap: 6px; margin-bottom: 15px; }
.step-progress span { flex: 1; height: 2px; background: #363636; }
.step-progress span.done { background: var(--accent-ink); }
.step-caption { color: #aaa; font-size: 12px; margin-bottom: 23px; }
.success-state { padding: 56px 24px; text-align: center; }
.success-state h3 { font-size: 16px; font-weight: 400; margin: 0 0 24px; }
.empty-form, .scope-note { font-size: 13px; line-height: 1.7; color: #aaa; }
.scope-note { padding-top: 10px; margin: 0; }
.metrics { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 28px; border-top: 1px solid var(--border); padding: 16px 27px; font-size: 12px; background: #0a0a0a; }
.metrics > span { display: flex; gap: 10px; color: #888; }
.metrics strong { color: #ccc; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.metrics small { font-size: 12px; color: #888; margin-left: 4px; }
.metrics .total-metric strong { color: #fafafa; }
.empty-prototype { min-height: calc(100dvh - 65px); display: grid; place-items: center; padding: 40px 20px; text-align: center; }
.empty-index { color: #555; font-size: 32px; letter-spacing: -.08em; }
.cursor { color: #aaa; }
.empty-prototype p { font-size: 13px; color: #929292; margin: 18px 0 0; }
dialog { width: min(780px, calc(100vw - 40px)); max-height: min(780px, calc(100dvh - 80px)); padding: 0; margin: auto; background: #111; color: #ededed; border: 1px solid #393939; border-radius: 8px; box-shadow: 0 24px 100px #0009; }
dialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
.inspector-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 0 17px 0 23px; border-bottom: 1px solid #303030; height: 58px; position: sticky; top: 0; background: #111; z-index: 1; }
.inspector-tabs { display: flex; align-items: stretch; height: 100%; gap: 24px; }
.inspector-tabs button { padding: 0; font-size: 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #999; }
.inspector-tabs button[aria-selected="true"] { color: #fafafa; border-color: #ededed; }
.detail-panel { padding: 22px; min-height: 200px; }
.detail-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.subtle-button { border: 1px solid #3a3a3a; border-radius: 4px; padding: 8px 11px; font-size: 12px; background: #191919; color: #ccc; }
.subtle-button:hover { background: #252525; }
pre { margin: 0; padding: 17px; border: 1px solid #292929; border-radius: 4px; background: #0b0b0b; font: inherit; font-size: 12px; line-height: 1.8; color: #bcbcbc; white-space: pre-wrap; overflow-wrap: anywhere; }
.decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 19px; }
.decision-card { padding: 14px; border: 1px solid #333; border-radius: 4px; }
.decision-card span, .decision-card small { display: block; color: #999; font-size: 12px; line-height: 1.7; }
.decision-card strong { display: block; font-size: 15px; font-weight: 400; margin: 7px 0; }
.decision-table, .history-list table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.7; }
.decision-table th, .decision-table td, .history-list th, .history-list td { padding: 10px 7px; border-bottom: 1px solid #292929; text-align: left; font-weight: 400; }
.decision-table th, .history-list th { color: #999; }
.decision-table td:last-child { text-align: right; white-space: nowrap; }
.decision-table .omit { color: #919191; }
.decision-note, .catalog-note { color: #999; font-size: 12px; line-height: 1.8; }
.raw-data { margin-top: 22px; }
.raw-data summary { cursor: pointer; color: #aaa; font-size: 12px; margin-bottom: 14px; }
.session-summary { color: #bbb; font-size: 12px; line-height: 1.8; margin: 0 0 15px; }
.history-list { overflow-x: auto; }
.history-list table { white-space: nowrap; }
@media (min-width: 1500px) {
  .workspace { grid-template-columns: 410px minmax(0, 1fr); }
  .composer { padding-left: 28px; padding-right: 28px; }
  .canvas { padding-top: 64px; }
  .generated-ui { max-width: 790px; }
}
@media (max-width: 1150px) {
  .workspace { grid-template-columns: 320px minmax(0, 1fr); }
  .composer { padding-left: 20px; padding-right: 20px; }
  .canvas { padding: 35px 24px; }
  .form-content.has-summary { grid-template-columns: 1fr; }
  .form-summary { border-left: 0; border-top: 1px solid #292929; }
  .form-summary dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
  .form-summary dt, .form-summary dd { margin: 0; }
  .generated-header { padding: 21px; }
  .form-body { padding: 22px 21px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 290px minmax(0, 1fr); }
  .composer { padding-left: 16px; padding-right: 16px; }
  .canvas { padding: 26px 18px; }
  .layout-columns .fields { grid-template-columns: 1fr; }
  .metrics { gap: 15px; padding-left: 18px; padding-right: 18px; }
  .metrics > span { gap: 7px; }
  .preview-toolbar { padding-left: 19px; padding-right: 15px; }
  .example-chip { font-size: 12px; padding-left: 9px; padding-right: 9px; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 18px; gap: 28px; flex-wrap: wrap; }
  .brand { min-height: 55px; }
  .prototype-tabs { gap: 20px; }
  .prototype-tabs button { font-size: 12px; gap: 7px; min-height: 55px; }
  .prototype-tabs button span { font-size: 12px; }
  .workspace { grid-template-columns: 1fr; min-height: calc(100dvh - 56px); }
  .composer { padding: 22px 18px; border-right: 0; border-bottom: 1px solid var(--border); }
  #prompt-form > label { margin-bottom: 14px; }
  #prompt { min-height: 165px; max-height: 50dvh; font-size: 16px; line-height: 1.65; }
  .example-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 17px; }
  .example-chip { text-align: center; padding: 10px 4px; font-size: 12px; }
  .preview-toolbar { min-height: 57px; }
  .canvas { min-height: 400px; padding: 27px 18px; }
  .generated-ui { max-width: 540px; }
  .layout-columns .fields { grid-template-columns: 1fr 1fr; }
  .metrics { justify-content: space-between; }
  .empty-prototype { min-height: calc(100dvh - 56px); }
}
@media (max-width: 440px) {
  .topbar { gap: 14px; padding: 0 14px; }
  .brand { gap: 5px; font-size: 13px; }
  .brand > span:first-child { display: none; }
  .prototype-tabs { gap: 15px; }
  .prototype-tabs button { gap: 5px; }
  .layout-columns .fields { grid-template-columns: 1fr; }
  .form-actions .submit-form { flex-grow: 1; }
  .optional { font-size: 12px; }
  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 40px); }
  .inspector-toolbar { padding-left: 16px; padding-right: 10px; }
  .inspector-tabs { gap: 20px; }
  .detail-panel { padding: 14px; }
  .decision-grid { grid-template-columns: 1fr; }
  .metrics, .metrics strong, .metrics small { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
