:root {
  --bg: #1A1D23;
  --card: #23272F;
  --card2: #2B303A;
  --line: #353B47;
  --text: #E4E6EB;
  --muted: #A8AEBF;
  --faint: #969CAD;          /* контраст ≥ 4,5 на карточках */
  --accent: #FF6E00;
  --accent2: #F7931E;
  --grad: linear-gradient(135deg, #F7931E, #FF6E00);
  --on-accent: #1A1D23;      /* тёмный текст на оранжевом: белый не проходит по контрасту */
  --green: #34C38F;
  --yellow: #F5B942;
  --red: #FF7A7F;
  --grey: #5B6173;
  --r: 18px;
  --r-sm: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 700; margin: 0; }
h2 a { display: inline-flex; align-items: center; gap: 4px; }
h2 a:hover { color: var(--accent2); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- шапка и меню ---------- */
header.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .wordmark { height: 20px; width: auto; display: block; }
.brand .app { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.brand:hover .app { color: var(--accent2); }
header nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }   /* узкий экран: меню листается внутри шапки */
header nav::-webkit-scrollbar { display: none; }
@media (min-width: 641px) and (max-width: 1100px) { .brand .app { display: none; } header nav a { padding: 8px 8px; font-size: 14px; }
  header.top nav .full { display: none; } header.top nav .short { display: inline; } }   /* header.top — сильнее общего .short{none} ниже */
header nav a { padding: 8px 13px; border-radius: 999px; color: var(--muted); font-weight: 600; white-space: nowrap; }
header nav a.on { background: var(--card2); color: var(--text); }
.me { position: relative; margin-left: auto; }
.me summary { list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 700; }
.me summary::-webkit-details-marker { display: none; }
.me .menu { position: absolute; right: 0; top: 44px; background: var(--card2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px; display: grid; gap: 10px; min-width: 220px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }

/* телефон: разделы — нижней панелью, как в приложении */
@media (max-width: 640px) {
  header.top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  header nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  header nav a { min-height: 48px; display: grid; place-items: center; padding: 4px 2px; font-size: 12px; border-radius: 12px; }
  header nav a.on { background: var(--card2); color: var(--accent2); }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
}

main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.back { display: inline-flex; align-items: center; min-height: 32px; color: var(--muted); font-size: 14px; }

/* ---------- переключатель периода ---------- */
.seg { display: inline-flex; background: var(--card); border-radius: 999px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { padding: 8px 13px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg a.on { background: var(--grad); color: var(--on-accent); }
@media (max-width: 480px) {
  .head > .seg { width: 100%; justify-content: space-between; }
  .seg a { padding: 10px 8px; font-size: 13px; flex: 1; text-align: center; }
}

.periods { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.periods > .seg { min-width: 0; }
details.dates { position: relative; }
details.dates summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  background: var(--card); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
details.dates summary::-webkit-details-marker { display: none; }
details.dates.on summary { background: var(--grad); color: var(--on-accent); }
details.dates[open] summary { outline: 1px solid var(--line); }
.datepick { position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; display: grid; gap: 10px; background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); min-width: 240px; }
.datepick label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.daypick input { padding: 7px 10px; border-radius: 999px; background: var(--card); border-color: var(--card); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 16px; }
.filters select, .filters input:not([type=checkbox]) { background: var(--card); border-color: var(--card); }
.filters .reset { color: var(--accent2); font-size: 14px; font-weight: 600; margin-left: 4px; }
.filters.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 0; }
.filters.grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters.grid .actions { display: flex; gap: 10px; align-items: center; }
details.filterbox > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
details.filterbox > summary h2 { white-space: nowrap; }
details.filterbox > summary::-webkit-details-marker { display: none; }
details.filterbox > summary h2::before { content: "▸ "; color: var(--accent2); }
details.filterbox[open] > summary h2::before { content: "▾ "; }
@media (max-width: 600px) {
  .filters.grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters.grid .wide, .filters.grid .actions { grid-column: 1 / -1; }
  .filters.grid select, .filters.grid input:not([type=checkbox]) { width: 100%; }
}
.dl { font-weight: 700; color: var(--faint); white-space: nowrap; }
.dl.good { color: var(--green); } .dl.bad { color: var(--red); }
.tile.accent .dl, .pulse .main .delta { display: inline-block; background: var(--bg); color: var(--text); padding: 2px 9px; border-radius: 8px; margin: 2px 0 4px; }
.tile.accent .dl.good, .pulse .main .delta.good { color: var(--green); }
.tile.accent .dl.bad, .pulse .main .delta.bad { color: var(--red); }
@media (max-width: 480px) {
  .periods { width: 100%; }
  .periods > .seg { width: 100%; justify-content: space-between; }
  details.dates { flex: 1; } details.dates summary { width: 100%; justify-content: center; }
  .datepick { left: 0; right: 0; }
  .daypick { flex: 1; } .daypick input { width: 100%; }
  .filters select { flex: 1 1 45%; }
}

/* ---------- карточки и плитки ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 0 0 16px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fresh { font-size: 12px; color: var(--faint); }
.fresh.bad { color: var(--yellow); }
.card.stale { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--yellow) 45%, transparent); }   /* цифры читаются, рамка предупреждает */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--card2); border-radius: var(--r-sm); padding: 12px 14px; min-width: 0; }
.tile .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .v small { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .l { color: var(--muted); font-size: 13px; }
.tile.accent { background: var(--grad); color: var(--on-accent); }
.tile.accent .l, .tile.accent .v small { color: rgba(26,29,35,.8); }
@media (max-width: 600px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tile .v { font-size: 23px; }
}
@media (min-width: 900px) { .tiles.four { grid-template-columns: repeat(4, 1fr); } }
.cols { display: grid; gap: 16px; margin-bottom: 16px; align-items: start; }
.cols > * { min-width: 0; }
.cols .card { margin: 0; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; } }

/* итог дня */
.pulse { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pulse > * { background: var(--card); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.pulse .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.pulse .v small { font-size: 16px; color: var(--faint); font-weight: 700; }
.pulse .l { color: var(--muted); font-size: 13px; }
.pulse .delta { font-size: 13px; font-weight: 700; }
.delta.up { color: var(--red); } .delta.down { color: var(--green); }
.pulse .main { background: var(--grad); color: var(--on-accent); }
.pulse .main .l, .pulse .main .v small { color: rgba(26,29,35,.8); }
@media (max-width: 600px) { .pulse { grid-template-columns: 1fr 1fr; } .pulse .main { grid-column: 1 / -1; } .pulse .v { font-size: 26px; } }

/* звонок дня */
.hero-call { display: grid; gap: 8px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--card)), var(--card)); }
.hero-call .who { font-size: 18px; font-weight: 800; }

/* ---------- менеджеры ---------- */
.people { display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: 14px 1fr auto; grid-template-areas: "dot who nums" ". meta meta" ". bar bar";
  column-gap: 12px; row-gap: 6px; align-items: center; background: var(--card2); border-radius: var(--r-sm); padding: 12px 14px; }
.prow:hover { outline: 1px solid var(--line); }
.prow .dot { grid-area: dot; }
.prow .who { grid-area: who; display: grid; min-width: 0; }
.prow .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .who span { font-size: 13px; }
.prow .nums { grid-area: nums; text-align: right; }
.prow .big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.prow .big .of { font-size: 15px; color: var(--faint); font-weight: 700; }
.prow .status { font-size: 12px; color: var(--faint); }
.prow .status.red { color: var(--red); } .prow .status.yellow { color: var(--yellow); } .prow .status.green { color: var(--green); }
.prow .meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prow .progress { grid-area: bar; }
@media (min-width: 900px) {
  .prow { grid-template-columns: 14px minmax(200px, 1.1fr) 2fr minmax(150px, auto); grid-template-areas: "dot who meta nums" ". bar bar bar"; }
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--grey); flex: none; }
.dot.green, .progress i.green { background: var(--green); }
.dot.yellow, .progress i.yellow { background: var(--yellow); }
.dot.red, .progress i.red { background: var(--red); }
.progress { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grey); border-radius: 3px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.meeting_scheduled { color: var(--green); } .tag.refused { color: var(--red); }

