@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  --wiki-purple-1: #4e6ea8;
  --wiki-purple-2: #5f86c8;
  --wiki-purple-3: #739de0;
  --wiki-blue-1: #3f7bcc;
  --wiki-blue-2: #4aa7d9;
  --wiki-white: #ffffff;

  --wiki-bg: #f3f6fb;
  --wiki-bg-soft: #eaf0f9;
  --wiki-card: #ffffff;
  --wiki-text: #1f2735;
  --wiki-text-soft: #5a6577;
  --wiki-border: #c9d4e3;

  --sl-font: 'IBM Plex Sans', sans-serif;
  --sl-font-system: 'IBM Plex Sans', sans-serif;
  --sl-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sl-color-white: #1e2738;
  --sl-color-gray-1: #2f3a4d;
  --sl-color-gray-2: #4c5a72;
  --sl-color-gray-3: #6a7a92;
  --sl-color-gray-4: #8d9bb2;
  --sl-color-gray-5: #d1dbe8;
  --sl-color-gray-6: #e4ebf4;
  --sl-color-gray-7: #ffffff;
  --sl-color-black: #ffffff;

  --sl-color-accent-low: color-mix(in srgb, var(--wiki-blue-2) 16%, #ffffff);
  --sl-color-accent: color-mix(in srgb, var(--wiki-blue-2) 64%, #456ca8);
  --sl-color-accent-high: #244b86;

  --sl-color-blue-low: color-mix(in srgb, var(--wiki-blue-2) 18%, #ffffff);
  --sl-color-blue: #5f9ce2;
  --sl-color-blue-high: #204d86;

  --sl-color-purple-low: color-mix(in srgb, var(--wiki-purple-2) 14%, #ffffff);
  --sl-color-purple: #7b9cd0;
  --sl-color-purple-high: #274d84;

  --sl-color-orange-low: #fff0e2;
  --sl-color-orange: #eea467;
  --sl-color-orange-high: #8c3f12;

  --sl-color-red-low: #ffe8ed;
  --sl-color-red: #f28ca3;
  --sl-color-red-high: #8d2d45;

  --sl-color-text-accent: #2e5a99;
  --sl-color-text-invert: #ffffff;
  --sl-color-bg: var(--wiki-bg);
  --sl-color-bg-nav: color-mix(in srgb, #f8fbff 90%, #e8eff9);
  --sl-color-bg-sidebar: color-mix(in srgb, #f5f9ff 90%, #e5edf8);
  --sl-color-bg-inline-code: #edf3fb;
  --sl-color-hairline-light: #dbe5f2;
  --sl-color-hairline: var(--wiki-border);
  --sl-color-hairline-shade: #ccd7e7;
  --sl-color-backdrop-overlay: hsl(219 28% 22% / 0.24);

  --sl-shadow-sm: 0 4px 10px hsl(218 33% 35% / 0.1);
  --sl-shadow-md: 0 10px 22px hsl(218 34% 30% / 0.12);
  --sl-shadow-lg: 0 16px 32px hsl(218 34% 28% / 0.16);
}

:root[data-theme='dark'] {
  --wiki-bg: #090d14;
  --wiki-bg-soft: #0d121a;
  --wiki-card: #131a24;
  --wiki-text: #eef2fb;
  --wiki-text-soft: #a7b1c7;
  --wiki-border: #283240;
  --sl-color-white: #eff3fc;
  --sl-color-gray-1: #d7deee;
  --sl-color-gray-2: #a8b4ce;
  --sl-color-gray-3: #8591ab;
  --sl-color-gray-4: #657089;
  --sl-color-gray-5: #2a3347;
  --sl-color-gray-6: #1b2232;
  --sl-color-gray-7: #151b28;
  --sl-color-black: #0a0e16;
  --sl-color-accent-low: color-mix(in srgb, var(--wiki-blue-2) 14%, #1a2230);
  --sl-color-accent: color-mix(in srgb, var(--wiki-blue-2) 65%, #7ea2d6);
  --sl-color-accent-high: #d5e7ff;
  --sl-color-blue-low: color-mix(in srgb, var(--wiki-blue-2) 17%, #172739);
  --sl-color-blue: #7ab9f7;
  --sl-color-blue-high: #c6e0ff;
  --sl-color-purple-low: color-mix(in srgb, var(--wiki-purple-2) 16%, #223149);
  --sl-color-purple: #9db8e6;
  --sl-color-purple-high: #d8e8ff;
  --sl-color-orange-low: #3f2a23;
  --sl-color-orange: #ffbc89;
  --sl-color-orange-high: #ffd3b3;
  --sl-color-red-low: #412231;
  --sl-color-red: #ff9eb4;
  --sl-color-red-high: #ffd0db;
  --sl-color-text-accent: #c8dcfb;
  --sl-color-text-invert: #101420;
  --sl-color-bg-nav: color-mix(in srgb, #101721 96%, #192433);
  --sl-color-bg-sidebar: color-mix(in srgb, #101721 95%, #182534);
  --sl-color-bg-inline-code: #182232;
  --sl-color-hairline-light: #2c364a;
  --sl-color-hairline-shade: #242c3e;
  --sl-color-backdrop-overlay: hsl(240 30% 5% / 0.62);
  --sl-shadow-sm: 0 8px 14px hsl(222 30% 3% / 0.26);
  --sl-shadow-md: 0 14px 24px hsl(222 34% 3% / 0.34);
  --sl-shadow-lg: 0 20px 34px hsl(222 38% 3% / 0.44);
}

html,
body {
  min-height: 100%;
}

body {
  color: var(--wiki-text);
  line-height: 1.66;
  background:
    radial-gradient(circle at 12% -18%, color-mix(in srgb, var(--wiki-blue-2) 8%, transparent), transparent 36%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--wiki-purple-2) 6%, transparent), transparent 38%),
    linear-gradient(180deg, var(--wiki-bg), var(--wiki-bg-soft));
  background-attachment: fixed;
}

.site-title {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.header {
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--sl-color-bg-nav) 94%, transparent);
  border-bottom-color: color-mix(in srgb, var(--sl-color-hairline) 92%, transparent);
}

/* Приводим мобильную кнопку меню/закрытия к стилю веб-иконок в хедере. */
starlight-menu-button button {
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 82%, transparent) !important;
  border-radius: 50% !important;
  width: 2.25rem !important;
  height: 2.25rem !important;
  top: calc((var(--sl-nav-height) - 2.25rem) / 2) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: color-mix(in srgb, var(--sl-color-bg-nav) 88%, transparent) !important;
  color: var(--sl-color-gray-2) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sl-color-hairline) 28%, transparent) !important;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease,
    transform 160ms ease !important;
}

starlight-menu-button button .open-menu,
starlight-menu-button button .close-menu {
  display: none !important;
}

starlight-menu-button button::before {
  content: '';
  display: block;
  width: 1rem;
  text-align: center;
  line-height: 1;
  font-weight: 400;
}

starlight-menu-button[aria-expanded='true'] button::before {
  content: '×';
  font-size: 1.02rem;
  letter-spacing: 0;
  transform: none;
}

starlight-menu-button:not([aria-expanded='true']) button::before {
  content: '⋮';
  font-size: 1.06rem;
  letter-spacing: 0;
  transform: none;
}

starlight-menu-button button:hover {
  border-color: color-mix(in srgb, var(--sl-color-accent) 42%, transparent) !important;
  background: color-mix(in srgb, var(--sl-color-accent-low) 56%, transparent) !important;
  color: var(--sl-color-white) !important;
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sl-color-accent) 24%, transparent),
    0 6px 14px color-mix(in srgb, var(--sl-color-accent) 22%, transparent) !important;
}

[data-mobile-menu-expanded] starlight-menu-button button {
  border-color: color-mix(in srgb, var(--sl-color-accent) 52%, transparent) !important;
  background: color-mix(in srgb, var(--sl-color-accent-low) 72%, transparent) !important;
  color: var(--sl-color-white) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sl-color-accent) 24%, transparent),
    0 6px 14px color-mix(in srgb, var(--sl-color-accent) 22%, transparent),
    0 0 16px color-mix(in srgb, var(--sl-color-accent) 20%, transparent) !important;
}

@media (min-width: 50rem) {
  starlight-menu-button button {
    display: none !important;
  }
}

.sidebar-pane {
  background:
    radial-gradient(circle at 8% -4%, color-mix(in srgb, var(--wiki-purple-2) 7%, transparent), transparent 38%),
    var(--sl-color-bg-sidebar);
}

.sidebar-content a {
  position: relative;
  border: 0;
  border-radius: 0.16rem;
  padding-inline-start: 0.72rem;
  transition: background 170ms ease, color 170ms ease;
}

.sidebar-content a:hover {
  background: color-mix(in srgb, var(--sl-color-accent-low) 32%, transparent);
}

.sidebar-content .sidebar-group-link {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  text-decoration: none;
  background: transparent;
}

.sidebar-content .sidebar-group-link:hover {
  text-decoration: none;
  background: transparent;
}

.sidebar-content :is(a[aria-current='page'], a[aria-current='page']:hover) {
  background: color-mix(in srgb, var(--sl-color-gray-6) 62%, transparent);
  color: var(--sl-color-white);
}

.sidebar-content ul ul li {
  border-inline-start-width: 2px;
  border-inline-start-color: color-mix(in srgb, var(--sl-color-hairline-light) 86%, transparent);
  transition: border-inline-start-color 180ms ease, border-inline-start-width 180ms ease;
}

.sidebar-content ul ul li:has(> a:hover) {
  border-inline-start-width: 4px;
  border-inline-start-color: color-mix(in srgb, var(--wiki-purple-2) 72%, #ffffff);
}

/* Делаем подсветку активного пункта частью общей левой линии группы. */
.sidebar-content li:has(> a[aria-current='page']) {
  border-inline-start-width: 4px;
  border-inline-start-color: color-mix(in srgb, var(--wiki-purple-2) 85%, #ffffff);
}

.content-panel > .sl-container {
  border-radius: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 100%, transparent);
  background: color-mix(in srgb, var(--wiki-card) 97%, transparent);
  box-shadow: var(--sl-shadow-sm);
  max-width: min(100%, 76rem);
  margin-inline: auto;
  padding: 1.2rem 1.35rem;
}

/* Выравниваем первый заголовок страницы: одинаковый воздух сверху и снизу. */
.content-panel:first-of-type > .sl-container {
  padding-top: 1.28rem;
  padding-bottom: 1.28rem;
}

.content-panel:first-of-type h1 {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.16;
}

.hero {
  border-radius: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 94%, transparent);
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--wiki-purple-3) 10%, transparent), transparent 55%),
    radial-gradient(circle at 95% 10%, color-mix(in srgb, var(--wiki-blue-2) 10%, transparent), transparent 53%),
    color-mix(in srgb, var(--wiki-card) 98%, transparent);
}

