@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700&display=swap');

:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: rgba(14, 15, 28, 0.82);
  --panel-solid: #111225;
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(177, 181, 255, 0.12);
  --line-strong: rgba(191, 195, 255, 0.2);
  --text: #f5f7fb;
  --muted: #b8bad7;
  --dim: #8589b4;
  --brand: #595999;
  --brand-2: #7878d5;
  --brand-3: #9ba2ff;
  --cyan: #75d7ff;
  --blue: #7878d5;
  --blue-soft: rgba(89, 89, 153, 0.22);
  --code: #242642;
  --shadow: 0 26px 80px rgba(9, 10, 24, 0.44);
  --rail-width: 52px;
  --wiki-sidebar-width: 252px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --theme-overlay: rgba(255, 255, 255, 0);
  font-family: "Comfortaa", sans-serif;
}

body.light-theme {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-soft: rgba(20, 32, 48, 0.055);
  --line: rgba(70, 75, 130, 0.14);
  --line-strong: rgba(70, 75, 130, 0.22);
  --text: #111827;
  --muted: #5f6878;
  --dim: #778194;
  --brand: #595999;
  --brand-2: #6868be;
  --brand-3: #7a81de;
  --cyan: #328fbd;
  --blue: #595999;
  --blue-soft: rgba(89, 89, 153, 0.13);
  --code: #e6ebf2;
  --shadow: 0 22px 70px rgba(35, 45, 60, 0.18);
  --theme-overlay: rgba(255, 255, 255, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #0c0e16 0%, #090b12 36%, #08090c 100%);
  color: var(--text);
  transition: background-color 360ms ease, color 360ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -8%, rgba(117, 215, 255, 0.24), transparent 24rem),
    radial-gradient(circle at 50% 0%, rgba(89, 89, 153, 0.26), transparent 14rem);
  opacity: 0.88;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--theme-overlay);
  opacity: 0;
  pointer-events: none;
}

body.theme-animating::after {
  animation: theme-fade 520ms var(--ease-out);
}

@keyframes theme-fade {
  0% {
    opacity: 0;
  }

  38% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

body.light-theme {
  background: linear-gradient(180deg, #f6f8fc 0%, #eef2f7 42%, #e9edf5 100%);
}

body.light-theme::before {
  background:
    radial-gradient(circle at 50% -8%, rgba(89, 89, 153, 0.16), transparent 24rem),
    radial-gradient(circle at 50% 0%, rgba(117, 215, 255, 0.14), transparent 14rem);
}

body.rail-open {
  --rail-width: 220px;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  color: currentColor;
  transition: color 260ms ease, stroke 260ms ease;
}

.app {
  display: grid;
  grid-template-columns: var(--rail-width) 252px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 420ms var(--ease-out);
}

.quick-rail,
.sidebar,
.topbar,
.connect-card,
.code-copy,
.user-drawer,
.notifications-popover,
.search input,
.icon-btn,
.rail-link,
.nav-item,
.nav-head,
.primary-action,
.secondary-action {
  transition:
    background-color 320ms ease,
    background 320ms ease,
    border-color 320ms ease,
    box-shadow 320ms ease,
    color 260ms ease,
    transform 240ms var(--ease-out);
}

.quick-rail,
.sidebar,
.topbar {
  backdrop-filter: blur(18px);
}

.quick-rail {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  padding: 28px 8px 12px;
  border-right: 1px solid var(--line);
  background: rgba(10, 11, 13, 0.86);
  transition: box-shadow 420ms var(--ease-out), background 260ms ease;
}

body.light-theme .quick-rail,
body.light-theme .sidebar,
body.light-theme .topbar {
  background: rgba(255, 255, 255, 0.86);
}

body.light-theme .rail-link,
body.light-theme .nav-item,
body.light-theme .nav-head,
body.light-theme .toc a,
body.light-theme .requirements li,
body.light-theme .command-list,
body.light-theme .icon-btn {
  color: var(--text);
}

body.light-theme p,
body.light-theme .note,
body.light-theme .field-label,
body.light-theme .copy-row,
body.light-theme .user-drawer h2 {
  color: var(--text);
}

body.light-theme .search input,
body.light-theme .icon-btn,
body.light-theme .rail-toggle,
body.light-theme .secondary-action,
body.light-theme .notice-clear {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(242, 244, 255, 0.66)),
    rgba(255, 255, 255, 0.62);
  color: var(--text);
}

body.light-theme .connect-card,
body.light-theme .code-copy {
  background:
    radial-gradient(circle at 0% 0%, rgba(89, 89, 153, 0.13), transparent 36%),
    radial-gradient(circle at 100% 100%, rgba(117, 215, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 253, 0.76)),
    #fff;
  border-color: rgba(30, 64, 120, 0.13);
}

body.light-theme .copy-row {
  background: transparent;
}

body.light-theme code {
  color: #172033;
}

body.light-theme .copy-icon {
  background: rgba(89, 89, 153, 0.1);
  border-color: rgba(89, 89, 153, 0.22);
  color: var(--brand);
}

body.light-theme .command-list a {
  color: var(--brand);
}

body.light-theme .command-list a:hover {
  color: #42427c;
}

body.light-theme .command-list li {
  background:
    radial-gradient(circle at 0% 0%, rgba(89, 89, 153, 0.09), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 253, 0.82));
  border-color: rgba(89, 89, 153, 0.13);
}

