/* ============================================================
   TestZeus Docs — design port of the approved mock
   Light theme, Manrope, blue #2563EB, dark code blocks.
   Applies on top of Shibuya; safe if a selector is absent.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --tz-bg: #ffffff;
  --tz-surface: #f6f8fb;
  --tz-surface-2: #eef2f8;
  --tz-sidebar: #fbfcfe;
  --tz-text: #0f172a;
  --tz-muted: #5b6678;
  --tz-faint: #94a3b8;
  --tz-border: #e6e9f0;
  --tz-border-strong: #d4dae6;
  --tz-primary: #2563EB;
  --tz-primary-ink: #1d4ed8;
  --tz-primary-wash: #eef3ff;
  --tz-accent: #0ea5b7;
  --tz-code-bg: #0d1428;
  --tz-code-text: #e6ecf8;
  --tz-code-faint: #7e8db0;
  --tz-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06);
  --tz-shadow-lg: 0 12px 48px rgba(15,23,42,.12);
  --tz-card: #ffffff;
  font-size: 16px;
}

/* ---- dark mode: softer layered slate surfaces (not near-black) ---- */
html.dark {
  --tz-bg: #111827;
  --tz-surface: #1f2937;
  --tz-surface-2: #374151;
  --tz-sidebar: #0e1522;
  --tz-text: #e7eaf1;
  --tz-muted: #aeb7c6;
  --tz-faint: #8792a3;
  --tz-border: #2a3444;
  --tz-border-strong: #3b4657;
  --tz-primary: #6b9bff;
  --tz-primary-wash: rgba(107,155,255,.16);
  --tz-card: #1f2937;
  --sy-c-background: #111827;
  --sy-c-surface: #1f2937;
}
html.dark .sy-head, html.dark header[class*="head"] { background: rgba(20,22,27,.85); }
html.dark article p > code, html.dark article li code,
html.dark article td code, html.dark article th code { color: #b9ccff; }

/* ---- typography ---- */
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--tz-text);
}
h1,h2,h3,h4,h5,h6 { font-family: 'Manrope', sans-serif; letter-spacing: -0.02em; color: var(--tz-text); }
code, pre, kbd, samp { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
::selection { background: rgba(37,99,235,.22); }

article { line-height: 1.62; }
article h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.08; margin-bottom: .5em; letter-spacing: -0.035em; }
article h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: .7rem; letter-spacing: -0.02em; }
article h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4rem; }
article p, article li { margin-block: .55em; color: var(--tz-text); }

/* ---- logo ---- */
.light-logo, .dark-logo { height: 36px; }

/* ---- header: sticky, translucent, tab-style links ---- */
.sy-head, header[class*="head"] {
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--tz-border);
}
.sy-head-links ul { gap: .35rem; }
.sy-head-links .link > a, .sy-head-links .link > button {
  padding: .42rem .9rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: .85rem;
  color: var(--tz-muted);
  transition: background .15s, color .15s;
}
.sy-head-links .link > a:hover { background: var(--tz-surface-2); color: var(--tz-text); }
.sy-head-links .link.current > a, .sy-head-links .link > a.current {
  background: var(--tz-primary-wash);
  color: var(--tz-primary);
}

/* ---- sidebar: soft panel, pill items, blue current-page bar ---- */
.tz-side, aside:has(li.toctree-l1) {
  background: var(--tz-sidebar);
  border-right: 1px solid var(--tz-border);
}
.tz-side p.caption, aside p.caption {
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tz-faint);
  padding: 0 .6rem;
  margin-top: 1.2rem;
}
li.toctree-l1 > a.reference {
  position: relative;
  display: flex;
  align-items: center;
  font-size: .875rem;
  font-weight: 600;
  color: var(--tz-muted);
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  padding: .48rem .6rem .48rem 2rem;   /* left space reserved for the injected icon (no shift) */
  transition: background .14s, color .14s;
}
li.toctree-l1 > a.reference:hover { background: var(--tz-surface-2); color: var(--tz-text); }
li.toctree-l1.current > a.reference, li.toctree-l1 > a.current {
  background: var(--tz-primary-wash);
  color: var(--tz-primary);
  font-weight: 800;
  border-left-color: var(--tz-primary);
}
.tz-ico { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); display: inline-flex; width: 17px; color: var(--tz-faint); }
li.toctree-l1.current .tz-ico, li.toctree-l1 > a.current .tz-ico { color: var(--tz-primary); }

/* "Need an account?" card (injected by docs.js) */
.tz-account {
  margin: 1.6rem .6rem 0;
  padding: .9rem;
  border: 1px solid var(--tz-border);
  border-radius: 12px;
  background: var(--tz-surface);
}
.tz-account b { display: block; font-size: .82rem; font-weight: 800; margin-bottom: .25rem; }
.tz-account p { font-size: .78rem; color: var(--tz-muted); line-height: 1.5; margin: 0 0 .6rem; }
.tz-account a { font-size: .78rem; font-weight: 700; color: var(--tz-primary); text-decoration: none; }

/* ---- content sections as cards (reference pages) ---- */
.sy-main article > section > section {
  border: 1px solid var(--tz-border);
  border-radius: 14px;
  padding: 1.3rem 1.6rem 1.5rem;
  margin: 1.4rem 0;
  background: var(--tz-card);
  transition: box-shadow .15s, border-color .15s;
}
.sy-main article > section > section:hover { box-shadow: var(--tz-shadow); border-color: var(--tz-border-strong); }
.sy-main article > section > section > h2:first-child,
.sy-main article > section > section > h3:first-child { margin-top: .15rem; }

