/* ClaudeAccess design system: tokens, base, shell (top bar, menu sheet, footer), buttons, dialogs.
   Loaded first on every page, page styles come after. Tokens are --ca-*, so page-local
   variables (--accent, --panel… in style.css, ip.css, order.css) never collide with them.
   Description of the system: ClaudeAccess/DESIGN.md. */

:root {
  color-scheme: dark;

  /* Surfaces — warm charcoal of the Claude dark theme, darkest at the edge, lighter when raised */
  --ca-sidebar: #1f1e1d;
  --ca-bg: #262624;
  --ca-raised: #30302e;
  --ca-hover: #3a3935;
  --ca-line: #4a4640;
  --ca-line-strong: #857f75;

  /* Text */
  --ca-text: #f5f2ea;
  --ca-text-2: #bfb9ad;
  --ca-text-3: #a39d92;

  /* Clay — the one accent */
  --ca-accent: #d97757;
  --ca-accent-hover: #e58d6e;
  --ca-on-accent: #1f1410;
  --ca-accent-text: #ec9f80;
  --ca-accent-soft: #3a2f28;
  --ca-focus: #f0a283;

  /* States */
  --ca-success: #93c97a;
  --ca-warning: #e6ad62;
  --ca-danger: #ee8577;

  /* Type */
  --ca-font-sans: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ca-font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ca-font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* Space — 4 px steps */
  --ca-space-1: 4px;
  --ca-space-2: 8px;
  --ca-space-3: 12px;
  --ca-space-4: 16px;
  --ca-space-5: 20px;
  --ca-space-6: 24px;
  --ca-space-8: 32px;
  --ca-space-10: 40px;
  --ca-space-12: 48px;

  /* Shape */
  --ca-radius-sm: 6px;
  --ca-radius-md: 9px;
  --ca-radius-lg: 14px;
  --ca-radius-xl: 20px;

  /* Depth */
  --ca-shadow-pop: 0 2px 6px rgb(0 0 0 / 0.3), 0 28px 80px -24px rgb(0 0 0 / 0.75);

  /* Motion — exponential ease-out, short */
  --ca-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ca-dur-1: 120ms;
  --ca-dur-2: 200ms;
  --ca-dur-3: 320ms;

  /* Shell: the top bar (137.9.1, world «Стандарт категории») */
  --ca-top-h: 72px;
  --ca-wrap: 1280px;
  /* Page grid (137.9.5): every top-bar page lays its content on one 1120 px column; the gutter is the bar's own
     side padding, so below 1168 px the page edges line up with the brand and the last button of the bar. */
  --ca-page: 1120px;
  --ca-gutter: 24px;
  --ca-footer-h: 42px;
}
@media (max-width: 899px) {
  :root {
    --ca-top-h: 56px;
    --ca-gutter: 16px;
  }
}
@media (max-width: 650px) {
  :root {
    --ca-footer-h: 28px;
  }
}
@media (max-height: 500px) {
  :root {
    --ca-footer-h: 24px;
  }
}

/* ---------- base ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--ca-font-sans);
  caret-color: var(--ca-accent);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-color: var(--ca-line) transparent;
}
::selection {
  background: #d977575c;
  color: var(--ca-text);
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ca-focus);
  outline-offset: 3px;
}
.ca-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ca-icon-ext {
  width: 13px;
  height: 13px;
  margin-left: auto;
  opacity: 0.75;
}
.sr-only,
.ca-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  left: var(--ca-space-3);
  top: var(--ca-space-3);
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--ca-radius-md);
  background: var(--ca-accent);
  color: var(--ca-on-accent);
  font: 600 14px/1.2 var(--ca-font-sans);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus-visible {
  transform: none;
}

/* ---------- layout of the shell ---------- */
/* shell-top: every public page — the bar sticks to the top, the page scrolls under it (the pay pages too: 137.9.7.3). */
html:has(body.shell-top) {
  scroll-padding-top: calc(var(--ca-top-h) + 12px);
}

