/* =====================================================================
 * Личный кабинет — стили
 *
 * Тот же визуальный язык, что у сайта: тёмный фон, Exo 2 для заголовков.
 * Отдельный файл, а не общий site-additions.css, потому что кабинет —
 * самостоятельный раздел: правки в нём не должны задевать сайт.
 *
 * ──────────────────────────────────────────────────────────────────
 * ПОЧЕМУ ЗДЕСЬ БОЛЬШЕ ЦВЕТОВ, ЧЕМ НА САЙТЕ
 * ──────────────────────────────────────────────────────────────────
 * Сайт выдержан в одном зелёном: там задача — произвести впечатление,
 * и единый акцент работает на это.
 *
 * В кабинете задача другая — не впечатлить, а помочь разобраться.
 * В списке из полусотни пунктов ТЗ нужно за секунду видеть, что
 * согласовано, а что висит; какие вопросы горят, а какие можно
 * отложить. Если всё зеленое — всё одинаковое, и различить нечего.
 *
 * Поэтому цвет — носитель смысла, а не украшение:
 *   зелёный — всё решено, можно не трогать;
 *   синий   — идёт работа или нас ждёт ответ;
 *   жёлтый  — требует внимания клиента;
 *   красный — блокирует или удалено;
 *   серый   — служебное, не значит ничего.
 *
 * Одни и те же цвета повторяются в статусах, полосах прогресса
 * и подсветке строк — чтобы «есть вопросы» выглядело одинаково
 * везде, где бы оно ни встретилось.
 * ===================================================================== */

:root {
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --accent-soft: rgba(0, 255, 136, 0.1);
    --bg: #0a0a0a;
    --surface: #131313;
    --surface-2: #1a1a1a;
    --line: #262626;
    --text: #d4ffe8;
    --text-2: #9ddfb9;
    --text-3: #7cc99a;
    --radius: 12px;

    /* --- Смысловые цвета состояний --- */

    /* Готово, решено, принято — трогать не надо. */
    --ok: #00ff88;
    --ok-bg: rgba(0, 255, 136, 0.1);
    --ok-line: rgba(0, 255, 136, 0.32);

    /* Ждёт нашего ответа или находится в работе. */
    --info: #4db8ff;
    --info-bg: rgba(77, 184, 255, 0.1);
    --info-line: rgba(77, 184, 255, 0.32);

    /* Ждёт ответа клиента — то, на чём висит срок. */
    --warn: #ffb829;
    --warn-bg: rgba(255, 184, 41, 0.1);
    --warn-line: rgba(255, 184, 41, 0.34);

    /* Блокирует работу или удалено. */
    --err: #ff6b6b;
    --err-bg: rgba(255, 107, 107, 0.1);
    --err-line: rgba(255, 107, 107, 0.34);

    /* Черновик — ещё ничей. */
    --mute: #8a9d92;
    --mute-bg: rgba(138, 157, 146, 0.1);
    --mute-line: rgba(138, 157, 146, 0.28);

    /* Старое имя для совместимости с уже написанными правилами. */
    --red: var(--err);
    --amber: var(--warn);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Фоновая сетка — как на сайте, чтобы кабинет не выглядел чужеродно. */
body::before {
    content: '';
    position: fixed;
    top: -120px; left: -120px; right: -120px; bottom: -120px;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Верхняя панель ---------- */
.top {
    border-bottom: 1px solid var(--line);
    background: rgba(10, 10, 10, 0.9);
    position: sticky;
    top: 0;
    z-index: 20;
}
.top-in {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -0.02em;
    color: var(--accent);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a {
    padding: 7px 13px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13px;
    text-decoration: none;
    transition: 0.2s;
}
.nav a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent); color: #0a0a0a; font-weight: 600; }

.who {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-2);
}
.who-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #0a0a0a;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 13px;
    flex: 0 0 auto;
}
.logout {
    color: var(--text-3);
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    text-decoration: none;
}
.logout:hover { border-color: var(--red); color: var(--red); text-decoration: none; }

/* ---------- Контейнер ---------- */
.wrap {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 60px;
    flex: 1;
}

h1 {
    font-family: 'Exo 2', sans-serif;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 8px;
}
.lead { color: var(--text-2); margin-bottom: 26px; max-width: 62ch; }

/* ---------- Карточка ---------- */
.card {
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 28px;
    max-width: 520px;
}
.card h2 {
    font-family: 'Exo 2', sans-serif;
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 6px;
}
.card .hint { color: var(--text-3); font-size: 13px; margin-bottom: 20px; }

