/* 404 NOT FOUND — каркас и компоненты. Цвета, шрифты и характер задаёт brand.css через токены.
   Главный экран — телефон стилиста в торговом зале: цели касания от 44 px, крупные цифры, навигация под большим пальцем. */
:root {
  --paper: #fff; --surface: #fff; --ink: #111; --muted: #5c5c5c; --line: #e4e4e4;
  --accent: #ff0000; --accent-ink: #000; --ok: #1d6b3c; --warn: #b3261e;
  --chrome: #fff; --chrome-ink: #111; --chrome-muted: #777;
  --font-ui: "Golos Text", system-ui, sans-serif; --font-display: var(--font-ui); --font-num: var(--font-ui);
  --r: 0px; --gutter: 16px; --tabbar: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--font-ui);
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); -webkit-font-smoothing: antialiased; }
body.guest, body.page-login { padding-bottom: 0; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
::selection { background: var(--accent); color: var(--accent-ink); }
input, button { font: inherit; color: inherit; caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }

/* Шапка и навигация */
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px var(--gutter); background: var(--chrome); color: var(--chrome-ink); }
.logo { flex: none; display: block; width: 30px; height: 50px; background: #ff0000; color: #000; text-decoration: none; }
.logo span { display: block; padding: 4px 3px; font: 700 6.5px/1.05 var(--font-ui); letter-spacing: .02em; }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--chrome-muted); }
.who a { text-decoration: none; }
.who button { background: none; border: 0; padding: 8px 0; min-height: 44px; cursor: pointer; color: inherit; }
.who a:hover, .who button:hover { color: var(--chrome-ink); }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--chrome); border-top: 1px solid var(--line); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-size: 10.5px; letter-spacing: .02em; color: var(--chrome-muted); transition: color .2s; }
nav.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
nav.tabs a.on { color: var(--chrome-ink); }
nav.tabs a.on svg { stroke-width: 2; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  nav.tabs { position: static; display: flex; gap: 4px; height: auto; padding: 0; border: 0; background: none; margin-left: 24px; }
  nav.tabs a { flex-direction: row; gap: 8px; font-size: 14px; padding: 10px 12px; }
  nav.tabs svg { width: 18px; height: 18px; }
}

/* Колонка контента */
/* clip, а не hidden на body: иначе мобильный Chrome расширяет layout viewport (качание бирки) и уносит таббар */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter) 56px; overflow-x: clip; }
h1 { font: 600 30px/1.1 var(--font-display); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font: 600 13px/1.3 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 40px 0 12px; }
.lead { color: var(--muted); margin: 10px 0 0; max-width: 46ch; }
.fine { font-size: 13px; color: var(--muted); margin: 16px 0; }
.page-head, .search, .client-head, .door { position: relative; padding: 32px 0 24px; }
.count { font-size: .55em; vertical-align: super; color: var(--muted); letter-spacing: 0; margin-left: .1em; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px;
  border: 1px solid var(--ink); border-radius: var(--r); background: var(--ink); color: var(--paper);
  font: 600 15px/1 var(--font-ui); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 0 12px; }
.btn.quiet:hover { color: var(--warn); background: transparent; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actions .btn { flex: 1 1 auto; }

/* Поля */
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-size: 13px; letter-spacing: .02em; color: var(--muted); margin: 0 0 6px; padding: 0; }
.field small { color: var(--muted); opacity: .8; margin-left: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=password] {
  width: 100%; min-height: 54px; padding: 12px 14px; font-size: 18px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s; -webkit-appearance: none; appearance: none; }
input:hover { border-color: var(--muted); }
input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input::placeholder { color: var(--muted); opacity: .7; }
.has-error input { border-color: var(--warn); }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--warn); font-size: 14px; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line);
  border-radius: var(--r); font-size: 15px; transition: background .2s, color .2s, border-color .2s; }
.toggle input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.fine-print { font-size: 13px; color: var(--muted); margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); max-height: 260px; overflow: auto; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Поиск */
.search-form { display: flex; gap: 8px; margin-top: 24px; }
.search-form input { flex: 1; min-height: 64px; font: 500 22px/1 var(--font-num); letter-spacing: .02em; }
.search-form .btn { min-height: 64px; }
.not-found { margin-top: 8px; }
.line-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px;
  border-bottom: 1px solid var(--line); text-decoration: none; margin: 0; }
