/* ============================================================
   Ladyschool · стили. Токены из docs/DESIGN.md
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #F6F4F5;
  --surface: #FFFFFF;
  --surface-2: #EFEAED;
  --line: #E3DCE0;
  --text: #1F1A1E;
  --text-2: #6F6670;
  --accent: #7B2D55;
  --accent-hover: #8E3A64;
  --accent-soft: #F7E7EF;
  --accent-text: #FFFFFF;
  --s-idle: #9A9298;
  --s-active: #2F6BE0;
  --s-wait: #C8860A;
  --s-ok: #2E9E62;
  --s-bad: #D6455F;
  --s-idle-soft: #EFEAED;
  --s-active-soft: #E6EDFC;
  --s-wait-soft: #FBF0DA;
  --s-ok-soft: #E2F4EA;
  --s-bad-soft: #FBE5EA;
  --shadow: 0 1px 2px rgba(31, 26, 30, 0.06);
  --shadow-lg: 0 12px 32px rgba(31, 26, 30, 0.18);
  --backdrop: rgba(31, 26, 30, 0.38);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-card: 12px;
  --r-btn: 10px;
  --r-field: 10px;
  --pad-card: 14px;
  --gap-card: 10px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171316;
    --surface: #211B1F;
    --surface-2: #2A2328;
    --line: #372E34;
    --text: #F1ECEF;
    --text-2: #A79DA3;
    --accent: #E39AB9;
    --accent-hover: #EBB0C8;
    --accent-soft: #3A2530;
    --accent-text: #1F1A1E;
    --s-bad: #E86A82;
    --s-wait: #E0A43A;
    --s-idle-soft: #2A2328;
    --s-active-soft: #1F2B45;
    --s-wait-soft: #3A3020;
    --s-ok-soft: #1F3529;
    --s-bad-soft: #3A2329;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171316;
  --surface: #211B1F;
  --surface-2: #2A2328;
  --line: #372E34;
  --text: #F1ECEF;
  --text-2: #A79DA3;
  --accent: #E39AB9;
  --accent-hover: #EBB0C8;
  --accent-soft: #3A2530;
  --accent-text: #1F1A1E;
  --s-bad: #E86A82;
  --s-wait: #E0A43A;
  --s-idle-soft: #2A2328;
  --s-active-soft: #1F2B45;
  --s-wait-soft: #3A3020;
  --s-ok-soft: #1F3529;
  --s-bad-soft: #3A2329;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --backdrop: rgba(0, 0, 0, 0.55);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; margin: 0; text-align: inherit; }
button:disabled { cursor: default; opacity: 0.55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
svg.ic { width: 24px; height: 24px; flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.wrap { overflow-wrap: anywhere; }
.mt { margin-top: 10px; }
.mt-l { margin-top: 18px; }
.mb { margin-bottom: 10px; }
.t-bad { color: var(--s-bad); } .t-wait { color: var(--s-wait); } .t-ok { color: var(--s-ok); } .t-active { color: var(--s-active); } .t-idle { color: var(--text-2); } .t-accent { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Корень приложения ---------- */
#app {
  container-type: inline-size;
  container-name: app;
  position: relative;
  height: 100vh;
  height: 100dvh;
  height: var(--tg-viewport-stable-height, 100dvh);
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.boot { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--text-2); font-size: 14px; }

