/* ==========================================================================
   Перерывы — интерфейс в стиле iOS 26
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --cell: #ffffff;
  --cell-press: #e5e5ea;
  --sheet-bg: #f2f2f7;
  --sheet-cell: #ffffff;
  --label: #000000;
  --label2: rgba(60, 60, 67, 0.6);
  --label3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.17);
  --fill: rgba(120, 120, 128, 0.12);
  --fill2: rgba(120, 120, 128, 0.2);
  --thumb: #ffffff;

  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --indigo: #5856d6;
  --teal: #30b0c7;
  --blue-soft: rgba(0, 122, 255, 0.12);

  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(250, 250, 252, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.07);
  --nav-glass: rgba(242, 242, 247, 0.78);
  --backdrop: rgba(0, 0, 0, 0.22);
  --live: #1c1c1e;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-r: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.64, 1);

  --safe-t: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --vh: var(--tg-viewport-stable-height, 100vh);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --cell: #1c1c1e;
  --cell-press: #2c2c2e;
  --sheet-bg: #1c1c1e;
  --sheet-cell: #2c2c2e;
  --label: #ffffff;
  --label2: rgba(235, 235, 245, 0.6);
  --label3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6);
  --fill: rgba(118, 118, 128, 0.24);
  --fill2: rgba(118, 118, 128, 0.36);
  --thumb: #636366;

  --blue: #0a84ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --indigo: #5e5ce6;
  --teal: #40c8e0;
  --blue-soft: rgba(10, 132, 255, 0.2);

  --glass: rgba(37, 37, 40, 0.66);
  --glass-strong: rgba(44, 44, 46, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  --nav-glass: rgba(0, 0, 0, 0.72);
  --backdrop: rgba(0, 0, 0, 0.5);
  --live: #1c1c1e;
}

/* Цвета типов перерыва */
.k-break { --k: var(--orange); --k-soft: rgba(255, 149, 0, 0.15); }
.k-lunch { --k: var(--green); --k-soft: rgba(52, 199, 89, 0.15); }
.k-personal { --k: var(--indigo); --k-soft: rgba(88, 86, 214, 0.16); }
.t-ok { --k: var(--green); }
.t-info { --k: var(--blue); }
.t-warn { --k: var(--orange); }
.t-err { --k: var(--red); }

/* ---------- база ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--label);
  font: 17px/1.3 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: var(--vh);
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; letter-spacing: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.pressable { transition: transform 0.25s var(--ease), opacity 0.2s; }
.pressable:active { transform: scale(0.96); }

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px calc(118px + var(--safe-b));
}

/* ---------- навбар и крупный заголовок ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(44px + var(--safe-t));
  padding-top: var(--safe-t);
  margin: 0 -16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s, box-shadow 0.25s;
}
body.scrolled .navbar {
  background: var(--nav-glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 0.5px 0 var(--sep);
}
.navbar-title {
  font-weight: 600;
  font-size: 17px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
body.scrolled .navbar-title { opacity: 1; transform: none; }

.lt {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 14px;
}
.lt-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--label2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.lt h1 {
  margin: 0;
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.av-btn { border-radius: 50%; margin-bottom: 3px; }

/* ---------- аватар ---------- */
.av {
  --s: 40px;
  --h: 210;
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--s) * 0.38);
  letter-spacing: 0;
  background: linear-gradient(180deg, hsl(var(--h) 62% 70%), hsl(var(--h) 52% 54%));
}
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- иконки-квадраты (как в «Настройках») ---------- */
.sq {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--k);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.sq svg { width: 19px; height: 19px; }
.sq.lg { width: 44px; height: 44px; border-radius: 12px; }
.sq.lg svg { width: 25px; height: 25px; }

/* ---------- панель вкладок (плавающее стекло) ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px calc(12px + var(--safe-b));
  pointer-events: none;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.tabbar > * { pointer-events: auto; }
body.overlay-open .tabbar { transform: translateY(24px); opacity: 0; pointer-events: none; }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  box-shadow: var(--glass-shadow), inset 0 0.5px 0 var(--glass-edge);
}
.tabs {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
}
.tab {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 54px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--label);
  transition: color 0.25s;
}
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--blue); }
.tabs .lens {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 104px;
  border-radius: 999px;
  background: var(--fill);
  transition: transform 0.45s var(--spring);
}
.tabs[data-tab="team"] .lens { transform: translateX(104px); }
.fab {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px -6px rgba(0, 122, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.3s var(--spring);
}
.fab:active { transform: scale(0.9); }
.fab svg { width: 28px; height: 28px; }

/* ---------- Live Activity: идущий перерыв ---------- */
.live {
  position: relative;
  overflow: hidden;
  background: var(--live);
  color: #fff;
  border-radius: 28px;
  padding: 16px 16px 14px;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}
