:root {
  --bg: #0e1015;
  --panel: #14171f;
  --panel-2: #1a1e28;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #7c5cff;
  --accent-2: #5dd0c4;
  --err: #ff6b6b;
  --border: #242936;
  --bubble-user: #2a2f3d;
  --bubble-asst: #1a1e28;
  --radius: 12px;
}
* { box-sizing: border-box; }
/* `hidden` attribute must always hide, even on elements with explicit display
   set by their class (e.g. inline-flex composer buttons). */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  /* The landing hero uses a 100vw full-bleed; clip horizontal so the
     trick never produces an unwanted horizontal scrollbar. */
  overflow-x: clip;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.bar .brand { font-weight: 700; font-size: 18px; color: var(--text); }
.bar .brand span { color: var(--accent); }
.bar nav { display: flex; align-items: center; gap: 14px; }
.bar nav form.inline { margin: 0; display: inline; }
.bar nav .link {
  background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0;
}
.bar nav .link:hover { color: var(--text); }

/* ---------- profile dropdown ---------- */
.profile { position: relative; }
.profile-btn {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--accent); color: white;
  border: none; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; line-height: 1;
  transition: filter 120ms;
}
.profile-btn:hover { filter: brightness(1.1); }
.profile-btn:focus { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.profile-initial { display: block; }

.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: min(240px, calc(100vw - 24px));
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.45);
  padding: 6px; z-index: 90;
  display: flex; flex-direction: column; gap: 2px;
}
.profile-email {
  padding: 8px 10px; color: var(--muted); font-size: 13px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-item {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--text);
  border: none; padding: 9px 10px; border-radius: 6px;
  cursor: pointer; font: inherit; font-size: 14px;
  text-decoration: none;     /* anchors used as menu items */
  box-sizing: border-box;
}
.profile-item:hover { background: var(--panel-2); text-decoration: none; }
.profile-item:disabled { color: var(--muted); cursor: progress; }
.profile-menu form.inline { display: block; }
.profile-menu form.inline button { width: 100%; }

