/*
 * IOStream Premium Design System
 * One semantic token layer for the full product.
 * C++ identity: #00599c / #004482 / #659ad2
 * Qt Development identity: Neon #2cde85 / Pine #00414a
 */

@font-face {
  font-family: "Farhang2";
  src: url("/assets/fonts/Farhang2-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-cpp: #00599c;
  --brand-cpp-deep: #004482;
  --brand-cpp-navy: #002b49;
  --brand-cpp-sky: #659ad2;
  --brand-qt-neon: #2cde85;
  --brand-qt-pine: #00414a;

  --canvas: #f5f8fb;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --surface-3: #e5eff5;
  --ink: #0b2235;
  --ink-strong: #041725;
  --muted: #526b7b;
  --soft: #566e7d;
  --line: #d5e1e9;
  --line-strong: #bed0dc;
  --action: var(--brand-cpp);
  --action-hover: var(--brand-cpp-deep);
  /* Text/icon colour placed on top of an --action fill. */
  --on-action: #ffffff;
  --focus: #1584cc;
  /* Darkened from #14875e: as label text on --surface-2 it only reached
     4.07:1, the one status colour that failed AA at 13px. */
  --success: #10744f;
  --warning: #8b5b00;
  --future: #7257b5;
  --danger: #b74242;
  /* Tinted surfaces for status chips: keep the hue, guarantee legible text. */
  --success-ink: #0f6244;
  --warning-ink: #6d4700;
  --future-ink: #5a4291;
  --danger-ink: #8f3232;
  /* Demo/environment banner. */
  --notice-ink: #664700;
  --notice-surface: #fff4cf;
  --notice-line: #ead79b;
  /* Ink placed on top of a solid status fill. */
  --on-success: #ffffff;
  --on-warning: #ffffff;
  --on-future: #ffffff;
  --on-danger: #ffffff;

  --shadow-xs: 0 1px 2px rgba(0, 43, 73, .05);
  --shadow-sm: 0 8px 24px rgba(0, 43, 73, .07);
  --shadow-md: 0 18px 48px rgba(0, 43, 73, .10);
  --shadow-lg: 0 34px 88px rgba(0, 43, 73, .15);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;
  --step-5: clamp(2.5rem, 4.5vw, 4.2rem);
}

html[data-theme="dark"] {
  --canvas: #09121b;
  --surface: #101c27;
  --surface-2: #162635;
  --surface-3: #1b3042;
  --ink: #e8f1f7;
  --ink-strong: #ffffff;
  --muted: #a7bac8;
  --soft: #8298a8;
  --line: #223545;
  --line-strong: #344d61;
  --action: #67a8dc;
  --action-hover: #8bc2eb;
  /* The dark-theme action colour is light, so filled controls need dark ink. */
  --on-action: #04202f;
  --focus: #75bee9;
  --success: #46c99b;
  --warning: #e0a63a;
  --future: #b39ce8;
  --danger: #f0888a;
  --success-ink: #6bd8b1;
  --warning-ink: #edbc63;
  --future-ink: #c6b4ee;
  --danger-ink: #f5a3a4;
  --notice-ink: #f2cd7d;
  --notice-surface: #2a2110;
  --notice-line: #4a3a15;
  /* Dark-theme status colours are light, so their fills need dark ink. */
  --on-success: #04241a;
  --on-warning: #2a1c00;
  --on-future: #1d1233;
  --on-danger: #2e0d0e;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .22);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, .3);
  --shadow-lg: 0 34px 88px rgba(0, 0, 0, .38);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 136px;
  background: var(--canvas);
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body *:not(code):not(pre):not(kbd):not(samp):not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.fas):not(.far):not(.fab) {
  font-family: inherit;
}

/* A font preference applies to the complete Persian interface; code and
   Font Awesome remain intentionally isolated from this choice. */
html[data-font="iransans"] body *:not(code):not(pre):not(kbd):not(samp):not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.fas):not(.far):not(.fab) {
  font-family: var(--font-ui) !important;
}
html[data-font="vazirmatn"] body *:not(code):not(pre):not(kbd):not(samp):not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.fas):not(.far):not(.fab) {
  font-family: var(--font-ui) !important;
}

.fa-solid, .fas {
  font-family: "Font Awesome 7 Free" !important;
  font-weight: 900 !important;
  line-height: 1;
}

.fa-regular, .far {
  font-family: "Font Awesome 7 Free" !important;
  font-weight: 400 !important;
  line-height: 1;
}

.fa-brands, .fab {
  font-family: "Font Awesome 7 Brands" !important;
  font-weight: 400 !important;
  line-height: 1;
}

code, pre, kbd, samp {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
  letter-spacing: 0;
}

code {
  direction: ltr;
  unicode-bidi: isolate;
}

.command-trigger kbd,
.command-dialog > footer kbd {
  font-family: "Farhang2", Tahoma, sans-serif !important;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img, video { max-width: 100%; }

h1, h2, h3, h4, p { overflow-wrap: break-word; }
h1, h2, h3, h4 { color: var(--ink-strong); font-weight: 800; letter-spacing: 0; }
h1 { font-size: var(--step-5); line-height: 1.18; }
h2 { font-size: clamp(1.9rem, 3vw, 2.75rem); line-height: 1.28; }
h3 { font-size: var(--step-2); line-height: 1.4; }
p { color: var(--muted); line-height: 1.95; }
small { font-size: var(--step--1); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 3px;
}

::selection { color: #fff; background: var(--brand-cpp); }

.section-width {
  width: min(1280px, calc(100% - 48px));
  margin-inline: auto;
}

#site-main { min-height: 60vh; }

.premium-eyebrow,
.eyebrow,
.product-eyebrow,
.section-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--action);
  font-family: "Farhang2", Tahoma, sans-serif !important;
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: 0;
  direction: rtl;
}

.premium-eyebrow i { font-size: .85rem; }

.premium-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr);
  align-items: end;
  gap: clamp(30px, 6vw, 80px);
  margin-bottom: 34px;
}

.premium-section-head h2 { margin: 8px 0 0; }
.premium-section-head > p { max-width: 640px; margin: 0; }

/* Shared controls */
.button,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  color: var(--on-action);
  background: var(--action);
  border: 1px solid var(--action);
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.button:hover,
.secondary-button:hover {
  color: var(--on-action);
  background: var(--action-hover);
  border-color: var(--action-hover);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--action) 22%, transparent);
  transform: translateY(-2px);
}

.button-quiet,
.button-secondary,
.secondary-button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.button-quiet:hover,
.button-secondary:hover,
.secondary-button:hover {
  color: var(--action);
  background: color-mix(in srgb, var(--action) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--action) 45%, var(--line));
}

/* Markup uses .button-primary to state intent explicitly. It must re-assert the
   filled look because it is also written alongside .button-secondary in
   templates that pick one of the two at runtime. */
.button-primary {
  color: var(--on-action);
  background: var(--action);
  border-color: var(--action);
  box-shadow: none;
}

.button-primary:hover {
  color: var(--on-action);
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.button-light {
  color: var(--brand-cpp-navy);
  background: #fff;
  border-color: #fff;
}

.button-light:hover { color: var(--brand-cpp-deep); background: #eef8ff; border-color: #eef8ff; }

.button-qt {
  color: var(--brand-qt-pine);
  background: var(--brand-qt-neon);
  border-color: var(--brand-qt-neon);
}

.button-qt:hover {
  color: var(--brand-qt-pine);
  background: #57e89a;
  border-color: #57e89a;
  box-shadow: 0 10px 26px rgba(44, 222, 133, .22);
}

.text-link {
  /* Inline links still need a comfortable touch height (WCAG 2.5.8). */
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--action);
  font-weight: 750;
}
.text-link:hover { color: var(--action-hover); text-decoration: underline; }

input, textarea, select {
  min-height: 48px;
  width: 100%;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea { resize: vertical; }
input::placeholder,
textarea::placeholder { color: var(--soft); opacity: 1; }
input:focus, textarea:focus, select:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--action) 12%, transparent);
}

/* Shell */
.demo-banner {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 18px;
  color: var(--notice-ink);
  background: var(--notice-surface);
  border: 0;
  border-bottom: 1px solid var(--notice-line);
  font-size: .8125rem;
  font-weight: 600;
}

.demo-banner > span { display: inline-flex; align-items: center; gap: 6px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-glyph {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--brand-cpp);
  border: 0;
  border-radius: 13px;
  box-shadow: 0 9px 20px rgba(0, 89, 156, .2);
}

.brand-glyph::before {
  content: "";
  position: absolute;
  top: -13px;
  left: -12px;
  width: 38px;
  height: 38px;
  background: var(--brand-cpp-sky);
  border-radius: 50%;
  opacity: .55;
}

.brand-glyph::after { display: none; }
.brand-glyph i {
  position: relative;
  z-index: 1;
  top: auto;
  right: auto;
  width: auto;
  height: auto;
  border: 0;
  font-size: 1.08rem;
  transform: none;
}
.brand-glyph i:first-child,
.brand-glyph i:last-child { right: auto; opacity: 1; }
.brand-glyph img { width: 100%; height: 100%; object-fit: contain; }

.brand-copy { min-width: 0; display: grid; line-height: 1.25; }
.brand-copy b {
  color: var(--ink-strong);
  font-family: "Farhang2", Tahoma, sans-serif !important;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}
.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-family: "Farhang2", Tahoma, sans-serif !important;
  font-size: .8125rem;
  white-space: nowrap;
}

.primary-nav {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.primary-nav > a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.primary-nav > a i { color: var(--action); font-size: .86rem; }
.primary-nav > a::after { display: none; }
.primary-nav > a:hover { color: var(--action); background: color-mix(in srgb, var(--action) 7%, transparent); }
.primary-nav > a.active {
  color: var(--action);
  background: color-mix(in srgb, var(--brand-cpp-sky) 17%, var(--surface));
  border-color: color-mix(in srgb, var(--brand-cpp-sky) 30%, var(--line));
}

.mobile-nav-extras { display: none; }
.header-actions { display: flex; align-items: center; gap: 7px; }

.command-trigger,
.font-select,
.theme-toggle,
.account-menu > summary,
.menu-toggle,
.account-trigger,
.admin-trigger {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: none;
  font-size: .88rem;
  font-weight: 750;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.command-trigger:hover,
.font-select:hover,
.theme-toggle:hover,
.account-menu > summary:hover,
.account-trigger:hover,
.admin-trigger:hover {
  color: var(--action);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--action) 40%, var(--line));
  transform: translateY(-1px);
}

.command-trigger { min-width: 142px; justify-content: flex-start; }
.command-trigger > i { color: var(--action); font-size: 1rem; }
.command-trigger b { font-size: .875rem; }
.command-trigger kbd {
  margin-right: auto;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .8125rem;
}

.theme-toggle, .menu-toggle { width: 42px; padding: 0; }
/* Signing out is destructive enough that it needs a word, not just an icon. */
.header-logout { display: inline-flex; }
.logout-trigger { gap: 7px; padding: 0 12px; cursor: pointer; }
.logout-trigger > i { font-size: .95rem; }
.logout-trigger b { font-size: .82rem; }
.logout-trigger:hover {
  color: var(--danger, #d92d20);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--danger, #d92d20) 40%, var(--line));
  transform: translateY(-1px);
}
.font-select { width: 92px; min-width: 92px; flex: 0 0 92px; padding: 0 9px; font-family: var(--font-ui); font-size: .76rem; font-weight: 750; cursor: pointer; }
.custom-select { position: relative; width: 100%; min-width: 0; }
.custom-select.font-picker { width: 92px; min-width: 92px; flex: 0 0 92px; }
.native-select { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.custom-select-trigger { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; font: inherit; font-weight: 700; text-align: right; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.font-picker .custom-select-trigger { min-height: 42px; padding: 0 9px; background: var(--surface-2); font-size: .76rem; }
.custom-select-trigger:hover, .custom-select.is-open .custom-select-trigger { border-color: var(--action); background: var(--surface); }
.custom-select.is-open .custom-select-trigger { box-shadow: 0 0 0 4px color-mix(in srgb,var(--action) 13%,transparent); }
.custom-select-trigger > i { flex: 0 0 auto; color: var(--action); font-size: .72rem; transition: transform .18s ease; }
.custom-select.is-open .custom-select-trigger > i { transform: rotate(180deg); }
.custom-select-options { position: absolute; z-index: 90; top: calc(100% + 8px); right: 0; width: max(100%, 190px); max-height: 290px; display: grid; gap: 3px; padding: 6px; overflow-y: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); }
.font-picker .custom-select-options { width: 170px; }
.custom-select-option { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; color: var(--ink); background: transparent; border: 0; border-radius: 9px; font: inherit; font-size: .9rem; font-weight: 650; text-align: right; }
.custom-select-option:hover, .custom-select-option:focus-visible { color: var(--on-action); background: var(--action); outline: 0; }
.custom-select-option.is-selected::after { content: "\f00c"; color: currentColor; font-family: "Font Awesome 7 Free"; font-weight: 900; font-size: .78rem; }
.custom-select-option:disabled { color: var(--soft); cursor: not-allowed; opacity: .55; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 color-mix(in srgb,#fff 65%,transparent);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height: 118px; resize: vertical; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, textarea:hover { border-color: color-mix(in srgb,var(--action) 45%,var(--line-strong)); }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, textarea:focus { border-color: var(--action); box-shadow: 0 0 0 4px color-mix(in srgb,var(--action) 13%,transparent); }
.admin-trigger i, .account-trigger i { color: var(--action); }
.menu-toggle { display: none; }

.context-bar {
  min-height: 42px;
  color: var(--muted);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}

.context-bar > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.live-signal,
.standard-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  white-space: nowrap;
}

.live-signal { color: var(--ink); font-weight: 750; }
.live-signal > i {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 13%, transparent);
}

.standard-pulse { padding-right: 14px; border-right: 1px solid var(--line-strong); }
.standard-pulse span { color: var(--soft); }
.standard-pulse b { color: var(--success); font: 750 .8125rem ui-monospace, monospace; }
.standard-pulse.current b { color: var(--warning); }
.standard-pulse.horizon b { color: var(--future); }
.context-links { margin-right: auto; display: flex; align-items: center; gap: 18px; }
.context-links a { font-size: .8125rem; font-weight: 650; }
.context-links a:hover { color: var(--action); }

.navigation-progress { height: 3px; }
.navigation-progress i { background: linear-gradient(90deg, var(--brand-cpp-sky), var(--brand-cpp)); }

.command-palette[hidden] { display: none; }
.command-palette { position: fixed; z-index: 100; inset: 0; display: grid; place-items: start center; padding-top: 10vh; }
.command-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(2, 18, 30, .62); border: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.command-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 32px));
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.command-dialog > header { min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.command-dialog > header > i { color: var(--action); }
.command-dialog > header label { font-weight: 750; }
.command-dialog > header button { margin-right: auto; width: 36px; height: 36px; color: var(--muted); background: var(--surface-2); border: 0; border-radius: 9px; }
.command-dialog form { padding: 16px 18px; }
.command-dialog input { min-height: 58px; font-size: 1.05rem; }
.command-results { display: grid; gap: 6px; padding: 0 18px 18px; }
.command-results > small { color: var(--soft); }
.command-results > a { min-height: 58px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface-2); border-radius: 11px; }
.command-results > a span { display: grid; }
.command-results > a em { color: var(--muted); font-size: .83rem; font-style: normal; }
.command-results > a > i { margin-right: auto; color: var(--action); font-style: normal; font-size: .78rem; }
.command-dialog > footer { display: flex; gap: 18px; padding: 12px 18px; color: var(--soft); background: var(--surface-2); font-size: .76rem; }