/* =====================================================================
 * Формы
 *
 * ──────────────────────────────────────────────────────────────────
 * ПОЧЕМУ ОДНО ПРАВИЛО НА ВСЕ ПОЛЯ
 * ──────────────────────────────────────────────────────────────────
 * Раньше здесь было только .field input — и текстовые поля выглядели
 * правильно, а <select> и <input type="search"> оставались системными:
 * белый фон, чёрный текст, шрифт Arial и высота 19px вместо 40.
 * В тёмном зелёном интерфейсе это выглядит как чужая вставка.
 *
 * Оформление задаётся по ТЕГАМ, а не по классам форм. Так новое поле
 * в любой форме получает нужный вид само — не надо помнить о стилях
 * и дописывать селектор при каждой новой форме.
 * ===================================================================== */

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 6px;
}
.field .req { color: var(--accent); }
.field .note { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/*
 * Общий вид поля. Список тегов полный: input всех типов, textarea, select.
 * Селектор по тегам — чтобы не перечислять формы и классы.
 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="number"],
input:not([type]),
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    background-color: #0f0f0f;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.08);
}

input::placeholder,
textarea::placeholder { color: #5a7a68; }

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/*
 * Поле только для чтения.
 *
 * Нам оно нужно в трёх местах: почта в профиле (меняет только
 * администратор), e-mail в приглашении (указан заранее) и показанный
 * один раз пароль. Обычное поле там врало бы: человек кликает,
 * пытается печатать и не понимает, почему не выходит.
 */
input[readonly] {
    background-color: rgba(15, 15, 15, 0.55);
    color: var(--text-2);
    cursor: default;
    border-style: dashed;
}

input[readonly]:focus {
    border-color: var(--line);
    box-shadow: none;
}

/* Отключённое поле — совсем неактивное: его не отправят и не изменят. */
input[disabled],
select[disabled],
textarea[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------
 * Выпадающие списки
 *
 * Системная стрелка рисуется по-своему в каждой ОС и на тёмном фоне
 * часто исчезает. Поэтому свою: нативные стили снимаем (appearance)
 * и рисуем стрелку фоном через SVG прямо в background-image.
 *
 * padding-right с запасом — текст длинного пункта не залезает под стрелку.
 * --------------------------------------------------------------------- */

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /*
     * Стрелка вписана как data-URI: отдельный файл потребовал бы
     * лишнего запроса, а внешняя картинка может не загрузиться.
     * Цвет совпадает с --text-3 (#7cc99a).
     */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237cc99a' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 11px 7px;
    padding-right: 36px !important;
    cursor: pointer;
}

/* В фокусе стрелка становится ярче — видно, какой список сейчас активен. */
select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300ff88' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
}

select[disabled] { opacity: 0.5; cursor: not-allowed; }

/*
 * Раскрытый список рисует сама система, и в Windows он белый
 * независимо от наших стилей. Задаём цвета явно через option —
 * иначе выпадающие пункты будут светлыми на тёмном сайте.
 */
select option,
select optgroup {
    background: #131313;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 8px;
}

/* Приглушённые пункты, которые нельзя выбрать. */
select option[disabled] { color: var(--text-3); }

/* ---------------------------------------------------------------------
 * Поле поиска
 * --------------------------------------------------------------------- */

/*
 * Крестик очистки в search — системный, в Safari и Chrome выглядит
 * по-разному. Скрываем его и рисуем свой через .search-clear,
 * чтобы не зависеть от браузера.
 */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