/* ---------- header ---------- */
.site-header {
  z-index: 5;
  display: flex;
  font-family: var(--ca-font-sans);
}
.shell-top .site-header {
  position: sticky;
  top: 0;
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: var(--ca-space-2);
  height: var(--ca-top-h);
  padding: 0 max(var(--ca-gutter), calc((100% - var(--ca-wrap)) / 2));
  background: rgb(35 35 33 / 0.84);
  border-bottom: 1px solid rgb(74 70 64 / 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  view-transition-name: ca-top;
}

/* Brand: the monogram tile + the wordmark, the same everywhere */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  min-height: 40px;
  color: var(--ca-text);
  font: 600 24px/1 var(--ca-font-serif);
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
}
.brand-word span {
  font-weight: 400;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Top bar: the places in the middle (180: «Помощь с Claude» is the orange one), support on the right */
.shell-top .brand {
  padding: 0;
  margin-right: var(--ca-space-5);
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.top-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--ca-radius-md);
  color: var(--ca-text-2);
  font: 500 14.5px/1.2 var(--ca-font-sans);
  white-space: nowrap;
  text-decoration: none;
  transition:
    color var(--ca-dur-2) var(--ca-ease),
    background-color var(--ca-dur-2) var(--ca-ease);
}
.top-link:hover {
  color: var(--ca-text);
  background: rgb(255 255 255 / 0.04);
}
/* Current place: brighter text on a quiet tint — a shape cue, not colour alone */
.top-link[aria-current="page"] {
  color: var(--ca-text);
  background: rgb(255 255 255 / 0.075);
}
/* 180 (owner 01.12.2026: «Кнопку "Помощь с Claude" Нужно выделить отдельно. Оранжевым»): the one orange place of the
   bar, a pill apart from the plain links; on /claude itself a ring around it says «you are here» (shape, not colour) */
.top-link.top-help {
  margin-left: 8px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ca-accent);
  color: var(--ca-on-accent);
  font-weight: 650;
}
.top-link.top-help:hover {
  background: var(--ca-accent-hover);
  color: var(--ca-on-accent);
}
.top-link.top-help[aria-current="page"] {
  background: var(--ca-accent);
  color: var(--ca-on-accent);
  box-shadow: 0 0 0 2px #232321, 0 0 0 3.5px rgb(217 119 87 / 0.75);
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 14px/1.2 var(--ca-font-sans);
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color var(--ca-dur-2) var(--ca-ease),
    border-color var(--ca-dur-2) var(--ca-ease),
    color var(--ca-dur-2) var(--ca-ease);
}
.top-support {
  color: var(--ca-text);
  border-color: var(--ca-line);
}
.top-support .ca-icon {
  width: 16px;
  height: 16px;
  color: var(--ca-text-2);
}
.top-support:hover {
  background: var(--ca-hover);
  border-color: var(--ca-line-strong);
}

/* Nav links with icons: the phone menu sheet and the pay bar's support */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--ca-radius-md);
  background: transparent;
  color: var(--ca-text-2);
  font: 500 14px/1.3 var(--ca-font-sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--ca-dur-2) var(--ca-ease),
    color var(--ca-dur-2) var(--ca-ease);
}
.nav-link .ca-icon {
  color: var(--ca-text-3);
  transition: color var(--ca-dur-2) var(--ca-ease);
}
.nav-link:hover {
  background: var(--ca-hover);
  color: var(--ca-text);
}
.nav-link:hover .ca-icon {
  color: var(--ca-text-2);
}
.nav-link[aria-current="page"] {
  background: var(--ca-accent-soft);
  color: var(--ca-accent-text);
}
.nav-link[aria-current="page"] .ca-icon {
  color: var(--ca-accent-text);
}

/* Menu button — only where the places fold into the sheet (below 1024 px since 170.4) */
.mobile-menu {
  display: none;
}

