/* Sofya site styles (2026-10 redesign).
   Design source: the claude.ai design canvas, rules in .design/brief-v2.md.
   Colors live in tokens only. Light is the default; [data-theme="dark"] on
   <html> switches to the navy palette. Pages use these classes plus their own
   small <style> block; avoid raw hex values in templates.
   Hard rules: no animation or transitions, no gradients, no red, no 999px
   radius except true circles. */

:root {
  color-scheme: light;
  --bg: #FFFFFF;          /* page ground */
  --raised: #FFFFFF;      /* header, cards, popovers */
  --panel: #F4F7FC;       /* mist: footer, code header, pale panels */
  --deep: #F4F7FC;        /* deeper strip */
  --ai: #F4F7FC;          /* AI answer panel */
  --soft: #E9EEF8;        /* bay: active nav, tag fill, selected segment */
  --soft-2: #E3EAF6;
  --hover: #F4F7FC;
  --line: #E2E6EF;        /* hairlines */
  --ctl: #C9D6EE;         /* control borders */
  --ink: #1B2033;         /* headings, strong text */
  --body: #444A5C;        /* body copy */
  --body-2: #2C3350;
  --muted: #4A5270;       /* never lighter than this for text */
  --placeholder: #7D849B; /* hint text only, clearly lighter than typed text */
  --link: #3A4A7A;        /* indigo text, links, titles */
  --primary: #3A4A7A;     /* primary button fill */
  --on-primary: #FFFFFF;
  --sub-on-primary: #E3EAF6;
  --gold: #7D5E17;        /* eyebrows, small accents */
  --ok: #2E7A55;          /* status: operational (icons and dots only) */
  --ok-fill: #E6F2EC;
  --champagne: #D8B76A;   /* fills only */
  --gold-fill: #F6EEDA;
  --gold-line: #E6D3A3;
  --code-bg: #FFFFFF;
  --code-head: #F4F7FC;
  --code-line: #C9D6EE;
  --sx-key: #3A4A7A;
  --sx-str: #7D5E17;
  --sx-punct: #4A5270;
  --sx-plain: #1B2033;
  --focus: #3A4A7A;
  --focus-halo: #E9EEF8;
  --band-a: #C9D6EE; --band-a-o: 1;
  --band-b: #D8B76A; --band-b-o: 1;
  --band-c: #3A4A7A; --band-c-o: 0.55;
  --scrim: rgba(27, 32, 51, 0.45);
  --card-line: #D9DFEA;   /* cards stand out a little more than hairlines */
  --card-shadow: 0 1px 2px rgba(27, 32, 51, 0.05);
  --shadow: 0 12px 32px rgba(27, 32, 51, 0.12);
  --header-line: transparent;
  --footer-line: transparent;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1020;
  --raised: #1B2442;
  --panel: #1B2442;
  --deep: #131A31;
  --ai: #243052;
  --soft: #27335A;
  --soft-2: #27335A;
  --hover: #27335A;
  --line: #2D3A5E;
  --ctl: #45527C;
  --ink: #E9EEF8;
  --body: #C3CBDD;
  --body-2: #C3CBDD;
  --muted: #9AA4BD;
  --placeholder: #6E7A99;
  --link: #AFC2F0;
  --primary: #5068D0;   /* white text 4.96:1 */
  --on-primary: #FFFFFF;
  --sub-on-primary: #F4F7FC;
  --gold: #D8B76A;
  --ok: #6CC490;
  --ok-fill: #17322A;
  --champagne: #D8B76A;
  --gold-fill: #2A2618;
  --gold-line: #5A4A22;
  --code-bg: #131A31;
  --code-head: #1B2442;
  --code-line: #45527C;
  --sx-key: #AFC2F0;
  --sx-str: #D8B76A;
  --sx-punct: #9AA4BD;
  --sx-plain: #E9EEF8;
  --focus: #AFC2F0;
  --focus-halo: #27335A;
  --band-a: #3F4A6B; --band-a-o: 1;
  --band-b: #D8B76A; --band-b-o: 0.5;
  --band-c: #6D80BF; --band-c-o: 0.7;
  --scrim: rgba(5, 8, 18, 0.66);
  --card-line: #2D3A5E;
  --card-shadow: none;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --header-line: #2D3A5E;
  --footer-line: #2D3A5E;
}

