/* Палитра и кнопки — как в интерфейсе Битрикс24 (общие с остальными приложениями FRBS Labs); компоновка — карточки, плитки, календари */
:root {
  --ground: #eef2f4;
  --surface: #fff;
  --ink: #333;
  --ink-2: #525c69;
  --muted: #6f7882;
  --line: #e4e8eb;
  --line-strong: #cfd5da;
  --chip-bg: #f5f7f8;
  --accent: #2fc6f6;
  --accent-dark: #11a9d9;
  --accent-soft: #e5f9ff;
  --link: #2067b0;
  --cta: #bbed21;
  --cta-hover: #d2f95f;
  --danger: #ff5752;
  --ok-bg: #f1fbd0; --ok-ink: #4f7d00; --ok-mark: #7bb300;
  --err-bg: #ffe8e8; --err-ink: #d0312b; --err-mark: #ff5752;
  --info-bg: #e5f9ff; --info-ink: #0b8eb6;
  --warn-bg: #fff4d6; --warn-ink: #8a5a00; --warn-mark: #f5b400;
  --off-bg: #f3f5f7;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 4px 14px rgba(20, 24, 30, .05);
  --shadow-up: 0 2px 4px rgba(20, 24, 30, .06), 0 10px 28px rgba(20, 24, 30, .10);
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.45 "Golos Text", "Open Sans", "Helvetica Neue", Arial, sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--err-ink); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.pad { padding: 24px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.ico { display: inline-flex; flex: none; }
.ico svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- каркас ---------- */
.app { max-width: 1240px; margin: 0 auto; padding: 16px clamp(12px, 3vw, 28px) 40px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar .right { margin-left: auto; }
.seg { display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 14px; border-radius: 8px; white-space: nowrap; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg .badge { background: var(--err-mark); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 18px; }

.page-head { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; font-weight: 600; text-wrap: balance; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
.thesis { margin: 0; max-width: 78ch; color: var(--ink-2); }
.back { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--link); font-size: 14px; display: inline-flex; gap: 4px; align-items: center; }
.back:hover { text-decoration: underline; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.section { display: flex; flex-direction: column; gap: 14px; }

/* ---------- кнопки и поля (ui-btn Битрикс24) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap;
}
.btn:hover { border-color: #a8adb4; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-cta { background: var(--cta); border-color: var(--cta); color: var(--ink-2); }
.btn-cta:hover:not(:disabled) { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn-danger { color: var(--err-ink); border-color: #f3b7b5; }
.btn-l { height: 46px; border-radius: 23px; font-size: 13px; padding: 0 28px; }
.btn-s { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 11px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--chip-bg); border-color: transparent; }
.btn .ico { font-size: 15px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.icon-btn:hover { background: var(--chip-bg); color: var(--ink); }
.x { border: 0; background: var(--surface); color: var(--ink-2); border-radius: 50%; width: 28px; height: 28px; font-size: 16px; line-height: 1; flex: none; }
.x:hover { background: var(--ink-2); color: #fff; }

.input {
  width: 100%; min-height: 38px; padding: 7px 10px; font: inherit; font-size: 14px; color: inherit;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 198, 246, .15); }
.input-s { min-height: 32px; padding: 5px 8px; }
.input-xl { font-size: 18px; min-height: 46px; padding: 9px 14px; font-weight: 500; }
select.input { width: auto; max-width: 100%; }
.num-input { width: 72px; text-align: center; }
.time-input { width: 104px; }
.date-input { width: 160px; }
textarea.input { resize: vertical; min-height: 70px; font-family: inherit; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); cursor: pointer; }
.check-line input { accent-color: var(--accent); margin-top: 3px; flex: none; width: 16px; height: 16px; }
.check-line .hint { display: block; }
.search-box { position: relative; flex: 1 1 240px; max-width: 340px; }
.search-box .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 34px; }

/* метки */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 6px; white-space: nowrap; background: var(--chip-bg); color: var(--ink-2); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note { border-radius: 10px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.ok { background: var(--ok-bg); color: var(--ok-ink); }
.note.err { background: var(--err-bg); color: var(--err-ink); }
.note.info { background: var(--info-bg); color: var(--info-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok-mark); }
.dot.warn { background: var(--warn-mark); }
.dot.err { background: var(--err-mark); }
.dot.off { background: var(--line-strong); }
.save-status { font-size: 13px; }
.save-status.ok { color: var(--ok-ink); }
.save-status.err { color: var(--err-ink); }
details > summary { cursor: pointer; font-weight: 500; }

/* сегменты-переключатели внутри формы */
.toggle-group { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: #fff; }
.toggle-group button { border: 0; border-right: 1px solid var(--line-strong); background: transparent; padding: 7px 13px; font-size: 13.5px; color: var(--ink-2); }
.toggle-group button:last-child { border-right: 0; }
.toggle-group button:hover { background: var(--chip-bg); }
.toggle-group button[aria-pressed="true"] { background: var(--accent-soft); color: var(--info-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* выключатель */
.switch { position: relative; width: 38px; height: 22px; border-radius: 11px; border: 0; background: var(--line-strong); padding: 0; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--ok-mark); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* аватары */
.ava { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; flex: none; overflow: hidden; border: 2px solid #fff; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.dept { border-radius: 7px; background: var(--chip-bg) !important; color: var(--ink-2); font-size: 13px; }
.ava.more { background: var(--chip-bg); color: var(--ink-2); }
.avas { display: inline-flex; }
.avas .ava + .ava { margin-left: -8px; }

/* ---------- список шаблонов ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.small { font-size: 16px; line-height: 1.35; font-weight: 600; }
.kpi .hint { margin-top: auto; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: var(--shadow-up); }
.kpi.alert .kpi-value { color: var(--err-ink); }

.toolbar { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.toolbar .right { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 4px 11px; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .75; margin-left: 2px; font-variant-numeric: tabular-nums; }

.tpls { display: flex; flex-direction: column; gap: 8px; }
.tpl { --c: var(--accent); position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) 150px auto; gap: 16px; align-items: center;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 14px 20px; overflow: hidden; transition: box-shadow .15s; }
.tpl::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.tpl:hover { box-shadow: var(--shadow-up); }
.tpl.off { background: #fbfcfc; }
.tpl.off::before { background: var(--line-strong); }
.tpl.off .tpl-title, .tpl.off .tpl-when { color: var(--muted); }
.tpl-main { display: flex; flex-direction: column; gap: 5px; cursor: pointer; min-width: 0; }
.tpl-title { font-weight: 600; font-size: 15.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpl-title span.t { overflow: hidden; text-overflow: ellipsis; }
.tpl-main:hover .tpl-title span.t { color: var(--link); }
.tpl-when { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: baseline; }
.tpl-when .ico { position: relative; top: 2px; color: var(--muted); }
.tpl-who { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpl-next { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--muted); }
.tpl-next b { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.tpl-actions { display: flex; gap: 4px; align-items: center; }
.last { display: inline-flex; gap: 5px; align-items: center; border: 0; background: none; padding: 0; font-size: 13px; color: var(--muted); }
.last.err { color: var(--err-ink); }
button.last:hover { text-decoration: underline; }

.empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-pic { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-size: 30px; }

/* быстрый старт */
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.preset { --c: var(--accent); text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.preset:hover { border-color: var(--c); box-shadow: var(--shadow); }
.preset-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--c); font-size: 17px; margin-bottom: 4px; }
.preset b { font-weight: 600; }
.preset span { font-size: 13px; color: var(--muted); }

/* выпадающее меню */
.menu { position: absolute; z-index: 50; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-up); border: 1px solid var(--line); padding: 5px; min-width: 190px; display: flex; flex-direction: column; }
.menu button { border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 7px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.menu button:hover { background: var(--chip-bg); }
.menu button.danger { color: var(--err-ink); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2f3640; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-up); z-index: 200; max-width: calc(100vw - 32px); }

/* ---------- редактор ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.editor-main { display: flex; flex-direction: column; gap: 16px; }
.aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; flex-direction: column; gap: 14px; }
.step-head { display: flex; gap: 12px; align-items: center; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--info-ink); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.step-head .hint { margin-left: auto; }

/* подстановки: кнопка у поля и меню с примерами */
.title-wrap { position: relative; }
.title-wrap .input-xl { padding-right: 140px; }
.var-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--chip-bg); color: var(--ink-2);
  border-radius: 8px; padding: 5px 10px; font-size: 13px; line-height: 1.2; }
.var-btn:hover { border-color: var(--accent); color: var(--info-ink); background: var(--accent-soft); }
.var-btn .ico { font-size: 15px; }
.title-wrap .var-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.title-hint { display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.title-hint:empty { display: none; }
.title-hint .ico { color: var(--ok-mark); position: relative; top: 2px; }
.var-menu { min-width: 320px; }
.var-menu-head { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.var-menu button { justify-content: space-between; gap: 16px; }
.var-label { font-weight: 500; }
.var-example { color: var(--muted); font-size: 13px; text-align: right; }

.checklist { display: flex; flex-direction: column; gap: 4px; }
.cl-item { display: flex; gap: 8px; align-items: center; }
.cl-box { width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 4px; flex: none; }
.cl-item .input { min-height: 32px; padding: 4px 8px; border-color: transparent; background: transparent; }
.cl-item .input:hover { border-color: var(--line); }
.cl-item .input:focus { border-color: var(--accent); background: #fff; }
.cl-item .icon-btn { width: 26px; height: 26px; font-size: 14px; opacity: 0; }
.cl-item:hover .icon-btn, .cl-item .icon-btn:focus { opacity: 1; }
.cl-new .input { border-style: dashed; border-color: var(--line-strong); background: #fff; }
.cl-new .btn { flex: none; }
.checklist .hint { margin: 2px 0 0 24px; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tile { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 10px 9px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 76px; transition: border-color .12s, background .12s; }
.tile:hover { border-color: var(--line-strong); }
.tile .ico { font-size: 18px; color: var(--muted); }
.tile b { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.tile span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tile[aria-pressed="true"] .ico { color: var(--accent-dark); }
.tiles.compact .tile { min-height: 0; flex-direction: row; align-items: center; gap: 8px; padding: 9px 10px; }

.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.wd { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.wd:hover { border-color: var(--accent); }
.wd.weekend { color: var(--err-ink); }
.wd[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.mdays { display: grid; grid-template-columns: repeat(7, 38px); gap: 5px; }
.mday { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mday:hover { border-color: var(--accent); }
.mday[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.mday.last-day { grid-column: span 3; }
.sched-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.sched-line > .lbl { min-width: 150px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.live { display: flex; gap: 8px; align-items: center; background: var(--ok-bg); color: var(--ok-ink); border-radius: 9px; padding: 9px 12px; font-size: 14px; }
.live.warn { background: var(--warn-bg); color: var(--warn-ink); }
.colors { display: flex; gap: 6px; }
.color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink-2); }

/* выбор сотрудников и отделов */
.pp { position: relative; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 6px; min-height: 40px; background: #fff; cursor: text; }
.pp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 198, 246, .15); }
.pp input { border: 0; outline: none; font: inherit; font-size: 14px; flex: 1 1 120px; min-width: 100px; padding: 4px; background: transparent; }
.pp-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip-bg); border-radius: 15px; padding: 2px 4px 2px 2px; font-size: 13.5px; }
.pp-chip .ava { width: 22px; height: 22px; border: 0; font-size: 10px; }
.pp-chip .ava.dept { font-size: 12px; }
.pp-chip button { border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.pp-chip button:hover { color: var(--err-ink); }
.pp-chip .n { color: var(--muted); font-size: 12px; }
.pp-drop { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-up); max-height: 290px; overflow-y: auto; padding: 4px; }
.pp-opt { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 7px; font-size: 14px; }
.pp-opt:hover, .pp-opt.hl { background: var(--chip-bg); }
.pp-opt small { display: block; color: var(--muted); font-size: 12px; }
.pp-sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 4px; }
.queue { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: var(--ink-2); }
.queue .q { display: inline-flex; gap: 5px; align-items: center; background: var(--chip-bg); border-radius: 14px; padding: 2px 9px 2px 3px; }
.queue .q.now { background: var(--accent-soft); color: var(--info-ink); font-weight: 600; }
.queue .q .ava { width: 20px; height: 20px; border: 0; font-size: 9px; }

/* превью «Как это будет» */
.pv { display: flex; flex-direction: column; gap: 14px; }
.pv-sum { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.pv-sum b { color: var(--ink); font-weight: 600; }
.pv-sum div + div { margin-top: 3px; }
.pv-task { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: #fcfdfd; }
.pv-task-title { font-weight: 600; font-size: 14.5px; }
.pv-task-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pv-task-meta span { display: inline-flex; gap: 4px; align-items: center; }
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mini-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; text-transform: capitalize; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 11.5px; text-align: center; font-variant-numeric: tabular-nums; }
.mini .wh { color: var(--muted); font-size: 10.5px; padding-bottom: 2px; }
.mini .d { height: 22px; line-height: 22px; border-radius: 50%; color: var(--ink-2); position: relative; }
.mini .d.off { color: #b4bbc2; }
.mini .d.today { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.mini .d.run { background: var(--c, var(--accent)); color: #fff; font-weight: 600; }
.mini .d.due::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--err-mark); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nexts { display: flex; flex-direction: column; }
.nx { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.nx:first-child { border-top: 0; }
.nx b { font-weight: 600; }
.nx .sub { color: var(--muted); font-size: 12.5px; }
.savebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- календарь запусков ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-head h2 { min-width: 170px; text-transform: capitalize; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line-strong); }
.mcal .wh { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--chip-bg); border-bottom: 1px solid var(--line-strong); text-transform: uppercase; letter-spacing: .04em; }
.mcal .cell { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcal .cell:nth-child(7n) { border-right: 0; }
.mcal .cell.out { background: #fafbfb; }
.mcal .cell.out .num { color: #c0c6cc; }
.mcal .cell.off { background: var(--off-bg); }
.mcal .num { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 2px 2px; display: flex; justify-content: space-between; }
.mcal .cell.today .num span { background: var(--accent); color: #fff; border-radius: 11px; padding: 0 7px; }
.mcal .hol { font-weight: 400; color: var(--err-ink); font-size: 11px; }
.ev { --c: var(--accent); display: flex; gap: 5px; align-items: center; border: 0; text-align: left; width: 100%; background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 3px solid var(--c); border-radius: 4px; padding: 2px 6px; font-size: 12px; color: var(--ink); min-width: 0; }
.ev:hover { background: color-mix(in srgb, var(--c) 24%, #fff); }
.ev .tm { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ev .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.past { background: #fff; border-left-color: var(--line-strong); color: var(--muted); }
.ev.past.err { border-left-color: var(--err-mark); color: var(--err-ink); }
.ev-more { border: 0; background: none; font-size: 12px; color: var(--link); text-align: left; padding: 0 6px; }
.agenda { display: none; flex-direction: column; gap: 8px; }
.ag-day { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.ag-day h3 { font-size: 14px; text-transform: capitalize; }
.ag-day.today h3 { color: var(--accent-dark); }

/* ---------- журнал ---------- */
.tablewrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; border: 1px solid var(--line-strong); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 13px; font-weight: 600; background: var(--chip-bg); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
td.nowrap { white-space: nowrap; }
.wide { min-width: 760px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.task-links { display: flex; flex-direction: column; gap: 3px; }
.task-links a { text-decoration: none; }
.task-links span { white-space: nowrap; }
.task-links a:hover { text-decoration: underline; }
.tpl-link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 500; text-align: left; display: inline-flex; gap: 7px; align-items: center; }
.tpl-link:hover { color: var(--link); }

/* ---------- настройки ---------- */
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.settings .card { display: flex; flex-direction: column; gap: 12px; }
.settings .card-head { margin-bottom: 0; }
.year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.year .mini .d { cursor: pointer; }
.year .mini .d:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.year .mini .d.hol { background: var(--err-bg); color: var(--err-ink); font-weight: 600; }
.year .mini .d.work { background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent); margin-top: 3px; }
.radio-card b { display: block; font-weight: 600; font-size: 14px; }
.radio-card span { font-size: 13px; color: var(--muted); }
.users-picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- знакомство (как в «Дублях по ИНН») ---------- */
.tour-tab { position: fixed; right: 0; top: 96px; z-index: 5; writing-mode: vertical-rl; transform: rotate(180deg); border: 0; border-radius: 0 8px 8px 0;
  background: var(--accent); color: #fff; padding: 12px 5px; font-size: 13px; box-shadow: var(--shadow); }
.tour-tab:hover { background: var(--accent-dark); }
@media (max-width: 700px) { .tour-tab { display: none; } }
.ob-overlay { position: fixed; inset: 0; background: rgba(20, 24, 30, .45); display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; overflow-y: auto; z-index: 100; }
.ob { position: relative; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(20, 24, 30, .25); width: 100%; max-width: 760px; overflow: hidden; }
.ob-x { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .9); z-index: 1; }
.ob-pic { background: var(--ground); border-bottom: 1px solid var(--line); height: 300px; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.ob-pic img { width: 100%; height: auto; display: block; }
.ob-pic.small { align-items: center; background: linear-gradient(135deg, #e6eaff, #f1e7fd); }
.ob-pic.fit { height: auto; padding: 16px 16px 0; }
.ob-pic.fit img { border-radius: 10px 10px 0 0; border: 1px solid var(--line-strong); border-bottom: 0; box-shadow: var(--shadow); }
.ob-pic.small img { width: 120px; border-radius: 26px; box-shadow: 0 8px 24px rgba(46, 68, 184, .25); }
.ob-body { padding: 18px 24px 20px; display: flex; flex-direction: column; gap: 8px; }
.ob-body h2 { font-size: 20px; }
.ob-body p { margin: 0; color: var(--ink-2); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.ob-dots i.on { background: var(--accent); width: 22px; border-radius: 4px; }
.ob-skip { border-color: transparent; color: var(--muted); }
.ob-tag { display: inline-block; background: var(--warn-bg); color: var(--warn-ink); border-radius: 6px; padding: 1px 8px; margin-right: 8px; letter-spacing: .04em; }
.ob-path { font-size: 14px; background: var(--chip-bg); border-radius: 8px; padding: 8px 12px; color: var(--ink); }
@media (max-width: 760px) {

/* поддержка */
.support { display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--accent); }
.support-ctx { color: var(--ink-2); }

@media (max-width: 1060px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; }
  .tpl .switch { margin-top: 2px; }
  .tpl-next { grid-column: 2 / 4; grid-row: 2; flex-direction: row; gap: 6px; align-items: baseline; }
  .tpl-actions { grid-column: 3; grid-row: 1; }
  .tpl-actions .btn { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .presets, .fields-2, .radio-cards, .minis { grid-template-columns: minmax(0, 1fr); }
  .year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcal { display: none; }
  .agenda { display: flex; }
  .sched-line > .lbl { min-width: 0; width: 100%; }
  .toolbar .right { margin-left: 0; }
  .card { padding: 16px; }
  .mdays { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .title-wrap .input-xl { padding-right: 52px; }
  .title-wrap .var-btn-label { display: none; }
}
