/* «Что на ужин» — оформление.
   Тёплая красно-розовая палитра, крупная типографика, много воздуха.
   Ощущение — как у приложения на айфоне: полупрозрачная навигация, мягкие
   тени с розовым подтоном, пружинные отклики на касание. */

/* ------------------------------------------------------------------ основа */

:root {
  color-scheme: light dark;

  /* светлая тема — тёплая бумага */
  --bg:            #FBF2F0;
  --bg-deep:       #F4E6E3;
  --surface:       #FFFFFF;
  --surface-2:     #FDF6F5;
  --ink:           #24121A;
  --ink-soft:      #6B4B54;
  --ink-faint:     #9A7B83;
  --line:          rgba(36, 18, 26, .10);

  --accent:        #C4183C;   /* уверенный красный, не алый */
  --accent-warm:   #FF5F7E;   /* розовый блик */
  --accent-deep:   #8E0F2B;
  --accent-tint:   #FFE7EB;
  --on-accent:     #FFFFFF;

  --glass:         rgba(255, 250, 249, .72);
  --glass-line:    rgba(255, 255, 255, .70);

  --shadow-soft:   0 1px 2px rgba(142, 15, 43, .06), 0 8px 24px rgba(142, 15, 43, .08);
  --shadow-lift:   0 2px 6px rgba(142, 15, 43, .10), 0 18px 44px rgba(142, 15, 43, .16);
  --shadow-accent: 0 8px 28px rgba(196, 24, 60, .34);

  --radius:        24px;
  --radius-sm:     16px;

  --tabbar:        calc(58px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #120A0E;
    --bg-deep:     #0B0507;
    --surface:     #1E1218;
    --surface-2:   #271821;
    --ink:         #FDF1F3;
    --ink-soft:    #C4A5AD;
    --ink-faint:   #937780;
    --line:        rgba(255, 235, 240, .12);

    --accent:      #FF4D6D;
    --accent-warm: #FF89A0;
    --accent-deep: #FF2E55;
    --accent-tint: #3A1622;
    --on-accent:   #240309;

    --glass:       rgba(30, 18, 24, .74);
    --glass-line:  rgba(255, 255, 255, .10);

    --shadow-soft:   0 1px 2px rgba(0, 0, 0, .40), 0 8px 24px rgba(0, 0, 0, .44);
    --shadow-lift:   0 2px 6px rgba(0, 0, 0, .46), 0 18px 44px rgba(0, 0, 0, .56);
    --shadow-accent: 0 8px 28px rgba(255, 77, 109, .30);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font: 400 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  /* тёплое свечение сверху — как свет лампы над столом */
  background-image:
    radial-gradient(120% 68% at 50% -18%, color-mix(in oklab, var(--accent-warm) 26%, transparent), transparent 68%),
    radial-gradient(90% 50% at 100% 8%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 70%);
  background-attachment: fixed;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

/* прокрутка только по вертикали, никакого горизонтального сползания */
body, html { overflow-x: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }

h1, h2, h3 { margin: 0; font-weight: 700; }

.display {
  font-size: clamp(30px, 8.4vw, 40px);
  line-height: 1.04;
  letter-spacing: -.03em;   /* крупному тексту буквы жмём — иначе он рассыпается */
  font-weight: 800;
}

.title {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 700;
}

.sub {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: -.005em;
}

.hint { font-size: 13.5px; color: var(--ink-faint); letter-spacing: .002em; }

.accent-text { color: var(--accent); }

/* --------------------------------------------------------------- каркас */

.app { min-height: 100dvh; }

.screen { display: none; }
.screen.is-on { display: block; }

.page {
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(var(--tabbar) + 118px);
  max-width: 620px;
  margin: 0 auto;
}

/* Шапка не сплошная плашка, а стекло: содержимое уезжает под неё */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  /* вместо жёсткой линии — мягкое затухание на границе с контентом */
  -webkit-mask-image: linear-gradient(180deg, #000 78%, rgba(0, 0, 0, .55) 100%);
          mask-image: linear-gradient(180deg, #000 78%, rgba(0, 0, 0, .55) 100%);
}

.topbar .eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 3px;
}

.topbar h1 { font-size: 26px; letter-spacing: -.025em; line-height: 1.1; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  flex: none;
  transition: transform .12s ease-out, background .18s;
}
.icon-btn:active { transform: scale(.92); background: color-mix(in oklab, var(--ink) 12%, transparent); }
.icon-btn svg { width: 21px; height: 21px; }

/* ----------------------------------------------------------------- сетка */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 30px 2px 14px;
}
.section-head:first-of-type { margin-top: 22px; }
.section-head h2 { font-size: 19px; letter-spacing: -.02em; }
.section-head .count { font-size: 14px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}
.grid.drinks { grid-template-columns: repeat(3, 1fr); gap: 11px; }

@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid.drinks { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------- карточка */

.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
  transform: translateZ(0);
  will-change: transform;
  text-align: left;
}
.grid.drinks .card { border-radius: 20px; }

.card .art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter .3s ease, transform .4s ease;
}

