/* artificial.kz — base styles. Tokens, header, grain and type follow artificial.kz (/opt/apps/artificial/style.css).
   Fonts: self-hosted variable woff2, Latin + Cyrillic + Kazakh (Әә Ғғ Ққ Ңң Өө Ұұ Үү Һһ Іі), SIL OFL. */
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 300 600; font-display: swap; src: url("fonts/inter-tight.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+0400-045F, U+0490-0493, U+049A-049B, U+04A2-04A3, U+04AE-04B1, U+04BA-04BB, U+04D8-04D9, U+04E8-04E9, U+2010-2014, U+2018-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+20AC, U+20B8, U+2116, U+2122, U+2190-2193, U+2197, U+2212, U+2713; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/jetbrains-mono.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+0400-045F, U+0490-0493, U+049A-049B, U+04A2-04A3, U+04AE-04B1, U+04BA-04BB, U+04D8-04D9, U+04E8-04E9, U+2010-2014, U+2018-201E, U+2022, U+2026, U+2032-2033, U+2039-203A, U+20AC, U+2116, U+2122, U+2190-2193, U+2197, U+2212, U+2713; }

:root {
  color-scheme: dark;
  /* одна шкала серых (ramp): фон → поверхности → линии → текст. Текст на --bg/--card/--raised: --mid ≥ 5:1, --soft ≥ 11:1 */
  --bg: #0e0e0e;      /* страница */
  --card: #131313;    /* карточка, плитка */
  --raised: #1a1a1a;  /* поповер, чат-окно, наведение строки */
  --line: #1e1e1e;    /* разделители */
  --edge: #262626;    /* рамка карточки, наведение в поповере */
  --dim: #3a3a3a;     /* рамки контролов (не текст) */
  --mid: #8a8a8a;     /* вторичный текст и мета */
  --soft: #c8c8c8;    /* основной текст абзацев */
  --fg: #f2f2f2;      /* заголовки, акцент */
  /* семантика — только статусы и админка */
  --ok: #4cc38a;
  --warn: #d9b44a;
  --bad: #f0606a;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(16px, 4vw, 56px);
  --sat: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-bar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .088 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* body (bg + grain) ends at 100svh; under Safari's bottom toolbar (and on overscroll) the root background shows —
   #181818 is what bg + grain look like on average, so there is no darker band there */
html { background: #181818; color: var(--fg); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(80px + var(--sat)); }   /* якоря (#main, #…) не уходят под фиксированную шапку */
body {
  min-height: calc(100svh / var(--z, 1)); display: flex; flex-direction: column;
  /* Safari 26 paints the strip under its bottom toolbar with body's background-color: #181818 = bg + grain on average;
     the gradient keeps the page itself on --bg */
  background: linear-gradient(var(--bg), var(--bg)) #181818;   /* без padding-top: --sat — он уже в отступах шапки и страниц */
  font-family: var(--sans); font-weight: 400; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
::selection { background: var(--fg); color: var(--bg); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 30; padding: 12px 16px; border-radius: 20px; background: var(--fg); color: var(--bg); font-size: 14px; }
.skip:focus { top: calc(12px + var(--sat)); }

/* film grain over the page — UNDER the header (9 < 10); the header carries its own grain (as on artificial.kz).
   В переходе между страницами — свой слой vt-grain поверх едущего содержимого (иначе оно без зерна темнее и в конце мигает) */
html::after {
  content: ""; position: fixed; inset: 0; z-index: 9; pointer-events: none;
  background-image: var(--grain); background-size: 180px 180px; opacity: .16;
  view-transition-name: vt-grain;
}

/* ---------- header ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(12px + var(--sat)) var(--pad) 4px;
  font-family: var(--mono); font-size: 14px; letter-spacing: .06em; color: #fff;
  background-color: #181818;   /* iPhone paints the strip under the clock with this colour */
}
.bar::before { content: ""; position: absolute; inset: -300px 0 0 0; z-index: -1; background: var(--grain-bar) 0 300px / 180px 180px, var(--bg); }
.bar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px;
  background: var(--grain-bar) 0 0 / 180px 180px, var(--bg);
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.bar::before, .bar::after { pointer-events: none; }
.mark { display: inline-flex; align-items: center; gap: 12px; line-height: 40px; white-space: nowrap; }
.mark .ball { width: 26px; height: 26px; flex: none; color: var(--fg); transition: transform .6s var(--ease); }
.mark .dom { color: var(--fg); }
.mark .dom span { color: var(--mid); }
@media (hover: hover) { .mark:hover .ball { transform: rotate(-24deg); } }

/* language menu: «RU ▾» → English / Қазақша / Русский (details/summary; app.js — Esc, arrows, click outside) */
.lsw { position: relative; font-size: 13px; letter-spacing: .06em; }
.lsw > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px; cursor: pointer; color: var(--fg);
  -webkit-user-select: none; user-select: none; }
.lsw > summary::-webkit-details-marker { display: none; }
.lsw > summary svg { width: 10px; height: 10px; color: var(--mid); transition: transform .2s var(--ease), color .2s; }
.lsw[open] > summary svg { color: var(--fg); }
@media (hover: hover) { .lsw > summary:hover svg { color: var(--fg); } }   /* iPhone: после тапа стрелка не «залипает» светлой */
.lsw[open] > summary svg { transform: rotate(180deg); }
.lsw-m { position: absolute; right: -8px; top: calc(100% + 6px); z-index: 20; min-width: 184px; padding: 8px; list-style: none;
  background: var(--raised); border: 1px solid var(--dim); border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
  font-family: var(--sans); font-size: 16px; letter-spacing: 0; }
.lsw-m a, .lsw-m .off { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; padding: 0 16px; border-radius: 12px; }
.lsw-m a { color: var(--soft); transition: background-color .2s, color .2s; }
.lsw-m a:hover, .lsw-m a:focus-visible { background: var(--edge); color: var(--fg); outline: none; }
.lsw-m a[aria-current] { color: var(--fg); }
.lsw-m a[aria-current]::after { content: "✓"; font-family: var(--mono); font-size: 13px; }
.lsw-m .off { color: var(--mid); cursor: default; }
/* всплывающие окна шапки появляются одинаково: короткое проявление со сдвигом 4px (меню языков; панель чата — msg.js) */
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.lsw[open] > .lsw-m { animation: pop-in .18s var(--ease); }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; position: relative; }
.wrap { padding: calc(132px + var(--sat)) var(--pad) clamp(56px, calc(10vh / var(--z, 1)), 120px); }
.idx {
  display: block; font-family: var(--mono); font-size: 13px; font-weight: 400;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mid);
}
.idx b { font-weight: 400; color: inherit; margin-right: .7em; }
h1 {
  font-weight: 300; font-size: clamp(48px, 7.4vw, 112px); line-height: .92; letter-spacing: -.04em;
  margin: 18px 0 clamp(32px, calc(5vh / var(--z, 1)), 56px) -0.05em;
  text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
}
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.muted { color: var(--mid); }
.line { color: var(--mid); font-size: 17px; line-height: 1.55; max-width: 560px; }
.line a, a.u { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(242, 242, 242, .35); transition: text-decoration-color .2s; }
.line a:hover, a.u:hover { text-decoration-color: var(--fg); }

