/* TossInbox site styles — shared by every page (index, quickstart, cli, agents, faq, 404)
   Design language: terminal-native. Flat 1px borders, monospace structure, one green accent.
   No blur, no gradients, no display webfonts. It should read like something written by a
   person who ships CLI tools — not assembled from a landing-page template. */

/* layout modifiers (kept class-based so the strict CSP never sees inline styles) */
.sec-lead--changelog { margin-top: 32px; margin-bottom: 12px; }
.codeblock--spaced { margin-top: 20px; }
.wrap--footer { padding-bottom: 44px; }

:root {
  --bg: #0b0e14;
  --panel: #10141d;
  --panel-2: #151b27;
  --border: #232b3b;
  --border-soft: #1a212e;
  --border-strong: #3d4759;
  --text: #e8edf4;
  --muted: #96a0b5;
  --faint: #838da0;
  --accent: #34d399;
  --accent-dim: #2aa87a;
  --amber: #fbbf24;
  --sky: #7dd3fc;
  --term-bg: #0d1118;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 4px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #052e1f; }
main { flex: 1 0 auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 0 0 var(--radius) 0; }
.skip:focus { left: 0; }
code, pre { font-family: var(--mono); }
code { font-size: 0.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* structure speaks monospace; paragraphs stay sans for readability */
h1, h2, h3, .brand, .btn, .chip, .eyebrow, .nav-links a, .end-line,
.il-label, .crumbs, .pager a, .tbl th, .tbl-caption, .code-head,
.copy-btn, .copy-chip, .term-bar .title, .term-bar .term-dim, .flag b,
.foot-links a, .foot-exit, .ls-cmd, .ls-name {
  font-family: var(--mono);
}
.accent { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}
nav .wrap { display: flex; align-items: center; gap: 24px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.brand img { width: 24px; height: 24px; border-radius: var(--radius); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); font-size: 13px; padding: 6px 9px; border-radius: var(--radius); }
.nav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.nav-links a.nav-gh {
  border: 1px solid var(--border-strong); padding: 5px 12px; border-radius: var(--radius);
  color: var(--text); margin-left: 8px;
}
.nav-links a.nav-gh:hover { border-color: var(--faint); background: var(--panel-2); }

/* ---------- hero (index only) ---------- */
.hero { padding: 72px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero .wrap > div { min-width: 0; }
@media (max-width: 880px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } .hero { padding: 48px 0 40px; } }
.eyebrow { font-size: 13px; color: var(--accent); margin-bottom: 18px; }
h1 {
  font-size: clamp(30px, 4.6vw, 47px); line-height: 1.16; letter-spacing: -0.02em;
  font-weight: 700;
}
h1 .accent { color: var(--accent); }
h1 .dim { color: var(--accent); animation: cursor-blink 1.15s step-end infinite; }
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } h1 .dim { animation: none; } }
.hero-sub { color: var(--muted); font-size: 17px; margin-top: 20px; max-width: 480px; }
.hero-sub b { color: var(--text); font-weight: 600; }
.install-inline {
  display: flex; align-items: center; gap: 0; margin-top: 26px; max-width: 470px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--term-bg); overflow: hidden;
}
.install-inline code { flex: 1; padding: 12px 16px; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow-x: auto; }
.install-inline code .dollar { color: var(--faint); }
.copy-btn {
  background: var(--panel-2); border: none; border-left: 1px solid var(--border-strong);
  color: var(--muted); padding: 12px 14px; cursor: pointer; font-size: 12px;
  flex-shrink: 0; min-height: 44px;
}
.copy-btn:hover { color: var(--accent); }
.install-inline .dollar { user-select: none; -webkit-user-select: none; }
/* hero package switch: brew / npx radio tabs, pure CSS, CSP-safe (no JS) */
.inst-switch { margin-top: 26px; max-width: 470px; }
.inst-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.inst-switch label {
  display: inline-block; font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0; padding: 6px 14px 7px; margin-right: 6px; cursor: pointer;
}
.inst-switch label:hover { color: var(--text); }
.inst-switch input:checked + label { color: var(--accent); background: var(--term-bg); border-color: var(--border-strong); }
.inst-switch input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.inst-switch .install-inline { display: none; margin-top: 0; }
.inst-switch input#inst-brew:checked ~ div.install-inline:nth-of-type(1),
.inst-switch input#inst-npx:checked ~ div.install-inline:nth-of-type(2) { display: flex; }
/* unified code block: label + copy in a header bar, code below (a button never covers code) */
.codeblock {
  background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.code-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 8px 7px 14px; background: var(--panel); border-bottom: 1px solid var(--border-soft);
  font-size: 12px; color: var(--faint);
}
.copy-chip {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); padding: 4px 12px; cursor: pointer; font-size: 11.5px;
  flex-shrink: 0; min-height: 28px;
}
.copy-chip:hover { color: var(--accent); border-color: var(--border-strong); }
.codeblock > pre.block { border: none; border-radius: 0; margin: 0; }
.tbl tbody td.prop { white-space: normal; color: var(--muted); }
.cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: var(--radius); font-weight: 600; font-size: 13.5px;
}
.btn-primary { background: var(--accent); color: #052e1f; }
.btn-primary:hover { text-decoration: none; background: var(--accent-dim); color: #052e1f; }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { text-decoration: none; border-color: var(--faint); }

/* status tags: literal bracket tokens, the way a prompt would print them */
.trust { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 44px; }
.chip { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chip::before { content: "["; color: var(--border-strong); margin-right: 6px; }
.chip::after { content: "]"; color: var(--border-strong); margin-left: 6px; }
a.chip:hover { color: var(--accent); text-decoration: none; }
a.chip:hover::before, a.chip:hover::after { color: var(--accent); }

.end-line { font-size: clamp(19px, 2.6vw, 25px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }

/* terminal window: chrome recedes, output leads. monochrome dots on purpose */
.term {
  background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; font-size: 14px;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft); background: var(--panel);
}
.term-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.term-bar .title { margin-left: 8px; color: var(--faint); font-size: 12px; }
.term-bar .term-dim { margin-left: auto; color: var(--faint); font-size: 11.5px; }
.term-body { padding: 18px 20px; line-height: 1.75; overflow-x: auto; }
.term-body .p { color: var(--faint); user-select: none; }
.term-body .cmd { color: var(--text); }
.term-body .ok { color: var(--accent); }
.term-body .lab { color: var(--muted); }
.term-body .val { color: var(--text); }
.term-body .code-out { color: var(--amber); font-weight: 600; }
.term-body .comment { color: var(--faint); }

/* ---------- doc pages (subpages share this header pattern) ---------- */
.page-head { padding: 48px 0 40px; }
.page-head h1 { font-size: clamp(28px, 4vw, 38px); }
.page-lead { color: var(--muted); font-size: 17px; margin-top: 14px; max-width: 660px; }
.page-lead b { color: var(--text); font-weight: 600; }
.page-lead code { background: var(--panel-2); padding: 2px 7px; border-radius: var(--radius); color: var(--text); }
/* links inside a text block must be distinguishable without color alone (axe: link-in-text-block) */
.note a, .tbl-caption a, .answer a, .page-lead a, .crumbs a, .foot-legal a { text-decoration: underline; text-underline-offset: 3px; }
.crumbs { font-size: 12px; color: var(--faint); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 7px; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0 8px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.pager a { font-size: 14px; }
.pager .dir { color: var(--faint); margin-right: 6px; }
.pager .next .dir { margin-right: 0; margin-left: 6px; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- sections ---------- */
section { padding: 56px 0; border-top: 1px solid var(--border-soft); scroll-margin-top: 76px; }
/* every section reads like a markdown heading */
h2 { font-size: 21px; letter-spacing: -0.01em; font-weight: 700; margin-bottom: 10px; }
h2::before { content: "## "; color: var(--accent); }
.sec-lead { color: var(--muted); max-width: 660px; margin-bottom: 28px; }
.sec-lead b { color: var(--text); font-weight: 600; }

pre.block {
  background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; color: var(--text);
  position: relative;
}
pre.block .c { color: var(--faint); }
pre.block .a { color: var(--accent); }
pre.block .k { color: var(--sky); }
pre.block .s { color: var(--amber); }

.install-list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.il-row { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; }
.il-row + .il-row { border-top: 1px solid var(--border-soft); }
.il-label { font-size: 12.5px; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.il-label em { font-style: normal; color: var(--faint); font-size: 11.5px; font-family: var(--sans); }
.il-row code { font-size: 14px; color: var(--text); white-space: nowrap; overflow-x: auto; }
.il-note { grid-column: 2; justify-self: start; font-size: 12.5px; color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--border); }
.il-note:hover { color: var(--text); border-bottom-color: var(--muted); }
.note { color: var(--faint); font-size: 14px; margin-top: 14px; }
.note code { color: var(--muted); font-size: 13px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); font-weight: 600; padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td:first-child { white-space: nowrap; }
.tbl code { background: var(--panel-2); padding: 2px 7px; border-radius: var(--radius); color: var(--text); white-space: nowrap; }
.tbl .desc { color: var(--muted); white-space: normal; }
.tbl .desc code { white-space: normal; overflow-wrap: anywhere; }
/* comparison table: lift our own column so the win reads at a glance */
.tbl--vs th:nth-child(2) { color: var(--accent); border-bottom-color: var(--accent-dim); }
.tbl--vs td:nth-child(2) { background: rgba(52, 211, 153, 0.05); }
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; background: var(--panel); }
.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }
.tbl-caption { font-size: 14px; color: var(--faint); margin: 8px 4px 0; }

.flag { color: var(--muted); }
.flag b { color: var(--text); font-weight: 600; font-size: 13px; }

/* short fact list (answer-engine extractable capabilities) */
ul.facts { list-style: none; max-width: 680px; margin: 0 0 30px; padding: 0; display: grid; gap: 10px; }
ul.facts li { color: var(--muted); font-size: 14.5px; line-height: 1.65; padding-left: 24px; position: relative; }
ul.facts li::before { content: "→"; position: absolute; left: 0; top: 0; color: var(--accent); font-family: var(--mono); }
ul.facts code { background: var(--panel-2); padding: 2px 7px; border-radius: var(--radius); color: var(--text); font-size: 13px; white-space: nowrap; }

/* agent flow */
.agent-flow {
  background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; font-size: 13.5px; line-height: 1.8; color: var(--muted); overflow-x: auto;
}
.agent-flow b { color: var(--text); font-weight: 600; }
.agent-flow .tool { color: var(--accent); font-family: var(--mono); font-size: 12.5px; }

/* faq */
details {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  margin-bottom: 10px; overflow: hidden;
}
details summary {
  cursor: pointer; padding: 15px 18px; font-weight: 600; font-size: 15px; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary:hover { background: var(--panel-2); }
details summary::after { content: "+"; color: var(--accent); font-family: var(--mono); font-size: 17px; }
details[open] summary::after { content: "−"; }
details[open] summary { border-bottom: 1px solid var(--border-soft); }
details .answer { padding: 14px 18px; color: var(--muted); font-size: 14.5px; max-width: 70ch; }
details .answer code { background: var(--panel-2); padding: 2px 6px; border-radius: var(--radius); color: var(--text); font-size: 13px; }

/* ---------- docs directory (index): the site as an ls listing ---------- */
.ls-dir {
  background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; font-size: 13.5px; line-height: 2.05; overflow-x: auto;
}
.ls-cmd { color: var(--faint); user-select: none; -webkit-user-select: none; margin-bottom: 4px; }
.ls-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: baseline; }
.ls-name a { color: var(--accent); }
.ls-desc { color: var(--muted); font-family: var(--sans); font-size: 14px; }
@media (max-width: 640px) { .ls-row { grid-template-columns: 1fr; gap: 0; } .ls-desc { padding-bottom: 6px; } }

/* footer */
footer { border-top: 1px solid var(--border-soft); padding: 26px 0 40px; color: var(--faint); font-size: 14px; margin-top: auto; flex-shrink: 0; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.foot-links { display: inline-flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
.foot-exit { font-size: 13px; }

/* ---------- small screens (kept last so overrides always win) ---------- */
@media (max-width: 760px) {
  /* nav becomes a single scrollable strip: all pages reachable, no hamburger JS */
  nav .wrap { height: auto; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 0; }
  .nav-links { margin-left: 0; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 10px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; flex-shrink: 0; }
  .install-inline { flex-direction: column; align-items: stretch; }
  .install-inline code { white-space: pre-wrap; word-break: break-all; font-size: 12.5px; }
  .install-inline .copy-btn { border-left: none; border-top: 1px solid var(--border-strong); padding: 10px; }
  .il-row { grid-template-columns: 1fr auto; }
  .il-row code { grid-column: 1 / -1; grid-row: 2; white-space: normal; word-break: break-all; }
}
