/* Лама и Джо — фирменное оформление графика смен (палитра и шрифты сайта lamaijo.ru).
   Приложение всегда тёмное, как сайт и гостевое приложение: тема Telegram его не перекрашивает. */
@font-face { font-family: "Red Keds"; src: url("assets/fonts/RedKeds.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Lena"; src: url("assets/fonts/Lena.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("assets/fonts/Gilroy-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("assets/fonts/Gilroy-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("assets/fonts/Gilroy-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("assets/fonts/Gilroy-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  color-scheme: dark;
  /* бренд */
  --ink: #232322;
  --coral: #f28d6c;
  --red: #cc4829;
  --grey-l: #cbcaca;
  --f-display: "Red Keds", "Lena", Impact, sans-serif;
  --f-head: "Lena", "Gilroy", system-ui, sans-serif;
  --f-body: "Gilroy", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* роли интерфейса */
  --bg: var(--ink);
  --text: #ffffff;
  --hint: #a9a7a3;
  --link: var(--coral);
  --accent: var(--coral);
  --accent-text: var(--ink);
  --card: #2e2e2c;
  --line: rgba(255, 255, 255, .12);
  /* --ok/--warn/--bad — для полос, рамок и подложек; *-text — для надписей; --bad-fill — заливка под белый текст */
  --ok: #5cc48c;
  --warn: #f2c063;
  --bad: #ff6f59;
  --ok-text: #7fd6a6;
  --warn-text: #f5c873;
  --bad-text: #ff8a76;
  --bad-fill: var(--red);
  --r: 16px;
  --nav-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 var(--f-body);
}
h1 { font-size: 22px; margin: 0; letter-spacing: -0.2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
b { font-weight: 650; }
a { color: var(--link); text-decoration: none; }
.muted { color: var(--hint); }
.small { font-size: 13px; }
.block { display: block; width: 100%; }
.grow { flex: 1 1 0; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.center { align-items: center; }
.spaced { margin-top: 18px; }
[hidden] { display: none !important; }

#app { max-width: 600px; margin: 0 auto; min-height: 100vh; }
.view { padding: 14px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
.top { padding: 4px 0 10px; display: flex; flex-direction: column; gap: 4px; }
.section-title { margin: 18px 0 8px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .5px; color: var(--hint); }

.splash { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-screen { padding: 22vh 28px 0; text-align: center; }
.big-icon { font-size: 56px; margin-bottom: 8px; }

/* ----- кнопки и поля ----- */
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; background: var(--accent); color: var(--accent-text);
  font-weight: 600; min-height: 44px; transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
/* кнопка, пока идёт запрос (withBusy в ui.js): рядом с текстом крутится значок */
.btn.is-busy { opacity: .75; }
.btn.is-busy::after { content: ''; display: inline-block; width: 13px; height: 13px; margin-left: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
/* окно сотрудника, пока сохраняется изменение: остальные кнопки и галочки не нажимаются */
.sheet-body.is-saving button { pointer-events: none; }
.sheet-body.is-saving .btn, .sheet-body.is-saving .toggle { opacity: .6; }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: var(--card); color: var(--text); }
.btn.danger { background: var(--bad-fill); color: #fff; }
.btn.danger-ghost { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-text); }
.icon-btn {
  border: 0; background: var(--card); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; line-height: 1;
  display: grid; place-items: center; flex: none;
}
.icon-btn.danger { color: var(--bad-text); }
.icon-btn.trash { color: var(--bad-text); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.icon-btn.trash.big { width: 48px; height: 48px; }
.icon-btn.copy { width: 34px; height: 34px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.copy-val { gap: 8px; flex: none; }   /* значение + значок «скопировать»: не сжимается, подпись слева переносится */
.point-row { margin-bottom: 8px; }
.points-edit { margin-top: 14px; }
.points-edit .btn.block { margin-top: 4px; }
.sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; position: sticky; bottom: -1px; padding: 10px 0 2px; background: var(--bg); }
.sheet-actions .btn { min-width: 150px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid transparent;
  background: var(--card); outline: none; appearance: none; -webkit-appearance: none;
}
.input:focus { border-color: var(--accent); }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%), linear-gradient(135deg, var(--hint) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.addr-select { font-size: 20px; font-weight: 650; background-color: transparent; padding-left: 0; }
.field { display: block; margin: 12px 0 0; }
.field-label { display: block; font-size: 13px; color: var(--hint); margin: 0 0 6px 2px; font-weight: 600; }
.hint { display: block; font-size: 13px; color: var(--hint); margin: 6px 2px 0; }
.hint.warn { color: var(--warn-text); }
.error { margin-top: 12px; padding: 10px 12px; border-radius: 12px; color: var(--bad-text); background: color-mix(in srgb, var(--bad) 12%, transparent); font-size: 14px; }

/* ----- неделя ----- */
.weekbar { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.weeklabel { flex: 1; text-align: center; font-weight: 650; }
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  border: 0; background: var(--card); border-radius: 12px; padding: 8px 0 6px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; min-height: 62px;
}
.day .wd { font-size: 12px; color: var(--hint); }
.day .dn { font-size: 17px; font-weight: 650; }
.day .dots { height: 6px; display: flex; align-items: center; }
.day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--hint); }
.day .dots i.mine { background: var(--accent); }
.day.today .dn { color: var(--accent); }
.day.sel { background: var(--accent); }
.day.sel .wd, .day.sel .dn { color: var(--accent-text); }
.day.sel .dots i { background: var(--accent-text); }

/* ----- таймлайн ----- */
.timeline { margin: 4px 0 14px; padding: 10px 10px 8px 0; background: var(--card); border-radius: var(--r); overflow: hidden; }
.tl-row { display: flex; align-items: center; min-height: 36px; }
.tl-label { width: 62px; flex: none; padding: 0 8px 0 12px; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-axis, .tl-track { position: relative; flex: 1; height: 32px; }
.tl-axis { height: 18px; }
.tl-axis span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--hint); top: 0; }
.tl-track { margin: 2px 0; }
.tl-track .grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-track .now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); border-radius: 1px; z-index: 2; }
.timeline.single .tl-label { display: none; }
.timeline.single { padding-left: 14px; }
.bar {
  position: absolute; top: 3px; bottom: 3px; border: 0; border-radius: 8px; padding: 0 6px; min-width: 6px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: #1a1d21; text-align: left; z-index: 1;
  background: var(--warn);
}
.bar.confirmed { background: var(--ok); }
.bar.declined { background: repeating-linear-gradient(135deg, var(--bad) 0 6px, color-mix(in srgb, var(--bad) 70%, #000) 6px 12px); opacity: .75; }
.bar.mine { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ----- карточки ----- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list.tight { gap: 6px; margin-bottom: 10px; }
.card { background: var(--card); border-radius: var(--r); padding: 12px 14px; }
.card.shift { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border-left: 4px solid var(--warn); cursor: pointer; }
.card.shift.confirmed { border-left-color: var(--ok); }
.card.shift.declined { border-left-color: var(--bad); opacity: .8; }
.card.shift.mine { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.card.shift .time { display: flex; flex-direction: column; min-width: 92px; }
.card.shift .time b { font-size: 17px; font-variant-numeric: tabular-nums; }
.card.shift .who { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-actions { grid-column: 1 / -1; }
.card-actions:empty { display: none; }
.name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.name.big { font-size: 18px; }
.person { color: inherit; font-weight: 600; }
.you, .tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text); }
.tag { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border: 0; }
.btn-chip { padding: 7px 12px; font-size: 14px; background: var(--card); color: var(--text); }
.btn-chip.on { background: var(--accent); color: var(--accent-text); }
.filters, .presets { margin: 10px 0; }
.badge { font-size: 12px; font-weight: 650; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.planned { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn-text); }
.badge.confirmed { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-text); }
.badge.declined { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-text); }
/* аватарка: спокойная подложка в тон кнопок и тёмная (в тёмной теме — светлая) буква того же оттенка */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none;
  background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: color-mix(in srgb, var(--accent) 65%, var(--text)); }
.card.req, .card.person-row, .card.addr-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card.person-row, .card.addr-row { cursor: pointer; }
.card.addr-row { align-items: flex-start; }
.card.addr-row .grow { display: flex; flex-direction: column; gap: 5px; }
.chev { color: var(--hint); font-size: 22px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0; }
.stat { background: var(--card); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; }
.stat b { font-size: clamp(17px, 5.4vw, 22px); }   /* «36 ч 30 мин» должно помещаться и на узком экране */
.stat span { color: var(--hint); font-size: 13px; }

.segmented { position: relative; display: flex; background: var(--card); padding: 3px; border-radius: 12px; margin-bottom: 12px; }
.segmented button { position: relative; z-index: 1; flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 10px; font-weight: 600; color: var(--hint); transition: color .22s; }
.segmented button.on { color: var(--text); }
.segmented .seg-ind {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 10px;
  background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.14); pointer-events: none;
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
}

.empty { text-align: center; padding: 34px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 6px; }
.empty p { margin: 4px 0 0; }

/* ----- навигация и кнопка действия ----- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
}
.nav-item { flex: 1; max-width: 200px; border: 0; background: transparent; color: var(--hint); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; font-weight: 600; }
.nav-item.active { color: var(--accent); }
.nav-ico { position: relative; display: grid; }
.dot { position: absolute; top: -6px; right: -14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }
.fab {
  position: fixed; right: max(16px, calc(50% - 284px)); bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 15;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 650; padding: 14px 20px 14px 14px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.fab .plus { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 20px; line-height: 1; }

/* ----- шторки ----- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.overlay.open { background: rgba(0,0,0,.45); }
.sheet {
  width: 100%; max-width: 600px; max-height: 92vh; background: var(--bg); border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.overlay.open .sheet { transform: none; }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 4px; }
.sheet-title { font-size: 19px; font-weight: 700; }
.sheet-body { padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sticky-actions { margin-top: 16px; }
.detail { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.detail-time { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv > span:first-child { color: var(--hint); }

.hours + .field-label { margin-top: 14px; }
.field + .btn.block, .list + .row, .btn.block + .field-label { margin-top: 12px; }
.hours { margin: 6px 2px 0; font-size: 14px; color: var(--hint); min-height: 20px; }
.hours.bad, .hint.bad { color: var(--bad-text); }
.hours b { color: var(--text); font-weight: 700; }
.hours-limit { margin-top: 2px; font-size: 13px; }
.spaced-label { margin-top: 14px; }
/* блок «Свой интервал» плавно раскрывается под переключателем */
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .32s cubic-bezier(.4, 0, .2, 1), opacity .22s ease, visibility 0s linear .32s; }
.reveal.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
.reveal-in { min-height: 0; overflow: hidden; }
.reveal-in > .pk { padding-bottom: 2px; }
.shift-mode { margin-bottom: 0; }
.spaced-sm { margin-top: 8px; }
textarea.input { min-height: 76px; resize: vertical; font: inherit; line-height: 1.35; }

/* ----- штрафы ----- */
.fines-filter { margin: 0 0 10px; }
.fines-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 0; }
.fines-sum > div { display: flex; flex-direction: column; }
.fines-sum b { font-size: 24px; font-variant-numeric: tabular-nums; }
.card.fine-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; border-left: 4px solid var(--bad); }
.card.fine-row .fine-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.card.fine-row .fine-comment { font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.fine-row.canceled { opacity: .55; border-left-color: var(--hint); }
.card.fine-row.canceled .fine-amount { text-decoration: line-through; }
.fine-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--bad-text); }
.fine-amount .badge { text-decoration: none; }
.fines-card { display: flex; align-items: center; gap: 12px; margin: 8px 0; cursor: pointer; border-left: 4px solid var(--bad); }
.quick-dates { margin-top: 8px; }
/* ----- зарплата ----- */
.minus { color: var(--bad-text); }
.plus { color: var(--ok-text); }
.premium-card { border-left-color: var(--ok); }
.prem-amount { width: 112px; flex: none; text-align: right; }
.prem-row { display: flex; align-items: center; gap: 8px; }
.prem-row .toggle { flex: 1; min-width: 0; }
.profile-screen { padding: 28px 16px 40px; max-width: 520px; margin: 0 auto; }
.profile-screen h1 { margin: 0 0 6px; }
.period-label { margin: 2px 2px 10px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.rate-row { display: flex; gap: 10px; }
.rate-row .field { flex: 1; min-width: 0; margin-top: 8px; }
.point-card { margin: 0 0 12px; padding: 10px; border-radius: var(--r); background: color-mix(in srgb, var(--card) 70%, transparent); border: 1.5px solid var(--line); }
.point-card .point-row { margin-bottom: 0; }
.card.rate-addr { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.card.rate-addr.multi { display: block; padding: 0; cursor: default; }
.rate-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rate-chev { display: grid; color: var(--hint); transition: transform .26s cubic-bezier(.4, 0, .2, 1); }
.rate-addr.open .rate-chev { transform: rotate(180deg); }
.rate-points { margin: 0 14px 6px; border-top: 1px solid var(--line); }
.rate-point { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rate-point:first-child { border-top: 0; }
.warn-box { margin-top: 12px; padding: 10px 12px; border-radius: 12px; color: var(--warn-text); background: color-mix(in srgb, var(--warn) 12%, transparent); font-size: 14px; }
.warn-box .small { margin-top: 4px; }
.seg-sm button { font-size: 13px; padding-left: 2px; padding-right: 2px; }
.card.pay-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.pay-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.pay-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-badges:empty { display: none; }
.pay-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-card { border-left-color: var(--ok); }
.card.pay-group { display: flex; align-items: center; gap: 12px; }
.pay-lines { display: flex; flex-direction: column; }
.pay-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pay-line:first-child { border-top: 0; }
.pay-line > b.wrap { max-width: 52%; text-align: right; }
/* ----- выбор нескольких дней в календарике формы смены (провести пальцем по дням) ----- */
.pk-cal-grid.can-range { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pk-cal-grid .pk-day.in-range { background: color-mix(in srgb, var(--accent) 42%, transparent); color: var(--accent-text); border-radius: 8px; box-shadow: none; opacity: 1; }
.pk-cal-grid .pk-day.in-range.range-end { background: var(--accent); }
.pk-cal-hint { margin: 8px 2px 2px; font-size: 12px; color: var(--hint); text-align: center; }
.days-wrap { margin-top: 10px; }
.day-chips { margin-top: 2px; }
.day-chips .chip { min-width: 52px; justify-content: center; }
.center-hint { text-align: center; margin-top: 14px; }

/* ----- удаление смены смахиванием ----- */
.swipe { position: relative; border-radius: var(--r); overflow: hidden; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 20px;
  border-radius: var(--r); background: color-mix(in srgb, var(--bad) 55%, var(--card)); color: #fff; font-weight: 700; opacity: 0;
  transition: opacity .15s ease, background-color .15s ease; }
.swipe.swiping .swipe-bg, .swipe.armed .swipe-bg { opacity: 1; }
.swipe.armed .swipe-bg { background: var(--bad-fill); }
.swipe > .card { position: relative; touch-action: pan-y; }
/* «Мои смены»: смены одного дня не слипаются */
.view > .card.shift.my, .view > .swipe { margin-bottom: 8px; }
.swipe.removing { height: 0 !important; opacity: 0; overflow: hidden; margin-top: -8px; transition: height .26s ease, opacity .2s ease, margin .26s ease; }
@media (prefers-reduced-motion: reduce) { .swipe > .card { transition: none !important; } }

/* раскрывающийся блок со стрелкой (collapsible) */
.card.fold { display: block; padding: 0; margin: 8px 0; }
.fold-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fold-head > b { white-space: nowrap; }
.fold-chev { display: grid; color: var(--hint); transition: transform .26s cubic-bezier(.4, 0, .2, 1); }
.fold.open .fold-chev { transform: rotate(180deg); }
.fold-body { padding: 0 14px 10px; border-top: 1px solid var(--line); }
.fold-body .pay-lines { margin: 0; }
.shelf-tasks .section-title:first-child { margin-top: 2px; }
/* парсер Озона: строки «Возвраты» / «Ozon полка» в списке точек и блоки в окне точки */
.oz-lines { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 14px; }
.oz-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; }
.oz-line > :last-child { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.oz-ok { color: var(--ok-text); }
.oz-block { margin-top: 12px; }
.oz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.oz-right { flex: 0 1 auto; max-width: 55%; text-align: right; white-space: normal; font-variant-numeric: tabular-nums; font-weight: 600; }
.fold-head > b.oz-right { white-space: normal; }   /* в заголовке блока числа переносятся, а не наезжают на стрелку */
.oz-stack { display: flex; flex-direction: column; align-items: flex-end; }
.oz-stack > span { white-space: nowrap; }
.oz-note { margin: 6px 0 0; }
/* позиция в списке «что сейчас»: нажатие — «В исключения»; список исключений с поиском */
.pay-line.oz-item { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pay-line.oz-item:first-child { border-top: 0; }
.pay-line.oz-item:active { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.mg-choice.oz-exc { display: flex; width: 100%; margin-top: 8px; justify-content: space-between; }
.mg-choice.oz-exc .chev { color: var(--hint); }
.oz-search { margin-bottom: 10px; }
.oz-empty { margin: 12px 0; text-align: center; }
.oz-comment { margin-top: 3px; overflow-wrap: anywhere; }
/* окно во весь экран (список исключений): та же шторка, но на всю высоту, без скруглений и «ручки» */
.sheet.full { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
.sheet.full > .sheet-grip { display: none; }
.sheet.full > .sheet-body { flex: 1 1 auto; min-height: 0; }
.oz-exc-top { position: sticky; top: -4px; z-index: 1; background: var(--bg); padding: 4px 0 2px; }
/* действия внизу окна точки: заголовок и пояснение, что из этого выйдет */
.oz-action { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 12px 14px; border: 0; border-radius: 14px;
  background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.oz-action:active { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.oz-action b { display: block; font-weight: 600; }
.oz-action.danger b { color: var(--bad-text); }
.oz-action-sub { display: block; margin-top: 3px; line-height: 1.35; }
.oz-action .chev { flex: none; color: var(--hint); }
.fold-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.fold-row:first-child { border-top: 0; }
.pay-details { margin: 10px 0; }
.pay-details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--accent); }
.pay-totals { margin: 14px 0 6px; padding: 4px 14px; border-radius: var(--r); background: var(--card); }
.pay-totals .kv:first-child, .pay-summary .kv:first-child { border-top: 0; }
.kv.total { font-size: 18px; }
.kv.total b { font-size: 20px; }
.card.pay-summary { margin: 4px 0 12px; padding-top: 4px; }
.card.pending-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-left: 4px solid var(--warn); }
.card.pending-row .row { margin-left: auto; }
.spaced-badge { margin-left: 8px; vertical-align: middle; }
.point-picker { display: flex; flex-direction: column; gap: 8px; }
.point-item { display: flex; flex-direction: column; gap: 6px; }
.pt-time { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 0 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-custom { color: var(--accent); font-weight: 700; }
/* «+7» и поле ввода в одной рамке; номер начинается сразу после кода, без лишнего пробела */
.phone-field { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid transparent; background: var(--card); }
.phone-field:focus-within { border-color: var(--accent); }
.phone-field .phone-code { font-weight: 600; margin-right: 6px; }
.phone-field .input { flex: 1; min-width: 0; padding: 10px 0; border: 0; border-radius: 0; background: transparent; }
.link-btn { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 0; cursor: pointer; }
.pick, .toggle {
  display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid transparent; background: var(--card);
  padding: 11px 12px; border-radius: 12px; min-height: 48px; width: 100%;
}
.pick.on, .toggle.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.pick:disabled { opacity: .55; cursor: not-allowed; }
.pick .pick-name { font-weight: 650; flex: 1; }
.pick .pick-note { font-size: 12px; color: var(--warn-text); }
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 14px; font-weight: 800; color: var(--accent-text); }
.pick.on .check, .toggle.on .check { background: var(--accent); border-color: var(--accent); }
.toggle-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* ----- возвраты Озон: окно подключения компьютера ----- */
.pair-code { font-size: 34px; font-weight: 800; letter-spacing: 4px; text-align: center; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.pair-code.done { letter-spacing: 0; color: var(--ok-text, var(--accent)); }
.steps-list { margin: 14px 0 4px; padding-left: 20px; color: var(--muted); }
.steps-list li { margin: 4px 0; }

/* ----- уведомления ----- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top)); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #20252c; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90%; opacity: 0; transform: translateY(-8px); transition: .22s; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--bad-fill); }

/* ----- график: адрес, дни, месяц ----- */
.addr-card {
  margin: 4px 0 12px; padding: 12px 16px; border-radius: var(--r); background: var(--card);
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  display: flex; flex-direction: column; gap: 2px;
}
.addr-card h1 { margin: 0; }
.addr-card .addr-select { min-height: 34px; padding-right: 36px; background-position: calc(100% - 6px) 50%, calc(100% - 1px) 50%; }
.view-switch { margin: 0 0 8px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.day { position: relative; min-height: 58px; padding: 4px 0; }
.day .ar { height: 11px; line-height: 11px; font-size: 9px; color: var(--accent); }
.day.sel .ar { color: var(--accent-text); }
.day.free { background: color-mix(in srgb, var(--ok) 30%, var(--card)); }
.day.free.sel { background: var(--accent); box-shadow: inset 0 0 0 3px var(--ok); }
.day.past { opacity: .45; }
.mwd { text-align: center; font-size: 12px; color: var(--hint); padding-bottom: 2px; }
.legend { display: flex; gap: 18px; margin: 10px 2px 0; font-size: 12px; color: var(--hint); }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; background: var(--card); border: 1px solid var(--line); display: inline-block; }
.lg.free { background: color-mix(in srgb, var(--ok) 50%, var(--card)); border-color: transparent; }


/* ----- базовые анимации ----- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Только мягкое появление без сдвигов и поочерёдных эффектов: так экран не «дёргается».
   Анимируем прозрачность, а не transform: transform на .view сломал бы позицию плавающей кнопки. */
.view.anim-view { animation: fade-in .2s ease-out both; }
.view.anim-day .day-content { animation: fade-in .18s ease-out both; }
/* Плавные состояния кнопок, карточек, чипов и нижней панели */
.day, .chip, .card, .pick, .toggle, .segmented button, .icon-btn, .btn, .check {
  transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s, opacity .18s, transform .12s;
}
.day:active, .card.shift:active, .card.person-row:active, .card.addr-row:active, .pick:active, .toggle:active { transform: scale(.97); }
.nav-item { transition: color .2s; }
.nav-ico { transition: transform .2s ease; }
.nav-item.active .nav-ico { transform: translateY(-1px) scale(1.08); }
.input { transition: border-color .15s, background-color .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ----- календарь: строки недель раскрываются из выбранной недели в месяц ----- */
.cal-head, .wk-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk-days { padding: 3px 2px 6px; }
.cal.month .day.out { opacity: .5; }
.weeklabel.swap { animation: label-swap .3s ease; }
@keyframes label-swap { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ----- свой выбор адреса ----- */
.addr-wrap { position: relative; margin: 4px 0 12px; z-index: 30; }
.addr-wrap .addr-card { margin: 0; width: 100%; text-align: left; font: inherit; color: inherit; }
.addr-card.clickable { cursor: pointer; transition: border-color .2s, background-color .2s; }
.addr-card.clickable:active { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.addr-wrap.open .addr-card { border-color: var(--accent); }
.addr-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.addr-chev { display: grid; color: var(--hint); transition: transform .28s cubic-bezier(.4, 0, .2, 1); }
.addr-wrap.open .addr-chev { transform: rotate(180deg); }
.addr-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: 272px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: var(--r);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top center; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .24s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .24s;
}
.addr-wrap.open .addr-menu { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.addr-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 14px; transition: background-color .15s; }
.addr-opt:last-child { border-bottom: 0; }
.addr-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.addr-opt-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-opt:active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.addr-opt.cur { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.addr-check { color: var(--accent); font-weight: 800; }
/* видимая полоса прокрутки сбоку для длинного списка адресов */
.addr-menu::-webkit-scrollbar { width: 7px; }
.addr-menu::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.addr-menu::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--hint) 55%, transparent); border-radius: 4px; }
@supports not selector(::-webkit-scrollbar) { .addr-menu { scrollbar-width: thin; } }

/* направление раскрытия: недели выше выбранной растут снизу вверх (прижаты к нижнему краю), ниже — сверху вниз */
/* «призрак» уходящей недели при листании */
.wk-days.ghost { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }

/* ----- «стопка» недель: в режиме «Неделя» все строки сложены под выбранной, в «Месяц» выезжают на свои места ----- */
.cal-body { position: relative; overflow: hidden; transition: height .46s cubic-bezier(.4, 0, .2, 1); }
.cal-slide { position: relative; }
.cal-slide.ghost { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.cal-track { transition: transform .46s cubic-bezier(.4, 0, .2, 1); }
.wk { position: relative; transition: transform .46s cubic-bezier(.4, 0, .2, 1), opacity .34s ease, visibility 0s; }
.wk.active { z-index: 2; }
.wk-in { position: relative; overflow: hidden; }
.cal.week .wk:not(.active) { visibility: hidden; pointer-events: none; transition: transform .46s cubic-bezier(.4, 0, .2, 1), opacity .3s ease, visibility 0s linear .46s; }
.cal.instant, .cal.instant * { transition: none !important; }
/* ----- свои элементы выбора: сотрудник, дата, время (без системных окон и AM/PM) ----- */
.pk-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid transparent; background: var(--card); color: inherit; font: inherit; text-align: left; transition: border-color .18s, background-color .18s; }
.pk-btn:active { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.pk.open > .pk-btn, .pk-btn.on { border-color: var(--accent); }
.pk-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.pk-chev { display: grid; color: var(--hint); transition: transform .26s cubic-bezier(.4, 0, .2, 1); }
.pk.open > .pk-btn .pk-chev, .pk-time.open .pk-btn.on .pk-chev { transform: rotate(180deg); }
.pk-panel { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .32s cubic-bezier(.4, 0, .2, 1), opacity .22s ease, visibility 0s linear .32s; }
.pk.open > .pk-panel { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
.pk-panel-in { min-height: 0; overflow: hidden; }
.pk-body { margin-top: 6px; padding: 8px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--bg); }
.pk-select .pk-body { padding: 0; overflow: hidden; }
.pk-list { max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.pk-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; padding: 11px 12px; transition: background-color .15s; }
.pk-opt:last-child { border-bottom: 0; }
.pk-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-opt:active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pk-opt.cur { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pk-list::-webkit-scrollbar { width: 7px; }
.pk-list::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.pk-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--hint) 55%, transparent); border-radius: 4px; }
@supports not selector(::-webkit-scrollbar) { .pk-list { scrollbar-width: thin; } }

/* календарь даты */
.pk-cal-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pk-cal-head, .pk-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pk-cal-head span { text-align: center; font-size: 12px; color: var(--hint); padding: 2px 0; }
.pk-day { border: 0; border-radius: 10px; min-height: 38px; background: transparent; color: inherit; font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s, color .15s, transform .1s; }
.pk-day:active { transform: scale(.94); }
.pk-day.out { color: var(--hint); opacity: .55; }
.pk-day.today { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.pk-day.sel { background: var(--accent); color: var(--accent-text); box-shadow: none; opacity: 1; }
.pk-day:disabled { opacity: .25; pointer-events: none; }

/* время: часы и минуты в формате 24 часа */
.pk-time-row { display: flex; gap: 10px; }
.pk-time-row .field { flex: 1; min-width: 0; }
.pk-sub-title { margin: 8px 2px 6px; font-size: 12px; font-weight: 600; color: var(--hint); }
.pk-done { margin-top: 10px; }

/* ----- iOS-барабаны выбора времени ----- */
.pk-sub-title { margin: 2px 2px 8px; font-size: 12px; font-weight: 600; color: var(--hint); text-align: center; }
.wheel-wrap { --wh: 40px; position: relative; display: flex; justify-content: center; align-items: center; height: calc(var(--wh) * 5); }
.wheel { width: 84px; height: 100%; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; padding: calc(var(--wh) * 2) 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.wheel::-webkit-scrollbar { display: none; }
.wheel-item { height: var(--wh); line-height: var(--wh); text-align: center; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; scroll-snap-align: center; cursor: pointer; user-select: none; will-change: transform, opacity; }
.wheel-item.dim { color: var(--hint); }
.wheel-colon { font-size: 24px; font-weight: 700; padding-bottom: 2px; }
.wheel-band { position: absolute; left: 8px; right: 8px; top: calc(50% - var(--wh) / 2); height: var(--wh); border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); pointer-events: none; z-index: 0; }
.wheel-wrap::before, .wheel-wrap::after { content: ''; position: absolute; left: 0; right: 0; height: calc(var(--wh) * 1.7); pointer-events: none; z-index: 2; }
.wheel-wrap::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.wheel-wrap::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }
.wheel, .wheel-colon { position: relative; z-index: 1; }

/* карусель месяцев в календаре формы */
.pk-cal-view { position: relative; overflow: hidden; }
.pk-cal-grid.ghost { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.pk-cal-title { transition: opacity .2s; }
/* ----- аккуратность при очень длинных названиях ----- */
.addr-card h1 { font-size: 20px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.addr-card > .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.addr-opt-text b, .pk-opt-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-label { width: 76px; padding: 0 6px 0 12px; font-size: 12px; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-label { width: 86px; padding: 0 4px 0 10px; overflow-wrap: break-word; }

/* карточка смены: первая строка — время и статус, вторая — кто и на каких точках (не наезжают друг на друга при длинных именах) */
.card.shift { grid-template-columns: 1fr auto; grid-template-areas: "time badge" "who who" "acts acts"; gap: 8px 12px; align-items: center; }
.card.shift > .time { grid-area: time; min-width: 0; }
.card.shift > .badge { grid-area: badge; align-self: start; }
.card.shift > .who { grid-area: who; min-width: 0; }
.card.shift > .card-actions { grid-area: acts; }
.card.shift .person { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.chip { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
.stats.one { grid-template-columns: 1fr; }

/* =====================================================================
   «Управление» (админ): меню и окна разделов. Всё здесь — только под .mg и классами mg-*,
   поэтому «График», «Мои смены», «Кабинет» и окна, которые видит сотрудник, не меняются.
   ===================================================================== */
.mg .top { padding-bottom: 2px; }
.mg-group-title { margin: 22px 6px 8px; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--hint); }
.mg .top + .mg-group-title { margin-top: 12px; }
.mg-group { background: var(--card); border-radius: 18px; overflow: hidden; }

/* строка меню: иконка · название · значение · › */
.mg-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .15s;
}
.mg-row:active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.mg-row + .mg-row::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--line); }
.mg-group.plain .mg-row + .mg-row::before { left: 14px; }
.mg-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.mg-row-title { flex: 1 1 auto; min-width: 0; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-row-value {
  flex: 0 1 auto; min-width: 0; max-width: 58%; display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  color: var(--hint); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mg-row .chev { flex: none; line-height: 1; margin-left: -2px; }
/* строка в две-три линии: название, статус, подпись */
.mg-row.tall { align-items: center; min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
.mg-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mg-row-main > b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-row-sub { font-size: 13px; color: var(--hint); }
.mg-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-text); }

/* статус: цветная точка и текст */
.mg-status { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--hint); }
.mg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--hint); }
.mg-status.ok .mg-dot { background: var(--ok); }
.mg-status.warn .mg-dot { background: var(--warn); }
.mg-status.warn { color: var(--warn-text); }
.mg-status.bad .mg-dot { background: var(--bad); }
.mg-status.bad { color: var(--bad-text); }

/* окно раздела: почти во весь экран, кнопки действий закреплены внизу */
.sheet.mg-panel { height: 88vh; }
.sheet.mg-panel > .sheet-body { flex: 1 1 auto; min-height: 0; }
.sheet.mg-panel.has-footer > .sheet-body { padding-bottom: 16px; }
.mg-footer {
  display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg);
}
.mg-footer .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-sec { padding-top: 2px; }
.mg-note { margin: 2px 4px 12px; }

/* списки внутри разделов — одной карточкой с разделителями, без «плиток» */
.mg .card { border-radius: 18px; }
.mg .list { gap: 0; background: var(--card); border-radius: 18px; overflow: hidden; }
.mg .list > .card { border-radius: 0; background: transparent; }
.mg .list > .card + .card { box-shadow: inset 0 1px 0 var(--line); }
.mg .list > .card.person-row:active, .mg .list > .card.addr-row:active, .mg .list > .card.pay-row:active { transform: none; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.mg .list > .card.fold { margin: 0; }
.mg .card.pay-summary { margin-bottom: 12px; }
.mg .card.pay-summary .kv:first-child { border-top: 0; }
.mg .fines-sum { margin: 4px 4px 14px; }
.mg .filters { margin: 2px 0 12px; }

/* панель фильтров: период (и сотрудник) в одну строку */
.mg-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 4px 0 6px; }
.mg-toolbar.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 370px) { .mg-toolbar.two { grid-template-columns: minmax(0, 1fr); } }   /* узкий телефон: друг под другом, без обрезки */
.mg-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 44px; padding: 10px 12px;
  border: 0; border-radius: 12px; background: var(--card); color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer;
  transition: background-color .15s;
}
.mg-choice:active { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.mg-choice > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-choice > svg { flex: none; color: var(--hint); }
.mg-range { margin: 2px 4px 12px; font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; }
.mg-dates-last { margin-bottom: 12px; }
.mg-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 4px 6px; }
.mg-total b { font-size: 26px; font-variant-numeric: tabular-nums; }

/* штраф: имя и сумма, причина и адрес, комментарий */
.mg-fine { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; cursor: pointer; transition: background-color .15s; }
.mg-fine:active { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.mg-fine + .mg-fine::before { content: ''; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.mg-fine-top { display: flex; align-items: baseline; gap: 12px; }
.mg-fine-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-fine-sum { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-fine > .muted { overflow-wrap: anywhere; }
.mg-fine-comment { font-style: italic; color: var(--hint); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mg-fine .pay-badges { margin-top: 4px; }
.mg-fine.canceled { opacity: .55; }
.mg-fine.canceled .mg-fine-sum { text-decoration: line-through; }

/* выбор из списка окном снизу */
.mg-options { background: var(--card); border-radius: 18px; overflow: hidden; margin: 4px 0 6px; }
.mg-option {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 11px 14px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .15s;
}
.mg-option + .mg-option::before { content: ''; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.mg-option:active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.mg-option.cur { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mg-option b { font-weight: 600; overflow-wrap: anywhere; }
.mg-check { flex: none; color: var(--accent); font-weight: 800; }

/* «Скоро»: будущие парсеры */
.mg-soon { margin-top: 12px; padding: 14px; border-radius: 18px; border: 1.5px dashed var(--line); display: flex; flex-direction: column; gap: 2px; color: var(--hint); }
.mg-soon b { color: var(--text); font-weight: 600; }

/* =====================================================================
   Лама и Джо: фирменный слой поверх базовых стилей
   ===================================================================== */
body { font-weight: 500; }
b, strong { font-weight: 700; }
h1 { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; font-size: 26px; }
.section-title { color: var(--coral); font-weight: 700; letter-spacing: .18em; font-size: 12px; }

/* шапка: логотип и заведение */
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 12px; }
.brand-bar img { height: 44px; width: auto; flex: none; }
.brand-bar .brand-kicker { font-weight: 700; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--coral); text-align: right; }
.addr-card { background: var(--card); border: 2px solid rgba(255, 255, 255, .14); border-radius: 18px; }
.addr-card h1 { font-size: 24px; }
.addr-wrap.open .addr-card { border-color: var(--coral); }

/* кнопки — «таблетки», как на сайте */
.btn { border-radius: 999px; font-weight: 700; letter-spacing: .02em; }
.btn.small { border-radius: 999px; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28); }
.btn.danger-ghost { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--bad) 40%, transparent); }
.fab { font-weight: 700; letter-spacing: .02em; box-shadow: 0 8px 22px rgba(0, 0, 0, .45), 0 0 0 3px var(--ink); }
.fab .plus { background: rgba(35, 35, 34, .16); }
.link-btn { color: var(--coral); }

/* поля */
.input, .pk-btn, .phone-field { border-radius: 14px; border: 2px solid rgba(255, 255, 255, .1); }
.input:focus, .pk-btn.on { border-color: var(--coral); }
.field-label { letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-weight: 700; color: var(--hint); }

/* переключатели и неделя */
.segmented { border-radius: 999px; padding: 4px; }
.segmented button { border-radius: 999px; font-weight: 700; }
.segmented .seg-ind { top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 2)); border-radius: 999px; background: var(--coral); box-shadow: none; }
.segmented button.on { color: var(--ink); }
.day { border-radius: 14px; }
.day .dn { font-weight: 700; }
.day.free { background: color-mix(in srgb, var(--ok) 22%, var(--card)); }
.day.sel { background: var(--coral); }
.day.free.sel { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.weeklabel { font-family: var(--f-head); font-weight: 400; font-size: 19px; }

/* шкала дня и карточки смен */
.timeline { border-radius: 18px; }
.bar { color: var(--ink); font-weight: 700; border-radius: 999px; padding: 0 9px; }
.bar.mine { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--coral); }
.tl-track .now { background: var(--coral); }
.card { border-radius: 18px; }
.card.shift { border-left-width: 5px; }
.card.shift .time b { font-family: var(--f-head); font-weight: 400; font-size: 20px; letter-spacing: .01em; }
.card.shift.mine { background: color-mix(in srgb, var(--coral) 12%, var(--card)); }
.chip { background: color-mix(in srgb, var(--coral) 18%, transparent); color: var(--coral); font-weight: 700; }
.btn-chip { background: var(--card); color: var(--text); }
.avatar { background: color-mix(in srgb, var(--coral) 22%, var(--card)); color: var(--coral); font-family: var(--f-display); font-weight: 400; }
.stat b { font-family: var(--f-head); font-weight: 400; }

/* нижняя панель и шторки */
.nav { background: rgba(35, 35, 34, .92); border-top: 1px solid rgba(255, 255, 255, .1); }
.nav-item { font-weight: 700; letter-spacing: .02em; }
.sheet { border-top: 3px solid var(--coral); }
.toast { background: var(--grey-l); color: var(--ink); font-weight: 600; border-radius: 999px; }

/* экраны «заявка на рассмотрении», «нет доступа» */
.status-screen .brand-logo { height: 64px; width: auto; margin: 0 auto 26px; }
.status-screen h1 { font-size: 28px; margin-bottom: 10px; }