/* auth screens: form on the left, dotted ball on the right (desktop) */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: var(--pad); align-items: center; min-height: calc(calc(100svh / var(--z, 1)) - 64px); padding-top: calc(96px + var(--sat)); }
.auth .form { max-width: 560px; }
.art { display: grid; place-items: center; align-self: center; }
.art .ball { width: min(100%, calc(52vh / var(--z, 1)), 520px); height: auto; color: var(--fg); opacity: .92; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; align-items: start; min-height: 0; padding-top: calc(104px + var(--sat)); }
  .art { display: none; }
}

/* ---------- fields and buttons ---------- */
.form { display: grid; gap: 12px; }
.field {
  width: 100%; height: 72px; padding: 0 32px; border-radius: 36px;
  border: 1px solid var(--dim); background: transparent; color: var(--fg);
  font-size: 24px; font-weight: 300; letter-spacing: -.01em; outline: none;
  transition: border-color .2s;
}
.field::placeholder { color: var(--mid); }
.field:hover { border-color: var(--mid); }
.field:focus { border-color: var(--fg); }
.field.bad, .field[aria-invalid="true"] { border-color: var(--bad); }
.field:-webkit-autofill { -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 100px var(--bg) inset; caret-color: var(--fg); }
.input { /* small field, as in the artificial.kz admin */
  width: 100%; height: 52px; padding: 0 20px; border-radius: 26px; border: 1px solid var(--dim);
  background: transparent; color: var(--fg); font-size: 16px; outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 64px; padding: 0 32px; border-radius: 32px; border: 0;
  background: var(--fg); color: var(--bg); font-size: 18px; font-weight: 500; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; transition: transform .2s, opacity .2s, background-color .2s, border-color .2s;
}
@media (hover: hover) { .btn:hover { background: #fff; } }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--dim); font-weight: 400; }
@media (hover: hover) { .btn.ghost:hover { border-color: var(--fg); background: transparent; } }   /* iOS: рамка не залипает после тапа */
/* одна система кнопок: 64 — вход и одиночный CTA публичных страниц; md 48 — действия в кабинете, чате, админке; sm 40 — вторичные; xs 32 — в строках таблиц */
.btn.md { height: 48px; padding: 0 24px; border-radius: 24px; font-size: 16px; gap: 8px; }
.btn.sm { height: 40px; padding: 0 20px; border-radius: 20px; font-size: 15px; gap: 8px; }
.btn.xs { height: 32px; padding: 0 16px; border-radius: 16px; font-size: 14px; gap: 8px; }
.btn.md svg, .btn.sm svg, .btn.xs svg { width: 16px; height: 16px; }
.btn.warn:hover { border-color: var(--bad); color: var(--bad); }
summary.btn { list-style: none; } summary.btn::-webkit-details-marker { display: none; }
.pill { /* small pill, as the filter chips on artificial.kz */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--dim); background: transparent;
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--mid);
  cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s, background-color .2s;
}
@media (hover: hover) { .pill:hover { color: var(--fg); border-color: var(--mid); } }   /* iOS: no hover stuck on a chip after a tap */
.pill[aria-selected="true"], .pill[aria-pressed="true"], .pill.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.pill:disabled { opacity: .5; border-color: var(--line); cursor: default; }
.or { display: flex; align-items: center; gap: 16px; margin: 12px 0; font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--mid); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { min-height: 22px; font-size: 15px; color: var(--bad); }
.err:empty { min-height: 0; }
.note { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--mid); }

