:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #16181d;
  --muted: #5b6270;
  --faint: #8a91a0;
  --accent: #0f766e;
  --accent-strong: #0b5f58;
  --accent-soft: #e3f4f1;
  --primary: #3346d3;
  --primary-strong: #2535b0;
  --ok: #16794a;
  --ok-soft: #e4f5ec;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --code-bg: #0f1420;
  --code-text: #dfe6f3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #161a21; --surface-2: #1d222b; --border: #2a303b;
    --text: #e8ebf1; --muted: #a3abba; --faint: #737c8c;
    --accent: #2dd4bf; --accent-strong: #5eead4; --accent-soft: #10302d;
    --primary: #7c8cff; --primary-strong: #9aa6ff;
    --ok: #4ade80; --ok-soft: #12301f; --bad: #f87171; --bad-soft: #3a1717;
    --warn: #fbbf24; --warn-soft: #36290c; --code-bg: #0a0d13;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }
p { margin: 0; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 560; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; }
label.field { display: grid; gap: 6px; font-weight: 560; font-size: 13px; }
label.field .hint { font-weight: 400; color: var(--muted); }
input[type=text], input:not([type]), textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }

/* App shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 4px 8px 16px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 520; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 4px; }
.sidebar .runtime { margin-top: auto; font-size: 11.5px; color: var(--faint); padding: 8px 10px; border-top: 1px solid var(--border); line-height: 1.6; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.workspace { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.workspace .avatar { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.local { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.main { min-width: 0; }
.content { padding: 28px; max-width: 1240px; }
.menu-toggle { display: none; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 12px; }
.stack.lg { gap: 20px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.banner.info { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.banner svg { flex: none; margin-top: 2px; }

.start { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; padding: 28px; }
.start .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.start .tile { border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 12px; color: var(--muted); background: var(--surface-2); display: grid; gap: 6px; }
.start .tile b { color: var(--text); font-size: 12.5px; }
.start .flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 20px; font-size: 12.5px; color: var(--muted); }
.start .flow span { background: var(--surface-2); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }

.agent-list .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.agent-list .item:first-child { border-top: 0; }
.agent-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 700; flex: none; }

/* Modal */
.backdrop { position: fixed; inset: 0; background: rgba(10, 14, 22, .55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: rise .18s ease; }
.modal header, .modal footer { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
.modal header { border-bottom: 1px solid var(--border); }
.modal footer { border-top: 1px solid var(--border); justify-content: flex-end; gap: 10px; }
.modal .body { padding: 20px 24px; display: grid; gap: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.templates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.template { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 12px; background: var(--surface); text-align: center; display: grid; gap: 8px; justify-items: center; cursor: pointer; font: inherit; color: inherit; }
.template:hover:not([disabled]) { border-color: var(--primary); }
.template[aria-pressed=true] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.template[disabled] { cursor: not-allowed; opacity: .62; }
.template .ticon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.template[aria-pressed=true] .ticon { background: var(--accent-soft); color: var(--accent-strong); }
.template b { font-size: 13px; }
.template small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

/* Agent page */
.agent-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.agent-head .agent-icon { width: 44px; height: 44px; font-size: 18px; }
.agent-head .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; overflow-y: hidden; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); }

.quick { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.rail { position: sticky; top: 76px; display: grid; gap: 16px; }
.progress ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.progress li a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.progress li a:hover { background: var(--surface-2); text-decoration: none; }
.progress li.done a { color: var(--text); }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; flex: none; font-size: 11px; color: var(--faint); background: var(--surface); }
.done .dot, .step.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.timeline { font-size: 12.5px; display: grid; gap: 6px; margin-top: 10px; }
.timeline div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.timeline b { color: var(--text); font-weight: 560; }

.step { display: grid; grid-template-columns: 32px 1fr; gap: 16px; padding-bottom: 28px; position: relative; scroll-margin-top: 76px; }
.step::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--border); }
.step:last-child::before { display: none; }
.step .num { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-weight: 650; color: var(--muted); background: var(--surface); position: relative; z-index: 1; }
.step.current .num { border-color: var(--primary); color: var(--primary); }
.step .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 5px 0 6px; }
.step .lead { color: var(--muted); margin-bottom: 14px; max-width: 760px; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; }
.toggle input { margin-top: 3px; accent-color: var(--primary); }
.toggle small { display: block; color: var(--muted); font-size: 12.5px; }