.line-link b { font-size: 20px; }
.line-link.muted { color: var(--muted); font-size: 14px; }
.people { list-style: none; margin: 0; padding: 0; }
.people a, .ranking a, .dates a { display: flex; align-items: center; gap: 14px; min-height: 56px; text-decoration: none; }
.people li { border-bottom: 1px solid var(--line); }

/* Карточка клиента */
.client-head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; color: var(--muted); }
.client-head h1 { font-size: 34px; }
.seal { display: inline-flex; align-items: baseline; gap: 8px; margin: 0 0 14px; padding: 6px 10px;
  background: var(--accent); color: var(--accent-ink); font: 800 13px/1 var(--font-ui); letter-spacing: .14em; }
.seal small { font-weight: 500; letter-spacing: .02em; font-size: 12px; }
.seal.sm { margin: 0 0 0 auto; padding: 4px 7px; font-size: 11px; }
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.total { margin: 0; }
.label { display: block; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.total b { display: block; font-size: 44px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.to-vip { margin-top: 20px; }
.to-vip p { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 0; color: var(--muted); }
.to-vip p b { color: var(--ink); font-weight: 600; }
.meter { display: block; height: 4px; background: var(--line); position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 20px 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 12px; }
.facts dt { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.facts dd { margin: 4px 0 0; font-size: 20px; font-weight: 500; }
.facts small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; font-family: var(--font-ui); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip { padding: 6px 12px; border: 1px solid var(--line); font-size: 14px; border-radius: var(--r); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lines .d { color: var(--muted); font-size: 14px; }
.lines .w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lines .s { font-weight: 600; }
.lines .ret .s, .lines .ret .w { color: var(--warn); }
.history .btn, .client > .btn { margin-top: 24px; }

/* Списки VIP и дней рождения */
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { border-bottom: 1px solid var(--line); }
.ranking a { transition: background .2s; }
.ranking .rank { width: 28px; color: var(--muted); font-size: 13px; }
.ranking .name { flex: 1; min-width: 0; font-size: 17px; line-height: 1.25; padding: 8px 0; }
.ranking .amt { font-weight: 600; }
.near .ranking a { flex-wrap: wrap; row-gap: 0; padding: 12px 0; }
.near .ranking .meter { flex-basis: 100%; margin-top: 8px; }
.near .ranking .amt { color: var(--muted); font-weight: 500; }
.dates { list-style: none; margin: 0; padding: 0; }
.dates li { border-bottom: 1px solid var(--line); }
.dates a { padding: 10px 0; }
.dates .day { width: 64px; flex: none; display: flex; flex-direction: column; }
.dates .day b { font-size: 30px; line-height: 1; font-weight: 600; }
.dates .day small { font-size: 12px; color: var(--muted); }
.dates .name { flex: 1; font-size: 17px; }
.dates .name small { display: block; font-size: 13px; color: var(--muted); }
.dates .today .day b { color: var(--accent); }
.empty { padding: 28px 0; color: var(--muted); max-width: 52ch; list-style: none; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* Совпадения */
.match { border: 1px solid var(--line); background: var(--surface); padding: 20px; margin-bottom: 16px; border-radius: var(--r); }
.match-phone { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.match-phone b { font-size: 22px; font-weight: 600; }
.match-phone small { color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pair > div { padding: 14px 12px 0 0; }
.pair > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.pair b, .pair a { display: block; margin-top: 4px; font-weight: 500; }
.match .actions { margin-top: 20px; }

/* Состояния */
.notice { padding: 12px 14px; border: 1px solid var(--warn); color: var(--warn); margin: 16px 0; font-size: 14px; border-radius: var(--r); }
.stamp { display: inline-block; margin: 0 0 12px; padding: 6px 12px; border: 2px solid var(--warn); color: var(--warn);
  font: 800 13px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; transform: rotate(-2deg); }
.stamp.ok { border-color: var(--ok); color: var(--ok); }

/* Вход */
.door form { margin-top: 28px; }
.door .btn { margin-top: 8px; }

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