/* promacro.store — the look of promacro.ru (../promacro.ru/src/styles/global.css, Header.astro, Footer.astro).
   Keep tokens and component names in sync with that site. */

@layer reset, base, layout, components, utilities;

/* ---- fonts: files restored by LibMan (libman.json) into /lib/fonts ---- */
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 600; font-display: swap; src: url(/lib/fonts/exo-2/files/exo-2-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 600; font-display: swap; src: url(/lib/fonts/exo-2/files/exo-2-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-cyrillic-400-italic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 600; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 600; font-display: swap; src: url(/lib/fonts/roboto/files/roboto-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* hints (format explanations): Roboto Mono, the monospace sibling of the body font; downloaded only when a hint is shown */
@font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/lib/fonts/roboto-mono/files/roboto-mono-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/lib/fonts/roboto-mono/files/roboto-mono-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  /* the place of the scrollbar is kept on short pages too (contacts): otherwise the centered layout jumps sideways between pages */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
  img, svg, video, iframe { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
}

@layer base {
  .review-rating { border: 0; padding: 0; }
  .review-stars { display: inline-flex; }
  .review-stars label { position: relative; cursor: pointer; }
  .review-score { color: var(--link); font-size: var(--step-2); letter-spacing: .08em; }
  .review-approved { color: color-mix(in srgb, var(--success) 80%, var(--ink)); font-size: var(--step--1); }
  .review-stars input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .review-stars span { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; font-size: 2rem; color: var(--ink-2); }
  .review-stars span::before { content: '☆'; }
  .review-stars label:has(:checked) span::before, .review-stars label:has(~ label :checked) span::before { content: '★'; color: var(--link); }
  .review-stars input:focus-visible + span { outline: 2px solid var(--link); }
  .review-body { white-space: pre-wrap; overflow-wrap: anywhere; }
  :root {
    color-scheme: light dark;
    /* brand: promacro navy + cyan */
    --ink: #13202e;
    --ink-2: #3a4f66;
    --paper: #f3f6f8;
    --surface: #ffffff;
    --line: #d5dee5;
    --cyan: #00c8ff;
    --warm: #f28a5c;
    --link: #00718f; /* 5.1:1 on --paper, 5.6:1 on --surface (WCAG AA) */
    --success: #1f8a5b;
    --warning: #c77d00;
    --danger: #c23a3a;
    --info: #00718f;

    --font-display: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Roboto', 'Segoe UI', system-ui, sans-serif;

    /* modular scale 1.25 on 18px */
    --step--1: 0.889rem;
    --step-0: 1.125rem;
    --step-1: 1.406rem;
    --step-2: 1.758rem;
    --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem);
    --step-4: clamp(2.3rem, 1.5rem + 3.6vw, 3.6rem);

    --gutter: clamp(16px, 4vw, 40px);
    --measure: 72ch;
    --radius: 6px;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
      --ink: #e3ebf1;
      --ink-2: #a8b9c9;
      --paper: #0f1a26;
      --surface: #15243a;
      --line: #263a52;
      --link: #3fd2ff;
      --success: #4cc28c;
      --warning: #f2b23c;
      --danger: #f07070;
      --info: #3fd2ff;
    }
  }
  :root[data-theme='light'] { color-scheme: light; }
  :root[data-theme='dark'] {
    color-scheme: dark;
    --ink: #e3ebf1;
    --ink-2: #a8b9c9;
    --paper: #0f1a26;
    --surface: #15243a;
    --line: #263a52;
    --link: #3fd2ff;
    --success: #4cc28c;
    --warning: #f2b23c;
    --danger: #f07070;
    --info: #3fd2ff;
  }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  [id] { scroll-margin-top: 16px; }

  body {
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--step-0) / 1.6 var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }
  h1 { font-size: var(--step-4); letter-spacing: -0.01em; }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-2); }
  h4 { font-size: var(--step-1); }
  h5, h6 { font-size: var(--step-0); }

  a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }

  strong, b { font-weight: 600; }
  code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.3em; }

  .skip-link { position: absolute; left: -9999px; }
  .skip-link:focus { left: var(--gutter); top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }
}

@layer layout {
  .wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
  .wrap.narrow { max-width: calc(480px + 2 * var(--gutter)); }
  main { flex: 1; padding-block: clamp(24px, 4vw, 48px) clamp(48px, 8vw, 96px); }
  main h1 + * { margin-top: 0.6em; }
  .maintenance-page { min-height: 100vh; }
  .maintenance { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
  .maintenance__card { width: min(100%, 620px); padding: clamp(32px, 7vw, 72px) clamp(24px, 6vw, 64px); text-align: center; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cyan); border-radius: var(--radius); box-shadow: 0 18px 50px rgb(19 32 46 / 0.12); }
  .maintenance__logo { display: block; width: 150px; height: auto; margin-inline: auto; margin-bottom: 24px; }
  .maintenance__card h1 { font-size: var(--step-3); }
  .maintenance__card .lead { max-width: none; margin: 16px auto 0; }
}

