/* css/app.css — Grand Mumtoz Director · ZARHAL
   Reset, layout shell (top bar, bottom nav, sidebar, inspector, layers, toasts, lamp),
   every §6 component with its states, §2 motion keyframes, reduced-motion overrides,
   §3.2–3.4 phone/desktop breakpoints, print base. Tokens only — no colour values here. */

/* ============================================================ 0. reset */
*, *::before, *::after { box-sizing: border-box; }
/* eski Chrome 80 (Redmi Note 8, 21.09.2026): inset → top/right/bottom/left, dvh → vh даны запасными объявлениями перед новыми */
/* Hujjat o'zi aylanmaydi / документ сам НЕ прокручивается (iPhone, с иконки «Домой», 12–14.10.2026: после
   свайпа вниз-вверх нижнее меню и шапка застревали посреди экрана поверх содержимого и оставались там даже
   после повторного открытия — iOS сдвигал прокрутку документа, а position:fixed панели держались за старое
   положение). Теперь html/body ровно в экран и без прокрутки; прокручивается только #screen между шапкой и
   меню (обычный поток, flex-колонка), панели больше не fixed. Высота — цепочкой 100 % от экрана: без dvh/vh
   (Chrome 80 у повара dvh не знает; клавиатура Chrome 80 уменьшает экран — 100 % идёт за ним, vh — нет). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; height: var(--app-h, 100%); overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg-0); color: var(--text-1);
  font: 400 14px/20px var(--font-ui);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
img { display: block; }
input, textarea { font-size: 16px; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--r-xs); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--accent-soft); }

/* ============================================================ 1. icons */
.i { display: inline-block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex-shrink: 0; }
.i--16 { width: 16px; height: 16px; } .i--20 { width: 20px; height: 20px; }
.i--24 { width: 24px; height: 24px; } .i--28 { width: 28px; height: 28px; }
.i--32 { width: 32px; height: 32px; } .i--40 { width: 40px; height: 40px; } .i--96 { width: 96px; height: 96px; }
.i--gold { color: var(--accent-strong); }

/* ============================================================ 2. typography (§1.3) */
.wordmark { font: 600 36px/40px var(--font-display); color: var(--text-1); letter-spacing: .01em; text-wrap: balance; }
.screen-title { font: 600 24px/28px var(--font-display); color: var(--text-1); text-wrap: balance; }
.hero-num { font: 700 40px/44px var(--font-ui); color: var(--accent-strong); letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.num-2xl { font: 700 32px/36px var(--font-ui); letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.num-xl { font: 700 26px/30px var(--font-ui); letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.num-lg { font: 700 20px/24px var(--font-ui); font-variant-numeric: tabular-nums lining-nums; }
.title { font: 700 16px/22px var(--font-ui); color: var(--text-1); text-wrap: balance; }
.body { font: 400 14px/20px var(--font-ui); }
.body-strong { font: 700 14px/20px var(--font-ui); }
.small { font: 400 13px/18px var(--font-ui); }
.small-strong { font: 700 13px/18px var(--font-ui); }
.caption { font: 500 12px/16px var(--font-ui); color: var(--text-2); }
.overline { font: 700 11px/14px var(--font-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overline--muted { color: var(--text-3); }
.num, .count, .tick { font-variant-numeric: tabular-nums lining-nums; }
.text-1 { color: var(--text-1); } .text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.tone--success { color: var(--success); } .tone--warning { color: var(--warning); }
.tone--danger { color: var(--danger); } .tone--info { color: var(--info); } .tone--accent { color: var(--accent); }
.unit { font: 500 12px/16px var(--font-ui); color: var(--text-2); margin-left: .35em; }
.mono { font-family: var(--font-mono); }
.link { color: var(--accent); font-weight: 500; cursor: pointer; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) {
  .screen-title { font-size: 30px; line-height: 36px; }
  .hero-num { font-size: 48px; line-height: 52px; }
}

/* ============================================================ 3. app shell */
/* телефон: колонка «шапка → #screen (прокрутка) → меню»; sticky теперь считается от верха #screen, а он
   уже под шапкой — поэтому --sticky-top 0 (раньше — высота шапки над прокручиваемым документом) */
.app { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; --sticky-top: 0px; }
.app__lamp { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: var(--lamp); pointer-events: none; z-index: 0; }
html.booting .app { visibility: hidden; }
.app--reveal { animation: fadeIn var(--t-grand) var(--e-velvet); }

/* --- top bar (phone: opaque, static, ≤ 2 icon targets on the right) --- */
.topbar { position: relative; flex: 0 0 auto; z-index: 30; background: var(--bg-1); border-bottom: 1px solid var(--line); padding-top: var(--safe-t); }
.topbar__inner { display: flex; align-items: center; height: var(--top-h); padding: 0 6px 0 10px; gap: 4px; }
.topbar__mono { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); flex-shrink: 0; -webkit-touch-callout: none; user-select: none; border-radius: var(--r-sm); }
.topbar__title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.topbar__title .screen-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.topbar__search, .topbar__seg, .topbar__theme, .topbar__avatar { display: none; }
.topbar__pill { flex-shrink: 0; }

/* --- icon button (44 × 44 hit area) --- */
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r-sm); color: var(--text-1); flex-shrink: 0; transition: transform var(--t-micro), background-color var(--t-short); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .badge { position: absolute; top: 5px; right: 3px; }
.icon-btn .badge--dot { top: 9px; right: 9px; }
.icon-btn--muted { color: var(--text-2); }
.icon-btn--active { color: var(--accent); }
@media (hover: hover) { .icon-btn:hover { background: var(--bg-3); } }

/* --- bottom nav (phone) --- */
/* translateZ — iOS Safari: o'z qatlamida / свой слой, чтобы панель не «плавала»
   при инерционной прокрутке длинных списков (владелец, 18.09.2026).
   16.10.2026: не fixed — последняя строка колонки .app, под #screen; relative нужен .nav__bg/.nav__bead
   (absolute, бусина торчит вверх на 16px поверх #screen: z-index 30 > 1). flex 0 0 auto — не сжимать. */
.nav { position: relative; flex: 0 0 auto; z-index: 30; display: flex; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--bg-1); border-top: 1px solid var(--line); user-select: none; transform: translateZ(0); }
.nav__item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-2); font: 500 11px/14px var(--font-ui); -webkit-tap-highlight-color: transparent; transition: color var(--t-short); }
.nav__item.is-active { color: var(--accent); font-weight: 700; }
.nav__item:active .i { transform: scale(.94); }
.nav__item .i { transition: transform var(--t-micro); }
.nav__dot { position: absolute; top: 6px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transition: transform 200ms var(--e-inout); will-change: transform; }
.nav__badge { position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-1); }
.app--sheet-full .nav { visibility: hidden; }

/* --- sidebar (desktop only) --- */
.sidebar { display: none; }

/* --- screen host --- */
/* единственная прокрутка телефона: всё место между шапкой и меню; отступов под fixed-панели больше нет.
   flex-basis 0 % (не auto): иначе основа = вся высота содержимого и flex сжимал бы шапку/меню.
   contain — прокрутка не уходит в документ (и нет «потянуть-обновить» Chrome), отскок iOS — только внутри. */
#screen { position: relative; z-index: 1; flex: 1 1 0%; min-height: 0; padding: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; outline: none; }
.screen { position: relative; padding: var(--gutter); }
.screen--out { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; animation: fadeOut 100ms var(--e-exit) forwards; }
.screen--enter-tab { animation: fadeUp8 var(--t-med) var(--e-enter); }
.screen--enter-push { animation: pushIn var(--t-med) var(--e-enter); }
.screen--enter-pop { animation: popIn 200ms var(--e-exit); }
.screen--enter-desk { animation: fadeUp6 200ms var(--e-velvet); }
.screen--fullscreen { padding: 0; }

/* --- strips (offline / online / return) --- */
.strip { position: sticky; top: var(--sticky-top); z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px var(--gutter); font: 500 13px/18px var(--font-ui); animation: stripIn 200ms var(--e-enter); }
.strip--offline { background: var(--warning-soft); color: var(--warning); }
.strip--online { background: var(--success-soft); color: var(--success); }
.strip--info { background: var(--info-soft); color: var(--info); }
.strip__text { flex: 1; min-width: 0; }
.strip.is-out { animation: fadeOut 160ms var(--e-exit) forwards; }

