:root {
  color-scheme: dark;
  --bg: #111016;
  --surface: #18171e;
  --raised: #201e28;
  --line: #34313e;
  --text: #f7f4fb;
  --muted: #b7b0c1;
  --violet: #c4b5fd;
  --ink: #1c142c;
  --danger: #fca5a5;
  --good: #a7dbb2;
  --type: "Avenir Next", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  font: 15px/1.5 var(--type);
}
* {box-sizing:border-box}
body {margin:0;background:var(--bg);color:var(--text);min-width:280px}
button,input,textarea,select {font:inherit}
a {color:inherit;text-decoration:none}
button,select {cursor:pointer}
button:disabled,select:disabled {cursor:default;opacity:.5}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,select:focus-visible {outline:2px solid var(--violet);outline-offset:3px}
h1,h2,h3,p {margin:0}
p {color:var(--muted)}
.skip {position:fixed;top:.5rem;left:.5rem;z-index:20;background:var(--violet);color:var(--ink);padding:.5rem 1rem;translate:0 -150%}
.skip:focus {translate:0}
.wrap {width:min(1180px,calc(100% - 3.5rem));margin-inline:auto}
.top {border-bottom:1px solid var(--line);background:var(--bg);position:relative;z-index:1}
.top .wrap,.toolbar {min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.brand {display:inline-flex;align-items:center;gap:10px;font-weight:760;letter-spacing:-.045em;font-size:1.45rem;white-space:nowrap;line-height:1}
.brand img {width:30px;height:30px}
.byline {font:10px var(--mono);letter-spacing:.02em;color:var(--muted);margin-left:5px}
.links,.actions {display:flex;align-items:center;gap:12px}
.links {gap:24px;color:var(--muted);font-size:.875rem}
.links a:hover,.text-button:hover {color:var(--text)}
.button,.text-button,.chip {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;border-radius:6px;white-space:nowrap;padding:.45rem .8rem;font-weight:650;font-size:.86rem}
.button {background:var(--surface);color:var(--text);border:1px solid var(--line)}
.button:hover:not(:disabled),.button[aria-pressed=true] {background:var(--raised);border-color:#6e647f}
.primary {background:var(--violet);border-color:var(--violet);color:var(--ink)}
.primary:hover:not(:disabled) {background:#d9ceff;border-color:#d9ceff}
.text-button {background:none;border:0;color:var(--muted)}
.danger {color:var(--danger)}
.icon {display:inline-block;width:16px;height:16px;flex:none;vertical-align:middle}
.hero {padding:70px 0 56px;display:grid;grid-template-columns:1fr .95fr;align-items:center;gap:68px;min-height:455px;position:relative}
.hero::before {content:"";position:absolute;z-index:-1;inset:0 -2%;background-image:linear-gradient(to right,#292433 1px,transparent 1px),linear-gradient(to bottom,#292433 1px,transparent 1px);background-size:35px 35px;mask-image:radial-gradient(ellipse at 68% 50%,#000 0,transparent 69%);opacity:.28;pointer-events:none}
.kicker,.address,.file-type,.status small {font:11px/1.4 var(--mono);letter-spacing:.07em;color:var(--violet)}
.hero h1 {font-size:clamp(3.35rem,6.35vw,6.55rem);line-height:.98;letter-spacing:-.086em;font-weight:785;margin:16px 0 22px}
.hero h1 span {color:var(--violet)}
.hero-copy {font-size:1.125rem;max-width:39ch}
.composer {border:1px solid #62566e;background:var(--surface);border-radius:8px;box-shadow:0 12px 28px #08070b45}
.composer:focus-within {border-color:var(--violet)}
.composer textarea {display:block;width:100%;padding:14px;background:none;border:0;color:var(--text);resize:vertical;min-height:86px}
.composer textarea:focus {outline:0}
.composer-footer {border-top:1px solid var(--line);padding:10px;display:flex;gap:8px;justify-content:space-between;align-items:center}
.composer-footer kbd {font:11px var(--mono);color:var(--muted);padding:0 4px}
.prompt-choices {display:flex;flex-wrap:wrap;gap:6px;margin-top:13px}
.chip {border:1px solid var(--line);background:var(--bg);color:var(--muted);min-height:31px;padding:.2rem .55rem;font-weight:500;white-space:normal;text-align:left}
.chip:hover {border-color:var(--violet);color:var(--text)}
.sample-shell {margin:0 auto 72px;border:1px solid #4b4457;border-radius:10px;overflow:hidden;background:var(--surface);box-shadow:0 18px 70px #08070b80}
.sample-top {display:flex;align-items:center;gap:16px;padding:12px 16px;border-bottom:1px solid var(--line)}
.sample-top .address {margin-inline:auto;background:var(--bg);border:1px solid var(--line);color:var(--muted);padding:.35rem min(9vw,100px);border-radius:5px;letter-spacing:0}
.sample-grid {display:grid;grid-template-columns:minmax(170px,.26fr) 1fr}
.sample-sidebar {padding:23px 18px;border-right:1px solid var(--line);display:flex;flex-direction:column;justify-content:space-between;gap:20px}
.sample-sidebar h2 {font-size:1rem}
.sample-sidebar p {font-size:.87rem;margin-top:10px}
.sample-sidebar .button {align-self:flex-start;max-width:100%;white-space:normal}
.sample-frame {display:block;background:#f0e2d0;border:0;width:100%;min-height:410px}
.section {padding:65px 0;border-top:1px solid var(--line)}
.section h2,.dashboard h1 {font-size:clamp(2rem,4vw,3.8rem);line-height:1.04;letter-spacing:-.065em;font-weight:760}
.section-header {display:grid;grid-template-columns:1fr .55fr;gap:30px;align-items:end;margin-bottom:32px}
.feature-grid {display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.feature {padding:24px 24px 24px 0}
.feature+.feature {border-left:1px solid var(--line);padding-left:24px}
.feature h3 {margin:.8rem 0 .45rem}
.feature .icon {color:var(--violet);width:22px;height:22px}
.example-list {display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.example {padding:20px 16px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px;text-align:left;font-weight:700}
.example:hover {border-color:var(--violet)}
.faq {display:grid;grid-template-columns:.75fr 1fr;gap:36px}
.faq details {border-top:1px solid var(--line);padding:16px 0}
.faq details:last-child {border-bottom:1px solid var(--line)}
.faq summary {cursor:pointer;font-weight:700}
.faq p {margin-top:8px}
.footer {padding:28px 0;border-top:1px solid var(--line)}
.footer .wrap {display:flex;justify-content:space-between;gap:15px;align-items:center;flex-wrap:wrap}
.auth {width:min(100% - 2rem,435px);margin:80px auto}
.auth h1,.settings h1 {font-size:2.5rem;letter-spacing:-.06em;line-height:1.1;margin-bottom:.6rem}
.auth form,.settings form {margin:1.65rem 0 1rem;background:var(--surface);border:1px solid var(--line);padding:24px;border-radius:8px}
.stack {display:grid;gap:14px}
.field {display:grid;gap:5px;color:var(--text);font-size:.88rem;font-weight:650}
input:not([type=range]),select {background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:.62rem .7rem;color:var(--text);min-width:0}
input[type=range] {accent-color:var(--violet)}
.help {font-size:.875rem}
.help a {color:var(--violet);text-decoration:underline}
.error {color:var(--danger)}
.dashboard,.settings {padding-top:58px;padding-bottom:70px}
.dashboard .title-row {display:flex;justify-content:space-between;align-items:start;gap:16px;margin-bottom:22px}
.usage {display:flex;gap:18px;flex-wrap:wrap;margin:15px 0;color:var(--muted);font:12px var(--mono)}
.usage b {color:var(--text)}
.setup {background:#231c33;border:1px solid #554374;color:#e3d8fb;padding:10px 12px;border-radius:6px;margin:12px 0;font-size:.88rem}
.controls {display:flex;gap:10px;align-items:center;justify-content:space-between;margin:22px 0 16px}
.controls input {width:min(100%,340px)}
.project-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,255px),1fr));gap:14px}
.project {background:var(--surface);border:1px solid var(--line);border-radius:8px;min-width:0}
.project:hover {border-color:#6e647f}
.project-shot {height:133px;overflow:hidden;background:var(--raised);border-radius:7px 7px 0 0;position:relative;display:grid;place-items:center;color:var(--muted)}
.project-shot iframe {width:100%;height:100%;border:0;pointer-events:none;background:white}
.project-shot a {position:absolute;inset:0}
.project-body {padding:14px;display:flex;justify-content:space-between;align-items:start;gap:8px;min-width:0}
.project-body h2 {font-size:1rem;overflow-wrap:anywhere}
.project-body p {font-size:.84rem;margin-top:3px}
.menu {position:relative}
.menu summary {list-style:none;cursor:pointer}
.menu summary::-webkit-details-marker {display:none}
.menu nav {z-index:4;position:absolute;right:0;top:calc(100% + 6px);display:grid;min-width:155px;padding:6px;background:var(--raised);border:1px solid var(--line);border-radius:6px;box-shadow:0 8px 25px #0007}
.menu nav a,.menu nav button {text-align:left;justify-content:start;padding:.45rem .6rem;white-space:nowrap}
.empty {text-align:center;padding:56px 18px;background:var(--surface);border:1px dashed #50475e;border-radius:8px;display:grid;justify-items:center;gap:12px}
.empty .icon {width:28px;height:28px;color:var(--violet)}
.settings {max-width:560px}
.editor {height:100dvh;display:grid;grid-template-rows:auto auto 1fr}
.toolbar {border-bottom:1px solid var(--line);padding:0 15px;background:var(--surface)}
.title-group {min-width:0;display:flex;align-items:center;gap:10px}
.title-group .project-title {overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:28vw}
.title-group .divider {width:1px;height:20px;background:var(--line)}
.title-group .save-status {font:11px var(--mono);color:var(--muted);white-space:nowrap}
.editor-tabs {display:flex;gap:5px;padding:5px 12px;border-bottom:1px solid var(--line);align-items:center;overflow:auto}
.tab {border:none;border-radius:4px;padding:7px 10px;background:transparent;color:var(--muted);font-size:.86rem;font-weight:650;white-space:nowrap}
.tab[aria-pressed=true] {background:var(--raised);color:var(--text)}
.workbench {min-height:0;display:grid;grid-template-columns:320px minmax(0,1fr);grid-template-columns:clamp(240px,var(--panel),510px) minmax(0,1fr)}
.chat {display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line);background:var(--surface)}
.chat-head {padding:12px 14px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:10px}
.chat-head h2 {font-size:1rem}
.chat-head input {width:66px}
.messages {overflow:auto;padding:14px;flex:1;display:grid;align-content:start;gap:12px}
.message {border:1px solid var(--line);background:var(--bg);border-radius:7px;padding:10px;min-width:0;overflow-wrap:anywhere}
.message .prompt {white-space:pre-wrap;color:var(--text);margin:.3rem 0}
.message .status {color:var(--muted);font-size:.8rem;display:flex;align-items:center;gap:6px}
.status-dot {width:7px;height:7px;background:var(--muted);border-radius:50%;display:inline-block;flex:none}
.status-dot.completed {background:var(--good)}
.status-dot.failed,.status-dot.cancelled {background:var(--danger)}
.status-dot.queued,.status-dot.running {background:var(--violet)}
.message .button {margin-top:8px}
.chat-form {padding:12px;border-top:1px solid var(--line)}
.chat-form .setup {margin-top:0}
.chat-form .composer textarea {min-height:78px}
.preview-region {min-width:0;min-height:0;display:flex;flex-direction:column;background:#0d0c12}
.preview-tools {display:flex;gap:8px;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:1px solid var(--line);overflow:auto}
.preview-tools .actions {gap:5px}
.preview-canvas {flex:1;min-height:0;padding:13px;overflow:auto}
#app:fullscreen {background:var(--bg)}
.live-frame {width:100%;height:100%;min-height:320px;display:block;margin:auto;border:1px solid var(--line);border-radius:7px;background:white}
.live-frame.tablet {width:768px}
.live-frame.mobile {width:390px}
.preview-canvas .empty {height:100%;align-content:center}
.source-grid {display:grid;grid-template-columns:minmax(145px,.27fr) minmax(0,1fr);min-height:0;flex:1}
.files {overflow:auto;border-right:1px solid var(--line);padding:10px}
.files h2 {font-size:1rem;margin:5px 0 8px}
.file-list {display:grid;gap:3px;margin:10px 0}
.file {text-align:left;overflow-wrap:anywhere;color:var(--muted);background:none;border:0;border-radius:5px;padding:6px;font:12px/1.4 var(--mono)}
.file[aria-pressed=true],.file:hover {background:var(--raised);color:var(--text)}
.source {min-height:0;min-width:0;display:flex;flex-direction:column}
.source .preview-tools {justify-content:start;flex-wrap:wrap}
.codebox {background:var(--bg);min-height:210px;flex:1;width:100%;overflow:auto;resize:none;margin:0;padding:13px;border:0;color:var(--text);font:13px/1.6 var(--mono);tab-size:2;white-space:pre}
.codebox:focus-visible {outline-offset:-3px}
.token-tag {color:#b4a1f2}.token-string {color:#c6dda6}.token-comment {color:#aba5b4}.token-keyword {color:#e9a6d8}
.editor-pane {overflow:auto;padding:18px}
.editor-pane h2 {margin-bottom:12px}
.revision {width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.revision small {color:var(--muted)}
.loading {display:grid;place-items:center;min-height:50vh;color:var(--muted)}
#notice:not(:empty) {position:fixed;z-index:10;bottom:15px;right:15px;max-width:calc(100% - 30px);padding:11px 15px;border:1px solid var(--line);border-radius:7px;background:var(--raised);box-shadow:0 5px 20px #0007}
dialog {width:min(450px,calc(100% - 25px));border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);padding:23px}
dialog::backdrop {background:#050408bd}
dialog p {margin:8px 0 14px}
.dialog-actions {display:flex;justify-content:end;gap:8px;margin-top:16px}
[data-mobile-chat] {display:none}
@media (max-width:850px) {
  .hero {gap:30px;padding:48px 0 38px;min-height:0}
  .wrap {width:calc(100% - 2rem)}
  .links {display:none}
  .toolbar .save-status {display:none}
}
@media (max-width:660px) {
  .hero,.section-header,.faq {grid-template-columns:1fr;gap:16px}
  .hero h1 {margin:12px 0 15px}
  .hero h1,.section h2 {max-width:14ch}
  .hero {padding-top:40px}
  .sample-sidebar {display:none}
  .sample-grid {display:block}
  .sample-shell {margin-bottom:36px}
  .sample-frame {min-height:350px}
  .sample-top {justify-content:space-between;gap:5px}
  .sample-top .address {margin:0;padding:4px 8px}
  .section {padding:38px 0}
  .feature-grid,.example-list {grid-template-columns:1fr}
  .feature+.feature {padding-left:0;border-left:0;border-top:1px solid var(--line)}
  .byline {display:none}
  .dashboard,.settings {padding-top:32px}
  .controls input {width:100%}
  .workbench {display:flex}
  .chat,.preview-region {width:100%}
  .chat {display:none;border:0}
  .workbench.mobile-chat .chat {display:flex}
  .workbench.mobile-chat .preview-region {display:none}
  [data-mobile-chat] {display:inline-flex}
  .resize {display:none}
  .toolbar {gap:5px;padding:0 8px}
  .toolbar .actions {gap:4px}
  .toolbar .button {padding:.37rem .49rem}
  .toolbar .brand img {width:25px;height:25px}
  .title-group {gap:5px}
  .source-grid {grid-template-columns:minmax(96px,.3fr) minmax(0,1fr)}
  .preview-tools {padding:6px;gap:5px}
  .preview-tools .button {min-height:32px;padding:4px 6px}
  .preview-canvas {padding:6px}
}
@media(max-width:370px) {
  .top .actions {gap:4px}
  .toolbar .account-menu {display:none}
  .mobile-hide {display:none}
}
@media(prefers-reduced-motion:no-preference) {
  .hero {animation:appear .38s ease-out}
  .button,.chip,.example {transition:background .16s,border-color .16s}
  @keyframes appear {from{opacity:0;translate:0 7px}to{opacity:1;translate:0}}
}
.preview-canvas.expanded {position:fixed;inset:0;z-index:5;background:var(--bg)}

.exit-preview {display:none}
.preview-canvas.expanded .exit-preview {display:inline-flex;position:fixed;top:10px;right:10px;z-index:1}

.preview-fullscreen > .toolbar,
.preview-fullscreen > .editor-tabs,
.preview-fullscreen .chat,
.preview-fullscreen .preview-tools {visibility:hidden}
