/* Smile Docs - smilecorp.co.uk/docs. The same navy and gold system as Smile Business: layered
   surfaces, one radius scale, a 4px rhythm. Class names are shared with the staff panel's preview
   (.main.doc .article .doc-title .doc-summary .prose), so they stay. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #060d19; --bg-2: #0a1424; --surface: #0d192c; --surface-2: #112038; --surface-3: #172a47; --surface-4: #1d3355;
  --line: rgba(160,186,224,.10); --line-2: rgba(160,186,224,.18); --line-3: rgba(160,186,224,.28);
  --text: #f4f7fc; --text-2: #c9d4e3; --text-dim: #8b9cb4; --faint: #5f7290;
  --gold: #f2c200; --gold-2: #ffd84d; --gold-3: #ffe58a; --ink: #1a1400;
  --gold-soft: rgba(242,194,0,.12); --gold-line: rgba(242,194,0,.36); --border: var(--gold-line);
  --panel: var(--surface); --panel-2: var(--surface-2);
  --blue: #60a5fa; --ok: #4ade80; --bad: #f87171; --violet: #c4a5ff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --top: 64px; --side: 288px; --ease: cubic-bezier(.2,.7,.2,1);
  --shadow: 0 1px 0 rgba(255,255,255,.035) inset, 0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.22);
  --shadow-lg: 0 1px 0 rgba(255,255,255,.05) inset, 0 30px 80px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface-2); color: var(--text-dim); font: 600 11px/1 var(--font); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--text-dim); }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--gold), var(--gold-2)); box-shadow: 0 0 10px var(--gold); transition: width .1s linear; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2)); color: var(--text); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: var(--line-3); background: linear-gradient(180deg, var(--surface-4), var(--surface-3)); }
.btn:active { transform: translateY(1px); }
.btn svg.i { width: 17px; height: 17px; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: rgba(255,216,77,.6); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 8px 22px -8px rgba(242,194,0,.45); }
.btn-gold:hover { background: linear-gradient(180deg, var(--gold-3), var(--gold-2)); border-color: var(--gold-2); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; }

/* ---------- top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: rgba(6,13,25,.8); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 800 17px var(--display); letter-spacing: -.02em; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 4px 14px rgba(242,194,0,.22); }
.brand .accent { color: var(--gold); }
.brand-docs { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold-2); font: 700 12px/1 var(--font); }
.search-launch { display: flex; align-items: center; gap: 10px; flex: 0 1 360px; height: 40px; margin-left: 18px; padding: 0 8px 0 13px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text-dim); font: 500 14px var(--font); cursor: pointer; transition: border-color .15s, background .15s; }
.search-launch:hover { border-color: var(--line-3); background: var(--surface); color: var(--text-2); }
.search-launch span { flex: 1; text-align: left; } .search-launch svg.i { width: 17px; height: 17px; }
.toplinks { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.toplinks a { font-size: 14px; font-weight: 500; color: var(--text-2); padding: 8px 12px; border-radius: 9px; white-space: nowrap; }
.toplinks a:hover { color: var(--text); background: rgba(160,186,224,.06); }
.toplinks .top-cta { display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; height: 38px; color: var(--ink); font-weight: 700; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 6px 18px -6px rgba(242,194,0,.5); }
.toplinks .top-cta:hover { color: var(--ink); background: linear-gradient(180deg, var(--gold-3), var(--gold-2)); }
.top-cta svg.i { width: 16px; height: 16px; }
.menu-btn { display: none; }

/* ---------- layout + sidebar */
.shell { display: flex; min-height: calc(100vh - var(--top)); }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); width: var(--side); flex: none; overflow-y: auto; padding: 18px 14px 24px;
  display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #08111f, #070e1a);
  overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(160,186,224,.16) transparent; }