.hero .stack {
  text-align: center;
  align-items: center;
}

.hero .copy {
  align-items: center;
}

.hero .actions {
  justify-content: center;
}

.hero .tagline {
  color: var(--wiki-text-soft);
}

.hero .sl-link-button {
  border-radius: 0.18rem;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.hero .sl-link-button:hover {
  transform: translateY(-1px);
}

/* Единый эффект свечения в момент нажатия для всех кнопок/кнопкоподобных элементов. */
:is(
    button:not(:disabled),
    .sl-link-button,
    .map-cta-button,
    .map-ghost-button,
    .copy-ip-chip
  ):active {
  transform: translateY(0) scale(0.98) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sl-color-accent) 34%, transparent),
    0 0 18px color-mix(in srgb, var(--sl-color-accent) 34%, transparent),
    0 0 34px color-mix(in srgb, var(--wiki-blue-2) 26%, transparent) !important;
  filter: saturate(1.08);
}

.sl-markdown-content h1,
.sl-markdown-content h2,
.sl-markdown-content h3,
.sl-markdown-content h4 {
  font-family: 'Sora', sans-serif;
  letter-spacing: 0.005em;
  line-height: 1.24;
  color: var(--sl-color-white);
}

.sl-markdown-content h1 {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.sl-markdown-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.72rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--sl-color-hairline) 85%, transparent);
}