/* ---------- сигналы ---------- */
.signals { display: grid; gap: 8px; margin-bottom: 16px; }
.sig { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--r-sm); padding: 8px 8px 8px 12px; border-left: 4px solid var(--grey); }
.sig.red { border-left-color: var(--red); }
.sig.yellow { border-left-color: var(--yellow); }
.sig a.t { flex: 1; min-width: 0; }
.sig a.t::after { content: " ›"; color: var(--faint); }
.sig form { margin: 0; }

/* ---------- таблицы ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
td, th { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.name { min-width: 200px; overflow-wrap: anywhere; }
td.name b { font-weight: 600; }
tr.dim td { color: var(--faint); }
/* таблицы кампаний на телефоне — карточками */
@media (max-width: 600px) {
  table.cards tr:first-child { display: none; }
  table.cards tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { border: 0; padding: 0; text-align: left; }
  table.cards td.name { grid-column: 1 / -1; min-width: 0; }
  table.cards td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--faint); font-weight: 600; }
  table.cards .hide-m { display: none; }
  .hide-m { display: none; }
}
/* таблицы админки на телефоне — стопкой полей */
.edit input:not([type=checkbox]), .edit select { width: 100%; }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; white-space: nowrap; }
@media (max-width: 980px) {
  table.edit tr:first-child { display: none; }
  table.edit tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.edit td { border: 0; padding: 0; text-align: left; }
  table.edit td.wide, table.edit td:first-child, table.edit td:last-child { grid-column: 1 / -1; }
  table.edit td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  table.edit input:not([type=checkbox]), table.edit select, table.edit .btn { width: 100%; min-height: 44px; }
}
@media (min-width: 981px) { .chk .t { display: none; } }
table .btn.sm:not(.ghost) { background: var(--card2); color: var(--muted); }
table form.dirty .btn.sm:not(.ghost), .dirty > .btn { background: var(--grad); color: var(--on-accent); }
tr:has(form.dirty) td { background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* ---------- звонки ---------- */
.calls { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .calls.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.call { position: relative; display: grid; gap: 6px; align-content: start; background: var(--card2); border-radius: var(--r-sm); padding: 12px 14px; min-width: 0; }
.call:hover { outline: 1px solid var(--line); }
.call .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; min-width: 0; }
.call .top a { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.call .top a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.call .sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; align-items: center; }
.call .sum { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.call audio, .call .play { position: relative; z-index: 1; }
.play { justify-self: start; }
.call .btn.play { background: var(--bg); color: var(--text); }
.call .btn.play svg { color: var(--accent2); }
.score { font-weight: 800; font-variant-numeric: tabular-nums; }
.score.good { color: var(--green); } .score.mid { color: var(--yellow); } .score.bad { color: var(--red); } .score.muted { color: var(--faint); }
audio { width: 100%; height: 40px; }
.kv { display: grid; gap: 14px; margin: 0; }
.kv dt { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kv dd { margin: 3px 0 0; white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.kv a { color: var(--accent2); }
details.tr summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
details.tr pre { white-space: pre-wrap; font: inherit; color: var(--muted); max-height: 70vh; overflow: auto; margin: 12px 0 0; }
.scorebadge { display: inline-flex; align-items: baseline; gap: 4px; background: var(--card); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: var(--muted); }
.scorebadge .score { font-size: 20px; }

/* ---------- график ---------- */
.bars { display: flex; gap: 3px; height: 180px; padding-top: 20px; }
.bars .b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bars .col { flex: 1; position: relative; }
.bars .f { position: absolute; bottom: 0; left: 14%; right: 14%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 1px 1px; }
.bars .off .f { background: var(--line); }
.bars .v { position: absolute; left: -6px; right: -6px; margin-bottom: 3px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars .pl { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--text); opacity: .6; }
.bars .d { padding-top: 5px; text-align: center; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bars .off .d { opacity: .6; }
@media (max-width: 600px) { .bars.dense .b:nth-last-child(n+11) { display: none; } }   /* на телефоне — последние 10 дней с подписями */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.empty { color: var(--faint); padding: 24px 0; text-align: center; }

/* ---------- формы ---------- */
input, select, textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 11px; font: inherit; min-width: 0; }
input::placeholder { color: #6E7486; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); padding: 0; }
input.n { width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--grad); color: var(--on-accent); border: 0;
  border-radius: 10px; padding: 9px 15px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; text-align: left; }
.linkbtn:hover { color: #fff; }
.linkbtn.danger:hover { color: var(--red); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.flash { background: color-mix(in srgb, var(--green) 18%, var(--card)); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; }
.error { background: color-mix(in srgb, var(--red) 22%, var(--card)); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; background: var(--bg); padding: 8px 12px; border-radius: 8px; user-select: all; display: inline-block; }
.savebar { position: sticky; bottom: 0; padding: 14px 0 4px; background: linear-gradient(transparent, var(--card) 35%); }
@media (max-width: 640px) { .savebar { bottom: calc(64px + env(safe-area-inset-bottom)); } }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a { padding: 7px 13px; border-radius: 999px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.subnav a.on { background: var(--card2); color: var(--text); }
@media (max-width: 760px) {
  .subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 16px; padding: 0 16px;
    mask-image: linear-gradient(90deg, #000 86%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); }
  .subnav::-webkit-scrollbar { display: none; }
}

header nav .short { display: none; }
@media (max-width: 640px) { header nav .full { display: none; } header nav .short { display: inline; } }

details.duties > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }

/* ---------- подсказки «?» (Popover API) и экскурсия ---------- */
.hint { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; vertical-align: 2px;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted);
  font: 800 12px/1 Manrope, system-ui, sans-serif; cursor: pointer; position: relative; }
.hint::after { content: ""; position: absolute; inset: -11px; }            /* палец попадает по 44 px, глаз видит 22 */
.hint:hover, .hint:focus-visible { color: var(--accent2); border-color: var(--accent2); }
.hint-pop { width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto; padding: 16px 18px 18px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55); font-size: 15px; font-weight: 500; line-height: 1.55; letter-spacing: normal; text-transform: none; text-align: left; }
.hint-pop::backdrop { background: rgba(5, 7, 20, .45); }
.hint-pop .hint-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 16px; }
.hint-pop .hp { display: block; margin-top: 10px; color: var(--text); }
.hint-pop .hp + .hp { color: var(--muted); }
.hint-x { border: 0; background: var(--card2); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; flex: none; }
@supports not selector(:popover-open) { .hint, .hint-pop { display: none !important; } }   /* старый браузер — без подсказок, но и без мусора */

.tour-spot { position: fixed; z-index: 100; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent2), 0 0 0 9999px rgba(5, 7, 20, .66); transition: all .25s ease; }
.tour-card { position: fixed; z-index: 101; padding: 16px 18px; border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); line-height: 1.5; }
.tour-card b { font-size: 16px; }
.tour-card p { margin: 6px 0 14px; color: var(--muted); }
.tour-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-nav .faint { margin-right: auto; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; line-height: 1.5; }
.help-map td a { color: var(--accent2); font-weight: 600; }
.help-dict dd { line-height: 1.5; }

.rowact { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.tag.ai { color: var(--accent2); }

.prow .status { white-space: nowrap; }
.seg.quick { margin: 0 0 12px; overflow-x: auto; }
details.fold > summary { cursor: pointer; }
@media (max-width: 480px) {
  .periods:has(.daypick) { flex-wrap: nowrap; }
  .periods:has(.daypick) > .seg { flex: 1; width: auto; }
  .daypick { flex: 0 0 140px; } .daypick input { width: 100%; }
}

/* ---------- отчёты и выгрузка ---------- */
.scrollx { overflow-x: auto; }
table.export { font-size: 13px; white-space: nowrap; }
table.export td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.ai-ask textarea { width: 100%; resize: vertical; min-height: 64px; }
button.tag.qsample { border: 0; cursor: pointer; font: 600 12px/1.3 Manrope, system-ui, sans-serif; white-space: normal; text-align: left; min-height: 32px; }
.history li { margin-bottom: 6px; } .history a { color: var(--accent2); }
@media print {
  header.top, .noprint, .ai-ask, .periods, form, .hint { display: none !important; }
  body { background: #fff; color: #000; } .card { background: #fff; box-shadow: none; border: 1px solid #ccc; }
  .rtext, .rh, .learn, .faint, .muted { color: #000 !important; }
}

/* ---------- вердикт дня, мини-графики, медиана команды ---------- */
.verdict { margin: 0 0 12px; padding: 11px 14px; border-radius: var(--r-sm); font-weight: 700; line-height: 1.4;
  background: var(--card); border-left: 4px solid var(--line); }
.verdict.green { border-left-color: var(--green); } .verdict.yellow { border-left-color: var(--yellow); }
.verdict.red { border-left-color: var(--red); } .verdict.grey { color: var(--muted); font-weight: 600; }
.spark { display: block; width: 100%; height: 26px; margin-top: 8px; overflow: visible; }
.spark polyline { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .55; vector-effect: non-scaling-stroke; }
.spark circle { fill: currentColor; }
.tile .team { font-size: 12px; color: var(--faint); margin-top: 4px; }
.status.green { color: var(--green); } .status.yellow { color: var(--yellow); } .status.red { color: var(--red); }

.tile .why { font-size: 12px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }

.bars .b.ev .d { color: var(--accent); font-weight: 800; }
.bars .b.ev .d::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 2px auto 0; }
.legend .evdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 4px; }
ul.events { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
ul.events li { padding: 4px 0; border-top: 1px solid var(--line); }
details.evadd { margin-top: 10px; }
details.evadd summary { cursor: pointer; color: var(--accent2); }

/* ---------- обучение ---------- */
.skillbar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; min-width: 80px; }
.skillbar i { display: block; height: 100%; border-radius: 4px; }
.skillbar i.green { background: var(--green); } .skillbar i.yellow { background: var(--yellow); } .skillbar i.red { background: var(--red); }
.focus .skillbar { margin: 6px 0 4px; }
table.skills td.barcell { width: 40%; }
table.skills.team th { white-space: normal; font-size: 11px; }
@media (max-width: 480px) { table.skills:not(.team) .n { display: none; } table.skills .skillbar { min-width: 48px; } }
.videos li.done a { text-decoration: line-through; opacity: .7; }
form.inline { display: inline; }
.growth .small a, .growth a.small { color: var(--accent2); }

/* ---------- ИИ-коуч ---------- */
.coach .growth { padding: 10px 12px; background: var(--card2); border-radius: var(--r-sm); margin-top: 8px; line-height: 1.45; }
.coach .growth.hi { border-left: 3px solid var(--yellow); }
.coach .quote { color: var(--muted); font-style: italic; margin-top: 4px; overflow-wrap: anywhere; }
.coach .better { color: var(--green); margin-top: 4px; }
.coach .learn { margin: 0; padding-left: 18px; line-height: 1.6; }

/* ---------- вечерние отчёты ---------- */
.warn { color: var(--yellow); }
.tag.good { color: var(--green); } .tag.bad { color: var(--red); }
.report-form { display: grid; gap: 16px; }
.rf { display: grid; gap: 4px; } .rf .t { font-weight: 700; } .rf textarea { width: 100%; resize: vertical; min-height: 88px; line-height: 1.45; }
.rh { font-size: 13px; color: var(--muted); margin: 14px 0 4px; font-weight: 700; } .rblock:first-child .rh { margin-top: 0; }
.rtext { margin: 0; white-space: pre-line; line-height: 1.5; overflow-wrap: anywhere; }
.rblock.ask { background: color-mix(in srgb, var(--yellow) 10%, transparent); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 12px; }
.rblock.ask .rh { margin-top: 0; color: var(--yellow); }
a.card.myrep { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: center; color: inherit; text-decoration: none; }

/* ---------- воронки ---------- */
.fchain { display: grid; gap: 8px; }
.fstep { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; background: var(--card2); border-radius: var(--r-sm); padding: 10px 14px; }
.fstep .bar { grid-column: 1 / -1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.fstep .bar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }
.fstep .n { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.kindtag.won { color: var(--green); } .kindtag.lost { color: var(--red); } .kindtag.side { color: var(--muted); }

/* ---------- KPI ---------- */
.roles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 16px; }
.role-card { display: grid; gap: 8px; align-content: start; margin: 0; }
.role-card:hover { outline: 1px solid var(--line); }
.role-card .btn { justify-self: start; }
.kpi-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 3px; }
.kpi-list b { color: var(--text); }
table.kpis td { vertical-align: top; }
.kbar { min-width: 150px; }
.kbar .progress { margin: 7px 0 4px; }
.tag.main { background: var(--grad); color: var(--on-accent); }
details.rolefrom summary { cursor: pointer; margin-top: 4px; list-style: none; }
details.rolefrom summary::-webkit-details-marker { display: none; }
@media (max-width: 600px) {
  table.kpis tr:first-child { display: none; }
  table.kpis tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.kpis td { border: 0; padding: 0; }
  table.kpis td:first-child, table.kpis td.kbar { grid-column: 1 / -1; }
  table.kpis td.num { text-align: left; }
  table.kpis td.num[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--faint); font-weight: 600; }
  table.kpis td.kbar { display: flex; align-items: center; gap: 10px; } table.kpis .kbar .progress { flex: 1; margin: 0; }
  .tile.dup { display: none; }
}

/* ---------- касание пальцем: зоны не меньше 44 px ---------- */
@media (pointer: coarse) {
  .seg a, .subnav a, .btn, .linkbtn, input:not([type=checkbox]), select { min-height: 44px; }
  .seg a, .subnav a, .linkbtn { display: inline-flex; align-items: center; justify-content: center; }
  .me summary { width: 44px; height: 44px; }
  .brand, .me .menu a, .me .menu .linkbtn { min-height: 44px; display: flex; align-items: center; }
  details.dates summary, details.filterbox > summary, .filters .reset, .card-h > a, .card-h .small a { min-height: 44px; display: inline-flex; align-items: center; }
  input[type=checkbox] { width: 24px; height: 24px; }
  .back, h2 a { min-height: 44px; }
  .chk { min-height: 44px; }
  td > a { display: block; min-height: 44px; }
  a.tag { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 14px; }
  .coach a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---------- вход: фирменный navy + оранжевое свечение ---------- */
body.login-page {
  background:
    radial-gradient(900px 520px at 50% -8%, #01033E 0%, color-mix(in srgb, #01033E 55%, transparent) 45%, transparent 75%),
    radial-gradient(520px 320px at 85% 105%, rgba(247, 147, 30, .16), transparent 70%),
    radial-gradient(420px 260px at 8% 95%, rgba(255, 110, 0, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body.login-page main { padding: 0 16px; }
.login { min-height: 100svh; display: grid; place-items: center; padding-block: 32px; }
.login-box { width: min(400px, 100%); display: grid; justify-items: center; gap: 22px; }
.login-logo { width: 220px; height: auto; filter: drop-shadow(0 10px 30px rgba(247, 147, 30, .18)); }
.login-card { width: 100%; display: grid; gap: 14px; padding: 28px;
  background: color-mix(in srgb, var(--card) 88%, #01033E); border: 1px solid color-mix(in srgb, var(--line) 70%, #01033E);
  border-radius: var(--r); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.login-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: .01em; }
.login-head p { margin: 0; font-size: 14px; }
.fld { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.fld input { padding: 12px 14px; min-height: 48px; font-size: 16px; font-weight: 500; color: var(--text); }
.login-card .btn { min-height: 48px; font-size: 16px; margin-top: 4px; }
.login-card .error { margin: 0; }
.login-foot { margin: 0; text-align: center; }
@media (max-width: 480px) { .login-logo { width: 180px; } .login-card { padding: 22px 18px; } .login { padding-block: 20px; } }
