/* The help site. Plain CSS, no build step. Light by default (dark only when a visitor chooses it); English and Bangla; desktop, tablet and phone; printable. */
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #14202b;
  --muted: #5d6e7c;
  --border: #e1e7ec;
  --border-strong: #cdd7de;
  --accent: #1b7a8f;
  --accent-2: #2aa0b8;
  --accent-soft: #e6f3f6;
  --on-accent: #ffffff;
  --tl: 94%; /* tile lightness and text lightness of a topic's colour */
  --tc: 33%;
  --tip: #1b7f4b; --tip-bg: #e9f6ef;
  --note: #1c5fb0; --note-bg: #eaf1fb;
  --warning: #9a5600; --warning-bg: #fdf1de;
  --important: #b3261e; --important-bg: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.06);
  --shadow: 0 1px 2px rgba(20, 32, 43, 0.05), 0 8px 24px -8px rgba(20, 32, 43, 0.14);
  --shadow-lg: 0 24px 60px -18px rgba(20, 32, 43, 0.35);
  --font: "Inter", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", "Kalpurush", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --top: 62px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0e11; --surface: #12181d; --surface-2: #1a2228; --text: #e7edf1; --muted: #92a3af; --border: #232e36; --border-strong: #35444e;
  --accent: #38b2cb; --accent-2: #5fcce0; --accent-soft: #123039; --on-accent: #03181d; --tl: 20%; --tc: 74%;
  --tip: #62d398; --tip-bg: #12291d; --note: #82b6f2; --note-bg: #12233a; --warning: #f2b862; --warning-bg: #302410; --important: #f4908a; --important-bg: #361817;
  --shadow-sm: none; --shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6); --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 18px); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body[data-lang="bn"] { font-size: 17px; line-height: 1.9; }
body.noscroll { overflow: hidden; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.i { flex: none; }
kbd { font-family: var(--mono); font-size: 0.78em; background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 8px 14px; z-index: 200; }
.skip:focus { left: 8px; top: 8px; border-radius: 8px; }
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 80; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.08s linear; }

/* topic colours: --h is the hue of the topic, set on the element that carries it */
.tile { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: hsl(var(--h, 190) 70% var(--tl)); color: hsl(var(--h, 190) 62% var(--tc)); flex: none; }
.tile.big { width: 44px; height: 44px; border-radius: 13px; }

/* ---------------------------------------------------------------- top bar */
.top { position: sticky; top: 0; z-index: 60; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
.brand-name { font-size: 17px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); letter-spacing: 0; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; padding: 0; transition: background 0.15s, border-color 0.15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.menu { display: none; }
.is-home .menu { display: none !important; }
.searchbtn { flex: 1; min-width: 0; max-width: 440px; margin-left: auto; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--muted); cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; }
.searchbtn:hover { border-color: var(--border-strong); background: var(--surface); }
.searchbtn .st { flex: 1; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 8px; }
.langs { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.langs .lang { padding: 5px 13px; text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; line-height: 1.35; border-radius: 999px; }
.langs a.lang:hover { color: var(--text); }
.langs .lang.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); cursor: default; }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: inline-grid; }
:root[data-theme="dark"] .ico-moon { display: none; }