/* --- inspector (desktop) --- */
#inspector { display: none; }
.scrim { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: var(--overlay); z-index: 44; animation: fadeIn 200ms; }

/* --- layers & toasts --- */
#layers { position: relative; z-index: 50; }
#toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 70; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }

/* ============================================================ 4. panels & layout helpers */
.card { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 12px 14px; }
.card--hero { border-radius: var(--r-xl); border-top-color: var(--line-gold); padding: 16px 18px; }
.card--stat { border-radius: var(--r-lg); border-top-color: var(--line-gold); }
.card--tap { cursor: pointer; transition: transform var(--t-micro), box-shadow var(--t-short); }
.card--tap:active { transform: scale(.985); }
@media (hover: hover) { .card--tap:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); } }
.section { margin-top: 20px; }
.section:first-child { margin-top: 0; }
.section__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 24px; }
.section__head .overline { flex: 1; min-width: 0; }
.section__count { font: 700 12px/16px var(--font-ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.section__link { font: 500 13px/18px var(--font-ui); color: var(--accent); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 8px); }
.hstack { display: flex; align-items: center; gap: var(--gap, 8px); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.center { text-align: center; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }
.cv-auto { content-visibility: auto; contain-intrinsic-size: auto 320px; }
.contain { contain: content; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.dept-reception { --dept: var(--dept-reception); } .dept-maid { --dept: var(--dept-maid); }
.dept-laundry { --dept: var(--dept-laundry); } .dept-cook { --dept: var(--dept-cook); }
.dept-director { --dept: var(--dept-director); } .dept-all { --dept: var(--text-3); }
.dept-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dept, var(--text-3)); flex-shrink: 0; }
.dept-rule { border-left: 3px solid var(--dept, var(--text-3)); }
.st-free { color: var(--st-free); } .st-busy { color: var(--text-1); } .st-dirty { color: var(--st-dirty); }
.st-cleaning { color: var(--st-cleaning); } .st-issue { color: var(--st-issue); }

/* ============================================================ 5. buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font: 700 14px/20px var(--font-ui); white-space: nowrap; user-select: none; transition: transform var(--t-micro), background-color var(--t-short), border-color var(--t-short), color var(--t-short); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn--primary { background: var(--accent-fill); color: var(--accent-ink); }
.btn--primary:active:not(:disabled) { background: var(--accent-fill-active); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text-1); }
.btn--danger { background: var(--danger); color: var(--text-inverse); }
.btn--danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--soft { background: var(--bg-3); color: var(--text-1); }
.btn--icon { width: 44px; padding: 0; }
.btn--52 { height: 52px; font-size: 15px; }
.btn--32 { height: 32px; padding: 0 10px; font-size: 13px; }
.btn--block { display: flex; width: 100%; }
.btn--stack { flex-direction: column; gap: 4px; padding: 4px 6px; font: 500 11px/13px var(--font-ui); height: auto; min-height: 44px; }
.btn--stack span { text-align: center; white-space: normal; max-width: 72px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label, .btn.is-loading .i { visibility: hidden; }
.btn.is-loading .spinner { position: absolute; }
.btn--warning-soft { background: var(--warning-soft); color: var(--warning); }
@media (hover: hover) {
  .btn--primary:hover:not(:disabled) { background: var(--accent-fill-hover); }
  .btn--ghost:hover:not(:disabled), .btn--soft:hover:not(:disabled) { background: var(--bg-3); }
  .btn--danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
}
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: currentColor; animation: spin 800ms linear infinite; }
.spinner--24 { width: 24px; height: 24px; }
.btn--primary .spinner { border-color: var(--accent-soft); border-top-color: var(--accent-ink); }
.action-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.action-bar .btn--stack { border-color: var(--line-strong); }

/* ============================================================ 6. inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field__label { font: 500 12px/16px var(--font-ui); color: var(--text-2); }
.field__wrap { position: relative; display: flex; align-items: center; }
.field__prefix, .field__suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--text-2); font: 500 13px/18px var(--font-ui); pointer-events: none; }
.field__prefix { left: 12px; } .field__suffix { right: 12px; }
.field__error { font: 500 12px/16px var(--font-ui); color: var(--danger); }
.field__hint { font: 500 12px/16px var(--font-ui); color: var(--text-3); }
.field--error .input { border-color: var(--danger); }
.input { width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text-1); font: 400 16px/22px var(--font-ui); transition: border-color var(--t-short); -webkit-appearance: none; appearance: none; }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input--amount { height: 56px; font: 700 28px/32px var(--font-ui); font-variant-numeric: tabular-nums; padding-right: 56px; }
.input--prefixed { padding-left: 40px; }
.textarea { min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 22px; }
.select { padding-right: 36px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg-2); overflow: hidden; }
.stepper__btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-1); }
.stepper__btn:active { background: var(--bg-3); }
.stepper__btn:disabled { color: var(--text-3); }
.stepper__val { min-width: 44px; text-align: center; font: 700 16px/20px var(--font-ui); font-variant-numeric: tabular-nums; }
.stepper__val input { width: 52px; text-align: center; border: 0; background: transparent; font: inherit; color: inherit; }
.stepper.is-set .stepper__val { color: var(--accent); }
.toggle { position: relative; width: 44px; height: 26px; flex-shrink: 0; border-radius: 13px; background: var(--bg-4); border: 1px solid var(--line-strong); transition: background-color var(--t-micro), border-color var(--t-micro); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform var(--t-micro), background-color var(--t-micro); }
.toggle[aria-checked="true"] { background: var(--accent-fill); border-color: var(--accent-fill); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); background: var(--accent-ink); }
.toggle:disabled { opacity: .5; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.toggle-row__label { flex: 1; min-width: 0; font: 500 14px/20px var(--font-ui); }
.toggle-row__sub { font: 500 12px/16px var(--font-ui); color: var(--text-3); }
.code-input { position: relative; display: flex; gap: 8px; justify-content: center; }
.code-input__cell { width: 44px; height: 52px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--bg-2); display: grid; place-items: center; font: 500 24px/1 var(--font-mono); color: var(--text-1); position: relative; transition: border-color var(--t-short); }
.code-input__cell.is-active { border-color: var(--accent); }
.code-input__cell.is-active:empty::after { content: ''; width: 2px; height: 26px; background: var(--accent); animation: caret 1s steps(2, start) infinite; }
.code-input__real { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; caret-color: transparent; color: transparent; background: transparent; border: 0; }
.code-input--error .code-input__cell { border-bottom: 2px solid var(--danger); }
.code-input.is-shake { animation: shake 240ms var(--e-velvet); }
.code-input.is-locked { pointer-events: none; opacity: .7; }
.search-field { position: relative; }
.search-field > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-field .input { padding-left: 40px; padding-right: 40px; }
.search-field__clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-3); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ============================================================ 7. chips, segmented, tabs */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text-1); font: 500 13px/18px var(--font-ui); white-space: nowrap; cursor: pointer; user-select: none; flex-shrink: 0; transition: transform var(--t-micro), background-color var(--t-micro), border-color var(--t-micro), color var(--t-micro); }
.chip:active { transform: scale(.97); }
.chip--selected, .chip.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip__count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip--selected .chip__count { color: inherit; }
.chip__x { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: -4px; border-radius: 50%; color: inherit; opacity: .8; }
.chip--sm { height: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--r-xs); gap: 4px; }
.chip--xs { height: 20px; padding: 0 6px; font-size: 11px; line-height: 14px; border-radius: var(--r-xs); gap: 4px; }
.chip--static { cursor: default; }
.chip--success { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.chip--warning { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.chip--danger { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.chip--info { border-color: var(--info); color: var(--info); background: var(--info-soft); }
.chip--accent { border-color: var(--accent); color: var(--accent); }
.chip--st-free { border-color: var(--st-free); color: var(--st-free); background: var(--success-soft); }
.chip--st-busy { border-color: var(--st-busy-line); color: var(--st-busy-ink); background: var(--st-busy-bg); }
.chip--st-dirty { border-color: var(--st-dirty); color: var(--st-dirty); background: var(--st-dirty-soft); }
.chip--st-cleaning { border-color: var(--st-cleaning); color: var(--st-cleaning); background: var(--st-cleaning-soft); }
.chip--st-issue { border-color: var(--st-issue); color: var(--st-issue); background: var(--danger-soft); }
.chip:disabled, .chip.is-disabled { opacity: .5; pointer-events: none; }
.chips { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 4px 0; overflow-x: auto; scrollbar-width: none; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, transparent, var(--text-1) 10px, var(--text-1) calc(100% - 10px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; mask-image: none; }
.seg { position: relative; display: inline-flex; align-items: stretch; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); user-select: none; max-width: 100%; }
.seg--block { display: flex; }
.seg__thumb { position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); border-radius: 8px; background: var(--bg-4); box-shadow: var(--shadow-1); transition: transform 200ms var(--e-inout); will-change: transform; }
.seg__opt { position: relative; z-index: 1; flex: 1 1 auto; height: 32px; padding: 0 12px; border-radius: 8px; font: 500 13px/32px var(--font-ui); color: var(--text-2); white-space: nowrap; text-align: center; transition: color var(--t-short); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg__opt.is-active { color: var(--text-1); font-weight: 700; }
.seg__opt .chip__count { font-weight: 500; }
.seg--sm .seg__opt { height: 28px; line-height: 28px; padding: 0 10px; font-size: 12px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); touch-action: pan-x pan-y; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__item { position: relative; flex-shrink: 0; padding: 10px 12px; font: 700 14px/20px var(--font-ui); color: var(--text-2); white-space: nowrap; transition: color var(--t-short); --dept: var(--accent); }
.tabs__item.is-active { color: var(--text-1); }
.tabs__item.is-active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 1px; background: var(--dept); }
.tabs__item.is-soon { color: var(--text-3); }
.tabs__dot { position: absolute; top: 8px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ============================================================ 8. badges, avatars, pills, wells */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent); color: var(--accent-ink); font: 700 11px/18px var(--font-ui); font-variant-numeric: tabular-nums; overflow: hidden; }
.badge--dot { min-width: 8px; width: 8px; height: 8px; padding: 0; }
.badge--muted { background: var(--bg-4); color: var(--text-2); }
.badge--danger { background: var(--danger); color: var(--text-inverse); }
.badge.is-bump { animation: badgeBump 200ms var(--e-velvet); }
.badge__num { display: block; }
.badge__num.is-roll { animation: odometer 140ms var(--e-velvet); }
.avatar { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--bg-3); color: var(--text-1); font-weight: 700; letter-spacing: .02em; --ring: transparent; box-shadow: 0 0 0 2px var(--ring); user-select: none; }
.avatar--24 { width: 24px; height: 24px; font-size: 10px; box-shadow: 0 0 0 1.5px var(--ring); }
.avatar--32 { width: 32px; height: 32px; font-size: 12px; }
.avatar--40 { width: 40px; height: 40px; font-size: 14px; }
.avatar--64 { width: 64px; height: 64px; font-size: 22px; box-shadow: 0 0 0 3px var(--ring); }
.avatar--ring-dept { --ring: var(--dept, var(--text-3)); }
.avatar--ring-gold { --ring: var(--accent); }
.avatar--ring-silver { --ring: var(--text-2); }
.avatar--ring-bronze { --ring: var(--st-dirty); }
.avatar__crown { position: absolute; top: -7px; right: -5px; color: var(--accent); width: 14px; height: 14px; }
.avatar__dot { position: absolute; right: -2px; bottom: -2px; box-shadow: 0 0 0 2px var(--bg-1); }
.avatar--glyph { color: var(--text-3); }
.pulse { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.pulse::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; border-radius: 50%; border: 1.5px solid var(--success); animation: pulseRing 2400ms var(--e-velvet) infinite; }
.pulse--static::after { animation: none; transform: scale(1.6); opacity: .5; }
.pulse--warning { background: var(--warning); } .pulse--warning::after { border-color: var(--warning); }
.pulse--accent { background: var(--accent); } .pulse--accent::after { border-color: var(--accent); }
.pulse--danger { background: var(--danger); } .pulse--danger::after { border-color: var(--danger); }
.pulse--6 { width: 6px; height: 6px; }
html.paused .pulse::after, html.paused .live-pill i::after { animation-play-state: paused; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font: 700 11px/20px var(--font-ui); letter-spacing: .08em; white-space: nowrap; flex-shrink: 0; }
.live-pill i { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.live-pill--live i { background: var(--accent); }
.live-pill--live i::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; border-radius: 50%; border: 1px solid var(--accent); animation: pulseRing 2400ms var(--e-velvet) infinite; }
.live-pill--poll i { background: var(--warning); }
.live-pill--offline i { background: var(--danger); }
.live-pill--live { color: var(--accent); }
.well { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line); font-size: 14px; line-height: 1; flex-shrink: 0; }
.well > span { filter: grayscale(1) opacity(.75); }
.byline { font: 500 12px/16px var(--font-ui); color: var(--text-3); margin-top: 6px; }
.byline--stale { color: var(--warning); }
.role-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); color: var(--text-2); font: 500 11px/18px var(--font-ui); }
.role-chip--owner { border-color: var(--accent); color: var(--accent); }

