:root {
  --white: #FFFFFF; --mist: #F4F6FA; --surface: #FFFFFF; --line: #E2E7EF; --ink: #10213F; --ink-2: #2D3B55; --muted: #56637A;
  --blue: #2346D8; --blue-hover: #1A37B3; --on-blue: #FFFFFF; --night: #0C1A33; --night-2: #152849; --code-bg: #0C1A33; --code-ink: #DCE3EE;
  --good: #0E7A62; --good-bg: #E3F4EF; --warn: #8E5B00; --warn-bg: #FBF0DC; --bad: #B23E28; --bad-bg: #FBE8E3;
  --font: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1200px; --gutter: clamp(1.25rem, 4.5vw, 3rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom, 0px); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
a { color: var(--blue); }
a:hover { color: var(--blue-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--mist); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--white); padding: 0.6rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; color: var(--white); }
.hide-sm {}

/* Buttons and pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0.6rem 1.2rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 0.95rem/1.1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--on-blue); }
.btn.light { background: var(--white); border-color: var(--white); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0.4rem 0.9rem; font-size: 0.88rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; font-weight: 600; background: var(--mist); color: var(--ink-2); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.alert { border-radius: 12px; padding: 0.75rem 1rem; margin: 1rem 0; font-size: 0.97rem; }
.alert.good { background: var(--good-bg); color: var(--good); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.1rem, 2.5vw, 1.6rem); }

/* Forms */
.form { display: grid; gap: 0.9rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.form label small { font-weight: 400; color: var(--muted); }
.form input:not([type=checkbox]), .form select, .form textarea, .field { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.8rem; background: var(--surface); font-weight: 400; }
.form textarea { min-height: 110px; resize: vertical; }
.form .check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 0.3rem; width: 18px; height: 18px; }
form.inline { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0.5rem 0 1rem; }
form.inline input { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.8rem; flex: 1 1 240px; }
.err { color: var(--bad); font-size: 0.92rem; }

