/* ==========================================================================
   Bsporty Cloud Docs
   One stylesheet for /docs. Rubik (self hosted, Latin + Arabic), brand green
   #1AAF31 on navy ink #132C3F, light and dark themes, logical properties
   throughout so Arabic mirrors without a second stylesheet.
   ========================================================================== */

@font-face { font-family: "Rubik Docs"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/rubik-400.woff") format("woff"); }
@font-face { font-family: "Rubik Docs"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/rubik-500.woff") format("woff"); }
@font-face { font-family: "Rubik Docs"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/rubik-600.woff") format("woff"); }
@font-face { font-family: "Rubik Docs"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/rubik-700.woff") format("woff"); }

/* ---------- Tokens ---------- */
:root {
  --font: "Rubik Docs", "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --brand: #1aaf31;
  --brand-hover: #169a2b;
  --brand-ink: #0e7a22;          /* green that reads as text on white (5.3:1) */
  --brand-soft: rgba(26, 175, 49, 0.1);
  --brand-softer: rgba(26, 175, 49, 0.06);
  --brand-ring: rgba(26, 175, 49, 0.22);

  --bg: #ffffff;
  --bg-tint: #f8fafb;
  --surface: #ffffff;
  --surface-2: #f3f6f8;
  --surface-3: #eaeef2;
  --border: #e4e9ee;
  --border-strong: #d3dae1;
  --text: #132c3f;
  --text-2: #4b5e6d;
  --text-3: #7a8a97;
  --link: var(--brand-ink);
  --code-bg: #f1f4f7;
  --code-text: #0f2b3f;
  --pre-bg: #0f1b26;
  --pre-text: #e3eaf0;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --scrim: rgba(9, 18, 26, 0.42);
  --shadow-sm: 0 1px 2px rgba(19, 44, 63, 0.05);
  --shadow-md: 0 1px 2px rgba(19, 44, 63, 0.04), 0 8px 24px -12px rgba(19, 44, 63, 0.18);
  --shadow-lg: 0 2px 6px rgba(19, 44, 63, 0.05), 0 28px 64px -20px rgba(19, 44, 63, 0.35);
  --mark: rgba(255, 194, 31, 0.38);

  --note: #2f84e0;      --note-ink: #1b5fae;      --note-bg: rgba(47, 132, 224, 0.07);  --note-border: rgba(47, 132, 224, 0.26);
  --tip: #1aaf31;       --tip-ink: #0e7a22;       --tip-bg: rgba(26, 175, 49, 0.07);    --tip-border: rgba(26, 175, 49, 0.28);
  --warning: #d98a00;   --warning-ink: #8f5a00;   --warning-bg: rgba(245, 165, 36, 0.1); --warning-border: rgba(217, 138, 0, 0.32);
  --important: #d63230; --important-ink: #a82523; --important-bg: rgba(214, 50, 48, 0.06); --important-border: rgba(214, 50, 48, 0.26);

  --topbar-h: 64px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand-hover: #22c23c;
  --brand-ink: #4ad464;
  --brand-soft: rgba(26, 175, 49, 0.16);
  --brand-softer: rgba(26, 175, 49, 0.08);
  --brand-ring: rgba(74, 212, 100, 0.28);

  --bg: #0d1419;
  --bg-tint: #0f171d;
  --surface: #121b22;
  --surface-2: #18222a;
  --surface-3: #1f2b34;
  --border: #1f2a33;
  --border-strong: #2b3843;
  --text: #e6ecf1;
  --text-2: #a6b2bd;
  --text-3: #7c8a96;
  --code-bg: #1a252e;
  --code-text: #e6ecf1;
  --pre-bg: #0a1117;
  --pre-text: #dde6ee;
  --topbar-bg: rgba(13, 20, 25, 0.78);
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 28px 64px -16px rgba(0, 0, 0, 0.75);
  --mark: rgba(255, 194, 31, 0.28);

  --note-ink: #7cb6f5;      --note-bg: rgba(47, 132, 224, 0.12);  --note-border: rgba(47, 132, 224, 0.34);
  --tip-ink: #5fdb77;       --tip-bg: rgba(26, 175, 49, 0.12);    --tip-border: rgba(26, 175, 49, 0.36);
  --warning: #f5a524;       --warning-ink: #f8c46b;   --warning-bg: rgba(245, 165, 36, 0.12); --warning-border: rgba(245, 165, 36, 0.34);
  --important: #f0625f;     --important-ink: #f59391; --important-bg: rgba(214, 50, 48, 0.13); --important-border: rgba(240, 98, 95, 0.36);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}

img, svg, video, iframe { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--brand-ring); }

.doc-icon { width: 20px; height: 20px; flex: none; }

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -48px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 12px; }

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  text-decoration: none;
  border-radius: 8px;
}
.brand__logo { display: block; height: 30px; width: auto; }
:root[data-theme="dark"] .brand__logo--light,
:root:not([data-theme="dark"]) .brand__logo--dark { display: none; }
.brand__tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 440px;
  height: 40px;
  margin-inline: auto;
  padding: 0 8px 0 12px;
  padding-inline: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.9rem;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.search-trigger__label { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-trigger__icon { width: 18px; height: 18px; }

.topbar__actions { display: flex; align-items: center; gap: 4px; flex: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.topbar__menu, .topbar__search-mobile, .sidebar__close { display: none; }

.theme-toggle .doc-icon { width: 19px; height: 19px; }
:root[data-theme="dark"] .theme-toggle__moon,
:root:not([data-theme="dark"]) .theme-toggle__sun { display: none; }

.lang-menu { position: relative; }
.lang-menu__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.lang-menu__button::-webkit-details-marker { display: none; }
.lang-menu__button:hover, .lang-menu[open] .lang-menu__button { background: var(--surface-2); color: var(--text); }
.lang-menu__button .doc-icon { width: 18px; height: 18px; }
.lang-menu__chevron { width: 14px !important; height: 14px !important; transition: transform 0.2s var(--ease); }
.lang-menu[open] .lang-menu__chevron { transform: rotate(180deg); }
.lang-menu__list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop 0.14s var(--ease);
}
.lang-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
}
.lang-menu__item:hover { background: var(--surface-2); }
.lang-menu__item.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.lang-menu__code { color: var(--text-3); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.04em; }

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  color: var(--warning-ink);
  font-size: 0.875rem;
  font-weight: 500;
}
.preview-banner .doc-icon { width: 18px; height: 18px; }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  max-width: 1520px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.sidebar__inner { padding: 20px 16px 56px 20px; padding-inline: 20px 16px; }

.sidebar__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sidebar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-inline-start: -8px;
  border-radius: 8px;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.sidebar__back:hover { color: var(--text); background: var(--surface-2); }
.sidebar__back .doc-icon { width: 15px; height: 15px; }

.sidebar__space {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-inline: -10px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar__space:hover, .sidebar__space.is-active { background: var(--surface-2); }

.space-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(26, 175, 49, 0.16), rgba(26, 175, 49, 0.06));
  box-shadow: inset 0 0 0 1px rgba(26, 175, 49, 0.18);
  color: var(--brand-ink);
}
.space-icon .doc-icon { width: 22px; height: 22px; }
.space-icon--sm { width: 32px; height: 32px; border-radius: 9px; }
.space-icon--sm .doc-icon { width: 17px; height: 17px; }
.space-icon--lg { width: 60px; height: 60px; border-radius: 16px; }
.space-icon--lg .doc-icon { width: 30px; height: 30px; }