/* links row under a form: "Send again 0:42 · Use another email" */
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 16px; font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.acts a, .acts button { background: none; border: 0; padding: 12px 0; color: var(--mid); cursor: pointer; transition: color .2s; }
.acts a:hover, .acts button:not(:disabled):hover { color: var(--fg); }
.acts button:disabled { color: var(--mid); cursor: default; }
.acts .t { font-variant-numeric: tabular-nums; }

/* ---------- 6-digit code: one real input over six drawn cells ---------- */
.code { --cg: 12px; --ch: 88px; --fs: 44px; container-type: inline-size; position: relative; width: 100%; height: var(--ch); overflow: hidden; overflow: clip; }
/* clip, а не только hidden: поле шире рамки на cg+40px, и hidden-блок браузер всё равно прокручивает к каретке —
   при вставке кода ячейки уезжали влево на ~50px */
.code > * { --cw: calc((100cqw - 5 * var(--cg)) / 6); }
.code .cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--cg); pointer-events: none; }
.code .cells i { border: 1px solid var(--dim); border-radius: 18px; transition: border-color .2s, background-color .2s; }
.code input {
  position: absolute; inset: 0 auto 0 0; width: calc(6 * (var(--cw) + var(--cg)) + 40px); height: 100%;
  padding: 0 0 0 calc((var(--cw) - .6 * var(--fs)) / 2);
  border: 0; background: transparent; outline: none; color: var(--fg);
  font-family: var(--mono); font-size: var(--fs); font-weight: 400; letter-spacing: calc(var(--cw) + var(--cg) - .6 * var(--fs));
  font-variant-numeric: tabular-nums; caret-color: transparent;
}
.code input::placeholder { color: transparent; }
.code:hover .cells i { border-color: var(--mid); }
.code:focus-within .cells i.cur, .code:focus-within .cells i.cur ~ i:last-child:is(.cur) { border-color: var(--fg); }
.code .cells i.cur { position: relative; }
.code:focus-within .cells i.cur::after { content: ""; position: absolute; left: 50%; top: 26%; bottom: 26%; width: 2px; margin-left: -1px; background: var(--fg); animation: blink 1.1s steps(1) infinite; }
.code .cells i.full { border-color: var(--mid); }
.code.bad .cells i, .code.bad:focus-within .cells i.cur { border-color: var(--bad); }
.code.bad { animation: shake .4s; }
html:not(.js) .code .cells { display: none; }
html:not(.js) .code input { width: 100%; border: 1px solid var(--dim); border-radius: 18px; caret-color: var(--fg); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.sent { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--mid); margin: -12px 0 28px; overflow-wrap: anywhere; }
.sent b { font-weight: 400; color: var(--fg); }

