/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/static/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #000;
  --fg: #fdfdfd;
  --fg-2: rgba(253, 254, 255, 0.65);
  --fg-3: rgba(253, 254, 255, 0.42);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.05);
  --green: #2ee08a;
  --cyan: #1fc8c8;
  --blue: #22a6ee;
  --brand: linear-gradient(120deg, var(--green), var(--blue));
  --radius: 16px;
  --sans: "Inter", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
:root:lang(zh-CN) {
  --sans: "Inter", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
::selection { background: rgba(46, 224, 138, 0.3); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--fg); color: #000; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 760px; }
.grad {
  background: linear-gradient(97deg, #fff 30%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.br-sm { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .2s, opacity .2s;
}
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn--primary { background: var(--fg); color: #000; }
.btn--primary:hover { opacity: .88; }
.btn--gray { background: #2a2b2f; color: var(--fg); border: 1px solid rgba(255,255,255,.08); }
.btn--gray:hover { background: #35363b; }
.btn--ghost { border: 1px solid var(--line-2); color: var(--fg); background: var(--surface); }
.btn--ghost:hover { background: var(--surface-2); border-color: rgba(255,255,255,.24); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.nav.is-scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; height: 64px; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand--muted { color: var(--fg-2); }
.nav__links { display: flex; gap: 28px; font-size: 14px; color: var(--fg-2); }
.nav__links a:hover { color: var(--fg); }
.nav__cta { margin-left: auto; display: flex; gap: 8px; }
.nav__toggle { display: none; }
.nav__mobile-cta { display: none; }
.nav__cta form, .nav__mobile-form { margin: 0; }
.user { display: inline-flex; align-items: center; gap: 8px; max-width: 180px; font-size: 14px; color: var(--fg-2); }
.user__av { position: relative; overflow: hidden; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #000; font-size: 13px; font-weight: 600; }
.user__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto; height: 720px; pointer-events: none;
  background:
    radial-gradient(40% 50% at 35% 30%, rgba(46, 224, 138, 0.16), transparent 70%),
    radial-gradient(40% 50% at 65% 25%, rgba(34, 166, 238, 0.16), transparent 70%);
  filter: blur(20px);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(60% 50% at 50% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 50% at 50% 20%, #000 20%, transparent 75%);
  opacity: .5;
}
.hero__inner { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  font-size: 13px; color: var(--fg-2);
  border: 1px solid var(--line-2); background: var(--surface);
  transition: color .2s, border-color .2s;
}
.pill:hover { color: var(--fg); border-color: rgba(255,255,255,.24); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.hero__title {
  margin-top: 28px;
  font-size: clamp(44px, 8vw, 88px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.hero__title .serif {
  font-size: clamp(30px, 5vw, 56px); letter-spacing: -0.01em;
  background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 4px;
}
.hero__lead { margin-top: 24px; max-width: 620px; font-size: 18px; line-height: 1.75; color: var(--fg-2); }
.hero__actions { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Demo ticket ---------- */
.demo {
  margin-top: 72px; width: 100%; max-width: 760px; text-align: left;
  border-radius: 20px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(20, 22, 26, 0.9), rgba(10, 11, 13, 0.9));
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 40px 120px -20px rgba(34, 166, 238, 0.18);
  overflow: hidden;
}
.demo__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.demo__dots { display: flex; gap: 6px; }
.demo__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.12); }
.demo__channel { font-family: var(--mono); color: var(--fg-2); }
.tag { margin-left: auto; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.tag--green { color: #46fea5; background: rgba(34, 255, 153, 0.1); border: 1px solid rgba(34, 255, 153, 0.2); }
.demo__body { padding: 24px 20px; display: flex; flex-direction: column; gap: 22px; }

.msg { display: flex; gap: 14px; opacity: 0; transform: translateY(8px); animation: rise .6s ease forwards; }
.msg--bot { animation-delay: .9s; }
.sys { animation: rise .6s ease 1.8s forwards; opacity: 0; }
@keyframes rise { to { opacity: 1; transform: none; } }

.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.avatar--user { background: linear-gradient(135deg, #f0abfc, #818cf8); color: #000; }
.avatar--bot { background: #0b0d10; border: 1px solid var(--line-2); }
.avatar--bot img { width: 24px; height: 24px; }
.msg__head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.msg__head span { color: var(--fg-3); font-size: 12px; }
.msg__head .bot-badge { font-size: 10px; font-weight: 600; color: #fff; background: #5865f2; padding: 1px 5px; border-radius: 4px; }
.msg p { font-size: 15px; color: rgba(253,254,255,.86); line-height: 1.7; }
.msg code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
.source {
  margin-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: var(--fg-2);
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.conf { margin-left: auto; font-family: var(--mono); font-size: 12px; color: #70b8ff; }
.msg__actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--fg-2); }
.chip--ok { color: #46fea5; border-color: rgba(34, 255, 153, 0.25); background: rgba(34, 255, 153, 0.06); }
.sys { font-size: 13px; color: var(--fg-3); text-align: center; padding-top: 4px; border-top: 1px dashed var(--line); padding-top: 16px; }

/* ---------- Sections ---------- */
.section { padding: 120px 0; border-top: 1px solid var(--line); }
.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block; margin-bottom: 16px;
}
.h2 { font-size: clamp(32px, 5vw, 52px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
.lead { margin-top: 20px; max-width: 640px; font-size: 18px; color: var(--fg-2); line-height: 1.75; }

/* Problem */
.stats { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 36px 32px; background: var(--surface); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat__num { font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__num span { font-size: .45em; color: var(--fg-3); margin-left: 4px; letter-spacing: 0; font-weight: 500; }
.stat__label { margin-top: 12px; color: var(--fg-2); font-size: 15px; }
.stat--accent .stat__num { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat--accent .stat__num span { color: var(--cyan); -webkit-text-fill-color: var(--cyan); }
.note { margin-top: 28px; color: var(--fg-3); font-size: 15px; }

/* Feature overview */
.overview { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ov {
  display: flex; flex-direction: column; gap: 6px; padding: 28px; background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .25s;
}
.ov:nth-child(3n) { border-right: 0; }
.ov:nth-child(n+10) { border-bottom: 0; }
.ov:hover { background: var(--surface-2); }
.ov__n { font-family: var(--mono); font-size: 12px; color: var(--fg-3); margin-bottom: 10px; }
.ov b { font-size: 17px; font-weight: 600; }
.ov span:last-child { color: var(--fg-2); font-size: 14.5px; }

/* Feature rows */
.feature { padding: 112px 0; border-top: 1px solid var(--line); scroll-margin-top: 40px; }
.feature__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.feature__grid--flip .feature__text { order: 2; }
.h3 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
.feature__text > p:not(.eyebrow) { margin-top: 18px; color: var(--fg-2); font-size: 16.5px; line-height: 1.75; }
.feature__text code, .faq code { font-family: var(--mono); font-size: .88em; color: var(--fg); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; color: rgba(253,254,255,.82); font-size: 15px; }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; color: var(--green); background: rgba(46,224,138,.12);
}

.panel {
  position: relative; border-radius: 18px; border: 1px solid var(--line-2); padding: 20px; min-width: 0;
  background: linear-gradient(180deg, rgba(20, 22, 26, 0.9), rgba(8, 9, 11, 0.9));
  box-shadow: 0 30px 80px -30px rgba(34, 166, 238, 0.18);
}
.panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(46,224,138,.35), rgba(34,166,238,.12) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 500; color: var(--fg-2); margin-bottom: 14px; }
.panel__head--sub { margin-top: 20px; }
.panel__meta { font-family: var(--mono); font-size: 11.5px; color: var(--fg-3); font-weight: 400; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; }

.kb { display: flex; flex-direction: column; gap: 8px; }
.kb__row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,.4); font-size: 14px; color: var(--fg-2);
}
.kb__icon { color: var(--fg-3); }
.kb__n { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--fg-3); }
.kb__row--hit { color: var(--fg); border-color: rgba(46, 224, 138, 0.35); background: rgba(46, 224, 138, 0.06); box-shadow: 0 0 30px -10px rgba(46,224,138,.5); }
.kb__row--hit .kb__n, .kb__row--hit .kb__icon { color: var(--green); }

/* Dashboard ranking */
.rank { display: flex; flex-direction: column; gap: 14px; }
.rank__row { display: grid; grid-template-columns: 1fr 90px 36px; align-items: center; gap: 14px; font-size: 13.5px; }
.rank__q { color: rgba(253,254,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank__bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rank__bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.w-100 { width: 100%; } .w-64 { width: 64%; } .w-38 { width: 38%; }
.rank__n { font-family: var(--mono); font-size: 12.5px; color: var(--fg-2); text-align: right; }
.add-kb { margin-top: 20px; padding: 16px; border-radius: 12px; border: 1px solid rgba(46,224,138,.3); background: rgba(46,224,138,.04); }
.add-kb__q { font-size: 13.5px; font-weight: 600; }
.add-kb__a { margin-top: 8px; font-size: 13px; color: var(--fg-2); line-height: 1.6; padding: 10px 12px; border-radius: 8px; background: rgba(0,0,0,.4); border: 1px solid var(--line); }
.add-kb__foot { margin-top: 12px; display: flex; justify-content: flex-end; }
.btn--xs { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

/* Staff protection relay */
.relay { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
.relay__pane { border-radius: 16px; border: 1px solid var(--line-2); padding: 16px; background: linear-gradient(180deg, rgba(20,22,26,.9), rgba(8,9,11,.9)); display: flex; flex-direction: column; gap: 10px; }
.relay__pane .panel__head { margin-bottom: 4px; font-family: var(--mono); font-size: 12px; }
.relay__arrow { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--green); font-size: 12px; font-family: var(--mono); }
.bubble { font-size: 14px; line-height: 1.6; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: rgba(253,254,255,.88); max-width: 88%; }
.bubble code { font-family: var(--mono); font-size: 12.5px; color: #70b8ff; }
.bubble--user { align-self: flex-end; background: rgba(88, 101, 242, .14); border-color: rgba(88,101,242,.3); }
.bubble--bot, .bubble--staff { align-self: flex-start; }
.bubble--wide { max-width: 100%; }
.bubble__from { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.bubble__from img { width: 16px; height: 16px; }
.mini-av { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700; color: #000; background: linear-gradient(135deg, #fde68a, #f59e0b); flex: none; }
.mini-av--red { background: linear-gradient(135deg, #fda4af, #ef4444); }
.hidden-tag { font-weight: 500; font-size: 11px; color: #ffca16; border: 1px solid rgba(250,130,0,.3); background: rgba(250,130,0,.1); padding: 0 6px; border-radius: 5px; }

/* Transcripts */
.plans { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan { padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.plan span { font-size: 13px; color: var(--fg-2); }
.plan b { font-size: 32px; letter-spacing: -0.03em; font-weight: 700; }
.plan small { font-size: 13px; color: var(--fg-3); }
.plan--paid { border-color: rgba(46,224,138,.3); background: rgba(46,224,138,.04); }
.plan--paid b { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tx { display: flex; flex-direction: column; }
.tx__row { display: grid; grid-template-columns: 52px 1fr auto 56px; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); font-size: 13.5px; }
.tx__id { font-family: var(--mono); font-size: 12px; color: var(--fg-3); }
.tx__t { color: rgba(253,254,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx__d { font-size: 12px; color: var(--fg-3); text-align: right; }
.badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 6px; }
.badge--green { color: #46fea5; background: rgba(34,255,153,.1); }
.badge--blue { color: #70b8ff; background: rgba(0,119,255,.16); }
.badge--gray { color: var(--fg-2); background: var(--surface-2); }

/* Monitoring */
.defs { margin: 24px 0 0; display: flex; flex-direction: column; gap: 14px; }
.defs div { padding-left: 14px; border-left: 2px solid var(--line-2); }
.defs dt { font-weight: 600; font-size: 15px; }
.defs dd { margin: 4px 0 0; color: var(--fg-2); font-size: 14.5px; }
.ut { display: flex; flex-direction: column; gap: 4px; }
.ut__row { display: grid; grid-template-columns: 1.4fr .7fr .7fr .7fr 1.3fr; gap: 8px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--line); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ut__row--head { border-top: 0; font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); padding-top: 0; }
.ut__row--flag { background: rgba(255,23,63,.06); border-radius: 10px; border-top-color: transparent; box-shadow: inset 0 0 0 1px rgba(255,23,63,.22); }
.ut__user { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.hot { color: #ff9592; font-weight: 600; }
.ut__act { display: flex; gap: 6px; justify-content: flex-end; }
.act { font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--fg-2); }
.act--red { color: #ff9592; border-color: rgba(255,23,63,.4); background: rgba(255,23,63,.12); }

/* Models */
.models { display: flex; flex-direction: column; gap: 8px; }
.model { display: grid; grid-template-columns: 18px 1fr auto 56px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--fg-2); }
.model--on { color: var(--fg); border-color: rgba(46,224,138,.35); background: rgba(46,224,138,.06); }
.model__name { display: flex; flex-direction: column; min-width: 0; font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }
.model__name small { font-size: 11.5px; font-weight: 400; color: var(--fg-3); }
.model__cost { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--green); }
.model__cost--high { color: #ffb86b; }
.radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.radio--on { border-color: var(--green); background: radial-gradient(circle, var(--green) 40%, transparent 45%); }

/* Ticket modes */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.duo__card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(20,22,26,.9), rgba(8,9,11,.9)); min-width: 0; }
.duo__card b { font-size: 15px; }
.duo__card .bubble { max-width: 100%; font-size: 13px; }
.duo__label { font-family: var(--mono); font-size: 11px; color: var(--green); text-transform: uppercase; letter-spacing: .06em; }
.chan { font-family: var(--mono); font-size: 12px; color: var(--fg-2); padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }

/* Flows, categories, departments, embeds */
.flow { display: flex; flex-direction: column; gap: 10px; }
.sys--flat { margin: 4px 0 0; }
.cats { display: flex; flex-direction: column; }
.cat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.cat:first-child { border-top: 0; }
.sw { position: relative; flex: none; width: 38px; height: 22px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg-3); }
.sw--on { background: rgba(46,224,138,.25); border-color: rgba(46,224,138,.5); }
.sw--on::after { left: 18px; background: var(--green); }
.depts { display: flex; flex-direction: column; gap: 10px; }
.dept { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.dept__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.embed { padding: 14px 16px; border-radius: 6px 12px 12px 6px; border-left: 4px solid var(--blue); background: rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 10px; }
.embed__title { font-size: 14px; font-weight: 600; }
.embed__row { display: flex; gap: 10px; font-size: 13px; color: var(--fg-2); }
.embed__k { color: var(--fg-3); }
.embed__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -2px; }
.dbtn { font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--fg); }
.dbtn--red { background: #da373c; }
.dept__role { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-3); }
.role { font-weight: 500; padding: 2px 8px; border-radius: 6px; color: #ffcf8b; background: rgba(255,184,107,.12); }

/* Customize */
.modes { margin-top: 16px; display: inline-flex; padding: 4px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.mode { font: inherit; font-size: 14px; font-weight: 500; color: var(--fg-2); background: none; border: 0; padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: background .2s, color .2s; }
.mode:hover { color: var(--fg); }
.mode.is-active { background: var(--fg); color: #000; }
.mode-panel { margin-top: 16px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.mode-panel p { color: var(--fg-2); font-size: 15px; line-height: 1.7; }
.pros { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.pro::before { content: "+"; color: var(--green); font-family: var(--mono); margin-right: 10px; }
.con::before { content: "−"; color: #ff9592; font-family: var(--mono); margin-right: 10px; }
.pro { color: rgba(253,254,255,.85); }
.con { color: var(--fg-2); }
.prompt { font-family: var(--mono); font-size: 13px; line-height: 1.9; padding: 14px 16px; border-radius: 10px; background: rgba(0,0,0,.5); border: 1px solid var(--line); color: rgba(253,254,255,.85); }
.prompt__ln { display: inline-block; width: 22px; color: var(--fg-3); user-select: none; }
.caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--green); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Steps */
.steps { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step__n { font-family: var(--mono); font-size: 13px; color: var(--fg-3); }
.step h3 { margin-top: 20px; font-size: 18px; }
.step p { margin-top: 8px; color: var(--fg-2); font-size: 15px; }

.code { margin-top: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: #0a0b0d; overflow: hidden; }
.code__bar { padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--fg-3); }
.code pre { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.7; }
.c-k { color: #70b8ff; } .c-f { color: var(--fg); } .c-p { color: var(--fg-3); } .c-s { color: #46fea5; } .c-n { color: #ffca16; }

/* Security */
.sec-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.sec { padding: 28px 24px 0 0; }
.sec + .sec { padding-left: 24px; border-left: 1px solid var(--line); }
.sec h3 { font-size: 16px; }
.sec p { margin-top: 8px; font-size: 14.5px; color: var(--fg-2); line-height: 1.7; }

/* FAQ */
.faq { margin-top: 40px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 0; font-size: 17px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--fg-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--fg-2); line-height: 1.8; }

/* CTA */
.cta { text-align: center; position: relative; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; left: 50%; bottom: -260px; width: 900px; height: 500px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(46, 224, 138, .14), rgba(34, 166, 238, .08) 50%, transparent);
  pointer-events: none;
}
.cta__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.cta__logo { margin-bottom: 28px; filter: drop-shadow(0 0 30px rgba(46, 224, 138, .35)); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 14px; }
.footer__inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; color: var(--fg-3); }
.footer__links a:hover { color: var(--fg); }
.footer__side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.footer__copy { color: var(--fg-3); margin: 0; }
.lang { position: relative; }
.lang__btn { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; color: var(--fg-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.lang__btn:hover, .lang__btn[aria-expanded="true"] { color: var(--fg); background: var(--surface-2); }
.lang__btn:focus-visible, .lang__list li:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.lang__flag, .lang__list img { width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); flex: none; }
.lang__chev { color: var(--fg-3); transition: transform .2s; }
.lang__btn[aria-expanded="true"] .lang__chev { transform: rotate(180deg); }
.lang__list { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; min-width: 200px; margin: 0; padding: 6px; list-style: none; border-radius: 12px; border: 1px solid var(--line-2); background: #0b0c0e; box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); }
.lang__list[hidden] { display: none; }
.lang__list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.lang__list li:hover { background: var(--surface-2); color: var(--fg); }
.lang__list li[aria-selected="true"] { color: var(--fg); background: rgba(46,224,138,.08); }
.lang__list li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--green); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sec-grid { grid-template-columns: 1fr 1fr; }
  .sec:nth-child(3) { padding-left: 0; border-left: 0; }
  .feature__grid { grid-template-columns: 1fr; gap: 40px; }
  .feature__grid--flip .feature__text { order: 0; }
  .overview { grid-template-columns: 1fr 1fr; }
  .ov:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .ov:nth-child(2n) { border-right: 0; }
  .ov:nth-child(n+11) { border-bottom: 0; }
}

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .br-sm { display: inline; }
  .nav__links, .nav__cta { display: none; }
  .nav__toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    margin-left: auto; width: 40px; height: 40px; padding: 0 10px;
    background: none; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer;
  }
  .nav__toggle span { display: block; height: 1.5px; background: var(--fg); transition: transform .25s; }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav.is-open { background: rgba(0,0,0,.92); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border-bottom-color: var(--line); }
  .nav.is-open .nav__links {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 64px; left: 0; right: 0; padding: 8px 16px 20px;
    background: rgba(0,0,0,.96); border-bottom: 1px solid var(--line);
  }
  .nav.is-open .nav__links a { padding: 14px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav.is-open .nav__links .nav__mobile-cta { font: inherit; cursor: pointer; width: 100%; display: flex; justify-content: center; margin-top: 16px; padding: 12px; border: 0; border-radius: 12px; background: var(--fg); color: #000; font-weight: 500; }

  .hero { padding: 64px 0 56px; }
  .hero__lead, .lead { font-size: 16px; }
  .hero__actions { width: 100%; flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .demo { margin-top: 48px; }
  .demo__body { padding: 20px 14px; }
  .conf { margin-left: 0; }

  .section { padding: 80px 0; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .feature { padding: 80px 0; }
  .overview { grid-template-columns: 1fr; }
  .ov:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .ov:last-child { border-bottom: 0; }
  .panel { padding: 16px; }
  .rank__row { grid-template-columns: 1fr 48px 30px; gap: 10px; }
  .tx__row { grid-template-columns: 44px 1fr auto; }
  .tx__d { display: none; }
  .ut__row { grid-template-columns: 1.5fr .8fr .8fr .8fr; font-size: 12.5px; padding: 10px 6px; }
  .ut__act { grid-column: 1 / -1; justify-content: flex-start; }
  .ut__row--head span:last-child { display: none; }
  .duo { grid-template-columns: 1fr; }
  .model { grid-template-columns: 18px 1fr 52px; }
  .model .badge { display: none; }
  .modes { display: flex; }
  .mode { flex: 1; padding: 8px 10px; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec, .sec + .sec { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .footer__side { margin-left: 0; align-items: flex-start; }
  .lang__list { right: auto; left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .msg, .sys { opacity: 1; transform: none; }
}
.user__av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
a.user:hover { color: var(--fg); }

/* ---------- Account dropdown (site nav + dashboard) ---------- */
.acct { position: relative; }
.acct__btn { list-style: none; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--fg); font-size: 14px; font-weight: 600; user-select: none; }
.acct__btn::-webkit-details-marker { display: none; }
.acct__btn:hover, .acct[open] .acct__btn { background: var(--surface-2); }
.acct__btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.acct__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__chev { flex: none; color: var(--fg-3); transition: transform .2s; }
.acct[open] .acct__chev { transform: rotate(180deg); }
.acct__menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: #0b0c0e; box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); }
.acct__menu a, .acct__menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 14px; font-weight: 500; color: var(--fg-2); background: none; border: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.acct__menu svg { flex: none; }
.acct__menu a:hover, .acct__menu button:hover { background: var(--surface-2); color: var(--fg); }
.acct__menu a:focus-visible, .acct__menu button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.acct__menu form { margin: 0; }
.acct__menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }
.acct__menu .is-danger { color: #ff5c5c; }
.acct__menu .is-danger:hover { color: #ff7a7a; background: rgba(255, 92, 92, .1); }
.acct--nav { max-width: 220px; }
.acct--nav .acct__menu { left: auto; min-width: 210px; }

@media (max-width: 760px) {
  .nav__cta.nav__cta--user { display: flex; }
  .acct--nav .acct__btn { padding: 4px; }
  .acct--nav .acct__name { display: none; }
  .nav__cta--user + .nav__toggle { margin-left: 8px; }
}