/* ---------- footer ---------- */
.site-footer {
  flex: none;
  min-height: var(--ca-footer-h);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 var(--ca-space-4);
  color: var(--ca-text-3);
  font: 400 12px/1.4 var(--ca-font-sans);
  text-align: center;
}
.footer-brand {
  white-space: pre;
}
.site-footer b {
  font-weight: 600;
  color: var(--ca-text-2);
}
/* Step 138: documents, support and the check word — one row on wide screens, their own row below 900 px. */
.footer-docs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.footer-docs::before,
.footer-code::before {
  content: "·";
  margin: 0 0.45em 0 0.15em;
}
/* 157.5b: the «Ответы» row — its own row above the brand and documents on every width; the links wrap by whole
   captions (gap, no separators to hang at a line end). */
.footer-answers {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding-top: var(--ca-space-1);
}
.footer-answers-title {
  margin-right: 0.15em;
  font-weight: 600;
  color: var(--ca-text-2);
}
.footer-answers-title::after {
  content: ":";
}
.footer-answers ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-answers a[aria-current="page"] {
  color: var(--ca-text);
  text-decoration-color: currentColor;
}
.footer-answers a,
.footer-docs a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.45em;
  color: var(--ca-text-2);
  text-decoration: underline;
  text-decoration-color: var(--ca-line-strong);
  text-underline-offset: 3px;
}
.footer-answers a:hover,
.footer-docs a:hover {
  color: var(--ca-text);
  text-decoration-color: currentColor;
}
.footer-code {
  margin-left: 0.3em;
  letter-spacing: 0.02em;
}
/* 163a: the seller line (name and INN) — its own row under the brand and documents; tools/seller.py turns it on/off. */
.footer-seller {
  flex-basis: 100%;
  margin: 0;
  padding-bottom: var(--ca-space-1);
}
/* 173: the line is filled after load from /seller-line.json (shell.js); until then — and with it off — no empty row. */
.footer-seller:empty {
  display: none;
}
@media (max-width: 900px) {
  .site-footer {
    padding-top: var(--ca-space-1);
    padding-bottom: var(--ca-space-1);
  }
  .footer-docs {
    flex-basis: 100%;
  }
  .footer-docs::before {
    content: none;
  }
}

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--ca-radius-md);
  font: 600 14px/1.25 var(--ca-font-sans);
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition:
    background-color var(--ca-dur-2) var(--ca-ease),
    border-color var(--ca-dur-2) var(--ca-ease),
    color var(--ca-dur-2) var(--ca-ease),
    transform var(--ca-dur-1) var(--ca-ease);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button .ca-icon-ext {
  margin-left: 0;
}
.primary {
  background: var(--ca-accent);
  color: var(--ca-on-accent);
}
.primary:hover:not(:disabled) {
  background: var(--ca-accent-hover);
}
.primary:disabled {
  background: #47362f;
  color: #d2b1a3;
  border-color: #61483b;
  cursor: default;
}
.secondary {
  color: var(--ca-text);
  background: transparent;
  border-color: var(--ca-line);
}
.secondary:hover:not(:disabled) {
  background: var(--ca-hover);
  border-color: var(--ca-line-strong);
}

/* ---------- dialogs (product, phone menu, explanations) ---------- */
.store-dialog {
  background: var(--ca-raised);
  color: var(--ca-text);
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-radius-xl);
  padding: 32px;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  box-shadow: var(--ca-shadow-pop);
}
.store-dialog::backdrop {
  background: rgb(14 13 12 / 0.72);
  backdrop-filter: blur(4px);
}
.store-dialog h2 {
  font: 500 28px/1.25 var(--ca-font-serif);
  letter-spacing: -0.02em;
  margin: 8px 0 24px;
}
.store-dialog .button {
  width: 100%;
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--ca-radius-md);
  background: transparent;
  color: var(--ca-text-2);
  cursor: pointer;
  transition: background-color var(--ca-dur-2) var(--ca-ease), color var(--ca-dur-2) var(--ca-ease);
}
.dialog-close:hover {
  background: var(--ca-hover);
  color: var(--ca-text);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-radius-md);
  background: transparent;
  color: var(--ca-text-2);
  cursor: pointer;
  transition: background-color var(--ca-dur-2) var(--ca-ease), color var(--ca-dur-2) var(--ca-ease);
}
.icon-button:hover {
  background: var(--ca-hover);
  color: var(--ca-text);
}
.menu-dialog .menu-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-dialog .header-cta {
  margin-top: 12px;
}
/* Entrance: the dialog rises 8 px and fades in, the backdrop fades with it. Closing is instant — the page
   behind is what the visitor wants back. Engines without @starting-style just snap open. */
