:root {
  --bg: #f6f2eb;
  --bg-strong: #efe6d7;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --text: #102132;
  --muted: #5f6e80;
  --line: rgba(20, 47, 86, 0.14);
  --blue: #0f4e8a;
  --blue-deep: #0a2f57;
  --cyan: #2aa7a6;
  --gold: #ee9e38;
  --danger: #c83b52;
  --shadow: 0 22px 60px rgba(8, 21, 43, 0.12);
  --shadow-soft: 0 12px 30px rgba(8, 21, 43, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(238, 158, 56, 0.2), transparent 26%),
    radial-gradient(circle at 86% 4%, rgba(42, 167, 166, 0.18), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, #f6f2eb 44%, #f2f6fb 100%);
}

body.site-shell {
  padding-top: 0;
}

body.admin-shell {
  padding-top: 0;
  background:
    radial-gradient(circle at top left, rgba(15, 78, 138, 0.15), transparent 30%),
    radial-gradient(circle at right center, rgba(42, 167, 166, 0.12), transparent 28%),
    linear-gradient(180deg, #fffefb 0%, #f3f6fb 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  line-height: 1.12;
}

p {
  margin: 0;
  line-height: 1.6;
}

a {
  color: var(--blue);
  text-decoration: none;
}

img {
  max-width: 100%;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: rgba(18, 72, 163, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

.shell-header {
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  padding-top: 12px;
}

.shell-header__inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.shell-header--site {
  padding-top: 0;
}

.shell-header--site .shell-header__inner {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    linear-gradient(118deg, rgba(10, 47, 87, 0.97) 0%, rgba(15, 78, 138, 0.95) 44%, rgba(42, 167, 166, 0.85) 100%);
  color: #f4f8ff;
  overflow: visible;
  position: relative;
}

.shell-header--site .shell-header__inner::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 221, 170, 0.75) 0%, rgba(255, 255, 255, 0.2) 40%, rgba(117, 240, 230, 0.72) 100%);
}

.shell-header--admin .shell-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px 22px;
}

.site-hero-bar {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 26px 10px;
}

.site-hero-bar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: 360px;
}

.site-hero-bar__meta span,
.site-hero-bar__meta a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #f4f8ff;
  font-size: 13px;
  font-weight: 700;
}

.brand {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.brand__logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.34);
  box-shadow: 0 12px 22px rgba(4, 14, 28, 0.25);
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 62px;
  padding: 0 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  color: white;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.brand__mark--site {
  min-width: 76px;
  height: 76px;
  background: linear-gradient(145deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 1.05rem;
}

.brand__content {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.brand__content strong {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.15;
}

.brand__content small {
  color: var(--muted);
  font-size: clamp(0.94rem, 1.35vw, 1.08rem);
  line-height: 1.3;
}

.brand--site .brand__content strong,
.brand--site .brand__content small {
  color: #f4f8ff;
}

.shell-nav,
.site-nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shell-nav a,
.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.2s ease;
}

.shell-nav a {
  color: var(--text);
}

.shell-nav a:hover,
.shell-nav a.active {
  background: rgba(18, 72, 163, 0.08);
  color: var(--blue);
}

.site-nav {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 20px 12px;
  position: relative;
  z-index: 20;
}

.site-nav__toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 20px;
  color: #f4f8ff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 18px 28px rgba(4, 18, 38, 0.18);
}

.site-nav__toggle-label {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav__toggle-icon {
  display: grid;
  gap: 4px;
}

.site-nav__toggle-icon span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.site-nav__item {
  position: relative;
  list-style: none;
}

.site-nav__entry {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.site-nav__link {
  color: white;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.1);
}

.site-nav__entry > .site-nav__link {
  flex: 1 1 auto;
  min-width: 0;
}

.site-nav__expander {
  display: none;
  flex: 0 0 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  color: white;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: none;
}

.site-nav__expander:hover {
  background: rgba(255,255,255,0.22);
}

.site-nav__expander-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.22s ease;
}

