/* Справочник «Орион» — стили */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --border: #e2e6ef;
  --text: #121826;
  --muted: #5d6679;
  --faint: #8b93a5;
  --accent: #3b5bdb;
  --accent-2: #5c7cfa;
  --accent-soft: #e7ecff;
  --danger: #e03131;
  --danger-soft: #ffe8e8;
  --ok: #2b8a3e;
  --mark: #ffe066;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 48px rgba(16, 24, 40, .18);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b24;
  --surface-2: #1d2430;
  --border: #2a3240;
  --text: #e8ecf3;
  --muted: #a1abbd;
  --faint: #6e788b;
  --accent: #748ffc;
  --accent-2: #91a7ff;
  --accent-soft: #1f2a4d;
  --danger: #ff6b6b;
  --danger-soft: #3a1d22;
  --ok: #51cf66;
  --mark: #8a6d00;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { scrollbar-gutter: stable; }
html, body, * {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, transparent) transparent;
}
::-webkit-scrollbar, *::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, *::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover, *::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
::-webkit-scrollbar-corner, *::-webkit-scrollbar-corner { background: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
[hidden] { display: none !important; }

.wrap { max-width: 1600px; margin: 0 auto; padding: 0 20px; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 64px; min-width: 0; width: 100%; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none !important; border-radius: 8px; flex: none; }
.brand .logo { height: 40px; width: 40px; object-fit: contain; display: block; }
.brand .logo.dark { display: none; }
:root[data-theme="dark"] .brand .logo.light { display: none; }
:root[data-theme="dark"] .brand .logo.dark { display: block; }
.brand .title { padding-left: 14px; border-left: 1px solid var(--border); font-weight: 600; font-size: 15px; color: var(--muted); }
.brand:hover .title { color: var(--text); }
.topbar .spacer { flex: 1; min-width: 0; }
.topbar .btn.support { flex: none; }
.topbar .top-right {
  display: flex; align-items: center; gap: 8px;
  flex: none; margin-left: auto;
}
.topbar .top-right > * { flex: none; }
.topbar .res-pins {
  display: none; align-items: center; gap: 6px;
  flex: 1 1 0; min-width: 0; overflow: hidden;
}
.topbar .res-pins.has-pins { display: flex; }
.topbar .res-pins.has-pins ~ .hello-wrap { flex: 0 1 0; overflow: hidden; }
.res-pin {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; max-width: 160px; padding: 0 10px 0 6px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: inherit; cursor: pointer;
  flex: none; min-width: 0;
}
.res-pin:hover { border-color: var(--accent-2); color: var(--accent); }
.res-pin-ic {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; color: #fff; background: #f59f00; flex: none;
}
.res-pin-ic svg { width: 13px; height: 13px; }
.res-pin.rdp .res-pin-ic { background: #1f6feb; }
.res-pin.run .res-pin-ic { background: #7048e8; }
.res-pin.link .res-pin-ic { background: #2fb344; }
.res-pin.app .res-pin-ic { background: #364fc7; }
.res-pin.map .res-pin-ic { background: #0e7490; }
.res-pin.svc .res-pin-ic { background: #2563eb; }
.res-pin.svc { text-decoration: none; color: inherit; }
.res-pin-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; min-width: 0; }
.res-pin-more {
  height: 34px; min-width: 34px; padding: 0 8px; flex: none;
  border: 0; border-radius: 17px;
  background: var(--surface-2); color: var(--muted); cursor: pointer; font-weight: 650;
}
.res-pin-more:hover { background: color-mix(in srgb, var(--text) 8%, var(--surface-2)); color: var(--text); }
.res-pin-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: transparent;
}
.res-pin-menu.menu {
  position: fixed; z-index: 81; padding: 8px 0; min-width: 260px; max-width: min(360px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 80px)); overflow-x: hidden; overflow-y: auto;
  border: 0; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  backdrop-filter: blur(40px) saturate(140%);
  box-shadow: 0 0 10px 1px rgba(0, 0, 0, .1), 0 8px 24px rgba(0, 0, 0, .12);
  animation: tgMenu .15s cubic-bezier(.2, .9, .3, 1);
  transform-origin: var(--tg-o, top right);
}
:root[data-theme="dark"] .res-pin-menu.menu {
  background: color-mix(in srgb, #212121 92%, transparent);
  box-shadow: 0 0 10px 1px rgba(0, 0, 0, .35), 0 8px 28px rgba(0, 0, 0, .45);
}
@keyframes tgMenu { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.res-pin-menu .tg-row {
  display: flex; align-items: center; gap: 16px; width: 100%;
  height: 56px; padding: 0 16px; border: 0; border-radius: 0;
  background: none; color: inherit; cursor: pointer; text-align: left; font: inherit;
}
.res-pin-menu .tg-row:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.res-pin-menu .tg-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; background: #f59f00;
}
.res-pin-menu .tg-av svg { width: 20px; height: 20px; color: #fff; }
.res-pin-menu .tg-av.rdp { background: #1f6feb; }
.res-pin-menu .tg-av.run { background: #7048e8; }
.res-pin-menu .tg-av.link { background: #2fb344; }
.res-pin-menu .tg-av.app { background: #364fc7; }
.res-pin-menu .tg-av.map { background: #0e7490; }
.res-pin-menu .tg-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.res-pin-menu .tg-t { font-size: 16px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-pin-menu .tg-s { font-size: 14px; color: var(--muted); line-height: 1.2; }
@media (max-width: 720px) {
  .res-pin-scrim { background: rgba(0, 0, 0, .3); animation: tgFade .2s ease; }
  @keyframes tgFade { from { opacity: 0; } }
  .res-pin-menu.menu.sheet {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100% !important; max-width: none; max-height: 70vh;
    border-radius: 16px 16px 0 0; padding-bottom: calc(8px + env(safe-area-inset-bottom));
    transform-origin: bottom center;
    animation: tgSheet .28s cubic-bezier(.2, .9, .3, 1);
  }
  .res-pin-menu.sheet::before {
    content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
    background: var(--faint); margin: 8px auto 4px; opacity: .55;
  }
  @keyframes tgSheet { from { transform: translateY(100%); } to { transform: none; } }
}
.res-star {
  width: 28px; height: 28px; padding: 0; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--faint); cursor: pointer;
}
.res-star svg { width: 16px; height: 16px; }
.res-star:hover { color: #eab308; background: color-mix(in srgb, #eab308 12%, transparent); }
.res-star.on { color: #eab308; }
.res-star.on svg { fill: currentColor; }
.res .res-star { position: absolute; top: 8px; right: 8px; left: auto; z-index: 2; }
.res .res-browse { right: 44px; }
.rt .res-star { position: absolute; top: 4px; left: 4px; z-index: 2; }
.rt-grid.compact .res-star { position: static; opacity: .7; }
.rt-grid.compact .res-star.on { opacity: 1; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 550; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--accent-2); color: var(--accent); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.support { background: #ea580c; border-color: #ea580c; color: #fff; }
.btn.support:hover { background: #f97316; border-color: #f97316; color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.icon { width: 38px; padding: 0; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.sm.icon { width: 32px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Поиск ---------- */
.hero { padding: 28px 0 8px; }
.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.search > svg { width: 22px; height: 22px; margin-left: 18px; color: var(--faint); flex: none; }
.search input {
  flex: 1; min-width: 0; height: 58px; border: 0; outline: 0; background: transparent;
  padding: 0 14px; font-size: 18px;
}
.search input::placeholder { color: var(--faint); }
.search kbd {
  margin-right: 14px; font: 600 12px/1 ui-monospace, monospace; color: var(--faint);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 4px 7px;
}
.search .clear { margin-right: 8px; }
.hint { margin: 10px 4px 0; color: var(--muted); font-size: 13px; min-height: 19px; }
.hint b { color: var(--text); }

/* ---------- Панель фильтров ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0; }
.chips { display: flex; gap: 7px; overflow-x: auto; flex: 1; min-width: 0; padding: 2px; scrollbar-width: thin; }
.chip {
  flex: none; height: 32px; padding: 0 13px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .65; margin-left: 4px; font-weight: 500; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 550;
}
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
select.sel {
  height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  padding: 0 30px 0 11px; font-size: 14px; max-width: 220px;
}

/* ---------- Админ-панель ---------- */
.adminbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px dashed var(--accent-2); font-size: 14px;
}
.adminbar .lbl { font-weight: 650; color: var(--accent); margin-right: 6px; display: flex; align-items: center; gap: 6px; }
.adminbar .lbl svg { width: 17px; height: 17px; }
.adminbar .spacer { flex: 1; }
.adminbar #coswitch { max-width: 240px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check svg { width: 16px; height: 16px; flex: none; }   /* значок в подписи галочки (замок «Только для администраторов») — не во всю ширину */

/* ---------- Карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 14px; padding-bottom: 40px; }
.letter {
  grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--faint);
  padding: 10px 2px 0; letter-spacing: .06em;
}
.card {
  position: relative; display: flex; gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s;
  animation: fade .25s ease both;
}
.card:hover { border-color: var(--accent-2); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.card.off { opacity: .5; border-style: dashed; }
.card .body { min-width: 0; flex: 1; }
.card .name { line-height: 1.25; }
.card .name .ln, .card .name .fm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .name .ln { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.card .name .fm { font-weight: 500; font-size: 14px; color: var(--text); opacity: .85; }
.card .name .badge { margin: 3px 0 0; }
.drawer h2.name2 .ln { display: block; }
.drawer h2.name2 .fm { display: block; font-size: 17px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.card .pos { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .dep { color: var(--faint); font-size: 12.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .phones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card .sel { position: absolute; top: 10px; right: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px;
  background: var(--surface-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
}
.pill:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.pill svg { width: 14px; height: 14px; color: var(--faint); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 99px; vertical-align: 2px;
  background: var(--surface-2); color: var(--muted); margin-left: 4px;
}
.badge.ad { background: var(--accent-soft); color: var(--accent); }
.badge.off { background: var(--danger-soft); color: var(--danger); }

.avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 19px; color: #fff; overflow: hidden; background: var(--accent);
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 96px; height: 96px; font-size: 32px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }

@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Таблица ---------- */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 40px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); background: var(--surface); padding: 12px 12px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none;
}
table.list th:hover { color: var(--text); }
table.list th .arr { opacity: .8; }
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover td { background: var(--surface-2); }
table.list tr.off td { opacity: .5; }
table.list .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
table.list .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list .c { width: 1%; }

/* ---------- Карта ---------- */
.mapview { padding-bottom: 40px; }
.mapbox {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.mapbox img.plan { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
:root[data-theme="dark"] .mapbox img.plan { filter: invert(.88) hue-rotate(180deg) contrast(.9); }
.pin {
  position: absolute; transform: translate(-50%, -100%); cursor: pointer; z-index: 2;
  display: flex; flex-direction: column; align-items: center; transition: transform .12s;
}
.pin:hover, .pin.hl { transform: translate(-50%, -100%) scale(1.18); z-index: 5; }
.pin .head {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface);
  overflow: hidden; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); box-shadow: var(--shadow);
}
.pin .head img { width: 100%; height: 100%; object-fit: cover; }
.pin::after { content: ""; width: 0; height: 0; border: 6px solid transparent; border-top: 8px solid var(--accent); margin-top: -1px; }
.pin.dim { opacity: .25; }
.pin.hl .head { border-color: #f59f00; box-shadow: 0 0 0 6px rgba(245, 159, 0, .3); }
.pin.hl::after { border-top-color: #f59f00; }
.tip {
  position: absolute; z-index: 10; pointer-events: none; transform: translate(-50%, calc(-100% - 50px));
  background: var(--text); color: var(--bg); padding: 7px 11px; border-radius: 9px; font-size: 13px; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.tip b { display: block; }
.mapbox.picking { cursor: crosshair; }
.mapbox.picking .pin { pointer-events: none; }

/* ---------- Боковая панель ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); z-index: 40; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(440px, 100vw);
  background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto;
  animation: slidein .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer.left {
  right: auto; left: 0;
  animation: slideinleft .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideinleft { from { transform: translateX(-40px); opacity: 0; } }
.drawer.svc-drawer { width: min(380px, 100vw); overflow-x: hidden; overflow-y: auto; }
.drawer .top.svc-top { justify-content: space-between; align-items: center; padding: 16px 16px 8px; }
.svc-top h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.svc-list { display: flex; flex-direction: column; padding: 8px 12px 24px; gap: 2px; overflow: visible; }
.svc-d-icons {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 10px; padding: 14px 10px 8px;
  overflow: visible;
}
.svc-d-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  justify-content: center;
  overflow: visible;
  gap: 12px;
}
.svc-d-icons.svc-d-grid {
  flex-wrap: wrap;
  align-items: flex-start;
  overflow: visible;
}
.svc-d-icons.svc-d-dock {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  overflow: visible;
  gap: 10px;
}
.svc-d-grid .svc-icol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 76px;
  flex: none;
}
.svc-d-grid .svc-d-pin { width: 76px; justify-content: center; }
.svc-d-pin { position: relative; display: inline-flex; flex: none; }
.svc-d-pin .svc-star {
  position: absolute; top: -8px; right: -8px; z-index: 2;
  width: 22px; height: 22px; background: var(--surface); color: var(--faint);
  box-shadow: 0 0 0 1px var(--border);
}
.svc-d-pin .svc-star.on { color: #eab308; }
.svc-row {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 14px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit;
  cursor: pointer; font: inherit; font-weight: 550; font-size: 15px; text-align: left;
  text-decoration: none !important;
}
.svc-row:hover { background: var(--surface-2); color: var(--text); }
.svc-row.on { background: var(--accent-soft); color: var(--accent); }
.svc-row svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.svc-row.on svg { color: var(--accent); }
.svc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-row .missbadge { margin-left: auto; }
.svc-row .svc-badges { margin-left: auto; }
.svc-row .lamp { margin-left: 4px; }
.svc-ico {
  position: relative; width: 46px; height: 46px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); cursor: pointer;
  text-decoration: none !important; flex: none;
}
.svc-ico svg { width: 22px; height: 22px; }
.svc-ico:hover { background: var(--surface-2); color: var(--accent); border-color: var(--accent-2); }
.svc-ico.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.svc-ico .missbadge { position: absolute; top: -5px; right: -5px; margin: 0; z-index: 3; }
.svc-badges { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.svc-ico .svc-badges {
  position: absolute; top: -5px; right: -5px; z-index: 3; margin: 0;
}
.svc-ico .svc-badges .missbadge { position: static; top: auto; right: auto; margin: 0; }
.svc-ico[data-name]::after {
  content: attr(data-name);
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: var(--text); color: var(--bg);
  padding: 5px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.2;
  opacity: 0; pointer-events: none;
  transition: opacity .12s, transform .12s;
  z-index: 6; box-shadow: var(--shadow);
}
.svc-ico:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.svc-ico.svc-mode { background: transparent; color: var(--muted); }
.svc-viewseg {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 8px 16px 20px; padding: 12px 4px 0; border-top: 1px solid var(--border);
}
.svc-viewseg > span { font-size: 13px; color: var(--muted); font-weight: 550; }
.svc-viewseg .seg { flex-wrap: wrap; }
.svc-viewacts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.svc-line { display: flex; align-items: center; gap: 2px; }
.svc-line .svc-row { flex: 1; min-width: 0; }
.svc-star {
  width: 40px; height: 40px; padding: 0; flex: none;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--faint); cursor: pointer;
}
.svc-star svg { width: 18px; height: 18px; }
.svc-star:hover { color: #eab308; background: color-mix(in srgb, #eab308 12%, transparent); }
.svc-star.on { color: #eab308; }
.svc-star.on svg { fill: currentColor; }
.svc-tbar-wrap {
  position: sticky; top: 64px; z-index: 29;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  overflow-x: hidden;
  max-width: 100%;
}
.svc-tbar-wrap > .wrap { overflow: hidden; max-width: min(1600px, 100%); }
.svc-tbar {
  display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 8px 8px 8px 10px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.svc-tbar-mid {
  display: flex; align-items: center; justify-content: center;
  min-width: 0; flex: 1 1 0;
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 6px 8px 0;
  margin: -6px -8px 0;
  gap: 2px;
}
.svc-tbar-arr {
  flex: none; width: 28px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.svc-tbar-arr svg { width: 18px; height: 18px; }
.svc-tbar-arr:hover { color: var(--text); background: var(--surface-2); }
.svc-tbar-arr[hidden] { display: none; }
.svc-tbar-cluster {
  display: flex; flex-direction: row; flex-wrap: nowrap;
  align-items: center; justify-content: center;
  justify-content: safe center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  scrollbar-width: none;
}
.svc-tbar-cluster::-webkit-scrollbar { display: none; height: 0; }
body.svc-taskbar .svc-tbar-mid {
  justify-content: flex-start;
}
body.svc-taskbar .svc-tbar-cluster {
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
body.svc-taskbar .svc-tbar-cluster::-webkit-scrollbar { display: none; height: 0; }
body.svc-taskbar .svc-tpin, body.svc-icons .svc-tpin,
body.v-desktop .svc-tpin { cursor: grab; user-select: none; }
body.svc-taskbar .svc-tpin > *, body.svc-icons .svc-tpin > *,
body.v-desktop .svc-tpin > * { -webkit-user-drag: none; }
body.svc-taskbar .svc-tpin.dragging, body.svc-icons .svc-tpin.dragging,
body.v-desktop .svc-tpin.dragging { opacity: .45; cursor: grabbing; }
.svc-tbar-pad { display: none; }
body.svc-icons .svc-tbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  min-height: 52px;
}
body.svc-icons .svc-tbar-mid {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px 0;
  margin: -6px -8px 0;
  gap: 2px;
}
body.svc-icons .svc-tbar-cluster {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
body.svc-icons .svc-tbar-cluster::-webkit-scrollbar { display: none; height: 0; }
body.svc-icons .svc-d-grid .svc-icol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  flex: none;
}
body.svc-icons .svc-tbar-pad {
  display: inline-flex;
  visibility: hidden;
  pointer-events: none;
}
.svc-tbar-lab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; color: var(--muted);
  margin-right: 4px; white-space: nowrap; flex: none;
}
.svc-tbar-lab svg { width: 14px; height: 14px; color: #eab308; fill: currentColor; }
.svc-cap { display: none; }
.svc-tbar .svc-ico,
.svc-d-icons .svc-ico {
  width: auto; min-width: 48px; height: auto; min-height: 40px;
  padding: 4px 6px 3px; border-radius: 10px;
  flex-direction: column; gap: 2px;
}
.svc-tbar .svc-ico svg,
.svc-d-icons .svc-ico svg { width: 20px; height: 20px; }
.svc-tbar .svc-cap,
.svc-d-icons .svc-cap {
  display: block;
  max-width: 72px;
  font-size: 10px; font-weight: 650; line-height: 1.15;
  color: var(--muted); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.svc-names-hover .svc-tbar .svc-cap { display: none; }
body.svc-names-hover .svc-tbar .svc-ico:not(.svc-mode) { min-height: 40px; padding: 6px 8px; }
.svc-tbar .svc-ico:hover .svc-cap,
.svc-tbar .svc-ico.on .svc-cap,
.svc-d-icons .svc-ico:hover .svc-cap,
.svc-d-icons .svc-ico.on .svc-cap { color: inherit; }
.svc-tbar .svc-ico .missbadge,
.svc-d-icons .svc-ico .missbadge {
  top: 0; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; line-height: 16px;
  box-shadow: 0 0 0 2px var(--bg);
}
.svc-tbar .svc-ico .svc-badges,
.svc-d-icons .svc-ico .svc-badges { top: 0; right: 0; }
.svc-tbar .svc-ico .svc-badges .missbadge,
.svc-d-icons .svc-ico .svc-badges .missbadge {
  position: static; top: auto; right: auto;
  min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; line-height: 16px;
  box-shadow: 0 0 0 2px var(--bg);
}
.svc-tbar .svc-ico[data-name]::after, .svc-tbar .svc-ico:hover::after,
.svc-d-icons .svc-ico[data-name]::after, .svc-d-icons .svc-ico:hover::after { content: none; display: none; }
.svc-tip {
  position: fixed; transform: translateX(-50%); z-index: 90;
  background: var(--text); color: var(--bg);
  padding: 5px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.2;
  pointer-events: none; box-shadow: var(--shadow);
}
.svc-tip[hidden] { display: none; }
.svc-tbar .svc-ico.folder { color: #d97706; }
.svc-tbar .svc-ico.rdp { color: #1f6feb; }
.svc-tbar .svc-ico.run { color: #7048e8; }
.svc-tbar .svc-ico.link { color: #2fb344; }
.svc-tbar .svc-ico.app { color: #364fc7; }
.svc-tbar .svc-ico.map { color: #0e7490; }
.svc-tpin { position: relative; flex: none; }
body.svc-taskbar .svc-tpin.fold-over > .svc-ico,
body.svc-icons .svc-tpin.fold-over > .svc-ico {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: 14px;
}
.svc-gico { padding: 3px 6px 2px !important; }
.svc-gmini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 28px; height: 28px;
  padding: 3px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  box-sizing: border-box;
}
.svc-gmini i {
  display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 0;
}
.svc-gmini svg { width: 10px; height: 10px; display: block; }
.svc-gmini .folder { color: #d97706; }
.svc-gmini .rdp { color: #1f6feb; }
.svc-gmini .run { color: #7048e8; }
.svc-gmini .link { color: #2fb344; }
.svc-gmini .app { color: #364fc7; }
.svc-gmini .map { color: #0e7490; }
.svc-fold-scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(10, 14, 22, .48);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  animation: fadein .15s;
}
.svc-fold-card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 22px;
  padding: 16px 14px 12px;
  min-width: 248px; max-width: min(360px, 92vw);
  box-shadow: var(--shadow);
}
.svc-fold-name {
  display: block; width: 100%;
  text-align: center; font-weight: 750; font-size: 16px;
  border: 0; background: transparent; color: inherit;
  margin: 0 0 12px; padding: 4px 8px;
  border-radius: 8px;
}
.svc-fold-name:focus { outline: none; background: var(--surface-2); }
.svc-fold-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 6px;
  min-height: 72px;
}
.svc-fold-cell { position: relative; display: flex; justify-content: center; }
.svc-fold-cell .svc-ico {
  width: auto; min-width: 56px; height: auto; min-height: 56px;
  padding: 4px 4px 2px; flex-direction: column; gap: 2px;
}
.svc-fold-cell .svc-ico svg { width: 26px; height: 26px; }
.svc-fold-cell .svc-cap { display: block; max-width: 64px; font-size: 10px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-fold-x {
  position: absolute; top: -4px; right: 2px;
  width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: .85;
}
.svc-fold-x svg { width: 11px; height: 11px; }
.svc-fold-x:hover { opacity: 1; }
.svc-fold-break { display: block; margin: 12px auto 0; }
.svc-fold-hint { margin: 8px 0 0; padding: 0 4px; }
.svc-tbar .svc-mode {
  flex: none; flex-direction: row;
  width: auto; min-width: 40px; height: 40px; min-height: 40px;
  padding: 0 8px; gap: 6px; overflow: visible;
}
.svc-tbar .svc-mode svg { width: 22px; height: 22px; }
.svc-tbar .svc-mode .missbadge { position: static; top: auto; right: auto; margin: 0; flex: none; }
@media (max-width: 720px) {
  .drawer.left.svc-drawer { right: 0; width: auto; }
  .svc-list { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .svc-row { height: 52px; font-size: 16px; }
  .topbar .btn.myext { flex-shrink: 0; padding: 0 8px; }
  .topbar [data-act=theme], .topbar [data-act=login] { flex-shrink: 0; }
  .svc-ico { width: 44px; height: 44px; }
  .svc-viewseg { margin-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .svc-tbar-lab span { display: none; }
  .svc-tbar { min-height: 48px; gap: 6px; }
}
.drawer .top { display: flex; justify-content: flex-end; gap: 4px; padding: 12px 12px 0; }
.drawer .head { text-align: center; padding: 4px 24px 18px; }
.drawer .head .avatar { margin: 0 auto 12px; }
.drawer h2 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.drawer .sub { color: var(--muted); margin-top: 4px; }
.drawer .actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.drawer .actions.call + .actions { margin-top: 10px; }
.drawer .actions.call .btn { min-width: 240px; justify-content: center; }
.drawer dl { margin: 0; padding: 4px 24px 8px; }
.drawer .row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.drawer .row > svg { width: 19px; height: 19px; color: var(--faint); flex: none; }
.drawer .row dt { font-size: 12px; color: var(--faint); }
.drawer .row dd { margin: 0; font-weight: 550; word-break: break-word; }
.drawer .row .grow { flex: 1; min-width: 0; }
.drawer .minimap { margin: 8px 24px 24px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); position: relative; cursor: pointer; }
.drawer .minimap img.plan { width: 100%; display: block; }
:root[data-theme="dark"] .drawer .minimap img.plan { filter: invert(.88) hue-rotate(180deg) contrast(.9); }
.drawer .admin { padding: 0 24px 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.drawer .admin .t { width: 100%; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-top: 6px; }
.drawer .admin.ntf-dest { display: block; padding-top: 8px; }
.ntf-dest-form { display: grid; gap: 8px; }
.ntf-dest-form .field { margin: 0; }
.ntf-dest-form .field label { display: flex; align-items: center; gap: 6px; }
.ntf-dest-form .field label svg { width: 16px; height: 16px; color: var(--faint); }
.ntf-dest-form input { width: 100%; }
.ntf-dest-form .ntf-chrow {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.ntf-dest-form .ntf-chsw { font-size: 13px; font-weight: 650; gap: 8px; cursor: pointer; }
.ntf-lamps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.ntf-lamp { border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.ntf-lamp.on { border-color: var(--accent); background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, var(--surface))); color: var(--accent); }
.ntf-dest-act { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
@media (max-width: 720px) {
  .ntf-dest-form { gap: 10px; }
  .ntf-dest-form input { min-height: 40px; }
}

/* ---------- Модальные окна ---------- */
body.layer-open { overflow: hidden; }
.modal, .drawer, .tk-console, .tk-thread, .tk-side, .tk-orig, .modal > .content {
  overscroll-behavior: contain;
}
.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal.wide { width: min(1100px, calc(100vw - 24px)); }
/* справочник агентов большим окном — все столбцы целиком */
.modal.agents-big { width: min(1600px, calc(100vw - 24px)); min-height: min(70vh, calc(100vh - 24px)); }
/* большое окно агентов без своей прокрутки (2.46.1): таблица по ширине окна, текст в ячейках переносится, прокручивается само окно */
.modal.agents-big .tablewrap, .modal.agents-big .tablewrap.dict { max-height: none; overflow: visible; }
.modal.agents-big table.list { width: 100%; }
.modal.agents-big table.list th { white-space: nowrap; }
.modal.agents-big table.list td, .modal.agents-big table.list td.nowrap, .modal.agents-big table.list .nowrap { white-space: normal; overflow-wrap: anywhere; }
.modal.agents-big table.list td.c { white-space: normal !important; min-width: 220px; }
#agentlist tr.agrow { cursor: pointer; }
#agentlist tr.agrow:hover td { background: rgba(37,99,235,.06); }
#agentlist tr.agrow.sel td { background: rgba(37,99,235,.13); }
.scrim.m { z-index: 50; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.modal header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal header h3 { margin: 0; font-size: 18px; flex: 1; }
.modal .content { padding: 10px 20px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; }
.modal footer .left { margin-right: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.inv-sec { grid-column: 1 / -1; font-size: 13px; font-weight: 650; color: var(--muted); margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.form .inv-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.inv-extra { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.inv-extra-row { display: grid; grid-template-columns: minmax(120px, .42fr) 1fr auto; gap: 8px; align-items: center; margin: 0; }
.inv-extra-row input { min-width: 0; }
.inv-extra-row [data-extra-del] { flex: none; height: 40px; }
@media (max-width: 560px) {
  .inv-extra-row { grid-template-columns: 1fr auto; }
  .inv-extra-n, .inv-extra-v { grid-column: 1; }
  .inv-extra-row [data-extra-del] { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
.inv-ke { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.inv-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.inv-pass { display: flex; gap: 6px; align-items: center; }
.inv-pass input { flex: 1; min-width: 0; }
.inv-agent { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.inv-askbar { flex-wrap: wrap; }
.inv-askbar [data-invask] { margin-left: auto; flex: none; }
.inv-ro a { color: var(--accent); }
.modal.inv-card > .inv-askbar { margin: 0 20px 8px; flex: none; }
.modal.inv-card > footer { flex-wrap: wrap; align-items: center; }
.modal.inv-card > footer .left { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }
.modal.inv-card > footer [data-close] { flex: none; }
.inv-table td .lamp { margin-right: 4px; vertical-align: 1px; }
.modal.inv-modal {
  width: min(1280px, calc(100vw - 16px));
  height: min(920px, calc(100vh - 16px));
  max-height: calc(100vh - 16px);
  display: flex; flex-direction: column; overflow: hidden;
}
.inv-modal > header { flex: none; }
.modal.inv-modal > .content {
  flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; padding-bottom: 16px;
}
.inv-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  margin: 0 0 10px; min-height: 28px; flex: none;
}
.inv-crumb svg { width: 15px; height: 15px; }
.inv-crumb .btn { height: 28px; padding: 0 8px; }
.inv-modal .dl-bar { flex: none; }
.inv-modal .inv-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0 0 10px;
  height: 48px;
  padding: 0 14px;
  border: 1.5px dashed var(--accent-2);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.inv-modal .inv-search svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.inv-modal .inv-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: 0;
}
.inv-modal .inv-search:focus-within,
.inv-modal .inv-search.on {
  border-color: var(--accent);
  background: var(--surface);
  border-width: 2px;
}
.inv-split {
  flex: 1 1 auto;
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(196px, 260px) 1fr;
  gap: 10px;
}
.inv-side {
  overflow: auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 6px;
}
.inv-tn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 6px 8px;
  border-radius: 7px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.inv-tn.on { background: var(--accent-soft); color: var(--accent); }
.inv-tn:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.inv-tn.dir .inv-tn-t { font-weight: 700; }
.inv-tn svg { width: 16px; height: 16px; flex: none; }
.inv-tn-ic { display: inline-flex; align-items: center; flex: none; color: #ca8a04; }
.inv-tn-ic svg { width: 16px; height: 16px; }
.inv-tn-k { font-size: 11px; color: var(--muted); flex: none; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-tn-t { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-table tr.inv-kit td { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.inv-parts { width: 100%; }
.inv-parts td, .inv-parts th { font-size: 13px; }
.field label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); margin: 0; }
.inv-modal .tk-search {
  border: 1.5px dashed var(--accent-2);
  background: var(--accent-soft);
  min-width: min(100%, 280px);
}
.inv-modal .tk-search svg { color: var(--accent); }
.inv-modal .tk-search input::placeholder { color: var(--accent); opacity: .72; }
.inv-modal .tk-search:focus-within,
.inv-modal .tk-search.on {
  border-color: var(--accent);
  background: var(--surface);
}
.inv-modal .tk-search.on { border-width: 2px; }
.inv-modal .seg {
  border: 1.5px dashed var(--accent-2);
  background: var(--accent-soft);
}
.inv-modal .seg button.on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}
.inv-bulk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); flex: none;
}
.inv-bulk[hidden] { display: none; }
.inv-bulk b { font-size: 13px; }
.inv-bulk select {
  height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 13px;
}
.inv-ckh { width: 36px; text-align: center; }
.inv-ckh input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.inv-table tr.on td { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.inv-table tr.inv-dir td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.inv-table tr.inv-dir.on td { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.inv-table tr.inv-nest td:nth-child(2) { padding-left: 12px; }
.inv-tree { display: inline-flex; align-items: stretch; gap: 2px; max-width: 100%; }
.inv-tree .inv-t { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inv-tree .inv-tn-ic { flex: none; align-self: center; }
.inv-tree-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.inv-g {
  flex: none;
  width: 14px;
  position: relative;
  align-self: stretch;
  min-height: 1.15em;
  pointer-events: none;
  --inv-elbow: 50%;
  --inv-line: color-mix(in srgb, var(--muted) 80%, var(--accent));
}
.inv-tree .inv-g { --inv-elbow: 11px; }
.inv-g.cont::before,
.inv-g.mid::before,
.inv-g.end::before,
.inv-g.mid::after,
.inv-g.end::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.inv-g.cont::before,
.inv-g.mid::before {
  left: 6px; top: 0; bottom: 0;
  border-left: 1px dashed var(--inv-line);
}
.inv-g.end::before {
  left: 6px; top: 0; height: var(--inv-elbow);
  border-left: 1px dashed var(--inv-line);
}
.inv-g.mid::after,
.inv-g.end::after {
  left: 6px; top: var(--inv-elbow); width: 8px;
  border-top: 1px dashed var(--inv-line);
}
.inv-table tr[draggable="true"],
.inv-table td[draggable="true"] { cursor: grab; user-select: none; -webkit-user-select: none; }
.inv-table tr.dragging { opacity: .4; }
.inv-tn[draggable="true"] { cursor: grab; user-select: none; -webkit-user-select: none; }
.inv-tn.dragging { opacity: .4; }
.inv-table a, .inv-table img { -webkit-user-drag: none; }
.inv-pre { white-space: pre-wrap; word-break: break-word; }
.inv-dragging .inv-table tr[data-inv], .inv-dragging [data-invdrop] {
  outline: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: -2px;
}
.inv-table tr.drop-on td, .inv-tn.drop-on, .inv-side.drop-on, .inv-crumb.drop-on, .inv-crumb .drop-on {
  background: var(--accent-soft);
  outline: 2px solid var(--accent);
}
.inv-kid {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 6px 0; cursor: pointer; color: var(--accent); font: inherit;
}
.inv-kid:hover { text-decoration: underline; }
.modal.inv-qr-dlg { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.modal.inv-qr-dlg > .content { overflow: auto; }
.inv-hist { margin-top: 12px; }
.inv-hist > summary.inv-hist-sum {
  cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
}
.inv-hist > summary.inv-hist-sum::-webkit-details-marker { display: none; }
.inv-hist > summary.inv-hist-sum::before { content: '▸'; display: inline-block; width: 1em; color: var(--muted); }
.inv-hist[open] > summary.inv-hist-sum::before { content: '▾'; }
.inv-hist-prev { flex: 1 1 10em; font-weight: 450; text-transform: none; letter-spacing: 0; }
.inv-hist-body { padding-top: 4px; }
.inv-hist-line, .inv-hist-act {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 7px 0; border-bottom: 1px solid var(--border); font: inherit; color: inherit;
}
.inv-hist-act { cursor: pointer; color: var(--accent); }
.inv-hist-act:hover { background: var(--accent-soft); }
.inv-photos { margin-top: 12px; }
.inv-photos .tk-bh svg { width: 14px; height: 14px; vertical-align: -2px; }
.inv-photos .inv-ph-add label.btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px; padding: 0; }
.inv-photos .inv-ph-add label.btn svg { width: 18px; height: 18px; }
.inv-ph-grid {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 8px; margin: 8px 0;
}
.inv-ph { position: relative; margin: 0; width: 72px; flex: none; }
.inv-ph-open {
  display: block; width: 72px; height: 72px; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--radius-sm); overflow: hidden; position: relative;
}
.inv-ph-open img { width: 72px; height: 72px; max-width: 72px; max-height: 72px; object-fit: cover; display: block; background: var(--surface-2); }
.inv-ph-kind {
  position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
}
.inv-ph-kind.now { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.inv-ph figcaption {
  font-size: 11px; line-height: 1.25; margin-top: 3px; color: var(--text);
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-ph-del { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.inv-ph-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.inv-ph-add select, .inv-ph-add input[name=phcap] { font: inherit; }
.inv-ph-add input[name=phcap] { flex: 1 1 8em; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.inv-ph-add select { flex: none; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.inv-ph-add .btn { flex: none; position: relative; overflow: hidden; }
.inv-ph-add input[type=file] { display: none; }
.modal.inv-act-dlg, .modal.inv-act-form { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.modal.inv-act-dlg > .content, .modal.inv-act-form > .content { overflow: auto; }
.inv-act-sheet h3 { margin: 4px 0 0; text-align: center; }
.inv-act-org { text-align: center; font-weight: 700; }
.inv-act-who {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
  margin: 12px 0;
}
.inv-act-who label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.inv-act-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 28px 0 8px; }
.inv-act-line { border-bottom: 1px solid var(--text); height: 36px; margin: 6px 0 4px; }
.inv-qr-sheet { display: flex; flex-direction: column; gap: 12px; }
.inv-qr-lab {
  display: flex; gap: 14px; align-items: center;
  padding: 10px 12px; border: 1px dashed var(--accent-2); border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.inv-qr-lab svg { width: 148px; height: 148px; background: #fff; border-radius: 6px; flex: none; }
.inv-qr-no { font-weight: 700; font-size: 18px; }
.inv-ke.folder {
  display: inline-flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, #ca8a04 18%, var(--surface-2)); color: #a16207;
}
:root[data-theme="dark"] .inv-ke.folder { color: #fbbf24; background: color-mix(in srgb, #ca8a04 22%, var(--surface-2)); }
.inv-ke.folder svg { width: 13px; height: 13px; }
.inv-open {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0;
  font: inherit; font-weight: 650; color: var(--accent); cursor: pointer;
}
.inv-open svg { width: 16px; height: 16px; }
.inv-open:hover { text-decoration: underline; }
.inv-modal #invhint { margin: 0 0 8px; flex: none; }
.inv-modal #invlist { min-height: 220px; display: block; overflow: auto; }
.inv-modal #invlist .tablewrap { overflow: auto; max-height: none; margin-bottom: 0; }
.inv-modal #invlist .empty { min-height: 160px; }
.modal.inv-pick { height: min(720px, calc(100vh - 24px)); }
.inv-pick > footer { flex: none; }
.inv-agbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); flex: none;
}
.inv-agbar b { font-size: 13px; }
.inv-agbar .tk-search { flex: 1; min-width: min(100%, 220px); }
.inv-pick #invaghint { margin: 0 0 8px; flex: none; }
.inv-pick #invaglist { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.inv-pick #invaglist .tablewrap { flex: 1; overflow: auto; max-height: none; margin-bottom: 0; }
.inv-pick #invaglist .empty { flex: 1; }
.inv-pick tr[data-ag] { cursor: pointer; }
.inv-filters { flex: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; max-width: 100%; }
.inv-flt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0; max-width: 100%;
}
.inv-flt-main { row-gap: 8px; }
.inv-flt-more {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.inv-flt label { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; color: var(--text); white-space: nowrap; flex: none; }
.inv-flt input, .inv-flt select {
  height: 32px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font: inherit;
}
.inv-range { gap: 6px; }
.inv-range input { width: 64px; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 8px 0 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit; font-size: 12.5px; font-weight: 650;
  cursor: pointer;
}
.inv-chip:hover { background: var(--accent); color: #fff; }
.inv-chip span { font-weight: 700; line-height: 1; }
[data-invmore].on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.inv-flt input[id=invbrand] { width: 140px; }
.inv-flt input[id=invos] { width: 110px; }
.inv-flt input[id=invnet] { width: 128px; }
.inv-flt input[id=invmodel],
.inv-flt input[id=invplace],
.inv-flt input[id=invperson],
.inv-flt input[id=invhost] { width: 124px; }
.inv-flt input[id=invserial],
.inv-flt input[id=invcpu],
.inv-flt input[id=invdisk] { width: 108px; }
.inv-flt input[type=checkbox] { width: 16px; height: 16px; padding: 0; }
.inv-pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 0 0; flex: none;
}
.inv-ifaces { display: flex; flex-direction: column; gap: 6px; }
.inv-iface {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2);
}
.inv-iface .inv-mono { font-weight: 650; }
.inv-table tr.inv-lo td { box-shadow: inset 4px 0 0 #dc2626; background: color-mix(in srgb, #dc2626 10%, var(--surface)); }
.inv-table tr.inv-hi td { box-shadow: inset 4px 0 0 #16a34a; background: color-mix(in srgb, #16a34a 10%, var(--surface)); }
.inv-table tr.inv-eq td { box-shadow: inset 4px 0 0 #ca8a04; background: color-mix(in srgb, #ca8a04 10%, var(--surface)); }
.inv-table tr.inv-lo.on td, .inv-table tr.inv-hi.on td, .inv-table tr.inv-eq.on td { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.inv-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inv-sheet-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: var(--surface); cursor: pointer;
}
.inv-sheet-card:hover { border-color: var(--accent); }
.inv-sheet-top { display: flex; gap: 8px; align-items: center; }
.inv-sheet-card h4 { margin: 4px 0 6px; font-size: 15px; }
.inv-sheet-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.modal.inv-pretty, .modal.inv-rep {
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: flex; flex-direction: column;
}
.modal.inv-pretty > .content, .modal.inv-rep > .content { overflow: auto; }
.inv-ro {
  min-height: 40px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); word-break: break-word;
}
.inv-ro .inv-pass { min-height: 0; }
.inv-ro .inv-pass input { border: 0; background: transparent; padding: 0; }
a.inv-mgmt { color: var(--accent); word-break: break-all; }
.inv-table td.inv-fio, .inv-table td.inv-place { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.inv-table td.inv-fio a.person, .inv-ro a.person, .inv-sheet-meta a.person {
  color: var(--accent); text-decoration: none; font-weight: 650;
}
.inv-table td.inv-fio a.person:hover, .inv-ro a.person:hover, .inv-sheet-meta a.person:hover { text-decoration: underline; }
.inv-fn { display: flex; flex-direction: column; line-height: 1.25; white-space: normal; }
.inv-fn .ln { font-weight: 650; white-space: normal; overflow: visible; text-overflow: unset; }
.inv-fn .fm { font-weight: 450; font-size: 13px; color: var(--muted); white-space: normal; overflow: visible; text-overflow: unset; }
.inv-qrbox {
  display: flex; gap: 14px; align-items: center;
  margin: 0 0 14px; padding: 10px 12px;
  border: 1px dashed var(--accent-2); border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.inv-qrbox img { width: 132px; height: 132px; background: #fff; border-radius: 6px; flex: none; }
.inv-qrbox .inv-mono { margin: 6px 0; }
.modal.inv-card { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.modal.inv-card > .content { overflow: auto; }
@media (max-width: 720px) {
  .inv-pass { flex-wrap: wrap; }
  .modal.inv-modal { width: calc(100vw - 12px); height: calc(100dvh - 16px); max-height: calc(100dvh - 12px); }
  .inv-modal .dl-bar .seg { max-width: 100%; overflow-x: auto; }
  .inv-split { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 28vh) 1fr; }
  .inv-side { max-height: 28vh; }
  .inv-table tr.inv-nest td:nth-child(2) { padding-left: 10px; }
  .inv-sheet { grid-template-columns: 1fr; }
  .modal.inv-pretty, .modal.inv-rep { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .inv-flt input[id=invbrand] { width: 110px; }
  .inv-qr-lab { flex-wrap: wrap; }
  .inv-qr-lab svg { width: 120px; height: 120px; }
  .modal.inv-qr-dlg { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .inv-act-who, .inv-act-sign { grid-template-columns: 1fr; }
  .modal.inv-act-dlg, .modal.inv-act-form { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .inv-pick .inv-ckh input, .inv-modal .inv-ckh input { width: 22px; height: 22px; }
  .inv-pick tr[data-ag] td { min-height: 44px; }
  .inv-agbar { padding: 10px; }
  .inv-qrbox { flex-wrap: wrap; }
  .inv-qrbox img { width: 120px; height: 120px; }
  .modal.inv-card { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .inv-table td.inv-fio, .inv-table td.inv-place, .inv-table td.nowrap { white-space: normal; overflow-wrap: anywhere; }
  .inv-table td.inv-fio { min-width: 8em; }
  .inv-ro a.person, .inv-fn { white-space: normal; }
}
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); outline: 0; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: 76px; padding: 9px 12px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.field.need label { color: var(--danger); }
.field.need input, .field.need textarea, .field.need select,
input.need, textarea.need, select.need {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft) !important;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.field.need input:focus, .field.need textarea:focus, .field.need select:focus,
input.need:focus, textarea.need:focus, select.need:focus {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft) !important;
}
.note-card.need { outline: 2px solid var(--danger); outline-offset: 2px; box-shadow: 0 0 0 3px var(--danger-soft); }
.note-big.need, .tk-edit.need { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.tk-compose.need, .tk-compose.need:focus-within { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.tk-ren-in.need { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 12px; }
.err { color: var(--danger); font-size: 13.5px; min-height: 18px; margin-top: 8px; }

/* ---------- Пусто / загрузка ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.skeleton { height: 112px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Тосты и меню ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; left: auto; transform: none; z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toasts .toast { pointer-events: auto; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop2 .2s ease; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } }
.menuwrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 35; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px;
  text-align: left; cursor: pointer; font-size: 14px;
}
.menu button:hover { background: var(--surface-2); }
.menu button svg { width: 17px; height: 17px; color: var(--faint); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.menu .cap { padding: 6px 10px 4px; font-size: 12px; color: var(--faint); }

footer.foot { color: var(--faint); font-size: 12.5px; text-align: center; padding: 10px 0 30px; }

@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  .brand .title { display: none; }
  .brand .logo { height: 34px; width: 34px; }
  .search input { height: 52px; font-size: 16px; }
  .search kbd { display: none; }
  .seg button span { display: none; }
  .form { grid-template-columns: 1fr; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  table.list .hide-m { display: none; }
}

/* ---------- Настройки ---------- */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 22px; min-height: 460px; padding-bottom: 22px; }
.tabs { display: flex; flex-direction: column; gap: 3px; }
.tabs button {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 9px; background: none;
  cursor: pointer; text-align: left; font-weight: 550; color: var(--muted);
}
.tabs button svg { width: 18px; height: 18px; flex: none; }
.tabs button:hover { background: var(--surface-2); color: var(--text); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); }
.pane { min-width: 0; }
.pane h4 { margin: 2px 0 8px; font-size: 16px; }
.muted { color: var(--muted); }
p.muted { font-size: 13.5px; margin: 0 0 12px; }
code { font: 12.5px ui-monospace, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.ok-msg { color: var(--ok); font-size: 13.5px; min-height: 18px; margin-top: 6px; }
form.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
form.inline .field { min-width: 180px; }
form.inline .field.grow { flex: 1; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { display: none; }
.switch span { width: 40px; height: 23px; border-radius: 99px; background: var(--border); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }
.seg.big { margin-bottom: 8px; }
.seg.big button { height: 38px; padding: 0 14px; font-size: 14px; }
.check.full { grid-column: 1 / -1; }
.maps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mapcard { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.mapcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mc-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.mc-name { border: 1px solid transparent; border-radius: 7px; padding: 4px 6px; margin: -4px -6px 0; font-weight: 650; background: none; outline: 0; }
.mc-name:hover, .mc-name:focus { border-color: var(--border); background: var(--surface); }
.mc-actions { display: flex; gap: 4px; }
.mc-actions .danger { margin-left: auto; }
.mapcard.add { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 230px; border-style: dashed; cursor: pointer; color: var(--muted); font-weight: 600; }
.mapcard.add svg { width: 28px; height: 28px; }
.mapcard.add:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) {
  .settings { grid-template-columns: 1fr; }
  /* телефон: все вкладки видны сразу плитками (раньше — одна строка с прокруткой вбок, открытая вкладка уезжала за край) */
  .tabs { flex-direction: row; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .tabs button { flex: 1 1 calc(50% - 6px); min-width: 0; gap: 7px; padding: 8px 10px; font-size: 13.5px; background: var(--surface-2); }
  .tabs button span { white-space: normal; line-height: 1.2; text-align: left; }
  .tabs button svg { width: 16px; height: 16px; }
}
.drop {
  display: flex; align-items: center; gap: 10px; justify-content: center; padding: 22px; margin-bottom: 12px;
  border: 1.5px dashed var(--border); border-radius: 12px; cursor: pointer; color: var(--muted); font-weight: 550; text-align: center;
}
.drop svg { width: 22px; height: 22px; transform: rotate(180deg); }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; font-size: 14px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 11px; font-size: 13px; color: var(--muted); }
.stat b { display: block; font-size: 18px; color: var(--text); }
.stat.ok b { color: var(--ok); }
.stat.off b { color: var(--danger); }
footer.foot b { color: var(--muted); }

/* ---------- Перетаскивание на плане ---------- */
.mapwrap { display: grid; grid-template-columns: 1fr 270px; gap: 14px; align-items: start; }
.mapbox.editable .pin { cursor: grab; touch-action: none; }
.mapbox.drop-ok { outline: 3px dashed var(--accent); outline-offset: 3px; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
body.dragging .mapbox .pin { pointer-events: none; }
.pin.ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -100%) scale(1.2); }
.pin.ghost .ghost-name {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
}
#floors button.hover { background: var(--accent); color: #fff; }
.unplaced {
  position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 100px);
}
.unplaced.drop-ok { outline: 3px dashed var(--danger); outline-offset: 2px; }
.up-head { padding: 12px 14px 4px; font-weight: 650; }
.up-hint { padding: 0 14px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.up-list { overflow-y: auto; padding: 6px; }
.up-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 9px; cursor: grab; touch-action: none; }
.up-item:hover { background: var(--surface-2); }
.up-item b { display: block; font-size: 13.5px; font-weight: 600; }
.up-item span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
@media (max-width: 900px) {
  .mapwrap { grid-template-columns: 1fr; }
  .unplaced { position: static; max-height: 320px; }
}

/* ---------- Выпадающие списки и дубли ---------- */
.combo { position: relative; }
.combo input { padding-right: 34px; }
.combo-arrow { position: absolute; right: 8px; bottom: 9px; width: 22px; height: 22px; color: var(--faint); cursor: pointer; }
.combo-arrow svg { width: 22px; height: 22px; }
.combo-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.combo-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.combo-item span { color: var(--faint); font-size: 12px; }
.combo-item:hover, .combo-item.on { background: var(--accent-soft); color: var(--accent); }
.combo-new { display: flex; align-items: center; gap: 6px; padding: 7px 9px; font-size: 13px; color: var(--muted); }
.combo-new svg { width: 15px; height: 15px; }
.dupes { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.dupes > b { display: flex; align-items: center; gap: 7px; color: var(--danger); margin-bottom: 6px; font-size: 14px; }
.dupes > b svg { width: 18px; height: 18px; }
.dupe { font-size: 14px; padding: 3px 0; }
.dupe a { font-weight: 600; }
.tablewrap.dict { max-height: 420px; overflow-y: auto; }
.dname { width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 5px 7px; background: none; outline: 0; }
.dname:hover, .dname:focus { border-color: var(--border); background: var(--surface); }

/* ---------- Копирование контакта ---------- */
.cc {
  width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--muted); cursor: pointer; transition: background .12s, color .12s, border-color .12s; flex: none;
}
.cc svg { width: 16px; height: 16px; }
.cc:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-2); }
.card .cc { position: absolute; top: 12px; right: 12px; }
.card .name { padding-right: 34px; }
table.list td.cc-cell { width: 1%; padding-right: 10px; }
[data-copycontact-dbl] { cursor: pointer; }

/* ---------- Две строки панели и выбор ---------- */
.toolbar { flex-direction: column; align-items: stretch; }
.toolbar .chips { flex: 0 1 auto; flex-wrap: wrap; overflow: visible; display: flex; gap: 7px; }
.toolbar .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .tools .spacer { flex: 1; }
.toolbar .tools .btn.on { background: var(--accent-soft); border-color: var(--accent-2); color: var(--accent); }
.mapview .toolbar { flex-direction: row; align-items: center; }
.selbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent-2); animation: fade .2s ease;
}
.selbar .spacer { flex: 1; }
.selbar a.btn { text-decoration: none; }
.card .ck { position: absolute; top: 10px; left: 10px; z-index: 2; opacity: 0; transition: opacity .12s; }
.card .ck input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.card:hover .ck, body.selecting .card .ck { opacity: 1; }
@media (hover: none) { .card .ck { opacity: 1; } }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.up-search { display: flex; align-items: center; gap: 6px; margin: 8px 10px 2px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.up-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.up-search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.up-search input { flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: none; font-size: 13.5px; }

/* ---------- Филиалы ---------- */
.toolbar.sites { padding-bottom: 8px; }
#sites button svg { width: 15px; height: 15px; }
.site-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--muted); font-size: 14px; }
.site-name svg { width: 17px; height: 17px; }
.site-group { margin-bottom: 18px; }
.site-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.site-head > svg { width: 19px; height: 19px; color: var(--accent); flex: none; }
.site-name-in { font-size: 15px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; background: none; outline: 0; min-width: 0; width: min(420px, 100%); }
.site-name-in:hover, .site-name-in:focus { border-color: var(--border); background: var(--surface); }
.pen { width: 15px; height: 15px; color: var(--faint); flex: none; }
.mc-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-top: 2px; }
.mc-line { display: flex; align-items: center; gap: 4px; }
.mc-line .mc-name { flex: 1; margin: 0; }
.mc-name, .mc-site { border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; font-weight: 600; background: var(--surface); outline: 0; width: 100%; }
.mc-site { font-weight: 500; font-size: 13px; }
.mc-name:focus, .mc-site:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mapcard.add small { font-weight: 500; }
.newsite { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Компактный фильтр отделов ---------- */
.tools .btn .caret { font-size: 11px; opacity: .6; margin-left: -2px; }
.tools .btn .badge { margin-left: 0; }
.depmenu { left: 0; right: auto; width: 400px; max-width: calc(100vw - 30px); padding: 0; display: flex; flex-direction: column; max-height: 70vh; }
.dm-search { display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dm-search svg { width: 16px; height: 16px; color: var(--faint); }
.dm-search input { flex: 1; border: 0; outline: 0; background: none; font-size: 14px; }
.dm-list { overflow-y: auto; padding: 4px; }
.dm-item { display: flex; align-items: center; border-radius: 8px; }
.dm-item:hover, .dm-item.on { background: var(--surface-2); }
.dm-item.on .dm-name { color: var(--accent); font-weight: 650; }
.menu .dm-name { flex: 1; display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.dm-name span { color: var(--faint); font-size: 12.5px; }
.menu .dm-pin { width: 34px; justify-content: center; padding: 6px; opacity: .25; filter: grayscale(1); }
.menu .dm-pin.pinned { opacity: 1; filter: none; }
.menu .dm-pin:hover { opacity: .8; filter: none; }
.dm-foot { display: flex; gap: 2px; padding: 6px; border-top: 1px solid var(--border); }
.menu .dm-foot button { width: auto; flex: 1; justify-content: center; font-size: 12.5px; padding: 7px 6px; color: var(--muted); }
.menu .dm-foot button svg { width: 14px; height: 14px; }

.menu .dm-foot button { white-space: nowrap; }
.card .pos { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dupes.soft { background: var(--accent-soft); border-color: var(--accent-2); }
.dupes.soft > b { color: var(--accent); }

table.list .who .nm { display: flex; flex-direction: column; line-height: 1.25; }
table.list .who .nm .ln { font-weight: 650; white-space: nowrap; }
table.list .who .nm .fm { font-weight: 450; font-size: 13px; color: var(--muted); white-space: nowrap; }
table.list .who .nm .badge { align-self: flex-start; margin: 2px 0 0; }

/* ---------- Таблица помещается по ширине ---------- */
table.list { table-layout: auto; }
table.list .who { min-width: 0; }
table.list .who .nm { max-width: clamp(160px, 17vw, 280px); min-width: 0; }
table.list .who .nm .ln, table.list .who .nm .fm { overflow: hidden; text-overflow: ellipsis; }
table.list td.num { line-height: 1.5; }
table.list td.col-pos { min-width: 130px; max-width: 220px; }
table.list td.col-dep { min-width: 130px; max-width: 200px; }
table.list td.col-dep .sub { font-size: 12.5px; color: var(--muted); }
table.list td.col-mail { max-width: 220px; overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  table.list td.col-pos, table.list td.col-dep { min-width: 110px; }
  table.list td { padding: 8px 8px; }
}

table.list td.num { width: 1%; white-space: nowrap; }
table.list td.num .ph { line-height: 1.45; }
table.list td.num .ph-note { display: block; white-space: normal; font-size: 11.5px; color: var(--muted); line-height: 1.2; max-width: 130px; }
table.list td.col-pos, table.list td.col-dep { max-width: none; }
table.list td.col-mail { min-width: 170px; max-width: 280px; overflow-wrap: anywhere; }
@media (max-width: 1100px) { table.list td.col-mail { min-width: 140px; } table.list td.col-pos, table.list td.col-dep { min-width: 100px; } }
@media (max-width: 1100px) { table.list .hide-t { display: none; } }
table.list td.num .ph-note.warn { color: var(--danger); }
.pane h5 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.form.three { grid-template-columns: repeat(3, 1fr); }
.field select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
@media (max-width: 720px) { .form.three { grid-template-columns: 1fr; } }
/* ---------- Почта в карточке, телефония ---------- */
.card .cmail { margin-top: 7px; font-size: 13px; min-width: 0; }
.card .cmail .mail-copy { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: var(--accent); }
.card .cmail .mail-copy span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cmail svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.btn.myext small { font-size: 10.5px; color: var(--ok); font-weight: 600; margin-left: 3px; }
.callnums { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.callnums .btn { justify-content: flex-start; height: 44px; font-size: 15px; }
.callnums .btn .muted { font-size: 12.5px; font-weight: 500; margin-left: auto; }
.callnums .btn.primary .muted { color: rgba(255,255,255,.8); }
.hello-wrap { display: flex; justify-content: center; min-width: 0; }
.hello { font-size: 16px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; letter-spacing: -.01em; }
.lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; box-shadow: 0 0 0 2px var(--surface-2); }
.lamp.on { background: #2fb344; box-shadow: 0 0 0 3px rgba(47, 179, 68, .25); animation: lamp 2.4s ease-in-out infinite; }
@keyframes lamp { 50% { box-shadow: 0 0 0 5px rgba(47, 179, 68, .08); } }
@media (max-width: 720px) { .hello { display: none; } }

/* ---------- Номер копируется, звонок — по трубке ---------- */
.pill { gap: 2px; padding: 0 9px 0 5px; cursor: default; }
.pill:hover { background: var(--surface-2); color: var(--text); }
.callbtn {
  width: 26px; height: 26px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; flex: none;
  background: transparent; color: var(--ok); cursor: pointer; transition: background .12s, color .12s;
}
.callbtn svg { width: 15px; height: 15px; }
.callbtn:hover { background: var(--ok); color: #fff; }
.num-copy { cursor: copy; border-radius: 5px; padding: 1px 3px; }
.num-copy:hover { background: var(--accent-soft); color: var(--accent); }
.pill .pill-tag { font-style: normal; font-size: 11px; color: var(--faint); margin-left: 3px; font-weight: 500; }
table.list td.num .ph { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
table.list td.num .ph .ph-note { flex-basis: 100%; padding-left: 28px; }
.drow-num { display: flex; align-items: center; gap: 4px; }
.drow-num .num-copy { font-weight: 550; }
.pill .callbtn svg, .callbtn svg { color: var(--ok); }
.callbtn { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.callbtn:hover svg { color: #fff; }
.callstat { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-top: 6px; }
.callstat .muted { font-weight: 500; margin-left: auto; }
.spin { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.check.redial { align-items: flex-start; font-size: 13.5px; margin: 6px 0 4px; line-height: 1.35; }
.check.redial input { margin-top: 2px; }
.calllog { font-size: 13px; margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }

.mail-copy { color: var(--accent); }
.topbar .btn.support { white-space: nowrap; }
@media (max-width: 720px) { .topbar .btn.support span:not(.missbadge) { display: none; } }
.callnums .btn .dial-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ok); color: #fff; margin: 0 -8px 0 10px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.callnums .btn .dial-ic svg { width: 17px; height: 17px; color: #fff; }
.callnums .btn:hover .dial-ic { transform: scale(1.08); }
.callnums .btn:disabled .dial-ic { opacity: .5; }
.btn.myext { gap: 6px; }
.btn.myext .myname { font-weight: 500; color: var(--muted); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) { .btn.myext .myname { display: none; } }

/* ---------- Мои звонки (2.12.0) ---------- */
.missbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.missbadge.tk-b-new { background: var(--danger); }
.missbadge.tk-b-work { background: #16a34a; }
.mycalls .mc-top { margin-bottom: 10px; }
.mycalls .mc-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.mycalls .mc-bar .seg button { height: 32px; padding: 0 12px; }
.mycalls h3 svg, .modal header h3 svg { width: 18px; height: 18px; vertical-align: -3px; }
.calls { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.call { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); }
.call:first-child { border-top: 0; }
.call .ci { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.call .ci svg { width: 17px; height: 17px; }
.call.miss .ci { background: var(--danger-soft); color: var(--danger); }
.call.in .ci { color: var(--ok); }
.call.out .ci { color: var(--accent); }
.call.new { background: color-mix(in srgb, var(--danger) 5%, transparent); }
.call .cw .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.call .cw .badge { margin-left: 6px; vertical-align: 1px; }
.call .sm { font-size: 12.5px; margin-top: 2px; }
.call .ct { text-align: right; white-space: nowrap; font-size: 13.5px; }
.call .ca { display: flex; gap: 4px; }
.call .callbtn { color: var(--ok); }
.call .callbtn svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .call { grid-template-columns: 30px 1fr auto; } .call .ct { grid-column: 2; text-align: left; } .call .ca { grid-row: 1 / span 2; grid-column: 3; } }
.note.agenttop { margin-bottom: 18px; }
.note.agenttop h4 svg { width: 18px; height: 18px; vertical-align: -3px; }
.note.agenttop p { margin: 6px 0 12px; }

/* ---------- Заявки в техподдержку ---------- */
.tkbtn { white-space: nowrap; }
@media (max-width: 900px) { .tkbtn span:not(.missbadge) { display: none; } }
.support-dlg { display: grid; gap: 14px; padding-bottom: 20px !important; }
.sp-who { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; font-size: 13.5px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--muted); }
.sp-who svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent); }
.sp-who b { color: var(--text); }
.sp-who.warn { background: var(--danger-soft); color: var(--danger); }
.sp-who.warn svg { color: var(--danger); }
.sp-who > span { flex: 1; min-width: 0; }
.ring.acc { border-left: 4px solid #f76707; }
/* Заметки-стикеры */
.notes-layer header { flex-wrap: wrap; }
.note-views { display: flex; flex-wrap: wrap; gap: 4px; }
.note-views .btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.notes-grid.view-list { grid-template-columns: 1fr; }
.notes-grid.view-list .note-card { min-height: 0; }
.notes-grid.view-list .note-edit { min-height: 72px; }
.note-card { display: flex; flex-direction: column; border-radius: 10px; padding: 8px; min-height: 170px; box-shadow: 0 2px 6px rgba(0,0,0,.08); color: #1f2430; }
.note-card .note-edit { flex: 1; min-height: 120px; border: 0; background: transparent; font: inherit; font-size: 14px; line-height: 1.45; color: inherit; outline: none; padding: 6px 8px 6px 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.note-edit.is-empty:before { content: 'Запишите…'; color: #6b7280; pointer-events: none; }
.note-card .note-body { flex: 1 1 auto; }
.note-card.dragging { opacity: .5; }
.note-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; padding: 2px 0 0; background: transparent; }
.note-foot .note-time { flex: 1; text-align: right; color: #4b5563; font-size: 11.5px; white-space: nowrap; }
.note-foot .btn { color: #1f2430; background: transparent; border-color: transparent; }
.note-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; }
.note-acts .btn { background: transparent; border-color: transparent; color: #1f2430; }
.note-acts .btn:hover { background: rgba(255,255,255,.45); }
.note-share-n { font-style: normal; font-weight: 650; margin-left: 3px; }
.note-share-list { max-height: 48vh; overflow: auto; margin-top: 8px; }
.note-share-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border); color: var(--text); background: var(--surface); }
.note-share-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.note-share-who span { display: flex; flex-direction: column; min-width: 0; }
.note-share-who b { font-weight: 650; }
.note-share-who small { color: var(--muted); font-size: 12px; }
.note-share-edit { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.note-share-save { margin-top: 12px; text-align: right; }
.note-big-wrap { display: flex; flex-direction: column; min-height: 55vh; }
.note-fmt { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.note-fmt button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text); font: inherit; font-size: 13.5px; }
.note-fmt button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.note-big { width: 100%; flex: 1; min-height: 50vh; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 14px 28px; font: 15px/1.6 inherit; color: var(--text); background: var(--surface); outline: none; overflow-wrap: anywhere; }
.note-big.is-empty:before { content: 'Запишите…'; color: var(--muted); pointer-events: none; }
.note-cal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.note-cal-h > div { text-align: center; }
.note-cal-wd, .note-cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.note-cal-wd { color: var(--muted); font-size: 12px; text-align: center; margin-bottom: 4px; }
.note-day { min-height: 78px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: var(--surface); }
.note-day.pad { border-color: transparent; background: transparent; }
.note-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.note-dn { font-size: 12px; color: var(--muted); }
.note-chip { display: flex; align-items: center; gap: 4px; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 3px 6px 3px 8px; margin-top: 3px; font-size: 12px; line-height: 1.3; cursor: pointer; color: #1f2430; overflow: hidden; }
.note-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-chip[draggable="true"] { cursor: grab; }
.note-chip.dragging { opacity: .45; }
.note-day.drop { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.cal-star { font-style: normal; color: #e0a106; flex: none; line-height: 1; }
.note-chip.dl-exp { background: #ffd0d0; }
.note-chip.dl-hot { background: #ffe0c2; }
.note-chip.dl-warm { background: #fff3bf; }
.note-chip.dl-ok { background: #e7eefc; }
.note-chip.dl-tk { background: #d8f5d0; }
.note-chip.dl-done { background: #e9ecef; color: #4b5563; }
.note-chip.c-yellow { background: #fff3a8; } .note-chip.c-green { background: #c9f2c7; } .note-chip.c-blue { background: #cfe8ff; }
.note-chip.c-pink { background: #ffd6e2; } .note-chip.c-purple { background: #e4d9ff; } .note-chip.c-gray { background: #e5e7eb; }
.note-colors { display: flex; gap: 3px; }
.nc { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); padding: 0; cursor: pointer; }
.nc.on { outline: 2px solid #111827; outline-offset: 2px; }
.note-card.c-yellow { background: #fff3a8; } .note-card.c-green { background: #c9f2c7; } .note-card.c-blue { background: #cfe8ff; }
.note-card.c-pink { background: #ffd6e2; } .note-card.c-purple { background: #e4d9ff; } .note-card.c-gray { background: #e5e7eb; }
.nc.c-yellow { background: #f5d90a; } .nc.c-green { background: #37b24d; } .nc.c-blue { background: #1c7ed6; }
.nc.c-pink { background: #e64980; } .nc.c-purple { background: #7048e8; } .nc.c-gray { background: #868e96; }
.ring.acc .acc-btns { display: flex; gap: 8px; margin-top: 8px; }
.sp-who .sp-rdbox { flex: 1; align-self: center; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.sp-who .btn.sp-rd { flex: none; align-self: center; background: #f76707; border-color: #f76707; color: #fff; font-weight: 600; white-space: nowrap; text-decoration: none; }
.sp-who .btn.sp-rd svg { color: #fff; margin: 0; }
.sp-who .btn.sp-rd:hover { background: #e8590c; border-color: #e8590c; }
.sp-who .btn.sp-ag { flex: none; align-self: center; background: #1c7ed6; border-color: #1c7ed6; color: #fff; font-weight: 600; white-space: nowrap; text-decoration: none; }
.sp-who .btn.sp-ag svg { color: #fff; margin: 0; }
.sp-who .btn.sp-ag:hover { background: #1864ab; border-color: #1864ab; color: #fff; }
.sp-who .btn.sp-ag span { font-variant-numeric: tabular-nums; }
.sp-who .btn.sp-ag7 { flex: none; align-self: center; height: 32px; padding: 0 8px; font-size: 13px; background: #fff; border-color: #1c7ed6; color: #1c7ed6; font-weight: 600; white-space: nowrap; text-decoration: none; }
.sp-who .btn.sp-ag7:hover { background: #e7f5ff; border-color: #1864ab; color: #1864ab; }
.sp-who .btn.sp-agx { flex: none; align-self: center; margin-left: auto; background: #fff; border-color: #e03131; color: #c92a2a; font-weight: 600; white-space: nowrap; text-decoration: none; }
.sp-who .btn.sp-agx:hover { background: #fff5f5; border-color: #c92a2a; color: #c92a2a; }
.sp-who .sp-ver { width: 100%; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .sp-who { flex-wrap: wrap; } .sp-who .sp-rdbox { width: 100%; } }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sp-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s, transform .15s; }
.sp-tile:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.sp-tile:disabled { opacity: .5; cursor: not-allowed; }
.sp-tile b { font-size: 16px; }
.sp-tile .muted { font-size: 12.5px; }
.sp-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff; margin-bottom: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.sp-ic svg { width: 26px; height: 26px; }
.sp-tile.call .sp-ic { background: var(--ok); }
.sp-tile.ticket .sp-ic { background: var(--accent); }
.sp-mine { border-top: 1px solid var(--border); padding-top: 12px; }
.sp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tk-minilist { display: grid; gap: 2px; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.tk-mini { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; text-align: left; }
.tk-mini:hover { background: var(--surface-2); }
.tk-mini .tk-subj, .tk-row .tk-subj { overflow-wrap: anywhere; white-space: normal; }
.tk-mini.unread .tk-subj, .tk-row.unread .tk-subj { font-weight: 650; }
.tk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
.tk-id { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.tk-st, .tk-pr, .tk-wait { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.tk-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tk-st.st-new { background: var(--accent-soft); color: var(--accent); }
.tk-st.st-work { background: color-mix(in srgb, #e8890c 15%, transparent); color: #c06a00; }
.tk-st.st-wait { background: color-mix(in srgb, #9c36b5 13%, transparent); color: #9c36b5; }
.tk-st.st-done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tk-st.st-closed { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .tk-st.st-work { color: #ffa94d; }
:root[data-theme="dark"] .tk-st.st-wait { color: #da77f2; }
.tk-pr { border: 1px solid var(--border); color: var(--muted); }
.tk-pr.pr-high { border-color: #e8890c; color: #c06a00; }
.tk-pr.pr-urgent { border-color: var(--danger); background: var(--danger); color: #fff; }
.tk-pr.pr-low { opacity: .75; }
.tk-wait { background: var(--danger-soft); color: var(--danger); }
.modal.tk-modal { width: min(980px, calc(100vw - 24px)); height: min(920px, calc(100vh - 32px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow: hidden; }
.modal.tk-modal.xl { width: min(1240px, calc(100vw - 24px)); height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.tk-modal.full { left: 0; top: 0; transform: none; width: 100vw; height: 100vh; max-height: none; border-radius: 0; animation: none; }
.tk-modal [data-tkfull] svg { width: 18px; height: 18px; }
.tk-modal > header { flex: none; }
.modal.tk-modal > .content { flex: 1; min-height: 0; overflow: hidden; }
.modal.tk-modal > .content.tk-console { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tk-modal header h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tk-modal header h3 svg { width: 20px; height: 20px; color: var(--accent); }
.tk-title { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tk-modal header h3.tk-title {
  display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 4px; min-width: 0;
}
.tk-title .tk-subj {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-width: 0; font-weight: 650;
}
.tk-title .tk-subj-t {
  min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tk-title .tk-subj .tk-st, .tk-title .tk-subj .tk-pr, .tk-title .tk-subj .badge, .tk-title .tk-ren { flex: none; }
.tk-title .tk-stline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  width: 100%; min-width: 0; overflow: visible;
}
.tk-title .tk-stline .tk-st, .tk-title .tk-stline .tk-pr, .tk-title .tk-stline .badge { flex: none; }
.tk-title .tk-c4 { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; flex: none; margin-left: auto; }
.tk-title .tk-metaline {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; white-space: normal; min-width: 0; max-width: 100%; width: 100%; overflow: visible; row-gap: 2px;
}
.tk-title .tk-metaline .tk-id, .tk-title .tk-metaline .tk-dates, .tk-title .tk-metaline .dl-lets, .tk-title .tk-metaline .muted.sm { flex: none; }
.tk-title .tk-metaline .tk-fnm, .tk-title .tk-metaline .tk-nm { flex: 0 1 auto; min-width: min-content; overflow: visible; text-overflow: unset; white-space: normal; }
.tk-title .tk-wholine { display: none; }
.tk-title:has(.tk-ren-in) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.tk-form .tk-pri { display: flex; width: 100%; }
.tk-form .tk-pri button { flex: 1; height: 34px; }
.tk-form textarea { height: 140px !important; }
.tk-form .sp-who { margin-bottom: 12px; }
.tk-drop { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.tk-drop svg { width: 20px; height: 20px; flex: none; color: var(--faint); }
.tk-drop:hover, .tk-drop.over, .tk-drop:focus { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.tk-drop kbd, .tk-reply kbd { font: 11px ui-monospace, monospace; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--text); }
.tk-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-thumbs:empty { display: none; }
.tk-thumb { position: relative; width: 112px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.tk-thumb img { display: block; width: 100%; height: 74px; object-fit: cover; }
.tk-thumb .tk-fic { display: grid; place-items: center; height: 74px; color: var(--faint); position: relative; }
.tk-thumb .tk-fic svg { width: 30px; height: 30px; }
.tk-thumb .tk-fic i { position: absolute; bottom: 8px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--accent); }
.tk-fn { display: block; padding: 4px 6px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-thumb.bad { border-color: var(--danger); }
.tk-thumb.bad .tk-fn { color: var(--danger); white-space: normal; }
.tk-thumb.busy img, .tk-thumb.busy .tk-fic { opacity: .45; }
.tk-thumb .spin { position: absolute; top: 26px; left: 47px; width: 18px; height: 18px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: tkspin .8s linear infinite; }
@keyframes tkspin { to { transform: rotate(360deg); } }
.tk-rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; padding: 0; }
.tk-rm svg { width: 13px; height: 13px; }
/* карточка заявки: исходный текст закреплён, переписка прокручивается ниже */
.tk-view { position: relative; display: grid; grid-template-columns: 1fr 290px; gap: 18px; flex: 1; min-height: 0; overflow: hidden; padding-bottom: 12px !important; }
.tk-mbar, .tk-more-scrim { display: none; }
.tk-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.tk-stack { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.tk-stack-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 220px; padding: 8px 28px 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: left; box-shadow: 2px 3px 0 color-mix(in srgb, var(--border) 85%, transparent); }
.tk-stack-card .tk-ss { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 196px; }
.tk-stack-card:hover { border-color: var(--accent); }
.tk-stack-card.on { background: var(--surface); border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent-soft), 6px 6px 0 color-mix(in srgb, var(--accent) 22%, transparent); }
.tk-stack-out { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.tk-stack-out svg { width: 14px; height: 14px; }
.tk-stack-out:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.tk-orig { flex: none; max-height: 40vh; overflow-y: auto; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--surface); padding: 12px 14px 14px; }
.tk-orig-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.tk-orig .tk-tools { margin-left: auto; }
.tk-orig:hover .tk-tools { opacity: 1; }
.tk-thread { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 96px; max-height: none; overflow-y: auto; padding: 4px 4px 4px 0; }
.tk-msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.tk-msg.staff { align-self: flex-end; background: var(--accent-soft); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.tk-msg.note { align-self: flex-end; background: color-mix(in srgb, var(--mark) 35%, var(--surface)); border: 1px dashed color-mix(in srgb, #e8890c 60%, transparent); }
.tk-msg.first { max-width: 100%; border: 1px solid var(--border); background: var(--surface); }
.tk-mh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; font-size: 13px; }
.tk-mb { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-mb.rich { white-space: normal; }
.tk-edit { min-height: 200px; max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px 10px 18px; font: 15px/1.55 inherit; color: var(--text); background: var(--surface); outline: none; overflow-wrap: anywhere; }
.tk-edit:focus { border-color: var(--accent); }
.tk-edit + .tk-fio { margin-top: 8px; }
.tk-edit ol, .tk-edit ul, .tk-mb.rich ol, .tk-mb.rich ul { margin: .35em 0 .35em 1.15em; padding: 0 0 0 .35em; }
.tk-edit ol, .tk-mb.rich ol { list-style: decimal outside; }
.tk-edit ul, .tk-mb.rich ul { list-style: disc outside; }
.tk-edit li, .tk-mb.rich li { margin: .15em 0; }
.tk-edit ul[data-check], .tk-mb.rich ul[data-check], .note-edit ul[data-check], .note-big ul[data-check], .jur-draft ul[data-check] { list-style: none; margin: .15em 0; padding: 0; }
.tk-edit ul[data-check] > li, .tk-mb.rich ul[data-check] > li, .note-edit ul[data-check] > li, .note-big ul[data-check] > li, .jur-draft ul[data-check] > li { list-style: none; position: relative; margin: .28em 0; padding: 1px 0 1px 34px; min-height: 24px; }
.tk-edit ul[data-check] > li::before, .tk-mb.rich ul[data-check] > li::before, .note-edit ul[data-check] > li::before, .note-big ul[data-check] > li::before, .jur-draft ul[data-check] > li::before { content: ''; position: absolute; left: 1px; top: .2em; width: 20px; height: 20px; box-sizing: border-box; border: 1.5px solid var(--faint); border-radius: 50%; background: transparent; cursor: pointer; animation: tk-circle-in .18s ease-out; }
.tk-edit ul[data-check] > li[data-done="1"], .tk-mb.rich ul[data-check] > li[data-done="1"], .note-edit ul[data-check] > li[data-done="1"], .note-big ul[data-check] > li[data-done="1"], .jur-draft ul[data-check] > li[data-done="1"] { color: var(--muted); text-decoration: line-through; }
.tk-edit ul[data-check] > li[data-done="1"]::before, .tk-mb.rich ul[data-check] > li[data-done="1"]::before, .note-edit ul[data-check] > li[data-done="1"]::before, .note-big ul[data-check] > li[data-done="1"]::before, .jur-draft ul[data-check] > li[data-done="1"]::before { border-color: var(--accent); background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.2 7.4 12.1 13.5 6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 16px 16px; }
@keyframes tk-circle-in { from { transform: scale(.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tk-fio { display: grid; gap: 8px; }
.tk-fio[hidden] { display: none; }
.tk-fio-one { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.tk-fio-one .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tk-mb a.person, .tk-subj a.person, .tk-mh a.person, .tk-sys a.person { background: var(--accent-soft); color: var(--accent); font-weight: 650; text-decoration: none; border-radius: 4px; padding: 0 3px; }
.tk-mb a.person:hover, .tk-subj a.person:hover, .tk-mh a.person:hover, .tk-sys a.person:hover { text-decoration: underline; }
.tk-sys { align-self: center; font-size: 12px; color: var(--faint); text-align: center; }
.tk-assign { font-size: 13.5px; font-weight: 650; color: var(--text); background: var(--surface-2); border-radius: 10px; padding: 6px 12px; }
.tk-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-img { padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; background: var(--surface); }
.tk-img img { display: block; max-width: 260px; max-height: 170px; object-fit: contain; }
.tk-img:hover { border-color: var(--accent); }
.tk-doc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; max-width: 280px; }
.tk-doc svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.tk-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-doc i { font-style: normal; color: var(--faint); font-size: 12px; white-space: nowrap; }
.tk-doc:hover { border-color: var(--accent); text-decoration: none; }
.tk-find, .tk-fio, .tk-reply { flex: none; }
.tk-reply { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; }
.tk-reply textarea { width: 100%; min-height: 80px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); outline: none; }
.tk-reply textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tk-reply.is-note textarea { background: color-mix(in srgb, var(--mark) 22%, var(--surface)); }
.tk-reply .tk-drop { padding: 8px 12px; }
.tk-rbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.tk-rbar .spacer { flex: 1; }
.tk-rbar select { max-width: 100%; min-width: 0; }
.tk-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tk-done > svg { width: 20px; height: 20px; color: var(--ok); }
.tk-done > div { flex: 1; min-width: 200px; }
.tk-rate { display: flex; align-items: center; gap: 2px; }
.tk-rate span { margin-right: 8px; color: var(--muted); font-size: 13.5px; }
.tk-rate button { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--border); cursor: pointer; padding: 0 2px; }
.tk-rate:hover button { color: #f59f00; }
.tk-rate button:hover ~ button { color: var(--border); }
.tk-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; }
.tk-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.tk-bh { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.tk-box label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; max-width: 100%; }
.tk-box select, .tk-box input[type=date] { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 400; color: var(--text); }
.btn.full { width: 100%; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.tk-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tk-author > div { min-width: 0; overflow: hidden; }
.tk-acts { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .tk-view { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .tk-msg { max-width: 100%; }
  .tk-side { max-height: min(46vh, 380px); }
  .tk-box select, .tk-box input[type=date] { height: 44px; font-size: 16px; }
  .tk-rbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .tk-rbar #tkst, .tk-rbar .spacer, .tk-rbar > .muted { display: none; }
  .tk-stack-card { max-width: calc(50% - 4px); }
}
@media (hover: none) { .tk-orig .tk-tools { opacity: 1; } .tk-stack-out { color: var(--text); } }
.tk-behind { visibility: hidden !important; pointer-events: none !important; z-index: 0 !important; }
/* карточка заявки — не путать с блоками статистики .tk-card (position:relative ломал окно) */
.modal.tk-modal.tk-card {
  position: fixed;
  z-index: 61;
  display: flex;
  flex-direction: column;
  padding: 0;
}
body.tk-view-open { overflow: hidden; }
body.tk-view-open .scrim.m { z-index: 60; }
body.tk-view-open .topbar,
body.tk-list-open .topbar {
  position: relative;
  top: auto;
  backdrop-filter: none;
}
body.tk-view-open .svc-tbar-wrap,
body.tk-list-open .svc-tbar-wrap {
  display: none;
}
@media (max-width: 720px) {
  body.tk-view-open {
    --mnav-h: calc(76px + env(safe-area-inset-bottom, 0px));
  }
  body.tk-view-open .mnav { z-index: 52; }
  body.tk-view-open .mnav > button.mcall svg {
    margin-top: 0; width: 26px; height: 26px; padding: 4px; border: 0; box-shadow: none;
  }
  .modal.tk-modal, .modal.tk-modal.full, .modal.tk-modal.xl {
    left: 0; top: 0; right: 0; bottom: var(--mnav-h, calc(76px + env(safe-area-inset-bottom, 0px)));
    transform: none; width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0; animation: none; overflow: hidden !important;
    display: flex; flex-direction: column;
    z-index: 51;
  }
  body.tk-view-open .modal.tk-modal.tk-card, body.tk-view-open .modal.tk-modal.tk-card.full {
    z-index: 61;
  }
  body.tk-view-open .scrim.m { z-index: 60; }
  .modal.tk-modal > .content { flex: 1 1 0%; min-height: 0; padding: 8px 12px 6px; }
  .modal.tk-modal > .content.tk-console { overflow-y: auto; }
  .tk-modal > header { flex: none; align-items: center; padding: 8px 10px 4px; gap: 6px; }
  .tk-modal header .tk-back { order: 0; }
  .tk-modal header [data-ref] { order: 1; margin-left: auto; }
  .tk-modal header [data-tkfull] { display: none; }
  .tk-modal header [data-close] { order: 3; }
  .tk-modal header h3.tk-title {
    order: 4; flex: 1 1 100%;
    flex-direction: column; align-items: flex-start; gap: 4px;
  }
  .tk-modal .tk-find, .tk-modal .tk-rbar, .tk-modal .tk-side { display: none; }
  .tk-view { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); padding-bottom: 0 !important; gap: 0; }
  .tk-main { gap: 8px; min-height: 0; overflow: hidden; }
  .tk-orig { max-height: min(22vh, 150px); min-height: 0; }
  .tk-thread { min-height: 0; }
  .tk-reply {
    flex: none; padding: 8px 0 0; background: var(--surface);
    border-top: 1px solid var(--border); z-index: 4;
  }
  .tk-mbar:not([hidden]) {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: relative; z-index: 5; flex: none;
    min-height: 52px; box-sizing: border-box;
    padding: 4px 6px;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  .tk-mbar > button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 4px 2px; border: 0; border-radius: 12px;
    background: none; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
  }
  .tk-mbar > button svg { width: 22px; height: 22px; }
  .tk-mbar > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tk-mbar > button:active { background: var(--surface-2); }
  .tk-mbar > button[data-tkopt="take"] { color: var(--ok); }
  .tk-modal.is-more .tk-mbar [data-tkopt="more"] { color: var(--accent); }
  .tk-modal.is-more .tk-side {
    display: flex; position: absolute; left: 0; right: 0; bottom: 0;
    max-height: min(60vh, 420px); z-index: 3;
    background: var(--surface); border-radius: 16px 16px 0 0;
    padding: 4px 12px 12px; box-shadow: 0 -8px 28px rgba(16, 24, 40, .14); overflow-y: auto;
  }
  .tk-modal.is-more .tk-side::before {
    content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
    background: var(--faint); margin: 8px auto 10px; opacity: .55; flex: none;
  }
  .tk-modal.is-more .tk-core { display: none; }
  .tk-modal.is-more .tk-more-scrim {
    display: block; position: absolute; inset: 0; background: rgba(10, 14, 22, .35); z-index: 2;
  }
  .modal.tk-sheet {
    left: 0; right: 0; top: auto; bottom: var(--mnav-h);
    transform: none; width: 100%; max-width: none; height: auto; max-height: min(70vh, 520px);
    border-radius: 16px 16px 0 0; overflow: hidden; display: flex; flex-direction: column;
    padding: 0; animation: tkSheetIn .28s cubic-bezier(.2, .9, .3, 1); z-index: 58;
  }
  .tk-sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--faint); margin: 8px auto 4px; opacity: .55; }
  .tk-sheet-h { font-size: 15px; font-weight: 700; padding: 8px 16px 10px; }
  .tk-sheet-list { overflow-y: auto; max-height: 55vh; }
  .tk-sheet-i { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 18px; border: 0; background: none; color: var(--text); font-size: 16px; font-weight: 550; cursor: pointer; }
  .tk-sheet-i.on { color: var(--accent); font-weight: 700; }
  .tk-sheet-i:active { background: var(--surface-2); }
  .tk-sheet-i.danger { color: var(--danger); }
  .tk-sheet-k { min-width: 0; }
  .tk-sheet-v { color: var(--muted); font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
  .tk-sheet-i.on .tk-sheet-v { color: var(--accent); }
  .tk-sheet-date { padding: 4px 16px 8px; }
  .tk-sheet-date input[type=date] { width: 100%; height: 44px; font-size: 16px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
  .tk-sheet-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px 16px; }
  @keyframes tkSheetIn { from { transform: translateY(100%); } to { transform: none; } }
}
@media (min-width: 721px) {
  .tk-mbar, .tk-notebtn, .tk-more-scrim { display: none !important; }
}
/* пульт исполнителя */
.tk-console { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px !important; }
.tk-scope { flex: none; }
.tk-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: sticky; top: 0; background: var(--surface); z-index: 2; padding-bottom: 6px; }
.tk-bar .seg { flex-wrap: wrap; }
.tk-bar .seg .n { margin-left: 5px; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.tk-bar .seg .n.hot { color: #fff; background: var(--danger); border-radius: 9px; padding: 0 6px; }
.tk-star { font-style: normal; margin-left: 4px; font-size: 13px; line-height: 1; color: var(--faint); opacity: 0; cursor: pointer; transition: opacity .12s; }
#tkf button:hover .tk-star, #dlv button:hover .tk-star, #dlf button:hover .tk-star, .tk-star:focus { opacity: .8; }
.tk-star:hover { color: #e8a50c; opacity: 1; }
.tk-star.fav { opacity: 1; color: #e8a50c; }
@media (hover: none) { .tk-star { opacity: .55; } }
.dl-wseg { display: flex; flex-wrap: wrap; margin: 6px 0; }
.dl-wpick { margin: 6px 0; }
#dlv .tk-star, #dlf .tk-star { flex: none; }
.tk-bar2 { flex-basis: 100%; display: flex; gap: 8px; align-items: center; }
.tk-grph { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-top: 6px; border-radius: var(--radius-sm); background: var(--surface-2, color-mix(in srgb, var(--accent) 7%, var(--surface))); cursor: pointer; user-select: none; }
.tk-grph:first-of-type, .tk-head + .tk-grph { margin-top: 0; }
.tk-grph:hover { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.tk-grph > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-grpn { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tk-gn { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 9px; background: color-mix(in srgb, #e8890c 16%, var(--surface)); }
.tk-gn.new { color: #fff; background: var(--accent); }
.tk-table.grouped .tk-row { margin-left: 18px; width: calc(100% - 18px); }
.tk-table.grouped .tk-head { padding-left: 32px; }
.tk-ubox { display: grid; gap: 4px; margin: 4px 0 10px; }
.tk-ubox .tk-pager { margin-left: 18px; }
@media (max-width: 700px) {
  .tk-grph { flex-wrap: wrap; gap: 4px 8px; padding: 8px 10px; }
  .tk-grph { flex-wrap: wrap; }
  .tk-grph > b { flex: 1 1 0; min-width: 0; }
  .tk-grph > .muted { flex-basis: 100%; box-sizing: border-box; white-space: normal; padding-left: 24px; }
  .tk-grpn { margin-left: 24px; flex-wrap: wrap; }
  .tk-table.grouped .tk-row { margin-left: 8px; width: calc(100% - 8px); }
  .tk-bar2 { flex-wrap: wrap; }
  .tk-bar2 .tk-search { min-width: 0; flex-basis: 100%; }
}
.tk-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tk-search svg { width: 17px; height: 17px; color: var(--faint); }
.tk-search input { flex: 1; border: 0; outline: 0; background: none; }
.tk-table { display: grid; gap: 4px; }
.tk-row { display: grid; grid-template-columns: 54px minmax(160px, 2fr) 28px minmax(160px, 1.4fr) minmax(100px, .9fr) minmax(140px, 1fr) 150px; grid-template-areas: "id subj clip who asg st date"; gap: 8px 12px; align-items: start; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; }
.tk-row > .tk-id { grid-area: id; }
.tk-row > .tk-c1 { grid-area: subj; }
.tk-row > .tk-clip { grid-area: clip; display: flex; align-items: flex-start; justify-content: center; padding-top: 3px; }
.tk-row > .tk-c2 { grid-area: who; }
.tk-row > .tk-c3 { grid-area: asg; }
.tk-row > .tk-c4 { grid-area: st; }
.tk-row > .tk-c5 { grid-area: date; }
.tk-row:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.tk-row.st-new { border-left-color: var(--accent); }
.tk-row.st-work { border-left-color: #e8890c; }
.tk-row.st-wait { border-left-color: #9c36b5; }
.tk-row.st-done { border-left-color: var(--ok); }
.tk-row.waiting { background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.tk-row > span { min-width: 0; }
.tk-c1, .tk-c2 { display: flex; align-items: center; gap: 6px; }
.tk-c1 { font-weight: 600; overflow-wrap: anywhere; white-space: normal; flex-wrap: wrap; }
.tk-c2 { flex-wrap: wrap; white-space: normal; min-width: 0; overflow: visible; align-items: baseline; align-content: center; row-gap: 1px; }
.tk-c2 .dl-lets, .tk-metaline .dl-lets { flex: none; margin-right: 0; margin-left: 2px; }
.tk-c2 .muted.sm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-metaline .muted.sm { flex: none; }
.tk-nm { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; min-width: 0; max-width: 100%; }
.tk-ln, .tk-fm { display: block; white-space: normal; overflow: visible; text-overflow: unset; }
.tk-ln { font-weight: 750; }
.tk-fm { font-weight: 500; font-size: 12.5px; }
.tk-c2 .tk-fnm, .tk-c2 .tk-nm { flex: 1 1 100%; min-width: 8em; overflow: visible; text-overflow: unset; white-space: normal; }
.tk-c3 { white-space: normal; }
.tk-c3 .tk-nm { max-width: 100%; }
.tk-author > div { overflow: visible; }
.tk-author b, .tk-author .person, .tk-author .tk-nm { white-space: normal; overflow: visible; text-overflow: unset; }
.tk-fnm { display: inline-block; min-width: 0; max-width: 100%; }
.tk-c4 { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tk-c5 { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.tk-filed, .tk-until { display: block; }
.tk-until { font-weight: 600; }
.tk-until.today { color: var(--accent); }
.tk-until.late { color: var(--danger); }
.tk-metaline .tk-dates { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; flex-wrap: nowrap; }
.tk-metaline .tk-filed, .tk-metaline .tk-until { display: inline; }
/* статистика */
.tk-stbar { display: flex; justify-content: flex-end; }
.tk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tk-kpi { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tk-kpi span { font-size: 12.5px; color: var(--muted); }
.tk-kpi b { font-size: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tk-kpi i { font-style: normal; font-size: 12px; color: var(--faint); }
.tk-card:not(.modal) { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; position: relative; display: grid; gap: 8px; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.tk-chart { width: 100%; height: 190px; display: block; }
.tk-chart .grid line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tk-chart text { fill: var(--faint); font-size: 11px; }
.tk-chart .bar path { fill: var(--accent); }
.tk-chart .bar .hit { fill: transparent; }
.tk-chart .bar.on .hit { fill: var(--accent-soft); }
.tk-chart .bar.on path { fill: var(--accent-2); }
.tk-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12.5px; padding: 5px 9px; border-radius: 7px; white-space: nowrap; box-shadow: var(--shadow); }
.hb { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 34px; gap: 8px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hb-t { height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hb-t i.st-new { background: var(--accent); }
.hb-t i.st-work { background: #e8890c; }
.hb-t i.st-wait { background: #9c36b5; }
.hb-t i.st-done { background: var(--ok); }
.hb-t i.st-closed { background: var(--faint); }
.hb b { text-align: right; font-variant-numeric: tabular-nums; }
.tk-exec .r, .list .r { text-align: right; }
/* исполнитель: выбор отделов и городов */
.pk { max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; display: grid; gap: 3px; margin-top: 6px; }
.pk .check { font-size: 13.5px; }
.pk .check span { flex: 1; }
.pk .check i { font-style: normal; color: var(--faint); font-size: 12px; }
.pk-q { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
/* просмотр картинок */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8, 10, 16, .88); display: flex; flex-direction: column; animation: fadein .15s; }
.scrim.lb { z-index: 79; }
body.tk-view-open .lightbox { z-index: 80; }
body.tk-view-open .scrim.lb { z-index: 79; }
.lb-img { flex: 1; display: grid; place-items: center; min-height: 0; padding: 20px 70px; cursor: zoom-out; }
.lb-img img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #e8ecf3; }
.lb-name { flex: 1; font-size: 13.5px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 36px; cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
/* правка администратора, вложения, страницы */
.tk-tools { margin-left: auto; display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.tk-msg:hover .tk-tools { opacity: 1; }
.tk-tools .btn { width: 26px; height: 26px; padding: 0; }
.tk-tools svg { width: 14px; height: 14px; }
.tk-file { position: relative; display: inline-flex; }
.tk-file .tk-rm { opacity: 0; transition: opacity .15s; }
.tk-file:hover .tk-rm { opacity: 1; }
.tk-pager { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.tk-pager .muted.sm { margin-right: auto; }
.tk-pager .btn { min-width: 34px; height: 32px; padding: 0 8px; }
.tk-pager .btn:disabled { opacity: .4; cursor: default; }
.tk-per { display: flex; align-items: center; gap: 6px; white-space: nowrap; margin-left: auto; }
.tk-per select { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.tk-bar2 .tk-per { margin-left: 0; }
.tk-thread { padding-right: 8px; scroll-behavior: smooth; }
/* компактный список заявок */
.tk-table { gap: 6px; }
.tk-head { display: grid; grid-template-columns: 54px minmax(160px, 2fr) 28px minmax(160px, 1.4fr) minmax(100px, .9fr) minmax(140px, 1fr) 150px; gap: 8px 12px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 4px 12px 4px 16px; }
.tk-row > span { font-size: 14px; }
.tk-cnt { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-weight: 500; font-size: 12px; color: var(--faint); flex: none; }
.tk-cnt svg { width: 15px; height: 15px; }
.tk-clip .tk-cnt { color: var(--muted); }
@media (max-width: 1000px) {
  .tk-head { display: none; }
  .tk-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "subj subj subj"
      "st st clip"
      "id date who";
    gap: 6px 10px;
    padding: 12px;
  }
  .tk-row > .tk-c3 { display: none; }
  .tk-row > .tk-c2, .tk-row > .tk-c5 { display: flex; }
  .tk-row > .tk-c5 {
    text-align: left; align-items: center; justify-content: flex-start;
    flex-direction: row; flex-wrap: nowrap; gap: 6px;
  }
  .tk-row > .tk-c5 .tk-filed, .tk-row > .tk-c5 .tk-until { display: inline; }
  .tk-row > .tk-id { color: var(--text); }
}
.sp-h .btn .n { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.tk-more { border: 0; background: none; color: var(--accent); font-size: 13px; padding: 6px 10px; cursor: pointer; text-align: left; }
.tk-more:hover { text-decoration: underline; }
.tk-back { flex: none; color: var(--accent); font-weight: 600; }
.tk-modal header { flex-wrap: wrap; }
/* «Мои заявки» — яркая кнопка по центру */
.sp-mine { display: flex; justify-content: center; border-top: 1px solid var(--border); padding-top: 14px; }
.btn.sp-my { height: 44px; padding: 0 26px; font-size: 15px; font-weight: 650; border: 0; border-radius: 22px; background: #f76707; color: #fff; box-shadow: 0 3px 12px color-mix(in srgb, #f76707 40%, transparent); }
.btn.sp-my:hover { background: #e8590c; color: #fff; }
.btn.sp-my svg { color: #fff; }
.btn.sp-my .missbadge { background: #fff; color: #e8590c; }
.tk-ren { width: 28px; height: 28px; padding: 0; opacity: .5; }
.tk-ren:hover { opacity: 1; }
.tk-ren svg { width: 15px !important; height: 15px !important; color: var(--muted) !important; }
.tk-ren-in { flex: 1; min-width: 240px; height: 36px; padding: 0 10px; font-size: 16px; font-weight: 600; border: 1px solid var(--accent); border-radius: var(--radius-sm); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); outline: none; }
/* внутренние и добавочные: в карточке — второй строкой, в таблице — узкий столбец */
.card .phones.ext { margin-top: 6px; }
.pill.int { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.pill.int .pill-tag { color: var(--accent); opacity: .8; }
table.list th.col-int, table.list td.col-int { width: 1%; white-space: nowrap; padding-left: 6px; padding-right: 10px; }
table.list td.col-int .ph { font-weight: 600; }
/* «Назад» / «‹ Мои заявки» — тем же оранжевым, что и «Мои заявки» */
.btn.tk-back { height: 32px; padding: 0 14px; border: 0; border-radius: 16px; background: #f76707; color: #fff; font-weight: 650; box-shadow: 0 2px 8px color-mix(in srgb, #f76707 35%, transparent); }
.btn.tk-back:hover { background: #e8590c; color: #fff; }
/* поле ввода как в Telegram: скрепка слева, самолётик справа */
.tk-compose { display: flex; align-items: flex-end; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.tk-compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tk-reply.over .tk-compose { border-color: var(--accent); background: var(--accent-soft); }
.tk-compose textarea#tkmsg, .tk-compose textarea#chmsg { flex: 1; min-height: 38px; max-height: 180px; height: 38px; padding: 9px 4px; border: 0 !important; box-shadow: none !important; background: transparent !important; resize: none; line-height: 1.4; }
.tk-attach, .tk-sendbtn, .tk-notebtn { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tk-attach, .tk-notebtn { background: none; color: var(--faint); }
.tk-attach:hover { color: var(--accent); background: var(--accent-soft); }
.tk-attach svg { width: 21px; height: 21px; transform: rotate(45deg); }
.tk-notebtn:hover, .tk-notebtn.on { color: #c06a00; background: color-mix(in srgb, var(--mark) 28%, transparent); }
.tk-notebtn svg { width: 20px; height: 20px; }
.tk-sendbtn { background: var(--accent); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .12s, background .15s; }
.tk-sendbtn:hover { background: var(--accent-2); transform: scale(1.06); }
.tk-sendbtn svg { width: 18px; height: 18px; margin-left: -2px; margin-top: 1px; }
.tk-reply.is-note .tk-compose { background: color-mix(in srgb, var(--mark) 22%, var(--surface)); }
.tk-reply .tk-up .tk-thumbs { margin: 0 0 4px; }
.tk-rbar { font-size: 13px; }
/* поиск в переписке заявки */
.tk-find { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-2); }
.tk-find:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.tk-find > svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.tk-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; }
.tk-find input::-webkit-search-cancel-button { display: none; }
.tk-fx { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--border); color: var(--text); cursor: pointer; padding: 0; flex: none; }
.tk-fx:hover { background: var(--danger); color: #fff; }
.tk-fx svg { width: 14px; height: 14px; }
.tk-thread mark { padding: 0 2px; border-radius: 3px; }
.sp-sum { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 10px; }
.sp-sum b { color: var(--text); }
#mtf .n { margin-left: 6px; font-size: 11.5px; color: var(--faint); font-weight: 700; }
#mtf .n:empty { display: none; }
.btn.sp-my { position: relative; }
.sp-new { position: absolute; top: 4px; right: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
/* ---------- Мобильная нижняя панель: Заявки · Телефоны · Позвонить · Настройки/Вход ---------- */
.mnav { display: none; }
@media (max-width: 720px) {
  .mnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(16, 24, 40, .08); }
  .mnav > button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; border: 0; border-radius: 12px;
    background: none; color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .mnav > button svg { width: 23px; height: 23px; }
  .mnav > a.mtrk { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; }
  .mnav > a.mtrk svg { width: 23px; height: 23px; }
  .mnav > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mnav > button.on { color: var(--accent); }
  .mnav > button:active { background: var(--surface-2); }
  .mnav > button.mcall { color: #fff; }
  .mnav > button.mcall svg { width: 46px; height: 46px; padding: 11px; margin-top: -20px; border-radius: 50%; background: var(--ok); box-shadow: 0 4px 14px color-mix(in srgb, var(--ok) 45%, transparent); border: 3px solid var(--surface); }
  .mnav > button.mcall span { color: var(--ok); }
  .mnav .missbadge { position: absolute; top: 0; left: calc(50% + 6px); font-style: normal; }
  .mnav .svc-badges { position: absolute; top: 0; left: calc(50% + 6px); display: inline-flex; gap: 2px; }
  .mnav .svc-badges .missbadge { position: static; top: auto; left: auto; margin: 0; font-style: normal; }
  .mnav .menu { position: absolute; top: auto; bottom: calc(100% + 6px); right: 8px; left: auto; }
  body { --mnav-h: calc(76px + env(safe-area-inset-bottom, 0px)); padding-bottom: var(--mnav-h); }
  /* в шапке на телефоне — слева логотип и ☰, справа мой номер, тема, вход; остальное внизу как раньше */
  .topbar .btn.support, .topbar .tkbtn, .topbar .chatbtn, .topbar .menuwrap, .topbar .mobgear { display: none; }
  .topbar [data-act=login] span { display: none; }   /* замочек вверху — вход администратора */
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
}
/* ---------- Удалённый доступ (RustDesk): строка над кружком в карточке и в заявке ---------- */
.rd-bar { display: flex; align-items: center; gap: 8px; margin: 0 auto 14px; padding: 6px 6px 6px 12px; max-width: 100%; width: fit-content; border: 1px solid var(--border); border-radius: 22px; background: var(--surface-2); text-align: left; }
.rd-bar.on { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.rd-bar .lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.rd-bar .lamp.on { background: #2fb344; box-shadow: 0 0 0 3px color-mix(in srgb, #2fb344 25%, transparent); animation: rdpulse 2s infinite; }
@keyframes rdpulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #2fb344 0%, transparent); } }
.rd-t { display: flex; flex-direction: column; font-size: 13px; line-height: 1.25; color: var(--muted); min-width: 0; }
.rd-t b { color: var(--text); font-size: 15px; letter-spacing: .02em; cursor: copy; font-variant-numeric: tabular-nums; }
.rd-t small { font-size: 11.5px; color: var(--faint); }
.btn.rd-go { background: #1f6feb; color: #fff; border: 0; border-radius: 16px; font-weight: 650; text-decoration: none; }
.btn.rd-go:hover { background: #1158c7; color: #fff; text-decoration: none; }
.btn.rd-go svg { color: #fff; }
.rd-more { margin: 10px auto 0; max-width: 420px; text-align: left; }
.rd-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.rd-row > span { flex: 1; min-width: 0; }
.rd-row .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.rd-row .lamp.on { background: #2fb344; }
.rd-bar .btn.icon { width: 30px; height: 30px; padding: 0; }
.tk-side .rd-bar { margin: 0; width: auto; }
.avatar { position: relative; }
.av-on { position: absolute; right: 1px; bottom: 1px; width: 22%; height: 22%; min-width: 9px; min-height: 9px; border-radius: 50%; background: #2fb344; border: 2px solid var(--surface); }
a.unc { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 8px; background: color-mix(in srgb, #f59f00 14%, var(--surface)); color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 13px; text-decoration: none !important; }
a.unc:hover { background: color-mix(in srgb, #f59f00 28%, var(--surface)); }
a.unc svg { width: 15px; height: 15px; color: #e67700; flex: none; }
/* заявки в списке — каждая отдельно: пунктир между ними */
.tk-minilist { gap: 0; }
.tk-minilist .tk-mini, .sp-list .tk-mini, .tk-minilist .tk-row { border-radius: var(--radius-sm); }
.tk-minilist .tk-row { width: 100%; }
.tk-ren-in { min-width: 0; max-width: 100%; }
.tk-table { gap: 6px; }
.tk-row + .tk-row { position: relative; }
/* «Подключиться» — отдельной кнопкой под окошком RustDesk */
.drawer .head > .btn.rd-go { display: flex; width: fit-content; margin: -6px auto 16px; height: 36px; padding: 0 18px; border-radius: 18px; }
.tk-side > .btn.rd-go { display: flex; width: 100%; justify-content: center; height: 36px; border-radius: 18px; margin-top: -4px; }
/* «Подключиться» — по форме и ширине как «Позвонить через АТС» */
.drawer .head > .btn.rd-go { display: flex; min-width: 240px; height: 38px; padding: 0 14px; margin: -4px auto 14px; border-radius: var(--radius-sm); justify-content: center; font-size: 14px; }
/* плитки «Позвонить» / «Создать заявку»: запас сверху, чтобы рамка при наведении не обрезалась */
.sp-tiles { padding: 8px 4px 4px; margin-top: 14px; }   /* 2.46.2: «Позвонить» чуть ниже — не прижата к «Вы: …», рамка не срезается */
.sp-tiles .sp-tile.call { border-top: 1px solid var(--border); }   /* 2.46.2: правило журнала звонков «.call:first-child { border-top: 0 }» снимало у плитки верхнюю рамку */
.sp-tiles .sp-tile.call:hover:not(:disabled) { border-top-color: var(--accent); }
.support-dlg { overflow: visible; }
/* «Мои звонки»: стрелки направления и метка «с сайта» */
.call.in .ci { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.call.other .ci { color: var(--ok); }
.call.out .ci { background: var(--accent-soft); color: var(--accent); }
.call .ci svg { width: 18px; height: 18px; stroke-width: 2.6; }
.via-site { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 1px 8px 1px 6px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(90deg, #f76707, #e8590c); vertical-align: 1px; }
.via-site svg { width: 12px; height: 12px; }
/* RustDesk: окошко шире и наряднее, «Подключиться» — оранжевая */
.drawer .rd-bar { min-width: 300px; padding: 10px 10px 10px 16px; gap: 12px; border-radius: 16px; border-width: 1.5px; box-shadow: var(--shadow); background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.drawer .rd-bar.on { background: linear-gradient(135deg, color-mix(in srgb, #2fb344 10%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, #2fb344 50%, var(--border)); }
.drawer .rd-t { flex: 1; }
.drawer .rd-t b { font-size: 19px; letter-spacing: .04em; }
.drawer .rd-t small { font-size: 12px; }
.drawer .rd-bar .lamp { width: 12px; height: 12px; }
.btn.rd-go, .drawer .head > .btn.rd-go { background: #f76707; color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, #f76707 35%, transparent); }
.btn.rd-go:hover, .drawer .head > .btn.rd-go:hover { background: #e8590c; color: #fff; }
.drawer .head > .btn.rd-go { min-width: 300px; }
/* дашборд «Отделы — кто сколько» */
.tk-deps th[data-sk] { cursor: pointer; user-select: none; white-space: nowrap; }
.tk-deps th.on { color: var(--accent); }
.tk-deps .bar-col { width: 22%; min-width: 120px; }
.tk-deps .hb-t { display: block; height: 10px; }
.tk-deps td.num { font-variant-numeric: tabular-nums; }
span.tk-open { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 9px; background: color-mix(in srgb, #e8890c 16%, transparent); color: #c06a00; font-weight: 700; text-align: center; }
:root[data-theme="dark"] span.tk-open { color: #ffa94d; }
/* дашборд: провалиться в отдел → люди → их заявки */
.tk-deps .dep-row { cursor: pointer; }
.tk-deps .dep-row:hover td { background: var(--surface-2); }
.tk-deps .dep-row.open td { background: var(--accent-soft); }
.dep-caret { display: inline-block; width: 26px; min-width: 26px; text-align: center; font-size: 1.2em; line-height: 1; color: var(--accent); }
.tk-deps .who-row { cursor: pointer; font-size: 13.5px; }
.tk-deps .who-row td { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); border-top: 1px dashed var(--border); }
.tk-deps .who-row:hover td { background: var(--accent-soft); }
.who-ind { display: inline-block; width: 26px; }
.hb-t.sm { height: 7px; }
/* «Мои звонки» — столбцами, текст по левому краю */
.call { grid-template-columns: 34px 118px minmax(150px, 1.4fr) minmax(150px, 1fr) 110px minmax(130px, 1fr) 76px; gap: 10px; text-align: left; }
.call > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.call.head { border-top: 0; padding-top: 8px; padding-bottom: 8px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.call.head > span { font-size: 11.5px; }
.call .c-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.call .c-who { display: flex; flex-direction: column; }
.call .c-who small, .call .c-num small { font-size: 11.5px; color: var(--faint); }
.call .c-num { font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.call .c-num .badge { margin: 0; }
.call .c-src .via-site { margin-left: 0; }
.call.miss.new .c-st { color: var(--danger); font-weight: 600; }
.call .ca { justify-content: flex-end; }
.call .c-party small .num { color: inherit; }
/* телефон: строки «время / кто звонил / → кому», без шапки таблицы */
@media (max-width: 860px) { .call { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 2px; } .call.head { display: none; }
  .call .ci { grid-row: 1 / span 3; align-self: start; } .call .c-time { grid-column: 2; grid-row: 1; font-size: 12px; }
  .call .c-party { grid-column: 2; grid-row: 2; } .call .c-party + .c-party { grid-row: 3; padding-left: 14px; position: relative; } .call .c-party + .c-party::before { content: '→'; position: absolute; left: 0; color: var(--faint); }
  .call .c-src, .call .c-st { display: none; } .call .ca { grid-column: 3; grid-row: 1 / span 3; } }
.sp-who.for { background: color-mix(in srgb, #f76707 10%, var(--surface)); color: var(--text); }
.sp-who.for svg { color: #f76707; }
/* ---------- Города и филиалы ---------- */
.city-sum { display: flex; gap: 22px; flex-wrap: wrap; align-items: baseline; padding: 6px 2px 4px; color: var(--muted); }
.city-sum b { color: var(--text); font-size: 20px; margin-right: 3px; }
.city-g { margin: 22px 2px 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.city-g .muted { font-weight: 500; }
.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.city { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow); }
.city.base { border-left-color: #f76707; }
.city.none { border-left-style: dashed; border-left-color: var(--faint); }
.city.org { border-left-color: #9c36b5; }
.city-h { display: flex; align-items: center; gap: 8px; }
.city-h b { font-size: 17px; flex: 1; min-width: 0; }
.city-k { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.city-k.base { background: color-mix(in srgb, #f76707 14%, transparent); color: #e8590c; }
.city-k.none { background: var(--surface-2); color: var(--muted); }
.city-k.org { background: color-mix(in srgb, #9c36b5 13%, transparent); color: #9c36b5; }
.city-note { font-size: 12.5px; color: #c06a00; background: color-mix(in srgb, #f59f00 12%, transparent); border-radius: 7px; padding: 3px 8px; width: fit-content; }
.city-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.city-row > svg { width: 15px; height: 15px; color: var(--faint); flex: none; margin-top: 2px; }
.city-row .num-copy { white-space: nowrap; }
.city-people { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 2px; }
.city-go { width: fit-content; }
.city-deps { display: flex; flex-wrap: wrap; gap: 5px; }
.city-deps .pill { cursor: pointer; font-size: 12px; height: 24px; padding: 0 9px; }
.city-deps .pill:hover { background: var(--accent-soft); color: var(--accent); }
/* Телефония: сводка подключений к АТС */
.pbx-status { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0 18px; display: grid; gap: 10px; }
.ps-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ps-row { display: grid; grid-template-columns: 26px 210px 1fr; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13.5px; }
.ps-row i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; color: #fff; background: var(--ok); }
.ps-row.bad i { background: #e8890c; }
.ps-row small { grid-column: 3; color: var(--faint); font-size: 12px; }
.ps-howto summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.ps-howto ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.ps-howto pre { background: var(--surface-2); padding: 8px 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; white-space: pre; }
.spin-i { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: tkspin .8s linear infinite; vertical-align: -1px; }
@media (max-width: 720px) { .ps-row { grid-template-columns: 26px 1fr; } .ps-row span, .ps-row small { grid-column: 2; } }
.drawer.top { z-index: 56; }
.auth-bad td { background: color-mix(in srgb, var(--danger-soft) 40%, transparent); }
/* плановая дата заявки */
.tk-due { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tk-due svg { width: 13px; height: 13px; }
.tk-due.today { background: var(--accent-soft); color: var(--accent); }
.tk-due.late { background: var(--danger-soft); color: var(--danger); }
.tk-box input[type=date] { height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 400; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
/* телефон: кнопки вида и выгрузки — справа, как на ПК; меню выгрузки — внутри экрана */
@media (max-width: 720px) {
  .toolbar .tools .spacer { display: none; }
  .toolbar .tools > .seg { margin-left: auto; }
  .toolbar .tools > .menuwrap:last-child .menu { right: 0; left: auto; }
  .menu { max-width: calc(100vw - 16px); }
}
/* фильтр включён — всегда видно, что выбрано, и кнопка сброса */
.btn.reset-f { height: 26px; margin-left: 10px; padding: 0 10px; border-radius: 13px; background: #f76707; color: #fff; border: 0; font-weight: 650; vertical-align: 1px; }
.btn.reset-f:hover { background: #e8590c; color: #fff; }
.btn.reset-f svg { width: 13px; height: 13px; color: #fff; }
/* кнопки вида и выгрузки — всегда справа (и когда переносятся на новую строку), с небольшим отступом от края */
.toolbar .tools > .seg { margin-left: auto; }
.toolbar .tools > .menuwrap:last-child { margin-right: 8px; }
.toolbar .tools > .menuwrap:last-child .menu { right: 0; left: auto; max-width: calc(100vw - 16px); }
/* вид + выгрузка — одна неразрывная группа справа */
.toolbar .tools > .viewgrp { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin-left: auto; margin-right: 8px; }
.toolbar .tools > .viewgrp .menu { right: 0; left: auto; max-width: calc(100vw - 16px); }
.toolbar .tools.compact > .viewgrp .seg button span { display: none; } .toolbar .tools.compact > .viewgrp .seg button { padding: 0 11px; }
/* фильтры: на ПК — в одну строку как раньше; на телефоне — вид сверху, фильтры под кнопкой «Фильтр» */
.mftoggle { display: none; }
.fpanel { display: contents; }
@media (max-width: 720px) {
  .toolbar .tools { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar .tools > .viewgrp { order: -2; margin: 0; justify-content: space-between; }
  .toolbar .tools > .viewgrp .seg { flex: 1; }
  .toolbar .tools > .viewgrp .seg button { flex: 1; }
  .mftoggle { display: inline-flex; order: -1; justify-content: flex-start; }
  .mftoggle .caret { margin-left: auto; }
  .mftoggle .badge { background: #f76707; color: #fff; }
  .fpanel { display: none; }
  .fpanel.open { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .fpanel .sel, .fpanel .menuwrap > .btn, .fpanel > .btn { width: 100%; justify-content: flex-start; }
  .toolbar .tools .spacer { display: none; }
}
/* не влезает в одну строку (любое разрешение) — вид сверху справа, ниже выбор слева; класс ставит fitToolbar() */
@media (min-width: 721px) {
  .toolbar .tools.stack { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar .tools.stack > .viewgrp { order: -2; margin: 0 8px 0 auto; }
  .toolbar .tools.stack .spacer { display: none; }
  .toolbar .tools.stack .fpanel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
}
/* телефон: вид — справа (не на всю ширину), «Фильтр» — слева под ним */
@media (max-width: 720px) {
  .toolbar .tools > .viewgrp { margin: 0 4px 0 auto; justify-content: flex-end; }
  .toolbar .tools > .viewgrp .seg { flex: none; }
  .toolbar .tools > .viewgrp .seg button { flex: none; }
  .mftoggle { align-self: flex-start; min-width: 160px; }
}
/* телефон: «Фильтр» слева и вид справа — в одну строку; раскрытые фильтры — ниже */
@media (max-width: 720px) {
  .toolbar .tools { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .mftoggle { order: -2; align-self: auto; min-width: 0; }
  .toolbar .tools > .viewgrp { order: -1; margin: 0 2px 0 auto; }
  .fpanel.open { order: 0; flex-basis: 100%; }
}
/* «Другие ПК сотрудника» — свёрнуто, открывается по клику */
details.rd-more > summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; list-style: none; padding: 4px 0; }
details.rd-more > summary::-webkit-details-marker { display: none; }
details.rd-more > summary::before { content: '▸ '; }
details.rd-more[open] > summary::before { content: '▾ '; }
/* поиск: один крестик «Очистить» — браузерный (синий в Chrome) скрыт */
#q::-webkit-search-cancel-button, #q::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
/* «Другие ПК сотрудника»: имя ПК, под ним ID (двойной клик — скопировать) */
.rd-row .rd-pc { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.rd-row .rd-pc b { font-size: 15px; letter-spacing: .03em; cursor: copy; user-select: none; font-variant-numeric: tabular-nums; }
/* «на связи» в карточке сотрудника — крупная лампочка под инициалами, со свечением */
.avatar.lg .av-on { right: auto; left: 50%; bottom: 10px; transform: translateX(-50%); width: 16px; height: 16px; min-width: 16px; min-height: 16px; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(47, 179, 68, .35), 0 0 12px rgba(47, 179, 68, .8); animation: rdpulse 2s infinite; }
.avatar.lg { line-height: 1; }
/* ---------- Ресурсы организации ---------- */
.res-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 0 4px; }
.res-bar .spacer { flex: 1; }
.res-pv { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.res-pv svg { width: 16px; height: 16px; }
.res-pv input { height: 34px; width: 240px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.res-hint { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.res-hint svg { width: 15px; height: 15px; color: var(--ok); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.res { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, box-shadow .15s, border-color .15s; }
.res:hover { transform: translateY(-1px); border-color: var(--accent); }
.res.off { opacity: .55; }
.res.pv-yes { border-color: #2fb344; box-shadow: 0 0 0 2px color-mix(in srgb, #2fb344 30%, transparent); }
.res.pv-no { opacity: .35; filter: grayscale(1); }
.res-open { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.res-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: #f59f00; box-shadow: 0 3px 10px color-mix(in srgb, #f59f00 35%, transparent); }
.res.rdp .res-ic { background: #1f6feb; box-shadow: 0 3px 10px color-mix(in srgb, #1f6feb 35%, transparent); }
.res.run .res-ic { background: #7048e8; box-shadow: 0 3px 10px color-mix(in srgb, #7048e8 35%, transparent); }
.res.link .res-ic { background: #2fb344; box-shadow: 0 3px 10px color-mix(in srgb, #2fb344 35%, transparent); }
.res-ic svg { width: 24px; height: 24px; }
.res-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.res-tx b { font-size: 15.5px; }
.res-tx small { font-size: 12.5px; color: var(--muted); }
.res-tx code { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-adm { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px dashed var(--border); background: var(--surface-2); }
.res-rules { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.res-rule { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: color-mix(in srgb, #2fb344 14%, transparent); color: #2b8a3e; }
.res-rule.deny { background: var(--danger-soft); color: var(--danger); }
.res-btns { display: flex; align-items: center; gap: 2px; flex: none; }
.rule-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.rule-row select, .rule-row input { height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.rule-row input { min-width: 220px; }
.who-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.who-col { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; max-height: 60vh; overflow-y: auto; display: grid; gap: 4px; align-content: start; font-size: 13.5px; }
.who-col.yes { border-top: 3px solid #2fb344; } .who-col.no { border-top: 3px solid var(--danger); }
.who-col h5 { margin: 0 0 6px; }
@media (max-width: 720px) { .who-cols { grid-template-columns: 1fr; } .res-pv input { width: 160px; } }
/* «Ресурсы» — в шапке после «Технической поддержки» */
.topbar .resbtn { white-space: nowrap; }
@media (max-width: 1100px) { .topbar .resbtn span { display: none; } }
/* Настройки → Меню сотрудников */
.menu-sw { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.msw { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.msw.off { background: var(--surface-2); opacity: .75; }
.msw-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.msw.off .msw-ic { background: var(--border); color: var(--faint); }
.msw-ic svg { width: 20px; height: 20px; }
.msw-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.msw-t small { color: var(--muted); font-size: 12px; }
/* «Обзор» папки ресурса — как Проводник */
.res { position: relative; }
.res-browse { position: absolute; top: 12px; right: 12px; }
.fb { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px !important; }
.fb-path { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.fb-path button { border: 0; background: var(--surface-2); border-radius: 8px; padding: 4px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; }
.fb-path button:hover { background: var(--accent-soft); color: var(--accent); }
.fb-path button svg { width: 15px; height: 15px; color: #f59f00; }
.fb-path span { color: var(--faint); }
.fb-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fb-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-height: 60vh; overflow-y: auto; }
.fb-row { display: grid; grid-template-columns: 34px 1fr 130px 80px; gap: 10px; align-items: center; padding: 7px 12px; border: 0; border-bottom: 1px dashed var(--border); background: var(--surface); text-align: left; cursor: pointer; color: inherit; font-size: 14px; }
.fb-row:hover { background: var(--accent-soft); }
.fb-row:last-child { border-bottom: 0; }
.fb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-d, .fb-s { color: var(--muted); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.fb-ic { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; color: #fff; background: #868e96; }
.fb-ic.dir { background: none; color: #f59f00; } .fb-ic.dir svg { width: 24px; height: 24px; }
.fb-ic.pdf { background: #e03131; } .fb-ic.doc { background: #1c7ed6; } .fb-ic.xls { background: #2b8a3e; } .fb-ic.ppt { background: #e8590c; }
.fb-ic.img { background: #ae3ec9; } .fb-ic.app { background: #364fc7; } .fb-ic.zip { background: #5f3dc4; } .fb-ic.sig { background: #f59f00; }
@media (max-width: 720px) { .fb-row { grid-template-columns: 30px 1fr 70px; } .fb-d { display: none; } }
/* ---------- Ресурсы: дерево папок слева, значки справа ---------- */
.res-layout { display: grid; grid-template-columns: 250px 1fr; gap: 16px; margin-top: 10px; align-items: start; }
.res-layout:has(> .res-main:only-child) { grid-template-columns: 1fr; }
.res-tree { position: sticky; top: 76px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px; max-height: calc(100vh - 100px); overflow-y: auto; }
.tr-i { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.tr-i:hover { background: var(--surface-2); }
.tr-i.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tr-i svg { width: 16px; height: 16px; color: #f59f00; flex: none; }
.tr-t { width: 12px; color: var(--faint); font-size: 11px; flex: none; text-align: center; }
.tr-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-i b { font-size: 11px; color: var(--faint); font-weight: 700; }
.res-crumbs { margin-bottom: 10px; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.rt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; text-align: center; color: inherit; }
.rt:hover { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.rt-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: #f59f00; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.rt-ic svg { width: 24px; height: 24px; }
.rt.dir .rt-ic { background: none; box-shadow: none; color: #f59f00; } .rt.dir .rt-ic svg { width: 42px; height: 42px; fill: color-mix(in srgb, #f59f00 22%, transparent); }
.rt.app .rt-ic { background: #364fc7; } .rt.rdp .rt-ic { background: #1f6feb; } .rt.run .rt-ic { background: #7048e8; } .rt.link .rt-ic { background: #2fb344; }
.rt-n { font-size: 13px; font-weight: 600; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rt small { font-size: 11px; color: var(--faint); }
.rt.off { opacity: .5; }
.rt.pv-yes .rt-ic { outline: 3px solid #2fb344; outline-offset: 2px; }
.rt.pv-no { opacity: .3; filter: grayscale(1); }
.rt-edit { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.rt-edit svg { width: 13px; height: 13px; }
.rt:hover .rt-edit { display: grid; }
.rt-edit.rt-copy { right: 32px; }
@media (max-width: 720px) { .res-layout { grid-template-columns: 1fr; } .res-tree { display: none; } .rt-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
/* перетаскивание ресурсов на папку */
.res-dragging .rt.dir, .res-dragging .tr-i, .res-dragging .res-crumbs button { outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; }
.rt.dragging { opacity: .4; }
.drop-on { background: var(--accent-soft) !important; outline: 2px solid var(--accent) !important; }
.rt[draggable="true"] { cursor: grab; }
.pk-path { flex: 1; min-width: 200px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.field label .btn[data-pick] { height: 24px; padding: 0 8px; margin-left: 6px; font-size: 12px; vertical-align: 1px; }
/* «Компактно»: мелкие значки списком в несколько колонок */
.rt-grid.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; }
.rt-grid.compact .rt { flex-direction: row; align-items: center; gap: 10px; padding: 6px 10px; text-align: left; border-radius: 9px; }
.rt-grid.compact .rt-ic { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.rt-grid.compact .rt-ic svg { width: 17px; height: 17px; }
.rt-grid.compact .rt.dir .rt-ic svg { width: 28px; height: 28px; }
.rt-grid.compact .rt-n { flex: 1; -webkit-line-clamp: 1; }
.rt-grid.compact .rt small { margin-left: auto; }
.rt-grid.compact .rt-edit { position: static; display: grid; opacity: 0; }
.rt-grid.compact .rt:hover .rt-edit { opacity: 1; }
.res-bar .res-hint { padding: 0; }
.rt.dir[draggable="true"] { cursor: grab; }
/* ресурс «только для администраторов» — замочек на значке */
.rt-ic { position: relative; }
.rt-lock { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--danger); color: #fff; border: 2px solid var(--surface); font-style: normal; }
.rt-lock svg { width: 11px !important; height: 11px !important; }
.res-rule svg { width: 11px; height: 11px; vertical-align: -1px; }

/* Карта сети (draw.io): просмотр — превью и фото из сетевой папки; редактор во весь экран */
.rt.map .rt-ic { color: #0e7490; }
.rt-hit { color: var(--muted); font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-modal { width: min(1280px, calc(100vw - 24px)) !important; }
.map-modal header .btn { flex: none; }
.map-path { margin-bottom: 8px; word-break: break-all; }
.map-prev { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 8px; text-align: center; max-height: 62vh; overflow: auto; }
.map-prev img { max-width: 100%; cursor: zoom-in; display: block; margin: 0 auto 4px; }
.map-prev.zoom img { max-width: none; cursor: zoom-out; }
.map-prev .empty { color: var(--muted); }
.map-ph-h { margin: 14px 0 8px; display: flex; align-items: center; gap: 6px; }
.map-ph-h svg { width: 16px; height: 16px; }
.map-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding-bottom: 8px; }
.map-ph { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; color: inherit; }
.map-ph:hover { border-color: var(--accent); }
.map-th { height: 96px; background: var(--bg) center / cover no-repeat; }
.map-pn { font-size: 12px; padding: 5px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-big { text-align: center; }
.map-big img { max-width: 100%; max-height: calc(100vh - 140px); }
.modal.drawio-layer { left: 0; top: 0; transform: none; width: 100vw; height: 100vh; max-height: none; border-radius: 0; overflow: hidden; animation: none; }
.modal.drawio-layer { display: flex; flex-direction: column; }
body.desk-web-open { overflow: hidden; }
.modal.desk-web-layer { z-index: 62; }
.desk-web-frame { background: #fff; }
.dio-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; min-width: 0; }
.dio-bar svg { width: 18px; height: 18px; flex: none; }
.dio-bar > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.dio-bar .dio-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 40vw; }
.dio-st { white-space: nowrap; }
.dio-back { font-weight: 700; border: 1.5px solid var(--accent); color: var(--accent); flex: none; }
.dio-bar .dio-back { padding: 7px 16px; font-size: 15px; }
.modal.dio-q { z-index: 53; }   /* вопрос при выходе — поверх редактора */
.dio-st.err { color: var(--danger); }
.drawio-frame { width: 100%; flex: 1; min-height: 0; border: 0; display: block; background: #fff; }
.map-photos > .muted { grid-column: 1 / -1; }

/* Входящий звонок и уведомления на сайте — справа внизу, как тосты; после звонка остаётся («Звонил») до закрытия или 25 минут */
.rings { position: fixed; right: 16px; left: auto; bottom: 16px; z-index: 45; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.ring { pointer-events: auto; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid #16a34a; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px 12px; animation: pop2 .2s ease; }
.ring:not(.live) { border-left-color: var(--muted); }
.ring.live .ring-h svg:first-child { color: #16a34a; animation: ringshake 1s infinite; }
.ring-h { display: flex; align-items: center; gap: 8px; }
.ring-h svg { width: 16px; height: 16px; flex: none; }
.ring-h .ring-st { flex: 1; color: #16a34a; font-size: 13px; }
.ring:not(.live) .ring-st { color: var(--muted); }
.ring-n { font-size: 17px; font-weight: 700; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring-n a { color: inherit; text-decoration: none; }
.ring-n a:hover { color: var(--accent); }
.ring-a { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ring-a small { opacity: .8; font-weight: 400; }
@keyframes ringshake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
.res-who { display: flex; align-items: center; gap: 8px; }
.res-who .seg button svg { width: 14px; height: 14px; }

/* Заявки из почты */
.tk-src { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--accent); }
.tk-src svg, .tk-box .kv svg { width: 14px; height: 14px; vertical-align: -2px; }
.row-in { display: flex; gap: 6px; }
.row-in select { flex: 1; }
.ok-t { color: var(--ok); }
td.nowrap { white-space: nowrap; }
h4 > svg, h5 > svg { width: 1em; height: 1em; vertical-align: -2px; flex: none; }   /* значок в заголовке раздела — по размеру текста */

/* Уведомления */
.ntf-ch { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 8px 0; opacity: .75; }
.ntf-ch.on { opacity: 1; border-color: var(--accent); }
.ntf-h { display: flex; align-items: center; gap: 8px; }
.ntf-h > svg { width: 18px; height: 18px; flex: none; }
.ntf-addr { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; }
.ntf-addr input { flex: 1; }
.ntf-ev { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13.5px; }
.ntf-dl { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 8px 0 14px; }
.ntf-dl .switch { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
label.dl-let:has(input:disabled) { cursor: default; }
.ntf-cfg { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin: 10px 0; }
.ntf-cfg summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ntf-cfg summary svg { width: 16px; height: 16px; }
.ntf-cfg .form { margin-top: 10px; }
.ntf-test { display: flex; gap: 8px; margin: 10px 0 4px; }
.ntf-test input { flex: 1; }
.ntf-add { display: flex; gap: 8px; margin-top: 10px; }
.ntf-add input { flex: 1; }
.ring.ntf { border-left-color: var(--accent); }
.ring.ntf .ring-st { color: var(--accent); }
.ntf-s { font-weight: 600; margin: 4px 0 2px; }
.ntf-s a { color: inherit; }
.ntf-b { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ring-more { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px 4px 3px 12px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow); }
.rings.top { z-index: 70; }

/* Оформление */
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.br-slot { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.br-prev { width: 120px; height: 72px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.br-prev.dark { background: #1b2130; }
.br-prev img { max-width: 110px; max-height: 60px; }
.bk-daily { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }

/* Сроки */
.dl-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.dl-bar .tk-search { flex: 1; min-width: 220px; }
.dl-t td { vertical-align: top; }
.dl-kind { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-right: 6px; }
.dl-lets { display: inline-flex; gap: 4px; align-items: center; margin-right: 6px; vertical-align: middle; }
.dl-let { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; min-width: 22px; margin: 0; padding: 0; box-sizing: border-box; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 1; text-align: center; background: var(--surface-2); color: var(--faint); user-select: none; }
.field label.dl-let, label.dl-let { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 0; padding: 0; font-size: 12px; font-weight: 700; line-height: 1; color: var(--faint); cursor: pointer; position: relative; }
.dl-let input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; }
.dl-let.on, label.dl-let:has(input:checked), .field label.dl-let:has(input:checked) { background: var(--accent); color: #fff; }

.dl-left { font-size: 12.5px; color: var(--muted); }
tr.dl-exp td:first-child { box-shadow: inset 4px 0 0 var(--danger); } tr.dl-exp .dl-left { color: var(--danger); font-weight: 700; }
tr.dl-hot td:first-child { box-shadow: inset 4px 0 0 #ea580c; } tr.dl-hot .dl-left { color: #ea580c; font-weight: 700; }
tr.dl-warm td:first-child { box-shadow: inset 4px 0 0 #ca8a04; } tr.dl-warm .dl-left { color: #ca8a04; }
tr.dl-done { opacity: .6; }
.dl-cert { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.dl-watch { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 720px) {   /* телефон: уведомления — над нижней панелью, во всю ширину */
  .rings { left: 8px; right: 8px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 720px) {   /* телефон: шапка без подписей и с узкими отступами — не шире экрана */
  .topbar .wrap { gap: 4px; }
  .topbar .btn { padding-left: 8px; padding-right: 8px; }
  .topbar .dlbtn span:not(.missbadge), .topbar .resbtn span:not(.missbadge) { display: none; }
  .topbar .top-right { gap: 4px; }
  .res-pin-n { display: none; }
  .res-pin { width: 34px; max-width: 34px; padding: 0; justify-content: center; }
  .topbar .res-pins { gap: 4px; }
}
.brand .logo-m { display: none; height: 34px; width: 34px; object-fit: contain; }
@media (max-width: 420px) {   /* узкий телефон: вместо широкого логотипа — значок */
  .brand .logo { display: none !important; }
  .brand .logo-m { display: block; height: 34px; width: 34px; }
}

/* Выбор сотрудника из справочника */
.pp { position: relative; }
.pp-in.picked { border-color: var(--ok); background-image: linear-gradient(90deg, color-mix(in srgb, var(--ok) 8%, transparent), transparent 40%); }
.pp-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 340px; overflow-y: auto; min-width: 280px; }
.pp-i { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 6px 8px; border: 0; background: none; border-radius: 9px; cursor: pointer; color: inherit; }
.pp-i.on, .pp-i:hover { background: var(--accent-soft); }
.pp-i span { display: flex; flex-direction: column; min-width: 0; }
.pp-i small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-i .avatar { flex: none; }
.pp-none { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.ntf-add .pp { flex: 1; }
.dl-who { font-size: 12px; margin-top: 3px; }

/* Меню: две колонки переключателей — сотрудникам и администраторам */
.menu-sw:has(.msw-head) { grid-template-columns: 1fr; gap: 6px; }
.menu-sw .msw { display: grid; grid-template-columns: 38px 1fr 80px 110px 140px; justify-items: start; cursor: default; padding: 10px 14px; }
.menu-sw .msw > .switch { justify-self: center; }
.msw-head { border: 0 !important; background: none !important; padding: 0 14px !important; font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.msw-head span:nth-child(n+3) { justify-self: center; }
.msw-ord { justify-self: center; display: flex; gap: 2px; }
.msw-ord svg { width: 14px; height: 14px; }
@media (max-width: 720px) { .menu-sw .msw { grid-template-columns: 30px 1fr 60px 56px 56px; } .msw-head span:nth-child(3)::after { content: ''; } }

/* «Ресурсы»: порядок значков перетаскиванием — метка, куда встанет */
.rt.drop-before { box-shadow: inset 4px 0 0 var(--accent); }
.rt.drop-after { box-shadow: inset -4px 0 0 var(--accent); }
.rt[draggable="true"] { cursor: grab; }

/* «В контакты телефона — сразу» — первым и заметно */
.menu button.strong { font-weight: 700; color: var(--accent); }

/* ---------- Корпоративный чат — раздел сайта (2.49) ---------- */
body.v-chat .hero, body.v-chat #adminbar, body.v-chat #toolbar, body.v-chat footer.foot { display: none; }
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 110px); min-height: 420px; margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.ch-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.ch-sh { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 16px; }
.ch-sh b { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.ch-sh b svg { width: 20px; height: 20px; color: var(--accent); }
.ch-sh [data-ntf].off { color: var(--faint); opacity: .7; }
.ch-find { flex: none; min-width: 0; margin: 4px 10px 8px; height: 36px; background: var(--surface); }
.tk-attach[data-respick] svg { transform: none; width: 19px; height: 19px; }
.ch-rooms { flex: 1; overflow-y: auto; padding: 0 6px 10px; }
.ch-room { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; cursor: pointer; position: relative; color: inherit; }
.ch-room:hover { background: var(--surface-2); }
.ch-room.on { background: var(--accent-soft); }
.ch-rt { display: grid; min-width: 0; flex: 1; }
.ch-rt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-rt small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-room .missbadge { position: static; flex: none; }
.ch-rx { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--faint); opacity: 0; cursor: pointer; }
.ch-rx svg { width: 14px; height: 14px; pointer-events: none; }
.ch-room:hover .ch-rx, .ch-room.on .ch-rx { opacity: 1; }
.ch-rx:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
@media (hover: none) { .ch-rx { opacity: .7; } }
.ch-sep { display: flex; align-items: center; gap: 6px; width: 100%; margin: 12px 0 4px; padding: 0 10px; border: 0; background: none; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); text-align: left; }
.ch-sep svg { width: 14px; height: 14px; }
.ch-none { padding: 4px 10px; }
.ch-ava { width: 34px; flex: 0 0 34px; display: flex; }
.ch-ava .avatar { width: 34px; height: 34px; font-size: 12px; }
.ch-hash { height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 17px; display: grid; place-items: center; }
.ch-hash svg { width: 17px; height: 17px; }
.ch-ini { display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.ch-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 62px; }
.ch-head > div { min-width: 0; }
.ch-head .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-back { display: none; }
.ch-thread { flex: 1; max-height: none; min-height: 0; padding: 8px 16px; scroll-behavior: auto; gap: 2px; }
.ch-foot { padding: 8px 16px 12px; }
.ch-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.ch-row.cont { margin-top: 2px; }
.ch-row.me { justify-content: flex-end; }
.ch-row .ch-ava { width: 32px; flex-basis: 32px; }
.ch-row .ch-ava .avatar { width: 32px; height: 32px; }
.ch-msg { max-width: min(680px, 78%); padding: 7px 12px 5px; }
.ch-row.cont .ch-msg { border-top-left-radius: 6px; }
.ch-row.me.cont .ch-msg { border-top-right-radius: 6px; border-top-left-radius: 14px; }
.ch-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11px; color: var(--faint); margin-top: 1px; }
.ch-sending { font-style: italic; opacity: 0.75; }
.ch-row.me .tk-msg:has(.ch-sending) { opacity: 0.7; }
.ch-del { border: 0; background: none; padding: 0; color: var(--faint); opacity: 0; cursor: pointer; display: inline-flex; }
.ch-del svg { width: 13px; height: 13px; }
.ch-msg:hover .ch-del { opacity: 1; }
.ch-del:hover { color: var(--danger); }
@media (hover: none) { .ch-del { opacity: .6; } }
.ch-day, .ch-new { display: flex; justify-content: center; margin: 12px 0 4px; }
.ch-day span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 2px 12px; border-radius: 10px; }
.ch-new { border-top: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); margin-top: 14px; }
.ch-new span { margin-top: -9px; font-size: 11.5px; font-weight: 700; color: var(--danger); background: var(--surface); padding: 0 10px; }
.ch-more { display: flex; justify-content: center; margin-bottom: 6px; }
.ch-reply { gap: 4px; border-top: 0; padding-top: 0; }
.ch-hint { padding-left: 14px; }
.ch-hint code { font-size: 11.5px; }
.ch-ro { text-align: center; padding: 8px; }
.ch-res { display: inline-flex; align-items: center; gap: 5px; margin: 1px 2px; padding: 2px 9px 2px 7px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 8px; background: var(--surface); color: var(--accent); font-weight: 600; font-size: 13.5px; cursor: pointer; vertical-align: baseline; white-space: normal; }
.ch-res svg { width: 15px; height: 15px; flex: none; }
.ch-res:hover { background: var(--accent-soft); }
.ch-res.off { color: var(--faint); border-color: var(--border); cursor: default; }
.ch-res.sm { font-size: 12px; cursor: default; }
.ch-reschips { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 10px; }
.ch-reschips:empty { display: none; }
.ch-rplist { display: grid; gap: 4px; margin: 10px 0; max-height: 50vh; overflow-y: auto; }
.ch-rp { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; }
.ch-rp:hover { border-color: var(--accent); }
.ch-rp svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.ch-rp span { display: grid; min-width: 0; }
.ch-rp small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-rp > .ch-ava { display: flex; flex: 0 0 34px; width: 34px; min-width: 34px; }
.ch-rp > .ch-ava.ch-hash { display: grid; place-items: center; }
.ch-rp > .ch-ava .avatar { min-width: 34px; }
.ch-rules { display: grid; gap: 8px; margin-top: 12px; }
.ch-rule { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ch-rule select { max-width: 320px; }
.ch-caps { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.ch-mods { margin-top: 16px; }
.ch-mods h5 { margin: 0 0 4px; }
.ch-mod { display: inline-flex; align-items: center; gap: 2px; margin: 0 6px 6px 0; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 14px; }
#chmodadd { max-width: 340px; }
.ring.chatntf .ring-h svg { color: var(--accent); }
@media (max-width: 720px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 150px); margin-top: 8px; border-radius: var(--radius-sm); }
  .chat.show-list .ch-main, .chat:not(.show-list) .ch-side { display: none; }
  .ch-side { border-right: 0; }
  .ch-back { display: inline-flex; font-size: 20px; }
  .ch-head { padding: 8px 10px; }
  .ch-thread { padding: 6px 8px; }
  .ch-foot { padding: 6px 8px 8px; }
  .ch-msg { max-width: 86%; }
  .ch-hint { display: none; }
}
@media (min-width: 721px) { body.v-chat .rings { bottom: 96px; } }   /* в чате карточки уведомлений — над полем ввода */
/* ---------- Чат 2.50: меню ☰, группы, поиск в переписке, мигание личных ---------- */
.ch-side { position: relative; }
.ch-sh { gap: 6px; justify-content: flex-start; }
.ch-sh b { flex: 1; }
.ch-burger { font-size: 18px; line-height: 1; }
.ch-drawer { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--surface); box-shadow: 8px 0 24px rgba(0,0,0,.12); transform: translateX(-102%); transition: transform .18s ease; }
.chat.menu-open .ch-drawer { transform: none; }
.ch-dh { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 16px; font-size: 17px; }
.ch-ditem { display: flex; align-items: center; gap: 12px; margin: 2px 6px; padding: 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; cursor: pointer; font-weight: 600; color: inherit; }
.ch-ditem:hover { background: var(--surface-2); }
.ch-ditem.on { background: var(--accent-soft); color: var(--accent); }
.ch-ditem svg { width: 20px; height: 20px; color: var(--accent); }
.ch-people { flex: 1; overflow-y: auto; padding: 0 6px 10px; }
.ch-grp svg { width: 17px; height: 17px; }
.ch-room.priv b { color: var(--accent); }
.ch-sbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.ch-sbar[hidden] { display: none; }
.ch-sbar .tk-search { height: 36px; }
.ch-head .spacer { flex: 1; }
.ch-gform { display: grid; gap: 10px; }
.ch-glist { display: grid; gap: 2px; max-height: 45vh; overflow-y: auto; }
.ch-gp { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.ch-gp:hover { background: var(--surface-2); }
.ch-gp input { flex: none; }
.ch-gsel:empty { display: none; }
.ch-gbar { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ch-grn { display: flex; gap: 8px; }
.ch-grn input { flex: 1; }
@keyframes chblink { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 0%, transparent); background: color-mix(in srgb, var(--danger) 16%, var(--surface)); } }
.chatbtn.has-priv, .mnav [data-act=chat].has-priv, .svcbtn.has-priv, .svc-ico.has-priv { animation: chblink 1.2s ease-in-out infinite; }
.mnav [data-act=chat].has-priv { border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .chatbtn.has-priv, .mnav [data-act=chat].has-priv, .svcbtn.has-priv, .svc-ico.has-priv { animation: none; outline: 2px solid var(--danger); } }
@media (max-width: 720px) { .ch-sbar { padding: 6px 8px; } }

.ch-del.ch-act { color: var(--faint); font-size: 13px; }
.ch-del.ch-act:hover { color: var(--accent); background: var(--accent-soft); }

/* Ресурс/ссылка в сообщении — своей строкой, текст переносится ниже элемента */
.tk-mb .ch-res, .tk-mb .rd-go { display: inline-flex; margin: 4px 6px 4px 0; }
.tk-mb .ch-res { display: flex; width: fit-content; max-width: 100%; }

/* Модуль «Юрист» — ИИ-черновики (портальный вид) */
.jur-wrap { max-width: 1280px; margin: 0 auto; padding-top: 4px; }
.jur-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px; }
.jur-card h1 { margin: 0; font-size: 21px; }
.jur-card h2 { margin: 0 0 12px; font-size: 17px; }
.jur-card > p { margin: 6px 0 16px; }
.jur-head { display: flex; align-items: center; gap: 10px; }
.jur-dlabel { font-weight: 600; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.jur-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.jur-drop:hover, .jur-drop.over { border-color: var(--accent-2); background: var(--accent-soft); }
.jur-drop svg { width: 38px; height: 38px; color: var(--accent); }
.jur-drop-t { font-weight: 600; } .jur-drop-h { color: var(--faint); font-size: 13px; }
.jur-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.jur-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.jur-chip button { border: 0; background: transparent; cursor: pointer; color: var(--faint); font-size: 17px; line-height: 1; padding: 0 4px; }
.jur-chip button:hover { color: var(--danger); }
.jur-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.jfield { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.jur-grid .jfield { margin-top: 0; }
.jfield label { font-weight: 600; font-size: 13px; color: var(--muted); }
.jfield input, .jfield select, .jfield textarea { width: 100%; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 9px 12px; outline: 0; transition: border-color .15s, box-shadow .15s; }
.jfield select { height: 40px; }
.jfield input:focus, .jfield select:focus, .jfield textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.jfield textarea { resize: vertical; min-height: 84px; }
.jchk { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; cursor: pointer; }
.jur-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.jur-secure { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.jur-secure svg { width: 15px; height: 15px; flex: none; }
.jur-result { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.jur-rhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.jur-draft { min-height: 44vh; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; font: 15px/1.6 inherit; outline: none; overflow: auto; background: var(--surface); }
.jur-draft p { margin: 6px 0; } .jur-draft ul, .jur-draft ol { margin: 6px 0; padding-left: 22px; }
.jur-working { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 6px 0; }
.jur-spin { width: 15px; height: 15px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; display: inline-block; animation: jurspin .8s linear infinite; }
@keyframes jurspin { to { transform: rotate(360deg); } }
.jur-err { color: var(--danger); font-size: 14px; }
.jur-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.jur-row:hover, .jur-row.on { border-color: var(--accent); }
.jur-ti { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jur-ti b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jur-badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.jur-badge.run { background: var(--accent-soft); color: var(--accent); }
.jur-badge.ok { background: #dcfce7; color: #166534; }
.jur-badge.err { background: #fee2e2; color: #b91c1c; }
@media (max-width: 640px) { .jur-grid { grid-template-columns: 1fr; } }

/* Юрист: раздел без хрома справочника + меню инструментов */
body.v-lawyer .hero, body.v-lawyer #adminbar, body.v-lawyer #toolbar { display: none; }
.jur-menu { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 18px; }
.jur-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.jur-tab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; font-size: 14px; color: var(--muted); }
.jur-tab:hover { border-color: var(--accent-2); color: var(--accent); }
.jur-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.jur-tab svg { width: 17px; height: 17px; flex: none; }
.jur-find { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 360px; }
.jur-find svg { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--faint); }
.jur-find input { width: 100%; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); outline: 0; }
.jur-find input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.jur-soon { text-align: center; padding: 30px 16px; color: var(--muted); }
.jur-soon svg { width: 46px; height: 46px; color: var(--faint); display: block; margin: 0 auto 8px; }
.jur-soon b { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.jur-soon p { max-width: 520px; margin: 0 auto; }
@media (max-width: 640px) { .jur-tab span { display: none; } .jur-find { max-width: none; } }

/* Юрист: сравнение документов */
.jur-cmp-in { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.jur-cmp-in textarea { width: 100%; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; outline: 0; resize: vertical; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.jur-cmp-in textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.jur-cmp-in label { display: flex; align-items: center; gap: 8px; }
.jur-cmp-in label .btn { margin-left: auto; }
.jur-diff-wrap { max-height: 68vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.jur-diff { border-collapse: collapse; width: 100%; table-layout: fixed; font: 14.5px/1.7 'Times New Roman', Georgia, 'Noto Serif', serif; }
.jur-diff th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; text-align: left; padding: 7px 10px; font: 600 12.5px/1.4 inherit; color: var(--muted); border-bottom: 1px solid var(--border); }
.jur-diff td { width: 50%; vertical-align: top; padding: 5px 16px; white-space: pre-wrap; word-break: break-word; border-bottom: 1px solid var(--surface-2); border-right: 1px solid var(--border); }
.jur-diff td.d-ins { background: #d7f5dd; }   /* добавлено — зелёным */
.jur-diff td.d-del { background: #ffe0e0; }   /* удалено — красным */
.jur-diff mark.wc { background: #fff3a0; color: inherit; padding: 0 1px; border-radius: 2px; }   /* изменённые слова — жёлтым */
:root[data-theme="dark"] .jur-diff td.d-ins { background: #14331f; }
:root[data-theme="dark"] .jur-diff td.d-del { background: #3a1d22; }
:root[data-theme="dark"] .jur-diff mark.wc { background: #5c4a00; color: #fff; }
.jur-diff td.d-gap { background: var(--surface-2); }
@media (max-width: 640px) { .jur-cmp-in { grid-template-columns: 1fr; } }

/* Юрист: улучшение договора — советы */
.jur-adv-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.jur-adv { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); font-size: 14px; line-height: 1.5; }
.jur-adv b { color: var(--accent); }

/* Юрист: ИИ-помощник (чат справа) */
.jur-fab { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer; font-weight: 600; }
.jur-fab:hover { background: var(--accent-2); }
.jur-fab svg { width: 20px; height: 20px; }
.jur-chat { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: min(440px, calc(100vw - 32px)); height: min(620px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.jur-chat-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); }
.jur-chat-h svg { width: 18px; height: 18px; color: var(--accent); }
.jur-chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.jur-msg { max-width: 88%; padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.jur-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.jur-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.jur-msg.sys { align-self: center; color: var(--faint); font-size: 12.5px; text-align: center; max-width: 95%; }
.jur-chat-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: flex-end; }
.jur-chat-in textarea { flex: 1; resize: none; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 10px; outline: 0; max-height: 140px; }
.jur-chat-in textarea:focus { border-color: var(--accent); }
@media (max-width: 640px) { .jur-fab span { display: none; } .jur-fab { padding: 0; width: 52px; justify-content: center; } }
/* Юрист: вопрос ИИ прямо в ячейке «Улучшения договора» — ответ справа в «Помощнике» */
#jimpout .jur-diff td { cursor: help; }
#jimpout .jur-diff td:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
#jimpout .jur-diff td.asked { box-shadow: inset 4px 0 0 var(--accent); }
.jur-cellask { margin: 6px 0 2px; }
.jur-cellask textarea { width: 100%; font: 14px/1.4 inherit; font-family: system-ui, sans-serif; padding: 6px 8px; border: 2px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }

/* Юрист: подсветка соответствующей строки при наведении (левая и правая напротив) */
.jur-diff tbody tr:hover > td { box-shadow: inset 0 0 0 9999px rgba(59,91,219,.07); }
:root[data-theme="dark"] .jur-diff tbody tr:hover > td { box-shadow: inset 0 0 0 9999px rgba(116,143,252,.12); }

/* Юрист: проверка на риски (светофор) */
.jur-risk-list { display: flex; flex-direction: column; gap: 10px; }
.jur-risk { border: 1px solid var(--border); border-left: 5px solid var(--faint); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); }
.jur-risk .sm { font-size: 13px; color: var(--muted); }
.jur-risk-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.jur-risk-b { font-weight: 700; }
.jur-risk.hi { border-left-color: #e03131; } .jur-risk.hi .jur-risk-b { color: #e03131; }
.jur-risk.mid { border-left-color: #e8a500; } .jur-risk.mid .jur-risk-b { color: #b8860b; }
.jur-risk.lo { border-left-color: #2b8a3e; } .jur-risk.lo .jur-risk-b { color: #2b8a3e; }

.note-fmt.alpha-ed { align-items: center; }
.alpha-name { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 2px; user-select: none; }
.alpha-ed select { min-height: 32px; max-width: 158px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: var(--text); font: inherit; font-size: 13.5px; }
.alpha-colors { display: inline-flex; gap: 4px; align-items: center; }
.alpha-ed button.alpha-dot { width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 50%; }
.alpha-ed button.alpha-dot.on { outline: 2px solid var(--text); outline-offset: 1px; }
.note-edit font[size="2"], .note-big font[size="2"], .tk-edit font[size="2"], .tk-mb font[size="2"], .jur-draft font[size="2"] { font-size: 13px; }
.note-edit font[size="3"], .note-big font[size="3"], .tk-edit font[size="3"], .tk-mb font[size="3"], .jur-draft font[size="3"] { font-size: 16px; }
.note-edit font[size="5"], .note-big font[size="5"], .tk-edit font[size="5"], .tk-mb font[size="5"], .jur-draft font[size="5"] { font-size: 22px; }
.note-edit font[face="Arial"], .note-big font[face="Arial"], .tk-edit font[face="Arial"], .tk-mb font[face="Arial"], .jur-draft font[face="Arial"] { font-family: Arial, Helvetica, sans-serif; }
.note-edit font[face="Times New Roman"], .note-big font[face="Times New Roman"], .tk-edit font[face="Times New Roman"], .tk-mb font[face="Times New Roman"], .jur-draft font[face="Times New Roman"] { font-family: "Times New Roman", Times, serif; }
.note-edit font[face="Georgia"], .note-big font[face="Georgia"], .tk-edit font[face="Georgia"], .tk-mb font[face="Georgia"], .jur-draft font[face="Georgia"] { font-family: Georgia, "Times New Roman", serif; }
.note-edit font[face="Courier New"], .note-big font[face="Courier New"], .tk-edit font[face="Courier New"], .tk-mb font[face="Courier New"], .jur-draft font[face="Courier New"] { font-family: "Courier New", Courier, monospace; }
.note-edit font[color="#1a1a1a"], .note-big font[color="#1a1a1a"], .tk-edit font[color="#1a1a1a"], .tk-mb font[color="#1a1a1a"], .jur-draft font[color="#1a1a1a"] { color: #1a1a1a; }
.note-edit font[color="#b00020"], .note-big font[color="#b00020"], .tk-edit font[color="#b00020"], .tk-mb font[color="#b00020"], .jur-draft font[color="#b00020"] { color: #b00020; }
.note-edit font[color="#b45309"], .note-big font[color="#b45309"], .tk-edit font[color="#b45309"], .tk-mb font[color="#b45309"], .jur-draft font[color="#b45309"] { color: #b45309; }
.note-edit font[color="#15803c"], .note-big font[color="#15803c"], .tk-edit font[color="#15803c"], .tk-mb font[color="#15803c"], .jur-draft font[color="#15803c"] { color: #15803c; }
.note-edit font[color="#1d4ed8"], .note-big font[color="#1d4ed8"], .tk-edit font[color="#1d4ed8"], .tk-mb font[color="#1d4ed8"], .jur-draft font[color="#1d4ed8"] { color: #1d4ed8; }
.note-edit font[color="#7c3aed"], .note-big font[color="#7c3aed"], .tk-edit font[color="#7c3aed"], .tk-mb font[color="#7c3aed"], .jur-draft font[color="#7c3aed"] { color: #7c3aed; }

/* ---------- Личный рабочий стол (2.50.131 / 2.50.147) ---------- */
body.v-desktop .hero, body.v-desktop #adminbar, body.v-desktop #toolbar { display: none; }
body.v-desktop .topbar .wrap,
body.v-desktop .svc-tbar-wrap > .wrap,
body.v-desktop main.wrap {
  max-width: 1600px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
body.v-desktop #view { width: 100%; }
.desk-bar { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 10px; }
.desk-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.desk-tab {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.desk-tab span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-tab .desk-tab-n { font-style: normal; font-size: 11px; font-weight: 700; opacity: .7; }
.desk-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.desk-tab.on .desk-tab-n { opacity: .9; }
.desk-tab-add { width: 32px; padding: 0; justify-content: center; }
.desk-tab-add svg { width: 16px; height: 16px; }
.desk-hint {
  display: flex; align-items: center; gap: 10px;
  margin: 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}
.desk-hint span { flex: 1; min-width: 0; }
.desk-hint .btn { flex: none; }
.desk {
  position: relative;
  width: 100%;
  height: auto;
  min-height: calc(100vh - 180px);
  margin: 0 0 18px;
  border-radius: 0;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(96, 165, 250, .22), transparent 55%),
    radial-gradient(900px 500px at 110% 20%, rgba(37, 99, 235, .28), transparent 50%),
    linear-gradient(165deg, #16345c 0%, #1d4f8c 42%, #0f2744 100%);
  overflow: visible;
  user-select: none;
}
.desk.desk-drop {
  box-shadow: inset 0 0 0 2px rgba(147, 197, 253, .85);
}
:root[data-theme="dark"] .desk {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(96, 165, 250, .12), transparent 55%),
    linear-gradient(165deg, #0b1220 0%, #12233d 50%, #0a1424 100%);
}
.desk-empty {
  position: absolute; inset: 16px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; text-align: center; color: rgba(255,255,255,.78);
}
.desk-empty svg { width: 52px; height: 52px; display: block; margin: 0 auto 8px; opacity: .85; }
.desk-empty b { display: block; font-size: 18px; color: #fff; margin-bottom: 6px; }
.desk-empty p { max-width: 420px; margin: 0 auto; line-height: 1.45; }
.desk-ico {
  position: absolute;
  z-index: 1;
  width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 6px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: #fff;
  cursor: pointer; touch-action: none;
  text-align: center; font: inherit;
}
.desk-ico:hover, .desk-ico:focus-visible {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  outline: 0;
}
.desk-ico.on {
  background: rgba(59, 130, 246, .38);
  border-color: rgba(191, 219, 254, .9);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.desk-ico.dragging { opacity: .88; z-index: 3; background: rgba(255,255,255,.18); }
.desk-ico.fold-over {
  background: rgba(255,255,255,.28);
  border-color: rgba(147, 197, 253, .95);
  transform: scale(1.08);
  z-index: 4;
}
.desk-ico.desk-fold .desk-gpic {
  background: rgba(255,255,255,.16);
  padding: 5px;
}
.desk-gmini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%; height: 100%;
  box-sizing: border-box;
}
.desk-gmini i {
  display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 0;
  background: rgba(255,255,255,.18);
  border-radius: 4px;
}
.desk-gmini svg { width: 12px; height: 12px; display: block; }
.desk-fold-scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(10, 14, 22, .48);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  animation: fadein .15s;
}
.desk-fold-card {
  background: rgba(36, 48, 68, .78);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  padding: 16px 14px 12px;
  min-width: 268px; max-width: min(380px, 92vw);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.desk-fold-name {
  display: block; width: 100%;
  text-align: center; font-weight: 750; font-size: 17px;
  border: 0; background: transparent; color: inherit;
  margin: 0 0 12px; padding: 4px 8px;
  border-radius: 8px;
}
.desk-fold-name:focus { outline: none; background: rgba(255,255,255,.12); }
.desk-fold-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 4px;
  min-height: 72px;
}
.desk-fold-cell { position: relative; display: flex; justify-content: center; }
.desk-fold-ico {
  width: 76px; padding: 6px 2px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: none; color: #fff; cursor: pointer; font: inherit;
}
.desk-fold-ico .desk-pic {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16);
  border-radius: 12px;
}
.desk-fold-ico .desk-pic svg { width: 22px; height: 22px; }
.desk-fold-ico .desk-name {
  font-size: 11px; line-height: 1.2; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
  max-width: 72px; overflow: visible; white-space: normal; word-break: break-word;
}
.desk-fold-x {
  position: absolute; top: -2px; right: 4px;
  width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%;
  background: #e8ecf3; color: #121826;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: .9;
}
.desk-fold-x svg { width: 11px; height: 11px; }
.desk-fold-empty { grid-column: 1 / -1; text-align: center; padding: 18px 8px; color: rgba(255,255,255,.75); font-size: 13px; }
.desk-fold-break { display: block; margin: 12px auto 0; color: #fff; }
.desk-fold-card .btn.ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.desk-lasso {
  position: absolute; z-index: 4;
  border: 1px solid #60a5fa;
  background: rgba(59, 130, 246, .22);
  pointer-events: none;
}
.desk-pic {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.desk-ico svg { width: 26px; height: 26px; display: block; }
.desk-name {
  font-size: 12px; line-height: 1.25; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
  word-break: break-word;
  overflow: visible;
  width: 100%;
}
.desk-hint .btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-2); }
.desk.desk-sm .desk-ico {
  width: max-content; max-width: none; min-width: 120px; height: 28px; box-sizing: border-box;
  flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 6px; padding: 2px 6px; border-radius: 6px; overflow: visible;
}
.desk.desk-sm .desk-pic {
  width: 20px; height: 20px; border-radius: 4px; box-shadow: none; flex: none;
}
.desk.desk-sm .desk-ico svg { width: 14px; height: 14px; }
.desk.desk-sm .desk-gpic { padding: 1px; }
.desk.desk-sm .desk-gmini { gap: 1px; }
.desk.desk-sm .desk-gmini svg { width: 7px; height: 7px; }
.desk.desk-sm .desk-name {
  font-size: 12px; font-weight: 600; line-height: 1.2;
  max-height: none; width: auto; flex: none; text-align: left;
  white-space: nowrap; overflow: visible; text-overflow: clip; word-break: normal;
}
.desk-menu {
  position: fixed; z-index: 75; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.desk-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; background: none; border-radius: 8px;
  text-align: left; cursor: pointer; font-size: 14px; color: inherit;
}
.desk-menu button:hover { background: var(--surface-2); }
.desk-menu button:disabled { opacity: .4; pointer-events: none; }
.desk-menu button svg { width: 17px; height: 17px; color: var(--faint); }
.desk-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.desk-menu .desk-mh { padding: 6px 10px 2px; font-size: 12px; font-weight: 650; color: var(--muted); }
.desk-menu button.desk-mchk svg { opacity: 0; color: var(--accent); }
.desk-menu button.desk-mchk.on svg { opacity: 1; }
.desk-pick {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.desk-pick:hover { background: var(--surface-2); }
.desk-pick svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.desk-pick span { flex: 1; min-width: 0; }
.desk-ptabs { margin-bottom: 10px; }
.desk-pick-q {
  width: 100%;
  height: 40px;
  margin: 0 0 10px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}
.desk-pick-q:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.desk-pick-list { max-height: min(52vh, 480px); overflow: auto; }
.desk-pick small { flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .desk-pick-q { height: 44px; font-size: 16px; }
}
.desk-space { width: 1px; pointer-events: none; visibility: hidden; }
.desk-hint [data-deskfull] { flex: none; }
body.desk-full.v-desktop { overflow: hidden; }
body.desk-full.v-desktop footer.foot { display: none; }
body.desk-full.v-desktop .topbar .wrap,
body.desk-full.v-desktop .svc-tbar-wrap > .wrap {
  max-width: none;
}
body.desk-full.v-desktop main.wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
body.desk-full.v-desktop #view { width: 100%; }
body.desk-full.v-desktop .desk-bar {
  position: fixed;
  z-index: 32;
  left: 12px; right: 12px;
  top: calc(var(--desk-top, 116px) + 6px);
  margin: 0;
  pointer-events: none;
}
body.desk-full.v-desktop .desk-hint {
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}
body.desk-full.v-desktop .desk-bar .btn,
body.desk-full.v-desktop .desk-bar .desk-tab { pointer-events: auto; }
body.desk-full.v-desktop .desk-hint .btn {
  color: #fff;
  border-color: rgba(255,255,255,.38);
  background: rgba(15, 23, 42, .28);
}
body.desk-full.v-desktop .desk-tab {
  color: #fff; background: rgba(15, 23, 42, .35); border-color: rgba(255,255,255,.38);
}
body.desk-full.v-desktop .desk-tab.on { background: #fff; color: #0f2744; border-color: #fff; }
body.desk-full.v-desktop .desk {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: calc(var(--desk-top, 116px) + var(--desk-bar, 46px));
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  overflow: auto;
  border-radius: 0;
}
.scrim.desk-os-scrim {
  top: var(--desk-top, 116px);
  z-index: 54;
}
.modal.desk-os-layer {
  left: 50%;
  right: auto;
  bottom: auto;
  top: calc(var(--desk-top, 116px) + 12px);
  transform: translateX(-50%);
  width: min(1600px, calc(100vw - 24px));
  height: calc(100vh - var(--desk-top, 116px) - 24px);
  max-height: calc(100vh - var(--desk-top, 116px) - 24px);
  border-radius: var(--radius);
  overflow: hidden;
  animation: none;
  display: flex;
  flex-direction: column;
  z-index: 55;
  box-shadow: var(--shadow-lg);
}
.modal.desk-os-layer .desk-os-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
  padding: 12px 20px 20px;
}
.modal.desk-os-layer .desk-os-body:has(.chat),
.modal.desk-os-layer .desk-os-body:has(.jur-wrap) {
  padding: 0;
}
.modal.desk-os-layer .desk-os-body .chat {
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.desk-os-ic { display: flex; align-items: center; }
.desk-os-ic svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  body.v-desktop .topbar .wrap,
  body.v-desktop .svc-tbar-wrap > .wrap,
  body.v-desktop main.wrap { padding-left: 14px; padding-right: 14px; }
  .desk { height: auto; min-height: calc(100vh - 120px - var(--mnav-h, 64px)); margin: 0 0 10px; }
  .desk-hint { margin: 6px 0 4px; }
  .desk-hint span { display: none; }
  .desk-fold-scrim { padding: 12px 10px calc(12px + var(--mnav-h, 64px)); }
  .desk-fold-card { width: min(380px, 94vw); }
  body.desk-full.v-desktop main.wrap { padding-left: 0; padding-right: 0; }
  body.desk-full.v-desktop .desk,
  .scrim.desk-os-scrim { bottom: var(--mnav-h, 64px); }
  .modal.desk-os-layer {
    left: 8px; right: 8px;
    transform: none;
    width: auto;
    top: calc(var(--desk-top, 56px) + 8px);
    height: auto;
    bottom: calc(var(--mnav-h, 64px) + 8px);
    max-height: none;
  }
}

/* ---------- Блокнот Windows (2.50.149) ---------- */
.desk-ico .desk-pic.pad-pic {
  background: linear-gradient(180deg, #fffce8 0%, #f3d36b 100%);
  color: #1d4ed8;
}
.modal.pad-win {
  position: fixed; z-index: 62; left: 50%; top: 50%;
  transform: none; margin: 0;
  width: min(760px, calc(100vw - 24px));
  height: min(540px, calc(100vh - 24px));
  max-height: calc(100vh - 16px);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: #fff;
  color: #111;
  border: 1px solid #7a7a7a;
  border-radius: 0;
  box-shadow: 0 0 0 1px #fff, 0 12px 40px rgba(0,0,0,.35);
  animation: none;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.modal.pad-win.pad-max {
  left: 8px !important; top: 8px !important; width: calc(100vw - 16px); height: calc(100vh - 16px);
}
.modal.pad-win.pad-min { height: 32px; width: min(360px, calc(100vw - 24px)); }
.modal.pad-win.pad-min .pad-menu,
.modal.pad-win.pad-min .pad-body,
.modal.pad-win.pad-min .pad-stat { display: none; }
.scrim.pad-scrim { z-index: 61; background: transparent; pointer-events: none; }
.pad-cap {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 0 0 8px;
  background: #fff; color: #111;
  user-select: none; cursor: default;
  flex: none;
}
.pad-cap .pad-logo, .pad-cap .pad-logo svg { width: 16px; height: 16px; flex: none; color: #1d4ed8; display: block; }
.pad-cap .pad-title { flex: 1; min-width: 0; font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pad-btns { display: flex; height: 32px; margin-left: auto; }
.pad-btns button {
  width: 46px; height: 32px; border: 0; background: transparent; color: #111;
  font-size: 11px; line-height: 32px; padding: 0; cursor: default;
}
.pad-btns button:hover { background: #e5e5e5; }
.pad-btns .pad-x:hover { background: #e81123; color: #fff; }
.pad-menu {
  display: flex; gap: 0; flex: none;
  background: #fff; border-bottom: 1px solid #d9d9d9;
  padding: 0 2px; position: relative;
}
.pad-menu > button {
  border: 1px solid transparent; background: none; color: #111;
  font: 12px/22px "Segoe UI", Tahoma, sans-serif;
  padding: 0 8px; cursor: default;
}
.pad-menu > button:hover, .pad-menu > button.on { background: #e5f3ff; border-color: #cce8ff; }
.pad-menu > button u { text-decoration: underline; }
.pad-drop {
  position: absolute; top: 100%; left: 0; z-index: 3;
  min-width: 240px; padding: 2px 0;
  background: #f2f2f2; border: 1px solid #a0a0a0;
  box-shadow: 2px 2px 4px rgba(0,0,0,.2);
  display: none;
}
.pad-drop.on { display: block; }
.pad-drop button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; color: #111;
  font: 12px/22px "Segoe UI", Tahoma, sans-serif;
  padding: 0 12px 0 28px; text-align: left; cursor: default;
}
.pad-drop button:hover { background: #91c9f7; }
.pad-drop button .k { margin-left: auto; color: #555; font-size: 11px; }
.pad-drop button[disabled] { color: #999; }
.pad-drop button[disabled]:hover { background: none; }
.pad-drop hr { border: 0; border-top: 1px solid #d0d0d0; margin: 4px 8px; }
.pad-body { flex: 1; min-height: 0; display: flex; background: #fff; }
.pad-body textarea {
  flex: 1; width: 100%; height: 100%; min-height: 0;
  border: 0; outline: 0; resize: none; margin: 0; padding: 2px 4px;
  background: #fff; color: #000;
  font: 11pt Consolas, "Lucida Console", "Courier New", monospace;
  line-height: 1.25; white-space: pre; overflow: auto;
  tab-size: 4;
}
.pad-body textarea.wrap { white-space: pre-wrap; overflow-wrap: break-word; }
.pad-stat {
  flex: none; display: flex; align-items: center; gap: 0;
  height: 23px; background: #f0f0f0; border-top: 1px solid #d9d9d9;
  font: 12px/22px "Segoe UI", Tahoma, sans-serif; color: #333;
}
.pad-stat span { padding: 0 10px; border-right: 1px solid #d9d9d9; white-space: nowrap; }
.pad-stat span:last-child { border-right: 0; margin-left: auto; }
.pad-find {
  display: none; flex: none; align-items: center; gap: 8px;
  padding: 6px 10px; background: #f3f3f3; border-bottom: 1px solid #d9d9d9;
  font: 12px "Segoe UI", Tahoma, sans-serif;
}
.pad-find.on { display: flex; }
.pad-find input { flex: 1; min-width: 0; height: 24px; font: 12px "Segoe UI", Tahoma, sans-serif; }
.pad-about {
  padding: 16px 20px; font: 13px/1.45 "Segoe UI", Tahoma, sans-serif; color: #111;
}
.pad-about b { display: block; font-size: 16px; margin-bottom: 8px; }
.pad-where { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 180px; overflow: auto; }
.pad-where .check { font-size: 14px; }
body.pad-open .scrim.pad-save-scrim { z-index: 79; background: rgba(10, 14, 22, .28); }
body.pad-open .modal.pad-dlg.pad-saveat { z-index: 80; }
@media (min-width: 721px) {
  body.pad-open .modal.pad-saveat { transform: none; width: min(420px, calc(100vw - 16px)); }
}

.pad-mbar, .pad-more, .pad-more-scrim { display: none; }
body.pad-open .modal:not(.pad-win) { z-index: 72; }
body.pad-open .scrim.m:not(.pad-scrim) { z-index: 71; }
body.pad-mob {
  overflow: hidden;
  overscroll-behavior: none;
  --mnav-h: calc(76px + env(safe-area-inset-bottom, 0px));
}
body.pad-mob .topbar { position: relative; top: auto; backdrop-filter: none; }
body.pad-mob .svc-tbar-wrap { display: none; }
body.pad-mob .mnav { z-index: 52; }
body.pad-mob .mnav > button.mcall svg {
  margin-top: 0; width: 26px; height: 26px; padding: 4px; border: 0; box-shadow: none;
}
body.pad-mob.pad-kb { --mnav-h: 0px; padding-bottom: 0; }
body.pad-mob.pad-kb .mnav { display: none; }
body.pad-mob .scrim.pad-scrim {
  pointer-events: auto; background: rgba(10, 14, 22, .45); z-index: 60;
}
body.pad-mob .modal input, body.pad-mob .modal select, body.pad-mob .modal textarea { font-size: 16px; }
body.pad-mob .modal.pad-dlg {
  left: 0; right: 0; top: auto; bottom: var(--mnav-h, 64px);
  transform: none; width: 100%; max-width: none;
  height: auto; max-height: min(70vh, 520px);
  border-radius: 16px 16px 0 0; overflow: hidden;
  display: flex; flex-direction: column; padding: 0;
  animation: tkSheetIn .28s cubic-bezier(.2, .9, .3, 1); z-index: 72;
}
body.pad-mob .modal.pad-dlg header { padding: 12px 16px 4px; }
body.pad-mob .modal.pad-dlg .content { padding: 8px 16px 12px; font-size: 16px; overflow-y: auto; }
body.pad-mob .modal.pad-dlg footer {
  flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 16px 16px;
}
body.pad-mob .modal.pad-dlg footer .btn { height: 44px; width: 100%; justify-content: center; }
body.pad-mob .modal.pad-dlg input, body.pad-mob .modal.pad-dlg select { height: 44px; font-size: 16px; }
body.pad-mob .modal.pad-dlg .desk-pick { min-height: 48px; font-size: 16px; padding: 12px 16px; border-radius: 0; }
.modal.pad-win.pad-mob, .modal.pad-win.pad-mob.pad-max {
  left: 0; top: 0; right: 0;
  bottom: var(--mnav-h, calc(76px + env(safe-area-inset-bottom, 0px)));
  transform: none; width: 100%; height: auto; max-height: none;
  border: 0; border-radius: 0; box-shadow: none;
  animation: none; overflow: hidden !important;
  display: flex; flex-direction: column;
  z-index: 61;
  background: var(--surface); color: var(--text);
  font-family: inherit;
  touch-action: manipulation;
}
.pad-win.pad-mob .pad-btns .pad-min, .pad-win.pad-mob .pad-btns .pad-maxb { display: none; }
.pad-win.pad-mob .pad-menu { display: none; }
.pad-win.pad-mob .pad-cap {
  height: calc(48px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 4px 0 12px;
  background: var(--surface); color: var(--text);
  border-bottom: 1px solid var(--border);
}
body.pad-kb .pad-win.pad-mob .pad-cap { height: 48px; padding-top: 0; }
.pad-win.pad-mob .pad-cap .pad-title { font-size: 16px; font-weight: 650; }
.pad-win.pad-mob .pad-cap .pad-logo, .pad-win.pad-mob .pad-cap .pad-logo svg { width: 22px; height: 22px; color: var(--accent); }
.pad-win.pad-mob .pad-btns { height: 48px; align-self: flex-end; }
.pad-win.pad-mob .pad-btns button { width: 48px; height: 48px; font-size: 18px; color: var(--text); line-height: 48px; }
.pad-win.pad-mob .pad-btns button:hover { background: transparent; }
.pad-win.pad-mob .pad-btns button:active { background: var(--surface-2); }
.pad-win.pad-mob .pad-btns .pad-x:hover { background: transparent; color: inherit; }
.pad-win.pad-mob .pad-btns .pad-x:active { background: var(--danger); color: #fff; }
.pad-win.pad-mob .pad-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pad-win.pad-mob .pad-body textarea {
  padding: 12px; line-height: 1.45;
  background: var(--surface); color: var(--text);
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}
.pad-win.pad-mob .pad-find {
  padding: 8px 12px; gap: 8px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 15px; color: var(--text);
}
.pad-win.pad-mob .pad-find input { height: 44px; font-size: 16px; }
.pad-win.pad-mob .pad-find .btn { height: 44px; min-width: 44px; }
.pad-win.pad-mob .pad-stat {
  height: 28px; background: var(--surface-2); border-top: 1px solid var(--border);
  color: var(--muted); font: 12px/26px inherit;
}
.pad-win.pad-mob .pad-stat span:nth-child(3),
.pad-win.pad-mob .pad-stat span:nth-child(4) { display: none; }
.pad-win.pad-mob .pad-mbar {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  position: relative; z-index: 5; flex: none;
  min-height: 52px; box-sizing: border-box;
  padding: 4px 6px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.pad-win.pad-mob .pad-mbar > button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 4px 2px; border: 0; border-radius: 12px;
  background: none; color: var(--muted); font-size: 11px; font-weight: 600;
  touch-action: manipulation;
}
.pad-win.pad-mob .pad-mbar > button svg { width: 22px; height: 22px; }
.pad-win.pad-mob .pad-mbar > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-win.pad-mob .pad-mbar > button:active { background: var(--surface-2); }
.pad-win.pad-mob.is-more .pad-mbar [data-pact="more"] { color: var(--accent); }
.pad-win.pad-mob .pad-more-scrim.on {
  display: block; position: absolute; inset: 0;
  background: rgba(10, 14, 22, .35); z-index: 2;
}
.pad-win.pad-mob .pad-more.on {
  display: flex; flex-direction: column;
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: min(70vh, 520px); z-index: 3;
  background: var(--surface); border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 28px rgba(16, 24, 40, .14); overflow: hidden;
  padding-bottom: 52px;
}
.pad-win.pad-mob .pad-more-grab {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--faint); margin: 8px auto 4px; opacity: .55; flex: none;
}
.pad-win.pad-mob .pad-more-h { font-size: 15px; font-weight: 700; padding: 8px 16px 10px; }
.pad-win.pad-mob .pad-more-list { overflow-y: auto; max-height: 55vh; -webkit-overflow-scrolling: touch; }
.pad-win.pad-mob .pad-more-i {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 14px 18px; border: 0; background: none;
  color: var(--text); font-size: 16px; font-weight: 550;
}
.pad-win.pad-mob .pad-more-i:active { background: var(--surface-2); }
.pad-win.pad-mob .pad-more-v { color: var(--muted); font-weight: 500; }
.pad-win:not(.pad-mob) .pad-mbar,
.pad-win:not(.pad-mob) .pad-more,
.pad-win:not(.pad-mob) .pad-more-scrim { display: none !important; }
@keyframes tkSheetIn { from { transform: translateY(100%); } to { transform: none; } }

.tk-form .tk-sim.full { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.tk-sim-one { display: block; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 6px 8px; cursor: pointer; color: var(--text); font: inherit; }
.tk-sim-one:hover { border-color: #1c7ed6; }
.tk-sim-one b { margin-right: 6px; }

/* Своя компания: галочка на карточке и в форме */
.own-row { margin-top: 10px; display: flex; justify-content: center; }
.drawer .own-flag { font-size: 14px; font-weight: 600; }
.own-edit { align-self: end; }
.own-edit .own-flag { font-weight: 600; }
.field.own-edit { display: flex; align-items: center; min-height: 42px; }

/* Сотрудник этой организации: мини-логотип рядом с именем */
.org-mark {
  width: 16px; height: 16px; object-fit: contain; flex: none;
  animation: orgglow 1.8s ease-in-out infinite;
}
.drawer h2.name2 .org-mark { width: 22px; height: 22px; }
@keyframes orgglow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(245, 80, 30, .5)); }
  50% { filter: drop-shadow(0 0 7px rgba(245, 80, 30, .95)); }
}
.card .name {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  align-items: center;
}
.card .name .ln { grid-column: 1; grid-row: 1; }
.card .name .fm { grid-column: 1; grid-row: 2; }
.card .name .org-mark { grid-column: 2; grid-row: 1 / span 2; }
.card .name .badge { grid-column: 1; grid-row: 3; justify-self: start; }
.card .name .ln, .card .name .fm { min-width: 0; }
table.list .who .nm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  align-items: center;
}
table.list .who .nm .ln { grid-column: 1; grid-row: 1; }
table.list .who .nm .fm { grid-column: 1; grid-row: 2; }
table.list .who .nm .org-mark { grid-column: 2; grid-row: 1 / span 2; }
table.list .who .nm .badge { grid-column: 1; grid-row: 3; justify-self: start; }
table.list .who .nm .ln, table.list .who .nm .fm { min-width: 0; }
.drawer h2.name2 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.drawer h2.name2 .nm2 { min-width: 0; text-align: left; }
.up-item b { display: inline; }
.up-item .org-mark { display: inline-block; vertical-align: -3px; margin-left: 5px; }
@media (prefers-reduced-motion: reduce) {
  .org-mark { animation: none; filter: drop-shadow(0 0 4px rgba(245, 80, 30, .8)); }
}
