/* Design tokens — dark first (carried over from the original console), light via system preference. */
:root {
  --bg: #0a0b0d;
  --panel: #121417;
  --panel-2: #17191d;
  --border: #242730;
  --text: #e9edf1;
  --text-dim: #9aa1ad;
  --text-faint: #646b76;
  --accent: #4fd1c5;
  --accent-ink: #04201d;
  --accent-dim: #16302e;
  --accent-text: #7de3d9;
  --success: #3ddc84;
  --danger: #f26b6b;
  --danger-dim: #3a1a1a;
  --warn: #f0b64c;
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --sidebar-w: 280px;
  --col-w: 760px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-2: #f0f2f5;
    --border: #dfe3e9;
    --text: #14181f;
    --text-dim: #566070;
    --text-faint: #8a93a1;
    --accent: #0f9e92;
    --accent-ink: #ffffff;
    --accent-dim: #dcf4f1;
    --accent-text: #0b7a70;
    --success: #1a9d57;
    --danger: #d64545;
    --danger-dim: #fbe6e6;
    --warn: #b97a0c;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; }

/* ---------- Buttons, forms ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover:not(:disabled) { background: var(--danger-dim); border-color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--text-dim); cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.field small { color: var(--text-faint); font-size: 12px; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field-check { flex-direction: row; align-items: center; gap: 8px; }
.field-check label { font-weight: 500; }

.flash { margin: 0 auto 16px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; max-width: var(--col-w); }
.flash-notice { background: var(--accent-dim); color: var(--accent-text); }
.flash-alert { background: var(--danger-dim); color: var(--danger); }
.page-chat .flash { margin: 12px 16px 0; }

.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 20px; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-by { font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--text-faint); }

/* ---------- Marketing / auth pages ---------- */

.page-auth { min-height: 100%; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 40px); }
.site-header nav { display: flex; align-items: center; gap: 10px; }
.site-header .btn { white-space: nowrap; }
.nav-link { padding: 9px 6px; font-size: 14px; font-weight: 600; color: var(--text-dim); text-decoration: none; }
.nav-link:hover { color: var(--text); }
.site-main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 64px; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 20px; padding: 20px 16px 28px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-faint); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-dim); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }

.hero { text-align: center; padding-top: clamp(24px, 7vh, 80px); }
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 4px 12px; border-radius: 99px; background: var(--accent-dim); color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero h1 { font-size: clamp(30px, 5.4vw, 52px); margin: 0 0 18px; text-wrap: balance; }
.lede { max-width: 620px; margin: 0 auto 28px; color: var(--text-dim); font-size: 17px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }


.auth-card { max-width: 400px; margin: clamp(8px, 5vh, 56px) auto 0; padding: 32px 28px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-sub { margin: 0 0 22px; color: var(--text-dim); }
.auth-fineprint { margin: 14px 0 0; font-size: 12.5px; color: var(--text-faint); }
.auth-fineprint a { color: var(--text-dim); }
.auth-links { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; font-size: 14px; align-items: flex-start; }

/* ---------- Chat shell ---------- */

.page-chat { overflow: hidden; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100dvh; }

.sidebar {
  display: flex; flex-direction: column; gap: 14px; padding: 16px 12px;
  background: var(--panel); border-right: 1px solid var(--border); min-height: 0;
}
.sidebar-head { padding: 4px 8px; }
.new-task { margin: 0; }

.history { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.history-empty { color: var(--text-faint); font-size: 13px; padding: 8px; margin: 0; }
.history-item {
  display: block; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-dim); text-decoration: none; font-size: 14px;
}
.history-item:hover { background: var(--panel-2); color: var(--text); }
.history-item.is-current { background: var(--panel-2); color: var(--text); }
.history-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.sidebar-foot form { margin: 0; flex-shrink: 0; }
.sidebar-foot .btn { white-space: nowrap; }
.account { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.account-email { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-quota { font-size: 12px; color: var(--text-faint); }
.account-link { font-size: 12px; color: var(--text-dim); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel); flex-shrink: 0; }
.topbar-title { margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; margin-left: -8px; }
.scrim { display: none; }

.main-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- Thread ---------- */

.thread { flex: 1; overflow-y: auto; padding: 24px 16px 8px; scroll-behavior: smooth; }
.turn { max-width: var(--col-w); margin: 0 auto 28px; display: flex; flex-direction: column; gap: 14px; }

.msg-user { display: flex; justify-content: flex-end; }
.bubble { max-width: 85%; padding: 10px 15px; background: var(--accent-dim); border-radius: var(--radius) var(--radius) 4px var(--radius); overflow-wrap: anywhere; }
.bubble p { margin: 0; }
.bubble p + p { margin-top: 8px; }

.msg-agent { display: flex; gap: 12px; align-items: flex-start; }
.avatar { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); color: var(--accent); font-size: 16px; }
.agent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Activity card: what the agent is doing, in plain language */
.activity { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.activity-log summary {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer;
  list-style: none; user-select: none; font-weight: 600; font-size: 14px;
}
.activity-log summary::-webkit-details-marker { display: none; }
.activity-meta { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--text-faint); }
.activity-log summary .chevron { color: var(--text-faint); transition: transform .15s; }
.activity-title + .chevron { margin-left: auto; }
.activity-log[open] summary .chevron { transform: rotate(180deg); }

.activity-icon { width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; position: relative; }
.activity[data-status="queued"] .activity-icon,
.activity[data-status="running"] .activity-icon { border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.activity[data-status="paused"] .activity-icon { background: var(--warn); opacity: .9; clip-path: polygon(15% 10%, 15% 90%, 40% 90%, 40% 10%, 60% 10%, 60% 90%, 85% 90%, 85% 10%); border-radius: 0; }
.activity[data-status="completed"] .activity-icon { background: var(--success); }
.activity[data-status="completed"] .activity-icon::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.activity[data-status="completed"][data-success="false"] .activity-icon { background: var(--warn); }
.activity[data-status="completed"][data-success="false"] .activity-icon::after { content: "!"; inset: 0; left: 0; top: 0; width: auto; height: auto; display: grid; place-items: center; border: 0; transform: none; color: var(--bg); font-size: 11px; font-weight: 800; }
.activity[data-status="failed"] .activity-icon { background: var(--danger); }
.activity[data-status="failed"] .activity-icon::after { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--bg); font-size: 11px; font-weight: 800; }
.activity[data-status="stopped"] .activity-icon { background: var(--text-faint); border-radius: 3px; transform: scale(.75); }

.events { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--border); }
.events:empty { display: none; }
.event { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-dim); animation: rise .25s ease-out; }
.event-mark { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; position: relative; background: var(--accent-dim); }
.event-mark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.event-info .event-mark { background: transparent; }
.event-info .event-mark::after { left: 6px; top: 6px; width: 4px; height: 4px; border: 0; border-radius: 50%; background: var(--text-faint); transform: none; }
.event-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.event-shot {
  position: relative; display: block; width: min(280px, 100%); margin-top: 8px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel-2);
  cursor: zoom-in; transition: border-color .15s, transform .15s;
}
.event-shot:hover { border-color: var(--accent); transform: translateY(-1px); }
/* the worker captures 16:9; reserving the box stops the feed jumping as pictures load */
.event-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.event-shot-host {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 2px 8px; overflow: hidden;
  border-radius: 99px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; line-height: 1.5;
  text-overflow: ellipsis; white-space: nowrap;
}
/* shown only while the log is folded, so the same picture never appears twice */
.proof-strip { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 14px 12px; }
.proof-strip .event-shot { width: min(190px, 100%); margin-top: 0; }
.activity-log[open] ~ .proof-strip { display: none; }
.lightbox { width: min(1100px, 94vw); padding: 0; border: 0; border-radius: var(--radius); background: var(--panel); color: var(--text); overflow: hidden; }
.lightbox::backdrop { background: rgba(0, 0, 0, .72); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; background: var(--panel-2); }
.lightbox figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 13px; color: var(--text-dim); }
.event-note { display: block; font-size: 12.5px; color: var(--warn); }
/* the newest line of a live run shows a spinner instead of a check */
.activity[data-status="running"] .event:last-child .event-mark { background: transparent; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.activity[data-status="running"] .event:last-child .event-mark::after { display: none; }
.activity[data-status="running"] .event:last-child { color: var(--text); }

.activity-controls { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--panel-2); }
.activity-controls form { margin: 0; }