.side-search { display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; padding: 0 8px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-dim); font: 500 14px var(--font); cursor: pointer; margin-bottom: 8px; }
.side-search:hover { border-color: var(--line-3); color: var(--text-2); } .side-search span { flex: 1; text-align: left; } .side-search svg.i { width: 16px; height: 16px; }
.nav-home { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.nav-home:hover { background: rgba(160,186,224,.06); color: var(--text); } .nav-home.active { background: var(--gold-soft); color: var(--text); } .nav-home svg.i { width: 17px; height: 17px; color: var(--faint); } .nav-home.active svg.i { color: var(--gold); }
.side-nav { display: grid; gap: 2px; }
.nav-group { border-radius: 10px; }
.nav-cat { list-style: none; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; user-select: none; }
.nav-cat::-webkit-details-marker { display: none; }
.nav-cat:hover { background: rgba(160,186,224,.06); color: var(--text); }
.nav-cat svg.i { width: 17px; height: 17px; color: var(--faint); }
.nav-cat span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-n { font: 600 11px/1 var(--font); color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; }
.nav-cat .nav-chev { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.nav-group[open] > .nav-cat { color: var(--text); } .nav-group[open] > .nav-cat svg.i:first-child { color: var(--gold); } .nav-group[open] > .nav-cat .nav-chev { transform: rotate(90deg); }
.nav-pages { display: grid; gap: 1px; margin: 2px 0 8px 18px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-link { position: relative; display: block; font-size: 13.5px; color: var(--text-dim); padding: 7px 10px; border-radius: 8px; line-height: 1.4; transition: color .12s, background .12s; }
.nav-link:hover { color: var(--text); background: rgba(160,186,224,.05); }
.nav-link.active { color: var(--text); background: var(--gold-soft); font-weight: 600; }
.nav-link.active::before { content: ''; position: absolute; left: -13px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--gold); }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.side-foot a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot a:hover { color: var(--text); background: rgba(160,186,224,.06); } .side-foot svg.i { width: 16px; height: 16px; }
.main { flex: 1; min-width: 0; padding: 40px 48px 80px; }

/* ---------- search palette */
.palette { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(3,8,16,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .15s ease; }
.palette-box { width: 100%; max-width: 640px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); }
.palette-input svg.i { width: 20px; height: 20px; color: var(--gold); }
.palette-input input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--text); font: 500 17px var(--font); }
.palette-input input::placeholder { color: var(--faint); } .palette-input input::-webkit-search-cancel-button { display: none; }
.palette-results { max-height: min(56vh, 460px); overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: rgba(160,186,224,.16) transparent; }
.palette-empty { padding: 26px 14px; text-align: center; color: var(--text-dim); font-size: 14px; }
.palette-group { font: 700 11px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 12px 10px 8px; }
.result { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 11px; cursor: pointer; }
.result .r-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim); flex: none; }
.result .r-ico svg.i { width: 16px; height: 16px; }
.result .r-body { min-width: 0; flex: 1; }
.result-title { font-weight: 600; font-size: 14.5px; color: var(--text); }
.result-cat { font-size: 11.5px; color: var(--text-dim); margin-left: 6px; font-weight: 500; }
.result-snip { font-size: 13px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.result mark { background: rgba(242,194,0,.28); color: var(--text); border-radius: 3px; padding: 0 2px; }
.result.sel, .result:hover { background: var(--gold-soft); } .result.sel .r-ico { color: var(--gold); border-color: var(--gold-line); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.palette-foot span { display: inline-flex; align-items: center; gap: 4px; } .palette-foot kbd { height: 20px; min-width: 20px; font-size: 10.5px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- home */
.home { padding-top: 0; }
.hero { position: relative; isolation: isolate; margin: 0 -48px 36px; padding: 72px 48px 56px; text-align: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(160,186,224,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(160,186,224,.05) 1px, transparent 1px); background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 20%, transparent 70%); }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(520px 300px at 50% -40px, rgba(242,194,0,.17), transparent 70%), radial-gradient(600px 340px at 90% 100%, rgba(96,165,250,.10), transparent 70%); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold-2); font: 700 12.5px/1 var(--font); }
.eyebrow svg.i { width: 15px; height: 15px; }
.hero h1 { font: 800 clamp(34px, 4.6vw, 54px)/1.08 var(--display); letter-spacing: -.035em; margin: 20px 0 14px; }
.hero h1 .hl { background: linear-gradient(100deg, var(--gold), var(--gold-3), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { color: var(--text-2); font-size: 17px; line-height: 1.6; max-width: 600px; margin: 0 auto 28px; }
.hero-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 620px; height: 58px; margin: 0 auto; padding: 0 12px 0 20px; border-radius: 16px;
  border: 1px solid var(--line-3); background: rgba(13,25,44,.85); color: var(--text-dim); font: 500 16px var(--font); cursor: text; box-shadow: 0 18px 50px -20px rgba(0,0,0,.8); transition: border-color .15s, box-shadow .15s; }
.hero-search:hover { border-color: var(--gold-line); box-shadow: 0 0 0 4px var(--gold-soft), 0 18px 50px -20px rgba(0,0,0,.8); }
.hero-search span { flex: 1; text-align: left; } .hero-search svg.i { width: 20px; height: 20px; color: var(--gold); }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; color: var(--text-dim); }
.hero-tags a { height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); }
.hero-tags a:hover { border-color: var(--gold-line); color: var(--text); }
.block { max-width: 1240px; margin: 0 auto 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.block-head h2 { font: 800 21px var(--display); letter-spacing: -.02em; margin: 0; } .block-head .muted { font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.quick { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 60%), var(--surface); box-shadow: var(--shadow); transition: border-color .2s, transform .2s var(--ease); }
.quick:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.quick-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); }
.quick-ico svg.i { width: 20px; height: 20px; stroke-width: 2.1; }
.quick b { display: block; font-size: 15px; } .quick small { display: block; color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.quick > span:nth-child(2) { flex: 1; min-width: 0; }
.quick-arrow { color: var(--faint); transition: transform .2s var(--ease), color .2s; } .quick:hover .quick-arrow { color: var(--gold); transform: translateX(3px); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cat-card { display: flex; flex-direction: column; padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transition: border-color .2s; }
.cat-card:hover { border-color: var(--line-3); }
.cat-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.cat-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); }
.cat-ico svg.i { width: 19px; height: 19px; }
.cat-head h2 { font: 700 16.5px var(--display); letter-spacing: -.01em; margin: 1px 0 3px; } .cat-head small { display: block; color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.cat-head:hover h2 { color: var(--gold-2); }
.cat-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.cat-card li a { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); padding: 7px 10px; border-radius: 8px; }
.cat-card li a::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); flex: none; transition: background .15s; }
.cat-card li a:hover { color: var(--text); background: rgba(160,186,224,.05); } .cat-card li a:hover::before { background: var(--gold); }
.more { margin-top: 4px; } .more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; color: var(--gold); font-size: 13.5px; font-weight: 600; }
.more > summary::-webkit-details-marker { display: none; } .more > summary::after { content: '↓'; font-size: 12px; } .more[open] > summary::after { content: '↑'; } .more > summary:hover { background: var(--gold-soft); }
.help-band { max-width: 1240px; margin: 24px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 30px 32px; border-radius: 22px; border: 1px solid var(--gold-line);
  background: radial-gradient(500px 220px at 0% 0%, rgba(242,194,0,.16), transparent 70%), var(--surface); }