.site-nav__link:hover,
.site-nav__link.active,
.site-nav__item:hover > .site-nav__link {
  background: rgba(255,255,255,0.22);
  color: white;
}

.site-nav__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin: 0;
  list-style: none;
  border-radius: 18px;
  background: rgba(7, 23, 45, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.24);
  z-index: 30;
}

.site-nav__submenu .site-nav__submenu {
  top: 0;
  left: 100%;
}

.site-nav__item:hover > .site-nav__submenu {
  display: flex;
}

.site-nav__submenu .site-nav__link {
  width: 100%;
  min-height: 40px;
  justify-content: space-between;
  border-radius: 12px;
  background: transparent;
}

.site-nav__submenu .site-nav__link:hover,
.site-nav__submenu .site-nav__link.active {
  background: rgba(255,255,255,0.08);
}

.site-nav__toggle:focus-visible,
.site-nav__expander:focus-visible,
.site-nav__link:focus-visible {
  outline: 2px solid rgba(255,255,255,0.78);
  outline-offset: 2px;
}

.site-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
}

.site-search input {
  min-width: 220px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.98);
  color: #10213b;
}

.site-search button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(12, 61, 108, 0.95) 0%, rgba(20, 129, 146, 0.92) 100%);
  color: #f6fbff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px rgba(8, 34, 62, 0.28);
}

.site-search button:hover {
  background: linear-gradient(135deg, rgba(15, 78, 138, 0.98) 0%, rgba(39, 166, 173, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.5);
}

.site-search button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 1px;
}

.bvi-toggle {
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.24);
  color: #f4f8ff;
}

.bvi-toggle:hover {
  background: rgba(255, 255, 255, 0.34);
}

.bvi2-panel {
  position: sticky;
  top: 0;
  z-index: 120;
  width: 100%;
  background: #ececec;
  border-top: 1px solid #c8c8c8;
  border-bottom: 1px solid #c8c8c8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 10px 16px;
}

.bvi2-panel[hidden] {
  display: none;
}