.result:empty { display: none; }
.answer { overflow-wrap: anywhere; }
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer p, .answer ul, .answer ol { margin: 0 0 10px; }
.answer ul, .answer ol { padding-left: 22px; }
.answer li { margin-bottom: 4px; }
.answer h1, .answer h2, .answer h3, .answer h4 { font-size: 16px; margin: 16px 0 6px; }
.answer code { font-family: var(--mono); font-size: 13px; padding: 1px 5px; background: var(--panel-2); border-radius: 5px; }
.answer pre { overflow-x: auto; padding: 12px; background: var(--panel-2); border-radius: var(--radius-sm); }
.answer pre code { padding: 0; background: none; }
.answer blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--border); color: var(--text-dim); }
.answer table { border-collapse: collapse; margin: 0 0 10px; font-size: 14px; display: block; overflow-x: auto; }
.answer th, .answer td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; }
.answer-partial { padding: 10px 14px; border-left: 3px solid var(--warn); background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.answer-error { padding: 10px 14px; border-left: 3px solid var(--danger); background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.answer-muted { color: var(--text-dim); margin: 0; }
.dev-detail { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere; }

/* ---------- Welcome (empty state) ---------- */

.welcome { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; }
.welcome-mark { font-size: 40px; color: var(--accent); line-height: 1; margin-bottom: 14px; }
.welcome h2 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 30px); }
.welcome p { margin: 0 0 24px; color: var(--text-dim); max-width: 460px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: var(--col-w); }
.chip { padding: 9px 14px; font: inherit; font-size: 13.5px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--border); border-radius: 99px; cursor: pointer; text-align: left; transition: border-color .15s, color .15s; }
.chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Composer ---------- */

.composer-wrap { width: 100%; max-width: calc(var(--col-w) + 32px); margin: 0 auto; padding: 8px 16px 14px; flex-shrink: 0; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px 6px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 26px; transition: border-color .15s; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; line-height: 1.5; padding: 8px 0; max-height: 160px;
}
.composer textarea::placeholder { color: var(--text-faint); }
.send-btn { background: var(--accent); color: var(--accent-ink); }
.send-btn:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); color: var(--accent-ink); }
.mic-btn.listening { color: var(--danger); background: var(--danger-dim); animation: pulse 1.4s ease-in-out infinite; }
.composer-hint { margin: 8px 6px 0; font-size: 12px; color: var(--text-faint); min-height: 18px; text-align: center; }
.composer-notice { margin: 0 6px 8px; font-size: 13px; color: var(--danger); text-align: center; }
.composer-notice:empty { display: none; }

/* ---------- Landing page ---------- */

.falef-promise { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin: 0 0 22px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.falef-promise b { color: var(--accent-text); font-size: 1.45em; font-weight: 800; }
.hero-note { margin: 14px 0 0; font-size: 13px; color: var(--text-faint); }

.section { margin-top: clamp(56px, 9vh, 96px); text-align: center; }
.section-title { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 34px); text-wrap: balance; }
.section-sub { max-width: 620px; margin: 0 auto 28px; color: var(--text-dim); font-size: 16px; }

.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; text-align: left; }
.pillar { padding: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.pillar h3 { margin: 12px 0 4px; font-size: 18px; }
.pillar p { margin: 0 0 8px; color: var(--text-dim); font-size: 14px; }
.pillar .pillar-line { color: var(--text); font-weight: 600; }
.pillar-badge { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px; background: var(--accent-dim); color: var(--accent-text); font-weight: 800; letter-spacing: .04em; }

/* The example run on the landing page: the product's own activity card, replayed */
.run-demo { max-width: 640px; margin: 0 auto; text-align: left; }
.run-demo [hidden] { display: none !important; }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.chip[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent); background: var(--accent-dim); }
.run-demo-stage { position: relative; padding: 42px 18px 18px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); }
.run-demo-panel { display: flex; flex-direction: column; gap: 14px; }
.demo-badge { position: absolute; top: 14px; left: 16px; padding: 1px 9px; border: 1px solid var(--border); border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.demo-caption { margin: 12px 4px 0; font-size: 12.5px; color: var(--text-faint); text-align: center; }
.demo-replay { align-self: flex-start; min-height: 44px; }
.activity-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-weight: 600; font-size: 14px; }
.run-demo .activity-controls .btn { min-height: 44px; }
/* unrevealed lines keep their space, so the page doesn't jump while an example plays */
.run-demo .is-pending { visibility: hidden; }
.run-demo .event { animation: none; }
.run-demo .event.is-current { animation: rise .25s ease-out; }
.activity[data-status="running"] .event.is-current { color: var(--text); }
.activity[data-status="running"] .event.is-current .event-mark { background: transparent; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.activity[data-status="running"] .event.is-current .event-mark::after { display: none; }
.demo-shot { margin: 0; cursor: default; }
.demo-shot:hover { transform: none; border-color: var(--border); }
.mock-page { aspect-ratio: 16 / 9; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--panel-2); }
.mock-page::before { content: ""; height: 7px; width: 38%; margin-bottom: 4px; border-radius: 4px; background: var(--border); }
.mock-page i { display: block; height: 5px; border-radius: 3px; background: var(--border); }
.mock-page i:nth-of-type(1) { width: 88%; }
.mock-page i:nth-of-type(2) { width: 70%; }
.mock-page i:nth-of-type(3) { width: 78%; }
.mock-page b { display: block; width: 34%; height: 16px; margin: auto 0 22px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent-dim); }
/* the same pill marks a live run in the app */
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 99px; background: var(--danger-dim); color: var(--danger); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }

.great-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: left; }
.great-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.great-card h3 { margin: 0; font-size: 17px; }
.great-ask { margin: 0; padding: 10px 14px; background: var(--accent-dim); border-radius: var(--radius) var(--radius) 4px var(--radius); font-size: 14px; }
.great-get { margin: 0; color: var(--text-dim); font-size: 14px; }
.great-get strong { color: var(--text); }

.great-card h3 a { color: inherit; text-decoration: none; }
.great-card h3 a::after { content: " \2192"; color: var(--accent-text); }
.great-card h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.eyebrow-link { color: inherit; text-decoration: none; }

/* Pages for one kind of errand */
.use-asks, .moves, .use-more { max-width: 640px; margin: 20px auto 0; padding: 0; list-style: none; text-align: left; }
.use-asks { display: flex; flex-direction: column; gap: 10px; }
.moves { display: flex; flex-direction: column; gap: 10px; counter-reset: move; }
.moves li { position: relative; padding: 12px 16px 12px 52px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); font-size: 14.5px; counter-increment: move; }
.moves li::before { content: counter(move); position: absolute; left: 14px; top: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.use-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.use-more a { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 99px; color: var(--text-dim); font-size: 14px; font-weight: 600; text-decoration: none; }
.use-more a:hover { color: var(--accent-text); border-color: var(--accent); }

/* About, contact, terms, privacy and refunds: plain reading pages */
.prose { max-width: 680px; margin: 0 auto; padding-top: clamp(16px, 5vh, 56px); }
.prose h1 { margin: 0 0 8px; font-size: clamp(28px, 4.2vw, 40px); }
.prose h2 { margin: 32px 0 8px; font-size: 20px; }
.prose p, .prose li { color: var(--text-dim); font-size: 15.5px; line-height: 1.65; }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent-text); }
.prose .prose-meta { margin: 0 0 20px; font-size: 13px; color: var(--text-faint); }

.how { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; text-align: left; }
.how-number { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.how h3 { margin: 10px 0 4px; font-size: 17px; }
.how p { margin: 0; color: var(--text-dim); font-size: 14px; }

.limits { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 20px auto 0; padding: 0; list-style: none; text-align: left; }
.limits li { padding: 12px 16px; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-dim); font-size: 14.5px; }

.faq { display: flex; flex-direction: column; gap: 8px; max-width: 640px; margin: 20px auto 0; text-align: left; }
.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.faq summary { padding: 12px 16px; font-weight: 600; cursor: pointer; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--text-dim); font-size: 14.5px; }
.final-cta .section-title { margin-bottom: 18px; }

/* ---------- Pricing ---------- */

