/* Рабочее пространство инспектора: оболочка и компоненты.
   Правило против перегруза: на экране одно главное действие, цвет только у состояния и у того, на что нажимают,
   подробности раскрываются по запросу. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.secondary { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--s { width: 14px; height: 14px; }
.icon--l { width: 18px; height: 18px; }

/* ---------- оболочка ---------- */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 12px; border-right: 1px solid var(--border); z-index: 6; /* меню «Кто работает» должно лежать поверх содержимого экрана */
}
.rail__logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin-bottom: 10px; }
.rail__item {
  position: relative; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3);
  border: 0; background: none; cursor: pointer;
}
.rail__item:hover { background: var(--surface-2); color: var(--text); }
.rail__item[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.rail__item[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail__count {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--critical); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}
.rail__me { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 0; cursor: pointer; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.crumbs b { color: var(--text); font-weight: 500; }
.searchbtn {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 10px; min-width: 300px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3); cursor: pointer; font-size: 13px;
}
.searchbtn:hover { border-color: var(--border-strong); color: var(--text-2); }
.kbd { margin-left: auto; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); font-size: 11px; color: var(--text-3); }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.today { font-size: 13px; color: var(--text-3); }

.page { padding: 28px 32px 56px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page__head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page__title { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.015em; }
.page__sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { border-color: transparent; color: var(--text-2); }
.btn--l { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--s { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.linkmore { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 500; }
.linkmore:hover { color: var(--accent-hover); }

/* ---------- карточка ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card__head { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px 0; }
.card__title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.card__note { color: var(--text-3); font-size: 12.5px; }
.card__body { padding: 16px 20px 20px; }
.card__foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; }

/* ---------- число с подписью ---------- */
.stat { padding: 16px 20px 18px; }
.stat__label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat__row { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; }
.stat__value { font-size: 32px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; }
.stat__aside { color: var(--text-3); font-size: 20px; line-height: 24px; font-weight: 500; }
.stat__sub { margin-top: 6px; color: var(--text-3); font-size: 12.5px; }

/* ---------- состояние: точка + подпись ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot--critical { background: var(--critical); }
.dot--serious { background: var(--serious); }
.dot--warning { background: var(--warning); }
.dot--good { background: var(--good); }
.dot--accent { background: var(--accent); }
.dot--hollow { background: none; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--surface-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip--critical { background: var(--critical-soft); color: var(--text); }
.chip--serious { background: var(--serious-soft); color: var(--text); }
.chip--warning { background: var(--warning-soft); color: var(--text); }
.chip--good { background: var(--good-soft); color: var(--text); }
.chip--outline { background: none; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-3); }
.sev { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; }

/* ---------- строки-ссылки ---------- */
.rows > li + li { border-top: 1px solid var(--border); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 13px 20px; cursor: pointer; }
.row:hover { background: var(--surface-2); }
.row__title { font-weight: 500; display: flex; align-items: center; gap: 9px; min-width: 0; }
.row__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { grid-column: 1; color: var(--text-3); font-size: 12.5px; padding-left: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__side { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 10px; color: var(--text-3); }

/* ---------- шкала: имя, полоса, число ---------- */
.meters { display: grid; gap: 14px; }
.meter__top { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.meter__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter__value { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.meter__track { position: relative; height: 6px; margin-top: 7px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); }
.meter__tick { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.meter--serious .meter__track { background: color-mix(in srgb, var(--serious) 22%, var(--surface)); }
.meter--serious .meter__fill { background: var(--serious); }
.meter__sub { margin-top: 5px; color: var(--text-3); font-size: 12px; }

/* ---------- график ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart__axis text { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart__line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--muted { stroke: var(--series-muted); stroke-dasharray: 4 4; }
.chart__area { fill: var(--series-1); opacity: 0.10; }
.chart__end { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart__cross { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; gap: 16px; color: var(--text-2); font-size: 12.5px; }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--series-1); vertical-align: middle; margin-right: 6px; }
.legend i.muted { border-top: 2px dashed var(--series-muted); }
.tip {
  position: absolute; pointer-events: none; min-width: 150px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); box-shadow: var(--shadow-pop);
  font-size: 12.5px; opacity: 0; transition: opacity .08s;
}
.tip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip__date { color: var(--text-3); margin-bottom: 4px; }
.tip__row { display: flex; align-items: center; gap: 8px; }
.tip__row i { width: 12px; border-top: 2px solid var(--series-1); }
.tip__row i.muted { border-top: 2px dashed var(--series-muted); }
.tip__row span { color: var(--text-2); margin-left: auto; padding-left: 12px; order: 3; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); }

/* ---------- таблица ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }

/* ---------- обращения: список и карточка ---------- */
.work { display: grid; grid-template-columns: 372px minmax(0, 1fr); height: calc(100vh - var(--topbar)); }
.queue { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.queue__head { padding: 16px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--border); }
.queue__title { display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 600; }
.queue__title small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--border); background: none; color: var(--text-2); font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.filter:hover { border-color: var(--border-strong); color: var(--text); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500; }
.filter b { font-weight: 500; opacity: .6; }
.queue__list { overflow-y: auto; flex: 1; }
.qrow { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 12px 16px 12px 19px; border-bottom: 1px solid var(--border); cursor: pointer; }
.qrow:hover { background: var(--surface); }
.qrow[aria-current="true"] { background: var(--surface); }
.qrow[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.qrow__title { font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.qrow__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__due { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.qrow__due--hot { color: var(--text); font-weight: 500; }
.qrow__addr { grid-column: 1 / -1; color: var(--text-2); font-size: 12.5px; padding-left: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__why { grid-column: 1 / -1; color: var(--text-3); font-size: 12.5px; padding-left: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__state { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

.detail { overflow-y: auto; min-width: 0; }
.detail__in { max-width: 1040px; margin: 0 auto; padding: 24px 32px 56px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px 32px; align-items: start; }
.detail__head { grid-column: 1 / -1; }
.detail__over { color: var(--text-3); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.detail__title { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.015em; margin-top: 6px; }
.detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; color: var(--text-2); font-size: 13px; }
.detail__meta a { color: var(--accent); }

/* следующий шаг: единственная главная кнопка экрана */
.next { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.next__text { flex: 1; min-width: 0; }
.next__label { color: var(--text-2); font-size: 12.5px; }
.next__what { font-size: 15px; font-weight: 600; margin-top: 2px; }
.next__why { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

/* путь обращения */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 4px; }
.step { position: relative; padding-top: 22px; font-size: 12.5px; color: var(--text-3); }
.step::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--surface-3); }
.step::before { left: 6px; right: -6px; } .step:last-child::before { display: none; }
.step::after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--surface-3); }
.step b { display: block; color: var(--text-2); font-weight: 500; font-size: 13px; }
.step--done::before { background: var(--accent); }
.step--done::after { background: var(--accent); box-shadow: none; }
.step--done b { color: var(--text); }
.step--now::after { background: var(--bg); box-shadow: inset 0 0 0 3px var(--accent); }
.step--now b { color: var(--text); }
.step--late::after { box-shadow: inset 0 0 0 3px var(--critical); }

.block__title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.why { display: grid; gap: 8px; }
.why li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; }
.why__pts { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; font-size: 12.5px; }
.quote { padding: 14px 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); white-space: pre-wrap; }
.more { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; color: var(--text-3); font-size: 12.5px; background: none; border: 0; padding: 0; cursor: pointer; }
.more:hover { color: var(--text); }

.side { display: grid; gap: 14px; }
.side .card__body { padding: 14px 16px 16px; }
.side h3 { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; text-transform: none; }
.side__big { font-weight: 600; font-size: 14px; color: var(--accent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12.5px; margin-top: 8px; }
.kv dt { color: var(--text-3); }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--warning-soft); font-size: 12.5px; color: var(--text); }
.note .icon { color: var(--warning); margin-top: 1px; }
.note--info { background: var(--surface-2); } .note--info .icon { color: var(--accent); }
.note a { color: var(--accent); font-weight: 500; }
.tl { display: grid; gap: 10px; font-size: 12.5px; }
.tl li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; }
.tl time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tag-demo { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-3); letter-spacing: .02em; text-transform: uppercase; }

/* предложение помощника */
.offer { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.offer__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.offer__title { font-weight: 600; }
.offer__text { color: var(--text-2); font-size: 13px; margin-top: 2px; }

@media (max-width: 1180px) {
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2-1 { grid-template-columns: 1fr; }
  .detail__in { grid-template-columns: 1fr; }
}

/* ---------- раскладка-помощники ---------- */
.hstack { display: flex; align-items: center; gap: 8px; }
.hstack--wrap { flex-wrap: wrap; }
.vstack { display: grid; gap: 12px; align-content: start; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

/* ---------- состояния: загрузка, пусто, ошибка ---------- */
.state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 32px 20px; color: var(--text-3); font-size: 13px; text-align: center; }
.state--error { color: var(--text); background: var(--critical-soft); border-radius: 8px; justify-content: flex-start; padding: 12px 14px; text-align: left; }
.state--error .icon { color: var(--critical); }
.is-stale { opacity: 0.6; transition: opacity .15s; }

/* ---------- формы ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text);
  padding: 8px 11px; font-size: 13.5px; line-height: 1.45;
}
.input, .select { height: 36px; padding-top: 0; padding-bottom: 0; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.textarea { min-height: 120px; resize: vertical; }
.textarea--letter { min-height: 300px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--danger { border-color: color-mix(in srgb, var(--critical) 60%, transparent); }

/* двухпозиционный и многопозиционный переключатель */
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-2); gap: 2px; }
.segmented button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--border-strong); }