/* ---- sphinx-design cards ---- */
.sd-card {
  border-radius: 16px;
  border: 1px solid var(--tz-border);
  box-shadow: var(--tz-shadow);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.sd-card:hover {
  box-shadow: var(--tz-shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(37,99,235,.45);
}
.sd-card-body { padding: 1.2rem 1.3rem; }
.sd-card-title { font-size: 1.02rem; font-weight: 800; }
.sd-btn-primary, .sd-btn-primary:hover {
  background: linear-gradient(180deg, var(--tz-primary), var(--tz-primary-ink));
  border: 0;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(37,99,235,.38);
}

/* ---- tables ---- */
article table {
  border: 1px solid var(--tz-border);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  width: 100%;
}
article table thead th { background: var(--tz-surface); font-weight: 700; }
article table th, article table td { border-bottom: 1px solid var(--tz-surface-2); padding: .5rem .8rem; text-align: left; }
article table tbody tr:last-child td { border-bottom: 0; }

/* ---- inline code ---- */
article p > code, article li code, article td code, article th code {
  background: var(--tz-primary-wash);
  color: var(--tz-primary-ink);
  border-radius: 6px;
  padding: .12em .4em;
  font-size: .9em;
}
article h1 code, article h2 code, article h3 code { background: transparent; color: inherit; }

/* ---- code blocks: LIGHT by default, dark navy only in dark mode ---- */
div.highlight, .highlight {
  background: var(--tz-surface);
  border: 1px solid var(--tz-border);
  border-radius: 13px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.highlight pre {
  background: transparent;
  border-radius: 13px;
  padding: 1rem 1.1rem;
  font-size: .82rem;
  line-height: 1.65;
}
/* light-mode syntax colors come from Shibuya's default pygments (good contrast on light) */

/* dark mode: navy blocks + bright token palette (the mock's dark code) */
html.dark div.highlight, html.dark .highlight {
  background: var(--tz-code-bg);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 1px 3px rgba(15,23,42,.18);
}
html.dark .highlight pre { background: var(--tz-code-bg); color: var(--tz-code-text); }
html.dark .highlight .c, html.dark .highlight .c1, html.dark .highlight .cm, html.dark .highlight .ch, html.dark .highlight .cs { color: var(--tz-code-faint); font-style: italic; }
html.dark .highlight .k, html.dark .highlight .kd, html.dark .highlight .kn, html.dark .highlight .kc, html.dark .highlight .kt, html.dark .highlight .ow { color: #82aaff; }
html.dark .highlight .s, html.dark .highlight .s1, html.dark .highlight .s2, html.dark .highlight .sb, html.dark .highlight .sd, html.dark .highlight .se, html.dark .highlight .si { color: #9ece6a; }
html.dark .highlight .m, html.dark .highlight .mi, html.dark .highlight .mf, html.dark .highlight .mh { color: #f78c6c; }
html.dark .highlight .nf, html.dark .highlight .fm, html.dark .highlight .nd { color: #7dd3fc; }
html.dark .highlight .nb, html.dark .highlight .bp, html.dark .highlight .na { color: #ffcb6b; }
html.dark .highlight .nt, html.dark .highlight .nc, html.dark .highlight .nn { color: #7dd3fc; }
html.dark .highlight .o, html.dark .highlight .p, html.dark .highlight .pm { color: #89ddff; }
html.dark .highlight .n, html.dark .highlight .nx, html.dark .highlight .nv { color: var(--tz-code-text); }
html.dark .highlight .gp { color: var(--tz-code-faint); }
html.dark .highlight .err { color: #ff8b8b; border: 0; }
/* copy button: dark styling only in dark mode */
html.dark button.copybtn { background: rgba(255,255,255,.08); border: 0; border-radius: 7px; opacity: .55; }
html.dark button.copybtn:hover { background: rgba(255,255,255,.16); opacity: 1; }
html.dark button.copybtn svg { stroke: #cdd7ee; }

/* ---- admonitions / tips ---- */
.admonition {
  border-radius: 13px;
  border: 1px solid rgba(37,99,235,.20);
  background: var(--tz-primary-wash);
  box-shadow: none;
}
.admonition.tip, .admonition.hint { border-color: rgba(14,165,183,.28); background: rgba(14,165,183,.07); }

/* ---- landing helpers (index.md raw-html blocks) ---- */
.tz-landing-wrap { max-width: 1140px; margin: 0 auto; }
/* hide the plain markdown H1 on the landing page (the hero carries its own) */
section:has(> .tz-hero) > h1:first-child,
section:has(> .tz-landing-wrap) > h1:first-child,
article:has(.tz-hero) > h1:first-child { display: none; }
@media (max-width: 680px) {
  .tz-grid-2, .tz-grid-3 { grid-template-columns: 1fr !important; }
  .tz-hero h1 { font-size: 2.3rem !important; }
}

/* ---- smoother navigation ---- */
/* reserve the scrollbar so page width never jumps between short/long pages */
html { scrollbar-gutter: stable; }
/* animated cross-fade between pages on same-origin navigation (Chrome/Edge; ignored elsewhere) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