.help-band h2 { font: 800 22px var(--display); letter-spacing: -.02em; margin: 0 0 4px; } .help-band p { margin: 0; color: var(--text-2); }
.help-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- a page */
.doc-grid { display: flex; gap: 56px; align-items: flex-start; max-width: 1180px; margin: 0 auto; }
.article { flex: 1; min-width: 0; max-width: 780px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-dim); margin-bottom: 22px; }
.crumbs a:hover { color: var(--gold); } .crumbs svg.i { width: 13px; height: 13px; color: var(--faint); } .crumbs span { color: var(--text-2); }
.doc-cat { display: inline-flex; align-items: center; gap: 7px; color: var(--gold-2); font: 700 12.5px var(--font); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.doc-cat svg.i { width: 15px; height: 15px; }
.doc-title { font: 800 clamp(30px, 3.4vw, 40px)/1.12 var(--display); letter-spacing: -.03em; margin: 0 0 12px; }
.doc-summary { color: var(--text-2); font-size: 18px; line-height: 1.6; margin: 0 0 18px; }
.doc-summary a { color: var(--gold); }
.doc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-dim); padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.doc-meta > span { display: inline-flex; align-items: center; gap: 6px; } .doc-meta svg.i { width: 14px; height: 14px; }
.copy-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; }
.copy-link:hover { border-color: var(--line-3); color: var(--text); } .copy-link svg.i { width: 14px; height: 14px; }
.toc { position: sticky; top: calc(var(--top) + 36px); width: 230px; flex: none; max-height: calc(100vh - var(--top) - 72px); overflow-y: auto; scrollbar-width: none; }
.toc-title { font: 700 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin-bottom: 12px; }
.toc-list { display: grid; border-left: 1px solid var(--line); }
.toc-link { display: block; font-size: 13px; color: var(--text-dim); padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.45; transition: color .12s, border-color .12s; }
.toc-link.lvl3 { padding-left: 26px; font-size: 12.5px; }
.toc-link:hover { color: var(--text); } .toc-link.on { color: var(--gold-2); border-left-color: var(--gold); font-weight: 600; }
.toc-foot { margin-top: 16px; } .toc-top { background: none; border: 0; padding: 0; color: var(--text-dim); font: 500 12.5px var(--font); cursor: pointer; } .toc-top:hover { color: var(--gold); }