/* Toasts */
.toast-stack {
  position: fixed;
  z-index: 95;
  top: 90px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(390px, calc(100vw - 48px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 11px;
  overflow: hidden;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: 4px solid var(--success);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  /* Enhanced by toast.js; without it the message simply stays visible. */
  opacity: 1;
}
.js .toast { opacity: 0; transform: translateY(-8px); }
.js .toast.is-visible { opacity: 1; transform: none; transition: opacity .22s ease, transform .22s ease; }
.js .toast.is-leaving {
  height: 0 !important;
  margin-top: -10px;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .2s ease, transform .2s ease, height .24s ease, padding .24s ease, margin .24s ease;
}

.toast-icon { margin-top: 1px; color: var(--success); font-size: 1.05rem; }
.toast-message { margin: 0; color: var(--ink); font-size: .88rem; line-height: 1.65; }

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -3px -4px 0 0;
  color: var(--soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.toast-close:hover { color: var(--ink); background: var(--surface-2); }

/* Shows how long is left, and freezes while the toast is hovered or focused. */
.toast-progress {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 2px;
  background: var(--success);
  transform-origin: right center;
  opacity: .5;
}

.toast-error { border-right-color: var(--danger); }
.toast-error .toast-icon, .toast-error .toast-progress { color: var(--danger); background: var(--danger); }
.toast-error .toast-icon { background: none; }
.toast-info { border-right-color: var(--action); }
.toast-info .toast-icon { color: var(--action); }
.toast-info .toast-progress { background: var(--action); }

@media (prefers-reduced-motion: reduce) {
  .js .toast, .js .toast.is-visible, .js .toast.is-leaving { transition: none; transform: none; }
  .toast-progress { display: none; }
}

/* Footer */
.footer {
  margin-top: 90px;
  color: #dceaf2;
  background: #031c2d;
  border-top: 5px solid var(--brand-cpp);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(150px, .7fr));
  gap: 52px;
  padding-block: 66px 52px;
}

.footer .brand-copy b { color: #fff; }
.footer .brand-copy small { color: #a9c1cf; font-size: .8125rem; }
.footer-brand p { max-width: 400px; color: #a9c1cf; font-size: .9rem; }
.footer-pulse { display: flex; align-items: center; gap: 8px; color: #b9d2df; font-size: .85rem; }
.footer-pulse i { width: 8px; height: 8px; background: #36d39a; border-radius: 50%; }
.footer-column { display: grid; align-content: start; gap: 9px; }
.footer-column > b { margin-bottom: 8px; color: #fff; font-size: 1rem; }
.footer-column a { color: #a9c1cf; font-size: .9rem; }
.footer-column a:hover { color: #fff; }
.footer-bottom { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #7998aa; border-top: 1px solid #18394c; font-size: .8125rem; }

/* Home */
.product-hero {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 15%, rgba(101, 154, 210, .18), transparent 30%),
    linear-gradient(180deg, #fff, #f4f9fc);
}

html[data-theme="dark"] .product-hero {
  background:
    radial-gradient(circle at 8% 15%, rgba(101, 154, 210, .14), transparent 30%),
    var(--canvas);
}

.product-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .35;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

.product-hero-grid {
  position: relative;
  /* Above .version-rail, which follows it and also opens a stacking context,
     so the search suggestions overlay the rail instead of being buried. */
  z-index: 2;
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
  align-items: center;
  gap: clamp(48px, 7vw, 96px);
  padding-block: 72px 48px;
}

/*
 * Hero copy columns hold horizontally scrollable chip rows. A grid item
 * defaults to min-width:auto, so the un-wrapped row's min-content would
 * stretch the track past the viewport and push the column off-screen in RTL.
 */
.product-hero-copy,
.ref-hero-copy,
.eco-hero-copy,
.standards-hero-copy,
.reference-now { min-width: 0; }

.product-status { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: .88rem; }
.product-status span { display: inline-flex; align-items: center; gap: 8px; color: var(--action); font-weight: 750; }
.product-status span i { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(20, 135, 94, .12); }
.product-status b { font-weight: 500; }
.product-hero-copy h1 { max-width: 820px; margin: 20px 0; color: var(--ink-strong); }
.product-hero-copy h1 span { display: block; color: var(--action); }
.product-hero-copy > p { max-width: 800px; margin: 0 0 26px; color: var(--muted); font-size: 1.1rem; }

/*
 * Search control.
 *
 * One field, one obvious place to type. The caption sits above the box so it
 * reads as a caption; the box itself is a single row (icon, input, submit) and
 * owns the focus ring, so the input never draws a second border inside the
 * first. Results hang below the box as an overlay.
 */
.reference-search,
.premium-search {
  position: relative;
  width: 100%;
  display: grid;
  gap: 8px;
}

.reference-search > label,
.premium-search > label {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}

.search-field {
  min-height: 64px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.search-field:hover { border-color: color-mix(in srgb, var(--action) 40%, var(--line-strong)); }

/* The ring belongs to the whole control, not the bare input inside it. */
.search-field:focus-within {
  border-color: var(--action);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--action) 15%, transparent);
}

.search-field > i {
  justify-self: center;
  color: var(--soft);
  font-size: 1.05rem;
  transition: color .18s ease;
}
.search-field:focus-within > i { color: var(--action); }

.search-field > input {
  min-height: 44px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  font-size: 1.02rem;
}
.search-field > input:focus { border: 0; box-shadow: none; }
/* The container already shows focus; a ring on the input would double it. */
.search-field > input:focus-visible { outline: 0; }
.search-field > input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-field > button {
  min-width: 120px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  color: var(--on-action);
  background: var(--action);
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  transition: background .18s ease;
}
.search-field > button:hover { background: var(--action-hover); }

.search-topic-row,
.quick-topics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.search-topic-row > span,
.quick-topics > span { color: var(--soft); font-size: .84rem; }
.search-topic-row a,
.quick-topics a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .82rem;
}
.search-topic-row a:hover,
.quick-topics a:hover { color: var(--action); border-color: var(--brand-cpp-sky); }

.reference-now {
  overflow: hidden;
  color: #fff;
  background: var(--brand-cpp-deep);
  border: 1px solid var(--brand-cpp);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.reference-now header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.15); }
.reference-now header span { color: #b9d8e9; }
.reference-now header b { display: flex; align-items: center; gap: 8px; color: #fff; }
.reference-now header b i { width: 8px; height: 8px; background: #45d49d; border-radius: 50%; }
.reference-now-main { padding: 26px 22px; }
.reference-now-main small { color: #a8c7d9; }
.reference-now-main strong { display: block; margin: 7px 0; color: #fff; font-family: "Farhang2", Tahoma, sans-serif !important; font-size: 2rem; }
.reference-now-main p { margin: 0; color: #c6dce8; font-size: .9rem; }
.reference-now dl { margin: 0; }
.reference-now dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 22px; border-top: 1px solid rgba(255,255,255,.12); }
.reference-now dt { color: #9dbdce; }
.reference-now dd { margin: 0; color: #fff; }
.reference-now > a { display: flex; align-items: center; min-height: 54px; padding: 0 22px; color: #fff; border-top: 1px solid rgba(255,255,255,.14); font-weight: 750; }

.version-rail {
  position: relative;
  z-index: 1;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.version-rail > span { margin-left: 10px; color: var(--soft); font-size: .84rem; }
.version-rail > a { min-width: 44px; min-height: 38px; display: grid; place-items: center; color: var(--muted); border-radius: 9px; font: 700 .78rem ui-monospace, monospace; }
.version-rail > a:hover { color: var(--action); background: var(--surface); }
.version-rail > a.current { color: #fff; background: var(--brand-cpp); }
.version-rail > a.future { color: var(--brand-cpp-deep); background: #bfe5f8; }
.version-rail small { margin-right: auto; color: var(--soft); font-size: .75rem; }

.reference-portal,
.standard-board,
.featured-book { padding-block: 90px; }
.product-section-head { display: grid; grid-template-columns: 1fr minmax(280px,.7fr); gap: 50px; align-items: end; margin-bottom: 34px; }
.product-section-head h2 { margin: 7px 0 0; }
.product-section-head p { margin: 0; }
.reference-browser { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 18px; }
.reference-tree, .reference-topics, .reference-brief { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.reference-tree { display: grid; align-content: start; overflow: hidden; }
.reference-tree header { display: flex; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.reference-tree header span { color: var(--soft); font-size: .78rem; }
.reference-tree > a { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.reference-tree > a > span { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 8px; }
.reference-tree > a em { color: var(--soft); font-size: .76rem; font-style: normal; }
.reference-tree > a.active { background: color-mix(in srgb,var(--action) 7%,var(--surface)); }
.reference-tree .tree-action { grid-template-columns: 1fr; color: var(--action); font-weight: 750; }
.reference-topics { padding: 20px; }
.reference-topics > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.reference-topics h3 { margin: 4px 0 0; }
.reference-topics > header span { color: var(--action); font-size: .8125rem; font-weight: 750; }
.reference-topics > header > a { color: var(--action); font-size: .84rem; font-weight: 750; }
.topic-grid { display: grid; }
.topic-grid > a { min-height: 68px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid var(--line); }
.topic-grid > a:hover { background: var(--surface-2); }
.topic-grid > a > code,
.topic-grid .topic-number { color: var(--soft); font-size: .8125rem; font-weight: 800; }
.topic-grid .topic-number { display: block; font-family: "Farhang2", Tahoma, sans-serif !important; }
.topic-grid > a > span { display: grid; }
.topic-grid > a small { color: var(--muted); }
.topic-grid > a em { color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-radius: 7px; padding: 3px 7px; font-size: .7rem; font-style: normal; }
.reference-brief { overflow: hidden; }
.reference-brief > header { display: flex; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.reference-brief > a { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.reference-brief > a > div { display: grid; }
.reference-brief > a small { color: var(--muted); }
.reference-brief > a > i { color: var(--action); font-style: normal; }
.brief-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border: 1px solid color-mix(in srgb,var(--action) 18%,var(--line)); border-radius: 10px; }
.brief-icon > i { font-size: 1rem; }

/* One accent per destination so the three shortcuts are told apart at a glance
   instead of reading as three copies of the same tile. */
.compiler-icon { color: var(--warning); background: color-mix(in srgb,var(--warning) 10%,var(--surface)); border-color: color-mix(in srgb,var(--warning) 22%,var(--line)); }
.library-icon { color: var(--success); background: color-mix(in srgb,var(--success) 10%,var(--surface)); border-color: color-mix(in srgb,var(--success) 22%,var(--line)); }
.standard-icon { color: var(--future); background: color-mix(in srgb,var(--future) 10%,var(--surface)); border-color: color-mix(in srgb,var(--future) 22%,var(--line)); }
.source-note { padding: 18px; }
.source-note p { margin: 6px 0; font-size: .84rem; }
.source-note a { color: var(--action); font-weight: 750; }

.engineering-section { padding-block: 108px; color: #fff; background: radial-gradient(circle at 12% 12%,rgba(101,154,210,.18),transparent 29%), var(--brand-cpp-navy); }
.engineering-section h2, .engineering-section h3 { color: #fff; }
.engineering-section p { color: #c4dded; }
.engineering-section .product-eyebrow { color: #9bd5f5; }
.engineering-section .product-section-head { align-items: center; margin-bottom: 42px; }
.engineering-section .product-section-head h2 { max-width: 720px; font-size: clamp(2rem,3.2vw,3.3rem); }
.engineering-section .product-section-head > p { max-width: 510px; font-size: 1.02rem; }
.engineering-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.engineering-grid > a { min-height: 342px; display: flex; flex-direction: column; padding: 27px; color: #fff; background: var(--brand-cpp-deep); border: 1px solid #2174ad; border-radius: 20px; box-shadow: 0 18px 42px rgba(0,24,52,.16); transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.engineering-grid > a:hover { background: var(--brand-cpp); border-color: var(--brand-cpp-sky); transform: translateY(-4px); }
.engineering-grid > a:hover { box-shadow: 0 24px 54px rgba(0,24,52,.28); }
.engineering-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.engineering-step { min-width: 50px; padding: 7px 10px; color: #b9e4fa; background: rgba(101,154,210,.14); border: 1px solid rgba(142,205,240,.28); border-radius: 999px; font-size: 1rem; font-weight: 850; text-align: center; }
.engineering-mark { width: 58px; height: 58px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border: 1px solid var(--brand-cpp-sky); border-radius: 17px; box-shadow: 0 10px 22px rgba(0,0,0,.14); font-size: 1.2rem; }
.engineering-grid h3 { margin: 34px 0 10px; font-size: 1.48rem; line-height: 1.35; }
.engineering-grid p { margin: 0; font-size: .96rem; line-height: 2; }
.engineering-grid b { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 22px; color: #fff; font-size: .95rem; }

.reference-shortcuts { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 26px; }
.reference-shortcuts > a { min-height: 96px; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-xs); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.reference-shortcuts > a:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.reference-shortcuts > a > span { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 13px; }
.reference-shortcuts b { display: block; color: var(--ink); font-size: .98rem; }
.reference-shortcuts small { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; }
.reference-shortcuts > a > i { color: var(--action); }

.store-hero { overflow: hidden; background: radial-gradient(circle at 10% 15%,rgba(101,154,210,.24),transparent 28%), linear-gradient(135deg,var(--brand-cpp-navy),var(--brand-cpp-deep)); }
.store-hero-grid { min-height: 390px; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.55fr); align-items: center; gap: clamp(36px,7vw,90px); padding-block: 72px; color: #fff; }
.store-hero h1 { max-width: 780px; margin: 12px 0 16px; color: #fff; }
.store-hero h1 span { color: #a8dcfa; }
.store-hero p { max-width: 720px; margin: 0; color: #cae2ef; font-size: 1.05rem; }
.store-hero .premium-eyebrow { color: #a8dcfa; }
.store-hero-note { min-height: 168px; display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 16px; padding: 22px; background: rgba(255,255,255,.08); border: 1px solid rgba(174,222,247,.28); border-radius: 20px; backdrop-filter: blur(10px); }
.store-hero-note > i { width: 54px; height: 54px; display: grid; place-items: center; color: var(--brand-cpp-deep); background: #d8f0fc; border-radius: 15px; font-size: 1.2rem; }
.store-hero-note b { display: block; color: #fff; }
.store-hero-note span { display: block; margin-top: 5px; color: #c6e2ef; font-size: .86rem; line-height: 1.8; }
.store-catalog { padding-block: 74px 42px; }
.store-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.store-toolbar h2 { margin: 6px 0 0; }
.store-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.store-filters button { min-height: 38px; padding: 7px 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .82rem; font-weight: 700; }
.store-filters button:hover, .store-filters button.active { color: #fff; background: var(--brand-cpp); border-color: var(--brand-cpp); }
.store-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.store-card { min-height: 360px; display: flex; flex-direction: column; padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-xs); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.store-card:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.store-card > header { display: flex; align-items: center; justify-content: space-between; }
.store-icon { width: 54px; height: 54px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 16px; font-size: 1.18rem; }
.store-status { padding: 5px 9px; border-radius: 999px; font-size: .74rem; font-weight: 750; }
.store-status.preview { color: var(--success-ink); background: color-mix(in srgb,var(--success) 10%,var(--surface)); }
.store-status.soon { color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 11%,var(--surface)); }
.store-eyebrow { display: block; margin-top: 26px; color: var(--action); font-size: .82rem; font-weight: 800; }
.store-card h2 { margin: 6px 0 8px; font-size: 1.4rem; }
.store-card p { margin: 0; font-size: .9rem; line-height: 1.95; }
.store-card footer { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.store-card footer small { display: block; color: var(--soft); font-size: .74rem; }
.store-card footer b { display: block; margin-top: 3px; color: var(--ink); font-size: 1.05rem; }
.store-card footer .button { min-height: 42px; padding: 8px 11px; font-size: .78rem; }
.store-process { min-height: 126px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; margin-block: 38px 90px; padding: 22px 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; }
.store-process > i { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 14px; }
.store-process b { color: var(--ink); }
.store-process p { margin: 3px 0 0; font-size: .86rem; }
.store-process a { color: var(--action); font-weight: 800; white-space: nowrap; }

@media (max-width: 1340px) {
  .primary-nav > a.store-nav { display: none; }
}

@media (max-width: 960px) {
  .reference-shortcuts { grid-template-columns: 1fr; }
  .store-hero-grid { min-height: 0; grid-template-columns: 1fr; gap: 28px; padding-block: 56px; }
  .store-hero-note { max-width: 620px; }
  .store-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 680px) {
  .reference-shortcuts > a { min-height: 84px; }
  .store-catalog { padding-block: 52px 24px; }
  .store-toolbar { align-items: flex-start; flex-direction: column; gap: 18px; }
  .store-filters { justify-content: flex-start; }
  .store-grid { grid-template-columns: 1fr; }
  .store-card { min-height: 320px; }
  .store-card footer { align-items: flex-start; flex-direction: column; }
  .store-process { grid-template-columns: 48px minmax(0,1fr); padding: 20px; }
  .store-process a { grid-column: 1 / -1; white-space: normal; }
}

.standard-board-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 16px; }
.standard-board-grid > * { min-width: 0; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.standard-board-grid article > header { display: flex; align-items: center; justify-content: space-between; }
.standard-board-grid article > header b { color: var(--action); font: 800 1.1rem ui-monospace, monospace; }
.standard-board-grid h3 { margin-top: 32px; }
.standard-board-grid p { font-size: .92rem; }
.standard-board-grid article > div { display: flex; flex-wrap: wrap; gap: 6px; }
.standard-board-grid article > div a { padding: 5px 9px; background: var(--surface-2); border-radius: 8px; font-size: .8125rem; }
.card-action { display: inline-flex; margin-top: 24px; color: var(--action); font-weight: 750; }
.standard-sources { display: grid; align-content: start; gap: 8px; }
.standard-sources > span { color: var(--soft); }
.standard-sources > a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.standard-sources > a small { color: var(--muted); }
.standard-sources > a i { grid-row: 1/3; grid-column: 2; align-self: center; color: var(--action); font-style: normal; }

.content-platform { padding-block: 90px; background: var(--surface); }
.content-type-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.content-type-grid > a { min-height: 280px; display: flex; flex-direction: column; padding: 24px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); }
.content-type-grid > a > span { color: var(--action); font-size: .84rem; font-weight: 750; }
.content-type-grid h3 { margin: 40px 0 8px; }
.content-type-grid p { margin: 0; font-size: .9rem; }
.content-type-grid b { margin-top: auto; color: var(--action); }

.featured-book { display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: clamp(50px,8vw,110px); }
.featured-book-cover { min-height: 520px; display: flex; flex-direction: column; padding: 34px; color: #fff; background: var(--brand-cpp-deep); border-radius: 8px 24px 24px 8px; box-shadow: var(--shadow-lg); }
.featured-book-cover > span { color: #8dc5e4; }
.featured-book-cover > small { margin-top: 54px; color: #bdd8e7; }
.featured-book-cover h2 { margin: 12px 0; color: #fff; }
.featured-book-cover p { margin: 0; color: #c5dce8; }
.featured-book-cover > code { margin-top: 40px; color: #7fd0fa; font-size: 1.2rem; }
.featured-book-cover footer { margin-top: auto; display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.18); padding-top: 18px; }
.featured-book-copy h2 { margin: 10px 0; }
.featured-book-copy > p { max-width: 650px; }
.featured-book-copy dl { display: grid; grid-template-columns: repeat(3,1fr); margin: 28px 0; }
.featured-book-copy dl > div { padding: 10px 18px; border-right: 1px solid var(--line); }
.featured-book-copy dl > div:first-child { border: 0; }
.featured-book-copy dt { color: var(--ink); font-size: 1.7rem; font-weight: 800; }
.featured-book-copy dd { margin: 3px 0 0; color: var(--muted); }
.product-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.membership-strip { color: #fff; background: var(--brand-cpp); }
.membership-strip-grid { min-height: 230px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 50px; }
.membership-strip h2 { margin: 8px 0; color: #fff; }
.membership-strip p { max-width: 650px; margin: 0; color: #d5ecf9; }
.membership-strip .product-eyebrow { color: #c9e9fb; }
.membership-price { display: flex; align-items: center; gap: 12px; }
.membership-price > strong { color: #fff; font-family: "Farhang2",sans-serif !important; font-size: 3.5rem; line-height: 1; }
.membership-price > span { display: grid; }
.membership-price small { color: #d5ecf9; }

/* Reference V2 */
.ref-hero {
  position: relative;
  background:
    radial-gradient(circle at 12% 10%, rgba(101,154,210,.23), transparent 32%),
    linear-gradient(180deg, #fff 0%, #eff7fc 100%);
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .ref-hero { background: radial-gradient(circle at 12% 10%, rgba(101,154,210,.12), transparent 32%), var(--canvas); }

.ref-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .34;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, transparent, #000 50%, transparent);
}

.ref-hero-grid {
  position: relative;
  z-index: 1;
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr);
  align-items: center;
  gap: clamp(50px,8vw,110px);
  padding-block: 78px 110px;
}

.ref-hero-copy h1 { margin: 16px 0 22px; }
.ref-hero-copy h1 span { color: var(--action); }
.ref-hero-copy > p { max-width: 720px; margin: 0; font-size: 1.08rem; }
.ref-hero-actions, .eco-hero-actions, .standards-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.ref-coverage {
  overflow: hidden;
  color: #fff;
  background: var(--brand-cpp-deep);
  border: 1px solid #1370ad;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.ref-coverage > header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.14); }
.ref-coverage > header span { display: flex; align-items: center; gap: 8px; color: #c5e0ef; }
.ref-coverage > header b { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.ref-coverage > header b i { width: 8px; height: 8px; background: #42dc9d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(66,220,157,.14); }
.coverage-primary { padding: 28px 22px; }
.coverage-primary small { color: #9dc6dc; }
.coverage-primary strong { display: flex; align-items: center; gap: 12px; margin: 6px 0; color: #fff; font-family: "Farhang2",sans-serif !important; font-size: 2.35rem; }
.coverage-primary strong i { color: #84c7eb; font-size: .85rem; font-style: normal; }
.coverage-primary p { margin: 0; color: #c8deea; font-size: .88rem; }
.coverage-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(255,255,255,.14); }
.coverage-grid > div { min-height: 92px; display: grid; align-content: center; padding: 15px 22px; border-left: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
.coverage-grid > div:nth-child(2n) { border-left: 0; }
.coverage-grid b { color: #fff; font-family: "Farhang2",sans-serif !important; font-size: 1.35rem; }
.coverage-grid span { color: #9fc4d8; font-size: .78rem; }
.ref-coverage footer { min-height: 52px; display: flex; align-items: center; gap: 18px; padding: 0 22px; }
.ref-coverage footer a { color: #d8edf8; font-family: "Farhang2", Tahoma, sans-serif !important; font-size: .82rem; font-weight: 700; }
.ref-coverage footer a:hover { color: #fff; }

.ref-search-surface {
  position: relative;
  z-index: 3;
  margin-top: -46px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.ref-search-surface .search-field { box-shadow: none; }
.ref-search-surface .quick-topics { margin: 14px 4px 0; }

.reference-index { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 34px; padding-block: 80px 110px; }
.ref-domain-tabs { position: sticky; top: 134px; align-self: start; display: grid; gap: 8px; }
.ref-domain-tabs > a { min-height: 74px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 2px 12px; padding: 12px 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.ref-domain-tabs > a:hover { color: var(--action); border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-sm); }
.ref-domain-tabs > a > i { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); border-radius: 10px; }
.ref-domain-tabs > a span { color: var(--ink); font-weight: 750; }
.ref-domain-tabs > a small { color: var(--soft); font-size: .8125rem; }
.ref-domain-stack { min-width: 0; display: grid; gap: 70px; }
.ref-domain { scroll-margin-top: 140px; }
.ref-domain-head { min-height: 110px; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 18px; margin-bottom: 16px; padding: 20px 22px; color: #fff; background: var(--brand-cpp-deep); border-radius: var(--radius); }
.domain-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--brand-cpp-deep); background: #fff; border-radius: 14px; font-size: 1.2rem; }
.ref-domain-head small { color: #9cc3d9; }
.ref-domain-head h2 { margin: 1px 0; color: #fff; font-size: 1.65rem; }
.ref-domain-head p { margin: 0; color: #c5dce8; font-size: .86rem; }
.ref-domain-head > b { color: #fff; font-size: .82rem; }
.ref-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ref-topic-card { min-width: 0; min-height: 124px; display: grid; grid-template-columns: 34px minmax(0,1fr) 34px; align-items: start; gap: 14px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-xs); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.ref-topic-card { position: relative; }
.ref-topic-card:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
/* Scroll targets only: no size, no grid cell, offset for the sticky header. */
.topic-anchor { position: absolute; top: 0; right: 0; width: 0; height: 0; scroll-margin-top: 150px; }
.topic-index { color: var(--soft); font-family: "Farhang2", Tahoma, sans-serif !important; font-size: .8125rem; font-weight: 800; }
.ref-topic-card h3 { margin: 0 0 5px; font-size: 1.03rem; }
.ref-topic-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.topic-arrow { width: 34px; height: 34px; display: grid; place-items: center; color: var(--action); background: var(--surface-2); border-radius: 9px; }

.reference-decisions { padding-block: 90px; background: var(--surface); border-block: 1px solid var(--line); }
.decision-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.decision-grid > a { min-height: 285px; display: flex; flex-direction: column; padding: 22px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.decision-grid > a:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.decision-grid > a > i { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 12px; }
.decision-grid > a > span { margin: 26px 0 6px; color: var(--soft); font-size: .76rem; }
.decision-grid h3 { margin: 0; }
.decision-grid p { margin: 8px 0; font-size: .88rem; }
.decision-grid b { margin-top: auto; color: var(--action); font-size: .84rem; }

.trust-panel,
.premium-cta,
.standards-trust {
  min-height: 230px;
  display: grid;
  grid-template-columns: auto 1fr minmax(280px,.8fr) auto;
  align-items: center;
  gap: 28px;
  margin-block: 90px;
  padding: 34px;
  color: #fff;
  background: var(--brand-cpp-deep);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.trust-panel { grid-template-columns: minmax(300px,.9fr) 1fr auto; }
.trust-panel h2, .premium-cta h2, .standards-trust h2 { margin: 8px 0 0; color: #fff; }
.trust-panel p, .premium-cta p, .standards-trust p { margin: 0; color: #bfd7e4; }
.trust-panel .premium-eyebrow { color: #8bcbea; }
.cta-icon { width: 62px; height: 62px; display: grid; place-items: center; color: var(--brand-cpp-deep); background: #fff; border-radius: 16px; font-size: 1.35rem; }

/* Ecosystem V2 */
.eco-hero {
  background:
    radial-gradient(circle at 5% 20%, rgba(101,154,210,.2), transparent 34%),
    linear-gradient(180deg,#fff,#f0f7fb);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .eco-hero { background: radial-gradient(circle at 5% 20%,rgba(101,154,210,.12),transparent 34%),var(--canvas); }
.eco-hero-grid { min-height: 650px; display: grid; grid-template-columns: minmax(0,1fr) minmax(470px,.92fr); align-items: center; gap: clamp(50px,7vw,100px); padding-block: 72px; }
.eco-hero-copy h1 { margin: 14px 0 20px; }
.eco-hero-copy h1 span { color: var(--action); }
.eco-hero-copy > p { max-width: 650px; margin: 0; font-size: 1.08rem; }

.ecosystem-map { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.ecosystem-map > header { min-height: 90px; display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: #fff; background: var(--brand-cpp-deep); }
.map-core { width: 52px; height: 52px; display: grid; place-items: center; background: var(--brand-cpp); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.ecosystem-map > header > div { display: grid; }
.ecosystem-map > header small { color: #9fc5da; }
.ecosystem-map > header strong { color: #fff; font-size: 1.15rem; }
.map-nodes { display: grid; grid-template-columns: repeat(3,1fr); }
.map-nodes > a { min-height: 126px; display: flex; flex-direction: column; justify-content: center; padding: 18px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: color .18s ease, background .18s ease; }
.map-nodes > a:nth-child(3n) { border-left: 0; }
.map-nodes > a:hover { color: var(--action); background: var(--surface-2); }
.map-nodes i { margin-bottom: 14px; color: var(--action); font-size: 1.15rem; }
.map-nodes span { color: var(--ink); font-weight: 750; }
.map-nodes small { color: var(--soft); font-size: .74rem; }
.ecosystem-map > footer { min-height: 58px; display: flex; align-items: center; gap: 28px; padding: 0 20px; background: var(--surface-2); }
.ecosystem-map > footer span { color: var(--muted); font-size: .82rem; }
.ecosystem-map > footer b { margin-left: 4px; color: var(--action); font-size: 1.05rem; }

.lifecycle-section { padding-block: 90px; }
.lifecycle-rail { position: relative; display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.lifecycle-rail::before { content: ""; position: absolute; top: 35px; right: 8%; left: 8%; height: 2px; background: linear-gradient(90deg,var(--brand-cpp-sky),var(--brand-cpp)); }
.lifecycle-rail li { position: relative; z-index: 1; min-height: 165px; display: grid; justify-items: center; align-content: start; padding: 17px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.lifecycle-rail li > span { position: absolute; top: 8px; right: 10px; color: var(--soft); font-size: .7rem; }
.lifecycle-rail li > i { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 17px; color: #fff; background: var(--brand-cpp); border: 6px solid var(--canvas); border-radius: 50%; }
.lifecycle-rail li div { display: grid; }
.lifecycle-rail li small { color: var(--muted); }

.explore-index { padding-block: 30px 100px; }
.explore-toolbar { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 22px; margin-bottom: 26px; }
.explore-toolbar h2 { margin: 7px 0 0; }
.explore-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.explore-filters button,
.filter-row button,
.standard-filter button {
  min-height: 42px;
  padding: 8px 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
}
.explore-filters button:hover,
.filter-row button:hover,
.standard-filter button:hover { color: var(--action); border-color: var(--brand-cpp-sky); }
.explore-filters button.active,
.filter-row button.active,
.standard-filter button.active { color: #fff; background: var(--brand-cpp); border-color: var(--brand-cpp); }
.resource-count { color: var(--soft); font-size: .82rem; }
.premium-resource-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.resource-card {
  min-width: 0;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.resource-card:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.resource-card[hidden] { display: none; }
.resource-card > header { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; margin: 0; color: inherit; }
.resource-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--brand-cpp); background: color-mix(in srgb,var(--brand-cpp) 8%,var(--surface)); border-radius: 12px; font-size: 1rem !important; letter-spacing: 0 !important; }
.resource-card > header > div { min-width: 0; display: grid; }
.resource-card > header small { color: var(--soft); font-size: .78rem; }
.resource-card > header b { overflow: hidden; padding: 0; color: var(--ink); background: transparent; border-radius: 0; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.resource-card > header > i { color: var(--soft); font-size: .82rem; }
.resource-card h3 { margin: 38px 0 8px; color: var(--ink-strong); font-size: 1.45rem; }
.resource-card p { margin: 0; font-size: .9rem; }
.resource-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.resource-card .resource-tags span { padding: 4px 8px; color: var(--muted); background: var(--surface-2); border: 0; border-radius: 7px; font-family: "Farhang2", Tahoma, sans-serif !important; font-size: .72rem; }
.resource-card > .resource-action {
  margin-top: auto;
  padding-top: 22px;
  color: var(--action);
  font-size: .875rem;
  font-weight: 750;
}
.resource-featured { color: #fff; background: var(--brand-cpp-deep); border-color: #176b9e; }
.resource-featured .resource-icon { color: var(--brand-cpp-deep); background: #fff; }
.resource-featured > header small, .resource-featured p { color: #b9d3e2; }
.resource-featured > header b, .resource-featured h3, .resource-featured .resource-action { color: #fff; }
.resource-featured .resource-tags span { color: #d4e7f0; background: rgba(255,255,255,.1); }
.resource-qt { border-top: 5px solid var(--brand-qt-neon); }
.resource-qt .resource-icon { color: var(--brand-qt-pine); background: var(--brand-qt-neon); }
.eco-cta { margin-top: 0; }

/* Standards V2 */
.standards-hero {
  background:
    radial-gradient(circle at 6% 14%,rgba(101,154,210,.2),transparent 34%),
    linear-gradient(180deg,#fff,#eff7fb);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .standards-hero { background: radial-gradient(circle at 6% 14%,rgba(101,154,210,.12),transparent 34%),var(--canvas); }
.standards-hero-grid { min-height: 620px; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(390px,.75fr); align-items: center; gap: clamp(50px,8vw,110px); padding-block: 74px; }
.standards-hero-copy h1 { margin: 15px 0 20px; }
.standards-hero-copy h1 span { color: var(--brand-cpp); }
.standards-hero-copy > p { max-width: 720px; margin: 0; font-size: 1.08rem; }
.standards-radar { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.standards-radar > header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: #fff; background: var(--brand-cpp-deep); }
.standards-radar > header span { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.standards-radar > header small { color: #9fc1d4; }
.radar-row { min-height: 95px; display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.radar-row > i { width: 10px; height: 10px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 5px color-mix(in srgb,var(--success) 12%,transparent); }
.radar-row > div { display: grid; }
.radar-row small { color: var(--soft); }
.radar-row b { color: var(--ink); font-size: 1.3rem; }
.radar-row > span { color: var(--muted); font-size: .8rem; }
.radar-process > i { background: var(--warning); box-shadow: 0 0 0 5px color-mix(in srgb,var(--warning) 12%,transparent); }
.radar-horizon > i { background: var(--future); box-shadow: 0 0 0 5px color-mix(in srgb,var(--future) 12%,transparent); }
.standards-radar footer { min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--surface-2); }
.standards-radar footer i { color: var(--action); }
.standards-radar footer p { margin: 0; font-size: .78rem; }

.status-glossary { padding-block: 72px; }
.status-glossary > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.status-glossary h2 { margin: 6px 0 0; }
.status-glossary > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.status-glossary article { min-height: 150px; display: grid; grid-template-columns: 48px 1fr; align-items: start; gap: 14px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.status-symbol { width: 48px; height: 48px; display: grid; place-items: center; color: var(--on-success); background: var(--success); border-radius: 13px; }
.status-symbol.process { background: var(--warning); }
.status-symbol.horizon { background: var(--future); }
.status-glossary h3 { margin: 0 0 4px; }
.status-glossary p { margin: 0; font-size: .86rem; }

.version-navigator { min-height: 76px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.version-navigator > span { padding-inline: 8px; color: var(--soft); white-space: nowrap; }
.version-navigator > a { min-width: 78px; min-height: 48px; display: grid; place-items: center; align-content: center; color: var(--muted); background: var(--surface-2); border-radius: 10px; white-space: nowrap; }
.version-navigator > a:hover { color: var(--action); }
.version-navigator > a.active { color: var(--action); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--action) 55%, transparent); }
.version-navigator > a.current { color: #fff; background: var(--brand-cpp); }
.version-navigator > a.future { color: var(--on-future); background: var(--future); }
.version-navigator > a.current.active,
.version-navigator > a.future.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,.82), 0 8px 22px color-mix(in srgb, currentColor 12%, transparent); }
.version-navigator small { font-size: .78rem; }

.standards-snapshot { padding-block: 90px; }
.snapshot-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.snapshot-grid article { min-height: 320px; display: flex; flex-direction: column; padding: 25px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--success); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.snapshot-grid article.process { border-top-color: var(--warning); }
.snapshot-grid article.horizon { border-top-color: var(--future); }
.snapshot-grid header { display: flex; justify-content: space-between; color: var(--success); }
.snapshot-grid .process header { color: var(--warning); }
.snapshot-grid .horizon header { color: var(--future); }
.snapshot-grid h3 { margin: 48px 0 8px; font-size: 2.2rem; }
.snapshot-grid p { margin: 0; }
.snapshot-grid a { margin-top: auto; color: var(--action); font-weight: 750; }

.standard-timeline { padding-block: 90px; background: var(--surface); border-block: 1px solid var(--line); }
.standard-timeline-grid { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 50px; }
.timeline-guide { position: sticky; top: 140px; align-self: start; }
.timeline-guide h2 { margin: 8px 0 14px; }
.timeline-guide p { margin: 0; }
.timeline-guide nav { display: grid; gap: 4px; margin-top: 24px; padding-right: 14px; border-right: 2px solid var(--line); }
.timeline-guide nav a { padding: 6px 12px; color: var(--muted); }
.timeline-guide nav a:hover { color: var(--action); }
.timeline-guide nav a.active { color: var(--action); background: color-mix(in srgb, var(--action) 8%, transparent); border-radius: 8px; font-weight: 750; }
.timeline-stream { position: relative; display: grid; gap: 12px; padding-right: 32px; }
.timeline-stream::before { content: ""; position: absolute; top: 38px; right: 8px; bottom: 38px; width: 2px; background: linear-gradient(var(--line-strong) 0 18%,var(--success) 18% 83%,var(--warning) 83% 92%,var(--future) 92%); }
.era-card { position: relative; min-height: 175px; display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 0; padding-bottom: 0; overflow: visible; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); scroll-margin-top: 155px; }
.era-card::before { content: ""; position: absolute; top: 38px; right: -31px; width: 14px; height: 14px; background: var(--soft); border: 4px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 2px var(--soft); }
.era-published::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.era-process::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.era-horizon::before { background: var(--future); box-shadow: 0 0 0 2px var(--future); }
.era-marker { display: grid; place-items: center; align-content: center; color: var(--action); background: var(--surface-2); border-left: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; }
.era-marker span { font-family: "Farhang2",sans-serif !important; font-size: 1.35rem; font-weight: 800; }
.era-marker i { width: 28px; height: 3px; margin-top: 9px; background: var(--brand-cpp-sky); border-radius: 99px; }
.era-content { min-height: 0; padding: 24px 26px; background: transparent; border: 0; border-radius: 0; }
.era-content > header { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin: 0; }
.era-content > header span { color: var(--action); font-family: "Farhang2",sans-serif !important; font-size: .78rem; font-weight: 750; }
.era-content > header b { color: var(--muted); font-size: .78rem; }
.era-content h3 { margin: 16px 0 6px; }
.era-content p { margin: 0; font-size: .9rem; }
.standards-trust { grid-template-columns: auto 1fr auto; }
.standards-trust-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Books */
.books-hero {
  padding-block: 82px 72px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0,rgba(101,154,210,.2),transparent 42%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.books-hero h1 { margin: 14px auto 18px; }
.books-hero h1 span { color: var(--brand-cpp); }
.books-hero p { max-width: 780px; margin: 0 auto; }
.books-hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.books-hero-meta span { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; background: var(--canvas); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.books-hero-meta b { color: var(--action); font-size: 1.1rem; }
.learning-tracks { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding-block: 60px 80px; }
.learning-track { min-height: 260px; display: flex; flex-direction: column; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--brand-cpp); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .2s ease,box-shadow .2s ease; }
.learning-track:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.track-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 24px; color: #fff; background: var(--brand-cpp); border-radius: 13px; }
.learning-track small { color: var(--soft); }
.learning-track h2 { margin: 4px 0; font-size: 1.45rem; }
.learning-track p { margin: 0; font-size: .88rem; }
.learning-track b { margin-top: auto; color: var(--action); font-size: .84rem; }
.learning-track-advanced { border-top-color: var(--brand-cpp-navy); }
.learning-track-qt { border-top-color: var(--brand-qt-neon); }
.learning-track-qt .track-icon { color: var(--brand-qt-pine); background: var(--brand-qt-neon); }
.learning-track-qt b { color: var(--brand-qt-pine); }
html[data-theme="dark"] .learning-track-qt b { color: var(--brand-qt-neon); }
.book-track { padding-block: 20px 80px; scroll-margin-top: 130px; }
.book-track > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.book-track > header h2 { max-width: 840px; margin: 5px 0 0; }
/* The bare "۱ عنوان" here read as a stray digit floating beside the heading. */
.book-track > header > .track-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 6px 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.book-track > header > .track-count > i { color: var(--soft); font-size: .85rem; }
.track-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 22px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.catalog-price { color: var(--action); font-weight: 800; }
.book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 0; }
.book-grid > .catalog-card:only-child { grid-column: 1 / -1; width: min(100%, 980px); justify-self: center; }
.catalog-card { min-width: 0; display: grid; grid-template-columns: 250px minmax(0,1fr); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mini-cover { min-height: 410px; display: flex; flex-direction: column; padding: 26px; color: #fff; background: var(--brand-cpp-deep); }
.cover-brandmark { align-self: flex-start; min-width: 52px; min-height: 40px; display: grid; place-items: center; padding: 5px 9px; color: var(--brand-cpp-deep); background: #fff; border-radius: 7px; font: 900 .95rem/1 ui-monospace,monospace !important; }
.mini-cover > small { margin-top: auto; color: #9fc6da; }
.mini-cover > strong { margin-top: 10px; color: #fff; font-size: 1.45rem; line-height: 1.55; }
.mini-cover > p { margin: 8px 0; color: #c3dbe7; font-size: .84rem; }
.mini-cover > footer { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.17); color: #a9c9d9; }
.catalog-copy { min-width: 0; display: flex; flex-direction: column; padding: 26px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { min-height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: .75rem; }
.tag-fa { font-family: "Farhang2",sans-serif !important; direction: rtl; }
.tag-code { direction: ltr; }
.catalog-copy h3 { margin: 34px 0 8px; }
.catalog-copy > p { margin: 0; font-size: .88rem; }
.catalog-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 20px 0; color: var(--muted); font-size: .78rem; }
.catalog-meta span { display: inline-flex; align-items: center; gap: 6px; }
.catalog-copy > .button { align-self: flex-start; margin-top: auto; }
[data-book-brand="qt"] .mini-cover { color: #fff; background: var(--brand-qt-pine); }
[data-book-brand="qt"] .cover-brandmark { color: var(--brand-qt-pine); background: var(--brand-qt-neon); }
[data-book-brand="qt"] .mini-cover > small,
[data-book-brand="qt"] .mini-cover > p,
[data-book-brand="qt"] .mini-cover > footer { color: #b9e5dc; }

.book-detail { min-height: 0; display: block; padding-block: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.book-detail-grid { min-height: 680px; display: grid; grid-template-columns: minmax(320px,.72fr) minmax(0,1.28fr); align-items: center; gap: clamp(52px,8vw,110px); padding-block: 72px; }
.book-detail-cover { min-width: 0; background: none; }
.book-cover.large { width: min(100%,420px); min-height: 550px; display: flex; flex-direction: column; margin-inline: auto; padding: 34px; color: #fff; background: var(--brand-cpp-deep); border-radius: 8px 24px 24px 8px; box-shadow: var(--shadow-lg); }
.book-cover.large > small { margin-top: auto; color: #9fc6da; }
.book-cover.large h3 { margin: 12px 0 8px; color: #fff; font-size: 2rem; }
.book-cover.large p { margin: 0; color: #c5dce8; font-size: .875rem; }
.book-cover.large footer { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.17); }
.book-cover.large footer b { font-size: .875rem; }
.book-cover.large footer i { color: #8bd3f5; font-size: 1.2rem; }
.book-detail-copy { min-width: 0; }
.book-detail-copy .tag-row { margin: 10px 0 18px; }
.book-detail-copy h1 { margin: 0; font-size: clamp(2.5rem,4.5vw,4rem); }
.book-detail-copy h2 { margin: 8px 0 18px; color: var(--muted); font-size: 1.35rem; font-weight: 600; }
.book-detail-copy > p { max-width: 720px; margin: 0; }
.book-stats { display: grid; grid-template-columns: repeat(3,1fr); max-width: 570px; margin: 28px 0; border-block: 1px solid var(--line); }
.book-stats > div { display: grid; padding: 14px 18px; border-right: 1px solid var(--line); }
.book-stats > div:first-child { border: 0; }
.book-stats b { color: var(--ink); font-family: "Farhang2",sans-serif !important; font-size: 1.65rem; }
.book-stats span { color: var(--muted); font-size: .78rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
[data-book-brand="qt"].book-detail { background: var(--surface); border-top: 7px solid var(--brand-qt-neon); }
[data-book-brand="qt"] .book-detail-cover { padding: 34px; background: color-mix(in srgb,var(--brand-qt-neon) 10%,var(--surface)); border-radius: var(--radius-lg); }
[data-book-brand="qt"] .book-cover.large { color: #fff; background: var(--brand-qt-pine); }
[data-book-brand="qt"] .book-cover.large .cover-brandmark { color: var(--brand-qt-pine); background: var(--brand-qt-neon); }
[data-book-brand="qt"] .book-cover.large > small,
[data-book-brand="qt"] .book-cover.large p { color: #b8e2d9; }
[data-book-brand="qt"] .book-cover.large footer i { color: var(--brand-qt-neon); }
[data-book-brand="qt"] .premium-eyebrow { color: var(--brand-qt-pine); }
html[data-theme="dark"] [data-book-brand="qt"] .premium-eyebrow { color: var(--brand-qt-neon); }

.qt-lifecycle { padding-block: 82px; color: #fff; background: var(--brand-qt-pine); }
.qt-lifecycle h2 { color: #fff; }
.qt-lifecycle p { color: #b9e4db; }
.qt-lifecycle .premium-eyebrow { color: var(--brand-qt-neon); }
.qt-lifecycle ol { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.qt-lifecycle li { min-height: 170px; display: flex; flex-direction: column; padding: 19px; color: var(--brand-qt-pine); background: var(--brand-qt-neon); border-radius: 4px; }
.qt-lifecycle li > span { font-size: .72rem; }
.qt-lifecycle li > i { margin: 20px 0 auto; font-size: 1.25rem; }
.qt-lifecycle li small { color: #0d655e; }
.syllabus { padding-block: 90px; }
.chapter-list { display: grid; gap: 8px; background: transparent; }
.chapter-list > a { min-height: 86px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; padding: 13px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; transition: border-color .18s ease,transform .18s ease,box-shadow .18s ease; }
.chapter-list > a:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-sm); transform: translateX(-3px); }
.chapter-number { width: 42px; height: 42px; display: grid; place-items: center; color: var(--action); background: var(--surface-2); border-radius: 11px; font-family: "Farhang2",sans-serif !important; font-size: .875rem; font-weight: 800; }
.chapter-list > a > span:nth-child(2) { min-width: 0; display: grid; }
.chapter-list b { font-size: .95rem; }
/*
 * Two lines, not one. Nearly every chapter summary is longer than a single
 * line, and clipping at one line cut all of them mid-sentence, which left the
 * syllabus with no usable information about any chapter.
 */
.chapter-list small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.6;
}
.chapter-access { min-width: 58px; padding: 5px 9px; color: var(--success-ink); background: color-mix(in srgb,var(--success) 10%,var(--surface)); border-radius: 8px; font-size: .75rem; text-align: center; }
.books-cta { margin-top: 10px; }

/* Page headings and portal surfaces */
.product-page-head,
.portal-hero,
.about-hero,
.page-header {
  width: 100%;
  padding-block: 76px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.product-page-head .page-head-grid,
.portal-hero-grid,
.about-hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr);
  /* Centred, not bottom-aligned: the side card is always shorter than the
     copy, and `end` pinned it to the baseline with a block of dead space
     above it. */
  align-items: center;
  gap: clamp(32px,5vw,60px);
}
.product-page-head .page-head-grid > *,
.portal-hero-grid > *,
.about-hero-grid > * { min-width: 0; }
.portal-hero-grid { min-height: 280px; }
.portal-hero-copy { padding-inline: 4px; }
.product-page-head h1,
.portal-hero h1,
.about-hero h1 { margin: 12px 0; }
.product-page-head p,
.portal-hero p,
.about-hero p { max-width: 780px; margin: 0; font-size: 1.05rem; }

.page-header-inner h1 { margin: 12px 0; }
.page-header-inner p { max-width: 780px; margin: 0; color: var(--muted); font-size: 1.05rem; }

/*
 * One text measure for every page header.
 *
 * The two-column heads (.product-page-head, .portal-hero) get a ~763px copy
 * column from their grid. The single-column heads had no cap, so their h1 ran
 * the full 1280px while the paragraph below stopped at 780px — a ragged left
 * edge in RTL and a different-looking header on every page. Capping the
 * heading makes all of them read as the same component.
 */
.about-hero h1,
.page-header-inner h1 { max-width: 800px; }
.page-header-inner.centered { text-align: center; }
.page-header-inner.centered h1,
.page-header-inner.centered p { margin-inline: auto; }
.page-header-inner.centered .eyebrow { justify-content: center; }
.compiler-principle,
.project-principle {
  padding: 22px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-right: 5px solid var(--brand-cpp);
  border-radius: 13px;
}
.compiler-principle span,
.project-principle b { color: var(--action); font-weight: 750; }
.compiler-principle p { margin: 8px 0 0; font-size: .88rem; }
.project-principle { display: grid; gap: 6px; }
.project-principle span { color: var(--muted); }

.toolchain-layers,
.principles-grid,
.trust-strip,
.admin-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; padding-block: 54px; }
.toolchain-layers article,
.principles-grid article,
.trust-strip > div { min-height: 190px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolchain-layers article > span { color: var(--action); font-size: .8rem; }
.toolchain-layers h2,
.principles-grid h2 { margin: 28px 0 7px; font-size: 1.35rem; }
.toolchain-layers p,
.principles-grid p { margin: 0; font-size: .86rem; }

.principles-grid { grid-template-columns: repeat(4,1fr); }

.download-hero .portal-hero-grid { min-height: 318px; }
.download-status { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.download-status > header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; color: #fff; background: var(--brand-cpp-deep); }
.download-status > header > span { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; }
.download-status > header > b { display: inline-flex; align-items: center; gap: 7px; color: #c8dde8; font-size: .76rem; }
.download-status > header > b > i { width: 8px; height: 8px; background: var(--brand-qt-neon); border-radius: 50%; box-shadow: 0 0 0 4px rgba(44,222,133,.14); }
.download-status-primary { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0 14px; padding: 28px 24px; }
.download-status-primary strong { grid-row: 1 / 3; color: var(--action); font-family: "Farhang2",sans-serif !important; font-size: 3.8rem; line-height: 1; }
.download-status-primary > span { color: var(--ink); font-weight: 800; }
.download-status-primary p { grid-column: 1 / -1; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .84rem; }
.download-status > footer { display: flex; align-items: center; gap: 18px; padding: 13px 20px; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); font-size: .78rem; }
.download-status > footer span { display: inline-flex; align-items: center; gap: 6px; }
.download-status > footer i { color: var(--action); }

.trust-strip { grid-template-columns: repeat(4,1fr); padding-block: 36px 54px; }
.trust-strip > article { min-height: 132px; display: grid; grid-template-columns: 42px 1fr; align-content: center; gap: 2px 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.trust-strip > article > i { grid-row: 1 / 3; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 11px; }
.trust-strip > article > b { color: var(--ink); }
.trust-strip > article > span { color: var(--muted); font-size: .78rem; }

.compiler-overview { padding-block: 20px 90px; }
.compiler-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.compiler-cards article { min-height: 370px; display: flex; flex-direction: column; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--brand-cpp); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.compiler-cards article > header { display: flex; align-items: center; justify-content: space-between; }
.compiler-cards article > header b { color: var(--ink); font-size: 1.35rem; }
.compiler-cards article > header span { color: var(--soft); }
.compiler-cards article > p { margin: 35px 0 18px; }
.compiler-cards article > div { display: grid; gap: 5px; padding: 13px; background: var(--surface-2); border-radius: 10px; }
.compiler-cards article > div span { color: var(--soft); font-size: .76rem; }
.compiler-cards article footer { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.compiler-cards article footer a { color: var(--action); font-size: .82rem; font-weight: 750; }
.compiler-matrix-product { margin-top: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.compiler-matrix-product > header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 26px; border-bottom: 1px solid var(--line); }
.compiler-matrix-product h2 { margin: 5px 0 0; font-size: 1.7rem; }
.standard-filter { display: flex; flex-wrap: wrap; gap: 5px; }
.compiler-table-wrap { overflow-x: auto; }
.compiler-feature-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.compiler-feature-table th,
.compiler-feature-table td { padding: 15px 20px; text-align: right; border-bottom: 1px solid var(--line); }
.compiler-feature-table th { color: var(--muted); background: var(--surface-2); font-size: .78rem; }
.compiler-feature-table td small { display: block; color: var(--soft); }
.compiler-feature-table a { color: var(--action); font-weight: 700; }
.compiler-matrix-product > footer { padding: 16px 22px; color: var(--muted); background: var(--surface-2); font-size: .8rem; }

.toolchain-guide { padding-block: 86px; color: #fff; background: var(--brand-cpp-deep); }
.toolchain-guide .product-section-head { margin-bottom: 28px; }
.toolchain-guide .product-section-head h2 { color: #fff; }
.toolchain-guide .product-section-head p { color: #c6dce8; }
.toolchain-guide .product-eyebrow { color: #8bd0f4; }
.toolchain-steps { position: relative; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 0 28px; padding: 0; list-style: none; }
.toolchain-steps::before { content: ""; position: absolute; top: 27px; right: 8%; left: 8%; height: 1px; background: #39718f; }
.toolchain-steps > li { position: relative; z-index: 1; min-height: 225px; display: flex; flex-direction: column; padding: 22px; background: #073653; border: 1px solid #2d6685; border-radius: var(--radius); }
.toolchain-steps > li > span { width: 54px; height: 54px; display: grid; place-items: center; color: var(--brand-cpp-navy); background: #8bd0f4; border: 6px solid var(--brand-cpp-deep); border-radius: 50%; font-weight: 850; }
.toolchain-steps h3 { margin: 30px 0 7px; color: #fff; font-size: 1.22rem; }
.toolchain-steps p { margin: 0; color: #bed5e1; font-size: .9rem; }
.toolchain-guide > .section-width > .button { color: var(--brand-cpp-deep); background: #fff; border-color: #fff; }
.toolchain-guide > .section-width > .button:hover { color: var(--brand-cpp-deep); background: #eaf7ff; border-color: #eaf7ff; }

.catalog-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.catalog-search { width: min(330px,100%); display: grid; gap: 6px; }
.catalog-search > span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.download-grid, .media-grid, .project-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding-bottom: 80px; }
.download-card, .media-card, .project-card { min-height: 330px; display: flex; flex-direction: column; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.download-card:hover, .media-card:hover, .project-card:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-md); }
.download-card h2, .media-card h2, .project-card h2 { margin: 30px 0 8px; }
.download-card p, .media-card p, .project-card p { margin: 0; font-size: .88rem; }
.download-card footer, .project-card footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 22px; }
.download-card a, .project-card a, .media-card a { color: var(--action); font-weight: 750; }
.media-card-top, .project-card header { display: flex; justify-content: space-between; gap: 12px; color: var(--soft); }
.media-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-block: 16px; color: var(--soft); font-size: .78rem; }
.media-card audio, .media-card video { width: 100%; margin-top: 10px; }
.planned-label { margin-top: 12px; padding: 9px 12px; color: var(--muted); background: var(--surface-2); border-radius: 9px; font-size: .8rem; }
.project-card ul { margin: 18px 0 0; padding-right: 18px; color: var(--muted); }
.download-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.download-card > header > span { padding: 5px 9px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-radius: 7px; font-size: .75rem; }
.download-card > header > code { color: var(--ink); font-size: 1rem; font-weight: 800; }
.download-card dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 22px 0 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 10px; }
.download-card dl > div { min-width: 0; display: grid; gap: 3px; padding: 11px; background: var(--surface-2); }
.download-card dt { color: var(--soft); font-size: .78rem; }
.download-card dd { margin: 0; overflow: hidden; color: var(--ink); font-size: .78rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.download-card dd.is-local { color: var(--success); }
.download-card details { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; }
.download-card summary { color: var(--muted); font-size: .78rem; cursor: pointer; }
.download-card details code { display: block; margin-top: 8px; overflow-x: auto; font-size: .78rem; }
.download-card footer > .button { flex: 1; padding-inline: 12px; }
.download-card footer > a:last-child { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; }
.download-card-qt { border-top: 6px solid var(--brand-qt-neon); }
.download-card-qt > header > span { color: var(--brand-qt-pine); background: var(--brand-qt-neon); }
.download-card-qt h2 { color: var(--brand-qt-pine); }
.project-card-qt { border-top: 6px solid var(--brand-qt-neon); }
.project-card-qt h2 { color: var(--brand-qt-pine); }
.mirror-note { min-height: 230px; display: grid; grid-template-columns: auto minmax(0,1fr) minmax(300px,.7fr); align-items: center; gap: 24px; margin-bottom: 90px; padding: 32px; color: #fff; background: var(--brand-cpp-deep); border-radius: var(--radius-lg); }
.mirror-note h2 { margin: 5px 0 0; color: #fff; }
.mirror-note p { margin: 0; color: #bfd5e1; }
.mirror-note .eyebrow { color: #8fd1f4; }

.pricing-grid { display: grid; grid-template-columns: repeat(3,1fr); align-items: stretch; gap: 16px; padding-block: 24px 82px; }
.pricing-card { min-height: 535px; display: flex; flex-direction: column; padding: 30px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.pricing-card.featured { color: #fff; background: var(--brand-cpp-navy); border-color: var(--brand-cpp-navy); border-top: 6px solid var(--brand-cpp-sky); box-shadow: var(--shadow-lg); transform: translateY(-12px); }
.plan-tag { width: fit-content; padding: 5px 9px; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 7px; font-size: .75rem; font-weight: 800; }
.pricing-card.featured .plan-tag { color: var(--brand-cpp-navy); background: #b9e3f8; }
.pricing-card h2 { margin: 22px 0 4px; color: var(--ink-strong); font-size: 1.8rem; }
.pricing-card.featured h2 { color: #fff; }
.pricing-card > p { min-height: 52px; margin: 0; color: var(--muted); font-size: .9rem; }
.pricing-card.featured > p { color: #abc5d3; }
.price { display: flex; align-items: baseline; gap: 9px; margin-block: 26px; padding-block: 20px; border-block: 1px solid var(--line); }
.pricing-card.featured .price { border-color: #24475c; }
.price b { color: var(--ink-strong); font-family: "Farhang2",sans-serif !important; font-size: 2.8rem; font-weight: 900; line-height: 1; }
.pricing-card.featured .price b { color: #fff; }
.price span { color: var(--muted); font-size: .78rem; }
.pricing-card.featured .price span { color: #abc5d3; }
.check-list { display: grid; gap: 11px; margin: 0 0 30px; padding: 0; color: var(--ink); list-style: none; font-size: .88rem; }
.pricing-card.featured .check-list { color: #e3eff5; }
.check-list li { position: relative; padding-right: 25px; }
.check-list li::before { content: "\f00c"; position: absolute; right: 0; color: var(--success); font-family: "Font Awesome 7 Free"; font-weight: 900; }
.pricing-card.featured .check-list li::before { color: var(--brand-qt-neon); }
.pricing-card > .button { width: 100%; margin-top: auto; }
.payment-note { min-height: 126px; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 100px; padding: 24px 28px; background: color-mix(in srgb,var(--success) 7%,var(--surface)); border: 1px solid color-mix(in srgb,var(--success) 25%,var(--line)); border-radius: var(--radius-lg); }
.payment-note > div { display: flex; align-items: center; gap: 15px; }
.payment-note > div > span { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; color: var(--on-success); background: var(--success); border-radius: 12px; }
.payment-note h3 { margin: 0; color: var(--ink); font-size: 1.05rem; }
.payment-note p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.payment-note code { color: var(--success-ink); font-size: .78rem; }
.media-pitch, .submit-project, .contact-panel { min-height: 220px; display: flex; align-items: center; justify-content: space-between; gap: 40px; margin-block: 30px 90px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.media-pitch h2, .submit-project h2, .contact-panel h2 { margin: 5px 0; }
.media-pitch p, .submit-project p, .contact-panel p { max-width: 760px; margin: 0; }

.media-wave { min-height: 210px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; overflow: hidden; background: var(--brand-cpp-deep); border: 1px solid color-mix(in srgb,var(--brand-cpp-sky) 45%,var(--line)); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.media-wave i { width: 9px; height: 52px; background: #8ed2f3; border-radius: 999px; }
.media-wave i:nth-child(2), .media-wave i:nth-child(6) { height: 92px; }
.media-wave i:nth-child(3), .media-wave i:nth-child(5) { height: 132px; }
.media-wave i:nth-child(4) { height: 166px; background: var(--brand-qt-neon); }

.about-hero-copy h1 { max-width: 760px; margin-bottom: 0; }
.about-hero-intro { padding: 24px; background: var(--surface-2); border: 1px solid var(--line); border-right: 5px solid var(--brand-cpp); border-radius: 13px; }
.about-hero-intro p { margin: 0; }
.about-mission { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 70px; padding-block: 80px; }
.about-mission h2 { margin: 7px 0; }
.about-capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.about-capabilities article { min-height: 145px; display: flex; flex-direction: column; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.about-capabilities i { margin-bottom: auto; color: var(--action); font-size: 1.25rem; }
.about-capabilities span { color: var(--muted); }
.people-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.people-grid article { min-height: 250px; display: grid; grid-template-columns: 64px 1fr; align-items: start; gap: 20px; padding: 30px; color: #fff; background: var(--brand-cpp-deep); border-radius: var(--radius-lg); }
.person-mark { width: 64px; height: 64px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 17px; font-size: 1.25rem; }
.person-mark.company { color: var(--brand-qt-pine); background: var(--brand-qt-neon); }
.people-grid small, .people-grid p { color: #b8d0de; }
.people-grid h2 { margin: 5px 0; color: #fff; }
.people-grid p { margin: 0; }
.product-identity { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); align-items: center; gap: 60px; margin-top: 18px; padding: 34px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--brand-cpp); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.product-identity h2 { margin: 6px 0; }
.product-identity p { margin: 0; }
.product-identity dl { display: grid; gap: 1px; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.product-identity dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px 15px; background: var(--surface-2); }
.product-identity dt { color: var(--soft); }
.product-identity dd { margin: 0; color: var(--ink); font-weight: 750; }
.editorial-charter { display: grid; grid-template-columns: .65fr 1.35fr; gap: 60px; padding-block: 90px; }
.editorial-charter h2 { margin: 7px 0; }
.editorial-charter ol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.editorial-charter li { min-height: 140px; display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.editorial-charter li b { display: flex; align-items: center; gap: 8px; }
.editorial-charter li b i { color: var(--action); }
/* The description belongs under its own heading. `margin-top: auto` pinned it
   to the bottom of the card and opened a gap in the middle of every item. */
.editorial-charter li span { color: var(--muted); }
.updates { padding-bottom: 70px; }
.updates > header { margin-bottom: 18px; }
.updates > article { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding-block: 20px; border-top: 1px solid var(--line); }
.updates time { color: var(--action); font-family: "Farhang2",sans-serif !important; font-weight: 750; }
.updates h3 { margin: 4px 0; }
.updates p { margin: 0; }

/* Safe Markdown output shared by public cards and the admin preview. */
.markdown-content { color: var(--muted); line-height: 1.85; overflow-wrap: anywhere; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content p { margin: 0 0 10px; color: inherit; font-size: inherit; }
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 { margin: 18px 0 7px; color: var(--ink); line-height: 1.5; }
.markdown-content h1 { font-size: 1.35rem; }
.markdown-content h2 { font-size: 1.18rem; }
.markdown-content h3 { font-size: 1.02rem; }
.markdown-content ul,
.markdown-content ol { margin: 8px 0 12px; padding-right: 24px; }
.markdown-content blockquote { margin: 12px 0; padding: 9px 14px; color: var(--ink); background: var(--surface-2); border-right: 4px solid var(--action); border-radius: 8px; }
.markdown-content blockquote p { margin: 0; }
.markdown-content code { padding: 2px 5px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-radius: 5px; direction: ltr; }
.markdown-content pre { margin: 12px 0; padding: 14px; overflow-x: auto; color: #e9f5fb; background: var(--brand-cpp-deep); border-radius: 9px; direction: ltr; text-align: left; }
.markdown-content pre code { padding: 0; color: inherit; background: transparent; }
.markdown-content a { color: var(--action); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.markdown-content hr { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.catalog-copy > .markdown-content { margin: 0; font-size: .88rem; }
.book-detail-copy > .markdown-content { max-width: 720px; margin: 0; }
.download-card > .markdown-content,
.media-card > .markdown-content,
.project-card > .markdown-content { margin: 0; font-size: .88rem; }
.updates .markdown-content { margin: 0; }
.chapter-header .markdown-content { max-width: 760px; margin-top: 10px; }

/* Search, auth, dashboard, reader */
.product-search-page { padding-block: 36px 90px; }
.reference-search-page { margin: 0; }
.search-results-header, .search-summary { color: var(--ink); }
.product-results { display: grid; gap: 9px; margin-top: 20px; }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-top: 26px; padding: 22px 0 14px; border-bottom: 1px solid var(--line); }
.result-heading h2 { margin: 5px 0 0; font-size: 1.6rem; }
.result-heading > span { color: var(--muted); font-size: .8rem; }
.result-list { display: grid; gap: 9px; }
.product-result { min-height: 112px; display: grid; grid-template-columns: 170px 1fr auto; align-items: center; gap: 20px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.product-result:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-sm); }
.result-meta { display: grid; gap: 4px; color: var(--action); font-size: .78rem; }
.result-meta b { color: var(--ink); }
.product-result h3 { margin: 0 0 4px; }
.product-result p { margin: 0; font-size: .84rem; }
.result-relation { display: inline-block; margin-top: 8px; color: var(--soft); font-size: .76rem; font-style: normal; }
.result-arrow { color: var(--action); font-weight: 750; }
.search-empty-guide { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding-block: 44px 28px; }
.search-empty-guide article { min-height: 270px; display: flex; flex-direction: column; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--brand-cpp); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.search-empty-guide article > span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 11px; font-weight: 850; }
.search-empty-guide h2 { margin: 32px 0 7px; font-size: 1.35rem; }
.search-empty-guide p { margin: 0; font-size: .9rem; }
.search-empty-guide a { margin-top: auto; padding-top: 22px; color: var(--action); font-weight: 750; }

.auth-shell { min-height: 720px; display: grid; place-items: center; padding: 50px 20px; background: radial-gradient(circle at 50% 0,rgba(101,154,210,.16),transparent 40%),var(--canvas); }
.auth-card { width: min(500px,100%); padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.auth-card h1 { margin: 7px 0; font-size: 2.2rem; }
.auth-card > p { margin: 0 0 24px; font-size: .95rem; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 7px; color: var(--ink); font-size: .92rem; font-weight: 750; }
.stack-form input { min-height: 50px; color: var(--ink); background: var(--surface-2); }
.stack-form .button { width: 100%; min-height: 52px; margin-top: 4px; }
.demo-credentials { display: grid; gap: 5px; margin-top: 18px; padding: 14px 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: .84rem; }
.demo-credentials code { overflow-wrap: anywhere; color: var(--action); font-size: .82rem; }
.form-foot { margin: 18px 0 0 !important; text-align: center; }
.form-foot a { color: var(--action); font-weight: 750; }

.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-block: 60px 30px; }
.dashboard-header h1 { margin: 6px 0; }
.dashboard-header p { margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 330px; gap: 20px; padding-bottom: 80px; }
.dashboard-main, .panel { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
/* .dashboard-main is itself a panel that sometimes holds panels. Without this
   the nested cards sit edge to edge and read as one block. */
.dashboard-main > .panel + .panel { margin-top: 20px; }
.dashboard-side { display: grid; align-content: start; gap: 14px; }
.empty-state { min-height: 360px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state > span { width: 62px; height: 62px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 17px; font-size: 1.5rem; }
.empty-state h3 { margin: 16px 0 4px; }
.empty-state p { max-width: 500px; font-size: .92rem; }
.dashboard-main > h2, .panel > h2, .panel > h3 { margin-top: 0; }
.panel > h3 { font-size: 1.15rem; }
.muted { color: var(--muted); font-size: .9rem; }
.library-list { display: grid; gap: 16px; }
.library-list article { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.library-list article > div:last-child { align-self: center; }
.library-cover { min-height: 145px; display: flex; flex-direction: column; padding: 14px; color: #fff; background: var(--brand-cpp-deep); border-radius: 6px 14px 14px 6px; box-shadow: var(--shadow-sm); }
.library-cover span { color: #9bc9e2; font-size: .8rem; }
.library-cover b { margin-top: auto; color: #fff; font-size: .9rem; }
.library-list h3 { margin: 0; font-size: 1.15rem; }
.library-list p { margin: 4px 0; color: var(--muted); font-size: .88rem; }
.progress-line { height: 6px; margin-block: 14px; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.progress-line i { display: block; height: 100%; background: var(--action); border-radius: inherit; }
.entitlement-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.entitlement-list li { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.entitlement-list span, .entitlement-list small { color: var(--muted); font-size: .82rem; }
.entitlement-list b { color: var(--ink); font-size: .92rem; }
.gradient-panel { color: #fff; background: var(--brand-cpp-deep); border-color: #16516f; }
.gradient-panel > span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--brand-cpp-navy); background: #8bd0f4; border-radius: 11px; }
.gradient-panel h3 { color: #fff; }
.gradient-panel p { color: #bdd4e0; font-size: .9rem; }

/* Checkout */
.checkout-page { min-height: 760px; display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,430px); align-items: center; gap: clamp(48px,8vw,105px); padding-block: 80px; }
.checkout-copy h1 { max-width: 760px; margin: 10px 0 14px; font-size: clamp(2.5rem,4.5vw,4rem); line-height: 1.22; }
.checkout-copy > p { max-width: 670px; margin: 0; font-size: 1rem; }
.checkout-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-block: 30px; }
.checkout-steps > div { min-height: 150px; display: flex; flex-direction: column; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-xs); }
.checkout-steps span { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 10px; font-size: .9rem; font-weight: 850; }
.checkout-steps b { margin-top: auto; color: var(--ink); font-size: .98rem; }
.checkout-steps small { color: var(--muted); font-size: .84rem; }
.security-note { display: grid; grid-template-columns: 42px 1fr; gap: 2px 14px; padding: 18px 20px; background: color-mix(in srgb,var(--success) 8%,var(--surface)); border: 1px solid color-mix(in srgb,var(--success) 28%,var(--line)); border-right: 5px solid var(--success); border-radius: 13px; }
.security-note::before { content: "\f3ed"; grid-row: 1 / 3; width: 42px; height: 42px; display: grid; place-items: center; color: var(--on-success); background: var(--success); border-radius: 11px; font-family: "Font Awesome 7 Free"; font-weight: 900; }
.security-note b { color: var(--ink); font-size: .96rem; }
.security-note p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.checkout-card { position: sticky; top: 138px; overflow: hidden; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--brand-cpp); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.checkout-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.checkout-brand-mark { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 12px; box-shadow: 0 8px 20px rgba(0,89,156,.18); }
.checkout-brand > div { display: grid; }
.checkout-brand b { color: var(--ink); font-size: 1rem; }
.checkout-brand small { color: var(--muted); font-size: .82rem; }
.order-line { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; padding-block: 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.order-line span { color: var(--muted); }
.order-line b { color: var(--ink); text-align: left; }
.order-total { display: grid; gap: 5px; margin-block: 20px; padding: 20px; color: #fff; background: var(--brand-cpp-deep); border-radius: 13px; }
.order-total span { color: #bcd6e5; font-size: .85rem; }
.order-total strong { color: #fff; font-family: "Farhang2",sans-serif !important; font-size: 1.65rem; }
/* Checkout · payment method tabs (GENY today, rial gateway pending). */
/* Stacked, not side by side: the checkout card is a narrow column and two
   tabs across it wrapped every label onto three lines. */
.pay-methods { display: grid; gap: 8px; margin: 18px 0 16px; }
.pay-method { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 13px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; font: inherit; text-align: right; cursor: pointer; transition: background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.pay-method > i { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: .84rem; transition: .2s ease; }
.pay-method b { display: block; font-size: .88rem; }
.pay-method small { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; }
.pay-method:hover { border-color: var(--line-strong); }
.pay-method.is-active { background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-color: color-mix(in srgb,var(--action) 45%,var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb,var(--action) 10%,transparent); }
.pay-method.is-active > i { color: var(--on-action); background: var(--action); border-color: var(--action); }
.pay-method-soon { padding: 3px 8px; color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 18%,var(--surface)); border: 1px solid color-mix(in srgb,var(--warning) 35%,var(--line)); border-radius: 999px; font-size: .68rem; font-style: normal; font-weight: 750; white-space: nowrap; }
.pay-soon { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 14px; margin-block: 14px; padding: 16px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 13px; }
.pay-soon > span { width: 40px; height: 40px; display: grid; place-items: center; color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 14%,var(--surface)); border-radius: 11px; }
.pay-soon b { display: block; font-size: .93rem; }
.pay-soon p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.9; }
[data-pay-panel="rial"] > .button { width: 100%; min-height: 50px; }

.wallet-button { width: 100%; min-height: 54px; }
.demo-pay { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 9px; padding: 10px 14px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border: 1px solid color-mix(in srgb,var(--action) 20%,var(--line)); border-radius: 11px; font-weight: 750; }
.demo-pay:hover { background: color-mix(in srgb,var(--action) 13%,var(--surface)); }
.checkout-status { min-height: 44px; display: grid; place-items: center; margin-top: 14px; padding: 9px 12px; color: var(--muted); background: var(--surface-2); border-radius: 10px; font-size: .86rem; text-align: center; }
.checkout-status.success { color: var(--success); background: color-mix(in srgb,var(--success) 10%,var(--surface)); }
.checkout-status.error { color: var(--danger); background: color-mix(in srgb,var(--danger) 10%,var(--surface)); }
.contract-line { margin: 13px 0 0; color: var(--soft); font-size: .78rem; line-height: 1.7; white-space: normal; }
.contract-line code { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--muted); font-size: .82rem; }
.price-quote { display: inline-grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.price-quote > b { grid-row: 1 / 3; align-self: center; color: var(--action); font-size: 1.2rem; white-space: nowrap; }
.price-quote > small { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.order-total small { color: #bcd6e5; font-size: .8rem; }
.checkout-rate-note { display: flex; gap: 7px; margin: -8px 0 14px; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.token-contract, .token-overview { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.token-contract-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); border-radius: 10px; }
.token-contract > div { min-width: 0; display: grid; }
.token-contract small, .token-overview small { color: var(--soft); font-size: .72rem; }
.token-contract a, .token-overview a { color: var(--action); font-size: .8rem; }
.token-contract button { margin-right: auto; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.buy-geny { width: 100%; margin-top: 9px; font-size: .8rem; }
.token-overview { flex-wrap: wrap; margin-block: 16px; }
.token-overview > div { min-width: 190px; display: grid; }
.token-overview > .button { margin-right: auto; }
.pricing-card > .price-quote { margin: 22px 0; padding-block: 20px; border-block: 1px solid var(--line); }
.pricing-card.featured > .price-quote { border-color: #24475c; }
.pricing-card.featured .price-quote > b { color: #fff; }
.pricing-card.featured .price-quote > small { color: #abc5d3; }

/* Reader */
.reader-layout { min-height: calc(100vh - 124px); display: grid; grid-template-columns: 280px minmax(0,1fr) 300px; background: var(--canvas); }
.reader-sidebar { position: sticky; top: 124px; align-self: start; min-width: 0; height: calc(100vh - 124px); padding: 24px 18px; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); scrollbar-width: thin; }
.tools-panel { border-left: 0; border-right: 1px solid var(--line); }
.reader-book-title { display: grid; gap: 5px; padding: 0 5px 14px; }
.reader-book-title small { color: var(--action); font-size: .84rem; font-weight: 750; }
.reader-book-title a { color: var(--ink); font-size: .96rem; font-weight: 800; }
.reader-progress { display: grid; gap: 7px; margin: 5px 5px 20px; }
.reader-progress > span { display: block; height: 5px; overflow: hidden; background: var(--surface-2); border-radius: 9px; }
.reader-progress i { display: block; height: 100%; background: var(--action); }
.reader-progress small { color: var(--soft); font-size: .82rem; }
.reader-chapters { display: grid; gap: 5px; }
.reader-chapters a { min-height: 54px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; color: var(--muted); border-radius: 9px; font-size: .84rem; }
.reader-chapters a:hover, .reader-chapters a.active { color: var(--action); background: var(--surface-2); }
.reader-chapters a > span { color: var(--soft); font-family: "Farhang2",sans-serif !important; font-size: .82rem; }
.reader-chapters a > i { color: var(--soft); font-size: .72rem; font-style: normal; }
.reader-article { width: 100%; max-width: none; min-width: 0; margin: 0; padding: 55px clamp(28px,6vw,90px) 80px; background: var(--canvas); }
.reader-mobile-bar { display: none; }
.chapter-header { max-width: 800px; margin: 0 auto 40px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.chapter-kicker { color: var(--action); font-size: .9rem; font-weight: 750; }
.chapter-header h1 { margin: 10px 0; font-size: clamp(2.4rem,4vw,3.8rem); letter-spacing: 0; }
.chapter-header p { margin: 0; color: var(--muted); font-size: 1rem; }
.book-content { max-width: 800px; margin-inline: auto; font-size: 1.04rem; }
.book-content h2 { margin-top: 54px; font-size: 1.8rem; }
.book-content h3 { margin-top: 36px; }
.book-content p, .book-content li { color: var(--ink); line-height: 2.05; }
.book-content pre { overflow-x: auto; padding: 20px; color: #e9f5fb; background: #031d2e; border-radius: 13px; direction: ltr; text-align: left; }
.book-content code:not(pre code) { padding: 2px 5px; color: var(--brand-cpp-deep); background: color-mix(in srgb,var(--brand-cpp-sky) 17%,var(--surface)); border-radius: 5px; }
.code-block { position: relative; margin: 26px 0; padding: 28px 22px 22px; overflow: auto; direction: ltr; color: #d8e8f1; background: #031d2e; border: 1px solid #1e465e; border-radius: 13px; text-align: left; font-size: .88rem; line-height: 1.8; }
.code-block::before { color: #92adbd; font-size: .75rem; }
.callout { margin: 26px 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-right: 4px solid var(--action); border-radius: 11px; }
.callout > strong { display: block; margin-bottom: 4px; color: var(--action); }
.callout p { margin: 4px 0; }
.callout-goals { background: color-mix(in srgb,var(--action) 6%,var(--surface)); }
.callout-warning { background: color-mix(in srgb,var(--warning) 7%,var(--surface)); border-right-color: var(--warning); }
.callout-warning > strong { color: var(--warning); }
.callout-exercise { background: color-mix(in srgb,var(--success) 7%,var(--surface)); border-right-color: var(--success); }
.callout-exercise > strong { color: var(--success); }
.locked-content { max-height: 400px; overflow: hidden; filter: blur(1.3px); mask-image: linear-gradient(#000 25%,transparent); }
.locked-card { position: relative; max-width: 800px; margin: -65px auto 0; padding: 36px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--action); border-radius: var(--radius); box-shadow: var(--shadow-md); text-align: center; }
.locked-card > span { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto; color: var(--on-action); background: var(--action); border-radius: 15px; font-size: 1.2rem; }
.locked-card h2 { margin: 18px 0 4px; }
.locked-card p { margin: 0 auto 20px; max-width: 620px; font-size: .94rem; }
.locked-card > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.chapter-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 800px; margin: 70px auto 0; padding-top: 25px; border-top: 1px solid var(--line); }
.chapter-pagination a { min-height: 76px; display: grid; align-content: center; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.chapter-pagination a:hover { border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-xs); }
.chapter-pagination a.next { text-align: left; }
.chapter-pagination small { color: var(--muted); font-size: .82rem; }
.chapter-pagination b { color: var(--ink); font-size: .9rem; }
.page-toc, .reader-actions, .tutor-box { padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.page-toc { display: grid; gap: 7px; }
.page-toc > b { margin-bottom: 4px; font-size: .94rem; }
.page-toc a { padding: 3px 0; color: var(--muted); font-size: .84rem; }
.page-toc a:hover { color: var(--action); }
.reader-actions { display: grid; gap: 6px; margin-top: 12px; }
.reader-actions button { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; text-align: right; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: .84rem; }
.reader-actions button:hover { color: var(--action); border-color: var(--brand-cpp-sky); }
.reader-actions button > i { width: 16px; color: var(--action); }
.tutor-box { margin-top: 12px; }
.tutor-title { display: flex; align-items: center; gap: 10px; padding: 0 0 13px; border-bottom: 1px solid var(--line); }
.tutor-title > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: var(--on-action); background: var(--action); border-radius: 10px; }
.tutor-title > div { display: grid; }
.tutor-title b { font-size: .92rem; }
.tutor-title small { color: var(--soft); font-size: .82rem; }
.tutor-messages { max-height: 260px; margin-block: 12px; padding: 0; overflow-y: auto; font-size: .84rem; }
.tutor-messages p { margin: 0; color: var(--muted); font-size: inherit; }
.tutor-messages .tutor-answer { margin-top: 8px; padding: 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; white-space: pre-line; }
.tutor-messages .tutor-source { display: block; margin-top: 6px; color: var(--action); }
.tutor-box form { display: grid; gap: 7px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.tutor-question-label { color: var(--muted); font-size: .84rem; font-weight: 750; }
.tutor-box textarea { min-height: 92px; padding: 10px; color: var(--ink); background: var(--surface); border-color: var(--line-strong); font-size: .86rem; }
.tutor-box button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--on-action); background: var(--action); border: 0; border-radius: 9px; font-size: .86rem; font-weight: 750; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 36px; padding-block: 52px 90px; }
.admin-nav { position: sticky; top: 130px; align-self: start; min-width: 0; }
.admin-nav h1 { margin: 7px 0; font-size: 1.75rem; }
.admin-nav p { color: var(--muted); font-size: .86rem; line-height: 1.75; }
.admin-nav nav { display: grid; gap: 3px; margin: 18px 0; padding-block: 12px; border-block: 1px solid var(--line); }
.admin-nav nav a {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: var(--muted);
  border-radius: 8px;
  font-weight: 700;
  font-size: .89rem;
  transition: color .16s ease, background .16s ease;
}
.admin-nav nav a > i { color: var(--soft); font-size: .9rem; }
.admin-nav nav a:hover { color: var(--action); background: var(--surface); }
.admin-nav nav a:hover > i { color: var(--action); }
/* Without this there was no way to tell which admin page you were on. */
.admin-nav nav a.active { color: var(--action); background: color-mix(in srgb, var(--action) 10%, transparent); }
.admin-nav nav a.active > i { color: var(--action); }

.admin-nav-sections { margin-top: 0 !important; border-top: 0 !important; }
.admin-nav-sections a { grid-template-columns: 1fr !important; padding-inline-start: 20px !important; font-size: .84rem !important; font-weight: 600 !important; }
.admin-nav-label { display: block; margin-bottom: 6px; color: var(--soft); font-size: .74rem; font-weight: 800; letter-spacing: .04em; }
.admin-nav-visit { width: 100%; justify-content: center; }
.admin-content { min-width: 0; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-header h2 { margin: 4px 0; }
.status-badge { padding: 8px 12px; color: #7a5600; background: #fff0c5; border-radius: 9px; font-size: .84rem; font-weight: 750; }
.status-badge.ok { color: #075b3d; background: #d9f5ea; }
.admin-metrics { grid-template-columns: repeat(4,1fr); padding-block: 24px; }
.admin-metrics article { min-height: 125px; display: grid; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.admin-metrics span, .admin-metrics small { color: var(--muted); font-size: .84rem; }
.admin-metrics b { color: var(--action); font-family: "Farhang2",sans-serif !important; font-size: 1.75rem; }
.admin-module { margin-top: 16px; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.admin-module > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.admin-module > header h2 { margin: 4px 0; }
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form label { display: grid; align-content: start; gap: 6px; }
.admin-form label > span { color: var(--muted); font-size: .88rem; font-weight: 700; }
.admin-form label > small { color: var(--soft); font-size: .82rem; }
.admin-form .wide { grid-column: 1 / -1; }
/* Short forms (changelog entry) read better as a single column than as a
   two-column grid with a lone field stranded on the last row. */
.admin-form.compact { grid-template-columns: 1fr 1fr 1fr; }
.admin-form.compact button { grid-column: 1 / -1; justify-self: start; }
.upload-field { padding: 16px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; }
.upload-field input[type="file"],
.admin-form input[type="file"] { min-height: 52px; padding: 8px; background: var(--surface); border-style: solid; }
.upload-field input[type="file"]::file-selector-button,
.admin-form input[type="file"]::file-selector-button { min-height: 34px; margin-left: 10px; padding: 6px 12px; color: var(--on-action); background: var(--action); border: 0; border-radius: 8px; font: inherit; font-size: .82rem; cursor: pointer; }
.admin-help { display: flex; gap: 9px; padding: 13px 15px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.admin-help i { margin-top: 5px; color: var(--action); }
.admin-records { display: grid; gap: 10px; margin-top: 24px; }
.admin-record { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.admin-record > summary { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; cursor: pointer; list-style: none; }
.admin-record > summary::-webkit-details-marker { display: none; }
.admin-record > summary > span { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 2px 8px; }
.admin-record > summary > span > i { grid-row: 1/3; color: var(--action); }
.admin-record > summary small { color: var(--soft); font-size: .82rem; }
.admin-record[open] > summary { border-bottom: 1px solid var(--line); }
.admin-record[open] > summary > i { transform: rotate(180deg); }
.admin-record-body { padding: 20px; background: var(--canvas); }
.admin-record-body > form + form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.check-field { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; }
.check-field input { width: 20px; min-height: 20px; accent-color: var(--action); }
.chapter-editor textarea[dir="ltr"] { font-family: ui-monospace,monospace !important; font-size: .88rem; line-height: 1.7; }
.legal-page { max-width: 900px; padding-block: 70px 100px; }
.legal-page > header { padding: 30px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-soft); }
.legal-page h1 { margin: 10px 0; font-size: clamp(2rem, 5vw, 3.5rem); }
.legal-page > header p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 2; }
.legal-page > header small { display: block; margin-top: 16px; color: var(--muted); }
.legal-sections { display: grid; gap: 14px; margin-top: 20px; }
.legal-sections article { padding: 24px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.legal-sections h2 { margin: 0 0 8px; font-size: 1.15rem; }
.legal-sections p { margin: 0; color: var(--muted); line-height: 2; }
.account-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-form .wide { grid-column: 1 / -1; }
.account-form > .button { justify-self: start; }
.danger-panel { border-color: color-mix(in srgb, #b83543 35%, var(--line)); }
.header-logout{display:contents}

/* The account page keeps a doorway to the wallets page rather than the panel. */
.wallet-link-card { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 16px; color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.wallet-link-card:hover { border-color: color-mix(in srgb,var(--action) 45%,var(--line)); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.wallet-link-mark { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 13px; }
.wallet-link-body { display: grid; gap: 4px; min-width: 0; }
.wallet-link-body b { font-size: 1.02rem; }
.wallet-link-body small { color: var(--muted); font-size: .85rem; line-height: 1.8; }
.wallet-link-go { width: 36px; height: 36px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 10px; transition: transform .2s ease; }
.wallet-link-card:hover .wallet-link-go { transform: translateX(-4px); }

.wallet-usage { display: grid; gap: 14px; margin: 0 0 18px; padding: 0; list-style: none; }
.wallet-usage li { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: start; gap: 12px; }
.wallet-usage li > i { width: 32px; height: 32px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); border-radius: 10px; font-size: .82rem; }
.wallet-usage b { display: block; font-size: .92rem; }
.wallet-usage small { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.85; }

/* Account · GENY wallets panel.
   Balances arrive after the page paints (wallet-link.js), so every amount has a
   loading, ready and unavailable state that has to look deliberate. */
.wallet-panel { display: grid; gap: 18px; }
.wallet-panel-head { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: start; gap: 8px 14px; }
.wallet-panel-mark { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 13px; box-shadow: 0 8px 20px color-mix(in srgb,var(--brand-cpp) 22%,transparent); }
.wallet-panel-head h2 { margin: 0 0 5px; }
.wallet-panel-head p { margin: 0; font-size: .87rem; line-height: 1.95; }
.wallet-chain-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border: 1px solid color-mix(in srgb,var(--action) 25%,var(--line)); border-radius: 999px; font-size: .77rem; font-weight: 750; white-space: nowrap; }

.wallet-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: linear-gradient(115deg,var(--brand-cpp-navy),var(--brand-cpp-deep)); border-radius: 15px; }
.wallet-total small { display: block; color: #a9c8dc; font-size: .79rem; }
.wallet-total strong { display: block; margin-top: 5px; color: #fff; font-family: "Farhang2",sans-serif !important; font-size: 1.5rem; }
.wallet-total strong.is-loading { color: #7ba3bf; letter-spacing: .2em; }
.wallet-total-refresh { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; color: #dbeaf5; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; font: inherit; font-size: .81rem; font-weight: 700; cursor: pointer; transition: background .18s ease; }
.wallet-total-refresh:hover { background: rgba(255,255,255,.2); }
@keyframes wallet-spin { to { transform: rotate(-360deg); } }
.wallet-total-refresh.is-spinning i, .icon-button.is-spinning i { animation: wallet-spin .8s linear infinite; }

.wallet-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.wallet-steps li { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 2px 10px; padding: 13px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; transition: background .2s ease, border-color .2s ease; }
.wallet-steps span { grid-row: 1/3; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; font-size: .82rem; font-weight: 850; }
.wallet-steps b { font-size: .89rem; }
.wallet-steps small { color: var(--muted); font-size: .77rem; line-height: 1.7; }
.wallet-steps .is-current { background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-color: color-mix(in srgb,var(--action) 40%,var(--line)); }
.wallet-steps .is-current span { color: var(--on-action); background: var(--action); border-color: var(--action); }
.wallet-steps .is-done span { color: var(--on-success); background: var(--success); border-color: var(--success); font-size: 0; }
.wallet-steps .is-done span::before { content: "\f00c"; font-family: "Font Awesome 7 Free"; font-weight: 900; font-size: .78rem; }

.wallet-form { display: grid; gap: 14px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 15px; }
.wallet-connected { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); border: 1px solid color-mix(in srgb,var(--success) 38%,var(--line)); border-radius: 12px; }
.wallet-connected-dot { width: 10px; height: 10px; flex: 0 0 10px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb,var(--success) 18%,transparent); }
.wallet-connected > div { flex: 1; display: grid; justify-items: start; min-width: 0; }
.wallet-connected small { color: var(--muted); font-size: .75rem; }
.wallet-connected code { max-width: 100%; overflow: hidden; color: var(--ink); font-size: .83rem; text-overflow: ellipsis; }
.wallet-connected-reset { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 9px; font: inherit; font-size: .77rem; white-space: nowrap; cursor: pointer; transition: .18s ease; }
.wallet-connected-reset:hover { color: var(--action); border-color: var(--action); }
.wallet-label-field { display: grid; gap: 6px; color: var(--ink); font-size: .9rem; font-weight: 750; }
.wallet-label-field small { color: var(--muted); font-weight: 500; font-size: .77rem; }
.wallet-label-field input { min-height: 48px; background: var(--surface); }
.wallet-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wallet-form-actions .button { min-height: 50px; }
.wallet-status { min-height: 22px; margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.9; }
.wallet-status.is-error { color: var(--danger-ink); }
.wallet-status.is-success { color: var(--success-ink); }

.wallet-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.wallet-list:empty { display: none; }
.wallet-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto; align-items: center; gap: 8px 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-xs); transition: opacity .2s ease, transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.wallet-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.wallet-card-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); border-radius: 12px; }
.wallet-card-body { display: grid; gap: 7px; min-width: 0; }
.wallet-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.wallet-card-title b { font-size: .94rem; }
.wallet-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: .71rem; font-weight: 750; }
.wallet-tag-primary { color: var(--action); background: color-mix(in srgb,var(--action) 12%,var(--surface)); }
.wallet-tag-verified { color: var(--success-ink); background: color-mix(in srgb,var(--success) 12%,var(--surface)); }
.wallet-copy { display: inline-flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; padding: 5px 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; font: inherit; cursor: pointer; transition: .18s ease; }
.wallet-copy code { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; }
.wallet-copy:hover { color: var(--action); border-color: color-mix(in srgb,var(--action) 40%,var(--line)); }
.wallet-copy.is-copied { color: var(--success-ink); border-color: color-mix(in srgb,var(--success) 45%,var(--line)); }
.wallet-copy.is-copied i { font-weight: 900; }
.wallet-copy.is-copied i::before { content: "\f00c"; }

.wallet-card-balance { display: grid; gap: 3px; justify-items: end; min-width: 104px; text-align: left; }
.wallet-card-balance[data-state="off"] { display: none; }
.wallet-card-balance small { color: var(--muted); font-size: .73rem; }
.wallet-balance-value { display: block; color: var(--ink); font-family: "Farhang2",sans-serif !important; font-size: 1.02rem; font-weight: 800; }
@keyframes wallet-shimmer { from { background-position: 0 0; } to { background-position: -220% 0; } }
.wallet-card-balance[data-state="loading"] .wallet-balance-value { width: 78px; height: 17px; border-radius: 6px; background: linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%); background-size: 220% 100%; animation: wallet-shimmer 1.2s linear infinite; }
.wallet-card-balance[data-state="error"] .wallet-balance-value { color: var(--warning-ink); font-family: inherit !important; font-size: .79rem; font-weight: 700; }

.wallet-card-actions { display: flex; align-items: center; gap: 6px; }
.wallet-remove { display: contents; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: .85rem; cursor: pointer; transition: .18s ease; }
.icon-button:hover { color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-color: color-mix(in srgb,var(--action) 40%,var(--line)); }
.icon-button-danger:hover { color: var(--danger-ink); background: color-mix(in srgb,var(--danger) 9%,var(--surface)); border-color: color-mix(in srgb,var(--danger) 40%,var(--line)); }
.wallet-confirm-hint { display: none; color: var(--danger-ink); font-size: .75rem; font-weight: 750; white-space: nowrap; }
.wallet-card.is-confirming { background: color-mix(in srgb,var(--danger) 5%,var(--surface)); border-color: color-mix(in srgb,var(--danger) 45%,var(--line)); }
.wallet-card.is-confirming .wallet-confirm-hint { display: inline; }
.wallet-card.is-confirming .icon-button-danger { color: var(--on-danger); background: var(--danger); border-color: var(--danger); }
@keyframes wallet-pop { from { opacity: 0; transform: translateY(-10px); } }
.wallet-card.is-new { border-color: color-mix(in srgb,var(--success) 50%,var(--line)); animation: wallet-pop .45s ease; }
.wallet-card.is-leaving { opacity: 0; transform: scale(.98); }
.wallet-empty { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0; padding: 26px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 14px; font-size: .87rem; }

@media (max-width: 1080px) { .wallet-steps { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .account-form { grid-template-columns: 1fr; }
  .wallet-panel-head { grid-template-columns: 46px minmax(0,1fr); }
  .wallet-chain-tag { grid-column: 1/-1; justify-self: start; }
  .wallet-total { flex-direction: column; align-items: stretch; }
  .wallet-card { grid-template-columns: 42px minmax(0,1fr); }
  .wallet-card-balance { grid-column: 1/-1; justify-items: start; text-align: right; }
  .wallet-card-actions { grid-column: 1/-1; }
  .wallet-form-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .wallet-card, .wallet-card.is-new, .wallet-total-refresh.is-spinning i, .icon-button.is-spinning i,
  .wallet-card-balance[data-state="loading"] .wallet-balance-value { animation: none; transition: none; }
}
.admin-search { display:flex; gap:8px; align-items:center; } .admin-search input { min-width:220px; }
.group-checkboxes { display:flex; flex-wrap:wrap; gap:10px 16px; }
.admin-table-wrap { overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.admin-table { width:100%; border-collapse:collapse; min-width:850px; } .admin-table th,.admin-table td { padding:13px 16px; text-align:right; border-bottom:1px solid var(--line); } .admin-table th { color:var(--muted); font-size:.82rem; background:var(--surface-2); } .admin-table tr:last-child td { border:0; }
.content-editor { overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.content-editor:focus-within { border-color: var(--action); box-shadow: 0 0 0 4px color-mix(in srgb,var(--action) 12%,transparent); }
.content-editor-topbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 5px 8px 5px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.content-editor-tabs { display: flex; gap: 3px; }
.content-editor-tabs button,
.content-editor-toolbar button { min-height: 32px; padding: 5px 10px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: .78rem; font-weight: 750; }
.content-editor-tabs button:hover,
.content-editor-toolbar button:hover { color: var(--action); background: color-mix(in srgb,var(--action) 7%,var(--surface)); }
.content-editor-tabs button[aria-selected="true"] { color: var(--action); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-xs); }
.content-editor-status { color: var(--soft) !important; font-size: .72rem !important; white-space: nowrap; }
.content-editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.content-editor-toolbar button + button { border-right-color: var(--line); border-radius: 0; }
.content-editor > textarea { min-height: 140px; margin: 0; padding: 15px; background: var(--surface); border: 0; border-radius: 0; box-shadow: none; line-height: 1.9; }
.content-editor[data-editor-mode="html"] > textarea { min-height: 360px; }
.content-editor-preview { min-height: 140px; padding: 18px; background: var(--surface); }
.content-editor[data-editor-mode="html"] .content-editor-preview { min-height: 360px; }
.content-editor-empty { color: var(--soft) !important; font-style: italic; }
.invoice-table { display: grid; }
.invoice-table > div { min-height: 54px; display: grid; grid-template-columns: 110px minmax(0,1fr) 130px 90px; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .84rem; }
.invoice-table > div:nth-child(odd) { background: var(--surface-2); }
.invoice-table code { color: var(--action); font-size: .8rem; }
.invoice-table i { color: var(--muted); font-style: normal; }
.pipeline-list li { font-size: .86rem; }
  .toast-message { font-size: .86rem; }

/* Error pages */
.error-page {
  min-height: 620px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 40px 24px;
  text-align: center;
}
.error-page > span { color: var(--line-strong); font: 900 5rem var(--mono); }
.error-page h1 { margin: 4px 0 0; font-size: 2rem; }
.error-note { max-width: 560px; margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.error-detail {
  max-width: 800px;
  margin: 10px 0 0;
  padding: 12px 16px;
  overflow-x: auto;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  text-align: start;
  white-space: pre-wrap;
}
.error-search {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(520px, 100%);
  margin-top: 26px;
}
.error-search input {
  flex: 1 1 240px;
  min-height: 48px;
  padding-inline: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
}
.error-search input:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--action) 18%, transparent);
}
.error-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 26px; }
.error-links a { color: var(--action); font-weight: 700; }
.error-links a:hover { text-decoration: underline; }

.media-wave i,
.resource-wave i { background: var(--action); }

/* Interface type floor: legacy component rules must never shrink Persian UI copy. */
#site-main small,
#site-main em {
  font-size: max(.82rem,.875em);
}

#site-main :where(
  .text-link,
  .tag,
  .plan-tag,
  .resource-count,
  .topic-index,
  .reference-tree header span,
  .decision-grid > a > span,
  .coverage-grid span,
  .lifecycle-rail li > span,
  .resource-card > header small,
  .resource-card .resource-tags span,
  .radar-row > span,
  .standards-radar footer p,
  .era-content > header span,
  .era-content > header b,
  .mini-cover > footer span,
  .catalog-meta,
  .book-stats span,
  .qt-lifecycle li > span,
  .chapter-access,
  .download-status > header > b,
  .download-status > footer,
  .trust-strip > article > span,
  .toolchain-layers article > span,
  .compiler-cards article > div span,
  .compiler-feature-table th,
  .compiler-matrix-product > footer,
  .catalog-search > span,
  .media-card-top,
  .media-meta,
  .planned-label,
  .download-card > header > span,
  .download-card dt,
  .download-card dd,
  .download-card summary,
  .download-card footer > a:last-child,
  .price span,
  .payment-note p,
  .result-meta,
  .result-relation,
  .result-heading > span
) {
  font-size: .82rem;
}

.check-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 7 Free";
  font-size: .78rem;
  font-weight: 900;
}

/* Dark mode component corrections */
html[data-theme="dark"] .ref-hero,
html[data-theme="dark"] .eco-hero,
html[data-theme="dark"] .standards-hero,
html[data-theme="dark"] .books-hero,
html[data-theme="dark"] .product-page-head,
html[data-theme="dark"] .portal-hero,
html[data-theme="dark"] .about-hero,
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .content-platform,
html[data-theme="dark"] .book-detail,
html[data-theme="dark"] .standard-timeline { background-color: var(--canvas); }
html[data-theme="dark"] .ref-hero,
html[data-theme="dark"] .eco-hero,
html[data-theme="dark"] .standards-hero { border-color: var(--line); }
html[data-theme="dark"] .button-light { color: var(--brand-cpp-navy); }
html[data-theme="dark"] .primary-nav > a { color: var(--muted); }
html[data-theme="dark"] .primary-nav > a i { color: var(--action); }
html[data-theme="dark"] .primary-nav > a:hover { color: var(--ink-strong); background: var(--surface-2); }
html[data-theme="dark"] .primary-nav > a.active { color: #fff; background: var(--surface-3); border-color: var(--line-strong); }
html[data-theme="dark"] .product-hero-copy h1 span,
html[data-theme="dark"] .ref-hero-copy h1 span,
html[data-theme="dark"] .eco-hero-copy h1 span,
html[data-theme="dark"] .standards-hero-copy h1 span,
html[data-theme="dark"] .books-hero h1 span { color: #70b6df; }
html[data-theme="dark"] .premium-search > i { color: var(--action); }
html[data-theme="dark"] .book-content code:not(pre code) { color: #cdeafb; }
html[data-theme="dark"] .status-badge { color: #ffe5a7; background: #4c3910; }
html[data-theme="dark"] .status-badge.ok { color: #a9f0d2; background: #113f31; }
html[data-theme="dark"] .project-card-qt h2 { color: var(--brand-qt-neon); }
html[data-theme="dark"] .download-card-qt h2 { color: var(--brand-qt-neon); }

/* Responsive */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: 190px minmax(0,1fr) auto; gap: 12px; }
  .primary-nav > a { padding-inline: 8px; }
  .primary-nav > a i { display: none; }
  .command-trigger { min-width: 42px; width: 42px; padding: 0; }
  .font-select, .custom-select.font-picker { width: 78px; min-width: 78px; flex-basis: 78px; }
  .command-trigger b, .command-trigger kbd { display: none; }
  .account-trigger b, .admin-trigger b { display: none; }
  .reference-browser { grid-template-columns: 200px minmax(0,1fr); }
  .reference-brief { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); }
  .reference-brief > header, .source-note { grid-column: 1 / -1; }
  .catalog-card { grid-template-columns: 215px minmax(0,1fr); }
  .premium-resource-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .section-width { width: min(100% - 32px,1280px); }
  .site-header { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar { min-height: 68px; grid-template-columns: minmax(0,1fr) auto; }
  .primary-nav {
    position: fixed;
    z-index: 79;
    top: var(--mobile-menu-top,68px);
    right: 0;
    left: 0;
    width: 100vw;
    height: calc(100dvh - var(--mobile-menu-top,68px));
    display: none;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 9px;
    padding: 20px 18px 100px;
    overflow-y: auto;
    background: var(--canvas);
    border-top: 1px solid var(--line);
  }
  .demo-banner + .site-header .primary-nav {
    top: var(--mobile-menu-top,98px);
    height: calc(100dvh - var(--mobile-menu-top,98px));
  }
  .primary-nav.open { display: grid; }
  .primary-nav > a, .mobile-nav-extras > a {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
  }
  .primary-nav > a i, .mobile-nav-extras > a i { display: inline-block; width: 22px; color: var(--brand-cpp); }
  .mobile-nav-extras { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .menu-toggle { display: inline-flex; }
  .context-bar { display: none; }

  .product-hero-grid, .ref-hero-grid, .eco-hero-grid, .standards-hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 40px; padding-block: 56px; }
  .reference-now, .ref-coverage, .ecosystem-map, .standards-radar { width: 100%; }
  .version-rail { overflow-x: auto; }
  .version-rail small { display: none; }
  .reference-browser { grid-template-columns: 1fr; }
  .reference-tree { grid-template-columns: repeat(2,1fr); }
  .reference-tree header, .reference-tree .tree-action { grid-column: 1 / -1; }
  .reference-brief { grid-column: auto; }
  .engineering-grid, .content-type-grid, .decision-grid { grid-template-columns: 1fr 1fr; }
  .standard-board-grid { grid-template-columns: 1fr 1fr; }
  .standard-sources { grid-column: 1 / -1; }
  .featured-book { grid-template-columns: 1fr; }
  .membership-strip-grid { grid-template-columns: 1fr auto; padding-block: 35px; }
  .membership-strip-grid > .button { grid-column: 1 / -1; justify-self: start; }
  .reference-index { grid-template-columns: 1fr; }
  .ref-domain-tabs { position: static; grid-template-columns: repeat(3,1fr); }
  .ref-domain-tabs > a { min-height: 66px; }
  .ref-domain-stack { gap: 55px; }
  .lifecycle-rail, .qt-lifecycle ol { grid-template-columns: repeat(5,minmax(160px,1fr)); overflow-x: auto; padding-bottom: 10px; }
  .explore-toolbar { grid-template-columns: 1fr; }
  .explore-filters { justify-content: flex-start; }
  .status-glossary > div, .snapshot-grid { grid-template-columns: 1fr; }
  .standard-timeline-grid { grid-template-columns: 1fr; }
  .timeline-guide { position: static; }
  .timeline-guide nav { display: flex; overflow-x: auto; padding: 0 0 8px; border: 0; }
  .timeline-guide nav a { flex: 0 0 auto; padding: 7px 12px; background: var(--canvas); border-radius: 8px; }
  .learning-tracks { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }
  .book-detail-grid { grid-template-columns: minmax(280px,.75fr) minmax(0,1.25fr); gap: 38px; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 620px; }
  .pricing-card.featured { transform: none; }
  .product-page-head .page-head-grid, .portal-hero-grid, .about-hero-grid { grid-template-columns: 1fr; }
  .compiler-cards, .download-grid, .media-grid, .project-grid { grid-template-columns: 1fr 1fr; }
  .toolchain-steps { grid-template-columns: 1fr 1fr; }
  .toolchain-steps::before { display: none; }
  .search-empty-guide { grid-template-columns: 1fr 1fr; }
  .principles-grid, .trust-strip { grid-template-columns: 1fr 1fr; }
  .about-mission, .product-identity, .editorial-charter { grid-template-columns: 1fr; }
  .checkout-page { min-height: 0; grid-template-columns: 1fr; gap: 42px; padding-block: 58px 80px; }
  .checkout-card { position: static; width: min(100%,620px); }
  .reader-layout { grid-template-columns: minmax(0,1fr); }
  .reader-sidebar { position: fixed; z-index: 70; top: var(--reader-panel-top,68px); bottom: auto; width: min(350px,90vw); height: calc(100dvh - var(--reader-panel-top,68px)); display: none; overflow-y: auto; box-shadow: var(--shadow-lg); }
  .chapters-panel { right: 0; }
  .tools-panel { left: 0; }
  .reader-sidebar.open { display: block; }
  .reader-mobile-bar { display: flex; justify-content: space-between; margin: -30px 0 30px; }
  .reader-mobile-bar button { min-height: 40px; padding: 7px 12px; color: var(--action); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-weight: 700; }
  .reader-mobile-bar > span { color: var(--muted); font-size: .86rem; }
  .admin-shell { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .admin-nav { position: static; }
  .admin-nav nav { display: flex; overflow-x: auto; gap: 7px; }
  .admin-nav nav a { flex: 0 0 auto; background: var(--surface); border: 1px solid var(--line); }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .section-width { width: min(100% - 24px,1280px); }
  .demo-banner { justify-content: flex-start; white-space: nowrap; overflow: hidden; }
  .demo-banner > span:last-child { display: none; }
  .brand-glyph { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-copy b { font-size: .95rem; }
  .brand-copy small { font-size: .8125rem; }
  .theme-toggle, .menu-toggle, .command-trigger { width: 40px; height: 40px; min-width: 40px; }
  .font-select, .custom-select.font-picker { width: 74px; min-width: 74px; flex-basis: 74px; height: 40px; padding-inline: 5px; font-size: .7rem; }
  .font-picker .custom-select-trigger { min-height: 40px; padding-inline: 5px; font-size: .7rem; }
  .account-trigger, .admin-trigger { display: none; }
  .primary-nav, .mobile-nav-extras { grid-template-columns: 1fr; }
  .product-hero-grid, .ref-hero-grid, .eco-hero-grid, .standards-hero-grid { padding-block: 42px; }
  .product-hero-copy h1, .ref-hero-copy h1, .eco-hero-copy h1, .standards-hero-copy h1 { font-size: 2.35rem; line-height: 1.27; }
  .product-hero-copy > p, .ref-hero-copy > p, .eco-hero-copy > p, .standards-hero-copy > p { font-size: 1rem; }
  /* Stack the row so the input keeps a full-width tap area next to its button. */
  .search-field {
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 12px 14px;
    row-gap: 10px;
  }
  .search-field > button { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 50px; }
  .search-topic-row, .quick-topics { min-width: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .search-topic-row::-webkit-scrollbar, .quick-topics::-webkit-scrollbar { display: none; }
  .search-topic-row > *, .quick-topics > * { flex: 0 0 auto; }
  .reference-now dl > div { grid-template-columns: 95px 1fr; }
  .version-rail { width: 100%; }
  .product-section-head, .premium-section-head { grid-template-columns: 1fr; gap: 14px; }
  .reference-tree, .reference-brief { grid-template-columns: 1fr; }
  .reference-tree header, .reference-tree .tree-action, .reference-brief > header, .source-note { grid-column: auto; }
  .topic-grid > a { grid-template-columns: 34px 1fr; }
  .topic-grid > a > em { grid-column: 2; justify-self: start; }
  .engineering-grid, .content-type-grid, .standard-board-grid, .decision-grid { grid-template-columns: 1fr; }
  .featured-book-cover { min-height: 480px; }
  .featured-book-copy dl { grid-template-columns: 1fr 1fr; }
  .membership-strip-grid { grid-template-columns: 1fr; gap: 24px; }
  .membership-strip-grid > .button { grid-column: auto; }
  .ref-hero-grid { padding-bottom: 82px; }
  .ref-search-surface { margin-top: -42px; padding: 12px; }
  .ref-domain-tabs { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .ref-domain-tabs > a { min-width: 205px; flex: 0 0 auto; }
  .ref-domain-head { grid-template-columns: 48px 1fr; padding: 16px; }
  .domain-icon { width: 48px; height: 48px; }
  .ref-domain-head > b { grid-column: 2; }
  .ref-topic-grid { grid-template-columns: 1fr; }
  .reference-decisions { padding-block: 70px; }
  .trust-panel, .premium-cta, .standards-trust { grid-template-columns: 1fr; gap: 18px; margin-block: 60px; padding: 25px; }
  .trust-panel { grid-template-columns: 1fr; }
  .ecosystem-map > header { align-items: flex-start; }
  .map-nodes { grid-template-columns: 1fr 1fr; }
  .map-nodes > a { border-left: 1px solid var(--line); }
  .map-nodes > a:nth-child(2n) { border-left: 0; }
  .premium-resource-grid { grid-template-columns: 1fr; }
  .explore-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .explore-filters button { flex: 0 0 auto; }
  .status-glossary > header { align-items: flex-start; flex-direction: column; }
  .version-navigator { width: calc(100% - 24px); }
  .snapshot-grid article { min-height: 270px; }
  .standard-timeline { padding-block: 70px; }
  .timeline-stream { padding-right: 20px; }
  .timeline-stream::before { right: 4px; }
  .era-card { grid-template-columns: 1fr; }
  .era-card::before { right: -22px; }
  .era-marker { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
  .era-marker i { margin: 0; }
  .standards-trust-actions { justify-content: flex-start; }
  .learning-tracks { padding-block: 40px 60px; }
  .book-track > header { align-items: flex-start; flex-direction: column; }
  .catalog-card { grid-template-columns: 1fr; }
  .mini-cover { min-height: 380px; }
  .book-detail-grid { grid-template-columns: 1fr; padding-block: 42px; }
  .book-detail-cover,
  [data-book-brand="qt"] .book-detail-cover { padding: 20px 12px; }
  .book-cover.large { width: 100%; max-width: 320px; min-height: 500px; }
  [data-book-brand="qt"].book-detail { background: var(--surface); }
  .book-detail-copy h1 { font-size: 2.45rem; }
  .book-stats { grid-template-columns: 1fr 1fr; }
  .book-stats > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions > * { width: 100%; }
  .chapter-list > a { grid-template-columns: 44px 1fr; }
  .chapter-access { grid-column: 2; justify-self: start; }
  .chapter-list small { -webkit-line-clamp: 3; line-clamp: 3; }
  .product-page-head, .portal-hero, .about-hero, .page-header { padding-block: 52px; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-search { width: 100%; }
  .compiler-cards, .download-grid, .media-grid, .project-grid, .people-grid { grid-template-columns: 1fr; }
  .toolchain-steps, .search-empty-guide { grid-template-columns: 1fr; }
  .toolchain-steps > li { min-height: 205px; }
  .toolchain-layers, .principles-grid, .trust-strip { grid-template-columns: 1fr; }
  .mirror-note { grid-template-columns: 1fr; gap: 16px; padding: 25px; }
  .payment-note { align-items: flex-start; flex-direction: column; }
  .compiler-matrix-product > header { align-items: flex-start; flex-direction: column; }
  .media-pitch, .submit-project, .contact-panel { align-items: flex-start; flex-direction: column; }
  .about-capabilities, .editorial-charter ol { grid-template-columns: 1fr; }
  .product-identity { gap: 28px; padding: 24px; }
  .product-identity dl > div { grid-template-columns: 1fr; gap: 2px; }
  .people-grid article { grid-template-columns: 52px 1fr; padding: 22px; }
  .person-mark { width: 52px; height: 52px; }
  .updates > article { grid-template-columns: 1fr; gap: 8px; }
  .product-result { grid-template-columns: 1fr; }
  .result-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .page-header-inner h1, .dashboard-header h1 { font-size: 2.35rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .library-list article { grid-template-columns: 88px 1fr; gap: 14px; }
  .library-cover { min-height: 125px; }
  .checkout-steps { grid-template-columns: 1fr; }
  .checkout-steps > div { min-height: 112px; }
  .checkout-copy h1 { font-size: 2.45rem; }
  .checkout-card { padding: 22px; }
  .reader-article { padding: 44px 20px 70px; }
  .reader-mobile-bar { margin-top: -20px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .admin-module { padding: 20px; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form .wide { grid-column: auto; }
  .invoice-table > div { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .invoice-table > div > span { grid-column: 1 / -1; }
  .invoice-table > div > i { justify-self: end; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 34px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 18px; }
}

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

/* =========================================================
   Component styles that previously lived in never-loaded
   stylesheets, restored on the token layer.
   ========================================================= */

/* Live search states inside the command palette (rendered by app.js). */
.live-search-state {
  padding: 18px 16px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

/*
 * Suggestion panel under the inline search fields. app.js fills this with the
 * same <a><span><b>/<em></span><i></i></a> shape the command palette uses; it
 * had no styling at all, so suggestions rendered as bare unstyled text over
 * the page.
 */
.live-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  /* Keep the panel inside the viewport: it opens next to a field that can sit
     low on the page, so an unbounded list would run off the bottom.
     --suggest-max is the real gap measured by app.js; the second value is only
     a ceiling for very tall screens. It used to be 360px, which cut the list
     off at ~5 rows even when there was 600px of room. */
  max-height: min(var(--suggest-max, 46vh), 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* Opened upward when the field sits too low for the list to fit below it. */
.live-search-results.is-above {
  top: auto;
  bottom: calc(100% + 8px);
}

.live-search-results > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .14s ease;
}

.live-search-results > a:hover,
.live-search-results > a:focus-visible { background: var(--surface-2); }

.live-search-results > a > span { min-width: 0; display: grid; gap: 2px; }
.live-search-results b { color: var(--ink); font-size: .95rem; font-weight: 700; }
.live-search-results em {
  overflow: hidden;
  color: var(--muted);
  font-size: .84rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-search-results > a > i {
  flex: 0 0 auto;
  padding: 3px 9px;
  color: var(--action);
  background: color-mix(in srgb, var(--action) 9%, var(--surface));
  border-radius: 7px;
  font-size: .76rem;
  font-style: normal;
  white-space: nowrap;
}

/*
 * On phones the search form is already a flex column and the panel is ordered
 * last in it, so let it sit in the flow. Floating it absolutely over a field
 * that is roughly mid-screen left it no room in either direction — it ran off
 * the top of the viewport once it held more than a few results.
 */
@media (max-width: 680px) {
  .reference-search .live-search-results,
  .premium-search .live-search-results {
    position: static;
    max-height: min(58vh, 420px);
  }
  .reference-search .live-search-results.is-above,
  .premium-search .live-search-results.is-above { bottom: auto; }
}

/* Standards board: the three cards were visually identical, which lost the
   published / current / horizon hierarchy the rest of the site communicates. */
.standard-board-grid > .standard-current {
  color: var(--on-action);
  background: var(--action);
  border-color: var(--action);
}

/* Everything inside the filled card takes the on-action ink, otherwise
   links keep --action and become invisible against their own background. */
.standard-board-grid > .standard-current :is(h3, p, span, b, code, a, i) { color: inherit; }

.standard-board-grid > .standard-current p { opacity: .88; }

.standard-board-grid > .standard-current > div a {
  background: color-mix(in srgb, var(--on-action) 16%, transparent);
}

.standard-board-grid > .standard-current > div a:hover {
  background: color-mix(in srgb, var(--on-action) 28%, transparent);
}

.standard-board-grid > .standard-current .card-action { text-decoration: underline; text-underline-offset: 4px; }

.standard-board-grid > .standard-future {
  border-color: color-mix(in srgb, var(--future) 45%, var(--line));
  box-shadow: inset 0 3px 0 0 var(--future), var(--shadow-sm);
}

.standard-board-grid > .standard-future > header b { color: var(--future-ink); }

/* Download Center / repository operations */
.mirror-hero { overflow: hidden; color: #fff; background: radial-gradient(circle at 12% 14%,rgba(101,154,210,.3),transparent 30%),linear-gradient(135deg,var(--brand-cpp-navy),var(--brand-cpp-deep)); }
.mirror-hero-grid { min-height: 470px; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(330px,.55fr); align-items: center; gap: clamp(48px,8vw,110px); padding-block: 76px; }
.mirror-hero h1 { max-width: 850px; margin: 14px 0 18px; color: #fff; font-size: clamp(2.6rem,4.8vw,5.4rem); line-height: 1.14; }
.mirror-hero p { max-width: 760px; color: #c8deeb; font-size: 1.03rem; }
.mirror-hero .eyebrow { color: #a7d8f2; }
.mirror-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.mirror-live-card { overflow: hidden; background: rgba(255,255,255,.08); border: 1px solid rgba(170,218,244,.28); border-radius: 22px; box-shadow: 0 25px 70px rgba(0,20,42,.28); backdrop-filter: blur(12px); }
.mirror-live-card > header { min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.15); }
.mirror-live-card > header b { display: inline-flex; align-items: center; gap: 7px; color: #c9e7d8; font-size: .78rem; }
.mirror-live-card > header b i { width: 8px; height: 8px; background: #2cde85; border-radius: 50%; }
.mirror-live-card dl { display: grid; gap: 1px; margin: 0; background: rgba(255,255,255,.12); }
.mirror-live-card dl > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 20px; background: rgba(0,36,69,.75); }
.mirror-live-card dt { color: #a9cada; font-size: .8rem; }
.mirror-live-card dd { margin: 0; color: #fff; font-weight: 750; }
.mirror-live-card > p { margin: 0; padding: 18px 20px; color: #bdd9e8; font-size: .82rem; }
.mirror-principles { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: -34px; }
.mirror-principles article { min-height: 92px; display: flex; align-items: center; gap: 14px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-md); }
.mirror-principles article > i { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 14px; }
.mirror-principles b,.mirror-principles span { display: block; }
.mirror-principles span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.mirror-catalog { padding-block: 92px 84px; }
.mirror-catalog-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.mirror-catalog-head h2 { margin: 6px 0 0; }
.mirror-search { min-width: min(360px,100%); display: flex; align-items: center; gap: 8px; padding-inline: 13px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 13px; }
.mirror-search i { color: var(--action); }
.mirror-search input { min-height: 46px !important; padding-inline: 4px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
.mirror-filter-row { margin: 24px 0; }
.mirror-repository-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.mirror-repository-card { min-height: 344px; display: flex; flex-direction: column; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-xs); transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.mirror-repository-card:hover { transform: translateY(-3px); border-color: var(--brand-cpp-sky); box-shadow: var(--shadow-md); }
.mirror-repository-card > header { display: flex; align-items: center; justify-content: space-between; }
.mirror-repository-icon { width: 52px; height: 52px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 15px; }
.mirror-health { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; color: var(--muted); background: var(--surface-2); border-radius: 999px; font-size: .73rem; font-style: normal; font-weight: 750; }
.mirror-health > i { width: 7px; height: 7px; background: var(--soft); border-radius: 50%; }
.mirror-health:is(.healthy,.completed) { color: var(--success-ink); background: color-mix(in srgb,var(--success) 11%,var(--surface)); }
.mirror-health:is(.healthy,.completed) > i { background: var(--success); }
.mirror-health:is(.outdated,.checking,.downloading,.verifying,.publishing,.syncing) { color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 12%,var(--surface)); }
.mirror-health:is(.outdated,.checking,.downloading,.verifying,.publishing,.syncing) > i { background: var(--warning); }
.mirror-health.failed { color: var(--danger); background: color-mix(in srgb,var(--danger) 9%,var(--surface)); }
.mirror-health.failed > i { background: var(--danger); }
.mirror-provider { margin-top: 26px; color: var(--action); font: 750 .75rem ui-monospace,monospace; }
.mirror-repository-card h2 { margin: 7px 0 18px; font-size: 1.5rem; }
.mirror-repository-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 11px; }
.mirror-repository-card dl div { padding: 12px; background: var(--surface-2); }
.mirror-repository-card dt { color: var(--soft); font-size: .72rem; }
.mirror-repository-card dd { margin: 3px 0 0; color: var(--ink); font-weight: 750; }
.mirror-repository-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.mirror-repository-card footer > a:last-child { color: var(--action); font-size: .78rem; font-weight: 750; }
.mirror-attribution { min-height: 120px; display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 16px; margin-bottom: 90px; padding: 22px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; }
.mirror-attribution > i { width: 50px; height: 50px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 14px; }
.mirror-attribution p { margin: 4px 0 0; font-size: .86rem; }
.mirror-project-hero { padding-block: 52px; background: linear-gradient(145deg,var(--surface),var(--surface-2)); border-bottom: 1px solid var(--line); }
.mirror-project-head { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 46px; align-items: end; }
.mirror-project-head > .back-link { grid-column: 1/-1; color: var(--action); font-weight: 750; }
.mirror-project-head h1 { margin: 7px 0; }
.mirror-project-head > aside { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.mirror-project-head aside dl { margin: 14px 0 0; }
.mirror-project-head aside dl div { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; border-top: 1px solid var(--line); }
.mirror-project-head aside dt { color: var(--muted); font-size: .8rem; }
.mirror-project-head aside dd { margin: 0; color: var(--ink); font-size: .82rem; font-weight: 700; }
.mirror-project-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 22px; padding-block: 68px 92px; }
.mirror-list-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.mirror-list-head h2 { margin: 4px 0 0; }
.mirror-empty { min-height: 340px; display: grid; place-items: center; align-content: center; padding: 38px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 19px; }
.mirror-empty > i { color: var(--action); font-size: 2rem; }
.mirror-empty h3 { margin: 18px 0 5px; }
.mirror-empty p { max-width: 540px; margin: 0 0 18px; }
.artifact-table { display: grid; gap: 10px; }
.artifact-table article { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,.8fr) auto; align-items: center; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.artifact-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.artifact-main > i { width: 42px; height: 42px; display: grid; place-items: center; color: var(--action); background: var(--surface-2); border-radius: 11px; }
.artifact-main b,.artifact-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-main span { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.artifact-table article > code { overflow: hidden; color: var(--soft); font-size: .72rem; text-overflow: ellipsis; }
.artifact-actions { display: flex; align-items: center; gap: 7px; }
.artifact-actions > button { color: var(--action); background: transparent; border: 0; font: inherit; font-size: .74rem; font-weight: 750; }
.mirror-project-meta { align-self: start; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.mirror-project-meta h2 { margin-top: 0; }
.mirror-project-meta dl div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding-block: 10px; border-top: 1px solid var(--line); }
.mirror-project-meta dt { color: var(--muted); font-size: .8rem; }
.mirror-project-meta dd { margin: 0; color: var(--ink); font-size: .82rem; font-weight: 700; }
.mirror-admin-metrics { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; padding-block: 24px; }
.mirror-admin-metrics article { min-height: 118px; display: grid; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.mirror-admin-metrics span,.mirror-admin-metrics small { color: var(--muted); font-size: .78rem; }
.mirror-admin-metrics b { color: var(--action); font-size: 1.7rem; }
.mirror-admin-repositories { display: grid; gap: 10px; margin-top: 20px; }
.mirror-create-repo { margin-top: 16px; overflow: hidden; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 13px; }
.mirror-create-repo > summary { min-height: 64px; display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 11px; padding: 10px 14px; cursor: pointer; list-style: none; }
.mirror-create-repo > summary::-webkit-details-marker { display: none; }
.mirror-create-repo > summary > i:first-child { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--brand-cpp); border-radius: 10px; }
.mirror-create-repo summary b,.mirror-create-repo summary small { display: block; }
.mirror-create-repo summary small { color: var(--muted); font-size: .76rem; }
.mirror-create-repo[open] > summary { border-bottom: 1px solid var(--line); }
.mirror-create-repo[open] > summary > i:last-child { transform: rotate(180deg); }
.mirror-create-repo > form { padding: 18px; background: var(--canvas); }
.mirror-admin-repository { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.mirror-admin-repository > summary { min-height: 74px; display: grid; grid-template-columns: 50px minmax(0,1fr) auto 20px; align-items: center; gap: 13px; padding: 11px 15px; cursor: pointer; list-style: none; }
.mirror-admin-repository > summary::-webkit-details-marker { display: none; }
.mirror-admin-repository > summary div b,.mirror-admin-repository > summary div small { display: block; }
.mirror-admin-repository > summary div small { color: var(--muted); }
.mirror-admin-repository[open] > summary { border-bottom: 1px solid var(--line); }
.mirror-admin-repository[open] > summary > i:last-child { transform: rotate(180deg); }
.mirror-admin-repository-body { display: grid; gap: 20px; padding: 20px; background: var(--canvas); }
.mirror-repo-facts { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.mirror-repo-facts span { padding: 11px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; }
.mirror-repo-facts b { display: block; margin-top: 3px; color: var(--ink); }
.mirror-job-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.mirror-history-table { overflow-x: auto; }
.mirror-history-table > header,.mirror-history-table > div { min-width: 720px; display: grid; grid-template-columns: 1.2fr .7fr .8fr .7fr 1fr; gap: 10px; align-items: center; padding: 11px; border-bottom: 1px solid var(--line); }
.mirror-history-table > header { color: var(--muted); background: var(--surface-2); font-size: .76rem; }
.mirror-history-table > div { position: relative; font-size: .8rem; }
.mirror-history-table small { grid-column: 1/-1; color: var(--danger); }
.mirror-storage-note { display: flex; align-items: center; gap: 14px; padding: 17px; background: var(--surface-2); border-radius: 12px; }
.mirror-storage-note > i { color: var(--action); font-size: 1.4rem; }
.mirror-storage-note p { margin: 0; }
.mirror-inventory-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.mirror-inventory-grid > article { min-width: 0; padding: 16px; background: var(--canvas); border: 1px solid var(--line); border-radius: 13px; }
.mirror-inventory-grid article > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mirror-inventory-grid header b,.mirror-inventory-grid header small { display: block; }
.mirror-inventory-grid header small { color: var(--muted); font: .75rem ui-monospace,monospace; }
.mirror-inventory-grid header a { color: var(--action); font-size: .76rem; font-weight: 750; }
.mirror-inventory-grid dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 14px 0; overflow: hidden; background: var(--line); border-radius: 9px; }
.mirror-inventory-grid dl div { padding: 9px; background: var(--surface); }
.mirror-inventory-grid dt { color: var(--muted); font-size: .72rem; }
.mirror-inventory-grid dd { margin: 2px 0 0; color: var(--ink); font-weight: 800; }
.mirror-inventory-grid ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.mirror-inventory-grid li { min-width: 0; display: flex; justify-content: space-between; gap: 10px; padding: 7px; background: var(--surface); border-radius: 7px; }
.mirror-inventory-grid li code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mirror-inventory-grid li span,.mirror-inventory-grid p { color: var(--muted); font-size: .72rem; }
.mirror-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }

@media (max-width: 1100px) {
  .mirror-repository-grid { grid-template-columns: repeat(2,1fr); }
  .mirror-admin-metrics { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 960px) {
  .mirror-hero-grid,.mirror-project-head,.mirror-project-layout { grid-template-columns: 1fr; }
  .mirror-live-card { max-width: 620px; }
  .mirror-principles { grid-template-columns: 1fr; margin-top: 18px; }
  .mirror-project-meta { order: -1; }
  .artifact-table article { grid-template-columns: 1fr; }
  .mirror-repo-facts { grid-template-columns: repeat(2,1fr); }
  .mirror-inventory-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .mirror-hero-grid { min-height: 0; padding-block: 52px; }
  .mirror-hero h1 { font-size: 2.5rem; }
  .mirror-catalog { padding-block: 64px; }
  .mirror-catalog-head { align-items: stretch; flex-direction: column; }
  .mirror-repository-grid,.mirror-admin-metrics { grid-template-columns: 1fr; }
  .mirror-repository-card footer { align-items: flex-start; flex-direction: column; }
  .mirror-admin-repository > summary { grid-template-columns: 44px minmax(0,1fr) 18px; }
  .mirror-admin-repository > summary .mirror-health { grid-column: 2; justify-self: start; }
  .mirror-repo-facts { grid-template-columns: 1fr; }
}

/* 2026 shell refresh: one clear navigation hierarchy, official C++ mark,
   calmer dark surfaces and consistent link geometry. */
.site-header { box-shadow: 0 10px 34px color-mix(in srgb,var(--brand-cpp-navy) 7%,transparent); }
.topbar { min-height: 76px; grid-template-columns: 205px minmax(0,1fr) auto; }
.brand-glyph {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  overflow: visible;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.brand-glyph::before { display: none; }
.brand-glyph img { display: block; width: 48px; height: 48px !important; max-height: 48px; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,68,130,.16)); }
.primary-nav { gap: 6px; }
.primary-nav > a,
.nav-overflow > summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.nav-overflow { position: relative; }
.nav-overflow > summary::-webkit-details-marker { display: none; }
.nav-overflow > summary i:first-child { color: var(--action); }
.nav-overflow > summary i:last-child { margin-right: 2px; color: var(--soft); font-size: .65rem; transition: transform .18s ease; }
.nav-overflow[open] > summary { color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-color: var(--line); }
.nav-overflow[open] > summary i:last-child { transform: rotate(180deg); }
.nav-overflow > div {
  position: absolute;
  z-index: 95;
  top: calc(100% + 10px);
  right: 0;
  width: 245px;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.nav-overflow > div a { min-height: 46px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--ink); border-radius: 10px; font-size: .86rem; font-weight: 700; }
.nav-overflow > div a i { width: 22px; color: var(--action); text-align: center; }
.nav-overflow > div a:hover { color: var(--action); background: var(--surface-2); }
.context-bar { min-height: 38px; background: color-mix(in srgb,var(--surface-2) 76%,var(--surface)); }
.context-bar > div { min-height: 38px; gap: 16px; }
.context-bar .implementation-link { margin-right: auto; }
.implementation-link,
.inline-link,
.back-link,
.card-action,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  line-height: 1.45;
  text-decoration: none;
  text-underline-offset: 4px;
}
.implementation-link { color: var(--action); font-size: .8rem; font-weight: 750; }
.implementation-link i,
.inline-link i,
.back-link i,
.card-action i { flex: 0 0 auto; font-size: .74em; transition: transform .18s ease; }
:is(.implementation-link,.inline-link,.back-link,.card-action):hover i { transform: translateX(-3px); }

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 85% -10%,rgba(0,89,156,.14),transparent 34rem),
    var(--canvas);
}
html[data-theme="dark"] .site-header { background: rgba(12,23,33,.9); border-color: #203342; }
html[data-theme="dark"] .context-bar { background: #0d1a25; }
html[data-theme="dark"] .primary-nav > a.active { color: #dff1ff; background: #173148; border-color: #294b65; }
html[data-theme="dark"] .nav-overflow > div { background: #111f2b; }
html[data-theme="dark"] :is(.ref-hero,.eco-hero,.standards-hero,.books-hero,.portal-hero,.about-hero,.page-header,.content-platform,.book-detail,.standard-timeline) {
  background-color: transparent;
}
html[data-theme="dark"] .mirror-hero {
  background: radial-gradient(circle at 10% 8%,rgba(101,154,210,.2),transparent 35%),linear-gradient(145deg,#0c2334,#091822 70%);
}
html[data-theme="dark"] .mirror-live-card dl > div { background: rgba(9,25,37,.82); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 182px minmax(0,1fr) auto; }
  .nav-overflow > summary span { display: none; }
}

@media (max-width: 960px) {
  .topbar { min-height: 68px; grid-template-columns: minmax(0,1fr) auto; }
  .nav-overflow { grid-column: 1 / -1; position: static; }
  .nav-overflow > summary { width: 100%; min-height: 62px; color: var(--ink); background: var(--surface); border-color: var(--line); }
  .nav-overflow > summary span { display: inline; }
  .nav-overflow > summary i:last-child { margin-right: auto; }
  .nav-overflow > div { position: static; width: 100%; grid-template-columns: 1fr 1fr; margin-top: 8px; box-shadow: none; }
  .primary-nav > a { min-height: 62px; }
}

@media (max-width: 680px) {
  .brand-glyph img { width: 40px; height: 40px !important; max-height: 40px; }
  .nav-overflow > div { grid-template-columns: 1fr; }
}

/* Navigation, reference-browser and reader refinement — 2026-08 */
.mobile-nav-preferences { display: none; }

.reference-tree > a.tree-action {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
}
.reference-tree > a.tree-action span { min-width: 0; }
.reference-tree > a.tree-action > i { flex: 0 0 auto; font-size: .75rem; transition: transform .18s ease; }
.reference-tree > a.tree-action:hover > i { transform: translateX(-3px); }

/* Reading pages behave like a focused workspace instead of a document slab. */
.reader-layout {
  position: relative;
  grid-template-columns: minmax(215px,250px) minmax(0,860px) minmax(225px,265px);
  justify-content: center;
  align-items: start;
  gap: 18px;
  padding: 26px clamp(16px,3vw,44px) 64px;
  background:
    linear-gradient(color-mix(in srgb,var(--line) 44%,transparent) 1px,transparent 1px),
    linear-gradient(90deg,color-mix(in srgb,var(--line) 44%,transparent) 1px,transparent 1px),
    var(--canvas);
  background-size: 72px 72px;
}
.reader-reading-progress {
  position: fixed;
  z-index: 86;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  pointer-events: none;
}
.reader-reading-progress > i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg,var(--brand-cpp-sky),var(--action));
  box-shadow: 0 0 12px color-mix(in srgb,var(--action) 45%,transparent);
  transition: width .12s linear;
}
.reader-panel-backdrop { display: none; }
.reader-sidebar {
  top: 142px;
  height: calc(100dvh - 166px);
  padding: 18px 14px;
  overflow-y: auto;
  background: color-mix(in srgb,var(--surface) 96%,transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px color-mix(in srgb,var(--ink) 8%,transparent);
  scrollbar-gutter: stable;
  backdrop-filter: blur(16px);
}
.tools-panel { border: 1px solid var(--line); }
.reader-article {
  margin: 0;
  padding: 46px clamp(28px,5vw,68px) 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px color-mix(in srgb,var(--ink) 7%,transparent);
}
.chapter-header { margin-bottom: 32px; padding-bottom: 28px; }
.chapter-header h1 { font-size: clamp(2.2rem,4vw,3.5rem); }
.reader-chapters a {
  position: relative;
  min-height: 50px;
  transition: color .18s ease,background .18s ease,transform .18s ease;
}
.reader-chapters a:hover { transform: translateX(-2px); }
.reader-chapters a.active {
  color: var(--action);
  background: color-mix(in srgb,var(--action) 10%,var(--surface));
  box-shadow: inset -3px 0 var(--action);
}
.page-toc,.reader-actions,.tutor-box { background: color-mix(in srgb,var(--surface-2) 74%,var(--surface)); }
.page-toc a {
  padding: 7px 10px;
  border-radius: 8px;
  transition: color .16s ease,background .16s ease,transform .16s ease;
}
.page-toc a:hover,.page-toc a.active {
  color: var(--action);
  background: color-mix(in srgb,var(--action) 9%,var(--surface));
  transform: translateX(-2px);
}
.chapter-pagination a {
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 14px;
  transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.chapter-pagination a.next { grid-template-columns: minmax(0,1fr) auto; }
.chapter-pagination a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.chapter-pagination a > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--action);
  background: color-mix(in srgb,var(--action) 9%,var(--surface));
  border-radius: 10px;
}
.chapter-pagination a > span { min-width: 0; display: grid; }

/* C++ code blocks: local, dependency-free editor treatment and tokenizer. */
.book-content pre.code-editor,
pre.code-editor {
  position: relative;
  margin: 30px 0;
  padding: 0;
  overflow: auto;
  color: #d6deeb;
  background: #09111b;
  border: 1px solid #26394c;
  border-radius: 16px;
  box-shadow: 0 18px 38px rgba(0,15,32,.2);
  direction: ltr;
  text-align: left;
  scrollbar-color: #3a5772 #09111b;
}
.code-editor-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  color: #a9bed0;
  background: #101b28;
  border-bottom: 1px solid #26394c;
  font: 700 .72rem ui-monospace,SFMono-Regular,Menlo,monospace;
}
.code-editor-dots { display: flex; gap: 6px; }
.code-editor-dots i { width: 9px; height: 9px; background: #ff6b6b; border-radius: 50%; }
.code-editor-dots i:nth-child(2) { background: #ffd166; }
.code-editor-dots i:nth-child(3) { background: #46d89c; }
.code-editor-actions { display: flex; gap: 4px; margin-left: auto; }
.code-editor-actions button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #a9bed0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}
.code-editor-actions button:hover,
.code-editor-actions button[aria-pressed="true"] { color: #fff; background: #1a2a3a; border-color: #31485e; }
.code-editor-body {
  display: grid;
  grid-template-columns: auto minmax(max-content,1fr);
  min-width: max-content;
}
.code-line-numbers {
  display: block;
  padding: 16px 13px 16px 16px;
  color: #587086;
  background: #0b1520;
  border-right: 1px solid #1f3142;
  font: 500 .84rem/1.8 ui-monospace,SFMono-Regular,Menlo,monospace;
  text-align: right;
  user-select: none;
  white-space: pre;
}
.code-editor code {
  display: block;
  min-width: 0;
  padding: 16px 22px;
  color: #d6deeb;
  background: transparent;
  font: 500 .88rem/1.8 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace !important;
  tab-size: 4;
  white-space: pre;
}
.code-editor.is-wrapped .code-editor-body { grid-template-columns: auto minmax(0,1fr); min-width: 100%; }
.code-editor.is-wrapped code { white-space: pre-wrap; overflow-wrap: anywhere; }
.cpp-token.keyword { color: #c792ea; }
.cpp-token.type { color: #82aaff; }
.cpp-token.literal { color: #ff5874; }
.cpp-token.namespace { color: #ffc777; }
.cpp-token.function { color: #82d2ce; }
.cpp-token.comment { color: #687b8e; font-style: italic; }
.cpp-token.preprocessor { color: #ffcb8b; }
.cpp-token.string,.cpp-token.character { color: #c3e88d; }
.cpp-token.number { color: #f78c6c; }
.cpp-token.operator { color: #89ddff; }
.code-editor ::selection { color: #fff; background: #2c5f8a; }

html[data-theme="dark"] .reader-article,
html[data-theme="dark"] .reader-sidebar { box-shadow: 0 18px 52px rgba(0,0,0,.24); }

@media (max-width: 1180px) and (min-width: 961px) {
  .reader-layout { grid-template-columns: 210px minmax(0,1fr) 225px; gap: 12px; padding-inline: 12px; }
  .reader-article { padding-inline: clamp(24px,4vw,50px); }
}

@media (max-width: 960px) {
  .primary-nav {
    position: fixed;
    z-index: 91;
    top: var(--mobile-menu-top,68px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - var(--mobile-menu-top,68px) - 16px);
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px;
    overflow-y: auto;
    background: color-mix(in srgb,var(--surface) 96%,transparent);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,26,49,.22);
    backdrop-filter: blur(22px);
  }
  .primary-nav.open { display: grid; animation: menu-in .18s ease-out both; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
  body.menu-open { overflow: hidden; }
  body.menu-open::after {
    content: "";
    position: fixed;
    z-index: 74;
    inset: 0;
    background: rgba(3,18,31,.3);
    backdrop-filter: blur(3px);
  }
  .primary-nav > a {
    min-height: 48px;
    padding: 9px 12px;
    background: transparent;
    border: 0;
    border-radius: 10px;
  }
  .primary-nav > a:hover,.primary-nav > a.active { background: var(--surface-2); }
  .nav-overflow { position: static; grid-column: auto; border-top: 1px solid var(--line); }
  .nav-overflow > summary { display: none; }
  .nav-overflow > div {
    position: static;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin: 5px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .nav-overflow > div a { min-height: 46px; padding: 8px 12px; }
  .mobile-nav-preferences {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 11px;
  }
  .mobile-nav-preferences > label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .84rem; font-weight: 750; }
  .mobile-nav-preferences .custom-select { min-width: 132px; }

  .reader-layout { display: block; min-height: 70vh; padding: 12px 12px 44px; background-size: 56px 56px; }
  .reader-article { padding: 22px clamp(18px,5vw,42px) 56px; border-radius: 18px; }
  .reader-mobile-bar {
    position: sticky;
    z-index: 15;
    top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: -10px -6px 26px;
    padding: 7px;
    color: var(--muted);
    background: color-mix(in srgb,var(--surface) 92%,transparent);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
  }
  .reader-mobile-bar button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; }
  .reader-sidebar {
    position: fixed;
    z-index: 90;
    top: var(--reader-panel-top,68px);
    bottom: 12px;
    display: block;
    width: min(360px,calc(100vw - 34px));
    height: auto;
    padding: 18px 14px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease,opacity .18s ease,visibility 0s linear .22s;
  }
  .chapters-panel { right: 12px; transform: translateX(110%); }
  .tools-panel { right: auto; left: 12px; transform: translateX(-110%); }
  .reader-sidebar.open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0s;
  }
  .reader-panel-backdrop {
    position: fixed;
    z-index: 84;
    inset: var(--reader-panel-top,68px) 0 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(3,18,31,.34);
    border: 0;
    backdrop-filter: blur(3px);
    transition: opacity .18s ease,visibility 0s linear .18s;
  }
  body.reader-panel-open { overflow: hidden; }
  body.reader-panel-open .reader-panel-backdrop { visibility: visible; opacity: 1; transition-delay: 0s; }
}

@media (max-width: 680px) {
  .topbar { min-height: 64px; gap: 8px; padding-inline: 12px; }
  .header-actions { gap: 6px; }
  .header-actions > .font-picker { display: none; }
  .command-trigger { width: 44px; min-width: 44px; padding: 0; }
  .command-trigger b,.command-trigger kbd { display: none; }
  .primary-nav { top: var(--mobile-menu-top,64px); right: 8px; left: 8px; }
  .nav-overflow > div { grid-template-columns: 1fr; }
  .brand-copy small { display: none; }
  .reader-layout { padding: 0 0 36px; }
  .reader-article { padding: 16px 18px 48px; border-inline: 0; border-radius: 0 0 18px 18px; }
  .reader-mobile-bar { margin: -5px -8px 24px; }
  .chapter-header { margin-bottom: 25px; padding-bottom: 22px; }
  .chapter-header h1 { font-size: clamp(1.9rem,9.6vw,2.7rem); }
  .book-content { font-size: 1rem; }
  .book-content h2 { margin-top: 42px; font-size: 1.55rem; }
  .chapter-pagination { grid-template-columns: 1fr; margin-top: 50px; }
  .chapter-pagination > span:empty { display: none; }
  .chapter-pagination a.next { text-align: right; }
  .code-editor code { padding-inline: 16px; font-size: .82rem !important; }
  .code-line-numbers { padding-inline: 10px; font-size: .78rem; }

  .ref-hero-grid { gap: 28px; padding-block: 42px 56px; }
  .ref-hero-copy h1 { font-size: clamp(2rem,10vw,3rem); }
  .ref-hero-copy > p { font-size: 1rem; }
  .ref-coverage .coverage-primary { padding: 22px 20px; }
  .ref-coverage .coverage-primary strong { font-size: clamp(1.85rem,10vw,2.7rem); }
}

@media (prefers-reduced-motion: reduce) {
  .reader-sidebar,.reader-panel-backdrop,.reader-reading-progress > i { transition: none; }
}

/* Mega navigation: a small top-level model with contextual destinations. */
.nav-mega { position: relative; }
.nav-mega > summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: .9rem;
  font-weight: 750;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease,background .18s ease,border-color .18s ease;
}
.nav-mega > summary::-webkit-details-marker { display: none; }
.nav-mega > summary i:first-child { color: var(--action); }
.nav-mega > summary i:last-child { margin-right: 2px; color: var(--soft); font-size: .65rem; transition: transform .18s ease; }
.nav-mega > summary:hover,.nav-mega[open] > summary,.nav-mega.active > summary {
  color: var(--action);
  background: color-mix(in srgb,var(--action) 8%,var(--surface));
  border-color: color-mix(in srgb,var(--action) 14%,var(--line));
}
.nav-mega[open] > summary i:last-child { transform: rotate(180deg); }
.mega-panel {
  position: fixed;
  z-index: 94;
  top: calc(var(--mega-top,72px) + 8px);
  right: 50%;
  width: min(1120px,calc(100vw - 40px));
  display: grid;
  grid-template-columns: 320px minmax(0,1fr);
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: color-mix(in srgb,var(--surface) 97%,transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0,25,48,.22);
  transform: translateX(50%);
  backdrop-filter: blur(24px) saturate(1.15);
  animation: mega-in .2s cubic-bezier(.22,1,.36,1) both;
}
@keyframes mega-in { from { opacity: 0; transform: translateX(50%) translateY(-8px) scale(.99); } }
.mega-intro {
  min-height: 225px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 25px;
  background:
    radial-gradient(circle at 12% 8%,rgba(101,154,210,.22),transparent 55%),
    var(--brand-cpp-deep);
  border-radius: 14px;
}
.mega-intro > span { color: #8ed0f2; font-size: .74rem; font-weight: 800; }
.mega-intro h2 { margin: 8px 0 5px; color: #fff; font-size: 1.45rem; }
.mega-intro p { margin: 0; color: #bfd8e7; font-size: .85rem; line-height: 1.9; }
.mega-intro > a { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; color: #fff; font-size: .84rem; font-weight: 800; }
.mega-intro > a i { transition: transform .18s ease; }
.mega-intro > a:hover i { transform: translateX(-4px); }
.mega-links { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 5px; padding: 5px; }
.mega-links > a {
  min-height: 94px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  transition: background .16s ease,border-color .16s ease,transform .16s ease;
}
.mega-links > a:hover { background: var(--surface-2); border-color: var(--line); transform: translateY(-2px); }
.mega-links > a > i { width: 42px; height: 42px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 11px; }
.mega-links > a > span { min-width: 0; display: grid; gap: 3px; }
.mega-links b { color: var(--ink); font-size: .9rem; }
.mega-links small { color: var(--muted); font-size: .76rem; line-height: 1.55; }
body.mega-open::after { content: ""; position: fixed; z-index: 72; inset: var(--mega-top,72px) 0 0; background: rgba(2,18,30,.2); backdrop-filter: blur(2px); }

/* Use the available width on reading pages; prose remains comfortably bounded. */
.reader-layout {
  grid-template-columns: minmax(240px,280px) minmax(0,1fr) minmax(240px,280px);
  justify-content: stretch;
  gap: 16px;
  padding: 20px clamp(14px,2vw,30px) 64px;
}
.reader-article { padding-inline: clamp(34px,5vw,86px); }
.chapter-header,.book-content,.chapter-pagination,.locked-card { max-width: 1080px; }

/* JetBrains/CLion-inspired editor chrome and Darcula token palette. */
.book-content pre.code-editor,pre.code-editor { background: #2b2b2b; border-color: #4a4d4f; box-shadow: 0 22px 48px rgba(0,0,0,.24); }
.code-editor-toolbar { height: 48px; color: #a9b7c6; background: #3c3f41; border-color: #515456; }
.code-editor-dots { opacity: .78; }
.code-editor-tab { align-self: stretch; display: inline-flex; align-items: center; gap: 8px; padding-inline: 13px; color: #d8d8d8; background: #2b2b2b; border-top: 2px solid #4f9bd6; }
.code-editor-tab > i { color: #7eb6e7; }
.code-editor-tab b { font-size: .74rem; font-weight: 650; }
.code-editor-language { padding: 3px 8px; color: #9ebad0; background: #323537; border: 1px solid #4b4e50; border-radius: 6px; font-size: .66rem; }
.code-editor-actions button { color: #c7cdd2; background: #45484a; border-color: #56595b; }
.code-editor-actions button:hover,.code-editor-actions button[aria-pressed="true"] { background: #4b4e50; border-color: #5b5e60; }
.code-editor-body { background: #2b2b2b; }
.code-line-numbers { color: #606366; background: #313335; border-color: #45484a; }
.code-editor code { color: #a9b7c6; background: #2b2b2b; }
.code-editor-status { min-width: 100%; min-height: 28px; display: flex; align-items: center; gap: 15px; padding: 4px 12px; color: #8f969c; background: #3c3f41; border-top: 1px solid #515456; font: 500 .65rem ui-monospace,SFMono-Regular,Menlo,monospace; }
.code-editor-status span:first-child { margin-left: auto; color: #9bc1df; }
.cpp-token.keyword { color: #cc7832; font-weight: 600; }
.cpp-token.type { color: #a9b7c6; }
.cpp-token.literal { color: #cc7832; }
.cpp-token.namespace { color: #ffc66d; }
.cpp-token.function { color: #ffc66d; }
.cpp-token.comment { color: #808080; }
.cpp-token.preprocessor { color: #bbb529; }
.cpp-token.string,.cpp-token.character { color: #6a8759; }
.cpp-token.number { color: #6897bb; }
.cpp-token.operator { color: #a9b7c6; }

/* Reliable anchor feedback, including percent-encoded Persian identifiers. */
.book-content [id],.ref-domain,.ref-topic-card,.topic-anchor { scroll-margin-top: 150px; }
.anchor-pulse { animation: anchor-pulse 1.05s ease-out; }
@keyframes anchor-pulse {
  0%,35% { outline: 4px solid color-mix(in srgb,var(--action) 30%,transparent); outline-offset: 7px; }
  100% { outline-color: transparent; outline-offset: 16px; }
}

/* Search has one focus owner, richer results, scopes, and stable keyboard UI. */
.search-field { box-shadow: none; }
.search-field:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb,var(--action) 13%,transparent); }
.search-field > input,.search-field > input:focus,.search-field > input:focus-visible {
  min-height: 44px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.command-dialog { width: min(820px,calc(100% - 32px)); max-height: min(780px,82dvh); display: flex; flex-direction: column; }
.command-dialog > header { min-height: 74px; gap: 12px; }
.command-dialog > header > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); border-radius: 10px; }
.command-dialog > header > div { min-width: 0; display: grid; }
.command-dialog > header label { font-size: 1rem; }
.command-dialog > header small { color: var(--muted); font-size: .72rem; }
.command-input-shell { min-height: 58px; display: grid; grid-template-columns: 22px minmax(0,1fr) 34px; align-items: center; gap: 10px; padding: 7px 13px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; transition: border-color .18s ease,box-shadow .18s ease; }
.command-input-shell:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb,var(--action) 13%,transparent); }
.command-input-shell > i { color: var(--action); }
.command-input-shell input,.command-input-shell input:focus { min-height: 42px !important; padding: 0 !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; outline: 0 !important; box-shadow: none !important; }
.command-input-shell input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; appearance: none; }
.command-input-shell > button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 8px; }
.command-input-shell > button:hover { color: var(--ink); background: var(--surface); }
.command-scopes { display: flex; gap: 5px; padding: 0 18px 11px; overflow-x: auto; }
.command-scopes button { min-height: 34px; padding: 5px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.command-scopes button.active { color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-color: color-mix(in srgb,var(--action) 28%,var(--line)); }
.command-results { min-height: 0; overflow-y: auto; }
.command-results > a,.live-search-results > a {
  grid-template-columns: 38px minmax(0,1fr) auto;
  gap: 12px;
  border: 1px solid transparent;
}
.command-results > a:hover,.command-results > a.is-active,.live-search-results > a.is-active {
  background: color-mix(in srgb,var(--action) 8%,var(--surface));
  border-color: color-mix(in srgb,var(--action) 18%,var(--line));
}
.search-result-icon { width: 38px; height: 38px; display: grid !important; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 10px; }
.search-result-meta { display: grid; justify-items: end; gap: 3px; }
.search-result-meta > i { padding: 3px 8px; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 7px; font-size: .72rem; font-style: normal; white-space: nowrap; }
.search-result-meta > small { color: var(--soft); font-size: .65rem; }
.search-result-summary { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 8px; color: var(--soft); font-size: .74rem; }
.search-result-summary a { color: var(--action); font-weight: 750; }
.command-dialog > footer { align-items: center; }
.command-dialog > footer a { margin-right: auto; color: var(--action); font-weight: 750; }
.search-topic-row > span { display: inline-flex; align-items: center; gap: 6px; }
.search-topic-row a { gap: 7px; }
.search-topic-row a small { min-width: 20px; padding: 1px 5px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-radius: 999px; font-size: .65rem; text-align: center; }

/* The homepage reference portal is a usable dashboard, not three thin slabs. */
.reference-portal.section-width { width: min(1480px,calc(100% - 48px)); }
.reference-browser { grid-template-columns: 260px minmax(0,1fr) 320px; gap: 16px; }
.reference-tree,.reference-topics,.reference-brief { border-radius: 18px; box-shadow: 0 14px 38px color-mix(in srgb,var(--ink) 7%,transparent); }
.reference-tree > a,.reference-brief > a,.topic-grid > a { transition: background .16s ease,transform .16s ease,border-color .16s ease; }
.reference-tree > a:hover,.reference-brief > a:hover { background: color-mix(in srgb,var(--action) 7%,var(--surface)); transform: translateX(-2px); }
.topic-grid > a { min-height: 74px; border-radius: 10px; }
.topic-grid > a:hover { transform: translateX(-3px); }
.reference-topics > header { min-height: 64px; }

@media (max-width: 1480px) and (min-width: 961px) {
  .reader-layout { grid-template-columns: 210px minmax(0,1fr) 220px; gap: 12px; padding-inline: 12px; }
  .reader-article { padding-inline: clamp(28px,3.5vw,48px); }
}

@media (max-width: 1180px) and (min-width: 961px) {
  .nav-mega > summary { padding-inline: 9px; }
  .nav-mega > summary > i:first-child { display: none; }
  .reader-layout { grid-template-columns: 220px minmax(0,1fr) 230px; }
  .reader-article { padding-inline: clamp(26px,4vw,52px); }
  .reference-browser { grid-template-columns: 220px minmax(0,1fr); }
  .reference-brief { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 960px) {
  body.mega-open::after { display: none; }
  .nav-mega { position: static; }
  .nav-mega > summary { width: 100%; min-height: 52px; padding: 10px 12px; color: var(--ink); }
  .nav-mega > summary i:last-child { margin-right: auto; }
  .mega-panel {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 4px;
    padding: 5px;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    transform: none;
    animation: none;
  }
  .mega-intro { min-height: 0; padding: 16px; }
  .mega-intro h2 { margin-block: 4px; font-size: 1.12rem; }
  .mega-intro p { display: none; }
  .mega-intro > a { margin-top: 9px; }
  .mega-links { grid-template-columns: 1fr 1fr; }
  .mega-links > a { min-height: 72px; padding: 10px; }
  .mega-links small { display: none; }
  .primary-nav > a.store-nav { display: flex; }
}

@media (max-width: 680px) {
  .mega-links { grid-template-columns: 1fr; }
  .mega-links > a { min-height: 58px; }
  .command-palette { padding-top: 3vh; }
  .command-dialog { max-height: 92dvh; }
  .command-dialog > header small { display: none; }
  .command-dialog > footer { flex-wrap: wrap; gap: 8px 14px; }
  .command-dialog > footer a { width: 100%; margin: 0; }
  .command-results > a,.live-search-results > a { grid-template-columns: 36px minmax(0,1fr); }
  .search-result-meta { grid-column: 2; justify-items: start; }
}

/* Interaction and responsive polish — 2026-08-03. */
:root { --font-code: "JetBrains Mono","Cascadia Code","SFMono-Regular",Menlo,Consolas,"Liberation Mono",monospace; }
.primary-nav > a.mobile-account-nav { display: none; }

/* Mega destinations carry recognizable icons and compact context badges. */
.mega-intro { position: relative; overflow: hidden; isolation: isolate; }
.mega-intro > *:not(.mega-intro-art) { position: relative; z-index: 1; }
.mega-intro-art {
  position: absolute;
  z-index: 0;
  left: -12px;
  bottom: -18px;
  color: rgba(255,255,255,.07);
  font-size: 9rem;
  transform: rotate(-8deg);
  transition: color .25s ease,transform .35s cubic-bezier(.22,1,.36,1);
}
.mega-intro:hover .mega-intro-art { color: rgba(255,255,255,.11); transform: rotate(-3deg) scale(1.04); }
.mega-links > a > span { position: relative; padding-left: 72px; }
.mega-links > a em {
  position: absolute;
  left: 0;
  top: 1px;
  max-width: 70px;
  overflow: hidden;
  padding: 2px 7px;
  color: var(--action);
  background: color-mix(in srgb,var(--action) 8%,var(--surface));
  border: 1px solid color-mix(in srgb,var(--action) 14%,var(--line));
  border-radius: 999px;
  font: 650 .58rem/1.55 var(--font-code) !important;
  font-style: normal !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mega-links > a:hover > i { color: #fff; background: var(--action); transform: rotate(-4deg) scale(1.06); }
.mega-links > a > i { transition: color .18s ease,background .18s ease,transform .22s cubic-bezier(.22,1,.36,1); }

/* Search result anatomy: icon and content start on the right; the category
   belongs to the content instead of floating as a detached left column. */
.command-results > a,.live-search-results > a {
  grid-template-columns: 42px minmax(0,1fr) 30px;
  align-items: center;
  direction: rtl;
  min-height: 82px;
  padding: 11px 12px;
}
.search-result-copy { min-width: 0; display: grid; justify-items: start; gap: 2px; text-align: right; }
.search-result-copy > b { max-width: 100%; color: var(--ink); overflow-wrap: anywhere; }
.search-result-copy > em { max-width: 100%; color: var(--muted); font-size: .8rem; font-style: normal; overflow-wrap: anywhere; }
.search-result-kicker { display: flex; align-items: center; justify-content: flex-start; gap: 6px; margin-bottom: 3px; }
.search-result-kicker > i,
.search-result-kicker > small {
  padding: 2px 7px;
  color: var(--action);
  background: color-mix(in srgb,var(--action) 8%,var(--surface));
  border: 1px solid color-mix(in srgb,var(--action) 14%,var(--line));
  border-radius: 999px;
  font-size: .66rem;
  font-style: normal;
  line-height: 1.55;
}
.search-result-kicker > small { color: var(--muted); font-family: var(--font-code) !important; direction: ltr; }
.search-result-go { width: 28px; height: 28px; display: grid; place-items: center; color: var(--soft); border-radius: 8px; transition: color .18s ease,background .18s ease,transform .18s ease; }
.command-results > a:hover .search-result-go,.command-results > a.is-active .search-result-go,.live-search-results > a:hover .search-result-go { color: #fff; background: var(--action); transform: translateX(-2px); }
.command-results > a.is-active { box-shadow: inset -3px 0 0 var(--action); }

.product-result {
  grid-template-columns: 48px minmax(0,1fr) auto;
  gap: 16px;
  direction: rtl;
  padding: 16px;
}
.product-result-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border: 1px solid color-mix(in srgb,var(--action) 16%,var(--line)); border-radius: 13px; }
.product-result-copy { min-width: 0; display: grid; justify-items: start; text-align: right; }
.product-result .result-meta { display: flex; align-items: center; justify-content: flex-start; gap: 6px; margin-bottom: 5px; }
.product-result .result-meta > span,.product-result .result-meta > b { padding: 2px 8px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-radius: 999px; font-size: .7rem; font-weight: 700; }
.product-result .result-meta > b { color: var(--muted); font-family: var(--font-code) !important; }

/* This is a standards timeline, not pagination. */
.version-rail { min-height: 112px; gap: 18px; padding-block: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.version-rail-title { min-width: 190px; display: flex; align-items: center; gap: 11px; margin: 0 !important; color: var(--ink) !important; }
.version-rail-title > i { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--action); border-radius: 11px; }
.version-rail-title > span { display: grid; }
.version-rail-title b { color: var(--ink); font-size: .84rem; }
.version-rail-title small { color: var(--soft); font-size: .66rem; }
.version-track { position: relative; min-width: 0; flex: 1; display: flex; align-items: stretch; gap: 6px; padding: 5px; overflow-x: auto; }
.version-track::before { content: ""; position: absolute; right: 16px; left: 16px; top: 25px; height: 1px; background: var(--line-strong); }
.version-track > a { position: relative; z-index: 1; min-width: 76px; min-height: 58px; display: grid; place-items: center; align-content: center; gap: 1px; padding: 6px 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: color .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease; }
.version-track > a code { color: inherit; font: 700 .72rem var(--font-code) !important; }
.version-track > a small { display: block !important; margin: 0; color: var(--soft); font-size: .58rem; white-space: nowrap; }
.version-track > a:hover { color: var(--action); border-color: color-mix(in srgb,var(--action) 35%,var(--line)); box-shadow: var(--shadow-xs); transform: translateY(-2px); }
.version-track > a.current { color: #fff; background: var(--action); border-color: var(--action); }
.version-track > a.current small { color: #d8edff; }
.version-track > a.future { color: var(--brand-cpp-deep); background: #c6e8f9; border-color: #9dcfe8; }
.version-track > a.future small { color: #305f78; }

/* Remove the numbered-tree styling from the full-reference action. */
.reference-tree > a.tree-action { margin: 10px; padding: 12px 13px; color: var(--action); background: color-mix(in srgb,var(--action) 7%,var(--surface)); border: 1px solid color-mix(in srgb,var(--action) 17%,var(--line)); border-radius: 11px; }
.reference-tree > a.tree-action > span { width: auto; height: auto; display: inline; grid-row: auto; color: inherit; background: transparent; border-radius: 0; }

/* Code has an independent editor typeface and language-aware chrome. */
.code-editor,.code-editor code,.code-line-numbers,.code-editor-toolbar,.code-editor-status,.code-editor-tab b,.code-editor-language {
  font-family: var(--font-code) !important;
  font-variant-ligatures: contextual common-ligatures;
  font-feature-settings: "liga" 1,"calt" 1,"zero" 1;
}
.code-editor code { font-size: .9rem !important; font-weight: 450; line-height: 1.82; }
.code-editor-toolbar { min-width: 100%; }
.code-editor-actions button { position: relative; }
.code-editor-actions button::after { content: attr(title); position: absolute; z-index: 3; bottom: calc(100% + 7px); left: 50%; padding: 4px 7px; color: #fff; background: #151719; border-radius: 5px; font: 600 .58rem var(--font-ui) !important; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%,4px); transition: opacity .15s ease,transform .15s ease; }
.code-editor-actions button:hover::after { opacity: 1; transform: translate(-50%,0); }
.code-editor[data-editor-language="qml"] .code-editor-language { color: #73d6bc; border-color: #397566; }
.code-editor[data-editor-language="javascript"] .code-editor-language,.code-editor[data-editor-language="typescript"] .code-editor-language { color: #f3dc72; border-color: #756d39; }
.code-editor[data-editor-language="cmake"] .code-editor-language { color: #80baf0; border-color: #3d6487; }

/* Account is a primary destination rather than an oversized utility button. */
.account-trigger,.admin-trigger { min-width: 112px; justify-content: flex-start; border-color: color-mix(in srgb,var(--action) 16%,var(--line)); }
.account-trigger > i,.admin-trigger > i { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; background: var(--action); border-radius: 8px; font-size: .75rem; }

@media (max-width: 1180px) and (min-width: 961px) {
  .mega-links > a > span { padding-left: 0; }
  .mega-links > a em { display: none; }
  .account-trigger,.admin-trigger { min-width: 42px; padding: 0; }
}

@media (max-width: 960px) {
  .primary-nav {
    top: var(--mobile-menu-top,68px);
    right: 10px;
    left: 10px;
    width: auto;
    height: auto;
    max-height: calc(100dvh - var(--mobile-menu-top,68px) - 12px);
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 9px;
    background: color-mix(in srgb,var(--surface) 97%,transparent);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(0,25,48,.24);
    backdrop-filter: blur(24px) saturate(1.12);
  }
  .demo-banner + .site-header .primary-nav { height: auto; max-height: calc(100dvh - var(--mobile-menu-top,98px) - 12px); }
  .nav-mega > summary { min-height: 54px; border-color: transparent; border-radius: 12px; }
  .nav-mega[open] > summary { background: color-mix(in srgb,var(--action) 9%,var(--surface)); }
  .mega-panel { max-height: min(480px,55dvh); overflow-y: auto; background: var(--surface-2); }
  .mega-intro { display: none; }
  .mega-links { grid-template-columns: 1fr 1fr; }
  .mega-links > a { min-height: 74px; background: var(--surface); border-color: var(--line); }
  .mega-links > a > span { padding-left: 0; }
  .mega-links > a em { display: none; }
  .primary-nav > a.store-nav,.primary-nav > a.mobile-account-nav { min-height: 52px; display: flex; background: transparent; border-color: transparent; }
  .primary-nav > a.mobile-account-nav { color: var(--action); }
  .mobile-nav-preferences { margin-top: 0; }
  .version-rail { width: 100%; align-items: stretch; flex-direction: column; gap: 8px; padding: 14px 16px; }
  .version-rail-title { min-width: 0; }
  .version-track { width: 100%; flex: none; }
  .product-result { grid-template-columns: 44px minmax(0,1fr) 24px; }
}

@media (max-width: 680px) {
  .topbar { width: 100%; grid-template-columns: minmax(0,1fr) auto; padding-inline: 10px; }
  .brand-copy b { font-size: .9rem; }
  .brand-glyph,.brand-glyph img { width: 38px; height: 38px !important; flex-basis: 38px; }
  .header-actions { gap: 5px; }
  .theme-toggle,.menu-toggle,.command-trigger { width: 42px; min-width: 42px; height: 42px; border-radius: 12px; }
  .primary-nav { right: 7px; left: 7px; padding: 7px; border-radius: 16px; }
  .mega-links { grid-template-columns: 1fr; }
  .mega-links > a { min-height: 62px; }
  .mobile-nav-preferences { min-height: 54px; padding: 7px 10px; }
  .command-palette { padding: 8px; place-items: start center; }
  .command-dialog { width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px; }
  .command-dialog > header { min-height: 64px; padding-inline: 12px; }
  .command-dialog > form { padding: 12px; }
  .command-scopes { padding-inline: 12px; }
  .command-results > a,.live-search-results > a { grid-template-columns: 38px minmax(0,1fr) 26px; min-height: 78px; padding-inline: 10px; }
  .search-result-meta { grid-column: auto; }
  .search-result-summary { padding-inline: 10px; }
  .product-result { grid-template-columns: 40px minmax(0,1fr); align-items: start; }
  .product-result-icon { width: 40px; height: 40px; }
  .product-result .result-arrow { grid-column: 2; justify-self: start; }
  .version-rail-title small { display: block; }
  .version-track > a { min-width: 72px; }
  .code-editor-toolbar { gap: 7px; padding-inline: 9px; }
  .code-editor-dots { display: none; }
  .code-editor-tab { padding-inline: 9px; }
  .code-editor-language { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .code-editor code { font-size: .8rem !important; }
}

@media (prefers-reduced-motion: no-preference) {
  .mega-panel { transform-origin: top center; }
  .command-dialog { animation: dialog-enter .22s cubic-bezier(.22,1,.36,1) both; }
  .command-results > a,.live-search-results > a { animation: result-enter .2s cubic-bezier(.22,1,.36,1) both; }
  @keyframes dialog-enter { from { opacity: 0; transform: translateY(-10px) scale(.985); } }
  @keyframes result-enter { from { opacity: 0; transform: translateY(5px); } }
}

/* Compact command surface and the final mobile navigation pass. */
.command-dialog { width: min(680px,calc(100% - 32px)); max-height: min(540px,70dvh); border-radius: 20px; }
.command-dialog > header { min-height: 60px; padding-inline: 16px; }
.command-dialog > header > span { width: 34px; height: 34px; border-radius: 9px; }
.command-dialog > header label { font-size: .94rem; }
.command-dialog > header small { font-size: .66rem; }
.command-dialog > form { padding: 10px 14px 7px; }
.command-input-shell { min-height: 50px; grid-template-columns: 20px minmax(0,1fr) 28px; gap: 8px; padding: 5px 11px; border-radius: 12px; }
.command-input-shell input,.command-input-shell input:focus { min-height: 36px !important; font-size: .92rem; }
.command-input-shell > button { width: 28px; height: 28px; }
.command-scopes { gap: 4px; padding: 0 14px 7px; }
.command-scopes button { min-height: 29px; padding: 3px 10px; font-size: .7rem; }
.command-results { gap: 4px; padding: 0 14px 8px; }
.command-results > small { margin: 1px 2px; font-size: .72rem; }
.command-results > a,.live-search-results > a {
  min-height: 50px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 22px;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
}
.search-result-icon { width: 30px; height: 30px; border-radius: 8px; font-size: .76rem; }
.search-result-copy { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; column-gap: 6px; gap: 0; line-height: 1.25; }
.search-result-copy > b { font-size: .84rem; }
.command-dialog .search-result-copy > em { display: none; }
.command-dialog .search-result-kicker { grid-column: 1; grid-row: 1; margin: 0; }
.command-dialog .search-result-copy > b { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy > em { font-size: .7rem; }
.search-result-kicker { gap: 4px; margin-bottom: 1px; }
.search-result-kicker > i,.search-result-kicker > small { padding: 1px 6px; font-size: .58rem; }
.search-result-go { width: 22px; height: 22px; font-size: .66rem; }
.command-dialog > footer { min-height: 38px; gap: 12px; padding: 8px 14px; font-size: .66rem; }
.command-dialog > footer a { font-size: .7rem; }

/* A three-act journey is easier to scan than nine similarly-weighted pills. */
.version-rail { display: none; }
.standards-journey {
  min-height: 94px;
  display: grid;
  grid-template-columns: 180px minmax(130px,.72fr) minmax(160px,.92fr) minmax(220px,1.25fr);
  align-items: stretch;
  gap: 8px;
  margin-block: 16px 0;
  padding: 8px;
  background: linear-gradient(115deg,color-mix(in srgb,var(--surface) 94%,#dff2fb),var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px color-mix(in srgb,var(--ink) 6%,transparent);
}
.journey-intro { display: flex; align-items: center; gap: 10px; padding: 12px; }
.journey-intro > i { width: 36px; height: 36px; display: grid; flex: 0 0 36px; place-items: center; color: #fff; background: linear-gradient(145deg,var(--brand-cpp),var(--brand-cpp-deep)); border-radius: 11px; box-shadow: 0 7px 15px rgba(0,89,156,.2); }
.journey-intro > span { display: grid; gap: 1px; }
.journey-intro small { color: var(--muted); font-size: .67rem; }
.journey-intro b { color: var(--ink); font-size: .86rem; }
.journey-stage { position: relative; min-width: 0; display: grid; align-content: center; gap: 3px; padding: 11px 12px; overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.journey-stage::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--stage-color,var(--action)); opacity: .78; }
.journey-stage.foundation { --stage-color:#7893ac; }
.journey-stage.modern { --stage-color:#4d88bf; }
.journey-stage.current { --stage-color:#0b67ae; color: #fff; background: linear-gradient(135deg,#1269ad,#0c3e75); border-color: transparent; box-shadow: 0 10px 20px rgba(0,78,140,.2); }
.journey-stage small { color: var(--soft); font-size: .6rem; }
.journey-stage.current small { color: #bcdcf2; }
.journey-stage b { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.journey-stage > span { display: flex; flex-wrap: wrap; gap: 4px; }
.journey-stage code { padding: 1px 4px; color: var(--muted); background: var(--surface-2); border-radius: 4px; font: 600 .57rem var(--font-code) !important; }
.journey-stage.current code { color: #e5f5ff; background: rgba(255,255,255,.14); }
.journey-stage:hover { border-color: color-mix(in srgb,var(--stage-color,var(--action)) 58%,var(--line)); box-shadow: var(--shadow-sm); transform: translateY(-2px); }

@media (max-width: 960px) {
  .primary-nav { height: fit-content; max-height: min(74dvh,560px); align-content: start; }
  .demo-banner + .site-header .primary-nav { height: fit-content; max-height: min(70dvh,530px); }
  .mobile-nav-preferences { display: grid; grid-template-columns: minmax(0,1fr) 146px; align-items: center; gap: 9px; }
  .mobile-nav-preferences .custom-select { min-width: 0; }
  .mobile-nav-preferences .custom-select-options { position: static; width: 100%; max-height: 140px; margin-top: 6px; box-shadow: none; }
  .mobile-nav-preferences .custom-select.is-open { grid-column: 1 / -1; }
  .mobile-nav-preferences .custom-select.is-open .custom-select-trigger { min-height: 42px; }
  .standards-journey { grid-template-columns: 168px repeat(3,minmax(155px,1fr)); overflow-x: auto; }
  .journey-stage { min-width: 155px; }
}

@media (max-width: 680px) {
  .command-trigger { justify-content: center; align-items: center; line-height: 1; }
  .command-trigger > i { display: block; margin: 0; line-height: 1; transform: translateY(0); }
  .theme-toggle > i,.menu-toggle > i { display: block; line-height: 1; }
  .primary-nav { max-height: min(72dvh,520px); }
  .mobile-nav-preferences { grid-template-columns: minmax(0,1fr) 136px; }
  .mobile-nav-preferences > label { font-size: .78rem; }
  .mobile-nav-preferences .custom-select-options { max-height: 126px; }
  .command-palette { padding: 5px; }
  .command-dialog { width: 100%; max-height: min(640px,calc(100dvh - 10px)); border-radius: 16px; }
  .command-dialog > header { min-height: 54px; padding-inline: 10px; }
  .command-dialog > header > span { width: 30px; height: 30px; }
  .command-dialog > form { padding: 8px 10px 5px; }
  .command-scopes { padding-inline: 10px; }
  .command-results { padding-inline: 10px; }
  .command-results > a { min-height: 58px; }
  .command-dialog > footer > span { display: none; }
  .command-dialog > footer { justify-content: flex-start; min-height: 34px; padding: 7px 10px; }
  .command-dialog > footer a { width: auto; }
  .standards-journey { width: calc(100% - 24px); grid-template-columns: 142px repeat(3,minmax(142px,1fr)); min-height: 82px; margin-top: 10px; padding: 6px; border-radius: 14px; }
  .journey-intro { gap: 7px; padding: 8px; }
  .journey-intro > i { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
  .journey-intro b { font-size: .74rem; }
  .journey-intro small { font-size: .58rem; }
  .journey-stage { min-width: 142px; padding: 8px; }
  .journey-stage b { font-size: .7rem; }
}

/* Final density pass: controls read like a quiet utility bar, not a button wall. */
.header-actions { gap: 6px; }
.command-trigger,.font-select,.theme-toggle,.menu-toggle,.account-trigger,.admin-trigger {
  min-height: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 680;
}
.command-trigger { min-width: 126px; padding-inline: 10px; gap: 6px; }
.command-trigger b { font-size: .8rem; }
.command-trigger kbd { padding: 2px 5px; font-size: .67rem; }
.theme-toggle,.menu-toggle { width: 38px; }
.font-select,.custom-select.font-picker { width: 86px; min-width: 86px; flex-basis: 86px; }
.font-picker .custom-select-trigger { min-height: 38px; padding-inline: 8px; border-radius: 10px; font-size: .72rem; }
.account-trigger,.admin-trigger { min-width: auto; padding-inline: 9px; gap: 6px; }
.account-trigger > i,.admin-trigger > i { width: 22px; height: 22px; color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); border-radius: 7px; font-size: .67rem; }

/* The editor owns horizontal scrolling; its toolbar and feedback can never be clipped. */
.book-content pre.code-editor,pre.code-editor { overflow: visible; }
.code-editor-body { overflow: auto; max-width: 100%; scrollbar-color: #59636a #2b2b2b; }
.code-editor-actions button::after { content: none; }
.code-editor-feedback { min-width: 0; margin-left: auto; overflow: hidden; color: #8fc6a6; font: 600 .64rem var(--font-ui) !important; text-overflow: ellipsis; white-space: nowrap; }
.code-editor-actions { margin-left: 0; }

/* Search results keep metadata close to their titles and stay scannable at a glance. */
.live-search-results > a {
  min-height: 54px;
  grid-template-columns: 32px minmax(0,1fr) 22px;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 10px;
}
.live-search-results .search-result-icon { width: 32px; height: 32px; border-radius: 9px; font-size: .76rem; }
.live-search-results .search-result-copy { grid-template-columns: auto minmax(0,1fr); align-items: center; column-gap: 6px; gap: 0; line-height: 1.25; }
.live-search-results .search-result-kicker { grid-column: 1; grid-row: 1; margin: 0; }
.live-search-results .search-result-copy > b { grid-column: 2; grid-row: 1; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.live-search-results .search-result-copy > em { display: none; }
.live-search-results .search-result-go { width: 22px; height: 22px; font-size: .66rem; }
.live-search-results .search-result-kicker > i,.live-search-results .search-result-kicker > small { padding: 1px 6px; font-size: .58rem; }

/* A compact timeline: three eras and one direction, without the dashboard-card look. */
.standards-journey {
  min-height: 76px;
  grid-template-columns: 154px repeat(3,minmax(0,1fr));
  gap: 0;
  padding: 7px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 12px 28px color-mix(in srgb,var(--ink) 6%,transparent);
}
.journey-intro { gap: 8px; padding: 8px 12px; border-left: 1px solid var(--line); }
.journey-intro > i { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; box-shadow: none; }
.journey-intro small { font-size: .6rem; }
.journey-intro b { font-size: .77rem; }
.journey-stage { min-width: 0; align-content: center; gap: 1px; padding: 7px 13px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.journey-stage + .journey-stage { border-right: 1px solid var(--line); }
.journey-stage::before { content: ""; position: absolute; right: 13px; top: 7px; width: 6px; height: 6px; background: var(--stage-color,var(--action)); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb,var(--stage-color,var(--action)) 12%,transparent); }
.journey-stage::after { right: 13px; left: 13px; height: 2px; opacity: .5; }
.journey-stage small { padding-right: 12px; font-size: .57rem; }
.journey-stage b { font-size: .73rem; }
.journey-stage > span { gap: 3px; }
.journey-stage code { padding: 0 3px; font-size: .53rem !important; }
.journey-stage.current { color: var(--ink); background: color-mix(in srgb,var(--action) 7%,var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--action) 13%,transparent); }
.journey-stage.current small { color: var(--muted); }
.journey-stage.current code { color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); }
.journey-stage:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--stage-color,var(--action)) 24%,transparent); transform: none; }

@media (max-width: 680px) {
  .command-trigger,.theme-toggle,.menu-toggle { width: 38px; min-width: 38px; height: 38px; }
  .font-select,.custom-select.font-picker { width: 82px; min-width: 82px; flex-basis: 82px; }
  .mobile-nav-preferences { grid-template-columns: minmax(0,1fr) 132px; }
  .standards-journey { grid-template-columns: 128px repeat(3,minmax(128px,1fr)); min-height: 70px; overflow-x: auto; }
  .journey-intro { padding: 7px; }
  .journey-stage { min-width: 128px; padding-inline: 9px; }
  .journey-stage::before,.journey-stage::after { right: 9px; left: 9px; }
  .journey-stage small { padding-right: 10px; }
}

/* Results have a strict reading order: icon, title, compact metadata, then action. */
.command-results > a,.live-search-results > a {
  position: relative;
  grid-template-columns: 32px minmax(0,1fr) max-content 24px;
  align-items: center;
  gap: 9px;
}
.command-results .search-result-copy,.live-search-results .search-result-copy { display: contents; }
.command-results .search-result-copy > b,.live-search-results .search-result-copy > b {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-results .search-result-kicker,.live-search-results .search-result-kicker {
  grid-column: 3;
  grid-row: 1;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  white-space: nowrap;
}
.command-results .search-result-kicker > i,.command-results .search-result-kicker > small,
.live-search-results .search-result-kicker > i,.live-search-results .search-result-kicker > small {
  padding: 2px 7px;
  font-size: .59rem;
  line-height: 1.45;
}
.command-results .search-result-go,.live-search-results .search-result-go { grid-column: 4; grid-row: 1; }
.command-results .search-result-copy > em,.live-search-results .search-result-copy > em { display: none; }

/* A lightweight chronological rail replaces the previous oversized standard cards. */
.standards-journey {
  min-height: 64px;
  display: grid;
  grid-template-columns: 134px repeat(3,minmax(0,1fr));
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.journey-intro { gap: 7px; padding: 4px 12px; border-left: 0; }
.journey-intro > i { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; }
.journey-intro small { font-size: .58rem; }
.journey-intro b { font-size: .73rem; }
.journey-stage {
  min-width: 0;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 5px 15px 12px;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
}
.journey-stage + .journey-stage { border-right: 0 !important; }
.journey-stage::before { right: 15px; top: auto; bottom: 4px; width: 7px; height: 7px; box-shadow: 0 0 0 4px color-mix(in srgb,var(--stage-color,var(--action)) 13%,transparent); }
.journey-stage::after { right: 15px; bottom: 7px; left: 0; height: 1px; background: color-mix(in srgb,var(--stage-color,var(--action)) 40%,var(--line)); opacity: 1; }
.journey-stage:last-child::after { left: 15px; }
.journey-stage small { padding-right: 0; color: var(--soft) !important; font-size: .57rem; }
.journey-stage b { color: var(--ink); font-size: .72rem; }
.journey-stage > span { display: none; }
.journey-stage code { padding: 0 3px; color: var(--action) !important; background: color-mix(in srgb,var(--action) 7%,var(--surface)) !important; font-size: .52rem !important; }
.journey-stage:hover { background: color-mix(in srgb,var(--action) 4%,transparent) !important; transform: none; }

@media (max-width: 680px) {
  .command-results > a,.live-search-results > a { grid-template-columns: 30px minmax(0,1fr) max-content 22px; gap: 6px; }
  .command-results .search-result-kicker > small,.live-search-results .search-result-kicker > small { display: none; }
  .standards-journey { width: calc(100% - 24px); grid-template-columns: 112px repeat(3,minmax(116px,1fr)); min-height: 60px; overflow-x: auto; }
  .journey-intro { padding-inline: 6px; }
  .journey-stage { min-width: 116px; min-height: 60px; padding-inline: 9px; }
  .journey-stage::before { right: 9px; }
  .journey-stage::after { right: 9px; }
  .journey-stage:last-child::after { left: 9px; }
}

/* Rounded, self-contained editor chrome: no protruding layers or clipped controls. */
.book-content pre.code-editor,pre.code-editor {
  overflow: hidden;
  border: 1px solid #505357;
  border-radius: 20px;
  background: #292b2d;
  box-shadow: 0 20px 44px rgba(14,18,22,.18),0 0 0 1px rgba(255,255,255,.06) inset;
}
.code-editor-toolbar {
  position: relative;
  min-width: 0;
  height: 52px;
  gap: 10px;
  padding: 0 16px;
  background: linear-gradient(180deg,#424547,#383a3c);
  border-bottom: 1px solid #55585a;
}
.code-editor-tab {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-block: 0;
  padding-inline: 14px;
  color: #e3e5e7;
  background: rgba(18,19,20,.42);
  border-top: 3px solid #53a6de;
}
.code-editor-language { padding: 5px 9px; color: #bad8ec; background: rgba(10,14,17,.26); border: 1px solid #5b6063; border-radius: 9px; }
.code-editor-body { overflow: auto; max-width: 100%; background: #292b2d; }
.code-line-numbers { background: #303234; border-right-color: #444749; }
.code-editor code { background: #292b2d; }
.code-editor-status { min-width: 0; min-height: 32px; padding-inline: 16px; color: #b6bdc5; background: #3b3e40; border-top-color: #515456; }
.code-editor-actions { gap: 6px; margin-left: 0; }
.code-editor-actions button {
  width: 34px;
  height: 34px;
  color: #d5d9dd;
  background: rgba(24,27,29,.28);
  border: 1px solid #5a5e61;
  border-radius: 10px;
  transition: color .16s ease,background .16s ease,border-color .16s ease,transform .16s ease;
}
.code-editor-actions button::after {
  content: attr(data-code-label);
  position: absolute;
  z-index: 8;
  top: calc(100% + 7px);
  bottom: auto;
  right: auto;
  left: 50%;
  padding: 4px 7px;
  color: #eef7ff;
  background: #15191d;
  border: 1px solid #5a6268;
  border-radius: 6px;
  box-shadow: 0 7px 14px rgba(0,0,0,.24);
  font: 650 .58rem var(--font-ui) !important;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  direction: rtl;
  transform: translate(-50%,-4px);
  transition: opacity .15s ease,transform .15s ease;
}
.code-editor-actions button::before {
  content: "";
  position: absolute;
  z-index: 9;
  top: calc(100% + 1px);
  bottom: auto;
  right: auto;
  left: 50%;
  width: 12px;
  height: 7px;
  background: #15191d;
  border: 0;
  clip-path: polygon(50% 0,0 100%,100% 100%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .15s ease;
}
.code-editor-actions button:hover::after,.code-editor-actions button:focus-visible::after { opacity: 1; transform: translate(-50%,0); }
.code-editor-actions button:hover::before,.code-editor-actions button:focus-visible::before { opacity: 1; }
.code-editor-actions button:hover,.code-editor-actions button:focus-visible,.code-editor-actions button[aria-pressed="true"] { color: #fff; background: #176eaa; border-color: #67b6e9; outline: 0; transform: translateY(-1px); }
.code-editor-message { min-width: 0; flex: 1; overflow: hidden; color: #b9d9ec; font: 650 .68rem var(--font-ui) !important; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.code-editor-feedback { display: none; }
@media (max-width: 680px) {
  .book-content pre.code-editor,pre.code-editor { border-radius: 15px; }
  .code-editor-toolbar { height: 46px; gap: 7px; padding-inline: 9px; }
  .code-editor-tab { padding-inline: 9px; }
  .code-editor-message { display: none; }
  .code-editor-actions button { width: 30px; height: 30px; border-radius: 9px; }
}

/* Header utilities use tactile keycap controls with a quiet, lifted shadow. */
.header-actions { gap: 10px; }
.header-actions .command-trigger,
.header-actions .theme-toggle,
.header-actions .menu-toggle,
.header-actions .account-trigger,
.header-actions .admin-trigger,
.header-actions .font-picker .custom-select-trigger {
  color: var(--ink);
  background: linear-gradient(180deg,var(--surface) 0%,color-mix(in srgb,var(--surface-2) 88%,#d7e8f5) 100%);
  border-color: color-mix(in srgb,var(--action) 24%,var(--line));
  box-shadow: 0 2px 0 color-mix(in srgb,var(--action) 13%,var(--surface)),0 7px 15px rgba(18,61,96,.08),inset 0 1px 0 rgba(255,255,255,.88);
}
.header-actions .command-trigger:hover,
.header-actions .theme-toggle:hover,
.header-actions .menu-toggle:hover,
.header-actions .account-trigger:hover,
.header-actions .admin-trigger:hover,
.header-actions .font-picker .custom-select-trigger:hover {
  color: var(--action);
  background: var(--surface);
  border-color: color-mix(in srgb,var(--action) 53%,var(--line));
  box-shadow: 0 2px 0 color-mix(in srgb,var(--action) 22%,var(--surface)),0 10px 18px rgba(18,83,129,.13),inset 0 1px 0 rgba(255,255,255,.95);
  transform: translateY(-1px);
}
.header-actions .command-trigger:active,
.header-actions .theme-toggle:active,
.header-actions .menu-toggle:active,
.header-actions .account-trigger:active,
.header-actions .admin-trigger:active,
.header-actions .font-picker .custom-select-trigger:active {
  box-shadow: inset 0 2px 5px rgba(0,67,113,.14),0 1px 0 rgba(255,255,255,.8);
  transform: translateY(1px);
}
.header-actions .command-trigger kbd {
  min-width: 38px;
  display: inline-grid;
  place-items: center;
  padding: 4px 6px;
  color: var(--muted);
  background: linear-gradient(180deg,#fff,#edf4f9);
  border-color: color-mix(in srgb,var(--action) 18%,var(--line));
  border-radius: 7px;
  box-shadow: 0 2px 0 color-mix(in srgb,var(--action) 16%,var(--surface)),inset 0 1px 0 #fff;
  font: 700 .69rem var(--font-code) !important;
}
.header-actions .account-trigger > i,.header-actions .admin-trigger > i {
  color: var(--action);
  background: color-mix(in srgb,var(--action) 8%,var(--surface));
  border: 1px solid color-mix(in srgb,var(--action) 10%,transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.header-actions .font-picker .custom-select-trigger { min-height: 38px; }
.header-actions .font-picker.is-open .custom-select-trigger { box-shadow: 0 0 0 3px color-mix(in srgb,var(--action) 14%,transparent),0 2px 0 color-mix(in srgb,var(--action) 15%,var(--surface)); }
@media (max-width: 680px) {
  .header-actions { gap: 7px; }
  .header-actions .command-trigger,.header-actions .theme-toggle,.header-actions .menu-toggle { box-shadow: 0 2px 0 color-mix(in srgb,var(--action) 13%,var(--surface)),0 5px 11px rgba(18,61,96,.08),inset 0 1px 0 rgba(255,255,255,.88); }
}

/* Navigation stays quiet; only literal keyboard shortcuts are tactile keycaps. */
.header-actions { gap: 7px; }
.header-actions .command-trigger,
.header-actions .theme-toggle,
.header-actions .menu-toggle,
.header-actions .account-trigger,
.header-actions .admin-trigger,
.header-actions .font-picker .custom-select-trigger {
  background: var(--surface-2);
  border-color: var(--line);
  box-shadow: none;
}
.header-actions .command-trigger:hover,
.header-actions .theme-toggle:hover,
.header-actions .menu-toggle:hover,
.header-actions .account-trigger:hover,
.header-actions .admin-trigger:hover,
.header-actions .font-picker .custom-select-trigger:hover {
  background: var(--surface);
  border-color: color-mix(in srgb,var(--action) 38%,var(--line));
  box-shadow: none;
  transform: translateY(-1px);
}
.header-actions .command-trigger:active,
.header-actions .theme-toggle:active,
.header-actions .menu-toggle:active,
.header-actions .account-trigger:active,
.header-actions .admin-trigger:active,
.header-actions .font-picker .custom-select-trigger:active {
  box-shadow: none;
  transform: none;
}
.header-actions .command-trigger kbd {
  min-width: auto;
  padding: 3px 6px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid color-mix(in srgb,var(--ink) 14%,var(--line));
  border-radius: 6px;
  box-shadow: 0 2px 0 color-mix(in srgb,var(--ink) 16%,transparent);
  font: 700 .67rem var(--font-code) !important;
}
.header-actions .account-trigger > i,.header-actions .admin-trigger > i {
  width: auto;
  height: auto;
  color: var(--action);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: .86rem;
}
.header-actions .font-picker.is-open .custom-select-trigger { box-shadow: 0 0 0 3px color-mix(in srgb,var(--action) 12%,transparent); }
html[data-theme="dark"] .header-actions .command-trigger,
html[data-theme="dark"] .header-actions .theme-toggle,
html[data-theme="dark"] .header-actions .menu-toggle,
html[data-theme="dark"] .header-actions .account-trigger,
html[data-theme="dark"] .header-actions .admin-trigger,
html[data-theme="dark"] .header-actions .font-picker .custom-select-trigger { box-shadow: none; }
@media (max-width: 680px) {
  .header-actions .command-trigger,.header-actions .theme-toggle,.header-actions .menu-toggle { box-shadow: none; }
}

/* Keyboard references are the only tactile elements in the command UI. */
.shortcut-keycap { display: inline-flex; align-items: center; gap: 3px; direction: ltr; vertical-align: middle; }
.shortcut-keycap > i { color: var(--soft); font: 700 .68rem/1 var(--font-code); font-style: normal; }
.shortcut-keycap kbd,
.command-dialog > footer .shortcut-keycap kbd {
  min-width: 23px;
  display: inline-grid;
  place-items: center;
  padding: 3px 6px;
  color: var(--muted);
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
  border: 1px solid color-mix(in srgb,var(--ink) 15%,var(--line));
  border-radius: 6px;
  box-shadow: 0 2px 0 color-mix(in srgb,var(--ink) 17%,transparent),inset 0 1px 0 rgba(255,255,255,.75);
  font: 700 .64rem/1 var(--font-code) !important;
}
.command-trigger .shortcut-keycap { margin-right: auto; }
.command-trigger .shortcut-keycap kbd { min-width: 20px; padding: 3px 5px; }
.command-trigger .shortcut-keycap.shortcut-ready { animation: shortcut-arrive .3s cubic-bezier(.22,1,.36,1) both; }
.command-dialog > footer > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@keyframes shortcut-arrive { from { opacity: 0; transform: translateY(3px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
html[data-theme="dark"] .shortcut-keycap kbd,
html[data-theme="dark"] .command-dialog > footer .shortcut-keycap kbd { background: #172532; border-color: #3b566d; box-shadow: 0 2px 0 rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.06); }
@media (max-width: 680px) { .command-trigger .shortcut-keycap { display: none; } }

/* Commerce control center */
.commerce-admin .admin-content { display: grid; gap: 20px; }
.commerce-hero { min-height: 190px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 30px 34px; color: #fff; background: radial-gradient(circle at 8% 0,rgba(105,188,235,.3),transparent 35%),linear-gradient(135deg,var(--brand-cpp-navy),var(--brand-cpp-deep)); border: 1px solid #195d89; border-radius: 22px; box-shadow: 0 22px 48px rgba(3,37,63,.16); }
.commerce-hero h2 { max-width: 720px; margin: 8px 0; color: #fff; font-size: clamp(1.8rem,3vw,2.55rem); }
.commerce-hero p { max-width: 730px; margin: 0; color: #c4ddea; font-size: .92rem; }
.commerce-hero .premium-eyebrow { color: #9bd8fa; }
.oracle-health { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; font-size: .79rem; font-weight: 800; white-space: nowrap; }
.oracle-health.is-ok { color: #bdf5db; background: rgba(29,170,111,.16); border: 1px solid rgba(105,226,168,.36); }
.oracle-health.is-warning { color: #ffe5a7; background: rgba(204,139,0,.16); border: 1px solid rgba(255,207,103,.34); }
.oracle-alert { display: flex; align-items: start; gap: 12px; padding: 15px 17px; color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 10%,var(--surface)); border: 1px solid color-mix(in srgb,var(--warning) 28%,var(--line)); border-radius: 14px; }
.oracle-alert > i { margin-top: 4px; }
.oracle-alert b { display: block; color: inherit; }
.oracle-alert p { margin: 2px 0 0; color: inherit; font-size: .82rem; }
.commerce-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; }
.commerce-metrics article { min-height: 142px; display: flex; flex-direction: column; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-xs); }
.commerce-metrics article.is-primary { background: color-mix(in srgb,var(--action) 7%,var(--surface)); border-color: color-mix(in srgb,var(--action) 30%,var(--line)); }
.commerce-metrics span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .79rem; font-weight: 750; }
.commerce-metrics span i { color: var(--action); }
.commerce-metrics b { margin-top: auto; color: var(--ink); font: 850 1.62rem/1.2 "Farhang2",sans-serif !important; }
.commerce-metrics small { margin-top: 5px; color: var(--soft); font-size: .72rem; }
.oracle-workspace { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr); align-items: start; gap: 14px; }
.oracle-sources,.oracle-settings { padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-xs); }
.oracle-sources > header,.oracle-settings > header { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.oracle-sources header span,.oracle-settings header span { color: var(--action); font-size: .75rem; font-weight: 800; }
.oracle-sources h3,.oracle-settings h3 { margin: 3px 0 0; font-size: 1.3rem; }
.oracle-sources header small { color: var(--soft); font-size: .75rem; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.source-grid article { position: relative; min-height: 128px; display: flex; flex-direction: column; padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.source-grid article.is-selected { background: color-mix(in srgb,var(--success) 7%,var(--surface)); border-color: color-mix(in srgb,var(--success) 35%,var(--line)); box-shadow: inset 0 3px 0 var(--success); }
.source-grid article.is-offline { opacity: .58; }
.source-state { display: flex; align-items: center; gap: 5px; color: var(--soft); font-size: .68rem; }
.source-state i,.invoice-status i { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.is-offline .source-state i { background: var(--soft); }
.source-grid article > b { margin-top: 10px; color: var(--ink); font-size: .86rem; }
.source-grid strong { margin-top: auto; color: var(--action); font: 800 1.28rem "Farhang2",sans-serif !important; }
.source-grid strong small { color: var(--muted); font-size: .65rem; }
.source-grid em { position: absolute; top: 12px; left: 12px; color: var(--success); font-size: .65rem; font-style: normal; font-weight: 800; }
.oracle-method { display: flex; gap: 8px; margin: 14px 0 0; padding: 11px 13px; color: var(--muted); background: var(--surface-2); border-radius: 10px; font-size: .72rem; line-height: 1.75; }
.oracle-method i { margin-top: 4px; color: var(--action); }
.oracle-settings { display: grid; gap: 16px; }
.oracle-settings fieldset { margin: 0; padding: 0; border: 0; }
.oracle-settings legend,.oracle-fields label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-switch legend { grid-column: 1/-1; }
.mode-switch label { position: relative; cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch label > span { min-height: 76px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 0 8px; padding: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.mode-switch label i { grid-row: 1/3; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border-radius: 8px; }
.mode-switch label b { color: var(--ink); font-size: .83rem; }
.mode-switch label small { color: var(--soft); font-size: .67rem; }
.mode-switch input:checked + span { background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb,var(--action) 9%,transparent); }
.mode-switch input:checked + span i { color: #fff; background: var(--action); }
.oracle-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.oracle-fields label { min-width: 0; }
.oracle-fields select,.oracle-fields input { width: 100%; min-height: 44px; padding: 8px 10px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .78rem; }
.input-suffix { position: relative; }
.input-suffix input { padding-left: 55px; }
.input-suffix small { position: absolute; top: 50%; left: 10px; color: var(--soft); font-size: .67rem; transform: translateY(-50%); }
.oracle-options { display: flex; flex-wrap: wrap; gap: 7px; }
.oracle-options label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; font-size: .7rem; cursor: pointer; }
.oracle-options input { width: 15px; height: 15px; margin: 0; accent-color: var(--action); }
.oracle-settings > .button { width: 100%; }
.invoice-section { margin-top: 18px; }
.invoice-section > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.invoice-section h2 { margin: 5px 0 2px; font-size: 1.8rem; }
.invoice-section header p { margin: 0; color: var(--muted); font-size: .8rem; }
.invoice-count { padding: 7px 11px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border: 1px solid color-mix(in srgb,var(--action) 18%,var(--line)); border-radius: 999px; font-size: .72rem; font-weight: 800; }
.invoice-table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-xs); }
.invoice-table { width: 100%; min-width: 930px; border-collapse: collapse; }
.invoice-table th,.invoice-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.invoice-table th { color: var(--soft); background: var(--surface-2); font-size: .73rem; font-weight: 800; }
.invoice-table tr:last-child td { border-bottom: 0; }
.invoice-table td { color: var(--ink); font-size: .78rem; }
.invoice-table td > b,.invoice-id,.invoice-prices,.invoice-table td:last-child { display: grid; gap: 3px; }
.invoice-table td small { display: block; color: var(--soft); font-size: .67rem; }
.invoice-id code,.tx-hash { color: var(--action); font-size: .74rem; }
.invoice-prices b { color: var(--ink); }
.invoice-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.invoice-status.is-paid { color: var(--success-ink); background: color-mix(in srgb,var(--success) 11%,var(--surface)); }
.invoice-status.is-pending { color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 12%,var(--surface)); }
.invoice-status.is-pending i { background: var(--warning); }
.invoice-status.is-failed,.invoice-status.is-expired { color: var(--danger); background: color-mix(in srgb,var(--danger) 9%,var(--surface)); }
.invoice-status.is-failed i,.invoice-status.is-expired i { background: var(--danger); }
.invoice-empty { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); }
.invoice-empty > i { font-size: 1.5rem; color: var(--soft); }
.invoice-empty b { color: var(--ink); }
@media (max-width: 1180px) {
  .commerce-metrics { grid-template-columns: 1fr 1fr; }
  .oracle-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .commerce-hero { align-items: flex-start; flex-direction: column; padding: 24px; }
  .commerce-metrics,.source-grid,.oracle-fields { grid-template-columns: 1fr; }
  .commerce-metrics article { min-height: 120px; }
  .oracle-sources,.oracle-settings { padding: 17px; }
  .invoice-section > header { align-items: flex-start; }
}
/* Compact feedback controls for books, chapters, and products. */
.community-panel{width:min(100% - 2rem,1180px);margin:3rem auto;padding:1.35rem;border:1px solid var(--line);border-radius:1.4rem;background:color-mix(in srgb,var(--surface) 92%,transparent);box-shadow:0 18px 38px color-mix(in srgb,var(--ink) 7%,transparent)}
.community-panel>header{display:flex;align-items:start;justify-content:space-between;gap:1rem;margin-bottom:1rem}.community-panel h2{margin:.18rem 0;font-size:1.22rem}.community-panel header small{color:var(--muted);max-width:28rem;text-align:left}.community-reactions{display:flex;flex-wrap:wrap;gap:.65rem}.community-reactions button{display:inline-flex;align-items:center;gap:.5rem;padding:.65rem .82rem;border:1px solid var(--line);border-radius:.85rem;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer;transition:.18s ease}.community-reactions button:hover,.community-reactions button.active{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,var(--surface));color:var(--primary)}.community-reactions button b{min-width:1.35rem;color:var(--muted);font-size:.82rem}.community-comments{margin-top:1.25rem;padding-top:1.1rem;border-top:1px solid var(--line)}.community-comments-head{display:flex;justify-content:space-between;align-items:center;gap:1rem}.community-comments h3{margin:0;font-size:1rem}.community-comments h3 b{display:inline-grid;place-items:center;min-width:1.4rem;padding:.05rem .3rem;border-radius:.45rem;background:var(--surface-2);color:var(--primary);font-size:.78rem}.community-comments-head span,.community-empty{color:var(--muted);font-size:.9rem}.community-comment-list{display:grid;gap:.65rem;margin:.85rem 0}.community-comment-list article{padding:.8rem 1rem;border-radius:.85rem;background:var(--surface-2)}.community-comment-list article b{font-size:.9rem}.community-comment-list article p{margin:.35rem 0 0;color:var(--muted);line-height:1.8}.community-empty{margin:0}.community-comment-form{display:grid;gap:.55rem}.community-comment-form label{font-weight:700}.community-comment-form textarea{min-height:6rem}.community-comment-form>div{display:flex;align-items:center;justify-content:space-between;gap:1rem}.community-comment-form small{color:var(--muted)}
@media(max-width:700px){.community-panel{width:calc(100% - 1.5rem);padding:1rem;margin:2rem auto}.community-panel>header,.community-comment-form>div{align-items:stretch;flex-direction:column}.community-panel header small{text-align:right}.community-reactions{display:grid;grid-template-columns:repeat(3,1fr)}.community-reactions button{justify-content:center;padding:.65rem .4rem}.community-reactions button span{display:none}.community-comment-form .button{width:100%}}
.auth-divider{display:flex;align-items:center;gap:.75rem;margin:1.1rem 0;color:var(--muted);font-size:.85rem}.auth-divider::before,.auth-divider::after{content:"";height:1px;flex:1;background:var(--line)}.auth-social{display:grid;grid-template-columns:1fr 1fr;gap:.65rem}.auth-social .button{justify-content:center;font-size:.9rem}
@media(max-width:520px){.auth-social{grid-template-columns:1fr}}
.community-comment-list article header{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem}.community-comment-list article time{color:var(--muted);font-size:.78rem;font-variant-numeric:tabular-nums}
.community-signin{margin:.85rem 0 0;padding:.85rem 1rem;border:1px dashed var(--line);border-radius:.85rem;color:var(--muted);font-size:.9rem}.community-signin a{color:var(--primary);font-weight:700}
.account-notice{display:flex;align-items:center;justify-content:space-between;gap:1.25rem;flex-wrap:wrap;margin:1.75rem auto 0;padding:1.15rem 1.35rem;border:1px solid color-mix(in srgb,var(--primary) 45%,var(--line));border-inline-start:4px solid var(--primary);border-radius:1.1rem;background:color-mix(in srgb,var(--primary) 12%,var(--surface));box-shadow:0 10px 26px color-mix(in srgb,var(--ink) 6%,transparent)}.account-notice b{display:block;margin-bottom:.25rem}.account-notice p{margin:0;color:var(--muted);font-size:.92rem}.account-notice code{font-size:.85rem}
.pending-invoice-list{list-style:none;display:grid;gap:.5rem;margin:.85rem 0 0;padding:0}.pending-invoice-list li{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;padding:.6rem .85rem;border-radius:.75rem;background:var(--surface-2);font-size:.88rem}.pending-invoice-list li span{color:var(--muted)}.pending-invoice-list li small{color:var(--muted);font-variant-numeric:tabular-nums}.pending-invoice-list li a{margin-inline-start:auto}
.pending-invoices{margin-top:1.25rem;padding-top:1.1rem;border-top:1px solid var(--line)}.pending-invoices h2{margin:0 0 .35rem;font-size:1rem}.pending-invoices>p{margin:0 0 .85rem;color:var(--muted);font-size:.9rem}.pending-invoices .muted{margin:.75rem 0 0;font-size:.82rem}.pending-invoice{display:grid;gap:.6rem;padding:.9rem 1rem;border:1px solid var(--line);border-radius:.9rem;background:var(--surface-2)}.pending-invoice+.pending-invoice{margin-top:.75rem}.pending-invoice label{display:grid;gap:.35rem;font-weight:700;font-size:.88rem}.pending-invoice input{font-family:var(--mono,monospace);font-size:.82rem}.pending-invoice code{font-size:.78rem;word-break:break-all}.pending-invoice small{color:var(--muted);min-height:1.1em}
@media(max-width:700px){.account-notice{flex-direction:column;align-items:stretch}.account-notice form .button{width:100%}.pending-invoice-list li a{margin-inline-start:0}}


/* Store card footer: formats and price used to collide into one string. */
.store-card > footer { display: grid; gap: 14px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.store-formats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.store-formats li {
  padding: 4px 9px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: .72rem;
  font-weight: 700;
}
.store-formats li[dir="ltr"] { font-family: var(--font-mono, ui-monospace, monospace); letter-spacing: .01em; }
.store-buy { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.store-price { color: var(--action); font-size: 1.02rem; font-weight: 850; white-space: nowrap; }

.store-unreleased {
  display: grid;
  gap: 12px;
  justify-items: start;
  max-width: 560px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.store-unreleased p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.8; }
.store-unreleased i { color: var(--soft); }

/* A header-only table looks broken; say plainly that there is nothing yet. */
.table-empty td {
  padding: 30px 20px !important;
  color: var(--muted);
  text-align: center;
  font-size: .88rem;
}
.table-empty i { margin-inline-end: 7px; color: var(--soft); }


/* Account menu */
.account-menu { position: relative; }
.account-menu > summary { gap: 8px; padding-inline: 8px 12px; cursor: pointer; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > summary { color: var(--action); border-color: color-mix(in srgb, var(--action) 40%, var(--line)); }
.account-menu[open] .account-caret { transform: rotate(180deg); }
.account-caret { font-size: .7rem; color: var(--soft); transition: transform .18s ease; }
.account-name { font-size: .84rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--on-action);
  background: var(--action);
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
}

.account-panel {
  position: absolute;
  z-index: 90;
  /* The trigger sits at the far left of an RTL header, so anchoring the panel
     to the inline-start edge sent it off the side of the screen. Pinning the
     opposite edge makes it open inward. */
  inset-inline-end: 0;
  max-width: calc(100vw - 24px);
  top: calc(100% + 8px);
  min-width: 248px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-md);
  animation: account-menu-in .16s ease;
}
@keyframes account-menu-in { from { opacity: 0; transform: translateY(-6px); } }

.account-panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 11px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-panel-head > span { display: grid; gap: 2px; min-width: 0; }
.account-panel-head b { font-size: .88rem; }
.account-panel-head small { color: var(--soft); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; }

.account-panel a,
.account-panel-logout {
  width: 100%;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.account-panel a > i, .account-panel-logout > i { color: var(--soft); font-size: .9rem; }
.account-panel a:hover, .account-panel a:focus-visible { color: var(--action); background: var(--surface-2); }
.account-panel a:hover > i, .account-panel a:focus-visible > i { color: var(--action); }
.account-panel form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.account-panel-logout:hover, .account-panel-logout:focus-visible { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.account-panel-logout:hover > i, .account-panel-logout:focus-visible > i { color: var(--danger); }

@media (max-width: 900px) { .account-name { display: none; } .account-menu > summary { padding-inline: 8px; } }


/* Moderation queue */
.moderation-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.moderation-card:hover { border-color: color-mix(in srgb, var(--action) 30%, var(--line)); box-shadow: var(--shadow-md); }
.moderation-card > header { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.moderation-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--on-action);
  background: var(--action);
  border-radius: 50%;
  font-weight: 800;
}
.moderation-who { display: grid; gap: 3px; min-width: 0; margin-inline-end: auto; }
.moderation-who b { font-size: .92rem; }
.moderation-who small { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--soft); font-size: .76rem; }
.moderation-who code { padding: 2px 7px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; font-size: .72rem; }
.moderation-card time { color: var(--soft); font-size: .76rem; white-space: nowrap; }
.moderation-body {
  margin: 0;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--surface-2);
  border-radius: 10px;
  border-inline-start: 3px solid var(--line);
  font-size: .9rem;
  line-height: 1.85;
}
.moderation-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.moderation-actions .button { padding-inline: 18px; }

/* Admin panels: the section headings were rendering at page-title scale. */
.admin-content .panel > h2,
.admin-module > header h2 { font-size: 1.3rem; }
.admin-module > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-module > header > b {
  flex: none;
  padding: 5px 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .78rem;
}

/* The account rows read as flat blocks with the chevron marooned far away. */
.admin-record > summary:hover { background: var(--surface-2); }
.admin-record > summary > span > b { font-size: .95rem; }
.admin-record > summary > i { color: var(--soft); transition: transform .18s ease, color .18s ease; }
.admin-record > summary:hover > i { color: var(--action); }
.admin-record:hover { border-color: color-mix(in srgb, var(--action) 28%, var(--line)); }

/* Checkboxes were bare browser defaults sitting loose in the form. */
.check-field {
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.check-field:hover { border-color: color-mix(in srgb, var(--action) 35%, var(--line)); }
.check-field:has(input:checked) { color: var(--action); border-color: color-mix(in srgb, var(--action) 45%, var(--line)); background: color-mix(in srgb, var(--action) 8%, transparent); }
.check-field input { cursor: pointer; }
.check-field span { font-size: .86rem; font-weight: 700; }


/* A heading dropped into a two-column form grid consumed one cell and pushed
   every following control one place out of alignment. Headings and the submit
   button belong on their own full-width rows. */
.admin-form > h3,
.admin-form > legend,
.admin-form > .admin-form-note { grid-column: 1 / -1; margin: 0; }
.admin-form > h3 { font-size: 1.05rem; }
.admin-form > button[type="submit"],
.admin-form > .button { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }

/* Community settings read as a checklist, so the boxes should line up. */
.admin-form:has(> .check-field) { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }


/* Account rows: name and email on the right, state in the middle, chevron at
   the end. Previously the row carried two lines of text and a lot of nothing. */
.admin-record > summary { gap: 14px; }
.user-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-lines { display: grid; gap: 2px; min-width: 0; }
.user-lines b { font-size: .93rem; }
.user-lines small { color: var(--soft); font-size: .79rem; overflow: hidden; text-overflow: ellipsis; }
.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--on-action);
  background: var(--action);
  border-radius: 50%;
  font-weight: 800;
}

.user-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-inline-start: auto; }
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.user-badge > i { font-size: .72rem; }
.user-badge.role-admin { color: var(--action); border-color: color-mix(in srgb, var(--action) 45%, var(--line)); background: color-mix(in srgb, var(--action) 10%, transparent); }
.user-badge.role-editor { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, var(--line)); background: color-mix(in srgb, var(--success) 10%, transparent); }
.user-badge.badge-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.user-badge.badge-warn { color: var(--warning, #b7791f); border-color: color-mix(in srgb, var(--warning, #b7791f) 45%, var(--line)); background: color-mix(in srgb, var(--warning, #b7791f) 10%, transparent); }

@media (max-width: 760px) {
  .admin-record > summary { flex-wrap: wrap; }
  .user-badges { margin-inline-start: 45px; width: 100%; }
}


/* Flex was shrinking the pills until their labels were unreadable: a five
   letter word was being squeezed into 24px. The identity block absorbs the
   slack instead, since its email can safely ellipsize. */
.user-badge { flex: none; }
.user-identity { flex: 1 1 auto; overflow: hidden; }
.user-badges { flex: none; }


/* The legacy rule `.admin-record > summary > span` forces a 24px first grid
   column for the old icon+text layout, and the new identity and badge spans
   were inheriting it — which is what crushed each pill to 24px. These are
   flex rows, so they have to opt out explicitly. */
.admin-record > summary > .user-identity,
.admin-record > summary > .user-badges {
  display: flex;
  grid-template-columns: none;
  align-items: center;
}
.admin-record > summary > .user-identity { gap: 11px; flex: 1 1 auto; overflow: hidden; }
.admin-record > summary > .user-badges { gap: 7px; flex: none; flex-wrap: wrap; justify-content: flex-end; margin-inline-start: auto; }
.admin-record > summary > .user-badges > .user-badge { flex: none; width: auto; }

/* Toman-first pricing: one clear decision price, two quiet conversions. */
.price-quote { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 180px; color: var(--ink); font-variant-numeric: tabular-nums; }
.price-primary { display: grid; gap: 1px; }
.price-primary > small { color: var(--soft); font-size: .68rem; font-weight: 750; }
.price-primary > b { color: var(--action); font: 900 clamp(1.35rem,2vw,1.8rem)/1.15 "Farhang2",sans-serif !important; white-space: nowrap; }
.price-primary > b em { color: inherit; font-size: .56em; font-style: normal; font-weight: 750; }
.price-equivalents { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.price-equivalents > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.price-equivalents i { color: var(--soft); font-size: .62rem; }
.book-stats > div:has(.price-quote) { align-items: flex-start; padding-inline: 20px; }
.catalog-meta > .price-quote { flex-basis: 100%; margin-top: 5px; padding-top: 12px; border-top: 1px solid var(--line); }
.store-buy > .price-quote { flex: 1 1 210px; }
.pricing-card > .price-quote { display: flex; margin: 22px 0; padding-block: 20px; border-block: 1px solid var(--line); }
.pricing-card.featured .price-primary > b { color: #fff; }
.pricing-card.featured .price-primary > small { color: #abc5d3; }
.pricing-card.featured .price-equivalents > span { color: #d4e5ee; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.purchase-button { min-height: 52px; display: grid !important; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 0 8px !important; text-align: right; }
.purchase-button > i { grid-row: 1/3; align-self: center; }
.purchase-button > span { font-weight: 850; }
.purchase-button > small { color: var(--muted); font-size: .67rem; font-weight: 600; }

/* Checkout is a workspace, not a sticky sidebar. */
.checkout-page { min-height: 0; display: block; padding-block: 42px 80px; }
.checkout-intro { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 22px; }
.checkout-intro > div { text-align: center; }
.checkout-intro h1 { margin: 4px 0 2px; font-size: clamp(2rem,3vw,3rem); }
.checkout-intro p { margin: 0; color: var(--muted); font-size: .9rem; }
.checkout-back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.checkout-secure { display: grid; grid-template-columns: 35px auto; align-items: center; gap: 0 9px; }
.checkout-secure > i { grid-row: 1/3; width: 35px; height: 35px; display: grid; place-items: center; color: var(--success); background: color-mix(in srgb,var(--success) 10%,var(--surface)); border-radius: 10px; }
.checkout-secure b { color: var(--ink); font-size: .78rem; }
.checkout-secure small { color: var(--soft); font-size: .66rem; }
.checkout-journey { max-width: 760px; display: grid; grid-template-columns: repeat(3,1fr); gap: 0; margin: 30px auto; padding: 0; list-style: none; }
.checkout-journey li { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--soft); }
.checkout-journey li:not(:last-child)::after { content: ""; position: absolute; top: 19px; right: calc(50% + 65px); width: calc(100% - 130px); height: 1px; background: var(--line); }
.checkout-journey li > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--soft); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; font-weight: 850; }
.checkout-journey li > div { display: grid; }
.checkout-journey b { color: var(--muted); font-size: .76rem; }
.checkout-journey small { font-size: .64rem; }
.checkout-journey li.is-active > span { color: #fff; background: var(--action); border-color: var(--action); box-shadow: 0 0 0 5px color-mix(in srgb,var(--action) 10%,transparent); }
.checkout-journey li.is-active b { color: var(--action); }
.checkout-shell { display: grid; grid-template-columns: minmax(300px,.78fr) minmax(0,1.22fr); align-items: start; gap: 18px; max-width: 1050px; margin-inline: auto; }
.checkout-order-card,.checkout-payment-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 45px color-mix(in srgb,var(--ink) 8%,transparent); }
.checkout-order-card { overflow: hidden; }
.checkout-order-card > header { display: flex; align-items: center; gap: 13px; padding: 22px; border-bottom: 1px solid var(--line); }
.checkout-order-icon { width: 45px; height: 45px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,var(--brand-cpp),var(--action)); border-radius: 13px; box-shadow: 0 10px 24px rgba(0,89,156,.2); }
.checkout-order-card header > div { min-width: 0; }
.checkout-order-card header small { color: var(--soft); font-size: .7rem; }
.checkout-order-card h2 { margin: 2px 0 0; overflow: hidden; color: var(--ink); font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.checkout-price-card { padding: 24px 22px 20px; }
.checkout-price-card .price-quote { width: 100%; }
.checkout-price-card .price-primary > b { font-size: 2rem !important; }
.checkout-reward { display: flex; align-items: center; gap: 11px; margin: 0 22px 18px; padding: 12px; color: #6e4d00; background: linear-gradient(135deg,#fff8dc,#fff1b9); border: 1px solid #efd77b; border-radius: 13px; }
.checkout-reward > span { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: #d79600; border-radius: 10px; }
.checkout-reward > div { display: grid; }
.checkout-reward b { font-size: .9rem; }
.checkout-reward small { font-size: .68rem; }
.checkout-assurances { display: grid; gap: 9px; margin: 0; padding: 18px 22px 22px; border-top: 1px solid var(--line); list-style: none; }
.checkout-assurances li { display: flex; gap: 8px; color: var(--muted); font-size: .73rem; }
.checkout-assurances i { color: var(--success); }
.checkout-payment-card { padding: 26px; }
.checkout-payment-card > header h2 { margin: 4px 0 0; font-size: 1.45rem; }
.checkout-payment-card .pay-methods { grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.checkout-payment-card .pay-method { min-height: 78px; grid-template-columns: 42px minmax(0,1fr) auto; padding: 13px; }
.pay-method-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pay-method.is-active .pay-method-icon { color: #fff; background: var(--action); border-color: var(--action); }
.pay-method-check { display: none; color: var(--action); }
.pay-method.is-active .pay-method-check { display: block; }
.payment-panel { padding-top: 4px; }
.geny-payment-summary { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; margin-bottom: 14px; }
.geny-payment-summary > span { display: grid; gap: 4px; padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.geny-payment-summary small { color: var(--soft); font-size: .68rem; }
.geny-payment-summary strong { color: var(--action); font: 900 1.45rem "Farhang2",sans-serif !important; }
.geny-payment-summary strong em { font-size: .55em; font-style: normal; }
.geny-payment-summary b { color: var(--ink); font-size: .9rem; }
.checkout-pay-action { min-height: 60px; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 0 10px; }
.checkout-pay-action > i { grid-row: 1/3; align-self: center; }
.checkout-pay-action > span { font-weight: 850; }
.checkout-pay-action > small { color: rgba(255,255,255,.72); font-size: .65rem; font-weight: 550; }
.token-tools { margin-top: 13px; border: 1px solid var(--line); border-radius: 13px; }
.token-tools > summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; color: var(--muted); cursor: pointer; list-style: none; font-size: .75rem; font-weight: 750; }
.token-tools > summary::-webkit-details-marker { display: none; }
.token-tools > summary span { display: flex; align-items: center; gap: 7px; }
.token-tools[open] > summary > i { transform: rotate(180deg); }
.token-tools > div { padding: 0 13px 13px; }
.token-tools .token-contract { margin-top: 0; }
.token-tool-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.token-tool-actions .button { width: 100%; margin: 0; padding-inline: 8px; font-size: .7rem; }
.checkout-shell > .pending-invoices { grid-column: 1/-1; margin-top: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.pending-invoices > header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pending-invoices > header > span { width: 40px; height: 40px; display: grid; place-items: center; color: var(--warning-ink); background: color-mix(in srgb,var(--warning) 14%,var(--surface)); border-radius: 11px; }
.pending-invoices > header h2 { margin: 0; }
.pending-invoices > header p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.checkout-shell .pending-invoice { grid-template-columns: auto auto minmax(240px,1fr) auto; align-items: end; }
.checkout-shell .pending-invoice > div { display: grid; }
.checkout-shell .pending-invoice > div small { color: var(--soft); }

/* Reward wallet and account activity. */
.reward-wallet { overflow: hidden; color: #fff; background: radial-gradient(circle at 10% 0,rgba(255,209,80,.22),transparent 38%),linear-gradient(135deg,#082d4d,#064e7c); border: 1px solid #1d6b98; border-radius: 18px; box-shadow: 0 16px 32px rgba(3,37,63,.15); }
.reward-wallet > header { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid rgba(255,255,255,.12); }
.reward-wallet header span { display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 800; }
.reward-wallet header a { color: #bfe8ff; font-size: .68rem; }
.reward-wallet > div { display: grid; grid-template-columns: 1fr 1fr; }
.reward-wallet > div > span { display: grid; gap: 3px; padding: 17px; }
.reward-wallet > div > span + span { border-right: 1px solid rgba(255,255,255,.12); }
.reward-wallet small { color: #acd1e5; font-size: .64rem; }
.reward-wallet b { color: #fff; font: 850 1.1rem "Farhang2",sans-serif !important; direction: ltr; text-align: right; }
.reward-wallet .is-xp b { color: #ffe38d; }
.account-rewards { display: grid; grid-template-columns: .8fr .8fr 1.4fr; gap: 12px; margin-top: -22px; margin-bottom: 25px; }
.account-reward-card,.reward-activity { min-height: 170px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-xs); }
.account-reward-card { display: flex; align-items: center; gap: 15px; }
.account-reward-card > span { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border-radius: 15px; font-size: 1.1rem; }
.account-reward-card.is-xp > span { color: #7a5400; background: #fff0ad; }
.account-reward-card.is-ep > span { color: #045f91; background: #d6effd; }
.account-reward-card > div { display: grid; gap: 3px; }
.account-reward-card small { color: var(--soft); font-size: .67rem; }
.account-reward-card b { color: var(--ink); font: 900 1.65rem "Farhang2",sans-serif !important; direction: ltr; text-align: right; }
.account-reward-card b em { color: var(--soft); font-size: .55em; font-style: normal; }
.account-reward-card p { margin: 2px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.7; }
.reward-activity { overflow: hidden; padding: 0; }
.reward-activity > header { display: flex; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.reward-activity > header b { font-size: .82rem; }
.reward-activity > header small { color: var(--soft); font-size: .65rem; }
.reward-activity > p { padding: 20px; }
.reward-activity ul { max-height: 155px; margin: 0; padding: 7px; overflow: auto; list-style: none; }
.reward-activity li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 8px; border-radius: 9px; }
.reward-activity li:hover { background: var(--surface-2); }
.reward-activity li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; }
.reward-activity li.is-xp > span { color: #8a6200; background: #fff3bd; }
.reward-activity li.is-ep > span { color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); }
.reward-activity li > div { display: grid; }
.reward-activity li b { font-size: .7rem; }
.reward-activity li small { color: var(--soft); font-size: .6rem; }
.reward-activity li strong { color: var(--action); font-size: .67rem; direction: ltr; }

/* Reward administration. */
.rewards-admin .admin-content { display: grid; gap: 17px; }
.rewards-hero { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 30px; color: #fff; background: radial-gradient(circle at 8% 10%,rgba(255,211,91,.22),transparent 30%),linear-gradient(135deg,#082d4d,#064e7c); border-radius: 22px; }
.rewards-hero h2 { margin: 7px 0; color: #fff; font-size: clamp(1.8rem,3vw,2.6rem); }
.rewards-hero p { max-width: 680px; margin: 0; color: #c0dbea; }
.rewards-hero .premium-eyebrow { color: #ffe38d; }
.reward-legend { display: grid; grid-template-columns: 1fr 1fr; min-width: 310px; overflow: hidden; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 17px; }
.reward-legend > span { display: grid; justify-items: center; gap: 4px; padding: 20px; }
.reward-legend > span + span { border-right: 1px solid rgba(255,255,255,.14); }
.reward-legend i { font-size: 1.25rem; }
.reward-legend .is-xp i,.reward-legend .is-xp b { color: #ffe38d; }
.reward-legend .is-ep i,.reward-legend .is-ep b { color: #9ddfff; }
.reward-legend b { font-size: 1.1rem; }
.reward-legend small { color: #c0dbea; font-size: .65rem; }
.reward-notes { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.reward-notes > span { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 0 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.reward-notes i { grid-row: 1/3; width: 38px; height: 38px; display: grid; place-items: center; color: var(--action); background: color-mix(in srgb,var(--action) 9%,var(--surface)); border-radius: 10px; }
.reward-notes b { font-size: .78rem; }
.reward-notes small { color: var(--soft); font-size: .64rem; }
.reward-rules > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 15px 0 10px; }
.reward-rules h2 { margin: 5px 0 1px; }
.reward-rules header p { margin: 0; color: var(--muted); font-size: .76rem; }
.reward-rule-count { padding: 7px 11px; color: var(--action); background: color-mix(in srgb,var(--action) 8%,var(--surface)); border-radius: 999px; font-size: .7rem; font-weight: 800; }
.reward-group { margin-bottom: 9px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.reward-group > summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; cursor: pointer; list-style: none; }
.reward-group > summary::-webkit-details-marker { display: none; }
.reward-group > summary > span { display: flex; align-items: center; gap: 9px; }
.reward-group > summary > span > i { width: 32px; height: 32px; display: grid; place-items: center; color: var(--action); background: var(--surface-2); border-radius: 9px; }
.reward-group > summary b { font-size: .86rem; }
.reward-group > summary small { color: var(--soft); font-size: .66rem; }
.reward-group[open] > summary { border-bottom: 1px solid var(--line); }
.reward-group[open] > summary > i { transform: rotate(180deg); }
.reward-rule-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 10px; }
.reward-rule-card { display: grid; gap: 13px; padding: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.reward-rule-card.is-configured { border-color: color-mix(in srgb,var(--success) 35%,var(--line)); }
.reward-rule-card > header { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 9px; align-items: center; }
.reward-rule-card > header > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--action); background: var(--surface); border-radius: 10px; }
.reward-rule-card header > div { min-width: 0; display: grid; }
.reward-rule-card header b { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.reward-rule-card header code { overflow: hidden; color: var(--soft); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.reward-rule-card header em { padding: 3px 7px; color: var(--success); background: color-mix(in srgb,var(--success) 10%,var(--surface)); border-radius: 999px; font-size: .58rem; font-style: normal; }
.reward-rule-card header em.is-default { color: var(--soft); background: var(--surface); }
.reward-rule-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reward-rule-card label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .62rem; }
.reward-input { display: flex; align-items: center; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.reward-input input { width: 100%; min-width: 0; padding: 8px; color: var(--ink); background: transparent; border: 0; font: inherit; font-size: .76rem; }
.reward-input small { padding: 8px; font-size: .62rem; font-weight: 850; }
.reward-input.is-xp small { color: #8a6200; background: #fff3bd; }
.reward-input.is-ep small { color: var(--action); background: color-mix(in srgb,var(--action) 10%,var(--surface)); }
.reward-rule-card > .button { min-height: 36px; justify-self: start; font-size: .7rem; }

/* Compact rate settings and scan-friendly invoice cards. */
.oracle-workspace { grid-template-columns: 1fr; }
.oracle-settings-disclosure { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-xs); }
.oracle-settings-disclosure > summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; cursor: pointer; list-style: none; }
.oracle-settings-disclosure > summary::-webkit-details-marker { display: none; }
.oracle-settings-disclosure > summary > span { display: grid; grid-template-columns: 35px 1fr; gap: 0 9px; align-items: center; }
.oracle-settings-disclosure > summary span > i { grid-row: 1/3; width: 35px; height: 35px; display: grid; place-items: center; color: var(--action); background: var(--surface-2); border-radius: 10px; }
.oracle-settings-disclosure > summary b { font-size: .82rem; }
.oracle-settings-disclosure > summary small { color: var(--soft); font-size: .67rem; }
.oracle-settings-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.oracle-settings-disclosure[open] > summary > i { transform: rotate(180deg); }
.oracle-settings-disclosure .oracle-settings { border: 0; border-radius: 0 0 16px 16px; box-shadow: none; }
.invoice-overview { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 10px; }
.invoice-overview > span { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.invoice-overview small { color: var(--muted); font-size: .67rem; }
.invoice-overview b { color: var(--ink); font-size: .95rem; }
.invoice-overview .is-paid b { color: var(--success); }
.invoice-overview .is-pending b { color: var(--warning-ink); }
.invoice-card-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.invoice-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-xs); }
.invoice-card.is-paid { border-top: 3px solid var(--success); }
.invoice-card.is-pending { border-top: 3px solid var(--warning); }
.invoice-card.is-failed,.invoice-card.is-expired { border-top: 3px solid var(--danger); }
.invoice-card > header,.invoice-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--surface-2); }
.invoice-kind { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.invoice-kind i { color: var(--action); }
.invoice-card-product { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 14px 5px; }
.invoice-card-product b { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.invoice-card-product code { color: var(--soft); font-size: .64rem; }
.invoice-card-price { display: grid; gap: 3px; padding: 9px 14px 14px; }
.invoice-card-price strong { color: var(--action); font: 900 1.3rem "Farhang2",sans-serif !important; }
.invoice-card-price strong em { font-size: .55em; font-style: normal; }
.invoice-card-price span { color: var(--muted); font-size: .67rem; direction: ltr; text-align: right; }
.invoice-card dl { display: grid; grid-template-columns: repeat(3,1fr); margin: 0; padding: 0 14px 14px; }
.invoice-card dl > div { display: grid; gap: 2px; padding: 8px 10px; background: var(--surface-2); border-left: 1px solid var(--line); }
.invoice-card dl > div:first-child { border-radius: 0 9px 9px 0; }
.invoice-card dl > div:last-child { border: 0; border-radius: 9px 0 0 9px; }
.invoice-card dt { color: var(--soft); font-size: .58rem; }
.invoice-card dd { margin: 0; color: var(--ink); font-size: .65rem; }
.invoice-card footer .tx-hash { display: inline-flex; align-items: center; gap: 6px; }
.invoice-card footer small { color: var(--soft); font-size: .6rem; }

@media (max-width: 980px) {
  .checkout-shell { grid-template-columns: 1fr; max-width: 680px; }
  .account-rewards { grid-template-columns: 1fr 1fr; }
  .reward-activity { grid-column: 1/-1; }
  .rewards-hero { align-items: stretch; flex-direction: column; }
  .reward-legend { min-width: 0; }
  .reward-rule-grid,.invoice-card-list { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .price-primary > b { font-size: 1.38rem !important; }
  .checkout-page { padding-block: 26px 55px; }
  .checkout-intro { grid-template-columns: 1fr auto; }
  .checkout-intro > div { grid-column: 1/-1; grid-row: 1; text-align: right; }
  .checkout-back { grid-column: 1; grid-row: 2; }
  .checkout-secure { grid-column: 2; grid-row: 2; }
  .checkout-journey li > div { display: none; }
  .checkout-journey li:not(:last-child)::after { right: calc(50% + 19px); width: calc(100% - 38px); }
  .checkout-order-card,.checkout-payment-card { border-radius: 17px; }
  .checkout-payment-card { padding: 18px; }
  .checkout-payment-card .pay-methods,.geny-payment-summary,.token-tool-actions { grid-template-columns: 1fr; }
  .checkout-shell .pending-invoice { grid-template-columns: 1fr; }
  .account-rewards,.reward-notes,.invoice-overview { grid-template-columns: 1fr 1fr; }
  .account-reward-card { min-height: 140px; padding: 15px; }
  .account-reward-card > span { display: none; }
  .reward-notes > span:last-child { grid-column: 1/-1; }
  .reward-rule-card > div { grid-template-columns: 1fr; }
  .invoice-section > header { flex-direction: column; }
  .invoice-card dl { grid-template-columns: 1fr; gap: 4px; }
  .invoice-card dl > div { border: 0; border-radius: 8px !important; }
}

/* Crypto identity and commerce polish. GENY always uses the DNA mark while
   network and settlement assets retain their own recognizable symbols. */
.inline-crypto-icon,.button-token-icon,.usage-crypto-icon { width: 18px; height: 18px; object-fit: contain; }
.button img,.pay-method img,.token-tools img,.wallet-chain-tag img,.payment-note img { flex: 0 0 auto; object-fit: contain; }
.button-token-icon { margin-inline-end: 2px; }
.wallet-chain-tag img { width: 19px; height: 19px; }
.payment-note > div > span img { width: 30px; height: 30px; }
.payment-note code { display: inline-flex; align-items: center; gap: 7px; }
.payment-note code img { width: 20px; height: 20px; }
.token-contract-mark img { width: 24px; height: 24px; }

/* Price conversions have equal optical weight and no RTL reordering. */
.price-equivalents { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(108px,1fr)); gap: 7px; }
.price-equivalents > .price-equivalent { min-height: 34px; display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 10px; }
.price-equivalent img { width: 18px; height: 18px; }
.price-equivalent .currency-dollar { width: 18px; height: 18px; display: grid; place-items: center; color: #fff; background: #16865b; border-radius: 50%; font: 850 .7rem/1 ui-sans-serif,sans-serif; }
.price-equivalent b { color: var(--ink); font-size: .73rem; font-weight: 850; text-align: left; }
.price-equivalent em { color: var(--soft); font-size: .64rem; font-style: normal; text-align: right; }
.catalog-meta > .price-quote { max-width: 300px; }
.catalog-card-top { min-height: 43px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.catalog-card-top .tag-row { flex: 1 1 auto; }

.reward-chip { min-height: 44px; display: grid; grid-template-columns: 34px auto; grid-template-rows: auto auto; align-items: center; gap: 0 9px; padding: 7px 10px; color: #725000; background: linear-gradient(135deg,#fff9df,#fff0b2); border: 1px solid #eed577; border-radius: 12px; white-space: nowrap; }
.reward-chip > span { grid-row: 1/3; width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #d79500; border-radius: 10px; font: 900 .66rem/1 ui-sans-serif,sans-serif; }
.reward-chip > b { color: #725000; font-size: .75rem; line-height: 1.2; }
.reward-chip > small { color: #8a6b25; font-size: .56rem; line-height: 1.2; }
.reward-chip-compact { min-height: 36px; grid-template-columns: 27px auto; padding: 5px 7px; border-radius: 10px; }
.reward-chip-compact > span { width: 27px; height: 27px; border-radius: 8px; font-size: .55rem; }
.reward-chip-compact > b { font-size: .66rem; }
.reward-chip-compact > small { font-size: .5rem; }
.book-stats { grid-template-columns: .65fr .65fr 1.7fr; max-width: 760px; }
.book-stats > .book-commerce-summary { display: flex; align-items: center; gap: 10px; padding: 13px 18px; }
.book-commerce-summary .price-quote { min-width: 210px; }
.book-commerce-summary .reward-chip { margin-inline-start: auto; }

/* Checkout: a clear acquire-token path instead of a technical afterthought. */
.pay-method-icon img { width: 26px; height: 26px; }
.pay-method.is-active .pay-method-icon { background: color-mix(in srgb,var(--action) 8%,#fff); }
.checkout-reward > span { font: 900 .66rem/1 ui-sans-serif,sans-serif; }
.token-tools { overflow: hidden; background: color-mix(in srgb,var(--action) 3%,var(--surface)); border-color: color-mix(in srgb,var(--action) 22%,var(--line)); }
.token-tools > summary { min-height: 48px; color: var(--ink); background: color-mix(in srgb,var(--action) 5%,var(--surface)); }
.token-tools > summary span img { width: 23px; height: 23px; }
.token-tools > div { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.token-buy-guide { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.token-buy-guide b { color: var(--ink); font-size: .82rem; }
.token-buy-guide p { margin: 3px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.75; }
.crypto-route { display: flex; align-items: center; gap: 6px; direction: ltr; }
.crypto-route > span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; color: var(--ink); background: var(--surface-2); border-radius: 8px; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.crypto-route img { width: 18px; height: 18px; }
.crypto-route > i { color: var(--soft); font-size: .6rem; }
.token-network-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.token-network-facts > span { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; align-items: center; gap: 0 8px; padding: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.token-network-facts img { grid-row: 1/3; width: 28px; height: 28px; }
.token-network-facts small { color: var(--soft); font-size: .56rem; }
.token-network-facts b { color: var(--ink); font-size: .65rem; direction: ltr; text-align: right; }
.token-tools .token-contract { margin: 0; background: var(--surface); }
.token-tool-actions { margin: 0; }
.token-tool-actions .button { min-height: 45px; }
.token-tool-actions .button img { width: 20px; height: 20px; }

/* Engineering store as a shoppable, versioned product showcase. */
.store-status.available { display: inline-flex; align-items: center; gap: 5px; color: var(--success-ink); background: color-mix(in srgb,var(--success) 12%,var(--surface)); border: 1px solid color-mix(in srgb,var(--success) 25%,var(--line)); }
.store-card { min-height: 430px; }
.store-card footer { align-content: end; }
.store-price-stack { min-width: 0; display: grid; grid-template-columns: minmax(190px,1fr) auto; align-items: end; gap: 9px; flex: 1 1 100%; }
.store-price-stack .price-quote { min-width: 0; }
.store-price-stack .reward-chip { align-self: end; }
.store-buy > .button { margin-inline-start: auto; }

.store-product-detail { overflow: hidden; padding-block: 68px; background: radial-gradient(circle at 8% 6%,rgba(101,154,210,.2),transparent 28%),var(--surface-2); border-bottom: 1px solid var(--line); }
.store-product-detail-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.55fr); align-items: center; gap: clamp(42px,7vw,90px); }
.store-product-copy { min-width: 0; }
.store-product-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 28px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.store-product-copy h1 { max-width: 760px; margin: 10px 0 14px; font-size: clamp(2.5rem,5vw,4.5rem); }
.store-product-lead { max-width: 720px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 2; }
.store-product-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.store-product-tags > span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: .7rem; font-weight: 750; }
.store-purchase-panel { max-width: 720px; display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; gap: 12px; margin-top: 26px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.store-purchase-panel > .price-quote { grid-row: 1/3; }
.store-purchase-panel .reward-chip { align-self: stretch; }
.store-purchase-action { min-height: 54px; display: grid !important; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 0 8px !important; }
.store-purchase-action > i { grid-row: 1/3; align-self: center; }
.store-purchase-action small { color: rgba(255,255,255,.75); font-size: .6rem; }
.store-product-visual { min-height: 460px; display: flex; flex-direction: column; padding: 34px; color: #fff; background: radial-gradient(circle at 100% 0,rgba(105,188,235,.25),transparent 35%),linear-gradient(145deg,var(--brand-cpp),var(--brand-cpp-deep)); border: 1px solid #216993; border-radius: 28px; box-shadow: 0 26px 55px rgba(3,37,63,.22); }
.store-product-icon { width: 64px; height: 64px; display: grid; place-items: center; color: var(--brand-cpp-deep); background: #dff3fd; border-radius: 18px; font-size: 1.35rem; }
.store-product-visual > small { margin-top: auto; color: #a9d3e9; }
.store-product-visual h2 { margin: 10px 0; color: #fff; font-size: 2rem; line-height: 1.5; }
.store-product-visual p { margin: 0; color: #c6e0ed; font-size: .82rem; }
.store-product-visual footer { display: flex; justify-content: space-between; margin-top: 34px; padding-top: 18px; color: #b9d8e7; border-top: 1px solid rgba(255,255,255,.16); font-size: .7rem; }
.store-owned { max-width: 720px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; margin-top: 26px; padding: 15px; background: color-mix(in srgb,var(--success) 7%,var(--surface)); border: 1px solid color-mix(in srgb,var(--success) 28%,var(--line)); border-radius: 16px; }
.store-owned > span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--success); background: var(--surface); border-radius: 12px; }
.store-owned b,.store-owned small { display: block; }
.store-owned small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.store-product-includes { padding-block: 64px 28px; }
.store-product-includes > header { max-width: 690px; }
.store-product-includes h2 { margin: 7px 0; }
.store-product-includes header p { margin: 0; color: var(--muted); }
.store-product-includes > div { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 24px; }
.store-product-includes article { min-height: 130px; display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-xs); }
.store-product-includes article > span { grid-column: 1/-1; color: var(--soft); font-size: .62rem; }
.store-product-includes article > i { color: var(--success); margin-top: 3px; }
.store-product-includes article > b { color: var(--ink); font-size: .82rem; line-height: 1.7; }
.entitlement-download { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--action); font-size: .68rem; font-weight: 800; }
.account-reward-card.is-xp > span,.reward-activity li.is-xp > span { font: 900 .72rem/1 ui-sans-serif,sans-serif; }
.community-comment-form > .comment-compose { display: grid; grid-template-columns: 110px minmax(0,1fr); align-items: start; justify-content: stretch; }
.comment-label { padding-top: 12px; }
.comment-field { min-width: 0; width: 100%; }
.comment-field textarea { width: 100%; min-height: 110px; }
.comment-field-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.comment-counter { color: var(--soft); font-size: .68rem; }
.community-comment-form > .comment-actions { display: flex; align-items: center; justify-content: space-between; }

@media (max-width: 980px) {
  .book-stats { grid-template-columns: 1fr 1fr; }
  .book-stats > .book-commerce-summary { grid-column: 1/-1; border-top: 1px solid var(--line); }
  .store-product-detail-grid { grid-template-columns: 1fr; }
  .store-product-visual { min-height: 380px; }
  .store-product-includes > div { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .price-equivalents { grid-template-columns: 1fr 1fr; }
  .catalog-card-top { align-items: stretch; flex-direction: column; }
  .catalog-card-top .reward-chip { align-self: flex-start; }
  .book-stats > .book-commerce-summary { align-items: stretch; flex-direction: column; }
  .book-commerce-summary .reward-chip { margin-inline-start: 0; }
  .token-buy-guide { grid-template-columns: 1fr; }
  .crypto-route { justify-content: flex-start; overflow-x: auto; }
  .token-network-facts { grid-template-columns: 1fr; }
  .store-price-stack,.store-purchase-panel { grid-template-columns: 1fr; }
  .store-purchase-panel > .price-quote { grid-row: auto; }
  .store-product-detail { padding-block: 42px; }
  .store-product-visual { min-height: 320px; padding: 25px; border-radius: 21px; }
  .store-product-includes > div { grid-template-columns: 1fr; }
  .store-owned { grid-template-columns: 38px 1fr; }
  .store-owned .button { grid-column: 1/-1; }
  .community-comment-form > .comment-compose { grid-template-columns: 1fr; }
  .comment-label { padding-top: 0; }
}
