/* ============================================================================
   Бизнес Пульс · Кабинет контрагента Братска — v0.1
   ----------------------------------------------------------------------------
   Токены --bp-* перенесены verbatim из Foundation v0.1 / Director Experience
   v0.2 через UI-kit v0.12 родительской ветки. Своей палитры здесь нет.

   Mobile-first: базовый макет рассчитан на 360 px, desktop — вспомогательный.
   Тема следует системной (prefers-color-scheme) и переключается вручную
   атрибутом data-theme, как в родительском модуле.
   ========================================================================== */

:root{
  color-scheme:light;

  --bp-color-background:#F7F8FA;
  --bp-color-surface:#FFFFFF;
  --bp-color-surface-subtle:#F8FAFC;
  --bp-color-surface-interactive:#F1F5F9;
  --bp-color-text-primary:#0F172A;
  --bp-color-text-secondary:#475569;
  --bp-color-text-muted:#64748B;
  --bp-color-border-subtle:#E6E8EC;
  --bp-color-border-strong:#CBD5E1;
  --bp-color-primary:#2563EB;
  --bp-color-primary-hover:#1D4ED8;
  --bp-color-primary-soft:#EFF6FF;
  --bp-color-success:#10B981;
  --bp-color-success-soft:#ECFDF5;
  --bp-color-warning:#F59E0B;
  --bp-color-warning-soft:#FFFBEB;
  --bp-color-danger:#EF4444;
  --bp-color-danger-soft:#FEF2F2;
  --bp-color-focus-ring:#93C5FD;
  --bp-color-on-primary:#FFFFFF;

  --bp-font-sans:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --bp-font-size-h2:20px;
  --bp-font-size-h3:17px;
  --bp-font-size-body-1:15px;
  --bp-font-size-body-2:14px;
  --bp-font-size-caption:12px;

  --bp-space-1:4px;
  --bp-space-2:8px;
  --bp-space-3:12px;
  --bp-space-4:16px;
  --bp-space-6:24px;
  --bp-space-8:32px;

  --bp-radius-md:10px;
  --bp-radius-lg:14px;
  --bp-shadow-sm:0 1px 2px rgba(15,23,42,0.06);
  --bp-shadow-md:0 6px 18px rgba(15,23,42,0.10);

  --bp-touch-target-min:44px;
  --bp-control-height-md:44px;
  --bp-control-height-lg:52px;
  --bp-tabbar-height:64px;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bp-color-background:#0F1115;
    --bp-color-surface:#151922;
    --bp-color-surface-subtle:#1E232B;
    --bp-color-surface-interactive:#2A303C;
    --bp-color-text-primary:#F8FAFC;
    --bp-color-text-secondary:#CBD5E1;
    --bp-color-text-muted:#94A3B8;
    --bp-color-border-subtle:#2A303C;
    --bp-color-border-strong:#475569;
    --bp-color-primary:#3B82F6;
    --bp-color-primary-hover:#60A5FA;
    --bp-color-primary-soft:rgba(59,130,246,0.14);
    --bp-color-success:#22C55E;
    --bp-color-success-soft:rgba(34,197,94,0.12);
    --bp-color-warning:#FBBF24;
    --bp-color-warning-soft:rgba(251,191,36,0.12);
    --bp-color-danger:#F87171;
    --bp-color-danger-soft:rgba(248,113,113,0.12);
    --bp-color-focus-ring:#60A5FA;
    --bp-color-on-primary:#0F172A;
    --bp-shadow-sm:0 1px 2px rgba(0,0,0,0.24);
    --bp-shadow-md:0 6px 18px rgba(0,0,0,0.28);
  }
}

[data-theme="dark"]{
  color-scheme:dark;
  --bp-color-background:#0F1115;
  --bp-color-surface:#151922;
  --bp-color-surface-subtle:#1E232B;
  --bp-color-surface-interactive:#2A303C;
  --bp-color-text-primary:#F8FAFC;
  --bp-color-text-secondary:#CBD5E1;
  --bp-color-text-muted:#94A3B8;
  --bp-color-border-subtle:#2A303C;
  --bp-color-border-strong:#475569;
  --bp-color-primary:#3B82F6;
  --bp-color-primary-hover:#60A5FA;
  --bp-color-primary-soft:rgba(59,130,246,0.14);
  --bp-color-success:#22C55E;
  --bp-color-success-soft:rgba(34,197,94,0.12);
  --bp-color-warning:#FBBF24;
  --bp-color-warning-soft:rgba(251,191,36,0.12);
  --bp-color-danger:#F87171;
  --bp-color-danger-soft:rgba(248,113,113,0.12);
  --bp-color-focus-ring:#60A5FA;
  --bp-color-on-primary:#0F172A;
}