.pricing { text-align: center; padding-top: clamp(16px, 5vh, 56px); }
.pricing h1 { font-size: clamp(28px, 4.6vw, 44px); margin: 0 0 14px; }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 860px; margin: 36px auto 0; text-align: left; }
.pack { display: flex; flex-direction: column; padding: 24px 22px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.pack-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pack-name { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.pack-tagline { margin: 4px 0 0; min-height: 20px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.pack-price { margin: 10px 0 0; font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.pack-terms { margin: 2px 0 14px; font-size: 13px; color: var(--text-faint); }
.pack-runs { margin: 0 0 22px; font-size: 17px; font-weight: 600; }
.pack form { margin: auto 0 0; }
.pricing-notes { list-style: none; max-width: 560px; margin: 32px auto 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); font-size: 14px; }
.pricing-note { margin: 20px 0 0; }
.pricing-billed { max-width: 560px; margin: 28px auto 0; font-size: 14px; color: var(--text-dim); }
.pricing-billed strong { color: var(--text); }
.pricing-warn { color: var(--warn); }

.account-quota a, .composer-notice a { color: var(--accent-text); }

/* ---------- Admin ---------- */

.page-admin { min-height: 100%; }
.admin-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--border); background: var(--panel); }
.admin-nav { display: flex; gap: 4px; margin-right: auto; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); color: var(--text-dim); font-size: 14px; font-weight: 600; text-decoration: none; }
.admin-nav a:hover { background: var(--panel-2); color: var(--text); }
.admin-nav a[aria-current="page"] { background: var(--accent-dim); color: var(--accent-text); }
.admin-main { max-width: 1120px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 72px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.admin-top h1 { margin: 0; font-size: 26px; }
.range { display: flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--border); border-radius: 99px; }
.range a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px; color: var(--text-dim); font-size: 13px; font-weight: 600; text-decoration: none; }
.range a:hover { color: var(--text); }
.range a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.admin-note { max-width: 760px; margin: 8px 0 16px; color: var(--text-dim); font-size: 13.5px; }
.admin-note code { padding: 1px 5px; border-radius: 5px; background: var(--panel-2); font-family: var(--mono); font-size: 12.5px; }
.admin-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }
.admin-section { margin-top: 36px; }
.admin-section h2 { margin: 0 0 14px; font-size: 18px; }
.admin-section h3 { margin: 26px 0 10px; font-size: 14px; color: var(--text-dim); }
.admin-empty { color: var(--text-faint); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.stat p { margin: 0; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.stat-value { margin-top: 4px; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-note { margin-top: 4px; font-size: 12.5px; color: var(--text-faint); }

/* One hue, and length is the only thing that varies */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(160px, 300px) minmax(80px, 1fr) minmax(100px, 190px); align-items: center; gap: 12px; font-size: 14px; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-value small { margin-left: 4px; font-weight: 500; color: var(--text-faint); }
.tag { display: inline-block; margin-left: 4px; padding: 0 8px; border: 1px solid var(--border); border-radius: 99px; color: var(--text-dim); font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }

.dailies { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.daily { margin: 0; padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.daily figcaption { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.daily figcaption small { color: var(--text-faint); }
.daily-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; border-bottom: 1px solid var(--border); }
.daily-bar { display: flex; flex: 1; align-items: flex-end; height: 100%; border-radius: 4px 4px 0 0; }
.daily-bar:hover { background: var(--panel-2); }
.daily-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); }
.daily-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-faint); }
.daily details { margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.daily summary { cursor: pointer; }

.admin-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table .asked { min-width: 220px; max-width: 340px; overflow-wrap: anywhere; color: var(--text-dim); }
.admin-table-compact { width: auto; min-width: 280px; margin-top: 12px; }
.admin-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 16px 0 8px; }
.admin-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.admin-filters select { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); font: inherit; }
.account-admin { margin-top: 2px; font-size: 12px; font-weight: 600; }

@media (max-width: 640px) {
  .hbar-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .hbar-track { grid-column: 1 / -1; order: 3; }
  .admin-head { gap: 8px 12px; }
  .admin-nav { order: 3; width: 100%; margin-right: 0; }
}

/* ---------- Motion ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 107, 107, .4); } 50% { box-shadow: 0 0 0 8px rgba(242, 107, 107, 0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------- Phones ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(86vw, var(--sidebar-w));
    transform: translateX(-100%); transition: transform .2s ease-out;
  }
  .shell[data-sidebar-open] .sidebar { transform: none; box-shadow: 8px 0 32px rgba(0, 0, 0, .35); }
  .shell[data-sidebar-open] .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .5); }
  .bubble { max-width: 92%; }
  .avatar { display: none; }
  .packs { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .pillars, .great-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .pillars, .great-grid, .how { grid-template-columns: minmax(0, 1fr); }
  .run-demo-stage { padding: 40px 12px 14px; }
}