/* Демо-панель */
.demo-bar {
  flex: none; z-index: 5;
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 6px 12px; padding-top: calc(6px + var(--safe-top));
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.demo-bar .demo-title { font-weight: 600; color: var(--text); white-space: nowrap; }
.demo-bar .demo-spacer { flex: 1; }
.demo-bar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.demo-bar .seg::-webkit-scrollbar { display: none; }
.demo-bar .seg button { min-height: 30px; padding: 3px 10px; font-size: 12px; }
.demo-bar .seg--theme button { padding: 3px 8px; }
.demo-bar .seg--theme svg.ic { width: 16px; height: 16px; }
@container app (max-width: 759px) {
  .demo-bar .demo-title span { display: none; }
  .demo-bar .seg--role { order: 10; flex: 1 1 100%; }
}

/* ---------- Каркас ---------- */
.app-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; font-size: 16px; }
.layout { display: flex; flex: 1; min-height: 0; }
.sidebar {
  display: none; width: 232px; flex: none;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 16px 10px; overflow-y: auto;
}
.sb-brand { display: flex; align-items: baseline; gap: 8px; padding: 4px 12px 16px; }
.wordmark { font-weight: 500; font-size: 13px; letter-spacing: 0.04em; color: var(--text-2); line-height: 1; }
.wordmark-sub { font-size: 12px; color: var(--text-2); font-weight: 400; }
.sb-group { margin-top: 12px; }
.sb-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); padding: 6px 12px; font-weight: 500; }
.sb-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 38px; padding: 6px 12px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 14px;
}
.sb-item svg.ic { color: var(--text-2); width: 20px; height: 20px; }
.sb-item:hover { background: var(--surface-2); }
.sb-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.sb-item[aria-current="page"] svg.ic { color: var(--accent); }
.sb-item .badge { margin-left: auto; }
.sb-me { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; width: 100%; border-radius: 0; }
.sb-me:hover { background: var(--surface-2); }
.sb-me .grow { min-width: 0; }
.sb-me b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar {
  display: flex; align-items: center; gap: 8px; flex: none;
  min-height: 56px; padding: 8px 12px 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .wordmark { font-size: 13px; }
.topbar .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--s-ok); }
.main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 16px 32px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.screen { min-height: 100%; }
.page-head { display: none; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.page-head .head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.phone-actions { margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.phone-actions .btn { flex: 1 1 auto; }
.tabbar { display: flex; flex: none; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.tabbar button {
  flex: 1; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 2px; font-size: 11px; font-weight: 500; color: var(--text-2); position: relative;
}
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar button svg.ic { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--accent); }
.tabbar .dot { position: absolute; top: 8px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--s-bad); border: 2px solid var(--surface); }

@container app (min-width: 760px) {
  :root { --pad-card: 16px; }
  .app-shell { font-size: 15px; }
  .sidebar { display: block; }
  .topbar { display: none; }
  .tabbar { display: none; }
  .page-head { display: flex; }
  .phone-actions { display: none; }
  .main { padding: 24px 28px 40px; }
  .screen { max-width: 1120px; }
}

/* ---------- Аватары, бейджи, чипы ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--s-bad); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap;
  background: var(--s-idle-soft); color: var(--text-2);
}
.chip--idle { background: var(--s-idle-soft); color: var(--text-2); }
.chip--active { background: var(--s-active-soft); color: var(--s-active); }
.chip--wait { background: var(--s-wait-soft); color: var(--s-wait); }
.chip--ok { background: var(--s-ok-soft); color: var(--s-ok); }
.chip--bad { background: var(--s-bad-soft); color: var(--s-bad); }
.chip--accent { background: var(--accent-soft); color: var(--accent); }
.chip--type { background: var(--surface-2); color: var(--text-2); }
.chip--outline { background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.chip svg.ic { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: -2px -2px 8px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.fchip .n { color: var(--text-2); font-variant-numeric: tabular-nums; }
.fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.fchip[aria-pressed="true"] .n { color: var(--accent-text); opacity: 0.85; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 999px; max-width: 100%; }
.seg button { min-height: 34px; padding: 4px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg--block { display: flex; }
.seg--block button { flex: 1; justify-content: center; }
.seg-scroll { overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.seg-scroll::-webkit-scrollbar { display: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 14px; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn--primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--danger { color: var(--s-bad); }
.btn--sm { min-height: 40px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn svg.ic { width: 18px; height: 18px; }
.btn.is-busy { opacity: 0.6; pointer-events: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; color: var(--text-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.actions .btn { flex: 1 1 auto; }
.actions--start .btn { flex: 0 0 auto; }
.link-btn { color: var(--accent); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
@container app (min-width: 760px) {
  .btn { min-height: 38px; }
  .btn--sm { min-height: 32px; }
  .icon-btn { width: 36px; height: 36px; }
  .actions .btn { flex: 0 0 auto; }
  .fchip { min-height: 32px; }
  .link-btn { min-height: 32px; }
}

/* ---------- Секции, карточки, строки ---------- */
.section { margin-bottom: 22px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-size: 16px; flex: 1; min-width: 0; }
.section-head .counter { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.section-head--btn { width: 100%; min-height: 44px; }
.section-head--btn svg.ic { color: var(--text-2); width: 20px; height: 20px; }
.list { display: flex; flex-direction: column; gap: var(--gap-card); }
.card {
  position: relative; display: block; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--pad-card); padding-left: calc(var(--pad-card) + 3px); overflow: hidden;
  --stripe: transparent; color: var(--text);
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.card[data-sev="bad"] { --stripe: var(--s-bad); }
.card[data-sev="wait"] { --stripe: var(--s-wait); }
.card[data-sev="active"] { --stripe: var(--s-active); }
.card[data-sev="ok"] { --stripe: var(--s-ok); }
.card[data-sev="idle"] { --stripe: var(--s-idle); }
.card[data-sev="accent"] { --stripe: var(--accent); }
.card--plain { padding-left: var(--pad-card); }
.card--plain::before { display: none; }
.card--btn { cursor: pointer; text-align: left; }
.card--btn:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.card--tight { padding: 6px; }
.card--out { animation: card-out 0.25s ease forwards; }
@keyframes card-out { to { opacity: 0; transform: translateX(24px); } }
.card-type { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 4px; flex-wrap: wrap; }
.card-title { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; line-height: 1.3; }
.card-meta { font-size: 13px; color: var(--text-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.card-meta .timer { font-weight: 600; font-variant-numeric: tabular-nums; }
.dotsep > *:not(:last-child)::after { content: "·"; margin-left: 6px; color: var(--text-2); }
.inline-menu { margin-top: 10px; padding: 8px; background: var(--surface-2); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.inline-menu .lbl { font-size: 12px; color: var(--text-2); padding: 2px 6px; }
.inline-menu .btn { justify-content: flex-start; text-align: left; white-space: normal; background: var(--surface); }

.row-btn {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  min-height: 60px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  color: var(--text); position: relative; overflow: hidden; --stripe: transparent;
}
.row-btn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.row-btn[data-sev="bad"] { --stripe: var(--s-bad); }
.row-btn[data-sev="wait"] { --stripe: var(--s-wait); }
.row-btn[data-sev="active"] { --stripe: var(--s-active); }
.row-btn[data-sev="ok"] { --stripe: var(--s-ok); }
.row-btn:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.row-btn .grow { flex: 1; min-width: 0; }
.row-btn .side { flex: none; text-align: right; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 45%; }
.row-title { font-weight: 600; overflow-wrap: anywhere; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-title svg.ic { width: 16px; height: 16px; color: var(--text-2); }
.row-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.row-line { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.row-line .timer { font-weight: 600; font-variant-numeric: tabular-nums; }
.row-btn .avatar { margin-top: 2px; }

.brief { background: var(--accent-soft); border-radius: var(--r-card); padding: var(--pad-card); }
.brief .lbl { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.brief ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.note { font-size: 13px; color: var(--text-2); padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.empty { padding: 20px 14px; text-align: center; color: var(--text-2); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--r-card); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.error-box { padding: 24px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-box h2 { font-size: 18px; }
.error-box p { color: var(--text-2); font-size: 14px; max-width: 420px; }
.loading { color: var(--text-2); font-size: 14px; padding: 12px 0; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton i { display: block; height: 60px; border-radius: var(--r-card); background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

/* Чекбоксы и переключатели */
.check { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--text); }
.check:hover { background: var(--surface-2); }
.check .box { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 2px solid var(--s-idle); display: flex; align-items: center; justify-content: center; color: #fff; }
.check .box svg.ic { width: 14px; height: 14px; opacity: 0; }
.check[aria-checked="true"] .box { background: var(--s-ok); border-color: var(--s-ok); }
.check[aria-checked="true"] .box svg.ic { opacity: 1; }
.check[aria-checked="true"] .check-text { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--line); }
.check .check-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.check .check-sub { display: block; font-size: 12px; color: var(--text-2); text-decoration: none; }
.check--overdue .check-sub { color: var(--s-bad); }
.check--sm { min-height: 40px; padding: 6px 8px; }
.switch { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 0; text-align: left; border-bottom: 1px solid var(--line); color: var(--text); }
.switch:last-child { border-bottom: 0; }
.switch .sw-text { flex: 1; min-width: 0; }
.switch .sw-sub { font-size: 12px; color: var(--text-2); }
.switch .knob { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--s-idle); position: relative; transition: background 0.2s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch[aria-checked="true"] .knob { background: var(--s-ok); }
.switch[aria-checked="true"] .knob::after { transform: translateX(18px); }
.switch[aria-checked="mixed"] .knob { background: var(--s-wait); }
.switch[aria-checked="mixed"] .knob::after { transform: translateX(9px); }
@container app (min-width: 760px) { .check { min-height: 38px; padding: 6px 10px; } }

/* Плитки */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; min-width: 0; color: var(--text); }
.tile .lbl { font-size: 12px; color: var(--text-2); margin-bottom: 4px; overflow-wrap: anywhere; }
.tile .val { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.tile .val small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.tile .sub { font-size: 12px; color: var(--text-2); margin-top: 4px; overflow-wrap: anywhere; }
.tile .big { font-weight: 700; font-size: 32px; line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile .big small { font-size: 14px; color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.tile-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tile-head h3 { font-size: 14px; flex: 1; min-width: 0; }
.tile ul.mini { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tile ul.mini li { display: flex; justify-content: space-between; gap: 8px; }
.tile ul.mini li span { color: var(--text-2); min-width: 0; }
.tile ul.mini li b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile--btn { cursor: pointer; text-align: left; width: 100%; }
.tile--btn:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.tile[data-sev="bad"] { border-color: color-mix(in srgb, var(--s-bad) 45%, var(--line)); }
@container app (max-width: 519px) {
  .tiles--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles--3 > :nth-child(3) { grid-column: 1 / -1; }
}
@container app (min-width: 760px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Бары, графики */
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar--ok > i { background: var(--s-ok); }
.bar--bad > i { background: var(--s-bad); }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.progress-line .bar { flex: 1; }
.progress-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar .track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar .track > i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.spark { display: block; max-width: 100%; height: auto; }
.heat { display: grid; grid-template-columns: 30px repeat(12, minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--text-2); align-items: center; }
.heat .hl { text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.heat .hc { aspect-ratio: 1; min-height: 12px; border-radius: 3px; background: var(--surface-2); }
.heat .hh { text-align: center; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }

/* Таблицы */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 600; font-size: 12px; color: var(--text-2); white-space: nowrap; background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl--tight { min-width: 0; }
.tbl tr.is-btn { cursor: pointer; }
.tbl tr.is-btn:hover td { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.tbl .cell-btn { display: block; width: 100%; min-height: 32px; text-align: left; color: var(--text); font-weight: 500; }

/* Формы */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r-field);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 16px;
}
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--s-bad); }
.search { position: relative; }
.search svg.ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); width: 20px; height: 20px; }
.search .input { padding-left: 40px; }
.ask { display: flex; gap: 8px; }
.ask .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .span { grid-column: 1 / -1; }
.hours { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.hours .input { width: 104px; min-height: 40px; text-align: center; }
.reply { display: flex; gap: 8px; align-items: flex-end; }
.reply .textarea { flex: 1; min-height: 44px; max-height: 160px; }
.reply .btn { flex: none; }
@container app (min-width: 760px) { .input, .select { min-height: 40px; font-size: 15px; } .textarea { font-size: 15px; } }
@container app (max-width: 419px) { .form-grid { grid-template-columns: 1fr; } }

/* Сообщения, текст */
.msgs { display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 14px; background: var(--surface-2); overflow-wrap: anywhere; }
.msg .t { display: block; font-size: 11px; color: var(--text-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.msg--out { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.msg--in { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg--media::before { content: "Вложение · "; color: var(--text-2); font-size: 12px; }
.script-card { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; }
.script-card .grow { flex: 1; min-width: 0; }
.draft { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.draft .lbl { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: minmax(96px, 130px) 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.rich { font-size: 14px; }
.rich p { margin: 0 0 10px; }
.rich h4, .rich h3, .rich h2 { font-size: 14px; margin: 12px 0 6px; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 20px; }
.rich li { margin-bottom: 3px; }
.rich code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.rich pre { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; line-height: 1.4; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 6px 0; font-size: 13px; position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 5px; }
.timeline li[data-sev="ok"]::before { background: var(--s-ok); }
.timeline li[data-sev="bad"]::before { background: var(--s-bad); }
.timeline li[data-sev="active"]::before { background: var(--s-active); }
.timeline li[data-sev="wait"]::before { background: var(--s-wait); }
.timeline .tl-meta { color: var(--text-2); font-size: 12px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.mini-list li { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.mini-list li svg.ic { width: 18px; height: 18px; margin-top: 2px; }
.mini-list li .t { color: var(--text-2); font-size: 12px; white-space: nowrap; margin-left: auto; }

/* Меню «Ещё» */
.menu { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg.ic { color: var(--text-2); }
.menu-item .grow { flex: 1; min-width: 0; }
.menu-item .sub { font-size: 12px; color: var(--text-2); }
.menu-item .chev { color: var(--text-2); }

/* Календарь недели */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; padding: 6px 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--text-2); }
.day b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.day[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.day[aria-pressed="true"] b { color: var(--accent); }
.day .dots { display: flex; gap: 2px; min-height: 6px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--s-idle); }
.day .dots i.a { background: var(--accent); }
.day .dots i.b { background: var(--s-bad); }

/* Задачи: доска и строки */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { flex: 0 0 250px; background: var(--surface-2); border-radius: var(--r-card); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13px; font-weight: 600; }
.col-head .n { color: var(--text-2); font-weight: 500; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; text-align: left; color: var(--text); }
.task-card .t { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.task-card .m { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--text-2); }
@container app (min-width: 760px) {
  .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .col { flex: auto; }
}
.task-row { display: flex; align-items: flex-start; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 6px 10px 6px 6px; }
.task-row .check { min-height: 44px; width: auto; padding: 10px 8px; flex: none; }
.task-row .task-open { flex: 1; min-width: 0; padding: 8px 4px; text-align: left; color: var(--text); min-height: 44px; }
.task-row .task-open .t { font-weight: 500; overflow-wrap: anywhere; font-size: 15px; }
.task-row.is-done .task-open .t { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--line); }
.task-row .task-open .m { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.task-row .side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 10px; }

/* Скоркарта */
.crit { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; width: 100%; text-align: left; color: var(--text); min-height: 44px; }
.crit:last-child { border-bottom: 0; }
.crit .mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; margin-top: 1px; }
.crit .mark--ok { background: var(--s-ok-soft); color: var(--s-ok); }
.crit .mark--bad { background: var(--s-bad-soft); color: var(--s-bad); }
.crit .mark--none { background: var(--surface-2); color: var(--text-2); }
.crit .c { font-size: 12px; color: var(--text-2); }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Шаги ритуала */
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); }
.steps i.on { background: var(--accent); }
.ok-block { text-align: center; padding: 24px 12px; }
.ok-block .ring { width: 56px; height: 56px; border-radius: 50%; background: var(--s-ok-soft); color: var(--s-ok); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.ok-block .ring svg.ic { width: 28px; height: 28px; }

/* Статус платформы */
.status-list { display: flex; flex-direction: column; gap: 2px; }
.status-item { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; width: 100%; text-align: left; color: var(--text); min-height: 44px; }
.status-item .ind { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.status-item .grow { flex: 1; min-width: 0; }
.status-item .sub { font-size: 12px; color: var(--text-2); }
.ind--ok { background: var(--s-ok-soft); color: var(--s-ok); }
.ind--warn { background: var(--s-wait-soft); color: var(--s-wait); }
.ind--bad { background: var(--s-bad-soft); color: var(--s-bad); }
.ind--idle { background: var(--surface-2); color: var(--text-2); }
.ind svg.ic { width: 15px; height: 15px; }
.flag-list { display: flex; flex-direction: column; gap: 6px; }
.flag { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--s-bad-soft); color: var(--text); font-size: 14px; width: 100%; text-align: left; min-height: 44px; }
.flag .ind { flex: none; }
.flag .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flag .chev { color: var(--s-bad); }

/* Две колонки на десктопе */
.cols { display: grid; grid-template-columns: 1fr; gap: 18px; }
@container app (min-width: 760px) { .cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } .cols--eq { grid-template-columns: 1fr 1fr; } }

/* Схема подключения (текстом) */
.scheme { display: flex; flex-direction: column; gap: 6px; align-items: stretch; font-size: 13px; }
.scheme .box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); text-align: center; }
.scheme .arrow { text-align: center; color: var(--text-2); font-size: 12px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; counter-increment: s; }
.steps-list li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }

/* ---------- Шторки и тосты ---------- */
.sheet-host { position: absolute; inset: 0; z-index: 30; display: none; }
.sheet-host.open { display: block; }
.backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity 0.2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%;
  background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.25s ease, opacity 0.2s ease;
  padding-bottom: var(--safe-bottom);
}
.sheet-host.in .backdrop { opacity: 1; }
.sheet-host.in .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { font-size: 17px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sheet-body { overflow-y: auto; padding: 16px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex: none; background: var(--surface); }
.sheet-foot .btn { flex: 1 1 auto; }
@container app (min-width: 760px) {
  .sheet { left: auto; top: 0; bottom: 0; width: 440px; max-width: 100%; max-height: none; border-radius: 0; border-left: 1px solid var(--line); transform: translateX(100%); padding-bottom: 0; }
  .sheet-host.in .sheet { transform: none; }
  .sheet-foot .btn { flex: 0 0 auto; }
}
.toasts { position: absolute; left: 16px; right: 16px; bottom: calc(76px + var(--safe-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; max-width: 100%; box-shadow: var(--shadow-lg); animation: toast-in 0.2s ease; overflow-wrap: anywhere; }
.toast--bad { background: var(--s-bad); color: #fff; }
.toast.hide { opacity: 0; transition: opacity 0.3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@container app (min-width: 760px) { .toasts { left: auto; right: 20px; bottom: 20px; align-items: flex-end; } }

/* Профиль */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head h2 { font-size: 20px; }
.pending-box { max-width: 480px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 0 16px; }
.pending-box h1 { font-size: 22px; }
.pending-box p { color: var(--text-2); }

/* ---------- График смен ---------- */
.sched-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.sched-nav .sched-title { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.sched-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); -webkit-overflow-scrolling: touch; max-width: 100%; }
.sched { display: grid; grid-template-columns: minmax(176px, 1.6fr) repeat(7, minmax(64px, 1fr)); min-width: 660px; }
.sched-row { display: contents; }
.sched-name { position: sticky; left: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 44px; min-width: 0; }
.sched-name .grow { min-width: 0; display: flex; flex-direction: column; }
.sched-name .n { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-name .r { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-cell { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px; border-bottom: 1px solid var(--line); border-left: 1px solid transparent; color: var(--text); width: 100%; }
button.sched-cell:hover { background: var(--surface-2); }
.sched-cell.is-today { background: var(--accent-soft); }
.sched-head .sched-cell, .sched-head .sched-name { background: var(--surface-2); position: sticky; top: 0; z-index: 3; }
.sched-head .sched-name { z-index: 4; }
.sched-head .sched-cell.is-today { background: var(--accent-soft); color: var(--accent); }
.sched-day { flex-direction: column; gap: 0; font-size: 11px; color: var(--text-2); line-height: 1.2; }
.sched-day b { font-size: 15px; color: inherit; font-variant-numeric: tabular-nums; }
.sh { display: inline-flex; align-items: center; gap: 4px; position: relative; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.sh--work { background: var(--s-active-soft); color: var(--s-active); }
.sh--off { background: var(--s-idle-soft); color: var(--text-2); }
.sh--default { background: transparent; border: 1px dashed var(--line); color: var(--text-2); font-weight: 500; }
.sh-note { position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--s-wait); }
.legend .sh { margin-right: 6px; padding: 0 7px; line-height: 16px; font-size: 11px; }
.sched-today { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sched-today:last-child { border-bottom: 0; }
.sched-today .who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sched-today .who > span { display: flex; flex-direction: column; min-width: 0; }
.sched-today .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-today .r { font-size: 12px; color: var(--text-2); }
.sched-today .num { font-weight: 600; white-space: nowrap; }
.sched-off { padding: 8px; font-size: 13px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.preset { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: center; }
.preset b { font-size: 14px; font-variant-numeric: tabular-nums; }
.preset span { font-size: 11px; color: var(--text-2); }
.preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.preset[aria-pressed="true"] span { color: var(--accent); }
.preset:disabled { opacity: 0.6; }
@container app (max-width: 419px) { .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Этапы процесса (возвраты) ---------- */
.stepper { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; counter-reset: st; }
.stepper li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); text-align: center; position: relative; padding-top: 2px; }
.stepper li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--s-ok); }
.stepper li i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 2px solid var(--surface); }
.stepper li i svg.ic { width: 14px; height: 14px; }
.stepper li.is-done i { background: var(--s-ok); color: #fff; }
.stepper li.is-current i { background: var(--accent); color: var(--accent-text); }
.stepper li.is-current { color: var(--text); font-weight: 600; }
.stepper--failed li.is-current i { background: var(--s-bad); color: #fff; }
.stepper--failed li.is-current::before { background: var(--s-bad); }
.stepper li span { overflow-wrap: anywhere; line-height: 1.2; }

/* ---- Смены/отпуска и общие аккаунты ---- */
:root {
  --to-vac: #6B4FA3;        /* отпуск — приглушённый лиловый */
  --to-vac-soft: #ECE6F7;
  --to-sick: #1F7A74;       /* больничный — приглушённый бирюзовый */
  --to-sick-soft: #DFF0EE;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --to-vac: #C7B3F0; --to-vac-soft: #2E2743; --to-sick: #86CFC8; --to-sick-soft: #1B3432; }
}
:root[data-theme="dark"] { --to-vac: #C7B3F0; --to-vac-soft: #2E2743; --to-sick: #86CFC8; --to-sick-soft: #1B3432; }
.sh--vac { background: var(--to-vac-soft); color: var(--to-vac); }
.sh--sick { background: var(--to-sick-soft); color: var(--to-sick); }
/* Полоса «Сейчас отсутствуют» над графиком и строка на «Сейчас» */
.away-strip, .away-line {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; margin-bottom: 12px; border-radius: 10px;
  background: var(--to-vac-soft); color: var(--text); font-size: 13px; text-align: left;
}
.away-strip svg.ic, .away-line svg.ic { width: 18px; height: 18px; color: var(--to-vac); flex: none; }
.away-strip > span, .away-line > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.away-line { margin-bottom: 0; cursor: pointer; }
.away-line:hover { background: color-mix(in srgb, var(--to-vac-soft) 85%, var(--to-vac)); }
.away-line .ic:last-child { color: var(--text-2); width: 16px; height: 16px; }
/* Заявки на отпуск: строка с действиями под описанием */
.toff .row-title .chip { font-weight: 500; }
.toff .row-sub { margin-top: 4px; }
.toff .actions { margin-top: 8px; }
.toff .side { max-width: 40%; }
@container app (max-width: 419px) {
  .toff { flex-wrap: wrap; }
  .toff .side { order: 3; width: 100%; max-width: none; align-items: flex-start; }
}

/* ---- v2: финансы, админ, темы ---- */
:root {
  --fin-bar: var(--accent);
  --fin-bar-soft: var(--accent-soft);
  --imp-bg: #FFF4D6;          /* полоса «Вы вошли как» — тёплый предупреждающий */
  --imp-text: #6B4A00;
  --imp-line: #F0D48A;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --imp-bg: #3A2F14; --imp-text: #F5D98A; --imp-line: #5A4A1E; }
}
:root[data-theme="dark"] { --imp-bg: #3A2F14; --imp-text: #F5D98A; --imp-line: #5A4A1E; }

/* Полоса «Войти как» над шапкой */
.imp-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--imp-bg); color: var(--imp-text); border-bottom: 1px solid var(--imp-line); font-size: 13px; flex: none; }
.imp-bar svg.ic { width: 18px; height: 18px; flex: none; }
.imp-bar .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.imp-bar .muted { color: inherit; opacity: 0.75; }
.imp-bar .btn { flex: none; background: var(--surface); }
@container app (max-width: 519px) { .imp-bar .muted { display: none; } }

/* Демо-панель: кнопка «Что допилить» */
.demo-bar .demo-fb { min-height: 30px; padding: 3px 10px; font-size: 12px; border-radius: 999px; gap: 4px; white-space: nowrap; }
.demo-bar .demo-fb svg.ic { width: 14px; height: 14px; }
@container app (max-width: 519px) { .demo-bar .demo-fb span { display: none; } }

/* Карточка «Что допилить» на «Ещё» и сетка формы обратной связи */
.fb-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--r-card); background: var(--accent-soft); color: var(--text); text-align: left; }
.fb-card svg.ic { color: var(--accent); flex: none; }
.fb-card .grow { flex: 1; min-width: 0; }
.fb-card .sub { font-size: 12px; color: var(--text-2); }
.fb-card .chev { color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@container app (max-width: 519px) { .grid-2 { grid-template-columns: 1fr; } }

/* Флаги клиенток */
.chip--xs { font-size: 10px; padding: 1px 6px; min-height: 0; line-height: 1.4; vertical-align: middle; margin-left: 6px; }
.flag-stop { margin-left: 6px; font-size: 13px; vertical-align: middle; }
.client-flags { align-items: center; }

/* Финансы: период */
.fin-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.fin-nav { display: flex; align-items: center; gap: 4px; }
.fin-nav b { min-width: 120px; text-align: center; font-size: 15px; }
.fin-nav .icon-btn:disabled { opacity: 0.35; }
.fin-range { display: flex; align-items: center; gap: 8px; }
.fin-range .input { max-width: 170px; }
.tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container app (min-width: 760px) { .tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile[data-sev="wait"] { border-color: color-mix(in srgb, var(--s-wait) 45%, var(--line)); }
/* Финансы: горизонтальные бары */
.fbars { display: flex; flex-direction: column; gap: 10px; }
.fbar-top { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.fbar-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fbar-track > i { display: block; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--fin-bar) 55%, var(--fin-bar-soft)); transition: width 0.3s ease; }
.fbar-track > i.is-top { background: var(--fin-bar); }
/* Финансы: черновики и таблица */
.fin-draft .row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fin-draft .row-title b { font-size: 16px; }
.fin-draft .actions { margin-top: 8px; }
.fin-tbl table.tbl { min-width: 720px; }
.fin-tbl .tbl td { vertical-align: middle; }
.fin-line { background: var(--accent-soft); }
.fin-line svg.ic { color: var(--accent); }

/* Админ: сотрудники */
.adm-user .row-line { flex-wrap: wrap; }
/* Админ: инвайты */
.inv-link { padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.inv-link-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.inv-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; color: var(--text); background: var(--surface); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); flex: 1; min-width: 0; }
/* Админ: матрица доступов */
.acc-wrap { max-height: 70vh; overflow: auto; }
table.acc { min-width: 0; }
.acc th.acc-role { position: sticky; left: 0; z-index: 2; background: var(--surface-2); min-width: 130px; text-align: left; font-weight: 600; color: var(--text); }
.acc tbody th.acc-role { background: var(--surface); border-right: 1px solid var(--line); }
.acc thead th { position: sticky; top: 0; z-index: 3; }
.acc thead th.acc-role { z-index: 4; }
.acc th.acc-col { padding: 6px 4px; text-align: center; width: 44px; min-width: 44px; height: 96px; vertical-align: bottom; white-space: nowrap; }
.acc th.acc-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 500; font-size: 11px; color: var(--text-2); max-height: 84px; overflow: hidden; text-overflow: ellipsis; }
.acc td.acc-cell { text-align: center; padding: 4px; }
.acc-check { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; position: relative; }
.acc-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.acc-check span { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: background 0.15s, border-color 0.15s; }
.acc-check span svg.ic { width: 14px; height: 14px; }
.acc-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.acc-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-check:hover span { border-color: var(--accent); }
.acc .acc-save { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.acc .acc-save .btn { min-height: 32px; padding: 2px 8px; font-size: 12px; }
/* Админ: чаты и темы */
.adm-chat-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.adm-chat-head .grow { flex: 1 1 240px; min-width: 0; }
.adm-chat-purpose { flex: 0 1 300px; min-width: 200px; }
.adm-chat-purpose .select { width: 100%; }
.adm-topics { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.adm-topic { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-topic:last-child { border-bottom: 0; }
.adm-topic .grow { flex: 1 1 160px; min-width: 0; }
.adm-topic-title { font-weight: 500; overflow-wrap: anywhere; }
.adm-topic .select { flex: 0 1 320px; min-width: 0; width: 100%; max-width: 100%; font-size: 13px; }
.adm-topic.is-bound .adm-topic-title::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--s-ok); margin-right: 8px; vertical-align: middle; }
@container app (max-width: 519px) {
  .adm-topic { flex-direction: column; align-items: stretch; gap: 6px; }
  .adm-topic .grow, .adm-topic .select { flex: none; }
  .adm-chat-purpose { flex: 1 1 100%; min-width: 0; }
  .fin-nav b { min-width: 0; }
}

/* Подсказки в заголовках секций — только на широких экранах */
@container app (max-width: 519px) { .hint-wide { display: none; } }

/* ---- v3: компоненты (валюты, калькулятор, шаблоны) ---- */
:root { --v3-mark-bg: #FBF0DA; --v3-mark-fg: #8A5A00; --v3-var-line: color-mix(in srgb, var(--accent) 45%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --v3-mark-bg: #4A3818; --v3-mark-fg: #F2C46B; } }
:root[data-theme="dark"] { --v3-mark-bg: #4A3818; --v3-mark-fg: #F2C46B; }

/* VIP, ссылки на Instagram и Telegram */
.chip--vip svg.ic { width: 12px; height: 12px; }
.ext-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--accent); text-decoration: none; font-size: 14px; max-width: 100%; }
.ext-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext-link svg.ic { width: 18px; height: 18px; flex: none; }
.ext-link:hover span { text-decoration: underline; }

/* Курсы валют: конвертер и строка-виджет */
.fx-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; margin-bottom: 8px; }
.fx-cur { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-cur .select { width: 100%; font-size: 15px; padding-left: 10px; padding-right: 26px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; text-overflow: ellipsis; }
.fx-swap { border: 1px solid var(--line); background: var(--surface); }
.fx-quick { margin-bottom: 12px; }
.fx-result { background: var(--surface-2); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.fx-big { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; color: var(--text); overflow-wrap: anywhere; }
.fx-sub { font-size: 14px; color: var(--text-2); }
.fx-sub b { color: var(--text); }
.fx-rate { font-size: 13px; color: var(--text-2); }
.fx-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--s-wait-soft); color: var(--s-wait); font-size: 13px; }
.fx-warn svg.ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.fx-strip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fx-strip svg.ic { width: 14px; height: 14px; flex: none; }
.fx-strip.is-stale { color: var(--s-wait); }

/* Калькуляторы: цена и оказанные услуги */
.calc-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.calc-head b { font-size: 16px; }
.calc-pkgs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.calc-pkg { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; color: var(--text); }
.calc-pkg:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.calc-pkg[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.calc-pkg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.calc-pkg-top .num { white-space: nowrap; font-weight: 600; }
.calc-disc-row { display: flex; gap: 8px; align-items: center; }
.calc-disc-row .seg { flex: none; }
.calc-disc-row .input { flex: 1; min-width: 0; }
.calc-result { background: var(--surface-2); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.calc-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.calc-big { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; color: var(--text); }
.calc-total s { font-size: 15px; }
.calc-cur { font-size: 14px; color: var(--text-2); margin-top: -6px; }
.calc-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.calc-line svg.ic { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 1px; }
.calc-line .grow { flex: 1; min-width: 0; }
.calc-formula { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--line); overflow-wrap: anywhere; }
.calc-disclaimer { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-2); }
.calc-disclaimer svg.ic { width: 16px; height: 16px; flex: none; }

/* Быстрые ответы */
.tpl-ctx { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tpl-product { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tpl-product .select { width: 100%; text-overflow: ellipsis; }
.tpl-group { margin-bottom: 16px; }
.tpl-group-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: none; margin-bottom: 8px; }
.tpl-group-title .counter { font-weight: 500; }
.tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; margin-bottom: 8px; }
.tpl-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.tpl-text { font-size: 14px; line-height: 1.45; margin-top: 6px; overflow-wrap: anywhere; }
.tpl-card .actions { margin-top: 8px; }
.tpl-var { box-shadow: inset 0 -2px 0 var(--v3-var-line); }
mark.tpl-miss { background: var(--v3-mark-bg); color: var(--v3-mark-fg); border-radius: 4px; padding: 0 3px; font-weight: 600; }
@container app (max-width: 419px) {
  .fx-pair { gap: 6px; }
  .fx-big { font-size: 28px; }
  .calc-big { font-size: 26px; }
  .tpl-card .actions .btn { flex: 1 1 auto; }
}

/* ---- v3: диалоги, разбор продаж, Лилу ---- */
:root {
  --v3-bot-bg: #EAF1FB; --v3-bot-line: #B9CDEB;      /* бот Лилу */
  --v3-cast-bg: #F1ECF8; --v3-cast-line: #D2C3E8;    /* рассылка */
  --v3-mgr-bg: #E9F5EE; --v3-mgr-line: #BFDFCB;      /* менеджер Лилу */
  --v3-fresh: #FFF1C2;                               /* подсветка обновлённого шага */
  --v3-ig: linear-gradient(135deg, #F58529 0%, #DD2A7B 52%, #8134AF 100%);
  --v3-tg: #2A9BD6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --v3-bot-bg: #1D2737; --v3-bot-line: #34496B; --v3-cast-bg: #2A2335; --v3-cast-line: #4A3D61;
    --v3-mgr-bg: #1C2C23; --v3-mgr-line: #2F5040; --v3-fresh: #4A3D17; --v3-tg: #5DB8EA;
  }
}
:root[data-theme="dark"] {
  --v3-bot-bg: #1D2737; --v3-bot-line: #34496B; --v3-cast-bg: #2A2335; --v3-cast-line: #4A3D61;
  --v3-mgr-bg: #1C2C23; --v3-mgr-line: #2F5040; --v3-fresh: #4A3D17; --v3-tg: #5DB8EA;
}

/* Список диалогов: каналы, VIP, ник Instagram под именем */
.fchip svg.ic { width: 16px; height: 16px; }
.ch-filter .chip-row { margin-bottom: 4px; }
.vip-star { display: inline-flex; align-items: center; color: var(--accent); }
.vip-star svg.ic { width: 15px; height: 15px; fill: currentColor; }
.row-title .vip-star svg.ic { color: var(--accent); }
.sheet-head h2 .vip-star { vertical-align: -2px; margin-left: 6px; }
.row-handle { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 13px; color: var(--text-2); min-width: 0; }
.row-handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-handle svg.ic { width: 14px; height: 14px; flex: none; }

/* Баннер «Смена от …» в «Диалогах» */
.ho-banner { border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 14px; }
.ho-head { display: flex; gap: 10px; align-items: flex-start; }
.ho-head .grow { flex: 1; min-width: 0; }
.ho-title { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.ho-note { font-weight: 400; color: var(--text); }
.ho-banner .actions { margin-top: 8px; }
.ho-items { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ho-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ho-open { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; text-align: left; color: var(--text); }
.ho-name { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.ho-links { display: flex; flex-wrap: wrap; gap: 0 14px; }

/* «Сдать смену»: выбор диалогов и предпросмотр сводки как в личке от бота */
.ho-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ho-pick { margin-bottom: 14px; }
.check--pick[aria-checked="true"] .check-text { color: var(--text); text-decoration: none; }
.check--pick[aria-checked="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.ho-pick-name { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.ho-preview { margin-top: 4px; padding: 12px; border-radius: var(--r-card); background: var(--surface-2); border: 1px dashed var(--line); }
.ho-preview-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.ho-preview-title svg.ic { width: 16px; height: 16px; color: var(--v3-tg); }
.ho-preview-msg { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.5; background: var(--surface); color: var(--text); border-radius: 12px 12px 12px 4px; padding: 10px 12px; box-shadow: var(--shadow); }

/* Импорт: файл, примеры форматов, предпросмотр разбора */
.imp-file { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.imp-file .btn { cursor: pointer; }
.imp-ex { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); }
.imp-ex summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--accent); }
.imp-ex-body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.imp-ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.imp-ex-head .btn { margin-left: auto; }
.imp-pre { margin: 6px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.imp-preview { margin-top: 4px; }
.imp-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.imp-errs { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.imp-errs li { display: flex; gap: 6px; align-items: flex-start; color: var(--s-bad); font-size: 13px; }
.imp-errs svg.ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.imp-wrap { margin-top: 8px; }
table.imp-tbl { min-width: 0; }
.imp-tbl tr.is-skip td { opacity: 0.6; }
.imp-tbl td .chip { margin-right: 4px; }
@container app (min-width: 760px) { .sheet:has(.imp-sheet) { width: 760px; } .sheet:has(.conv-sheet) { width: 520px; } }
@container app (max-width: 759px) {
  .imp-tbl thead { display: none; }
  .imp-tbl, .imp-tbl tbody, .imp-tbl tr, .imp-tbl td { display: block; width: 100%; }
  .imp-tbl tr { padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .imp-tbl tr:last-child { border-bottom: 0; }
  .imp-tbl td { border: 0; padding: 2px 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
  .imp-tbl td::before { content: attr(data-l); color: var(--text-2); font-size: 12px; }
  .imp-tbl td.num { text-align: left; white-space: normal; }
}

/* Панель диалога: клиентка, Instagram, сводка */
.conv-sheet .sub-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.conv-sheet .sub-head .counter { color: var(--text-2); font-weight: 500; font-size: 13px; }
.note--bad { display: flex; gap: 8px; align-items: flex-start; border-style: solid; border-color: color-mix(in srgb, var(--s-bad) 45%, var(--line)); background: var(--s-bad-soft); color: var(--text); }
.note--bad svg.ic { width: 18px; height: 18px; color: var(--s-bad); flex: none; }
.cl-block { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 14px; background: var(--surface); }
.cl-top { display: flex; gap: 10px; align-items: flex-start; }
.cl-top .grow { flex: 1; min-width: 0; }
.cl-name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.vip-toggle { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; }
.vip-toggle svg.ic { width: 16px; height: 16px; }
.vip-toggle:hover { background: var(--surface-2); }
.vip-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.vip-toggle[aria-pressed="true"] svg.ic { fill: currentColor; }
.vip-toggle.is-busy { opacity: 0.6; pointer-events: none; }
.cl-flags { margin-top: -4px; }
.ig-cta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.btn--ig { background: var(--v3-ig); color: #fff; border-color: transparent; font-weight: 600; text-decoration: none; }
.btn--ig:hover { background: var(--v3-ig); filter: brightness(1.07); }
.btn--ig svg.ic { color: #fff; }
.ig-handle { font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.ig-cta .icon-btn { width: 36px; height: 36px; }
.ig-cta--empty { justify-content: space-between; padding: 6px 6px 6px 10px; border: 1px dashed var(--line); border-radius: 10px; }
.ig-empty { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; }
.ig-empty svg.ic { width: 18px; height: 18px; }
.ig-edit-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.ig-edit-row .input { flex: 1 1 200px; min-width: 0; }
.cl-links { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: -4px; }
.cl-sum { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.sum-line { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; font-size: 14px; text-align: left; color: var(--text); border-radius: 8px; }
.sum-line > svg.ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.sum-line .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sum-line--btn { padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); }
.sum-line--btn:hover { background: var(--surface-2); }
.sum-line--btn > svg.ic:last-child { width: 16px; height: 16px; color: var(--text-2); }
.sum-line.is-bad, .sum-line.is-bad > svg.ic:first-child { color: var(--s-bad); }
.sum-line.is-bad .grow { font-weight: 600; }
.sum-line.is-loading, .sum-line.is-loading > svg.ic { color: var(--text-2); }
.cl-foot { margin: -6px 0 -6px -10px; }
.course-row { margin-bottom: 4px; }
.course-row .field { margin-bottom: 8px; }
.tool-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-btns .btn { flex: 1 1 auto; }
.ch-banner { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px; border-radius: var(--r-card); background: var(--surface-2); font-size: 14px; }
.ch-banner > svg.ic { width: 22px; height: 22px; flex: none; color: var(--accent); }
.ch-banner .grow { flex: 1; min-width: 0; }
.ch-banner .actions { margin-top: 8px; }
.ch-banner--lee > svg.ic { color: var(--s-active); }
/* Сообщения из Лилу: бот, рассылка и менеджер Лилу — отдельно от клиентки и сотрудниц */
.msg--origin { border: 1px dashed var(--v3-bot-line); background: var(--v3-bot-bg); border-bottom-right-radius: 4px; }
.msg--broadcast { background: var(--v3-cast-bg); border-color: var(--v3-cast-line); }
.msg--manager { background: var(--v3-mgr-bg); border-color: var(--v3-mgr-line); border-style: solid; }
.msg-origin { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.msg-origin svg.ic { width: 13px; height: 13px; }
/* Статус и следующий шаг */
.st-card { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.st-sum { display: flex; gap: 10px; align-items: flex-start; }
.st-sum .grow { flex: 1; min-width: 0; }
.st-sum .sub-head { margin-bottom: 6px; }
.st-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; border-radius: 8px; }
.st-next { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; overflow-wrap: anywhere; }
.st-next svg.ic { width: 16px; height: 16px; flex: none; }
.st-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-card.is-fresh .st-line { animation: v3-fresh 2.4s ease; }
@keyframes v3-fresh { 0%, 35% { background: var(--v3-fresh); box-shadow: 0 0 0 6px var(--v3-fresh); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.obj-block { margin-top: 16px; }
.obj-chips { margin-bottom: 6px; }
.obj-chips .fchip { min-height: 34px; padding: 4px 12px; }
/* Заметки (внутренние) */
.notes-block { margin: 18px 0 14px; }
.cnotes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cnote { padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--s-idle); border-radius: 10px; background: var(--surface); font-size: 14px; }
.cnote-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.cnote-head svg.ic { width: 15px; height: 15px; flex: none; }
.cnote-head .grow { flex: 1; min-width: 0; }
.cnote-t { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cnote-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cnote--hint { border-left-color: var(--accent); background: var(--accent-soft); }
.cnote--hint .cnote-head { color: var(--accent); }
.cnote--help { border-left-color: var(--s-wait); background: var(--s-wait-soft); }
.cnote--help .cnote-head { color: var(--s-wait); }
.cnote--help.is-resolved { border-left-color: var(--s-ok); background: var(--surface); }
.cnote--help.is-resolved .cnote-head { color: var(--text-2); }
.cnote--transcript { border-left-color: var(--to-vac); }
.cnote--transcript .cnote-head svg.ic { color: var(--to-vac); }
.cnote--handover { border-left-color: var(--s-active); background: var(--s-active-soft); }
.cnote--handover .cnote-head { color: var(--s-active); }
.cnote-pre { margin: 0; font-family: inherit; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); max-height: 3em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); }
.cnote-pre.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.cnote .link-btn { min-height: 32px; }
.cnote-foot { margin-top: 6px; }
.cnote-form { border-top: 1px solid var(--line); padding-top: 12px; }
.cnote-form--help { border: 1px solid color-mix(in srgb, var(--s-wait) 40%, var(--line)); border-radius: var(--r-card); padding: 12px; background: var(--s-wait-soft); }

/* «Разбор продаж» */
.coach-period { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.coach-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@container app (min-width: 640px) { .coach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container app (min-width: 1180px) { .coach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.coach-card { position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 12px 14px 12px 17px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--text); text-align: left; overflow: hidden; --stripe: transparent; }
.coach-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.coach-card[data-sev="bad"] { --stripe: var(--s-bad); border-color: color-mix(in srgb, var(--s-bad) 35%, var(--line)); }
.coach-card:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.coach-head { display: flex; align-items: center; gap: 10px; }
.coach-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.coach-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.coach-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-conv { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.coach-pct { font-size: 22px; font-weight: 700; line-height: 1.1; }
.coach-flags { gap: 6px; }
.coach-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.coach-kpis > span { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.coach-kpis b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach-kpis i { font-style: normal; font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-obj { gap: 4px; }
.help-row { cursor: default; }
.help-text { margin-top: 6px; font-size: 14px; padding: 8px 10px; border-radius: 8px; background: var(--s-wait-soft); overflow-wrap: anywhere; }

/* «Подключения» → Лилу */
.lee-card { display: flex; flex-direction: column; gap: 8px; }
.lee-card .chips { margin-bottom: 0; }
.lee-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 6px; }
.lee-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.lee-stat b { font-size: 20px; font-weight: 600; line-height: 1.2; }
.lee-stat span { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.lee-stat.is-bad b { color: var(--s-bad); }
.lee-url { margin-top: 4px; }
.lee-steps { gap: 8px; }
.lee-steps li { font-size: 13px; }
.lee-ev .row-title { font-weight: 500; }
.lee-sum { font-size: 14px; overflow-wrap: anywhere; }

/* «Сейчас»: курсы валют и строка о передаче смены */
.fx-widget { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--text); text-align: left; }
.fx-widget:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.fx-widget .fx-strip { font-size: 14px; font-weight: 600; color: var(--text); }
.fx-widget .fx-strip svg.ic { width: 18px; height: 18px; color: var(--accent); }
.fx-widget .fx-strip.is-stale { color: var(--s-wait); }
.fx-widget-sub { flex: 1 1 140px; min-width: 0; font-size: 12px; color: var(--text-2); }
.fx-widget > svg.ic:last-child { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.ho-line { background: var(--accent-soft); }
.ho-line svg.ic { color: var(--accent); }
.ho-line:hover { background: color-mix(in srgb, var(--accent-soft) 85%, var(--accent)); }
.ho-line-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); }

/* «Финансы»: ожидаемые платежи и чип плана */
.chip-btn { cursor: pointer; border: 0; margin-left: 6px; vertical-align: middle; font: inherit; font-size: 12px; font-weight: 500; }
.chip-btn:hover { filter: brightness(0.96); text-decoration: underline; }
div.fin-expected { cursor: default; }
.fin-expected > span { flex: 1; min-width: 0; }

/* «Что допилить»: что сделано по правкам */
.done-card { padding: 14px 16px 14px 19px; }
.done-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.done-head > svg.ic { width: 22px; height: 22px; color: var(--s-ok); flex: none; margin-top: 1px; }
.done-head .grow { flex: 1; min-width: 0; }
.done-head h2 { font-size: 16px; }
.done-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.done-list li { display: flex; gap: 10px; align-items: flex-start; }
.done-list li .grow { flex: 1; min-width: 0; }
.done-list li .actions { margin-top: 6px; }
.done-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--s-ok-soft); color: var(--s-ok); font-size: 12px; font-weight: 600; margin-top: 1px; }
.done-extra { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.done-extra > svg.ic { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 1px; }
.done-extra .grow { flex: 1; min-width: 0; }
@container app (max-width: 419px) {
  .tool-btns .btn { flex: 1 1 100%; }
  .coach-kpis b { font-size: 14px; }
  .ig-cta .btn--ig { flex: 1 1 auto; }
}

/* ---- v3: клиентки, рассрочки, курсы, календарь ---- */
:root {
  --cal-bad-solid: #C8344F;      /* плашка «Конец ЛВ» / просрочка — сплошной красный */
  --cal-bad-on: #FFFFFF;
  --cal-bad-cell: #FDF0F2;       /* день с концом личного ведения */
  --cal-out-bg: #F3EFF1;         /* дни соседних месяцев */
  --cal-wait-text: #8A5A00;      /* платежи и брони на светлом */
  --cal-ok-text: #1E7A4A;        /* задачи */
  --pl-paid-bg: #F1FAF5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cal-bad-solid: #E86A82; --cal-bad-on: #1F1A1E; --cal-bad-cell: #2E1D22; --cal-out-bg: #1B1619; --cal-wait-text: #F2C46B; --cal-ok-text: #7FD3A5; --pl-paid-bg: #1C2A22; }
}
:root[data-theme="dark"] { --cal-bad-solid: #E86A82; --cal-bad-on: #1F1A1E; --cal-bad-cell: #2E1D22; --cal-out-bg: #1B1619; --cal-wait-text: #F2C46B; --cal-ok-text: #7FD3A5; --pl-paid-bg: #1C2A22; }

/* Общее для шторок v3 */
.cc-sec { margin-top: 18px; }
.cc-sec .section-head { margin-bottom: 8px; }
.cc-sec .section-head h2 { font-size: 15px; }
.btn--danger.btn--solid { background: var(--cal-bad-solid); border-color: var(--cal-bad-solid); color: var(--cal-bad-on); }
.btn--danger.btn--solid:hover { background: color-mix(in srgb, var(--cal-bad-solid) 88%, #000); }
.kv .link-btn { min-height: 0; }
.kv .link-btn svg.ic { width: 16px; height: 16px; }
.clr-main .chip--xs, .inst-who .chip--xs, .inst-card-top .chip--xs, .pc-res-name .chip--xs, .cc-title .chip--xs, .pl-client .chip--xs { margin-left: 0; }

/* Клиентки: строки списка */
.clr-list { gap: 8px; }
.clr-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main owner" "links owner" "chips chips"; column-gap: 10px; padding: 10px 12px 10px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); cursor: pointer; overflow: hidden; --stripe: transparent; }
.clr-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.clr-row[data-sev="bad"] { --stripe: var(--s-bad); }
.clr-row:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.clr-main { grid-area: main; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-width: 0; }
.clr-name { font-weight: 600; font-size: 15px; color: var(--text); text-align: left; overflow-wrap: anywhere; min-height: 28px; }
.clr-name:hover { color: var(--accent); }
.clr-links { grid-area: links; display: flex; flex-wrap: wrap; gap: 0 14px; min-width: 0; }
.clr-links .ext-link { font-size: 13px; min-height: 28px; }
.clr-links .ext-link svg.ic { width: 16px; height: 16px; }
.clr-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; min-width: 0; }
.clr-chips .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.clr-chips .chip svg.ic { width: 13px; height: 13px; }
.clr-owner { grid-area: owner; align-self: start; padding-top: 1px; }

/* Карточка клиентки */
.cc-title { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.cc-top .switch { border-bottom: 0; min-height: 48px; padding: 4px 6px; }
.cc-vip .sw-text > span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cc-vip .sw-text svg.ic { width: 18px; height: 18px; color: var(--accent); fill: currentColor; }
.cc-flags { align-items: center; }
.cc-ig { min-height: 52px; font-size: 16px; font-weight: 600; gap: 8px; text-decoration: none; }
.cc-ig svg.ic { width: 22px; height: 22px; }
.cc-handle { display: flex; align-items: center; gap: 2px; margin-top: 6px; font-size: 14px; min-width: 0; }
.cc-handle b { overflow-wrap: anywhere; min-width: 0; }
.cc-handle .icon-btn { margin-left: auto; }
.cc-cform .field:last-of-type { margin-bottom: 8px; }
.cc-notes { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cc-m-top { display: flex; gap: 10px; align-items: flex-start; }
.cc-m-top .grow { flex: 1; min-width: 0; }
.cc-m-dates { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.cc-m-dates .muted { font-weight: 400; font-size: 13px; }
.cc-m-left { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 2px; font-weight: 500; }
.cc-m-left svg.ic { width: 16px; height: 16px; flex: none; }
.cc-m-note { font-style: italic; }
.cc-m-actions { margin-top: 8px; }
.cc-inline { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.cc-inline--bad { background: var(--s-bad-soft); }
.cc-inline .actions { margin-top: 4px; }
.cc-addm { margin-bottom: 10px; }
.cc-plan { min-height: 0; }
.cc-plan .row-title .muted { font-weight: 400; }
.cc-buys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.cc-buys li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cc-buys li:last-child { border-bottom: 0; }
.cc-buys .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.cc-buys .num { white-space: nowrap; font-weight: 600; }
.cc-next .card-title { margin: 2px 0; }
.cc-alt { font-size: 14px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.cc-alt .link-btn { min-height: 32px; text-align: left; }
.cc-conv { min-height: 0; }
.cc-conv-line { margin-top: 0; }
.cc-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-del { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.cc-danger { padding-top: 14px; border-top: 1px solid var(--line); }

/* Рассрочка: прогресс, график, оплата, правка */
.pl-bar .bar { height: 8px; }
.pl-bar.mt { margin-top: 6px; }
.pl-client { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 17px; }
.pl-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin-top: 10px; }
.pl-contacts .btn { margin-left: auto; }
.pl-progress { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pl-sum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.pl-sum b { font-size: 22px; line-height: 1.2; }
.pl-sub { font-size: 13px; color: var(--text-2); }
.pl-sub b { color: var(--text); }
.pl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pl-item .grow { flex: 1; min-width: 0; }
.pl-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.pl-n svg.ic { width: 15px; height: 15px; }
.pl-item.is-paid { background: var(--pl-paid-bg); }
.pl-item.is-paid .pl-n { background: var(--s-ok); color: #fff; }
.pl-item.is-overdue { border-color: color-mix(in srgb, var(--s-bad) 55%, var(--line)); }
.pl-item.is-overdue .pl-n { background: var(--s-bad-soft); color: var(--s-bad); }
.pl-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-size: 14px; }
.pl-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.pl-fin { font-size: 11px; padding: 1px 8px; }
.pl-fin svg.ic { width: 12px; height: 12px; }
button.pl-fin:hover { filter: brightness(0.97); text-decoration: underline; }
.pl-item > .btn { flex: none; align-self: center; }
.pl-danger { padding-top: 12px; border-top: 1px solid var(--line); }
.pl-pay-head { margin-bottom: 12px; }
.pay-hint { min-height: 18px; margin: -6px 0 10px; }
.sch-need { display: flex; flex-direction: column; gap: 2px; }
.sch-need b { font-size: 20px; }
.sch-rows, .sch-kept { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.sch-row { display: grid; grid-template-columns: 22px minmax(0, 1.25fr) minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.sch-row .input { min-width: 0; padding-left: 8px; padding-right: 8px; }
.sch-row--kept { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.sch-i { font-size: 12px; color: var(--text-2); text-align: center; }
.sch-status span { display: inline-flex; align-items: center; gap: 6px; }
.sch-status svg.ic { width: 16px; height: 16px; flex: none; }
@container app (max-width: 419px) {
  .pl-item { flex-wrap: wrap; }
  .pl-item > .btn { flex: 1 1 100%; margin-left: 36px; }
  .pl-contacts .btn { margin-left: 0; }
}

/* Новая рассрочка или бронь */
.pc-search .search { margin-bottom: 8px; }
.pc-results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pc-res { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; color: var(--text); background: var(--surface); }
.pc-res:last-child { border-bottom: 0; }
.pc-res:hover { background: var(--surface-2); }
.pc-res .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-res .xs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-res > svg.ic { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.pc-res-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-weight: 600; overflow-wrap: anywhere; }
.pc-picked { display: flex; align-items: center; gap: 10px; }
.pc-picked .grow { flex: 1; min-width: 0; }
.pc-picked-links { display: flex; flex-wrap: wrap; gap: 0 12px; }
.pc-picked-links .ext-link { font-size: 13px; min-height: 26px; }
.pc-new .link-btn svg.ic { width: 16px; height: 16px; }
.pc-prev { list-style: none; margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.pc-prev-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pc-opts { display: flex; flex-direction: column; gap: 8px; }
.pc-opt { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; color: var(--text); }
.pc-opt .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pc-opt-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--s-idle); margin-top: 1px; background: var(--surface); }
.pc-opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pc-opt[aria-checked="true"] .pc-opt-dot { border: 6px solid var(--accent); }

/* Экран «Рассрочки и брони»: фильтры, таблица (десктоп), карточки (телефон) */
.inst-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.inst-segs { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.inst-filters > .chip-row { margin: 0; padding: 2px; flex: 1 1 100%; }
.inst-selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; flex: 1 1 100%; }
.inst-selects .select { min-width: 0; }
.inst-filters > .search { flex: 1 1 100%; }
.inst-tbl { display: none; margin-bottom: 14px; }
.inst-tbl table.tbl { min-width: 900px; }
.inst-tbl .tbl td { vertical-align: middle; }
.inst-g1 th { background: var(--surface); padding-top: 14px; color: var(--text); font-size: 13px; white-space: normal; }
.inst-g2 td { background: var(--surface-2); padding-top: 6px; padding-bottom: 6px; }
.inst-ghead, .inst-shead { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.inst-gtitle { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); min-width: 0; }
.inst-gtitle b { overflow-wrap: anywhere; }
.inst-stitle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.inst-stitle svg.ic { width: 16px; height: 16px; color: var(--text-2); }
.inst-gmeta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.inst-gmeta > span:first-child { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.inst-g2 .inst-gmeta > span:first-child { background: var(--surface); }
.inst-row td:first-child { box-shadow: inset 3px 0 0 var(--stripe, transparent); }
.inst-row[data-sev="bad"] { --stripe: var(--s-bad); }
.inst-row[data-sev="wait"] { --stripe: var(--s-wait); }
.inst-row.is-closed td { color: var(--text-2); }
.inst-who { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.inst-name { font-weight: 600; color: var(--text); text-align: left; font-size: 14px; min-height: 28px; overflow-wrap: anywhere; }
.inst-name:hover { color: var(--accent); text-decoration: underline; }
.inst-tbl .ext-link { font-size: 12px; min-height: 22px; }
.inst-tbl .ext-link svg.ic { width: 14px; height: 14px; }
.inst-next { white-space: nowrap; }
.inst-next > * { display: block; }
.inst-asst { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.inst-act { text-align: right; white-space: nowrap; }
.inst-cards { display: flex; flex-direction: column; }
.inst-group { margin-bottom: 14px; }
.inst-group > .inst-ghead { padding: 4px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.inst-cards .inst-shead { padding: 8px 2px 6px; }
.inst-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 10px 12px 10px 15px; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 6px; --stripe: transparent; }
.inst-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.inst-card[data-sev="bad"] { --stripe: var(--s-bad); }
.inst-card[data-sev="wait"] { --stripe: var(--s-wait); }
.inst-card:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.inst-card-top { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.inst-card-top .grow { flex: 1; }
.inst-links { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: -4px; min-width: 0; }
.inst-links .ext-link { font-size: 13px; min-height: 26px; }
.inst-links .ext-link svg.ic { width: 16px; height: 16px; }
.inst-meta { font-size: 13px; color: var(--text-2); }
.inst-nums { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; color: var(--text-2); }
.inst-nums b { color: var(--text); }
.inst-foot { display: flex; align-items: center; gap: 8px; }
.inst-nextline { flex: 1; min-width: 0; font-size: 13px; }
.inst-foot .btn { flex: none; }
@container app (min-width: 760px) {
  .inst-tbl { display: block; }
  .inst-cards { display: none; }
  .inst-segs { flex: 0 1 auto; }
  .inst-filters > .chip-row { flex: 0 1 auto; }
  .inst-selects { flex: 1 1 340px; }
  .inst-filters > .search { flex: 1 1 260px; }
}

/* Курсы и цены: карточки */
.pr-tabs .seg { max-width: 420px; }
.pr-cur { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
.pr-cur-lbl { color: var(--text-2); font-weight: 500; }
.pr-cur-chips { margin: 0; padding: 2px; flex: 0 1 auto; max-width: 100%; }
.pr-cur-chips .fchip { min-height: 32px; padding: 4px 10px; }
.pr-cur-rate { flex-basis: 100%; }
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pr-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; text-align: left; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--text); min-width: 0; }
.pr-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pr-card.is-inactive { opacity: 0.62; border-style: dashed; }
.pr-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pr-code { font-weight: 700; letter-spacing: 0.02em; color: var(--text); }
.pr-check svg.ic { width: 12px; height: 12px; }
.pr-name { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pr-start { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 14px; }
.pr-start svg.ic { width: 16px; height: 16px; }
.pr-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; font-size: 14px; }
.pr-price b { font-size: 17px; }
.pr-line { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--text-2); }
.pr-line svg.ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.pr-line > span { min-width: 0; overflow-wrap: anywhere; }
@container app (min-width: 600px) { .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container app (min-width: 1180px) { .pr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Карточка курса */
.pr-desc { font-size: 14px; margin-bottom: 10px; }
.pr-kv { grid-template-columns: minmax(104px, 140px) minmax(0, 1fr); }
.pr-fill { min-height: 0; font-size: 14px; }
.pr-ladder { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pr-ladder-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; color: var(--text); min-height: 48px; }
.pr-ladder-btn:hover { background: var(--surface-2); }
.pr-ladder-btn .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.pr-ladder-btn > svg.ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.pr-ladder-btn > svg.ic:last-child { color: var(--text-2); }
.pr-lesson { padding: 14px; border-radius: var(--r-card); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.pr-lesson-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.pr-lesson-head h3 { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--accent); }
.pr-lesson-head svg.ic { width: 18px; height: 18px; }
.pr-lesson-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pr-lesson-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; background: var(--surface); font-size: 14px; }
.pr-calc { color: var(--cal-wait-text); }
.pr-cursel .select { min-height: 32px; padding-top: 2px; padding-bottom: 2px; font-size: 13px; width: auto; max-width: 170px; }
.pr-pkgs { display: flex; flex-direction: column; gap: 8px; }
.pr-pkg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.pr-pkg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pr-pkg-top > b { font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.pr-pkg-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.pr-pkg-kv { display: grid; grid-template-columns: minmax(96px, 124px) minmax(0, 1fr); gap: 3px 10px; margin: 0; font-size: 13px; }
.pr-pkg-kv dt { color: var(--text-2); }
.pr-pkg-kv dd { margin: 0; overflow-wrap: anywhere; }
.pr-links { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pr-link { display: flex; align-items: center; gap: 2px; padding: 8px 4px 8px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.pr-link:last-child { border-bottom: 0; }
.pr-link .grow { flex: 1; min-width: 0; }
.pr-url { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-req { align-items: flex-start; }
.pr-req-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pr-banner { display: block; max-width: calc(100% - 24px); max-height: 180px; object-fit: cover; border-radius: 8px; margin: 8px 12px; }
.pr-notes { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--s-wait-soft); font-size: 14px; margin-bottom: 10px; }
.pr-notes svg.ic { width: 18px; height: 18px; color: var(--s-wait); flex: none; margin-top: 1px; }
.pr-tpl { min-height: 0; align-items: center; }
.pr-tpl > svg.ic { width: 18px; height: 18px; color: var(--text-2); flex: none; }

/* Правка курса: пакеты */
.pe-pkgs { display: flex; flex-direction: column; gap: 10px; }
.pe-pkg-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.pe-pkg-head .input { flex: 1; min-width: 0; font-weight: 600; }
.pe-pkg-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.pe-pkg-head .icon-btn:disabled { opacity: 0.3; }
svg.ic.ic-up { transform: rotate(180deg); }

/* Быстрые ответы на экране «Курсы и цены» */
.tpl-bar { display: flex; flex-direction: column; gap: 6px; }
.tpl-bar .tpl-product { max-width: 420px; }
.tpl-vars-box { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-varbtn { padding: 4px 8px; min-height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); }
.tpl-varbtn:hover { border-color: var(--accent); }
.tpl-vars-help { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 10px 0 0; color: var(--text-2); }
.tpl-vars-help dt { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.tpl-vars-help dd { margin: 0; overflow-wrap: anywhere; }
.tp-preview .tpl-text { margin-top: 0; }

/* Календарь: месяц, плашки (десктоп), точки (телефон), список дня */
.cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-nav .btn[hidden] { display: none; }
.cal-title { font-size: 17px; font-weight: 600; min-width: 136px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-next svg.ic { transform: scaleX(-1); }
.cal-red { display: inline-flex; align-items: center; gap: 4px; color: var(--s-bad); font-weight: 600; margin-left: auto; }
.cal-red svg.ic { width: 15px; height: 15px; }
.cal-layers { margin-bottom: 10px; }
.cal-layer .n { margin-left: 2px; }
.cal-sw, .cal-dots i, .cal-ev-dot { background: var(--tone, var(--s-idle)); }
.cal-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cal-sw[data-tone="bad"], .cal-dots i[data-tone="bad"], .cal-ev-dot[data-tone="bad"], .cal-ev[data-tone="bad"], .cal-pill[data-tone="bad"] { --tone: var(--s-bad); --tone-soft: var(--s-bad-soft); --tone-text: var(--s-bad); }
.cal-sw[data-tone="wait"], .cal-dots i[data-tone="wait"], .cal-ev-dot[data-tone="wait"], .cal-ev[data-tone="wait"], .cal-pill[data-tone="wait"] { --tone: var(--s-wait); --tone-soft: var(--s-wait-soft); --tone-text: var(--cal-wait-text); }
.cal-sw[data-tone="accent"], .cal-dots i[data-tone="accent"], .cal-ev-dot[data-tone="accent"], .cal-ev[data-tone="accent"], .cal-pill[data-tone="accent"] { --tone: var(--accent); --tone-soft: var(--accent-soft); --tone-text: var(--accent); }
.cal-sw[data-tone="ok"], .cal-dots i[data-tone="ok"], .cal-ev-dot[data-tone="ok"], .cal-ev[data-tone="ok"], .cal-pill[data-tone="ok"] { --tone: var(--s-ok); --tone-soft: var(--s-ok-soft); --tone-text: var(--cal-ok-text); }
.cal-sw[data-tone="idle"], .cal-dots i[data-tone="idle"], .cal-ev-dot[data-tone="idle"], .cal-ev[data-tone="idle"], .cal-pill[data-tone="idle"] { --tone: var(--s-idle); --tone-soft: var(--s-idle-soft); --tone-text: var(--text-2); }
.cal { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-wd { padding: 6px 2px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
.cal-wd.is-weekend { color: color-mix(in srgb, var(--text-2) 65%, var(--accent)); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { position: relative; min-height: 54px; padding: 4px 2px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-grid > .cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
.cal-cell.is-weekend { background: color-mix(in srgb, var(--surface-2) 30%, var(--surface)); }
.cal-cell.is-out { background: var(--cal-out-bg); }
.cal-cell.is-out .cal-num { color: var(--text-2); opacity: 0.6; font-weight: 500; }
.cal-cell.has-end { background: var(--cal-bad-cell); box-shadow: inset 0 3px 0 var(--cal-bad-solid); }
.cal-cell.has-end .cal-num { color: var(--s-bad); }
.cal-cell:hover { background: color-mix(in srgb, var(--surface) 82%, var(--surface-2)); }
.cal-cell.has-end:hover { background: color-mix(in srgb, var(--cal-bad-cell) 85%, var(--s-bad-soft)); }
.cal-cell.is-sel { box-shadow: inset 0 0 0 2px var(--accent); z-index: 1; }
.cal-cell.is-sel.has-end { box-shadow: inset 0 0 0 2px var(--accent), inset 0 5px 0 var(--cal-bad-solid); }
.cal-sw--day { background: var(--cal-bad-cell); box-shadow: inset 0 2px 0 var(--cal-bad-solid), 0 0 0 1px var(--line); }
.cal-daybtn { display: flex; justify-content: center; width: 100%; color: var(--text); }
.cal-daybtn::after { content: ""; position: absolute; inset: 0; }
.cal-daybtn:focus-visible { outline: none; }
.cal-daybtn:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 4px; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.cal-cell.is-today .cal-num { background: var(--accent); color: var(--accent-text); opacity: 1; }
.cal-cell.is-sel:not(.is-today):not(.has-end) .cal-num { color: var(--accent); }
.cal-pills { display: none; position: relative; z-index: 2; width: 100%; flex-direction: column; gap: 2px; pointer-events: none; }
.cal-pill, .cal-more { pointer-events: auto; }
.cal-pill { display: flex; align-items: center; gap: 3px; width: 100%; min-height: 20px; padding: 1px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 500; line-height: 18px; text-align: left; background: var(--tone-soft); color: var(--tone-text); overflow: hidden; }
.cal-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-pill[data-tone="bad"] { background: var(--cal-bad-solid); color: var(--cal-bad-on); font-weight: 600; }
.cal-pill:hover { filter: brightness(0.96); }
.cal-more { align-self: flex-start; padding: 0 6px; min-height: 18px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.cal-more:hover { background: var(--surface-2); color: var(--text); }
svg.ic.cal-star { width: 12px; height: 12px; flex: none; fill: currentColor; }
.cal-dots { display: flex; gap: 2px; justify-content: center; align-items: center; flex-wrap: wrap; pointer-events: none; max-width: 100%; }
.cal-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; }
.cal-dots b { font-size: 9px; line-height: 6px; color: var(--text-2); }
.cal-legend i { margin-right: 0; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend svg.ic.cal-star { color: var(--accent); }
.cal-ev { align-items: center; min-height: 56px; --stripe: var(--tone, transparent); }
.cal-ev-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.cal-ev .row-title { gap: 4px; }
.cal-vip { display: inline-flex; color: var(--accent); }
.cal-vip svg.ic.cal-star { width: 14px; height: 14px; color: var(--accent); }
svg.ic.cal-chev { width: 18px; height: 18px; color: var(--text-2); flex: none; }
@container app (min-width: 760px) {
  .cal-cell { min-height: 112px; align-items: stretch; padding: 4px 5px 6px; gap: 3px; }
  .cal-daybtn { justify-content: flex-start; }
  .cal-num { min-width: 26px; height: 26px; font-size: 13px; }
  .cal-pills { display: flex; }
  .cal-dots { display: none; }
}
@container app (max-width: 419px) {
  .cal-title { min-width: 0; flex: 1; }
  .cal-red { flex-basis: 100%; margin-left: 0; }
  .cal-num { min-width: 26px; height: 26px; font-size: 13px; }
}
.ig-who { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.coach-kpis i { white-space: normal; line-height: 1.25; }
.conv-sheet a.btn { text-decoration: none; }
@container app (max-width: 419px) { .tool-btns .btn { flex: 1 1 auto; } }
/* v3: клиентки, рассрочки, курсы, календарь — уточнения */
.pr-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pr-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pr-fact .xs { line-height: 1.25; }
.pr-fact-v { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.pr-fact-v .link-btn { min-height: 0; font-weight: 500; }
.pr-over .pr-desc { margin-bottom: 10px; }
.pr-ladder-btn { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
@container app (max-width: 419px) { .pr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inst-tbl table.tbl { min-width: 860px; }
.inst-tbl .tbl th, .inst-tbl .tbl td { padding-left: 8px; padding-right: 8px; }
.inst-tbl .tbl th:first-child, .inst-tbl .tbl td:first-child { padding-left: 12px; }
.inst-tbl .ext-link { max-width: 190px; }
.inst-tbl .inst-act .btn { padding: 4px 8px; }
.cal-layer[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--text); }
.cal-layer[aria-pressed="true"] .n { color: var(--text-2); opacity: 1; }
.cal-layer[aria-pressed="false"] { color: var(--text-2); }
.cal-layer[aria-pressed="false"] .cal-sw { opacity: 0.35; }
.inst-tbl table.tbl { table-layout: fixed; }
.inst-tbl .tbl td { overflow-wrap: anywhere; }
.inst-tbl .tbl th { white-space: normal; }
.inst-tbl .inst-g1 th, .inst-tbl .inst-g2 td { overflow-wrap: normal; }
.inst-tbl .inst-asst span { overflow: hidden; text-overflow: ellipsis; }
.inst-tbl .inst-asst { max-width: 100%; }
.inst-card-top { flex-wrap: nowrap; align-items: flex-start; }
.inst-card-top .inst-who { flex: 1; min-width: 0; }
.inst-card-top > .chip { flex: none; margin-top: 4px; }

/* ---- v3.1: кураторы — отчёты, таблицы, события ---- */
/* Цвета видов событий школы: эфир, планёрка, мастер-класс, запуск, другое (светлая / тёмная тема) */
:root {
  --ev-stream: #7B2D55; --ev-stream-soft: #F7E7EF; --ev-stream-text: #7B2D55;
  --ev-meeting: #2F6BE0; --ev-meeting-soft: #E6EDFC; --ev-meeting-text: #2457BF;
  --ev-masterclass: #0F8582; --ev-masterclass-soft: #DDF2F1; --ev-masterclass-text: #0B6B69;
  --ev-launch: #C2560C; --ev-launch-soft: #FCEBDD; --ev-launch-text: #9A4309;
  --ev-other: #9A9298; --ev-other-soft: #EFEAED; --ev-other-text: #6F6670;
  --rep-over-text: #8A5A00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ev-stream: #E39AB9; --ev-stream-soft: #3A2530; --ev-stream-text: #EDB3CB;
    --ev-meeting: #6E97F0; --ev-meeting-soft: #1F2B45; --ev-meeting-text: #9DB8F5;
    --ev-masterclass: #4CC2BE; --ev-masterclass-soft: #173331; --ev-masterclass-text: #7FD6D2;
    --ev-launch: #EE8A4A; --ev-launch-soft: #3A2718; --ev-launch-text: #F4AC7C;
    --ev-other: #A79DA3; --ev-other-soft: #2A2328; --ev-other-text: #A79DA3;
    --rep-over-text: #F2C46B;
  }
}
:root[data-theme="dark"] {
  --ev-stream: #E39AB9; --ev-stream-soft: #3A2530; --ev-stream-text: #EDB3CB;
  --ev-meeting: #6E97F0; --ev-meeting-soft: #1F2B45; --ev-meeting-text: #9DB8F5;
  --ev-masterclass: #4CC2BE; --ev-masterclass-soft: #173331; --ev-masterclass-text: #7FD6D2;
  --ev-launch: #EE8A4A; --ev-launch-soft: #3A2718; --ev-launch-text: #F4AC7C;
  --ev-other: #A79DA3; --ev-other-soft: #2A2328; --ev-other-text: #A79DA3;
  --rep-over-text: #F2C46B;
}
[data-ev="stream"] { --ev: var(--ev-stream); --ev-soft: var(--ev-stream-soft); --ev-text: var(--ev-stream-text); }
[data-ev="meeting"] { --ev: var(--ev-meeting); --ev-soft: var(--ev-meeting-soft); --ev-text: var(--ev-meeting-text); }
[data-ev="masterclass"] { --ev: var(--ev-masterclass); --ev-soft: var(--ev-masterclass-soft); --ev-text: var(--ev-masterclass-text); }
[data-ev="launch"] { --ev: var(--ev-launch); --ev-soft: var(--ev-launch-soft); --ev-text: var(--ev-launch-text); }
[data-ev="other"] { --ev: var(--ev-other); --ev-soft: var(--ev-other-soft); --ev-text: var(--ev-other-text); }

/* Таблица на десктопе, карточки на телефоне (отчёты, личное ведение, график курсов) */
.rep-tbl, .mt-tbl, .cs-tbl { display: none; }
.rep-cards, .mt-cards, .cs-cards { display: flex; flex-direction: column; gap: var(--gap-card); }
@container app (min-width: 760px) {
  .rep-tbl, .mt-tbl, .cs-tbl { display: block; }
  .rep-cards, .mt-cards, .cs-cards { display: none; }
}
.lbl-like { font-size: 13px; color: var(--text-2); font-weight: 500; }
/* Скрытые подписи (.sr-only) внутри шторки не должны растягивать корень приложения: при фокусе он прокручивался */
.sheet-body { position: relative; }

/* Демо-панель: пояснение про роли (десктоп — текст, телефон — ⓘ) */
.demo-bar .demo-note { order: 20; flex: 1 1 100%; min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--text-2); }
.demo-bar .demo-info { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-2); flex: none; }
.demo-bar .demo-info svg.ic { width: 18px; height: 18px; }
.demo-bar .demo-info:hover { background: var(--surface-2); color: var(--text); }
@container app (max-width: 759px) {
  .demo-bar .demo-note { display: none; }
  .demo-bar .demo-info { display: inline-flex; }
}

/* ---------- Отчёты по сотрудникам ---------- */
.rep-note { display: flex; align-items: center; gap: 8px; color: var(--text); }
.rep-note svg.ic { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.rep-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.rep-month { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.rep-month .icon-btn { width: 40px; height: 40px; border-radius: 999px; }
.rep-month-title { min-width: 136px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rep-next svg.ic { transform: scaleX(-1); }
.rep-dept { flex: 0 1 220px; min-width: 150px; }
.rep-tiles { margin-bottom: 14px; }
.rep-tiles .tile .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rep-tbl table.tbl { min-width: 720px; }
.rep-tbl .tbl td { vertical-align: middle; }
.rep-tbl .tbl th { white-space: normal; vertical-align: bottom; line-height: 1.25; min-width: 72px; }
.rep-tbl .tbl th:first-child { min-width: 190px; }
.rep-row[data-sev="bad"] td:first-child { box-shadow: inset 3px 0 0 var(--s-bad); }
.rep-row[data-sev="wait"] td:first-child { box-shadow: inset 3px 0 0 var(--s-wait); }
.rep-who { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--text); text-align: left; }
.rep-who .grow { display: flex; flex-direction: column; min-width: 0; }
.rep-who b { font-weight: 600; white-space: nowrap; }
.rep-tot { min-width: 128px; }
.rep-total { font-size: 16px; font-weight: 700; }
.rep-tot-sub { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 6px; margin-top: 4px; white-space: normal; }
.rep-delta { font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-delta .muted { font-weight: 400; }
.rep-card { position: relative; display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 12px 14px 12px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--text); text-align: left; overflow: hidden; --stripe: transparent; }
.rep-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.rep-card[data-sev="bad"] { --stripe: var(--s-bad); }
.rep-card[data-sev="wait"] { --stripe: var(--s-wait); }
.rep-card:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.rep-card-top { display: flex; align-items: center; gap: 10px; }
.rep-card-top .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rep-card-top > .chip { flex: none; }
.rep-card-total { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.rep-card-total .rep-total { font-size: 22px; }
.rep-card-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.rep-card-metrics > div { min-width: 0; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.rep-card-metrics dt { font-size: 11px; line-height: 1.25; color: var(--text-2); overflow-wrap: anywhere; }
.rep-card-metrics dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rep-card-metrics dd .muted { font-size: 12px; font-weight: 400; }
.rep-formula { max-width: 820px; }
/* Карточка сотрудницы */
.rep-title { overflow: hidden; text-overflow: ellipsis; }
.rep-head { display: flex; align-items: center; gap: 12px; }
.rep-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rep-head-total { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.rep-head-total > b { font-size: 26px; line-height: 1.1; }
.rep-head .chips { align-items: center; }
.rep-undo { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--s-ok-soft); font-size: 13px; }
.rep-undo > svg.ic { width: 18px; height: 18px; color: var(--s-ok); flex: none; }
.rep-undo .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rep-undo .btn { flex: none; }
.rep-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.rep-m { min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.rep-m dt { font-size: 12px; line-height: 1.3; color: var(--text-2); overflow-wrap: anywhere; }
.rep-m dd { margin: 2px 0 0; font-size: 15px; }
.rep-hint { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.3; color: var(--text-2); overflow-wrap: anywhere; }
.rep-hint .link-btn { min-height: 28px; font-size: 12px; }
.rep-crits { display: flex; flex-direction: column; gap: 8px; }
.rep-crit { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rep-crit[data-over="true"] { border-color: color-mix(in srgb, var(--s-wait) 55%, var(--line)); }
.rep-crit-top { display: flex; align-items: flex-start; gap: 8px; }
.rep-crit-top .grow { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rep-crit-top b { font-size: 14px; overflow-wrap: anywhere; }
.rep-score { flex: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.rep-crit-sub { margin-top: 4px; overflow-wrap: anywhere; }
.rep-over { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--rep-over-text); }
.rep-over > svg.ic { width: 14px; height: 14px; flex: none; }
.rep-over .btn { margin-left: auto; }
.rep-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.rep-edit-btn { min-height: 36px; margin-top: 2px; font-size: 13px; }
.rep-edit-btn svg.ic { width: 16px; height: 16px; }
.rep-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rep-q { min-width: 40px; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.rep-q:hover { border-color: var(--accent); }
.rep-q[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.rep-q-input { display: inline-flex; }
.rep-q-input .input { width: 88px; min-height: 40px; padding: 6px 8px; text-align: center; }
.rep-comment { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
@container app (min-width: 520px) { .rep-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rep-card-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container app (min-width: 760px) { .sheet:has(.rep-sheet), .sheet:has(.crit-sheet) { width: 580px; } .sheet:has(.ev-form), .sheet:has(.cs-sheet) { width: 520px; } }
@container app (max-width: 419px) { .rep-month-title { min-width: 0; } .rep-month { flex: 1 1 auto; justify-content: space-between; } .rep-dept { flex: 1 1 100%; } }
/* Редактор критериев */
.crit-scheme { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; border-style: solid; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); color: var(--text); }
.crit-scheme svg.ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.crit-formula { margin-bottom: 12px; color: var(--text-2); }
.crit-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.crit-item { padding: 8px 12px 2px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.crit-item.is-off { border-style: dashed; background: var(--surface-2); }
.crit-item.is-off .field, .crit-item.is-off .crit-kind, .crit-item.is-off .form-grid { opacity: 0.6; }
.crit-item-top { display: flex; align-items: center; gap: 4px; margin: 0 -6px 6px 0; }
.crit-item-top .grow { flex: 1; }
.crit-item-top .icon-btn { width: 40px; height: 40px; }
.crit-item-top .icon-btn svg.ic { width: 20px; height: 20px; }
.crit-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.crit-on, .crit-lower { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 13px; color: var(--text); cursor: pointer; }
.crit-on input, .crit-lower input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.crit-kind { margin-bottom: 4px; }

/* ---------- Личное ведение ---------- */
.mt-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mt-filters .seg-scroll { margin-bottom: 0; }
.mt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-row > .select { flex: 1 1 180px; min-width: 0; }
.mt-row > .search { flex: 2 1 240px; min-width: 0; }
.mt-tbl table.tbl { min-width: 820px; }
.mt-tbl .tbl td { vertical-align: middle; }
.mt-tbl .tbl th, .mt-tbl .tbl td { padding-left: 8px; padding-right: 8px; }
.mt-tbl .tbl th:first-child, .mt-tbl .tbl td:first-child { padding-left: 12px; }
.mt-tr[data-sev="bad"] td { background: color-mix(in srgb, var(--s-bad-soft) 45%, var(--surface)); }
.mt-tr[data-sev="bad"] td:first-child { box-shadow: inset 3px 0 0 var(--s-bad); }
.mt-who { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; min-width: 0; }
.mt-who .chip--xs { margin-left: 2px; }
.mt-name { min-height: 28px; color: var(--text); font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.mt-name:hover { color: var(--accent); text-decoration: underline; }
.mt-links { display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; }
.mt-links:empty { display: none; }
.mt-links .ext-link { min-height: 24px; max-width: 200px; font-size: 12px; }
.mt-links .ext-link svg.ic { width: 14px; height: 14px; }
.mt-end { font-weight: 600; }
.mt-end svg.ic { display: inline-block; width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; }
.mt-person { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mt-course { min-width: 150px; }
.mt-note { max-width: 280px; margin-top: 2px; color: var(--text-2); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-client { min-width: 170px; }
.mt-period { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mt-asst { margin-top: 2px; white-space: nowrap; }
.mt-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-act { width: 1%; }
.mt-act .mt-acts { flex-wrap: nowrap; justify-content: flex-end; }
.mt-act .btn { min-height: 34px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.mt-act .btn svg.ic { width: 16px; height: 16px; }
.mt-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 12px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; --stripe: transparent; }
.mt-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.mt-card[data-sev="bad"] { --stripe: var(--s-bad); }
.mt-card-top { display: flex; align-items: flex-start; gap: 8px; }
.mt-card-top .grow { flex: 1; }
.mt-card-top > .chip { flex: none; margin-top: 4px; }
.mt-card .mt-name { font-size: 15px; }
.mt-meta { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.mt-dates { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 14px; }
.mt-card-note { font-style: italic; }
.mt-card .mt-acts { margin-top: 6px; }
.mt-card .mt-acts .btn { flex: 1 1 auto; }
@container app (min-width: 760px) {
  .mt-filters { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .mt-filters .seg-scroll { flex: 0 1 auto; }
  .mt-row { flex: 1 1 420px; }
}
/* Новое личное ведение: выбор клиентки */
.mc-picked { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px; }
.mc-picked .grow { flex: 1; min-width: 0; }
.mc-picked-links { display: flex; flex-wrap: wrap; gap: 0 10px; }
.mc-picked-links:empty { display: none; }
.mc-results { margin-top: 6px; }
.mc-found { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.mc-opt { min-height: 52px; padding: 8px 12px; }

/* ---------- График курсов ---------- */
.cs-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.cs-filters .seg-scroll { margin-bottom: 0; max-width: 100%; }
.cs-filters > .select { flex: 0 1 280px; min-width: 0; }
.chip.cs-code { background: var(--accent-soft); color: var(--accent); font-weight: 700; letter-spacing: 0.02em; }
.cs-launches { display: flex; flex-direction: column; gap: 8px; }
.cs-launch { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px 10px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; --stripe: transparent; }
.cs-launch::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.cs-launch[data-sev="ok"] { --stripe: var(--s-ok); }
.cs-launch[data-sev="wait"] { --stripe: var(--s-wait); }
.cs-launch-date { display: flex; flex-direction: column; min-width: 96px; }
.cs-launch-date b { font-size: 15px; }
.cs-launch .grow { flex: 1 1 160px; min-width: 0; }
.cs-launch-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.cs-launch-name b { overflow-wrap: anywhere; }
.cs-tbl table.tbl { min-width: 760px; }
.cs-flow { min-width: 200px; }
.cs-prod { margin-top: 2px; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.cs-chat-line { margin-top: 2px; }
.cs-chat-line:empty { display: none; }
.cs-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs-tbl .tbl td { vertical-align: middle; }
.cs-tr[data-st="finished"] td { color: var(--text-2); }
.cs-tr:has(+ .cs-ev-row) td { border-bottom: 0; }
.cs-ev-row td { padding-top: 0; }
.cs-course { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.cs-name { min-height: 28px; color: var(--text); font-weight: 600; text-align: left; white-space: nowrap; }
.cs-name:hover { color: var(--accent); text-decoration: underline; }
.cs-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.cs-progress .bar { flex: 1; min-width: 56px; }
.cs-progress .num { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cs-progress.is-done .num { color: var(--text-2); }
.cs-curators { display: inline-flex; align-items: center; }
.cs-curators .avatar { margin-left: -6px; border: 2px solid var(--surface); box-sizing: content-box; }
.cs-curators .avatar:first-child { margin-left: 0; }
.cs-cur-names { margin-left: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.cs-chat { display: inline-flex; align-items: center; gap: 4px; max-width: 180px; font-size: 12px; }
.cs-chat svg.ic { width: 14px; height: 14px; flex: none; color: var(--text-2); }
.cs-chat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-evs, .cs-loose { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-ev { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--ev-soft, var(--surface-2)); color: var(--ev-text, var(--text)); font-size: 12.5px; text-align: left; }
.cs-ev svg.ic { width: 15px; height: 15px; flex: none; }
.cs-ev span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-ev b { font-weight: 600; }
.cs-ev:hover { filter: brightness(0.96); }
.cs-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; --stripe: transparent; }
.cs-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--stripe); }
.cs-card[data-st="running"] { --stripe: var(--s-active); }
.cs-card[data-st="upcoming"] { --stripe: var(--accent); }
.cs-card[data-st="finished"] { --stripe: var(--s-idle); }
.cs-card-main { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px 12px 17px; color: var(--text); text-align: left; }
.cs-card-main:hover { background: color-mix(in srgb, var(--surface) 88%, var(--surface-2)); }
.cs-card-top { display: flex; align-items: flex-start; gap: 8px; }
.cs-card-top .cs-course { flex: 1; min-width: 0; }
.cs-card-top b { font-size: 15px; }
.cs-card-top > .chip { flex: none; margin-top: 2px; }
.cs-meta { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.cs-dates { font-size: 14px; font-weight: 600; }
.cs-card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; }
.cs-card > .cs-evs { padding: 0 14px 12px 17px; }
.cs-sheet-dates { margin-bottom: 8px; font-size: 15px; }
.cs-sheet .cs-progress { max-width: 320px; margin-bottom: 12px; }
.cs-sheet > .xs { display: block; margin-bottom: 10px; }
.cs-people, .cs-sheet-evs { display: flex; flex-direction: column; gap: 8px; }
.cs-person { display: flex; align-items: center; gap: 10px; }
.cs-person .grow { flex: 1; min-width: 0; }
.cs-sheet-ev { align-items: center; min-height: 56px; }
.cs-sheet-ev > svg.ic { width: 18px; height: 18px; color: var(--text-2); }
@container app (max-width: 519px) { .cs-filters > .select { flex: 1 1 100%; } }
@container app (max-width: 419px) { .mt-segs .seg button, .cs-filters .seg button { padding: 4px 9px; } }

/* ---------- События школы: плашки, карточка, форма ---------- */
.chip.ev-chip { background: var(--ev-soft, var(--surface-2)); color: var(--ev-text, var(--text-2)); }
.ev-chip svg.ic { width: 14px; height: 14px; }
.ev-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 26px; padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--ev-soft, var(--surface-2)); color: var(--ev-text, var(--text)); font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; text-align: left; }
.ev-pill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ev-pill b { font-weight: 600; }
.ev-pill svg.ic { width: 14px; height: 14px; flex: none; }
.ev-pill:hover { filter: brightness(0.96); }
.ev-sheet .chips { align-items: center; }
.ev-when { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ev-when-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ev-soft, var(--surface-2)); color: var(--ev-text, var(--text)); }
.ev-when-ic svg.ic { width: 22px; height: 22px; }
.ev-when .grow { flex: 1; min-width: 0; }
.ev-when b { font-size: 16px; }
.btn.ev-link { text-decoration: none; margin-bottom: 4px; }
.ev-url { margin-bottom: 12px; overflow-wrap: anywhere; }
.ev-who { display: inline-flex; align-items: center; gap: 6px; }
.ev-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.ev-form .chip-row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.ev-kinds .fchip svg.ic { width: 16px; height: 16px; }
.ev-times { display: flex; align-items: center; gap: 6px; }
.ev-times .input { flex: 1; min-width: 0; }
.card.ev-repeat { margin-bottom: 12px; padding: 0 12px; }
.ev-repeat .switch { border-bottom: 0; }
/* Календарь: слой «События» */
.cal-pill.cal-pill--ev { background: var(--ev-soft, var(--accent-soft)); color: var(--ev-text, var(--accent)); }
svg.ic.cal-evic { width: 12px; height: 12px; flex: none; }
.row-btn.cal-ev--school { --stripe: var(--ev, var(--accent)); }
.cal-ev-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ev-soft, var(--accent-soft)); color: var(--ev-text, var(--accent)); }
.cal-ev-ic svg.ic { width: 18px; height: 18px; }
svg.ic.cal-lg-ic { width: 14px; height: 14px; color: var(--accent); }
.cal-legend svg.ic.cal-lg-ic + svg.ic.cal-lg-ic { margin-left: -4px; color: var(--ev-meeting-text); }
/* График смен: строка «События школы» */
.sched-events .sched-name { background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.sched-name .icon-btn.sched-ev-add { width: 32px; height: 32px; margin-left: auto; }
.sched-ev-add svg.ic { width: 18px; height: 18px; }
.sched-cell.sched-evcell { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 3px; padding: 4px 3px; background: color-mix(in srgb, var(--accent-soft) 15%, var(--surface)); min-width: 0; }
.sched-cell.sched-evcell.is-today { background: var(--accent-soft); }
.sched-evcell .ev-pill { align-items: flex-start; min-width: 0; padding: 3px 5px; border-radius: 7px; line-height: 15px; white-space: normal; }
.sched-evcell .ev-pill > span { overflow: visible; }
.sched-evcell .ev-pill svg.ic { width: 13px; height: 13px; margin-top: 1px; }
.sched-events .sched-name .n { white-space: normal; overflow: visible; line-height: 1.2; }
@container app (max-width: 759px) { .sched-evcell .ev-pill-k { display: none; } }
/* «Сейчас»: «Сегодня в школе» */
.school-today { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.st-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.st-head > svg.ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.st-head b { font-size: 15px; }
.st-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.st-item { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.st-item:first-child { border-top: 0; }
.st-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 0; color: var(--text); text-align: left; }
.st-time { flex: none; min-width: 46px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.st-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ev-soft, var(--surface-2)); color: var(--ev-text, var(--text)); }
.st-ic svg.ic { width: 16px; height: 16px; }
.st-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.st-kind { color: var(--ev-text, var(--text-2)); font-weight: 600; }
.st-link { flex: none; text-decoration: none; }
.st-link svg.ic { width: 16px; height: 16px; }
@container app (max-width: 419px) { .st-link span { display: none; } .st-link { padding: 4px 8px; } .st-title { white-space: normal; overflow-wrap: anywhere; } }

/* ---------- Команда: состав и обязанности ---------- */
.team-list { gap: 8px; }
.team-top { display: flex; align-items: flex-start; gap: 10px; }
.team-top > .avatar { margin-top: 2px; }
.team-top .grow { flex: 1; min-width: 0; }
.team-top .row-title .xs { font-weight: 400; }
.team-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 48%; }
.team-duties { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.team-duties-text { margin-top: 2px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.team-login { display: flex; align-items: center; gap: 4px; margin-top: 6px; overflow-wrap: anywhere; }
.team-login svg.ic { width: 14px; height: 14px; flex: none; }
@container app (max-width: 519px) {
  .team-top { flex-wrap: wrap; }
  .team-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; width: 100%; max-width: none; padding-left: 36px; }
  .team-side:empty { display: none; }
}

/* ---------- Подключения: платформа школы ---------- */
/* Ссылка на оплату из диалога (components/paymentLink.js, docs/PLATFORM_SYNC.md §3) */
.pl-result { display: flex; flex-direction: column; gap: 8px; }
.pl-result .pl-ok { display: flex; align-items: center; gap: 6px; margin: 0; }
.pl-result .pl-ok .ic { color: var(--s-ok); }
.pl-url { font-size: 15px; }
.pl-result .chips { margin: 0; }
.pl-hist .icon-btn { flex: none; }
.pf-card { display: flex; flex-direction: column; gap: 10px; }
.pf-card .chips { margin: 0; }
/* Обмен с платформой (docs/PLATFORM_SYNC.md): карточка над активностью кураторов */
.pf-sync { margin-bottom: var(--gap-card); }
.pf-sync .card-title { margin: 0; }
.pf-grid { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pf-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, minmax(52px, 96px)); align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pf-row:last-child { border-bottom: 0; }
.pf-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.pf-head { background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.pf-s { display: none; }
.pf-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-who > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-unmatched { padding: 10px 12px; border-radius: 10px; background: var(--s-wait-soft); }
.pf-um { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 4px 0; }
.pf-um .inv-code { flex: 1 1 160px; }
.pf-url .inv-code { flex: 1 1 220px; }
.pf-dev summary { display: flex; align-items: center; min-height: 40px; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; }
.pf-json { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
@container app (max-width: 519px) {
  .pf-l { display: none; }
  .pf-s { display: inline; }
  .pf-row { grid-template-columns: minmax(0, 1fr) repeat(4, minmax(0, 46px)); gap: 4px; padding: 6px 8px; }
}

/* ---- v3.2: календарь школы, задачи, база знаний ---- */

/* Новые виды событий школы: «Повтор МК», «Кейсы», «Экзамен», «Выпускной» (плашки графика, «Сегодня в школе», карточки) */
:root {
  --ev-repeat: #B5446E; --ev-repeat-soft: #FBE6EF; --ev-repeat-text: #9A3159;
  --ev-cases: #6B4FC8; --ev-cases-soft: #EEE9FB; --ev-cases-text: #5A3FB0;
  --ev-exam: #2F7D5B; --ev-exam-soft: #E2F3EA; --ev-exam-text: #24694B;
  --ev-graduation: #A87C00; --ev-graduation-soft: #FBF3D5; --ev-graduation-text: #7F5E00;
  --spec-chats: #2457BF; --spec-chats-soft: #E6EDFC;
  --spec-platform: #0B6B69; --spec-platform-soft: #DDF2F1;
  --cal-chip-mix: 46%;          /* светлый оттенок цвета плашки */
  --cal-dot-mix: 62%;           /* точка: цвет, притемнённый к чёрному */
  --cal-fill-text: #2A2026;     /* текст на залитой плашке потока (пастельный цвет) */
  --cal-dot-dl: 0.26; --cal-dot-kc: 2.6;
  --band-h: 5px; --band-gap: 3px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ev-repeat: #E89AB8; --ev-repeat-soft: #3A2330; --ev-repeat-text: #F0B5CC;
    --ev-cases: #A894F0; --ev-cases-soft: #2A2440; --ev-cases-text: #C3B5F6;
    --ev-exam: #6CC498; --ev-exam-soft: #1D3328; --ev-exam-text: #8FD6B1;
    --ev-graduation: #E2C25A; --ev-graduation-soft: #3A3218; --ev-graduation-text: #EBD07E;
    --spec-chats: #9DB8F5; --spec-chats-soft: #1F2B45;
    --spec-platform: #7FD6D2; --spec-platform-soft: #173331;
    --cal-chip-mix: 24%;
    --cal-dot-mix: 100%;
    --cal-dot-dl: -0.02; --cal-dot-kc: 1.7;
  }
}
:root[data-theme="dark"] {
  --ev-repeat: #E89AB8; --ev-repeat-soft: #3A2330; --ev-repeat-text: #F0B5CC;
  --ev-cases: #A894F0; --ev-cases-soft: #2A2440; --ev-cases-text: #C3B5F6;
  --ev-exam: #6CC498; --ev-exam-soft: #1D3328; --ev-exam-text: #8FD6B1;
  --ev-graduation: #E2C25A; --ev-graduation-soft: #3A3218; --ev-graduation-text: #EBD07E;
  --spec-chats: #9DB8F5; --spec-chats-soft: #1F2B45;
  --spec-platform: #7FD6D2; --spec-platform-soft: #173331;
  --cal-chip-mix: 24%;
  --cal-dot-mix: 100%;
  --cal-dot-dl: -0.02; --cal-dot-kc: 1.7;
}
[data-ev="repeat"] { --ev: var(--ev-repeat); --ev-soft: var(--ev-repeat-soft); --ev-text: var(--ev-repeat-text); }
[data-ev="cases"] { --ev: var(--ev-cases); --ev-soft: var(--ev-cases-soft); --ev-text: var(--ev-cases-text); }
[data-ev="exam"] { --ev: var(--ev-exam); --ev-soft: var(--ev-exam-soft); --ev-text: var(--ev-exam-text); }
[data-ev="graduation"] { --ev: var(--ev-graduation); --ev-soft: var(--ev-graduation-soft); --ev-text: var(--ev-graduation-text); }

/* ---------- График смен: точка «есть заметка» — в углу ячейки, с обводкой фона, не на времени ---------- */
.sched-cell.has-note { position: relative; }
.sched-cell > .sh-note { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; margin: 0; border-radius: 50%; background: var(--s-wait); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.sched-cell.is-today > .sh-note { box-shadow: 0 0 0 2px var(--accent-soft); }
.legend .sh-sample { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-right: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); vertical-align: middle; }
.legend .sh-sample .sh { margin-right: 0; }
.legend .sh-sample > .sh-note { position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; margin: 0; border-radius: 50%; background: var(--s-wait); box-shadow: 0 0 0 2px var(--surface); vertical-align: baseline; }

/* ---------- «Спланировать день» ---------- */
.rit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rit-head h3 { font-size: 15px; }
.rit-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rit-add { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.rit-add-lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.rit-add-row { display: flex; gap: 6px; align-items: stretch; }
.rit-add-row .input:first-child { flex: 1 1 auto; min-width: 0; }
.rit-add-row .rit-time { flex: 0 0 104px; width: 104px; }
.rit-add-row .btn { flex: none; }
.rit-add .hint { font-size: 12px; color: var(--text-2); }
.rit-add .hint.t-bad { color: var(--s-bad); }
.rit-more-btn { margin-bottom: 6px; }
.rit-plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.rit-plan li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); min-height: 52px; }
.rit-plan li:last-child { border-bottom: 0; }
.rit-plan .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rit-t { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.rit-ok { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--s-ok-soft); color: var(--s-ok); }
.rit-ok svg.ic { width: 14px; height: 14px; }
.icon-btn.rit-rm { flex: none; color: var(--text-2); }
.icon-btn.rit-rm:hover { color: var(--s-bad); background: var(--s-bad-soft); }
@container app (max-width: 419px) {
  .rit-add-row { flex-wrap: wrap; }
  .rit-add-row .input:first-child { flex: 1 1 100%; }
  .rit-add-row .rit-time { flex: 1 1 auto; width: auto; }
  .rit-add-row .btn { flex: 1 1 auto; }
}

/* ---------- Задачи: «поставила {Имя}» ---------- */
.task-by { color: var(--text-2); white-space: nowrap; }

/* ---------- Специализации кураторов ---------- */
.chip.spec-chip { font-size: 11.5px; padding: 1px 8px; line-height: 17px; }
.chip.spec-chip[data-spec="chats"] { background: var(--spec-chats-soft); color: var(--spec-chats); }
.chip.spec-chip[data-spec="platform"] { background: var(--spec-platform-soft); color: var(--spec-platform); }
.chip.spec-chip--none { font-weight: 400; }
.chips--inline { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.spec-toggles { margin: 4px 0 2px; }
.spec-toggles .fchip { min-height: 36px; }
.team-specs { margin-top: 4px; gap: 4px; }

/* ---------- Пройденные курсы «ЖВВЖ ✓» ---------- */
.chip.course-done { background: var(--s-ok-soft); color: var(--s-ok); font-size: 11.5px; padding: 1px 8px; line-height: 17px; font-weight: 600; }

/* ---------- Цвет потока ---------- */
.co-sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, #000 30%); vertical-align: -1px; margin-right: 6px; }
.co-sw--lg { width: 14px; height: 14px; border-radius: 4px; }
.row-btn.co-row { align-items: flex-start; }
.row-btn.co-row > .co-sw { margin: 4px 0 0; }
.chip.co-desc { font-size: 11.5px; padding: 0 8px; line-height: 18px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.co-colors { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.co-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.co-color i { width: 26px; height: 26px; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 75%, #000 25%); }
.co-color[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.co-color--auto { width: auto; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.co-color--auto[aria-checked="true"] { color: var(--text); }
.co-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.co-pick-u { gap: 6px; }
.co-pick-spec { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.fchip[aria-pressed="true"] .co-pick-spec { background: color-mix(in srgb, var(--accent-text) 22%, transparent); color: var(--accent-text); }

/* ---------- Ученицы ---------- */
.st-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.st-toolbar .select.st-cohort { width: auto; min-width: 170px; max-width: 100%; }
.st-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-ro-hint { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; }
.st-ro-hint svg.ic { width: 14px; height: 14px; flex: none; }
.st-ro { display: flex; align-items: flex-start; gap: 6px; }
.st-ro svg.ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
h3.st-h { font-size: 14px; }
.st-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.st-hist li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 48px; }
.st-hist li:last-child { border-bottom: 0; }
.st-hist li.is-current { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.st-hist .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.st-hist .co-sw { margin-right: 0; }
@container app (max-width: 419px) {
  .st-toolbar .seg.st-scope { flex: 1 1 100%; }
  .st-toolbar .seg.st-scope button { flex: 1 1 0; justify-content: center; padding: 4px 6px; }
  .st-toolbar .select.st-cohort { flex: 1 1 auto; min-width: 0; }
}

/* ---------- База знаний: «Как пополнить базу» ---------- */
.kb-hint { margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: var(--r-card); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.kb-hint-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--text); text-align: left; }
.kb-hint-btn span { flex: 1; }
.kb-hint-btn svg.ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.kb-hint-btn svg.ic:last-child { color: var(--text-2); }
.kb-hint-body { padding: 0 12px 12px 38px; font-size: 14px; color: var(--text); }
.kb-hint-body p { margin: 0 0 10px; line-height: 1.45; }
.kb-hint-body[hidden] { display: none; }
.kb-empty { gap: 12px; }
.kb-hint--empty { width: 100%; max-width: 520px; margin: 0; text-align: left; }

/* ---------- Почта клиентки ---------- */
.copy-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 100%; overflow-wrap: anywhere; }
.copy-line a { overflow-wrap: anywhere; }
.copy-line .btn--sm { min-height: 32px; padding: 2px 10px; }
.copy-line .icon-btn { width: 32px; height: 32px; }
.t-email-edit { padding: 10px 12px; }
.t-email-act { margin: -4px 0 8px; }
.rf-email { color: var(--text); }
.am-label-chips { margin: 6px 0 0; padding-bottom: 2px; }

/* ---------- Подключения: Start у бота ---------- */
.note.conn-start { display: flex; align-items: flex-start; gap: 8px; border-style: solid; border-color: color-mix(in srgb, var(--s-wait) 35%, var(--line)); background: var(--s-wait-soft); color: var(--text); }
.note.conn-start svg.ic { width: 18px; height: 18px; flex: none; color: var(--s-wait); margin-top: 1px; }
.note.conn-start .link-btn { min-height: 0; display: inline; }

/* ---------- Отчёты: критерий не относится к специализации ---------- */
.rep-crit--na { opacity: 0.85; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.rep-crit--na .rep-crit-top b { color: var(--text-2); }

/* ---------- График курсов: кураторы по ролям ---------- */
.cs-roles { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.cs-role { overflow-wrap: anywhere; }
.cs-role-l { color: var(--text-2); }
.cs-desc { color: var(--s-wait); }
.cs-role-h { margin: 8px 0 4px; font-weight: 600; text-transform: none; }
.cs-course .co-sw { margin-right: 2px; }

/* ---------- Импорт «Личного ведения» из Google Таблицы ---------- */
@container app (min-width: 760px) { .sheet:has(.mi-sheet) { width: 820px; } }
.mi-steps { margin-bottom: 4px; }
.mi-sheet .imp-file span { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
svg.ic.mi-ok { width: 14px; height: 14px; color: var(--s-ok); flex: none; }
.mi-steps li { font-size: 13.5px; }
.mi-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.note.mi-warn { display: flex; align-items: flex-start; gap: 8px; border-style: solid; border-color: color-mix(in srgb, var(--s-wait) 35%, var(--line)); background: var(--s-wait-soft); color: var(--text); }
.note.mi-warn svg.ic { width: 16px; height: 16px; flex: none; color: var(--s-wait); margin-top: 1px; }
.mi-errors { padding: 10px 12px; border-radius: 10px; background: var(--s-bad-soft); }
.mi-errors ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text); }
.mi-errors b { color: var(--s-bad); }
.mi-tbl { display: none; }
.mi-tbl table.tbl { min-width: 760px; font-size: 13px; }
.mi-tbl .tbl td { vertical-align: top; }
.mi-tbl tr[data-block="planned"] td { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.mi-contacts { overflow-wrap: anywhere; }
.mi-tbl .mi-dates, .mi-tbl .mi-pkg { white-space: nowrap; }
.mi-contacts div + div { color: var(--text-2); }
.mi-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.mi-cards { display: flex; flex-direction: column; gap: 8px; }
.mi-card { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.mi-card[data-block="planned"] { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.mi-card-top { display: flex; align-items: center; gap: 8px; }
.mi-card .mi-note { max-width: none; white-space: normal; }
.mi-result .card-title { display: flex; align-items: center; gap: 6px; }
@container app (min-width: 760px) {
  .mi-tbl { display: block; }
  .mi-cards { display: none; }
}

/* ---------- Календарь школы (как «Июнь 2026») ---------- */
.cal-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.cal-top .cal-nav { margin-bottom: 0; flex: 1 1 auto; }
.cal-streams { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 14px; }
.cal-stream { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 2px 4px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); }
.cal-stream:hover { background: var(--surface-2); }
.cal-stream i { flex: none; width: 22px; height: 6px; border-radius: 999px; background: var(--c); }
.cal--v32 { --lanes: 0; }
.cal--v32 .cal-week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal--v32 .cal-week:last-child { border-bottom: 0; }
.cal--v32 .cal-cell { border-bottom: 0; min-height: calc(52px + var(--lanes) * (var(--band-h) + var(--band-gap))); padding-bottom: calc(var(--lanes) * (var(--band-h) + var(--band-gap)) + 6px); }
.cal--v32 .cal-cell:nth-child(7n) { border-right: 0; }
.cal--v32 .cal-cell.is-weekend { background: var(--surface); }
.cal--v32 .cal-cell.is-out { background: var(--cal-out-bg); }
.cal--v32 .cal-cell.is-out .cal-chips, .cal--v32 .cal-cell.is-out .cal-dots { opacity: 0.55; }
.cal--v32 .cal-cell.has-end { background: var(--surface); box-shadow: none; }
.cal--v32 .cal-cell.has-end .cal-num { color: var(--text); }
.cal--v32 .cal-cell.is-out.has-end { background: var(--cal-out-bg); }
.cal--v32 .cal-cell.is-sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal--v32 .cal-cell.is-today .cal-num { color: var(--accent-text); }
.cal--v32 .cal-cell:hover { background: color-mix(in srgb, var(--surface) 86%, var(--surface-2)); }
.cal--v32 .cal-cell.is-out:hover { background: color-mix(in srgb, var(--cal-out-bg) 80%, var(--surface-2)); }
/* Плашки: светлый оттенок цвета + точка; время после названия */
.cal-chips { display: none; position: relative; z-index: 2; width: 100%; flex-direction: column; gap: 2px; pointer-events: none; }
.cal-chip, .cal-chips .cal-more { pointer-events: auto; }
.cal-chip { --c: var(--tone, var(--s-idle)); display: flex; align-items: center; gap: 4px; width: 100%; min-height: 20px; padding: 1px 5px; border-radius: 6px; font-size: 11px; font-weight: 500; line-height: 18px; text-align: left; color: var(--text);
  background: color-mix(in srgb, var(--c) var(--cal-chip-mix), var(--surface)); overflow: hidden; }
.cal-chip[data-tone]:not([style]) { background: var(--tone-soft); }
.cal-chip-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in oklab, var(--c) var(--cal-dot-mix), #000); }
/* Точка ярче пастельного цвета: темнее и насыщеннее (в тёмной теме — светлая, насыщеннее) */
@supports (color: oklch(from red l c h)) {
  .cal-chip[style] .cal-chip-dot, .cal--v32 .cal-dots i[style] { background: oklch(from var(--c) calc(l - var(--cal-dot-dl)) calc(c * var(--cal-dot-kc)) h); }
}
.cal-chip-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip-tm { flex: none; color: var(--text-2); font-weight: 600; font-size: 10.5px; }
.cal-chip:hover { filter: brightness(0.97); }
.cal-chip.cal-chip--fill { background: var(--c); color: var(--cal-fill-text); font-weight: 600; }
.cal-chip.cal-chip--end, .cal-chip.cal-chip--end[data-tone] { background: var(--cal-bad-solid); color: var(--cal-bad-on); font-weight: 600; }
.cal-chip.cal-chip--end .cal-chip-dot { background: var(--cal-bad-on); }
.cal-chip svg.ic.cal-star { width: 11px; height: 11px; color: var(--accent); }
.cal-chip.cal-chip--end svg.ic.cal-star { color: var(--cal-bad-on); }
.cal-chip[data-tone="bad"], .cal-dots i[data-tone="bad"] { --tone: var(--s-bad); --tone-soft: var(--s-bad-soft); }
.cal-chip[data-tone="wait"], .cal-dots i[data-tone="wait"] { --tone: var(--s-wait); --tone-soft: var(--s-wait-soft); }
.cal-chip[data-tone="accent"], .cal-dots i[data-tone="accent"] { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.cal-chip[data-tone="ok"], .cal-dots i[data-tone="ok"] { --tone: var(--s-ok); --tone-soft: var(--s-ok-soft); }
.cal-chip[data-tone="idle"], .cal-dots i[data-tone="idle"] { --tone: var(--s-idle); --tone-soft: var(--s-idle-soft); }
.cal--v32 .cal-dots i[style] { background: color-mix(in oklab, var(--c) var(--cal-dot-mix), #000); }
.cal--v32 .cal-dots i[data-kind="mentoring_end"] { background: var(--cal-bad-solid); }
.cal--v32 .cal-dots i[data-kind="course_start"][style], .cal--v32 .cal-dots i[data-kind="course_end"][style] { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px color-mix(in oklab, var(--c) var(--cal-dot-mix), #000); }
/* Полосы потоков внизу недели: одна полоса — один поток, ряд постоянный для месяца */
.cal-bands { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--lanes), var(--band-h)); row-gap: var(--band-gap); pointer-events: none; }
.cal-band { display: block; height: var(--band-h); background: var(--c); }
.cal-band.is-start { margin-left: 6px; border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.cal-band.is-end { margin-right: 6px; border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
/* Легенда под сеткой */
.cal-lg-chip { display: inline-block; width: 22px; height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--c) var(--cal-chip-mix), var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent); }
.cal-lg-chip--fill { background: var(--c); box-shadow: none; }
.cal-lg-band { display: inline-block; width: 22px; height: 5px; border-radius: 999px; background: linear-gradient(90deg, #E9A3A0 0 50%, #B9A7F0 50% 100%); }
/* Список дня: цвет события */
.row-btn.cal-ev--color { --stripe: var(--c); }
.cal-ev-sw { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, #000 30%); }
.cal-ev-tm { margin-left: 2px; color: var(--text-2); font-weight: 600; font-size: 13px; }
@container app (min-width: 760px) {
  .cal--v32 .cal-cell { min-height: calc(104px + var(--lanes) * (var(--band-h) + var(--band-gap))); padding: 4px 4px calc(var(--lanes) * (var(--band-h) + var(--band-gap)) + 8px); }
  .cal--v32 .cal-chips { display: flex; }
  .cal--v32 .cal-dots { display: none; }
}
@container app (max-width: 759px) {
  .cal--v32 { --band-h: 3px; --band-gap: 2px; }
  .cal--v32 .cal-cell { gap: 3px; padding-top: 3px; }
  .cal--v32 .cal-dots i { width: 6px; height: 6px; }
  .cal-band.is-start { margin-left: 3px; }
  .cal-band.is-end { margin-right: 3px; }
  .cal-bands { bottom: 4px; }
  .cal-top { flex-direction: column; align-items: stretch; }
  .cal-streams { justify-content: flex-start; gap: 2px 12px; }
  .cal-stream { font-size: 12px; min-height: 28px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cal-band { background: color-mix(in srgb, var(--c) 82%, var(--surface)); }
}
:root[data-theme="dark"] .cal-band { background: color-mix(in srgb, var(--c) 82%, var(--surface)); }

/* ---- v4 (06–07.10.2026): финансы Светы, курс школы, конверсия, два трека ведения, отчёт кураторов, касания курсов ---- */
/* Графики без библиотек: SVG на токенах темы */
.chart-wrap { padding: 10px 8px 6px; overflow-x: auto; scrollbar-width: thin; }
.chart-wrap svg.chart { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.chart-wrap--mini { padding: 0; margin-top: 8px; overflow-x: auto; }
.chart-wrap--mini svg.chart { margin: 0; }
.chart-val { font-size: 11px; font-weight: 600; fill: var(--text); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-val--sm { font-size: 10px; }
.chart-val--ok { fill: var(--s-ok); }
.chart-lbl { font-size: 11px; fill: var(--text-2); font-family: var(--font); }
.chart-center { font-size: 15px; font-weight: 700; fill: var(--text); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px; }
.chart-donut-wrap svg.chart-donut { flex: none; }
.chart-legend { flex: 1 1 200px; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.chart-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.chart-legend li i { width: 10px; height: 10px; border-radius: 3px; }
.chart-lg-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend b { white-space: nowrap; }
.chart-conv--mini { max-height: 110px; }
/* Стрелки динамики: ↑ лучше, ↓ хуже, → без изменений */
.trend { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; font-weight: 700; line-height: 1; vertical-align: baseline; }
.trend--ok { color: var(--s-ok); }
.trend--bad { color: var(--s-bad); }
.trend--idle { color: var(--text-2); }
.trend .xs { margin-left: 3px; font-weight: 500; }

/* «Финансы»: вкладки, фильтры, чеки */
.fin-tabs { margin-bottom: 12px; }
.fin-tabs .seg .n { margin-left: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--s-wait-soft); color: var(--s-wait); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.fin-selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; flex: 1 1 100%; }
.fin-selects .select { min-width: 0; }
.fin-selects .select:only-child { grid-column: 1 / -1; }
.rc-row { align-items: flex-start; }
.rc-title { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.rc-title > b { font-size: 16px; }
.rc-cur { font-size: 13px; }
.rc-row .side { max-width: 38%; }
.rc-row .row-sub { overflow-wrap: anywhere; }
/* Карточка чека в шторке */
.rc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 10px; }
.rc-sum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-right: auto; }
.rc-sum > b { font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; }
.rc-dup { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 6px; margin-bottom: 10px; }
.rc-dup > svg.ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.rc-dup .link-btn { min-height: 0; font-weight: 600; }
.rc-dup .actions { flex: 1 1 100%; }
.rc-links { margin-top: 12px; }
.rc-sheet .kv { margin-bottom: 4px; }
/* Форма чека */
.rc-form .form-grid .span { grid-column: 1 / -1; }
.rc-form .hint { display: block; margin-top: 4px; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.rc-form .hint.t-wait { color: var(--s-wait); }
.rc-form .hint.t-bad { color: var(--s-bad); }
.rc-type button { padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
.rc-newclient { margin-bottom: 12px; }
.rc-newclient .form-grid { margin-top: 8px; }
.rc-form .mc-picked { margin-bottom: 8px; }
/* Отчёты: раскрывающиеся строки по продуктам и отделам */
.rep-products { display: flex; flex-direction: column; gap: 6px; }
.rp-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rp-item summary { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; min-height: 44px; padding: 6px 12px; cursor: pointer; list-style: none; }
.rp-item summary::-webkit-details-marker { display: none; }
.rp-item summary::before { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(-45deg); transition: transform 0.15s ease; margin-right: 2px; }
.rp-item[open] summary::before { transform: rotate(45deg); }
.rp-item summary .fbar-label { flex: 1 1 140px; white-space: normal; overflow-wrap: anywhere; }
.rp-item summary > b { white-space: nowrap; }
.rp-pkgs { list-style: none; margin: 0; padding: 2px 12px 10px 28px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rp-pkgs li { display: flex; align-items: baseline; gap: 10px; }
.rp-pkgs li > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rp-pkgs li b { white-space: nowrap; }
/* Категории расходов (шторка) */
.cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cat-row { display: flex; align-items: center; gap: 4px; }
.cat-row .input { flex: 1; min-width: 0; }
.cat-row .icon-btn { flex: none; }
/* Зарплата: карточки на телефоне */
.sal-card .row-title { justify-content: space-between; gap: 8px; }
.sal-card .row-title b:last-child { font-size: 16px; }
.sal-card .kv { margin-top: 8px; }
.sal-card .actions { margin-top: 8px; }
@container app (min-width: 760px) {
  .fin-selects { flex: 1 1 340px; }
  .chart-donut-wrap { flex-wrap: nowrap; }
}

/* «Пульт»: конверсия */
.conv-tile { grid-column: 1 / -1; }
.conv-tile .tile-head .chips { margin-left: auto; }
.conv-tile[data-sev="ok"] { border-color: color-mix(in srgb, var(--s-ok) 45%, var(--line)); }
.conv-tile[data-sev="wait"] { border-color: color-mix(in srgb, var(--s-wait) 45%, var(--line)); }
.conv-tile .val .trend { font-size: 18px; }
/* «Разбор продаж» → «Динамика» */
.dyn-card[data-sev="ok"] { border-color: color-mix(in srgb, var(--s-ok) 45%, var(--line)); }
.dyn-card[data-sev="wait"] { border-color: color-mix(in srgb, var(--s-wait) 45%, var(--line)); }
.dyn-card .row-title { justify-content: space-between; }
.dyn-card .coach-pct { font-weight: 700; }

/* «Сейчас»: строки конверсии, недожатых и дежурного */
.conv-line { background: var(--s-ok-soft); }
.conv-line svg.ic { color: var(--s-ok); }
.conv-line:hover { background: color-mix(in srgb, var(--s-ok-soft) 85%, var(--s-ok)); }
.pend-line { background: var(--s-wait-soft); }
.pend-line svg.ic { color: var(--s-wait); }
.pend-line:hover { background: color-mix(in srgb, var(--s-wait-soft) 85%, var(--s-wait)); }
div.duty-line { cursor: default; background: var(--surface); border: 1px solid var(--line); }
div.duty-line:hover { background: var(--surface); }
.duty-line svg.ic { color: var(--accent); }
.fx-widget--stale { border-color: color-mix(in srgb, var(--s-wait) 55%, var(--line)); }
.fx-widget--stale .fx-widget-sub { color: var(--s-wait); }

/* Курс школы: шапка конвертера и шторка «Обновить курс школы» */
.fx-school { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.fx-school > svg.ic { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--accent); }
.fx-school .grow { flex: 1; min-width: 0; }
.fx-school .grow > b { font-size: 15px; }
.fx-school .btn { flex: none; align-self: center; }
.fx-school.is-stale { border-color: color-mix(in srgb, var(--s-wait) 55%, var(--line)); }
.fx-school.is-stale > svg.ic { color: var(--s-wait); }
.fx-market { margin-top: 2px; }
.fx-manual-grid { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.fx-manual-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(72px, auto); align-items: center; gap: 8px; }
.fx-manual-code { display: flex; flex-direction: column; font-weight: 700; letter-spacing: 0.02em; line-height: 1.15; }
.fx-manual-code .xs { font-weight: 400; letter-spacing: 0; }
.fx-manual-row .input { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.fx-manual-row > .num { text-align: right; white-space: nowrap; }
@container app (max-width: 419px) { .fx-manual-row { grid-template-columns: 76px minmax(0, 1fr) minmax(60px, auto); } }

/* Курсы и цены: группы, пакеты «по заявке», способы оплаты */
.pr-group + .pr-group { margin-top: 14px; }
.pr-regular { text-decoration: line-through; }
.pr-pkg--request { border-style: dashed; border-color: color-mix(in srgb, var(--s-wait) 55%, var(--line)); }
.pm-card .pr-code { font-size: 15px; }
.pm-card .pr-line b { color: var(--text); }
.pm-card .chips { margin-top: 2px; }

/* Личное ведение: переключатель треков */
.mt-tracks { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.mt-tracks .seg { max-width: 460px; }
@container app (min-width: 760px) { .mt-tracks { flex: 1 1 100%; } }

/* Отчёт кураторов: таблица активностей по схеме Даши */
.seg.seg--xs { padding: 2px; }
.seg--xs button { min-height: 28px; padding: 2px 8px; font-size: 12px; }
.act-tbl table.tbl { min-width: 720px; }
.act-tbl .tbl td { vertical-align: top; }
.act-tr[data-src="auto"] td { color: var(--text-2); }
.act-tr[data-src="auto"] td .act-title, .act-tr[data-src="auto"] td b { color: var(--text); }
.act-who { min-width: 150px; font-size: 14px; }
.act-who b { white-space: nowrap; }
.act-tr td:nth-child(2) { min-width: 220px; }
.act-title { min-height: 0; text-align: left; font-weight: 500; }
.act-note { min-width: 180px; max-width: 320px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.act-tools { display: flex; gap: 2px; margin: 4px 0 0 -8px; }
.act-tools .icon-btn { width: 34px; height: 34px; }
.act-tools .icon-btn svg.ic { width: 18px; height: 18px; }
.act-card .row-title { justify-content: space-between; margin-bottom: 4px; }
.act-item { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.act-item-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-weight: 500; }
.act-item-top .link-btn { min-height: 0; text-align: left; font-weight: 500; }
.act-item-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.act-item-foot .icon-btn { width: 36px; height: 36px; }
.act-item-foot .act-inv { margin-right: auto; }

/* График курсов: таблица по дням с касаниями */
.cs-view { margin-bottom: 10px; }
.csd-tbl table.tbl { min-width: 760px; }
.csd-tbl .tbl th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.csd-tbl .tbl td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
.csd-tr.is-weekend td { background: var(--cal-out-bg); }
.csd-tr.is-today td { background: var(--accent-soft); }
.csd-tr.is-today td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.csd-tr.has-touch .csd-touch { font-weight: 500; }
.csd-date { white-space: nowrap; font-weight: 600; }
.csd-wd { color: var(--text-2); white-space: nowrap; }
.csd-day { white-space: nowrap; }
.csd-daybtn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 8px; margin: 1px 0; border-radius: 8px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.csd-daybtn:hover { background: var(--surface-2); }
.csd-touch { min-width: 120px; }
.csd-touchbtn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 30px; padding: 3px 10px 3px 8px; margin: 1px 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 500; text-align: left; }
.csd-touchbtn svg.ic { width: 15px; height: 15px; flex: none; }
.csd-touchbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csd-touchbtn:hover { filter: brightness(0.96); }
.csd-card.is-today { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.csd-card .row-title { gap: 8px; margin-bottom: 4px; }
.csd-card-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.csd-card-course { flex: 1 1 100%; font-weight: 500; }
.csd-cards .csd-touchbtn span { white-space: normal; }
@container app (min-width: 760px) { .csd-tr.is-today td { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .csd-touchbtn { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
}
:root[data-theme="dark"] .csd-touchbtn { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
/* Команда: пометка, оклад (владелец/финансы), блок «Не работают» */
.team-note, .team-salary { display: flex; align-items: flex-start; gap: 4px; margin-top: 4px; overflow-wrap: anywhere; }
.team-note svg.ic, .team-salary svg.ic { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--text-2); }
.team-salary b { color: var(--text); }
.team-row--gone { opacity: 0.72; border-style: dashed; }
.team-row--gone .avatar { filter: grayscale(1); }
/* Админ → Сотрудники: пометка и выключенные */
.adm-note { display: flex; align-items: flex-start; gap: 4px; margin-top: 2px; overflow-wrap: anywhere; }
.adm-note svg.ic { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--text-2); }
.adm-user--gone { opacity: 0.75; }
.adm-user--gone .avatar { filter: grayscale(1); }
/* События: повтор — сегменты (не повторять / каждую неделю / каждый день / по будням) */
.card.ev-repeat { padding: 10px 12px 4px; }
.ev-repeat .field { margin-bottom: 8px; }
.ev-rec button { padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
@container app (max-width: 419px) { .ev-rec { flex-wrap: wrap; border-radius: 14px; } .ev-rec button { flex: 1 1 45%; } }
.done-todo { margin-top: 6px; font-size: 13px; }
/* v4: защита от горизонтальной прокрутки — колонки и поля формы не растягиваются под содержимое, сегменты переносят текст */
.cols > * { min-width: 0; }
@container app (min-width: 760px) { .cols--eq { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.form-grid > .span, .form-grid > .field { min-width: 0; }
.seg--block button { white-space: normal; min-width: 0; text-align: center; line-height: 1.2; }
.csd-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; }
.csd-legend svg.ic { display: inline-block; width: 14px; height: 14px; }
.csd-date, .csd-wd, .csd-day { width: 1%; }
.csd-tbl .csd-touchbtn { border-radius: 12px; white-space: normal; }
.csd-tbl .csd-touchbtn span { white-space: normal; line-height: 1.25; }
.csd-tbl .csd-touch { min-width: 160px; }

/* ===================================================================== v5 (контракт v5, 12.10.2026) ===================================================================== */
/* §8: чипы и сегменты — на ширине > 600 px переносятся на новую строку; на телефоне — прокрутка с затуханием края, последний чип не обрезается */
@container app (min-width: 601px) {
  .chip-row { flex-wrap: wrap; overflow-x: visible; }
  .seg-scroll { overflow-x: visible; }
  .seg-scroll .seg { flex-wrap: wrap; border-radius: 16px; }
  .seg-scroll .seg button { border-radius: 13px; }
}
@container app (max-width: 600px) {
  .chip-row, .seg-scroll {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  }
  .chip-row::after { content: ""; flex: 0 0 18px; }
  .seg-scroll { display: flex; }
  .seg-scroll > .seg { flex: none; }
  .seg-scroll::after { content: ""; flex: 0 0 24px; }
}

/* §10: демо — чей кабинет; жёлтая плашка после переключения роли */
.demo-wrap { flex: none; z-index: 5; }
.demo-bar .demo-cab { order: 20; flex: 1 1 100%; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--text-2); overflow-wrap: anywhere; }
.demo-bar .demo-cab b { color: var(--text); font-weight: 600; }
.demo-bar .demo-info { display: inline-flex; }
@container app (max-width: 759px) { .demo-bar .demo-cab-note { display: none; } }
.demo-plaque { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--imp-bg); color: var(--imp-text); border-bottom: 1px solid var(--imp-line); font-size: 13px; line-height: 1.35; }
.demo-plaque > svg.ic { width: 18px; height: 18px; flex: none; }
.demo-plaque .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.demo-plaque .icon-btn { color: inherit; width: 36px; height: 36px; }

/* §2: вопросы коллегам */
.card--q .card-title, .card--qa .card-title { font-size: 15px; }
.q-inline { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.q-inline .textarea { min-height: 64px; }
.q-kb { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-height: 32px; cursor: pointer; }
.q-kb input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.q-head { font-size: 14px; margin-bottom: 8px; overflow-wrap: anywhere; }
.q-text { margin: 0 0 10px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-answer { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--s-ok-soft); display: flex; flex-direction: column; gap: 4px; }
.q-answer-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--text); }
.q-answer-text--card { margin: 8px 0 2px; padding: 8px 12px; border-left: 3px solid var(--s-ok); background: var(--s-ok-soft); border-radius: 0 10px 10px 0; }
.q-row-answer { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 13px; color: var(--text); }
.q-row-answer svg.ic { width: 16px; height: 16px; color: var(--s-ok); flex: none; margin-top: 2px; }
.ask-ref { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; overflow-wrap: anywhere; }
.ask-ref svg.ic { width: 16px; height: 16px; flex: none; }
.ask-sug { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.ask-sug-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.ask-sug-head svg.ic { width: 16px; height: 16px; }
.ask-page { border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.ask-page:first-of-type { border-top: 0; }
.ask-page-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; text-align: left; color: var(--text); }
.ask-page-btn .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ask-page-t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ask-page-btn svg.ic { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.ask-page-body { padding: 4px 0 10px; font-size: 14px; }
.im-note { padding: 2px 6px; }
.kb-askcol { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.kb-askcol svg.ic { width: 16px; height: 16px; }

/* §5.1, §9: «Мои потоки сегодня», «Дела отдела на сегодня» */
.mc-list { display: grid; gap: var(--gap-card); }
@container app (min-width: 760px) { .mc-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.mc-card { --stripe: var(--c, var(--accent)); display: flex; flex-direction: column; gap: 8px; }
.mc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-head b { overflow-wrap: anywhere; }
.mc-day { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.mc-bar { height: 6px; }
.mc-touches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mc-touches li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--accent-soft); border-radius: 10px; }
.mc-touches .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-touch-t { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.mc-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-2); }
.mc-meta b { color: var(--text); }
.mc-open { align-self: flex-start; font-size: 13px; }
.mc-open svg.ic { width: 16px; height: 16px; }
.tt-list { display: flex; flex-direction: column; }
.tt-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-top: 1px solid var(--line); }
.tt-list .tt-row:first-child { border-top: 0; }
.task-row.tt-row { border-top: 1px solid var(--line); align-items: center; padding: 6px 10px; }
.tt-time { flex: none; width: 46px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.tt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tt-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.tt-row.is-done .tt-title, .tt-row.is-done .t { text-decoration: line-through; color: var(--text-2); }
.tt-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.tt-ok svg.ic { width: 20px; height: 20px; }
@container app (max-width: 519px) { .tt-row { flex-wrap: wrap; } .tt-acts { flex: 1 1 100%; justify-content: flex-start; padding-left: 56px; } .task-row.tt-row .side { flex: 1 1 100%; flex-direction: row; justify-content: flex-start; max-width: none; padding-left: 52px; } }
.seg--scope { margin-right: 4px; }
.rit-hint { padding: 8px 10px; background: var(--accent-soft); border-radius: 10px; color: var(--text); }

/* §1: утренний список в Профиле */
.tg-preview { margin-top: 12px; }
.tg-preview-lbl { margin-bottom: 6px; }
.tg-bubble { max-width: 460px; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.tg-btns { max-width: 460px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
.tg-btns span { padding: 7px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; text-align: center; }
.tg-btns .tg-btn-wide { grid-column: 1 / -1; }

/* §8: база знаний по отделам */
.kb-allrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-allrow .switch { flex: 1 1 280px; }
.kb-asdept { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.kb-aud { display: block; max-width: 180px; text-align: right; }
.aud-chips .fchip { min-height: 34px; }

/* §9: календарь дел */
.src-card { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--gap-card); }
.src-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.src-head .grow { flex: 1; min-width: 0; }
.src-res { font-size: 13px; overflow-wrap: anywhere; }
.src-file { cursor: pointer; }
.src-new .reply { display: flex; gap: 6px; }
.src-new .select { flex: 1; min-width: 0; }

/* §6: эфиры */
.bc-src { display: inline-flex; align-items: center; gap: 4px; }
.bc-src svg.ic { width: 14px; height: 14px; }
.bc-list { display: grid; gap: var(--gap-card); align-items: start; }
@container app (min-width: 1100px) { .bc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bc-card { display: flex; flex-direction: column; gap: 8px; }
.bc-head { display: flex; align-items: baseline; gap: 8px; }
.bc-no { flex: none; font-size: 13px; color: var(--text-2); font-weight: 600; }
.bc-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; line-height: 1.3; }
.bc-access { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--s-wait-soft); color: var(--text); }
.bc-access svg.ic { width: 16px; height: 16px; color: var(--s-wait); flex: none; margin-top: 1px; }
.bc-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bc-part-t { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; overflow-wrap: anywhere; }
.bc-links, .bc-extra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bc-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none; max-width: 100%; }
.bc-link svg.ic { width: 16px; height: 16px; flex: none; }
.bc-link--best { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.bc-link--bad { opacity: 0.7; text-decoration: line-through; }
.bc-best { font-size: 11px; font-weight: 500; opacity: 0.9; }
.bc-note { overflow-wrap: anywhere; }
.bc-edit-part { margin-bottom: 10px; }
.bc-edit-link { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.bc-edit-link .select { width: auto; flex: 0 1 150px; min-width: 0; }
.bc-edit-url { flex: 1 1 160px; min-width: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; overflow: hidden; }
.bc-edit-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-edit-url svg.ic { width: 16px; height: 16px; flex: none; }

/* §7: заготовки */
.tpl-cards { display: block; }
.tpl-card--empty { border-style: dashed; }
.tpl-empty { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--s-wait); padding: 8px 10px; background: var(--s-wait-soft); border-radius: 10px; margin: 6px 0; }
.tpl-empty svg.ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.tpl-meta { margin-top: 4px; }
.pr-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-tabs .seg { flex: 1 1 260px; }
.pr-tpl-link { flex: none; }
.pm-req { align-self: flex-start; }
.pm-bo { display: flex; flex-direction: column; gap: 6px; }
.pm-bo-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pm-bo-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pm-bo-row .select { width: auto; flex: 0 0 150px; }
.pm-owner-note { display: flex; gap: 6px; align-items: flex-start; border-color: var(--s-wait); color: var(--text); }
.pm-owner-note svg.ic { width: 16px; height: 16px; color: var(--s-wait); flex: none; margin-top: 1px; }

/* §5: ключевые даты, уроки, редакторы курса */
.kd-list, .ls-list, .ce-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(72px, auto); gap: 8px; align-items: center; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.kd-list .kd-row:first-child { border-top: 0; }
.kd-l { min-width: 0; overflow-wrap: anywhere; }
.kd-d { font-weight: 600; }
.kd-r { text-align: right; color: var(--text-2); }
.kd-row.is-past { color: var(--text-2); }
.kd-row.is-past .kd-d { font-weight: 500; }
.kd-row.is-next { background: var(--accent-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.kd-row.is-next .kd-r { color: var(--accent); }
.kd-row.is-today .kd-d { color: var(--accent); }
.kd-access { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.kd-form { margin-top: 10px; }
.kd-tbl { display: none; }
.kd-tbl table.tbl { min-width: 900px; }
.kd-tbl td.kd-past { color: var(--text-2); }
.kd-tbl td.kd-today { color: var(--accent); font-weight: 700; }
.kd-name { white-space: nowrap; }
.kd-name .cs-name { font-weight: 600; color: var(--text); }
.kd-acc { min-width: 160px; }
.kd-cards { display: flex; flex-direction: column; gap: var(--gap-card); }
.kd-card { text-align: left; display: flex; flex-direction: column; gap: 4px; }
.kd-line { color: var(--text-2); overflow-wrap: anywhere; line-height: 1.4; }
.row-sub.kd-line { font-size: 12px; margin-top: 4px; }
@container app (min-width: 760px) { .kd-tbl { display: block; } .kd-cards { display: none; } }
.ls-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.ls-list .ls-row:first-child { border-top: 0; }
.ls-no { flex: none; width: 38px; font-weight: 600; color: var(--text-2); }
.ls-t { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.ls-d { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ls-row.is-open .ls-no { color: var(--s-ok); }
.ls-row.is-today { background: var(--accent-soft); border-radius: 8px; }
.ls-edit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1 1 100%; padding-left: 46px; }
.ls-edit .input { width: auto; flex: 0 1 170px; }
.csd-lesson { display: flex; align-items: flex-start; gap: 4px; width: 100%; text-align: left; font-size: 12px; line-height: 1.3; padding: 4px 6px; margin-bottom: 4px; border-radius: 6px; background: var(--s-active-soft); color: var(--s-active); font-weight: 500; }
.csd-lesson svg.ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.csd-card-line .csd-lesson { width: auto; }
.cs-lessons { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 6px; }
.cs-lesson { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--s-active-soft); color: var(--s-active); font-weight: 500; }
.cs-lesson.is-open { background: var(--s-ok-soft); color: var(--s-ok); }
.cs-lesson svg.ic { width: 13px; height: 13px; }
.touch-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ce-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); }
.ce-list .ce-row:first-child { border-top: 0; }
.ce-day { flex: none; width: 62px; font-size: 13px; font-weight: 600; color: var(--accent); padding-top: 2px; }
.ce-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ce-title { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.ce-text { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ce-form { margin: 6px 0 10px; }

/* §12: финансы v5 */
.fin-refunds { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.fin-refunds svg.ic { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--s-bad); }
.fin-nocard { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-color: var(--s-bad); color: var(--s-bad); }
.fin-nocard span { flex: 1 1 200px; }
.fin-nocard svg.ic { width: 16px; height: 16px; flex: none; }
.fin-refund-c { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.note--bad { border-color: var(--s-bad); }
.tbl td.sal-fines { min-width: 120px; white-space: normal; }
.sal-fine-list .xs { white-space: normal; text-align: right; }
.sal-fine-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.sal-fine-list li.is-draft, .sal-fine-list li.is-draft .link-btn { color: var(--text-2); opacity: 0.75; }
.sal-fine-list .link-btn { min-height: 24px; font-size: 13px; white-space: nowrap; }
.sal-tbl .tbl th, .sal-tbl .tbl td { padding: 9px 8px; }
.sal-tbl .tbl td:first-child, .sal-tbl .tbl th:first-child { padding-left: 12px; }
.sal-card .sal-fine-list, .sal-card .sal-fine-list .xs { text-align: left; }
.sal-carry { margin-top: 4px; font-weight: 500; }
.rec-upload label.btn { cursor: pointer; }
.rec-paste summary { cursor: pointer; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.rec-paste .textarea { margin-top: 6px; }
.rec-wrap { display: flex; flex-direction: column; gap: 4px; }
.rec-act { margin-top: 0; }
.rec-pair { display: grid; gap: 8px; }
@container app (min-width: 760px) { .rec-pair { grid-template-columns: 1fr 1fr; } }
.rc-combo { display: flex; flex-direction: column; gap: 6px; }
.rc-combo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-combo-row .fchip { min-width: 96px; justify-content: center; }
.rc-combo-row .select { flex: 1 1 180px; width: auto; min-width: 0; }
.field--bad .select, .field--bad .input { border-color: var(--s-bad); }

a.btn { text-decoration: none; }

/* ---- 14.10: правки Ильи — удаление на карточках, тип возврата, график курсов ---- */
.btn--ghost.btn--danger { color: var(--s-bad); }
.btn--ghost.btn--danger:hover { background: var(--s-bad-soft); }
.tpl-card .actions .tpl-del { margin-left: auto; }
.tpl-del-ask { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--s-bad-soft); display: flex; flex-direction: column; gap: 8px; }
.tpl-del-ask .actions { margin-top: 0; }
@container app (max-width: 419px) { .tpl-card .actions .tpl-del { flex: 0 0 auto; margin-left: 0; } }
/* Возврат: тип, реквизиты, скрин чека, исполнитель */
.rf-kind-card { display: flex; flex-direction: column; gap: 8px; }
.rf-kind-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rf-pay { display: flex; flex-direction: column; gap: 2px; }
.rf-pay-row { display: grid; grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 36px; border-top: 1px solid var(--line); }
.rf-pay-row:first-child { border-top: 0; }
.rf-pay-l { font-size: 13px; color: var(--text-2); }
.rf-pay-v { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.rf-pay .actions { margin-top: 6px; }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm svg.ic { width: 16px; height: 16px; }
.rf-payout { margin: 4px 0 12px; padding: 12px; border: 1px solid var(--line); min-inline-size: 0; min-width: 0; }
.rf-legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.rf-receipt { display: flex; align-items: flex-start; gap: 12px; }
.rf-receipt--empty { align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-card); color: var(--text-2); }
.rf-receipt--empty > svg.ic { width: 18px; height: 18px; flex: none; }
.rf-receipt--empty .small { flex: 1 1 180px; }
.rf-thumb { display: block; flex: none; width: 88px; height: 88px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.rf-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rf-thumb.is-big { width: 100%; height: auto; max-height: none; cursor: zoom-out; }
.rf-thumb.is-big img { height: auto; max-height: 70vh; object-fit: contain; background: #fff; }
.rf-receipt:has(.rf-thumb.is-big) { flex-direction: column; }
.rf-receipt-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rf-receipt-side .small { flex: 1 0 100%; }
.rf-receipt--form .rf-thumb { width: 64px; height: 64px; cursor: default; }
.rf-upload { align-self: flex-start; }
label.btn { cursor: pointer; }
.rf-exec-pick { margin-top: 8px; }
.rf-exec-pick .select { width: 100%; }
.field .hint.t-ok { color: var(--s-ok); }
/* Чек-листы: новый шаблон, удаление */
.cl-tpl-side { flex-direction: row !important; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.cl-del { color: var(--text-2); }
.cl-del:hover { color: var(--s-bad); background: var(--s-bad-soft); }
.cl-del-ask { background: var(--s-bad-soft); cursor: default; }
.cl-del-ask .row-sub { white-space: normal; }
.sheet-foot .cl-del-q { flex: 1 1 100%; }
/* График курсов «По дням»: два потока курса в одну дату — по строке на поток, с номером потока */
.csd-days { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.csd-days.is-multi .csd-daybtn { min-height: 28px; }
.csd-stream { font-size: 11px; font-weight: 500; color: var(--text-2); padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.csd-stream-tag { font-weight: 600; color: var(--text-2); }

/* Вход из браузера (screens/login.js): карточка по центру, кнопка-виджет Telegram */
.login-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-bottom)); background: var(--bg); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo { width: 64px; height: 64px; border-radius: 16px; background: var(--accent); color: var(--accent-text); font: 600 34px/64px var(--font); }
.login-title { margin: 4px 0 0; font-size: 22px; font-weight: 700; color: var(--text); }
.login-sub { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.login-widget { min-height: 48px; display: flex; align-items: center; justify-content: center; margin: 8px 0 4px; }
.login-note { width: 100%; text-align: left; }
.login-alt { margin: 0; }
.login-alt a { color: var(--accent); }
.login-alt svg.ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