/* ── база ──────────────────────────────────────────────────────────────── */

*,*::before,*::after{box-sizing:border-box}

html{
  min-width:320px;
  -webkit-text-size-adjust:100%;
  overflow-x:hidden;
}

body{
  margin:0;
  min-height:100vh;
  overflow-x:hidden;
  background:var(--bp-color-background);
  color:var(--bp-color-text-primary);
  font-family:var(--bp-font-sans);
  font-size:var(--bp-font-size-body-1);
  /* Место под нижнюю навигацию и безопасную зону телефона. */
  padding-bottom:calc(var(--bp-tabbar-height) + env(safe-area-inset-bottom, 0px));
}

.page{
  max-width:560px;
  margin:0 auto;
  padding:var(--bp-space-4) var(--bp-space-3);
}

h1,h2,h3{margin:0 0 var(--bp-space-2)}
h1{font-size:var(--bp-font-size-h2)}
h2{font-size:var(--bp-font-size-h3)}

.muted{color:var(--bp-color-text-muted);font-size:var(--bp-font-size-body-2)}
.hidden{display:none !important}

/* CP9 source reuse, not a second design system.
   cloud/horeca-rev3.css @ 714a63dd7e39916b3df40ea63ad6aaf533fec101
   blob e3796711e13124d08f2e5059fbd654676f43845c:
   L19-46 palette/font; L156-194 photo/button/stepper; L447-459 product row;
   L463-478 floating cart/footer; L760-783 rapid-tap/input platform contract.
   The source tokens are mapped to the cabinet's --bp-* names below.
   Source provenance was read from GitHub at that exact ref; no font download. */