.nav-group { margin-top: 22px; }
.nav-group__title {
  margin: 0 0 6px;
  padding-inline: 10px;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.nav-group__list { margin: 0; padding: 0; list-style: none; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.925rem;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { padding-inline-start: 14px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
}
.nav-link__text { flex: 1; min-width: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge--draft { background: var(--warning-bg); color: var(--warning-ink); box-shadow: inset 0 0 0 1px var(--warning-border); }

.drawer-scrim { display: none; }

/* ---------- Main + article ---------- */
.main {
  display: flex;
  justify-content: center;
  gap: 64px;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-h));
  padding: 40px 48px 32px;
}
/* The rule between sidebar and article belongs to the content column, so it
   runs the full height of a long page instead of stopping with the sticky
   sidebar. */
.shell > .main { border-inline-start: 1px solid var(--border); }
.main--wide { display: block; padding: 40px 56px 32px; }

.article {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 72ch;
  font-size: 1.0625rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--text-3);
  font-size: 0.82rem;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: 4px; color: var(--border-strong); }
.breadcrumbs a { color: var(--text-3); text-decoration: none; border-radius: 4px; }
.breadcrumbs a:hover { color: var(--brand-ink); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.55;
}
.notice p { margin: 0; }
.notice__icon { width: 18px; height: 18px; margin-top: 1px; color: var(--text-3); }