/* ---------------------------------------------------------------- three columns: contents, page, on this page */
.shell { display: grid; grid-template-columns: 290px minmax(0, 1fr) 250px; max-width: 1560px; margin: 0 auto; }
.shell-home { display: block; max-width: none; }
.side { position: sticky; top: var(--top); height: calc(100dvh - var(--top)); overflow: auto; padding: 22px 14px 48px 20px; scrollbar-width: thin; }
.side-head { display: none; }
.group { margin-bottom: 22px; }
.group h2 { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 6px 4px; letter-spacing: 0; }
.group ul { list-style: none; margin: 0 0 0 16px; padding: 0 0 0 12px; border-left: 1px solid var(--border); }
.group li { margin: 0; }
.group a { display: block; position: relative; padding: 6px 10px; margin: 1px 0; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14.5px; line-height: 1.45; transition: background 0.12s, color 0.12s; }
.group a:hover { background: var(--surface-2); color: var(--text); }
.group a[aria-current="page"] { background: hsl(var(--h, 190) 70% var(--tl)); color: hsl(var(--h, 190) 62% var(--tc)); font-weight: 600; }
.group a[aria-current="page"]::before { content: ""; position: absolute; left: -13px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: hsl(var(--h, 190) 62% var(--tc)); }
.toc { position: sticky; top: var(--top); height: calc(100dvh - var(--top)); overflow: auto; padding: 30px 20px 40px 8px; font-size: 13.5px; scrollbar-width: thin; }
.toc h2 { font-size: 12.5px; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 14px; color: var(--muted); text-decoration: none; line-height: 1.45; margin-left: -1px; border-left: 2px solid transparent; transition: color 0.12s; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-help { display: block; margin-top: 26px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); line-height: 1.5; }
.toc-help strong { display: block; font-size: 14px; }
.toc-help span { color: var(--muted); font-size: 13px; }
.toc-help:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- the page */
.main { padding: 34px clamp(18px, 4vw, 56px) 40px; min-width: 0; outline: none; }
.main article { max-width: 790px; }
.page-head { margin-bottom: 28px; }
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 2px 11px 2px 4px; border-radius: 999px; background: hsl(var(--h, 190) 70% var(--tl)); color: hsl(var(--h, 190) 62% var(--tc)); font-weight: 600; font-size: 13px; }
.chip .tile { width: 20px; height: 20px; border-radius: 999px; background: transparent; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.025em; font-weight: 800; }
body[data-lang="bn"] h1 { line-height: 1.35; letter-spacing: 0; font-weight: 700; }
.lead { font-size: 1.14rem; color: var(--muted); margin: 0 0 16px; line-height: 1.6; max-width: 62ch; }
.meta { display: flex; gap: 16px; margin: 0; color: var(--muted); font-size: 13.5px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
h2 { font-size: 1.55rem; line-height: 1.3; margin: 3rem 0 0.9rem; letter-spacing: -0.015em; font-weight: 700; }
body[data-lang="bn"] h2 { letter-spacing: 0; line-height: 1.45; }
h3 { font-size: 1.18rem; margin: 2rem 0 0.6rem; font-weight: 650; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.4rem; }
.anchor { margin-left: 8px; color: var(--border-strong); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity 0.15s; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; color: var(--accent); }
p { margin: 0 0 1.05rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
li { margin: 0.35rem 0; }
li > ul, li > ol { margin: 0.35rem 0; }
strong { font-weight: 650; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow: auto; margin: 0 0 1.3rem; }
pre code { border: 0; padding: 0; background: none; }
article kbd { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.4rem 0; }
.mtoc { display: none; }

/* numbered steps are cards */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.1rem 0 1.6rem; display: grid; gap: 10px; }
ol.steps > li { counter-increment: step; position: relative; margin: 0; padding: 14px 16px 14px 58px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); min-height: 56px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
body[data-lang="bn"] ol.steps > li::before { top: 14px; }
ol.steps > li > ul, ol.steps > li > ol { margin: 0.5rem 0 0.2rem; }
ol.steps > li figure { margin: 0.9rem 0 0.3rem; }
ol.steps > li > ol.steps { gap: 6px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; white-space: nowrap; font-size: 0.86rem; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }

/* pictures: a framed screenshot that opens big */
figure { margin: 1.5rem 0 1.8rem; }
figure .zoom { display: block; position: relative; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; cursor: zoom-in; box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.2s; }
figure .zoom:hover { border-color: var(--accent); }
figure img { display: block; width: 100%; height: auto; border-radius: 11px; background: var(--surface); }
.zoom-hint { position: absolute; right: 16px; bottom: 16px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(20, 32, 43, 0.78); color: #fff; opacity: 0; transition: opacity 0.15s; }
figure .zoom:hover .zoom-hint, figure .zoom:focus-visible .zoom-hint { opacity: 1; }
figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; line-height: 1.55; }
figure.tall .zoom { max-height: 620px; overflow: hidden; }
figure.tall .zoom::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 150px; background: linear-gradient(to top, var(--surface-2) 12%, transparent); pointer-events: none; }
.zoom-more { position: absolute; z-index: 1; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px; background: var(--surface); color: var(--accent); border: 1px solid var(--border-strong); font-size: 13.5px; font-weight: 650; box-shadow: var(--shadow); white-space: nowrap; transition: border-color 0.15s, transform 0.15s; }
figure.tall .zoom:hover .zoom-more { border-color: var(--accent); transform: translateX(-50%) translateY(-2px); }
figure.phone .zoom { max-width: 340px; margin: 0 auto; }
figure.phone figcaption { max-width: 440px; margin-left: auto; margin-right: auto; }
p > img, li > img { max-width: 100%; vertical-align: middle; }