.live::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--k);
  opacity: 0.22;
  filter: blur(50px);
  pointer-events: none;
}
.live > * { position: relative; }
.live-top { display: flex; align-items: center; gap: 12px; }
.live-title { min-width: 0; }
.live-title b { display: block; font-size: 17px; font-weight: 600; }
.live-title span { font-size: 15px; color: rgba(255, 255, 255, 0.6); }
.live-timer {
  margin-left: auto;
  font: 600 42px/1 var(--font-r);
  letter-spacing: -0.03em;
  color: var(--k);
  font-variant-numeric: tabular-nums;
}
.live-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); margin: 18px 0 8px; overflow: hidden; }
.live-bar i { display: block; height: 100%; border-radius: 3px; background: var(--k); transition: width 1s linear; }
.live-times { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }
.live-btn {
  margin-top: 14px;
  width: 100%;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.live-btn svg { width: 20px; height: 20px; }

/* ---------- карточки ---------- */
.card { background: var(--cell); border-radius: 26px; padding: 16px; }
.card-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--k, var(--label2));
}
.card-eyebrow svg { width: 17px; height: 17px; }
.next-big { font: 700 36px/1.1 var(--font-r); letter-spacing: -0.025em; margin: 10px 0 4px; }
.next-big .dim { color: var(--label3); font-weight: 600; }
.next-sub { font-size: 15px; color: var(--label2); }

.tl { position: relative; height: 10px; border-radius: 5px; background: var(--fill); margin: 18px 0 7px; }
.tl i { position: absolute; top: 0; bottom: 0; min-width: 6px; border-radius: 5px; background: var(--k); }
.tl-axis { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--label2); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 28px 22px 22px; }
.empty-ic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
}
.empty-ic svg { width: 32px; height: 32px; }
.empty h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.empty p { margin: 0 0 18px; font-size: 15px; color: var(--label2); line-height: 1.35; }

/* ---------- кнопки ---------- */
.btn {
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn.block { width: 100%; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-tinted { background: var(--blue-soft); color: var(--blue); }
.btn.sm { height: 40px; font-size: 15px; padding: 0 16px; }
.link-btn { color: var(--blue); font-size: 15px; font-weight: 600; }

/* ---------- списки ---------- */
.sh {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 4px 10px;
}
.sh h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.sh span { font-size: 15px; color: var(--label2); white-space: nowrap; }

.group { background: var(--cell); border-radius: 22px; overflow: hidden; }
.cell { position: relative; overflow: hidden; }
.cell-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px;
  background: var(--cell);
  transition: transform 0.4s var(--ease), background-color 0.15s;
}
.cell.tappable .cell-body:active { background: var(--cell-press); }
.cell + .cell .cell-body::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 60px;
  height: 0.5px;
  background: var(--sep);
}
.group.avatars .cell + .cell .cell-body::before { left: 68px; }
.cell-text { flex: 1; min-width: 0; }
.cell-text b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-text > span {
  display: block;
  margin-top: 1px;
  font-size: 15px;
  color: var(--label2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.cell-trail { font-size: 15px; color: var(--label2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell.past .cell-text b, .cell.past .cell-time b { color: var(--label2); }
.cell.past .sq { opacity: 0.45; }
.cell.past .av { opacity: 0.55; }
.cell-time { text-align: right; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cell-time b { display: block; font-size: 17px; font-weight: 600; }
.cell-time span { font-size: 13px; color: var(--label2); }
.you {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  flex: none;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k); margin-right: 5px; vertical-align: 1px; }
.badge {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--k);
  background: var(--k-soft);
  white-space: nowrap;
}

/* свайп для удаления */
.cell.swipeable .cell-body { touch-action: pan-y; }
.swipe-act {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
}
.swipe-act.finish { background: var(--orange); }
.swipe-act svg { width: 22px; height: 22px; }

.notice .cell-body { gap: 12px; }
.notice + * { margin-top: 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- команда ---------- */
.search { position: relative; display: block; margin-bottom: 4px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--label2); }
.search input {
  width: 100%;
  height: 40px;
  border: 0;
  outline: none;
  border-radius: 12px;
  background: var(--fill);
  padding: 0 12px 0 36px;
  font-size: 17px;
}
.search input::placeholder { color: var(--label2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.away {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px 4px;
  scroll-padding: 0 16px;
}
.away::-webkit-scrollbar { display: none; }
.away-item { flex: none; width: 70px; text-align: center; }
.ring {
  --p: 0.5;
  width: 66px;
  height: 66px;
  margin: 0 auto 6px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(var(--k) calc(var(--p) * 1turn), var(--fill2) 0);
}
.ring .av { --s: 60px; border: 3px solid var(--bg); }
.away-item b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.away-item > span { display: block; font-size: 12px; color: var(--label2); font-variant-numeric: tabular-nums; }

.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.chart-head small { display: block; font-size: 13px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: 0.02em; }
.chart-value { font: 700 30px/1.15 var(--font-r); letter-spacing: -0.02em; }
.chart-value span { font: 600 17px var(--font); color: var(--label2); letter-spacing: -0.01em; }
.chart-plot { position: relative; height: 120px; margin-top: 14px; }
.grid-line { position: absolute; left: 0; right: 26px; height: 0; border-top: 1px dashed var(--sep); }
.grid-line.limit { border-top: 1.5px dashed var(--red); opacity: 0.7; }
.grid-label { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; font-weight: 500; color: var(--label2); }
.grid-line.limit + .grid-label { color: var(--red); }
.bars { position: absolute; inset: 0 26px 0 0; display: flex; align-items: stretch; gap: 3px; }
.bar-col { flex: 1; min-width: 0; display: flex; align-items: flex-end; }
.bar {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 1.5px 1.5px;
  background: var(--blue);
  transition: height 0.5s var(--ease), opacity 0.2s;
}
.bar.zero { background: var(--fill2); }
.bar.over { background: var(--red); }
.bars.has-sel .bar:not(.sel) { opacity: 0.32; }
.now-line { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 1.5px solid var(--orange); z-index: 1; pointer-events: none; }
.now-line::before { content: ""; position: absolute; top: -3px; left: -4.5px; width: 7.5px; height: 7.5px; border-radius: 50%; background: var(--orange); }
.axis { position: relative; height: 16px; margin: 7px 26px 0 0; font-size: 11px; font-weight: 500; color: var(--label2); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; top: 0; white-space: nowrap; }
.chart-names { margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--sep); font-size: 15px; color: var(--label2); line-height: 1.35; }
.chart-names b { color: var(--label); font-weight: 500; }

/* ---------- шторки ---------- */
.sheet-backdrop, .as-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.sheet-backdrop { z-index: 50; }
.as-backdrop { z-index: 60; }
.sheet {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--safe-b));
  z-index: 51;
  max-width: 600px;
  margin: 0 auto;
  max-height: calc(var(--tg-viewport-height, 100vh) - 24px - var(--safe-b));
  display: flex;
  flex-direction: column;
  background: var(--sheet-bg);
  border-radius: 34px;
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(calc(100% + 40px));
  transition: transform 0.5s var(--ease);
}
.open > .sheet-backdrop, .open > .as-backdrop { opacity: 1; }
.open > .sheet { transform: none; }
.sheet.dragging { transition: none; }
.sheet-top { flex: none; touch-action: none; padding-top: 6px; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill2); margin: 0 auto; }
.sheet-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 4px 12px 2px;
}
.sheet-nav h3 { margin: 0; text-align: center; font-size: 17px; font-weight: 600; }
.circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--label2);
}
.circle-btn svg { width: 15px; height: 15px; }
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px 18px;
  -webkit-overflow-scrolling: touch;
}