/* Заглушка, пока Росинант не принёс картинку. Не «сломанная картинка»,
   а осмысленный цветной фон с крупной буквой — выглядит нарочно. */
.card .stub {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 44px; font-weight: 800; letter-spacing: -.04em;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}

/* тёмная подложка снизу, чтобы название читалось на любой картинке */
.card .veil {
  position: absolute; inset: 0;
  background: linear-gradient(178deg,
    rgba(0, 0, 0, 0) 34%,
    rgba(28, 6, 12, .34) 62%,
    rgba(24, 4, 10, .82) 100%);
}

.card .label {
  position: absolute; left: 12px; right: 12px; bottom: 11px;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -.012em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}
.grid.drinks .card .label { font-size: 13.5px; left: 10px; right: 10px; bottom: 9px; }

/* «ели недавно» — чтобы не повторяться */
.card .ago {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: #fff;
  background: rgba(20, 6, 10, .48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* галочка */
.card .tick {
  position: absolute; top: 9px; right: 9px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .35);
  transform: scale(.2);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, 1.5, .5, 1), opacity .18s;
}
.card .tick svg { width: 17px; height: 17px; }

.card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  border: 3px solid var(--accent);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.card.is-picked::after { opacity: 1; }
.card.is-picked .tick { transform: scale(1); opacity: 1; }
.card.is-picked { box-shadow: var(--shadow-accent); }
.card.is-picked .art { filter: saturate(1.08); }

/* когда лимит выбран, остальные мягко отступают на второй план */
.card.is-muted { opacity: .42; }
.card.is-muted .art { filter: saturate(.35); }

.card:disabled { cursor: default; }

/* ---------------------------------------------------- плавающая кнопка снизу */

.dock {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--tabbar);
  z-index: 25;
  padding: 12px 18px 14px;
  display: flex; justify-content: center;
  pointer-events: none;
  /* контент проявляется из-под кнопки, а не обрубается линией */
  background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--bg) 86%, transparent) 55%);
}
.dock > * { pointer-events: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 17px; font-weight: 650; letter-spacing: -.012em;
  color: var(--on-accent);
  background: linear-gradient(168deg, var(--accent-warm), var(--accent) 62%, var(--accent-deep));
  box-shadow: var(--shadow-accent);
  width: 100%; max-width: 420px;
  transition: transform .11s ease-out, opacity .2s;
  will-change: transform;
}
.btn:active { transform: scale(.972); }
.btn[disabled] { opacity: .45; box-shadow: none; }
.btn .badge {
  min-width: 26px; height: 26px; padding: 0 8px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .26);
  font-size: 14.5px; font-variant-numeric: tabular-nums;
}

.btn.ghost {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
  box-shadow: none;
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
}
.btn.quiet {
  color: var(--ink-soft);
  background: color-mix(in oklab, var(--ink) 7%, transparent);
  box-shadow: none;
}

/* ------------------------------------------------------------ нижние вкладки */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--glass-line);
}

.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 7px;
  color: var(--ink-faint);
  font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  transition: color .2s;
  position: relative;
}
.tab svg { width: 23px; height: 23px; transition: transform .22s cubic-bezier(.2, 1.4, .5, 1); }
.tab.is-on { color: var(--accent); }
.tab.is-on svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(.9); }

.tab .dot {
  position: absolute; top: 7px; right: calc(50% - 17px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--glass);
  opacity: 0; transform: scale(.4);
  transition: opacity .2s, transform .3s cubic-bezier(.2, 1.5, .5, 1);
}
.tab .dot.is-on { opacity: 1; transform: scale(1); }