/* callouts */
.callout { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; border-radius: 14px; padding: 14px 16px; margin: 1.3rem 0; border: 1px solid transparent; }
.callout .ci { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.callout div { min-width: 0; }
.callout p { margin: 2px 0 0; }
.callout-title { display: block; font-size: 14px; font-weight: 700; color: var(--c); }
.callout.tip { --c: var(--tip); background: var(--tip-bg); border-color: color-mix(in srgb, var(--tip) 26%, transparent); }
.callout.note { --c: var(--note); background: var(--note-bg); border-color: color-mix(in srgb, var(--note) 26%, transparent); }
.callout.warning { --c: var(--warning); background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 32%, transparent); }
.callout.important { --c: var(--important); background: var(--important-bg); border-color: color-mix(in srgb, var(--important) 32%, transparent); }

/* previous / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 790px; margin-top: 3.4rem; }
.pn a { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--text); line-height: 1.4; box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.2s, box-shadow 0.2s; }
.pn a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.pn small { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 600; }
.pn strong { font-size: 1rem; }
.pn span { color: var(--muted); font-size: 13px; }
.pn .next { text-align: right; align-items: flex-end; }
.foot { max-width: 790px; margin-top: 2.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.totop { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.totop:hover { color: var(--accent); background: var(--surface-2); }

/* ---------------------------------------------------------------- the home page */
.home { padding: 0 0 20px; }
.home article { max-width: none; }
.hero { position: relative; text-align: center; padding: 76px 20px 56px; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%),
  linear-gradient(to right, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px) 0 0 / 52px 52px,
  linear-gradient(to bottom, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px) 0 0 / 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, #000 25%, transparent 78%); mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, #000 25%, transparent 78%); }
