:root {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-2: #f2f1f7;
    --border: #e3e1ec;
    --text: #1f1d2b;
    --muted: #6e6a80;
    --accent: #6c5fc7;
    --accent-ink: #ffffff;
    --accent-soft: #eeebfb;
    --sidebar: #2b2140;
    --sidebar-ink: #c9c2de;
    --sidebar-active: #43356a;
    --danger: #e0405a;
    --danger-soft: #fdecef;
    --warning: #e8a317;
    --warning-soft: #fdf5e2;
    --success: #2ba672;
    --success-soft: #e5f6ee;
    --info: #3d8bfd;
    --info-soft: #e6f0ff;
    /* Цвета для текста: обычные --danger/--success/--warning/--info — для полос, точек и рамок,
       на светлом фоне им не хватает контраста (WCAG AA 4.5:1) */
    --danger-text: #c42a44;
    --success-text: #1f7a4d;
    --warning-text: #8a5a00;
    --info-text: #1f64d6;
    --accent-text: #5a4db3;
    --accent-strong: #6c5fc7;
    --code-bg: #f6f5fa;
    --inapp: #fffdf3;
    --radius: 8px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17151f;
        --surface: #1f1c29;
        --surface-2: #26222f;
        --border: #352f44;
        --text: #ebe8f3;
        --muted: #9b95ad;
        --accent: #8b7ff0;
        --accent-soft: #2e2850;
        --sidebar: #120f1a;
        --sidebar-ink: #b2abc6;
        --sidebar-active: #2e2650;
        --danger-soft: #3a1a22;
        --warning-soft: #372c13;
        --success-soft: #16301f;
        --code-bg: #1a1823;
        --inapp: #262214;
        --info-soft: #172a45;
        --danger-text: #ff7d8f;
        --success-text: #4cc58f;
        --warning-text: #e8a317;
        --info-text: #7fb0ff;
        --accent-text: #a99ff5;
        --accent-strong: #6c5fc7;
    }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Ссылка внутри приглушённого текста по цвету почти не отличается от него — подчёркиваем (WCAG 1.4.1) */