.store-dialog[open] {
  transition:
    opacity var(--ca-dur-2) var(--ca-ease),
    transform var(--ca-dur-3) var(--ca-ease);
}
.store-dialog[open]::backdrop {
  transition: opacity var(--ca-dur-2) var(--ca-ease);
}
@starting-style {
  .store-dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  .store-dialog[open]::backdrop {
    opacity: 0;
  }
}

/* ---------- the top bar folds: the places into the menu sheet (180: the light button is gone) ---------- */
@media (max-width: 1023px) {
  .shell-top .site-header {
    padding: 0 var(--ca-gutter); /* 137.9.5: the menu button's border sits on the page edge */
  }
  .top-nav,
  .top-actions {
    display: none;
  }
  .mobile-menu {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--ca-line);
    border-radius: var(--ca-radius-md);
    background: transparent;
    color: var(--ca-text);
    cursor: pointer;
    transition: background-color var(--ca-dur-2) var(--ca-ease);
  }
  .mobile-menu:hover {
    background: var(--ca-hover);
  }
  .mobile-menu .ca-icon {
    width: 20px;
    height: 20px;
  }
  /* The sheet hangs right under the bar, full width; the bar itself stays undimmed above it
     (::backdrop does not inherit custom properties everywhere — 56 px is --ca-top-h here). */
  .menu-dialog {
    position: fixed;
    inset: var(--ca-top-h) 0 auto 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - var(--ca-top-h));
    overflow: auto;
    padding: 8px 16px 20px;
    border-width: 0 0 1px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 24px 48px rgb(0 0 0 / 0.45);
  }
  .menu-dialog::backdrop {
    background: linear-gradient(to bottom, transparent 56px, rgb(14 13 12 / 0.72) 56px);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .menu-dialog h2 {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0 56px 4px 12px;
    color: var(--ca-text-3);
    font: 500 13px/1.3 var(--ca-font-sans);
    letter-spacing: 0;
  }
  .menu-dialog .dialog-close {
    top: 10px;
    right: 12px;
  }
  .menu-dialog .nav-link {
    min-height: 48px;
    font-size: 15px;
  }
  .menu-dialog .menu-cta {
    margin-top: 14px;
    min-height: 48px;
  }
}
@media (max-width: 650px) {
  .brand {
    padding: 0;
    font-size: 22px;
    gap: 9px;
  }
  .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .store-dialog {
    padding: 26px 22px 22px;
    border-radius: 18px;
  }
  .menu-dialog {
    padding: 8px 12px 18px;
    border-radius: 0 0 18px 18px;
  }
}
@starting-style {
  .menu-dialog[open] {
    transform: translateY(-8px);
  }
}
@media (max-width: 420px) {
  .icon-button {
    width: 44px;
    height: 44px;
  }
}
@media (pointer: coarse) {
  .nav-link {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-link .ca-icon,
  .top-link,
  .top-button,
  .mobile-menu,
  .button,
  .dialog-close,
  .store-dialog,
  .store-dialog::backdrop {
    transition: none !important;
  }
  .button:active:not(:disabled) {
    transform: none;
  }
}

/* ---------- 156.6: the account place on the bar (shell.py account(), shell.js) ---------- */
.top-account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}
.top-login {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--ca-radius-md);
  color: var(--ca-text-2);
  font: 600 14px/1.2 var(--ca-font-sans);
  white-space: nowrap;
  text-decoration: none;
  transition:
    color var(--ca-dur-2) var(--ca-ease),
    background-color var(--ca-dur-2) var(--ca-ease);
}
.top-login:hover {
  color: var(--ca-text);
  background: rgb(255 255 255 / 0.05);
}
/* «Рефералка»: the one bright pill of the bar — explicit, not loud */
.top-ref {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  background: var(--ca-accent);
  color: var(--ca-on-accent);
  font: 700 14px/1.2 var(--ca-font-sans);
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgb(217 119 87 / 0.45);
  transition:
    background-color var(--ca-dur-2) var(--ca-ease),
    box-shadow var(--ca-dur-3) var(--ca-ease);
}
.top-ref:hover {
  background: var(--ca-accent-hover);
  box-shadow: 0 0 0 4px rgb(217 119 87 / 0.18);
}
.top-ref .ca-icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}
.top-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 40px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--ca-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ca-text);
  font: 600 14px/1.2 var(--ca-font-sans);
  cursor: pointer;
  transition:
    background-color var(--ca-dur-2) var(--ca-ease),
    border-color var(--ca-dur-2) var(--ca-ease);
}
.top-me:hover,
.top-me[aria-expanded="true"] {
  background: var(--ca-hover);
  border-color: var(--ca-line-strong);
}
.top-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ca-accent-soft);
  color: var(--ca-accent-text);
  font: 700 14px/1 var(--ca-font-sans);
}
.top-avatar .ca-icon {
  width: 17px;
  height: 17px;
}
.top-me-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-me-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 7;
  display: grid;
  gap: 2px;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-radius-lg);
  background: var(--ca-raised);
  box-shadow: var(--ca-shadow-pop);
}
.top-me-menu[hidden] {
  display: none;
}
.top-me-who {
  display: grid;
  gap: 2px;
  margin: 0 0 6px;
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--ca-line);
  color: var(--ca-text-3);
  font: 500 13px/1.35 var(--ca-font-sans);
  overflow-wrap: anywhere;
}
.top-me-who b {
  color: var(--ca-text);
  font-weight: 600;
}
.top-me-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--ca-radius-md);
  background: transparent;
  color: var(--ca-text-2);
  font: 500 14px/1.3 var(--ca-font-sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.top-me-item:hover,
.top-me-item[aria-current="page"] {
  background: var(--ca-hover);
  color: var(--ca-text);
}
.top-me-item .ca-icon {
  color: var(--ca-text-3);
}
/* the phone sheet: «Личный кабинет» with the name under it, «Рефералка» lit */
.nav-sub {
  display: block;
  color: var(--ca-text-3);
  font-size: 12.5px;
  font-weight: 500;
}
.menu-nav .nav-ref {
  color: var(--ca-accent-text);
}
.menu-nav .nav-ref .ca-icon {
  color: var(--ca-accent-text);
}

/* The hint by «Рефералка»: under the bar, an arrow to the button; never over the bar (so never over the menu button) */
.ref-hint {
  position: fixed;
  z-index: 6;
  padding: 16px 44px 16px 16px;
  border: 1px solid #6b4a3c;
  border-radius: var(--ca-radius-lg);
  background: #34291f;
  color: var(--ca-text);
  box-shadow: var(--ca-shadow-pop);
  font: 400 14px/1.45 var(--ca-font-sans);
  animation: ref-hint-in var(--ca-dur-3) var(--ca-ease);
}
.ref-hint::before {
  content: "";
  position: absolute;
  top: -7px;
  left: calc(var(--arrow, 50%) - 7px);
  width: 12px;
  height: 12px;
  border: solid #6b4a3c;
  border-width: 1px 0 0 1px;
  background: #34291f;
  transform: rotate(45deg);
}
.ref-hint-title {
  margin: 0 0 6px;
  font: 600 16px/1.3 var(--ca-font-serif);
}
.ref-hint p {
  margin: 0 0 12px;
  color: var(--ca-text-2);
}
.ref-hint b {
  color: var(--ca-text);
  white-space: nowrap;
}
.ref-hint-go {
  color: var(--ca-accent-text);
  font-weight: 600;
  text-underline-offset: 3px;
}
.ref-hint-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--ca-radius-md);
  background: transparent;
  color: var(--ca-text-3);
  cursor: pointer;
}
.ref-hint-close:hover {
  background: rgb(255 255 255 / 0.06);
  color: var(--ca-text);
}
@keyframes ref-hint-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@media (max-width: 1179px) {
  .top-me-name {
    display: none;
  }
  .top-me {
    padding: 0 4px;
  }
}
@media (max-width: 1023px) {
  /* the places fold into the sheet; the account stays on the bar: «Войти» or «Рефералка» (the avatar menu moves into
     the sheet — «Личный кабинет», «Выйти») */
  .top-account {
    margin-left: auto;
  }
  .top-account ~ .mobile-menu {
    margin-left: 8px;
  }
  .top-me,
  .top-me-menu {
    display: none;
  }
  .top-ref {
    min-height: 38px;
    padding: 0 13px 0 11px;
    font-size: 13.5px;
  }
}
/* 170.3: «Пригласить друга» длиннее прежней «Рефералки» — на телефоне подпись в две строки, кнопка той же высоты */
@media (max-width: 520px) {
  .top-ref span {
    width: min-content;
    white-space: normal;
    font-size: 12.5px;
    line-height: 1.08;
  }
  .shell-top .brand {
    margin-right: 0;
  }
}
/* 170.3: кнопка меню и «Пригласить друга» не сжимаются (кнопка меню сжималась до 22 px ещё с «Рефералкой»);
   место даёт отступ за именем сайта (20 px, на телефоне его и так держит margin-left: auto), на 360–374 px —
   имя сайта и поля кнопки */