.s-head {
  display: flex;
  justify-content: space-between;
  margin: 20px 16px 7px;
  font-size: 13px;
  color: var(--label2);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.s-head:first-child { margin-top: 8px; }
.s-head .acc { color: var(--blue); font-weight: 600; }
.s-group { background: var(--sheet-cell); border-radius: 20px; overflow: hidden; }
.s-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 6px 16px;
}
.s-row + .s-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.s-row .val { color: var(--label2); font-variant-numeric: tabular-nums; }
.s-foot { margin: 8px 16px 0; font-size: 13px; color: var(--label2); line-height: 1.35; }
.s-foot.err { color: var(--red); }
.s-input { width: 100%; border: 0; outline: none; background: transparent; height: 50px; font-size: 17px; }
.s-input::placeholder { color: var(--label3); }

/* сегментированный контрол */
.seg {
  --i: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 40px;
  padding: 3px;
  border-radius: 999px;
  background: var(--fill);
}
.seg button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
}
.seg button svg { width: 17px; height: 17px; color: var(--k); }
.seg button.on { font-weight: 600; }
.seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: var(--thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  transform: translateX(calc(100% * var(--i)));
  transition: transform 0.45s var(--spring);
}

/* колесо времени */
.wheel { position: relative; height: 190px; display: flex; justify-content: center; align-items: center; }
.wheel-band {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 38px;
  margin-top: -19px;
  border-radius: 12px;
  background: var(--fill);
}
.wheel-col {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 32%, #000 68%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 32%, #000 68%, transparent);
}
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-pad { height: 76px; }
.wheel-item {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  scroll-snap-align: center;
  cursor: pointer;
  will-change: transform, opacity;
}
.wheel-colon { position: relative; z-index: 1; font-size: 23px; font-weight: 500; padding-bottom: 2px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px; scroll-padding: 0 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.chip:active { transform: scale(0.94); }
.chip.on { background: var(--blue); color: #fff; font-weight: 600; }
.chips.tinted .chip { background: var(--blue-soft); color: var(--blue); }
.chips.tinted .chip.on { background: var(--blue); color: #fff; }

.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 62px; }
.status-row .sq { border-radius: 50%; }
.status-row b { display: block; font-size: 17px; font-weight: 600; }
.status-row span { display: block; font-size: 15px; color: var(--label2); line-height: 1.3; }
.status-row.t-err b { color: var(--red); }
.sheet-cta { margin-top: 18px; }

/* профиль */
.profile-head { text-align: center; padding: 6px 0 4px; }
.profile-head .av { --s: 88px; margin: 0 auto 12px; }
.profile-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.profile-head p { margin: 4px 0 0; font-size: 15px; color: var(--label2); }
.s-row .lbl { display: flex; align-items: center; gap: 12px; }
.s-row .lbl .sq { width: 30px; height: 30px; border-radius: 8px; }
.s-row .lbl .sq svg { width: 18px; height: 18px; }
.on-text { color: var(--green); font-weight: 500; }
.off-text { color: var(--red); font-weight: 500; }

/* ---------- меню действий ---------- */
.as {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--safe-b));
  z-index: 61;
  max-width: 560px;
  margin: 0 auto;
  transform: translateY(calc(100% + 40px));
  transition: transform 0.45s var(--ease);
}
.open > .as { transform: none; }
.as-group {
  border-radius: 20px;
  overflow: hidden;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
}
.as-title { padding: 14px 20px 13px; text-align: center; font-size: 13px; color: var(--label2); line-height: 1.35; }
.as-title b { display: block; font-weight: 600; color: var(--label2); }
.as-btn { position: relative; width: 100%; height: 58px; font-size: 20px; color: var(--blue); }
.as-btn::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 0.5px; background: var(--sep); }
.as-btn:active { background: var(--fill); }
.as-btn.danger { color: var(--red); }
.as-cancel {
  margin-top: 8px;
  width: 100%;
  height: 58px;
  border-radius: 20px;
  background: var(--sheet-cell);
  color: var(--blue);
  font-size: 20px;
  font-weight: 600;
}
.as-cancel:active { background: var(--cell-press); }