/* ============================================================ 9. rows: generic, person, feed */
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color var(--t-micro); text-align: left; width: 100%; }
.row:last-child { border-bottom: 0; }
.row--48 { min-height: 48px; padding: 4px; }
.row--static { cursor: default; }
.row:not(.row--static):active { background: var(--bg-3); }
@media (hover: hover) { .row:not(.row--static):hover { background: var(--bg-3); } }
.row__icon { color: var(--text-2); display: grid; place-items: center; flex-shrink: 0; }
.row__body { flex: 1; min-width: 0; }
.row__title { font: 500 14px/20px var(--font-ui); display: flex; align-items: center; gap: 8px; }
.row__title b { font-weight: 700; }
.row__sub { font: 500 12px/16px var(--font-ui); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--text-2); font: 500 13px/18px var(--font-ui); }
.row__chev { color: var(--text-3); }
.row--danger .row__title { color: var(--danger); }
.list { display: flex; flex-direction: column; }
.list--card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 8px; }
.person { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; cursor: pointer; transition: background-color var(--t-micro); }
.person:active { background: var(--bg-3); }
@media (hover: hover) { .person:hover { background: var(--bg-3); } }
.person__body { flex: 1; min-width: 0; }
.person__name { display: flex; align-items: center; gap: 8px; font: 700 14px/20px var(--font-ui); }
.person__name .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__floor { font-weight: 500; color: var(--text-2); }
.person__tick { font: 500 13px/18px var(--font-ui); font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.person--warning .person__tick { color: var(--warning); font-weight: 700; }
.person__meta { font: 500 12px/16px var(--font-ui); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.person__meta .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__progress { flex: 0 0 56px; height: 2px; border-radius: 1px; background: var(--line); overflow: hidden; }
.person__progress i { display: block; height: 100%; width: 100%; background: var(--dept, var(--accent)); transform-origin: left; }
.person__call { color: var(--text-2); }
.person__actions { margin-top: 4px; }
.dept-head { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-top: 8px; font: 700 13px/18px var(--font-ui); cursor: pointer; }
.dept-head__rule { flex: 1; height: 1px; background: var(--line); }
.dept-head__count { font: 700 12px/16px var(--font-ui); color: var(--text-2); }
.dept-head--soon { color: var(--text-3); font-weight: 500; cursor: default; }
.feed-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 1px 8px; padding: 9px 12px 9px 18px; border-bottom: 1px solid var(--line); --dept: var(--text-3); text-align: left; width: 100%; cursor: pointer; transition: background-color var(--t-micro); }
.feed-row::before { content: ''; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--dept); }
.feed-row:active { background: var(--bg-3); }
@media (hover: hover) { .feed-row:hover { background: var(--bg-3); } }
.feed-row__time { font: 500 12px/18px var(--font-ui); color: var(--text-2); font-variant-numeric: tabular-nums; }
.feed-row__kind { font: 700 13px/18px var(--font-ui); display: flex; align-items: center; gap: 6px; min-width: 0; }
.feed-row__kind .unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.feed-row__amount { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font: 700 14px/18px var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-row__detail { grid-column: 2 / 4; font: 400 13px/18px var(--font-ui); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-row--compact .feed-row__detail { -webkit-line-clamp: 1; }
.feed-row.is-highlight { background: var(--accent-soft); }
.day-head { position: sticky; top: var(--sticky-top); z-index: 3; display: flex; align-items: center; gap: 8px; padding: 8px 0 6px; background: var(--bg-0); font: 700 11px/14px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.day-head b { color: var(--text-2); }
.day-head .ml-auto { font-variant-numeric: tabular-nums; }
.day-group { content-visibility: auto; contain-intrinsic-size: auto 480px; }
.held-pill { position: fixed; left: 50%; top: calc(var(--top-h) + var(--safe-t) + 12px); transform: translateX(-50%); z-index: 25; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-full); background: var(--accent-fill); color: var(--accent-ink); font: 700 13px/18px var(--font-ui); box-shadow: var(--shadow-2); animation: heldIn 200ms var(--e-enter); }

/* ============================================================ 10. hero, stat, attention */
.hero__eyebrow { margin-bottom: 4px; }
.hero__value { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hero__value--zero .hero-num { color: var(--text-2); }
.hero__delta { font: 500 13px/18px var(--font-ui); color: var(--text-2); margin-top: 2px; }
.hero__delta--up { color: var(--success); } .hero__delta--down { color: var(--danger); }
.hero__breakdown { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 6px; font: 500 12px/16px var(--font-ui); color: var(--text-2); }
.hero__breakdown button { color: inherit; font: inherit; }
.hero__breakdown button:hover { color: var(--text-1); }
.hero__spark { position: absolute; right: 18px; top: 18px; display: none; }
.hero.card--tap { cursor: pointer; width: 100%; text-align: left; }
.stat { display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; width: 100%; text-align: left; cursor: pointer; }
.stat__value { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stat__value .num-xl { white-space: nowrap; }
.stat__value small { font: 500 14px/18px var(--font-ui); color: var(--text-2); }
.stat__label { color: var(--text-3); margin-top: 4px; }
.stat__sub { font: 500 12px/16px var(--font-ui); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat--warning .stat__sub { color: var(--warning); }
.stat--danger .stat__sub { color: var(--danger); }
.stat--danger .num-xl { color: var(--danger); }
.stat__ring { width: 32px; height: 32px; flex-shrink: 0; }
.attention { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 10px; margin-bottom: 12px; animation: stripIn 200ms var(--e-enter); }
.attention__title { padding: 4px 2px 2px; color: var(--text-3); }
.attention__item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 0; --tone: var(--info); border-top: 1px solid var(--line); }
.attention__item:first-of-type { border-top: 0; }
.attention__item--danger { --tone: var(--danger); } .attention__item--warning { --tone: var(--warning); } .attention__item--info { --tone: var(--info); }
.attention__icon { color: var(--tone); flex-shrink: 0; }
.attention__text { flex: 1; min-width: 0; font: 500 13px/18px var(--font-ui); }
.attention__item--danger .attention__text { color: var(--danger); }
.attention__action { height: 32px; padding: 0 10px; font-size: 12px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.attention__dismiss { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-3); border-radius: var(--r-xs); flex-shrink: 0; }
.attention__more { display: block; width: 100%; padding: 8px 0 4px; text-align: center; font: 500 13px/18px var(--font-ui); color: var(--accent); }
.attention__item.is-removing { animation: fadeOut 160ms var(--e-exit) forwards; }

/* ============================================================ 11. room tiles & floors (§5.2.1) */
.tile { position: relative; display: block; width: var(--tile); height: var(--tile); flex-shrink: 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--text-2); contain: content; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; cursor: pointer; transition: background-color var(--t-short), border-color var(--t-short), opacity var(--t-short), transform var(--t-micro); }
.tile:active { transform: scale(.97); }
.tile--s { width: 44px; height: 44px; }
.tile--l { width: 88px; height: 88px; }
.tile__num { position: absolute; top: 5px; left: 8px; font: 700 14px/20px var(--font-ui); font-variant-numeric: tabular-nums; color: inherit; }
.tile--l .tile__num { font-size: 20px; line-height: 24px; }
.tile--s .tile__num { top: 2px; left: 5px; font-size: 12px; line-height: 16px; }
.tile__glyph { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; color: inherit; opacity: .85; }
.tile--l .tile__glyph { top: 8px; right: 8px; width: 16px; height: 16px; }
.tile__center { position: absolute; left: 6px; right: 6px; top: 50%; transform: translateY(-50%); text-align: center; font: 500 12px/16px var(--font-ui); color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile--l .tile__center { font-size: 13px; }
.tile__dots { position: absolute; left: 8px; bottom: 6px; font-size: 9px; line-height: 10px; letter-spacing: 2px; color: inherit; opacity: .9; }
.tile__door { position: absolute; right: 6px; bottom: 5px; width: 14px; height: 14px; color: var(--accent); }
.tile__corner { position: absolute; top: -1px; right: -1px; width: 0; height: 0; border-style: solid; border-width: 0 14px 14px 0; border-color: transparent var(--st-issue) transparent transparent; border-top-right-radius: var(--r-sm); }
.tile__ring { position: absolute; top: 1px; left: 3px; width: 28px; height: 28px; color: var(--st-cleaning); pointer-events: none; }
.tile__ring circle { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 3 3; animation: ringSpin 3s linear infinite; }
.tile--s .tile__ring { display: none; }
.tile--busy { background: var(--st-busy-bg); border-color: var(--st-busy-line); color: var(--st-busy-ink); box-shadow: inset 0 0 0 1px var(--st-busy-inset); }
.tile--dirty { background: var(--st-dirty-soft) repeating-linear-gradient(135deg, var(--st-dirty-hatch) 0 2px, transparent 2px 8px); box-shadow: inset 2px 0 0 var(--st-dirty); color: var(--text-1); }
.tile--dirty .tile__glyph { color: var(--st-dirty); opacity: 1; }
.tile--cleaning { background: var(--st-cleaning-soft); box-shadow: inset 2px 0 0 var(--st-cleaning); color: var(--text-1); }
.tile--cleaning .tile__glyph { color: var(--st-cleaning); opacity: 1; }
.tile--issue { border-color: var(--st-issue); }
.tile--arrival-ring { outline: 2px solid var(--warning); outline-offset: 0; }
.tile--selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile--dimmed { opacity: .28; }
.tile.is-stamp { animation: stamp 320ms var(--e-spring); }
.tile .tile__center.tone--warning { color: var(--warning); } .tile .tile__center.tone--danger { color: var(--danger); }
.tile:focus-visible { box-shadow: var(--focus-ring); }
.floor { margin-top: 12px; }
.floor__head { position: sticky; top: var(--sticky-top); z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px 0 6px; background: var(--bg-0); cursor: pointer; }
.floor__head .overline { flex: 1; color: var(--text-3); }
.floor__stats { font: 700 12px/16px var(--font-ui); color: var(--text-2); font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; }
.floor__chev { color: var(--text-3); transition: transform var(--t-short); }
.floor--collapsed .floor__chev { transform: rotate(-90deg); }
.floor--collapsed .floor__grid { display: none; }
.floor__grid { display: grid; grid-template-columns: repeat(auto-fill, var(--tile)); gap: 8px; content-visibility: auto; contain-intrinsic-size: auto 260px; }
.floor__grid--l { grid-template-columns: repeat(auto-fill, 88px); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 16px; font: 500 12px/16px var(--font-ui); color: var(--text-3); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); vertical-align: -2px; margin-right: 4px; }
.legend i.l-busy { background: var(--st-busy-bg); border-color: var(--st-busy-line); }
.legend i.l-dirty { background: var(--st-dirty-soft); border-color: var(--st-dirty); }
.legend i.l-cleaning { background: var(--st-cleaning-soft); border-color: var(--st-cleaning); border-style: dashed; }
.legend i.l-issue { border-color: var(--st-issue); }

/* ============================================================ 12. table */
.table__wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); box-shadow: var(--shadow-1); }
.table { width: 100%; border-collapse: collapse; font: 400 13px/18px var(--font-ui); }
.table th { position: sticky; top: 0; z-index: 2; background: var(--bg-2); text-align: left; font: 700 11px/14px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--text-1); }
.table th.is-sorted-asc::after { content: ' ↑'; } .table th.is-sorted-desc::after { content: ' ↓'; }
.table td { padding: 4px 12px; height: 40px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even) td { background: var(--bg-1); }
.table--dense td { height: 34px; padding: 2px 10px; }
.table tbody tr.is-row { cursor: pointer; }
@media (hover: hover) { .table tbody tr.is-row:hover td { background: var(--bg-3); } }
.table tr.is-selected td { background: var(--accent-soft) !important; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 700; }
.table__group td { height: 30px; background: var(--bg-1); font: 700 11px/14px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.table__empty td { height: 120px; text-align: center; color: var(--text-3); }
.table__more { padding: 8px; text-align: center; }
.cards { display: flex; flex-direction: column; }

/* ============================================================ 13. states: skeleton, empty, error */
.skel { display: block; background: var(--bg-3); border-radius: var(--r-sm); animation: skelPulse 1200ms ease-in-out infinite alternate; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton--text .skel { height: 14px; width: 60%; }
.skeleton--row .skel { height: 56px; }
.skeleton--card .skel { height: 120px; border-radius: var(--r-md); }
.skeleton--stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skeleton--stat .skel { height: 96px; border-radius: var(--r-lg); }
.skeleton--tile { display: grid; grid-template-columns: repeat(auto-fill, var(--tile)); gap: 8px; }
.skeleton--tile .skel { width: var(--tile); height: var(--tile); }
.skeleton--chart .skel { height: 180px; border-radius: var(--r-md); }
.skeleton--hero .skel { height: 150px; border-radius: var(--r-xl); }
.skel-fade { animation: fadeIn var(--t-short) var(--e-velvet); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 40px 24px; color: var(--text-2); }
.empty__well { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); color: var(--text-3); margin-bottom: 8px; }
.empty__title { font: 700 16px/22px var(--font-ui); color: var(--text-1); }
.empty__hint { font: 400 13px/18px var(--font-ui); color: var(--text-3); max-width: 320px; }
.empty__action { margin-top: 8px; }
.empty--compact { padding: 20px 16px; }
.empty--compact .empty__well { width: 48px; height: 48px; }
.error-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; text-align: center; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); color: var(--text-2); }
.error-panel__title { font: 700 14px/20px var(--font-ui); color: var(--text-1); }
.is-stale-content { opacity: .6; pointer-events: none; }
.quiet { color: var(--text-3); font: 400 13px/18px var(--font-ui); }