.muted a:not(.btn):not(.chip), .crumbs a, .hint a, .lead a, p.small a:not(.btn), .empty a:not(.btn), .step a, .steps-plain a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2px; }
h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
/* Длинные JSON, URL и пути в тексте переносятся, а не растягивают страницу */
code { overflow-wrap: anywhere; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* Каркас */
.layout { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-toggle { display: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #fff; border-radius: 6px; width: 38px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 8px 16px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #8b7ff0, #e0405a); display: grid; place-items: center; font-size: 14px; }
.org-switch { margin: 0 0 12px; }
.org-switch summary { list-style: none; cursor: pointer; padding: 8px; border-radius: 6px; background: rgba(255,255,255,.06); color: #fff; display: flex; justify-content: space-between; }
.org-switch summary::-webkit-details-marker { display: none; }
.org-switch ul { list-style: none; margin: 4px 0 0; padding: 4px; background: rgba(0,0,0,.25); border-radius: 6px; }
.org-switch li a { display: block; padding: 6px 8px; color: var(--sidebar-ink); border-radius: 4px; }
.org-switch li a:hover { background: var(--sidebar-active); text-decoration: none; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 12px 8px 4px; opacity: .85; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--sidebar-ink); }
.nav a:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar-footer a, .sidebar-footer .btn-link { color: var(--sidebar-ink); }
.main { min-width: 0; }
.page-head { padding: 20px 32px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; padding: 16px 32px 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tabs a { flex: none; white-space: nowrap; padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.content { padding: 24px 32px 48px; }

/* Элементы */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card + .card { margin-top: 16px; }
.card-body { padding: 16px 20px; }
.card-head { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h2 { margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); filter: brightness(1.08); }
.btn-danger { color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 3px 10px; font-size: 12.5px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
form.inline { display: inline; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .error { color: var(--danger-text); font-size: 12.5px; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=tel], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
input[size] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.flash-success { background: var(--success-soft); color: var(--success-text); }
.flash-error { background: var(--danger-soft); color: var(--danger-text); }
.flash-warning { background: var(--warning-soft); color: var(--text); border-left: 3px solid var(--warning); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.level { display: inline-block; width: 4px; align-self: stretch; border-radius: 2px; background: var(--muted); flex: none; }
.level-fatal, .level-error { background: var(--danger); }
.level-warning { background: var(--warning); }
.level-info { background: var(--info); }
.badge.level-fatal, .badge.level-error { background: var(--danger-soft); color: var(--danger-text); }
.badge.level-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.level-info { background: var(--info-soft); color: var(--info-text); }
.badge.status-resolved { background: var(--success-soft); color: var(--success-text); }
.badge.status-ignored { background: var(--surface-2); color: var(--muted); }
.badge.status-unresolved { background: var(--accent-soft); color: var(--accent-text); }
.badge.status-merged { background: var(--surface-2); color: var(--muted); }
/* Cron-мониторы: точка состояния, полоса последних check-in'ов */
.monitor-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; flex: none; }
.monitor-dot.health-ok { background: var(--success); }
.monitor-dot.health-error { background: var(--danger); }
.monitor-dot.health-active { background: var(--info); }
.monitor-dot.health-paused, .monitor-dot.health-new { background: var(--border); }
.monitor-dot.health-muted { background: transparent; box-shadow: inset 0 0 0 2px var(--border); }
.monitor-env-row .env-cell { padding-left: 34px; }
.monitor-row td { border-bottom: 0; }
.env-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.regroup { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.regroup-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.regroup-form select { width: auto; }
.progress { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.warning-text { color: var(--warning-text); }
.checkin-timeline { display: flex; gap: 3px; align-items: flex-end; height: 34px; padding: 12px 16px; overflow-x: auto; }
.checkin-timeline i { display: block; width: 8px; min-width: 8px; height: 100%; border-radius: 2px; background: var(--border); }
.checkin-timeline i.st-ok { background: var(--success); }
.checkin-timeline i.st-error { background: var(--danger); }
.checkin-timeline i.st-missed { background: var(--warning); }
.checkin-timeline i.st-timeout { background: #b5469b; }
.checkin-timeline i.st-in_progress { background: var(--info); }
.badge.st-ok { background: var(--success-soft); color: var(--success-text); }
.badge.st-error, .badge.st-timeout { background: var(--danger-soft); color: var(--danger-text); }
.badge.st-missed { background: var(--warning-soft); color: var(--warning-text); }
.badge.st-in_progress { background: var(--info-soft); color: var(--info-text); }
.w-90 { width: 90px !important; }
.btn-group.wrap { flex-wrap: wrap; }
pre.snippet { color: var(--text); margin: 0; padding: 12px 16px; background: var(--code-bg); border-radius: 6px; overflow-x: auto; font-size: 12.5px; }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
/* Широкие таблицы на узком экране прокручиваются внутри карточки, а не растягивают страницу */
.card:has(> table), .card:has(> form > table), .table-scroll { overflow-x: auto; }
/* В ячейках — break-word, не anywhere: anywhere сжимает колонку до символа вместо прокрутки таблицы */
.table td code, .table td .mono { overflow-wrap: break-word; }

.spark rect { fill: var(--accent); opacity: .8; }
.spark rect.zero { fill: var(--border); opacity: 1; }
.spark-lg rect { fill: var(--accent); }
.spark-lg rect.zero { fill: var(--border); }
/* Графики с фиксированной шириной (sparkline 700px) ужимаются до ширины карточки */
.card-body > svg { max-width: 100%; }

/* Аутентификация */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 50%), var(--bg); }
.auth > div { width: 100%; max-width: 400px; }
.auth .card { width: 100%; }
.auth .brand { color: var(--text); justify-content: center; padding-bottom: 20px; font-size: 20px; }

/* Проекты */
.projects { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.projects > .card + .card, .usage-grid > .card + .card, .plan-grid > .card + .card, .admin-stats > .card + .card { margin-top: 0; }
.project-card { display: block; padding: 16px 20px; color: inherit; }
.project-card:hover { text-decoration: none; border-color: var(--accent); }
.project-card .stats { display: flex; gap: 24px; margin: 12px 0; }
.project-card .stat b { font-size: 20px; display: block; }

/* Список issues */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type=search] { max-width: 320px; }
.filters select { width: auto; }
/* На узком экране сегменты переносятся на следующую строку; нижняя граница каждого сегмента
   разделяет строки, у последней строки её прячет overflow: hidden */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg a { flex: none; white-space: nowrap; padding: 6px 12px; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: -1px; }
.seg a:last-child { border-right: 0; }
.seg a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.seg a:hover { text-decoration: none; }
.issues-head, .issue-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 128px 72px 64px 28px; gap: 16px; align-items: center; padding: 10px 16px; }
.issues-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.issue-row { border-bottom: 1px solid var(--border); }
.issue-row:last-child { border-bottom: 0; }
.issue-row:hover { background: var(--surface-2); }
.issue-main { display: flex; gap: 10px; min-width: 0; }
.issue-title { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-title .type { color: var(--text); }
.issue-title .value { font-weight: 400; color: var(--muted); }
.issue-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; overflow: hidden; white-space: nowrap; }
.issue-meta .culprit { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.issue-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.bulk-bar { padding: 8px 16px; background: var(--accent-soft); display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--muted); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .big { font-size: 32px; margin-bottom: 8px; }

/* Детали issue */
.issue-head { padding: 20px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.issue-head h1 { font-size: 20px; word-break: break-word; }
.issue-head .culprit { font-family: var(--mono); color: var(--muted); margin-top: 4px; word-break: break-all; }
.issue-head-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.issue-counters { display: flex; gap: 28px; }
.issue-counters .counter b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.issue-counters .counter span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.issue-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 24px 32px 48px; }
.section { margin-bottom: 24px; }
.event-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.kv { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); }
.kv > div { padding: 6px 16px; border-bottom: 1px solid var(--border); word-break: break-word; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); font-family: var(--mono); font-size: 12.5px; word-break: normal; overflow-wrap: break-word; hyphens: auto; }
/* Длинные немецкие составные слова в подписях (Kontingentüberschreitung) — перенос по слогам по lang страницы */
h1, h2, .card-head, th { hyphens: auto; }
.kv .v pre { font-size: 12.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
.tag { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; font-size: 12.5px; }
.tag .tk { background: var(--surface-2); padding: 2px 8px; color: var(--muted); }
.tag .tv { padding: 2px 8px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.exception + .exception { border-top: 1px dashed var(--border); }
.exception-head { padding: 14px 16px 10px; }
.exception-head .etype { font-weight: 700; font-size: 15px; }
.exception-head .evalue { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.exception-head .mech { margin-top: 6px; }
/* Группа исключений: дерево с отступом по глубине */
.exc-depth-1 { margin-left: 20px; border-left: 2px solid var(--border); }
.exc-depth-2 { margin-left: 40px; border-left: 2px solid var(--border); }
.exc-depth-3 { margin-left: 60px; border-left: 2px solid var(--border); }
.exc-depth-4, .exc-depth-5, .exc-depth-6 { margin-left: 80px; border-left: 2px solid var(--border); }
.exc-group > .exception-head .etype { color: var(--muted); }
/* Вложения и отзывы */
.attachments { display: flex; flex-wrap: wrap; gap: 16px; }
.attachment { max-width: 320px; }
.attachment-thumb { display: block; max-width: 300px; max-height: 220px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 4px; background: var(--surface-2); }
.feedback-item { padding: 12px 16px; border-top: 1px solid var(--border); }
.feedback-item:first-child { border-top: 0; }
.feedback-text { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.feedback-url { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-item .attachment-thumb { margin-top: 8px; max-height: 160px; }
details.collapsible > summary { cursor: pointer; list-style: none; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible:not([open]) > summary { border-bottom: 0; }
.frames { border-top: 1px solid var(--border); }
.frame { border-bottom: 1px solid var(--border); }
.frame:last-child { border-bottom: 0; }
.frame.system { display: none; }
.show-all .frame.system { display: block; }
.frame-line { padding: 7px 16px; cursor: pointer; font-family: var(--mono); font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
.frame-line:hover { background: var(--surface-2); }
.frame.in-app .frame-line { background: var(--inapp); }
.frame-line .fn { font-weight: 600; }
.frame-line .file { color: var(--muted); word-break: break-all; }
.frame-line .chev { color: var(--muted); width: 10px; flex: none; transition: transform .15s; }
.frame.open .chev { transform: rotate(90deg); }
.frame-detail { display: none; background: var(--code-bg); border-top: 1px solid var(--border); }
.frame.open .frame-detail { display: block; }
.code { font-family: var(--mono); font-size: 12.5px; padding: 6px 0; overflow-x: auto; }
.code div { display: flex; white-space: pre; }
.code .ln { width: 56px; text-align: right; padding-right: 12px; color: var(--muted); user-select: none; flex: none; }
.code .hl { background: var(--accent-soft); }
.code .hl .ln { color: var(--accent-text); font-weight: 600; }
.frame-vars { padding: 8px 16px; border-top: 1px solid var(--border); }
.frames-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

.crumbs-table td { font-size: 12.5px; padding: 6px 16px; }
.crumbs-table .cat { white-space: nowrap; font-weight: 600; }
.crumbs-table .msg { font-family: var(--mono); word-break: break-word; }
.crumbs-table tr.crumb-error td { background: var(--danger-soft); }
.crumbs-table tr.crumb-warning td { background: var(--warning-soft); }

.side-card { padding: 16px; }
.side-card + .side-card { border-top: 1px solid var(--border); }
.tag-dist { margin-bottom: 14px; }
.tag-dist .name { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; display: flex; justify-content: space-between; }
.bar { position: relative; height: 22px; border-radius: 4px; background: var(--surface-2); margin-bottom: 3px; overflow: hidden; font-size: 12px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); }
.bar span { position: relative; padding: 0 8px; line-height: 22px; display: flex; justify-content: space-between; gap: 8px; }
.bar span em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Онбординг */
.dsn-box { display: flex; gap: 8px; align-items: center; background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 8px 8px 12px; }
.dsn-box code { flex: 1; word-break: break-all; }
.snippet { position: relative; background: #1e1b2b; color: #e6e1f5; border-radius: 8px; padding: 14px 16px; margin: 8px 0 16px; }
.snippet pre { font-size: 12.5px; }
.snippet .btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 40px; margin-bottom: 24px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; display: grid; place-items: center; }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.platform-grid label { display: block; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; cursor: pointer; background: var(--surface); }
.platform-grid input { margin-right: 6px; }
.platform-grid label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sidebar { position: sticky; top: 0; z-index: 20; height: auto; max-height: 100vh; padding: 8px 12px; }
    .sidebar .brand { padding: 4px 8px; }
    .nav-toggle { display: inline-grid; place-items: center; }
    .sidebar:not(.open) .sidebar-body { display: none; }
    .sidebar.open .sidebar-body { padding-top: 8px; }
    .issue-layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
    .content, .page-head, .tabs, .issue-head { padding-left: 16px; padding-right: 16px; }
    .issues-head, .issue-row { grid-template-columns: 24px minmax(0, 1fr) 56px; }
    .issues-head .hide-sm, .issue-row .hide-sm { display: none; }
    .kv { grid-template-columns: minmax(96px, 35%) minmax(0, 1fr); }
    .kv > div { padding: 6px 10px; }
    .card-head { padding: 12px 16px; flex-wrap: wrap; }
    .card-body { padding: 14px 16px; }
    .snippet { padding-top: 40px; }
}

/* Аккаунт и безопасность */
.content.narrow { max-width: 860px; }
.btn-block { width: 100%; justify-content: center; }
.auth-foot { margin: 16px 0 0; text-align: center; }
.label-row { display: flex !important; justify-content: space-between; align-items: baseline; }
.label-row a { font-weight: 400; }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 32px; background: var(--warning-soft); border-bottom: 1px solid var(--border); }
.card-subhead { padding: 8px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.notice-success { background: var(--success-soft); border-bottom: 1px solid var(--border); }
.ok { color: var(--success-text); }
.code-input { font-family: var(--mono); font-size: 16px; letter-spacing: .12em; }
.w-160 { width: 160px !important; }
.w-220 { width: 220px !important; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin: 10px 0 12px; }
.backup-codes code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; text-align: center; font-size: 14px; }
.totp-setup { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
/* QR всегда чёрным по белому — иначе в тёмной теме не считается */
.totp-setup .qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--border); line-height: 0; }
.totp-setup > div:last-child { flex: 1; min-width: 280px; }
.steps-plain { margin: 0 0 12px; padding-left: 20px; }
.steps-plain li { margin-bottom: 10px; }
.steps-plain .dsn-box { margin-top: 6px; }
.table.audit td { padding: 8px 16px; }

/* Поиск issues */
.search { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.search .presets { align-self: flex-start; flex-wrap: wrap; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search-row .search-input { flex: 1 1 360px; font-size: 13px; }
.search-row select { width: auto; }
.search-input.invalid { border-color: var(--danger); }
.search-errors { color: var(--danger-text); font-size: 12.5px; }
.search-help summary { cursor: pointer; list-style: none; }
.search-help summary::-webkit-details-marker { display: none; }
.search-help-body { margin-top: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; line-height: 1.9; }
.search-help code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.chip { display: inline-block; padding: 0 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; }

/* Аватар исполнителя: инициалы на цветном круге (оттенок — от id) */
.avatar { --hue: 260; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
    background: hsl(var(--hue) 55% 88%); color: hsl(var(--hue) 45% 30%); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--hue) 35% 30%); color: hsl(var(--hue) 70% 88%); } }

/* Выпадающее меню на <details> — без JS */
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; min-width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; }
.dropdown-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-form { padding: 8px 10px; border-top: 1px solid var(--border); margin-top: 4px; }
.dropdown-form label { display: block; margin-bottom: 4px; }
.assign-form { display: inline-flex; align-items: center; gap: 6px; }
.assign-form select { width: auto; padding: 3px 8px; font-size: 12.5px; }

/* Лента активности */
.feed { list-style: none; margin: 0; padding: 8px 16px; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.feed-item + .feed-item { border-top: 1px dashed var(--border); }
.feed-item.system { color: var(--muted); font-size: 13px; }
.feed-item.system b { color: var(--text); font-weight: 600; }
.feed-item.regression .feed-icon { color: var(--danger-text); }
.feed-icon { width: 24px; text-align: center; flex: none; color: var(--accent); }
.feed-body { min-width: 0; flex: 1; }
.feed-meta { font-size: 13px; }
.comment-text { margin-top: 4px; word-break: break-word; }
.comment-text code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.comment-form { padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.comment-form textarea { resize: vertical; min-height: 64px; }
.comment-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Онбординг: ждём первое событие */
.waiting { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 8px; border: 1px dashed var(--accent); background: var(--accent-soft); margin-bottom: 16px; }
.waiting.done { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.6s ease-in-out infinite; }
.waiting.done .pulse { background: var(--success); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.project-card .waiting-note { color: var(--accent); font-size: 13px; margin: 12px 0 4px; }

/* Настройки: чекбоксы */
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; font-weight: 400; }
.check input { margin-top: 3px; }
.default-fields { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.default-fields code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 11.5px; }

/* Интеграции: меню «Создать задачу», задачи issue, ссылки на код */
.dropdown-wide { min-width: 340px; max-height: 70vh; overflow-y: auto; }
.dropdown-form input[type=text], .dropdown-form input[type=url], .dropdown-form input[type=number] { width: 100%; margin-bottom: 6px; }
.dropdown-form:first-child { border-top: 0; margin-top: 0; }
.external-link { position: relative; padding-right: 18px; margin-bottom: 8px; word-break: break-word; }
.external-link form { position: absolute; right: 0; top: 0; }
.code-link { white-space: nowrap; text-decoration: none; }
.code-link:hover { text-decoration: underline; }
.scope-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; margin: 8px 0; }
.field-error { color: var(--danger, #c0392b); font-size: 12px; margin-top: 4px; }
.api-op { border-top: 1px solid var(--border); padding: 14px 16px; overflow-x: auto; }
.api-method { display: inline-block; min-width: 58px; text-align: center; font: 600 12px var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--surface-2); }
.api-method.get { color: #1f7a4d; } .api-method.post { color: #2463b5; } .api-method.patch { color: #9a6200; } .api-method.delete { color: #b42318; }
@media (prefers-color-scheme: dark) {
    .api-method.get { color: #4cc58f; } .api-method.post { color: #7fb0ff; } .api-method.patch { color: #e8a317; } .api-method.delete { color: #ff7d8f; }
}
.api-op td a { text-decoration: underline; text-underline-offset: 2px; }
.api-schema { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; margin: 6px 0 0; }

/* Сохранённые поиски (выпадающий список над списком issues) */
.dropdown-right { left: auto; right: 0; }
.btn-active { border-color: var(--accent); color: var(--accent); }
.saved-searches .dropdown-menu { min-width: 380px; max-width: calc(100vw - 32px); }
.saved-group { padding: 8px 10px 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.saved-item { display: flex; align-items: center; gap: 6px; border-radius: 6px; }
.saved-item:hover, .saved-item.active { background: var(--surface-2); }
.saved-link { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; color: var(--text); }
.saved-link:hover { text-decoration: none; }
.saved-link .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-item .pin { opacity: .25; padding: 4px 8px; }
.saved-item .pin:hover, .saved-item .pin.pinned { opacity: 1; }
.saved-actions { display: flex; gap: 10px; padding: 0 10px 6px; }
.saved-empty { padding: 4px 10px 8px; }
.dropdown-form label.small { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; }

/* Профиль: дайджест и Telegram */
.digest-projects { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; }
.digest-projects label { display: flex; align-items: center; gap: 6px; font-weight: normal; }

/* Тарифы и «Войти как» (App\Billing, App\Admin): баннеры над страницей */
.banner.banner-danger { background: var(--danger-soft); }
.banner.banner-impersonation { background: var(--sidebar-active); color: #fff; }
.banner.banner-impersonation .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }

/* Страницы ошибок (templates/bundles/TwigBundle/Exception) */
.error-code { margin: 0 0 4px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.error-title { font-size: 20px; margin: 0 0 8px; }

/* Переключатель языка (templates/_locale_switcher.html.twig) */
.locale-switcher { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.locale-switcher [aria-current] { font-weight: 600; }
.auth-locales { justify-content: center; margin-top: 16px; color: var(--muted); }
.auth-locales a { color: var(--muted); }
.sidebar-locales { margin-top: 8px; opacity: .85; }