/* ---------- Dynamic Island ---------- */
.island {
  position: fixed;
  top: calc(10px + var(--safe-t));
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 9px 18px 9px 10px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.55);
  transition: transform 0.5s var(--spring), opacity 0.25s;
  pointer-events: none;
}
.island.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.island .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--green); display: grid; place-items: center; flex: none; }
.island.err .ic { background: var(--red); }
.island .ic svg { width: 15px; height: 15px; }
.island span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- приветствие ---------- */
.welcome {
  min-height: var(--vh);
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(44px + var(--safe-t)) 28px calc(20px + var(--safe-b));
}
.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #ffb443, #ff7a1a);
  box-shadow: 0 16px 34px -12px rgba(255, 122, 26, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.app-icon svg { width: 54px; height: 54px; }
.app-icon.blue { background: linear-gradient(180deg, #5ac8fa, #007aff); box-shadow: 0 16px 34px -12px rgba(0, 122, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.welcome h1 { margin: 0 0 12px; text-align: center; font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; }
.welcome .lead { margin: 0 0 34px; text-align: center; font-size: 17px; color: var(--label2); line-height: 1.35; }
.feature { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.feature svg { width: 36px; height: 36px; color: var(--k); }
.feature b { display: block; font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.feature span { display: block; font-size: 15px; color: var(--label2); line-height: 1.35; }
.welcome-foot { margin-top: auto; padding-top: 18px; }
.welcome-foot .hint { text-align: center; font-size: 13px; color: var(--label2); margin: 0 0 14px; }
.welcome .s-group { background: var(--cell); }

.splash { height: var(--vh); display: grid; place-content: center; justify-items: center; gap: 22px; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--fill2); border-top-color: var(--label2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- появление ---------- */
.appear { animation: appear 0.5s var(--ease) both; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } }
.tab-pane { animation: pane 0.35s var(--ease) both; }
@keyframes pane { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- дополнения ---------- */
.btn svg { width: 19px; height: 19px; }
.welcome form, form.welcome { display: flex; flex-direction: column; }
.welcome .s-head:first-of-type { margin-top: 0; }
.eye { width: 34px; height: 34px; margin-right: -6px; display: grid; place-items: center; color: var(--label2); border-radius: 50%; }
.eye svg { width: 20px; height: 20px; }
.key-hint { display: flex; align-items: flex-start; gap: 6px; }
.key-hint svg { width: 15px; height: 15px; margin-top: 1px; color: var(--orange); }
.key-hint b { color: var(--label); font-weight: 600; }
.chips + .s-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.cell-trail.done svg { width: 18px; height: 18px; color: var(--label3); }
.live-txt { color: var(--k); font-weight: 500; }
.nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-h { margin: 16px 16px 7px; font-size: 13px; color: var(--label2); text-transform: uppercase; letter-spacing: 0.01em; }
.sub-h:first-of-type { margin-top: 0; }
.as-group > .as-btn:first-child::before { display: none; }
#hero + #notice:empty + #mine-list > .sh:first-child { margin-top: 28px; }
.notice .cell-body { min-height: 62px; }
.cell .swipe-act { visibility: hidden; }
.cell.swiping .swipe-act, .cell.open .swipe-act { visibility: visible; }
.chips.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
.chips.grid4 .chip { padding: 0 4px; font-size: 14.5px; }

/* ---------- роли: оператор и старший смены ---------- */
.t-ok { --k-soft: rgba(52, 199, 89, 0.15); }
.t-info { --k-soft: rgba(0, 122, 255, 0.13); }
.t-warn { --k-soft: rgba(255, 149, 0, 0.16); }
.t-err { --k-soft: rgba(255, 59, 48, 0.14); }

/* оператор: одна большая кнопка вместо вкладок */
.cta {
  height: 58px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 28px -8px rgba(0, 122, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.3s var(--spring);
}
.cta:active { transform: scale(0.95); }
.cta svg { width: 22px; height: 22px; }

/* старший: три вкладки */
.tabs { --tw: 104px; }
.tabs.three { --tw: 86px; }
.tab { width: var(--tw); }
.tabs .lens { width: var(--tw); transform: translateX(calc(var(--tw) * var(--ti, 0))); }

.seg4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.seg4 .seg-thumb { width: calc((100% - 6px) / 4); }
.seg4 button { font-size: 14.5px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.tile { background: var(--cell); border-radius: 22px; padding: 14px; min-width: 0; }
.sheet .tile { background: var(--sheet-cell); }
.tile .sq { width: 30px; height: 30px; border-radius: 50%; margin-bottom: 10px; }
.tile .sq svg { width: 16px; height: 16px; }
.tile b { display: block; font: 700 30px/1.05 var(--font-r); letter-spacing: -0.02em; }
.tile > span:last-child { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--label2); line-height: 1.25; }
.tiles.three .tile { padding: 12px; }
.tiles.three .tile b { font-size: 26px; }

.stack { display: flex; flex: none; }
.stack .av { border: 2px solid var(--cell); }
.stack .av + .av { margin-left: -12px; }
.role-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 149, 0, 0.16);
  color: var(--orange);
  flex: none;
}
.chev { color: var(--label3); }
.chev svg { width: 16px; height: 16px; }
.adm-search { margin-top: 28px; }
.loading-row { display: grid; place-items: center; height: 120px; }
.link-btn.danger { color: var(--red); }
.link-btn[disabled] { opacity: 0.35; }
.s-row .link-btn { flex: none; }

.s-row.brk { gap: 12px; padding: 10px 16px; }
.s-row.brk .sq { width: 30px; height: 30px; border-radius: 8px; }
.s-row.brk .sq svg { width: 17px; height: 17px; }
.s-row.brk + .s-row.brk::before { left: 58px; }
.st { font-size: 14px; font-weight: 500; color: var(--label2); white-space: nowrap; }
.st-live { color: var(--orange); }
.st-plan { color: var(--blue); }
.warn-txt { font-style: normal; color: var(--red); }
.group.ov .cell + .cell .cell-body::before { left: 94px; }
.ring.sm { width: 44px; height: 44px; margin: 0; padding: 2px; flex: none; }
.ring.sm .av { border: 2px solid var(--cell); }
.ring.sm.idle { background: transparent; }
.ring.sm.idle .av { border-color: transparent; }
#adm-list .group.avatars .cell + .cell .cell-body::before { left: 72px; }
.s-row.brk .cell-text > span { white-space: normal; }

/* ---------- свободные слоты ---------- */
:root { --slot-free: rgba(52, 199, 89, 0.14); --slot-busy: rgba(255, 149, 0, 0.16); --slot-full: rgba(255, 59, 48, 0.1); }
:root[data-theme="dark"] { --slot-free: rgba(48, 209, 88, 0.18); --slot-busy: rgba(255, 159, 10, 0.2); --slot-full: rgba(255, 69, 58, 0.16); }

/* виджет на главной */
#slots-widget:not(:empty) { margin-top: 12px; }
.slots-head { display: flex; align-items: center; justify-content: space-between; }
.slots-head > span { font-size: 13px; font-weight: 600; color: var(--label2); }
.slots-big { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 14px; }
.slots-big b { font: 700 34px/1 var(--font-r); letter-spacing: -0.02em; }
.slots-big span { font-size: 15px; color: var(--label2); }
.heat { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; }
.hs {
  aspect-ratio: 1;
  border-radius: 5px;
  transition: transform 0.25s var(--spring);
}
.hs:active { transform: scale(0.85); }
.hs.h-free { background: var(--green); }
.hs.h-busy { background: var(--orange); }
.hs.h-full { background: var(--red); opacity: 0.85; }
.hs.h-mine { background: var(--indigo); }
.hs.now { box-shadow: 0 0 0 2px var(--cell), 0 0 0 3.5px var(--label); }
.heat-axis { position: relative; height: 16px; margin-top: 7px; font-size: 11px; font-weight: 500; color: var(--label2); font-variant-numeric: tabular-nums; }
.heat-axis span { position: absolute; top: 0; }
.heat-legend, .slot-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--label2); }
.heat-legend i, .slot-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--k); margin-right: 5px; vertical-align: -0.5px; }
.slot-legend { margin: 0 0 12px; }
.slot-legend b { margin-left: auto; font-weight: 600; color: var(--label); }
.next-free {
  margin-top: 14px;
  width: 100%;
  height: 50px;
  padding: 0 14px 0 16px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.25s var(--ease);
}
.next-free:active { transform: scale(0.98); }
.next-free span { flex: 1; text-align: left; }
.next-free b { font-weight: 700; font-size: 17px; }
.next-free svg { width: 16px; height: 16px; }
.next-free.none { justify-content: center; background: var(--fill); color: var(--label2); font-size: 15px; }

/* сетка в шторке */
.seg2 { grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.seg2 .seg-thumb { width: calc((100% - 6px) / 2); }
.seg2 button svg { width: 16px; height: 16px; }
.slots-box { padding: 14px 12px 12px; }
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot {
  height: 56px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--fill);
  transition: transform 0.25s var(--spring), background-color 0.2s;
}
.slot:not([disabled]):active { transform: scale(0.93); }
.slot b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.slot .occ { font-size: 11.5px; font-weight: 500; color: var(--label2); line-height: 1; }
.slot.pad { visibility: hidden; }
.slot.s-free { background: var(--slot-free); }
.slot.s-free .occ { color: var(--green); }
.slot.s-busy { background: var(--slot-busy); }
.slot.s-busy .occ { color: var(--orange); }
.slot.s-full { background: var(--slot-full); cursor: not-allowed; }
.slot.s-full b { color: var(--red); opacity: 0.55; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.slot.s-full .occ { color: var(--red); }
.slot.s-mine { background: var(--fill); cursor: not-allowed; }
.slot.s-mine b, .slot.s-mine .occ { color: var(--label3); }
.slot.range { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.slot.sel { background: var(--blue); box-shadow: 0 6px 16px -6px rgba(0, 122, 255, 0.7); transform: scale(1.03); }
.slot.sel b, .slot.sel .occ { color: #fff; text-decoration: none; opacity: 1; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.25; }
.dots i.on { opacity: 1; }
.more-btn { display: block; width: 100%; margin-top: 10px; height: 40px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--blue); }
.more-btn:active { background: var(--fill); }
.slots-box .next-free { margin-top: 10px; }
.status-row .act { flex: none; height: 34px; padding: 0 12px; font-size: 14px; }

/* лимит у старшего */
.limit-card { margin-bottom: 14px; }
.limit-row { display: flex; align-items: center; gap: 12px; }
.limit-row .cell-text b { font-weight: 600; }
.stepper { display: flex; align-items: center; flex: none; height: 38px; border-radius: 999px; background: var(--fill); }
.stepper button { width: 40px; height: 38px; font-size: 22px; font-weight: 400; color: var(--blue); display: grid; place-items: center; }
.stepper button[disabled] { color: var(--label3); }
.stepper button:active { opacity: 0.5; }
.stepper span { min-width: 30px; text-align: center; font: 700 19px var(--font-r); }
.limit-note { margin: 12px 0 0; font-size: 13px; color: var(--label2); line-height: 1.35; }
.limit-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 0.5px solid var(--sep); font-size: 16px; }

/* ---------- расписание по минутам (24 часа) ---------- */
:root {
  --c-free: #34c759; --c-some: #a5d63f; --c-last: #ffcc00; --c-full: #ff3b30; --c-mine: #5856d6; --c-sel: #007aff;
}
:root[data-theme="dark"] {
  --c-free: #30d158; --c-some: #9acd32; --c-last: #ffd60a; --c-full: #ff453a; --c-mine: #5e5ce6; --c-sel: #0a84ff;
}
.t-mine { --k: var(--c-mine); }

.day-toggle {
  margin-top: 10px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--fill);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.25s var(--ease);
}
.day-toggle:active { transform: scale(0.98); }
.day-toggle svg:first-child { width: 19px; height: 19px; color: var(--blue); }
.day-toggle span { flex: 1; text-align: left; }
.day-toggle svg:last-child { width: 15px; height: 15px; color: var(--label3); transform: rotate(90deg); transition: transform 0.3s var(--ease); }
.day-toggle.open svg:last-child { transform: rotate(-90deg); }

.day { margin-top: 14px; animation: appear 0.35s var(--ease) both; }
.day-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--label2); }
.day-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--mc); margin-right: 5px; vertical-align: -1px; }
.day-hint { margin: 8px 0 10px; font-size: 13px; line-height: 1.35; color: var(--label2); }