/* ============================================================ 14. overlays: sheet, modal, popover, action sheet, viewer */
.backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 50; background: var(--overlay); opacity: 0; transition: opacity 200ms var(--e-velvet); }
.backdrop.is-open { opacity: 1; }
.backdrop.is-closing { opacity: 0; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; display: flex; flex-direction: column; background: var(--bg-1); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); transform: translateY(100%); transition: transform var(--t-long) var(--e-enter); max-height: 92vh; max-height: 92dvh; touch-action: none; }
.sheet--full { height: 92vh; height: 92dvh; }
.sheet--half { height: 56vh; height: 56dvh; }
.sheet--auto { height: auto; }
.sheet.is-open { transform: translateY(0); }
.sheet.is-closing { transition: transform 200ms var(--e-exit); transform: translateY(100%); }
.sheet.is-dragging { transition: none; }
.sheet.is-grow { height: 92vh; height: 92dvh; }
.sheet__handle { flex-shrink: 0; width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 2px; }
.sheet__head { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 2px 6px 6px 16px; min-height: 48px; }
.sheet__title { flex: 1; min-width: 0; font: 700 16px/22px var(--font-ui); display: flex; align-items: center; gap: 8px; }
.sheet__back { margin-left: -8px; }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.sheet__foot { flex-shrink: 0; padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet__foot .btn { flex: 1; }
.sheet__step { animation: stepIn 200ms var(--e-enter); }
.sheet__step--back { animation: stepBack 200ms var(--e-enter); }
.fade-groups > * { animation: fadeUp6 200ms var(--e-enter) both; }
.fade-groups > *:nth-child(2) { animation-delay: 40ms; }
.fade-groups > *:nth-child(n+3) { animation-delay: 80ms; }
.modal-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 51; display: grid; place-items: center; padding: 24px; }
.modal { position: relative; width: min(var(--modal-w, 480px), 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); transform: scale(.97); opacity: 0; transition: transform var(--t-med) var(--e-enter), opacity var(--t-med) var(--e-enter); }
.modal.is-open { transform: none; opacity: 1; }
.modal.is-closing { transition-duration: 140ms; transform: scale(.97); opacity: 0; }
.modal--danger { border-color: var(--danger); }
.modal .sheet__head { padding: 14px 10px 8px 20px; }
.modal .sheet__body { padding: 0 20px 20px; }
.modal .sheet__foot { padding: 12px 20px 16px; justify-content: flex-end; }
.modal .sheet__foot .btn { flex: 0 0 auto; min-width: 120px; }
.popover { position: fixed; z-index: 60; min-width: 180px; max-width: min(420px, calc(100vw - 16px)); background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; opacity: 0; transform: translateY(-4px); transition: opacity var(--t-short) var(--e-velvet), transform var(--t-short) var(--e-velvet); }
.popover.is-open { opacity: 1; transform: none; }
.popover--tip { padding: 8px 10px; font: 500 12px/16px var(--font-ui); color: var(--text-2); min-width: 0; pointer-events: none; }
.popover--wide { width: 420px; max-height: 600px; display: flex; flex-direction: column; }
.popover__body { overflow: auto; flex: 1; min-height: 0; }
.popover__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); font: 500 14px/20px var(--font-ui); color: var(--text-1); text-align: left; white-space: nowrap; }
.popover__item .i { color: var(--text-2); }
.popover__item:hover, .popover__item:focus-visible { background: var(--bg-3); }
.popover__item--danger, .popover__item--danger .i { color: var(--danger); }
.popover__item[disabled] { opacity: .5; }
.popover__sep { height: 1px; background: var(--line); margin: 6px 4px; }
/* qidiruvda topilgan bo'lak / совпадение в результатах поиска (GM.find.mark, 25.09.2026) */
/* bitta xoch / один крестик очистки: у type=search браузер рисует свой, у поля — наш (25.09.2026) */
.search-field input[type=search]::-webkit-search-cancel-button, .search-field input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
mark.gm-m { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; font-weight: 700; }
.popover__head { padding: 8px 12px 6px; font: 500 12px/16px var(--font-ui); color: var(--text-3); }
.popover__title { padding: 6px 12px 4px; font: 700 14px/20px var(--font-ui); }
.action-sheet { padding-bottom: calc(8px + var(--safe-b)); }
.action-sheet__item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; font: 500 15px/20px var(--font-ui); text-align: left; border-top: 1px solid var(--line); }
.action-sheet__item .i { color: var(--text-2); }
.action-sheet__item:active { background: var(--bg-3); }
.action-sheet__item--danger, .action-sheet__item--danger .i { color: var(--danger); }
.action-sheet__item--accent .i { color: var(--accent); }
.action-sheet__cancel { margin: 8px 16px 0; width: calc(100% - 32px); }
.viewer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 80; background: var(--overlay); display: grid; place-items: center; overflow: auto; touch-action: pinch-zoom; animation: fadeIn var(--t-short); }
.viewer img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; touch-action: pinch-zoom; }
.viewer__close { position: absolute; top: calc(8px + var(--safe-t)); right: 8px; color: var(--text-1); background: var(--bg-1); border-radius: 50%; }
.viewer.is-closing { animation: fadeOut 160ms var(--e-exit) forwards; }
.confirm__text { font: 400 14px/20px var(--font-ui); color: var(--text-2); }
.confirm__text b { color: var(--text-1); }

