/* ============================================================
   Долговой штурм — оформление
   Боковое меню на десктопе, выдвижное на мобильном.
   ============================================================ */

:root {
    --bg: #f5f7f8;
    --surface: #ffffff;
    --surface-2: #f0f3f4;
    --surface-3: #e7ecee;
    --text: #16211f;
    --text-2: #4a5a57;
    --muted: #6d7d79;
    --line: #e0e7e7;
    --line-2: #cbd6d5;

    --accent: #1d6b58;
    --accent-2: #14503f;
    --accent-soft: #e4f1eb;
    --on-accent: #ffffff;

    --danger: #b3261e;
    --danger-soft: #fdecea;
    --warn: #8a5800;
    --warn-soft: #fdf2d6;
    --info: #1f5b96;
    --info-soft: #e6effa;
    --good: #146b3a;
    --good-soft: #e2f3e8;

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --sp: 8px;

    --shadow-1: 0 1px 2px rgba(15, 30, 27, .05);
    --shadow-2: 0 4px 16px rgba(15, 30, 27, .07);
    --shadow-3: 0 16px 48px rgba(15, 30, 27, .16);

    --sidebar-w: 244px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1416;
        --surface: #161e21;
        --surface-2: #1c262a;
        --surface-3: #243034;
        --text: #e9f0ee;
        --text-2: #b3c4c0;
        --muted: #8fa4a0;
        --line: #263438;
        --line-2: #35474c;

        --accent: #46bd97;
        --accent-2: #6ad3b1;
        --accent-soft: #14302a;
        --on-accent: #06231b;

        --danger: #ff8f85;
        --danger-soft: #3a1e1c;
        --warn: #f0c165;
        --warn-soft: #382d15;
        --info: #82b9f2;
        --info-soft: #152838;
        --good: #6fd79b;
        --good-soft: #133020;

        --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
        --shadow-2: 0 4px 16px rgba(0, 0, 0, .4);
        --shadow-3: 0 16px 48px rgba(0, 0, 0, .6);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); }
button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: 17px; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }

.muted { color: var(--muted); }
.tiny { font-size: 12.5px; line-height: 1.5; }
.small { font-size: 13.5px; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
    left: 12px; top: 12px; z-index: 100;
    padding: 10px 16px; border-radius: var(--r-sm);
    background: var(--accent); color: var(--on-accent);
}

/* ---------- Каркас ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--line);
    z-index: 40;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand-mark {
    width: 26px; height: 26px; border-radius: 8px; flex: none;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    position: relative;
}
.brand-mark::after {
    content: ""; position: absolute; inset: 8px 7px auto 7px; height: 2.5px; border-radius: 2px;
    background: var(--on-accent); box-shadow: 0 5px 0 var(--on-accent); opacity: .92;
}
.brand-name { font-weight: 750; font-size: 15px; letter-spacing: -.01em; }

.sidebar .sidebar-close { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px; display: grid; gap: 11px; align-content: start; }

.nav-group { display: grid; gap: 2px; }
.nav-group-label {
    padding: 0 10px 2px;
    font-size: 10px; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
}

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; border-radius: var(--r-sm);
    color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 550;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.nav-icon { width: 18px; text-align: center; opacity: .85; font-size: 13px; }
.nav-text { flex: 1; }
.nav-badge {
    min-width: 20px; padding: 1px 6px; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 750; text-align: center;
}
.nav-link.active .nav-badge { background: var(--on-accent); color: var(--accent-2); }

.sidebar-foot { padding: 10px 10px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

.user-block { display: flex; align-items: center; gap: 9px; }
.user-block-text { flex: 1; min-width: 0; display: grid; }
.user-block-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-block-text small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
    display: grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-2);
    font-weight: 750; font-size: 13.5px;
}

.content { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar { display: none; }

.page {
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 26px 40px;
    display: grid;
    gap: 18px;
    align-content: start;
}

.page-foot { max-width: 1180px; margin: 0 auto; padding: 0 26px 28px; width: 100%; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.page-head p { color: var(--muted); margin-top: 3px; font-size: 14px; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.scrim {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(8, 18, 16, .5);
}
.scrim[hidden] { display: none; }

/* ---------- Главный блок ---------- */

.hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
    padding: 22px 24px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    box-shadow: var(--shadow-2);
}
/* Красная панель всегда со светлым текстом: в темной теме --on-accent
   почти черный, и на красном фоне его было не прочитать. */
