/* Морозилка — «Мягкое стекло»
   Плавающие панели матового стекла на сиренево-голубом поле.
   Цвет несёт только то, что требует внимания: срок годности. */

:root {
  --ink:        #131829;
  --ink-2:      #454e6b;
  --ink-3:      #5a6484;
  --ink-on-dark:#f4f6ff;

  --line:       rgba(93, 110, 168, 0.20);
  --line-soft:  rgba(93, 110, 168, 0.12);
  --glass:      rgba(255, 255, 255, 0.52);
  --glass-2:    rgba(255, 255, 255, 0.70);
  --glass-3:    rgba(255, 255, 255, 0.88);
  --highlight:  rgba(255, 255, 255, 0.85);

  --accent:     #4d5ff0;
  --accent-a:   #6f6cf7;
  --accent-b:   #3fa4ef;
  --accent-soft:rgba(77, 95, 240, 0.12);

  --warn:       #8a5104;
  --warn-bg:    rgba(220, 148, 40, 0.18);
  --alert:      #b23a22;
  --alert-bg:   rgba(200, 69, 47, 0.14);
  --calm:       #2c6a52;
  --calm-bg:    rgba(52, 140, 106, 0.13);

  --pill:       #14161f;
  --pill-hover: #262a38;

  --r-panel: 28px;
  --r-card:  18px;
  --r-tile:  14px;

  --shadow-panel: 0 26px 50px -30px rgba(33, 47, 100, 0.55), 0 5px 14px -10px rgba(33, 47, 100, 0.35);
  --shadow-tile:  0 10px 22px -16px rgba(33, 47, 100, 0.55), 0 2px 5px -4px rgba(33, 47, 100, 0.30);
  --shadow-pill:  0 16px 30px -14px rgba(16, 20, 40, 0.55), 0 3px 8px -5px rgba(16, 20, 40, 0.40);

  --ease: cubic-bezier(0.16, 0.9, 0.24, 1);

  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ui-display: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* Правила display ниже перебивают hidden из стилей браузера — возвращаем его силу. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #e6eafa;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--ui-display); font-weight: 620; margin: 0; letter-spacing: -0.015em; }

button, input, select { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.sprite { position: absolute; }
.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico--xl { width: 40px; height: 40px; stroke-width: 1.25; }

/* ------------------------------------------------------------------ поле */

.field { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.field::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(162deg, #f0f2fd 0%, #e2e8f9 42%, #ccd7f0 78%, #c3d1ee 100%);
}
.field__glow { position: absolute; border-radius: 50%; filter: blur(70px); }
.field__glow--violet {
  width: 62vmax; height: 62vmax; top: -26vmax; left: -18vmax;
  background: radial-gradient(circle, rgba(146, 132, 246, 0.42), rgba(146, 132, 246, 0) 68%);
}
.field__glow--cyan {
  width: 70vmax; height: 70vmax; right: -28vmax; bottom: -34vmax;
  background: radial-gradient(circle, rgba(86, 174, 240, 0.40), rgba(86, 174, 240, 0) 68%);
}
.field__grain {
  position: absolute; inset: 0; opacity: 0.5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- шапка */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 12px;
  max-width: 1180px; margin: 0 auto; min-width: 0;
}
.topbar__mark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__mark h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__flake {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 10px; color: #fff;
  background: linear-gradient(150deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 8px 18px -10px rgba(77, 95, 240, 0.9);
}
.topbar__flake svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.topbar h1 { font-size: 19px; }
.topbar__side { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar__date { margin: 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ------------------------------------------------------------- плашка */

.alertbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  max-width: 1180px; margin: 0 auto 12px; padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(200, 69, 47, 0.16), rgba(220, 148, 40, 0.14));
  border: 1px solid rgba(200, 69, 47, 0.22);
  box-shadow: var(--shadow-tile);
}
.page + .alertbar, .topbar + .alertbar { margin-inline: 14px; }
.alertbar .ico { color: var(--alert); }
.alertbar__text { margin: 0; flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); }
.alertbar__go {
  border: 0; border-radius: 999px; cursor: pointer; padding: 0 15px; min-height: 36px;
  background: var(--pill); color: #fff; font-size: 13px; font-weight: 550; white-space: nowrap;
}
.alertbar__close {
  border: 0; background: none; cursor: pointer; color: var(--ink-2);
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; flex: none;
}
.alertbar__close:hover { background: rgba(255, 255, 255, 0.6); }

/* ----------------------------------------------------- фото с зонами */

.rackphoto {
  position: relative; border-radius: var(--r-card); overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  touch-action: manipulation;
}
.rackphoto img { display: block; width: 100%; height: auto; }
.zones { position: absolute; inset: 0; }

.zone {
  position: absolute; cursor: pointer; padding: 0;
  /* Выравнивание по центру: тонкая полка высотой в два десятка пикселей
     иначе выталкивает счётчик и подпись за свои границы. */
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  border-radius: 10px;
  border: 2px solid rgba(77, 95, 240, 0.55);
  background: rgba(77, 95, 240, 0.10);
  backdrop-filter: blur(1px);
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
}
.zone:hover { background: rgba(77, 95, 240, 0.22); border-color: var(--accent); }
.zone[aria-pressed="true"] {
  background: linear-gradient(150deg, rgba(111, 108, 247, 0.42), rgba(63, 164, 239, 0.34));
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(77, 95, 240, 0.75);
}
.zone--empty { border-color: rgba(90, 100, 132, 0.42); background: rgba(255, 255, 255, 0.14); }
.zone__badge {
  margin: 0 5px; padding: 0 7px; min-width: 24px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.94); color: var(--ink);
  box-shadow: 0 2px 6px -3px rgba(20, 30, 70, 0.7);
}
.zone--alert .zone__badge { background: #fff; color: var(--alert); }
.zone--warn .zone__badge { background: #fff; color: var(--warn); }
.zone__name {
  position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 550; white-space: nowrap;
  background: rgba(255, 255, 255, 0.92); color: var(--ink-2);
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.zone:hover .zone__name, .zone:focus-visible .zone__name, .zone[aria-pressed="true"] .zone__name { opacity: 1; }

/* режим подгонки */
.rackphoto.is-tuning .zone { cursor: grab; border-style: dashed; border-color: var(--accent); background: rgba(77, 95, 240, 0.18); }
.rackphoto.is-tuning .zone:active { cursor: grabbing; }
.rackphoto.is-tuning .zone__name { opacity: 1; }
.zone__grip {
  position: absolute; right: -7px; bottom: -7px; width: 20px; height: 20px;
  border-radius: 6px; background: #fff; border: 2px solid var(--accent);
  cursor: nwse-resize; display: none;
}
.rackphoto.is-tuning .zone__grip { display: block; }

.tuner {
  margin-top: 12px; padding: 13px 14px; border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.7);
}
.tuner__hint { margin: 0 0 12px; font-size: 12.5px; color: var(--ink-2); }
.tuner__row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tuner .pill--head { display: inline-flex; }
.tuner .ghost { padding: 9px 16px; font-size: 13.5px; }

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

.page {
  max-width: 1180px; margin: 0 auto; padding: 0 14px;
  display: grid; gap: 14px; align-items: start;
  /* minmax(0, 1fr), а не 1fr: элементы грида по умолчанию не сжимаются уже
     своего содержимого, и одна неразрывная строка кнопок распирает колонку,
     утаскивая всю страницу за край экрана. */
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  position: relative;
  min-width: 0;
  border-radius: var(--r-panel);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  padding: 18px;
}
.panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, var(--highlight), rgba(255, 255, 255, 0) 34%);
  opacity: 0.75;
}
.panel > * { position: relative; }

/* Переносим строку: на узком экране заголовок, ссылка и кнопки иначе
   распирают панель и утаскивают страницу за край. */
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-width: 0; }
.panel__head > * { min-width: 0; }
.panel__head--tabs { margin-bottom: 12px; }
.panel__title { font-size: 15px; letter-spacing: 0.01em; color: var(--ink-2); font-weight: 600; }
.panel__note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }

.linkish {
  border: 0; background: none; padding: 4px 2px; cursor: pointer;
  font-size: 13px; color: var(--accent); border-radius: 8px;
}
.linkish:hover { color: var(--accent-a); }

/* ----------------------------------------------------------------- орбы */

.panel--summary { padding-bottom: 16px; }
.panel--summary .panel__title { text-align: center; margin-bottom: 16px; }

.orbs { display: flex; align-items: center; justify-content: center; }

.orb {
  position: relative;
  display: grid; place-content: center; gap: 2px;
  border-radius: 50%; cursor: pointer;
  text-align: center; padding: 0;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.orb--side {
  width: 96px; height: 96px;
  background: var(--glass-3);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-tile);
  color: var(--ink);
}
.orb--lead {
  width: 122px; height: 122px; margin: 0 -13px; z-index: 2;
  border: 0; color: #fff;
  /* Нижняя точка градиента затемнена намеренно: на ней лежит подпись 11 px,
     и на исходном светлом циане она не добирала до контраста 4.5:1. */
  background: linear-gradient(148deg, var(--accent-a) 4%, var(--accent) 46%, #2f74be 100%);
  box-shadow: 0 20px 34px -18px rgba(77, 95, 240, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.orb__value { font-family: var(--ui-display); font-size: 27px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.orb--lead .orb__value { font-size: 34px; }
.orb__label { font-size: 11px; line-height: 1.25; color: var(--ink-3); }
.orb--lead .orb__label { color: #fff; font-weight: 500; }
.orb:hover { transform: translateY(-2px); }
.orb[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--accent), var(--shadow-tile); }
.orb--lead[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 20px 34px -18px rgba(77, 95, 240, 0.95); }
.orb--alerting { color: var(--alert); }
.orb--alerting .orb__value { color: var(--alert); }

/* ----------------------------------------------------------------- рэк */

.rack { display: grid; gap: 8px; }
.rack__shelves { display: grid; gap: 6px; }
.rack__drawers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }

.slot {
  position: relative; display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; cursor: pointer; min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--r-tile);
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--glass-2);
  box-shadow: var(--shadow-tile);
  color: var(--ink);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.slot--drawer { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 13px 14px; }
.slot--drawer::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 7px; height: 2px;
  border-radius: 2px; background: var(--line); opacity: 0.7;
}
.slot .ico { color: var(--ink-3); }
.slot__label { font-size: 13.5px; font-weight: 550; }
.slot__count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--ink-2); }
.slot--drawer .slot__count { margin-left: 0; }
.slot__dots { display: flex; gap: 3px; margin-left: 8px; }
.slot--drawer .slot__dots { margin-left: 0; margin-top: 2px; }
.slot__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn-bg); }
.slot__dot--expired { background: var(--alert); }
.slot__dot--soon { background: #d1912a; }
.slot:hover { transform: translateY(-1px); background: var(--glass-3); }
.slot[aria-pressed="true"] {
  background: linear-gradient(140deg, rgba(111, 108, 247, 0.16), rgba(63, 164, 239, 0.14));
  border-color: rgba(77, 95, 240, 0.45);
  box-shadow: 0 0 0 1.5px rgba(77, 95, 240, 0.35), var(--shadow-tile);
}
.slot[aria-pressed="true"] .ico { color: var(--accent); }
/* Пустое место гасим подложкой, а не прозрачностью: opacity утягивала
   текст ниже контрастного порога, а на первом запуске так выглядят все шесть. */
.slot--empty { background: rgba(255, 255, 255, 0.40); box-shadow: none; }
.slot--empty .slot__count, .slot--empty .ico { color: var(--ink-3); }

@keyframes land {
  0%   { box-shadow: 0 0 0 0 rgba(77, 95, 240, 0.55), var(--shadow-tile); }
  55%  { box-shadow: 0 0 0 12px rgba(77, 95, 240, 0), var(--shadow-tile); }
  100% { box-shadow: 0 0 0 0 rgba(77, 95, 240, 0), var(--shadow-tile); }
}
.slot.is-landing { animation: land 1000ms var(--ease); }

/* --------------------------------------------------- «съесть в первую» */

.soon { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.soon li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px;
  padding: 9px 12px; border-radius: var(--r-tile);
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.soon__name { font-weight: 550; overflow-wrap: break-word; }
.soon__where { font-size: 12.5px; color: var(--ink-3); grid-column: 1; }
.soon__when { grid-column: 2; grid-row: 1 / span 2; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --------------------------------------------------------------- вкладки */

.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.6); }
.tab {
  display: inline-flex; align-items: center; min-height: 44px;
  border: 0; background: none; cursor: pointer; border-radius: 999px;
  padding: 0 14px; font-size: 13.5px; color: var(--ink-2); font-weight: 550;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.tab.is-active { background: var(--pill); color: #fff; }

.iconbtn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 44px;
  border-radius: 999px; padding: 0 14px; cursor: pointer;
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.iconbtn:hover { background: rgba(255, 255, 255, 0.85); }
.iconbtn[aria-expanded="true"] { background: var(--pill); color: #fff; border-color: transparent; }
.iconbtn--round { padding: 0; width: 44px; justify-content: center; }
.headtools { display: flex; align-items: center; gap: 8px; }
/* На широком экране основное действие переезжает в шапку списка:
   плавающая кнопка там накрывала бы кнопки строк. */
.pill--head { display: none; align-items: center; gap: 7px; padding: 9px 17px; font-size: 14px; }
.iconbtn__badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums;
  background: var(--accent); color: #fff;
}

/* --------------------------------------------------------------- поиск */

.searchrow { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 12px; }
.search {
  display: flex; align-items: center; gap: 9px;
  padding: 0 14px; height: 44px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.75);
}
.search .ico { color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search:focus-within, .select:focus-within { border-color: rgba(77, 95, 240, 0.55); box-shadow: 0 0 0 3px var(--accent-soft); }

.select { position: relative; display: flex; align-items: center; height: 44px; border-radius: 999px; background: rgba(255, 255, 255, 0.62); border: 1px solid rgba(255, 255, 255, 0.75); }
.select select {
  appearance: none; -webkit-appearance: none;
  border: 0; background: none; outline: none; cursor: pointer;
  width: 100%; height: 100%; padding: 0 38px 0 16px; border-radius: inherit;
  font-size: 14px;
}
.select__caret { position: absolute; right: 13px; transform: rotate(90deg); color: var(--ink-3); pointer-events: none; width: 16px; height: 16px; }

/* ------------------------------------------------------------- фильтры */

.filters {
  display: grid; gap: 14px; margin-bottom: 14px; padding: 15px;
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.62);
}
.filters__group { display: grid; gap: 8px; }
.filters__legend { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.filters__foot { display: flex; justify-content: flex-end; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px;
  border-radius: 999px; padding: 0 15px; cursor: pointer; font-size: 13px;
  color: var(--ink-2); background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: background 0.22s var(--ease), color 0.22s var(--ease);
}
.chip:hover { background: #fff; }
.chip[aria-pressed="true"] { background: var(--pill); color: #fff; border-color: transparent; }
.chip__n { font-variant-numeric: tabular-nums; color: var(--ink-3); margin-left: 6px; }
.chip[aria-pressed="true"] .chip__n { color: rgba(255, 255, 255, 0.75); }

.rangerow { display: flex; gap: 8px; flex-wrap: wrap; }
.field-inline {
  display: flex; align-items: center; gap: 8px; flex: 1 1 140px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.66); border: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 13px; color: var(--ink-3);
}
.field-inline input { border: 0; background: none; outline: none; width: 100%; color: var(--ink); font-size: 13.5px; }

.listmeta { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-3); }

/* --------------------------------------------------------------- список */

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }

.item {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main side" "badge side";
  gap: 8px 10px;
  padding: 12px 13px; border-radius: var(--r-card);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px -16px rgba(33, 47, 100, 0.6);
}
.item--gone { background: rgba(255, 255, 255, 0.34); }
.item--gone .item__name { color: var(--ink-2); }
.item__main { grid-area: main; min-width: 0; }
.item > .badge { grid-area: badge; justify-self: start; }
.item__name { font-size: 15px; font-weight: 570; letter-spacing: -0.005em; overflow-wrap: break-word; }
.item__meta { margin-top: 3px; font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 2px 8px; }
.item__meta b { font-weight: 550; color: var(--ink-2); }
.item__side { grid-area: side; display: flex; align-items: center; gap: 6px; justify-self: end; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 550;
  background: rgba(255, 255, 255, 0.7); color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.badge--expired { background: var(--alert-bg); color: var(--alert); }
.badge--soon { background: var(--warn-bg); color: var(--warn); }
.badge--ok { background: var(--calm-bg); color: var(--calm); }
.badge--none { background: rgba(255, 255, 255, 0.55); color: var(--ink-3); }

.rowbtn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 14px; cursor: pointer; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.85);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.rowbtn:hover { background: #fff; color: var(--ink); }
.rowbtn--danger:hover { color: var(--alert); }
.rowbtn--take:hover { color: var(--accent); }

@keyframes settle {
  from { opacity: 0; transform: translateY(10px); filter: blur(7px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.item.is-new { animation: settle 620ms var(--ease); }

.empty { text-align: center; padding: 30px 14px 22px; color: var(--ink-3); }
.empty .ico { color: rgba(100, 112, 143, 0.6); margin-bottom: 8px; }
.empty__title { margin: 0 0 4px; font-family: var(--ui-display); font-size: 16px; color: var(--ink-2); font-weight: 600; }
.empty__text { margin: 0; font-size: 13.5px; max-width: 34ch; margin-inline: auto; }
.empty__retry { margin-top: 16px; }

/* ------------------------------------------------------------------ fab */

.fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px 14px 18px; border-radius: 999px; cursor: pointer; border: 0;
  background: var(--pill); color: #fff; font-size: 15px; font-weight: 560;
  box-shadow: var(--shadow-pill);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.fab:hover { background: var(--pill-hover); transform: translateY(-2px); }
.fab:active { transform: translateY(0); }

.pill {
  border: 0; border-radius: 999px; cursor: pointer; padding: 13px 24px;
  background: var(--pill); color: #fff; font-size: 15px; font-weight: 560;
  box-shadow: var(--shadow-pill);
}
.pill:hover { background: var(--pill-hover); }
.pill[disabled], .fab[disabled] { opacity: 0.5; box-shadow: none; cursor: not-allowed; }

.ghost {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.6); cursor: pointer;
  border-radius: 999px; padding: 12px 20px; font-size: 14px; color: var(--ink-2);
}
.ghost:hover { background: #fff; }

/* ---------------------------------------------------------------- лист */

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(28, 36, 72, 0.34); backdrop-filter: blur(3px); animation: fade 260ms var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet__panel {
  position: relative; width: min(560px, 100%);
  max-height: min(92dvh, 780px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86));
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 -22px 60px -30px rgba(24, 34, 80, 0.65);
  animation: rise 380ms var(--ease);
}
@keyframes rise { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__grip { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 12px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.sheet__head h2 { font-size: 19px; }
.sheet__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* --------------------------------------------------------------- форма */

.form { display: grid; gap: 14px; }
.f { display: grid; gap: 7px; position: relative; border: 0; padding: 0; margin: 0; min-width: 0; }
.f__label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; padding: 0; }
.f__label em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.f__control { display: flex; align-items: center; position: relative; }
.f input, .f select {
  width: 100%; height: 48px; padding: 0 15px; border-radius: 15px; outline: none;
  background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line);
  font-size: 15px;
}
.f input::placeholder { color: var(--ink-3); }
.f input:focus, .f select:focus { border-color: rgba(77, 95, 240, 0.6); box-shadow: 0 0 0 3px var(--accent-soft); }
.f__control--select select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }

/* Количество набирают у открытой морозилки одной рукой: кнопки быстрее клавиатуры. */
.f__control--qty { gap: 8px; }
.f__control--qty input {
  text-align: center; padding: 0 4px;
  appearance: textfield; -moz-appearance: textfield;
}
.f__control--qty input::-webkit-outer-spin-button,
.f__control--qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qtystep {
  flex: none; width: 48px; height: 48px; border-radius: 15px; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line);
}
.qtystep:hover { background: #fff; color: var(--ink); }
.qtystep:disabled { opacity: 0.4; cursor: default; }
.f__control--select .select__caret { position: absolute; right: 14px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.f--places legend { padding: 0; }
.placepick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 7px; }
.placepick button {
  display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left;
  padding: 11px 12px; border-radius: 13px; font-size: 13.5px; font-weight: 500;
  background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line); color: var(--ink-2);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.placepick button .ico { width: 18px; height: 18px; color: var(--ink-3); }
.placepick button:hover { background: #fff; }
.placepick button[aria-pressed="true"] {
  background: linear-gradient(140deg, rgba(111, 108, 247, 0.18), rgba(63, 164, 239, 0.15));
  border-color: rgba(77, 95, 240, 0.5); color: var(--ink);
}
.placepick button[aria-pressed="true"] .ico { color: var(--accent); }

/* Подсказки стоят в потоке, а не оверлеем: всплывающий список накрывал
   обязательный блок «Место» и перехватывал тап по полке. */
.suggest {
  list-style: none; margin: 0; padding: 5px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px -20px rgba(33, 47, 100, 0.6);
}
.suggest li { border-radius: 11px; }
.suggest button {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; min-height: 44px;
  padding: 10px 12px; border: 0; background: none; cursor: pointer; border-radius: 11px;
}
.suggest button:hover, .suggest li.is-active button { background: var(--accent-soft); }
.suggest__name { font-weight: 550; }
.suggest__hint { font-size: 12px; color: var(--ink-3); margin-left: auto; white-space: nowrap; }

.formerror {
  margin: 0; padding: 11px 14px; border-radius: 13px; font-size: 13.5px;
  background: var(--alert-bg); color: var(--alert);
}

/* ---------------------------------------------------------------- тост */

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px; border-radius: 999px;
  background: rgba(20, 22, 31, 0.95); color: var(--ink-on-dark);
  box-shadow: var(--shadow-pill); font-size: 14px;
  animation: rise 300ms var(--ease); max-width: calc(100vw - 32px);
}
.toast__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast__action {
  border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer;
  border-radius: 999px; padding: 7px 15px; font-size: 13.5px; font-weight: 550; flex: none;
}
.toast__action:hover { background: rgba(255, 255, 255, 0.28); }

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

.gate { padding-bottom: 0; display: grid; place-items: center; min-height: 100dvh; }
.gate__wrap { width: 100%; padding: 24px 16px; display: grid; place-items: center; }
.gate__panel { width: min(420px, 100%); padding: 26px; }
.gate__mark { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.gate__mark h1 { font-size: 22px; }
.gate__text { margin: 0 0 20px; font-size: 13.5px; color: var(--ink-2); }
.gate__submit { width: 100%; margin-top: 4px; }

/* --------------------------------------------------------------- фокус */

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

/* ------------------------------------------------------------ широкий */

@media (min-width: 700px) {
  body { font-size: 15.5px; }
  .page { padding: 0 22px; gap: 16px; }
  .topbar { padding: calc(24px + env(safe-area-inset-top)) 26px 14px; }
  .topbar h1 { font-size: 22px; }
  .panel { padding: 22px; }
  .searchrow { grid-template-columns: 1fr 260px; }
  .placepick { grid-template-columns: repeat(3, 1fr); }
  .orb--side { width: 108px; height: 108px; }
  .orb--lead { width: 138px; height: 138px; margin: 0 -15px; }
  .orb__value { font-size: 30px; }
  .orb--lead .orb__value { font-size: 40px; }
  .sheet { align-items: center; }
  .sheet__panel { border-radius: 30px; max-height: min(88dvh, 820px); padding-bottom: 22px; }
  .item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "main badge side";
    gap: 0 12px;
  }
  .item > .badge { justify-self: end; }
}

@media (min-width: 1000px) {
  /* Явные строки обязательны: без них span до -1 схлопывается и левая колонка уезжает вниз. */
  /* Последняя строка забирает весь остаток высоты, иначе длинный список
     растянул бы строки и развёл панели левой колонки пустотами. */
  .page { grid-template-columns: 370px minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .panel--summary { grid-area: 1 / 1 / 2 / 2; }
  .panel--places  { grid-area: 2 / 1 / 3 / 2; }
  .panel--soon    { grid-area: 3 / 1 / 4 / 2; }
  .panel--list    { grid-area: 1 / 2 / 4 / 3; align-self: start; }
  .item { padding: 14px 16px; }
  body { padding-bottom: 40px; }
  .fab { display: none; }
  .pill--head { display: inline-flex; }
}

/* На телефоне вкладки и «Фильтры» не помещаются в строку, а перенос съедает
   экран. Прячем слово, оставляя иконку и счётчик активных фильтров. */
@media (max-width: 460px) {
  .iconbtn__text { display: none; }
  #filters-toggle { padding: 0 12px; gap: 4px; }
}

/* Узкие телефоны: круги сводки чуть меньше, иначе три штуки не встают в ряд. */
@media (max-width: 359px) {
  .orb--side { width: 84px; height: 84px; }
  .orb--lead { width: 108px; height: 108px; margin: 0 -11px; }
  .orb__value { font-size: 24px; }
  .orb--lead .orb__value { font-size: 30px; }
  .orb__label { font-size: 10px; }
  .page, .topbar { padding-left: 10px; padding-right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