/* ============================================================ 15. toast */
.toast { position: relative; pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); font: 500 13px/18px var(--font-ui); color: var(--text-1); transform: translateY(12px); opacity: 0; transition: transform 200ms var(--e-enter), opacity 200ms var(--e-enter); overflow: hidden; touch-action: pan-x; }
.toast.is-in { transform: none; opacity: 1; }
.toast.is-out { opacity: 0; transition: opacity 160ms var(--e-exit); }
.toast--success { border-color: var(--success); }
.toast--danger { border-color: var(--danger); }
.toast__icon { flex-shrink: 0; }
.toast--success .toast__icon { color: var(--success); } .toast--danger .toast__icon { color: var(--danger); } .toast--info .toast__icon { color: var(--accent); }
.toast__text { flex: 1; min-width: 0; }
.toast__text code { font-family: var(--font-mono); font-size: 12px; }
.toast__action { flex-shrink: 0; height: 32px; padding: 0 10px; border-radius: var(--r-xs); font: 700 13px/18px var(--font-ui); color: var(--accent); }
.toast__close { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-3); }
.toast__progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent-line); transform-origin: left; animation: toastProgress var(--toast-ms, 6000ms) linear forwards; }

/* ============================================================ 16. misc components */
.timeline { padding: 0 0 0 4px; }
.timeline__item { position: relative; padding: 0 0 12px 20px; font: 400 13px/18px var(--font-ui); }
.timeline__item::before { content: ''; position: absolute; left: 3px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { position: absolute; left: 0; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--text-3)); }
.timeline__time { color: var(--text-2); font-variant-numeric: tabular-nums; margin-right: 6px; }
.timeline__who { color: var(--text-2); }
.daystrip { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.daystrip::-webkit-scrollbar { display: none; }
/* kengligi cheklanmasin / не сжимать под экран — лента прокручивается (22.09.2026) */
.daystrip svg { display: block; height: 112px; max-width: none; }
.daystrip__label { font: 600 12px/14px var(--font-ui); fill: var(--text-2); }
.daystrip__count { font: 700 12px/14px var(--font-ui); fill: var(--text-1); }
.photo { position: relative; width: 96px; height: 96px; border-radius: var(--r-sm); background: var(--bg-3); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--text-3); cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo--failed { font: 500 11px/14px var(--font-ui); text-align: center; padding: 6px; cursor: default; }
.photo--loading .skel { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; border-radius: 0; }
.is-flash { position: relative; }
.is-flash::after { content: ''; position: absolute; top: -1px; right: -1px; bottom: -1px; left: -1px; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 1px var(--accent-line); pointer-events: none; animation: brassFlash 700ms linear forwards; }
.enter > * { animation: fadeUp6 200ms var(--e-enter) both; animation-delay: calc(min(var(--i, 0), 12) * 20ms); }
.is-scrolling .enter > * { animation: none; }
.is-new { animation: rowIn 200ms var(--e-enter); }
.is-removing { animation: fadeOut 160ms var(--e-exit) forwards; pointer-events: none; }
.kv { display: grid; grid-template-columns: minmax(96px, 40%) 1fr; gap: 6px 12px; font: 400 13px/18px var(--font-ui); }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { margin: 0; color: var(--text-1); word-break: break-word; }
.diag { font: 500 12px/18px var(--font-ui); color: var(--text-2); }
.diag b { color: var(--text-1); }
.callout { padding: 10px 12px; border-radius: var(--r-sm); font: 500 13px/18px var(--font-ui); }
.callout--warning { background: var(--warning-soft); color: var(--warning); }
.callout--danger { background: var(--danger-soft); color: var(--danger); }
.callout--info { background: var(--info-soft); color: var(--info); }
.callout--success { background: var(--success-soft); color: var(--success); }
.na-caption { font: 500 12px/16px var(--font-ui); color: var(--text-3); font-style: italic; }
.range-picker { display: flex; flex-direction: column; gap: 8px; }
.cal { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); padding: 8px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; font: 700 14px/20px var(--font-ui); padding: 4px 4px 8px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__wd { font: 500 11px/16px var(--font-ui); color: var(--text-3); text-align: center; text-transform: uppercase; padding-bottom: 4px; }
.cal__day { height: 40px; border-radius: var(--r-xs); font: 500 13px/18px var(--font-ui); text-align: center; color: var(--text-1); font-variant-numeric: tabular-nums; }
.cal__day:disabled { color: var(--text-3); opacity: .5; }
.cal__day.is-today { color: var(--accent); font-weight: 700; }
.cal__day.is-in { background: var(--accent-soft); border-radius: 0; }
.cal__day.is-start, .cal__day.is-end { background: var(--accent-fill); color: var(--accent-ink); border-radius: var(--r-xs); }
.cal__day.is-other { visibility: hidden; }
.cal--two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; background: transparent; }
.cal--two .cal { margin: 0; }
.month-list { display: flex; flex-direction: column; }
.month-list .row { min-height: 48px; }