.hero.tone-danger {
    background: linear-gradient(135deg, #b3241a, #7a1911);
    color: #fff;
}
.hero.tone-danger .hero-label,
.hero.tone-danger .hero-hint { opacity: .93; }
.hero.tone-danger .hero-stat span { opacity: .88; }
.hero.tone-neutral { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-1); }

.hero-main { display: grid; gap: 2px; }
.hero-label { font-size: 13px; opacity: .9; font-weight: 600; }
.hero-value { font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.hero-hint { font-size: 13.5px; opacity: .9; }
.hero-side { display: flex; gap: 22px; flex-wrap: wrap; }

.hero-stat { display: grid; gap: 1px; }
.hero-stat b { font-size: 18px; font-weight: 750; }
.hero-stat span { font-size: 12.5px; opacity: .85; }

/* ---------- Плитки ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }

.stat {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    display: grid; gap: 3px; align-content: start;
}
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--muted); }

.stat-danger { border-color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.stat-warn .stat-value { color: var(--warn); }
.stat-good .stat-value { color: var(--good); }

/* ---------- Карточки ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}
.card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}
.card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-body > .stats { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

/* ---------- Кнопки ---------- */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 40px; padding: 8px 15px;
    border: 1px solid var(--line-2); border-radius: var(--r-sm);
    background: var(--surface); color: var(--text);
    font-size: 14.5px; font-weight: 600;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s, border-color .12s, transform .05s;
}
.button:hover { border-color: var(--accent); }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.button.ghost { background: var(--surface-2); }
.button.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.button.small { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.button.wide { width: 100%; }

.icon-button {
    display: grid; place-items: center;
    width: 34px; height: 34px; flex: none;
    border: 1px solid transparent; border-radius: var(--r-sm);
    background: transparent; color: var(--muted);
    font-size: 17px; line-height: 1; cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-end { justify-content: flex-end; }

/* ---------- Таблицы ---------- */

.table-wrap { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
thead th {
    background: var(--surface-2); color: var(--muted);
    font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
    white-space: nowrap; border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tfoot th { background: var(--surface-2); font-size: 13px; text-transform: none; letter-spacing: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.link-strong { color: var(--text); font-weight: 650; text-decoration: none; }
.link-strong:hover { color: var(--accent); text-decoration: underline; }

.row-title { display: grid; gap: 1px; }
.row-title small { color: var(--muted); font-size: 12px; }

/* ---------- Значки ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-neutral { background: var(--surface-3); color: var(--muted); }

.badge-stack { display: inline-flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* ---------- Формы ---------- */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 15px; }
.stack { display: grid; gap: 15px; }
.field { display: grid; gap: 5px; align-content: start; }
.field > span { font-size: 13.5px; font-weight: 650; }
.field small { color: var(--muted); }

input, textarea, select {
    width: 100%; min-height: 42px; padding: 9px 12px;
    border: 1px solid var(--line-2); border-radius: var(--r-sm);
    background: var(--surface); color: var(--text);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
input:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }

input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.compact input, .compact select { width: 130px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; }

.password-meter { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.password-meter > span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }
.password-meter[data-level="2"] > span { background: var(--warn); }
.password-meter[data-level="3"] > span { background: var(--info); }
.password-meter[data-level="4"] > span { background: var(--good); }

/* ---------- Сообщения ---------- */

.flash {
    padding: 12px 15px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: var(--surface); font-size: 14px;
}
.flash.success { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.flash.error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.empty { padding: 30px 20px; color: var(--muted); text-align: center; font-size: 14px; }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13.5px; margin-bottom: 4px; }
.back-link:hover { color: var(--accent); }

/* ---------- Список действий ---------- */

.action-list { display: grid; gap: 0; }
.action-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 18px; border-bottom: 1px solid var(--line);
    text-decoration: none; color: inherit;
}
.action-item:last-child { border-bottom: none; }
.action-item:hover { background: var(--surface-2); }
.action-date {
    flex: none; width: 54px; text-align: center;
    display: grid; gap: 0; line-height: 1.15;
}
.action-date b { font-size: 17px; font-weight: 750; }
.action-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.action-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.action-body strong { font-size: 14.5px; }
.action-body span { font-size: 12.5px; color: var(--muted); }
.action-sum { text-align: right; display: grid; gap: 1px; }
.action-sum b { font-size: 15px; font-variant-numeric: tabular-nums; }
.action-sum span { font-size: 12px; color: var(--muted); }

/* ---------- Календарь ---------- */

.calendar-day { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.calendar-day:last-child { border-bottom: none; }
.calendar-date { display: grid; gap: 2px; align-content: start; }
.calendar-date strong { font-size: 15px; }
.calendar-date span, .calendar-date small { color: var(--muted); font-size: 12.5px; }
.calendar-items { display: grid; gap: 8px; }
.calendar-card {
    display: grid; gap: 8px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface-2); text-decoration: none; color: inherit;
}
.calendar-card:hover { border-color: var(--accent); }
.calendar-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.calendar-card dt { color: var(--muted); font-size: 11.5px; }
.calendar-card dd { margin: 1px 0 0; font-weight: 700; font-size: 14px; }

/* ---------- Партнерский блок ---------- */

.partner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: var(--r); background: var(--accent-soft);
}
.partner-body { flex: 1 1 300px; }
.partner h3 { margin-bottom: 3px; }
.partner p { font-size: 13.5px; color: var(--text-2); }
.partner-tag {
    display: inline-block; margin-bottom: 5px; padding: 1px 7px; border-radius: 999px;
    background: var(--surface); color: var(--muted);
    font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em;
}

/* ---------- Окно поддержки ---------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 18, 16, .6); }
.modal-window {
    position: relative; width: min(400px, 100%); max-height: 90vh; overflow-y: auto;
    padding: 24px; border-radius: var(--r-lg);
    background: var(--surface); box-shadow: var(--shadow-3);
    text-align: center; display: grid; gap: 12px;
}
.modal-window p { color: var(--muted); font-size: 14px; }
.modal-close { position: absolute; top: 10px; right: 10px; }
.donate-qr {
    margin: 0 auto; width: 220px; max-width: 100%; padding: 10px;
    border-radius: var(--r); background: #fff; border: 1px solid var(--line);
}
.donate-qr img { display: block; width: 100%; height: auto; }
.donate-raw code { word-break: break-all; font-size: 12.5px; }

/* ---------- Обращения ---------- */

.thread { display: grid; gap: 12px; }
.msg { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r); max-width: 78%; }
.msg-user { background: var(--surface-2); border: 1px solid var(--line); justify-self: start; }
.msg-admin { background: var(--accent-soft); border: 1px solid var(--accent); justify-self: end; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.msg-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }

/* ---------- График регистраций ---------- */

.spark { display: flex; align-items: flex-end; gap: 2px; height: 68px; }
.spark-bar { flex: 1; min-width: 3px; height: 100%; background: var(--accent-soft); border-radius: 2px 2px 0 0; }
.spark-bar > i { display: block; width: 100%; margin-top: auto; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }

/* ---------- Мобильные ---------- */

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-3);
        width: min(290px, 84vw);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar .sidebar-close { display: grid; }

    .content { margin-left: 0; }

    .topbar {
        display: flex; align-items: center; gap: 8px;
        position: sticky; top: 0; z-index: 30;
        padding: 10px 12px;
        padding-top: max(10px, env(safe-area-inset-top));
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }
    .topbar-title { flex: 1; font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav-toggle { font-size: 19px; }

    .page { padding: 16px 14px 32px; gap: 14px; }
    .page-foot { padding: 0 14px 24px; }

    .hero { padding: 18px; }
    .hero-side { gap: 16px; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
    .card-head, .card-body { padding: 14px; }
    .grid-2 { gap: 14px; }

    .calendar-day { grid-template-columns: 1fr; gap: 10px; }
    .calendar-card dl { grid-template-columns: 1fr 1fr; }
    .partner { flex-direction: column; align-items: stretch; }
    .partner .button { width: 100%; }
    .msg { max-width: 92%; }

    th, td { padding: 10px 12px; }
    .action-item { padding: 12px 14px; gap: 10px; }
}

@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { padding: 12px 13px; }
    .stat-value { font-size: 18px; }
    .page-head-actions { width: 100%; }
    .page-head-actions .button { flex: 1; }
    .calendar-card dl { grid-template-columns: 1fr; }
}