/* цвет состояния минуты */
.free { --mc: var(--c-free); }
.some { --mc: var(--c-some); }
.last { --mc: var(--c-last); }
.full { --mc: var(--c-full); }
.mine { --mc: var(--c-mine); }
.past, .lock { --mc: var(--fill); }
.hour-bar i.sel, .m.sel { --mc: var(--c-sel); }
.hour-bar i.sel.bad, .m.sel.bad { --mc: var(--c-full); background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, 0.35) 4px 7px); }

.hour { border-top: 0.5px solid var(--sep); }
.hour-head { width: 100%; height: 46px; display: flex; align-items: center; gap: 10px; }
.hour-head:disabled { cursor: default; }
.hour-time { width: 44px; flex: none; text-align: left; font-size: 15px; font-weight: 600; }
.hour-bar { flex: 1; min-width: 0; height: 22px; display: flex; gap: 1px; border-radius: 6px; overflow: hidden; }
.hour-bar i { flex: 1; background-color: var(--mc); transition: background-color 0.15s; }
.hour-head > svg { width: 14px; height: 14px; flex: none; color: var(--label3); transition: transform 0.3s var(--ease); }
.hour.open .hour-head > svg { transform: rotate(90deg); color: var(--blue); }
.hour.locked { opacity: 0.45; }