/* ============================================================ 17. keyframes (§2.1) — transform / opacity only */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeUp8 { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp6 { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pushIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes stripIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes heldIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes inspectorIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes brassFlash { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: 0; } }
@keyframes stamp { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes pulseRing { from { transform: scale(1); opacity: .6; } to { transform: scale(2.4); opacity: 0; } }
@keyframes skelPulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes badgeBump { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes odometer { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ringSpin { to { stroke-dashoffset: -24; } }
@keyframes chartBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
html.theming * { transition: background-color var(--t-med), color var(--t-med), border-color var(--t-med) !important; }

/* ============================================================ 18. reduced motion (§2.2) */
html[data-motion="reduced"] .pulse::after, html[data-motion="reduced"] .live-pill i::after { animation: none; transform: scale(1.6); opacity: .5; }
html[data-motion="reduced"] .skel { animation: none; }
html[data-motion="reduced"] .tile.is-stamp { animation: none; }
html[data-motion="reduced"] .tile__ring circle { animation: none; }
html[data-motion="reduced"] .enter > *, html[data-motion="reduced"] .is-new, html[data-motion="reduced"] .sheet__step, html[data-motion="reduced"] .sheet__step--back, html[data-motion="reduced"] .fade-groups > * { animation: fadeIn 120ms both; }
html[data-motion="reduced"] .screen--enter-tab, html[data-motion="reduced"] .screen--enter-push, html[data-motion="reduced"] .screen--enter-pop, html[data-motion="reduced"] .screen--enter-desk { animation: fadeIn 120ms; }
html[data-motion="reduced"] .sheet { transform: none; opacity: 0; transition: opacity 120ms; }
html[data-motion="reduced"] .sheet.is-open { opacity: 1; }
html[data-motion="reduced"] .sheet.is-closing { opacity: 0; transform: none; }
html[data-motion="reduced"] .modal { transform: none; transition: opacity 120ms; }
html[data-motion="reduced"] .toast { transform: none; transition: opacity 120ms; }
html[data-motion="reduced"] .code-input.is-shake { animation: none; }
html[data-motion="reduced"] .is-flash::after { animation: brassFlash 120ms linear forwards; }
html[data-motion="reduced"] .chart-bar { animation: none !important; }
html[data-motion="reduced"] .chart-line { stroke-dashoffset: 0 !important; transition: none !important; }

/* ============================================================ 19. tablet 768–899: 2-column grids where screens define them */
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero__spark { display: block; }
}

/* ============================================================ 20. desktop ≥ 900 (§3.3) */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto; grid-template-rows: 60px minmax(0, 1fr); height: 100vh; height: 100dvh; min-height: 0; --sticky-top: 0px; overflow: hidden; }
  .app--sidebar-collapsed { grid-template-columns: var(--sidebar-w-min) minmax(0, 1fr) auto; }
  .app__lamp { position: absolute; }
  .topbar { position: relative; grid-row: 1; grid-column: 2; z-index: 10; padding-top: 0; border-bottom: 1px solid var(--line); background: var(--bg-1); }
  .topbar__inner { height: 60px; padding: 0 24px; gap: 12px; max-width: calc(var(--content-max) + 48px); margin: 0 auto; }
  .topbar__mono, .topbar__back--phone { display: none; }
  .topbar__title { padding-left: 0; }
  .topbar__search { display: block; width: 320px; flex-shrink: 1; }
  .topbar__search .input { height: 38px; font-size: 14px; }
  .topbar__search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 11px/16px var(--font-ui); color: var(--text-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; pointer-events: none; }
  .topbar__seg, .topbar__theme, .topbar__avatar { display: inline-flex; }
  .topbar__actions { gap: 4px; }
  .topbar__avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
  .sidebar { display: flex; flex-direction: column; grid-row: 1 / 3; grid-column: 1; z-index: 11; background: var(--bg-1); border-right: 1px solid var(--line); overflow: hidden; }
  .sidebar__brand { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 18px; color: var(--accent); flex-shrink: 0; overflow: hidden; }
  .sidebar__brand b { font: 600 18px/22px var(--font-display); color: var(--text-1); white-space: nowrap; }
  .sidebar__list { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; overflow: hidden auto; }
  .sidebar__item { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font: 500 14px/20px var(--font-ui); white-space: nowrap; transition: color var(--t-short), background-color var(--t-short); width: 100%; text-align: left; }
  .sidebar__item .i { color: inherit; flex-shrink: 0; }
  .sidebar__item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
  .sidebar__item:hover { color: var(--text-1); background: var(--bg-2); }
  .sidebar__item.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
  .sidebar__item .badge { margin-left: auto; }
  .sidebar__item kbd { font: 500 11px/16px var(--font-ui); color: var(--text-3); opacity: 0; }
  .sidebar__item:hover kbd { opacity: 1; }
  .sidebar__bar { position: absolute; left: 0; top: 8px; width: 3px; height: 40px; border-radius: 0 2px 2px 0; background: var(--accent); transition: transform 240ms var(--e-inout); will-change: transform; }
  .sidebar__sep { height: 1px; background: var(--line); margin: 6px 0; }
  .sidebar__foot { flex-shrink: 0; padding: 8px 12px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
  .sidebar__user { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px; border-radius: var(--r-sm); width: 100%; text-align: left; white-space: nowrap; overflow: hidden; }
  .sidebar__user:hover { background: var(--bg-2); }
  .sidebar__user .row__body { min-width: 0; }
  .sidebar__user .row__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .app--sidebar-collapsed .sidebar__item span, .app--sidebar-collapsed .sidebar__item kbd, .app--sidebar-collapsed .sidebar__brand b, .app--sidebar-collapsed .sidebar__user .row__body { display: none; }
  .app--sidebar-collapsed .sidebar__item { justify-content: center; padding: 0; }
  .app--sidebar-collapsed .sidebar__item .badge { position: absolute; top: 4px; right: 6px; margin: 0; }
  .app--sidebar-collapsed .sidebar__brand { justify-content: center; padding: 0; }
  .app--sidebar-collapsed .sidebar__user { justify-content: center; padding: 0; }
  #screen { grid-row: 2; grid-column: 2; min-height: 0; padding: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  .screen { max-width: var(--content-max); margin: 0 auto; padding: 24px; }
  .screen--out { top: 0; }
  .nav { display: none; }
  #inspector:not([hidden]) { display: flex; flex-direction: column; grid-row: 1 / 3; grid-column: 3; width: var(--inspector-w); min-height: 0; background: var(--bg-1); border-left: 1px solid var(--line); z-index: 12; animation: inspectorIn 200ms var(--e-enter); }
  .inspector__head { flex-shrink: 0; display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 8px 0 20px; border-bottom: 1px solid var(--line); }
  .inspector__title { flex: 1; min-width: 0; font: 700 16px/22px var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inspector__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; overscroll-behavior: contain; }
  .inspector__body.is-swap { animation: fadeIn 160ms var(--e-velvet); }
  #toasts { left: auto; right: 24px; bottom: 24px; width: 360px; }
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
  .stat-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card--hero { padding: 20px 24px; }
  .hero__spark { top: 24px; right: 24px; }
  .day-head, .floor__head { background: var(--bg-0); }
  .strip { position: sticky; top: 0; }
  .held-pill { top: 76px; }
  .tabs__item { padding: 12px 16px; }
  .sheet { display: none; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  #inspector:not([hidden]) { position: fixed; top: 0; right: 0; bottom: 0; grid-area: auto; z-index: 46; box-shadow: var(--shadow-3); }
}
@media (pointer: fine) and (min-width: 1024px) {
  @supports (backdrop-filter: blur(1px)) {
    .topbar { background: color-mix(in srgb, var(--bg-1) 86%, transparent); backdrop-filter: blur(12px) saturate(1.2); }
  }
}

/* ============================================================ 21. print base (§5.7.3 extends in money.css) */
@media print {
  .topbar, .nav, .sidebar, #inspector, #toasts, #layers, .app__lamp, .strip, .held-pill, .btn, .chips { display: none !important; }
  body, .app { background: white; color: black; }
  html, body { height: auto; overflow: visible; }
  .app { display: block; height: auto; overflow: visible; }
  #screen { padding: 0; overflow: visible; }
  .card { border-color: black; box-shadow: none; background: white; }
  .table__wrap, .card, table { page-break-inside: avoid; }
  a { color: black; text-decoration: none; }
}

/* ============================================================ 22. core-1 additions (js/core.js): bead nav (VIDEO-INSIGHTS §4), sidebar pill + seg spring (§5),
   login shell, More hub, not-available state, topbar extras. Tokens only. */
@property --bead-x { syntax: '<length>'; inherits: true; initial-value: 0px; }
.nav--bead { background: transparent; border-top: 0; --bead-x: 0px; transition: --bead-x 360ms cubic-bezier(.2, .8, .2, 1); }
.nav__bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: var(--bg-1); border-top: 1px solid var(--line); pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 20px at var(--bead-x) -2px, transparent 19.5px, var(--text-1) 20.5px); mask-image: radial-gradient(circle 20px at var(--bead-x) -2px, transparent 19.5px, var(--text-1) 20.5px); }
.nav--no-bead .nav__bg { -webkit-mask-image: none; mask-image: none; }
.nav--no-bead .nav__bead { opacity: 0; }
.nav__bead { position: absolute; top: -16px; left: 0; width: 28px; height: 28px; border-radius: 50%; z-index: 2; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 35% 30%, var(--accent-strong), var(--accent) 55%, var(--accent-fill-active) 100%);
  box-shadow: 0 0 14px 3px var(--bead-glow), 0 2px 4px var(--bg-0); transition: transform 360ms cubic-bezier(.2, .8, .2, 1), opacity var(--t-short); will-change: transform; }
