/* FoodBGU mini-app — macOS/iOS inspired dark theme */

:root {
  --bg-top: #0a0a0a;
  --bg-bottom: #141414;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-bg-hover: rgba(255, 255, 255, 0.07);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;

  --accent: #30d158;       /* iOS SF Green */
  --accent-pressed: #28b14a;
  --breakfast: #ff9f0a;    /* orange */
  --lunch: #64d2ff;        /* light blue */
  --dinner: #ff6482;       /* pink */
  --snack: #bf5af2;        /* purple */
  --danger: #ff453a;

  --radius-card: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset,
                 0 10px 30px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-top);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse at top, #1a1a1a 0%, var(--bg-top) 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 72px);
}

#root { max-width: 560px; margin: 0 auto; }

.tab {
  display: none;
  flex-direction: column;
  gap: 14px;
}
.tab--active { display: flex; }

/* ─── Нижний таб-бар ─── */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  padding: 8px 10px calc(var(--safe-bottom) + 8px);
  background: rgba(20, 20, 20, 0.86);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-top: 1px solid var(--card-border);
}

.tabbar__btn {
  background: none;
  border: 0;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: 68px;
  transition: color 0.15s ease;
}

.tabbar__btn:active { opacity: 0.7; }

.tabbar__icon {
  font-size: 22px;
  line-height: 1;
}

.tabbar__btn--active { color: var(--accent); }
.tabbar__btn--active .tabbar__icon { filter: drop-shadow(0 0 6px rgba(48, 209, 88, 0.5)); }

/* ─── Быстрый ввод вопроса на дневнике ─── */
.quick-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
}

.quick-ask input {
  flex: 1;
  background: none;
  border: 0;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  padding: 10px 0;
  outline: none;
}
.quick-ask input::placeholder { color: var(--text-tertiary); }

.quick-ask button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: 0;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  transition: transform 0.1s ease, background 0.15s ease;
}
.quick-ask button:active { transform: scale(0.92); background: var(--accent-pressed); }

/* ─── Чат ─── */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 0;
}

.chat-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.chat-header__actions { display: flex; gap: 8px; }

.chat-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-pill:active { opacity: 0.7; }
.chat-pill--ghost { background: none; padding: 7px 10px; font-size: 15px; }

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40vh;
  padding: 4px 0;
}

.msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: msg-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 6px;
}

.msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 6px;
}