.minutes {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  padding: 2px 0 6px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.minutes.fresh { animation: appear 0.3s var(--ease) both; }
.m {
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background-color: var(--mc);
  cursor: pointer;
  transition: background-color 0.12s, transform 0.2s var(--spring);
}
.m b { font-size: 11px; font-weight: 600; color: rgba(0, 0, 0, 0.55); font-variant-numeric: tabular-nums; pointer-events: none; }
.m.full b, .m.mine b, .m.sel b { color: rgba(255, 255, 255, 0.95); }
.m.past, .m.lock { cursor: default; }
.m.past b, .m.lock b { color: var(--label3); }
.m.sel { transform: scale(0.94); }
.hour-foot { padding: 2px 0 10px; font-size: 12.5px; color: var(--label2); }

/* выезжающая панель закрашенного перерыва */
.paintbar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--safe-b));
  z-index: 35;
  max-width: 600px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 30px;
  transform: translateY(calc(100% + 40px));
  transition: transform 0.45s var(--ease);
}
.paintbar.show { transform: none; }
.pb-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pb-text { flex: 1; min-width: 0; }
.pb-text b { display: block; font: 700 24px/1.15 var(--font-r); letter-spacing: -0.02em; }
.pb-text span { display: block; margin-top: 2px; font-size: 14px; color: var(--label2); }
.pb-text span.err { color: var(--red); font-weight: 500; }
.paintbar .seg { margin-bottom: 12px; }
body.selecting .tabbar { transform: translateY(24px); opacity: 0; pointer-events: none; }
body.selecting .page { padding-bottom: calc(240px + var(--safe-b)); }
.m, .hour-bar i, .day-legend i { font-style: normal; }
.slots-card .day-legend { margin-top: -4px; }
.slots-card .day { margin-top: 4px; animation: none; }
.slots-card .hour:first-child { border-top: 0; }
.slots-card .next-free { margin-top: 6px; }
.hour-head { height: 42px; }
.senior-entry { margin-top: 28px; }
.app-icon.sm { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 14px; }
.app-icon.sm svg { width: 38px; height: 38px; }
.lt-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.lt-actions .av-btn { margin-bottom: 0; }
.lt-actions { margin-bottom: 3px; }
.pill-btn {
  height: 32px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  background: var(--fill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
}
.pill-btn svg { width: 16px; height: 16px; color: var(--orange); }
.shield-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 149, 0, 0.16); color: var(--orange); }
.shield-btn svg { width: 20px; height: 20px; }