.bvi2-panel__row {
  width: min(1280px, calc(100% - 8px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 18px;
}

.bvi2-group {
  display: grid;
  gap: 6px;
}

.bvi2-group__title {
  margin: 0;
  color: #101010;
  font-size: 14px;
  font-weight: 800;
}

.bvi2-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bvi2-btn {
  min-height: 34px;
  min-width: 40px;
  padding: 0 10px;
  border: 1px solid #b9b9b9;
  border-radius: 4px;
  background: #dedede;
  color: #1b1b1b;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.bvi2-btn:hover {
  background: #d2d2d2;
}

.bvi2-btn.is-active {
  border-color: #141414;
  background: #131313;
  color: #f2f2f2;
}

.bvi2-btn--theme-white {
  background: #ffffff;
}

.bvi2-btn--theme-black {
  background: #050505;
  color: #ffffff;
}

.bvi2-btn--theme-blue {
  background: #8fc8f5;
}

.bvi2-btn--theme-beige {
  background: #e7e0b8;
}

.bvi2-btn--theme-green {
  background: #403015;
  color: #d2ff8f;
}

.bvi2-btn--wide {
  min-width: 170px;
}

body.site-shell.bvi2-active .shell-header--site .shell-header__inner,
body.site-shell.bvi2-active .shell-footer__inner--site {
  background: #ececec;
  color: #111;
}

body.site-shell.bvi2-active .shell-header--site .shell-header__inner::after {
  display: none;
}

body.site-shell.bvi2-active .site-nav__link,
body.site-shell.bvi2-active .site-nav__toggle,
body.site-shell.bvi2-active .site-nav__expander,
body.site-shell.bvi2-active .site-nav__submenu,
body.site-shell.bvi2-active .site-search,
body.site-shell.bvi2-active .site-search input,
body.site-shell.bvi2-active .site-search button,
body.site-shell.bvi2-active .surface,
body.site-shell.bvi2-active .sidebar-card,
body.site-shell.bvi2-active .right-item,
body.site-shell.bvi2-active .doc-item,
body.site-shell.bvi2-active .stack-link,
body.site-shell.bvi2-active .shell-footer__inner--site {
  background: #fff !important;
  color: #111 !important;
  border-color: #777 !important;
  box-shadow: none !important;
}

body.site-shell.bvi2-active .site-search button,
body.site-shell.bvi2-active .bvi-toggle {
  background: #dfdfdf !important;
  color: #111 !important;
}

body.site-shell.bvi2-active a {
  color: #0f2f8f !important;
}

body.site-shell.bvi2-theme-black,
body.site-shell.bvi2-theme-black .surface,
body.site-shell.bvi2-theme-black .sidebar-card,
body.site-shell.bvi2-theme-black .right-item,
body.site-shell.bvi2-theme-black .stack-link,
body.site-shell.bvi2-theme-black .doc-item,
body.site-shell.bvi2-theme-black .site-nav__toggle,
body.site-shell.bvi2-theme-black .site-nav__expander,
body.site-shell.bvi2-theme-black .site-nav__submenu,
body.site-shell.bvi2-theme-black .shell-header--site .shell-header__inner,
body.site-shell.bvi2-theme-black .shell-footer__inner--site {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.site-shell.bvi2-theme-black a,
body.site-shell.bvi2-theme-black .site-nav__link,
body.site-shell.bvi2-theme-black .site-nav__toggle,
body.site-shell.bvi2-theme-black .site-nav__expander {
  color: #ffef83 !important;
}

body.site-shell.bvi2-theme-blue,
body.site-shell.bvi2-theme-blue .surface,
body.site-shell.bvi2-theme-blue .sidebar-card,
body.site-shell.bvi2-theme-blue .right-item,
body.site-shell.bvi2-theme-blue .stack-link,
body.site-shell.bvi2-theme-blue .doc-item,
body.site-shell.bvi2-theme-blue .site-nav__toggle,
body.site-shell.bvi2-theme-blue .site-nav__expander,
body.site-shell.bvi2-theme-blue .site-nav__submenu,
body.site-shell.bvi2-theme-blue .shell-header--site .shell-header__inner,
body.site-shell.bvi2-theme-blue .shell-footer__inner--site {
  background: #9dd4fb !important;
  color: #102640 !important;
  border-color: #285784 !important;
}

body.site-shell.bvi2-theme-blue a,
body.site-shell.bvi2-theme-blue .site-nav__link,
body.site-shell.bvi2-theme-blue .site-nav__toggle,
body.site-shell.bvi2-theme-blue .site-nav__expander {
  color: #0a355f !important;
}

body.site-shell.bvi2-theme-beige,
body.site-shell.bvi2-theme-beige .surface,
body.site-shell.bvi2-theme-beige .sidebar-card,
body.site-shell.bvi2-theme-beige .right-item,
body.site-shell.bvi2-theme-beige .stack-link,
body.site-shell.bvi2-theme-beige .doc-item,
body.site-shell.bvi2-theme-beige .site-nav__toggle,
body.site-shell.bvi2-theme-beige .site-nav__expander,
body.site-shell.bvi2-theme-beige .site-nav__submenu,
body.site-shell.bvi2-theme-beige .shell-header--site .shell-header__inner,
body.site-shell.bvi2-theme-beige .shell-footer__inner--site {
  background: #f5ebc6 !important;
  color: #402e13 !important;
  border-color: #7e6742 !important;
}

body.site-shell.bvi2-theme-beige a,
body.site-shell.bvi2-theme-beige .site-nav__link,
body.site-shell.bvi2-theme-beige .site-nav__toggle,
body.site-shell.bvi2-theme-beige .site-nav__expander {
  color: #5d3b12 !important;
}

body.site-shell.bvi2-theme-green,
body.site-shell.bvi2-theme-green .surface,
body.site-shell.bvi2-theme-green .sidebar-card,
body.site-shell.bvi2-theme-green .right-item,
body.site-shell.bvi2-theme-green .stack-link,
body.site-shell.bvi2-theme-green .doc-item,
body.site-shell.bvi2-theme-green .site-nav__toggle,
body.site-shell.bvi2-theme-green .site-nav__expander,
body.site-shell.bvi2-theme-green .site-nav__submenu,
body.site-shell.bvi2-theme-green .shell-header--site .shell-header__inner,
body.site-shell.bvi2-theme-green .shell-footer__inner--site {
  background: #292011 !important;
  color: #ddff9b !important;
  border-color: #d5f593 !important;
}

body.site-shell.bvi2-theme-green a,
body.site-shell.bvi2-theme-green .site-nav__link,
body.site-shell.bvi2-theme-green .site-nav__toggle,
body.site-shell.bvi2-theme-green .site-nav__expander {
  color: #ddff9b !important;
}

body.site-shell.bvi2-images-off .shell-main img,
body.site-shell.bvi2-images-off .site-nav img {
  visibility: hidden !important;
}

body.site-shell.bvi2-images-gray img {
  filter: grayscale(1) contrast(1.08);
}

.shell-main {
  width: min(1280px, calc(100% - 32px));
  margin: 26px auto 54px;
}

.shell-main--site {
  display: grid;
  gap: 22px;
}

.shell-main--center {
  margin-left: auto;
  margin-right: auto;
}

.shell-main--docs-left {
  margin-left: 16px;
  margin-right: auto;
}

.shell-main--admin {
  width: min(1180px, calc(100% - 32px));
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 22px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(18, 72, 163, 0.98) 0%, rgba(10, 47, 115, 0.98) 40%, rgba(57, 198, 199, 0.9) 100%);
  color: white;
  box-shadow: var(--shadow);
}

.page-hero__content,
.page-hero__aside {
  display: grid;
  gap: 18px;
}

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-hero__lead {
  max-width: 760px;
  color: rgba(255,255,255,0.86);
  font-size: 1.04rem;
}

.stats-grid,
.feature-grid,
.admin-stats,
.content-grid,
.docs-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-grid,
.admin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
  align-items: start;
}

.content-grid--with-left-nav {
  grid-template-columns: minmax(0, 2.15fr) minmax(240px, 0.85fr);
}

.content-grid--with-left-nav .page-body {
  grid-column: 1;
  grid-row: 1;
}

.content-grid--with-left-nav .page-sidebar {
  grid-column: 2;
  grid-row: 1;
}

.content-grid > * {
  min-width: 0;
}

.docs-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.surface,
.metric-card,
.feature-card,
.docs-card,
.table-card,
.auth-card,
.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

.surface,
.table-card,
.auth-card,
.form-card,
.docs-card {
  padding: 24px;
}

.metric-card,
.feature-card {
  padding: 20px;
}

.metric-card {
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(243,248,255,0.9) 100%);
}

