/* Agent Fleet. Structure follows poni.web.id (dot-grid black, floating pill nav, tight 800 headlines with a
   dim second line, white pill CTA). Palette swapped to black, purple, pink and white. */
:root {
  --bg: #07060b; --bg-2: #0d0b13; --card: rgba(21, 18, 31, .68); --card-solid: #13101c;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --text: #f6f4fb; --dim: #a8a2b9; --muted: #7f7891;
  --violet: #a78bfa; --violet-2: #7c3aed; --pink: #f472b6; --pink-2: #db2777; --rose: #fb7185; --amber: #fbbf24;
  --radius: 22px; --max: 1120px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15.5px/1.65 var(--font);
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 22px 22px;
  overflow-x: hidden;
}
body::before { /* one quiet violet haze at the top, nothing else */
  content: ""; position: fixed; inset: -30vh -10vw auto; height: 70vh; pointer-events: none; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(124, 58, 237, .16), transparent 70%);
}
a { color: var(--violet); text-decoration: none; }
a:hover { color: #c4b5fd; }
code, kbd, .mono { font-family: var(--mono); font-size: .86em; }
:not(pre) > code { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; letter-spacing: -.03em; line-height: 1.08; }
p { margin: 0 0 12px; }
.dim { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px 96px; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 12px; z-index: 20; margin: 12px auto 0; width: fit-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 999px;
  background: rgba(12, 10, 18, .74); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; letter-spacing: -.02em; margin-right: 10px; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand svg { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--dim); font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 999px; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: #0b0912; background: #fff; box-shadow: 0 8px 30px -8px rgba(255, 255, 255, .35); }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 30; background: linear-gradient(90deg, var(--violet-2), var(--pink)); transition: width .3s; }

/* ---------- page head ---------- */
.head { padding: 64px 0 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--dim);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px; margin-bottom: 18px; background: rgba(255, 255, 255, .02); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.head h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -.045em; }
.head h1 .dim { color: #8b849c; }
.head .lead { color: var(--dim); font-size: 17px; max-width: 640px; margin-top: 16px; }
.head .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.lead { color: var(--dim); }

/* ---------- buttons, inputs ---------- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer; font: 700 14px/1 var(--font); border-radius: 999px;
  padding: 11px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); background: none;
  transition: transform .15s, background .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: #fff; color: #0b0912; box-shadow: 0 8px 30px -8px rgba(255, 255, 255, .35); }
.btn.primary:hover { background: #f3eefe; color: #0b0912; }
.btn.ghost { background: rgba(255, 255, 255, .03); border-color: var(--line-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.btn.pink { background: var(--pink); color: #1a0711; box-shadow: 0 8px 30px -10px rgba(244, 114, 182, .6); }
.btn.danger { border-color: rgba(251, 113, 133, .35); color: var(--rose); }
.btn.danger:hover { background: rgba(251, 113, 133, .08); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: progress; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--dim); }
input, textarea, select {
  width: 100%; font: 500 15px var(--font); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 14px; min-height: 44px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167, 139, 250, .18); }
.form { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 10px; }
.between { justify-content: space-between; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.card h2 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; margin-bottom: 6px; }
.card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.stack { display: grid; gap: 16px; }
.section-title { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.035em; margin: 48px 0 16px; }
.section-title .dim { color: #8b849c; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat.hot b { color: var(--pink); }

/* machines */
.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.mc { display: grid; gap: 14px; align-content: start; }
.mc-top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.mc-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.mc-where { font: 12.5px var(--mono); color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok { background: var(--pink); box-shadow: 0 0 0 3px rgba(244, 114, 182, .15), 0 0 12px rgba(244, 114, 182, .7); }
.dot.err { background: var(--rose); box-shadow: 0 0 0 3px rgba(251, 113, 133, .15); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 600 12px var(--mono); color: var(--dim); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip.v { color: #d8ccff; border-color: rgba(167, 139, 250, .35); background: rgba(167, 139, 250, .08); }
.chip.p { color: #ffd1e8; border-color: rgba(244, 114, 182, .35); background: rgba(244, 114, 182, .08); }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.err-line { font: 12px/1.5 var(--mono); color: #fda4af; background: rgba(251, 113, 133, .06); border: 1px solid rgba(251, 113, 133, .2); border-radius: 12px; padding: 8px 10px; overflow-wrap: anywhere; }
.note { color: var(--dim); font-size: 14px; }

/* live stat tiles and meters */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.tiles.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255, 255, 255, .02); display: grid; gap: 2px; min-width: 0; }
.tile.wide { grid-column: 1 / -1; }
.tile span { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile b { font-size: 20px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.tile small { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.tiles.compact .tile { padding: 10px 11px; }
.tiles.compact .tile b { font-size: 16px; }
.tiles.compact .tile small { font-size: 11px; }
.meter { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--violet); transition: width .4s; }
.meter.hot i { background: var(--pink); }
.rows { display: grid; }
.rows > div { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 11px 0; border-top: 1px solid var(--line); }
.rows > div:first-child { border-top: 0; }
.rows b { font-weight: 700; }
.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; width: fit-content; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; flex: none; }
.out { margin-top: 16px; }
.out pre { max-height: 420px; overflow: auto; }
.builder { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 8px; }
.builder fieldset { margin: 0; min-width: 0; }
.builder .sticky { position: sticky; top: 90px; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } .builder .sticky { position: static; } }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--dim); }
.switch input { appearance: none; width: 40px; height: 24px; min-height: 0; padding: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #d9d4e6; transition: transform .2s; }
.switch input:checked { background: var(--pink); border-color: var(--pink); }
.switch input:checked::after { transform: translateX(16px); background: #fff; }

/* segmented tabs (poni's feature pill group) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 22px; border: 1px solid var(--line-2); background: rgba(12, 10, 18, .6); margin-bottom: 18px; }
.seg button, .seg a { appearance: none; border: 0; background: none; color: var(--dim); font: 600 14px var(--font); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-selected="true"], .seg a.on { background: #fff; color: #0b0912; }

/* steps */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps > li { counter-increment: s; position: relative; padding-left: 46px; }
.steps > li::before {
  content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 1px; width: 32px; height: 26px; border-radius: 999px;
  font: 600 12px/26px var(--mono); text-align: center; color: #ffd1e8; background: rgba(244, 114, 182, .1); border: 1px solid rgba(244, 114, 182, .3);
}
.steps > li > b:first-child { display: block; color: var(--text); margin-bottom: 2px; }
.steps p, .steps li { color: var(--dim); }

/* code + copy */
.code { position: relative; }
.code pre { margin: 8px 0 0; background: #0b0911; border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 14px; padding-right: 74px;
  font: 12.5px/1.6 var(--mono); color: #e9e4f5; white-space: pre-wrap; word-break: break-all; }
.code .copy { position: absolute; top: 16px; right: 8px; }
.claim { text-align: center; padding: 18px; border: 1px dashed rgba(244, 114, 182, .4); border-radius: 18px; background: rgba(244, 114, 182, .04); }
.claim .codebig { font: 700 clamp(26px, 7vw, 38px) var(--mono); letter-spacing: .12em; color: #fff; margin: 4px 0 12px; }

/* tables (connect page) */
.list { display: grid; gap: 0; }
.list > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.list > div:first-child { border-top: 0; }

/* guide */
.toc { position: sticky; top: 76px; z-index: 5; }
.toc .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; width: fit-content;
  background: rgba(12, 10, 18, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.toc .seg::-webkit-scrollbar { display: none; }
.toc .seg a { white-space: nowrap; flex: none; }
.kb { display: grid; gap: 16px; }
.kb article { scroll-margin-top: 140px; }
.kb article h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.kb article h3 { margin: 18px 0 8px; }
.kb ul { padding-left: 18px; color: var(--dim); }
.kb .tag { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--pink); margin-bottom: 8px; display: block; }
.flow { display: grid; gap: 8px; margin: 14px 0; }
.flow div { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); font-size: 14px; color: var(--dim); }
.flow b { color: var(--text); min-width: 0; }
.flow i { font-style: normal; font: 600 11px var(--mono); color: var(--violet); border: 1px solid rgba(167, 139, 250, .3); border-radius: 999px; padding: 1px 8px; flex: none; }
.callout { border-left: 2px solid var(--pink); padding: 4px 0 4px 14px; color: var(--dim); margin: 12px 0; }

/* toast, empty, footer */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 40; max-width: calc(100% - 32px);
  background: #fff; color: #0b0912; font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 999px; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--rose); color: #22060b; }
.empty { text-align: center; padding: 48px 22px; }
.empty h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.err { color: #fda4af; font-weight: 600; font-size: 14px; }
footer { color: var(--muted); font-size: 13px; text-align: center; padding: 32px 0 40px; }

/* solo pages: login, OAuth approval */
body.solo { display: grid; place-items: center; padding: 24px 16px; }
.solo-card { width: 100%; max-width: 440px; padding: 30px; }
.h-solo { font-size: clamp(30px, 8vw, 40px); font-weight: 800; letter-spacing: -.045em; margin-bottom: 16px; }
.h-solo .dim { color: #8b849c; }
.solo-card form { display: grid; gap: 14px; margin-top: 18px; }

@media (max-width: 720px) {
  .wrap { padding: 0 16px 80px; }
  .head { padding: 40px 0 20px; }
  .head .lead { font-size: 15.5px; }
  .nav { padding-left: 10px; gap: 2px; }
  .brand span { display: none; }
  .brand { margin-right: 2px; }
  .nav-links a { padding: 7px 10px; font-size: 13.5px; }
  .card { padding: 18px; }
  .toc { top: 70px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