.nav__bead i { position: absolute; top: 4px; right: 4px; bottom: 4px; left: 4px; inset: 4px; border-radius: 50%; border: 1px solid var(--accent-strong); opacity: .55; }
.nav__bead:active { cursor: grabbing; }
.nav--instant, .nav--instant .nav__bead, .nav--instant .nav__item .i { transition: none !important; }
.nav--bead .nav__item { z-index: 1; padding-top: 10px; gap: 2px; }
.nav--bead .nav__item .i { transition: transform 360ms cubic-bezier(.2, .8, .2, 1), color var(--t-short); }
.nav--bead .nav__item.is-active .i { transform: translateY(-2px); }
.nav--bead .nav__label { opacity: 0; transform: translateY(4px); transition: opacity var(--t-short), transform var(--t-short); }
.nav--bead .nav__item.is-active .nav__label { opacity: 1; transform: none; }
.nav--bead .nav__badge { top: 7px; }
html[data-motion="reduced"] .nav--bead, html[data-motion="reduced"] .nav__bead, html[data-motion="reduced"] .nav--bead .nav__item .i { transition: none; }
@media (prefers-reduced-motion: reduce) { .nav--bead, .nav__bead, .nav--bead .nav__item .i { transition: none; } }

/* segmented: sliding pill with the springy curve (VIDEO §5); brass text on the active option */
.seg__thumb { background: var(--bg-3); border: 1px solid var(--line-strong); box-shadow: none; transition: transform 320ms cubic-bezier(.34, 1.2, .64, 1), width 320ms cubic-bezier(.34, 1.2, .64, 1), opacity var(--t-short); }
.seg__opt.is-active { color: var(--accent); }
.seg--icons .seg__opt { padding: 0 10px; }
.seg--sm .seg__thumb { border-radius: 6px; }
html[data-motion="reduced"] .seg__thumb { transition: opacity var(--t-short); }