.sl-markdown-content h3 {
  margin-top: 1.35rem;
  margin-bottom: 0.5rem;
}

.sl-markdown-content h4 {
  margin-top: 1rem;
  margin-bottom: 0.36rem;
  font-size: clamp(0.96rem, 0.93rem + 0.18vw, 1.07rem);
  color: color-mix(in srgb, var(--sl-color-white) 86%, var(--wiki-blue-2));
}

.sl-markdown-content .sl-heading-wrapper.level-h3 > h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
}

.sl-markdown-content .minimal-heading-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
  opacity: 0.98;
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--wiki-purple-2) 76%, #ffffff),
    color-mix(in srgb, var(--wiki-blue-2) 82%, #ffffff)
  );
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.sl-markdown-content p,
.sl-markdown-content li {
  color: var(--wiki-text);
}

.sl-markdown-content p {
  margin-block: 0.7rem;
}

.sl-markdown-content ul,
.sl-markdown-content ol {
  margin-block: 0.75rem 1rem;
  padding-inline-start: 1.3rem;
}

.sl-markdown-content li + li {
  margin-top: 0.28rem;
}

.sl-markdown-content a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.07em;
}

.sl-markdown-content :is(p, li, td, blockquote) a[href]:not(.sl-anchor-link):not(.map-cta-button):not(
    .map-ghost-button
  ):not(.sl-link-button):not([href^='#']) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.44rem;
  max-width: min(100%, 100ch);
  margin: 0.1rem 0.2rem 0.1rem 0;
  padding: 0.55rem 1rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 48%, transparent);
  border-radius: 0.2rem;
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--wiki-blue-2) 76%, #233145),
    color-mix(in srgb, var(--wiki-purple-2) 66%, #273850)
  );
  color: #f8fbff;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.008em;
  line-height: 1;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--sl-color-accent) 18%, transparent);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.sl-markdown-content :is(p, li, td, blockquote) a[href]:not(.sl-anchor-link):not(.map-cta-button):not(
    .map-ghost-button
  ):not(.sl-link-button):not([href^='#']):hover {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sl-color-accent) 64%, transparent);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--sl-color-accent) 24%, transparent);
}