/* ---------- нормы: длинный и короткий ---------- */
.k-short { --k: var(--orange); --k-soft: rgba(255, 149, 0, 0.15); }
.k-long { --k: var(--green); --k-soft: rgba(52, 199, 89, 0.15); }
.kind-badge.k-short, .sq.k-short { background: var(--orange); }
.sq.k-long { background: var(--green); }

#quota:not(:empty) { margin-top: 12px; }
.quota-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.q-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.q-ring { position: relative; width: 56px; height: 56px; flex: none; }
.q-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.q-ring circle { fill: none; stroke-width: 7; }
.q-ring .tr { stroke: var(--k-soft); }
.q-ring .br { stroke: var(--k); stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.q-ring span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--k); }
.q-ring span svg { width: 20px; height: 20px; transform: none; }
.q-item small { display: block; font-size: 12px; font-weight: 600; color: var(--k); text-transform: uppercase; letter-spacing: 0.03em; }
.q-item b { display: block; font: 700 24px/1.1 var(--font-r); letter-spacing: -0.02em; }
.q-item b i { font: 600 14px var(--font); font-style: normal; color: var(--label2); letter-spacing: 0; }
.q-item div > span { display: block; font-size: 12.5px; color: var(--label2); }

.chip[disabled] { opacity: 0.32; pointer-events: none; }

/* меню длительностей под минутой */
.m.popped { box-shadow: 0 0 0 2.5px var(--label); transform: scale(1.06); z-index: 1; position: relative; }
.minute-pop {
  grid-column: 1 / -1;
  position: relative;
  margin: 6px 0 4px;
  padding: 12px;
  border-radius: 18px;
  background: var(--sheet-cell);
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.35), 0 0 0 0.5px var(--sep);
  transform-origin: calc((var(--col) + 0.5) * 10%) 0;
}
.minute-pop.fresh { animation: pop-in 0.28s var(--spring) both; }
.minute-pop.flat { margin: 12px 0 2px; transform-origin: 50% 0; }
.minute-pop.flat::before { display: none; }
:root[data-theme="dark"] .minute-pop { background: #2c2c2e; }
.minute-pop::before {
  content: "";
  position: absolute;
  top: -6px;
  left: calc((var(--col) + 0.5) * 10% - 7px);
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: inherit;
  transform: rotate(45deg);
}
@keyframes pop-in { from { opacity: 0; transform: scale(0.92) translateY(-4px); } }
.pop-head { position: relative; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pop-head > div { flex: 1; min-width: 0; }
.pop-head b { display: block; font-size: 16px; font-weight: 700; }
.pop-head span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--label2); }
.pop-head .circle-btn { width: 30px; height: 30px; }
.pop-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pop-chip {
  height: 38px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s var(--spring);
}
.pop-chip:active { transform: scale(0.92); }
.pop-chip.short { background: rgba(255, 149, 0, 0.18); color: var(--orange); }
.pop-chip[disabled] { background: var(--fill); color: var(--label3); }
.pop-chip.busy[disabled] { background: rgba(255, 59, 48, 0.1); color: var(--red); text-decoration: line-through; opacity: 0.7; }
.pop-note { margin: 10px 2px 0; font-size: 12px; color: var(--label2); line-height: 1.35; }

/* ---------- выдача доступа старшего ---------- */
.grant-box { padding: 12px; }
.grant-row { display: flex; align-items: center; gap: 10px; }
.grant-num {
  width: 84px;
  height: 44px;
  flex: none;
  border: 0;
  outline: none;
  border-radius: 12px;
  background: var(--fill);
  text-align: center;
  font: 700 22px var(--font-r);
  color: var(--label);
  -moz-appearance: textfield;
}
.grant-num::-webkit-inner-spin-button, .grant-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.grant-row .seg { flex: 1; margin: 0; }
.grant-box .chips { padding: 12px 0; }
.grant-box .btn svg { width: 18px; height: 18px; }