.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 5px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.hero h1 { font-size: clamp(2.3rem, 1.4rem + 4vw, 3.9rem); margin: 18px auto 14px; max-width: 18ch; text-wrap: balance; background: linear-gradient(115deg, var(--text) 35%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.hero .lead { margin: 0 auto 30px; max-width: 56ch; font-size: 1.18rem; }
.hero-search { display: flex; align-items: center; gap: 12px; width: min(620px, 100%); height: 58px; margin: 0 auto; padding: 0 12px 0 20px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); color: var(--muted); cursor: text; box-shadow: var(--shadow); font-size: 1.02rem; text-align: left; transition: border-color 0.15s, box-shadow 0.2s; }
.hero-search:hover { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow); }
.hero-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 760px; margin: 22px auto 0; font-size: 14px; color: var(--muted); }
.chip-link { padding: 5px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; transition: border-color 0.15s, color 0.15s, transform 0.15s; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.path, .topics, .more { max-width: 1120px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }
.path { margin-top: 56px; }
.path h2, .topics h2 { margin: 0 0 18px; font-size: 1.5rem; }
.path ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: p; }
.path li { margin: 0; }
.path a { position: relative; display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 20px 20px 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.2s, box-shadow 0.2s; }
.path a:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.path .n { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: 8px; }
.path strong { font-size: 1.1rem; }
.path small { color: var(--muted); font-size: 14px; line-height: 1.55; }
.path .go { position: absolute; right: 18px; top: 22px; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.path a:hover .go { color: var(--accent); transform: translateX(3px); }
.topics { margin-top: 56px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.topic { padding: 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.topic header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.topic h3 { margin: 0; font-size: 1.12rem; }
.topic small { color: var(--muted); font-size: 13px; }
.topic ul { list-style: none; margin: 0; padding: 0; }
.topic li { margin: 0; border-top: 1px solid var(--border); }
.topic li a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 4px; color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.45; border-radius: 8px; }
.topic li a .i { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity 0.15s, transform 0.15s; }
.topic li a:hover { color: hsl(var(--h, 190) 62% var(--tc)); }
.topic li a:hover .i { opacity: 1; transform: none; color: hsl(var(--h, 190) 62% var(--tc)); }
.more { margin-top: 48px; }
.more { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 24px clamp(20px, 4vw, 36px); border: 1px solid var(--border); border-radius: 22px; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); max-width: 1040px; }
.more strong { display: block; font-size: 1.12rem; }
.more span { color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 12px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 650; border: 1px solid var(--accent); transition: transform 0.15s, filter 0.15s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.is-home .foot { max-width: 1040px; margin: 2.4rem auto 0; padding-left: clamp(18px, 4vw, 40px); padding-right: clamp(18px, 4vw, 40px); }

/* ---------------------------------------------------------------- the search palette */
#scrim { position: fixed; inset: 0; z-index: 70; background: rgba(8, 14, 20, 0.5); backdrop-filter: blur(2px); }
#scrim[hidden], #palette[hidden], #lightbox[hidden] { display: none; }
#palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 11vh 14px 14px; background: rgba(8, 14, 20, 0.5); backdrop-filter: blur(3px); }
.pal-box { width: min(660px, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-in input { flex: 1; min-width: 0; height: 58px; border: 0; background: none; color: var(--text); font: inherit; font-size: 1.05rem; outline: none; }
.pal-in input::-webkit-search-cancel-button { display: none; }
.pal-x { border: 0; background: var(--surface-2); }
#results { overflow: auto; padding: 8px; min-height: 60px; }
.res-label { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
#results a { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; line-height: 1.45; }
#results a:hover, #results a.on { background: var(--accent-soft); }
#results a .i { margin-top: 3px; color: var(--muted); }
#results a.on .i { color: var(--accent); }
#results a span { min-width: 0; }
#results strong { display: block; font-size: 15px; font-weight: 600; }
#results small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#results mark { background: color-mix(in srgb, #ffd54a 60%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
#results .none { padding: 26px 14px; text-align: center; color: var(--muted); }
.pal-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.pal-foot span { display: inline-flex; align-items: center; gap: 5px; }

#lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 14, 20, 0.92); overflow: auto; padding: 60px 20px 36px; text-align: center; cursor: zoom-out; overscroll-behavior: contain; }
#lightbox img { display: block; width: auto; max-width: min(1240px, 100%); height: auto; margin: 0 auto; border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); cursor: default; }
.lb-cap { margin: 14px auto 0; color: #d6dee5; font-size: 14px; text-align: center; max-width: 70ch; }
#lightbox button { position: fixed; top: 14px; right: 16px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer; z-index: 1; }
#lightbox button:hover { background: rgba(255, 255, 255, 0.28); }

/* ---------------------------------------------------------------- language gate and 404 */
.gate { display: grid; place-items: center; min-height: 100dvh; text-align: center; padding: 24px; background: radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--bg); }
.gate-box { width: min(560px, 100%); }
.gate-box h1 { font-size: 2.4rem; margin: 14px 0 6px; }
.gate-sub { color: var(--muted); margin: 0 0 22px; }
.gate-ask { font-weight: 600; margin: 0 0 14px; }
.gate-404 { font-size: 5rem; font-weight: 800; line-height: 1; margin: 0; background: linear-gradient(115deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gate-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; position: relative; padding: 18px 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; text-align: left; box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.2s, box-shadow 0.2s; }
.gate-card strong { font-size: 1.3rem; }
.gate-card span { color: var(--muted); font-size: 14px; }
.gate-card .i { position: absolute; right: 18px; top: 20px; color: var(--muted); }
.gate-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr); }
  .toc { display: none; }
  .mtoc { display: block; margin: 0 0 1.6rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
  .mtoc summary { cursor: pointer; padding: 12px 16px; font-weight: 650; list-style: none; display: flex; justify-content: space-between; }
  .mtoc summary::after { content: "+"; color: var(--muted); font-size: 1.2rem; line-height: 1; }
  .mtoc[open] summary::after { content: "−"; }
  .mtoc ul { margin: 0; padding: 0 16px 12px 34px; font-size: 14.5px; }
}
@media (max-width: 900px) {
  .menu { display: inline-grid; }
  .brand .pill { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(330px, 88vw); height: auto; z-index: 75; background: var(--surface); transform: translateX(-104%); transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: var(--shadow-lg); padding-top: 0; visibility: hidden; }
  body.open .side { transform: none; visibility: visible; }
  .side-head { display: flex; align-items: center; justify-content: space-between; height: var(--top); margin: 0 0 8px; padding: 0 2px 0 6px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .side { padding-left: 14px; }
  .main { padding-top: 24px; }
}
@media (max-width: 520px) {
  .searchbtn { flex: none; width: 40px; padding: 0; justify-content: center; margin-left: auto; }
  .searchbtn .st, .searchbtn kbd { display: none; }
}
@media (max-width: 640px) {
  .top { gap: 8px; padding: 0 12px; }
  .brand-name { display: none; }
  .searchbtn { padding-right: 12px; }
  .searchbtn kbd { display: none; }
  .langs .lang { padding: 5px 10px; font-size: 13px; }
  .hero { padding: 48px 16px 40px; }
  .hero-search kbd { display: none; }
  .path ol { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .pn { grid-template-columns: 1fr; }
  .pn .next { text-align: left; align-items: flex-start; }
  .gate-links { grid-template-columns: 1fr; }
  ol.steps > li { padding: 12px 12px 12px 52px; }
  ol.steps > li::before { left: 12px; top: 12px; }
  th, td { padding: 9px 11px; }
  #palette { padding: 0; }
  .pal-box { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .pal-foot { display: none; }
  figure .zoom { padding: 5px; border-radius: 14px; }
  .zoom-hint { opacity: 1; right: 11px; bottom: 11px; }
  figure.tall .zoom { max-height: 460px; }
  .zoom-more { bottom: 12px; padding: 7px 13px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .top, .side, .toc, .pn, .tools, .menu, .progress, #palette, #scrim, #lightbox, .totop, .mtoc, .zoom-hint { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  figure .zoom { box-shadow: none; padding: 0; border: 0; background: none; }
  a { color: #000; }
  h2 { break-after: avoid; }
  figure, .callout, tr, ol.steps > li { break-inside: avoid; }
}

/* ---------------------------------------------------------------- the splash on the first page of a visit: the logo builds itself */
#splash { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--bg); transition: opacity 0.45s ease, visibility 0.45s; animation: sp-auto 0.45s ease 3.4s forwards; }
#splash.done { opacity: 0; visibility: hidden; }
.no-splash #splash { display: none; }
@keyframes sp-auto { to { opacity: 0; visibility: hidden; } }
.sp-glow { position: absolute; width: min(70vmin, 560px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); animation: sp-pulse 4.2s ease-in-out infinite; }
@keyframes sp-pulse { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
.sp-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.sp-glyph { display: block; overflow: visible; filter: drop-shadow(0 14px 28px color-mix(in srgb, var(--accent) 30%, transparent)); }
.sp-word { margin: 0; font-size: 1.45rem; font-weight: 650; letter-spacing: -0.015em; opacity: 0; animation: sp-word 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.85s forwards; }
@keyframes sp-word { from { opacity: 0; transform: translateY(6px); letter-spacing: 0.06em; } to { opacity: 1; transform: none; letter-spacing: -0.015em; } }
.sp-line { position: relative; width: 7rem; height: 2px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--accent) 16%, transparent); opacity: 0; animation: sp-fade 0.5s ease 1.2s forwards; }
.sp-line::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: inherit; background: var(--accent); animation: sp-slide 1.35s cubic-bezier(0.65, 0, 0.35, 1) 1.2s infinite; }
@keyframes sp-fade { to { opacity: 1; } }
@keyframes sp-slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
/* the logo: the tile settles, the stem grows down, the bars extend one after another, then light up in turn */
.lm-tile { transform-box: fill-box; transform-origin: center; opacity: 0; animation: lm-tile 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes lm-tile { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: none; } }
.lm-bar { transform-box: fill-box; opacity: 0; }
.lm-stem { transform-origin: center top; animation: lm-grow-y 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s forwards; }
@keyframes lm-grow-y { from { opacity: 1; transform: scaleY(0); } to { opacity: 1; transform: none; } }
.lm-b1, .lm-b2, .lm-b3 { transform-origin: left center; animation: lm-grow-x 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, lm-light 1.8s ease-in-out infinite; }
.lm-b1 { animation-delay: 0.5s, 1.45s; } .lm-b2 { animation-delay: 0.62s, 1.63s; } .lm-b3 { animation-delay: 0.74s, 1.81s; }
@keyframes lm-grow-x { from { opacity: 1; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes lm-light { 0%, 100% { opacity: 1; } 35% { opacity: 0.4; } 70% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lm-tile, .lm-bar, .sp-word, .sp-line, .sp-line::after { animation: none !important; opacity: 1; transform: none; }
  .sp-line::after { inset: 0; width: 100%; }
}
@media print { #splash { display: none !important; } }