body.light-theme .rail-link:hover,
body.light-theme .rail-link.active,
body.light-theme .nav-item:hover,
body.light-theme .nav-head:hover,
body.light-theme .nav-item.active {
  color: #0f172a;
}

body.rail-open .quick-rail {
  box-shadow: 22px 0 70px rgba(0, 0, 0, 0.38);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  border: 1px solid rgba(155, 162, 255, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(89, 89, 153, 0.24);
  box-shadow: 0 14px 32px rgba(89, 89, 153, 0.3), inset 0 1px rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

body.light-theme .brand-mark {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 242, 255, 0.72)),
    rgba(89, 89, 153, 0.12);
}

body.light-theme .brand-mark::before {
  content: none;
}

.brand-mark::before {
  content: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  image-rendering: pixelated;
}

.rail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 1px 18px auto;
  padding: 0;
  border: 1px solid rgba(155, 162, 255, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(155, 162, 255, 0.18), rgba(89, 89, 153, 0.08)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 14px 34px rgba(89, 89, 153, 0.22);
  cursor: pointer;
  overflow: hidden;
  transition: width 420ms var(--ease-out), transform 240ms var(--ease-out), border-color 180ms ease, background 180ms ease;
}

.rail-toggle::after {
  content: "Свернуть";
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: max-width 420ms var(--ease-out), opacity 220ms ease;
}

body.rail-open .rail-toggle {
  justify-content: flex-start;
  width: 100%;
  gap: 10px;
  padding: 0 10px;
}

body.rail-open .rail-toggle::after {
  max-width: 92px;
  opacity: 1;
}