.sl-markdown-content :is(p, li, td, blockquote) a[href]:not(.sl-anchor-link):not(.map-cta-button):not(
    .map-ghost-button
  ):not(.sl-link-button):not([href^='#']):focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--sl-color-accent) 72%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sl-color-accent) 30%, transparent),
    0 0 0 4px color-mix(in srgb, var(--sl-color-accent) 20%, transparent);
}

.sl-markdown-content :is(p, li, td, blockquote) a[href]:not(.sl-anchor-link):not(.map-cta-button):not(
    .map-ghost-button
  ):not(.sl-link-button):not([href^='#']):active {
  transform: translateY(0) scale(0.98);
}

.sl-markdown-content code {
  border-radius: 0.16rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 78%, transparent);
  background: var(--sl-color-bg-inline-code);
}

.expressive-code,
pre {
  border-radius: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 86%, transparent);
}

.pagination-links a {
  border-radius: 0.18rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  background: color-mix(in srgb, var(--sl-color-bg-nav) 90%, transparent);
  transition: border-color 170ms ease, background 170ms ease;
}

.pagination-links a:hover {
  border-color: color-mix(in srgb, var(--sl-color-accent) 40%, transparent);
  background: color-mix(in srgb, var(--sl-color-accent-low) 70%, transparent);
}

