:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --surface: #1d1830;
  --surface-2: #262040;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f7;
  --text-dim: #9797a8;
  --accent-1: #7c5cff;
  --accent-2: #a855f7;
  --accent-text: #a996ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* верхняя панель — та же геометрия и логика, что и в самом приложении */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
}

.topbar-spacer {
  justify-self: end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  justify-self: start;
}

/* Обёртка фиксированного размера — .brand-mark внутри неё увеличивается на
   наведении (через .brand:hover), а сама обёртка не меняет размер, поэтому
   JS-подмена на анимированный GIF (см. legal-shared.js) не дёргается. */
.brand-mark-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-mark {
  position: absolute;
  inset: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 0 rgba(168, 85, 247, 0));
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.35s ease;
}

.brand-mark-gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.brand:hover .brand-mark {
  transform: scale(1.14);
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.65));
}

/* Раньше тут был доп. transform:scale(1.3) конкретно на букве "T" внутри
   квадратной плашки — теперь, без плашки, с маскотом (сам уже вписан в
   размер значка), это правило только обрезало ему рога за край SVG,
   поэтому убрано вместе с самой плашкой. */
.brand-text span {
  color: var(--accent-text);
}

nav.doclinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  justify-self: center;
}

nav.doclinks a {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

nav.doclinks a:hover {
  color: var(--text);
  border-color: rgba(168, 85, 247, 0.4);
}

nav.doclinks a.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.doc-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 48px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

h1 {
  position: relative;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0 0 6px;
}

.updated {
  position: relative;
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 36px;
}

h2 {
  position: relative;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin: 36px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--accent-2);
}

h2:first-of-type {
  margin-top: 0;
}

p {
  position: relative;
  margin: 0 0 14px;
  color: #cfcfdb;
  font-size: 15.5px;
}

ul {
  position: relative;
  margin: 0 0 14px;
  padding-left: 22px;
  color: #cfcfdb;
  font-size: 15.5px;
}

li {
  margin-bottom: 8px;
}

p strong,
li strong,
b {
  color: var(--accent-text);
  font-weight: 700;
}

a.inline {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: rgba(169, 150, 255, 0.35);
  text-underline-offset: 2px;
}

a.inline:hover {
  text-decoration-color: var(--accent-text);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--accent-text);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  color: #cfcfdb;
}

tr:last-child td {
  border-bottom: none;
}

.note {
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  margin: 18px 0;
}

.contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 18px 0;
}

.contact-card b {
  display: inline-block;
  margin-bottom: 2px;
}

footer {
  position: relative;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 14px 16px;
    gap: 12px;
  }

  .brand {
    justify-self: center;
  }

  nav.doclinks {
    justify-content: center;
  }

  .topbar-spacer {
    display: none;
  }
}

@media (max-width: 640px) {
  .brand {
    font-size: 16px;
  }

  .wrap {
    padding: 24px 12px 56px;
  }

  .doc-card {
    padding: 28px 20px;
    border-radius: 16px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 17px;
  }
}
