:root {
  --bg: #F4F7F8;
  --card: #FFFFFF;
  --accent: #0E9594;
  --accent-dark: #0B7776;
  --accent-soft: #E3F4F3;
  --text: #17323D;
  --muted: #647E8D;
  --line: #E4EBEE;
  --red: #D8574D;
  --amber: #E0A100;
  --green: #2E9E5B;
  --blue: #3A7BD5;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(23, 50, 61, .07);
  --input-bg: #FFFFFF;
  --nav-bg: rgba(255, 255, 255, .97);
  color-scheme: light;
}

/* ночная тема — переключается атрибутом data-theme на <html> */
:root[data-theme="dark"] {
  --bg: #0F1720;
  --card: #18232F;
  --accent: #17B3B1;
  --accent-dark: #5AD6D3;
  --accent-soft: #123A38;
  --text: #E7EEF3;
  --muted: #93A7B3;
  --line: #27333F;
  --red: #F0736A;
  --amber: #E7B23A;
  --green: #46B877;
  --blue: #6AA6F0;
  --shadow: 0 1px 3px rgba(0, 0, 0, .45);
  --input-bg: #101A24;
  --nav-bg: rgba(18, 26, 35, .97);
  color-scheme: dark;   /* нативные контролы (аудио-плеер, ползунки, date-пикер) — тёмными */
}
:root[data-theme="dark"] .bottomnav { box-shadow: 0 -1px 8px rgba(0, 0, 0, .5); }
/* белые вкрапления — под тёмную тему */
:root[data-theme="dark"] .sch-cell .c-names .nm-chip { background: #223140; color: var(--text); }
/* .fact часто со СВОИМ inline-фоном (жёлтым/зелёным) — перебиваем !important под тёмную тему */
:root[data-theme="dark"] .fact { background: rgba(255, 255, 255, .06) !important; color: var(--text) !important; }
:root[data-theme="dark"] .vid video, :root[data-theme="dark"] .cam-view { background: #000; }
:root[data-theme="dark"] img.rv-photo, :root[data-theme="dark"] .att-grid img { opacity: .96; }
:root[data-theme="dark"] .skeleton { background:
  linear-gradient(100deg, #1b2833 40%, #26343f 50%, #1b2833 60%); background-size: 200% 100%; }
/* колонки доски (режим «панелями») — тёмные вместо светло-серых */
:root[data-theme="dark"] .bcol { background: #131E28; }
/* отчёты в карточках приёмки — тёмные плашки вместо светлых */
:root[data-theme="dark"] .rvcard .rv-report { background: #1c2a38; }
:root[data-theme="dark"] .rvcard .rv-report .by { color: #B79BE8; }
/* бейджи (тип/время/статус) — тёмный фон вместо светлых пастелей */
:root[data-theme="dark"] .b-short  { background: rgba(23,179,177,.20); color: #5AD6D3; }
:root[data-theme="dark"] .b-time   { background: rgba(23,179,177,.18); color: #5AD6D3; }
:root[data-theme="dark"] .b-long   { background: rgba(106,166,240,.20); color: #9CC0F5; }
:root[data-theme="dark"] .b-mentor { background: rgba(231,178,58,.20); color: #E7C270; }
:root[data-theme="dark"] .b-rep    { background: rgba(231,178,58,.20); color: #E7C270; }
:root[data-theme="dark"] .s-new         { background: rgba(106,166,240,.22); color: #9CC0F5; }
:root[data-theme="dark"] .s-in_progress { background: rgba(231,178,58,.22); color: #E7C86A; }
:root[data-theme="dark"] .s-review      { background: rgba(150,110,220,.24); color: #C3A8F0; }
:root[data-theme="dark"] .s-done        { background: rgba(70,184,119,.22); color: #7CD3A0; }
:root[data-theme="dark"] .s-closed      { background: rgba(147,167,179,.20); color: var(--muted); }
:root[data-theme="dark"] .b-vpn-active  { background: rgba(70,184,119,.22); color: #7CD3A0; }
:root[data-theme="dark"] .b-vpn-none    { background: rgba(147,167,179,.18); color: var(--muted); }
:root[data-theme="dark"] .b-vpn-revoked { background: rgba(240,115,106,.22); color: #F0938C; }
/* ---- v118: досветка тёмной темы (забытые захардкоженные светлые цвета) ---- */
:root[data-theme="dark"] .b-fs    { background: rgba(106,166,240,.20); color: #9CC0F5; }
:root[data-theme="dark"] .b-reuse { background: rgba(70,184,119,.20);  color: #7CD3A0; }
:root[data-theme="dark"] .b-imp   { background: rgba(240,115,106,.22); color: #F0938C; }
:root[data-theme="dark"] .markline { background: rgba(70,184,119,.14); }
:root[data-theme="dark"] .markline .who { color: #7CD3A0; }
:root[data-theme="dark"] .tl-track { background: rgba(70,184,119,.15); }
:root[data-theme="dark"] .tl-busy { background: repeating-linear-gradient(45deg,
  rgba(240,115,106,.45), rgba(240,115,106,.45) 5px, rgba(240,115,106,.28) 5px, rgba(240,115,106,.28) 10px); }
:root[data-theme="dark"] .cab-row .slot-chip.sl-guest { background: rgba(155,110,220,.22); color: #C9AFF2; }
:root[data-theme="dark"] .cab-row .slot-chip.sl-dbl   { background: rgba(240,115,106,.22); color: #F09A93; }
:root[data-theme="dark"] .slot-chip .sl-tr { color: #8FC0EA; }
:root[data-theme="dark"] .sec-review .sec-head { color: #B79BE8; }
:root[data-theme="dark"] .rvcard { border-left-color: #9B72E0; }
:root[data-theme="dark"] .reuse-review { border-left-color: var(--green); }
:root[data-theme="dark"] .bcol.drop-hint { background: #14312F; }
:root[data-theme="dark"] .pick-asr.other-br { border-left-color: #F0736A; background: rgba(240,115,106,.10); }
:root[data-theme="dark"] .chip.chip-cant { background: rgba(240,115,106,.20); border-color: rgba(240,115,106,.55); color: #F0938C; }
:root[data-theme="dark"] .toast { background: #243642; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 4px 16px rgba(0,0,0,.5); }
:root[data-theme="dark"] .composer { box-shadow: 0 -1px 4px rgba(0,0,0,.45); }
:root[data-theme="dark"] .drop-bar { box-shadow: 0 -4px 18px rgba(0,0,0,.55); }
:root[data-theme="dark"] .sheet { box-shadow: 0 -8px 30px rgba(0,0,0,.6); }
:root[data-theme="dark"] .drag-ghost { box-shadow: 0 14px 32px rgba(0,0,0,.6); }
:root[data-theme="dark"] .tier-txt-bronze { color: #D89557; fill: #D89557; }
:root[data-theme="dark"] .tier-txt-silver { color: #AEBBC6; fill: #AEBBC6; }
:root[data-theme="dark"] .tier-txt-gold   { color: #E9BE55; fill: #E9BE55; }
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] textarea:focus,
:root[data-theme="dark"] select:focus { box-shadow: 0 0 0 3px rgba(23, 179, 177, .22); }
/* семантические плашки сохраняют смысловой цвет и в тёмной теме (перебивают общий .fact) */
:root[data-theme="dark"] .fact.fact-info { background: rgba(106,166,240,.12) !important; color: #9CC0F5 !important; }
:root[data-theme="dark"] .fact.fact-ok   { background: rgba(70,184,119,.14)  !important; color: #7CD3A0 !important; }
:root[data-theme="dark"] .fact.fact-warn { background: rgba(231,178,58,.14)  !important; color: #E7C270 !important; }
:root[data-theme="dark"] .fact.fact-bad  { background: rgba(240,115,106,.14) !important; color: #F0938C !important; }
:root[data-theme="dark"] .fact.fact-fs   { background: rgba(106,166,240,.14) !important; color: #9CC0F5 !important; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
/* iOS «text inflation»: без этого при повороте экрана и возврате шрифты рандомно увеличивались */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
/* кнопка, задизейбленная на время запроса, выглядит выключенной (чип-лейблы не трогаем) */
button:disabled:not(.chip) { opacity: .55; cursor: default; }
input, textarea {
  font: inherit; font-size: 16px; color: var(--text); width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: var(--input-bg); outline: none; resize: none;
}
/* select тематизируем, но БЕЗ width:100% — иначе роль в «Команде» растягивалась и перекрывала id.
   appearance:none ОБЯЗАТЕЛЕН — иначе iOS/мобильный вебвью рисует select системным белым фоном. */
select {
  font: inherit; font-size: 16px; color: var(--text); max-width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 30px 9px 11px; outline: none;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background: var(--input-bg)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%239AA7B3' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    no-repeat right 11px center;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 149, 148, .15); }
/* select для наставника-стажёра — во всю ширину (как поле) */
#create-trainee { width: 100%; }

/* ---------- gate ---------- */
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 32px; gap: 10px; }
.gate-icon { font-size: 56px; }
.gate p { color: var(--muted); max-width: 280px; }

/* ---------- main ---------- */
.screen { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* ролевая нижняя навигация */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  display: flex; background: var(--nav-bg); backdrop-filter: blur(8px);
  box-shadow: 0 -1px 8px rgba(23,50,61,.1); padding-bottom: env(safe-area-inset-bottom); }
.navbtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; color: var(--muted); position: relative; }
.navbtn .ni { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(.7); transition: .15s; }
.navbtn .nl { font-size: 11px; font-weight: 600; }
.navbtn.active { color: var(--accent-dark); }
.navbtn.active .ni { filter: none; transform: translateY(-1px); }
.navbtn.active::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.panel-body { padding-bottom: 24px; }
/* панели верхнего уровня оставляют место под навбар */
#screen-schedule .panel-body, #screen-kpi .panel-body, #screen-team .panel-body {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.topbar { display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 14px 16px 8px; }
/* кнопки справа не сжимаются и не уходят за край (иначе терялась «Автотикеты») */
.top-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.topbar h1 { font-size: 22px; letter-spacing: -.3px; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.icon-btn { font-size: 20px; width: 38px; height: 38px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow); display: inline-flex;
  align-items: center; justify-content: center; }

.projects { display: flex; gap: 6px; padding: 6px 16px; }
.projects .ptab { flex: 1; text-align: center; padding: 9px 4px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
  color: var(--muted); border: 1.5px solid transparent; }
.projects .ptab.active { color: var(--accent-dark); border-color: var(--accent);
  background: var(--accent-soft); }

.chips { display: flex; gap: 6px; padding: 6px 16px 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; background: var(--card);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 500; color: var(--muted);
  border: 1.5px solid transparent; }
.chip.active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.chip .cnt { font-weight: 700; margin-left: 4px; }
.chips-types { padding-bottom: 2px; }

/* ---------- list ---------- */
.list { padding: 10px 16px 72px; display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.tcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; cursor: pointer;
  border-left: 4px solid transparent; transition: transform .08s; }
.tcard:active { transform: scale(.985); }
.tcard.prio-high { border-left-color: var(--red); }
.tcard .trow { display: flex; align-items: center; gap: 8px; }
.tcard .title { font-weight: 600; font-size: 15px; flex: 1; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  color: var(--muted); font-size: 13px; }
.badge { padding: 2.5px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-short  { background: #E3F4F3; color: #0B7776; }
.b-long   { background: #EAEFFA; color: #3A5BC7; }
.b-mentor { background: #FBEFE2; color: #B26A00; }
.s-new         { background: #EAF1FB; color: var(--blue); }
.s-in_progress { background: #FBF3DC; color: #9A7100; }
.s-review      { background: #F1EAFB; color: #7B4BC9; }
.s-done        { background: #E7F5EC; color: var(--green); }
.s-closed      { background: #EEF1F3; color: var(--muted); }
.b-time { background: #EEF4F5; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.b-rep  { background: #FFF2D9; color: #A66B00; }
.b-vpn-active { background:#E7F5EC; color: var(--green); }
.b-vpn-none { background:#EEF1F3; color: var(--muted); }
.b-vpn-revoked { background:#FBE9E7; color: var(--red); }
.mini { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }

.fab { position: fixed; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px;
  border-radius: 18px; background: var(--accent); color: #fff; font-size: 28px;
  box-shadow: 0 6px 18px rgba(14, 149, 148, .4); z-index: 9050; }
.fab:active { background: var(--accent-dark); }

/* ---------- panel (тикет / создание / команда) ---------- */
.panel { position: fixed; inset: 0; background: var(--bg); z-index: 100;
  display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--card); box-shadow: var(--shadow); }
.panel-title { font-weight: 700; font-size: 16px; }
.back { font-size: 26px; width: 36px; height: 36px; color: var(--accent-dark); }
.panel-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; }
.tk-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tk-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tk-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
  font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.tk-meta b { color: var(--text); font-weight: 600; }
.tk-desc { white-space: pre-wrap; margin-bottom: 4px; }
.tk-actions { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.primary { background: var(--accent); color: #fff; font-weight: 600; padding: 11px 18px;
  border-radius: 12px; flex: 1; text-align: center; }
.primary:active { background: var(--accent-dark); }
.secondary { background: var(--card); color: var(--accent-dark); font-weight: 600;
  padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.danger-text { color: var(--red); }

.section-title { font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; margin: 16px 0 8px; }
.progressbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 6px 0 10px; }
.progressbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px;
  transition: width .25s; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0;
  border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line);
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; margin-top: 1px; }
.check.done .box { background: var(--accent); border-color: var(--accent); }
.check.done .ctext { text-decoration: line-through; color: var(--muted); }
.check-add { display: flex; gap: 8px; margin-top: 8px; }

.att-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.att-grid img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; cursor: pointer; }
audio { width: 100%; height: 38px; }
.vid { margin-top: 8px; }
.vid video { width: 100%; max-height: 340px; border-radius: 10px; background: #000; }
.vid-dl { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent-dark); font-weight: 600; }
.instr-card { display: flex; flex-direction: column; gap: 10px; }
.instr-item { position: relative; }
.instr-item .mini { margin-top: 4px; }
/* у старших дата сдвигается левее — ✕ занимает правый угол и не прячется за ней */
.cmt.has-del .when { margin-right: 34px; }
.cmt-del { position: absolute; top: 0; right: 0; color: var(--red); font-size: 14px;
  padding: 10px 12px; opacity: .6; }
.cmt { position: relative; }

/* comments */
.comments { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cmt { background: var(--card); border-radius: 12px; padding: 9px 12px; box-shadow: var(--shadow); }
.cmt.own { background: var(--accent-soft); }
.cmt .who { font-size: 12px; font-weight: 700; color: var(--accent-dark); }
.cmt .when { font-size: 11px; color: var(--muted); float: right; }
.cmt .body { white-space: pre-wrap; }
.cmt img { max-width: 160px; border-radius: 10px; margin-top: 6px; display: block; cursor: pointer; }
.sysline { text-align: center; color: var(--muted); font-size: 12px; padding: 2px 0; }

/* composer */
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px
  calc(8px + env(safe-area-inset-bottom)); background: var(--card);
  box-shadow: 0 -1px 4px rgba(23,50,61,.08); }
.composer-mid { flex: 1; }
.composer textarea { max-height: 110px; }
.send { width: 42px; height: 42px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 17px; flex: 0 0 auto; }
.icon-btn.rec { background: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.attach-previews { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.attach-previews:empty { display: none; }
.attach-previews .ap { position: relative; }
.attach-previews img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.attach-previews .ap-x { position: absolute; top: -6px; right: -6px; background: var(--red);
  color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 11px;
  display: flex; align-items: center; justify-content: center; }
.attach-previews .ap-voice { padding: 6px 10px; background: var(--accent-soft);
  border-radius: 8px; font-size: 12px; color: var(--accent-dark); font-weight: 600; }

/* form */
.form label { display: block; font-size: 13px; font-weight: 700; color: var(--muted);
  margin: 12px 0 6px; }
.form .chips { padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .primary { width: 100%; margin-top: 18px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* team */
.tmember { display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 11px 13px; margin-bottom: 8px; }
.tmember .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex: 0 0 auto; }
.tmember .info { flex: 1; min-width: 0; }
.tmember .nm { font-weight: 600; }
.tmember .sub { font-size: 12px; color: var(--muted); }
.tmember select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 22px 4px 8px;
  font-size: 16px; background-color: var(--input-bg); color: var(--text); }
.tmember .rm { color: var(--red); font-size: 18px; padding: 6px; }

/* toast, lightbox */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: rgba(23, 50, 61, .92); color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 14px; z-index: 9600; max-width: 88vw; text-align: center; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9500;
  display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

/* executor + kpi */
.execrow { padding: 8px 16px 0; }
.execrow select { width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: var(--card); font-size: 16px; color: var(--text); }
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 16px 0; }
.kpi .k { background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 8px 4px; text-align: center; }
.kpi .k b { display: block; font-size: 17px; color: var(--accent-dark); }
.kpi .k span { font-size: 11px; color: var(--muted); }

/* board (Trello-style) */
.board { display: flex; gap: 10px; padding: 12px 16px 72px; overflow-x: auto;
  scroll-snap-type: x mandatory; align-items: flex-start; }
.bcol { flex: 0 0 76vw; max-width: 320px; scroll-snap-align: start;
  background: #ECF1F3; border-radius: var(--radius); padding: 10px;
  min-height: 120px; }
.bcol h3 { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 4px 8px;
  display: flex; justify-content: space-between; }
.bcol h3 .n { background: var(--card); border-radius: 999px; padding: 0 8px; }
.bcard { background: var(--card); border-radius: 10px; box-shadow: var(--shadow);
  padding: 9px 11px; margin-bottom: 8px; cursor: pointer; border-left: 3px solid transparent; }
.bcard.prio-high { border-left-color: var(--red); }
.bcard .bt { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.bcard .bm { display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted); }
.bcard .quick { margin-top: 7px; width: 100%; padding: 7px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 13px; }

/* аватарки */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex: 0 0 auto; overflow: hidden; cursor: pointer; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.av-lg { width: 44px; height: 44px; font-size: 18px; }
.av-sm { width: 26px; height: 26px; font-size: 12px; }
.me-block { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
/* имя/роль в шапке — усечь, а не выталкивать кнопки */
.topbar .me-block > div:last-child { min-width: 0; }
.topbar .me-block .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* инбокс приёмки для старших */
.rvcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid #7B4BC9; padding: 12px 14px; margin-bottom: 10px; }
.rvcard .rv-top { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.rvcard .rv-title { font-weight: 600; flex: 1; }
.rvcard .rv-report { background: #F6F1FF; border-radius: 10px; padding: 8px 11px;
  margin-top: 8px; font-size: 14px; }
.rvcard .rv-report .by { font-size: 12px; font-weight: 700; color: #7B4BC9; }
.rvcard .rv-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  margin-top: 8px; cursor: pointer; }
.rvcard .rv-actions { display: flex; gap: 8px; margin-top: 10px; }
.rvcard .rv-actions .primary { padding: 9px 12px; font-size: 14px; }
.rvcard .rv-actions .secondary { padding: 9px 12px; font-size: 14px; }
.rvcard .rv-reject { display: flex; gap: 8px; margin-top: 8px; }

/* расписание */
.sch-week { font-weight: 700; margin-bottom: 4px; }
.sch-status { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.sch-day { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 12px; margin-bottom: 8px; }
.sch-day .d-name { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.sch-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sch-cell { border: 1.5px dashed var(--line); border-radius: 10px; padding: 9px 10px;
  min-height: 52px; cursor: pointer; }
.sch-cell .c-label { font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; }
.sch-cell.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.sch-cell .c-names { font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; }
.sch-cell .c-names .nm-chip { background: #fff; border-radius: 999px; padding: 1px 8px;
  box-shadow: var(--shadow); }
.sch-cell .c-names .nm-chip.asg { background: var(--accent); color: #fff; }
.sch-cell .c-cnt { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sch-actions { display: flex; gap: 8px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
.sch-actions::-webkit-scrollbar { display: none; }
.sch-actions > button { flex: 0 0 auto; white-space: nowrap; }

/* дневной конструктор графика */
.cab-row { font-size: 12.5px; margin: 2px 0; }
.cab-row .slot-chip { display: inline-block; background: var(--accent-soft);
  color: var(--accent-dark); border-radius: 8px; padding: 1px 7px; margin: 1px 2px; font-size: 11.5px; }
/* маркеры графика: 🚶 приглашённый (сиреневый), 🐣 стажёр, ❗️ человек в 2+ кабинетах (красный) */
.cab-row .slot-chip.sl-guest { background: #EFE6FB; color: #5b3a8c; }
.cab-row .slot-chip.sl-dbl { background: #FBE6EC; color: #a3324c; font-weight: 700; }
.slot-chip .sl-tr { color: #1f5e8c; }
.sl-dbl-txt { color: var(--red, #d33); font-weight: 700; }
.cab-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 12px; margin-bottom: 10px; }
.cab-head { font-weight: 700; margin-bottom: 6px; }
.blk { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; background: var(--bg);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.blk-main { flex: 1 1 200px; min-width: 0; display: flex; gap: 12px; align-items: baseline;
  cursor: pointer; }
.blk-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto; }
.blk-people { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.blk-doc, .blk-asr, .blk-tr { font-size: 13px; overflow-wrap: anywhere; line-height: 1.3; }
.blk-tr { color: var(--muted); }
.tel { color: var(--muted); font-size: 11px; white-space: nowrap; }
.blk-asr.bad { color: var(--red); font-weight: 600; }
.blk-spec { color: var(--muted); font-weight: 400; }
.blk-acts { flex: 0 0 auto; display: flex; gap: 12px; align-items: center; margin-left: auto; }
/* редактировать/удалить — каждая в своём мелком блоке, чуть отодвинуты друг от друга */
.blk-edit, .blk-del { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
.blk-edit { color: var(--muted); opacity: 1; }
.blk-del { color: var(--red); }
.blk-del:active, .blk-edit:active { background: var(--bg); }
.add-blk { width: 100%; padding: 9px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 600; font-size: 13.5px; }
/* прогресс/табель */
.wl-sub { text-align: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.wl-list { max-height: 42vh; overflow-y: auto; margin-top: 4px; }
.wl-row { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wl-int { background: var(--bg); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.wl-del { color: var(--red); background: none; font-size: 14px; padding: 10px 12px; margin: -10px -8px; }
.wl-add { margin-top: 12px; }
/* календарь смен */
.cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day { min-height: 50px; border-radius: 8px; background: var(--bg); padding: 3px;
  display: flex; flex-direction: column; gap: 2px; cursor: pointer; overflow: hidden; }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.today { outline: 2px solid var(--accent); }
.cal-num { font-size: 11px; font-weight: 600; }
.cal-chip { font-size: 10px; font-weight: 600; background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 4px; padding: 0 3px; line-height: 1.35; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
/* под-вкладки графика */
.subtabs { display: flex; gap: 6px; margin: 0 0 10px; }
.subtab { flex: 1 1 0; padding: 9px 6px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtab.active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
/* календарь пожеланий */
.cal-day.wsh-off { background: transparent; border: 1px dashed var(--line); cursor: default; opacity: .55; }
.cal-day.wsh-pub { outline: 1.5px solid var(--accent-soft); }
.cal-chip.wsh-m, .cal-chip.wsh-e, .cal-chip.wsh-cant { background: transparent; padding: 0; font-size: 12px; }
/* «Мой график»: смена = ряд пилюль (время → кабинет(филиал) → врач), каждая переносится целиком */
.mg-slot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 0; }
.mg-slot + .mg-slot { border-top: 1px dashed var(--line); }
.mg-pill { display: inline-flex; align-items: center; white-space: nowrap; font-size: 13px;
  background: var(--bg); border-radius: 8px; padding: 3px 9px; line-height: 1.35; }
.mg-pill.mg-time { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700;
  font-variant-numeric: tabular-nums; }
.mg-pill.mg-cab { font-weight: 600; }
.mg-br { font-weight: 400; color: var(--muted); margin-left: 4px; }
/* мелкая кнопка (напр. «Задать» срок) */
.btn-mini { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark);
  font-size: 12px; font-weight: 600; cursor: pointer; margin-left: 6px; }
/* отчёты */
.rep-card { background: var(--card); border-radius: 12px; padding: 10px 12px; margin: 8px 0; box-shadow: var(--shadow); }
.rep-h { font-weight: 700; margin-bottom: 6px; }
.rep-row { display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rep-row:last-child { border-bottom: none; }
.rep-total { font-weight: 700; }
.doc-card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 4px 12px; margin-bottom: 6px; }

/* выбор ассистента в блоке */
.pick-list { max-height: 46vh; overflow-y: auto; }
.pick-asr { display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.pick-asr.sel { border-color: var(--accent); background: var(--accent-soft); }
.pick-asr.bad { opacity: .55; cursor: not-allowed; border-style: dashed; }
/* в этот день стоит в другом филиале: выбрать можно, но подсвечиваем красной кромкой */
.pick-asr.other-br { border-left: 3px solid #a3324c; background: rgba(251, 230, 236, .35); }
/* 👥 Смены ассистентов/стажёров — полоска нагрузки под строкой */
.shbar { height: 4px; border-radius: 2px; background: var(--line); margin: 0 0 8px; overflow: hidden; }
.shbar i { display: block; height: 100%; background: var(--accent); }
.pick-asr .info { flex: 1; }
.pick-asr .bad-tag { color: var(--red); font-size: 12px; font-weight: 700; }
.pick-asr .warn-tag { color: var(--amber); font-size: 12px; font-weight: 700; }
.pick-asr .ok-tag { color: var(--green); font-size: 12px; font-weight: 700; }
.pick-asr .rec-badge { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* кадрирование аватара */
.crop-back { position: fixed; inset: 0; z-index: 9500; background: rgba(23,50,61,.6);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.crop-box { background: var(--card); border-radius: 18px; padding: 18px; width: 100%;
  max-width: 340px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.crop-title { font-weight: 700; font-size: 14px; text-align: center; margin-bottom: 12px; }
.crop-view { position: relative; margin: 0 auto; border-radius: 50%; overflow: hidden;
  background: #000; touch-action: none; cursor: grab; box-shadow: 0 0 0 3px var(--accent-soft); }
.crop-view:active { cursor: grabbing; }
.crop-img { position: absolute; left: 0; top: 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.crop-hint { text-align: center; font-size: 12px; color: var(--muted); margin: 12px 4px 0; }
.crop-actions { display: flex; gap: 8px; margin-top: 14px; }
.crop-actions button { flex: 1; padding: 11px; border-radius: 12px; font-weight: 600; }

/* тумблер уведомлений */
.notifrow { display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 14px; margin: 10px 0 4px; font-weight: 600; }
.switch2 { padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: var(--line); color: var(--muted); min-width: 56px; }
.switch2.on { background: var(--accent); color: #fff; }

/* навигатор месяцев */
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; }
.mn-title { font-weight: 700; font-size: 15px; flex: 1; text-align: center; }
.mn-arrow { width: 40px; height: 34px; border-radius: 10px; background: var(--card);
  box-shadow: var(--shadow); font-size: 20px; color: var(--accent-dark); font-weight: 700; }

/* навигатор недель */
.weekbar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 0 10px; }
.weekbar::-webkit-scrollbar { display: none; }
.weekchip { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding: 8px 12px;
  border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 13px;
  font-weight: 600; color: var(--muted); border: 1.5px solid transparent; }
.weekchip.active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.weekchip .ws { font-size: 11px; }
.weekchip.add { color: var(--accent-dark); border-style: dashed; border-color: var(--accent); }

/* таймлайн занятости в шторке блока */
.timeline { margin: 8px 0 4px; }
.tl-track { position: relative; height: 24px; border-radius: 7px; overflow: hidden;
  background: #E7F5EC; border: 1px solid var(--line); }
.tl-busy { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(
  45deg, #F3C0BC, #F3C0BC 5px, #EBA9A4 5px, #EBA9A4 10px); border-left: 1px solid var(--red);
  border-right: 1px solid var(--red); }
.tl-sel { position: absolute; top: 0; bottom: 0; border: 2px solid; box-sizing: border-box; border-radius: 4px; }
.tl-sel.ok { border-color: var(--green); background: rgba(46,158,91,.18); }
.tl-sel.bad { border-color: var(--red); background: rgba(216,87,77,.22); }
/* перетаскиваемые ручки границ */
.tl-track { height: 30px; }
.tl-h { position: absolute; top: 50%; transform: translateY(-50%); width: 22px; height: 40px;
  display: flex; align-items: flex-start; justify-content: center; cursor: ew-resize;
  touch-action: none; z-index: 2; }
.tl-h::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%);
  width: 12px; height: 22px; border-radius: 5px; background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3);
  border: 2px solid var(--green); }
.tl-sel.bad .tl-h::after { border-color: var(--red); }
.tl-h-from { left: -11px; } .tl-h-to { right: -11px; }
.tl-h b { position: absolute; top: -16px; font-size: 10px; font-weight: 700; color: var(--accent-dark);
  background: var(--card); border-radius: 6px; padding: 0 4px; box-shadow: var(--shadow); white-space: nowrap; }
.tl-ticks { position: relative; height: 14px; font-size: 10px; color: var(--muted); }
.tl-ticks span { position: absolute; transform: translateX(-50%); }
.tl-legend { font-size: 12px; font-weight: 600; margin-top: 2px; }
.tl-legend .ok { color: var(--green); }
.tl-legend .bad { color: var(--red); }
.editlbl { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }

/* часы «с — до» */
.timerow { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.timerow input { flex: 1; text-align: center; }

/* шторка назначения */
.sheet-back { position: fixed; inset: 0; background: rgba(23,50,61,.45); z-index: 9300; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9400; background: var(--card);
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 70vh; overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 -8px 30px rgba(23,50,61,.25); }
.sheet h3 { margin-bottom: 10px; font-size: 16px; }
.sheet .srow { display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.sheet .srow:last-child { border-bottom: 0; }
.sheet .srow .info { flex: 1; }
.sheet .srow .avail-dot { font-size: 11.5px; color: var(--green); font-weight: 600; }
.sheet .srow .no-dot { font-size: 11.5px; color: var(--muted); }
.sheet .srow .asg-btn { padding: 7px 14px; border-radius: 10px; font-weight: 600;
  background: var(--bg); color: var(--muted); }
.sheet .srow .asg-btn.on { background: var(--accent); color: #fff; }

/* ручной ввод минут */
.minrow { display: flex; gap: 8px; align-items: center; }
.minrow .chips { flex: 1; padding: 0; }
.minrow input { width: 76px; flex: 0 0 auto; text-align: center; }

/* секции главного списка */
.sec-head { display: flex; align-items: center; gap: 8px; padding: 10px 4px 4px;
  font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; cursor: pointer; user-select: none; }
.sec-head .n { background: var(--card); border-radius: 999px; padding: 1px 9px;
  box-shadow: var(--shadow); color: var(--text); }
.sec-head .chev { margin-left: auto; transition: transform .15s; }
.sec-head.closed .chev { transform: rotate(-90deg); }
.sec-review .sec-head { color: #7B4BC9; }

/* факт времени для старших */
.fact { background: #F6F1FF; border-radius: 10px; padding: 8px 12px; margin-top: 10px;
  font-size: 13px; color: #5A3E99; }
.fact b { font-variant-numeric: tabular-nums; }

/* drag & drop */
.bcard.drag-src { opacity: .35; }
.drag-ghost { position: fixed; z-index: 9200; pointer-events: none;
  transform: rotate(2.5deg) scale(1.04); box-shadow: 0 14px 32px rgba(23,50,61,.3);
  transition: none; border-radius: 10px; }
.bcol.drop-hint { outline: 2px dashed var(--accent); outline-offset: -2px;
  background: #E3F1F0; }
.drop-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9100;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  background: var(--nav-bg); box-shadow: 0 -4px 18px rgba(23,50,61,.15); }
.drop-chip { text-align: center; padding: 16px 4px; border-radius: 12px;
  font-size: 12px; font-weight: 700; background: var(--bg);
  border: 1.5px dashed var(--line); color: var(--muted); }
.drop-chip.hover { background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-dark); transform: scale(1.05); }

/* KPI */
.krow { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 14px; margin-bottom: 8px; }
.krow.me { border: 1.5px solid var(--accent); }
.krow .top { display: flex; align-items: baseline; gap: 8px; }
.krow .pos { font-weight: 800; color: var(--muted); width: 22px; }
.krow .nm { font-weight: 600; flex: 1; }
.krow .mins { font-weight: 800; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.krow .bar { height: 7px; border-radius: 4px; background: var(--line); margin: 7px 0 4px; overflow: hidden; }
.krow .bar i { display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #4DB8B0); }
.krow .det { font-size: 12px; color: var(--muted); }

/* отметка дежурного в ленте */
.markline { background: #EAF7EE; border-radius: 12px; padding: 8px 12px;
  box-shadow: var(--shadow); font-size: 13.5px; }
.markline .who { font-weight: 700; color: var(--green); }
.markline .when { float: right; font-size: 11px; color: var(--muted); }

/* recurring rules */
.rule { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 8px; }
.rule .rt { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.rule .rs { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rule .ractions { display: flex; gap: 8px; margin-top: 8px; }
.rule.off { opacity: .55; }
.switch { padding: 6px 12px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 600; font-size: 13px; }

.skeleton { height: 74px; border-radius: var(--radius); background:
  linear-gradient(100deg, #ECF1F3 40%, #F6FAFB 50%, #ECF1F3 60%); background-size: 200% 100%;
  animation: sk 1.1s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* карточка проверки выполнения переиспользуемого тикета */
.reuse-review { border-left: 3px solid #1F7A45; cursor: pointer; }
.reuse-review .meta { color: var(--muted); font-size: 13px; margin: 4px 0; }
/* --card2 не существовало → фолбэк всегда давал белую плашку в тёмной теме */
.reuse-review .rv-report { background: var(--bg); color: var(--text); border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 14px; white-space: pre-wrap; }
.reuse-review .rv-report.muted { color: var(--muted); font-style: italic; }
.reuse-review .rv-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin: 6px 0; cursor: zoom-in; }
.reuse-review .rv-actions { display: flex; gap: 8px; margin-top: 8px; }
.reuse-review .rv-actions button { flex: 1; }

/* анти-чит: встроенная камера (живая съёмка) */
.cam-back { position: fixed; inset: 0; z-index: 9600; background: #000; display: flex; flex-direction: column; }
.cam-view { flex: 1; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-hint { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 12px; right: 12px;
  text-align: center; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 22px calc(env(safe-area-inset-bottom, 0px) + 22px);
  display: flex; align-items: center; justify-content: space-between; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.cam-side { min-width: 74px; background: rgba(255,255,255,.16); color: #fff; border: none; border-radius: 22px;
  padding: 10px 14px; font-size: 15px; font-weight: 600; }
.cam-shutter { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 4px solid rgba(255,255,255,.45);
  box-shadow: 0 0 0 3px rgba(0,0,0,.25); }
.cam-shutter:active { transform: scale(.93); }

/* настройки: кабинеты (по филиалу) и врачи (общие) */
.cd-branch { margin: 12px 0 6px; }
.cd-branch-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cd-sec { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 16px;
  background: var(--card); border: 1px solid var(--line, #e6e9ef); border-radius: 12px;
  padding: 12px 14px; font-size: 16px; font-weight: 700; color: var(--text); text-align: left; }
.cd-sec .n { background: var(--accent, #0b7776); color: #fff; border-radius: 10px;
  font-size: 12px; padding: 1px 8px; font-weight: 700; }
.cd-sec .cd-note { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted); }
.cd-sec .chev { margin-left: 8px; transition: transform .15s; }
.cd-sec.closed .chev { transform: rotate(-90deg); }
.cd-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.cd-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.cd-card { display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1px solid var(--line, #e6e9ef); border-radius: 12px; padding: 10px 12px; }
.cd-name { flex: 1; font-size: 15px; font-weight: 600; color: var(--text); }
.cd-bad { font-size: 11px; font-weight: 500; color: var(--red); margin-top: 3px; }
/* кнопки действий разнесены и упакованы в отдельный блок — не промахнуться */
.cd-act { display: flex; gap: 12px; align-items: center; flex: 0 0 auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 5px 9px; }
.cd-act .asg-btn { width: 40px; height: 34px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 17px; border-radius: 10px; }
.cd-act .asg-btn.danger-text { color: var(--red); }
.cd-edit-inp { flex: 1; min-width: 0; }
.cd-add { display: flex; gap: 8px; margin-top: 4px; }
.cd-add input { flex: 1; min-width: 0; }
.cd-add .primary { flex: 0 0 auto; white-space: nowrap; }

/* KPI: роль в рейтинге + сводка */
.krole { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; margin-left: 2px; vertical-align: middle; }
.kpi-sum { flex-wrap: wrap; gap: 8px; }
.kpi-sum .k { flex: 1 1 40%; }

/* пресеты утро/вечер в подаче доступности */
.preset-row { display: flex; gap: 8px; margin: 4px 0 10px; }
.preset-row button { flex: 1; padding: 10px 6px; font-size: 14px; }

/* КПИ (личные цели) */
.goal-card, .goal-task { cursor: pointer; }
.goal-task { cursor: default; }
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.g-sub { color: var(--muted); font-size: 13px; margin: 4px 0 6px; }
.g-money { flex: 0 0 auto; font-weight: 700; color: var(--green); font-size: 13px; background: rgba(46,158,91,.12); border-radius: 999px; padding: 2px 9px; }
.g-due { color: var(--muted); }
.g-cmts { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.g-cmt { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 5px 9px; }
.g-task-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.g-task-act .mini { background: var(--accent-soft); color: var(--accent-dark); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.g-task-act .mini.danger-text { background: rgba(216,87,77,.12); color: var(--red); }

/* крупный авто-расчёт ставки */
.rate-big { text-align: center; font-size: 34px; font-weight: 800; color: var(--accent-dark);
  letter-spacing: -.5px; margin: 4px 0 2px; }


/* ============================ v118: визуальная полировка ============================ */
/* бейджи тикета из инлайна — тема-совместимые классы */
.b-fs    { background: #EAF1FB; color: #3A5BC7; }
.b-reuse { background: #EAF7EE; color: #1F7A45; }
.b-imp   { background: #FBE9E7; color: var(--red); }
/* семантические плашки-подсказки (светлая тема) */
.fact-info { background: #EEF3F7; color: #38607a; }
.fact-ok   { background: #EAF7EE; color: #1F7A45; }
.fact-warn { background: #FFF4E0; color: #8a5a00; }
.fact-bad  { background: #FBE6EC; color: #a3324c; }
.fact-fs   { background: #EEF1FB; color: #3A5BC7; }
/* тир прогресса: текст читаемым цветом отдельно от цвета сегмента кольца */
.tier-txt-bronze { color: #A05E1F; fill: #A05E1F; }
.tier-txt-silver { color: #66767F; fill: #66767F; }
.tier-txt-gold   { color: #9C7A00; fill: #9C7A00; }
/* чипы дня в «Пожеланиях» */
.chip.chip-day { padding: 12px; font-size: 14px; }
.chip.chip-cant { background: #FBE6EC; border-color: #e0819a; color: #a3324c; }
/* вторичный текст — единый вид по всему приложению */
.no-dot { font-size: 12px; color: var(--muted); }
.g-money.deny { color: var(--red); background: rgba(216,87,77,.12); }
.cal-day.empty .cal-num { color: var(--muted); opacity: .45; }
.fact.x-row { margin: 6px 0; }
.fact.x-click { cursor: pointer; }
/* пустые состояния: в шторках компактнее, на экранах с крупной иконкой */
.sheet .empty { padding: 26px 12px; }
.empty { font-size: 14.5px; }
.empty .e-ico { display: block; font-size: 38px; line-height: 1; margin-bottom: 10px; }
/* ручка-граббер шторки */
.sheet::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
  background: var(--line); margin: -4px auto 12px; }
.wl-list, .pick-list { overscroll-behavior: contain; }
/* табличные цифры там, где числа сравниваются или живо обновляются */
.kpi .k b, .tk-meta b, .cmt .when, .markline .when, .wl-int, .cal-num, .rate-big,
.tl-h b, .tl-ticks { font-variant-numeric: tabular-nums; }
/* горизонтальные ряды графика скроллятся от края до края экрана */
#schedule-body .weekbar { margin-left: -16px; margin-right: -16px; padding: 0 16px 10px; }
#schedule-body .sch-actions { margin: 12px -16px; padding-left: 16px; padding-right: 16px; }
/* расширенные хит-зоны мелких кнопок (визуал не меняется) */
.blk-edit, .blk-del { position: relative; }
.blk-edit::after, .blk-del::after { content: ''; position: absolute; inset: -8px -5px; }
.mn-arrow { position: relative; }
.mn-arrow::after { content: ''; position: absolute; inset: -4px -2px; }
.attach-previews .ap-x::after { content: ''; position: absolute; inset: -10px; }
.tmember .nm button.mini { padding: 8px 10px; margin: -8px -6px; }

/* ---------- v118: микроинтеракции ---------- */
.chip, .subtab, .weekchip, .projects .ptab, .switch, .switch2, .navbtn, .sch-cell,
.pick-asr, .check .box, .btn-mini, .asg-btn, .drop-chip {
  transition: background-color .15s, border-color .15s, color .15s, transform .12s;
}
.icon-btn, .send, .mn-arrow, .fab, .primary, .secondary, .bcard .quick, .add-blk, .back {
  transition: transform .1s, background-color .15s;
}
.chip:active, .subtab:active, .weekchip:active, .projects .ptab:active, .btn-mini:active,
.switch:active, .switch2:active, .asg-btn:active, .primary:active, .secondary:active,
.bcard .quick:active, .add-blk:active { transform: scale(.96); }
.icon-btn:active, .mn-arrow:active, .send:active, .back:active { transform: scale(.9); }
.fab:active { transform: scale(.94); }
/* кликабельные карточки отзываются на тап */
.bcard, .reuse-review, .goal-card, .pick-asr, .tappable { transition: transform .08s; }
.bcard:active:not(.drag-src), .reuse-review:active, .goal-card:active,
.pick-asr:active:not(.bad), .tappable:active { transform: scale(.985); }
.tappable { cursor: pointer; }
/* драг-призрак доски двигается inline-transform'ом на каждый touchmove —
   transition ему противопоказан (иначе отстаёт от пальца) */
.drag-ghost { transition: none !important; }
/* оверлеи появляются мягко (закрытие мгновенное — намеренно) */
.sheet-back { animation: v118-fade .22s ease-out; }
.sheet { animation: v118-sheet .28s cubic-bezier(.21, .85, .3, 1); }
.lightbox, .crop-back { animation: v118-fade .18s ease-out; }
.lightbox img { animation: v118-zoom .18s ease-out; }
.toast { animation: v118-toast .22s ease-out; transition: opacity .2s, transform .2s; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
.navbtn.active::before { animation: v118-navind .22s ease-out; }
@keyframes v118-fade { from { opacity: 0; } }
@keyframes v118-sheet { from { transform: translateY(100%); } }
@keyframes v118-zoom { from { transform: scale(.94); opacity: .4; } }
@keyframes v118-toast { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes v118-navind { from { width: 6px; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   РЕЖИМ APEX (v120) — третье оформление поверх ночной темы.
   Включается атрибутом data-apex на <html> вместе с data-theme="dark",
   поэтому все ночные правила продолжают работать, а этот блок правит
   палитру, геометрию и типографику. Логика приложения не затрагивается.
   ═══════════════════════════════════════════════════════════════════════════ */
:root[data-apex] {
  --bg: #08090A;
  --card: #101315;
  --accent: #D4FF3F;
  --accent-dark: #D4FF3F;
  --accent-soft: rgba(212, 255, 63, .13);
  --text: #F2F4F5;
  --muted: #8B949B;
  --line: #23282C;
  --red: #FF4133;
  --amber: #FFC53F;
  --green: #7BE87B;
  --blue: #7FB0FF;
  --radius: 0;
  --shadow: none;
  --input-bg: #0B0D0F;
  --nav-bg: rgba(8, 9, 10, .98);
}
/* геометрия: никаких скруглений во всём приложении */
:root[data-apex] *, :root[data-apex] *::before, :root[data-apex] *::after { border-radius: 0 !important; }
/* техническая сетка на фоне — как на витрине продукта */
:root[data-apex] body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(90deg, #14181B 1px, transparent 1px), linear-gradient(180deg, #14181B 1px, transparent 1px);
  background-size: 25% 88px;
}
:root[data-apex] .screen, :root[data-apex] .panel { position: relative; z-index: 1; }
:root[data-apex] .bottomnav { z-index: 9000; }   /* position:fixed не трогаем — иначе меню отклеится */

/* типографика: заголовки — узкий гротеск капсом, данные — моноширинный */
:root[data-apex] .topbar h1, :root[data-apex] .panel-title, :root[data-apex] .tk-title,
:root[data-apex] .sch-week, :root[data-apex] .cab-head, :root[data-apex] .rep-h,
:root[data-apex] .sheet h3, :root[data-apex] .mn-title, :root[data-apex] .d-name {
  font-family: 'Oswald', 'Arial Narrow', var(--f-ui, sans-serif);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
:root[data-apex] .badge, :root[data-apex] .chip, :root[data-apex] .mini,
:root[data-apex] .b-time, :root[data-apex] .blk-time, :root[data-apex] .krow .mins,
:root[data-apex] .cal-num, :root[data-apex] .wl-int, :root[data-apex] .tel,
:root[data-apex] .weekchip, :root[data-apex] .subtab, :root[data-apex] .sec-head,
:root[data-apex] .section-title, :root[data-apex] .kpi .k span, :root[data-apex] .navbtn .nl,
:root[data-apex] .no-dot, :root[data-apex] .cmt .when, :root[data-apex] .g-sub {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  letter-spacing: .02em;
}
:root[data-apex] .badge, :root[data-apex] .navbtn .nl, :root[data-apex] .sec-head,
:root[data-apex] .section-title { text-transform: uppercase; letter-spacing: .1em; }

/* поверхности: контур вместо тени */
:root[data-apex] .tcard, :root[data-apex] .card, :root[data-apex] .cmt, :root[data-apex] .rvcard,
:root[data-apex] .krow, :root[data-apex] .rule, :root[data-apex] .tmember, :root[data-apex] .rep-card,
:root[data-apex] .doc-card, :root[data-apex] .cd-card, :root[data-apex] .sch-day, :root[data-apex] .cab-card,
:root[data-apex] .bcard, :root[data-apex] .kpi .k, :root[data-apex] .icon-btn, :root[data-apex] .notifrow,
:root[data-apex] .goal-card, :root[data-apex] .goal-task {
  box-shadow: none; border: 1px solid var(--line); background: var(--card);
}
:root[data-apex] .tcard { border-left: 1px solid var(--line); }
:root[data-apex] .tcard.prio-high { border-left: 3px solid var(--red); }
:root[data-apex] .panel-head { box-shadow: none; border-bottom: 1px solid var(--line); background: var(--bg); }
:root[data-apex] .bottomnav { box-shadow: none; border-top: 1px solid var(--line); }
:root[data-apex] .composer { box-shadow: none; border-top: 1px solid var(--line); }
:root[data-apex] .sheet { box-shadow: none; border-top: 1px solid var(--accent); }
:root[data-apex] .bcol { background: #0C0E10; border: 1px solid var(--line); }

/* акцентные элементы: кислотная плашка с чёрным текстом */
:root[data-apex] .primary, :root[data-apex] .send, :root[data-apex] .fab {
  background: var(--accent); color: #07080A; font-weight: 700; box-shadow: none;
}
:root[data-apex] .primary:active, :root[data-apex] .fab:active { background: #EBFF7A; }
:root[data-apex] .secondary { background: transparent; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
:root[data-apex] .secondary:active { border-color: var(--accent); color: var(--accent); }
:root[data-apex] .chip { background: transparent; border: 1px solid var(--line); color: var(--muted); box-shadow: none; }
:root[data-apex] .chip.active { background: var(--accent); border-color: var(--accent); color: #07080A; font-weight: 700; }
:root[data-apex] .projects .ptab { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--muted); }
:root[data-apex] .projects .ptab.active { background: var(--accent); border-color: var(--accent); color: #07080A; }
:root[data-apex] .subtab { background: transparent; border: 1px solid var(--line); color: var(--muted); }
:root[data-apex] .subtab.active { background: var(--accent); border-color: var(--accent); color: #07080A; }
:root[data-apex] .weekchip { background: transparent; border: 1px solid var(--line); box-shadow: none; }
:root[data-apex] .weekchip.active { background: var(--accent); border-color: var(--accent); color: #07080A; }
:root[data-apex] .switch, :root[data-apex] .switch2, :root[data-apex] .btn-mini,
:root[data-apex] .add-blk, :root[data-apex] .bcard .quick {
  background: transparent; border: 1px solid var(--line); color: var(--accent);
}
:root[data-apex] .switch2.on { background: var(--accent); color: #07080A; border-color: var(--accent); }
:root[data-apex] .mn-arrow { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--accent); }

/* нижняя навигация */
:root[data-apex] .navbtn .ni { filter: grayscale(1) opacity(.45); }
:root[data-apex] .navbtn.active { color: var(--accent); }
:root[data-apex] .navbtn.active .ni { filter: none; }
:root[data-apex] .navbtn.active::before { background: var(--accent); height: 2px; width: 100%; border-radius: 0; }

/* бейджи: контур вместо заливки, семантика цветом */
:root[data-apex] .badge { background: transparent !important; border: 1px solid currentColor; font-weight: 500; padding: 2px 8px; }
:root[data-apex] .b-short, :root[data-apex] .b-time { color: var(--accent); }
:root[data-apex] .b-long, :root[data-apex] .s-new { color: var(--blue); }
:root[data-apex] .b-mentor, :root[data-apex] .b-rep, :root[data-apex] .s-in_progress { color: var(--amber); }
:root[data-apex] .s-review { color: #C9A7FF; }
:root[data-apex] .s-done, :root[data-apex] .b-reuse { color: var(--green); }
:root[data-apex] .s-closed { color: var(--muted); }
:root[data-apex] .b-imp { color: var(--red); }
:root[data-apex] .b-fs { color: var(--blue); }

/* поля ввода */
:root[data-apex] input, :root[data-apex] textarea, :root[data-apex] select {
  background: var(--input-bg); border: 1px solid var(--line);
}
:root[data-apex] input:focus, :root[data-apex] textarea:focus, :root[data-apex] select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 255, 63, .18);
}

/* график и расписание */
:root[data-apex] .sch-cell { border: 1px dashed var(--line); }
:root[data-apex] .sch-cell.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
:root[data-apex] .sch-cell .c-names .nm-chip { background: transparent; border: 1px solid var(--line); color: var(--text); }
:root[data-apex] .sch-cell .c-names .nm-chip.asg { background: var(--accent); border-color: var(--accent); color: #07080A; }
:root[data-apex] .cab-row .slot-chip { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(212, 255, 63, .3); }
:root[data-apex] .cab-row .slot-chip.sl-dbl { background: rgba(255, 65, 51, .14); color: var(--red); border-color: rgba(255, 65, 51, .45); }
:root[data-apex] .cab-row .slot-chip.sl-guest { background: rgba(255, 255, 255, .06); color: var(--text); border-color: var(--line); }
:root[data-apex] .blk { background: #0B0D0F; border: 1px solid var(--line); }
:root[data-apex] .cal-day { background: #0B0D0F; border: 1px solid #16191C; }
:root[data-apex] .cal-day.today { outline: 1px solid var(--accent); outline-offset: -1px; }
:root[data-apex] .cal-chip { background: var(--accent-soft); color: var(--accent); }
:root[data-apex] .mg-pill { background: transparent; border: 1px solid var(--line); }
:root[data-apex] .mg-pill.mg-time { background: var(--accent-soft); border-color: rgba(212, 255, 63, .3); color: var(--accent); }
:root[data-apex] .pick-asr { border: 1px solid var(--line); }
:root[data-apex] .pick-asr.sel { border-color: var(--accent); background: var(--accent-soft); }
:root[data-apex] .tl-track { background: rgba(123, 232, 123, .12); border-color: var(--line); }

/* прогресс, рейтинг, отчёты */
:root[data-apex] .progressbar, :root[data-apex] .krow .bar, :root[data-apex] .shbar { background: #1A1E21; }
:root[data-apex] .progressbar i, :root[data-apex] .shbar i { background: var(--accent); }
:root[data-apex] .krow .bar i { background: var(--accent); }
:root[data-apex] .krow.me { border: 1px solid var(--accent); }
:root[data-apex] .kpi .k b { color: var(--accent); }
:root[data-apex] .rate-big { color: var(--accent); }
:root[data-apex] .check .box { border: 1px solid var(--line); }
:root[data-apex] .check.done .box { background: var(--accent); border-color: var(--accent); color: #07080A; }
:root[data-apex] .cmt.own { background: var(--accent-soft); border-color: rgba(212, 255, 63, .28); }
:root[data-apex] .cmt .who { color: var(--accent); }

/* всплывающее сообщение и подсказки */
:root[data-apex] .toast { background: var(--accent); color: #07080A; font-weight: 700; border: 0; box-shadow: none; }
:root[data-apex] .hint, :root[data-apex] .sch-status { color: var(--muted); }
:root[data-apex] .empty .e-ico { filter: grayscale(1) opacity(.6); }
:root[data-apex] .skeleton { background: linear-gradient(100deg, #101315 40%, #191D20 50%, #101315 60%); background-size: 200% 100%; }

/* выбор оформления в профиле */
.theme-pick { display: flex; gap: 6px; }
.theme-pick .chip { flex: 1; text-align: center; justify-content: center; }

/* ─── APEX: цвета филиалов и приборные эффекты (v121) ─── */
:root[data-apex] { --acc-2: #45E3FF; --acc-3: #FF52C8; }

/* вкладка филиала окрашена своим сигнальным цветом */
:root[data-apex] .projects .ptab { border-left: 3px solid var(--pc, var(--line)); color: var(--muted); }
:root[data-apex] .projects .ptab.active {
  background: var(--pc, var(--accent)); border-color: var(--pc, var(--accent)); color: #07080A; font-weight: 700;
  box-shadow: 0 0 18px -4px var(--pc, var(--accent));
}
/* филиал в личном графике — той же меткой */
:root[data-apex] .mg-br { color: var(--accent); }

/* свечение акцентных действий */
:root[data-apex] .primary, :root[data-apex] .fab, :root[data-apex] .send {
  box-shadow: 0 0 22px -6px var(--accent);
}
:root[data-apex] .fab { border: 1px solid #EBFF7A; }
:root[data-apex] .chip.active, :root[data-apex] .subtab.active, :root[data-apex] .weekchip.active {
  box-shadow: 0 0 16px -6px var(--accent);
}

/* уголковые засечки на карточках — приборная разметка */
:root[data-apex] .tcard, :root[data-apex] .rvcard, :root[data-apex] .krow, :root[data-apex] .cab-card { position: relative; }
:root[data-apex] .tcard::after, :root[data-apex] .rvcard::after,
:root[data-apex] .krow::after, :root[data-apex] .cab-card::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px;
  border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); opacity: .55; pointer-events: none;
}
:root[data-apex] .tcard.prio-high::after { border-color: var(--red); opacity: .9; }

/* тревожное подсвечивается, а не просто краснеет */
:root[data-apex] .badge-warn, :root[data-apex] .warn, :root[data-apex] .sl-dbl-txt,
:root[data-apex] .blk-asr.bad { animation: apexPulse 2s steps(1) infinite; }
@keyframes apexPulse { 50% { opacity: .45; } }
:root[data-apex] .s-review { border-style: dashed; }

/* сканлайны — очень слабые, поверх фона */
:root[data-apex] body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
}
/* активная строка нижнего меню светится */
:root[data-apex] .navbtn.active::before { box-shadow: 0 0 12px var(--accent); }
/* заголовок экрана с технической засечкой слева */
:root[data-apex] .panel-title { padding-left: 12px; position: relative; }
:root[data-apex] .panel-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; background: var(--accent);
}
/* время и числа — акцентным моно */
:root[data-apex] .blk-time, :root[data-apex] .krow .mins, :root[data-apex] .b-time { color: var(--accent); }
:root[data-apex] .mg-pill.mg-time { text-shadow: 0 0 10px rgba(212,255,63,.45); }

/* ─── APEX: набор заголовка и шум загрузки (v122) ─── */
/* заголовок «собирается» из помех — ширина не скачет, поэтому моно и фиксированный кегль */
:root[data-apex] .panel-title, :root[data-apex] .topbar h1 { font-variant-numeric: tabular-nums; }
:root[data-apex] .topbar h1 { letter-spacing: .06em; }

/* скелетон превращается в дамп памяти под сканирующей полосой */
:root[data-apex] .skeleton {
  background: #0B0D0F; border: 1px solid var(--line); animation: none;
  position: relative; overflow: hidden; padding: 10px 12px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
}
:root[data-apex] .skeleton span {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; letter-spacing: .14em;
  color: rgba(212, 255, 63, .3); white-space: nowrap; overflow: hidden;
  animation: apexFlick 1.5s steps(1) infinite;
}
:root[data-apex] .skeleton span:nth-child(2) { animation-delay: .3s; opacity: .75; }
:root[data-apex] .skeleton span:nth-child(3) { animation-delay: .6s; opacity: .5; }
@keyframes apexFlick { 50% { opacity: .25; } }
/* сканирующая полоса поверх шума */
:root[data-apex] .skeleton::after {
  content: ''; position: absolute; left: 0; right: 0; height: 22px; top: -22px;
  background: linear-gradient(180deg, transparent, rgba(212, 255, 63, .16), transparent);
  animation: apexScan 1.6s linear infinite;
}
@keyframes apexScan { to { top: 100%; } }
@media (prefers-reduced-motion: reduce) {
  :root[data-apex] .skeleton::after, :root[data-apex] .skeleton span { animation: none; }
}

/* ─── APEX: графика витрины внутри приложения (v124) ─── */
/* «ё» в узком гротеске обрезается сверху — даем заголовкам воздух */
:root[data-apex] .topbar h1, :root[data-apex] .panel-title, :root[data-apex] .tk-title,
:root[data-apex] .sch-week, :root[data-apex] .cab-head, :root[data-apex] .rep-h,
:root[data-apex] .sheet h3, :root[data-apex] .mn-title, :root[data-apex] .d-name {
  line-height: 1.34; padding-top: 1px;
}

/* растровая текстура — та же фактура, что на витрине продукта */
:root[data-apex] .topbar, :root[data-apex] .panel-head { position: relative; overflow: hidden; }
:root[data-apex] .topbar::after, :root[data-apex] .panel-head::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(#2A3035 .8px, transparent .9px); background-size: 5px 5px;
  -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000);
  mask-image: linear-gradient(90deg, transparent 45%, #000);
}
/* диагональная кислотная штриховка под шапкой экрана */
:root[data-apex] .panel-head { border-bottom: 1px solid var(--accent); }
:root[data-apex] .topbar { border-bottom: 1px solid var(--line); }

/* фирменный знак в пустых состояниях вместо серого текста */
:root[data-apex] .empty { position: relative; padding-top: 64px; }
:root[data-apex] .empty::before {
  content: ''; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 17px solid transparent; border-right: 17px solid transparent;
  border-top: 30px solid var(--accent); opacity: .85;
}
:root[data-apex] .empty::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 92px; height: 56px; pointer-events: none;
  background-image: radial-gradient(rgba(212,255,63,.5) .9px, transparent 1px); background-size: 5px 5px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent);
}
:root[data-apex] .empty .e-ico { display: none; }

/* полосы загрузки в рейтинге — как спектр на витрине */
:root[data-apex] .krow .bar { height: 9px; background: repeating-linear-gradient(90deg, #1A1E21 0 3px, transparent 3px 5px); }
:root[data-apex] .krow .bar i { background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 5px); }
:root[data-apex] .shbar { height: 6px; background: repeating-linear-gradient(90deg, #1A1E21 0 3px, transparent 3px 5px); }
:root[data-apex] .shbar i { background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 5px); }

/* кислотная засечка на плашках-подсказках */
:root[data-apex] .fact { border-left: 2px solid var(--accent); }
:root[data-apex] .fact.fact-bad { border-left-color: var(--red); }
:root[data-apex] .fact.fact-warn { border-left-color: var(--amber); }
:root[data-apex] .fact.fact-ok { border-left-color: var(--green); }

/* ─── APEX: кольца прогресса в профиле (v125) ─── */
/* трек кольца превращается в шкалу прибора, дуга поверх — сплошная */
:root[data-apex] .ring-track { stroke: #171B1E; stroke-dasharray: 3 2.4; }
:root[data-apex] .ring-arc { filter: drop-shadow(0 0 5px currentColor); }
/* числа в центре колец — моноширинные, как показания */
:root[data-apex] #profile-progress text, :root[data-apex] .wl-rings text {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
/* подписи ярусов выработки под кислотную палитру */
:root[data-apex] .tier-txt-bronze { color: #FFB03F; fill: #FFB03F; }
:root[data-apex] .tier-txt-silver { color: #45E3FF; fill: #45E3FF; }
:root[data-apex] .tier-txt-gold   { color: #D4FF3F; fill: #D4FF3F; }

/* ─── поиск по задачам ─── */
.searchrow { position: relative; padding: 8px 16px 0; }
.searchrow input {
  width: 100%; padding: 10px 36px 10px 34px; font-size: 16px;
  background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237A93A0' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5' stroke-linecap='round'/></svg>")
    no-repeat 11px center;
}
.searchrow input::-webkit-search-cancel-button { display: none; }
.search-x {
  position: absolute; right: 22px; top: 50%; transform: translateY(-25%);
  width: 26px; height: 26px; color: var(--muted); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.search-x:active { color: var(--red); }
.search-note {
  padding: 10px 4px 0; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.search-note b { color: var(--text); font-weight: 600; }
/* режим APEX: поисковая строка как командная */
:root[data-apex] .searchrow input {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 16px; letter-spacing: .02em;
  border-color: var(--line); background-color: var(--input-bg);
}
:root[data-apex] .searchrow input:focus { border-color: var(--accent); }
:root[data-apex] .search-note { font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
:root[data-apex] .search-note b { color: var(--accent); }

/* уволенный сотрудник в истории графика: имя остаётся, рядом пометка */
.gone { color: var(--muted); font-size: 11px; opacity: .85; }
:root[data-apex] .gone { color: var(--amber); }


/* ── смена без ассистента: её должно быть видно с другого конца комнаты ── */
.blk.blk-none {
  background: var(--hole-bg, #FBE9E7);
  box-shadow: inset 0 0 0 1.5px var(--hole-line, #E9B4AE);
  animation: asrPulse 2.2s ease-in-out infinite;
}
.asr-none { color: var(--red, #D8574D); font-weight: 700; }
.cab-row .slot-chip.sl-none {
  background: var(--hole-bg, #FBE9E7); color: var(--red, #D8574D); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--hole-line, #E9B4AE);
  animation: asrPulse 2.2s ease-in-out infinite;
}
@keyframes asrPulse {
  0%, 100% { box-shadow: inset 0 0 0 1.5px var(--hole-line, #E9B4AE), 0 0 0 0 rgba(216, 87, 77, .45); }
  50%      { box-shadow: inset 0 0 0 1.5px var(--hole-line, #E9B4AE), 0 0 0 6px rgba(216, 87, 77, 0); }
}
:root[data-apex] .blk.blk-none,
:root[data-apex] .cab-row .slot-chip.sl-none {
  background: rgba(255, 65, 51, .12); color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
:root[data-apex] .asr-none { color: var(--red); }
@media (prefers-reduced-motion: reduce) {
  .blk.blk-none, .cab-row .slot-chip.sl-none { animation: none; }
}