starlight-toc nav {
  border-radius: 0.18rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  background: color-mix(in srgb, var(--wiki-card) 92%, transparent);
  padding: 0.82rem 0.9rem;
}

starlight-toc h2 {
  margin: 0 0 0.58rem;
  font-size: 1.02rem;
  line-height: 1.3;
}

starlight-toc ul {
  margin: 0;
  padding: 0;
}

starlight-toc li {
  margin: 0;
}

starlight-toc ul ul {
  margin-top: 0.18rem;
  padding-left: 0.72rem;
}

starlight-toc a {
  position: relative;
  display: block;
  padding: 0.2rem 0.42rem;
  line-height: 1.38;
  border-radius: 0.12rem;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

/* Разделы, внутри которых есть подпункты, выделяем сильнее. */
starlight-toc li:has(> ul) > a,
mobile-starlight-toc li:has(> ul) > a {
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 22%, transparent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--wiki-purple-2) 20%, transparent),
    color-mix(in srgb, var(--wiki-blue-2) 12%, transparent)
  );
}

starlight-toc li:has(> ul) > a:hover,
mobile-starlight-toc li:has(> ul) > a:hover {
  border-color: color-mix(in srgb, var(--sl-color-accent) 44%, transparent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--wiki-purple-2) 30%, transparent),
    color-mix(in srgb, var(--wiki-blue-2) 18%, transparent)
  );
}

starlight-toc a::before {
  content: '';
  position: absolute;
  inset-inline-start: 0.12rem;
  inset-block: 0.2rem;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--wiki-purple-1) 92%, #ffffff),
    color-mix(in srgb, var(--wiki-purple-3) 88%, #ffffff)
  );
  opacity: 0;
  transform: scaleY(0.65);
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

starlight-toc a:hover {
  transform: translateX(2px);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--wiki-purple-2) 20%, transparent),
    color-mix(in srgb, var(--wiki-blue-2) 10%, transparent)
  );
  color: var(--sl-color-white);
}

starlight-toc a:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

starlight-toc a[aria-current='true'] {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--wiki-purple-2) 34%, transparent),
    color-mix(in srgb, var(--wiki-purple-3) 18%, transparent)
  );
  color: var(--sl-color-white);
  transform: translateX(2px);
}

starlight-toc a[aria-current='true']::before {
  opacity: 1;
  transform: scaleY(1);
}

starlight-theme-select label {
  --sl-select-width: 2.3rem !important;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 72%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--sl-color-bg-nav) 88%, transparent);
  color: var(--sl-color-gray-2);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease,
    transform 160ms ease;
}

/* Убираем стандартный выпадающий селект темы (Тёмная/Светлая/Авто). */
starlight-theme-select {
  display: none !important;
}

starlight-theme-select label:hover {
  border-color: color-mix(in srgb, var(--sl-color-accent) 42%, transparent);
  background: color-mix(in srgb, var(--sl-color-accent-low) 56%, transparent);
  color: var(--sl-color-white);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--sl-color-accent) 18%, transparent);
}

starlight-theme-select .label-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: #6eead8;
}

:root[data-theme='light'] starlight-theme-select .label-icon {
  color: #2e6b57;
}

starlight-theme-select select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

starlight-theme-select .caret {
  display: none;
}

.starlight-aside {
  border-radius: 0.2rem;
  border-inline-start-width: 0.26rem;
}

.sl-markdown-content table {
  border-radius: 0.16rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  display: table;
  width: 100%;
  border-collapse: collapse;
  margin: 0.9rem 0 1.15rem;
}