input[type="search"] {
    /* Иконка лупы слева — узнаваемо и не занимает места подписи. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237cc99a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 15px 15px;
    padding-left: 38px !important;
}

/* ---------------------------------------------------------------------
 * Флажки и переключатели
 * --------------------------------------------------------------------- */

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
    vertical-align: middle;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid var(--accent-dim);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
 * Поля, которым ширина не нужна
 * --------------------------------------------------------------------- */

/*
 * Дата, время, число — узкие и короткие. Растягивать их на всю
 * ширину значит получить поле в 600px для значения «1.2».
 */
input[type="date"],
input[type="time"],
input[type="number"] { width: auto; min-width: 120px; }

/*
 * Календарь в date-поле — системный, рисуем видимым на тёмном фоне.
 * Иначе значок чёрный на чёрном и его не видно.
 */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(70%) sepia(40%) saturate(400%) hue-rotate(90deg);
    cursor: pointer;
    opacity: 0.8;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Убираем стрелки увеличения у числовых полей: не нужны и мешают. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* Автозаполнение в Chrome закрашивает поле своим цветом — перебиваем. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #0f0f0f inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ---------------------------------------------------------------------
 * Кнопки
 * --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 9px;
    padding: 11px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-p { background: var(--accent); color: #0a0a0a; }
.btn-p:hover { background: #33ffa6; }
.btn-s { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
.btn-s:hover { border-color: var(--accent-dim); color: var(--text); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Сообщения ---------- */
.msg {
    border-radius: 9px;
    padding: 12px 15px;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}
.msg-err { background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); color: #ffb3b3; }
.msg-ok  { background: rgba(0, 255, 136, 0.09); border: 1px solid rgba(0, 255, 136, 0.25); color: var(--text); }
.msg-info { background: rgba(122, 169, 255, 0.09); border: 1px solid rgba(122, 169, 255, 0.25); color: #cfe0ff; }
/* Жёлтое — «ждёт вашего действия»: используется токен --warn как у бейджей. */
.msg-warn {
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    color: var(--warn);
}
.msg-warn strong { color: var(--warn); }

.form-foot {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--text-3);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Страница ошибки ---------- */
.error-page {
    text-align: center;
    padding: 60px 20px;
}
.error-page h1 { margin-bottom: 12px; }
.error-page p { color: var(--text-2); margin-bottom: 22px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Подвал ---------- */
.foot {
    border-top: 1px solid var(--line);
    padding: 18px 24px;
    font-size: 12px;
    color: var(--text-3);
}
.foot-in {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.foot-links { display: flex; gap: 14px; }
.foot-links a { color: var(--text-3); }
.foot-links a:hover { color: var(--accent); }

/* =====================================================================
 * Управление пользователями
 *
 * Список людей — раскрывающиеся строки. Раскрытая строка должна
 * читаться как карточка, а не как таблица: у неё три независимые
 * зоны (данные, права, пароль), и в каждой своё действие.
 * ===================================================================== */

.people-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.person {
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.person[open] { border-color: var(--accent-dim); }
.person-off { opacity: 0.62; }

.person-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s;
}
/* Убираем штатный треугольник: он мешает выравниванию. */
.person-head::-webkit-details-marker { display: none; }
.person-head:hover { background: rgba(0, 255, 136, 0.04); }

.person-main { flex: 1; min-width: 0; }
.person-name {
    display: block;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.person-sub {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.person-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.person-body {
    padding: 4px 16px 18px;
    border-top: 1px solid var(--line);
}
.person-facts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-3);
    padding: 12px 0;
}

.person-form { padding-bottom: 6px; }

.person-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.person-actions-pass { gap: 18px; }

/* Два способа сменить пароль лежат рядом: видно, что это выбор. */
.pass-hint { margin-bottom: 8px; }
.pass-hint strong { display: block; font-size: 13px; font-weight: 600; }
.pass-hint span { display: block; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.inline-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form-row input { flex: 1; min-width: 200px; }

.avatar-muted { background: var(--line); color: var(--text-3); }

/* ---------- Закладки ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-3);
}

/* ---------- Справочник должностей ---------- */
.position-list { list-style: none; margin-bottom: 20px; }
.position-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.position-list li:last-child { border-bottom: none; }
.position-hidden .position-title { color: var(--text-3); }
.position-title { flex: 1; display: flex; align-items: center; gap: 8px; }
.position-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.position-actions { flex: 0 0 auto; }
.sub-head-side { display: flex; align-items: center; gap: 8px; }

/* ---------- Списки сведений ---------- */
.facts { font-size: 13px; }
.facts dt { color: var(--text-3); margin-top: 10px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { color: var(--text); margin-left: 0; }

/* ---------- Ссылка на Telegram ---------- */
/*
 * Единственное место, где человек без доступа может что-то сделать.
 * Поэтому она заметнее остальных ссылок в подвале формы: цветом
 * акцента и иконкой. Всё остальное — служебное, это — действие.
 */
.link-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 500;
}

.link-contact:hover { color: #33ffa6; }

.icon-tg { flex: 0 0 auto; }

/* ---------- Показ созданного пароля ---------- */
/*
 * Пароль показывается один раз и его надо скопировать. Поэтому
 * поле wide и рядом кнопка — чтобы не выделять текст мышью
 * и не ошибиться при перепечатывании.
 */
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input {
    flex: 1;
    min-width: 240px;
    font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 0.5px;
    padding: 11px 13px;
    background: #0f0f0f;
    border: 1px solid var(--accent-dim);
    border-radius: 9px;
    color: var(--accent);
}

/* ---------- Форма создания пользователя ---------- */
.user-create-form { padding-bottom: 4px; }

/* ---------- Ссылка на уведомления в шапке ---------- */
.bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 12px;
    background: var(--accent);
    color: #0a0a0a;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.bell:hover { background: #33ffa6; text-decoration: none; }

/* =====================================================================
 * Вступительная инструкция
 *
 * ──────────────────────────────────────────────────────────────────
 * ПОЧЕМУ БАННЕР, А НЕ ВСПЛЫВАЮЩЕЕ ОКНО
 * ──────────────────────────────────────────────────────────────────
 * Модальное окно поверх всего закрывают рефлексом, не читая: оно
 * мешает сделать то, зачем человек пришёл. Баннер видно, он объясняет
 * суть в двух строках и по нему можно уйти в полную инструкцию.
 * Кто хочет — прочитает, кому некогда — закроет и вернётся позже.
 * ===================================================================== */

.guide-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.09), rgba(0, 255, 136, 0.03));
    border: 1px solid rgba(0, 255, 136, 0.28);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.15s;
}
.guide-banner:hover {
    border-color: var(--accent);
    text-decoration: none;
    transform: translateX(2px);
}

.guide-banner-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #0a0a0a;
    display: grid;
    place-items: center;
    font-family: 'Exo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.guide-banner-text { flex: 1; }
.guide-banner-text strong {
    display: block;
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    margin-bottom: 3px;
}
.guide-banner-text span { display: block; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.guide-banner-go { flex: 0 0 auto; font-size: 13px; color: var(--accent); white-space: nowrap; }

/* ---------- Страница инструкции ---------- */
.guide-head { margin-bottom: 22px; }
.guide-head h1 { margin-bottom: 6px; }

/*
 * Двухколоночная раскладка: слева список разделов, справа текст.
 * На длинной инструкции так видно, где ты находишься и куда идти дальше.
 */
.guide-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

.guide-nav {
    position: sticky;
    top: 78px; /* высота шапки + отступ */
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.guide-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 10px;
}
.guide-nav ol { list-style: none; counter-reset: g; }
.guide-nav li { counter-increment: g; }
.guide-nav a {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    line-height: 1.4;
}
.guide-nav a:hover { color: var(--accent); text-decoration: none; }
.guide-nav-icon { color: var(--accent-dim); flex: 0 0 auto; }

.guide-body { min-width: 0; }

.guide-section {
    padding: 22px 24px;
    margin-bottom: 16px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    /*
     * scroll-margin-top — чтобы при переходе по ссылке из меню заголовок
     * не заезжал под липкую шапку.
     */
    scroll-margin-top: 78px;
}

.guide-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.guide-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 16px;
}
.guide-section h2 {
    font-family: 'Exo 2', sans-serif;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.guide-text { color: var(--text-2); line-height: 1.65; margin-bottom: 14px; }

.guide-points { list-style: none; }
.guide-points li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 9px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}
/* Своя метка вместо стандартного маркера: он выравнивается иначе. */
.guide-points li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-dim);
}

.guide-finish {
    padding: 22px 24px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.guide-finish .muted { font-size: 13px; color: var(--text-3); margin: 0; }

/* =====================================================================
 * Версии ТЗ (снимки)
 * ===================================================================== */

.snapshot-list { list-style: none; }
.snapshot-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.snapshot-list li:last-child { border-bottom: none; }

.snapshot-main { flex: 1; min-width: 0; }
.snapshot-version {
    font-family: 'Exo 2', sans-serif;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.snapshot-version .when { font-family: inherit; font-size: 12px; font-weight: 400; color: var(--text-3); }
.snapshot-note { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.snapshot-author { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.snapshot-links { display: flex; gap: 6px; flex: 0 0 auto; }

.snapshot-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.snapshot-actions .muted { font-size: 12px; color: var(--text-3); margin: 0; flex: 1; min-width: 180px; }

/* Содержимое снимка — как документ: отступы и разделители между пунктами. */
.snapshot-items { margin-top: 4px; }
.snapshot-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.snapshot-item:last-child { border-bottom: none; }
.snapshot-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}
.snapshot-item-body {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
    padding-left: 2px;
}

/* Список изменений после снимка */
.diff-list { list-style: none; margin-bottom: 6px; }
.diff-list li {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(38, 38, 38, 0.6);
}
.diff-list li:last-child { border-bottom: none; }
.diff-list .muted { width: 100%; padding-left: 2px; }

/* ---------- Мобильные ---------- */
@media (max-width: 680px) {
    .top-in { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
    .nav { order: 3; width: 100%; }
    .who { margin-left: auto; }
    .who-name { display: none; }
    .wrap { padding: 22px 16px 48px; }
    h1 { font-size: 24px; }
    .card { padding: 20px 18px; }

    /*
     * Строка пользователя в одну линию на телефоне не влезает:
     * имя, а под ним подписи в две строки.
     */
    .person-head { flex-wrap: wrap; }
    .person-badges { justify-content: flex-start; width: 100%; }
    .person-facts { gap: 10px; }
    .position-list li { flex-wrap: wrap; }
    .position-meta { width: 100%; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; }

    /*
     * Инструкция на телефоне — в одну колонку. Меню разделов при этом
     * остаётся сверху: по нему видно, что впереди, и можно прыгнуть
     * сразу к нужному.
     */
    .guide-layout { grid-template-columns: 1fr; gap: 16px; }
    .guide-nav { position: static; }
    .guide-section, .guide-finish { padding: 18px 16px; }
    .guide-banner { flex-wrap: wrap; gap: 12px; }
    .guide-banner-go { width: 100%; }

    .snapshot-list li { flex-wrap: wrap; }
    .snapshot-links { width: 100%; }
}

/* =====================================================================
 * ОТМЕТКИ СОСТОЯНИЙ
 *
 * Цвет здесь — носитель смысла. Одни и те же цвета повторяются
 * в статусах, полосах прогресса и подсветке строк, чтобы «есть вопросы»
 * выглядело одинаково везде, где бы ни встретилось.
 *
 * Отметка — не только цвет, но и текст: цвет один не читается
 * теми, кто плохо различает оттенки.
 * ===================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok); }
.badge-info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.badge-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.badge-err  { background: var(--err-bg);  border-color: var(--err-line);  color: var(--err); }
.badge-mute { background: var(--mute-bg); border-color: var(--mute-line); color: var(--mute); }

/* ===== ЗАГОЛОВКИ СТРАНИЦ ===== */

/*
 * Крошки, заголовок и действия — один блок сверху.
 * Действия справа: там их ищут, и там они не мешают читать заголовок.
 */
.crumbs {
    font-size: 12.5px;
    color: var(--text-3);
    margin-bottom: 14px;
}
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { opacity: 0.5; margin: 0 6px; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head h1 { margin-bottom: 5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.lead-sm { font-size: 13.5px; color: var(--text-2); line-height: 1.6; max-width: 68ch; margin: 0; }

/* Раздел внутри страницы: «Проекты», «Архив». */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 26px 0 14px;
}
.section-head h2 { font-size: 19px; margin: 0; }
.section-head-sub { margin-top: 34px; }
.section-head-sub h2 { font-size: 15px; color: var(--text-2); }

.sub-head {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}
.sub-head:first-child { margin-top: 0; }

/* ===== КАРТОЧКИ ===== */

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.card-head h2 { margin: 0; }

/*
 * Широкая карточка — на всю колонку.
 *
 * Базовая .card ограничена 520px под форму входа: тянуть поле ввода
 * на 900px неудобно. Но таблицы, ленты и списки в такую ширину
 * не влезают, поэтому у них отдельный класс.
 */
.card-wide { max-width: none; }

/* Карточка, которая просит внимания: рамка теплеет. */
.card-attention { border-color: var(--warn-line); background: rgba(255, 184, 41, 0.04); }
.card-danger    { border-color: var(--err-line);  background: rgba(255, 107, 107, 0.04); }
.card-work      { border-color: var(--info-line); }

/* ===== СЕТКА И РЯДЫ ПОЛЕЙ ===== */

/*
 * Две колонки: основная и боковая. На телефоне схлопывается в одну —
 * боковая колонка уезжает вниз, а не сжимается в нечитаемую полоску.
 */
.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.grid-2 > div { min-width: 0; }

.form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.form-row .field { margin-bottom: 16px; }
.field-grow { flex: 1 1 200px; min-width: 0; }
.field-num { flex: 0 0 120px; }
.field-role { flex: 0 0 190px; }
.field-action { flex: 0 0 auto; margin-bottom: 16px; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.note-block {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.55;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

/* ===== КНОПКИ: РАЗМЕРЫ ===== */

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-danger { background: var(--err); color: #1a0505; }
.btn-danger:hover { background: #ff8585; }
.btn-ghost {
    background: transparent;
    color: var(--text-3);
    border: 1px solid transparent;
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }

/* Формы внутри строк списка — без отступов карточки. */
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { font-size: 12.5px; color: var(--text-3); }
.inline-form input, .inline-form select { width: auto; min-width: 0; flex: 1 1 160px; }
.inline-action { display: inline-flex; }
.inline-action button { white-space: nowrap; }

/* ===== РАСКРЫВАЮЩИЕСЯ БЛОКИ ===== */

/*
 * «Ответить», «Принять», «Изменить» — раскрываются на месте.
 * Без JavaScript: работает и при отключённых скриптах.
 */
.disclose { margin: 10px 0; }
.disclose > summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-2);
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.2s;
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::before {
    content: '+';
    font-size: 15px;
    line-height: 1;
    color: var(--accent);
    font-weight: 600;
}
.disclose[open] > summary::before { content: '−'; }
.disclose > summary:hover { border-color: var(--accent-dim); color: var(--text); }
.disclose[open] > summary { margin-bottom: 12px; border-color: var(--accent-dim); }
.disclose form { padding: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 10px; }
.disclose textarea { margin-bottom: 10px; }
.disclose-inline { display: inline-block; margin: 0; }

/* Кнопки-действия в раскрытом блоке заметнее: это то, ради чего раскрыли. */
.disclose-accept { color: var(--ok); border-color: var(--ok-line); }
.disclose-accept:hover { border-color: var(--ok); }
.disclose-ask { margin-top: 16px; }
.disclose-ask > summary { border-color: var(--accent-dim); color: var(--accent); }
.disclose-edit { margin-top: 16px; }

/* =====================================================================
 * СПИСОК ПРОЕКТОВ
 *
 * Карточки, а не строки таблицы: у проекта есть название, клиент,
 * прогресс и счётчик вопросов — в строку это не влезет.
 * ===================================================================== */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.project-card {
    display: block;
    padding: 20px 22px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.15s;
}
.project-card:hover {
    border-color: var(--accent-dim);
    text-decoration: none;
    transform: translateY(-2px);
}

.project-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}
.project-card-head h3 {
    font-family: 'Exo 2', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
    min-width: 0;
}

.project-client { font-size: 12.5px; color: var(--text-3); margin-bottom: 16px; }

/* ===== ПОЛОСА ПРОГРЕССА ===== */

.progress {
    height: 7px;
    background: var(--surface-2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-sm { height: 5px; }

.progress-bar {
    height: 100%;
    background: var(--ok);
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 0;
}

/* Второй прогресс — про работы, а не про согласование: другой цвет. */
.progress-bar-work { background: var(--info); }

.progress-legend {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 12px;
}

/* ===== СВОДКА ЦИФРАМИ ===== */

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric {
    display: block;
    padding: 16px 18px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
}
a.metric:hover { border-color: var(--accent-dim); text-decoration: none; }

.metric-value {
    font-family: 'Exo 2', sans-serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.metric-label { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.metric-note { font-size: 11.5px; color: var(--text-3); margin-top: 7px; }

/* Вопросы без ответа — то, ради чего заходят. Поэтому цветом. */
.metric-attention { border-color: var(--warn-line); background: rgba(255, 184, 41, 0.05); }
.metric-attention .metric-value { color: var(--warn); }

/* ===== СПИСКИ СООБЩЕНИЙ И ЛЕНТЫ ===== */

.notice-list { list-style: none; }
.notice-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 0;
    border-bottom: 1px solid rgba(38, 38, 38, 0.6);
    font-size: 13.5px;
}
.notice-list li:last-child { border-bottom: none; }
.notice-list a { color: var(--text); text-decoration: none; }
.notice-list a:hover { color: var(--accent); }
.notice-list .when { font-size: 12px; color: var(--text-3); }
.notice-list-plain li { font-size: 13px; }

.attention { border-color: var(--warn-line); background: rgba(255, 184, 41, 0.04); }
.attention-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.attention-head h2 { margin: 0; font-size: 18px; }

/* ===== ЛЕНТА СОБЫТИЙ ===== */

.feed { list-style: none; }
.feed li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(38, 38, 38, 0.7);
}
.feed li:last-child { border-bottom: none; }
.feed-compact li { padding: 9px 0; }

.feed-head {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 13px;
}
.feed-head strong { color: var(--text); font-weight: 600; }
.feed-head .when { font-size: 12px; color: var(--text-3); margin-left: auto; }
.feed-action { color: var(--text-2); }

.feed-body { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.feed-body a { color: var(--text); text-decoration: none; }
.feed-body a:hover { color: var(--accent); }
.feed-detail {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-3);
    padding-left: 10px;
    border-left: 2px solid var(--line);
}
.feed-history li { padding: 13px 0; }

/* Длинный текст: абзацы должны быть абзацами, а не сплошным полотном. */
.prose { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.prose p + p { margin-top: 12px; }

/* ===== ОПОВЕЩЕНИЯ ===== */

.notifications { list-style: none; }
.notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 8px;
}
.notification-unread { border-color: var(--info-line); background: rgba(77, 184, 255, 0.05); }
.notification-main { flex: 1; min-width: 0; }
.notification-title { display: block; color: var(--text); text-decoration: none; font-size: 14px; margin-bottom: 5px; }
.notification-title:hover { color: var(--accent); }
.notification-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; }
.dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--info);
    margin-top: 5px;
}

/* =====================================================================
 * СПИСОК ПУНКТОВ ТЗ
 *
 * Три зоны в строке: номер, текст, состояния. Номер и состояния —
 * фиксированной ширины, текст тянется: так строки выравниваются
 * в колонки и по ним можно вести взглядом сверху вниз.
 *
 * ──────────────────────────────────────────────────────────────────
 * ПОЧЕМУ У СТРОК ЦВЕТНАЯ ПОЛОСА СЛЕВА
 * ──────────────────────────────────────────────────────────────────
 * В полусотне пунктов нужно за секунду находить проблемные. Полоса
 * слева читается боковым зрением, не требуя разглядывать отметки:
 * жёлтых абзацев в списке сразу видно, сколько.
 * ===================================================================== */

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.spec-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-left: 3px solid var(--mute-line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.spec-row:hover {
    background: rgba(19, 19, 19, 0.95);
    border-color: var(--accent-dim);
    border-left-color: var(--accent);
    text-decoration: none;
    transform: translateX(2px);
}

/* Полоса слева показывает состояние согласования. */
.spec-row-open     { border-left-color: var(--warn); }
.spec-row-agreed   { border-left-color: var(--ok); }
.spec-row-conflict { border-left-color: var(--err); }
.spec-row-draft    { border-left-color: var(--mute-line); }

.spec-num {
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    text-align: right;
    letter-spacing: -0.02em;
}

.spec-main { min-width: 0; display: block; }

.spec-title {
    display: block;
    font-size: 14.5px;
    font-weight: 500;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spec-text {
    display: block;
    font-size: 12.5px;
    color: var(--text-3);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Строка про вопросы внутри пункта — самое важное, поэтому цветом. */
.spec-question {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--warn);
}
.spec-question-answered { color: var(--info); }

.spec-state {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.spec-assignee {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
}

/* ===== ФИЛЬТРЫ ===== */

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.filters input[type="search"] { flex: 1 1 220px; min-width: 0; }
.filters select { flex: 0 1 210px; }
.filters button, .filters a { flex: 0 0 auto; }

/* Фильтр-«таблетки»: состояние вопроса одной строкой. */
.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-2);
    font-size: 12.5px;
    text-decoration: none;
    transition: 0.18s;
}
.chip:hover { border-color: var(--accent-dim); color: var(--text); text-decoration: none; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip-count {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-3);
}

/* ===== ПРЕВЬЮ ПУНКТОВ НА ОБЗОРЕ ПРОЕКТА ===== */

.item-preview { list-style: none; }
.item-preview li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(38, 38, 38, 0.6);
    font-size: 13.5px;
}
.item-preview li:last-child { border-bottom: none; }
.item-preview a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-preview a:hover { color: var(--accent); }
.item-tags { display: flex; gap: 6px; flex: 0 0 auto; }

.item-num {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-align: right;
}

/* =====================================================================
 * ВОПРОСЫ
 *
 * ──────────────────────────────────────────────────────────────────
 * ПОЧЕМУ ЗДЕСЬ ЦВЕТ — ГЛАВНОЕ
 * ──────────────────────────────────────────────────────────────────
 * Раньше все вопросы выглядели одинаково, и в списке из десятка
 * нельзя было понять, где ждут ответа, а что уже закрыто. Приходилось
 * читать каждый.
 *
 * Теперь состояние видно по полосе слева и цвету отметки:
 *   жёлтый  — ждёт ответа, на этом висит срок;
 *   синий   — ответ дан, но не принят;
 *   зелёный — принят, вопрос закрыт;
 *   серый   — отложен или отклонён.
 *
 * Цвет не единственный признак: рядом всегда текст состояния.
 * ===================================================================== */

.question-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.question-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    padding: 15px 18px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-left: 3px solid var(--mute-line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: 0.15s;
}
.question-row:hover {
    background: rgba(19, 19, 19, 0.95);
    text-decoration: none;
    transform: translateX(2px);
}

.question-row-open     { border-left-color: var(--warn); }
.question-row-answered { border-left-color: var(--info); }
.question-row-accepted { border-left-color: var(--ok); }
.question-row-declined,
.question-row-deferred { border-left-color: var(--mute-line); opacity: 0.75; }

.question-row-main { min-width: 0; }

.question-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 12px;
}
.question-row-meta .when { color: var(--text-3); margin-left: auto; }

.question-row-title {
    font-size: 14.5px;
    font-weight: 500;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.question-row-body {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Цитата из ТЗ — с отступом и вертикальной чертой, как в письме. */
.question-row-quote {
    margin-top: 8px;
    padding-left: 11px;
    border-left: 2px solid var(--line);
    font-size: 12.5px;
    font-style: italic;
    color: var(--text-3);
    line-height: 1.5;
}

.question-row-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 92px;
}
.question-row-author { font-size: 11.5px; color: var(--text-3); text-align: center; }

/* ===== СТРАНИЦА ОДНОГО ВОПРОСА ===== */

.question-page { max-width: 860px; }

.question-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.question-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 13px;
}
.question-meta .when { font-size: 12px; color: var(--text-3); }
.question-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.question-context {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 16px;
}
.question-context-head {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 13px;
}

/* Цитата из пункта: заметно, но не спорит с текстом вопроса. */
.quote {
    margin: 0 0 14px;
    padding: 11px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--info);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    font-style: italic;
    color: var(--text-2);
    line-height: 1.6;
}

.question-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 14px;
}
.question-body-lg { font-size: 15px; }

/* Предложение по умолчанию — то, что можно принять одной кнопкой. */
.proposal {
    padding: 13px 16px;
    background: var(--ok-bg);
    border: 1px solid var(--ok-line);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
}
.proposal-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ok);
    margin-bottom: 7px;
}

/* ===== ОТВЕТЫ ===== */

.answers { margin: 16px 0; }
.answer {
    padding: 13px 16px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    border-left: 2px solid var(--info-line);
    border-radius: 0 10px 10px 0;
    margin-bottom: 10px;
}
.answer-head {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    margin-bottom: 8px;
}
.answer-head .when { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.answer-body { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.question-actions { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }

/* ===== ВОПРОС ВНУТРИ ПУНКТА ТЗ ===== */

.question {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--mute-line);
    border-radius: 10px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.22);
}
.question-open     { border-left-color: var(--warn); }
.question-answered { border-left-color: var(--info); }
.question-accepted { border-left-color: var(--ok); }
.question-declined,
.question-deferred { border-left-color: var(--mute-line); opacity: 0.8; }

/* =====================================================================
 * СТРАНИЦА ПУНКТА ТЗ
 * ===================================================================== */

.item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.item-head-main { min-width: 0; flex: 1; }

.item-number {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}
.item-head h1 { font-size: 27px; margin-bottom: 10px; }

.item-states { display: flex; gap: 7px; flex-wrap: wrap; }

.item-nav { display: flex; gap: 7px; flex-wrap: wrap; flex: 0 0 auto; }

/*
 * Текст пункта — то, ради чего открыли страницу. Поэтому крупнее
 * остального текста и с воздухом: это документ, а не подпись.
 */
.item-body {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    margin-bottom: 18px;
}

/* Панель действий под текстом: согласовать, вернуть, спросить. */
.action-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 16px 18px;
    background: rgba(19, 19, 19, 0.72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 18px;
}

/* ===== ХОД РАБОТ ===== */

.work-form { margin-bottom: 16px; }
.work-form:last-child { margin-bottom: 0; }
.work-form-note {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.work-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.work-form-row select { flex: 0 1 200px; }
.work-form-row input { flex: 1 1 220px; min-width: 0; }
.work-form-row button { flex: 0 0 auto; }

/* ===== ИСТОРИЯ ПРАВОК ===== */

.revision {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.22);
}
.revision > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 13px;
}
.revision > summary::-webkit-details-marker { display: none; }
.revision > summary::before {
    content: '▸';
    color: var(--accent);
    font-size: 11px;
}
.revision[open] > summary::before { content: '▾'; }
.revision > summary .when { font-size: 12px; color: var(--text-3); }
.revision-reason {
    font-size: 12px;
    color: var(--text-3);
    font-style: italic;
}

/* Было / стало рядом: разницу видно глазами, а не по описанию. */
.diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}
.diff-side { min-width: 0; }
.diff-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 6px;
}
.diff-side:first-child .diff-label { color: var(--err); }
.diff-side:last-child .diff-label { color: var(--ok); }

.diff-text {
    font-size: 13px;
    line-height: 1.6;
    padding: 11px 13px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
}
.diff-side:first-child .diff-text { border-color: var(--err-line); }
.diff-side:last-child .diff-text { border-color: var(--ok-line); }

/* =====================================================================
 * ЛЮДИ, ПОСТАВКИ, МЕЛОЧИ
 * ===================================================================== */

.people { list-style: none; }
.people li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(38, 38, 38, 0.6);
    font-size: 13.5px;
    flex-wrap: wrap;
}
.people li:last-child { border-bottom: none; }
.people-name { flex: 1; min-width: 0; }
.people-role { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.people-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.people-actions select { width: auto; font-size: 12.5px; padding: 6px 30px 6px 10px; }
.people-muted { opacity: 0.7; }
.people-manage li { padding: 12px 0; }

/*
 * Участник, зарегистрировавшийся по открытой ссылке и ждущий
 * подтверждения. Подсвечиваем фоном и жёлтой полосой слева:
 * администратор должен заменить это, не вычитывая бейджи.
 */
.person-await {
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    border-radius: 6px;
    padding-left: 9px !important;
    margin-left: -12px;
}

.avatar-sm { width: 24px; height: 24px; font-size: 11px; }

.danger { color: var(--err); }

/* ----- Поставки ----- */

.release-list { list-style: none; margin-bottom: 18px; }
.release-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(38, 38, 38, 0.6);
}
.release-list li:last-child { border-bottom: none; }
.release-title {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 4px;
}
.release-note { font-size: 12px; color: var(--text-3); }
.release-form { padding-top: 14px; border-top: 1px solid var(--line); }
.release-form input[type="text"] { flex: 1 1 200px; }

/* ----- Приглашение ----- */

.invite-head { margin-bottom: 20px; }
.invite-head h1 { margin-bottom: 8px; }
.invite-head .lead { font-size: 14px; line-height: 1.65; }

/* ----- Таблица пользователей (карточка) ----- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 13px 12px; border-bottom: 1px solid rgba(38, 38, 38, 0.6); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-person { display: flex; align-items: center; gap: 11px; }
.table-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.table-nowrap { white-space: nowrap; }
.table-actions { white-space: nowrap; }
.row-muted { opacity: 0.6; }

.menu { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; min-width: 240px; }
.menu label { font-size: 12px; color: var(--text-3); }

.muted { font-size: 12.5px; color: var(--text-3); }
.nowrap { white-space: nowrap; }