.article__title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 1.55rem + 1.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.article__lead {
  margin: 0;
  color: var(--text-2);
  font-size: 1.2rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 22px 0 36px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.82rem;
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item .doc-icon { width: 15px; height: 15px; }

/* ---------- Prose ---------- */
.prose { color: var(--text); line-height: 1.75; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p { margin: 0 0 1.25em; text-wrap: pretty; }
.prose .lead { font-size: 1.18em; color: var(--text-2); line-height: 1.6; }

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  position: relative;
  color: var(--text);
  font-weight: 600;
  text-wrap: balance;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.prose h1, .prose h2 { margin: 2.6em 0 0.75em; font-size: 1.55em; line-height: 1.25; letter-spacing: -0.016em; }
.prose h3 { margin: 2.1em 0 0.6em; font-size: 1.22em; line-height: 1.35; letter-spacing: -0.01em; }
.prose h4 { margin: 1.8em 0 0.5em; font-size: 1.04em; line-height: 1.4; }
.prose h5, .prose h6 { margin: 1.6em 0 0.5em; font-size: 0.95em; color: var(--text-2); }

.doc-anchor {
  display: inline-block;
  margin-inline-start: 0.35em;
  padding: 0 0.2em;
  border-radius: 6px;
  color: var(--text-3);
  font-weight: 400;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.prose h1:hover .doc-anchor, .prose h2:hover .doc-anchor, .prose h3:hover .doc-anchor,
.prose h4:hover .doc-anchor, .doc-anchor:focus-visible { opacity: 1; }
.doc-anchor:hover { color: var(--brand-ink); }

.prose a:not(.link-card) {
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.15s;
}
.prose a:not(.link-card):hover { text-decoration-color: currentColor; }

.prose strong, .prose b { font-weight: 600; color: var(--text); }

.prose ul, .prose ol { margin: 0 0 1.35em; padding-inline-start: 1.45em; }
.prose li { margin: 0.4em 0; padding-inline-start: 0.2em; }
.prose li > p { margin: 0.4em 0; }
.prose li::marker { color: var(--text-3); }
.prose ol > li::marker { font-weight: 600; font-size: 0.94em; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 0.4em 0; }

.prose blockquote {
  margin: 1.75em 0;
  padding: 0.2em 1.2em;
  border-inline-start: 3px solid var(--brand);
  color: var(--text-2);
}
.prose blockquote p { margin: 0.6em 0; }

.prose code {
  padding: 0.14em 0.4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 0.86em;
  unicode-bidi: isolate;
}
.prose pre {
  margin: 1.75em 0;
  padding: 1.05em 1.25em;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--pre-bg);
  color: var(--pre-text);
  font-size: 0.86rem;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }

.prose hr { height: 1px; margin: 3em 0; border: 0; background: var(--border); }
.prose mark { padding: 0 0.15em; border-radius: 4px; background: var(--mark); color: inherit; }
.prose small { color: var(--text-2); }
.prose kbd { font-size: 0.8em; }

.prose details {
  margin: 1.5em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.prose summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style-position: inside;
}
.prose details > :not(summary) { margin-inline: 16px; }
.prose details[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }

.doc-table {
  margin: 1.75em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scrollbar-width: thin;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; line-height: 1.55; }
.prose th, .prose td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.94em; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose th p, .prose td p { margin: 0; }
.prose tbody tr:hover td { background: var(--brand-softer); }

.prose img {
  display: block;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.doc-figure { margin: 2em 0; }
.doc-figure img { margin: 0 auto; }
[data-zoom] { cursor: zoom-in; }

/* ---------- Blocks: callout ---------- */
.callout {
  --c: var(--note); --c-ink: var(--note-ink); --c-bg: var(--note-bg); --c-border: var(--note-border);
  display: flex;
  gap: 12px;
  margin: 1.75em 0;
  padding: 14px 18px 14px 14px;
  padding-inline: 14px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  font-size: 0.95em;
  line-height: 1.65;
}
.callout--tip { --c: var(--tip); --c-ink: var(--tip-ink); --c-bg: var(--tip-bg); --c-border: var(--tip-border); }
.callout--warning { --c: var(--warning); --c-ink: var(--warning-ink); --c-bg: var(--warning-bg); --c-border: var(--warning-border); }
.callout--important { --c: var(--important); --c-ink: var(--important-ink); --c-bg: var(--important-bg); --c-border: var(--important-border); }
.callout__icon { display: grid; place-items: start center; flex: none; padding-top: 2px; color: var(--c); }
.callout__icon .doc-icon { width: 20px; height: 20px; }
.callout__body { min-width: 0; flex: 1; }
.callout__title { margin: 0 0 2px !important; color: var(--c-ink); font-weight: 600; }
.callout__text { color: var(--text); }
.callout__text a { color: var(--c-ink) !important; }

/* ---------- Blocks: steps ---------- */
.steps { margin: 2em 0; padding: 0 !important; list-style: none; }
.steps > .step { position: relative; display: flex; gap: 16px; margin: 0; padding: 0 0 1.6em; }
.steps > .step:last-child { padding-bottom: 0; }
.steps > .step::before {
  content: "";
  position: absolute;
  inset-inline-start: 15px;
  top: 38px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--brand-ring), var(--border));
}
.steps > .step:last-child::before { display: none; }
.step__marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 4px var(--bg);
  color: var(--brand-ink);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step__body { flex: 1; min-width: 0; padding-top: 3px; }
.step__title { margin: 0 0 4px !important; font-weight: 600; line-height: 1.45; }
.step__text { color: var(--text-2); }

/* ---------- Blocks: screenshot ---------- */
.shot { margin: 2.25em 0; text-align: center; }
.shot__frame { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
.shot__img { display: block; width: 100%; height: auto; margin: 0 !important; }

.shot--phone .shot__frame {
  width: min(380px, 88%);
  padding: 9px;
  border-radius: 44px;
  background: linear-gradient(160deg, #26323c, #0b1116 55%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(19, 44, 63, 0.18),
    0 30px 60px -24px rgba(19, 44, 63, 0.45),
    0 12px 24px -12px rgba(19, 44, 63, 0.25);
}
.shot--phone .shot__img { border: 0 !important; border-radius: 35px !important; }

.shot--desktop .shot__frame {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.shot__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  direction: ltr;
}
.shot__chrome span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.shot__chrome span:nth-child(2) { background: #febc2e; }
.shot__chrome span:nth-child(3) { background: #28c840; }
.shot--desktop .shot__img { border: 0 !important; border-radius: 0 !important; }

.shot--none .shot__img { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }

.shot__caption, .video__caption {
  max-width: 56ch;
  margin: 14px auto 0;
  color: var(--text-3);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Blocks: link card ---------- */
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 1.5em 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease);
}
.link-card:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 0 0 4px var(--brand-softer), var(--shadow-md); }
.link-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.link-card__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.link-card__title { font-weight: 600; line-height: 1.4; }
.link-card__desc { color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.link-card__host { color: var(--text-3); font-size: 0.78rem; }
.link-card__arrow { color: var(--text-3); transition: transform 0.18s var(--ease), color 0.18s; }
.link-card:hover .link-card__arrow { color: var(--brand-ink); transform: translateX(3px); }
[dir="rtl"] .link-card__arrow { transform: scaleX(-1); }
[dir="rtl"] .link-card:hover .link-card__arrow { transform: scaleX(-1) translateX(3px); }

/* ---------- Blocks: video ---------- */
.video { margin: 2em 0; }
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: var(--shadow-md);
}
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Pager ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.pager__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.pager__link:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: 0 0 0 4px var(--brand-softer); }
.pager__link--next { grid-column: 2; text-align: end; align-items: flex-end; }
.pager__label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 0.8rem; font-weight: 500; }
.pager__label .doc-icon { width: 15px; height: 15px; }
.pager__title { font-weight: 600; line-height: 1.4; }

/* ---------- Table of contents ---------- */
.toc { flex: 0 0 224px; min-width: 0; }
.toc__inner {
  position: sticky;
  top: calc(var(--topbar-h) + 40px);
  max-height: calc(100vh - var(--topbar-h) - 80px);
  overflow-y: auto;
  scrollbar-width: none;
}
.toc__title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}
.toc__list { margin: 0; padding: 0; list-style: none; border-inline-start: 1px solid var(--border); }
.toc__link {
  display: block;
  margin-inline-start: -1px;
  padding: 5px 12px;
  border-inline-start: 2px solid transparent;
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.toc__item--h3 .toc__link { padding-inline-start: 24px; font-size: 0.8rem; }
.toc__link:hover { color: var(--text); }
.toc__link.is-active { color: var(--brand-ink); border-inline-start-color: var(--brand); font-weight: 500; }
.toc__top {
  display: inline-block;
  margin-top: 18px;
  color: var(--text-3);
  font-size: 0.78rem;
  text-decoration: none;
}
.toc__top:hover { color: var(--text); }

/* ---------- Home ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  padding: 96px 24px 72px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 44px 44px;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 90% at 50% 0%, transparent 0%, var(--bg) 72%);
  pointer-events: none;
}
.home-hero__glow {
  position: absolute;
  top: -180px;
  left: 50%;
  width: 760px;
  height: 420px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(26, 175, 49, 0.2), transparent);
  filter: blur(8px);
  pointer-events: none;
  z-index: 1;
}
.home-hero__inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  margin: 0;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--brand-ring), var(--shadow-sm);
  color: var(--brand-ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.home-hero__title {
  margin: 20px 0 14px;
  font-size: clamp(2.6rem, 1.9rem + 3vw, 4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.home-hero__lead {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--text-2);
  font-size: 1.18rem;
  line-height: 1.6;
  text-wrap: pretty;
}
.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(580px, 100%);
  height: 58px;
  margin: 36px auto 0;
  padding: 0 14px 0 18px;
  padding-inline: 18px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text-3);
  font-size: 1rem;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hero-search:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border-strong)); box-shadow: 0 0 0 5px var(--brand-softer), var(--shadow-md); }
.hero-search__icon { color: var(--brand-ink); }
.hero-search__label { flex: 1; }

.home-section { max-width: 1180px; margin: 0 auto; padding: 60px 24px 0; }
.home-section__title { margin: 0 0 20px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }

.space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.space-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.space-card:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: 0 0 0 4px var(--brand-softer), var(--shadow-md);
  transform: translateY(-2px);
}
.space-card .space-icon { margin-bottom: 6px; }
.space-card__title { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
.space-card__intro {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.space-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 500;
}
.space-card__arrow { width: 18px; height: 18px; transition: transform 0.2s var(--ease), color 0.2s; }
.space-card:hover .space-card__arrow { color: var(--brand-ink); transform: translateX(3px); }
[dir="rtl"] .space-card:hover .space-card__arrow { transform: translateX(-3px); }

.recent-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.recent-list li + li { border-top: 1px solid var(--border); }
.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.recent-item:hover { background: var(--surface-2); }
.recent-item__icon { display: grid; place-items: center; color: var(--text-3); }
.recent-item__icon .doc-icon { width: 18px; height: 18px; }
.recent-item__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.recent-item__title { font-weight: 500; line-height: 1.4; }
.recent-item__meta, .recent-item__date { color: var(--text-3); font-size: 0.8rem; }
.recent-item__date { flex: none; font-variant-numeric: tabular-nums; }

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-3);
  text-align: center;
}

/* ---------- Space landing ---------- */
.space-page { max-width: 62rem; }
.space-hero { padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.space-hero__title {
  margin: 20px 0 10px;
  font-size: clamp(2rem, 1.55rem + 1.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.024em;
}
.space-hero__intro { max-width: 44rem; margin: 0; color: var(--text-2); font-size: 1.15rem; line-height: 1.65; text-wrap: pretty; }
.space-hero .button { margin-top: 26px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.button:hover { background: var(--surface-2); }
.button .doc-icon { width: 18px; height: 18px; }
.button--primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(19, 44, 63, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.button--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.space-group { scroll-margin-top: calc(var(--topbar-h) + 24px); }
.space-group__title { margin: 44px 0 16px; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.012em; }

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.page-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px 20px;
  padding-inline-end: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.page-card:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); box-shadow: 0 0 0 4px var(--brand-softer); }
.page-card__title { font-weight: 600; line-height: 1.4; }
.page-card__summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.page-card__arrow {
  position: absolute;
  inset-inline-end: 16px;
  top: 20px;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: color 0.18s, transform 0.18s var(--ease);
}
.page-card:hover .page-card__arrow { color: var(--brand-ink); transform: translateX(3px); }
[dir="rtl"] .page-card:hover .page-card__arrow { transform: translateX(-3px); }

/* ---------- 404 ---------- */
.missing { max-width: 560px; margin: 0 auto; padding: 120px 24px 40px; text-align: center; }
.missing__code { margin: 0; color: var(--brand-ink); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; }
.missing__title { margin: 12px 0 28px; font-size: 2.2rem; letter-spacing: -0.02em; }
.missing__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 96px; border-top: 1px solid var(--border); background: var(--bg-tint); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  color: var(--text-3);
  font-size: 0.82rem;
}
.site-footer__logo { height: 24px; width: auto; }
:root[data-theme="dark"] .site-footer__logo.brand__logo--light,
:root:not([data-theme="dark"]) .site-footer__logo.brand__logo--dark { display: none; }
.site-footer__note { flex: 1; min-width: 240px; margin: 0; }
.site-footer__copy { margin: 0; }
.has-sidebar .site-footer { margin-top: 0; }

/* ---------- Command palette ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 16px;
}
.palette__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade 0.15s ease;
}
.palette__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: min(620px, 78vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(19, 44, 63, 0.04);
  animation: pop 0.18s var(--ease);
}
.palette__field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  height: 62px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.palette__icon { color: var(--brand-ink); }
.palette__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.08rem;
}
.palette__input::placeholder { color: var(--text-3); }
.palette__input::-webkit-search-cancel-button { display: none; }
.palette__esc {
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}
.palette__body { flex: 1; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.palette__status { margin: 0; padding: 36px 16px; color: var(--text-3); font-size: 0.92rem; text-align: center; }
.palette__results { margin: 0; padding: 0; list-style: none; }
.result {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  scroll-margin: 8px;
}
.result[aria-selected="true"] { background: var(--brand-soft); }
.result__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-3);
}
.result[aria-selected="true"] .result__icon { background: var(--surface); color: var(--brand-ink); }
.result__icon .doc-icon { width: 17px; height: 17px; }
.result__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.result__crumb { color: var(--text-3); font-size: 0.75rem; font-weight: 500; }
.result__title { font-weight: 600; line-height: 1.4; }
.result__snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.result mark { padding: 0 1px; border-radius: 3px; background: var(--mark); color: inherit; }
.result__enter { align-self: center; color: var(--brand-ink); opacity: 0; }
.result[aria-selected="true"] .result__enter { opacity: 1; }
.result__enter .doc-icon { width: 16px; height: 16px; }
[dir="rtl"] .result__enter .doc-icon { transform: scaleX(-1); }
.palette__foot {
  display: flex;
  gap: 18px;
  flex: none;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.75rem;
}
.palette__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Lightbox + toast ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  background: rgba(5, 10, 14, 0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
  animation: fade 0.18s ease;
}
.lightbox__figure { margin: 0; text-align: center; }
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: pop 0.2s var(--ease);
}
.lightbox__caption { margin-top: 14px; color: #c9d3db; font-size: 0.9rem; }
.lightbox__close { position: absolute; top: 16px; inset-inline-end: 16px; color: #fff; }
.lightbox__close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 130;
  padding: 10px 16px;
  border-radius: 11px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: rise 0.2s var(--ease);
}

@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Arabic ---------- */
:lang(ar) { letter-spacing: 0 !important; }
.prose:lang(ar) { font-size: 1.06em; line-height: 1.95; }
.article__header:lang(ar) .article__lead, .space-hero__intro:lang(ar), .home-hero__lead:lang(ar) { line-height: 1.8; }
html[lang="ar"] .nav-group__title, html[lang="ar"] .toc__title { text-transform: none; font-size: 0.8rem; }
html[lang="ar"] .home-hero__title { line-height: 1.2; }
.prose:lang(ar) h1, .prose:lang(ar) h2, .prose:lang(ar) h3 { line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .toc { display: none; }
  .main { padding-inline: 48px; }
}

@media (max-width: 1023px) {
  .shell { display: block; }
  .topbar__menu, .sidebar__close { display: inline-grid; }
  .topbar__inner { padding: 0 12px; gap: 8px; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 90;
    width: min(330px, 88vw);
    height: 100%;
    border-inline-end: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform 0.28s var(--ease), visibility 0s linear 0.28s;
  }
  [dir="rtl"] .sidebar { transform: translateX(104%); }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform 0.28s var(--ease); }
  .sidebar__inner { padding-top: 14px; }
  .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 85; background: var(--scrim); animation: fade 0.2s ease; }
  .main, .main--wide { padding: 28px 20px 24px; }
  .shell > .main { border-inline-start: 0; }
  .article { max-width: 72ch; margin: 0 auto; }
  .space-page { margin: 0 auto; }
}