.sl-markdown-content th,
.sl-markdown-content td {
  padding: 0.76rem 0.95rem;
  line-height: 1.5;
}

.sl-markdown-content :is(th:first-child, td:first-child) {
  padding-inline-start: 0.95rem;
}

.sl-markdown-content :is(th:last-child, td:last-child) {
  padding-inline-end: 0.95rem;
}

.sl-markdown-content details {
  border-radius: 0.16rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 86%, transparent);
  background: color-mix(in srgb, var(--wiki-card) 93%, transparent);
  padding: 0.72rem 0.82rem;
}

.sl-markdown-content details summary {
  font-weight: 700;
}

.lore-grid {
  display: grid;
  gap: 1.05rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1.05rem 0 1.25rem;
}

.lore-card {
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  border-radius: 0.2rem;
  padding: 1rem 1.02rem;
  background:
    linear-gradient(
      140deg,
      color-mix(in srgb, var(--wiki-purple-3) 7%, transparent),
      color-mix(in srgb, var(--wiki-blue-2) 7%, transparent)
    ),
    color-mix(in srgb, var(--wiki-card) 94%, transparent);
  transition: transform 170ms ease, border-color 170ms ease;
}

.lore-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--sl-color-accent) 42%, transparent);
}

.lore-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.craft-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: 1fr;
  margin: 1rem 0 1.3rem;
}

.craft-grid > .craft-card {
  margin-top: 0;
}

.craft-catalog {
  margin-top: 0.95rem;
}

.craft-controls {
  display: grid;
  gap: 0.72rem;
  margin: 0 0 1rem;
}

.craft-search-field {
  display: grid;
  gap: 0.36rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--wiki-text) 92%, var(--sl-color-white));
}

.craft-search-input {
  width: 100%;
  min-height: 2.42rem;
  border-radius: 0.18rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 82%, transparent);
  background: color-mix(in srgb, var(--wiki-card) 92%, transparent);
  color: var(--wiki-text);
  padding: 0.5rem 0.68rem;
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.craft-search-input::placeholder {
  color: color-mix(in srgb, var(--wiki-muted) 78%, var(--sl-color-white));
}

.craft-search-input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--sl-color-accent) 68%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sl-color-accent) 30%, transparent),
    0 0 0 4px color-mix(in srgb, var(--sl-color-accent) 18%, transparent);
}

.craft-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.craft-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 85%, transparent);
  background: color-mix(in srgb, var(--wiki-card) 92%, transparent);
  color: color-mix(in srgb, var(--wiki-text) 92%, var(--sl-color-white));
  padding: 0.4rem 0.82rem;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.008em;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.craft-filter-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sl-color-accent) 42%, transparent);
}

.craft-filter-chip.is-active {
  border-color: color-mix(in srgb, var(--sl-color-accent) 56%, transparent);
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--wiki-blue-2) 74%, #233145),
    color-mix(in srgb, var(--wiki-purple-2) 64%, #273850)
  );
  color: #f7fbff;
}

.craft-empty {
  margin: 0.18rem 0 1.02rem;
  border: 1px dashed color-mix(in srgb, var(--sl-color-accent) 34%, transparent);
  border-radius: 0.16rem;
  background: color-mix(in srgb, var(--sl-color-accent-low) 66%, transparent);
  padding: 0.62rem 0.74rem;
  font-size: 0.93rem;
}

.craft-group {
  margin-bottom: 1.15rem;
}

.craft-group > h3 {
  margin-bottom: 0.58rem;
}

