/* BigDaddy HH · «Чёрный и золото» */
:root {
  /* палитра (утверждена) */
  --bg: #0b0b0c;
  --card: #141310;
  --line: #2a261f;
  --line-strong: #3a3326;
  --text: #efe9dd;
  --muted: #a39a88;
  --gold: #e0bf82;
  --empty: #26231e;
  --ok: #7fbf7a;
  --soft: #c9c1b1;
  --gold-hover: #f5dfb0;
  --on-gold: #14110c;
  --error: #e8a08a;
  --edge: linear-gradient(135deg, #b8955c 0%, #3a3326 30%, #2a261f 65%, #6b5734 100%);

  /* материал */
  --well: #0d0c0a;                         /* поля ввода: темнее карточки */
  --card-top: #181611;                     /* верх карточки, едва светлее низа */
  --gold-deep: #b8955c;
  --gold-light: #f2dcaa;
  --gold-fill: linear-gradient(180deg, #ecd29c 0%, #e0bf82 48%, #c9a466 100%);
  --gold-text: linear-gradient(180deg, #f5e1b4 0%, #e3c387 46%, #c39c5c 100%);
  --hair: rgba(224, 191, 130, 0.22);       /* золотая волосяная линия */
  --hair-soft: rgba(224, 191, 130, 0.12);
  --hover-line: #5a4b30;
  --highlight: inset 0 1px 0 rgba(255, 240, 210, 0.045);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -18px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 28px 56px -24px rgba(0, 0, 0, 0.85);
  --glow: 0 0 0 3px rgba(224, 191, 130, 0.2);

  /* шрифты и ритм (сетка 8 px) */
  --serif: "Playfair Display", Georgia, serif;
  --sans: Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  --track: 0.18em;                         /* разрядка микроподписей */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px;
  --r-sm: 10px; --r: 12px; --r-lg: 20px;

  /* движение: медленно, плавно, без отскоков */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fade: 350ms;
  --slow: 600ms;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  animation: bd-fade-in var(--slow) var(--ease) both;
  transition: opacity var(--fade) var(--ease);
}
body.leaving { opacity: 0; }
@keyframes bd-fade-in { from { opacity: 0; } to { opacity: 1; } }
/* содержимое поднимается на 6 px волной, без отскока */
@keyframes bd-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page > *, .face > * { animation: bd-rise 700ms var(--ease-out) both; }
.page > :nth-child(2), .face > :nth-child(2) { animation-delay: 90ms; }
.page > :nth-child(3) { animation-delay: 180ms; }

::selection { background: rgba(224, 191, 130, 0.3); color: #fff8ea; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--hover-line); }

a { color: #e8c98d; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: rgba(232, 201, 141, 0.45); transition: color .3s var(--ease), text-decoration-color .3s var(--ease); }
a:hover { color: var(--gold-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-style: italic; font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.005em; }
h1 { font-size: 44px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0 0 12px; text-wrap: pretty; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
code { color: var(--soft); background: var(--well); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--well); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 12px; color: var(--soft); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45); line-height: 1.6; }
.num, [data-count] { font-variant-numeric: lining-nums tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* микроподпись: заглавные с разрядкой */
.eyebrow, .mini-l, dl.kv dt, th, legend, .brand-tag {
  font-size: 11px; font-weight: 500; letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); line-height: 1.4;
}
/* золотой штрих перед подписью главной карточки */
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0; }
/* черта-засечка только на экранах входа: в карточках кабинета она читалась как минус */
.face .eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--gold); opacity: .75; flex: none; }

/* зерно */
.grain { position: fixed; inset: 0; width: 100%; height: 100%; opacity: 0.09; pointer-events: none; z-index: 0; }
/* едва заметный тёплый свет сверху страницы */
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: 0; background: radial-gradient(60% 100% at 50% 0%, rgba(224, 191, 130, 0.045), rgba(224, 191, 130, 0) 70%); }
.page { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: var(--s5) var(--s6) 72px; display: flex; flex-direction: column; gap: var(--s4); }

/* шапка */
.top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; padding-bottom: var(--s3); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--hair) 0%, var(--line) 35%, var(--line) 70%, rgba(42, 38, 31, 0) 100%); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--hair); display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--gold); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--hair-soft); flex: none; transition: border-color .4s var(--ease); }
.brand:hover .brand-mark { border-color: var(--gold); }
.brand-name { font-family: var(--serif); font-style: italic; font-size: 26px; letter-spacing: 0.01em; color: var(--gold); line-height: 1; }
.brand-tag { padding-left: 14px; border-left: 1px solid var(--line-strong); }
.top-nav { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.top-nav > a:not(.how-btn), .top-nav .link {
  position: relative; color: var(--soft); text-decoration: none; font-size: 12px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; padding: 6px 0;
}
.top-nav > a:not(.how-btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.top-nav > a:not(.how-btn):hover, .top-nav .link:hover { color: var(--text); }
.top-nav > a:not(.how-btn):hover::after, .top-nav a[aria-current="page"]::after { transform: scaleX(1); }
.top-nav a[aria-current="page"] { color: var(--text); }
.how-btn { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(224, 191, 130, 0.03); color: var(--gold) !important; font: 400 12px var(--sans); letter-spacing: 0.14em; text-transform: uppercase; display: inline-flex; align-items: center; cursor: pointer; text-decoration: none; box-shadow: var(--highlight); transition: border-color .4s var(--ease), background .4s var(--ease); }
.how-btn:hover { border-color: rgba(224, 191, 130, 0.5); background: rgba(224, 191, 130, 0.06); }

/* кнопки */
.btn, button { font-family: var(--sans); }
.btn, .btn-ghost, form button:not(.link) {
  position: relative; isolation: isolate; overflow: hidden;
  height: 48px; padding: 0 24px; border-radius: var(--r); font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  text-decoration: none; border: 0; background: var(--gold-fill); color: var(--on-gold);
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.55), inset 0 -1px 0 rgba(80, 56, 20, 0.35), 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -14px rgba(224, 191, 130, 0.45);
  transition: box-shadow .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease), filter .4s var(--ease);
}
/* мягкий блик по золоту при наведении */
.btn::after, form button:not(.link):not(.ghost)::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 30%, rgba(255, 250, 235, 0.45) 50%, rgba(255, 255, 255, 0) 70%);
  transform: translateX(-120%); transition: transform 1.1s var(--ease);
}
.btn:hover, form button:not(.link):hover { color: var(--on-gold); filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.6), inset 0 -1px 0 rgba(80, 56, 20, 0.35), 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 32px -14px rgba(224, 191, 130, 0.55); }
.btn:hover::after, form button:not(.link):not(.ghost):hover::after { transform: translateX(120%); }
.btn:active, form button:not(.link):active { filter: brightness(.96); }
.btn-ghost, button.ghost, form button.ghost {
  background: rgba(255, 240, 210, 0.015); color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; box-shadow: var(--highlight);
}
.btn-ghost, button.ghost { position: relative; height: 48px; padding: 0 24px; border-radius: var(--r); font-size: 14px; letter-spacing: 0.02em; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; transition: border-color .4s var(--ease), background .4s var(--ease), color .4s var(--ease); }
.btn-ghost:hover, button.ghost:hover, form button.ghost:hover { background: rgba(224, 191, 130, 0.05); border-color: rgba(224, 191, 130, 0.45); color: var(--gold-hover); filter: none; box-shadow: var(--highlight); }
button.small, form button.small { height: 36px; padding: 0 16px; font-size: 13px; border-radius: var(--r-sm); }
button.link, .link { background: none; border: 0; padding: 0; color: #e8c98d; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: rgba(232, 201, 141, 0.45); text-underline-offset: 4px; height: auto; transition: color .3s var(--ease), text-decoration-color .3s var(--ease); }
button.link:hover { color: var(--gold-hover); text-decoration-color: currentColor; }
.top-nav .link { text-decoration: none; }
button:disabled { opacity: .55; cursor: progress; filter: saturate(.7); }
form.inline { display: inline; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* формы: тёмные «колодцы», золотая каретка, мягкое свечение фокуса */
label { display: flex; flex-direction: column; gap: var(--s1); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); }
label.check { flex-direction: row; align-items: center; gap: 12px; font-size: 15px; font-weight: 300; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0 0 12px; cursor: pointer; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; background: var(--well); color: var(--text); border: 1px solid #2f2a21; border-radius: var(--r);
  padding: 12px 16px; font: 300 15px/1.45 var(--sans); letter-spacing: 0; text-transform: none; min-height: 48px;
  caret-color: var(--gold);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 240, 210, 0.03);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
input:not([type=checkbox]):not([type=radio]):hover, textarea:hover { border-color: var(--line-strong); }
input[type=number] { max-width: 120px; }
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #7d7566; }
/* фокус: золотая рамка и свечение; прозрачный outline остаётся для режима высокой контрастности */
input:not([type=checkbox]):not([type=radio]):focus-visible, textarea:focus-visible, select:focus-visible,
input:not([type=checkbox]):not([type=radio]):focus, textarea:focus {
  outline: 1px solid transparent; outline-offset: 0; border-color: var(--gold);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), var(--glow);
}
/* автозаполнение браузера красит поля в свой цвет: возвращаем палитру */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--gold);
  -webkit-box-shadow: 0 0 0 1000px var(--well) inset; box-shadow: 0 0 0 1000px var(--well) inset;
  transition: background-color 9999s ease-out 0s;
}
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--well) inset, var(--glow); box-shadow: 0 0 0 1000px var(--well) inset, var(--glow); }
/* флажки и переключатели: золотая вставка внутри колодца */
input[type=checkbox], input[type=radio] {
  -webkit-appearance: none; appearance: none; accent-color: var(--gold);
  width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer;
  background: var(--well); border: 1px solid var(--line-strong); border-radius: 5px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: var(--hover-line); }