/* ---------- супер-админ, права, история ---------- */
.t-gray { --k: #8e8e93; --k-soft: rgba(142, 142, 147, 0.16); }
.role-tag.super { background: rgba(255, 59, 48, 0.15); color: var(--red); }
.nav-group { margin-bottom: 14px; }
.history-entry { margin-top: 28px; }
.right-row { width: 100%; text-align: left; gap: 12px; justify-content: flex-start; }
.right-row .cell-text { flex: 1; }
.right-row[disabled] { opacity: 0.6; }
.right-row:not([disabled]):active { background: var(--fill); }
.check {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--label3);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background-color 0.2s, border-color 0.2s, transform 0.25s var(--spring);
}
.check svg { width: 15px; height: 15px; }
.check.on { background: var(--blue); border-color: var(--blue); color: #fff; transform: scale(1.06); }
.rights .s-row + .s-row::before { left: 64px; }
.hist .hist-row { gap: 12px; align-items: center; padding: 10px 16px; }
.hist-row .sq { width: 30px; height: 30px; border-radius: 50%; }
.hist-row .sq svg { width: 16px; height: 16px; }
.hist-row .cell-text { flex: 1; }
.hist-row .cell-text > span { white-space: normal; }
.hist .s-row + .s-row::before { left: 58px; }
.hist-row .cell-text b { white-space: normal; line-height: 1.25; }

/* начало смены в расписании (по МСК) */
.shift-sep { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.shift-sep::before, .shift-sep::after { content: ""; flex: 1; height: 1px; background: var(--blue-soft); }
.shift-sep + .hour { border-top: 0; }
.shield-btn.super { background: rgba(255, 59, 48, 0.14); color: var(--red); }
.app-icon.super-icon { background: linear-gradient(180deg, #ff6b5e, #e5312a); box-shadow: 0 16px 34px -12px rgba(229, 49, 42, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

/* ---------- быстрый выбор времени ---------- */
.empty-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.empty-row .empty-ic { width: 42px; height: 42px; margin: 0; flex: none; }
.empty-row .empty-ic svg { width: 22px; height: 22px; }
.empty-row b { display: block; font-size: 16px; font-weight: 600; }
.empty-row div > span { display: block; margin-top: 1px; font-size: 13.5px; color: var(--label2); line-height: 1.3; }

.quick {
  display: flex;
  gap: 8px;
  margin: 12px -16px 0;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.quick::-webkit-scrollbar { display: none; }
.qt {
  flex: none;
  height: 38px;
  padding: 0 13px 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 12px;
  background: var(--fill);
  background: color-mix(in srgb, var(--mc) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 35%, transparent);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  scroll-snap-align: start;
  transition: transform 0.2s var(--spring), background-color 0.2s, color 0.2s;
}
.qt i { width: 8px; height: 8px; border-radius: 50%; background: var(--mc); flex: none; }
.qt:active { transform: scale(0.94); }
.qt.on { background: var(--blue); box-shadow: none; color: #fff; }
.qt.on i { box-shadow: 0 0 0 2px #fff; }
.qt[disabled] { color: var(--label3); text-decoration: line-through; }
.slots-head .card-eyebrow { white-space: nowrap; }

.day-sub { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; padding-top: 14px; border-top: 0.5px solid var(--sep); }
.day-sub b { font-size: 15px; font-weight: 600; }
.day-sub span { font-size: 12.5px; color: var(--label2); }
.slots-card .day-legend { margin: 0 0 6px; }

.hour.locked-sum { display: flex; align-items: center; gap: 10px; padding: 12px 0 4px; color: var(--label2); }
.hour.locked-sum > svg { width: 16px; height: 16px; flex: none; color: var(--label3); }
.locked-sum b { display: block; font-size: 14px; font-weight: 600; color: var(--label2); }
.locked-sum span { display: block; font-size: 12.5px; color: var(--label3); }

/* «Отменить» в острове сразу после сохранения */
.island.has-act { padding-right: 6px; }
.island.has-act.show { pointer-events: auto; }
.island-act {
  flex: none;
  height: 30px;
  margin-left: 4px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.island-act:active { background: rgba(255, 255, 255, 0.28); }

/* «Очистить все» под списком смены */
.clear-all {
  width: 100%;
  height: 50px;
  margin-top: 10px;
  border-radius: 16px;
  background: var(--cell);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s var(--spring), background-color 0.15s;
}
.clear-all svg { width: 18px; height: 18px; }
.clear-all:active { transform: scale(0.98); background: var(--cell-press); }

/* час до и после своего перерыва — туда новый не поставить */
.gap { --mc: var(--fill2); }
.m.gap, .hour-bar i.gap, .day-legend .gap i, .qt.gap i {
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(127, 127, 127, 0.28) 3px 5px);
}
.m.gap b { color: var(--label3); }
.qt.gap[disabled] { text-decoration: none; }
.quick-note { margin: 6px 2px 0; font-size: 12.5px; color: var(--label2); }