/* ---------- account page ---------- */
.me { display: grid; gap: clamp(56px, calc(9vh / var(--z, 1)), 96px); max-width: 960px; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.who-sec h1 { margin: 20px 0 0 -0.05em; font-size: clamp(40px, 6vw, 88px); }
.who-sec h1.h-mail { font-size: clamp(32px, 4.4vw, 64px); letter-spacing: -.03em; }
.who-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.status {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 12px; border-radius: 18px;
  border: 1px solid var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--fg);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mid); }
.status.pending::before { background: transparent; border: 1.5px solid var(--fg); }
.status.approved { background: var(--fg); border-color: var(--fg); color: var(--bg); padding-left: 12px; }
.status.approved::before { width: 14px; height: 14px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%23f2f2f2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.status.needs_info::before { background: var(--fg); }
.status.rejected, .status.suspended { color: var(--mid); }
.status.rejected::before, .status.suspended::before { background: var(--dim); }
.mod-note { max-width: 640px; padding-left: 16px; border-left: 1px solid var(--fg); font-size: 17px; line-height: 1.55; color: var(--soft); margin-top: 20px; }
.who-mail { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--mid); overflow-wrap: anywhere; }

.sec .idx { margin-bottom: 24px; }
/* MCP address with a copy button */
.mcp {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px clamp(20px, 2.4vw, 30px);
  border: 1px solid var(--dim); border-radius: 44px; background: rgba(14, 14, 14, .6);
}
.mcp code { flex: 1; min-width: 0; font-family: var(--mono); font-size: clamp(17px, 2.3vw, 28px); letter-spacing: -.01em; color: var(--fg); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.mcp code::-webkit-scrollbar { display: none; }
.mcp code span { color: var(--mid); }
.copy { flex: none; }
.copy .go, .copy .ok { display: inline-flex; align-items: center; gap: 8px; }
/* «Копировать» и «Скопировано» в одной ячейке: ширина кнопки — по большей надписи, при нажатии ничего не сдвигается */
.btn.copy { display: inline-grid; justify-items: center; }
.copy .go, .copy .ok { grid-area: 1 / 1; transition: opacity .2s; }
.copy .ok { visibility: hidden; opacity: 0; }
.copy.done .ok { visibility: visible; opacity: 1; }
.copy.done .go { visibility: hidden; opacity: 0; }

/* client tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.panel { margin-top: 8px; }
html.js .panel:not(.on) { display: none; }
html:not(.js) .panel { border-top: 1px solid var(--line); margin-top: 32px; }
html:not(.js) .panel::before { content: attr(data-name); display: block; padding-top: 20px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
.steps { list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--line); font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45;
}
.steps li::before { content: "/ 0" counter(s); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--mid); }
.steps li > * { grid-column: 2; }
.steps kbd, .ui { font-family: var(--mono); font-size: .8em; letter-spacing: .01em; color: var(--fg); }
.steps .m { color: var(--mid); }
.snip { position: relative; display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 16px 12px 16px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.snip pre { flex: 1; min-width: 0; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 8px; }
.snip-l { display: block; margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
/* шаг из нескольких частей («Другие»): подпись — текст — команда — текст с ровными отступами, первая подпись на линии номера */
.steps li > div > .snip-l:first-child { margin-top: 0; }
.steps li > div > .snip-l + span { display: block; margin-top: 4px; }
.steps li > div > .snip + span { display: block; margin-top: 12px; }
.first { display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 20px 16px 20px 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.first q { flex: 1; min-width: 0; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.4; quotes: none; }
.first .idx { margin-bottom: 8px; font-size: 11px; }
.conn { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--mid); }
.conn b { font-weight: 400; color: var(--fg); }
.conn b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--fg); vertical-align: 1px; }
.out { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 28px; border-top: 1px solid var(--line); }

