/*
 * Деладо в окне Битрикс24.
 * Белая страница без карточек: структуру держат заголовки, линейки и воздух.
 * Янтарь работает как маркер: им отмечено выбранное и то, что требует внимания. Других акцентов нет.
 * Jost — заголовки и цифры, Golos Text — рабочий текст.
 */
@font-face {
    font-family: Jost;
    src: url("jost-cyrillic-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: Jost;
    src: url("jost-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Golos Text";
    src: url("golos-text-cyrillic-wght-normal.woff2") format("woff2");
    font-weight: 400 900;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Golos Text";
    src: url("golos-text-latin-wght-normal.woff2") format("woff2");
    font-weight: 400 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;
    --ink: #15181d;
    --soft: #626975;
    --rule: #e3e5e9;
    --tick: #d9dce1;
    --control: #aeb4bd;
    --wash: #f5f6f7;
    --marker: #fbb83a;
    --marker-deep: #f0a31a;
    --error: #b3261e;
    /* Зоны оценки: деления шкалы ярче, цифры темнее ради читаемости на белом */
    --low: #d5492f;
    --low-text: #b5361f;
    --mid: #f0a31a;
    --mid-text: #a26a00;
    --high: #2f9a69;
    --high-text: #1f7a50;
    --display: Jost, "Golos Text", sans-serif;
    font: 400 14px/1.5 "Golos Text", "Segoe UI", sans-serif;
    color: var(--ink);
    background: #fff;
    font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
h1 { font: 500 2rem/1.1 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
h2 { font: 500 1.36rem/1.2 var(--display); }
h3 { font: 500 1.13rem/1.25 var(--display); }
h4 { font-size: 1rem; font-weight: 600; }
strong, b { font-weight: 600; }
small { font-size: .87rem; color: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Маркер: штрих под выбранным и пометка того, что требует внимания */
.marked { background: linear-gradient(transparent 58%, var(--marker) 58% 92%, transparent 92%); padding: 0 2px; }

/* Шапка */
.preview-notice { padding: 5px 28px; background: var(--ink); color: #fff; font-size: .87rem; }
.appbar { display: flex; align-items: baseline; gap: 4px 32px; padding: 16px 28px 0; }
.brand { display: flex; align-items: center; gap: 9px; align-self: center; font: 500 1.33rem/1 var(--display); }
.logo { display: flex; align-items: center; gap: 2.5px; height: 20px; }
.logo i { width: 3px; height: 8px; border-radius: 2px; background: var(--ink); }
.logo i:nth-child(2), .logo i:nth-child(4) { height: 14px; }
.logo i:nth-child(3) { height: 20px; background: var(--marker); }
.tabs { display: flex; gap: 22px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.tabs button { flex: none; padding: 4px 0; border: 0; background: none; color: var(--soft); font-size: 1rem; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; background: linear-gradient(transparent 62%, var(--marker) 62% 90%, transparent 90%); }
.cabinet { margin-left: auto; color: var(--soft); font-size: .87rem; white-space: nowrap; }

.page { max-width: 1240px; padding: 26px 28px 56px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; margin-bottom: 22px; }
.lead { margin-top: 8px; color: var(--soft); max-width: 68ch; }
.hint, .empty { color: var(--soft); font-size: .93rem; max-width: 76ch; }
.stack { display: grid; gap: 16px; min-width: 0; }
#team-body, #coaching-body, #report-content { gap: 36px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 36px 48px; align-items: start; }
.block { min-width: 0; }
.block > h2 { padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.block > h2 + .hint { margin-top: 10px; }
.long-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78ch; }

/* Выбор из нескольких значений словами: период, фильтр критериев */
.choice { display: flex; align-items: baseline; gap: 18px; }
.choice[data-for="criterion-review"], .choice[data-for="criterion-filter"] { flex-wrap: wrap; }
.choice button { padding: 2px 0; border: 0; background: none; color: var(--soft); }
.choice button:hover { color: var(--ink); }
.choice button[aria-pressed="true"] { color: var(--ink); font-weight: 600; background: linear-gradient(transparent 62%, var(--marker) 62% 90%, transparent 90%); }

/* Сводка: одна цифра и предложение */
.summary { display: flex; align-items: center; gap: 22px; }
.figure { flex: none; font: 400 4.4rem/.82 var(--display); letter-spacing: -.03em; font-variant-numeric: lining-nums; }
.figure small { margin-left: .08em; font: inherit; font-size: .42em; letter-spacing: 0; color: var(--ink); }
.summary-text { display: grid; gap: 2px; max-width: 56ch; font-size: 1.07rem; line-height: 1.4; }
.summary-text span + span { color: var(--soft); font-size: .93rem; }

/* Шкала из делений */
.meter, .meter > span { display: block; height: 12px; background: repeating-linear-gradient(90deg, var(--tick) 0 3px, transparent 3px 5px); }
.meter { flex: none; width: 98px; overflow: hidden; }
.meter > span { background-image: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 5px); }
.meter[data-tone="low"] > span { background-image: repeating-linear-gradient(90deg, var(--low) 0 3px, transparent 3px 5px); }
.meter[data-tone="mid"] > span { background-image: repeating-linear-gradient(90deg, var(--mid) 0 3px, transparent 3px 5px); }
.meter[data-tone="high"] > span { background-image: repeating-linear-gradient(90deg, var(--high) 0 3px, transparent 3px 5px); }
:is(.score-value, .figure)[data-tone="low"], .figure[data-tone="low"] small { color: var(--low-text); }
:is(.score-value, .figure)[data-tone="mid"], .figure[data-tone="mid"] small { color: var(--mid-text); }
:is(.score-value, .figure)[data-tone="high"], .figure[data-tone="high"] small { color: var(--high-text); }
.score { display: inline-flex; align-items: center; gap: 14px; }
.score-value { flex: none; min-width: 1.6em; text-align: right; font: 500 1.2rem/1 var(--display); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.points, .status-text { flex: none; color: var(--soft); font-size: .87rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Кнопки и поля */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 18px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: #fff;
    font-weight: 500;
    white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--ink); color: #fff; }
.button:disabled { border-color: var(--tick); color: var(--control); }
.button.primary { background: var(--marker); border-color: var(--marker); font-weight: 600; }
.button.primary:hover:not(:disabled) { background: var(--marker-deep); border-color: var(--marker-deep); color: var(--ink); }
.button.primary:disabled { background: var(--wash); border-color: var(--wash); color: var(--control); }
.button.quiet, .button.back { min-height: 0; padding: 2px 0; border: 0; border-radius: 0; background: none; color: var(--soft); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--control); }
:is(.button.quiet, .button.back):hover:not(:disabled) { background: none; color: var(--ink); text-decoration-color: var(--ink); }
.button.back { margin-bottom: 26px; }
.button.danger { border-color: var(--error); color: var(--error); }
.button.danger:hover:not(:disabled) { background: var(--error); color: #fff; }
.button.small { min-height: 32px; padding: 3px 12px; font-size: .93rem; }
.start { justify-self: start; }
.link { padding: 0; border: 0; background: none; font-weight: 600; text-align: left; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.link.quiet { font-weight: 400; color: var(--soft); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--control); }
.link.quiet:hover { color: var(--ink); text-decoration-color: var(--ink); }

label, .label { display: block; margin-bottom: 6px; font-size: .87rem; color: var(--soft); }
input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--control);
    border-radius: 4px;
    background: #fff;
    text-overflow: ellipsis;
}
:is(input[type="text"], input[type="number"], select, textarea):hover:not(:disabled) { border-color: var(--ink); }
:is(input[type="text"], input[type="number"], select, textarea):focus-visible { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input::placeholder { color: var(--soft); }
:is(input, select, textarea):disabled { background: var(--wash); color: var(--soft); border-color: var(--tick); }
textarea { min-height: 68px; resize: vertical; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { min-width: 0; }
.toolbar { display: flex; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 30px; }
.toolbar .field { flex: 1 1 220px; max-width: 320px; }
.toolbar .field-narrow { flex-basis: 250px; max-width: 300px; }

.status { color: var(--soft); font-size: .93rem; overflow-wrap: anywhere; }
.status:empty { display: none; }
.page > section > .status, #reports-overview > .status { margin-bottom: 16px; }
.status[data-kind="error"] { color: var(--error); }
.status[data-kind="success"] { color: var(--ink); font-weight: 500; }

/* Таблицы */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table :is(th, td) { padding: 11px 20px 11px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: baseline; font-weight: 400; }
.data-table :is(th, td):last-child { padding-right: 0; }
.data-table thead th { padding-block: 10px 8px; color: var(--soft); font-size: .87rem; white-space: nowrap; }
.data-table tbody th { font-weight: 600; }
.data-table tbody th small { display: block; font-weight: 400; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { width: 1%; padding-right: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.data-table .weak { color: var(--soft); font-size: .93rem; overflow-wrap: anywhere; }
.data-table td:has(.score) { white-space: nowrap; width: 1%; padding-right: 32px; }
#team-sellers tbody th { min-width: 11em; overflow-wrap: anywhere; }
.data-table .weak { min-width: 11em; }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--wash); }
.sort { padding: 0; border: 0; background: none; color: inherit; }
.sort:hover { color: var(--ink); }
[aria-sort="ascending"] .sort::after { content: " ↑"; }
[aria-sort="descending"] .sort::after { content: " ↓"; }
[aria-sort]:not([aria-sort="none"]) .sort { color: var(--ink); font-weight: 600; }

/* Списки разборов */
.row-list { display: grid; }
.row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 2.6em;
    align-items: baseline;
    gap: 20px;
    width: 100%;
    padding: 11px 0;
    border: 0;
    border-bottom: 1px solid var(--rule);
    background: none;
    text-align: left;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--wash); }
.row:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.row-label { display: grid; min-width: 0; overflow-wrap: anywhere; }
.row-date { color: var(--soft); font-size: .93rem; white-space: nowrap; }
#report-list { border-top: 2px solid var(--ink); }
.plain-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.plain-list li small { flex: none; }
.pending { margin-bottom: 26px; max-width: 560px; }
.pending summary { cursor: pointer; color: var(--soft); }
.pending summary:hover { color: var(--ink); }
.pending[open] summary { margin-bottom: 12px; }
#report-list-card, #reports-more { margin-bottom: 20px; }

/* Сводка тренера */
.loss { border-bottom: 1px solid var(--rule); }
.loss:last-child { border-bottom: 0; }
.loss summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 6px 32px; padding: 13px 0; cursor: pointer; list-style: none; }
.loss summary::-webkit-details-marker { display: none; }
.loss summary:hover { background: var(--wash); }
.loss summary:hover strong, .loss[open] summary strong { text-decoration: underline; text-underline-offset: 4px; }
.loss-title { display: grid; min-width: 0; overflow-wrap: anywhere; }
.loss-count { color: var(--soft); font-size: .93rem; white-space: nowrap; }
.loss-body { display: grid; gap: 10px; max-width: 760px; padding: 4px 0 20px 20px; border-left: 3px solid var(--marker); margin-bottom: 14px; }
.loss-seller { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; }
.loss-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: .93rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px 56px; margin-top: 18px; }
.person { display: grid; gap: 4px; align-content: start; }
.person-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.person .plain-list { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: .93rem; }

/* Один разбор */
.report-nav { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.report-nav .button.back { margin-bottom: 0; }
.report-step { display: flex; align-items: baseline; gap: 18px; }
.report-step button:disabled { color: var(--control); text-decoration: none; }
.report-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; margin-bottom: 26px; }
#report-provisional { margin-bottom: 16px; }
.report-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.report-actions { display: flex; align-items: baseline; gap: 6px 22px; flex-wrap: wrap; margin-top: 12px; }
.report-actions a { cursor: pointer; }
.report-task-list, .report-task-details { display: inline-flex; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.report-task-list { gap: 4px 18px; }
.report-task-details { gap: 2px 8px; }
.player { position: sticky; top: 0; z-index: 2; display: grid; gap: 6px; margin-bottom: 26px; padding: 10px 0; background: #fff; border-block: 1px solid var(--rule); }
.player audio { width: 100%; height: 40px; }
.note-action { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; font-size: .93rem; }
.note-action .status:empty { display: none; }
.report-head h1:focus { outline: none; }
.report-score { display: grid; gap: 14px; justify-items: end; }
.note { max-width: 78ch; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.note:last-child { border-bottom: 0; }
.note h4 { margin-bottom: 4px; }
.block.stack > .note { margin-top: -16px; }
.block.stack > h2 + .note { margin-top: -6px; }
.section-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 0 56px; }
.section-scores > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.section-scores .score-value { min-width: 4.4em; font: inherit; font-size: .93rem; color: var(--soft); }
.outcome { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 24px 56px; }
.outcome h4 { margin-bottom: 4px; }
.outcome .plain-list { gap: 0; }
.outcome .plain-list li { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.outcome .plain-list li:last-child { border-bottom: 0; }
.outcome .link.quiet { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.outcome .link.quiet:hover { text-decoration: underline; }
.outcome small { font-variant-numeric: tabular-nums; white-space: nowrap; }
.criteria { display: grid; gap: 30px; }
.criteria-group { display: grid; }
.criteria-group h3 { padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.criterion { padding-inline: 12px 8px; border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; min-width: 0; }
.criterion:last-child { border-bottom: 0; }
.criterion[data-status="fail"], .criterion[data-status="not_observed"][data-gap="true"] { border-left-color: var(--low); }
.criterion[data-status="partial"] { border-left-color: var(--mid); }
.criterion.focused { background: var(--wash); }
.criterion-head { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 3px 12px; align-items: baseline; padding: 10px 0; cursor: pointer; list-style: none; }
.criterion-head::-webkit-details-marker { display: none; }
.criterion-head:hover .criterion-title { text-decoration: underline; text-underline-offset: 3px; }
.criterion-indicator { align-self: start; margin-top: 7px; width: 6px; height: 6px; border: solid var(--soft); border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.criterion[open] .criterion-indicator { transform: rotate(45deg); }
.criterion-head .criterion-title { font-weight: 600; }
.criterion-meta { display: flex; gap: 2px 13px; flex-wrap: wrap; align-items: baseline; }
.criterion-doubt { color: var(--ink); background: #ffe5a9; padding: 0 5px; border-radius: 3px; font-size: .82rem; white-space: nowrap; }
.deduction { color: var(--low-text); font-weight: 600; }
.criterion-body { display: grid; gap: 8px; padding: 0 0 14px 20px; }
.criterion-body > .long-text { color: var(--soft); }
.criterion-body .dialog-actions { margin-top: 2px; }
.criteria[data-pending-only="true"] :is(.criterion, .criteria-group)[data-provisional="false"] { display: none; }
.criteria[data-gaps-only="true"] :is(.criterion, .criteria-group)[data-gap="false"] { display: none; }
.gaps-empty { display: none; }
.criteria[data-gaps-only="true"][data-has-gaps="false"] .gaps-empty { display: block; }
.quotes { margin-top: 4px; }
.quotes summary { cursor: pointer; color: var(--soft); font-size: .93rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--control); list-style: none; }
.quotes summary::-webkit-details-marker { display: none; }
.criterion-quotes { max-width: 78ch; }
.criterion-quotes li { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); justify-content: start; gap: 5px 12px; overflow-wrap: anywhere; }
.criterion-quotes .player { position: static; grid-column: 1 / -1; min-width: 0; margin: 0; padding: 6px 0; }
.listen { font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; color: var(--ink); }
.listen:hover { text-decoration: underline; text-underline-offset: 4px; }
.criterion-quotes q { quotes: "«" "»"; }
.quotes .rules { margin-top: 10px; }

/* Чек-листы */
.checklist-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px 56px; align-items: start; }
.checklist-side { display: grid; gap: 36px; }
.pick-list { display: grid; border-top: 2px solid var(--ink); }
.pick { display: grid; gap: 2px; padding: 12px 0 12px 14px; border: 0; border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; background: none; text-align: left; }
.pick:hover:not(:disabled) strong { text-decoration: underline; text-underline-offset: 4px; }
.pick[aria-pressed="true"] { border-left-color: var(--marker); }
.pick strong { font-weight: 500; }
.pick[aria-pressed="true"] strong { font-weight: 600; }
.import { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.import label { margin: 0; color: var(--ink); font: 500 1.13rem/1.25 var(--display); }
.import .button { justify-self: start; }
input[type="file"] { max-width: 100%; font-size: .87rem; }
input::file-selector-button { margin-right: 10px; padding: 5px 12px; border: 1px solid var(--ink); border-radius: 4px; background: #fff; font: inherit; cursor: pointer; }
.edit-head { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; }
#checklist-state { font-weight: 600; }
.editor-field { margin: 0; min-width: 0; }
.editor-field > :is(input, textarea) { display: block; margin-top: 6px; color: var(--ink); font-size: 1rem; }
.section-nav { display: flex; gap: 6px 20px; flex-wrap: wrap; font-size: .93rem; }
.chip-button { padding: 0; border: 0; background: none; color: var(--soft); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--control); }
.chip-button:hover { color: var(--ink); text-decoration-color: var(--ink); }
#checklist-fields { gap: 40px; }
.edit-section > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; }
.edit-section > h2 small { font: 400 .87rem/1.4 "Golos Text", sans-serif; }
.section-actions { display: flex; gap: 6px 22px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--rule); font-size: .93rem; }
.danger-link:hover:not(:disabled) { color: var(--error); text-decoration-color: var(--error); }
#add-section { margin-top: -16px; }
.edit-section { scroll-margin-top: 16px; gap: 0; }
.edit-section > .fields { padding: 16px 0; }
.criterion-edit { border-top: 1px solid var(--rule); }
.criterion-edit summary { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; cursor: pointer; list-style: none; }
.criterion-edit summary::-webkit-details-marker { display: none; }
.criterion-edit summary::before { content: "+"; flex: none; width: .8em; color: var(--soft); font: 400 1.2rem/1 var(--display); }
.criterion-edit[open] summary::before { content: "–"; }
.criterion-edit summary:hover .criterion-title { text-decoration: underline; text-underline-offset: 4px; }
.criterion-edit[open] .criterion-title { font-weight: 600; }
.criterion-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.criterion-edit > :not(summary) { padding: 4px 0 24px calc(.8em + 14px); }
.rules { display: grid; grid-template-columns: 11em minmax(0, 60ch); gap: 8px 20px; }
.rules dt { color: var(--soft); font-size: .93rem; }
#checklist-read { gap: 0; }
#checklist-read > .hint { margin: 10px 0 8px; }
#checklist-read h3 { margin-top: 30px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
#checklist-read h3 + .criterion-edit { border-top: 0; }
/* Просмотр: название и баллы в строке, под названием условие полного балла; после раскрытия оно уходит в условия */
#checklist-read h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; }
#checklist-read h3 small { font: 400 .87rem/1.4 "Golos Text", sans-serif; }
.criterion-name { display: block; }
.criterion-title small { display: -webkit-box; max-width: 76ch; overflow: hidden; font-size: .93rem; font-weight: 400; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.criterion-edit[open] .criterion-title small { display: none; }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding: 14px 0; background: #fff; border-top: 2px solid var(--ink); }
.savebar .status:empty { display: block; }
.savebar-actions { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-left: auto; }

/* Загрузка */
.upload-form { max-width: 760px; }
.audio-field { margin-top: 20px; }
.dropzone { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 168px; padding: 20px 14px; border: 1px dashed var(--control); border-radius: 4px; text-align: center; }
.dropzone strong { font: 500 1.47rem/1.2 var(--display); }
.dropzone.dragging { border: 2px solid var(--marker); background: var(--wash); }
.drop-mobile { display: none; }
.recordings { margin: 10px 0 0; padding: 0; list-style: none; }
.recordings li { display: flex; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.recording-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.recording-size { flex: none; color: var(--soft); font-size: .87rem; }
.remove { padding: 0; border: 0; background: none; color: var(--soft); font-size: .93rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--control); }
.remove:hover { color: var(--error); text-decoration-color: var(--error); }
.upload-form .status { margin-top: 16px; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--ink); }

/* Выбор сотрудника */
.employee-picker, .employee-control { position: relative; }
.employee-control input { padding-inline-end: 66px; }
.employee-clear, .employee-toggle { position: absolute; inset-block: 1px; width: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--soft); }
.employee-clear { inset-inline-end: 32px; font-size: 1.2rem; }
.employee-toggle { inset-inline-end: 1px; }
.employee-toggle::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.employee-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
:is(.employee-clear, .employee-toggle):hover:not(:disabled) { color: var(--ink); }
.employee-popup { position: absolute; z-index: 3; top: calc(100% + 4px); width: 100%; max-height: min(18rem, 45vh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--ink); border-radius: 4px; background: #fff; box-shadow: 0 14px 30px -12px #15181d59; }
.employee-popup ul { list-style: none; padding: 4px 0; margin: 0; }
.employee-popup [role="option"], .employee-popup .employee-empty { display: grid; min-height: 40px; align-content: center; padding: 6px 12px; margin: 0; overflow-wrap: anywhere; }
.employee-popup [role="option"] { cursor: pointer; border-left: 3px solid transparent; }
.employee-popup [role="option"]:hover, .employee-popup .employee-active { background: var(--wash); }
.employee-popup [aria-selected="true"] { border-left-color: var(--marker); }
.employee-popup small, .employee-empty { color: var(--soft); font-size: .87rem; }
.employee-name { font-weight: 500; }

/* Доступы и диалоги */
.roles { display: grid; grid-template-columns: 10.5em minmax(0, 1fr); font-size: .93rem; }
.roles > * { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.roles > :nth-last-child(-n + 2) { border-bottom: 0; }
.roles dt { font-weight: 600; }
.roles dd { color: var(--soft); }
#access .split > .stack { gap: 44px; }
#access-form { padding-top: 6px; }
#issued-access .data-table td:last-child { width: 1%; text-align: right; }
.dialog { width: min(31rem, calc(100% - 32px)); padding: 28px; border: 1px solid var(--ink); border-radius: 4px; color: var(--ink); box-shadow: 0 30px 60px -20px #15181d80; }
.dialog::backdrop { background: #15181d73; }
.dialog-actions { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-top: 6px; }
.install-panel { max-width: 68ch; overflow-wrap: anywhere; }

/* Окно приложения в Битрикс24 обычно уже 1100 px: колонки складываются раньше, чем на отдельной странице */
@media (max-width: 1180px) {
    .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
    .checklist-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .checklist-side { display: contents; }
    .checklist-main { order: 1; }
    .import { order: 2; }
    .pick-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 24px; }
    .loss summary { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
    .loss-title { grid-column: 1 / -1; }
    .loss-count { white-space: normal; }
}

@media (pointer: coarse), (max-width: 640px) {
    .drop-desktop { display: none; }
    .drop-mobile { display: block; }
}

@media (max-width: 640px) {
    h1 { font-size: 1.72rem; }
    .preview-notice { padding-inline: 16px; }
    .appbar { flex-wrap: wrap; padding: 14px 16px 0; }
    .table-wrap { overflow-x: visible; }
    .tabs { order: 3; flex-basis: 100%; gap: 16px; margin-top: 8px; }
    .cabinet { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .page { padding: 26px 16px 44px; }
    .fields { grid-template-columns: minmax(0, 1fr); }
    .toolbar .field { max-width: none; flex-basis: 100%; }
    .figure { font-size: 3.6rem; }
    .report-score { justify-items: start; }
    .summary { gap: 16px; }
    .button, input[type="text"], input[type="number"], select { min-height: 44px; }
    .button.quiet, .button.back { min-height: 0; }
    /* Таблица сотрудников складывается в строки */
    #team-sellers thead { display: none; }
    #team-sellers tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
    #team-sellers tbody :is(th, td) { padding: 0; border: 0; width: auto; }
    #team-sellers .weak { grid-column: 1 / -1; }
    #team-sellers .num { display: none; }
    #team-sellers .weak::before { content: attr(data-label) ": "; }
    .row { gap: 12px; }
    .loss summary { align-items: center; column-gap: 12px; }
    .rules, .roles { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .roles dt { border-bottom: 0; padding-bottom: 0; }
    .rules dd { margin-bottom: 10px; }
    .criterion { padding-inline: 6px 2px; }
    .criterion-head { grid-template-columns: 7px minmax(0, 1fr); column-gap: 8px; }
    .criterion-meta { grid-column: 2; }
    .criterion-body { padding-left: 15px; }
    .criterion-edit > :not(summary) { padding-left: 0; }
    .savebar-actions { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
    .edit-section { scroll-behavior: smooth; }
}