/* top bar extras */
.topbar__back { margin-left: -2px; }
.topbar--pushed .topbar__mono { display: none; }
.topbar__pill:empty { display: none; }
.topbar__search .search-field kbd { display: none; }
.ui-stub { display: none; }
.topbar__seg, .topbar__theme, .topbar__avatar { display: none; } /* phone: ≤ 2 icon targets (§3.2); .seg would otherwise win over app.css */
@media (min-width: 900px) {
  .topbar__seg { display: inline-flex; }
  .topbar__theme { display: inline-grid; justify-content: center; }
  .topbar__avatar { display: grid; }
  .topbar__search .search-field kbd { display: block; }
  .topbar__search .search-field > .i { top: 50%; }
  .topbar__search-btn { display: none; }
  /* sidebar: sliding active pill instead of a static highlight */
  .sidebar__pill { position: absolute; left: 12px; right: 12px; top: 8px; height: 40px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px solid var(--line-strong); pointer-events: none; z-index: 0;
    transition: transform 320ms cubic-bezier(.34, 1.2, .64, 1), height 200ms var(--e-inout); will-change: transform; }
  .sidebar__pill .sidebar__bar { top: 0; left: -12px; height: 100%; border-radius: 0 2px 2px 0; transition: none; }
  .sidebar__pill.is-instant { transition: none; }
  .sidebar__item { z-index: 1; }
  .sidebar__item.is-active { background: transparent; }
  .sidebar__item.is-active--static { background: var(--accent-soft); }
  .sidebar__collapse { color: var(--text-3); }
  .sidebar__collapse .i { transform: rotate(180deg); }
  .app--sidebar-collapsed .sidebar__collapse .i { transform: none; }
  html[data-motion="reduced"] .sidebar__pill { transition: none; }
}

/* login shell: no chrome, full canvas */
.app--login .topbar, .app--login .nav, .app--login .sidebar, .app--login #inspector { display: none !important; }
.app--login #screen { padding: 0; }
.app--login .screen--fullscreen { padding: 0; }
@media (min-width: 900px) {
  /* 16.10.2026: документ не прокручивается — вход на компьютере прокручивает сам #screen (низкое окно) */
  .app--login { display: block; height: 100%; min-height: 0; overflow: hidden; }
  .app--login #screen { height: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; }
  .app--login .screen { max-width: none; margin: 0; padding: 0; }
}

/* More hub (core) */
.more__prefs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.more__pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.more__list { padding: 0 10px; margin-bottom: 12px; }
.more__list .row__icon { color: var(--text-2); display: inline-grid; place-items: center; width: 32px; height: 32px; }
.more__list .row__right { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-3); }
.more__user { display: flex; align-items: center; gap: 12px; }
.more__user .row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.more__user .row__body .role-chip { align-self: flex-start; }
.more__version { text-align: center; margin-top: 16px; color: var(--text-3); }

/* screen module missing: designed "not available yet" state */
.empty--na { min-height: 50vh; }
.empty--na .empty__well { box-shadow: var(--shadow-2); }

/* ============================================================ 23. live-1 additions (js/live.js): reconnecting pill state, offline strip host */
.live-pill--reconnecting i { background: var(--warning); animation: livePillBlink 1200ms ease-in-out infinite; }
.live-pill--reconnecting { color: var(--text-2); }
@keyframes livePillBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
html[data-motion="reduced"] .live-pill--reconnecting i, html.paused .live-pill--reconnecting i { animation: none; opacity: .6; }
#live-strip { margin: 0; }
#live-strip svg { flex-shrink: 0; }

/* ============================================================ 23. ui.js additions (js/ui.js part 2): scroll lock, small helpers. Tokens only. */
html.has-overlay, html.has-overlay body { overflow: hidden; }
.well--40 { width: 40px; height: 40px; font-size: 20px; }
.stepper__unit { padding: 0 10px; color: var(--text-2); white-space: nowrap; }
.form__foot { margin-top: 8px; }
.row.is-selected { background: var(--accent-soft); }
.row.is-disabled { opacity: .5; pointer-events: none; }
.sheet--menu .sheet__body, .modal.sheet--menu .sheet__body { padding: 0; }
.field__counter { margin-left: auto; font-variant-numeric: tabular-nums; }
.sheet__title:empty { display: none; }
.person__call { width: 40px; height: 40px; }
.table__summary td { color: var(--text-2); text-transform: none; letter-spacing: 0; font: 700 12px/16px var(--font-ui); }
.cards-wrap .table__more { padding-top: 12px; }
.action-sheet__item[disabled] { opacity: .5; }
.stat__value { flex-wrap: wrap; row-gap: 0; }

/* Direktor chipi / чип директора — корона рядом с подписью (владелец, 17.09) */
.role-chip--boss { border-color: var(--accent); color: var(--accent); }
.role-chip .i { width: 14px; height: 14px; }

/* Faqat toj / только корона, без подписи — полный доступ, но не хозяин отеля (17.09) */
.role-chip--crown { border-color: var(--accent); color: var(--accent); padding: 0 5px; }

/* xodim qo'ng'irog'i / список сообщений персоналу (повар: колокольчик, 22.09.2026) */
.notes { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }
.note { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); font: 400 14px/20px var(--font-ui); color: var(--text-1); }
.note small { display: block; color: var(--text-3); font: 500 11px/14px var(--font-ui); margin-bottom: 4px; }
.note--new { border-color: var(--accent); background: var(--accent-soft); }

/* ============================================================ Оформление / Ko‘rinish — лист выбора темы (16.10.2026)
   Один лист на «Ещё», вход и кнопку в шапке (core.js skinSheet). Только токены темы; цвета образцов (.skin-chip) ставит
   JS из skin.js — это данные. Без gap во flex (Chrome 80 у повара): отступы через margin; в .skin-chip — grid gap (есть с Chrome 66). */
.skin-hint { margin: 0 0 12px; color: var(--text-3); }
.skin-demo { margin: 0 0 12px; padding: 12px; border-radius: var(--r-md); background: var(--bg-0); border: 1px solid var(--line); }
.skin-demo__card { display: flex; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.skin-demo__emoji { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: 12px; border-radius: 12px; background: var(--bg-3); font-size: 22px; line-height: 1; }
.skin-demo__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.skin-demo__name { font: 700 15px/20px var(--font-ui); color: var(--text-1); }
.skin-demo__cap { font: 500 12px/16px var(--font-ui); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-demo__btn { flex: none; margin-left: 10px; padding: 0 14px; height: 32px; border-radius: var(--r-sm); background: var(--accent-fill); color: var(--accent-ink); font: 700 13px/32px var(--font-ui); white-space: nowrap; }
.skin-list { display: flex; flex-direction: column; }
.skin-opt { display: flex; align-items: center; width: 100%; min-height: 60px; margin: 0 0 8px; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); color: var(--text-1); text-align: left; transition: background-color var(--t-short), border-color var(--t-short), box-shadow var(--t-short); }
.skin-opt:last-child { margin-bottom: 0; }
.skin-opt:active { background: var(--bg-3); }
.skin-opt.is-on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.skin-opt:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.skin-opt__text { flex: 1; min-width: 0; display: flex; flex-direction: column; margin: 0 10px 0 12px; }
.skin-opt__name { font: 700 15px/20px var(--font-ui); color: var(--text-1); }
.skin-opt__note { margin-top: 2px; font: 500 12px/16px var(--font-ui); color: var(--text-3); }
.skin-opt__check { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: opacity var(--t-short), transform var(--t-short) var(--e-spring); }
.skin-opt.is-on .skin-opt__check { opacity: 1; transform: none; }
.skin-chip { flex: none; display: grid; grid-template-columns: 10px 10px; grid-template-rows: 10px 10px; grid-gap: 5px; gap: 5px; align-content: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); }
.skin-chip > i { display: block; width: 10px; height: 10px; border-radius: 50%; }
.skin-chip--sm { width: 28px; height: 28px; border-radius: 9px; grid-template-columns: 7px 7px; grid-template-rows: 7px 7px; grid-gap: 3px; gap: 3px; }
.skin-chip--sm > i { width: 7px; height: 7px; }
.skin-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 12px 0 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font: 600 13px/1 var(--font-ui); cursor: pointer; }
.skin-btn .skin-chip { margin-right: 8px; }
.mo-skin { display: inline-flex; align-items: center; }
.mo-skin .skin-chip { margin-right: 4px; }
@media (prefers-reduced-motion: reduce) { .skin-opt, .skin-opt__check { transition: none; } }
html[data-motion="reduced"] .skin-opt, html[data-motion="reduced"] .skin-opt__check { transition: none; }