/* ---------- error page ---------- */
.oops { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--pad); align-items: end; min-height: calc(calc(100svh / var(--z, 1)) - 64px); padding-top: calc(96px + var(--sat)); }
.oops .num { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--mid); }
.oops .art .ball { width: min(38vw, calc(46vh / var(--z, 1)), 420px); opacity: .35; }
.oops .btns { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) { .oops { grid-template-columns: 1fr; align-items: start; min-height: 0; padding-top: calc(104px + var(--sat)); } }

/* ---------- footer ---------- */
.foot {
  position: relative; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 22px var(--pad) calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--mid);
}
.foot a { transition: color .2s; }
.foot a:hover { color: var(--fg); }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  .bar { font-size: 13px; gap: 8px; }
  .wrap { padding-top: calc(104px + var(--sat)); }   /* под шапкой тот же отступ, что у входа и ошибок (.auth, .oops) */
  .mark { gap: 8px; }
  .mark .ball { width: 22px; height: 22px; }
  .lsw > summary { height: 44px; font-size: 12px; }
  .idx { font-size: 12px; }
  h1 { font-size: clamp(42px, 13vw, 64px); }
  .field { height: 64px; padding: 0 24px; font-size: 20px; border-radius: 32px; }
  .btn { height: 60px; font-size: 17px; }
  .code { --cg: 8px; --ch: 72px; --fs: 34px; }
  .code .cells i { border-radius: 14px; }
  .mcp { border-radius: 26px; padding: 8px 8px 8px 20px; }
  .mcp .copy .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mcp code { font-size: clamp(14px, 4.4vw, 17px); }
  .mcp code span { display: none; }
  .mcp .copy { width: 44px; padding: 0; }
  .steps li { grid-template-columns: 1fr; row-gap: 8px; padding: 16px 0; }
  .steps li > * { grid-column: 1; }
  .first { flex-direction: column; align-items: stretch; }
  .snip { flex-direction: column; align-items: stretch; gap: 8px; }   /* команда во всю ширину, «Копировать» под ней */
  .snip pre { padding-top: 0; }
  .first .pill { align-self: flex-start; }
  .snip { flex-wrap: wrap; }
  .snip pre { flex-basis: 100%; }   /* команда во всю ширину, «Копировать» под ней — без переносов посреди адреса */
  .out .btn { flex: 1; }
}
@media (max-width: 360px) { .mark .dom { display: none; } .mark { min-width: 44px; min-height: 44px; justify-content: center; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, *::backdrop { transition: none !important; animation: none !important; }
}
@media print {
  html::after, .bar, .foot { display: none; }
  html, body { background: #fff; color: #000; }
}

/* button + quiet link in one row */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 28px; }
.cta .btn { padding: 0 44px; }
.cta .link { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; color: var(--mid); padding: 12px 0; transition: color .2s; }
.cta .link:hover { color: var(--fg); }
.sent.who-mail { margin: 0 0 8px; }
.acts .done { color: var(--fg); }
.acts .done::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-5.2' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-5.2' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.me > *, .sec, .panel, .steps li > * { min-width: 0; }
@media (max-width: 560px) { .out .btn { flex: 0 1 auto; padding: 0 40px; } }

/* ---------- header: section menu, sign-in icon, DEMO, mobile menu (blocks nav / acct / bar_end / after_bar of base.html) ---------- */
.bar-r { display: flex; align-items: center; gap: 16px; }
.acct { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--mid); overflow: hidden;
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--fg); transition: border-color .2s, color .2s; }
.acct:hover, .acct:focus-visible, .acct[aria-current] { border-color: var(--fg); }
.acct.anon { border: 0; color: var(--mid); }
.acct.anon:hover, .acct.anon:focus-visible { color: var(--fg); }
.acct svg { width: 30px; height: 30px; display: block; }
.acct.pic { border-color: var(--dim); }
.acct img { width: 100%; height: 100%; object-fit: cover; display: block; }
.demo-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; line-height: 16px; color: var(--mid); border: 1px solid var(--dim); border-radius: 9px; padding: 0 8px; }
.bar.has-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.bar.has-nav .bar-r { justify-self: end; }
.bar.has-nav .mark { justify-self: start; }   /* ссылка на главную — по логотипу, а не на всю левую треть шапки */
.pnav { display: flex; gap: clamp(16px, 2vw, 30px); height: 40px; align-items: center; font-size: 14px; letter-spacing: .06em; white-space: nowrap; }
.pnav a { color: var(--mid); transition: color .2s; padding: 12px 8px; margin: 0 -8px; border-radius: 8px; }   /* поля 8px — для рамки фокуса, место в строке прежнее */
.pnav a:hover, .pnav a:focus-visible, .pnav a[aria-current="page"] { color: var(--fg); }
.pnav a:focus-visible { outline-offset: -4px; }
.burger { display: none; width: 40px; height: 40px; margin-right: -8px; border: 0; background: none; cursor: pointer; position: relative; }
.burger i { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--fg); transition: transform .2s var(--ease); }
.burger i:first-child { top: 15px; } .burger i:last-child { top: 23px; }
.burger[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }
.menu { position: fixed; inset: 0 0 auto 0; z-index: 9; height: 100vh; height: 100lvh; min-height: 100%; background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg);   /* iOS Safari: и под нижней панелью, и под вспрыгнувшей адресной строкой — тот же фон */
  padding: calc(96px + var(--sat)) var(--pad) calc(40px + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px) + 100lvh - 100svh);   /* последний пункт не уходит под панели */
  display: flex; flex-direction: column; gap: 32px; overflow-y: auto; overscroll-behavior: contain; }