body.structured-mode{
  --bp-color-background:#F2F5F7;--bp-color-surface:#FFFFFF;--bp-color-surface-subtle:#F7F9FB;
  --bp-color-surface-interactive:#FFFFFF;--bp-color-text-primary:#171A1E;
  --bp-color-text-secondary:#4B535C;--bp-color-text-muted:#636C76;
  --bp-color-border-subtle:#E2E7EC;--bp-color-border-strong:#868E96;
  --bp-color-primary:#1E2731;--bp-color-primary-hover:#171E27;--bp-color-primary-soft:#F7F9FB;
  --bp-color-on-primary:#F1EFE9;--bp-color-focus-ring:#7A5C1F;
  --bp-color-success:#2E7D53;--bp-color-danger:#A8442E;
  --bp-font-sans:"Golos Text",-apple-system,system-ui,sans-serif;
  --bp-shadow-sm:0 1px 2px rgba(30,39,49,.08);
  --bp-structured-keyboard-inset:0px;--bp-structured-viewport-height:100dvh;
  padding-bottom:0;background:var(--bp-color-background);color:var(--bp-color-text-primary);
  color-scheme:light;font:15px/1.5 var(--bp-font-sans);font-variant-numeric:tabular-nums;
}
body.structured-mode .page{max-width:560px;padding:12px 14px}
body.structured-mode .topbar{min-height:48px;padding:2px 14px;background:var(--bp-color-background);border-bottom-color:var(--bp-color-border-subtle)}
body.structured-mode .topbar__title{font:600 16px var(--bp-font-sans)}
.structured-form{display:grid;gap:8px;padding-bottom:calc(110px + var(--bp-structured-keyboard-inset,0px) + env(safe-area-inset-bottom,0px));min-width:0;overflow-wrap:break-word;word-break:normal;hyphens:none}
.structured-picker-open{overflow:hidden}
.structured-heading{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 8px;min-width:0}
.structured-heading h1{font:700 20px/1.2 var(--bp-font-sans);margin:0}
.structured-heading p{margin:0;font-size:12.5px;color:var(--bp-color-text-secondary)}
.structured-topline{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}
.structured-point{padding:12px 13px;border:1px solid var(--bp-color-border-subtle);border-radius:16px;background:var(--bp-color-surface);min-width:0}
.structured-point h2{font:600 14.5px/1.28 var(--bp-font-sans);margin:0}
.structured-point p{margin:4px 0;font-size:12.5px;line-height:1.35;color:var(--bp-color-text-secondary)}
.structured-secondary{border-bottom:1px solid var(--bp-color-border-subtle);min-width:0}
.structured-secondary summary,.structured-max-details summary{min-height:44px;display:flex;align-items:center;gap:6px;cursor:pointer;font-size:12.5px;color:var(--bp-color-text-secondary)}
.structured-secondary[open] summary{font-weight:600}
.structured-secondary p{font-size:12.5px;margin:4px 0 8px}
.structured-controls{border:0;padding:0;margin:0;display:grid;gap:8px;min-width:0}
.structured-controls:disabled{opacity:.5}
.structured-primary-grid,.structured-controls .structured-primary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
.structured-form .field{margin:0;min-width:0}
.structured-form .field__label{font-size:12.5px;font-weight:500;color:var(--bp-color-text-secondary);margin-bottom:4px}
.structured-form .field__control{max-width:100%;min-width:0;min-height:44px;font:400 16px var(--bp-font-sans);padding:11px 13px;border:1px solid var(--bp-color-border-strong);border-radius:12px;background:var(--bp-color-surface);color:var(--bp-color-text-primary)}
.structured-form .button{width:100%;white-space:normal;overflow-wrap:break-word;min-height:44px;min-width:44px;font:600 14px var(--bp-font-sans);border-radius:14px;padding:11px 17px;border:1px solid var(--bp-color-border-strong);background:var(--bp-color-surface);color:var(--bp-color-text-primary);box-shadow:var(--bp-shadow-sm);transition:transform .06s ease}
.structured-form .button:active{transform:scale(.985)}
.structured-form .button:disabled{opacity:.5;cursor:default}
.structured-form .structured-add{position:sticky;top:48px;z-index:10;margin:0;background:var(--bp-color-surface);color:var(--bp-color-text-primary);border-color:var(--bp-color-border-strong)}
.structured-list,.structured-frequent{border:1px solid var(--bp-color-border-subtle);border-radius:16px;background:var(--bp-color-surface);min-width:0;overflow:hidden}
.structured-list:empty{display:none}
.structured-list>h2,.structured-frequent h2{font:600 14px var(--bp-font-sans);padding:12px 12px 0;margin:0}
.structured-line{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px;padding:12px;min-width:0;border-top:1px solid var(--bp-color-border-subtle)}
.structured-line:first-child{border-top:0}
.structured-photo{width:60px;height:60px;border-radius:14px;object-fit:cover;flex:none;background:var(--bp-color-surface-subtle);border:1px solid var(--bp-color-border-subtle)}
.structured-photo-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--bp-color-text-muted);overflow:hidden}
.structured-photo-placeholder svg{width:22px;height:22px;flex:none;stroke:var(--bp-color-border-strong);fill:none;stroke-width:1.5}
.structured-photo-placeholder>span{font:500 9px/1.05 var(--bp-font-sans);max-width:52px;text-align:center;overflow-wrap:normal;word-break:normal}
.structured-line__body{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:8px}
.structured-line__body h3,.structured-line__name{font:600 14px/1.28 var(--bp-font-sans);color:var(--bp-color-text-primary);margin:0;overflow-wrap:break-word;word-break:normal;hyphens:none;text-wrap:pretty}
.structured-line__body p{margin:0}
.structured-line__meta{font:500 12.5px/1.3 var(--bp-font-sans);color:var(--bp-color-text-secondary);margin:0}
.structured-line__row2{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.structured-line__unit{font:500 12.5px/1.25 var(--bp-font-sans);color:var(--bp-color-text-secondary);min-width:0}
.structured-stepper{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none;min-width:0}
.structured-stepper__button{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--bp-color-border-strong);border-radius:14px;background:var(--bp-color-surface);color:var(--bp-color-text-primary);font:600 22px var(--bp-font-sans);box-shadow:var(--bp-shadow-sm);transition:transform .06s ease;cursor:pointer}
.structured-stepper__button:active{transform:scale(.985)}
.structured-stepper input{appearance:textfield;-moz-appearance:textfield;width:44px;min-width:44px;min-height:44px;padding:0;text-align:center;font:700 16px var(--bp-font-sans);font-variant-numeric:tabular-nums;border:0;border-radius:0;background:var(--bp-color-surface);color:var(--bp-color-text-primary);box-shadow:none}
.structured-stepper input::-webkit-inner-spin-button,.structured-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.structured-stepper__button:focus-visible,.structured-stepper input:focus-visible{outline:2px solid var(--bp-color-focus-ring);outline-offset:1px}
.structured-line__details{flex-basis:100%;min-width:0;font-size:12.5px;color:var(--bp-color-text-secondary)}
.structured-line__error{flex-basis:100%;min-width:0;margin:2px 0;font-size:12.5px}
.structured-line__details summary{display:flex;align-items:center;min-height:44px;font-size:12.5px;cursor:pointer;color:var(--bp-color-text-muted)}
.structured-line__details p{margin:4px 0;line-height:1.35}
.structured-line__remove{min-height:44px;padding:0 8px;border:0;background:none;color:var(--bp-color-danger);font:500 12.5px var(--bp-font-sans);text-align:left;cursor:pointer}
.structured-quantity{font:600 12.5px var(--bp-font-sans);color:var(--bp-color-text-primary);margin:3px 0}
.structured-mapping{font-size:12.5px;color:var(--bp-color-text-secondary)}
.structured-receipt{padding:12px 13px;border:1px solid var(--bp-color-border-subtle);border-radius:12px;background:var(--bp-color-surface);min-width:0}
.structured-receipt h2{font:600 16px var(--bp-font-sans);margin-bottom:4px}
.structured-receipt p{font-size:12.5px;margin:4px 0 8px}
/* CP9 floating footer, preserving the existing keyboard/safe-area behaviour. */
.structured-submitbar{position:fixed;bottom:var(--bp-structured-keyboard-inset,0px);left:0;right:0;z-index:40;width:100%;display:flex;justify-content:center;padding:14px 16px calc(14px + env(safe-area-inset-bottom,0px));background:linear-gradient(to top,var(--bp-color-background) 68%,transparent);border:0;box-shadow:none;pointer-events:none}
.structured-submitbar__inner{pointer-events:auto;display:flex;align-items:center;gap:8px;max-width:532px;width:100%;min-width:0;margin:auto;padding:0 12px;border-radius:14px;background:var(--bp-color-primary);color:var(--bp-color-on-primary);box-shadow:0 2px 10px rgba(30,39,49,.22)}
.structured-submitbar__count{display:flex;align-items:center;gap:8px;flex:1 1 auto;min-width:0;font:700 14px/1.25 var(--bp-font-sans);color:var(--bp-color-on-primary)}
.structured-submitbar__count svg{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7}
.structured-submitbar .button{flex:0 0 auto;width:auto;min-width:100px;min-height:48px;margin:0;padding:0 8px;border:0;border-radius:14px;background:var(--bp-color-primary);color:var(--bp-color-on-primary);box-shadow:none;font:700 15px var(--bp-font-sans)}
.structured-picker-backdrop{position:fixed;inset:0;z-index:60;background:rgba(23,30,39,.42);display:flex;align-items:center;justify-content:center;padding:12px;overscroll-behavior:contain}
.structured-picker{display:grid;gap:8px;width:min(100%,560px);max-width:100%;max-height:calc(var(--bp-structured-viewport-height,100dvh) - 24px);min-width:0;overflow:auto;overscroll-behavior:contain;margin:0;padding:12px;border:1px solid var(--bp-color-border-subtle);border-radius:20px;background:var(--bp-color-surface);color:var(--bp-color-text-primary);box-shadow:0 -8px 30px rgba(23,30,39,.20)}
.structured-picker__head{position:sticky;top:-12px;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;background:var(--bp-color-surface);min-width:0}
.structured-picker__head h2{flex:1;min-width:0;font:600 17px var(--bp-font-sans);margin:0}
.structured-picker__head .button,.structured-picker__head button{width:auto;min-width:44px;min-height:44px;flex:0 0 auto}
.structured-picker__choices{display:grid;gap:8px;min-width:0}
.structured-picker__choices .button,.structured-picker__choices button{display:flex;flex-direction:column;align-items:flex-start;min-height:44px;width:100%;max-width:100%;white-space:normal;text-align:left;overflow-wrap:break-word;padding:11px 13px;line-height:1.28}
.structured-picker__choices .structured-product-choice{flex-direction:row;align-items:flex-start;justify-content:flex-start;gap:12px}
.structured-choice__body{display:flex;flex-direction:column;gap:8px;flex:1 1 0;min-width:0}
.structured-feedback{min-width:0;border-top:1px solid var(--bp-color-border-subtle)}
.structured-feedback>.button{min-height:44px;width:100%;padding:6px 0;border:0;background:none;box-shadow:none;color:var(--bp-color-primary);font-size:12.5px;font-weight:500;text-align:left}
.structured-feedback textarea{min-height:88px;width:100%;resize:vertical}
.structured-feedback .structured-point{margin-bottom:8px}
#add-product{margin-bottom:var(--bp-space-3);width:100%}
body.structured-mode button,body.structured-mode [role="button"],body.structured-mode label,body.structured-mode select{touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
body.structured-mode input,body.structured-mode textarea{touch-action:manipulation;-webkit-user-select:text;user-select:text;font-size:max(16px,1rem)}
@media (max-width:359px){
  .structured-photo{width:56px;height:56px}
  .structured-stepper{gap:4px}
  .structured-stepper input{width:44px;min-width:44px}
  .structured-primary-grid,.structured-controls .structured-primary-grid{gap:6px}
  .structured-submitbar__inner{gap:6px;padding:0 10px}
  .structured-submitbar__count{font-size:12.5px}
}
@media (min-width:900px){
  body.structured-mode .page{max-width:760px}
  .structured-submitbar__inner{max-width:732px}
}

/* ── шапка ─────────────────────────────────────────────────────────────── */

.topbar{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;justify-content:space-between;gap:var(--bp-space-2);
  min-height:var(--bp-control-height-md);
  padding:var(--bp-space-2) var(--bp-space-3);
  background:var(--bp-color-surface);
  border-bottom:1px solid var(--bp-color-border-subtle);
}

.topbar__title{font-size:var(--bp-font-size-h3);font-weight:600}

.bell{
  position:relative;
  min-height:var(--bp-touch-target-min);
  min-width:var(--bp-touch-target-min);
  display:inline-flex;align-items:center;justify-content:center;
  background:none;border:0;color:inherit;font-size:var(--bp-font-size-h3);
  border-radius:var(--bp-radius-md);
}

/* Счётчик — подпись, а не цель нажатия: нажимается кнопка вокруг него,
   поэтому здесь фиксированный размер, а не min-height цели. */
.bell__count{
  position:absolute;top:var(--bp-space-1);right:var(--bp-space-1);
  width:20px;height:20px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0 var(--bp-space-1);
  border-radius:999px;
  background:var(--bp-color-danger);color:var(--bp-color-on-primary);
  font-size:var(--bp-font-size-caption);font-weight:600;
}

/* ── экран категорий ───────────────────────────────────────────────────── */
/* Две колонки на 360 px: minmax(0,1fr) вместо auto — иначе длинное название
   («Очищенные овощи») распирает колонку и уводит страницу в горизонтальную
   прокрутку. Именно minmax(0,…) держит 360 и 390 px. */

.categories{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:var(--bp-space-2);
  margin-top:var(--bp-space-3);
}

.category{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:var(--bp-space-1);
  min-width:0;
  /* Цель нажатия заведомо больше 44 px: карточка целиком и есть кнопка. */
  min-height:76px;
  padding:var(--bp-space-3);
  text-align:left;
  background:var(--bp-color-surface);
  border:1px solid var(--bp-color-border-subtle);
  border-radius:var(--bp-radius-lg);
  box-shadow:var(--bp-shadow-sm);
  color:var(--bp-color-text-primary);
  font-family:inherit;font-size:var(--bp-font-size-body-1);
}

.category:active{background:var(--bp-color-primary-soft)}
.category__name{font-weight:600;overflow-wrap:anywhere}
.category__count{color:var(--bp-color-text-muted);font-size:var(--bp-font-size-caption)}

/* Пустая категория остаётся видимой и честно помечена, но не открывается. */
.category--empty{opacity:.55;background:var(--bp-color-surface-subtle)}

/* Возврат к категориям — первое, что видно на экране категории.
   UI-4: прежнее правило ужимало кнопку до минимальной цели нажатия и оставляло
   ей заливку .button--ghost, которая в светлой теме почти совпадает с фоном
   страницы — контраст поверхности около 1.03:1, то есть кнопки визуально не
   было вовсе. Теперь у неё явная граница, высота остальных контролов и своё
   состояние нажатия. */
.back{
  width:auto;
  min-height:var(--bp-control-height-lg);
  margin-bottom:var(--bp-space-3);
  padding:0 var(--bp-space-4);
  background:var(--bp-color-surface);
  /* Граница берётся токеном текста, а не --bp-color-border-*: слабые границы
     дают около 1.4:1 к фону страницы, то есть не проходят требование 3:1 к
     видимой границе элемента управления. Это меряется браузерным прогоном. */
  border:1px solid var(--bp-color-text-muted);
  color:var(--bp-color-text-primary);
  font-weight:600;
  box-shadow:var(--bp-shadow-sm);
}
.back:active{background:var(--bp-color-surface-interactive)}

/* ── карточка товара ───────────────────────────────────────────────────── */

.card{
  display:flex;gap:var(--bp-space-3);
  padding:var(--bp-space-3);
  margin-bottom:var(--bp-space-2);
  background:var(--bp-color-surface);
  border:1px solid var(--bp-color-border-subtle);
  border-radius:var(--bp-radius-lg);
  box-shadow:var(--bp-shadow-sm);
}

/* Рамка фото. Issue #318 (MEDIA): рамка существует всегда, а картинка внутри —
   только когда она реально загрузилась. Пустой URL и сорвавшаяся загрузка
   дают одну и ту же честную заглушку, а не серый квадрат и не системную
   «битую картинку» браузера. */
.card__photo{
  position:relative;
  flex:0 0 auto;
  width:72px;
  height:72px;
  max-width:100%;
  overflow:hidden;
  border-radius:var(--bp-radius-md);
  background:var(--bp-color-surface-subtle);
}

.card__photo-img{width:100%;height:100%;object-fit:cover;display:block}

.card__photo--empty::after{
  content:"нет фото";
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  padding:0 4px;
  color:var(--bp-color-text-muted);
  font-size:var(--bp-font-size-caption);
  text-align:center;
}

/* Подтверждение выполненного действия (Issue #318, UI-1 и UI-2). Номер заявки
   обязан быть виден и читаем, а не теряться серым текстом среди подписей. */
.notice{
  margin-bottom:var(--bp-space-3);
  padding:var(--bp-space-3);
  background:var(--bp-color-surface-subtle);
  border:1px solid var(--bp-color-border-subtle);
  border-radius:var(--bp-radius-md);
  color:var(--bp-color-text-primary);
  font-weight:600;
  overflow-wrap:anywhere;
}
.notice--ok{border-color:var(--bp-color-success);background:var(--bp-color-surface)}

.card__body{flex:1 1 auto;min-width:0}
.card__name{font-weight:600;overflow-wrap:anywhere}
.card__meta{color:var(--bp-color-text-muted);font-size:var(--bp-font-size-caption)}

/* ── шаговый ввод количества ───────────────────────────────────────────── */

.stepper{display:flex;align-items:center;gap:var(--bp-space-2);margin-top:var(--bp-space-2)}

.stepper__button{
  min-height:var(--bp-touch-target-min);
  min-width:var(--bp-touch-target-min);
  border:1px solid var(--bp-color-border-strong);
  border-radius:var(--bp-radius-md);
  background:var(--bp-color-surface-interactive);
  color:var(--bp-color-text-primary);
  font-size:var(--bp-font-size-h3);
}

.stepper__value{
  flex:1 1 auto;min-width:0;
  text-align:center;font-variant-numeric:tabular-nums;
}

.stepper__hint{color:var(--bp-color-warning);font-size:var(--bp-font-size-caption)}

/* ── кнопки ────────────────────────────────────────────────────────────── */

.button{
  display:inline-flex;align-items:center;justify-content:center;
  width:100%;
  min-height:var(--bp-control-height-lg);
  padding:0 var(--bp-space-4);
  border:0;border-radius:var(--bp-radius-md);
  background:var(--bp-color-primary);color:var(--bp-color-on-primary);
  font-size:var(--bp-font-size-body-1);font-weight:600;
}

.button:active{background:var(--bp-color-primary-hover)}
.button:disabled{opacity:.55}
.button--ghost{background:var(--bp-color-surface-interactive);color:var(--bp-color-text-primary)}
.button--danger{background:var(--bp-color-danger);color:var(--bp-color-on-primary)}

.button-row{display:flex;gap:var(--bp-space-2);margin-top:var(--bp-space-3)}

:focus-visible{outline:2px solid var(--bp-color-focus-ring);outline-offset:2px}

/* ── поля ──────────────────────────────────────────────────────────────── */

.field{display:block;margin-bottom:var(--bp-space-3)}
.field__label{display:block;margin-bottom:var(--bp-space-1);font-size:var(--bp-font-size-body-2);color:var(--bp-color-text-secondary)}

.field__control{
  width:100%;
  min-height:var(--bp-control-height-md);
  padding:0 var(--bp-space-3);
  border:1px solid var(--bp-color-border-strong);
  border-radius:var(--bp-radius-md);
  background:var(--bp-color-surface);
  color:var(--bp-color-text-primary);
  font-family:inherit;font-size:var(--bp-font-size-body-1);
}

textarea.field__control{min-height:80px;padding:var(--bp-space-2) var(--bp-space-3)}

/* ── статусы и предложения ─────────────────────────────────────────────── */

.status{
  display:inline-flex;align-items:center;gap:var(--bp-space-1);
  padding:var(--bp-space-1) var(--bp-space-2);
  border-radius:999px;
  font-size:var(--bp-font-size-caption);font-weight:600;
  background:var(--bp-color-surface-interactive);
  color:var(--bp-color-text-secondary);
}

/* Статус читается без цвета: точка плюс подпись, как требует канон. */
.status__dot{width:8px;height:8px;border-radius:999px;background:currentColor}
.status--wait{background:var(--bp-color-warning-soft);color:var(--bp-color-warning)}
.status--ok{background:var(--bp-color-success-soft);color:var(--bp-color-success)}
.status--stop{background:var(--bp-color-danger-soft);color:var(--bp-color-danger)}

.diff{width:100%;border-collapse:collapse;font-size:var(--bp-font-size-body-2)}
.diff th,.diff td{padding:var(--bp-space-2);border-bottom:1px solid var(--bp-color-border-subtle);text-align:left}
.diff td:last-child,.diff th:last-child{text-align:right}
.diff__was{color:var(--bp-color-text-muted);text-decoration:line-through}
.diff__proposed{font-weight:600}

.scroll-x{overflow-x:auto}

/* ── состояния экрана ──────────────────────────────────────────────────── */

.state{
  padding:var(--bp-space-8) var(--bp-space-4);
  text-align:center;
  color:var(--bp-color-text-secondary);
}

.state__title{font-weight:600;color:var(--bp-color-text-primary);margin-bottom:var(--bp-space-1)}
.state--error .state__title{color:var(--bp-color-danger)}
.state--stale .state__title{color:var(--bp-color-warning)}

/* ── нижняя навигация: управление одной рукой ──────────────────────────── */

.tabbar{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:30;
  display:flex;
  padding-bottom:env(safe-area-inset-bottom, 0px);
  background:var(--bp-color-surface);
  border-top:1px solid var(--bp-color-border-subtle);
}

.tabbar__item{
  position:relative;
  flex:1 1 0;
  min-height:var(--bp-tabbar-height);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  border:0;background:none;
  color:var(--bp-color-text-muted);
  font-family:inherit;font-size:var(--bp-font-size-caption);
}

.tabbar__item[aria-current="page"]{color:var(--bp-color-primary)}

/* Бейдж — метка поверх иконки, а не третья строка. Третьей строкой он выдавливал
   подпись за нижний край панели: видно только в браузере, тестами не ловится. */
.tabbar__badge{
  position:absolute;
  top:6px;
  left:calc(50% + 6px);
  width:18px;height:18px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:999px;
  background:var(--bp-color-primary);color:var(--bp-color-on-primary);
  font-size:10px;
}

/* ── desktop как вспомогательный режим ─────────────────────────────────── */

@media (min-width: 900px){
  body{padding-bottom:0}
  .page{max-width:840px;padding:var(--bp-space-6)}
  .tabbar{position:sticky;top:0;bottom:auto;border-top:0;border-bottom:1px solid var(--bp-color-border-subtle)}
  .card__photo{width:96px;height:96px}
}

@media (prefers-reduced-motion: reduce){
  *{animation:none !important;transition:none !important}
}