/* ---------- окно ---------- */
dialog.modal {
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal--wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.modal__title { font-size: 16px; font-weight: 600; flex: 1; }
.modal__body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 16px; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.modal__foot .spacer + * { margin-left: 0; }
.modal__note { color: var(--text-3); font-size: 12.5px; margin-right: auto; max-width: 320px; }

/* ---------- выпадающее меню ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 6px; border-radius: 10px; background: var(--surface-2); box-shadow: var(--shadow-pop); display: grid; gap: 1px; }
.menu--left { right: auto; left: 0; }
.menu--up { top: auto; bottom: calc(100% + 6px); }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.menu__item:hover, .menu__item[aria-selected="true"] { background: var(--surface-3); }
.menu__item .icon { color: var(--text-3); }
.menu__sep { height: 1px; margin: 5px 4px; background: var(--border); }
.menu__label { padding: 6px 10px 4px; font-size: 11.5px; color: var(--text-3); }

/* ---------- поиск по Ctrl+K ---------- */
dialog.palette { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.palette::backdrop { background: rgba(0, 0, 0, 0.5); }
.palette__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.palette__input input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); }
.palette__list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette__group { padding: 10px 10px 4px; font-size: 11.5px; color: var(--text-3); }
.palette__item { display: grid; grid-template-columns: 20px 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.palette__item[aria-selected="true"], .palette__item:hover { background: var(--surface-2); }
.palette__item .icon { color: var(--text-3); }
.palette__item small { grid-column: 2; color: var(--text-3); font-size: 12px; }
.palette__empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- сообщения ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.toast .icon { color: var(--good); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { position: relative; height: 38px; padding: 0 12px; border: 0; background: none; color: var(--text-3); font-size: 13px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 500; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 1px; background: var(--accent); }
.tab b { font-weight: 400; color: var(--text-3); margin-left: 6px; }

/* ---------- график: столбцы и таблица ---------- */
.chart__bar { fill: var(--series-1); }
.chart__bar--on { fill: var(--accent-hover); }
.chart__table { margin-top: 10px; font-size: 12.5px; }
.chart__table summary { color: var(--text-3); cursor: pointer; width: max-content; }
.chart__table summary:hover { color: var(--text); }
.chart__table .table { margin-top: 8px; max-width: 420px; }
.chart__table td, .chart__table th { padding: 5px 12px 5px 0 !important; }

/* ---------- карта и метки ---------- */
.map { height: 560px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.pin { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .4); }
.pin--urgent { background: var(--critical); }
.pin--start { width: auto; height: 24px; margin: -12px 0 0 -26px; padding: 0 9px; border-radius: 6px; background: #0b0b0b; }
.num-badge { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.num-badge--off { background: var(--surface-3); color: var(--text-3); }

/* ---------- сроки по дням ---------- */
.day + .day { margin-top: 20px; }
.day__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.day__title { font-size: 15px; font-weight: 600; }
.day__title--late { color: var(--text); }
.kind { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }

/* плашка «обращение закрыто» и прочие спокойные сообщения в карточке */
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.letter-to { display: grid; gap: 10px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.checkline .icon { color: var(--good); }
.checkline--bad .icon { color: var(--warning); }
.menu-backdrop { position: fixed; inset: 0; z-index: 19; }
.menu--scroll { max-height: 60vh; overflow-y: auto; }
.crumbs a:hover { color: var(--text); }
.rail .menu { min-width: 180px; }
.chart__note { margin-top: 8px; color: var(--text-3); font-size: 12.5px; }
