/* Architect 2.0 · quiet surfaces, clear hierarchy, purposeful green. */
:root {
  --paper: #f7f9f8;
  --surface: #ffffff;
  --sand: #f0f3f2;
  --sand-2: #e9eeec;
  --mist: #edf2f3;
  --sage: #eaf1ed;
  --ink: #202725;
  --ink-2: #4c5853;
  --ink-3: #65716c;
  --ink-4: #89948f;
  --line: #e3e9e6;
  --line-2: #d5ded9;
  --line-3: #eaf0ed;
  --ember: #4c7868;
  --ember-ink: #315c4c;
  --ember-soft: #edf5f1;
  --ember-line: #c6dbd0;
  --live: #3f7d4e;
  --live-ink: #2f6340;
  --amber: #b7791f;
  --amber-ink: #7a5010;
  --amber-soft: #fbf3e4;
  --canvas: #f0f4f2;
  --shadow-1: 0 1px 2px rgba(31, 36, 32, 0.08);
  --shadow-2: 0 4px 16px rgba(31, 56, 44, 0.07);
  --shadow-3: 0 18px 50px rgba(31, 56, 44, 0.13), 0 2px 6px rgba(31, 56, 44, 0.06);
  --display: "Instrument Sans", "DM Sans", system-ui, sans-serif;
  --ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
a:hover { color: var(--ember-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.i { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.eyebrow { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.display { font-family: var(--display); letter-spacing: -0.035em; font-weight: 500; }

/* ---------- Buttons ---------- */
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 13.5px; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: #f2f6f4; color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #333a34; color: #fff; }
.btn.arrow { padding: 0 4px 0 16px; gap: 10px; }
.btn.arrow .disc { width: 28px; height: 28px; border-radius: 999px; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.btn.big { height: 44px; font-size: 15px; padding: 0 22px; }
.btn.big.arrow { padding: 0 6px 0 20px; }
.btn.big.arrow .disc { width: 32px; height: 32px; }
.btn.quiet { border-color: transparent; background: transparent; padding: 0 10px; }
.btn.quiet:hover { background: var(--sand); }
.btn.danger { color: #9b2c1f; border-color: #e8c4bc; }
.btn.danger:hover { background: #fcefec; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.sm.arrow { padding: 0 3px 0 12px; }
.btn.sm.arrow .disc { width: 24px; height: 24px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.icon-btn:hover, .icon-btn.on { background: var(--sand); color: var(--ink); }
.icon-btn .pip { position: absolute; right: 6px; top: 6px; width: 7px; height: 7px; border-radius: 99px; border: 1.5px solid var(--paper); }
.link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { color: var(--ember-ink); text-decoration-color: currentColor; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; color: var(--ink); white-space: nowrap;
}
.chip:hover { background: #f2f6f4; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Status ---------- */
.dot { width: 7px; height: 7px; border-radius: 99px; background: #b6b2a8; display: inline-block; flex-shrink: 0; }
.dot.live { background: var(--live); }
.dot.ember { background: var(--ember); }
.dot.amber { background: var(--amber); }
.dot.ring { background: transparent; border: 1.5px solid var(--ink-4); }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.status.live { color: var(--live-ink); }
.status.ember { color: var(--ember-ink); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin, .shimmer { animation: none !important; } }

/* ---------- Form controls ---------- */
label.field-label, .field-label { display: block; font-size: 12.5px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
input[type="text"], input[type="email"], input:not([type]), textarea, select {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px;
  padding: 9px 12px; font-size: 13.5px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: #8fb0a0; box-shadow: 0 0 0 3px rgba(76, 120, 104, 0.12); }
textarea { resize: none; line-height: 1.55; }
select {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234a4f48' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.seg { display: inline-flex; background: var(--sand-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: var(--shadow-1); }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.seg.block { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 12px; }
.seg.block button { border-radius: 10px; padding: 8px 6px; font-size: 12.5px; }
.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d9d4c9; transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform 0.15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-3); font-size: 13.5px; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.card + .card { margin-top: 14px; }
.card h3 { font-family: var(--display); font-size: 19px; letter-spacing: -0.02em; }
.tint-sand { background: var(--sand); border: 0; }
.tint-sage { background: var(--sage); border: 0; }
.tint-mist { background: var(--mist); border: 0; }
.note-amber { display: flex; gap: 10px; align-items: center; background: var(--amber-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.listrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-3); }
.listrow:last-child { border-bottom: 0; }
.listrow p { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); }
.empty .display { color: var(--ink); font-size: 22px; margin-bottom: 6px; }

/* ---------- Home ---------- */
.home { position: relative; min-height: 100vh; overflow-x: hidden; }
.home-nav { position: relative; z-index: 2; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; border: 0; background: none; padding: 0; color: var(--ink); }
.brand .word { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.035em; }
.home-nav nav { display: flex; gap: 6px; margin-left: 28px; }
.home-nav nav button { border: 0; background: none; font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: 999px; }
.home-nav nav button:hover { background: rgba(255,255,255,.5); }
.credits { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 99px; border: 1px solid #d5ded9; background: #eff5f1;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.hero { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 50px 24px 0; }
.hero h1 { font-family: var(--display); font-size: clamp(40px, 6vw, 76px); line-height: 1; letter-spacing: -0.048em; }
.hero > p { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 640px; }
.composer {
  position: relative; z-index: 1; width: min(780px, calc(100vw - 32px)); margin: 42px auto 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-3);
  padding: 22px 18px 14px 24px; text-align: left;
}
.composer textarea { border: 0; padding: 0; font-size: 17px; line-height: 1.55; min-height: 56px; max-height: 220px; box-shadow: none; background: transparent; }
.composer textarea:focus { box-shadow: none; }
.composer-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.composer-tools .row { gap: 8px; }
.tool {
  height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; font-size: 13.5px; color: var(--ink);
}
.tool.round { width: 36px; padding: 0; justify-content: center; }
.tool:hover { background: #f2f6f4; }
.tool.on { background: var(--ember-soft); border-color: var(--ember-line); color: var(--ember-ink); }
.mini-switch { width: 28px; height: 16px; border-radius: 99px; background: var(--line); position: relative; display: inline-block; }
.mini-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.tool.on .mini-switch { background: var(--ember); }
.tool.on .mini-switch::after { transform: translateX(12px); }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; background: var(--sand); border-radius: 8px; padding: 4px 6px 4px 9px; font-size: 12px; }
.attachment button { border: 0; background: none; padding: 0; display: inline-flex; color: var(--ink-3); }
.model-select { width: auto; border: 0; background-color: transparent; font-size: 13.5px; color: var(--ink-2); padding: 6px 24px 6px 8px; background-position: right 4px center; border-radius: 99px; }
.model-select:hover { background-color: var(--sand); }
.quick { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px; margin-top: 22px; }
.quick button { border: 0; background: none; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); padding: 6px 4px; }
.quick button:hover { color: var(--ember-ink); }
.home-section { position: relative; z-index: 1; width: min(1248px, calc(100vw - 48px)); margin: 64px auto 80px; }
.home-section .head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.home-section h2 { font-family: var(--display); font-size: 26px; letter-spacing: -0.03em; }
.tabs-line { display: flex; gap: 18px; font-size: 13.5px; }
.tabs-line button { border: 0; background: none; padding: 0 0 4px; color: var(--ink-3); border-bottom: 1.5px solid transparent; }
.tabs-line button.on { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.proj { display: flex; flex-direction: column; gap: 12px; border: 0; background: none; padding: 0; text-align: left; }
.proj:hover .thumb { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.proj .name { font-size: 15px; font-weight: 600; }
.proj .meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.thumb {
  height: 156px; border-radius: 14px; border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; background: var(--t-bg);
}
.thumb .t-top { display: flex; justify-content: space-between; align-items: center; }
.thumb .t-logo { width: 48px; height: 7px; border-radius: 4px; background: var(--t-accent); }
.thumb .t-nav { display: flex; gap: 5px; }
.thumb .t-nav i { width: 18px; height: 5px; border-radius: 3px; background: var(--t-line); display: block; }
.thumb .t-h { width: 62%; height: 12px; border-radius: 5px; background: var(--t-ink); margin-top: 8px; }
.thumb .t-p { width: 42%; height: 7px; border-radius: 4px; background: var(--t-line); }
.thumb .t-in { margin-top: 4px; height: 28px; border-radius: 8px; background: var(--t-surface); border: 1px solid var(--t-line); display: flex; justify-content: flex-end; align-items: center; padding: 0 4px; }
.thumb .t-in i { width: 34px; height: 20px; border-radius: 6px; background: var(--t-accent); display: block; }
.thumb .t-cards { display: flex; gap: 6px; }
.thumb .t-cards i { flex: 1; height: 30px; border-radius: 7px; background: var(--t-surface); display: block; }
.thumb.new { background: var(--sand); border-style: dashed; align-items: center; justify-content: center; color: var(--ink-3); font-size: 13.5px; gap: 8px; }
.home-footer { position: relative; z-index: 1; text-align: center; padding: 0 20px 36px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Workspace ---------- */
.ws { height: 100vh; display: grid; grid-template-columns:minmax(0,1fr); grid-template-rows: 56px 1fr; overflow: hidden; }
.bar { display: flex; align-items: center; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); background: var(--paper); gap: 10px; position: relative; z-index: 20; }
.bar-left { width: 384px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-left .slash { color: #c9c4b8; }
.proj-name { border: 0; background: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14.5px; padding: 6px 6px; border-radius: 8px; max-width: 190px; }
.proj-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-name:hover { background: var(--sand); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatars { display: flex; margin-right: 4px; }
.avatars .avatar { border: 2px solid var(--paper); }
.avatars .avatar + .avatar { margin-left: -8px; background: var(--mist); }
.ws-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 0; }

/* Chat */
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--paper); }
.msgs { flex: 1 1 auto; overflow-y: auto; padding: 20px 22px 12px; display: flex; flex-direction: column; gap: 18px; }
.msg-user { align-self: flex-end; max-width: 312px; background: var(--sand); border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sel-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--ember-ink); background: #fff; border: 1px solid var(--ember-line); border-radius: 99px; padding: 2px 9px 2px 7px; white-space: nowrap; }
.msg-ai { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.55; color: #2a2f2a; }
.ai-head { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.plan-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.plan-card .pc-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f2f6f4; font-size: 12.5px; gap: 10px; }
.plan-card dl { display: grid; grid-template-columns: 78px minmax(0, 1fr); row-gap: 7px; column-gap: 10px; padding: 12px 14px; margin: 0; font-size: 13px; line-height: 1.4; }
.plan-card dt { color: var(--ink-3); }
.plan-card dd { margin: 0; }
.plan-card .pc-foot { border-top: 1px solid var(--line-3); padding: 9px 14px; font-size: 12.5px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.steps { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.step { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-2); }
.step .i { margin-top: 2px; }
.step.current { color: var(--ink); font-weight: 500; }
.step.todo { color: var(--ink-4); }
.step .todo-ring { width: 12px; height: 12px; border-radius: 99px; border: 1.5px solid #c9c4b8; margin: 3px 1px 0; flex-shrink: 0; }
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 8px; font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
.file-chip:hover { border-color: var(--line-2); background: #f2f6f4; }
.add { color: var(--live); }
.del { color: var(--ember-ink); }
.built { display: inline-flex; align-items: center; gap: 7px; color: var(--live-ink); font-weight: 500; font-size: 12.5px; }
.version-line { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); }
.version-line::before, .version-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.version-line button { border: 0; background: none; padding: 0; font-weight: 500; color: var(--ink-2); font-size: 12px; }
.version-line button:hover { color: var(--ember-ink); }
.options { display: flex; flex-direction: column; gap: 6px; }
.options button { text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 9px 12px; font-size: 13px; display: flex; align-items: center; gap: 9px; }
.options button:hover { background: #f2f6f4; }
.options button:disabled { opacity: 0.55; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 10px; }
.suggest .chip { height: 28px; font-size: 12px; color: var(--ink-2); }
.composer-mini { margin: 0 14px 14px; background: #fff; border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-2); padding: 10px 10px 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.composer-mini textarea { border: 0; padding: 0; background: transparent; box-shadow: none; font-size: 14px; min-height: 44px; max-height: 180px; }
.composer-mini textarea:focus { box-shadow: none; }
.composer-mini textarea:focus-visible, .composer textarea:focus-visible { outline: none; }
.composer-mini:focus-within { border-color: #8fb0a0; box-shadow: 0 0 0 3px rgba(76, 120, 104, 0.1), var(--shadow-2); }
.composer:focus-within { border-color: #abc3b7; }
.composer-mini .ctx { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ember-ink); background: var(--ember-soft); border-radius: 99px; padding: 3px 6px 3px 9px; }
.composer-mini .ctx button { border: 0; background: none; padding: 0; display: inline-flex; color: var(--ember-ink); }
.composer-mini .tools-row { display: flex; align-items: center; gap: 2px; }
.send { margin-left: auto; width: 34px; height: 34px; border-radius: 99px; border: 0; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.send:disabled { background: #bdb8ae; opacity: 1; }
.send .stop { width: 10px; height: 10px; border-radius: 2px; background: #fff; }

/* Canvas */
.canvas { min-width: 0; min-height: 0; background: var(--canvas); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.canvas-pad { padding: 14px; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.browser { flex: 1 1 auto; min-height: 0; background: #fff; border: 1px solid #dfe7e2; border-radius: 14px; box-shadow: 0 2px 10px rgba(74,58,32,.06); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.browser-bar { height: 46px; flex-shrink: 0; border-bottom: 1px solid var(--line-3); display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--paper); }
.browser-bar .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.url { flex: 1 1 auto; max-width: 440px; height: 30px; border-radius: 99px; background: #f0f4f2; display: flex; align-items: center; gap: 7px; padding: 0 12px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url .path { color: var(--ink-4); }
.select-btn { height: 30px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 12.5px; font-weight: 500; }
.select-btn.on { background: var(--ember-soft); border-color: var(--ember-line); color: var(--ember-ink); }
.viewport { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; background: #fff; display: flex; flex-direction: column; }
.viewport.framed { background: #edf2ef; padding: 22px 0; }
.device { flex: 1 0 auto; width: 100%; margin: 0 auto; position: relative; display: flex; flex-direction: column; }
.device > .appview { flex: 1 0 auto; }
.viewport.framed .device { border-radius: 26px; overflow: hidden; box-shadow: 0 0 0 1px #d9d4c9, 0 12px 30px rgba(40,32,20,.12); }
.device.tablet { width: 820px; max-width: calc(100% - 24px); }
.device.phone { width: 390px; max-width: calc(100% - 24px); }
.console { height: 32px; flex-shrink: 0; border-top: 1px solid var(--line-3); background: var(--paper); display: flex; align-items: center; gap: 14px; padding: 0 12px; font-size: 12px; color: var(--ink-3); }
.console button { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.console .applying { margin-left: auto; color: var(--ember-ink); display: inline-flex; align-items: center; gap: 7px; }
.drawer { height: 240px; flex-shrink: 0; border-top: 1px solid var(--line-3); background: #fff; overflow: auto; padding: 12px 16px; }
.run { border-bottom: 1px solid var(--line-3); padding: 10px 0; }
.run:last-child { border-bottom: 0; }
.run summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.run summary::-webkit-details-marker { display: none; }
.trace { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.trace li::marker { color: var(--ink-4); }
.out { margin-top: 8px; background: var(--sand); border-radius: 10px; padding: 9px 12px; font-size: 13px; }

/* Inspector (select to edit) */
.inspector {
  position: absolute; z-index: 15; width: 308px; background: #fff; border: 1px solid #dfe7e2; border-radius: 16px;
  box-shadow: 0 16px 40px rgba(40,32,20,.16); padding: 14px; display: flex; flex-direction: column; gap: 12px; font-family: var(--ui); color: var(--ink);
}
.inspector .ins-head { display: flex; justify-content: space-between; align-items: center; }
.inspector .ins-head strong { font-size: 14px; font-weight: 600; }
.agent-link { display: flex; align-items: center; gap: 10px; background: var(--sand); border-radius: 12px; padding: 10px 12px; border: 0; text-align: left; width: 100%; }
.agent-link:hover { background: #e5eee8; }
.agent-link .ag { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.agent-link small { display: block; font-size: 11.5px; color: var(--ink-3); }
.agent-link b { font-size: 13.5px; font-weight: 600; }
.inspector .toggle-row { padding: 7px 0; font-size: 13px; }
.inspector input, .inspector select { font-size: 13px; padding: 7px 10px; border-radius: 10px; }

/* ---------- Generated app (the user's app, themed by its own palette) ---------- */
.appview {
  --a-bg: #f4f8f5; --a-surface: #fff; --a-ink: #173f36; --a-muted: #4f5f59; --a-accent: #1f5c4f; --a-on: #fff; --a-soft: #eaf3ef; --a-line: #dce7e2;
  background: var(--a-bg); color: var(--a-ink); min-height: 100%; font-family: var(--ui); font-size: 15px; position: relative;
}
.appview .a-head { height: 60px; display: flex; align-items: center; gap: 30px; padding: 0 28px; border-bottom: 1px solid var(--a-line); background: var(--a-surface); }
.appview .a-brand { display: inline-flex; align-items: center; gap: 9px; font-family: Georgia, "Times New Roman", serif; font-size: 17px; white-space: nowrap; }
.appview .a-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--a-accent); color: var(--a-on); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.appview .a-nav { display: flex; gap: 20px; font-size: 13.5px; color: var(--a-muted); overflow-x: auto; }
.appview .a-nav button { border: 0; background: none; padding: 4px 0; color: inherit; white-space: nowrap; }
.appview .a-nav button.on { color: var(--a-ink); font-weight: 600; }
.appview .a-user { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--a-muted); white-space: nowrap; }
.appview .a-user span.av { width: 30px; height: 30px; border-radius: 99px; background: var(--a-soft); color: var(--a-ink); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.appview .a-main { max-width: 660px; margin: 0 auto; padding: 44px 24px 60px; display: flex; flex-direction: column; gap: 18px; }
.appview h2.a-h { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 34px; line-height: 1.15; letter-spacing: -0.01em; color: var(--a-ink); }
.appview .a-intro { color: var(--a-muted); margin-top: 8px; }
.appview form.a-form { display: flex; gap: 8px; align-items: center; border: 1px solid var(--a-line); border-radius: 12px; padding: 6px 6px 6px 14px; background: var(--a-surface); }
.appview form.a-form input { border: 0; padding: 8px 0; background: transparent; color: var(--a-ink); box-shadow: none; font-size: 15px; }
.appview form.a-form input::placeholder { color: var(--a-muted); opacity: 0.8; }
.appview .a-btn { border: 0; background: var(--a-accent); color: var(--a-on); border-radius: 8px; padding: 9px 16px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.appview .a-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.appview .a-chip { border: 1px solid var(--a-line); background: var(--a-surface); color: var(--a-ink); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.appview .a-chip:hover { border-color: var(--a-accent); }
.appview .a-card { border: 1px solid var(--a-line); border-radius: 14px; padding: 20px 22px; background: var(--a-surface); display: flex; flex-direction: column; gap: 12px; }
.appview .a-card .a-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--a-muted); }
.appview .a-card p { line-height: 1.6; }
.appview .a-evidence { background: var(--a-soft); color: var(--a-ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; white-space: pre-line; }
.appview .a-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.appview .a-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--a-soft); color: var(--a-accent); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; font-weight: 500; }
.appview .a-tag.hi { background: #fbeee8; color: #9a3f1e; }
.appview .a-link { border: 0; background: none; padding: 0; color: var(--a-accent); font-weight: 500; font-size: 13px; text-align: left; }
.appview .a-feedback { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--a-line); padding-top: 12px; font-size: 13px; color: var(--a-muted); }
.appview .a-feedback button { border: 1px solid var(--a-line); background: transparent; color: var(--a-ink); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; }
.appview .a-feedback button.on { background: var(--a-accent); color: var(--a-on); border-color: var(--a-accent); }
.appview .a-list { display: flex; flex-direction: column; }
.appview .a-list > div { padding: 14px 0; border-bottom: 1px solid var(--a-line); }
.appview .a-list strong { display: block; margin-bottom: 4px; }
.appview .a-list small { color: var(--a-muted); }
.appview table { width: 100%; border-collapse: collapse; font-size: 14px; }
.appview th, .appview td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--a-line); }
.appview th { color: var(--a-muted); font-weight: 500; font-size: 12.5px; }
.appview .bars { display: flex; flex-direction: column; gap: 8px; }
.appview .bar-row { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.appview .bar-track { height: 10px; border-radius: 99px; background: var(--a-soft); overflow: hidden; }
.appview .bar-track i { display: block; height: 100%; background: var(--a-line); border-radius: 99px; }
.appview .bar-row.hi .bar-track i { background: var(--a-accent); }
.appview .a-empty { color: var(--a-muted); padding: 30px 0; }
.appview .a-signin { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--a-line); border-radius: 99px; padding: 4px 10px; font-size: 12px; color: var(--a-muted); }
.appview.dark .a-tag.hi { background: #3a2a24; color: #f0b79e; }
.skel { background: linear-gradient(90deg, #eaf0ed 0%, #f4f7f5 50%, #eaf0ed 100%); background-size: 200% 100%; border-radius: 8px; animation: shimmer 1.4s ease-in-out infinite; }
.shimmer { animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.reveal { animation: reveal 0.45s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.builder-hint { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-family: var(--ui); background: var(--ember-soft); color: var(--ember-ink); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; }

/* Selection */
.selecting [data-el] { cursor: pointer; }
.selecting [data-el]:hover { outline: 2px dashed rgba(76, 120, 104, 0.55); outline-offset: 4px; border-radius: 6px; }
[data-el].is-selected { outline: 2px solid var(--ember) !important; outline-offset: 5px; border-radius: 8px; position: relative; }
[data-el].is-selected::before {
  content: attr(data-label); position: absolute; left: -7px; top: -30px; background: var(--ember); color: #fff; font: 500 11.5px/1 var(--ui);
  padding: 5px 9px; border-radius: 6px 6px 0 0; white-space: nowrap; letter-spacing: 0; text-transform: none; z-index: 2;
}

/* Code */
.code-wrap { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); background: #fff; }
.tree { border-right: 1px solid var(--line-3); background: var(--paper); overflow-y: auto; padding: 10px 8px; font-size: 13px; }
.tree .t-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 8px 8px; }
.tree-row { width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px; text-align: left; color: var(--ink-2); font-size: 13px; }
.tree-row.file:hover { background: #f0f5f2; }
.tree-row.on { background: #e8f1eb; color: var(--ink); font-weight: 500; }
.tree-row .mark { margin-left: auto; font-family: var(--mono); font-size: 11px; }
.tree-row .mark.M { color: var(--ember-ink); }
.tree-row .mark.A { color: var(--live-ink); }
.tree-row.appear { animation: reveal 0.35s ease both; }
.viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.viewer-bar { height: 42px; flex-shrink: 0; border-bottom: 1px solid var(--line-3); display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--paper); font-size: 12.5px; }
.crumbs { display: flex; gap: 6px; color: var(--ink-3); align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs b { color: var(--ink); font-weight: 500; }
.code { flex: 1 1 auto; overflow: auto; margin: 0; padding: 10px 0 30px; font-family: var(--mono); font-size: 12.5px; line-height: 21px; color: var(--ink); background: #fff; counter-reset: ln; }
.code .ln { display: block; padding: 0 16px 0 0; white-space: pre; min-height: 21px; }
.code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 48px; padding-right: 16px; text-align: right; color: #b6b2a8; user-select: none; }
.code .ln.added { background: #eef5ef; box-shadow: inset 3px 0 0 var(--live); }
.tk-kw { color: #9c3d1f; }
.tk-str { color: #3f7d4e; }
.tk-com { color: #89948f; font-style: italic; }
.tk-num { color: #8a5a12; }
.tk-key { color: #2f5d8a; }
.code-foot { height: 38px; flex-shrink: 0; border-top: 1px solid var(--line-3); display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--paper); font-size: 12px; color: var(--ink-3); }
.cmd { font-family: var(--mono); font-size: 11.5px; background: var(--sand); color: var(--ink); border-radius: 6px; padding: 3px 8px; border: 0; }
.cmd:hover { background: #e5eee8; }

/* Code: changes, editor, terminal */
.viewer-bar .seg button { padding: 4px 11px; }
.mark { font-family: var(--mono); font-size: 11px; font-weight: 500; }
.mark.M { color: var(--ember-ink); }
.mark.A { color: var(--live-ink); }
.mark.D { color: #9b2c1f; }
.edit-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.edit-note { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12.5px; color: var(--ink-2); background: var(--sage); border-bottom: 1px solid var(--line-3); }
.edit-note.bad { background: var(--ember-soft); color: var(--ember-ink); }
.editor { flex: 1 1 auto; border: 0; border-radius: 0; resize: none; padding: 12px 16px 30px 64px; font-family: var(--mono); font-size: 12.5px; line-height: 21px; tab-size: 2; white-space: pre; overflow: auto; background: #ffffff; box-shadow: inset 48px 0 0 #f5f8f6, inset 49px 0 0 var(--line-3); }
.editor:focus { box-shadow: inset 48px 0 0 #f5f8f6, inset 49px 0 0 var(--line-3); }
.diffs { flex: 1 1 auto; overflow: auto; padding: 14px 16px 30px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.diffs.in-dialog { max-height: 360px; padding: 0; background: none; }
.diff-file { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.diff-file summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12.5px; background: #f2f6f4; }
.diff-file summary::-webkit-details-marker { display: none; }
.diff-file summary .mono { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-file summary .add, .diff-file summary .del { font-family: var(--mono); font-size: 11.5px; }
.diff { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 20px; overflow-x: auto; padding: 4px 0; }
.dl { display: block; white-space: pre; padding-right: 16px; }
.dl i { display: inline-block; width: 38px; padding-right: 8px; text-align: right; color: #b6b2a8; font-style: normal; user-select: none; }
.dl b { display: inline-block; width: 18px; text-align: center; font-weight: 500; color: var(--ink-4); user-select: none; }
.dl.d-add { background: #eef5ef; }
.dl.d-add b { color: var(--live); }
.dl.d-del { background: #fbefeb; }
.dl.d-del b { color: var(--ember-ink); }
.dl.gap { color: var(--ink-4); font-family: var(--ui); font-size: 12px; padding: 4px 0 4px 108px; background: #f5f8f6; }
.term { flex-shrink: 0; background: #202725; color: #e9e5dc; border-top: 1px solid #333a34; display: flex; flex-direction: column; }
.term.open { height: 230px; }
.term-head { height: 38px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid #333a34; }
.term-toggle { border: 0; background: none; color: #fff; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 4px; }
.btn.dark { background: #2c332d; border-color: #3a423b; color: #e9e5dc; height: 28px; }
.btn.dark:hover { background: #363e37; color: #fff; }
.term-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 14px 10px; font-family: var(--mono); font-size: 12px; line-height: 19px; }
.tl { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl.cmd, .tl.cmd:hover { background: transparent; color: #fff; margin-top: 6px; padding: 0; border-radius: 0; }
.tl.ok { color: #8fc79d; }
.tl.bad { color: #f0a58a; }
.tl.dim { color: #9ea398; }
.tl .btn { margin: 6px 0 2px; }
.term-input { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.term-input span { color: #9ea398; }
.term-input input { border: 0; background: transparent; color: #fff; font-family: var(--mono); font-size: 12px; padding: 2px 0; box-shadow: none; }
.term-input input:focus { box-shadow: none; }
.term-input input::placeholder { color: #6f746b; }

/* Agents and Data */
.panel-wrap { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--paper); }
.side-list { border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.side-list .eyebrow { padding: 0 8px 6px; }
.agent-item { width: 100%; border: 1px solid transparent; background: none; border-radius: 14px; padding: 12px; text-align: left; display: flex; gap: 10px; align-items: flex-start; }
.agent-item:hover { background: var(--sand); }
.agent-item.on { background: #fff; border-color: var(--line); box-shadow: var(--shadow-1); }
.agent-item .ag { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.agent-item .ag.alt { background: var(--mist); color: var(--ink); }
.agent-item b { display: block; font-size: 13.5px; font-weight: 600; }
.agent-item small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.flow-mini { margin: 10px 4px 0; padding: 12px; border-radius: 14px; background: var(--sand); font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.flow-mini .arrow { color: var(--ink-4); padding-left: 6px; }
.main-panel { overflow-y: auto; padding: 22px 28px 40px; }
.main-panel .ph { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.main-panel .ph h2 { font-family: var(--display); font-size: 24px; letter-spacing: -0.03em; }
.subtabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line-3); margin-bottom: 18px; font-size: 13.5px; }
.subtabs button { border: 0; background: none; padding: 0 0 10px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.fw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.checks { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.checks > div { display: flex; align-items: center; gap: 9px; }

/* Popovers */
.pop {
  position: absolute; top: 60px; right: 12px; z-index: 40; width: 420px; max-width: calc(100vw - 24px); max-height: calc(100vh - 80px); overflow-y: auto;
  background: #fff; border: 1px solid #dfe7e2; border-radius: 20px; box-shadow: 0 24px 70px rgba(20,18,12,.22); padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.pop.left { left: 60px; right: auto; width: 340px; }
.pop h2 { font-family: var(--display); font-size: 24px; letter-spacing: -0.035em; line-height: 1.1; }
.pop .sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.pop-foot { border-top: 1px solid var(--line-3); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.menu { display: flex; flex-direction: column; }
.menu button { border: 0; background: none; text-align: left; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13.5px; }
.menu button:hover { background: var(--sand); }
.menu hr { border: 0; border-top: 1px solid var(--line-3); margin: 6px 0; }
.addr { display: flex; align-items: center; height: 40px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 5px 0 12px; font-size: 13.5px; gap: 6px; }
.progress { height: 6px; border-radius: 99px; background: #edf2ef; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ember); border-radius: 99px; transition: width 0.4s ease; }
.versions .listrow { padding: 8px 0; font-size: 13px; }

.swatch { width: 26px; height: 26px; border-radius: 99px; border: 2px solid #fff; padding: 0; background: linear-gradient(135deg, var(--sw-bg) 0 50%, var(--sw) 50% 100%); box-shadow: 0 0 0 1px var(--line-2); }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.thumb .t-top, .thumb .t-in, .thumb .t-cards, .thumb .t-nav { display: flex; }
.thumb .t-h, .thumb .t-p { display: block; }

/* Dialog */
dialog#modal {
  border: 1px solid var(--line); padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  box-shadow: 0 30px 80px rgba(20, 18, 12, 0.28); color: var(--ink); background: #fff;
}
dialog#modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(31, 36, 32, 0.4); }
.dlg { padding: 28px 30px 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; max-height: calc(100vh - 40px); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dlg-head h2 { font-family: var(--display); font-size: 24px; letter-spacing: -0.04em; line-height: 1.08; }
.dlg-head p { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.dlg-close { width: 34px; height: 34px; border-radius: 99px; border: 0; background: var(--sand); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.quote { background: var(--sand); border-radius: 14px; padding: 13px 16px; font-size: 14px; line-height: 1.5; }
.provider { height: 48px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 15px; font-weight: 500; width: 100%; }
.provider:hover { background: #f2f6f4; }
.or { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.choice { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.choice:hover { background: #f5f8f6; }
.choice.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.choice b { display: block; font-size: 14px; font-weight: 600; }
.choice small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tpl { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.tpl .thumb { height: 130px; }
.tpl b { font-size: 14px; font-weight: 600; }
.tpl small { color: var(--ink-3); font-size: 12.5px; display: block; margin-top: 2px; }
.pre { background: var(--ink); color: #e9e5dc; border-radius: 12px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; margin: 0; }
.diffcols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.diffcols > div { background: var(--sand); border-radius: 12px; padding: 10px 12px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: none;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: calc(100vw - 32px);
}

/* Recipient and draft views */
.shared { min-height: 100vh; display: flex; flex-direction: column; }
.shared .appview { flex: 1 1 auto; }
.made-with { position: fixed; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px 6px 8px; font-size: 12px; color: var(--ink-2); box-shadow: var(--shadow-2); text-decoration: none; }
.gate { max-width: 440px; margin: 12vh auto; padding: 0 20px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }

/* Mobile switch */
.mobile-switch { display: none; }

@media (max-width: 1100px) {
  .ws-body { grid-template-columns: 340px minmax(0, 1fr); }
  .bar-left { width: auto; }
  .avatars, .hide-md { display: none !important; }
}
@media (max-width: 860px) {
  .home-nav { padding: 0 16px; }
  .home-nav nav, .credits { display: none; }
  .hero { padding-top: 26px; }
  .hero > p { font-size: 16px; }
  .composer { margin-top: 28px; padding: 16px 12px 12px 16px; border-radius: 22px; }
  .composer-tools { flex-wrap: wrap; }
  .composer-tools .hide-sm { display: none; }
  .home-section { margin-top: 44px; }
  .ws { grid-template-rows: auto 1fr; height: 100dvh; }
  .bar { flex-wrap: wrap; height: auto; padding: 8px 10px; row-gap: 8px; }
  .bar-left { order: 1; flex: 1 1 auto; }
  .bar-right { order: 2; }
  .bar .tabs { order: 3; width: 100%; overflow-x: auto; }
  .bar .tabs button { flex: 1; }
  .hide-sm { display: none !important; }
  .ws-body { grid-template-columns: 1fr; padding-bottom: 56px; }
  .ws-body.m-chat .canvas, .ws-body.m-app .chat { display: none; }
  .chat { border-right: 0; }
  .mobile-switch { display: flex; position: fixed; left: 12px; right: 12px; bottom: 10px; z-index: 30; }
  .mobile-switch .seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow-3); background: #fff; border: 1px solid var(--line); }
  .mobile-switch .seg button { padding: 10px; font-size: 14px; }
  .canvas-pad { padding: 0; }
  .browser { border-radius: 0; border: 0; }
  .browser-bar .url { display: none; }
  .code-wrap, .panel-wrap { grid-template-columns: 1fr; }
  .code-wrap { grid-template-rows: minmax(0, 140px) minmax(0, 1fr); }
  .viewer-bar { height: auto; min-height: 42px; flex-wrap: wrap; padding: 8px 12px; }
  .viewer-bar > .seg { flex-shrink: 0; }
  .viewer-bar > .crumbs { flex: 1 1 120px; }
  .viewer-bar > .row { flex-wrap: wrap; max-width: 100%; }
  .viewer-bar > select { min-width: 0; max-width: 100%; }
  .tree, .side-list { max-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .main-panel { padding: 18px 16px 40px; }
  .two { grid-template-columns: 1fr; }
  .pop { left: 12px; right: 12px; width: auto; top: 110px; }
  .appview .a-head { padding: 0 16px; gap: 14px; }
  .appview .a-nav { display: none; }
  .appview .a-main { padding: 28px 16px 48px; }
  .appview h2.a-h { font-size: 27px; }
  .tpl-grid { grid-template-columns: 1fr; }
  .dlg { padding: 22px 20px 20px; }
}

/* Capability views share the canvas; the workflow is the visual center. */
.cap-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:18px; }
.cap-heading h2 { font-family:var(--display); font-size:27px; letter-spacing:-.035em; }
.cap-heading p { margin-top:5px; max-width:60ch; }
.cap-scroll { height:100%; overflow:auto; padding:24px 28px 90px; min-width:0; }
.cap-nav { display:flex; gap:6px; flex-wrap:wrap; padding:14px 20px; border-bottom:1px solid var(--line); background:var(--paper); }
.cap-scroll > .cap-nav { padding:0 0 16px; margin-bottom:22px; }
.data-shell { display:flex; flex-direction:column; height:100%; min-height:0; }
.data-shell > .panel-wrap { flex:1; min-height:0; }
.check-label { display:flex; align-items:center; gap:10px; padding:6px 0; }
.check-label input { width:17px; height:17px; flex-shrink:0; accent-color:var(--ink); }
.form-error:empty { display:none; }
.form-error { color:var(--ember-ink); background:var(--ember-soft); padding:10px 12px; border-radius:8px; }
.database-layout { display:grid; grid-template-columns:180px minmax(0,1fr); gap:24px; }
.collection-list { display:flex; flex-direction:column; gap:6px; }
.collection-list > p { margin:16px 8px; }
.collection { border:0; background:transparent; display:flex; justify-content:space-between; align-items:center; gap:8px; padding:12px; border-radius:8px; text-align:left; }
.collection.on { background:var(--sand-2); font-weight:600; }
.database-main { min-width:0; padding:20px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.table-scroll { overflow:auto; margin:14px 0; }
.cap-table { width:100%; border-collapse:collapse; font-size:13px; text-align:left; }
.cap-table th { font-weight:500; color:var(--ink-3); background:var(--paper); }
.cap-table th,.cap-table td { padding:12px; border-bottom:1px solid var(--line); white-space:nowrap; max-width:300px; overflow:hidden; text-overflow:ellipsis; }
.workflow-pane { height:100%; overflow:auto; padding-bottom:64px; background:var(--paper); }
.workflow-head { padding:24px 28px 20px; border-bottom:1px solid var(--line); background:var(--surface); }
.workflow-head .cap-heading { margin-bottom:10px; }
.workflow-map { display:flex; align-items:center; flex-direction:column; padding:32px 20px; background-image:radial-gradient(var(--line-2) 1px,transparent 1px); background-size:20px 20px; min-height:380px; }
.flow-end { display:flex; align-items:center; gap:8px; border:1px solid var(--line-2); padding:9px 17px; border-radius:30px; background:var(--paper); font-size:12px; }
.flow-wire { width:1px; height:24px; background:var(--ink-4); flex-shrink:0; }
.flow-node { position:relative; display:grid; grid-template-columns:32px 1fr; gap:3px 10px; text-align:left; width:245px; max-width:100%; padding:16px; background:var(--surface); border:1px solid var(--line-2); border-radius:12px; box-shadow:var(--shadow-1); }
.flow-node:hover { border-color:var(--ink-3); }
.flow-node strong { font-size:14px; font-weight:500; }
.flow-node small { grid-column:2; color:var(--ink-3); }
.node-icon { grid-row:1/3; align-self:center; color:var(--ink-2); }
.node-open { grid-column:2; display:flex; align-items:center; gap:7px; margin-top:10px; font-size:11px; color:var(--ink-3); }
.main-node { border-color:#66776d; border-top:3px solid #365849; }
.flow-source { padding:8px 14px; border:1px dashed var(--line-2); background:var(--paper); font-size:12px; border-radius:8px; text-align:center; }
.flow-branches { display:flex; flex-wrap:wrap; justify-content:center; gap:16px; max-width:100%; }
.flow-branch { display:flex; flex-direction:column; align-items:center; gap:9px; max-width:100%; }
.flow-condition { font-size:11px; color:var(--ink-3); background:var(--paper); padding:2px 8px; max-width:260px; text-align:center; }
.flow-add { padding:10px 16px; border:1px dashed var(--line-2); border-radius:8px; background:var(--surface); }
.workflow-bottom { padding:22px 28px; display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
.workflow-bottom .card { margin:0; min-width:0; }
.workflow-bottom .row input { min-width:0; }
.market-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.market-card { border:1px solid var(--line); border-radius:13px; overflow:hidden; }
.market-card > div:last-child { padding:18px; }
.market-card h3 { font-family:var(--display); font-size:23px; margin:6px 0; }
.market-card p { font-size:13px; color:var(--ink-3); margin-bottom:18px; }
.market-art { height:135px; display:flex; align-items:center; gap:22px; padding:28px; color:var(--market-accent); background:var(--sand); }
.market-art > span { display:grid; place-items:center; border-radius:14px; background:var(--surface); width:56px; height:56px; flex-shrink:0; }
.market-lines { flex:1; display:flex; flex-direction:column; gap:11px; }
.market-lines i { height:6px; background:var(--market-accent); opacity:.25; border-radius:4px; }
.market-lines i:nth-child(2) { width:72%; }.market-lines i:nth-child(3) { width:88%; }
.design-layout { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.theme-list { display:flex; flex-direction:column; gap:8px; margin:16px 0; max-height:310px; overflow:auto; }
.palette { display:flex; padding:0 4px; }.palette i { width:19px; height:28px; border:1px solid rgba(0,0,0,.08); }.palette i:first-child { border-radius:6px 0 0 6px; }.palette i:last-child { border-radius:0 6px 6px 0; }
.choice.selected { outline:1px solid var(--ink-2); }
.design-preview { padding:28px; border-radius:12px; border:1px solid var(--line); }
.design-preview h3 { font-family:var(--display); font-size:28px; margin:25px 0 10px; }.design-preview > div { padding:20px; margin:20px 0; border-radius:10px; }.design-preview p { margin:12px 0; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:22px 0; }
.stats-grid > div { padding:16px 0; border-top:2px solid var(--line); }.stats-grid strong { font-family:var(--display); font-size:32px; display:block; }.stats-grid span { color:var(--ink-3); font-size:12px; }
.dlg details { padding:12px 0; border-bottom:1px solid var(--line); }.dlg summary { cursor:pointer; font-weight:500; }.dlg details p { margin-top:8px; color:var(--ink-3); }
@media(max-width:1100px) { .workflow-bottom { grid-template-columns:1fr; }.cap-heading { flex-wrap:wrap; }.database-layout { grid-template-columns:145px minmax(0,1fr); gap:12px; } }
@media(max-width:650px) {
 .cap-scroll { padding:18px 14px 90px; }.cap-heading h2 { font-size:25px; }.cap-heading { gap:12px; }
 .workflow-head { padding:20px 16px; }.workflow-bottom { padding:16px; }.workflow-map { padding:24px 12px; }.flow-branches { flex-direction:column; }
 .database-layout,.design-layout { grid-template-columns:1fr; }.collection-list { flex-direction:row; flex-wrap:wrap; }.collection-list > p { display:none; }.database-main { padding:14px; }
 .market-grid { grid-template-columns:1fr; }.market-card { display:grid; grid-template-columns:90px 1fr; }.market-art { height:100%; padding:15px; }.market-lines { display:none; }.market-art > span { width:48px; height:48px; }
 .stats-grid { grid-template-columns:1fr 1fr; }.theme-list { max-height:200px; }.design-preview { padding:20px; }
 .workflow-bottom form.row { flex-wrap:wrap; }.workflow-bottom form.row input { flex-basis:100%; }
 .cap-nav { padding:12px 14px; }.console { flex-wrap:wrap; }
}
.mockup-review { background:var(--paper); padding:14px; margin-top:14px; border:1px solid var(--line); border-radius:9px; }
.mockup-review .thumb { height:100px; margin-bottom:14px; }.mockup-review strong { font-size:18px; }.mockup-review p { margin:8px 0 12px; font-size:12px; }

/* ---------- Workspace-led home ---------- */
.home { display: grid; grid-template-columns: 216px minmax(0,1fr); background: var(--paper); }
.home-sidebar { position: sticky; top: 0; height: 100dvh; padding: 28px 14px 14px; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); z-index: 25; overflow-y: auto; }
.home-sidebar > .brand { padding: 0 12px; margin-bottom: 28px; }
.brand-version { font: 10px var(--ui); letter-spacing: 0; color: var(--ink-3); margin-left: 6px; vertical-align: top; }
.workspace-label { display: flex; gap: 9px; align-items: center; margin: 0 6px 22px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.nav-group { display: grid; gap: 3px; margin-bottom: 22px; }
.nav-label { color: var(--ink-3); font-size: 11px; padding: 4px 12px 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; width: 100%; border: 0; background: transparent; border-radius: 7px; text-align: left; color: var(--ink-2); font-size: 13px; }
.nav-item .i { color: #7c8982; }
.nav-item:hover { background: var(--sand); color: var(--ink); }
.nav-item[aria-current="page"] { background: #eaf2ee; color: #315c4c; font-weight: 600; }
.nav-item[aria-current="page"] .i { color: #4c7868; }
.sidebar-bottom { margin-top: auto; padding-top: 20px; }
.sidebar-account { display: flex; gap: 10px; align-items: center; padding: 16px 8px 2px; margin-top: 12px; border-top: 1px solid var(--line); }
.sidebar-account > span { min-width: 0; }
.sidebar-account b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 135px; font-size: 12px; font-weight: 500; }
.sidebar-account small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.home-main { min-width: 0; }
.home-nav { height: 66px; padding: 0 32px; }
.home-breadcrumb { font-size: 12px; color: var(--ink-3); }
.home-breadcrumb span { margin: 0 10px; color: #bcc7c0; }
.home-nav .credits { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 11.5px; gap: 5px; }
.mobile-nav-toggle { display: none; }
.hero { padding: 52px 24px 0; }
.creation-mark { width: 48px; height: 48px; margin-bottom: 22px; color: #739384; }
.creation-mark svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.15; stroke-linejoin: round; }
.hero h1 { font-size: clamp(28px,3.15vw,42px); letter-spacing: -.045em; line-height: 1.15; font-weight: 500; }
.hero > p { font-size: 14px; color: var(--ink-3); margin-top: 12px; max-width: 530px; }
.composer { width: min(700px,calc(100% - 64px)); margin-top: 32px; padding: 22px 16px 13px 20px; border-radius: 16px; box-shadow: 0 2px 3px #183c2c04,0 8px 26px #183c2c06; }
.composer textarea { font-size: 15px; min-height: 72px; }
.composer textarea::placeholder { color: #89948e; }
.composer-tools { margin-top: 14px; gap: 6px; }
.composer-tools .row { gap: 5px; }
.composer .tool { border-radius: 7px; border-color: transparent; font-size: 11.5px; height: 30px; padding: 0 8px; color: var(--ink-2); }
.composer .tool.round { width: 30px; padding: 0; background: var(--sand); border: 1px solid var(--line); }
.composer .tool:hover { background: var(--sand); }
.composer .mini-switch { transform: scale(.82); margin: 0 -2px; }
.composer .model-select { font-size: 11.5px; }
.composer .btn.big { height: 34px; font-size: 12px; padding: 0 12px; gap: 10px; }
.composer .btn.arrow .disc { width: 17px; height: 17px; background: transparent; color: inherit; }
.composer:focus-within, .composer-mini:focus-within { border-color: #91b09f; box-shadow: 0 0 0 3px #4c78680c,0 4px 18px #183c2c06; }
.quick { margin-top: 17px; gap: 5px 20px; align-items: center; padding: 0 20px; }
.quick button { font-size: 12px; color: var(--ink-3); gap: 6px; }
.quick-divider { height: 13px; width: 1px; background: var(--line-2); }
.starter-prompts { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 20px 20px 0; flex-wrap: wrap; }
.starter-prompts > span { font-size: 11px; color: var(--ink-3); margin-right: 2px; }
.starter-prompts button { background: transparent; border: 1px solid var(--line); color: var(--ink-2); font-size: 11px; padding: 6px 10px; border-radius: 6px; }
.starter-prompts button:hover { background: #fff; border-color: #b7c8be; }
.home-section { width: min(1056px,calc(100% - 80px)); margin: 70px auto 48px; scroll-margin-top: 24px; }
.home-section .head { margin-bottom: 20px; align-items: center; }
.home-section h2 { font-size: 19px; font-weight: 600; letter-spacing: -.035em; }
.home-section .link { font-size: 12px; color: var(--ink-3); text-decoration: none; }
.home-section .link:hover { color: var(--ink); }
.home-section .tabs-line { font-size: 12px; gap: 16px; }
.proj-grid { grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.proj { min-width: 0; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .15s,box-shadow .15s; }
.proj:hover { border-color: #aebfb5; box-shadow: 0 4px 14px #183c2c08; }
.proj:hover .thumb { box-shadow: none; transform: none; }
.proj > span:last-child { padding: 13px 14px 15px; }
.proj .name { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .meta { font-size: 10.5px; margin-top: 5px; }
.thumb { display: flex; flex-direction: column; width: 100%; height: 178px; border: 0; border-radius: 0; padding: 0; gap: 0; border-bottom: 1px solid var(--line); color: var(--t-ink); }
.mini-browser { display: flex; align-items: center; gap: 3px; height: 23px; flex-shrink: 0; padding: 0 9px; background: var(--t-surface); border-bottom: 1px solid var(--t-line); }
.mini-browser > i { width: 3px; height: 3px; border-radius: 50%; background: var(--t-line); }
.mini-browser > span { font-size: 5px; margin: 0 auto; opacity: .6; }
.mini-app { display: flex; flex-direction: column; flex: 1; padding: 14px 18px; text-align: center; align-items: center; }
.mini-brand { font-size: 6px; font-weight: 600; display: flex; align-items: center; gap: 4px; align-self: flex-start; margin-bottom: 17px; }
.mini-brand .i { color: var(--t-accent); }
.mini-app strong { font: 500 13px var(--display); letter-spacing: -.3px; }
.mini-description { font-size: 5.5px; margin-top: 5px; opacity: .65; }
.mini-input { width: 90%; display: flex; align-items: center; justify-content: space-between; font-size: 5.5px; margin-top: 13px; border: 1px solid var(--t-line); background: var(--t-surface); border-radius: 4px; padding: 4px 5px 4px 8px; }
.mini-input b { padding: 1px 5px; font-size: 10px; border-radius: 2px; background: var(--t-accent); color: #fff; }
.mini-bars { display: flex; align-items: end; justify-content: center; gap: 7px; margin-top: 6px; height: 30px; width: 75%; border-bottom: 1px solid var(--t-line); }
.mini-bars i { width: 16%; background: var(--t-accent); opacity: .6; height: 40%; border-radius: 2px 2px 0 0; }
.mini-bars i:nth-child(2n) { height: 65%; opacity: .85; }
.mini-bars i:nth-child(3n) { height: 95%; }
.home-footer { font-size: 10.5px; padding-bottom: 24px; }
.home-footer .link { color: var(--ink-3); font-size: inherit; font-weight: 400; }
/* The same control scale carries into editing and configuration. */
.chat-heading { height: 45px; min-height: 45px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.chat-heading > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 12px; }
.chat-heading .i { color: var(--ember); }
.chat-ready { color: var(--ink-3); font-size: 10px; }
.ws .bar { background: #fff; }
.ws .bar .btn, .ws .bar .proj-name { font-size: 12px; }
.ws .bar .btn.arrow .disc { background: transparent; color: inherit; width: 18px; }
.ws .bar .btn.arrow { padding: 0 12px; }
.ws .chat { background: #fafcfb; }
.msgs { padding: 20px 18px 12px; }
.plan-card { border-radius: 10px; }
.plan-card .pc-head { background: #f4f7f5; }
.composer-mini { border-radius: 12px; box-shadow: 0 2px 10px #183c2c05; }
.seg { border-radius: 8px; }
.seg button { border-radius: 6px; }
.provider { border-radius: 9px; font-size: 13px; }
.dlg-head p { font-size: 13px; line-height: 1.6; }
.dlg-close { border-radius: 8px; }
.card, .choice { border-radius: 10px; }
.eyebrow { text-transform: none; letter-spacing: 0; }
@media(min-width:1500px) { .hero { padding-top: 80px; } .home-section { margin-top: 90px; } }
@media(max-width:1100px) and (min-width:741px) { .home { grid-template-columns: 190px minmax(0,1fr); } .home-sidebar { padding-inline: 8px; } .home-section { width: calc(100% - 48px); } .composer { width: calc(100% - 48px); } .hero { padding-top: 38px; } .composer-tools .model-select { display:none; } }
@media(max-width:740px) {
  .home { display: block; }
  .home-sidebar { position: fixed; left: 0; top: 0; width: 232px; transform: translateX(-100%); visibility: hidden; }
  .home.nav-open .home-sidebar { transform: none; visibility: visible; box-shadow: 10px 0 30px #183c2c16; }
  .nav-scrim { position: fixed; inset: 0; background: #17281f55; z-index: 24; border: 0; }
  .mobile-nav-toggle { display: inline-flex; }
  .home-nav { padding: 0 16px; height: 58px; }
  .home-nav .credits { display: inline-flex; font-size: 10px; }
  .home-breadcrumb { font-size: 11px; }
  .home-breadcrumb span { margin: 0 4px; }
  .hero { padding: 36px 20px 0; }
  .creation-mark { width: 40px; height: 40px; margin-bottom: 20px; }
  .hero h1 { font-size: 30px; max-width: 320px; }
  .hero > p { font-size: 13px; max-width: 290px; }
  .composer { width: calc(100% - 32px); margin-top: 28px; padding: 16px 12px 12px; }
  .composer textarea { font-size: 14px; min-height: 78px; }
  .composer-tools { flex-wrap: wrap; }
  .composer-tools > .row:last-child { margin-left: auto; }
  .composer .tool { font-size: 11px; padding-inline: 6px; }
  .quick { gap: 4px 12px; margin-top: 12px; }
  .quick-divider { display: none; }
  .quick button { font-size: 11px; }
  .starter-prompts { gap: 6px; margin-top: 18px; }
  .starter-prompts > span { width: 100%; text-align: center; margin-bottom: 2px; }
  .home-section { width: calc(100% - 32px); margin: 44px auto 32px; }
  .home-section .head { gap: 12px; }
  .home-section .head > .row { gap: 12px !important; }
  .home-section h2 { font-size: 18px; }
  .proj-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .thumb { height: 144px; }
  .mini-app { padding: 10px; }
  .mini-app strong { font-size: 10px; }
  .mini-brand { margin-bottom: 12px; font-size: 5.5px; }
  .mini-description { display:none; }
  .proj > span:last-child { padding: 10px; }
  .proj .name { font-size: 11px; }
  .proj .meta { font-size: 9px; flex-wrap: wrap; gap: 4px; }
  .home .home-account { right: 12px; left: auto; }
}
@media(max-width:359px) { .composer .tool { gap: 3px; } .composer-tools { gap: 10px; } .hero h1 { font-size: 28px; } .proj-grid { grid-template-columns: 1fr; } .thumb { height: 170px; } }

.home-main.show-projects .creation-area { display: none; }
.home-main.show-projects .home-section { margin-top: 40px; }
@media(min-width:741px) and (max-height:790px) { .home-sidebar { padding-top: 20px; } .home-sidebar > .brand { margin-bottom:20px; } .workspace-label { margin-bottom:16px; } .nav-item { padding-block:8px; } .nav-group { margin-bottom:16px; } .sidebar-bottom { padding-top:8px; } .sidebar-account { padding-top:12px; } }

.sidebar-close, .mobile-word { display:none; }
@media(max-width:740px) { .sidebar-close { display:flex; position:absolute; top:22px; right:10px; } .home-sidebar > .brand { padding-left:8px; } .mobile-word { display:inline; font:600 17px var(--display); letter-spacing:-.6px; } .home-breadcrumb { display:none; } body:has(.home.nav-open) { overflow:hidden; } }

.home .home-account { position:fixed; left:14px; right:auto; top:auto; bottom:78px; width:300px; max-width:calc(100vw - 28px); border-radius:12px; }
.release-emblem { display:flex; align-items:center; justify-content:center; width:54px; height:54px; border:1px solid #c6dbd0; color:#315c4c; background:#edf5f1; border-radius:16px; }
.pop { border-radius:14px; box-shadow:0 14px 45px #173b2c1c; }

/* Optional, project-local guidance; the product controls remain the main path. */
.walkthrough-entry { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:8px; margin:20px 16px 0; font-size:13px; color:var(--ink-3); }
.walkthrough-entry .link { display:inline-flex; align-items:center; gap:6px; color:var(--ink); }
.ws.with-guide { grid-template-rows:56px auto minmax(0,1fr); }
.walkthrough-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 22px; background:var(--sage); border-bottom:1px solid var(--line); min-width:0; }
.walkthrough-copy { min-width:0; max-width:760px; }
.walkthrough-copy h2 { font-size:15px; line-height:1.4; margin:2px 0; }
.walkthrough-copy p { font-size:13px; line-height:1.5; color:var(--ink-2); }
.walkthrough-controls { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.demo-address .grow { min-width:0; overflow-wrap:anywhere; font-size:12px; }
.demo-address .btn { flex-shrink:0; }
@media(max-width:740px) {
  .ws.with-guide { grid-template-rows:auto auto minmax(0,1fr); }
  .walkthrough-bar { display:block; padding:10px 14px; max-height:38dvh; overflow-y:auto; }
  .walkthrough-controls { flex-direction:row; justify-content:space-between; align-items:center; flex-wrap:wrap; margin-top:8px; gap:4px; }
  .walkthrough-copy .hint { font-size:11px; }
  .walkthrough-copy p { font-size:12px; }
  .demo-address { flex-wrap:wrap; }
}

.demo-address { height:auto; min-height:40px; padding:8px 10px; }

/* Generated editorial covers describe the task; editable projects show app previews. */
.catalog-art { display:block; width:100%; height:auto; aspect-ratio:3/2; object-fit:cover; background:#e8eae5; }
.proj > .catalog-art { height:174px; }
.tpl > .catalog-art { height:128px; }
.market-card > .catalog-art { height:165px; }

.journey-art { width:72px; height:72px; object-fit:contain; flex-shrink:0; }
.creation-mark { width:72px; height:72px; margin-bottom:14px; }
.creation-mark img { display:block; width:100%; height:100%; object-fit:contain; }
@media(max-width:740px) { .journey-art { width:52px; height:52px; } .creation-mark { width:56px; height:56px; } }

.pattern-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.template-families { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.template-family { min-width:0; }
.template-family > .catalog-art { aspect-ratio:4/3; margin-bottom:16px; border-radius:8px; }
.template-family h3 { font-size:16px; margin-bottom:5px; }
.template-family > div { margin-top:14px; }
.template-option { display:flex; align-items:center; justify-content:space-between; gap:8px; text-align:left; width:100%; padding:13px 0; border:0; border-top:1px solid var(--line); background:none; }
.template-option:hover { color:var(--ember); }
.template-option b { display:block; font-size:13px; }
.template-option small { display:block; font-size:12px; line-height:1.45; color:var(--ink-3); margin-top:4px; }
.template-detail { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:center; margin-bottom:20px; }
.template-detail .thumb { height:160px; border:1px solid var(--line); border-radius:8px; }
.template-detail p { margin-top:8px; }
@media(max-width:740px) { .pattern-grid { grid-template-columns:1fr; } .template-families { grid-template-columns:1fr; gap:28px; } .template-family > .catalog-art { aspect-ratio:2/1; } .template-detail { grid-template-columns:1fr; } }
.ws-body, .chat, .msgs { min-width:0; }
@media(max-width:740px) {
  .ws-body { grid-template-columns:minmax(0,1fr); }
  .suggest .chip { white-space:normal; height:auto; min-height:28px; text-align:left; }
  .file-chip { max-width:100%; overflow-wrap:anywhere; }
}

/* Labeled search fields and their actions share the same input baseline. */
.form-search { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; }
.form-search .field { min-width:0; }
.form-search .field-label { margin-bottom:0; }
.form-search input, .form-search > .btn { height:40px; }