input[type=checkbox]:checked, input[type=radio]:checked {
  border-color: var(--gold); background: var(--gold-fill);
  box-shadow: inset 0 0 0 3px var(--well);
}
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .45; cursor: not-allowed; }
@media (forced-colors: active) { input[type=checkbox], input[type=radio] { appearance: auto; -webkit-appearance: auto; } }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: var(--s2) var(--s2) var(--s1); margin: 0 0 var(--s3); min-width: 0; }
legend { padding: 0 8px; }
fieldset.mode { display: flex; gap: var(--s3); padding: 12px var(--s2); flex-wrap: wrap; }
fieldset.mode label { margin: 0; }
form.is-sending button[type=submit], form.is-sending button:not([type]) { opacity: .6; cursor: progress; }
/* видны поля только выбранного режима поиска: правка в скрытом не теряется молча */
form:has(.mode input[value=simple]:checked) .advanced,
form:has(.mode input[value=advanced]:checked) .simple { display: none; }
.hint { color: var(--muted); font-size: 13px; margin-top: -16px; margin-bottom: var(--s3); line-height: 1.5; }
.preview:not(:empty) { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* карточки: лёгкий свет сверху, внутренняя кромка, глубокая тень при наведении */
.card {
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card) 120px), var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); min-width: 0;
  box-shadow: var(--highlight), var(--shadow-1);
}
.edge { padding: 1px; border-radius: var(--r-lg); background: var(--edge); min-width: 0; box-shadow: var(--shadow-1), 0 30px 80px -50px rgba(224, 191, 130, 0.25); }
.edge > .card { border: 0; border-radius: 19px; height: 100%; box-shadow: var(--highlight); }
.bd-lift { transition: transform .6s var(--ease), border-color .6s var(--ease), box-shadow .6s var(--ease); }
.bd-lift:hover { transform: translateY(-3px); border-color: var(--hover-line); box-shadow: var(--highlight), var(--shadow-2); }
.edge.bd-lift:hover { box-shadow: var(--shadow-2), 0 40px 90px -40px rgba(224, 191, 130, 0.3); }
.stack { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }

/* уведомления в странице */
.error, .saved, .banner { position: relative; border-radius: var(--r); padding: 12px 16px 12px 20px; margin: 0 0 var(--s2); font-size: 14px; box-shadow: var(--highlight); }
.error::before, .saved::before, .banner::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: currentColor; opacity: .8; }
.error { color: var(--error); border: 1px solid #4a2b22; background: #170f0d; }
.saved { color: var(--ok); border: 1px solid #2a4228; background: #0e140d; }
.banner { color: var(--gold); border: 1px solid var(--hair); background: var(--card); }

/* кабинет */
.tabs, .settings-nav { display: flex; gap: var(--s1); flex-wrap: wrap; }
.tabs a, .settings-nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 13px; color: var(--soft); text-decoration: none; background: rgba(255, 240, 210, 0.012); box-shadow: var(--highlight);
  transition: color .4s var(--ease), border-color .4s var(--ease), background .4s var(--ease);
}
.tabs a:hover, .settings-nav a:hover { color: var(--text); border-color: rgba(224, 191, 130, 0.45); }
.settings-nav a[aria-current="page"] { color: var(--on-gold); background: var(--gold-fill); border-color: var(--gold); font-weight: 500; box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.55); }
.profile { display: flex; flex-direction: column; gap: var(--s4); scroll-margin-top: var(--s3); }
.profile + .profile { border-top: 1px solid var(--line); padding-top: var(--s6); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s2); flex-wrap: wrap; }
.person { font-family: var(--serif); font-style: italic; font-size: 48px; line-height: 1.08; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.subtitle { font-size: 14px; color: var(--muted); margin-top: var(--s1); letter-spacing: 0.01em; }
.pill { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px; border: 1px solid var(--hair); border-radius: 999px; font-size: 13px; color: var(--gold); white-space: nowrap; background: rgba(224, 191, 130, 0.03); box-shadow: var(--highlight); letter-spacing: 0.02em; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--gold); }
@keyframes bd-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(127,191,122,.5); } 55% { box-shadow: 0 0 0 7px rgba(127,191,122,0); } }
.bd-pulse { animation: bd-pulse 2.8s var(--ease) infinite; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.grid .edge { grid-column: span 2; }
.edge > .card { padding: var(--s4) 36px; }
.big { display: flex; align-items: baseline; gap: 12px; margin-top: var(--s2); flex-wrap: wrap; }
/* главная цифра: золото с градиентом; поля справа, чтобы курсив не обрезался */
.big-n {
  font-family: var(--serif); font-style: italic; font-size: 88px; line-height: 1.02; color: var(--gold);
  letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; padding: 0 0.1em 0 0.02em; margin-right: -0.08em;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .big-n { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.big-of { font-size: 18px; color: var(--muted); letter-spacing: 0.01em; }
.progress { height: 4px; border-radius: 4px; background: var(--empty); margin-top: var(--s3); overflow: hidden; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5); }
.progress > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-deep), var(--gold) 70%, var(--gold-light)); }
.progress-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin: var(--s4) 0 0; padding: var(--s2) 0 0; list-style: none; border-top: 1px solid var(--line); }
.bars li { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s1); height: 100%; justify-content: flex-end; }
.bars .col { width: 100%; height: 80px; display: flex; align-items: flex-end; }
.bars .bar { width: 100%; min-height: 3px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 35%, var(--gold-deep) 100%); box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.4); }
.bars .bar.zero { background: var(--empty); box-shadow: none; }
.bars .lbl { font-size: 11px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.02em; }
.week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.week-sum { display: flex; gap: var(--s4); margin: 0; flex-wrap: wrap; }
.week-sum dt { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.week-sum dd { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-size: 32px; line-height: 1.1; }
.week-bars { height: auto; }
.example-hint { margin: var(--s1) 0 0; }
#example { margin-bottom: var(--s2); }
.week-bars li { height: auto; }
.week-bars .n { font-size: 12px; color: var(--soft); min-height: 1em; font-variant-numeric: lining-nums tabular-nums; }
.week-bars .today .lbl { color: var(--gold); }
@keyframes bd-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bd-bar { transform-origin: bottom; animation: bd-grow 1s var(--ease-out) both; animation-delay: calc(200ms + var(--i, 0) * 50ms); }
.mini { padding: var(--s3); display: flex; flex-direction: column; justify-content: space-between; }
.mini-n { font-family: var(--serif); font-style: italic; font-size: 40px; margin-top: var(--s1); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.foot-note { font-size: 14px; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions form { margin: 0; }
.subnav { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; padding-top: var(--s3); border-top: 1px solid var(--line); }
.subnav a { position: relative; color: var(--soft); text-decoration: none; padding: 4px 0; }
.subnav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.subnav a:hover { color: var(--gold); }
.subnav a:hover::after { transform: scaleX(1); }

/* пустые состояния: тонкий штрих и строка курсивом */
.empty { padding: 56px var(--s6); }
.empty::before { content: ""; display: block; width: 40px; height: 1px; background: var(--gold); opacity: .7; margin-bottom: var(--s4); }
.empty .lead { font-family: var(--serif); font-style: italic; font-size: 36px; line-height: 1.2; margin-bottom: var(--s2); text-wrap: balance; }
.empty .lead + .muted { max-width: 520px; margin-bottom: var(--s4); }
.empty-line { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--muted); margin: var(--s1) 0 0; }

/* страницы настроек */
.page-head { display: flex; flex-direction: column; gap: var(--s3); }
.page-head h1::after, .admin > h1::after { content: ""; display: block; width: 40px; height: 1px; margin-top: var(--s2); background: var(--gold); opacity: .7; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); align-items: start; }
.card h2 { margin-bottom: var(--s2); }
.card h1 { margin-bottom: var(--s1); }
.readonly { color: var(--soft); }
.card.readonly { background: linear-gradient(180deg, #121110 0%, #100f0d 100%); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list a { overflow-wrap: anywhere; }
.mark { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; letter-spacing: 0.02em; }
.mark::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
[data-mark="applied"] .mark { color: var(--ok); border-color: #2a4228; }
[data-mark="queued"] .mark { color: var(--gold); border-color: var(--hair); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px; border-bottom: 1px solid var(--line-strong); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:has(td):hover td { background: rgba(224, 191, 130, 0.02); }
th:first-child, td:first-child { padding-left: 0; }
tr.disabled td { opacity: .6; }
th { white-space: nowrap; }
/* число и кнопка в одну строку: лимиты в админке */
form:has(> input[type=number]) { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
td form:has(> input[type=number]) { display: inline-flex; flex-wrap: nowrap; gap: 8px; }
td input[type=number] { width: 72px; min-height: 36px; padding: 6px 12px; border-radius: var(--r-sm); }
dl.kv { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
dl.kv div { background: linear-gradient(180deg, var(--card-top) 0%, var(--card) 100%); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); min-width: 0; box-shadow: var(--highlight), var(--shadow-1); }
dl.kv dd { margin: var(--s1) 0 0; font-family: var(--serif); font-style: italic; font-size: 40px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; }
details { margin-top: var(--s1); }
summary { cursor: pointer; color: var(--gold); font-size: 13px; letter-spacing: 0.02em; }
summary::marker { color: var(--gold-deep); }
details[open] > summary { margin-bottom: var(--s2); }
.profile-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-row:last-child { border-bottom: 0; }

/* скелеты */
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.sk { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--empty) 0%, #302a22 50%, var(--empty) 100%); background-size: 200% 100%; animation: bd-sk 1.8s var(--ease) infinite; }
.sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.w40 { width: 40%; } .sk.tall { height: 48px; border-radius: 12px; }
@keyframes bd-sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* вход и регистрация */
/* сетка по центру экрана, но верх карточки на одной линии с фразой */
.face { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 420px); gap: 96px; align-content: center; align-items: start; max-width: 1200px; margin: 0 auto; padding: 72px 48px; }
/* тёплое свечение за фразой */
body:has(.face) { overflow-x: clip; }
body:has(.face)::before { display: none; }
.face::before { content: ""; position: absolute; left: -120px; top: 50%; width: 820px; height: 620px; transform: translateY(-50%); background: radial-gradient(closest-side, rgba(224, 191, 130, 0.075), rgba(224, 191, 130, 0) 100%); pointer-events: none; z-index: -1; }
/* монограмма: двойное кольцо, как печать */
.monogram { position: relative; width: 64px; height: 64px; border: 0; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--gold); letter-spacing: 0.02em; margin-bottom: 72px; box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--hair), 0 0 40px -6px rgba(224, 191, 130, 0.25); }
.phrase { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 60px; line-height: 1.08; letter-spacing: -0.015em; max-width: 640px; margin: 0; text-wrap: balance; }
.three { list-style: none; padding: 0; margin: var(--s5) 0 0; display: flex; flex-direction: column; gap: 0; color: var(--muted); font-size: 15px; counter-reset: three; max-width: 520px; }
.three li { display: flex; align-items: baseline; gap: var(--s2); counter-increment: three; padding: 12px 0; border-top: 1px solid var(--line); }
.three li:last-child { border-bottom: 1px solid var(--line); }
.three li::before { content: counter(three, decimal-leading-zero); flex: none; width: 22px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
/* 64 px монограммы + 72 px отступа: верх карточки = верх фразы */
.face-card { margin-top: 136px; box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9), 0 30px 80px -50px rgba(224, 191, 130, 0.3); }
.face .card { padding: 40px; }
.face .card .eyebrow { margin-bottom: 12px; }
.face .card h1 { font-size: 34px; margin-bottom: var(--s4); }
.face .card h1::after { content: ""; display: block; width: 40px; height: 1px; margin-top: var(--s2); background: var(--gold); opacity: 0.7; }
.face .card form button { width: 100%; margin-top: var(--s1); }
.face-alt { margin: var(--s3) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* панель «Как это работает» */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(5,5,6,.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 40; opacity: 0; visibility: hidden; transition: opacity var(--slow) var(--ease), visibility 0s linear var(--slow); }
.drawer-backdrop.open { opacity: 1; visibility: visible; transition: opacity var(--slow) var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100%; z-index: 50; background: linear-gradient(180deg, var(--card-top) 0%, var(--card) 240px); border-left: 1px solid var(--line-strong); box-shadow: -40px 0 100px -20px rgba(0, 0, 0, 0.75), inset 1px 0 0 rgba(255, 240, 210, 0.03); display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden; transition: transform var(--slow) var(--ease-out), visibility 0s linear var(--slow); }
.drawer.open, html:not(.js) .drawer:target { transform: none; visibility: visible; transition: transform var(--slow) var(--ease-out); }
.drawer::before { content: ""; position: absolute; left: -1px; top: 0; width: 1px; height: 180px; background: linear-gradient(180deg, var(--gold), rgba(224, 191, 130, 0)); opacity: .6; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 32px; }
.drawer-head p { margin: var(--s1) 0 0; color: var(--muted); font-size: 13px; }
.drawer-close { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); font-size: 20px; font-weight: 300; line-height: 1; cursor: pointer; display: grid; place-items: center; text-decoration: none; transition: border-color .4s var(--ease), color .4s var(--ease), transform .6s var(--ease); }
.drawer-close:hover { border-color: rgba(224, 191, 130, 0.5); color: var(--gold); transform: rotate(90deg); }
.drawer-body { overflow-y: auto; padding: var(--s1) var(--s4) var(--s4); flex: 1; overscroll-behavior: contain; }
.how { list-style: none; padding: 0; margin: 0; counter-reset: how; }
.how li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 12px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); counter-increment: how; }
.how li:last-child { border-bottom: 0; }
.how li::before { content: counter(how, decimal-leading-zero); font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 15px; grid-row: span 2; font-variant-numeric: lining-nums tabular-nums; padding-top: 1px; }
.how b { font-weight: 500; color: var(--text); grid-column: 2; }
.how .what { grid-column: 2 / 4; color: var(--muted); font-size: 13px; line-height: 1.55; }
.how .when { grid-column: 3; grid-row: 1; font-size: 12px; color: var(--gold); white-space: nowrap; text-align: right; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.01em; }
.how .when.none { color: var(--muted); }
body.drawer-open { overflow: hidden; }

/* тосты */
.toasts { position: fixed; left: 50%; bottom: var(--s3); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 12px; align-items: center; width: min(480px, calc(100% - 32px)); pointer-events: none; }
.toast {
  position: relative; pointer-events: auto; margin: 0; width: 100%;
  background: rgba(22, 20, 16, 0.92); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--line-strong); color: var(--text); border-radius: 14px; padding: 14px 20px 14px 40px; font-size: 14px; letter-spacing: 0.01em;
  box-shadow: var(--highlight), 0 2px 6px rgba(0,0,0,.4), 0 24px 60px -20px rgba(0,0,0,.8);
  animation: bd-toast-in var(--slow) var(--ease-out) both;
}
.toast::before { content: ""; position: absolute; left: 20px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(224, 191, 130, 0.15); }
.toast.error::before { background: var(--error); box-shadow: 0 0 0 3px rgba(232, 160, 138, 0.15); }
.toast.ok::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(127, 191, 122, 0.15); }
.toast.error { border-color: #4a2b22; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: opacity var(--fade) var(--ease), transform var(--fade) var(--ease); }
@keyframes bd-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* планшет и телефон */
@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid .edge { grid-column: auto; }
  .grid .stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  dl.kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .face { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding: var(--s6) var(--s3); }
  .face::before { left: -40%; top: 20%; width: 140%; height: 480px; }
  .face-card { margin-top: 0; }
  .monogram { margin-bottom: var(--s5); }
}
@media (max-width: 640px) {
  /* таблица пользователей карточками: кнопки не уезжают за край */
  .users table, .users tbody, .users tr, .users td { display: block; width: 100%; }
  .users tr:first-child { display: none; }
  .users tr { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
  .users tr:last-child { border-bottom: 0; }
  .users td { padding: 6px 0; border-bottom: 0; }
  .users td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
  .page { padding: var(--s3) 16px var(--s6); gap: var(--s3); }
  .top { padding-bottom: var(--s2); }
  .top-nav { width: 100%; justify-content: space-between; gap: 8px 12px; }
  .top-nav > a:not(.how-btn), .top-nav .link, .how-btn { font-size: 11px; letter-spacing: 0.06em; }
  .how-btn { padding: 0 12px; }
  .brand-tag { display: none; }
  h1 { font-size: 34px; }
  .person { font-size: 34px; }
  .card, .edge > .card { padding: var(--s3) 20px; border-radius: 16px; }
  .edge { border-radius: 16px; }
  .edge > .card { border-radius: 15px; }
  .big-n { font-size: 68px; }
  .big-of { font-size: 16px; }
  .bars { gap: 4px; height: 100px; margin-top: var(--s3); }
  .bars .col { height: 64px; }
  .bars .lbl { font-size: 10px; }
  .mini { padding: 14px 12px; }
  .mini-l { font-size: 10px; letter-spacing: 0.1em; }
  .mini-n { font-size: 30px; }
  .actions, .actions form, .actions .btn, .actions .btn-ghost, .actions button { width: 100%; }
  .subnav { gap: var(--s2) var(--s3); }
  .face { padding: var(--s4) 16px; }
  .face .card { padding: 28px 20px; }
  .phrase { font-size: 40px; }
  .empty { padding: var(--s4) 20px; }
  .empty .lead { font-size: 30px; }
  .drawer { width: 100%; border-left: 0; }
  .drawer::before { display: none; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  dl.kv { gap: 12px; }
  dl.kv div { padding: var(--s2); }
  dl.kv dd { font-size: 30px; }
}

/* ---- три анимации: волна появления, живая цифра, монограмма ---- */
/* 1. волна: карточки и строки списков по очереди; fill backwards, чтобы после конца не мешать подъёму при наведении */
@keyframes bd-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bd-in { animation: bd-in 500ms var(--ease-out) backwards; animation-delay: calc(120ms + min(var(--d, 0), 12) * 70ms); }

/* 2. блик по прогрессу, когда цифра выросла с прошлого визита (класс ставит JS) */
.progress { position: relative; }
.progress.bd-shine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 248, 230, 0) 0%, rgba(255, 248, 230, 0.75) 50%, rgba(255, 248, 230, 0) 100%);
  width: 40%; animation: bd-shine 900ms var(--ease) both;
}
@keyframes bd-shine { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 3. монограмма на входе: кольцо рисуется тонкой линией, затем проявляются буквы и внешнее кольцо */
.monogram-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.monogram-ring circle { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: bd-draw 1s cubic-bezier(0.65, 0, 0.35, 1) 150ms backwards; }
.monogram-bd { position: relative; animation: bd-letters 400ms var(--ease) 1.1s backwards; }
.monogram { animation: bd-seal 500ms var(--ease) 1.1s backwards; }
@keyframes bd-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes bd-letters { from { opacity: 0; } to { opacity: 1; } }
@keyframes bd-seal { from { box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px rgba(224, 191, 130, 0), 0 0 40px -6px rgba(224, 191, 130, 0); } }

/* без анимаций */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  body.leaving { opacity: 1; }
  .bd-lift:hover, .drawer-close:hover { transform: none; }
  .btn::after, form button:not(.link):not(.ghost)::after, .progress.bd-shine::after { display: none; }
}
.lede { margin-top: var(--s2); }