@media (max-width: 719px) {
  :root { --topbar-h: 58px; }
  .search-trigger { display: none; }
  .topbar__search-mobile { display: inline-grid; }
  .topbar__actions { margin-inline-start: auto; }
  .brand__logo { height: 26px; }
  .brand__tag { font-size: 0.72rem; padding: 2px 8px; }
  .lang-menu__current, .lang-menu__chevron { display: none; }
  .home-hero { padding: 64px 20px 48px; }
  .home-hero__lead { font-size: 1.05rem; }
  .hero-search { height: 52px; }
  .hero-search__kbd { display: none; }
  .home-section { padding: 44px 16px 0; }
  .article { font-size: 1rem; }
  .article__lead { font-size: 1.08rem; }
  .pager { grid-template-columns: 1fr; }
  .pager__link--next { grid-column: 1; }
  .palette { padding: 10px; }
  .palette__panel { max-height: calc(100dvh - 20px); border-radius: 16px; }
  .palette__foot { display: none; }
  .shot--phone .shot__frame { width: min(260px, 86%); border-radius: 38px; }
  .shot--phone .shot__img { border-radius: 30px !important; }
  .callout { padding-inline: 12px 14px; }
  .site-footer__inner { padding: 24px 16px 32px; }
}

@media (hover: none) {
  .doc-anchor { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #f4f6f8; --border: #d6dde3; --border-strong: #c3ccd4;
    --text: #000; --text-2: #333; --text-3: #555; --link: #000; --code-bg: #f4f6f8; --code-text: #000;
    --pre-bg: #f4f6f8; --pre-text: #000;
    color-scheme: light;
  }
  body { background: #fff; font-size: 11pt; }
  .topbar, .sidebar, .drawer-scrim, .toc, .pager, .palette, .lightbox, .toast, .skip-link,
  .site-footer, .doc-anchor, .preview-banner, .breadcrumbs, .video { display: none !important; }
  .shell, .main { display: block; max-width: none; padding: 0; }
  .article { max-width: none; font-size: 11pt; }
  .article__meta { margin: 8pt 0 16pt; }
  .prose a:not(.link-card)[href^="http"]::after { content: " (" attr(href) ")"; color: #555; font-size: 0.85em; font-weight: 400; }
  .prose pre { white-space: pre-wrap; box-shadow: none; border: 1px solid #ccc; }
  .prose h2, .prose h3, .prose h4 { break-after: avoid; }
  .shot, .callout, .steps, .link-card, .doc-figure, .doc-table, pre { break-inside: avoid; }
  .shot--phone .shot__frame { width: 200px; padding: 0; background: none; box-shadow: none; }
  .shot--phone .shot__img { border: 1px solid #ccc !important; border-radius: 16px !important; }
  .shot--desktop .shot__frame, .link-card, .shot--none .shot__img { box-shadow: none; }
}