.menu[hidden] { display: none; }
.menu:not([hidden]) nav { animation: pop-in .2s var(--ease); }   /* фон сразу непрозрачный — страница не просвечивает сквозь пункты */
.menu nav { display: grid; }
.menu nav a { font-size: clamp(32px, 9vw, 52px); font-weight: 300; letter-spacing: -.03em; padding: 8px 0; color: var(--mid); }
.menu nav a[aria-current="page"], .menu nav a:active { color: var(--fg); }
@media (max-height: 500px) { .menu { padding-top: calc(72px + var(--sat)); } .menu nav a { font-size: 32px; padding: 4px 0; } }   /* телефон боком */
/* 961–1180: меню разделов остаётся в шапке, только плотнее; казахские пункты длиннее — ещё мельче */
@media (min-width: 961px) and (max-width: 1180px) {
  .pnav { font-size: 13px; letter-spacing: .03em; gap: 18px; }
  :lang(kk) .pnav { font-size: 12px; letter-spacing: 0; gap: 14px; }
}
@media (max-width: 960px) {
  .pnav { display: none; }
  .burger { display: block; }
  .bar.has-nav { display: flex; }
}
@media (max-width: 640px) { .bar-r { gap: 8px; } .acct { width: 32px; height: 32px; } .acct svg { width: 28px; height: 28px; } }
@media (max-width: 379px) { .demo-tag { display: none; } }
@media (max-width: 379px) { .lsw-m { min-width: 168px; } }   /* iPhone SE: меню языков не прилипает к краю экрана */
@media (max-width: 480px) { .bar:not(.has-nav) .demo-tag { display: none; } }   /* вход/кабинет: на телефоне шапка как раньше */
@media print { .bar-r, .pnav, .burger, .menu { display: none !important; } }