.metric-card__value {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.65rem;
  color: var(--blue-deep);
}

.metric-card__label,
.meta-note,
.card-subtitle,
.field-help,
.table-meta,
.shell-footer p,
.shell-footer span,
.shell-footer a,
.muted {
  color: var(--muted);
}

.feature-card {
  display: grid;
  gap: 10px;
}

.feature-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill,
.status-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill,
.meta-pill {
  background: rgba(18, 72, 163, 0.08);
  color: var(--blue);
}

.status-pill--success {
  background: rgba(37, 171, 115, 0.14);
  color: #137047;
}

.status-pill--draft {
  background: rgba(255, 182, 72, 0.18);
  color: #9b5d00;
}

.page-body,
.page-sidebar,
.docs-toolbar,
.form-layout,
.auth-layout {
  display: grid;
  gap: 18px;
}

.home-intro {
  display: grid;
  gap: 10px;
}

.home-intro h1 {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  color: var(--blue-deep);
}

.home-intro p {
  color: var(--muted);
  max-width: 980px;
}

.home-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.home-columns > * {
  min-width: 0;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 2.6fr) minmax(220px, 0.7fr);
  gap: 20px;
  align-items: start;
}

.home-layout > * {
  min-width: 0;
}

.home-layout__left,
.home-layout__right {
  display: grid;
  gap: 18px;
}