/* ------------------------------------------------------------------ панели */

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

.panel + .panel { margin-top: 13px; }

.note {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 16px 17px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 18%, transparent);
}
.note .glyph { font-size: 21px; line-height: 1.2; flex: none; }
.note p { margin: 0 0 4px; font-size: 14.5px; line-height: 1.45; }
.note .actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.note .mini {
  padding: 9px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--on-accent);
  transition: transform .11s ease-out;
}
.note .mini:active { transform: scale(.95); }
.note .mini.plain { background: color-mix(in oklab, var(--ink) 8%, transparent); color: var(--ink-soft); }

/* --------------------------------------------------------- состояние ожидания */

.waiting {
  text-align: center;
  padding: 40px 22px 34px;
}
.waiting .orb {
  width: 92px; height: 92px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--accent-warm), var(--accent) 58%, var(--accent-deep));
  box-shadow: var(--shadow-accent);
  animation: breathe 3.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1);    box-shadow: 0 8px 28px rgba(196, 24, 60, .30); }
  50%      { transform: scale(1.06); box-shadow: 0 14px 44px rgba(196, 24, 60, .44); }
}
.waiting h2 { margin-bottom: 9px; }

/* строка «что отправлено» */
.chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 16px; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 550;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- итог вечера */

.result { padding-top: 8px; }
.result .crown { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.result .display { margin: 8px 0 22px; }

.dish-row {
  display: flex; align-items: center; gap: 15px;
  padding: 13px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}
.dish-row + .dish-row { margin-top: 11px; }
.dish-row .thumb {
  width: 68px; height: 68px; flex: none;
  border-radius: 17px;
  object-fit: cover;
  background: var(--surface-2);
}
.dish-row .thumb.stub-box { display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; }
.dish-row .name { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.dish-row .role { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

/* --------------------------------------------------------------- история */

.day {
  display: flex; gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.day:last-child { border-bottom: 0; }
.day .when { flex: none; width: 60px; padding-top: 2px; }
.day .when b { display: block; font-size: 20px; letter-spacing: -.02em; line-height: 1; }
.day .when span { font-size: 12px; color: var(--ink-faint); }
.day .what { flex: 1; min-width: 0; }
.day .what .line { font-size: 15.5px; line-height: 1.4; letter-spacing: -.01em; }
.day .what .drink { font-size: 13.5px; color: var(--ink-faint); margin-top: 3px; }
.day .pics { display: flex; gap: 6px; margin-top: 9px; }
.day .pics img, .day .pics .ph {
  width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
  background: var(--surface-2);
}
.day .pics .ph { display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff; }

.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--ink-faint);
}
.empty .glyph { font-size: 40px; display: block; margin-bottom: 14px; opacity: .8; }

/* ------------------------------------------------------------------- чат */

/* Высоту режем на вкладки: иначе поле ввода уезжает под них и до кнопки
   «отправить» не дотянуться. */
.chat-screen { display: flex; flex-direction: column; height: calc(100dvh - var(--tabbar)); }

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px calc(18px);
  display: flex; flex-direction: column; gap: 10px;
}

.bubble {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 21px;
  font-size: 16px; line-height: 1.45;
  letter-spacing: -.008em;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: rise .32s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(9px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.bubble.mine {
  align-self: flex-end;
  color: var(--on-accent);
  background: linear-gradient(168deg, var(--accent-warm), var(--accent) 70%);
  border-bottom-right-radius: 7px;
  box-shadow: 0 4px 16px rgba(196, 24, 60, .22);
}
.bubble.his {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 7px;
  box-shadow: var(--shadow-soft);
}
.bubble .stamp { display: block; margin-top: 5px; font-size: 11px; opacity: .62; }

.bubble.mine.is-pending { opacity: .74; }

.howl-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--glass-line);
}
.howl-head .face {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 21px;
  background: linear-gradient(150deg, #F6C177, #C4183C);
  box-shadow: var(--shadow-soft);
  flex: none;
}
.howl-head .who { flex: 1; min-width: 0; }
.howl-head .who b { display: block; font-size: 17px; letter-spacing: -.02em; }
.howl-head .who span { font-size: 12.5px; color: var(--ink-faint); }
.howl-head .who span.awake { color: #2E9E5B; }

.typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint);
  animation: blink 1.3s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.asleep {
  align-self: center;
  text-align: center;
  max-width: 300px;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px; line-height: 1.45;
  color: var(--ink-soft);
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}

.composer {
  display: flex; gap: 9px; align-items: flex-end;
  padding: 10px 14px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--glass-line);
}
.composer textarea {
  flex: 1;
  min-height: 44px; max-height: 132px;
  padding: 11px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  resize: none;
  font-size: 16px;   /* меньше 16 — сафари зумит поле при фокусе */
  line-height: 1.35;
  outline: none;
  transition: border-color .2s;
}
.composer textarea:focus { border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.composer .send {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--on-accent);
  background: linear-gradient(168deg, var(--accent-warm), var(--accent));
  box-shadow: 0 4px 14px rgba(196, 24, 60, .28);
  transition: transform .11s ease-out, opacity .2s;
}
.composer .send:active { transform: scale(.9); }
.composer .send[disabled] { opacity: .35; box-shadow: none; }
.composer .send svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------- вход */

.login {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom, 0px));
  max-width: 480px; margin: 0 auto;
  text-align: center;
}
.login .heart { font-size: 46px; margin-bottom: 18px; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.09); } }
.login .display { margin-bottom: 10px; }
.login .sub { margin-bottom: 34px; }