.rail-toggle:hover {
  border-color: rgba(117, 215, 255, 0.5);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

body.rail-open .rail-toggle:hover {
  transform: translateY(-1px);
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.rail-nav-bottom {
  margin-top: auto;
}

.rail-link {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #c7ccd6;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, transform 420ms var(--ease-out);
}

.rail-link svg,
.rail-toggle svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.rail-link svg {
  justify-self: center;
}

.rail-link span {
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: max-width 420ms var(--ease-out), opacity 260ms ease, transform 360ms var(--ease-out);
}

body.rail-open .rail-link span {
  max-width: 150px;
  opacity: 1;
  transform: translateX(0);
}

.rail-link:hover,
.rail-link.active {
  border-color: rgba(155, 162, 255, 0.24);
  background: rgba(155, 162, 255, 0.09);
  color: #fff;
}

.rail-link.active {
  border-color: rgba(117, 215, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(89, 89, 153, 0.45), rgba(117, 215, 255, 0.12)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 3px 0 0 var(--cyan), 0 12px 30px rgba(89, 89, 153, 0.2);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 100vh;
  padding: 34px 16px 14px 22px;
  border-right: 1px solid var(--line);
  background: rgba(12, 13, 16, 0.76);
  transition: transform 420ms var(--ease-out), background 260ms ease;
}

.wiki-title {
  margin: 0 0 36px;
  font-size: 18px;
  font-weight: 850;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.nav-head {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #f0f2f6;
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.15;
  cursor: pointer;
}

.nav-item,
.nav-head span {
  gap: 10px;
}

.nav-head {
  justify-content: space-between;
}

.nav-head span,
.nav-item {
  display: flex;
  align-items: center;
}

.nav-item svg,
.nav-head svg,
.requirements svg,
.drawer-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.nav-item:hover,
.nav-head:hover {
  border-color: rgba(155, 162, 255, 0.18);
  background: rgba(155, 162, 255, 0.075);
}

.nav-item.active {
  border-color: rgba(117, 215, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(89, 89, 153, 0.42), rgba(117, 215, 255, 0.11)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 3px 0 0 var(--cyan), 0 14px 34px rgba(89, 89, 153, 0.2);
}

.nav-chevron {
  transition: transform 160ms ease;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.subnav {
  display: grid;
  gap: 2px;
  max-height: 0;
  margin: 0 0 0 31px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  overflow: hidden;
  opacity: 0;
  transition: max-height 180ms ease, opacity 160ms ease, margin 180ms ease;
}

.nav-group.open .subnav {
  max-height: 170px;
  margin-bottom: 8px;
  opacity: 1;
}

.subnav a {
  padding: 7px 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.subnav a:hover {
  color: #fff;
}

.updated {
  position: absolute;
  bottom: 14px;
  left: 34px;
  color: var(--dim);
  font-size: 12px;
}

.page {
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 78px;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 13, 0.78);
}

.mobile-brand {
  display: none;
  font-weight: 850;
}

.search {
  position: fixed;
  left: calc(50vw - var(--rail-width) - var(--wiki-sidebar-width));
  top: 18px;
  z-index: 9;
  display: block;
  width: clamp(420px, 46vw, 820px);
  transform: translateX(-50%);
}

.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: #9ea4af;
  transform: translateY(-50%);
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 18px 0 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  outline: none;
  background:
    linear-gradient(180deg, rgba(155, 162, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(14, 15, 28, 0.9);
  color: #eef2f8;
  box-shadow: 0 16px 38px rgba(9, 10, 24, 0.22), inset 0 1px rgba(255, 255, 255, 0.08);
}

.search input:focus {
  border-color: rgba(117, 215, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(89, 89, 153, 0.2), 0 18px 44px rgba(9, 10, 24, 0.24);
}

.toolbar {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #c7ccd6;
  cursor: pointer;
}

.icon-btn:hover,
.icon-btn[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

.dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 8px;
  height: 8px;
  border: 2px solid #101116;
  border-radius: 999px;
  background: #ff4d5d;
  transition: opacity 180ms ease, transform 180ms ease;
}

body.notifications-read .dot {
  opacity: 0;
  transform: scale(0);
}

.notifications-popover {
  position: absolute;
  top: 48px;
  right: 44px;
  z-index: 20;
  width: 316px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(15, 17, 22, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 180ms ease, transform 280ms var(--ease-out);
}

body.light-theme .notifications-popover {
  background: rgba(255, 255, 255, 0.96);
}

body.notifications-open .notifications-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 10px;
  font-size: 14px;
  font-weight: 850;
}

.popover-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notice-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 11px 8px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}

.notice-item:hover {
  background: var(--panel-soft);
}

.notice-item svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: #72b2ff;
}

.notice-clear {
  width: 100%;
  height: 34px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  justify-content: center;
  gap: 48px;
  width: 100%;
  padding: 34px 40px 28px;
}

main {
  min-width: 0;
}

h1 {
  max-width: 1320px;
  margin: 0 0 22px;
  font-size: clamp(38px, 2.8vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: #f0f2f5;
  font-size: 15px;
  line-height: 1.55;
}

.hero {
  width: 100%;
  aspect-ratio: 1600 / 574;
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #20242b;
  box-shadow: var(--shadow);
}

.hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro {
  margin-bottom: 34px;
}

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

.section {
  min-width: 0;
  scroll-margin-top: 96px;
  padding: 4px 0;
}

.section h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section h2::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-3), var(--cyan));
  box-shadow: 0 0 0 6px rgba(89, 89, 153, 0.12);
}

.section:target h2::before {
  box-shadow: 0 0 0 6px rgba(117, 215, 255, 0.18);
}

.requirements {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.requirements li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #f4f6fb;
  font-size: 15px;
  line-height: 1.35;
}

.requirements b {
  font-weight: 800;
}

.connect-card {
  overflow: hidden;
  border: 1px solid rgba(126, 150, 180, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(117, 215, 255, 0.16), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(89, 89, 153, 0.32), transparent 42%),
    linear-gradient(180deg, rgba(31, 33, 57, 0.9), rgba(15, 17, 31, 0.86));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 18px 44px rgba(9, 10, 24, 0.24);
}

.field-label {
  padding: 15px 16px 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 10px 12px 16px;
  border-top: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.copy-button,
.copy-icon,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, background 180ms ease, border-color 180ms ease;
}

.copy-button:hover,
.copy-icon:hover,
.primary-action:hover,
.secondary-action:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.copy-button {
  min-width: 78px;
  height: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 45%),
    linear-gradient(135deg, var(--brand-2), var(--brand) 60%, #454579);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(89, 89, 153, 0.35), inset 0 1px rgba(255, 255, 255, 0.25);
}

.copy-button.copied {
  min-width: 42px;
  background: linear-gradient(135deg, #75d7ff, #595999);
}

.copy-button svg,
.copy-icon svg,
.primary-action svg,
.secondary-action svg {
  width: 16px;
  height: 16px;
}

.note {
  margin-top: 14px;
  color: #f4f4f6;
}

.command-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #f2f4f8;
  font-size: 15px;
  line-height: 1.35;
}

.command-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 11px 14px;
  border: 1px solid rgba(126, 150, 180, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(117, 215, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(31, 33, 57, 0.9), rgba(15, 17, 31, 0.88));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 12px 26px rgba(9, 10, 24, 0.15);
}

.command-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-3), var(--cyan));
  box-shadow: 0 0 0 5px rgba(89, 89, 153, 0.1);
}

.command-list a {
  color: var(--brand-3);
  text-decoration: none;
  text-underline-offset: 2px;
  font-weight: 750;
}

code {
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: var(--code);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

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

.code-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(126, 150, 180, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(117, 215, 255, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(31, 33, 57, 0.94), rgba(15, 17, 31, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px rgba(9, 10, 24, 0.18);
}

.code-copy code {
  padding-left: 16px;
  overflow: hidden;
  border: 0;
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-icon {
  width: 34px;
  height: 34px;
  margin-right: 5px;
  border-color: rgba(117, 215, 255, 0.24);
  background: rgba(89, 89, 153, 0.18);
  color: #fff;
}

.copy-icon.copied {
  background: rgba(57, 201, 134, 0.22);
  border-color: rgba(57, 201, 134, 0.48);
  color: #7bf0b2;
}

.toc {
  position: sticky;
  top: 104px;
  align-self: start;
  padding-left: 16px;
}

.toc-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.toc-links {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 18px;
}

.toc-track {
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 0;
  width: 1px;
  background: rgba(155, 162, 255, 0.22);
}

.toc-thumb {
  position: absolute;
  left: -1px;
  top: 0;
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-3), var(--cyan));
  box-shadow: 0 0 0 2px rgba(89, 89, 153, 0.12);
  transition: transform 260ms var(--ease-out), height 260ms var(--ease-out), opacity 260ms ease;
}

.toc a {
  position: relative;
  margin: 0;
  color: #f1f3f7;
  text-decoration: none;
  font-size: 14px;
  transition: color 180ms ease, transform 180ms ease;
}

.toc a:hover,
.toc a.active {
  color: #72b2ff;
}

.toc a.active {
  transform: translateX(2px);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(3px);
}

.drawer-backdrop[hidden] {
  display: none;
}

.user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 31;
  width: min(390px, calc(100vw - 28px));
  height: 100vh;
  padding: 32px;
  border-left: 1px solid var(--line-strong);
  background: rgba(14, 16, 20, 0.96);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.42);
  transform: translateX(102%);
  transition: transform 210ms ease;
}

body.light-theme .user-drawer {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

body.drawer-open .user-drawer {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.drawer-close svg {
  width: 18px;
  height: 18px;
}

.drawer-kicker {
  margin: 36px 0 14px;
  color: #72b2ff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

body.light-theme .drawer-kicker {
  color: #176cdf;
}

.user-drawer h2 {
  margin-bottom: 14px;
}

.user-drawer p {
  color: var(--muted);
}

.drawer-actions {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.primary-action,
.secondary-action {
  height: 46px;
  font-weight: 800;
}

.primary-action {
  border-color: rgba(98, 170, 255, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 48%),
    linear-gradient(135deg, #36a3ff, #176cdf 58%, #1350b9);
  color: #fff;
  box-shadow:
    0 18px 34px rgba(25, 114, 220, 0.34),
    inset 0 1px rgba(255, 255, 255, 0.34),
    inset 0 -1px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}

.primary-action::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0;
  transform: translateX(-70%);
  transition: opacity 180ms ease, transform 420ms var(--ease-out);
}

.primary-action:hover::before {
  opacity: 1;
  transform: translateX(70%);
}

.secondary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
}

.drawer-note {
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .toc {
    display: none;
  }

  :root {
    --wiki-sidebar-width: 0px;
  }

  .app {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .content-shell {
    grid-template-columns: minmax(0, 760px);
    padding-inline: 34px;
  }

  .topbar {
    grid-template-columns: 1fr minmax(280px, 520px) 1fr;
  }

  .search {
    width: min(520px, calc(100vw - 180px));
    min-width: 280px;
  }
}

@media (max-width: 720px) {
  .app {
    display: block;
  }

  .quick-rail {
    display: none;
  }

  .page {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
    padding: 14px;
  }

  .mobile-brand {
    display: block;
  }

  .search {
    position: relative;
    left: auto;
    top: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    transform: none;
  }

  .toolbar {
    position: absolute;
    top: 10px;
    right: 12px;
  }

  .content-shell {
    padding: 22px 14px 18px;
  }

  .sections {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  h1 {
    font-size: 30px;
  }
}