.tenant-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.tenant-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tenant-card .docs { padding: 12px 14px; display: grid; gap: 10px; }
.doc { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.doc .row input { font-size: 13px; padding: 6px 8px; }
.doc textarea { min-height: 52px; font-size: 13px; padding: 6px 8px; }
.tenant-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.t0 { background: #e0ecff; color: #1d4ed8; }
.t1 { background: #fde7f3; color: #be185d; }
.t2 { background: #fef3c7; color: #a16207; }
.t3 { background: #ede9fe; color: #6d28d9; }
.tx { background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t0 { background: #172554; color: #93c5fd; }
  :root:not([data-theme="light"]) .t1 { background: #4a0f2c; color: #f9a8d4; }
  :root:not([data-theme="light"]) .t2 { background: #422006; color: #fcd34d; }
  :root:not([data-theme="light"]) .t3 { background: #2e1065; color: #c4b5fd; }
}

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }

.codeblock { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: 10px; overflow: hidden; }
.codeblock .bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 12px; color: #8b95aa; border-bottom: 1px solid #1f2633; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; line-height: 1.6; }
.codeblock .copy { background: #1f2633; color: #dfe6f3; border: 0; border-radius: 6px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.codeblock .copy:hover { background: #2a3344; }
.tok-c { color: #6b7a93; } .tok-s { color: #a5e3b8; } .tok-k { color: #c4a7ff; }

.protect { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.protect ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.protect .yes h4 { color: var(--ok); }
.protect .no h4 { color: var(--warn); }
.protect h4 { font-size: 13px; display: flex; gap: 6px; align-items: center; }

.chat { display: grid; gap: 12px; }
.chat .compose { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; }
.exchange { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; animation: rise .2s ease; }
.exchange .q { padding: 10px 14px; background: var(--surface-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.exchange .a { padding: 12px 14px; display: grid; gap: 10px; }
.toolcall { font-size: 12.5px; border-left: 3px solid var(--border); padding: 4px 10px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolcall.ok { border-left-color: var(--ok); }
.toolcall.denied { border-left-color: var(--bad); }

.feedback { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; flex-wrap: wrap; }
.next-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.next-steps a.card { display: grid; gap: 6px; color: inherit; }
.next-steps a.card:hover { border-color: var(--primary); text-decoration: none; }

.code-view { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.tree { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: grid; gap: 1px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.tree button { text-align: left; background: none; border: 0; color: var(--muted); padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.tree button:hover { background: var(--surface-2); color: var(--text); }
.tree button.active { background: var(--accent-soft); color: var(--accent-strong); }
.code-view .codeblock pre { max-height: calc(100vh - 160px); }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }

@media (max-width: 1080px) {
  .quick { grid-template-columns: 1fr; }
  .rail { position: static; order: -1; grid-template-columns: 1fr 1fr; }
  .progress ol { display: flex; flex-wrap: wrap; gap: 2px 8px; }
  .templates { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .start, .grid2, .grid3, .protect, .next-steps, .code-view, .rail { grid-template-columns: 1fr; }
  .tree { position: static; max-height: 240px; }
  .chat .compose { grid-template-columns: 1fr; }
  .step { grid-template-columns: 24px 1fr; gap: 10px; }
  .step .num { width: 24px; height: 24px; font-size: 12px; }
  .step::before { left: 11px; top: 28px; }
}
@media (max-width: 520px) {
  .templates { grid-template-columns: 1fr; }
}

/* Front page */
.fp { background: var(--bg); min-height: 100vh; }
.fp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.fp-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.fp-nav-row { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fp-links { display: flex; gap: 22px; }
.fp-links a { color: var(--muted); font-weight: 520; }
.fp-links a:hover { color: var(--text); text-decoration: none; }
.fp-eyebrow { display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 12px; }
.fp-hero { padding: 88px 0 56px; text-align: center;
  background: radial-gradient(800px 360px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.fp-hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; letter-spacing: -.025em; max-width: 860px; margin: 0 auto; font-weight: 720; }
.fp-cta { padding: 11px 20px; font-size: 15px; }
.fp-fine { margin-top: 16px; font-size: 13px; color: var(--faint); }
.fp-section { padding: 72px 0; scroll-margin-top: 64px; }
.fp-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.fp-section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.fp-section-head h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.02em; font-weight: 700; }
.fp-section-head p { color: var(--muted); font-size: 16px; margin-top: 14px; line-height: 1.6; }

.fp-diagram { max-width: 1120px; margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Equal billing: the web app and the ring share one size, --stage, and sit in equal columns. */
.fp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; container-type: inline-size;
  --stage: min(600px, max(300px, 100svh - 250px), (100cqw - 40px) / 2); }
.fp-pane { display: flex; flex-direction: column; align-items: center; min-width: 0; --gap: 34px; }
.fp-pane-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.fp-app { width: var(--stage); height: var(--stage); display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 18px 50px -24px rgba(16, 24, 40, .35); margin-top: var(--gap); }
.fp-app-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.fp-app-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.fp-app-bar span { margin-left: 10px; flex: 1; font-size: 11.5px; color: var(--faint); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.fp-app-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.fp-app-head > span:not(.fp-app-user) { color: var(--muted); }
.fp-app-user { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e0ecff; color: #1d4ed8; font-weight: 700; font-size: 12px; }
.fp-app-body { flex: 1; min-height: 0; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; overflow: hidden; }
.fp-app-empty { margin: auto; color: var(--faint); font-size: 13px; }
.fp-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; animation: rise .3s ease; }
.fp-msg-me { align-self: flex-end; background: #3346d3; color: #fff; border-bottom-right-radius: 4px; }
.fp-msg-bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; display: grid; gap: 6px; }
.fp-msg-bot small { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.fp-msg-bot small svg { width: 13px; height: 13px; }
.fp-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-self: flex-start; }
.fp-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); animation: rise .25s ease; }
.fp-st.is-live { color: var(--text); }
.fp-st svg { width: 15px; height: 15px; flex: none; }
.fp-st-id { color: var(--muted); }
.fp-st-tg { color: var(--accent-strong); font-weight: 600; }
.fp-st-warn { color: var(--warn); font-weight: 600; }
.fp-st-warn svg path:first-child { fill: var(--warn); }
.fp-st-ok svg { color: var(--ok); }
.fp-dots { display: inline-flex; gap: 3px; }
.fp-dots b { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: blink 1s infinite; }
.fp-dots b:nth-child(2) { animation-delay: .15s; } .fp-dots b:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.fp-app-compose { display: flex; align-items: center; gap: 2px; margin: 0 12px 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 13.5px; min-height: 40px; }
.fp-typed { color: var(--text); white-space: nowrap; overflow: hidden; }
.fp-placeholder { color: var(--faint); }
.fp-caret { width: 1.5px; height: 16px; background: var(--primary); animation: blink 1s infinite; }
.fp-send { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; }
/* Same size as the web app; fits the screen height so the whole cycle is visible. */
.fp-ring { position: relative; width: var(--stage); aspect-ratio: 1; margin: var(--gap) auto 26px; container-type: inline-size; --node: clamp(120px, 33%, 220px); }
.fp-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fp-ring-track { fill: none; stroke: var(--border); stroke-width: .7; }
.fp-ring-progress { fill: none; stroke: var(--primary); stroke-width: .9; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .9s ease, stroke .3s; }
.fp-diagram[data-story=contained] .fp-ring-progress { stroke: var(--warn); }
.fp-hub { position: absolute; left: 50%; top: 50%; width: 36%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 6%; text-align: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 70%);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); transition: box-shadow .4s, border-color .4s; }
.fp-hub-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); white-space: nowrap; }
.fp-hub ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.fp-hub b { color: var(--text); }
.fp-ring.tg-active .fp-hub { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent); }
.fp-diagram[data-story=contained] .fp-ring.tg-active .fp-hub { border-color: var(--warn); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 14%, transparent); }
/* Floating icons: no card. A page-coloured halo masks the ring line behind each node. */
.fp-node { position: absolute; width: var(--node); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 10px 4px 8px; border-radius: 22px; background: var(--bg); opacity: .5; transition: opacity .35s, transform .35s; }
.fp-node.is-reached { opacity: 1; }
.fp-node.is-current { transform: translate(-50%, -50%) scale(1.1); }
.fp-node-num { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border); color: var(--faint); }
.fp-node.is-reached .fp-node-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.fp-diagram[data-story=contained] .fp-node.is-reached .fp-node-num { background: var(--warn); border-color: var(--warn); }
.fp-node-icons { display: flex; gap: 8px; justify-content: center; margin: 8px 0 8px; }
.fp-ico { display: grid; place-items: center; color: var(--text); filter: drop-shadow(0 3px 6px rgba(16, 24, 40, .14)); transition: filter .35s; }
.fp-ico svg { width: 44px; height: 44px; }
.fp-ico-line { color: var(--muted); }
.fp-node.is-current .fp-ico { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 55%, transparent)); }
.fp-diagram[data-story=contained] .fp-node.is-current .fp-ico { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--warn) 60%, transparent)); }
.fp-node b { font-size: 13px; line-height: 1.25; }
.fp-node small { font-size: 11px; color: var(--faint); line-height: 1.25; }
.fp-node-tg { opacity: 1; }
.fp-node-tg b { font-size: 16px; color: var(--accent-strong); }
.fp-tg-mark svg { width: 84px; height: 84px; display: block; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--accent) 45%, transparent)); transition: filter .35s; }
.fp-node-tg.is-current .fp-tg-mark svg { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 80%, transparent)); }
.fp-legend { margin-top: 12px; display: flex; justify-content: center; gap: 20px; font-size: 12.5px; color: var(--muted); }
.fp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fp-dot { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--border); background: var(--surface); display: inline-block; }
.fp-dot-tg { background: var(--accent); border-color: var(--accent); }
@container (max-width: 560px) {
  .fp-hub li span { display: none; }
  .fp-hub ol { font-size: 13px; gap: 4px; }
}
.fp-marks { text-align: center; font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.fp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fp-card { border: 1px solid var(--border); border-radius: 14px; padding: 24px; background: var(--bg); }
.fp-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.fp-is h3 { color: var(--ok); }
.fp-isnt h3 { color: var(--warn); }
.fp-card ul { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 10px; color: var(--muted); }
.fp-card li b { color: var(--text); }
.fp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fp-steps li { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 20px; }
.fp-steps span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; margin-bottom: 12px; }
.fp-steps h3 { font-size: 15px; }
.fp-steps p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.fp-final { margin: 32px auto 0; max-width: 860px; text-align: center; padding: 44px 24px; border-radius: 18px; color: #f3f5fa;
  background: radial-gradient(600px 300px at 80% 120%, #3346d3 0%, transparent 60%), radial-gradient(500px 260px at 10% -20%, #0f766e 0%, transparent 60%), #0b0f19; }
.fp-final h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 22px; letter-spacing: -.02em; }
.fp-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 13px; color: var(--faint); }
.fp-footer p + p { margin-top: 12px; gap: 18px; }