.who-pick { display: grid; gap: 12px; }
.who-btn {
  display: flex; align-items: center; gap: 15px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform .12s ease-out, box-shadow .2s;
}
.who-btn:active { transform: scale(.975); }
.who-btn .face {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 23px; flex: none;
  background: linear-gradient(150deg, var(--accent-warm), var(--accent));
  color: #fff;
}
.who-btn b { display: block; font-size: 18px; letter-spacing: -.02em; }
.who-btn span { font-size: 13.5px; color: var(--ink-faint); }

.pinpad { margin-top: 28px; }
.pin-dots { display: flex; gap: 13px; justify-content: center; margin: 20px 0 26px; }
.pin-dots i {
  width: 14px; height: 14px; border-radius: 50%;
  background: color-mix(in oklab, var(--ink) 14%, transparent);
  transition: transform .22s cubic-bezier(.2, 1.5, .5, 1), background .2s;
}
.pin-dots i.on { background: var(--accent); transform: scale(1.15); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; }
.keys button {
  height: 62px;
  border-radius: 20px;
  font-size: 25px; font-weight: 550;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .1s ease-out, background .15s;
  font-variant-numeric: tabular-nums;
}
.keys button:active { transform: scale(.94); background: var(--accent-tint); }
.keys button.blank { background: none; box-shadow: none; }

.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ------------------------------------------------------------------- шторка */

.sheet-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 6, 11, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
.sheet-back.is-on { opacity: 1; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-width: 620px; margin: 0 auto;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lift);
  transform: translateY(101%);
  will-change: transform;
}
.sheet .grip {
  width: 38px; height: 5px; border-radius: 3px;
  background: color-mix(in oklab, var(--ink) 16%, transparent);
  margin: 0 auto 16px;
}
.sheet h2 { margin-bottom: 4px; }

.row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
}
.row:last-of-type { border-bottom: 0; }
.row .glyph { font-size: 20px; width: 26px; text-align: center; flex: none; }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.012em; }
.row .body span { font-size: 13px; color: var(--ink-faint); }
.row .chevron { color: var(--ink-faint); flex: none; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tabbar) + 92px);   /* выше плавающей кнопки */
  z-index: 80;
  transform: translate(-50%, 16px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(24, 8, 13, .92);
  color: #fff;
  font-size: 14.5px; font-weight: 550;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, transform .34s cubic-bezier(.2, 1.1, .3, 1);
  max-width: calc(100vw - 36px);
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------- доступность и вкусы */

/* «Меньше движения» — не «никакой обратной связи», а спокойная её версия */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
  }
  .waiting .orb, .login .heart { animation: none; }
  .bubble { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar, .composer, .howl-head { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .card .ago { background: rgba(20, 6, 10, .85); backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(36, 18, 26, .34); --ink-faint: var(--ink-soft); }
  .card::after { border-width: 4px; }
  .panel, .dish-row { border-width: 2px; }
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.hidden { display: none !important; }
