:root {
  --st-bg: #f6f5f1;
  --st-panel: #ffffff;
  --st-text: #1d2321;
  --st-muted: #6b716e;
  --st-line: #e4e2dc;
  --st-primary: #2f5d50;
  --st-primary-text: #ffffff;
  --st-accent: #e0a458;
  --st-user: #2f5d50;
  --st-err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --st-bg: #151917;
    --st-panel: #1d2220;
    --st-text: #ecefed;
    --st-muted: #9aa29e;
    --st-line: #2d3431;
    --st-primary: #6fb39d;
    --st-primary-text: #0f1412;
    --st-user: #3c6f61;
    --st-err: #f2867d;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--st-bg); color: var(--st-text); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--st-primary); }
.st-muted { color: var(--st-muted); }
.st-error { color: var(--st-err); margin: 0; }
.st-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.st-mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--st-primary), var(--st-accent)); }
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--st-line); background: var(--st-panel); color: var(--st-text); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.st-btn:disabled { opacity: .5; cursor: default; }
.st-primary { background: var(--st-primary); border-color: var(--st-primary); color: var(--st-primary-text); }
.st-ghost { background: transparent; }
.st-link { background: none; border: 0; color: var(--st-primary); font: inherit; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 9px; padding: 10px 12px; }

/* sign in */
.st-auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.st-card { background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 16px; padding: 32px; width: min(380px, 100%); display: grid; gap: 14px; }
.st-card h1 { margin: 8px 0 0; font-size: 1.4rem; }
.st-card label { display: grid; gap: 6px; font-weight: 500; }

/* dashboard */
.st-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--st-line); background: var(--st-panel); gap: 12px; flex-wrap: wrap; }
.st-dash { max-width: 920px; margin: 0 auto; padding: 32px 16px; }
.st-new { display: flex; gap: 10px; margin-bottom: 12px; }
.st-new input { flex: 1; min-width: 0; }
.st-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 24px; }
.st-site { display: grid; gap: 4px; padding: 18px; background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 14px; color: inherit; text-decoration: none; }
.st-site:hover { border-color: var(--st-primary); }

/* editor */
.st-full { height: 100vh; overflow: hidden; }
.st { display: grid; grid-template-columns: 380px 1fr; height: 100vh; }
.st-chat { display: flex; flex-direction: column; min-height: 0; background: var(--st-panel); border-right: 1px solid var(--st-line); }
.st-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--st-line); }
.st-back { text-decoration: none; font-size: 18px; color: var(--st-muted); }
.st-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.st-msg { padding: 10px 13px; border-radius: 14px; max-width: 92%; white-space: pre-wrap; word-wrap: break-word; }
.st-user { align-self: flex-end; background: var(--st-user); color: #fff; border-bottom-right-radius: 4px; }
.st-assistant { align-self: flex-start; background: var(--st-bg); border-bottom-left-radius: 4px; }
.st-assistant:empty { display: none; }
.st-typing:empty { display: block; }
.st-typing:empty::after { content: "Thinking…"; color: var(--st-muted); }
.st-note { align-self: center; font-size: 13px; color: var(--st-muted); text-align: center; background: none; }
.st-err { color: var(--st-err); }
.st-activity { display: grid; gap: 4px; align-self: flex-start; }
.st-step { font-size: 13px; color: var(--st-muted); padding-left: 16px; position: relative; }
.st-step::before { content: ""; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--st-accent); }
.st-suggest { display: grid; gap: 8px; }
.st-suggest p { margin: 0 0 4px; }
.st-chip { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--st-line); background: var(--st-panel); color: inherit; font: inherit; cursor: pointer; }
.st-chip:hover { border-color: var(--st-primary); }
.st-composer { border-top: 1px solid var(--st-line); padding: 12px; display: grid; gap: 8px; }
.st-composer textarea { resize: none; width: 100%; }
.st-composer-row { display: flex; align-items: center; gap: 8px; }
.st-tokens { flex: 1; font-size: 12px; color: var(--st-muted); text-align: right; }
.st-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.st-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--st-line); background: var(--st-panel); flex-wrap: wrap; }
.st-bar select { padding: 7px 10px; }
.st-spacer { flex: 1; }
.st-seg { display: inline-flex; border: 1px solid var(--st-line); border-radius: 9px; overflow: hidden; }
.st-seg button { border: 0; background: transparent; color: var(--st-muted); padding: 7px 12px; font: 500 13px Inter, system-ui, sans-serif; cursor: pointer; }
.st-seg button.on { background: var(--st-bg); color: var(--st-text); }
.st-frame-wrap { flex: 1; min-height: 0; padding: 16px; display: flex; justify-content: center; }
.st-frame-wrap iframe { width: 100%; height: 100%; border: 1px solid var(--st-line); border-radius: 12px; background: #fff; transition: width .25s; }
.st-frame-wrap.st-mobile iframe { width: 390px; }

@media (max-width: 860px) {
  .st-full { height: auto; overflow: auto; }
  .st { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .st-chat { order: 2; height: 70vh; border-right: 0; border-top: 1px solid var(--st-line); }
  .st-frame-wrap { height: 70vh; padding: 8px; }
  .st-new { flex-direction: column; }
}