/* ---------- base ---------- */
*, ::before, ::after { box-sizing: border-box; }
html { font-size: 16px; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; background: var(--bg); }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
main { flex: 1; }
a { color: var(--link); }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
/* Thin, themed scrollbars inside cards and code blocks. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--ctl) transparent; }
  html { scrollbar-width: auto; }
}
body *::-webkit-scrollbar { width: 8px; height: 8px; }
body *::-webkit-scrollbar-track { background: transparent; }
body *::-webkit-scrollbar-thumb { background: var(--ctl); border-radius: 4px; }
body *::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
body *::-webkit-scrollbar-corner { background: transparent; }
p { margin: 0; }
code, pre, kbd, samp { font-family: var(--mono); }
img, svg { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--soft); color: var(--ink); }
.ic { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 200; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; color: var(--on-primary); }
.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; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
pre a, code a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.wrap { max-width: 1360px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.wrap-wide { max-width: 1360px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.wrap-text { max-width: 880px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
@media (max-width: 720px) {
  .wrap, .wrap-wide, .wrap-text { padding-left: 16px; padding-right: 16px; }
}
.section { padding-top: 64px; padding-bottom: 72px; }
.stack { display: flex; flex-direction: column; }
.eyebrow { font-size: 16px; font-weight: 600; color: var(--gold); }
.h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
.h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -0.01em; }
.h3 { font-size: 26px; line-height: 1.2; }
.lede { font-size: 18px; line-height: 1.6; color: var(--body); }
.body { color: var(--body); }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 48px; }
.sec-head > div { display: flex; flex-direction: column; gap: 10px; }
.sec-head > p { max-width: 480px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- header ---------- */
.site-hd { background: var(--raised); position: relative; z-index: 30; border-bottom: 1px solid var(--line); }
/* Three columns: logo, centered nav, actions. The nav never moves when the
   right side changes (Sign in, account chip, nothing). */
.site-hd .hdr-in { min-height: 80px; padding-top: 18px; padding-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px 24px; }
.site-hd .hdr-in > .brand { justify-self: start; }
.site-hd .hdr-in > .hdr-act { justify-self: end; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-word { font-size: 27px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.logo-key { display: none; }
:root[data-theme="dark"] .logo-key { display: inline; }
.hdr-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.hdr-nav a { text-decoration: none; color: var(--muted); font-size: 16px; font-weight: 500; padding: 10px 14px; border-radius: 8px; white-space: nowrap; display: inline-flex; flex-direction: column; align-items: center; }
/* Reserve the bold width so the active link does not push its neighbours. */
.hdr-nav a::after { content: attr(data-label); font-weight: 600; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; }
.hdr-nav a:hover { background: var(--hover); color: var(--ink); }
.hdr-nav a[aria-current="page"] { background: var(--soft); color: var(--link); font-weight: 600; }
:root[data-theme="dark"] .hdr-nav a[aria-current="page"] { color: var(--ink); }
.hdr-act { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; }
.hdr-acct { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); text-decoration: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--link); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; }
.hdr-acct { padding: 4px 10px 4px 4px; border-radius: 8px; min-height: 44px; }
.hdr-acct:hover { background: var(--hover); color: var(--ink); }
.hdr-acct .ic { color: var(--muted); }
/* Header widths, widest first:
   >1240  logo | nav centered on the page | actions
   <=1240 the nav centers in the space between logo and actions
   <=1080 still one row: the theme switch becomes one button, tighter nav
   <=940  "Sign in" drops (Get started leads to it), still one row
   <=860  the nav takes its own row, labels aligned with the logo, and wraps
          instead of hiding links on very small phones. */