.home-layout__center {
  align-self: stretch;
}

.column-right {
  display: grid;
  gap: 18px;
}

.right-item {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(248,251,255,0.92) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.head-column {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--blue-deep);
}

.head-r {
  margin: 0;
}

.documents {
  display: grid;
  gap: 10px;
}

.doc-item {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(18, 72, 163, 0.1);
  background: rgba(255, 255, 255, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.doc-item img {
  display: block;
  width: 100%;
  height: auto;
}

.doc-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 34, 73, 0.14);
  border-color: rgba(18, 72, 163, 0.18);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 14, 31, 0.82);
  z-index: 9999;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #10213b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.page-body,
.page-sidebar {
  min-width: 0;
}

.page-body article {
  display: grid;
  gap: 18px;
}

.prose {
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  color: var(--text);
}

.prose,
.prose p,
.prose div,
.prose span,
.prose li,
.prose td,
.prose th,
.prose a {
  font-family: 'Manrope', sans-serif !important;
  font-size: 1rem;
  line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin-top: 1.2em;
  margin-bottom: 0.55em;
  color: var(--blue-deep);
}

.prose img,
.prose table,
.prose iframe {
  max-width: 100%;
}

.prose img,
.prose video,
.prose embed,
.prose object {
  height: auto;
}

.prose iframe {
  width: 100%;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose table[style*='width'] {
  width: 100% !important;
  max-width: 100% !important;
}

.prose pre {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  margin: 0 0 1em;
  padding: 0;
  background: transparent;
  font: inherit;
}

.prose > :first-child {
  margin-top: 0 !important;
}

.prose td,
.prose th {
  word-break: break-word;
}

.prose [style*='overflow'] {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

.prose [style*='max-height'] {
  max-height: none !important;
}

.prose table[style*='height'] {
  height: auto !important;
}

.prose :not(img):not(svg):not(video):not(iframe)[style*='height'] {
  height: auto !important;
}

.sidebar-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(248,251,255,0.93) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.sidebar-nav-card {
  gap: 16px;
}

.sidebar-nav-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-nav-card__title {
  margin: 0;
}

.sidebar-nav-card__body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.sidebar-nav-card__toggle,
.sidebar-nav__expander {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(18, 72, 163, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: var(--blue-deep);
  box-shadow: none;
}

.sidebar-nav-card__toggle {
  white-space: nowrap;
}

.sidebar-nav-card__toggle-label {
  font-weight: 800;
}

.sidebar-nav__expander {
  min-width: 44px;
  padding: 0;
  flex: 0 0 44px;
}

.sidebar-nav-card__toggle-icon,
.sidebar-nav__expander-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.sidebar-nav-card.is-open .sidebar-nav-card__toggle-icon,
.sidebar-nav__item.is-open > .sidebar-nav__entry .sidebar-nav__expander-icon {
  transform: rotate(225deg) translateY(-1px);
}

.stack-list {
  display: grid;
  gap: 10px;
}

.sidebar-nav__item,
.sidebar-nav__entry {
  display: grid;
  gap: 8px;
}

.sidebar-nav__entry {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.sidebar-nav__list,
.sidebar-nav__sublist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.sidebar-nav__sublist {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid rgba(18, 72, 163, 0.16);
}

.sidebar-nav__link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 72, 163, 0.08);
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar-nav__link:hover,
.sidebar-nav__link.active {
  color: var(--blue-deep);
  background: rgba(18, 72, 163, 0.1);
  border-color: rgba(18, 72, 163, 0.2);
}

.stack-link,
.doc-tile {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: white;
  border: 1px solid rgba(18, 72, 163, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.stack-link:hover,
.doc-tile:hover,
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(10, 26, 49, 0.14);
  border-color: rgba(18, 72, 163, 0.16);
}

.stack-link strong,
.doc-tile strong {
  color: var(--text);
}

.news-item time,
.doc-tile span {
  font-size: 0.85rem;
  color: var(--muted);
}

.docs-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.search-form,
.stack-form,
.auth-form {
  display: grid;
  gap: 16px;
}

.search-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

label,
.field-label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.editor-field {
  align-items: stretch;
}

.editor-field > span {
  display: block;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(18, 72, 163, 0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.94);
  font: inherit;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

/* Исключаем textarea редакторов из общих правил */
.editor-code {
  min-height: auto !important;
  resize: none !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(18, 72, 163, 0.45);
  box-shadow: 0 0 0 4px rgba(18, 72, 163, 0.12);
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.inline-check input {
  width: auto;
  min-height: auto;
  box-shadow: none;
}

.btn,
button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
button:hover,
.button-link:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, #0f4e8a 0%, #2aa7a6 100%);
  box-shadow: 0 14px 24px rgba(10, 47, 87, 0.25);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
}

.btn-danger,
.inline-form button {
  color: white;
  background: linear-gradient(135deg, #d45168 0%, #b7233f 100%);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(18, 72, 163, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inline-form {
  display: inline-flex;
  margin-left: 8px;
}

.actions-row .inline-form {
  margin-left: 0;
}

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(200, 59, 82, 0.18);
  background: rgba(200, 59, 82, 0.08);
  color: #91273a;
}

.alert--success {
  border-color: rgba(35, 138, 92, 0.18);
  background: rgba(35, 138, 92, 0.1);
  color: #1b6d46;
}

.auth-layout {
  place-items: center;
  min-height: calc(100vh - 220px);
}

.auth-card {
  width: min(520px, 100%);
  display: grid;
  gap: 20px;
}

.stack-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  border-left: 3px solid var(--cyan);
}

.stack-item strong {
  display: block;
  font-size: 13px;
  color: var(--blue);
  margin-bottom: 4px;
}

.stack-item p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-card__header {
  display: grid;
  gap: 10px;
}

.form-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.7fr);
  align-items: start;
}

.form-layout > aside {
  grid-column: 1 / -1;
}

.editor-frame {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.editor-frame .stack-form,
.editor-frame label,
.editor-frame .page-editor,
.editor-frame .page-editor > *,
.editor-frame .page-editor__toolbar,
.editor-frame .page-editor__visual,
.editor-frame .page-editor__code {
  min-width: 0;
}

.page-editor {
  display: grid;
  gap: 10px;
}

.page-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(18, 72, 163, 0.16);
  background: rgba(246, 250, 255, 0.86);
  overflow-x: auto;
}

.page-editor__toolbar .btn {
  min-height: 36px;
  padding: 0 12px;
}

.page-editor__visual,
.page-editor__code {
  width: 100%;
  max-width: 100%;
  min-height: 640px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(18, 72, 163, 0.2);
  background: rgba(255,255,255,0.98);
  font: inherit;
  color: var(--text);
}

.page-editor__visual {
  overflow: auto;
}

.page-editor__code {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.page-editor__visual img,
.page-editor__visual iframe,
.page-editor__visual table,
.page-editor__code table {
  max-width: 100%;
}

.page-editor__visual table,
.page-editor__code table {
  display: block;
  overflow-x: auto;
}

.page-editor__visual:focus,
.page-editor__code:focus {
  outline: none;
  border-color: rgba(18, 72, 163, 0.45);
  box-shadow: 0 0 0 4px rgba(18, 72, 163, 0.12);
}

.shell-footer {
  margin-top: 20px;
}

.shell-footer__inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 26px;
  padding: 18px 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shell-footer__inner--site {
  background: linear-gradient(118deg, rgba(10, 47, 87, 0.95) 0%, rgba(15, 78, 138, 0.92) 56%, rgba(42, 167, 166, 0.82) 100%);
  color: #e7efff;
  border-color: rgba(255,255,255,0.08);
}

.shell-footer__about,
.shell-footer__contact,
.shell-footer__meta {
  display: grid;
  gap: 6px;
}

.shell-footer__meta {
  text-align: right;
}

.shell-footer--site .shell-footer__about p,
.shell-footer--site .shell-footer__contact span,
.shell-footer--site .shell-footer__contact a,
.shell-footer--site .shell-footer__meta span {
  color: rgba(231, 239, 255, 0.82);
}

body.site-shell .reveal,
body.site-shell .reveal.visible {
  opacity: 1;
  transform: none;
}

.search-summary,
.search-group {
  display: grid;
  gap: 12px;
}

@media (max-width: 1120px) {
  .page-hero,
  .content-grid,
  .home-columns,
  .home-layout,
  .form-layout,
  .feature-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-hero-bar,
  .shell-header--admin .shell-header__inner,
  .shell-footer__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .brand__logo {
    width: 78px;
    height: 78px;
  }

  .brand__content strong {
    font-size: 1.14rem;
  }

  .brand__content small {
    font-size: 0.92rem;
  }

  .site-search {
    width: 100%;
  }

  .site-hero-bar__meta {
    max-width: 100%;
  }

  .site-search input {
    min-width: 0;
    width: 100%;
  }

  .site-hero-bar__meta,
  .shell-footer__meta {
    justify-content: flex-start;
    text-align: left;
  }

  .bvi2-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  body.site-shell {
    padding-top: 0;
  }

  body.admin-shell {
    padding-top: 0;
  }

  .shell-header__inner,
  .shell-main,
  .shell-footer__inner {
    width: min(100% - 20px, 1280px);
  }

  .shell-main--docs-left {
    margin-left: auto;
  }

  .shell-nav {
    gap: 8px;
  }

  .site-nav {
    padding: 0 20px 16px;
  }

  .site-nav__toggle {
    display: inline-flex;
  }

  .site-nav__list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 12px;
  }

  .site-nav.site-nav--open .site-nav__list {
    display: flex;
  }

  .site-nav.site-nav--open .site-nav__toggle-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .site-nav.site-nav--open .site-nav__toggle-icon span:nth-child(2) {
    opacity: 0;
  }

  .site-nav.site-nav--open .site-nav__toggle-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .site-nav__item,
  .site-nav__entry {
    width: 100%;
  }

  .site-nav__entry {
    align-items: stretch;
  }

  .site-nav__entry > .site-nav__link {
    justify-content: flex-start;
    border-radius: 18px;
    padding-right: 16px;
  }

  .site-nav__expander {
    display: inline-flex;
  }

  .site-nav__submenu,
  .site-nav__submenu .site-nav__submenu {
    position: static;
    display: none;
    min-width: 100%;
    margin-top: 8px;
    padding: 8px 0 0 14px;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(255,255,255,0.18);
    box-shadow: none;
  }

  .site-nav__submenu .site-nav__submenu {
    padding-left: 12px;
  }

  .site-nav__item:hover > .site-nav__submenu {
    display: none;
  }

  .site-nav__item.is-open > .site-nav__submenu {
    display: grid;
  }

  .site-nav__item.is-open > .site-nav__entry .site-nav__expander-icon {
    transform: rotate(225deg) translateY(-1px);
  }

  .site-nav__submenu .site-nav__link {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
  }

  .content-grid--with-left-nav .page-sidebar {
    grid-column: 1;
    grid-row: 1;
  }

  .content-grid--with-left-nav .page-body {
    grid-column: 1;
    grid-row: 2;
    margin-top: 4px;
  }

  .sidebar-nav-card__head {
    align-items: flex-start;
  }

  body.js-ready .sidebar-nav-card__toggle {
    display: inline-flex;
    justify-content: space-between;
    width: 100%;
  }

  body.js-ready .sidebar-nav-card__body {
    display: none;
  }

  body.js-ready .sidebar-nav-card.is-open .sidebar-nav-card__body {
    display: grid;
  }

  body.js-ready .sidebar-nav__expander {
    display: inline-flex;
  }

  body.js-ready .sidebar-nav__sublist {
    display: none;
    margin-top: 10px;
    padding-left: 12px;
  }

  body.js-ready .sidebar-nav__item.is-open > .sidebar-nav__sublist {
    display: grid;
  }

  .sidebar-nav__entry > .sidebar-nav__link {
    padding-right: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .search-form,
  .actions-row,
  .hero-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}