@layer components {
  .lead { font-size: var(--step-1); color: var(--ink-2); max-width: var(--measure); }
  .lead + p { margin-top: 1.5em; }
  .plain-list { margin-top: 1em; padding-left: 1.3em; }
  .plain-list li + li { margin-top: 0.3em; }

  /* callouts: the left rule colour encodes the type */
  .note {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--note, var(--info));
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 18px;
  }
  .note strong:first-child { display: block; font-family: var(--font-display); color: var(--note, var(--info)); margin-bottom: 2px; }
  .note p + p { margin-top: 4px; }
  .note--success { --note: var(--success); }
  .note--warning { --note: var(--warning); }
  .telegram-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 1.5em; }
  .telegram-invite p { flex: 1 1 260px; }
  .note--danger { --note: var(--danger); }
  .note--action { display: flex; align-items: center; gap: 12px 16px; }
  .note--action form { margin: 0; }
  .note--action .note__text { flex: 1 1 auto; }

  .toast-stack {
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 12px;
    width: min(440px, calc(100vw - 40px));
    pointer-events: none;
  }
  .toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--note, var(--info));
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 12px 30px rgb(19 32 46 / 0.24);
    pointer-events: auto;
    animation: toast-in 180ms ease-out;
  }
  .toast--success { --note: var(--success); }
  .toast--danger { --note: var(--danger); }
  .toast__text { flex: 1 1 auto; min-width: 0; }
  .toast__close { flex: 0 0 auto; border: 0; padding: 0 2px; background: transparent; color: var(--ink-2); font-size: 1.5rem; line-height: 1; cursor: pointer; }
  .toast__close:hover { color: var(--ink); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @media (max-width: 600px) {
    .toast-stack { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  }
  @media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step-0);
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 2px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    cursor: pointer;
  }
  .btn:hover { background: transparent; color: var(--ink); }
  .btn--ghost { background: transparent; color: var(--ink); }
  .btn--ghost:hover { background: var(--ink); color: var(--paper); }
  .btn--small { font-size: var(--step--1); padding: 6px 14px; }

  /* forms: same panel as the download box / DPI calculator on promacro.ru */
  .form { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cyan); border-radius: 0 0 var(--radius) var(--radius); padding: 20px 24px 24px; }
  .form label { display: grid; gap: 6px; font-weight: 500; line-height: 1.35; }
  .form label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
  .form input:not([type='checkbox']), .form select, .form textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
  .form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { border-color: var(--link); }
  .form input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--link); }
  .form .btn { justify-self: start; }
  .checkout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "order" "terms" "payment";
    padding: clamp(16px, 2.5vw, 32px);
  }
  .checkout__order, .checkout__terms, .checkout__payment {
    display: grid; align-content: start; gap: 16px; min-width: 0;
  }
  .checkout__order { grid-area: order; }
  .checkout__terms { grid-area: terms; }
  .checkout__payment { grid-area: payment; }
  .checkout .buy-box {
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 0 16px;
  }
  .checkout .buy-box__price { white-space: nowrap; }
  .checkout__product {
    display: grid; grid-template-columns: clamp(44px, 5vw, 56px) minmax(0, 1fr);
    align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere;
  }
  .checkout__product img { display: block; width: 100%; height: auto; }
  .checkout .check input { flex-shrink: 0; }
  @media (min-width: 860px) {
    .checkout {
      grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
      grid-template-rows: auto 1fr;
      grid-template-areas: "order terms" "payment terms";
      column-gap: clamp(24px, 3vw, 40px);
    }
    .checkout__terms { border-left: 1px solid var(--line); padding-left: clamp(24px, 3vw, 40px); }
  }
  .checkout-offer { min-width: 0; }
  .checkout-offer > h2 { margin-bottom: 8px; font-size: var(--step-1); }
  .checkout-offer__text {
    max-height: min(18rem, 45vh); overflow: auto; overflow-wrap: anywhere;
    padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .checkout-offer__text h2 { font-size: var(--step-1); }
  .form-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--step--1); }

  /* ---- header (Header.astro) ---- */
  .site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
  /* the menu of promacro.ru plus the shop's items is long: the bar gets more width than the page text.
     Equal side columns keep the menu in the middle of the page as long as the right part fits its column */
  .bar { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: center; gap: 20px; min-height: 72px; max-width: 1440px; }
  .logo { justify-self: start; }
  .logo img { width: 115px; height: auto; }
  .bar-end { justify-self: end; display: flex; align-items: center; gap: 12px; }

  .menu { list-style: none; padding: 0; display: flex; }
  .menu a { color: var(--ink); text-decoration: none; display: block; }
  .menu > li > a { font-family: var(--font-display); font-weight: 600; font-size: 1rem; padding: 10px 6px; border-radius: var(--radius); white-space: nowrap; }
  .menu > li > a:hover, .menu > li > a[aria-current], .menu > li.active > a { color: var(--link); }
  .menu > li { position: relative; }
  .has-sub > a::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
  .sub { list-style: none; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 270px; max-height: calc(100vh - 140px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px -12px rgb(19 32 46 / 0.35); display: none; }
  .has-sub:hover > .sub, .has-sub:focus-within > .sub { display: block; }
  .sub a { padding: 7px 10px; border-radius: 4px; font-size: var(--step--1); font-weight: 500; }
  .sub a:hover, .sub a[aria-current] { background: var(--paper); color: var(--link); }
  .sub ul { list-style: none; padding: 0 0 4px 12px; margin-left: 10px; border-left: 2px solid var(--line); }
  /* a tall dropdown: two columns, the biggest group (rendered last) starts the second one */
  .sub--cols { width: 530px; columns: 2; column-gap: 12px; }
  .sub--cols > li { break-inside: avoid; }
  .sub--cols > li.side-group { break-before: column; }

  .bar-link { background: none; border: 0; padding: 4px 2px; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: var(--step--1); text-decoration: none; cursor: pointer; white-space: nowrap; }
  .bar-link:hover { color: var(--link); }
  .bar-end > .bar-link--wide { min-inline-size: 5.5em; text-align: center; }
  .bar-end > .btn { min-inline-size: 7em; justify-content: center; white-space: nowrap; }
  .inline-form { display: contents; }

  .lang-switch { display: flex; width: max-content; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
  .lang-switch--menu { display: none; margin-top: 12px; }
  .lang-switch a { padding: 3px 10px; font-family: var(--font-display); font-weight: 600; font-size: var(--step--1); color: var(--ink-2); text-decoration: none; }
  .lang-switch a:hover { color: var(--link); }
  .lang-switch a[aria-current] { background: var(--ink); color: var(--paper); }

  .menu-toggle { display: none; align-items: center; gap: 10px; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; font-family: var(--font-display); font-weight: 600; cursor: pointer; }
  .burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
  .burger::before, .burger::after { content: ''; position: absolute; }
  .burger::before { top: -6px; }
  .burger::after { top: 6px; }

  /* the shop bar has more on the right than promacro.ru (language, sign-in, bell, cabinet): the menu folds earlier */
  @media (max-width: 1400px) {
    /* logo and the menu button on the left, the rest pushed to the right */
    .bar { display: flex; position: relative; }
    .bar-end { margin-left: auto; }
    .menu-toggle { display: inline-flex; }
    /* the menu opens under its button: a panel on the left edge of the bar, not across the whole page */
    .site-nav { display: none; position: absolute; top: calc(100% + 8px); left: var(--gutter); width: min(340px, calc(100% - 2 * var(--gutter))); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px -12px rgb(19 32 46 / 0.35); padding: 8px 20px 16px; }
    .nav-open .site-nav { display: block; }
    .site-nav { max-height: calc(100vh - 120px); overflow-y: auto; }
    .menu { flex-direction: column; }
    .menu > li > a { padding-inline: 0; }
    .sub, .sub--cols { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 8px 12px; min-width: 0; width: auto; max-height: none; overflow: visible; columns: auto; }
    .has-sub > a::after { display: none; }
  }
  @media (max-width: 720px) {
    .bar { gap: 12px; }
    .bar-end { gap: 8px; }
    .bar .logo img { width: 80px; }
    .menu-toggle { padding: 8px 10px; font-size: 0; gap: 0; }
  }
  @media (max-width: 640px) {
    .bar .logo img { width: 96px; }
    .lang-switch--bar { display: none; }
    .lang-switch--menu { display: flex; }
    .bar-link--wide { display: none; }
  }
  @media (max-width: 420px) {
    .bar { gap: 6px; padding-inline: 8px; }
    .bar-end { gap: 6px; }
    .bar .logo img { width: 60px; }
    .bar .menu-toggle, .bar-end > .btn { padding-inline: 6px; }
    .bar-end > .btn { min-inline-size: 5.75em; }
  }

  /* ---- pack service home ---- */
  main:has(> .home-hero) { display: grid; align-items: center; min-height: 65svh; padding-block: clamp(24px, 5vh, 56px); }
  @media (min-width: 761px) {
    body:has(main > .home-hero) {
      display: grid;
      grid-template: "header" auto "hero" 1fr "links" auto "legal" auto / minmax(0, 1fr);
    }
    /* Reserve the first screen for the header, hero and footer links together. */
    body:has(main > .home-hero)::before { content: ""; grid-area: header-start / 1 / links-end / -1; min-height: 100svh; pointer-events: none; }
    body:has(main > .home-hero) > .site-header { grid-area: header; }
    main:has(> .home-hero) { grid-area: hero; min-height: auto; }
    main:has(> .home-hero) + .site-footer { grid-area: links-start / 1 / legal-end / -1; display: grid; grid-template-rows: subgrid; }
    main:has(> .home-hero) + .site-footer .grid { margin-bottom: 16px; }
    main:has(> .home-hero) + .site-footer .legal { margin-top: 0; }
  }
  .home-hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px 48px; align-items: center; }
  .home-hero h1 { font-size: var(--step-4, 2.4rem); line-height: 1.1; max-width: 16ch; }
  .home-hero .lead { margin-top: 16px; max-width: 46ch; }
  .home-hero__actions { display: flex; flex-wrap: wrap; align-items: flex-start; width: fit-content; max-width: 100%; gap: 12px; margin-top: 28px; }
  .home-hero__actions > * { flex: 1 1 auto; }
  .home-hero__actions .btn { justify-content: center; }
  .home-hero__downloads { display: grid; justify-items: center; gap: 4px; }
  .home-hero__downloads > .btn { justify-self: stretch; }
  .home-hero__downloads > a:not(.btn) { font-size: 0.9em; }
  .home-hero__mascot { width: 100%; height: auto; justify-self: center; }
  .shop { margin-top: clamp(32px, 5vw, 56px); }
  .shop h2 { font-size: var(--step-2); } /* small (decision of the owner): the shop starts high; kept for search — the h1 has no keywords */
  @media (max-width: 760px) {
    .home-hero { grid-template-columns: minmax(0, 1fr) clamp(80px, 22vw, 120px); gap: 16px; }
    .home-hero__text { display: contents; }
    .home-hero h1 { grid-column: 1; font-size: var(--step-3, 1.8rem); }
    .home-hero__mascot { grid-column: 2; grid-row: 1; }
    .home-hero .lead, .home-hero__actions { grid-column: 1 / -1; margin-top: 0; }
  }
  @media (max-width: 400px) { .home-hero__actions { display: grid; } }
  .game-grid { list-style: none; padding: 0; margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
  .game-card { display: grid; height: 100%; grid-template-rows: auto 1fr auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; }
  .game-card:hover { border-color: var(--link); }
  .game-card img, .game-card__placeholder { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
  .game-card__placeholder { display: grid; place-items: center; padding: 16px; background: #13202e; color: #f3f6f8; font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); text-align: center; }
  .game-card__name { padding: 14px 16px 0; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); line-height: 1.2; }
  .game-card__price { padding: 6px 16px 16px; color: var(--ink-2); }
  .shop { container-type: inline-size; }
  .category-grid { --columns: 2; --gap: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); margin-top: 20px; }
  .category-grid > li { flex: 0 0 calc((100% + var(--gap)) / var(--columns) - var(--gap)); display: flex; flex-direction: column; gap: 4px; align-items: center; min-width: 0; }
  /* Reserve room for «Универсальные» at the desktop heading size, including card padding and gaps. */
  @container (min-width: 39.5rem) {
    .category-grid { --columns: 3; --gap: 16px; }
  }
  @container (52.5rem <= width < 66rem) {
    /* Five categories stay in rows of three and two until all five fit. */
    .category-grid:not(:has(> :nth-child(5):last-child)) { --columns: 4; }
  }
  @container (min-width: 66rem) {
    .category-grid { --columns: 5; }
    .category-grid:has(> :nth-child(5n + 1):last-child) { --columns: 4; }
  }
  @container (39.5rem <= width < 66rem) {
    .category-grid:has(> :nth-child(6):last-child) { --columns: 3; }
  }
  @container (min-width: 66rem) {
    .category-grid:has(> :nth-child(6):last-child) { --columns: 6; --gap: 10px; }
    .category-grid:has(> :nth-child(6):last-child) .game-card__name { font-size: var(--step-0); }
  }
  .category-card { width: 100%; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; gap: 8px; padding: 16px 10px; text-align: center; }
  .category-card .game-card__name { display: grid; align-content: center; min-height: 2.4em; padding: 0; overflow-wrap: anywhere; text-wrap: balance; }
  .category-card img { width: min(100%, 160px); height: auto; object-fit: contain; }
  #game-cs2 .category-card img { scale: .93; }
  .category-card .game-card__price { grid-row: 3; padding: 0; font-size: var(--step--1); }
  @media (max-width: 560px) {
    .category-card { padding: 12px 8px; }
    .category-card .game-card__name { font-size: var(--step-0); }
  }
  @container (width < 20rem) {
    .category-card { padding-inline: 4px; }
    .category-card .game-card__name { font-size: 1rem; }
  }

  .crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; font-size: var(--step--1); color: var(--ink-2); }
  .crumbs a { color: var(--ink-2); }
  /* admin only: a strip of links to the admin forms under the crumbs (Russian, like the whole admin) */
  .admin-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 14px; padding: 6px 12px; border: 1px dashed var(--warm); border-radius: var(--radius); font-size: var(--step--1); }
  .admin-edit__label { font-weight: 600; color: var(--warm); }
  .admin-edit__group { display: contents; }
  .admin-edit__group[hidden], .admin-edit [hidden] { display: none; }
  .admin-edit__inline { font-size: var(--step--1); color: var(--warm); }

  /* game page: the layout of a product page on n1key.com — cover and facts | the choice and the texts | sticky buy box */
  [hidden] { display: none !important; }
  .wrap--wide { max-width: 1340px; }
  .product { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
  .product--no-image { grid-template-columns: 220px minmax(0, 1fr); }
  .product__aside { display: grid; gap: 14px; min-width: 0; position: sticky; top: 16px; }
  .product__cover { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
  .product__facts { list-style: none; padding: 14px 16px; margin: 0; display: grid; gap: 8px; font-size: var(--step--1); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .product__facts li { padding-left: 16px; position: relative; }
  .product__facts li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
  .product__facts b { color: var(--ink); font-weight: 600; }
  .product__body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "main buy" "info buy"; gap: 24px; align-items: start; min-width: 0; }
  /* the choice card and, under it, the card of the chosen pack */
  .product__col { grid-area: main; display: grid; gap: 24px; min-width: 0; }
  @media (max-width: 760px) { .product__col { gap: 16px; } }
  .product__main { display: grid; gap: 24px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
  .product__head-img { display: none; }
  .product__main h1 { font-size: var(--step-3); }
  .product-lead { margin-top: -12px; color: var(--ink-2); max-width: var(--measure); }
  /* what is in the chosen pack: its own card under the choice, shown only while a pack with some text is chosen */
  .product__details { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
  .product__details:not(:has(> .product-pane:not([hidden], .product-pane--empty))) { display: none; }
  .product-pane { display: grid; gap: 16px; }
  .product-pane__title { font-size: var(--step-1); }
  .product__info { grid-area: info; min-width: 0; max-width: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
  .product__info > * { max-width: var(--measure); }

  /* the choice: step 1 mouse format, step 2 pack (tiles with the price), what is inside appears below once chosen */
  .step { display: grid; gap: 12px; }
  .step__title { font-size: var(--step-1); display: flex; align-items: center; gap: 10px; }
  .step__num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: var(--step--1); }
  .step-hint { color: var(--ink-2); font-size: var(--step--1); }
  .opt-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 8px; }
  .opt-tiles--seg { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .opt-tile { display: flex; min-width: 0; justify-content: space-between; align-items: baseline; gap: 10px; height: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 600; line-height: 1.25; }
  .opt-tiles--seg .opt-tile { justify-content: center; text-align: center; padding-inline: 30px; }
  /* "i" in the top right corner of a format button; the explanation floats under the buttons without moving the page */
  .opt-tiles__item { position: relative; }
  .opt-info { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--ink-2); border-radius: 50%; background: transparent; color: var(--ink-2); font: italic 600 12px/1 Georgia, serif; cursor: pointer; }
  .opt-info:hover, .opt-info[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
  /* the hint: a small rounded window right under its button, as wide as the button, a notch pointing at the "i" */
  .mouse-info__pane { --font-hint: 'Roboto Mono', ui-monospace, Consolas, monospace; position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; right: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgb(0 0 0 / 0.3); font: 400 13px / 1.45 var(--font-hint); text-align: left; }
  .mouse-info__pane::before { content: ""; position: absolute; top: -6px; right: 11px; width: 10px; height: 10px; background: inherit; border-top: 1px solid var(--line); border-left: 1px solid var(--line); transform: rotate(45deg); }
  .mouse-info__pane p + p, .mouse-info__pane ul, .mouse-info__pane ol { margin-top: 6px; }
  .mouse-info__pane ul, .mouse-info__pane ol { padding-left: 1.2em; }
  .opt-tile:hover { border-color: var(--ink-2); }
  .opt-tile[aria-current] { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
  /* the chosen format, pack and weapon in the brand colour of the mouse (by the slug: no inline styles under the CSP; other formats keep the site colour) */
  .opt-tile[data-mouse^="a4tech"] { --brand: #e1251b; }   /* A4Tech Bloody red */
  .opt-tile[data-mouse^="logitech"] { --brand: #00b8fc; } /* Logitech Blue */
  .opt-tile[data-mouse^="razer"] { --brand: #44d62c; }    /* Razer Green */
  .opt-tile[data-mouse][aria-current] { border-color: var(--brand, var(--cyan)); box-shadow: inset 0 0 0 1px var(--brand, var(--cyan)); }
  .opt-tile__text { min-width: 0; overflow-wrap: break-word; }
  .opt-tile__mod { color: var(--ink-2); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; max-width: 100%; }
  .opt-tile[aria-current] .opt-tile__mod { color: var(--ink); }
  /* full packs, then single weapons: up to 15 weapons stay compact — name over price, more tiles per row */
  .pack-groups { display: grid; gap: 10px; }
  .pack-groups__title { font-size: var(--step-0); color: var(--ink-2); margin-top: 6px; }
  /* name and price on one line while they fit ("AK47 ··· 499 ₽"), a long name pushes the price to the next line */
  /* the upgrade credit of the signed-in customer: "для вас −300 ₽" under the price */
  .opt-tile[data-pack]:not(.opt-tile--image) { flex-wrap: wrap; row-gap: 4px; }
  .opt-tile__credit { flex-basis: 100%; color: var(--success); font-size: var(--step--1); font-weight: 600; white-space: nowrap; }
  /* a tile with a picture (weapon silhouette 2:1): picture on top, then the name and the price */
  .opt-tile--image { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; }
  .opt-tile__img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: contain; margin-bottom: 4px; }
  /* store front cards: name, price "от", then a badge per mouse of the game — the ones without this pack faded */
  .opt-tile--card { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; }
  .mouse-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 6px; }
  .mouse-badge { padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-body); font-size: 0.75rem; font-weight: 500; line-height: 1.5; color: var(--ink); }
  .mouse-badge--off { opacity: 0.3; }

  /* the buy box: the range until a pack is chosen, then its price, the choice and "Купить" */
  .product__buy { grid-area: buy; position: sticky; top: 16px; display: grid; gap: 12px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cyan); border-radius: var(--radius); padding: 20px; box-shadow: 0 12px 32px -18px rgb(0 0 0 / 0.45);
                  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }  /* a long weapon list on a short screen: the sticky box scrolls inside, nothing is cut off */
  .buy { display: grid; gap: 10px; }
  .buy__price { font-family: var(--font-display); font-weight: 700; font-size: var(--step-3); line-height: 1.1; font-variant-numeric: tabular-nums; }
  .buy__price--range { font-size: var(--step-2); }
  .buy__summary { color: var(--ink-2); font-size: var(--step--1); overflow-wrap: anywhere; }
  .buy__credit { color: var(--success); font-size: var(--step--1); overflow-wrap: anywhere; }
  .buy__action { width: 100%; justify-content: center; }
  /* the weapons of the chosen pack (Product.Weapons) in the buy box, under "Купить": compact chips */
  .weapons { display: grid; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
  .weapons__title { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
  .weapons__count { padding: 0 7px; border-radius: 999px; background: var(--line); color: var(--ink-2); font-size: 0.75rem; line-height: 1.6; font-variant-numeric: tabular-nums; }
  .weapons__list { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
  .weapons__list li { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 0.8125rem; font-weight: 500; line-height: 1.6; color: var(--ink); }
  .product__buy .buy-box__note { margin: 0; }
  .buy__security { display: grid; gap: 8px; list-style: none; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--step--1); line-height: 1.4; }
  .buy__security li { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; }
  .buy__info { position: relative; inset: auto; display: inline-grid; vertical-align: middle; width: 24px; height: 24px; border: 0; font-size: 11px; }
  .buy__info::before { content: ""; position: absolute; inset: 4px; border: 1px solid currentColor; border-radius: 50%; }
  .buy__tooltip { top: auto; bottom: 100%; font-family: var(--font-body); }
  .buy__tooltip::before { display: none; }
  .buy__security svg { color: var(--success); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  /* phones: price and "Купить" at the bottom of the screen (site.js shows it while the buy box is scrolled away) */
  .buy-bar { display: none; }

  /* narrower: the cover and the facts go under the page (a small cover by the title), the choice and the buy box stay side by side */
  @media (max-width: 1180px) {
    .product, .product--no-image { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .product__aside { order: 2; position: static; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); align-items: start; }
    .product__body { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
    .product__head { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; }
    .product__head-img { display: block; width: 72px; height: 96px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
    .product-lead { margin-top: -8px; }
  }
  @media (max-width: 760px) {
    .product__body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "buy" "info"; gap: 16px; }
    .product__details { padding: 16px; }
    .product__buy { position: static; max-height: none; overflow: visible; }
    .product__main { padding: 16px; gap: 20px; }
    .product__main h1 { font-size: var(--step-2); }
    .product__info { padding: 16px; }
  }
  @media (max-width: 760px) {
    .product__aside { grid-template-columns: minmax(0, 1fr); }
    .product__cover { max-width: 280px; }
    .buy-bar:not([hidden]) {
      display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
      padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
      background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(0 0 0 / 0.18);
    }
    .buy-bar__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .buy-bar__price { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); }
    .buy-bar .btn { min-height: 44px; padding-inline: 28px; }
    body:has(.buy-bar:not([hidden])) { padding-bottom: 72px; }
    body:has(.buy-bar:not([hidden])) .to-top { bottom: 84px; }
  }

  .buy-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 24px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cyan); border-radius: 0 0 var(--radius) var(--radius); padding: 20px 24px; }
  .buy-box__price { font-family: var(--font-display); font-weight: 600; font-size: var(--step-3); line-height: 1.1; }
  /* "≈ $18" after a ruble price on English pages: secondary, the charge is in rubles */
  .usd { font-family: var(--font-body); font-weight: 400; font-size: 0.7em; color: var(--ink-2); white-space: nowrap; }
  .game-card__price .usd { font-size: 0.9em; }
  .buy-box__meta { color: var(--ink-2); font-size: var(--step--1); margin-top: 4px; }
  .buy-box__note { grid-column: 1 / -1; font-size: var(--step--1); color: var(--ink-2); }
  .buy-box__old { display: block; font-size: var(--step-0); font-weight: 400; color: var(--ink-2); }
  .promo { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
  .promo label { display: grid; gap: 4px; }
  .promo input { text-transform: uppercase; }
  .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
  .btn[disabled]:hover { background: var(--ink); color: var(--paper); }
  @media (max-width: 560px) { .buy-box { grid-template-columns: 1fr; } }


  /* Markdown texts from the admin panel */
  .prose { max-width: var(--measure); }
  .prose > * + * { margin-top: 1em; }
  .prose ul, .prose ol { padding-left: 1.3em; }
  .prose li + li { margin-top: 0.3em; }
  .prose img { border-radius: var(--radius); }
  .prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); display: block; overflow-x: auto; }
  .prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
  .note.prose { max-width: none; }
  .prose.content-page--wide { max-width: none; } /* pack-link pages use the full content width, like the FAQ */
  /* in Markdown texts **bold** is just bold, not the callout heading */
  .note.prose strong:first-child { display: inline; font-family: inherit; color: inherit; margin: 0; }

  /* details used for the version history */
  details > summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); line-height: 1.25; }
  details > summary::-webkit-details-marker { display: none; }
  details > summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
  details[open] > summary::after { transform: translateY(-30%) rotate(225deg); }
  details > :not(summary) { margin-bottom: 1em; }

  /* collapsed blocks in texts ("::: faq Вопрос" … ":::", Infrastructure/MarkdownAccordion.cs), as on the old promacro.store:
     light card when closed, white with a shadow when open, "+" on the right turns into "×"; the colour tells the kind */
  .acc { margin: 0; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--surface) 55%, var(--paper)); overflow: hidden; transition: background-color 0.2s, box-shadow 0.2s; }
  .prose > * + .acc { margin-top: 0.8em; }
  .prose > .acc + .acc { margin-top: 8px; }
  .acc[open] { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 22%, transparent); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.06); }
  .acc > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.4; color: var(--ink); user-select: none; }
  .acc > summary:hover { color: var(--link); }
  .acc > summary::after { content: '+'; position: static; flex: none; width: auto; height: auto; border: 0; transform: none; font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--acc, var(--link)); transition: transform 0.3s ease, color 0.2s; }
  .acc[open] > summary::after { transform: rotate(45deg); color: var(--ink); }
  .acc--settings { --acc: var(--warm); }
  .acc--install { --acc: var(--success); }
  .acc > .acc__body { margin: 0; padding: 0 16px 16px; color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; }
  .acc__body > * + * { margin-top: 0.8em; }
  .acc__body ul, .acc__body ol { padding-left: 1.3em; }

  /* pages: "## Topic" + its questions = a card (.acc-group), topics in a row = up to three columns of cards (.acc-col) side by side
     when there is room, one under the other on a phone;
     inside a card the questions are rows with dividers, not separate boxes (MarkdownAccordion, groups) */
  .prose:has(> .acc-groups) { max-width: none; }
  .prose:not(.content-page--wide):has(> .acc-groups) > :not(.acc-groups) { max-width: var(--measure); }
  .acc-groups { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
  .acc-col { flex: 1 1 320px; min-width: 0; display: grid; gap: 20px; }
  .prose > * + .acc-groups { margin-top: 1.4em; }
  .prose > .acc-groups + * { margin-top: 1.6em; }
  .acc-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 8px 8px; }
  .acc-group > h2 { margin: 0 12px 10px; font-size: var(--step-1); line-height: 1.25; }
  .acc-group > .acc { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
  .acc-group > .acc[open] { background: color-mix(in srgb, var(--ink) 4%, transparent); border-radius: 4px; }
  .acc-group > .acc[open] + .acc { border-top-color: transparent; }
  .acc-group > .acc > summary { padding: 10px 12px; }
  .acc-group > .acc > .acc__body { padding: 0 12px 14px; }

  /* videos in texts (Features/Media/Videos.cs): a preview with ▶, then the player of YouTube or RUTUBE in its place */
  .video { margin: 0; max-width: 820px; }
  .prose > * + .video, .acc__body > * + .video { margin-top: 1em; }
  .video__play, .video__frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); overflow: hidden; background: #000; }
  .video__play { color: #fff; text-decoration: none; }
  .video__play img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
  .video__button { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: rgb(0 0 0 / 0.65); box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85); transition: background-color 0.2s, transform 0.2s; }
  .video__button::after { content: ''; position: absolute; left: 29px; top: 22px; border-left: 22px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
  .video__play:hover .video__button, .video__play:focus-visible .video__button { background: var(--link); transform: scale(1.06); }
  .video__title { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 16px 12px; background: linear-gradient(transparent, rgb(0 0 0 / 0.8)); font-weight: 600; line-height: 1.3; text-align: left; }
  .video__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: var(--step--1); color: var(--ink-2); }
  .video__switch { padding: 0; border: 0; background: none; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }

  /* ---- header: bell with the unread count ---- */
  .bell { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); }
  .bell:hover { color: var(--link); background: var(--paper); }
  .bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warm); color: #13202e; font: 600 11px/1 var(--font-body); }
  .bell .badge { position: absolute; top: 0; right: -2px; background: #ffb648; color: #171717; }


  /* ---- cabinet ---- */
  .cabinet { display: grid; gap: 20px; align-content: start; }
  .cabinet > * { margin: 0; }
  .cabinet h1 { font-size: var(--step-3); }
  .cabinet__user { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--ink-2); font-size: var(--step--1); }
  .tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
  .tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 600; }
  .tabs a:hover { color: var(--link); }
  .tabs a[aria-current] { border-bottom-color: var(--cyan); }
  .form--narrow { max-width: 520px; }
  .key-input { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.05em; text-transform: uppercase; }
  .library { list-style: none; padding: 0; display: grid; gap: 14px; }
  .library-item { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .library-item__title { font-size: var(--step-1); }
  .library-item__meta { color: var(--ink-2); font-size: var(--step--1); margin-top: 4px; }
  .library-item__update, .library-item__note { grid-column: 1 / -1; }
  .library-item__update { display: grid; gap: 10px; padding: 14px 16px; border-left: 4px solid var(--warm); background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; }
  .library-item__update form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  .library-item__note { font-size: var(--step--1); }
  .library-item__purchases { grid-column: 1 / -1; font-size: var(--step--1); }
  .library-item__purchases summary { cursor: pointer; color: var(--link); }
  .purchase-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
  .notifications { list-style: none; padding: 0; display: grid; gap: 10px; }
  .cabinet-section { display: grid; gap: 12px; margin-bottom: 32px; }
  .cabinet-section h2 { font-size: var(--step-1); }
  .steps { padding-left: 1.4em; display: grid; gap: 4px; }
  .offer-banner { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 16px 0;
    padding: 12px 16px; background: var(--surface); border: 1px solid var(--link); border-radius: var(--radius); }
  .offer-banner p { margin: 0; font-weight: 500; }
  .notification { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .notification--new { border-left: 4px solid var(--warm); }
  .notification__title { font-weight: 500; }
  .notification__body { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
  .notification__meta { font-size: var(--step--1); color: var(--ink-2); margin-top: 4px; }
  @media (max-width: 560px) { .library-item { grid-template-columns: 1fr; } }

  /* ---- support: ticket list and the conversation (cabinet and admin) ---- */
  .status--waiting { color: var(--warning); border-color: currentColor; }
  .cabinet-head, .ticket-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
  .ticket-head { justify-content: flex-start; }
  .ticket-head h1 { overflow-wrap: anywhere; }
  .ticket-head__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--ink-2); font-size: var(--step--1); }
  .tickets { list-style: none; padding: 0; display: grid; gap: 10px; }
  .ticket-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .ticket-row--waiting { border-left: 4px solid var(--warning); }
  .ticket-row__subject { font-weight: 600; overflow-wrap: anywhere; }
  .ticket-row__meta { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--step--1); }
  .thread { list-style: none; padding: 0; display: grid; gap: 12px; max-width: 820px; }
  .msg { padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-right: clamp(0px, 8vw, 80px); }
  .msg--staff { border-left: 4px solid var(--cyan); margin-right: 0; margin-left: clamp(0px, 8vw, 80px); }
  .msg__head { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 6px; }
  .msg__head strong { color: var(--ink); }
  .msg__body { white-space: pre-line; overflow-wrap: anywhere; }
  .thread__event { font-size: var(--step--1); color: var(--ink-2); text-align: center; }
  .form--wide { max-width: 820px; }
  .form textarea { resize: vertical; }
  @media (max-width: 560px) { .ticket-row { grid-template-columns: 1fr; } }

  /* ---- admin panel ---- */
  .admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
  .admin h1 { font-size: var(--step-3); }
  .admin-nav { display: grid; gap: 2px; position: sticky; top: 16px; }
  .admin-nav a { padding: 7px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--step--1); }
  .admin-nav a:hover, .admin-nav a[aria-current] { background: var(--surface); color: var(--link); }
  .admin-nav__group { margin: 12px 10px 2px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
  /* one column as wide as the screen: a wide table scrolls inside its own .table-scroll, the heading and its buttons stay in view
     (an auto column grew to the widest table and pushed "Добавить" off the screen) */
  .admin-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; min-width: 0; } /* no overflow here: it would clip the "i" popups */
  .admin-main > * { margin: 0; min-width: 0; } /* a table deep inside a section or form scrolls too */
  .admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .admin-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); background: var(--surface); border: 1px solid var(--line); }
  .admin-table th, .admin-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
  .admin-table th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
  .admin-table tr:last-child td { border-bottom: 0; }
  .admin-table__text { max-width: 40ch; white-space: pre-line; }
  /* "Версии пака": how the mark goes into a version (PackCopies.CheckAsync) */
  .mark-check { min-width: 220px; }
  .mark-check details > summary { padding: 0; font: inherit; font-weight: 500; }
  .mark-check details > summary::after { display: none; }
  .mark-check ul { padding-left: 1.2em; margin: 4px 0 8px; font-size: 0.8rem; }
  .mark-check--bad { color: var(--warm); }
  .admin-table code { white-space: nowrap; }
  .admin-form { max-width: 920px; }
  .admin-filter { display: flex; gap: 12px; align-items: end; }
  .admin-filter select { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .admin-card { display: grid; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: var(--step--1); }
  .admin-card strong { font-family: var(--font-display); font-size: var(--step-3); line-height: 1; }
  .admin-card:hover { border-color: var(--link); }
  .admin-cover { width: 150px; height: auto; border-radius: var(--radius); }
  .admin-pack-image { width: 240px; height: auto; aspect-ratio: 2 / 1; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius); }

  /* ---- Statistics: period, figures, daily bars, tables */
  .crm-period { align-items: end; }
  .crm-presets { display: flex; flex-wrap: wrap; gap: 6px; }
  .crm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
  .crm-kpi { display: grid; gap: 4px; align-content: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .crm-kpi__label { font-size: var(--step--1); color: var(--ink-2); }
  .crm-kpi strong { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.1; }
  .crm-kpi__delta { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
  .crm-good { color: var(--success); }
  .crm-bad { color: var(--danger); }
  .crm-chart { display: grid; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .crm-chart h2, .crm-table h2 { font-size: var(--step-0); }
  .crm-chart svg { width: 100%; height: 140px; display: block; }
  .crm-bar { fill: var(--link); }
  .crm-bar:hover { fill: var(--ink); }
  .crm-chart__axis { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--ink-2); }
  .crm-table { display: grid; gap: 8px; }
  .message-lang { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
  .message-lang legend { font-family: var(--font-display); font-weight: 600; padding: 0 6px; }
  .message-lang textarea { width: 100%; }
  .message-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
  .message-preview > div { padding: 10px 12px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); font-size: var(--step--1); }
  .message-preview__channel { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin-bottom: 4px; }
  .message-preview__tg { white-space: pre-line; }
  .batch-edit { display: grid; gap: 8px; }
  .batch-edit summary { cursor: pointer; font-size: var(--step--1); color: var(--link); }
  .client-crm { display: grid; gap: 14px; }
  .client-crm h3 { font-size: var(--step-0); }
  .client-crm textarea { width: 100%; }
  .client-note { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--link); border-radius: var(--radius); }
  .client-note__meta { display: flex; gap: 12px; align-items: center; }
  .tag { display: inline-block; margin: 0 4px 4px 0; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: var(--step--1); text-decoration: none; }
  a.tag:hover { border-color: var(--link); color: var(--link); }
  .admin-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .client-list { container-type: inline-size; }
  .client-filters label, .client-filters select, .client-filters input { min-width: 0; max-width: 100%; }
  .client-table { table-layout: fixed; }
  .client-table th, .client-table td, .client-table td.num { padding: 8px 6px; white-space: normal; overflow-wrap: anywhere; }
  .client-table th:nth-child(1) { width: 22%; }
  .client-table th:nth-child(2) { width: 12%; }
  .client-table th:nth-child(4), .client-table th:nth-child(5), .client-table th:nth-child(6) { text-align: right; }
  .client-table th:nth-child(6), .client-table th:nth-child(9) { width: 6%; }
  .client-table th:nth-child(7) { width: 18%; }
  .client-table .tag { max-width: 100%; margin-right: 0; }
  @container (max-width: 50rem) {
    .client-table, .client-table tbody { display: block; }
    .client-table { border: 0; background: transparent; }
    .client-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
    .client-table tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: 8px 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
    .client-table tbody tr + tr { margin-top: 12px; }
    .client-table td, .client-table td.num { min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; }
    .client-table td:first-child { grid-column: 1 / -1; font-weight: 600; }
    .client-table td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: .85em; }
    .client-table td[data-label]:empty { display: none; }
  }
  .section-title { font-size: var(--step-1); }
  .form-title { font-size: var(--step-1); }
  .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
  .pack-upload-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
  .pack-upload-fields > label { min-width: 0; }
  .pack-upload-fields > label:first-child { flex: 0 1 11rem; }
  .pack-upload-fields > label:last-child { flex: 1 1 18rem; }
  /* a form field whose label has an "i" popup next to it (admin: roles of pages); the popup floats, the row does not move */
  .form .field { display: grid; gap: 6px; font-weight: 500; line-height: 1.35; }
  .field__head { display: flex; align-items: center; gap: 8px; }
  .tip { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--ink-2); font: italic 600 12px/1 Georgia, serif; cursor: help; }
  .tip:hover, .tip:focus-visible { color: var(--link); border-color: currentColor; }
  .tip__pop { display: none; position: absolute; z-index: 10; top: calc(100% + 8px); left: -8px; width: min(440px, 85vw); padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgb(0 0 0 / 0.3); font: 400 var(--step--1) / 1.45 var(--font-body); font-style: normal; text-align: left; cursor: auto; }
  .tip:hover > .tip__pop, .tip:focus > .tip__pop { display: grid; gap: 6px; }
  .tip__row strong { font-weight: 600; }
  .tip--up > .tip__pop { top: auto; bottom: calc(100% + 8px); } /* near the bottom of a form: opens upwards */
  .form:has(#Input_Role option[value="PackLinks"]:checked) :is(.footer-check, .slug-field) { display: none; }
  .form:has(#Input_Role):not(:has(#Input_Role :is([value="Privacy"], [value="ServiceTerms"]):checked)) .footer-check { display: none; }
  .packlinks-slug { margin: 0; }
  .form:not(:has(#Input_Role option[value="PackLinks"]:checked)) .packlinks-slug { display: none; }
  .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .form .input-short { max-width: 160px; }
  .key-issue-form .form-row { align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
  .key-issue-form .input-short { max-width: 6rem; }
  .key-issue-form textarea { resize: vertical; }
  @media (min-width: 700px) {
    .key-issue-form .form-row:has(textarea) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  }
  .l10n { border: 0; padding: 0; display: grid; gap: 6px; }
  .l10n legend { font-weight: 500; margin-bottom: 6px; }
  .l10n__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .l10n__lang { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0.06em; }
  .l10n textarea { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.9rem; resize: vertical; }
  /* RU and EN boxes keep one height: the language label stays on top, the box fills the rest of the row,
     so dragging either box resizes the pair (the stretched label used to push the shorter box down) */
  .l10n__pair > label { grid-template-rows: auto 1fr; }
  .l10n__pair textarea { height: 100%; }
  .hint { font-size: var(--step--1); color: var(--ink-2); font-weight: 400; }
  .req { color: var(--danger); }
  .muted { color: var(--ink-2); }
  .field-error { color: var(--danger); font-size: var(--step--1); font-weight: 400; }
  .field-error:empty { display: none; }
  .danger-zone { padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--step--1); }
  .danger-zone .check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
  .btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
  .btn--danger:hover { background: var(--danger); color: #fff; }
  .admin-nav__logout { margin: 16px 10px 0; }
  .admin-filter { flex-wrap: wrap; }
  .admin-filter label { display: grid; gap: 4px; font-size: var(--step--1); font-weight: 500; }
  .admin-filter input { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .form .input-tiny, .admin-table .input-tiny { width: 110px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
  .admin-table select { padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
  .admin-table form { display: flex; gap: 6px; align-items: center; }
  .row--revoked td { opacity: 0.6; }
  .table-scroll { overflow-x: auto; max-width: 100%; }
  /* the event journal: JSON without spaces and long e-mails break anywhere instead of pushing the table wider */
  .audit-table td:first-child { white-space: nowrap; }
  .audit-table__who { max-width: 22ch; overflow-wrap: anywhere; }
  .audit-table__data { max-width: none; overflow-wrap: anywhere; word-break: break-word; }
  .admin-table .input-num { width: 64px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
  /* packs of a client: the name gets room, the actions (save, revoke with its reason) stack in one column */
  .client-packs th { white-space: normal; }
  .client-packs td:first-child { min-width: 180px; }
  .client-packs__actions { display: grid; gap: 8px; min-width: 150px; }
  .client-packs__actions form { flex-wrap: wrap; }
  .client-packs__actions .input-tiny { width: 100%; }
  .status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; background: var(--paper); border: 1px solid var(--line); }
  .status--active { color: var(--success); border-color: currentColor; }
  .status--activated { color: var(--info); border-color: currentColor; }
  .status--revoked { color: var(--danger); border-color: currentColor; }
  .facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; font-size: var(--step--1); }
  .facts dt { color: var(--ink-2); }
  .facts dd { margin: 0; }
  .key-code { font-size: 0.7em; letter-spacing: 0.04em; }
  .mass-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: var(--step--1); }
  .mass-actions legend { font-weight: 600; padding: 0 4px; }
  /* product form: what a pack includes / which packs a weapon is in */
  .mass-actions input:not([type]) { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
  .mass-actions .check { display: flex; gap: 8px; align-items: center; }
  .mass-actions > .check:nth-of-type(2), .mass-actions > .check:last-of-type, .mass-actions .btn { grid-column: 1 / -1; }
  .mass-actions .btn { justify-self: start; }
  .pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
  .pager a { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
  .pager a[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  @media (max-width: 900px) {
    .admin { grid-template-columns: minmax(0, 1fr); }
    .admin-nav { position: static; display: flex; flex-wrap: wrap; }
    .admin-nav__group { width: 100%; }
    .l10n__pair { grid-template-columns: 1fr; }
  }

  /* ---- theme switch (ThemeToggle.astro) ---- */
  .theme-toggle {
    --track: #e3e9ee; --rim: #c9d3dc; --knob: #13202e; --icon: #3a4f66; --x: 24px;
    position: relative; flex: none; width: 52px; height: 28px; padding: 0; border: 1px solid var(--rim); border-radius: 999px;
    background: var(--track); cursor: pointer;
  }
  :root[data-theme='dark'] .theme-toggle { --track: #0a131d; --rim: #263a52; --knob: #e3ebf1; --icon: #a8b9c9; --x: 0px; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .theme-toggle { --track: #0a131d; --rim: #263a52; --knob: #e3ebf1; --icon: #a8b9c9; --x: 0px; }
  }
  .theme-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
  .theme-toggle .knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); transform: translateX(var(--x)); }
  .theme-toggle svg { position: absolute; top: 6px; width: 14px; height: 14px; fill: none; stroke: var(--icon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .theme-toggle .sun { left: 6px; }
  .theme-toggle .moon { right: 6px; fill: var(--icon); stroke: none; }
  @media (prefers-reduced-motion: no-preference) {
    .theme-toggle .knob { transition: transform 0.2s ease, background-color 0.2s; }
  }

  /* ---- footer (Footer.astro): always dark, in both themes ---- */
  .site-footer { --paper: #f3f6f8; background: #13202e; color: var(--paper); padding-block: 24px 16px; font-size: var(--step--1); border-top: 1px solid transparent; }
  :root[data-theme='dark'] .site-footer { background: #0a131d; border-top-color: var(--line); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .site-footer { background: #0a131d; border-top-color: var(--line); } }
  .site-footer a { color: inherit; }
  .site-footer .grid { display: grid; grid-auto-flow: column; grid-template-columns: minmax(0, 1.7fr); grid-auto-columns: minmax(0, 1fr); gap: 20px 24px; }
  .site-footer .name, .site-footer .h { font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); margin-bottom: 8px; }
  .site-footer .name { font-size: var(--step-1); }
  .site-footer ul { list-style: none; padding: 0; display: grid; gap: 4px; }
  .site-footer p + p { margin-top: 8px; }
  .site-footer .legal { margin-top: 16px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); opacity: 0.75; display: grid; gap: 8px; text-align: center; }
  .site-footer .legal p { margin: 0; font-size: 0.875em; }
  /* as wide as the header bar */
  .site-footer .wrap { max-width: 1440px; }
  @media (max-width: 1000px) {
    .site-footer .grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer .grid > :first-child { grid-column: 1 / -1; }
  }
  @media (max-width: 360px) { .site-footer .grid { grid-template-columns: minmax(0, 1fr); } }
}

/* ---- text of the documents and descriptions (global.css of promacro.ru) ---- */
@layer components {
  h5, h6 { font-size: var(--step-0); }

  a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }

  strong, b { font-weight: 600; }
  code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.3em; }
  /* code blocks (file paths etc.): site colours instead of the highlighter's inline theme */
  pre { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; overflow-x: auto; }
  pre code { background: none; border: 0; padding: 0; font-size: 0.9rem; }
  .prose { max-width: var(--measure); }
  .prose > * + * { margin-top: 1em; }
  .prose > * + :is(h2, h3, h4, h5) { margin-top: clamp(1.5rem, 3vw, 1.75rem); }
  .prose > :is(h2, h3, h4, h5) + * { margin-top: 0.6em; }
  .prose ul, .prose ol { padding-left: 1.3em; }
  .prose li + li { margin-top: 0.3em; }
  .prose li::marker { color: var(--ink-2); }
  .prose img { border-radius: var(--radius); }
  .prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
  .prose blockquote { border-left: 3px solid var(--line); padding-left: 1em; color: var(--ink-2); }
  .prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); display: block; overflow-x: auto; }
  .prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
  .prose th { background: var(--surface); }
  /* details used for in-content toggles and the FAQ block */
  .prose details:not(.acc) { border-bottom: 1px solid var(--line); }
  .prose details:not(.acc) > :not(summary) { margin-bottom: 1em; }
  .prose details:not(.acc) > * + :not(summary) { margin-top: 0.8em; }
  .prose details
}

/* ---- page lists, back to top ---- */
@layer components {
  .page-list { list-style: none; padding: 0; max-width: var(--measure); }
  .page-list li { padding-block: 18px; border-bottom: 1px solid var(--line); }
  .page-list li:first-child { border-top: 1px solid var(--line); }
  .page-list a { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); line-height: 1.25; text-decoration: none; }
  .page-list a:hover { text-decoration: underline; }
  .page-list p { margin-top: 4px; color: var(--ink-2); }
  .page-list time { font-size: var(--step--1); color: var(--ink-2); }

  /* ---- back to top (ToTop.astro) ---- */
  .to-top { position: fixed; right: 24px; bottom: 24px; z-index: 30; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgb(19 32 46 / 0.18); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s, border-color 0.15s, color 0.15s; }
  .to-top svg path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .to-top--visible { opacity: 1; visibility: visible; transform: none; }
  .to-top:hover { border-color: var(--link); color: var(--link); }
  @media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
  @media (max-width: 600px) { .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; } }

}

@layer components {
  .claim { display:grid; grid-template-columns:minmax(0, 2fr) minmax(16rem, 1fr); grid-template-rows:auto 1fr; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
  .claim__head, .claim__body, .claim__account, .claim__action { min-width:0; padding:clamp(1rem, 3vw, 2rem); }
  .claim__head { display:flex; align-items:center; gap:1rem; padding-bottom:0; }
  .claim__head > div { min-width:0; }
  .claim__head img { flex:none; width:clamp(4rem, 9vw, 6rem); height:auto; object-fit:contain; }
  .claim h2, .claim h3, .claim__head p { margin:0; }
  .claim__head p, .claim__action .hint { color:var(--ink-2); }
  .claim__body { max-width:72ch; align-self:start; }
  .claim__body h3 { margin-top:1.15rem; }
  .claim__body details { margin-top:.5rem; }
  .claim__body > :first-child, .claim__action > :first-child { margin-top:0; }
  .claim__account, .claim__action { background:var(--paper); border-inline-start:1px solid var(--line); }
  .claim__account { padding-bottom:.5rem; }
  .claim__account strong { display:block; overflow-wrap:anywhere; margin:.4rem 0; }
  .claim__account button { padding-inline:0; }
  .claim__action .btn { width:100%; justify-content:center; text-align:center; margin-top:.75rem; }
  .claim-success { grid-column:1/-1; color:var(--success); margin:0; }
  .library-item:target { outline:2px solid var(--link); scroll-margin-block:5rem; }
  @media (max-width: 48rem) {
    .claim { grid-template-columns:minmax(0,1fr); }
    .claim__head { padding-bottom:1rem; }
    .claim__account, .claim__action { border-inline-start:0; border-top:1px solid var(--line); }
    .claim__account { padding-bottom:1rem; }
  }
}
