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

:root {
  --portal-max: 1180px;
  --portal-brand: 27 86 239;
  --portal-brand-strong: 20 64 190;
  --portal-hero-start: 242 247 255;
  --portal-hero-end: 248 250 252;
  --portal-glow: 191 219 254;
  --portal-overlay: 15 23 42 / 0.5;
}

.dark {
  --portal-brand: 96 165 250;
  --portal-brand-strong: 147 197 253;
  --portal-hero-start: 12 24 45;
  --portal-hero-end: 9 14 25;
  --portal-glow: 30 64 175;
  --portal-overlay: 0 0 0 / 0.72;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: rgb(var(--surface-canvas));
}

body {
  min-height: 100vh;
  margin: 0;
  background: rgb(var(--surface-canvas));
  color: rgb(var(--text-primary));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgb(var(--focus-ring) / 0.42);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgb(var(--text-primary));
  color: rgb(var(--surface-base));
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgb(var(--border-subtle) / 0.82);
  background: rgb(var(--surface-base) / 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.site-header__inner,
.site-footer__inner {
  display: flex;
  width: min(var(--portal-max), calc(100% - 48px));
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: rgb(var(--text-primary));
  font-size: 16px;
  font-weight: 520;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand strong {
  color: rgb(var(--text-secondary));
  font-weight: 520;
}

/* Renamed from .brand__mark: year-cached stale CSS carries the old blue-tile
   rule for that class and would paint a chip behind the transparent logo. */
.brand__logo {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* W-6: revealed only after the client session probe confirms a signed-in vendor. */
.header-my-tickets {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 9px;
  background: rgb(var(--surface-subtle) / 0.7);
  color: rgb(var(--text-secondary));
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.header-my-tickets:hover {
  border-color: rgb(var(--text-tertiary) / 0.7);
  background: rgb(var(--surface-base));
}

.header-search {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 9px;
  padding: 8px 9px 8px 12px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 9px;
  background: rgb(var(--surface-subtle) / 0.7);
  color: rgb(var(--text-secondary));
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.header-search:hover {
  border-color: rgb(var(--text-tertiary) / 0.7);
  background: rgb(var(--surface-base));
  box-shadow: var(--shadow-card);
}

.header-search:active {
  background: rgb(var(--surface-muted));
}

.header-search svg,
.hero-search svg,
.search-dialog__icon {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.header-search span {
  flex: 1;
  text-align: left;
}

kbd {
  padding: 2px 6px;
  border: 1px solid rgb(var(--border-subtle));
  border-radius: 5px;
  background: rgb(var(--surface-base));
  box-shadow: 0 1px 0 rgb(var(--border-strong));
  color: rgb(var(--text-tertiary));
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
}

.theme-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid rgb(var(--border-subtle));
  border-radius: 9px;
  background: rgb(var(--surface-subtle));
}

.theme-toggle button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgb(var(--text-tertiary));
  cursor: pointer;
  font-size: 13px;
}

.theme-toggle button:hover {
  color: rgb(var(--text-primary));
}

.theme-toggle button[aria-pressed="true"] {
  background: rgb(var(--surface-base));
  box-shadow: var(--shadow-card);
  color: rgb(var(--accent));
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgb(var(--border-subtle));
  background:
    radial-gradient(circle at 50% -20%, rgb(var(--portal-glow) / 0.55), transparent 45%),
    linear-gradient(180deg, rgb(var(--portal-hero-start)), rgb(var(--portal-hero-end)));
}

.hero::before,
.hero::after {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgb(var(--portal-brand) / 0.08);
  border-radius: 50%;
  content: "";
}

.hero::before {
  top: -250px;
  left: calc(50% - 520px);
}

.hero::after {
  right: calc(50% - 530px);
  bottom: -310px;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(820px, calc(100% - 48px));
  min-height: 420px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0 72px;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgb(var(--accent));
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(39px, 6vw, 58px);
  font-weight: 730;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.hero__inner > p:not(.eyebrow) {
  max-width: 570px;
  margin: 18px 0 0;
  color: rgb(var(--text-secondary));
  font-size: 18px;
}

.hero-search {
  display: flex;
  width: min(650px, 100%);
  min-height: 62px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 18px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 14px;
  margin-top: 34px;
  background: rgb(var(--surface-base));
  box-shadow: 0 14px 34px rgb(15 23 42 / 0.1), 0 2px 6px rgb(15 23 42 / 0.05);
  color: rgb(var(--text-tertiary));
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.dark .hero-search {
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.35);
}

.hero-search:focus-within {
  border-color: rgb(var(--accent));
  box-shadow: 0 0 0 4px rgb(var(--focus-ring) / 0.12), 0 16px 36px rgb(15 23 42 / 0.1);
  transform: translateY(-1px);
}

.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgb(var(--text-primary));
  font-size: 16px;
}

.hero-search input::placeholder {
  color: rgb(var(--text-tertiary));
}

.hero-search button {
  align-self: stretch;
  padding-inline: 18px;
  border: 0;
  border-radius: 9px;
  background: rgb(var(--accent-solid));
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.section-shell,
.page-shell {
  width: min(var(--portal-max), calc(100% - 48px));
  margin-inline: auto;
}

.section-shell {
  padding-block: 84px;
}

.section-shell--compact {
  padding-top: 10px;
  padding-bottom: 100px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.section-heading > p {
  max-width: 450px;
  margin: 0 0 2px;
  color: rgb(var(--text-secondary));
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.category-card {
  position: relative;
  display: flex;
  min-height: 176px;
  align-items: flex-start;
  gap: 18px;
  padding: 25px;
  border: 1px solid rgb(var(--border-subtle));
  border-radius: 13px;
  background: rgb(var(--surface-base));
  color: rgb(var(--text-primary));
  text-decoration: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.category-card:hover {
  border-color: rgb(var(--accent) / 0.45);
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.09);
  transform: translateY(-2px);
}

.dark .category-card:hover {
  box-shadow: 0 16px 32px rgb(0 0 0 / 0.28);
}

.category-card:active {
  transform: translateY(0);
}

.category-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid rgb(var(--accent) / 0.14);
  border-radius: 12px;
  background: rgb(var(--accent-soft));
  color: rgb(var(--accent));
  font-size: 18px;
  font-weight: 800;
}

/* Drawn icon inside the same tile as the letter fallback, so both line up. */
.category-card__glyph {
  width: 23px;
  height: 23px;
}

.category-hero .category-card__glyph {
  width: 26px;
  height: 26px;
}

.category-card__content {
  display: grid;
  gap: 7px;
}

.category-card__content strong {
  font-size: 20px;
  font-weight: 690;
  letter-spacing: -0.02em;
}

.category-card__content > span {
  max-width: 46ch;
  color: rgb(var(--text-secondary));
  line-height: 1.55;
}

.category-card__content small {
  margin-top: 5px;
  color: rgb(var(--text-tertiary));
  font-size: 12px;
  font-weight: 650;
}

.category-card__arrow {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: rgb(var(--text-tertiary));
  font-size: 20px;
  transition: color 150ms ease, transform 150ms ease;
}

.category-card:hover .category-card__arrow {
  color: rgb(var(--accent));
  transform: translateX(3px);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgb(var(--border-subtle));
}

.article-card {
  position: relative;
  min-height: 205px;
  padding: 28px 44px 28px 0;
  border-bottom: 1px solid rgb(var(--border-subtle));
}

.article-card:not(:nth-child(3n + 1)) {
  padding-left: 28px;
  border-left: 1px solid rgb(var(--border-subtle));
}

.article-card__category {
  margin: 0 0 10px;
  color: rgb(var(--text-tertiary));
  font-size: 12px;
  font-weight: 700;
}

.article-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.article-card__title a {
  text-decoration: none;
}

.article-card__title a::after {
  position: absolute;
  content: "";
  inset: 0;
}

.article-card__description {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 0;
  color: rgb(var(--text-secondary));
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card__arrow {
  position: absolute;
  right: 18px;
  bottom: 28px;
  color: rgb(var(--text-tertiary));
  transition: color 150ms ease, transform 150ms ease;
}

.article-card:hover .article-card__arrow {
  color: rgb(var(--accent));
  transform: translateX(3px);
}

.page-shell {
  min-height: calc(100vh - 190px);
  padding-block: 42px 96px;
}

.breadcrumbs {
  color: rgb(var(--text-tertiary));
  font-size: 13px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.breadcrumbs li + li::before {
  color: rgb(var(--border-strong));
  content: "/";
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: rgb(var(--accent));
}

.category-hero {
  display: flex;
  max-width: 760px;
  align-items: flex-start;
  gap: 20px;
  padding: 68px 0 48px;
}

.category-hero .category-card__icon {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
}

.category-hero h1,
.search-page h1 {
  margin: 0;
  font-size: 39px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.category-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 14px 0 0;
  color: rgb(var(--text-secondary));
  font-size: 17px;
  line-height: 1.6;
}

.article-list {
  max-width: 900px;
  border-top: 1px solid rgb(var(--border-subtle));
}

.article-list__item {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 20px 8px;
  border-bottom: 1px solid rgb(var(--border-subtle));
  color: rgb(var(--text-primary));
  text-decoration: none;
  transition: color 150ms ease, padding 150ms ease;
}

.article-list__item:hover {
  padding-inline: 14px 2px;
  color: rgb(var(--accent));
}

.article-list__item > span:first-child {
  display: grid;
  gap: 5px;
}

.article-list__item strong {
  font-size: 17px;
  font-weight: 660;
}

.article-list__item small,
.search-page__snippet {
  color: rgb(var(--text-secondary));
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  min-height: 310px;
  place-content: center;
  justify-items: center;
  padding: 48px 24px;
  border: 1px dashed rgb(var(--border-strong));
  border-radius: 14px;
  background: rgb(var(--surface-base));
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: rgb(var(--surface-subtle));
  color: rgb(var(--text-tertiary));
  font-size: 22px;
}

.empty-state h2 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.empty-state p {
  max-width: 470px;
  margin: 0;
  color: rgb(var(--text-secondary));
}

.empty-state a {
  margin-top: 18px;
  color: rgb(var(--accent));
  font-weight: 700;
}

.portal-article-page {
  padding: 32px;
}

.portal-article-sheet {
  max-width: 1420px;
  padding: 0;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) minmax(160px, 210px);
  gap: clamp(32px, 4vw, 72px);
  padding: 48px clamp(32px, 5vw, 72px) 84px;
}

.article-layout__breadcrumbs {
  align-self: start;
}

.article-layout__breadcrumbs ol {
  align-items: flex-start;
  flex-direction: column;
}

.article-layout__breadcrumbs li {
  display: block;
}

.article-layout__breadcrumbs li + li::before {
  display: none;
}

.article-layout__breadcrumbs li[aria-current="page"] {
  color: rgb(var(--text-secondary));
  font-weight: 650;
}

.article-layout .kb-article-column {
  width: 100%;
}

.article-header {
  padding-bottom: 36px;
  border-bottom: 1px solid rgb(var(--border-subtle));
  margin-bottom: 36px;
}

.article-header .kb-article-title {
  margin-bottom: 18px;
}

.article-updated {
  margin: 0;
  color: rgb(var(--text-tertiary));
  font-size: 13px;
}

.article-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding-left: 18px;
  border-left: 1px solid rgb(var(--border-subtle));
}

.article-toc > p {
  margin: 0 0 12px;
  color: rgb(var(--text-primary));
  font-size: 12px;
  font-weight: 760;
}

.article-toc ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.article-toc li + li {
  margin-top: 4px;
}

.article-toc a {
  display: block;
  padding: 5px 0;
  color: rgb(var(--text-tertiary));
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 120ms ease;
}

.article-toc a:hover,
.article-toc a[aria-current="true"] {
  color: rgb(var(--accent));
}

.article-toc__level-3 {
  padding-left: 10px;
}

.article-toc__level-4 {
  padding-left: 20px;
}

.kb-content :is(h2, h3, h4) {
  position: relative;
  scroll-margin-top: 100px;
}

.heading-anchor {
  position: absolute;
  top: 50%;
  right: calc(100% + 7px);
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgb(var(--text-tertiary));
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.kb-content :is(h2, h3, h4):hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.heading-anchor:hover {
  background: rgb(var(--surface-subtle));
  color: rgb(var(--accent));
}

.code-shell {
  position: relative;
}

.code-copy {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  padding: 5px 9px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 6px;
  background: rgb(15 23 42 / 0.76);
  color: rgb(241 245 249);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease;
}

.code-shell:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  background: rgb(30 41 59);
}

.article-feedback {
  position: relative;
  min-height: 170px;
  padding: 26px;
  border: 1px solid rgb(var(--border-subtle));
  border-radius: 12px;
  margin-top: 72px;
  background: rgb(var(--surface-subtle) / 0.72);
}

.article-feedback h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 690;
  letter-spacing: -0.015em;
}

.article-feedback p {
  margin: 7px 0 0;
  color: rgb(var(--text-secondary));
  font-size: 14px;
}

.article-feedback__buttons {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}

.article-feedback__buttons button {
  padding: 8px 13px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 8px;
  background: rgb(var(--surface-base));
  cursor: pointer;
  font-weight: 680;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}

.article-feedback__buttons button:hover,
.article-feedback__buttons button[aria-pressed="true"] {
  border-color: rgb(var(--accent));
  background: rgb(var(--accent-soft));
  color: rgb(var(--accent));
}

.vote-comment {
  display: grid;
  gap: 10px;
}

.vote-comment fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  border: 0;
  margin: 0;
}

.vote-comment legend {
  width: 100%;
  margin-bottom: 5px;
  font-weight: 720;
}

.vote-comment fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.vote-comment label {
  font-size: 14px;
  font-weight: 680;
}

.vote-comment label span {
  color: rgb(var(--text-tertiary));
  font-weight: 450;
}

.vote-comment textarea {
  width: 100%;
  resize: vertical;
  padding: 11px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 8px;
  outline: 0;
  background: rgb(var(--surface-base));
  color: rgb(var(--text-primary));
}

.vote-comment textarea:focus {
  border-color: rgb(var(--accent));
  box-shadow: 0 0 0 3px rgb(var(--focus-ring) / 0.12);
}

.primary-button {
  width: fit-content;
  padding: 9px 15px;
  border: 0;
  border-radius: 8px;
  background: rgb(var(--accent-solid));
  color: white;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-button:hover {
  background: rgb(var(--accent-solid-hover));
}

.primary-button:active {
  transform: translateY(1px);
}

.vote-thanks {
  align-items: flex-start;
  gap: 13px;
}

.vote-thanks:not([hidden]) {
  display: flex;
}

.vote-thanks > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: rgb(var(--kb-tip-bg));
  color: rgb(var(--kb-tip-border));
  font-weight: 800;
}

.vote-thanks a {
  display: inline-block;
  margin-top: 15px;
  color: rgb(var(--accent));
  font-size: 14px;
  font-weight: 700;
}

.form-error {
  color: rgb(var(--sla-breach)) !important;
}

.contact-deflect {
  margin-top: 18px;
}

.contact-form {
  display: grid;
  max-width: 640px;
  gap: 14px;
  margin-top: 24px;
}

.contact-form .field {
  display: grid;
  gap: 6px;
}

.contact-form label {
  font-size: 14px;
  font-weight: 680;
}

.contact-form label span {
  color: rgb(var(--text-tertiary));
  font-weight: 450;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 8px;
  background: rgb(var(--surface-base));
  color: rgb(var(--text-primary));
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: rgb(var(--accent));
  outline: 0;
  box-shadow: 0 0 0 3px rgb(var(--focus-ring) / 0.12);
}

.contact-form .primary-button {
  margin-top: 4px;
}

.related-articles {
  padding-top: 62px;
}

.related-articles h2 {
  margin: 0 0 20px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.related-articles__grid a {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px;
  border: 1px solid rgb(var(--border-subtle));
  border-radius: 9px;
  color: rgb(var(--text-primary));
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 130ms ease, background 130ms ease;
}

.related-articles__grid a:hover {
  border-color: rgb(var(--accent) / 0.5);
  background: rgb(var(--surface-subtle));
}

.search-dialog,
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgb(var(--text-primary));
}

.search-dialog {
  /* The height cap has to subtract the top offset, or the footer falls below the
     fold on any viewport under ~830px tall. Shared as a var so the surface agrees. */
  --search-dialog-offset: min(13vh, 110px);
  width: min(680px, calc(100% - 28px));
  max-height: min(720px, calc(100vh - var(--search-dialog-offset) - 24px));
  border-radius: 15px;
  margin-top: var(--search-dialog-offset);
  box-shadow: 0 28px 80px rgb(15 23 42 / 0.3);
}

.search-dialog::backdrop,
.lightbox::backdrop {
  background: rgb(var(--portal-overlay));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.search-dialog__surface {
  position: relative;
  display: flex;
  max-height: min(720px, calc(100vh - var(--search-dialog-offset) - 24px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 15px;
  background: rgb(var(--surface-base));
}

.search-dialog__topbar {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 0 15px 0 19px;
  border-bottom: 1px solid rgb(var(--border-subtle));
  color: rgb(var(--text-tertiary));
}

.search-dialog__input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgb(var(--text-primary));
  font-size: 18px;
  letter-spacing: -0.01em;
}

.icon-button,
.text-button {
  border: 0;
  background: transparent;
  color: rgb(var(--text-secondary));
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  font-size: 24px;
}

.icon-button:hover,
.text-button:hover {
  background: rgb(var(--surface-subtle));
  color: rgb(var(--text-primary));
}

.search-dialog__body {
  /* Yields on short viewports so the topbar+body+footer can't outgrow the cap */
  min-height: min(250px, 40vh);
  overflow-y: auto;
  padding: 15px;
}

.search-dialog__eyebrow {
  margin: 5px 8px 9px;
  color: rgb(var(--text-tertiary));
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-list {
  display: grid;
  gap: 3px;
}

.search-result {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 11px;
  border-radius: 8px;
  color: rgb(var(--text-primary));
  text-decoration: none;
}

.search-result:hover,
.search-result[aria-selected="true"] {
  background: rgb(var(--surface-subtle));
}

.search-result > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.search-result strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  color: rgb(var(--text-tertiary));
  font-size: 11px;
}

.search-result__snippet {
  display: -webkit-box;
  overflow: hidden;
  color: rgb(var(--text-secondary));
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-result mark,
.search-page mark {
  border-radius: 2px;
  background: rgb(var(--accent-soft));
  color: inherit;
}

.search-group + .search-group {
  margin-top: 16px;
}

.search-status {
  min-height: 24px;
  padding: 5px 8px 0;
  color: rgb(var(--text-tertiary));
  font-size: 12px;
}

.search-zero,
.search-error {
  display: grid;
  min-height: 230px;
  place-content: center;
  justify-items: center;
  padding: 26px;
  text-align: center;
}

.search-zero strong,
.search-error strong {
  font-size: 17px;
}

.search-zero p,
.search-error p {
  max-width: 400px;
  margin: 7px 0 18px;
  color: rgb(var(--text-secondary));
  font-size: 13px;
}

.search-zero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.search-zero__actions button,
.search-zero__actions a {
  padding: 8px 12px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 7px;
  background: rgb(var(--surface-base));
  color: rgb(var(--text-primary));
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
}

.recent-searches {
  margin-top: 18px;
}

.recent-search-button {
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgb(var(--text-secondary));
  cursor: pointer;
  text-align: left;
}

.recent-search-button:hover {
  background: rgb(var(--surface-subtle));
  color: rgb(var(--text-primary));
}

.search-dialog__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-top: 1px solid rgb(var(--border-subtle));
  background: rgb(var(--surface-subtle) / 0.55);
}

.ask-ai-row {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgb(var(--text-primary));
  cursor: pointer;
  text-align: left;
}

.ask-ai-row:hover {
  background: rgb(var(--surface-base));
}

.ask-ai-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
}

.ask-ai-row strong {
  font-size: 13px;
}

.ask-ai-row small {
  overflow: hidden;
  color: rgb(var(--text-tertiary));
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ask-ai-row__spark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgb(var(--kb-important-bg));
  color: rgb(var(--kb-important-border));
}

.search-dialog__contact {
  color: rgb(var(--text-secondary));
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.ai-answer {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: rgb(var(--surface-base));
  inset: 0;
}

.ai-answer__header {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid rgb(var(--border-subtle));
}

.ai-answer__header h2 {
  flex: 1;
  margin: 0;
  font-size: 15px;
}

.text-button {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
}

.ai-answer__content {
  overflow-y: auto;
  padding: 24px;
  color: rgb(var(--text-primary));
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.ai-answer__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 24px 18px;
}

.ai-answer__sources a {
  padding: 6px 9px;
  border: 1px solid rgb(var(--border-subtle));
  border-radius: 7px;
  color: rgb(var(--accent));
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.ai-answer__status {
  min-height: 40px;
  padding: 10px 24px;
  border-top: 1px solid rgb(var(--border-subtle));
  margin: auto 0 0;
  color: rgb(var(--text-tertiary));
  font-size: 12px;
}

.lightbox {
  width: min(1180px, calc(100% - 48px));
  height: min(860px, calc(100vh - 48px));
  overflow: visible;
}

.lightbox figure {
  display: grid;
  height: 100%;
  place-items: center;
  margin: 0;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100% - 50px);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.5);
}

.lightbox figcaption {
  min-height: 36px;
  padding: 10px 16px;
  color: white;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  z-index: 2;
  top: -4px;
  right: -4px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 50%;
  background: rgb(15 23 42 / 0.7);
  color: white;
  cursor: pointer;
  font-size: 26px;
}

.search-page header {
  padding-top: 62px;
}

.search-page__form {
  margin-top: 30px;
  margin-inline: 0;
}

.search-page__count {
  margin: 38px 0 10px;
  color: rgb(var(--text-tertiary));
  font-size: 13px;
  font-weight: 650;
}

.search-page__snippet {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state--search {
  max-width: 760px;
  margin-top: 40px;
}

.empty-state--search > div {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.not-found {
  display: grid;
  width: min(700px, calc(100% - 48px));
  min-height: calc(100vh - 180px);
  place-content: center;
  justify-items: start;
  margin-inline: auto;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(39px, 6vw, 58px);
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.not-found > p:not(.eyebrow) {
  max-width: 580px;
  margin: 20px 0 28px;
  color: rgb(var(--text-secondary));
  font-size: 17px;
}

.not-found > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer {
  border-top: 1px solid rgb(var(--border-subtle));
  background: rgb(var(--surface-base));
}

.site-footer__inner {
  min-height: 104px;
  color: rgb(var(--text-tertiary));
  font-size: 13px;
}

.site-footer__inner a {
  color: rgb(var(--text-secondary));
  font-weight: 650;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: 330px;
  padding: 10px 14px;
  border: 1px solid rgb(var(--border-strong));
  border-radius: 8px;
  background: rgb(var(--text-primary));
  box-shadow: var(--shadow-popover);
  color: rgb(var(--surface-base));
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast-region[data-visible="true"] {
  opacity: 1;
  transform: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 190px;
  }

  .article-layout__breadcrumbs {
    grid-column: 1 / -1;
  }

  .article-layout__breadcrumbs ol {
    flex-direction: row;
  }

  .article-layout__breadcrumbs li {
    display: inline-flex;
  }

  .article-layout__breadcrumbs li + li::before {
    display: inline;
  }
}

@media (max-width: 760px) {
  .site-header__inner,
  .site-footer__inner,
  .section-shell,
  .page-shell {
    width: min(100% - 32px, var(--portal-max));
  }

  .site-header__inner {
    min-height: 62px;
  }

  .header-search {
    width: 38px;
    min-width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
  }

  .header-search span,
  .header-search kbd {
    display: none;
  }

  .theme-toggle button {
    width: 27px;
    height: 27px;
  }

  .hero__inner {
    width: calc(100% - 32px);
    min-height: 390px;
    padding-block: 52px 60px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero__inner > p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-search {
    min-height: 56px;
  }

  .hero-search kbd {
    display: none;
  }

  .section-shell {
    padding-block: 62px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 12px;
  }

  .category-grid,
  .article-grid,
  .related-articles__grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 160px;
    padding: 20px;
  }

  .article-card,
  .article-card:not(:nth-child(3n + 1)) {
    min-height: 165px;
    padding: 24px 40px 24px 0;
    border-left: 0;
  }

  .category-hero {
    padding-top: 48px;
  }

  .category-hero h1,
  .search-page h1 {
    font-size: 31px;
  }

  .portal-article-page {
    padding: 0;
  }

  .article-layout {
    display: block;
    padding: 34px 20px 62px;
  }

  .article-layout .kb-article-column {
    max-width: none;
  }

  .article-layout__breadcrumbs {
    margin-bottom: 48px;
  }

  .article-toc {
    display: none;
  }

  .kb-article-title {
    font-size: 31px;
  }

  .heading-anchor {
    position: static;
    display: inline-grid;
    margin-left: 4px;
    opacity: 0.55;
    transform: none;
    vertical-align: middle;
  }

  .code-copy {
    opacity: 1;
  }

  .search-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .search-dialog__surface {
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .search-dialog__body {
    flex: 1;
  }

  .search-dialog__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .search-dialog__contact {
    padding: 8px 10px;
  }

  .lightbox {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
  }

  .lightbox__close {
    top: 4px;
    right: 4px;
  }
}

@media (max-width: 470px) {
  .brand strong {
    display: none;
  }

  .site-header__actions {
    gap: 6px;
  }

  .theme-toggle button {
    width: 25px;
  }

  .category-hero {
    display: block;
  }

  .category-hero .category-card__icon {
    margin-bottom: 18px;
  }

  .article-feedback {
    padding: 20px;
  }

  .article-feedback__buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .not-found > div,
  .empty-state--search > div {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