/* ---------- the writing */
.prose { font-size: 16px; line-height: 1.75; color: #dfe6f0; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { position: relative; font: 800 24px/1.25 var(--display); letter-spacing: -.02em; margin: 48px 0 14px; padding-top: 4px; color: var(--text); }
.prose h3 { position: relative; font: 700 18.5px/1.3 var(--display); letter-spacing: -.01em; margin: 32px 0 10px; color: var(--text); }
.prose h4 { font-size: 16px; margin: 24px 0 8px; color: var(--text); }
.prose .anchor { position: absolute; left: -24px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--faint) !important; text-decoration: none !important; font-weight: 600; padding-right: 8px; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; } .prose .anchor:hover { color: var(--gold) !important; }
.prose p { margin: 0 0 18px; }
.prose a { color: var(--gold-2); text-decoration: underline; text-decoration-color: rgba(242,194,0,.35); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.prose a:hover { text-decoration-color: var(--gold); }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin: 6px 0; padding-left: 4px; } .prose li::marker { color: var(--gold); }
.prose ol > li::marker { font-weight: 700; font-size: .92em; }
.prose strong { color: var(--text); font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose img { max-width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: .12em .4em; color: var(--gold-3); }
.prose pre { position: relative; background: #070f1d; border: 1px solid var(--line-2); border-radius: 14px; padding: 44px 18px 16px; overflow-x: auto; margin: 0 0 22px; box-shadow: var(--shadow); }
.prose pre::before { content: attr(data-lang); position: absolute; top: 0; left: 0; right: 0; height: 34px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text-dim); font: 600 11.5px var(--font); text-transform: uppercase; letter-spacing: .08em; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.7; color: #e6edf6; }
.prose code, .prose pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.prose pre, .table-wrap { scrollbar-width: thin; scrollbar-color: rgba(160,186,224,.2) transparent; }
.copy-btn { position: absolute; top: 5px; right: 8px; display: inline-flex; align-items: center; gap: 5px; height: 24px; font: 600 11.5px var(--font); color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 0 9px; cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--line-3); } .copy-btn.done { color: var(--ok); border-color: rgba(74,222,128,.4); }
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 700 11.5px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); background: rgba(255,255,255,.02); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; } .prose tbody tr:hover { background: rgba(160,186,224,.03); }
.prose blockquote { margin: 0 0 22px; padding: 14px 18px; border-left: 3px solid var(--line-3); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }

/* callouts: > [!TIP] and friends */
.prose blockquote.callout { --c: var(--blue); position: relative; border: 1px solid color-mix(in srgb, var(--c) 34%, transparent); border-left: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
  border-radius: 14px; padding: 15px 18px 15px 52px; background: color-mix(in srgb, var(--c) 7%, var(--surface)); color: #e3e9f2; }
.prose blockquote.callout::before { content: ''; position: absolute; left: 17px; top: 16px; width: 20px; height: 20px; background: var(--c);
  -webkit-mask: var(--ico) center/contain no-repeat; mask: var(--ico) center/contain no-repeat; }
.callout-title { font: 700 12.5px var(--font); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; color: var(--c); }
.prose blockquote.callout-note { --c: var(--blue); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.prose blockquote.callout-tip { --c: var(--ok); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5M9 18h6M10 22h4'/%3E%3C/svg%3E"); }
.prose blockquote.callout-important { --c: var(--violet); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3Cpath d='M12 7v4M12 15h.01'/%3E%3C/svg%3E"); }
.prose blockquote.callout-warning { --c: var(--gold); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.prose blockquote.callout-danger { --c: var(--bad); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E"); }

/* help + previous / next */
.doc-help { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 44px; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--text-dim); }
.doc-help span { font-weight: 600; color: var(--text-2); margin-right: auto; }
.doc-help a { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 600; } .doc-help a:hover { color: var(--gold); } .doc-help svg.i { width: 16px; height: 16px; }
.pagers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.pager { display: grid; gap: 3px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, transform .15s var(--ease); }
.pager:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.pager.next { text-align: right; } .pager.empty { border: 0; background: none; }
.pager-label { font: 600 12px var(--font); color: var(--text-dim); }
.pager.prev .pager-label::before { content: '← '; } .pager.next .pager-label::after { content: ' →'; }
.pager-title { font-weight: 700; font-size: 15px; color: var(--text); } .pager:hover .pager-title { color: var(--gold-2); }
.pager-cat { font-size: 12px; color: var(--faint); }
.nf { text-align: center; max-width: 560px; margin: 8vh auto 0; } .nf-code { font: 800 96px/1 var(--display); letter-spacing: -.05em; background: linear-gradient(180deg, var(--gold-2), rgba(242,194,0,.2)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- narrower screens */
@media (max-width: 1280px) { .toc { display: none; } .doc-grid { max-width: 820px; } }
@media (max-width: 1100px) { .toplinks a:not(.top-cta) { display: none; } }
@media (max-width: 920px) {
  .menu-btn { display: grid; } .topbar { padding: 0 14px; gap: 10px; } .brand-docs { display: none; }
  .search-launch { flex: 1; margin-left: 4px; } .search-launch kbd { display: none; }
  .sidebar { position: fixed; left: 0; top: var(--top); z-index: 45; width: min(320px, 86vw); background: #07101d; transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: 20px 0 50px rgba(0,0,0,.45); }
  body.menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(3,8,16,.55); backdrop-filter: blur(3px); z-index: 44; display: none; }
  body.menu-open .scrim { display: block; }
  .main { padding: 28px 20px 64px; } .hero { margin: 0 -20px 28px; padding: 48px 20px 40px; }
  .pagers { grid-template-columns: 1fr; } .pager.next { text-align: left; } .pager.empty { display: none; }
  .prose .anchor { display: none; }
}
@media (max-width: 640px) {
  .brand > span { display: none; } .brand img { width: 30px; height: 30px; }
  .search-launch span { font-size: 13.5px; } .toplinks .top-cta { font-size: 0; gap: 0; width: 40px; padding: 0; justify-content: center; margin-left: 0; } .top-cta svg.i { width: 18px; height: 18px; }
  .hero .lede { font-size: 15.5px; } .hero-search { height: 52px; font-size: 15px; } .hero-search kbd { display: none; }
  .cat-grid { grid-template-columns: 1fr; } .quick-grid { grid-template-columns: 1fr; }
  .help-band { padding: 24px 20px; } .help-actions, .help-actions .btn { width: 100%; }
  .doc-summary { font-size: 16.5px; } .prose { font-size: 15.5px; } .copy-link span { display: none; }
  .palette { padding: 0; place-items: stretch; } .palette-box { max-width: none; border-radius: 0; height: 100%; display: flex; flex-direction: column; } .palette-results { max-height: none; flex: 1; } .palette-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- languages (2026-10-19, docs-i18n.js) */
.lang-menu { position: relative; flex: none; }
.lang-menu > summary { list-style: none; } .lang-menu > summary::-webkit-details-marker { display: none; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 11px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.lang-btn:hover, .lang-menu[open] > .lang-btn { border-color: var(--line-3); color: var(--text); }
.lang-btn svg.i { width: 16px; height: 16px; } .lang-btn .lang-chev { width: 13px; height: 13px; transform: rotate(90deg); color: var(--faint); }
.lang-list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; min-width: 190px; max-height: min(70vh, 460px); overflow: auto; padding: 6px; border-radius: 14px; border: 1px solid var(--line-2); background: #0b1628; box-shadow: 0 24px 60px rgba(0,0,0,.55); display: grid; gap: 1px; }
.lang-item { display: block; padding: 8px 12px; border-radius: 9px; font-size: 14px; color: var(--text-2); }
.lang-item:hover { background: rgba(160,186,224,.07); color: var(--text); }
.lang-item.on { color: var(--gold-2); font-weight: 700; background: rgba(242,194,0,.08); }
.lang-item:first-child { border-bottom: 1px solid var(--line); border-radius: 9px 9px 4px 4px; margin-bottom: 4px; }
.lang-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(242,194,0,.28); background: rgba(242,194,0,.06); color: var(--text-2); font-size: 14px; }
.lang-notice svg.i { width: 18px; height: 18px; flex: none; color: var(--gold); margin-top: 1px; }
@media (max-width: 900px) { .lang-btn span { display: none; } .lang-btn { padding: 0 9px; } .lang-btn .lang-chev { display: none; } }

/* Right-to-left (Arabic): mirror the layout. Code always reads left to right. */
[dir="rtl"] .search-launch { margin-left: 0; margin-right: 18px; } [dir="rtl"] .search-launch span, [dir="rtl"] .side-search span, [dir="rtl"] .hero-search span { text-align: right; }
[dir="rtl"] .toplinks { margin-left: 0; margin-right: auto; } [dir="rtl"] .toplinks .top-cta { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .lang-list { right: auto; left: 0; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .nav-pages { margin: 2px 18px 8px 0; padding-left: 0; padding-right: 12px; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .nav-link.active::before { left: auto; right: -13px; }
[dir="rtl"] .nav-cat .nav-chev, [dir="rtl"] .crumbs svg.i, [dir="rtl"] .quick-arrow { transform: scaleX(-1); }
[dir="rtl"] .nav-group[open] > .nav-cat .nav-chev { transform: rotate(90deg); }
[dir="rtl"] .quick:hover .quick-arrow { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .result-cat { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .copy-link { margin-left: 0; margin-right: auto; }
[dir="rtl"] .doc-help span { margin-right: 0; margin-left: auto; }
[dir="rtl"] .toc-list { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .toc-link { padding: 6px 14px 6px 0; margin-left: 0; margin-right: -1px; border-left: 0; border-right: 2px solid transparent; }
[dir="rtl"] .toc-link.lvl3 { padding-left: 0; padding-right: 26px; } [dir="rtl"] .toc-link.on { border-right-color: var(--gold); }
[dir="rtl"] .prose .anchor { left: auto; right: -24px; padding-right: 0; padding-left: 8px; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 24px; } [dir="rtl"] .prose li { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .prose th, [dir="rtl"] .prose td { text-align: right; }
[dir="rtl"] .prose blockquote { border-left: 0; border-right: 3px solid var(--line-3); border-radius: 12px 0 0 12px; }
[dir="rtl"] .prose blockquote.callout { border: 1px solid color-mix(in srgb, var(--c) 34%, transparent); border-radius: 14px; padding: 15px 52px 15px 18px; }
[dir="rtl"] .prose blockquote.callout::before { left: auto; right: 17px; }
[dir="rtl"] .pager.next { text-align: left; } [dir="rtl"] .pager.prev .pager-label::before { content: '→ '; } [dir="rtl"] .pager.next .pager-label::after { content: ' ←'; }
[dir="rtl"] .progress { left: auto; right: 0; }
[dir="rtl"] pre, [dir="rtl"] code { direction: ltr; text-align: left; }
@media (max-width: 1100px) {
  [dir="rtl"] .search-launch { margin-right: 4px; }
}
@media (max-width: 920px) {
  [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(102%); box-shadow: -20px 0 50px rgba(0,0,0,.45); }
  [dir="rtl"] body.menu-open .sidebar { transform: none; }
  [dir="rtl"] .pager.next { text-align: right; }
}
.lang-item { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.lang-item .lang-en { color: var(--text-dim); font-size: 12px; font-weight: 500; }
.lang-list { min-width: 230px; }