/* счётчик непрочитанных у иконки аккаунта (шапка) */
.acct-w { position: relative; display: inline-grid; }
.acct-n { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid;
  place-items: center; background: var(--fg); color: var(--bg); font: 600 10px/1 var(--mono); text-decoration: none; border: 2px solid var(--bg); }
/* телефон, вошедший: иконка сообщений + меню языков + DEMO — надпись домена уступает место (шар остаётся) */
@media (max-width: 440px) { .bar.has-nav:has(.hdr-msg) .mark .dom { display: none; } .bar-r { gap: 8px; } .lsw > summary { gap: 4px; } }

/* знак Verified — одно имя знака на всех языках, одна метка везде (профиль, кабинет, сеть, чат) */
.vpl { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  color: var(--fg); border: 1px solid var(--mid); border-radius: 99px; padding: 4px 12px 4px 4px; line-height: 1; white-space: nowrap; }
.vpl svg { width: 16px; height: 16px; flex: none; color: var(--fg); }
/* флажок 16 px вместо системного checkbox */
.chk { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk i { width: 16px; height: 16px; border: 1px solid var(--mid); border-radius: 4px; flex: none; transition: background-color .15s, border-color .15s; }
.chk input:checked + i { background: var(--fg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.2' fill='none' stroke='%230e0e0e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; border-color: var(--fg); }
.chk input:focus-visible + i { outline: 2px solid var(--fg); outline-offset: 2px; }
/* выпадающий список без системной стрелки */
select.sel { appearance: none; -webkit-appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a8a8a' stroke-width='1.5'/%3E%3C/svg%3E") right 16px center / 12px no-repeat; }
select.sel option { background: var(--raised); }

/* поля по краям экрана: вырез iPhone в горизонтальной ориентации */
:root { --padl: max(var(--pad), env(safe-area-inset-left, 0px)); --padr: max(var(--pad), env(safe-area-inset-right, 0px)); }
.wrap, .bar, .foot, .menu { padding-left: var(--padl); padding-right: var(--padr); }

/* тач-экраны: зона нажатия не меньше 44 px (видимый размер прежний, где можно) */
@media (pointer: coarse) {
  .pill, .btn.sm { min-height: 44px; }
  .btn.sm { height: 44px; border-radius: 22px; }
  .burger { width: 44px; height: 44px; margin-right: -10px; }
  .burger i:first-child { top: 17px; } .burger i:last-child { top: 25px; }
  .lsw > summary { height: 44px; }
  .acct { position: relative; overflow: visible; }
  .acct img { border-radius: 50%; }
  .acct::after { content: ""; position: absolute; inset: -6px; }
  .mark { position: relative; }
  .mark::after { content: ""; position: absolute; inset: -11px -11px -11px -11px; }   /* один шар без надписи — 22 px; зона нажатия 44 */
  .acct-n { z-index: 1; }
  .foot { row-gap: 0; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .foot > * { padding: 12px 0; min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
  .acts a, .acts button { min-height: 44px; }
}

/* большие мониторы: весь сайт пропорционально крупнее, как на 1440 (без пустых полей по краям) */
@media (min-width: 1600px) { html { zoom: 1.12; --z: 1.12; } }
@media (min-width: 1800px) { html { zoom: 1.25; --z: 1.25; } }
@media (min-width: 2200px) { html { zoom: 1.5; --z: 1.5; } }
@media (min-width: 2800px) { html { zoom: 1.8; --z: 1.8; } }

/* крестик закрытия — одна векторная иконка по всему сайту, ровно по центру круга */
.xi { width: 14px; height: 14px; flex: none; display: block; }

/* значки в кнопках — векторные: символы шрифта (⋯ ‹ › ← ↗) на iPhone встают не по центру */
.ii { width: 16px; height: 16px; flex: none; display: block; }

/* ловушка для ботов в форме входа: человеку не видна и не доступна с клавиатуры */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* полосы прокрутки скрыты везде (страница, панели, чаты, списки); листается колесом, пальцем, клавиатурой */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ── переходы между страницами (как на artificial.kz; логика направления — head.js) ─────────────────────────────
   уходящее содержимое (vt-out, имя ставится на старой странице) гаснет, приходящее (vt-page) проявляется со сдвигом;
   шапка, окно сообщений и зерно — отдельные неподвижные слои. Карточка ↔ пост (html.vt-news) — переход из pub.css. */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
#main { view-transition-name: vt-page; }
.bar { view-transition-name: vt-bar; }
html.vt-news #main { view-transition-name: none; }
html.vt-wk .bar { view-transition-name: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(vt-bar), ::view-transition-old(vt-bar), ::view-transition-new(vt-bar) { animation: none; }
::view-transition-group(vt-bar) { z-index: 10; }
/* окно сообщений (чат-док внизу справа) — свой слой поверх едущих страниц, неподвижный, как шапка */
.chatdock { view-transition-name: vt-dock; }
html.vt-wk .chatdock { view-transition-name: none; }
::view-transition-group(vt-dock), ::view-transition-old(vt-dock), ::view-transition-new(vt-dock) { animation: none; }
::view-transition-group(vt-dock) { z-index: 11; }
::view-transition-new(vt-dock) { display: none; }   /* на новой странице окно ещё не заполнено скриптом — весь переход видно прежнее */
::view-transition-group(vt-grain), ::view-transition-old(vt-grain), ::view-transition-new(vt-grain) { animation: none; }
::view-transition-group(vt-grain) { z-index: 9; }
::view-transition-old(vt-grain) { display: none; }
html.vt-wk::after { view-transition-name: none; }
/* смена раздела: прежняя страница гаснет на месте, затем новая проявляется с коротким сдвигом — двух копий текста нет ни в одном кадре */
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-in-r { from { transform: translateX(20px); opacity: 0; } }
@keyframes vt-in-l { from { transform: translateX(-20px); opacity: 0; } }
::view-transition-group(vt-page), ::view-transition-group(vt-out) { animation: none; }
::view-transition-old(vt-page), ::view-transition-old(vt-out) { animation: vt-fade-out .12s cubic-bezier(.4, 0, 1, 1) both; mix-blend-mode: normal; }
::view-transition-new(vt-page) { animation: vt-in-r .24s cubic-bezier(.2, .7, .1, 1) .12s both; mix-blend-mode: normal; }
html.vt-back::view-transition-new(vt-page) { animation-name: vt-in-l; }
/* Safari: снимков нет — содержимое новой страницы проявляется с тем же коротким сдвигом */
html.vt-in-fwd #main, html.vt-in-back #main { overflow-x: clip; }
html.vt-in-fwd #main > * { animation: vt-in-r .24s cubic-bezier(.2, .7, .1, 1) both; }
html.vt-in-back #main > * { animation: vt-in-l .24s cubic-bezier(.2, .7, .1, 1) both; }
@media (prefers-reduced-motion: reduce) { html.vt-in-fwd *, html.vt-in-back * { animation: none !important; } }

/* вход через Google / LinkedIn / GitHub (inart/sso.py): значки провайдеров на экране входа и в кабинете */
.sso-i { width: 18px; height: 18px; flex: none; }
.btn.md .sso-i { width: 18px; height: 18px; }
.sso .btn { gap: 12px; }
.sso-cut { fill: var(--bg); }
/* экран входа: только круглые чёрно-белые значки, подпись — в aria-label/title */
.sso-row { display: flex; justify-content: center; gap: 16px; }
.sso-c { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid #3a3a3a; color: var(--fg);
  transition: border-color .2s, background-color .2s; }
.sso-c .sso-i { width: 22px; height: 22px; }
.sso-c:hover, .sso-c:focus-visible { border-color: var(--fg); background: rgba(255, 255, 255, .04); }
/* «Мои QR» на экране «Домой»: уход к провайдеру открыл бы браузер со своими куками — там только вход по коду */
@media (display-mode: standalone) { .sso { display: none; } }
