/* =====================================================================
   «Бизнес контроль» — тема в стиле «Куда сходить»: белый фон, коралловый
   акцент, плотные светлые карточки с чёткими краями, заголовки — Unbounded.
   Стекло — только в шапке и в окнах.
   Контраст (WCAG AA): белый текст — только на тёмно-коралловой заливке
   (--accent-fill #c4471a — 4,9:1; градиент --g-accent-fill), коралловый текст
   на белом — --accent-ink #b8400f (5,0:1). Светлый коралл #ff7f50 — только
   для иконок, рамок и бледных плашек (с белым текстом он даёт 2,5:1).
   ===================================================================== */
:root {
  color-scheme: light;
  --accent: #ff7f50;
  --accent-ink: #b8400f;          /* коралловый текст на белом */
  --accent-soft: #fff0e9;         /* бледная плашка */
  --accent-line: #ffd6c6;         /* светлая коралловая рамка */
  --accent-fill: #c4471a;         /* заливка под белым текстом */
  --accent-fill-hover: #ad3c0d;
  --g-accent: linear-gradient(135deg, #ffa07a 0%, #ff7f50 50%, #f2643a 100%);
  --g-accent-fill: linear-gradient(135deg, #d0531f 0%, #c84a1a 50%, #ad3c0d 100%);
  --ink: #15120e;
  --ink-2: #3b362f;
  --muted: #6e6c68;
  --line: #ececea;
  --line-strong: #dddcd8;
  --surface-2: #f6f6f5;
  --danger: #c42b1c;
  --danger-soft: #fdecea;
  --warn: #b7790f;
  --warn-soft: #fff1cf;
  --warn-ink: #8f5a00;            /* жёлтый текст: 5,8:1 на белом, 5,2:1 на --warn-soft */
  --ok: #12875a;
  --radius: 26px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --shadow-hover: 0 2px 4px rgba(30, 20, 10, .04), 0 12px 30px rgba(30, 20, 10, .09);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  /* прежние имена — используются во встроенных стилях в public/js, не удалять */
  --mint: var(--accent);
  --mint-3: var(--accent-ink);
  --mint-soft: var(--accent-soft);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #ffffff; }
html { overflow-x: clip; }   /* шапка шириной 100vw не создаёт горизонтальной прокрутки */
body {
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

.app { max-width: 1120px; margin: 0 auto; padding: 16px 16px calc(60px + env(safe-area-inset-bottom)); }

/* ---------- шапка: на всю ширину экрана, стекло; учитывает вырез сверху (режим приложения) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
  margin: 0 calc(50% - 50vw) 18px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, 3vw) 10px;
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; font-weight: 800; font-size: 18px; }
.brand-logo { height: 26px; width: auto; flex: none; display: block; }
.brand-title { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; }
.topbar .brand-title { overflow: hidden; text-overflow: ellipsis; }
.topbar .who { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.25; }
.topbar .who b { color: var(--ink); display: block; font-size: 14px; }
.topbar:has(.point-switch) .who, .topbar:has(.point-switch) #logout { margin-left: 0; }

/* переключатель точки (владелец) */
.point-switch {
  display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-strong); background: #fff; border-radius: 14px;
  padding: 8px 12px; font-weight: 800; cursor: pointer; max-width: 46vw; transition: transform .15s, background .15s;
}
.point-switch:hover { background: var(--accent-soft); }
.point-switch:active { transform: scale(.95); }
.point-switch svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.point-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.point-switch b { color: var(--accent-ink); }
.topbar .point-switch { margin-left: auto; flex: 0 1 auto; min-width: 0; padding: 6px 11px; gap: 6px; font-size: 13.5px; border-radius: 12px; }
.topbar .point-switch svg { width: 16px; height: 16px; }

@media (max-width: 640px) { .topbar:has(.point-switch) .who { display: none; } }
@media (max-width: 520px) {
  .topbar .brand { font-size: 16px; }
  .topbar .who { font-size: 0; }
  .topbar .who b { font-size: 13px; }
  .brand-logo { height: 22px; }
  .brand-title { font-size: 14px; }
}
/* телефон: логотип, точка и выход помещаются без вылезания за экран */
@media (max-width: 460px) {
  .topbar { gap: 8px; }
  .topbar .brand { gap: 8px; }
  .brand-title { font-size: 13px; }
  .topbar .point-switch { max-width: 118px; padding: 5px 9px; font-size: 12.5px; gap: 4px; }
  .topbar .point-switch svg { display: none; }
  .topbar #logout { margin-left: auto; flex: none; width: 36px; height: 36px; }
}

/* ---------- заголовок страницы ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 24px; font-weight: 700; flex: 1; min-width: 160px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff;
  border-radius: 999px; padding: 8px 14px 8px 10px; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer;
  transition: transform .15s, background .15s;
}
.back:hover { border-color: var(--ink-2); }
.back:active { transform: scale(.95); }
/* телефон: заголовок вкладки меньше, кнопки в одном ряду с ним */
@media (max-width: 520px) {
  .page-head { flex-wrap: nowrap; gap: 8px; }
  .page-head h1 { font-size: 20px; min-width: 0; white-space: nowrap; overflow: hidden; }
  .page-head .back { flex: none; padding: 7px 12px 7px 9px; font-size: 13px; }
  .page-head .icon-btn { width: 40px; height: 40px; border-radius: 13px; flex: none; }
  .page-head .icon-btn svg { width: 20px; height: 20px; }
  .page-head > .btn { flex: none; padding: 9px 12px; font-size: 13px; }
}

/* ---------- плитки меню: белая плашка, коралловая иконка, чёрная подпись ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: min(640px, 78vh); margin: 0 auto; }
.tile {
  position: relative; overflow: hidden; aspect-ratio: 1 / 1; border: 0; cursor: pointer; text-align: left;
  border-radius: var(--radius); padding: 16px; color: #f0592a; background: #fff;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .18s cubic-bezier(.3,.7,.4,1.4), box-shadow .2s, filter .2s;
  user-select: none;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-hover); }
.tile:active { transform: scale(.93); filter: brightness(.96); }
.tile svg { width: 38px; height: 38px; stroke: var(--accent); }
.tile .t-name { font-weight: 800; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.tile .dot { position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: #f0592a; box-shadow: 0 0 0 3px rgba(240, 89, 42, .18); }

.ripple {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .4); transform: scale(0);
  animation: ripple .55s ease-out forwards; pointer-events: none;
}
.tile .ripple, .btn.light .ripple { background: rgba(255, 127, 80, .18); }
.tiles.sections .tile.active .ripple { background: rgba(255, 127, 80, .22); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

@media (max-width: 520px) {
  .tiles { gap: 10px; }
  .tile { padding: 12px; border-radius: 18px; }
  .tile svg { width: 30px; height: 30px; }
  .tile .t-name { font-size: 13px; }
}

/* разделы внутри вкладок: компактные кнопки, иконка и текст в один ряд; активный — бледно-коралловый */
.tiles.sections { display: flex; flex-wrap: wrap; gap: 10px; max-width: none; margin: 0 0 20px; }
.tiles.sections .tile {
  flex: 0 0 auto; aspect-ratio: auto; min-height: 0; width: auto;
  flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 12px 20px 12px 16px; border-radius: 16px;
}
.tiles.sections .tile:hover { transform: translateY(-2px); }
.tiles.sections .tile svg { width: 22px; height: 22px; flex: none; }
.tiles.sections .tile .t-name { font-size: 15px; white-space: nowrap; }
.tiles.sections .tile:not(.active) { color: var(--ink); }
.tiles.sections .tile.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 127, 80, .14); }
.tiles.sections .tile.active:hover { background: #ffe7dc; box-shadow: inset 0 0 0 1px rgba(255, 127, 80, .28), 0 10px 24px -12px rgba(255, 127, 80, .45); }
.tiles.sections .tile.active svg { stroke: #f0592a; }
@media (max-width: 520px) {
  .tiles.sections { gap: 8px; }
  .tiles.sections .tile { padding: 10px 14px 10px 12px; border-radius: 14px; }
  .tiles.sections .tile svg { width: 20px; height: 20px; }
  .tiles.sections .tile .t-name { font-size: 14px; }
}

/* главное меню и кубики владельца: на ПК — ровно по центру экрана и чуть крупнее */
@media (min-width: 761px) {
  :root { --top-h: 93px; }   /* высота шапки с отступом под ней */
  .tiles.menu-tiles { gap: 16px; }
  .menu-tiles .tile { padding: 20px; }
  .menu-tiles .tile svg { width: 44px; height: 44px; }
  .menu-tiles .t-name { font-size: 18px; }
  .menu-tiles .ow-cube.wide .t-name { font-size: 20px; }
  /* страница с меню занимает весь экран; содержимое центрируется в нём */
  .app:has(.menu-tiles) { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 0; }
  .app:has(.menu-tiles) > #view {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding-bottom: var(--top-h);   /* компенсирует шапку — центр совпадает с центром экрана */
  }
  .app:has(.ow-tiles) > #view { padding-bottom: 16px; }
  /* меню КТ и сотрудника: ширина = 3 плитки, высота рядов не больше свободной высоты экрана */
  #view > .tiles.menu-tiles:not(.ow-tiles) { width: 100%; margin: 0 auto;
    max-width: min(880px, calc((100dvh - 190px - (var(--rows, 3) - 1) * 16px) / var(--rows, 3) * 3 + 32px)); }
  /* сводка владельца помещается на экран: ширина сетки ≈ высота экрана − 330px */
  #view > .tiles.ow-tiles.menu-tiles { width: 100%; max-width: clamp(600px, calc(100dvh - 330px), 880px); margin-left: auto; margin-right: auto; }
}
/* телефон: меню — прямоугольные кнопки в один столбец, от шапки до низа экрана */
@media (max-width: 760px) {
  .app:has(.menu-tiles) { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .app:has(.menu-tiles) > #view { flex: 1; display: flex; flex-direction: column; }
  #view > .tiles.menu-tiles {
    flex: 1; max-width: none; width: 100%;
    grid-template-columns: 1fr; grid-auto-rows: minmax(56px, 1fr); gap: 10px;
  }
  .tiles.menu-tiles .tile, .tiles.menu-tiles .tile.ow-cube, .tiles.menu-tiles .tile.ow-cube.wide {
    aspect-ratio: auto; min-height: 56px; grid-column: auto;
    flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 0 18px;
    border-radius: 18px;
  }
  .tiles.menu-tiles .tile svg { width: 28px; height: 28px; flex: none; }
  .tiles.menu-tiles .tile .t-name, .tiles.menu-tiles .ow-cube.wide .t-name { font-size: 16px; }
  .tiles.menu-tiles .tile .dot { top: 50%; right: 18px; transform: translateY(-50%); }
}

/* ---------- кнопки ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 800; cursor: pointer; white-space: nowrap;
  background: var(--accent-fill); color: #fff; box-shadow: 0 6px 16px rgba(255, 127, 80, .32);
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-fill-hover); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.dark { background: var(--ink); box-shadow: 0 6px 16px rgba(21, 18, 14, .18); }
.btn.dark:hover { background: #2b2620; }
.btn.light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.light:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--ink-2); }
.btn.danger { background: var(--danger); box-shadow: 0 6px 16px rgba(196, 43, 28, .25); }
.btn.danger.light { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; white-space: normal; text-align: center; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn {
  position: relative; width: 46px; height: 46px; border-radius: 15px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent-fill); color: #fff; box-shadow: 0 6px 16px rgba(255, 127, 80, .32); transition: transform .15s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.ghost { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); width: 38px; height: 38px; border-radius: 12px; }
.icon-btn.ghost svg { width: 19px; height: 19px; }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
/* select/textarea: селектор с тегом сильнее :focus-visible — у них рамки фокуса нет, только подсветка поля */
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 11px 14px; background: #fff; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #c9c6c0; }
.input:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 1.5px var(--accent-ink); }
textarea.input { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1; min-width: 140px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar.list-actions { margin: -4px 0 14px; }   /* кнопка добавления — отдельной строкой прямо над списком */
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 42px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:active { transform: scale(.95); }

/* ---------- карточки: плотные светлые поверхности ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card.click:active { transform: scale(.97); }
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; }
.card .big { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 2px; }
.card.mint { background: var(--g-accent-fill); border: 0; color: #fff; box-shadow: 0 10px 26px rgba(255, 127, 80, .3); }
.card.mint .sub { color: rgba(255, 255, 255, .88); }
.card.dark { background: var(--ink); border: 0; color: #fff; }
.card.dark .sub { color: rgba(255, 255, 255, .7); }
.card.warn { border-color: #f3dca2; background: var(--warn-soft); }
.card.done { opacity: .65; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none;
  background: var(--g-accent-fill); margin-bottom: 12px;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-ink);
}
.badge.gray { background: var(--surface-2); color: var(--muted); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.dark { background: var(--ink); color: #fff; }
.pos-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid rgba(0,0,0,.18); flex: none; }
.online { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px rgba(18, 135, 90, .18); flex: none; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); }
.note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--warn-soft); color: #7a4f06; font-weight: 600; margin-bottom: 16px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.section-title { font-size: 18px; font-weight: 800; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }

/* ---------- списки ---------- */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .title { font-weight: 700; }
.li .sub { color: var(--muted); font-size: 13.5px; }
.li .right { text-align: right; font-weight: 700; min-width: 0; flex: 0 1 auto; max-width: 50%; }
.li.click { cursor: pointer; transition: background .12s; }
.li.click:hover { background: #faf9f7; }
.amount-in { color: var(--ok); }
.amount-out { color: var(--danger); }

/* ---------- таблица графика ---------- */
.sched-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 70vh; box-shadow: var(--shadow); }
table.sched { border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 100%; }
.sched th, .sched td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; padding: 0; }
.sched thead th { position: sticky; top: 0; background: #fff; z-index: 2; font-weight: 800; padding: 10px 0 8px; min-width: 46px; }
.sched thead th small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.sched thead th.we small { color: var(--danger); }
.sched th.emp, .sched td.emp { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 10px 14px; min-width: 210px; max-width: 240px; }
.sched thead th.emp { z-index: 3; color: var(--muted); font-weight: 700; }
.sched td.emp .n { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sched td.emp .p { color: var(--muted); font-size: 12.5px; padding-left: 20px; }
.sched td.cell { height: 54px; cursor: pointer; transition: background .12s; }
.sched td.cell:hover { background: var(--accent-soft); }
.sched td.cell.we { background: #faf9f7; }
.sched td.cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.sched td.cell .shift { display: grid; place-items: center; width: 100%; height: 54px; font-weight: 800; font-size: 14px; }
.sched td.tot { padding: 0 12px; font-weight: 800; white-space: nowrap; background: var(--surface-2); }
.sched th.tot { background: var(--surface-2); padding: 10px 12px; }
.sched.readonly td.cell { cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 4px 0 16px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .pos-dot { width: 20px; height: 20px; border-radius: 6px; }

/* ---------- окна (стекло) и уведомления ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(18, 12, 6, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s ease;
}
.modal {
  background: rgba(255, 255, 255, .96); width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; overflow: auto; border-radius: 28px; padding: 22px;
  box-shadow: 0 24px 70px rgba(20, 12, 4, .28), 0 0 0 1px rgba(255, 255, 255, .4) inset; animation: pop .26s cubic-bezier(.2,.9,.3,1.25);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.modal-head h2 { flex: 1; font-family: var(--display); font-size: 19px; font-weight: 700; }
.modal-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.modal-foot .btn { flex: 1 1 auto; white-space: normal; text-align: center; }
@media (max-width: 520px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 28px 28px 0 0; max-height: 94vh; max-height: 94dvh; animation: up .28s cubic-bezier(.2,.9,.3,1);
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }
@keyframes up { from { transform: translateY(100%); } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(21, 18, 14, .92); color: #fff; padding: 12px 20px;
  border-radius: 14px; font-weight: 600; z-index: 80; animation: pop .2s ease; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 90vw;
}
.toast.err { background: var(--danger); }

.pass-btn {
  width: 100%; border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent-ink); border-radius: 16px; padding: 14px;
  font-size: 22px; font-weight: 800; letter-spacing: .12em; cursor: pointer; font-family: var(--display);
  transition: transform .15s;
}
.pass-btn:active { transform: scale(.96); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin-bottom: 16px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.files { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.file a { flex: 1; font-weight: 600; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file svg { width: 18px; height: 18px; color: var(--accent); flex: none; }

.check-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.check-item .input { flex: 1; }
.check-list { list-style: none; padding: 0; margin: 10px 0 0; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 14px; }
.check-list li::before { content: ''; width: 15px; height: 15px; border-radius: 5px; border: 1.5px solid var(--accent); flex: none; margin-top: 3px; }
.card.mint .check-list li::before { border-color: #fff; }

/* ---------- мессенджер ---------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 170px); height: calc(100dvh - 170px); min-height: 460px; }
.chat-side { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-side .search { margin: 12px; min-width: 0; flex: none; }
.chat-list { overflow: auto; flex: 1; }
.chat-group { padding: 10px 16px 4px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px 16px; cursor: pointer; transition: background .12s; }
.chat-item.active { background: var(--accent-soft); }
.chat-item:hover { background: #faf9f7; }
.chat-item .avatar { width: 38px; height: 38px; border-radius: 12px; margin: 0; font-size: 14px; }
.chat-item .grow { flex: 1; min-width: 0; }
.chat-item .title { font-weight: 700; font-size: 14.5px; }
.chat-item .last { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { background: var(--accent-fill); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 8px; }
.chat-main { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.chat-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #faf9f7; }
.msg { max-width: 78%; align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 9px 13px; }
.msg.mine { align-self: flex-end; background: var(--accent-fill); color: #fff; border: 0; border-radius: 18px 18px 6px 18px; }
.msg .from { font-size: 12px; font-weight: 800; color: var(--accent-ink); margin-bottom: 2px; }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.msg .time { font-size: 11px; opacity: .7; margin-top: 4px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.msg .del { background: none; border: 0; color: inherit; cursor: pointer; opacity: .85; padding: 6px 4px; margin: -6px -4px; min-height: 24px; text-decoration: underline; font-size: 11px; }   /* зона нажатия ≥ 24 px */
.msg .att { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 7px 10px; border-radius: 12px; background: rgba(0,0,0,.06); color: inherit; text-decoration: none; font-weight: 600; font-size: 13px; }
.msg.mine .att { background: rgba(255,255,255,.2); }
.msg .att svg { width: 16px; height: 16px; }
.msg .link-btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 12px; padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer; background: var(--accent-soft); color: var(--accent-ink); }
.msg.mine .link-btn { background: #fff; }
.msg .link-btn svg { width: 15px; height: 15px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; }
.chat-attach { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px; }
.chat-attach:empty { display: none; }
.chat-attach .badge { padding: 5px 10px; }
.chat-attach .badge button { border: 0; background: none; cursor: pointer; padding: 4px 6px 4px 8px; margin: -4px -6px -4px -4px; min-width: 24px; min-height: 24px; font-weight: 800; color: inherit; }
.chat-back { display: none; }
@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 150px); height: calc(100dvh - 150px); }
  .chat-layout.open .chat-side { display: none; }
  .chat-layout:not(.open) .chat-main { display: none; }
  .chat-back { display: grid; }
}

/* ---------- полоски и прогресс ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 100px; gap: 10px; align-items: center; font-size: 14px; }
.bar-row .bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 6px; background: var(--g-accent); }
.bar-row .v { text-align: right; font-weight: 700; }
.stock { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.stock i { display: block; height: 100%; background: var(--g-accent); border-radius: 4px; }
.card.warn .stock i { background: #f0a630; }
.bar i.grow, .stock i.grow { width: 0; animation: owBar .9s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes owBar { to { width: var(--w); } }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--g-accent); border-radius: 4px; transition: width .3s; }
.card.mint .progress { background: rgba(255, 255, 255, .3); }
.card.mint .progress i { background: #fff; }

/* лимит точек */
.limit-line { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 6px; }
.limit-line b { font-size: 14px; }
.limit-bar { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; max-width: 320px; }
.limit-bar i { display: block; height: 100%; border-radius: 4px; background: var(--g-accent); transition: width .4s; }
.limit-line.over b, .limit-line.over .limit-bar i { color: var(--danger); background: var(--danger); }
.limit-line.over b { background: none; }
.limit-line.full .limit-bar i { background: #f0a630; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .input { width: 90px; text-align: center; font-weight: 800; font-size: 17px; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-box {
  width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 28px; border: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(30, 20, 10, .04), 0 18px 50px rgba(30, 20, 10, .1);
}
.auth-box h1 { font-family: var(--display); font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.auth-brand img { width: auto; height: 34px; flex: none; }
.auth-brand span { font-family: var(--display); font-weight: 700; font-size: clamp(17px, 5.2vw, 22px); color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.auth-tabs { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 18px 0; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(30, 20, 10, .05), 0 0 0 1px var(--line); }

/* ---------- сотрудник: контроль времени ---------- */
.clock { text-align: center; padding: 26px; }
.clock .time { font-family: var(--display); font-size: 54px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- печать отчёта ---------- */
#print-root { display: none; }
@media print {
  body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  .pr-page { page-break-after: always; break-after: page; padding: 0; }
  .pr-page:last-child { page-break-after: auto; break-after: auto; }
  @page { size: A4; margin: 14mm; }
}
.pr-page { font-family: var(--font); color: #111; font-size: 11.5pt; }
.pr-page h1 { font-size: 18pt; margin-bottom: 4px; }
.pr-page .pr-sub { color: #555; margin-bottom: 14px; }
.pr-page table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 10pt; }
.pr-page th, .pr-page td { border: 1px solid var(--line-strong); padding: 5px 7px; text-align: left; }
.pr-page th { background: var(--accent-soft); }
.pr-page .pr-tot { display: flex; gap: 20px; margin: 8px 0 14px; font-weight: 700; flex-wrap: wrap; }

/* ---------- календарь «График план» ---------- */
.emp-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.emp-chip {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; border-radius: 16px; padding: 9px 12px; min-width: 170px;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.emp-chip:active { transform: scale(.95); }
.emp-chip b { display: block; font-size: 14px; }
.emp-chip small { display: block; color: var(--muted); font-size: 12px; }
.emp-chip .n { margin-left: auto; min-width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--surface-2); color: var(--muted); }
.emp-chip.has { background: var(--g-accent-fill); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(255, 127, 80, .25); }
.emp-chip.has small { color: rgba(255,255,255,.85); }
.emp-chip.has .n { background: rgba(255,255,255,.25); color: #fff; }
.emp-chip.has .pos-dot { border-color: #fff; }
.emp-chip.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--ink); }

.cal { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 30px; padding: 22px; max-width: 620px; margin: 0 auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h2 { font-family: var(--display); font-size: 26px; font-weight: 700; }
.cal-who { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: -4px 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-wd { background: var(--surface-2); border-radius: 10px; text-align: center; padding: 8px 0; font-weight: 700; color: var(--muted); font-size: 14px; }
.cal-day {
  position: relative; aspect-ratio: 1; border: 2px solid transparent; border-radius: 16px; background: none; cursor: pointer;
  display: grid; place-items: center; font-size: 20px; font-weight: 500; color: var(--ink); padding: 0;
  transition: transform .15s, background .15s;
}
.cal-day:hover { background: #faf9f7; }
.cal-day:active { transform: scale(.9); }
.cal-day.out { background: #fbfaf9; cursor: default; }
.cal-day.we .num { color: var(--danger); }
.cal-day .cnt {
  position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 5px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink);
}
.cal-day .cnt svg, .cnt-demo svg { width: 11px; height: 11px; stroke-width: 2.4; }
.cal-day .lbl { font-size: 9.5px; font-weight: 800; color: var(--accent-ink); letter-spacing: -.02em; }
.cal-day.busy { background: var(--accent-soft); }
.cal-day.shift { background: var(--accent-soft); border-color: var(--accent); font-weight: 800; }
.cal-day.came { background: var(--g-accent-fill); font-weight: 800; }
.cal-day.came .num, .cal-day.came .lbl { color: #fff; }
.cal-day.came .cnt { background: rgba(255, 255, 255, .3); color: #fff; }
.cal-day.busy .cnt { background: var(--accent-fill); color: #fff; }
.cal-day.missed { border: 2px dashed var(--danger); font-weight: 800; }
.cal-day.today { box-shadow: inset 0 0 0 2.5px var(--ink); }
.cal-day.shift.today, .cal-day.came.today, .cal-day.missed.today { box-shadow: 0 0 0 2.5px var(--ink); }
.cal-foot { text-align: center; color: var(--muted); margin-top: 18px; font-size: 16px; line-height: 1.7; }
.cal-foot b { color: var(--accent-ink); font-family: var(--display); font-weight: 800; }
.cal-legend .lg { width: 20px; height: 20px; border-radius: 6px; display: inline-block; border: 2px solid transparent; }
.cal-legend .lg.shift { background: var(--accent-soft); border-color: var(--accent); }
.cal-legend .lg.came { background: var(--g-accent); }
.cal-legend .lg.missed { border: 2px dashed var(--danger); }
.cal-legend .lg.today { border: 2.5px solid var(--ink); }
.cnt-demo { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; padding: 3px 5px; border-radius: 7px; background: var(--accent-fill); color: #fff; }
@media (max-width: 520px) {
  .cal { padding: 14px 10px; border-radius: 22px; }
  .cal-grid { gap: 4px; }
  .cal-day { font-size: 15px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1; }
  .cal-day .cnt { position: static; padding: 2px 4px; font-size: 9.5px; border-radius: 5px; }
  .cal-day .cnt svg { width: 9px; height: 9px; }
  .cal-head h2 { font-size: 21px; }
  .cal-wd { font-size: 12px; }
  .emp-chip { min-width: 0; flex: 1 1 calc(50% - 4px); max-width: calc(50% - 4px); padding: 9px 10px; gap: 8px; }
  .emp-chip > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
  .emp-chip b { font-size: 13px; }
}

/* ---------- «График факт» вертикально (телефон) ---------- */
.fact-vert { display: none; }
@media (max-width: 760px) {
  .fact-wide { display: none; }
  .fact-vert { display: block; }
}
.fv-block { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; overflow: hidden; }
.fv-sum { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.fv-sum:last-child { border-bottom: 0; }
.fv-sum .grow, .fv-line .grow { flex: 1; min-width: 0; }
.fv-sum b, .fv-line b { display: block; font-size: 14px; }
.fv-sum small, .fv-line small { display: block; color: var(--muted); font-size: 12px; }
.fv-num { text-align: right; min-width: 58px; }
.fv-num b { font-size: 15px; font-weight: 800; color: var(--accent-ink); }
.fv-num i { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12px; }
.fv-hint { color: var(--muted); font-size: 12.5px; margin: 8px 4px 16px; }
.fv-days { display: flex; flex-direction: column; gap: 8px; }
.fv-day { display: flex; gap: 10px; align-items: stretch; }
.fv-date {
  flex: none; width: 52px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 8px 0; line-height: 1.1;
}
.fv-date b { font-size: 19px; font-weight: 800; }
.fv-date small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fv-date.we b, .fv-date.we small { color: var(--danger); }
.fv-day.today .fv-date { background: var(--ink); }
.fv-day.today .fv-date b, .fv-day.today .fv-date small { color: #fff; }
.fv-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fv-line {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 14px;
  border: 1.5px solid var(--accent-line); background: #fff; cursor: pointer; transition: transform .15s;
}
button.fv-line:active { transform: scale(.97); }
.fv-line.planned { background: #faf9f7; border-color: var(--line); cursor: default; }
.fv-line.missed { border: 1.5px dashed var(--danger); cursor: default; }
.fv-h { font-weight: 800; font-size: 13.5px; color: var(--accent-ink); white-space: nowrap; }
.fv-h.on { background: var(--accent-fill); color: #fff; padding: 3px 8px; border-radius: 8px; font-size: 12px; }
.fv-empty { color: var(--muted); font-size: 13px; padding: 10px 4px; display: flex; align-items: center; min-height: 42px; }

/* ---------- версия сотрудника ---------- */
.emp-app { max-width: 520px; }
@media (min-width: 761px) { .emp-app { max-width: 920px; } }
.emp-app .tiles { max-width: none; }
.emp-app .cal { padding: 14px 10px; border-radius: 22px; }
.emp-app .cal-grid { gap: 4px; }
.emp-app .cal-day { font-size: 15px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1; }
.emp-app .cal-head h2 { font-size: 21px; }
.emp-app .cal-wd { font-size: 12px; }
.chk-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 16px;
  border: 1.5px solid var(--line); background: #fff; margin-bottom: 8px; cursor: pointer; font-size: 15px; transition: transform .15s, background .15s;
}
.chk-item:active { transform: scale(.97); }
.chk-item .box { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--accent); flex: none; display: grid; place-items: center; color: #fff; }
.chk-item .box svg { width: 17px; height: 17px; stroke-width: 3; opacity: 0; }
.chk-item.on { background: var(--accent-soft); border-color: var(--accent-line); }
.chk-item.on .box { background: var(--accent); border-color: var(--accent); }
.chk-item.on .box svg { opacity: 1; }
.chk-item.on span:last-child { color: var(--muted); text-decoration: line-through; }
.chk-item[disabled] { cursor: default; }
.cam { position: relative; border-radius: 22px; overflow: hidden; background: var(--ink); aspect-ratio: 3 / 4; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.cam .stamp { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.shot { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; transform: scaleX(-1); border: 2px solid var(--accent-line); }
.tl { display: flex; flex-direction: column; gap: 0; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-row .t { font-weight: 800; font-size: 17px; min-width: 58px; }

/* ---------- кабинет владельца ---------- */
.ow-period { margin: -4px 0 16px; }
.ow-tiles .ow-cube {
  gap: 6px; opacity: 0;
  animation: owIn .5s cubic-bezier(.2, .8, .3, 1) forwards; animation-delay: calc(var(--i) * 50ms);
}
.ow-tiles .ow-cube:not(.wide) { aspect-ratio: 1 / 1; min-height: 0; justify-content: space-between; padding: 16px; }
.ow-tiles .ow-cube.wide { grid-column: 1 / -1; aspect-ratio: auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; min-height: 88px; }
@keyframes owIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.ow-ring circle:last-child { animation: owRing 1.2s cubic-bezier(.2,.8,.3,1) forwards; stroke-dashoffset: var(--c); }
@keyframes owRing { to { stroke-dashoffset: var(--off); } }
.ow-detail .bar-row { grid-template-columns: minmax(90px, 160px) 1fr auto; }
.ow-detail .bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ow-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ow-stat { background: var(--accent-soft); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ow-stat b { font-family: var(--display); font-size: min(21px, 11cqw); font-weight: 700; letter-spacing: -.02em; color: var(--accent-ink); }
.ow-stat span { font-size: 12.5px; color: var(--muted); }
.ow-stat.bad { background: var(--danger-soft); }
.ow-stat.bad b { color: var(--danger); }
.ow-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.ow-big { font-family: var(--display); font-size: 54px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.ow-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ow-donut svg { flex: none; animation: owSpin .9s cubic-bezier(.2,.8,.3,1); }
@keyframes owSpin { from { transform: rotate(-120deg) scale(.6); opacity: 0; } }
.ow-legend { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 8px; }
.ow-legend div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ow-legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.ow-legend span { flex: 1; }
.ow-cols { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 8px; }
.ow-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.ow-col .cb { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.ow-col .cb i { display: block; width: 100%; height: 0; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #ffa07a, #f2643a); animation: owCol .9s cubic-bezier(.2,.8,.3,1) forwards; }
.ow-col:last-child .cb i { background: linear-gradient(180deg, #3b362f, #15120e); }
@keyframes owCol { to { height: var(--h); } }
.ow-col .cv { font-size: 12px; font-weight: 800; color: var(--accent-ink); }
.ow-col .cl { font-size: 12px; color: var(--muted); }
/* «уменьшить движение» в системе: анимации и переходы во всём приложении мгновенные, сдвиги при нажатии отключены */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .ripple { display: none; }
  .tile:hover, .tile:active, .card.click:hover, .card.click:active, .btn:active, .icon-btn:active, .chip:active, .back:active,
  .point-switch:active, .cal-day:active, .emp-chip:active, .chk-item:active, button.fv-line:active, .pass-btn:active, .tiles.sections .tile:hover { transform: none; }
}

/* ---------- суммы и подписи — всегда в одну строку; при нехватке места мельче шрифт (fitText в core.js) ---------- */
.ow-stat, .kpi-row .card { container-type: inline-size; min-width: 0; overflow: hidden; }
.kpi-row .card .big { font-size: min(30px, 12.5cqw); }
.ow-stat b, .card .big, .ow-big, .bar-row .v, .amount-in, .amount-out, .cal-foot b, .fv-num b { white-space: nowrap; }
.li .title, .li .right > div, .li .right, .card h3, .chat-item .title, .fv-line b, .fv-sum b, .emp-chip b,
.bar-row > span:first-child, .bar-row .v, .sched td.emp .n, .cal-who, .limit-line b {
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}

/* ---------- режим приложения (добавлено на экран «Домой») ---------- */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }          /* без «резинки» за край — как у приложения */
}

/* ---------- фокус и доступность ---------- */
/* фокус с клавиатуры: сплошная тёмно-коралловая рамка (контраст 5:1 к белому) */
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
/* окно получает фокус целиком (для клавиатуры и чтения экрана) — рамка вокруг всего окна не нужна */
.modal:focus { outline: none; }
/* текст только для программ чтения экрана */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