/* Top bar and footer */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.88); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid rgba(16,33,63,0.08); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 650; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo svg { width: 26px; height: 26px; flex: none; }
.topbar ul { display: flex; align-items: center; gap: 0.25rem 1.4rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.topbar ul a:not(.btn) { color: var(--ink-2); text-decoration: none; font-size: 0.94rem; padding-block: 0.7rem; display: inline-block; }
.topbar .btn { min-height: 40px; padding: 0.45rem 1rem; font-size: 0.92rem; }
.sitefoot { background: var(--mist); color: var(--muted); font-size: 0.92rem; margin-top: 0; }
.foot { padding-block: 3rem 2rem; display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
.foot h4 { margin: 0 0 0.8rem; color: var(--ink); font-size: 0.92rem; font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot p { margin-top: 0.8rem; max-width: 22rem; }
.foot-base { border-top: 1px solid var(--line); padding-block: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Marketing */
.hero { padding-block: clamp(4rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem); text-align: center; }
.hero h1 { font-size: clamp(3rem, 8.5vw, 7rem); letter-spacing: -0.055em; line-height: 0.96; }
.hero h1 span { display: block; color: var(--muted); }
.hero-sub { margin: 1.5rem auto 0; max-width: 40rem; font-size: clamp(1.1rem, 1.9vw, 1.3rem); color: var(--muted); }
.prompt { margin: 2.5rem auto 0; max-width: 760px; text-align: left; background: var(--white); border: 1.5px solid var(--ink); border-radius: 24px; padding: 1rem 1rem 0.85rem 1.25rem; box-shadow: 0 24px 60px -36px rgba(16,33,63,0.45); }
.prompt textarea { width: 100%; min-height: 96px; resize: vertical; border: 0; outline: 0; font: 400 1.15rem/1.5 var(--font); background: transparent; }
.prompt-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.prompt-bar small { color: var(--muted); font-size: 0.88rem; }
.ideas { margin: 1.25rem auto 0; max-width: 760px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.ideas button { border: 1px solid var(--line); background: var(--mist); color: var(--ink-2); border-radius: 999px; padding: 0.55rem 1rem; font: 500 0.92rem/1.2 var(--font); cursor: pointer; min-height: 40px; }
.ideas button:hover { border-color: var(--ink); color: var(--ink); }
.block { padding-block: clamp(4.5rem, 10vw, 8rem); }
.mist { background: var(--mist); }
.night { background: var(--night); color: var(--white); }
.headline { font-size: clamp(2.3rem, 5.5vw, 4.5rem); letter-spacing: -0.045em; line-height: 1; }
.lede { margin-top: 1.25rem; max-width: 42rem; font-size: clamp(1.08rem, 1.7vw, 1.3rem); color: var(--muted); }
.center .lede { margin-inline: auto; }
.night .lede { color: #B4C0D4; }
.templates { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tpl { background: var(--white); border-radius: 20px; padding: 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.tpl-art { height: 140px; border-radius: 12px; background: var(--mist); padding: 14px; display: grid; gap: 8px; align-content: start; }
.tpl-art .row { display: flex; gap: 8px; align-items: center; }
.tpl-art .bar { height: 10px; border-radius: 4px; background: #D3DAE6; }
.tpl-art .bar.b { background: var(--blue); }
.tpl-art .box { flex: 1; height: 40px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); }
.tpl-art .chip { width: 44px; height: 16px; border-radius: 999px; background: var(--good-bg); }
.tpl h3 { font-size: 1.2rem; padding-inline: 0.25rem; }
.tpl p { color: var(--muted); font-size: 0.98rem; padding-inline: 0.25rem; }
.tpl button { margin: auto 0.25rem 0.25rem; align-self: flex-start; background: none; border: 0; padding: 0.5rem 0; color: var(--blue); font: 600 0.95rem var(--font); cursor: pointer; }
.steps { margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: s; }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.steps li::before { content: counter(s); font-size: 3rem; font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--blue); }
.steps h3 { margin-top: 1rem; font-size: 1.5rem; }
.steps p { margin-top: 0.5rem; color: var(--muted); }
.trust { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trust div { background: var(--night-2); border-radius: 20px; padding: clamp(1.5rem, 3vw, 2.25rem); }
.trust h3 { font-size: 1.45rem; }
.trust p { margin-top: 0.6rem; color: #B4C0D4; }
.trust .tag { display: inline-block; margin-bottom: 1rem; font-size: 0.85rem; font-weight: 600; color: #8FD9C4; }
.billing { margin: 2rem auto 0; display: inline-flex; background: var(--mist); border-radius: 999px; padding: 4px; gap: 4px; }
.billing button { border: 0; background: transparent; border-radius: 999px; padding: 0.55rem 1.1rem; font: 600 0.95rem var(--font); color: var(--muted); cursor: pointer; min-height: 40px; }
.billing button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(16,33,63,0.12); }
.billing-note { margin-top: 0.75rem; color: var(--muted); font-size: 0.95rem; }
.plans { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; text-align: left; }
.plan { border: 1px solid var(--line); border-radius: 22px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; background: var(--white); }
.plan.featured { border: 2px solid var(--blue); }
.plan .badge { align-self: flex-start; font-size: 0.8rem; font-weight: 600; color: var(--blue); background: #E8EDFD; border-radius: 999px; padding: 0.25rem 0.7rem; }
.plan h3 { font-size: 1.35rem; }
.plan .for { color: var(--muted); font-size: 0.95rem; min-height: 2.9em; }
.price { display: flex; align-items: baseline; gap: 0.35rem; }
.price strong { font-size: 2.3rem; font-weight: 600; letter-spacing: -0.04em; }
.price span { color: var(--muted); font-size: 0.95rem; }
.price-sub { color: var(--muted); font-size: 0.88rem; min-height: 1.3em; margin-top: -0.6rem; }
.plan ul { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.96rem; }
.plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0.55rem; }
.plan li svg { width: 18px; height: 18px; margin-top: 3px; color: var(--good); }
.plan .btn { width: 100%; }
.compare-wrap { margin-top: 3rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table.compare { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.96rem; text-align: left; }
.compare th, .compare td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
.compare thead th { background: var(--mist); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.compare tr.group th { font-size: 0.85rem; color: var(--muted); padding-top: 1.3rem; text-align: left; background: var(--white); }
.yes { color: var(--good); font-weight: 600; }
.no { color: #A7B1C2; }
.faq { margin: clamp(2.5rem, 5vw, 3.5rem) auto 0; max-width: 820px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; font-size: 1.12rem; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 1.25rem; color: var(--muted); max-width: 64ch; }
.closing h2 { font-size: clamp(2.6rem, 7vw, 6rem); letter-spacing: -0.05em; line-height: 0.96; }
.closing .btn { margin-top: 2.25rem; }

/* Pages */
.page { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.prose h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
.prose h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; letter-spacing: -0.015em; }
.prose p, .prose li { color: var(--ink-2); max-width: 70ch; }
.prose p + p { margin-top: 0.8rem; }
.prose ul { padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.lede-sm { font-size: 1.2rem; color: var(--muted); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: clamp(2rem, 6vw, 4rem) 1rem; background: var(--mist); }
.auth-logo { margin-bottom: 1.5rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 0.4rem; }
.auth-card .form { margin-top: 1.2rem; }
.row-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; font-size: 0.95rem; }
.receipt .card { margin-top: 1rem; }
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.receipt-head h1 { font-size: 1.8rem; }
.right { text-align: right; }
table.kv { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.kv th, .kv td { text-align: left; padding: 0.7rem 0.4rem; border-top: 1px solid var(--line); vertical-align: top; }
.kv th { width: 30%; color: var(--muted); font-weight: 500; }
@media print { .noprint, .topbar, .sitefoot { display: none; } .auth, body { background: #fff; } .card { border: 0; } }

/* Admin */
.admin { padding-block: 2rem 4rem; }
.admin h1 { font-size: 2rem; }
.admin h2 { font-size: 1.35rem; margin: 2rem 0 0.8rem; }
.admin h3 { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; }
.admin .card { margin-bottom: 1rem; }
.admin .card h3 { margin-top: 0; }
.tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: 0.65rem 0.9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.stat { background: var(--mist); border-radius: 14px; padding: 0.9rem 1rem; display: grid; gap: 0.15rem; }
.stat small { color: var(--muted); font-size: 0.85rem; }
.stat strong { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.94rem; display: block; overflow-x: auto; }
.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.85rem; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.stack { display: grid; gap: 1rem; align-content: start; }
.checklist { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.checklist li { padding-left: 1.8rem; position: relative; }
.checklist li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.checklist li.ok::before { content: "✓"; color: var(--good); }
.checklist li.todo::before { content: "!"; color: var(--warn); left: 0.4rem; }
.thread { display: grid; gap: 0.7rem; margin: 1rem 0; }
.thread .msg { background: var(--mist); border-radius: 14px; padding: 0.8rem 1rem; max-width: 760px; }
.thread .msg.mine { background: #E8EDFD; margin-left: auto; }
.thread .msg small { color: var(--muted); }
.thread .msg p { margin-top: 0.3rem; overflow-wrap: anywhere; }

/* Studio */
.studio-root { min-height: 100vh; display: flex; flex-direction: column; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.sbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem clamp(0.9rem, 2.5vw, 1.5rem); border-bottom: 1px solid var(--line); flex-wrap: wrap; padding-top: calc(0.6rem + env(safe-area-inset-top, 0px)); }
.snav { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.snav a { padding: 0.55rem 0.8rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 0.93rem; }
.snav a[aria-current="page"] { background: var(--mist); color: var(--ink); }
.credits { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.credits strong { color: var(--ink); }
.smain { flex: 1; min-height: 0; }
.spage { max-width: 1100px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem) 4rem; }
.spage h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.03em; }
.spage h2 { font-size: 1.25rem; margin: 2rem 0 0.8rem; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head-row p { color: var(--muted); }
.newbox { border: 1.5px solid var(--ink); border-radius: 20px; padding: 0.9rem 0.9rem 0.7rem 1.1rem; background: var(--surface); }
.newbox textarea { width: 100%; min-height: 84px; resize: vertical; border: 0; outline: 0; background: transparent; font-size: 1.08rem; }
.newbox .prompt-bar { margin-top: 0.4rem; }
.pgrid { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.pcard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 1rem 1.1rem; cursor: pointer; display: grid; gap: 0.3rem; text-decoration: none; color: var(--ink); }
.pcard:hover { border-color: var(--ink); color: var(--ink); }
.pcard b { font-weight: 600; overflow-wrap: anywhere; }
.pcard span { color: var(--muted); font-size: 0.88rem; }
.empty { color: var(--muted); padding: 1.5rem 0; }
.ws { display: flex; flex-wrap: wrap; flex: 1; min-height: calc(100vh - 62px); }
.chat { flex: 1 1 320px; max-width: 400px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.chat-head p { color: var(--muted); font-size: 0.85rem; }
.msgs { flex: 1; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; overflow-y: auto; max-height: 58vh; }
.m { border-radius: 14px; padding: 0.6rem 0.8rem; font-size: 0.92rem; overflow-wrap: anywhere; }
.m.user { align-self: flex-end; max-width: 92%; background: var(--ink); color: var(--white); border-radius: 14px 14px 4px 14px; }
.m.sys { background: var(--mist); color: var(--ink-2); }
.m.good { background: var(--good-bg); color: var(--good); }
.m.bad { background: var(--bad-bg); color: var(--bad); }
.composer { border-top: 1px solid var(--line); padding: 0.75rem 0.9rem; display: grid; gap: 0.5rem; }
.composer textarea { width: 100%; min-height: 70px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 0.75rem; background: var(--surface); }
.crow { display: flex; gap: 0.5rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.crow small { color: var(--muted); font-size: 0.82rem; }
.stage { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; }
.tools { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; gap: 3px; background: var(--mist); padding: 3px; border-radius: 999px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 0.4rem 0.85rem; font-weight: 600; font-size: 0.88rem; cursor: pointer; min-height: 34px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.tright { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.ver { color: var(--muted); font-size: 0.85rem; }
.checks { display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); align-items: center; }
.ck { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: 0.8rem; font-weight: 600; }
.ck.pass { background: var(--good-bg); color: var(--good); }
.ck.warn { background: var(--warn-bg); color: var(--warn); }
.ck.fail { background: var(--bad-bg); color: var(--bad); }
.ck.wait { background: var(--mist); color: var(--muted); }
.view { flex: 1; padding: 0.9rem 1rem 1.2rem; }
.frame { width: 100%; height: max(540px, 72vh); border: 1px solid var(--line); border-radius: 14px; background: #fff; display: block; }
.code { margin: 0; height: max(540px, 72vh); overflow: auto; background: var(--code-bg); color: var(--code-ink); border-radius: 14px; padding: 1rem; font: 12.5px/1.55 var(--mono); white-space: pre; tab-size: 2; }
.placeholder { min-height: max(540px, 72vh); border: 1px dashed var(--line); border-radius: 14px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 1.5rem; }
.placeholder b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 0.3rem; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); margin: 0 auto 0.8rem; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin 0.9s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }
.panel { padding: 0.4rem 0.2rem; display: grid; gap: 1rem; max-width: 780px; }
.issue { border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 1rem; }
.issue h4 { font-size: 1rem; margin: 0.3rem 0; }
.issue p { color: var(--muted); font-size: 0.93rem; }
.upsell { background: #E8EDFD; border-radius: 14px; padding: 0.9rem 1rem; display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.meter { height: 10px; background: var(--mist); border-radius: 999px; overflow: hidden; margin: 0.5rem 0; }
.meter i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.cycle { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; gap: 3px; }
.cycle button { border: 0; background: transparent; border-radius: 999px; padding: 0.45rem 1rem; font-weight: 600; cursor: pointer; color: var(--muted); min-height: 36px; }
.cycle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 0.65rem 1.1rem; border-radius: 999px; font-size: 0.92rem; z-index: 60; max-width: calc(100% - 2rem); }

@media (max-width: 1040px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .templates, .steps, .trust, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-sm { display: none; }
  .chat { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .msgs { max-height: 30vh; }
}
@media (max-width: 600px) { .plans, .foot { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===== Brand wordmark (matches the stacked "The / Anything AI" mark) =====
   To use your real logo, upload it to /assets/ and set brand.logo_url in config.php. */
.wordmark { display: inline-flex; flex-direction: column; line-height: 0.92; letter-spacing: -0.035em; color: var(--ink); }
.wm-the { font-size: 0.62em; font-weight: 500; letter-spacing: 0; color: var(--muted); padding-left: 0.08em; }
.wm-main { font-size: 1.12em; font-weight: 700; }
.logo-img { display: block; height: 34px; width: auto; }
.night .wordmark, .wordmark.inverse { color: var(--white); }
.auth-logo { font-size: 1.25rem; }

/* ===== Safari compatibility (macOS, iPhone, iPad) ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, summary, label, [role="button"] { -webkit-tap-highlight-color: transparent; }
.topbar { position: -webkit-sticky; position: sticky; }
/* iPhone: 100vh is taller than the visible screen; dvh fits the real space */
@supports (height: 100dvh) {
  .auth { min-height: 100dvh; }
  .studio-root { min-height: 100dvh; }
  .ws { min-height: calc(100dvh - 62px); }
}
/* Remove Safari's native form styling so fields look the same as in other browsers */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], input:not([type]), textarea, select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 12px 8px !important; padding-right: 34px !important;
}
input[type="checkbox"] { -webkit-appearance: checkbox; appearance: auto; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
/* iPhone/iPad: stop Safari zooming in when a small field is tapped (it zooms below 16px) */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}