/* ---------- site switcher ---------- */
.site-switcher { position: relative; flex: 1; max-width: 280px; margin: 0 16px; }
.site-switcher-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; font: inherit; font-size: 14px;
  text-align: left;
}
.site-switcher-btn:hover { border-color: var(--muted); }
.site-switcher-btn .site-current {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-switcher-btn .caret { color: var(--muted); font-size: 11px; }
.site-switcher.open .caret { transform: rotate(180deg); }

.site-switcher-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: min(420px, calc(100vw - 32px));
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.45);
  padding: 6px; z-index: 90;
  max-height: 70vh; overflow-y: auto;
}
.site-switcher-menu .site-list { display: flex; flex-direction: column; gap: 2px; }
.site-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; color: var(--text);
  border: none; padding: 9px 10px; border-radius: 6px;
  cursor: pointer; font: inherit;
}
.site-row:hover { background: var(--panel-2); }
.site-row.active { background: var(--panel-2); }
.site-row .row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.site-row .row-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-row .dom { font-size: 12px; color: var(--accent-2); }
.site-row.new-site { color: var(--accent); font-weight: 600; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; flex-shrink: 0;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.badge-ready    { background: rgba(93,208,196,0.12); color: var(--accent-2); border-color: transparent; }
.badge-building { background: rgba(124,92,255,0.15); color: var(--accent); border-color: transparent; }
.badge-queued   { background: rgba(124,92,255,0.10); color: var(--accent); border-color: transparent; }
.badge-failed   { background: rgba(255,107,107,0.15); color: var(--err); border-color: transparent; }

/* per-row delete button — sits next to .site-row inside .site-row-wrap */
.site-row-wrap { display: flex; align-items: stretch; gap: 2px; }
.site-row-wrap .site-row { flex: 1; }
.site-del {
  background: transparent; color: var(--muted); border: none;
  width: 28px; padding: 0; border-radius: 6px;
  font-size: 18px; line-height: 1; cursor: pointer; opacity: 0;
  transition: opacity .12s, color .12s, background .12s;
}
.site-row-wrap:hover .site-del { opacity: 1; }
.site-del:hover { background: rgba(255,107,107,0.15); color: var(--err); }

/* delete confirmation modal */
.site-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.site-modal {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  width: min(460px, 100%); padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.site-modal h3 { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.site-modal-warn { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.site-modal-warn strong { color: var(--text); }
.site-modal-label { display: block; font-size: 13px; color: var(--muted); }
.site-modal-label code {
  display: inline-block; background: var(--panel-2); color: var(--text);
  padding: 1px 6px; border-radius: 4px; font-size: 12px;
}
.site-modal-label input {
  display: block; width: 100%; box-sizing: border-box; margin-top: 6px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font: inherit;
}
.site-modal-label input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.site-modal-err { color: var(--err); font-size: 13px; margin: 8px 0 0; }
.site-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.site-modal-actions button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.site-modal-actions button:hover { background: var(--border); }
.site-modal-actions button.danger { background: var(--err); color: #fff; border-color: transparent; }
.site-modal-actions button.danger:hover { filter: brightness(1.05); }
.site-modal-actions button:disabled { opacity: .5; cursor: not-allowed; filter: none; }

/* ---------- landing page ---------- */
.landing { display: block; }

/* Let the hero go edge-to-edge by removing main's normal width cap +
   padding when the body is in landing mode. Cleaner than the 100vw
   full-bleed trick (which on mobile pushed the gradient under the
   header). */
body.layout-landing main { padding: 0; max-width: none; }

.landing-hero {
  min-height: calc(100dvh - 110px);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 20px 64px; box-sizing: border-box;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124,92,255,0.18), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(93,208,196,0.10), transparent 55%);
}
.landing-inner {
  width: min(720px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.landing-eyebrow {
  margin: 0; font-size: 12px; letter-spacing: 0.16em; color: var(--accent);
  text-transform: uppercase; font-weight: 600;
}
.landing-h1 {
  margin: 0; font-size: clamp(28px, 4.6vw, 48px); font-weight: 700;
  text-align: center; color: var(--text); letter-spacing: -0.02em; line-height: 1.1;
}
.landing-sub {
  margin: 0; max-width: 580px; text-align: center;
  font-size: clamp(15px, 1.8vw, 17px); line-height: 1.55; color: var(--muted);
}
.landing-form { width: 100%; margin-top: 8px; }
.landing-input-wrap {
  position: relative; width: 100%;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.45);
  transition: border-color .15s, box-shadow .15s;
}
.landing-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 26px 70px rgba(124,92,255,0.28); }

.landing-input-real {
  display: block; width: 100%; box-sizing: border-box;
  background: transparent; color: var(--text);
  border: 0; outline: 0; resize: none;
  padding: 24px 64px 24px 24px;
  font: inherit; font-size: clamp(16px, 2.1vw, 20px); line-height: 1.4;
  min-height: 130px; max-height: 320px; overflow-y: auto;
}
.landing-input-real::placeholder { color: transparent; }

/* Overlay shown when textarea is empty + unfocused. pointer-events:none
   so a click anywhere on the box focuses the textarea behind it.
   Default block layout (no flex) so the prefix + animated phrase + cursor
   spans inside flow as inline text and wrap naturally on long types. */
.landing-placeholder {
  position: absolute; inset: 0;
  padding: 24px 64px 24px 24px;
  font-size: clamp(16px, 2.1vw, 20px); line-height: 1.4;
  color: var(--muted); pointer-events: none;
}
.landing-prefix, .landing-suffix { color: var(--muted); }
.landing-type { color: var(--text); font-weight: 600; }
.landing-cursor {
  display: inline-block; width: 2px; height: 1em; background: var(--accent);
  vertical-align: text-bottom; margin: 0 1px;
  animation: landing-blink 1.05s steps(1) infinite;
}
@keyframes landing-blink { 50% { opacity: 0; } }

.landing-go {
  position: absolute; right: 14px; bottom: 14px;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; font-weight: 700;
  border: 0; cursor: pointer; transition: filter .12s, opacity .12s;
}
.landing-go:hover { filter: brightness(1.08); }
.landing-go:disabled { opacity: .5; cursor: not-allowed; }
.landing-suggest {
  margin: 8px 0 0; font-size: 12px; color: var(--muted);
}
.landing-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 600px; }
.landing-chip {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 16px; font: inherit; font-size: 14px; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.landing-chip:hover { border-color: var(--accent); color: var(--accent); }

main { max-width: 880px; margin: 0 auto; padding: 24px 18px 80px; }

.banner {
  max-width: 880px; margin: 14px auto 0; padding: 10px 14px;
  border-radius: var(--radius); font-size: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.banner.warn { background: #2a2412; color: #f0d57a; border: 1px solid #4a3d18; }
.banner .link { background: none; border: none; color: inherit; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.banner .ok { color: var(--accent-2); }
.banner form.inline { margin: 0; display: inline; }

.chat { display: flex; flex-direction: column; gap: 16px; height: calc(100vh - 120px); }
.messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding-right: 6px;
}
.msg {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user { background: var(--bubble-user); align-self: flex-end; }
.msg.assistant { background: var(--bubble-asst); align-self: flex-start; border: 1px solid var(--border); }
.msg.system {
  background: transparent; align-self: center; color: var(--muted);
  font-size: 13px; font-style: italic; max-width: 100%;
}

/* Markdown inside assistant bubbles. */
.msg.assistant strong { font-weight: 600; }
.msg.assistant em { font-style: italic; }
.msg.assistant code {
  background: rgba(255,255,255,0.06); padding: 1px 6px;
  border-radius: 4px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.9em;
}
.msg.assistant pre {
  background: rgba(0,0,0,0.35); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin: 6px 0;
  overflow-x: auto; font-size: 13px;
}
.msg.assistant pre code { background: transparent; padding: 0; font-size: inherit; }
.msg.assistant ul, .msg.assistant ol { margin: 4px 0 4px 20px; padding: 0; }
.msg.assistant li { margin: 2px 0; }
.msg.assistant h4 { margin: 8px 0 4px; font-size: 15px; }
.msg img.upload-img { max-width: 220px; border-radius: 8px; display: block; margin-top: 6px; }
.msg.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.msg.thinking .spinner { width: 14px; height: 14px; }
.msg.thinking .t { font-style: italic; }

.archived-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.archived-wrap.collapsed .archived-inner { display: none; }
.archived-toggle {
  align-self: center;
  background: transparent; color: var(--muted); border: 1px dashed var(--border);
  padding: 6px 12px; font-size: 12px; cursor: pointer; border-radius: 999px;
}
.archived-toggle:hover { color: var(--text); border-color: var(--text); }
.archived-inner { display: flex; flex-direction: column; gap: 8px; opacity: 0.55; }
.archived-inner .msg.archived { font-size: 13px; }

a.msg.signup-cta {
  background: var(--accent); color: white; text-decoration: none;
  font-style: normal; font-weight: 600; align-self: center;
  padding: 10px 18px; border-radius: 999px;
}
a.msg.signup-cta:hover { filter: brightness(1.1); }

button.msg.domain-cta {
  background: var(--accent-2); color: #0e1015; border: none;
  font-style: normal; font-weight: 600; align-self: center;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
}
button.msg.domain-cta:hover { filter: brightness(1.1); }

/* ---------- paywall card (replaces composer) ---------- */
.paywall-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.paywall-card h3 {
  margin: 0; font-size: 18px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.paywall-card .checklist,
.modal .checklist {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.paywall-card .checklist li,
.modal .checklist li {
  position: relative; padding-left: 22px; color: var(--text); font-size: 14px;
}
.paywall-card .checklist li::before,
.modal .checklist li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--accent-2); font-weight: 700;
}
.paywall-card .big-cta {
  background: var(--accent); color: white; border: none;
  padding: 12px 18px; border-radius: 8px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: filter 120ms;
}
.paywall-card .big-cta:hover { filter: brightness(1.1); }
.paywall-card .small { font-size: 12px; }

/* ---------- provisioning banner (between messages and composer) ---------- */
.provisioning-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 14px; color: var(--text);
}
.provisioning-banner .spinner { width: 14px; height: 14px; flex-shrink: 0; }
.provisioning-banner button { margin-left: auto; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; width: min(560px, 100%);
  max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: transparent; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal h2 { margin: 0 0 12px; font-size: 20px; }
.modal .muted { color: var(--muted); }
.modal .err { color: var(--err); }
.modal .big { font-size: 22px; font-weight: 600; }
.modal .small { font-size: 12px; }
.modal .row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal .loading { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 8px 0; }

.modal .domain-list {
  list-style: none; padding: 0; margin: 12px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.modal .domain-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2);
}
.modal .domain-list .dom { font-family: ui-monospace, monospace; font-size: 15px; }
.modal .domain-list li.muted { justify-content: center; }

.picker-controls { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.picker-controls .lookup { display: flex; gap: 8px; }
.picker-controls input {
  flex: 1; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit;
}
.picker-controls .hit {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel-2); padding: 10px 12px; border-radius: 8px; margin: 4px 0;
}

/* bring-your-own-domain flow */
.byo-label { display: block; margin: 14px 0 6px; }
.byo-label > span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.byo-label input {
  display: block; width: 100%; box-sizing: border-box;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 15px;
}
.byo-label input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.byo-err { margin: 6px 0 0; font-size: 13px; }
.byo-ns {
  list-style: none; padding: 14px; margin: 14px 0;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
}
.byo-ns li { padding: 4px 0; }
.byo-ns code {
  font-family: ui-monospace, monospace; font-size: 14px;
  color: var(--text); user-select: all;
}

ol.progress { list-style: none; padding: 0; margin: 16px 0; counter-reset: step; }
ol.progress li {
  counter-increment: step;
  padding: 8px 12px 8px 38px; position: relative;
  border-radius: 8px; margin: 4px 0;
}
ol.progress li::before {
  content: counter(step);
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--border);
}
ol.progress li.done { color: var(--muted); }
ol.progress li.done::before { content: '✓'; background: var(--accent-2); color: #0e1015; border-color: transparent; }
ol.progress li.cur { background: var(--panel-2); }
ol.progress li.cur::before { background: var(--accent); color: white; border-color: transparent; }
ol.progress li.pending { color: var(--muted); }

body.modal-open { overflow: hidden; }

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  /* Lock the chat layout to the viewport: header pinned top, composer pinned
     bottom, messages fill the middle and scroll. dvh handles iOS dynamic
     toolbar / on-screen-keyboard resize.
     Opt-in via body.layout-chat — every other page (owner, admin, auth,
     marketing landing) scrolls normally. */
  body.layout-chat { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  .bar    { flex: 0 0 auto; }
  .banner { flex: 0 0 auto; max-width: 100%; margin: 0; border-radius: 0; }
  main {
    flex: 1 1 auto; min-height: 0;
    max-width: 100%; padding: 10px 12px;
  }
  .chat { height: 100%; gap: 10px; }
  /* Status (when a build is running) and the provisioning banner sit between
     messages and the composer/paywall, keeping the bottom slot anchored. */
  .chat .messages              { order: 1; }
  .chat .provisioning-banner   { order: 2; }
  .chat .status                { order: 3; }
  .chat .composer              { order: 4; }
  .chat .paywall               { order: 4; }

  .composer { padding: 8px; }
  .composer .actions {
    gap: 8px;
    margin-top: 8px;
  }
  /* Stack buttons full-width on narrow screens — bigger tap targets, no
     cramped two-button rows. */
  .composer .actions > button {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 44px;        /* iOS touch-target floor */
    font-size: 15px;
  }
  /* Send sits at the bottom; upload + build, when present, stack above it. */
  .composer .actions .send-btn  { order: 3; }
  .composer .actions .build-btn { order: 2; }
  .composer .actions .upload-btn { order: 1; }

  .msg { max-width: 92%; padding: 10px 12px; }

  .status {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .status .spinner { align-self: flex-start; }

  .site-switcher { max-width: none; margin: 0 8px; }

  /* Tighten the bar to keep brand · switcher · avatar in one row on phones. */
  .bar { padding: 10px 12px; gap: 8px; }
  .bar .brand { font-size: 15px; flex-shrink: 0; }
  .bar nav { gap: 8px; }
  .profile-btn { width: 32px; height: 32px; }

  .modal-card { padding: 18px; }
  .modal h2 { font-size: 18px; }
}

.composer {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px;
}
.composer textarea {
  width: 100%; min-height: 56px; resize: vertical;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font: inherit;
}
.composer textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.composer .actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap;
  align-items: center;
}

button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 14px; border: 1px solid transparent;
  transition: filter 120ms, background 120ms, border-color 120ms;
  min-height: 40px;
}
button:hover { filter: brightness(1.1); }
button[disabled] { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); color: white; border: none; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
button.small { padding: 4px 10px; font-size: 13px; min-height: 0; }
.btn.small { padding: 4px 10px; font-size: 13px; background: var(--accent); color: white; border-radius: 6px; }

/* Composer button styling — paperclip-pill upload, sparkle build */
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 999px;
  font-weight: 500;
}
.upload-btn:hover { background: var(--bubble-user); border-color: var(--accent-2); color: var(--accent-2); }
.upload-btn svg { flex-shrink: 0; }
.upload-btn .label { white-space: nowrap; }

.build-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.send-btn { font-weight: 600; }

.status {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: var(--radius); padding: 14px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  line-height: 1.5;
}
/* The text/content children of .status grow to fill the row — but explicitly
   exclude .spinner: its specificity (0,1,0) is lower than `.status > div`
   (0,1,1), so without :not() the spinner inherits flex-basis:200px and
   stretches into a thin ellipse arc. */
.status > div:not(.spinner) { flex: 1 1 200px; min-width: 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  /* Prevent flex parents (.status, .loading, .provisioning-banner) from
     stretching the spinner via inherited flex-basis rules. Without this,
     `.status > div { flex: 1 1 200px }` blows the spinner up to 200px wide. */
  flex: 0 0 auto;
  box-sizing: border-box;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-card {
  max-width: 380px; margin: 60px auto;
  background: var(--panel); border: 1px solid var(--border);
  padding: 24px; border-radius: var(--radius);
}
.auth-card h1 { margin: 0 0 14px; font-size: 22px; }
.auth-card label { display: block; margin: 12px 0; }
.auth-card input {
  display: block; width: 100%; margin-top: 4px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit;
}
.auth-card .primary { width: 100%; margin-top: 10px; padding: 10px; }
.auth-card .err { color: var(--err); }
.auth-card .muted { color: var(--muted); margin-top: 14px; font-size: 13px; }