@media (max-width: 900px) {
  .fp-split { grid-template-columns: 1fr; gap: 18px; --stage: min(560px, 100cqw, max(300px, 100svh - 250px)); }
}
@media (max-width: 860px) {
  .fp-links { display: none; }
  .fp-wrap { padding: 0 16px; }
  .fp-hero { padding: 56px 0 40px; }
  .fp-section { padding: 52px 0; }
  .fp-two, .fp-steps { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .fp-app-bar { display: none; }

  .fp-app-head { padding: 8px 12px; }
  .fp-app-body { padding: 10px 12px; gap: 8px; }
  .fp-app-compose { margin: 0 10px 10px; padding: 6px 10px; min-height: 34px; }
  .fp-split { gap: 10px; }
  .fp-msg { font-size: 12.5px; padding: 8px 11px; }
  .fp-status .fp-st:not(:last-child) { display: none; }
  .fp-pane { --gap: 30px; }
  .fp-ring { --node: 34%; margin-bottom: 20px; }
  .fp-node { padding: 8px 2px 6px; }
  .fp-node small { display: none; }
  .fp-node b { font-size: 11.5px; }
  .fp-node-tg b { font-size: 13px; }
  .fp-ico svg { width: 30px; height: 30px; }
  .fp-node-icons { gap: 5px; margin: 6px 0 4px; }
  .fp-tg-mark svg { width: 56px; height: 56px; }
  .fp-hub { gap: 4px; width: 40%; padding: 3%; }
  .fp-hub ol { font-size: 11.5px; gap: 2px; }
  .fp-hub-title { font-size: 9px; letter-spacing: .05em; }
}
@media (max-width: 420px) {
  .fp-nav-row .btn.ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fp-node, .fp-ring-progress, .fp-hub, .fp-ico, .fp-tg-mark svg { transition: none; }
  .fp-msg, .fp-st, .fp-dots b, .fp-caret { animation: none; }
}