.craft-card {
  padding: 0.82rem 0.86rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.craft-card:hover {
  transform: none;
}

.craft-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.craft-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 346 / 167;
  object-fit: cover;
  border-radius: 0.18rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  background: color-mix(in srgb, #ffffff 18%, transparent);
  box-shadow: var(--sl-shadow-sm);
  image-rendering: pixelated;
}

.craft-card[hidden],
.craft-group[hidden] {
  display: none !important;
}

.alcohol-nav-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.alcohol-nav-card:hover {
  text-decoration: none;
}

.alcohol-nav-card p {
  margin-bottom: 0;
}

.contact-link-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.contact-link-card:hover {
  text-decoration: none;
}

.contact-link-card p {
  margin-bottom: 0;
}

.city-feature-card p {
  margin-bottom: 0;
}

.city-highlight {
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

.command-block {
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  border-radius: 0.16rem;
  padding: 0.78rem 0.88rem;
  background: color-mix(in srgb, var(--wiki-card) 92%, transparent);
  font-family: var(--sl-font-mono);
}

.brew-image {
  display: block;
  width: min(100%, 640px);
  margin: 0.85rem auto 1.15rem;
  border-radius: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
  box-shadow: var(--sl-shadow-sm);
}

.see-also {
  margin-top: 1.2rem;
  padding: 0.82rem 0.95rem;
  border-radius: 0.16rem;
  border: 1px dashed color-mix(in srgb, var(--sl-color-accent) 36%, transparent);
  background: color-mix(in srgb, var(--sl-color-accent-low) 72%, transparent);
}

.see-also p {
  margin: 0 0 0.45rem;
  font-weight: 700;
}

.ip-main-grid {
  display: grid;
  gap: 0.96rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-items: stretch;
  margin: 0.95rem 0 0.8rem;
}

.ip-main-card {
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 28%, var(--sl-color-hairline));
  border-radius: 0.2rem;
  padding: 1rem 1.02rem;
  height: 100%;
  min-height: 11.2rem;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--wiki-purple-2) 12%, transparent),
      color-mix(in srgb, var(--wiki-blue-2) 8%, transparent)
    ),
    color-mix(in srgb, var(--wiki-card) 96%, transparent);
}

.ip-main-grid > .ip-main-card {
  margin: 0 !important;
  align-self: stretch;
}

.ip-main-grid > .ip-main-card + .ip-main-card {
  margin-top: 0 !important;
}

.ip-main-card h3 {
  margin: 0 0 0.52rem;
  font-family: 'Sora', sans-serif;
  font-size: 1.02rem;
  line-height: 1.25;
}

.ip-main-card ul {
  margin: 0;
  padding-inline-start: 1.06rem;
  display: grid;
  gap: 0.52rem;
  align-content: start;
}

.ip-main-card li {
  margin: 0;
  line-height: 1.4;
}

.copy-ip-chip {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 48%, transparent);
  border-radius: 0.2rem;
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--wiki-blue-2) 76%, #233145),
    color-mix(in srgb, var(--wiki-purple-2) 66%, #273850)
  );
  color: #f8fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.36rem 0.72rem;
  margin: 0 0 0 0.24rem;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.008em;
  line-height: 1;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--sl-color-accent) 18%, transparent);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.copy-ip-chip code {
  margin: 0;
  border: 0;
  background: transparent;
  display: inline-block;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  line-height: 1.2;
  color: inherit;
}

.copy-ip-chip:hover {
  color: #ffffff;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sl-color-accent) 66%, transparent);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--sl-color-accent) 24%, transparent);
}

.copy-ip-chip:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--sl-color-accent) 72%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sl-color-accent) 30%, transparent),
    0 0 0 4px color-mix(in srgb, var(--sl-color-accent) 20%, transparent);
}

