/* Smart Food Ombor — Telegram Mini App. Theme comes from Telegram (--tg-theme-*), with fallbacks. */
:root {
  --bg: var(--tg-theme-secondary-bg-color, #eef1f7);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #0f172a);
  --hint: var(--tg-theme-hint-color, #64748b);
  --accent: var(--tg-theme-button-color, #2563eb);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --link: var(--tg-theme-link-color, var(--accent));
  --danger: var(--tg-theme-destructive-text-color, #e11d48);
  --sep: color-mix(in srgb, var(--text) 9%, transparent);
  --soft: color-mix(in srgb, var(--accent) 11%, var(--card));
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-strong: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent);
  --r-lg: 22px;
  --r: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tg]) { --bg: #0b0f17; --card: #151b26; --text: #e8edf5; --hint: #8a94a6; }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
.app { min-height: 100vh; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; min-height: 60px;
  padding: 8px 10px 8px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px);
}
.topbar__back { margin-left: -10px; }
.topbar__title { flex: 1; min-width: 0; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { padding: 4px 16px calc(28px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px;
  border: 0; border-radius: var(--r); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.btn--primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7c3aed));
  color: var(--accent-text); box-shadow: var(--shadow-strong); }
.btn--outline { background: var(--card); color: var(--link); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow); }
.btn--soft { background: var(--soft); color: var(--link); }
.btn--text { width: 100%; min-height: 44px; background: none; color: var(--hint); font-weight: 600; }
.btn--light { background: #fff; color: #1e293b; }
.btn--ghost-light { background: rgba(255, 255, 255, 0.18); color: #fff; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn--lg { min-height: 56px; flex: 1; }
.btn--xl { width: 100%; min-height: 62px; font-size: 18px; border-radius: 18px; }
.btn--hero {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 92px; margin: 0 0 16px; padding: 0 22px;
  border-radius: var(--r-lg); text-align: left;
}
.btn--hero__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: rgba(255, 255, 255, 0.2); flex: none; }
.btn--hero__text { display: grid; gap: 2px; }
.btn--hero__text strong { font-size: 20px; }
.btn--hero__text small { font-size: 14px; font-weight: 500; opacity: 0.85; }

.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 14px;
  background: none; color: var(--text); cursor: pointer; }
.icon-btn:active { background: var(--sep); }
.icon-btn:disabled { opacity: 0.3; }
.icon-btn[hidden] { display: none; }
.icon-btn--muted { color: var(--hint); width: 38px; height: 38px; }
.icon-btn--danger { color: var(--danger); }
.icon-btn--round { width: 48px; height: 48px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); }