/* ---------- Вход и регистрация ---------- */

.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-shell { width: min(400px, 100%); display: grid; gap: 18px; justify-items: center; }
.auth-brand .brand-name { font-size: 17px; }
.auth-card {
    width: 100%; padding: 24px;
    border: 1px solid var(--line); border-radius: var(--r-lg);
    background: var(--surface); box-shadow: var(--shadow-2);
    display: grid; gap: 15px;
}
.auth-card h2 { font-size: 19px; }
.auth-card > p { color: var(--muted); font-size: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; padding-top: 4px; }
.auth-back { font-size: 13.5px; }
.auth-back a { color: var(--muted); text-decoration: none; }

.danger-zone { border-color: var(--danger); }
.danger-zone .card-head h2 { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Утилиты */
.gap-top { margin-top: 16px; }
.card-body-flush > .card-body { padding: 0; }
.spark-bar { display: flex; align-items: flex-end; }

/* Старые секции оформляются как карточки — разметка страниц не переписывается */
.panel {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
}
.panel > h2 { margin-bottom: 10px; }
.panel > p { color: var(--muted); font-size: 13.5px; }
.panel-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-form { padding: 18px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.section-title {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.section-title p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.plan-table td:nth-child(n+3) { white-space: nowrap; }
.timeline { display: grid; gap: 10px; }
.timeline-day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.timeline-date { color: var(--muted); font-weight: 700; font-size: 14px; }
.timeline-items { display: grid; gap: 8px; }
.timeline-item {
    display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center;
    padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--surface-2); text-decoration: none; color: inherit;
}
.timeline-item:hover { border-color: var(--accent); }
.timeline-item small { color: var(--muted); font-size: 12.5px; }
.calendar-list { display: grid; }

@media (max-width: 900px) {
    .panel, .card-form { padding: 14px; }
    .split { gap: 14px; }
    .timeline-day { grid-template-columns: 1fr; }
    .timeline-item { grid-template-columns: 1fr; }
}

/* Подсказки полей */
.field small b { font-weight: 700; color: var(--text-2); }
.field small.hint-warn { color: var(--warn); }
.field-key {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
    background: var(--warn-soft); color: var(--warn);
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    vertical-align: middle;
}

/* ---------- Инструкция ---------- */

.guide-window {
    position: relative;
    width: min(560px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-3);
    overflow: hidden;
}

.guide-pages { flex: 1; overflow-y: auto; }

.guide-page { display: none; padding: 26px 26px 20px; }
.guide-page.active { display: block; }
.guide-page h2 { font-size: 20px; margin-bottom: 8px; }
.guide-page > p { color: var(--text-2); font-size: 14.5px; margin-bottom: 12px; }
.guide-page > p b { color: var(--text); }

.guide-art {
    margin: 0 -6px 18px;
    padding: 14px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.guide-art svg { display: block; width: 100%; height: auto; }

/* Цвета рисунков — из палитры темы, работают в обеих */
.g-bg { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.g-line { fill: var(--line-2); }
.g-accent { fill: var(--accent); opacity: .9; }
.g-accent-c { fill: var(--accent); opacity: .9; }
.g-strong { fill: var(--accent); }
.g-hot { fill: var(--danger); opacity: .9; }
.g-bar { fill: var(--accent); opacity: .55; }
.g-bar-hot { fill: var(--danger); }
.g-axis { stroke: var(--line-2); stroke-width: 2; }
.g-curve { fill: none; stroke: var(--danger); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-curve-down { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-dot { fill: var(--accent); }
.g-dot-now { fill: var(--danger); }
.g-span { fill: var(--line-2); opacity: .5; }
.g-span-active { fill: var(--accent); opacity: .3; }
.g-arrow { stroke: var(--muted); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.g-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.g-caption { fill: var(--muted); font-size: 10.5px; }
.g-caption-active { fill: var(--accent); font-size: 10.5px; font-weight: 700; }
.g-inbar { fill: #fff; font-size: 11px; font-weight: 700; }
.g-inbar-dark { fill: var(--text-2); font-size: 11px; font-weight: 700; }

.guide-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 7px; }
.guide-list li {
    position: relative; padding-left: 20px;
    color: var(--text-2); font-size: 14px;
}
.guide-list li::before {
    content: ""; position: absolute; left: 4px; top: 8px;
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.guide-list li b { color: var(--text); }

.guide-note {
    padding: 11px 13px; margin-bottom: 12px;
    border-radius: var(--r-sm);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text-2); font-size: 13.5px;
}
.guide-note b { color: var(--text); }

.guide-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.guide-dots { display: flex; gap: 6px; }
.guide-dot {
    width: 7px; height: 7px; border-radius: 50%; border: none; padding: 0;
    background: var(--line-2); cursor: pointer;
}
.guide-dot.active { background: var(--accent); width: 18px; border-radius: 4px; }

.guide-foot .button { min-width: 84px; }
.guide-foot .button[disabled] { opacity: .4; cursor: default; }

@media (max-width: 560px) {
    .guide-page { padding: 20px 16px 16px; }
    .guide-art { margin: 0 0 14px; padding: 10px; }
    .guide-page h2 { font-size: 18px; }
    .guide-foot { padding: 11px 14px; }
    .guide-foot .button { min-width: 72px; }
}