.copy-ip-chip.is-copied {
  border-color: color-mix(in srgb, #7ed49b 66%, transparent);
  background: linear-gradient(
    110deg,
    color-mix(in srgb, #63b888 76%, #223b2f),
    color-mix(in srgb, #5ccd9f 66%, #26463b)
  );
}

.copy-ip-chip.is-copied::after {
  content: '';
}

.copy-ip-chip.is-copy-error {
  border-color: color-mix(in srgb, #ef6f85 74%, transparent);
  background: linear-gradient(
    110deg,
    color-mix(in srgb, #d56b7f 78%, #3b242a),
    color-mix(in srgb, #cf6f90 68%, #3f2532)
  );
}

.copy-ip-chip.is-copy-error::after {
  content: '';
}

.ip-main-note {
  margin-top: 0.52rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 30%, transparent);
  border-radius: 0.18rem;
  padding: 0.58rem 0.72rem;
  background: color-mix(in srgb, var(--sl-color-accent-low) 66%, transparent);
  color: var(--wiki-text);
  font-size: 0.94rem;
}

.map-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.map-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.44rem;
  padding: 0.55rem 1rem;
  border-radius: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 48%, transparent);
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--wiki-blue-2) 76%, #233145),
    color-mix(in srgb, var(--wiki-purple-2) 66%, #273850)
  );
  color: #f8fbff;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.008em;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--sl-color-accent) 18%, transparent);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.map-cta-button:hover {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sl-color-accent) 66%, transparent);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--sl-color-accent) 24%, transparent);
}

.map-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.44rem;
  padding: 0.55rem 1rem;
  border-radius: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--sl-color-accent) 48%, transparent);
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--wiki-blue-2) 76%, #233145),
    color-mix(in srgb, var(--wiki-purple-2) 66%, #273850)
  );
  color: #f8fbff;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.008em;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--sl-color-accent) 18%, transparent);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.map-ghost-button:hover {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--sl-color-accent) 66%, transparent);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--sl-color-accent) 24%, transparent);
}

@media (min-width: 50rem) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-block: clamp(2rem, calc(1.2rem + 4vmin), 4.8rem);
    text-align: center;
  }

  .hero > img,
  .hero > .hero-html {
    order: 0;
    width: min(70%, 18rem);
  }
}

@media (max-width: 50rem) {
  .ip-main-grid {
    grid-template-columns: 1fr;
  }

  .wiki-header {
    gap: 0.5rem;
  }

  /* Освобождаем место под фиксированную кнопку меню, чтобы поиск не заезжал под нее. */
  .wiki-header > div:nth-child(2) {
    flex: 1;
    min-width: 0;
    margin-inline-end: 2.9rem;
  }

  .wiki-header > div:nth-child(2) site-search {
    width: 100%;
  }

  .wiki-read-progress {
    top: var(--sl-nav-height);
  }

  :root[data-mobile-menu-expanded] .wiki-read-progress {
    display: none;
  }

  .main-frame {
    padding-inline: 0.56rem;
  }

  .header {
    padding-inline: 0.56rem;
  }

  .right-sidebar-container {
    padding-inline: 0;
    margin-bottom: 0.42rem;
  }

  mobile-starlight-toc nav {
    border-radius: 0.16rem;
    border: 1px solid color-mix(in srgb, var(--sl-color-hairline) 88%, transparent);
    background: color-mix(in srgb, var(--wiki-card) 94%, transparent);
    overflow: hidden;
  }

  mobile-starlight-toc summary {
    padding: 0.46rem 0.6rem;
  }

  .hero .actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.52rem;
  }

  .hero .actions .sl-link-button {
    flex: 1 1 10.5rem;
    justify-content: center;
  }

  .hero .stack {
    padding-top: 0.45rem;
  }

  .hero .copy {
    width: 100%;
    margin-inline: auto;
    text-align: center;
  }

  .hero h1 {
    width: 100%;
    margin-inline: auto;
    text-align: center;
  }

  .content-panel > .sl-container {
    border-radius: 0.16rem;
    padding: 0.92rem 0.84rem;
  }

  .map-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .map-cta-button,
  .map-ghost-button {
    width: 100%;
    justify-content: center;
  }

  .copy-ip-chip {
    margin-inline-start: 0.2rem;
  }
}
