:root {
  color-scheme: light;
  --page: #eef1f4;
  --card: #f6f8fa;
  --surface: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e3e7ec;
  --grid: rgba(17, 24, 39, 0.045);
  --soft: #e7eaee;
  --ok: #15803d;
  --bad: #b91c1c;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 40px 16px;
  font: 16px/1.55 Roboto, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--page);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
}

a { color: inherit; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 1px 5px; border-radius: 5px; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.inline { width: 1em; height: 1em; vertical-align: -0.15em; }

/* Card */
.card {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 24px 60px -20px rgba(17, 24, 39, .18);
  padding: 0 clamp(16px, 6vw, 72px) 24px;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  transition: max-width .25s ease;
}
.card.wide { max-width: 1480px; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 32px 0 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 30px/1 Inter, sans-serif; letter-spacing: -.02em; }
.logo-mark { height: 52px; width: auto; display: block; margin: -6px 0; }
.links { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.links > a { text-decoration: none; color: var(--ink-2); font-size: 17px; }
.links > a:hover, .links > a[aria-current="page"] { color: var(--ink); }
.links > a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; background: #dcfce7; color: var(--ok) !important; font-size: 14px !important; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; padding: 10px 18px; font: 500 16px Roboto, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #1f2937; }
.btn.light { background: var(--soft); color: var(--ink); }
.btn.light:hover { background: #dde1e6; }
.btn.big { padding: 15px 26px; font-size: 19px; }
.btn.small { padding: 6px 12px; font-size: 14px; gap: 6px; }
.btn.small .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: default; }

/* Views */
.view { flex: 1; }
.home { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 0 0; }
.guides { position: absolute; inset: 0 0 auto; height: 100%; pointer-events: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: linear-gradient(90deg, transparent calc(10% - 1px), var(--line) 10%, transparent calc(10% + 1px), transparent calc(90% - 1px), var(--line) 90%, transparent calc(90% + 1px)); opacity: .6; z-index: 0; }
.home > *:not(.guides) { position: relative; z-index: 1; }
.wordmark { font: 800 clamp(48px, 9vw, 104px)/1 Inter, sans-serif; letter-spacing: -.035em; margin: 0; white-space: nowrap; }
.tld { color: #9ca3af; font-weight: 700; }
.powered { margin: 10px 0 44px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-size: 20px; }

/* Omnibox */
.omnibox { width: min(100%, 680px); display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid #d9dde3; border-radius: 99px; padding: 6px 6px 6px 18px; box-shadow: 0 10px 30px -12px rgba(17, 24, 39, .22); }
.omnibox:focus-within { border-color: #9ca3af; }
.omnibox .lead { width: 22px; height: 22px; color: var(--muted); }
.omnibox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 19px Roboto, sans-serif; color: var(--ink); padding: 10px 4px; }
.omnibox input::placeholder { color: #9ca3af; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: #eef0f3; color: var(--ink-2); flex: none; }
.round.mic { background: transparent; }
.round:hover { background: #e2e5ea; }
.round[aria-pressed="true"], .round.listening { background: var(--ink); color: #fff; }
.round.listening { animation: pulse 1.2s infinite; }
.omnibox.compact { box-shadow: none; border-radius: 10px; padding: 2px 12px; flex: 1; width: auto; }
.omnibox.compact input { font-size: 16px; padding: 9px 4px; }

.hint { min-height: 1.6em; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.hint.error { color: var(--bad); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Code / terminal panels */
.runner { width: min(100%, 680px); margin-top: 8px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.runner-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.runner textarea { display: block; width: 100%; min-height: 150px; resize: vertical; border: 0; outline: 0; padding: 14px; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--surface); }
.output { margin: 0; padding: 14px; max-height: 300px; overflow: auto; background: #0f172a; color: #e5e7eb; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.output .err { color: #fca5a5; }
.output .cmd { color: #93c5fd; }
.output .meta { color: #94a3b8; }

.tagline { margin: 40px 0 0; font-size: clamp(20px, 2.4vw, 27px); line-height: 1.35; max-width: 19em; color: var(--ink); }
.cta { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; justify-content: center; }

.strip { list-style: none; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin: 88px 0 0; padding: 22px 0; width: 100%; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 18px; color: var(--ink-2); }
.strip li { display: flex; align-items: center; gap: 12px; }
.strip li + li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #cbd0d6; margin-right: 16px; }
.chip { width: 38px; height: 38px; border-radius: 8px; background: var(--soft); display: inline-grid; place-items: center; color: var(--ink-2); flex: none; }

.foot { text-align: right; color: var(--muted); font-size: 14px; padding-top: 28px; }

/* Browser view */
.browse { display: flex; flex-direction: column; padding-top: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.browse .hint { margin-top: 8px; }
.nav-buttons { display: flex; gap: 4px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.keyboard-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.keyboard-row input { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font: 15px Roboto, sans-serif; color: var(--ink); background: var(--surface); outline: 0; }
.keyboard-row input:focus { border-color: #9ca3af; }
.bar-status { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bar-extras { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: #e0f2fe; color: #075985; }
.time-left { color: var(--muted); }
.time-left.low { color: var(--bad); font-weight: 500; }
.bar-status .hint { margin: 8px 0 0; }
.linkish { border: 0; background: none; padding: 0; font: 14px Roboto, sans-serif; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--ink); }
.linkish:disabled { opacity: .5; cursor: default; }
.stage { flex: 1; display: flex; gap: 16px; min-height: 0; }
.screen { flex: 1; min-height: min(72vh, 820px); border-radius: var(--radius); overflow: hidden; background: #0b0f17; display: flex; }
.screen { position: relative; }
.screen iframe { flex: 1; border: 0; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--surface); color: var(--ink-2); font-size: 18px; }
.spinner.big { width: 44px; height: 44px; border-width: 4px; margin: 0; }
.sidebar { width: 340px; flex: none; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; overflow-y: auto; height: min(72vh, 820px); }
.sidebar h3, .sidebar summary { margin: 6px 0 8px; font: 500 12px Roboto, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sidebar h3 { display: flex; align-items: center; gap: 6px; }
.sidebar h3 .ic { width: 16px; height: 16px; }
.sidebar summary { cursor: pointer; }
.sidebar ul { list-style: none; margin: 0 0 8px; padding: 0; }

/* Agent chat */
.chat { flex: 1; min-height: 260px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 10px; }
/* Items keep their natural size so the log scrolls; shrinking squeezed text to one letter per line. */
.chat-log > * { flex: none; min-width: 0; }
.chat-log p { margin: 0; }
.msg { padding: 8px 11px; border-radius: 12px; line-height: 1.45; overflow-wrap: break-word; }
.msg.user { white-space: pre-wrap; }
.msg p { margin: 0 0 6px; } .msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 4px 0 6px; padding-left: 18px; }
.sidebar .msg li { padding: 1px 0; border: 0; }
.msg a { color: inherit; }
.msg.user { align-self: flex-end; max-width: 88%; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; max-width: 95%; background: var(--soft); border-bottom-left-radius: 4px; }
.msg.error { background: #fee2e2; color: var(--bad); }
.steps { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.sidebar .steps li { position: relative; display: block; padding: 0 0 0 14px; border: 0; overflow-wrap: break-word; }
.steps li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: #cbd0d6; }
.steps li.note { font-style: italic; color: var(--ink-2); }
.steps li.note::before { background: transparent; }
.steps li.live::before { background: var(--ok); animation: pulse 1.2s infinite; }
.chat-form { display: flex; flex-direction: column; gap: 8px; }
.chat-form textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: 14px/1.4 Roboto, sans-serif; color: var(--ink); background: var(--surface); outline: 0; }
.chat-form textarea:focus { border-color: #9ca3af; }
.chat-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sidebar li { padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; border: 1px solid currentColor; margin-left: 4px; }
.tag.safe { color: var(--ok); } .tag.blocked { color: var(--bad); } .tag.checking { color: var(--muted); }
.sidebar .btn { margin-top: 6px; }

/* Pages */
.page { padding: 48px 0 24px; }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.page h2 { font: 800 clamp(30px, 4vw, 44px)/1.15 Inter, sans-serif; letter-spacing: -.02em; margin: 10px 0 14px; max-width: 22em; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 40em; margin: 0 0 36px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature, .plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3, .plan h3 { margin: 14px 0 6px; font: 700 19px Inter, sans-serif; }
.feature p { margin: 0; color: var(--ink-2); }
.sub { font: 700 22px Inter, sans-serif; margin: 40px 0 12px; }

.api { display: grid; gap: 14px; }
.endpoint { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.endpoint > code:not(.verb) { background: none; font-size: 16px; font-weight: 600; }
.endpoint p { margin: 8px 0 0; color: var(--ink-2); }
.verb { font-size: 12px !important; font-weight: 700; margin-right: 8px; padding: 2px 7px; }
.verb.post { background: #dbeafe; color: #1d4ed8; } .verb.get { background: #dcfce7; color: #15803d; } .verb.del { background: #fee2e2; color: #b91c1c; }
pre.code { margin: 12px 0 0; padding: 14px 16px; background: #0f172a; color: #e5e7eb; border-radius: 10px; overflow-x: auto; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }

.docs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 40px; margin-top: 24px; }
.toc { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--line); padding-left: 14px; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover, .toc a.active { color: var(--ink); }
.doc { max-width: 42em; }
.doc h3 { font: 700 22px Inter, sans-serif; margin: 0 0 8px; scroll-margin-top: 24px; }
.doc h3:not(:first-child) { margin-top: 36px; }
.doc p, .doc li { color: var(--ink-2); }

.plan { display: flex; flex-direction: column; }
.plan.featured { border-color: var(--ink); box-shadow: 0 12px 30px -16px rgba(17, 24, 39, .35); }
.plan .price { font: 800 40px Inter, sans-serif; margin: 6px 0 2px; }
.plan .price small { font: 400 16px Roboto, sans-serif; color: var(--muted); }
.plan ul { padding-left: 20px; color: var(--ink-2); flex: 1; }
.plan .btn { justify-content: center; }

/* Toast and dialog */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); z-index: 10; }
dialog { border: 0; border-radius: 16px; padding: 24px 28px; max-width: 440px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(17, 24, 39, .35); }
dialog h3 { margin: 0 0 8px; font: 700 22px Inter, sans-serif; }
dialog ul { padding-left: 20px; color: var(--ink-2); }

@media (max-width: 800px) {
  body { padding: 16px 8px; }
  .card { padding: 0 16px 16px; border-radius: 16px; }
  .links { gap: 14px 18px; }
  .links > a { font-size: 15px; }
  .home { padding-top: 40px; }
  .powered { margin-bottom: 28px; font-size: 16px; }
  .round { width: 40px; height: 40px; }
  .omnibox input { font-size: 16px; }
  .strip { margin-top: 56px; font-size: 16px; }
  .strip li + li::before { display: none; }
  .stage { flex-direction: column; }
  .screen { min-height: 60vh; }
  .sidebar { width: auto; height: auto; }
  .chat { min-height: 320px; }
  .docs-layout { grid-template-columns: 1fr; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; border-left: 0; padding-left: 0; gap: 6px 14px; }
}