.msg__empty {
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* Карточка рецепта внутри сообщения ассистента */
.recipe {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.recipe__name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

.recipe__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 10px;
}

.recipe__meta span::before { content: "• "; color: var(--text-tertiary); }
.recipe__meta span:first-child::before { content: ""; }

.recipe__block { margin-top: 10px; }
.recipe__block h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.recipe__ingredients, .recipe__steps {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}
.recipe__ingredients li, .recipe__steps li { margin: 2px 0; }

.recipe__tip {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(48, 209, 88, 0.08);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.recipe__actions { margin-top: 10px; }

.recipe__fav {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: #ffd60a;
  padding: 8px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.recipe__fav:disabled { opacity: 0.5; cursor: default; }
.recipe__fav:active { transform: scale(0.97); }

/* ─── Поле ввода чата ─── */
.chat-input {
  position: sticky;
  bottom: calc(var(--safe-bottom) + 60px);
  display: flex;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  background: rgba(28, 28, 30, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  margin-top: 8px;
}

.chat-input textarea {
  flex: 1;
  background: none;
  border: 0;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  padding: 8px 0;
  resize: none;
  outline: none;
  max-height: 120px;
}
.chat-input textarea::placeholder { color: var(--text-tertiary); }

.chat-input button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: 0;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.chat-input button:disabled { opacity: 0.4; }
.chat-input button:active { transform: scale(0.92); }

/* ─── Избранное ─── */
.favorites {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.favorites__empty {
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
  padding: 14px;
}

.fav {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
}

.fav__head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fav__name { font-size: 14px; font-weight: 600; }
.fav__meta { font-size: 12px; color: var(--text-tertiary); }

.fav__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.fav__body > div { overflow: hidden; min-height: 0; }
.fav--open .fav__body { grid-template-rows: 1fr; }

.fav__inner { padding: 0 12px 12px; }

.fav__del {
  background: none;
  border: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0 0;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Профиль ─── */
.profile-block {
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-line;
}
.profile-block strong { font-weight: 600; }

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* ─── Верхняя шапка ─── */
.top-bar { display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 0; }

.top-bar__date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.top-bar__date h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

.today-btn {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.today-btn:active { opacity: 0.6; }

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 2px;
}

.week__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 2px 0 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

.week__circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.week__day:active .week__circle { transform: scale(0.94); }

.week__day--active .week__circle {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(48, 209, 88, 0.08);
}

.week__day--today .week__circle:not(.week__day--active .week__circle) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.week__day--active { color: var(--accent); }

/* ─── Карточки ─── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-card);
}

/* ─── Сводка ─── */
.summary {
  display: flex;
  padding: 16px 18px;
  gap: 12px;
  align-items: center;
}

.summary__content { flex: 1; min-width: 0; }

.summary__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0;
}

.summary__label {
  color: var(--text-secondary);
  font-size: 15px;
}

.summary__value {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.summary__value--muted {
  color: var(--text-tertiary);
  font-weight: 500;
  font-style: italic;
}

.summary__divider {
  height: 1px;
  background: var(--card-border);
  margin: 8px 0;
}

.summary__row--pct .summary__label {
  color: var(--text-tertiary);
  font-size: 14px;
}

.summary__macros {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ─── Панель совета ─── */
.tip {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.18);
  border-radius: var(--radius-sm);
}

.tip--warn   { background: rgba(255, 159, 10, 0.08);  border-color: rgba(255, 159, 10, 0.22); }
.tip--danger { background: rgba(255, 69, 58, 0.08);   border-color: rgba(255, 69, 58, 0.22); }
.tip--ok     { background: rgba(48, 209, 88, 0.06);   border-color: rgba(48, 209, 88, 0.14); }

.tip__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.tip__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.tip__more {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding-left: 8px;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.tip--warn .tip__more   { color: var(--breakfast); }
.tip--danger .tip__more { color: var(--danger); }

.tip__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.tip__body > div { overflow: hidden; min-height: 0; }
.tip--open .tip__body { grid-template-rows: 1fr; }

.tip__detail {
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tip--open .tip__more::after { content: " ▴"; }
.tip:not(.tip--open) .tip__more::after { content: " ▾"; }

.macro {
  flex: 1;
  min-width: 56px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 10px 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.macro__label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.macro__got {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1;
}

.macro__divider {
  width: 24px;
  height: 1px;
  background: var(--card-border);
  margin: 3px 0;
}

.macro__target {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  line-height: 1;
}

/* Пиктограмма-сетка справа */
.summary__grid {
  width: 86px;
  height: 86px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 2px;
  flex-shrink: 0;
}

.summary__grid span {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1.5px;
}

/* ─── Приёмы пищи ─── */
.meals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: background 0.15s ease;
}

.meal-card__head {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}

.meal-card__head:active { background: var(--card-bg-hover); }

.meal-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.meal-card[data-meal-type="breakfast"] .meal-card__icon { color: var(--breakfast); }
.meal-card[data-meal-type="lunch"]     .meal-card__icon { color: var(--lunch); }
.meal-card[data-meal-type="dinner"]    .meal-card__icon { color: var(--dinner); }
.meal-card[data-meal-type="snack"]     .meal-card__icon { color: var(--snack); }

.meal-card__name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.meal-card__kcal {
  font-size: 14px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
}

.meal-card__kcal:empty { display: none; }

.meal-card__add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  background: rgba(48, 209, 88, 0.1);
  transition: transform 0.1s ease;
}

.meal-card__head:active .meal-card__add { transform: scale(0.88); }

.meal-card__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.meal-card__body > .meal-card__inner {
  overflow: hidden;
  min-height: 0;
}

.meal-card--open .meal-card__body { grid-template-rows: 1fr; }

.meal-card__items {
  list-style: none;
  margin: 0;
  padding: 6px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.meal-item__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meal-item__name {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-item__macros {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.meal-item__right { display: flex; align-items: center; gap: 10px; }

.meal-item__kcal {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.meal-item__del {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 69, 58, 0.12);
  border: 0;
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.meal-item__del:active { transform: scale(0.9); }

.meal-card__empty {
  padding: 8px 2px 2px;
  color: var(--text-tertiary);
  font-size: 14px;
  text-align: center;
}

/* ─── Нижняя шторка ─── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.sheet[aria-hidden="false"] { display: flex; }

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.2s ease;
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 10px 18px calc(var(--safe-bottom) + 20px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  animation: slide-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet__grabber {
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin: 2px auto 6px;
}

.sheet__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}

.sheet__field { display: flex; flex-direction: column; gap: 6px; }

.sheet__label {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 2px;
}

.sheet__field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  resize: none;
  outline: none;
  transition: border-color 0.15s ease;
}

.sheet__field textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.sheet__field textarea::placeholder { color: var(--text-tertiary); }

.btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.985); }

.btn--primary {
  background: var(--accent);
  color: #000;
}

.btn--primary:active { background: var(--accent-pressed); }

.btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.sheet__photo-row { display: flex; gap: 10px; }
.sheet__photo-row .btn { flex: 1; }

.sheet__or {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
}

.sheet__or::before,
.sheet__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.sheet__cancel {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  padding: 10px;
  margin-top: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sheet__cancel:active { opacity: 0.5; }

/* ─── Overlay-спиннер ─── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  animation: fade-in 0.15s ease;
}

.overlay[aria-hidden="false"] { display: flex; }

.overlay__spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.overlay__text {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(44, 44, 46, 0.95);
  backdrop-filter: blur(20px);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.toast[aria-hidden="false"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-note {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 8px 0 4px;
}

/* ─── Анимации ─── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