@media (max-width: 1240px) {
  .site-hd .hdr-in { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 16px; }
  .site-hd .hdr-in > .hdr-nav { justify-self: center; }
}
@media (max-width: 1080px) {
  .hdr-nav { gap: 0; }
  .hdr-nav a { padding: 10px 10px; }
}
@media (max-width: 940px) { .hdr-signin { display: none !important; } }
@media (max-width: 860px) {
  .site-hd .hdr-in { grid-template-columns: minmax(0, 1fr) auto; }
  .site-hd .hdr-in > .hdr-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -10px; justify-content: flex-start; }
  .site-hd .hdr-in > .hdr-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 720px) {
  .hdr-nav a { font-size: 15px; padding: 10px 8px; }
  .site-hd .hdr-in > .hdr-nav { margin-left: -8px; }
  .hdr-acct .acct-email { display: none; }
}

/* theme switch: segmented on desktop, single toggle at <=720px */
.tsw { display: inline-flex; height: 44px; padding: 2px; border-radius: 8px; border: 1.5px solid var(--ctl); background: var(--raised); align-items: stretch; flex-shrink: 0; }
:root[data-theme="dark"] .tsw, :root[data-theme="dark"] .tcy { background: transparent; }
.tsg { width: 40px; padding: 0; border: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: transparent; color: var(--muted); }
.tsg[aria-checked="false"]:hover { background: var(--hover); }
.tsg[aria-checked="true"] { background: var(--soft); color: var(--link); }
:root[data-theme="dark"] .tsg[aria-checked="true"] { color: var(--ink); }
.tcy { display: none; width: 44px; height: 44px; padding: 0; border-radius: 8px; border: 1.5px solid var(--ctl); background: var(--raised); color: var(--link); align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
:root[data-theme="dark"] .tcy { color: var(--ink); }
.tcy:hover { background: var(--hover); }
.tcy .i-moon { display: none; }
:root[data-theme="dark"] .tcy .i-sun { display: none; }
:root[data-theme="dark"] .tcy .i-moon { display: inline; }
@media (max-width: 1080px) { .tsw { display: none; } .tcy { display: inline-flex; } }

/* ---------- footer ---------- */
.site-ft { background: var(--panel); border-top: 1px solid var(--footer-line); }
.site-ft .ft-in { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: minmax(0, 420px) auto; justify-content: space-between; gap: 32px 64px; }
@media (max-width: 1000px) { .site-ft .ft-in { grid-template-columns: minmax(0, 1fr); } }
.site-ft .ft-about { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.site-ft .ft-about p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.site-ft .ft-about p.ft-legal { font-size: 13px; line-height: 1.55; }
.site-ft nav.ft-cols { display: grid; grid-template-columns: repeat(4, minmax(110px, auto)); gap: 24px 48px; font-size: 15px; align-content: flex-start; }
.site-ft .ft-cols > div { display: flex; flex-direction: column; }
.site-ft .ft-h { font-size: 14px; font-weight: 600; color: var(--ink); padding-bottom: 6px; }
.site-ft nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
@media (max-width: 720px) { .site-ft nav.ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; } }
.site-ft nav a:hover { color: var(--ink); }
@media (max-width: 720px) { .site-ft .ft-in { padding-top: 40px; padding-bottom: 40px; } }

/* test-instance banner */
.env-banner { background: var(--gold-fill); color: var(--gold); border-bottom: 1px solid var(--gold-line); text-align: center; padding: 6px 12px; font: 600 12px/1.4 var(--mono); }

/* ---------- B1 buttons ---------- */
.btn { font-family: var(--font); font-size: 15px; font-weight: 600; height: 44px; padding: 0 18px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; border: 0; line-height: 1; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { color: var(--on-primary); background: #2F3D66; }
:root[data-theme="dark"] .btn-primary:hover { background: #4459BC; }
.btn-secondary { background: var(--raised); color: var(--link); border: 1.5px solid var(--ctl); }
:root[data-theme="dark"] .btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--hover); color: var(--link); }
:root[data-theme="dark"] .btn-secondary:hover { color: var(--ink); }
/* Quiet actions share the link color; gold is kept for labels and badges. */
.btn-quiet { background: transparent; color: var(--link); padding: 0 10px; }
.btn-quiet:hover { background: var(--hover); color: var(--link); }
.btn-sm { font-size: 13px; height: 32px; padding: 0 12px; border-radius: 6px; gap: 6px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- P2 tags ---------- */
.tag { font-family: var(--font); font-size: 13px; font-weight: 500; padding: 4px 9px; border-radius: 6px; background: var(--soft); color: var(--link); border: 1px solid var(--ctl); display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; white-space: nowrap; }
:root[data-theme="dark"] .tag { color: #C9D6EE; }
.tag-mono { font-family: var(--mono); font-size: 12px; }
.tag-gold { background: var(--gold-fill); color: var(--gold); border-color: var(--gold-line); }
:root[data-theme="dark"] .tag-gold { color: var(--gold); }
/* Status labels: a quiet fill, no border, regular weight, so they never look like buttons. */
.tag-plain { background: var(--soft); color: var(--muted); border-color: transparent; font-weight: 400; }
:root[data-theme="dark"] .tag-plain { background: var(--soft); color: var(--body); border-color: transparent; }
.tag-path { background: var(--panel); color: var(--link); border-color: var(--line); }
:root[data-theme="dark"] .tag-path { background: var(--soft); color: var(--link); border-color: var(--ctl); }

/* ---------- T3 segmented tabs ---------- */
.seg { display: inline-flex; border: 1.5px solid var(--ctl); border-radius: 8px; overflow: hidden; max-width: 100%; }
.seg > button, .seg > a { font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; border: 0; border-left: 1.5px solid var(--ctl); padding: 9px 18px; background: var(--raised); color: var(--link); text-decoration: none; }
:root[data-theme="dark"] .seg > button, :root[data-theme="dark"] .seg > a { color: var(--body); }
.seg > :first-child { border-left: 0; }
.seg > button:hover, .seg > a:hover { background: var(--hover); }
.seg > [aria-selected="true"], .seg > [aria-checked="true"], .seg > [aria-pressed="true"], .seg > .on { background: var(--soft); color: var(--link); box-shadow: inset 0 0 0 1.5px var(--link); }
:root[data-theme="dark"] .seg > [aria-selected="true"], :root[data-theme="dark"] .seg > [aria-checked="true"], :root[data-theme="dark"] .seg > [aria-pressed="true"], :root[data-theme="dark"] .seg > .on { color: var(--ink); background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--link); }
.seg-sm > button, .seg-sm > a { font-size: 14px; padding: 7px 14px; }

/* ---------- I1 inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 13px; color: var(--muted); }
.input, .select, .textarea { width: 100%; background: var(--raised); border: 1.5px solid var(--ctl); border-radius: 8px; padding: 0 14px; height: 46px; font-size: 16px; color: var(--ink); outline: 0; }
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select, :root[data-theme="dark"] .textarea, :root[data-theme="dark"] .input-box { background-color: var(--deep); }
select.select, select.input { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; background-repeat: no-repeat; background-position: right 14px center; background-size: 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5270' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] select.select, :root[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA4BD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; flex-shrink: 0; cursor: pointer; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
.input:focus, .select:focus, .textarea:focus { border: 1.5px solid var(--focus); box-shadow: 0 0 0 3px var(--focus-halo); }
.input-box { display: flex; align-items: center; gap: 6px; background: var(--raised); border: 1.5px solid var(--ctl); border-radius: 8px; padding: 0 14px; height: 46px; }
.input-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-halo); }
.input-box input { border: 0; outline: 0; width: 100%; font-size: 17px; color: var(--ink); background: transparent; padding: 0; min-width: 0; }
.input-box .affix { color: var(--muted); }
.input-box .suffix { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* toggle switch (a true circle knob) */
.switch { position: relative; display: inline-flex; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { width: 40px; height: 24px; border-radius: 12px; background: var(--ctl); position: relative; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { left: 19px; }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- C1 cards ---------- */
.card { background: var(--raised); border: 1px solid var(--card-line); border-radius: 12px; padding: 20px 22px; box-shadow: var(--card-shadow); }
.card-flush { padding: 0; overflow: hidden; }
.panel { background: var(--panel); border-radius: 12px; padding: 20px 22px; }
.stat-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.stat-num { font-size: 40px; font-weight: 600; letter-spacing: -0.015em; line-height: 1; color: var(--ink); }

/* ---------- K2 code blocks ---------- */
.code { background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 12px; overflow: hidden; min-width: 0; }
.code-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 18px; min-height: 48px; background: var(--code-head); border-bottom: 1px solid var(--code-line); }
:root[data-theme="dark"] .code-hd { border-bottom-color: var(--line); }
.code-hd .code-label { font-size: 13px; font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code pre { margin: 0; padding: 14px 18px; font-family: var(--mono); font-size: 13px; line-height: 1.7; white-space: pre; overflow-x: auto; color: var(--sx-plain); background: transparent; }
.code pre:focus-visible { outline-offset: -2px; } /* .code clips overflow */
.code pre.wrap-lines { white-space: pre-wrap; word-break: break-word; }
.code-inline, :not(pre) > code { font-family: var(--mono); font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--panel); color: var(--link); border: 1px solid var(--line); }
:root[data-theme="dark"] :not(pre) > code { background: var(--soft); border-color: var(--ctl); }
pre code { padding: 0; border: 0; background: none; font-size: inherit; color: inherit; }
/* syntax classes used by the shared highlighter in base.html */
.json-key, .sh-cmd, .py-kw, .py-fn { color: var(--sx-key); }
.json-str, .sh-str, .py-str { color: var(--sx-str); }
.json-num, .json-bool { color: var(--sx-key); }
.json-null, .json-brace, .sh-flag, .sh-comment, .py-comment { color: var(--sx-punct); }
/* Underlined, not only colored: a URL string is close in color to the code
   around it (2.7:1 light, 1.7:1 dark), so color alone can't mark it as a link. */
.json-url { color: var(--sx-str); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.json-url:hover { text-decoration-thickness: 2px; }
.sh-cmd { font-weight: 500; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
:root[data-theme="dark"] .table th { background: var(--raised); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--body-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--mono); font-size: 14px; text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }

/* ---------- band divider ---------- */
.band { display: block; width: 100%; height: 36px; overflow: visible; }
#sofya-band .b-a { stroke: var(--band-a); stroke-opacity: var(--band-a-o); }
#sofya-band .b-b { stroke: var(--band-b); stroke-opacity: var(--band-b-o); }
#sofya-band .b-c { stroke: var(--band-c); stroke-opacity: var(--band-c-o); }

/* ---------- modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; }
.modal-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* ---------- notices ---------- */
.note { border-radius: 12px; padding: 12px 16px; font-size: 15px; line-height: 1.5; background: var(--panel); border: 1px solid var(--line); color: var(--body-2); }
.note-gold { background: var(--gold-fill); border-color: var(--gold-line); color: var(--ink); }
.note-indigo { background: var(--soft); border-color: var(--ctl); color: var(--ink); }

/* ---------- prose (legal pages, updates) ---------- */
.prose { font-size: 17px; line-height: 1.7; color: var(--body); }
.prose h2 { font-size: 24px; margin: 40px 0 12px; line-height: 1.25; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose :not(pre) > code { font-size: 15px; }
.prose strong { color: var(--ink); font-weight: 600; }

/* tooltips kept for older markup */
.has-tip { position: relative; }
.tip { visibility: hidden; position: absolute; left: 50%; transform: translateX(-50%); padding: 4px 10px; font-size: 12px; white-space: nowrap; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; pointer-events: none; z-index: 50; }
.tip-below { top: 100%; margin-top: 6px; }
.tip-above { bottom: 100%; margin-bottom: 6px; }
.has-tip:hover .tip, .has-tip:focus-within .tip { visibility: visible; }

@media print { .site-hd, .site-ft, .tsw, .tcy { display: none !important; } }
main:focus { outline: none; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .input-box:has(input[aria-invalid="true"]) { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-fill); }
@media (max-width: 360px) { .hdr-nav a { font-size: 14px; padding: 10px 4px; } .site-hd .hdr-in > .hdr-nav { margin-left: -4px; flex-wrap: nowrap; justify-content: space-between; } }