@media (max-width: 1023px) {
  .mobile-menu,
  .top-ref {
    flex-shrink: 0;
  }
}
@media (max-width: 374px) {
  .brand {
    font-size: 19px;
    gap: 7px;
  }
  .top-ref {
    gap: 6px;
    padding: 0 10px 0 9px;
  }
}
@media (max-width: 359px) {
  .top-ref span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .top-ref {
    padding: 0 11px;
  }
}
/* 170.4: шапка не шире окна при любом имени. shell.js добавляет шаги по очереди, пока шапка не влезет: fit-name — без
   имени у аватара (оно есть в меню аккаунта), fit-support — «Поддержка» одним значком. Ниже 1024 px места уходят в меню. */
@media (min-width: 1024px) {
  /* a long name first shortens with «…» (not below 72 px), only then the step fit-name hides it */
  .top-account {
    min-width: 0;
  }
  .top-me {
    min-width: 128px; /* 2 + 4 + avatar 30 + 8 + name 72 + 12 */
  }
  .top-me-name {
    min-width: 0;
  }
}
.site-header.fit-name .top-me-name {
  display: none;
}
.site-header.fit-name .top-me {
  min-width: 0;
  padding: 0 4px;
}
.site-header.fit-support .top-support {
  gap: 0;
  padding: 0 11px;
}
.site-header.fit-support .top-support > span:not(.ca-sr) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* лист меню на 900–1023 px висит под шапкой высотой 72 px (--ca-top-h), а не 56 */
@media (min-width: 900px) and (max-width: 1023px) {
  .menu-dialog::backdrop {
    background: linear-gradient(to bottom, transparent 72px, rgb(14 13 12 / 0.72) 72px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ref-hint {
    animation: none;
  }
  .top-ref,
  .top-me,
  .top-login {
    transition: none !important;
  }
}

/* 156.5c: the invitee's banner (shell.js) — the first block under the bar, in the flow: it moves the page down and never
   covers the bar or the menu sheet. The same warm clay tile as the partner's hint, page-wide like the bar's content. */
.inv-bar {
  padding: 14px max(var(--ca-gutter), calc((100% - var(--ca-wrap)) / 2)) 0;
  font-family: var(--ca-font-sans);
  animation: inv-bar-in var(--ca-dur-3) var(--ca-ease);
}
.inv-bar-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px 18px;
  padding: 14px 52px 14px 16px;
  border: 1px solid #6b4a3c;
  border-radius: var(--ca-radius-lg);
  background: #34291f;
  color: var(--ca-text);
}
.inv-bar-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ca-accent-soft);
  color: var(--ca-accent-text);
}
.inv-bar-icon .ca-icon {
  width: 22px;
  height: 22px;
}
.inv-bar-body {
  flex: 1;
  min-width: 0;
}
.inv-bar-title {
  margin: 0 0 3px;
  font: 600 16px/1.3 var(--ca-font-serif);
}
.inv-bar-text {
  margin: 0;
  color: var(--ca-text-2);
  font-size: 14px;
  line-height: 1.45;
}
.inv-bar-go {
  flex: none;
}
.inv-bar-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--ca-radius-md);
  background: transparent;
  color: var(--ca-text-3);
  cursor: pointer;
}
.inv-bar-close:hover {
  background: rgb(255 255 255 / 0.06);
  color: var(--ca-text);
}
@keyframes inv-bar-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@media (max-width: 650px) {
  /* the phone: the text under the title, the button on its own line, full width */
  .inv-bar-in {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 14px 48px 14px 14px;
  }
  .inv-bar-body {
    flex-basis: calc(100% - 54px);
  }
  .inv-bar-go {
    width: 100%;
    margin-right: -34px;
  }
}
@media (min-width: 1180px) {
  /* the home page from 1180 px: the right rail (home.css .rail, fixed) takes --rail-w — the banner stays in the left
     column, as wide as the column's own blocks (.home > *), so the button and «×» are never under the rail */
  .home-page .inv-bar {
    margin-right: var(--rail-w);
    padding: 14px 0 0;
  }
  .home-page .inv-bar-in {
    width: min(var(--col), 100% - 80px);
    margin: 0 auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .inv-bar {
    animation: none;
  }
}

/* 137.10.7: the bar on a phone — the menu button is always whole on the screen, no sideways scroll.
   Before: every item of the bar could shrink, so the menu button was squeezed from 42 px to 22 px and then pushed past
   the screen edge (320 px «Войти» — 0.9 px; 360–393 px signed in — up to 18 px, the button off the screen).
   Now only the brand gives way: its size follows the screen width (no truncation from 320 px with «Войти» and from 360 px
   signed in), and as the last resort its word is cut with an ellipsis instead of pushing the menu out. */
body.shell-top {
  margin: 0; /* cabinet, login, referral had the UA 8 px margin: the bar did not reach the screen edges */
}
.shell-top .site-header {
  box-sizing: border-box;
}
@media (max-width: 899px) {
  .shell-top .site-header > * {
    flex-shrink: 0;
  }
  .shell-top .brand {
    flex-shrink: 1;
    min-width: 0;
    margin-right: 0; /* the account keeps its distance by margin-left: auto and the bar gap */
  }
  .shell-top .brand-word {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 520px) {
  .shell-top .brand {
    font-size: clamp(16px, 15.8vw - 32px, 22px);
  }
  .shell-top .site-header:has(.top-ref) .brand {
    font-size: clamp(16px, 15.8vw - 41.5px, 22px);
  }
}

/* 137.11.1: «кнопки-разделы» на телефоне (sections.js). Классы ds-sec* ставит только скрипт и только при ширине
   ≤ 899 px, поэтому компьютер и страница без JS этих правил не видят. Раздел = заголовок с кнопкой-строкой внутри
   (название, суть одной строкой, стрелка) + панель hidden="until-found". */
.ds-sec {
  overflow-anchor: none; /* закрытие длинной панели выше не тянет экран за собой (Bootstrap #31341) */
}
[data-sections].ds-sec .ds-sec-wrap {
  margin: 0;
  padding: 0;
  border: 0;
  scroll-margin-top: 0; /* answer.css, legal.css: вместе со scroll-padding-top шапки — двойной отступ */
}
[data-sections].ds-sec .ds-sec-head {
  margin: var(--ca-space-2) 0 0;
  padding: 0;
  border: 0;
  font: inherit;
  letter-spacing: normal;
  scroll-margin-top: 0; /* claude.css .cl-more h2: +24 px сверх scroll-padding-top — заголовок не вставал под шапку */
}
.ds-sec-row {
  display: flex;
  align-items: center;
  gap: var(--ca-space-3);
  box-sizing: border-box;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ca-line);
  border-radius: var(--ca-radius-lg);
  background: rgb(255 255 255 / 0.035);
  color: var(--ca-text);
  -webkit-text-fill-color: currentColor;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ds-sec-row[aria-expanded="true"] {
  border-color: var(--ca-accent);
  background: rgb(217 119 87 / 0.08);
}
.ds-sec-row:focus-visible,
.ds-sec-next:focus-visible,
.ds-sec-up:focus-visible {
  outline: 2px solid var(--ca-focus);
  outline-offset: 2px;
}
.ds-sec-t {
  flex: 1;
  min-width: 0;
}
.ds-sec-name {
  display: block;
  font: 600 16px/1.25 var(--ca-font-sans);
  overflow-wrap: anywhere;
}
.ds-sec-sum {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ca-text-3);
  font: 400 13px/1.3 var(--ca-font-sans);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ds-sec-ch {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--ca-text-2);
  transition: transform var(--ca-dur-2) var(--ca-ease);
}
.ds-sec-row[aria-expanded="true"] .ds-sec-ch {
  transform: rotate(90deg);
}
.ds-sec-row[aria-expanded="true"] .ds-sec-sum {
  display: none; /* раздел открыт — строка сути повторяла бы его первую фразу */
}
/* закрытая панель: content-visibility скрывает текст, но рамка коробки осталась бы — у панели нет своих полей;
   [hidden] { display: none !important } страниц (claude.css, answer.css, legal.css) отключил бы «Найти на странице» */
.ds-sec-panel {
  margin: 0;
  padding: 0;
  border: 0;
}
.ds-sec-panel[hidden="until-found"] {
  display: block !important;
}
.ds-sec-panel:not([hidden]) {
  padding: var(--ca-space-2) 2px var(--ca-space-3);
}
.ds-sec-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ca-space-3);
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin-top: var(--ca-space-4);
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.06);
  color: var(--ca-text);
  -webkit-text-fill-color: currentColor;
  font: 500 14.5px/1.25 var(--ca-font-sans);
  text-align: left;
  cursor: pointer;
}
/* «↑ Разделы» — слева внизу, кнопка чата справа (claude.css .chat-fab, z-index 40) её не перекрывает */
.ds-sec-up {
  position: fixed;
  left: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--ca-line);
  border-radius: 22px;
  background: rgb(35 35 33 / 0.94);
  color: var(--ca-text);
  -webkit-text-fill-color: currentColor;
  font: 600 14px/1 var(--ca-font-sans);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.4);
  cursor: pointer;
}
.ds-sec-up[hidden] {
  display: none;
}
.ds-sec-up-ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) {
  .ds-sec-ch {
    transition: none;
  }
}
@media print {
  .ds-sec-panel[hidden] {
    display: block !important;
    content-visibility: visible;
  }
  .ds-sec-next,
  .ds-sec-up,
  .ds-sec-sum,
  .ds-sec-ch {
    display: none !important;
  }
}
/* 172.14: ссылка «сторис» в тексте (плашка друга, подарок за вход) — окно сторис Mini App */
.ca-story-link {
  color: var(--ca-accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
