:root {
  --bg: #f6f5fb; --bg2: #efedf8; --card: #ffffff; --fg: #1b1930; --muted: #6a6784; --line: #e3e0ef; --soft: #f1effa;
  --accent: #6d5efc; --accent2: #c04bf2; --accent-fg: #fff; --good: #18a058; --warn: #d98a00; --bad: #e0445a; --info: #2f86eb;
  --shadow: 0 1px 2px #1b193008, 0 8px 28px #1b19300d; --r: 16px;
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d16; --bg2: #14131f; --card: #181726; --fg: #ecebf7; --muted: #9c99b8; --line: #2a2840; --soft: #201f31;
    --accent: #8f83ff; --accent2: #d77bff; --shadow: 0 1px 2px #0006, 0 10px 30px #0005; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0d16; --bg2: #14131f; --card: #181726; --fg: #ecebf7; --muted: #9c99b8; --line: #2a2840; --soft: #201f31;
  --accent: #8f83ff; --accent2: #d77bff; --shadow: 0 1px 2px #0006, 0 10px 30px #0005; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; }
pre { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow: auto; margin: 8px 0; white-space: pre; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 15px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--fg); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 15px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: var(--muted); padding: 6px 11px; border-radius: 9px; font-weight: 550; white-space: nowrap; }
.nav a:hover { background: var(--soft); color: var(--fg); text-decoration: none; }
.nav a.on { color: var(--fg); background: var(--soft); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }

/* buttons and inputs */
button, .btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 11px; padding: 8px 14px; cursor: pointer; background: var(--accent); color: var(--accent-fg); display: inline-flex; align-items: center; gap: 7px; transition: transform .06s, filter .15s, background .15s; text-decoration: none; }
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
button.ghost, .btn.ghost { background: var(--card); color: var(--fg); border-color: var(--line); }
button.ghost:hover, .btn.ghost:hover { background: var(--soft); }
button.danger { background: var(--bad); }
button.link { background: none; color: var(--accent); padding: 4px 6px; }
button.sm, .btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
button.grad, .btn.grad { background: var(--grad); }
input, textarea, select { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; outline: none; min-width: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; }
label.field { display: grid; gap: 5px; font-weight: 550; font-size: 13px; color: var(--muted); }
label.field input, label.field textarea { color: var(--fg); font-weight: 400; font-size: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: grid; gap: 12px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.section { margin-top: 30px; }
.section > h2 { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile .v { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--muted); font-size: 13px; font-weight: 550; }

/* app cards */
.appcard { display: grid; gap: 10px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; color: var(--fg); }
.appcard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); text-decoration: none; }
.appcard .head { display: flex; align-items: center; gap: 10px; }
.appicon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: 16px; }
.appcard .name { font-weight: 700; }
.appcard .url { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { width: 100%; height: 38px; display: block; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 48px 40px; background: radial-gradient(1200px 400px at 80% -10%, color-mix(in srgb, var(--accent2) 30%, transparent), transparent), radial-gradient(900px 400px at 0% 120%, color-mix(in srgb, var(--accent) 32%, transparent), transparent), var(--card); border: 1px solid var(--line); }
.hero h1 { font-size: 44px; max-width: 760px; letter-spacing: -0.035em; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; margin: 10px 0 22px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flow { width: 100%; height: auto; margin-top: 26px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step .n { width: 28px; height: 28px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 8px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tabs a { padding: 9px 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.on { color: var(--fg); border-color: var(--accent); }
.apphead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.apphead .appicon { width: 52px; height: 52px; border-radius: 15px; font-size: 22px; }

/* map */
.map { width: 100%; height: auto; display: block; }
.map text { font: 600 12.5px Inter, system-ui, sans-serif; fill: var(--fg); }
.map .lab { font: 700 11px Inter, system-ui, sans-serif; fill: var(--muted); letter-spacing: .06em; }
.map .sub { font: 500 11px Inter, system-ui, sans-serif; fill: var(--muted); }
.map .edge { fill: none; stroke-width: 1.6; opacity: .7; }
.map .flowing { stroke-dasharray: 5 6; animation: flow 1.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }

/* deploy timeline */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 26px 1fr; gap: 12px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; }
.tl .rail .b { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--card); outline: 2px solid var(--line); background: var(--muted); margin-top: 16px; }
.tl .rail .b.live { background: var(--good); outline-color: color-mix(in srgb, var(--good) 40%, transparent); }
.tl .rail .b.failed { background: var(--bad); }
.tl .rail .l { flex: 1; width: 2px; background: var(--line); }
.tl .body { padding: 10px 0 14px; border-bottom: 1px dashed var(--line); }
.stepchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* tables */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 520px; }
table.data { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--soft); text-align: left; font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
table.data tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.side { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.list { display: grid; gap: 4px; }
.list a, .list button.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--fg); background: none; border: 0; font-weight: 550; text-align: left; width: 100%; }
.list a:hover, .list button.item:hover { background: var(--soft); text-decoration: none; filter: none; }
.list .on { background: var(--soft); }

/* logs */
.log { display: grid; grid-template-columns: 70px 80px 1fr 60px; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: start; }
.log pre { margin: 4px 0 0; font-size: 12px; padding: 8px; max-height: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 99px; background: var(--soft); color: var(--muted); border: 1px solid transparent; cursor: pointer; }
.chip.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* charts */
.chart { width: 100%; height: 150px; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: var(--accent2); }
.chart text { font: 500 10.5px Inter, system-ui; fill: var(--muted); }

/* personas */
.persona { display: grid; gap: 10px; }
.ring { width: 54px; height: 54px; flex: none; }
.issue { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.issue:last-child { border: 0; }

/* market */
.item { display: grid; gap: 8px; cursor: pointer; transition: transform .12s, border-color .12s; }
.item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.item .desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kind { font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.k-component { color: #2f86eb; } .k-helper { color: #18a058; } .k-function { color: #d98a00; } .k-template { color: #c04bf2; } .k-technology { color: #e0445a; }

/* drawer */
.scrim { position: fixed; inset: 0; background: #0b0a1499; backdrop-filter: blur(3px); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
.drawer { width: min(720px, 100%); height: 100%; overflow: auto; background: var(--bg); border-left: 1px solid var(--line); padding: 26px; animation: slide .2s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.modal { margin: auto; width: min(520px, 94vw); max-height: 90vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 24px; animation: fade .15s; }

/* preview frame */
.frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.frame .bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.frame .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.frame iframe { width: 100%; height: 460px; border: 0; display: block; background: #fff; }
.frame.phone { width: 390px; max-width: 100%; margin: 0 auto; border-radius: 28px; }
.frame.phone iframe { height: 640px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 99; box-shadow: var(--shadow); animation: fade .2s; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.two > *, .stack > *, .side > * { min-width: 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--muted); }
.copy { position: relative; }
.copy button { position: absolute; top: 6px; right: 6px; }
.doc { max-width: 820px; }
.doc h1 { font-size: 30px; } .doc h2 { margin-top: 30px; font-size: 21px; } .doc p, .doc li { line-height: 1.65; }
.switch { position: relative; width: 40px; height: 23px; border-radius: 99px; background: var(--line); border: 0; padding: 0; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px #0003; }
.switch.on { background: var(--good); }
.switch.on::after { left: 20px; }
input[type=range] { accent-color: var(--accent); padding: 0; border: 0; }

@media (max-width: 860px) {
  .two, .side { grid-template-columns: 1fr; }
  .hero { padding: 30px 20px; } .hero h1 { font-size: 32px; }
  main { padding: 20px 16px 60px; }
  .top { padding: 10px 16px; gap: 10px; }
  .log { grid-template-columns: 60px 1fr; } .log .hide-sm { display: none; }
}