/* ---------- hero ---------- */
.hero {
  position: relative; display: grid; gap: 2px; margin: 4px 0 16px; padding: 22px; overflow: hidden;
  border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, #7c3aed 85%, var(--accent)) 0%, transparent 55%),
              linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0f172a));
  box-shadow: var(--shadow-strong);
}
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); pointer-events: none; }
.hero--compact { padding: 18px 20px; }
.hero__hello { font-size: 15px; font-weight: 600; opacity: 0.85; }
.hero__label { font-size: 14px; opacity: 0.85; }
.hero__value { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero--compact .hero__value { font-size: 28px; }
.hero__sub { font-size: 14px; opacity: 0.85; }
.hero__link { color: #fff; }
.hero__row { display: flex; align-items: center; gap: 14px; }
.hero__row > div { display: grid; min-width: 0; }
.hero__row .avatar { background: rgba(255, 255, 255, 0.25); }
.hero__mini { display: flex; justify-content: space-between; margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.14); font-size: 14px; position: relative; z-index: 1; }

/* ---------- home tiles ---------- */
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-tile {
  display: grid; align-content: start; gap: 6px; min-height: 132px; padding: 18px; border: 0; border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform 0.12s ease;
}
.home-tile:active { transform: scale(0.97); }
.home-tile--shifts { grid-column: span 2; min-height: 96px; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; }
.home-tile--shifts .home-tile__icon { grid-row: span 2; }
.home-tile__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; margin-bottom: 4px; }
.home-tile--debts .home-tile__icon { background: color-mix(in srgb, #f59e0b 16%, var(--card)); color: #d97706; }
.home-tile--history .home-tile__icon { background: color-mix(in srgb, #10b981 16%, var(--card)); color: #059669; }
.home-tile--shifts .home-tile__icon { background: color-mix(in srgb, #8b5cf6 16%, var(--card)); color: #7c3aed; }
.home-tile__label { font-size: 18px; font-weight: 800; }
.home-tile__sub { color: var(--hint); font-size: 13px; }

/* ---------- avatar ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 30%; font-size: 15px; font-weight: 800;
  color: #fff; background: var(--tone, var(--accent)); letter-spacing: -0.02em; }

/* ---------- search & chips ---------- */
.search { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0 16px; height: 54px;
  background: var(--card); border-radius: var(--r); color: var(--hint); box-shadow: var(--shadow); }
.search__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chips--center { justify-content: center; margin: 0; }
.chips--center:empty { display: none; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 42px; padding: 0 16px; border: 0; border-radius: 21px; background: var(--card);
  box-shadow: var(--shadow); font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.is-active { background: var(--accent); color: var(--accent-text); }
.chip--accent { background: var(--soft); color: var(--link); box-shadow: none; }

/* ---------- tiles (suppliers, products) ---------- */
.section-title { margin: 20px 4px 10px; color: var(--hint); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: grid; justify-items: start; align-content: start; gap: 8px; min-height: 128px; padding: 16px;
  border: 0; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.tile:active { transform: scale(0.96); }
.tile__name { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tile__chip { padding: 4px 10px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile__chip--muted { background: var(--bg); color: var(--hint); }
.tile__meta { color: var(--hint); font-size: 13px; font-variant-numeric: tabular-nums; }
.tiles--products .tile { min-height: 120px; }
.tile.is-picked { box-shadow: inset 0 0 0 2.5px var(--accent), var(--shadow); }
.tile__badge { position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: 10px; background: var(--accent);
  color: var(--accent-text); font-size: 12px; font-weight: 800; }

/* ---------- AI card ---------- */
.ai-card {
  display: grid; gap: 14px; margin: 4px 0 16px; padding: 18px; border-radius: var(--r-lg); color: #fff;
  background: linear-gradient(135deg, #7c3aed, #db2777); box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
}
.ai-card__text { display: grid; gap: 2px; }
.ai-card__text strong { font-size: 18px; }
.ai-card__text span { font-size: 14px; opacity: 0.9; }
.ai-card__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 8px; vertical-align: 2px;
  background: color-mix(in srgb, #7c3aed 16%, transparent); color: #7c3aed; font-size: 11px; font-weight: 800; }
.ai-wait { display: grid; justify-items: center; padding: 8px 0 24px; text-align: center; }

/* ---------- cart bar & sticky action ---------- */
.bar-space { height: 96px; }
.cart-bar { position: fixed; inset: auto 14px calc(14px + env(safe-area-inset-bottom)); z-index: 8; max-width: 612px; margin: 0 auto;
  animation: rise 0.25s ease; }
.cart-bar[hidden] { display: none; }
.cart-bar__btn {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 0 18px 0 12px; border: 0; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7c3aed)); color: var(--accent-text);
  box-shadow: var(--shadow-strong); cursor: pointer; text-align: left;
}
.cart-bar__count { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, 0.22);
  font-size: 18px; font-weight: 800; }
.cart-bar__text { display: grid; flex: 1; }
.cart-bar__text small { opacity: 0.85; font-size: 13px; }
.cart-bar__text strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.cart-bar__go { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.sticky-action { position: fixed; inset: auto 14px calc(14px + env(safe-area-inset-bottom)); z-index: 8; max-width: 612px; margin: 0 auto; }
.sticky-action .spinner--small { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }

/* ---------- cart ---------- */
.cart-lines, .cards { display: grid; gap: 10px; margin: 0 0 14px; }
.cart-line { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 0; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.cart-line.has-error { box-shadow: inset 0 0 0 2px var(--danger), var(--shadow); }
.cart-line__main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 10px 6px 10px 12px; border: 0;
  background: none; text-align: left; cursor: pointer; }
.cart-line__text { display: grid; flex: 1; min-width: 0; gap: 2px; }
.cart-line__name { font-weight: 700; overflow-wrap: anywhere; }
.cart-line__calc { color: var(--hint); font-size: 14px; font-variant-numeric: tabular-nums; }
.cart-line__error { color: var(--danger); font-size: 13px; font-weight: 600; }
.cart-line__sum { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.action-row { display: flex; gap: 10px; margin: 0 0 14px; }
.action-row .btn { padding: 0 12px; white-space: nowrap; font-size: 15px; }
.pending .section-title { margin-top: 0; }
.pending__row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--sep); }
.notice { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--r); background: var(--soft); color: var(--link); font-weight: 600; }

/* ---------- cards, rows ---------- */
.card { margin: 0 0 14px; padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.row-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; padding: 12px 12px 12px 14px; border: 0;
  border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform 0.12s ease; }
.row-card:active:not(.row-card--static) { transform: scale(0.98); }
.row-card--static { cursor: default; }
.row-card > svg { color: var(--hint); flex: none; }
.row-card__main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.row-card__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card__sub { color: var(--hint); font-size: 13px; }
.row-card__amount { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-card__amount.is-plus { color: var(--danger); }
.row-card__amount.is-minus { color: var(--ok); }
.row-card.is-reversed .row-card__title, .row-card.is-reversed .row-card__amount { text-decoration: line-through; color: var(--hint); }
.dot { width: 12px; height: 12px; flex: none; margin: 0 6px; border-radius: 50%; }
.dot--plus { background: var(--danger); }
.dot--minus { background: var(--ok); }
.empty, .empty-card { margin: 0 0 14px; padding: 32px 16px; color: var(--hint); text-align: center; }
.empty-card { border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.muted { color: var(--hint); font-size: 14px; }
.note { white-space: pre-wrap; }

/* ---------- fields ---------- */
.field { display: grid; gap: 8px; margin: 0 0 14px; }
.field__label { color: var(--hint); font-size: 14px; font-weight: 600; }
.field__input { width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--sep); border-radius: 14px;
  background: var(--bg); color: var(--text); font-size: 17px; outline: 0; }
.field__input:focus { border-color: var(--accent); }
.details summary { display: flex; align-items: center; gap: 6px; min-height: 32px; font-weight: 700; cursor: pointer; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details[open] summary { margin: 0 0 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch-row input { width: 24px; height: 24px; accent-color: var(--accent); }
.seg { display: inline-flex; padding: 4px; background: var(--bg); border-radius: 14px; }
.seg--wide { display: flex; }
.seg__btn { flex: 1; min-height: 44px; padding: 0 12px; border: 0; border-radius: 11px; background: none; color: var(--hint);
  font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.seg__btn.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.inline-form { display: flex; gap: 10px; margin: 0 0 14px; }
.inline-form .field__input { flex: 1; }
.list { overflow: hidden; margin: 0 0 14px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 14px; border: 0;
  border-bottom: 1px solid var(--sep); background: none; text-align: left; }
.row:last-child { border-bottom: 0; }
.row__main { display: grid; flex: 1; min-width: 0; }
.row__title { font-weight: 600; }
.row__sub { color: var(--hint); font-size: 13px; }

/* ---------- sheets, entry + keypad ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(2, 6, 23, 0.45); opacity: 0; transition: opacity 0.2s; }
.sheet-backdrop.is-open { opacity: 1; }
.sheet { position: fixed; inset: auto 0 0; z-index: 21; display: flex; flex-direction: column; max-height: 94vh; max-width: 640px; margin: 0 auto;
  background: var(--bg); border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -10px 40px rgba(2, 6, 23, 0.2); }
.sheet.is-open { transform: none; }
.sheet__head, .entry__head { display: flex; align-items: center; gap: 12px; padding: 16px 10px 8px 18px; }
.sheet__head h2 { flex: 1; margin: 0; font-size: 19px; }
.sheet__body { overflow-y: auto; padding: 8px 16px 18px; }
.entry__title { display: grid; flex: 1; min-width: 0; }
.entry__title h2 { margin: 0; font-size: 19px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry__body { display: grid; gap: 8px; overflow-y: auto; padding: 6px 16px 16px; }
.slots { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.slot { display: grid; gap: 2px; justify-items: start; align-content: start; min-height: 80px; padding: 12px 14px; border: 0; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: box-shadow 0.15s; }
.slot.is-active { box-shadow: inset 0 0 0 3px var(--accent), var(--shadow); }
.slot__label { color: var(--hint); font-size: 13px; font-weight: 700; }
.slot__value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.15; }
.slot__value small { margin-left: 6px; color: var(--hint); font-size: 15px; font-weight: 700; }
.slot__sub { color: var(--accent); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill-toggle { display: flex; padding: 4px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.pill-toggle__btn { flex: 1; min-height: 42px; border: 0; border-radius: 12px; background: none; color: var(--hint); font-size: 15px;
  font-weight: 700; cursor: pointer; white-space: nowrap; }
.pill-toggle__btn.is-active { background: var(--accent); color: var(--accent-text); }
.pill-toggle--big .pill-toggle__btn { min-height: 50px; font-size: 17px; }
.calc-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px 16px;
  border-radius: 16px; background: var(--card); color: var(--hint); font-size: 15px; font-variant-numeric: tabular-nums; }
.calc-result.is-ok { background: color-mix(in srgb, var(--ok) 12%, var(--card)); color: var(--text); }
.calc-result strong { font-size: 20px; color: var(--ok); white-space: nowrap; }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad__key { min-height: 56px; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font-size: 26px; font-weight: 700; cursor: pointer; display: grid; place-items: center; transition: transform 0.08s ease; }
.pad__key:active { transform: scale(0.93); background: var(--soft); }
.pad__key--op { background: var(--soft); color: var(--link); }
.pad__key--soft { color: var(--hint); font-size: 22px; }
.amount-display { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.amount-display__value { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.amount-display__value small { margin-left: 8px; color: var(--hint); font-size: 16px; }

/* ---------- shifts ---------- */
.date-switch { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.date-switch__label { position: relative; font-size: 18px; font-weight: 800; }
.date-switch__input { position: absolute; inset: 0; opacity: 0; }
.shift-card { padding: 14px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.shift-card__head { display: flex; align-items: center; gap: 12px; }
.shift-card__nums { display: flex; align-items: baseline; justify-content: space-between; margin: 12px 2px 0; }
.shift-card__nums strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.shift-card__days { margin: 10px 2px 0; }
.shift-card__days summary { color: var(--link); font-weight: 600; cursor: pointer; }
.shift-card__days ul { margin: 8px 0 0; padding: 0; list-style: none; }
.shift-card__days li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--sep); font-variant-numeric: tabular-nums; }
.shift-card__days li.is-current { font-weight: 800; }
.badge { padding: 5px 11px; border-radius: 10px; background: var(--bg); color: var(--hint); font-size: 12px; font-weight: 800; }
.badge.is-open { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* ---------- done ---------- */
.done { display: grid; justify-items: center; gap: 6px; padding: 30px 0 10px; text-align: center; }
.done h2 { margin: 14px 0 0; font-size: 24px; font-weight: 800; }
.done__mark { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 12px 30px rgba(22, 163, 74, 0.4); animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.done__total { margin: 4px 0; font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
.done__debt { margin: 0 0 18px; padding: 8px 14px; border-radius: 12px; background: var(--card); font-variant-numeric: tabular-nums; }
.done .btn { width: 100%; margin-top: 8px; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- feedback ---------- */
.spinner { display: block; width: 32px; height: 32px; margin: 48px auto; border: 3px solid var(--sep); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner--small { display: inline-block; width: 20px; height: 20px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-block { padding: 36px 16px; text-align: center; }
.error-block p { margin: 0 0 14px; }
.toast { position: fixed; inset: auto 16px calc(100px + env(safe-area-inset-bottom)); z-index: 30; max-width: 600px; margin: 0 auto;
  padding: 14px 16px; border-radius: 16px; background: #1e293b; color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.3); opacity: 0; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: var(--danger); }
.toast.is-warning { background: var(--warn); }
.toast.is-success { background: var(--ok); }

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

/* AI shortcuts on the home screen (manual entry stays the main button) */
.ai-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -4px 0 16px; }
.btn--ai { min-height: 54px; background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; font-size: 15px;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.3); }
.btn--ai-soft { background: color-mix(in srgb, #7c3aed 12%, var(--card)); color: #7c3aed; box-shadow: var(--shadow); }
.add-more { margin: 0 0 14px; }

.tile__stock { color: var(--ok); font-size: 12px; font-weight: 700; }
.done__lines { display: grid; gap: 8px; width: 100%; margin: 4px 0 6px; text-align: left; }
.done__line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.done__stock { color: var(--ok); font-size: 13px; font-weight: 700; }

/* blocks */
.pill-toggle--units { flex: none; padding: 3px; border-radius: 13px; }
.pill-toggle--units .pill-toggle__btn { min-height: 40px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.pack-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 16px;
  border: 0; border-radius: 16px; background: color-mix(in srgb, #f59e0b 14%, var(--card)); color: #b45309; font-size: 16px;
  font-weight: 700; cursor: pointer; text-align: left; }
.pack-bar[hidden] { display: none; }
.pack-bar.is-active { box-shadow: inset 0 0 0 3px #f59e0b; }
.pack-bar small { font-size: 13px; text-decoration: underline; }
.pack-bar strong { font-size: 20px; }
.calc-result__pieces { display: block; color: var(--ok); font-size: 13px; font-weight: 700; }
.tile__pack { position: absolute; bottom: 12px; right: 12px; padding: 3px 8px; border-radius: 8px;
  background: color-mix(in srgb, #f59e0b 16%, var(--card)); color: #b45309; font-size: 11px; font-weight: 800; }

@media (max-height: 900px) {
  .pad__key { min-height: 50px; font-size: 24px; }
  .slot { min-height: 74px; padding: 10px 12px; }
  .slot__value { font-size: 26px; }
  .pill-toggle__btn { min-height: 38px; }
  .calc-result { min-height: 46px; padding: 8px 14px; }
  .entry__head { padding-top: 12px; }
}
