/* Ассистент ЛМГ — интерфейс. Тихий, плотный, читаемый. Только системные шрифты, без внешних ресурсов. */

:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --line: #e7e5df;
  --line-strong: #d3d0c8;
  --ink: #1b1d21;
  --ink-2: #454b56;
  --muted: #626874;
  --accent: #2b5c8f;
  --accent-hover: #234d78;
  --accent-soft: #e8eff7;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #8f5400;
  --warn-soft: #fff1d6;
  --ok: #1b7046;
  --ok-soft: #e4f3ea;
  --teal: #0f6f68;
  --teal-soft: #e1f2f0;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 4px 16px rgba(20, 20, 20, 0.04);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 232px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1a1c20;
    --surface-2: #1f2227;
    --line: #2a2d33;
    --line-strong: #3a3e46;
    --ink: #ecedf0;
    --ink-2: #b9bdc6;
    --muted: #8f95a1;
    --accent: #7aa9dc;
    --accent-hover: #93bbe6;
    --accent-soft: #1d2a3a;
    --accent-ink: #0e1722;
    --danger: #f2877d;
    --danger-soft: #3a1f1c;
    --warn: #e9b866;
    --warn-soft: #34280f;
    --ok: #6fcf9b;
    --ok-soft: #15301f;
    --teal: #5ec6bb;
    --teal-soft: #12302d;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }

/* Каркас */
.app { min-height: 100vh; min-height: 100dvh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 24px;
  border-right: 1px solid var(--line); background: var(--surface-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 650; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--line); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav .count.alert { color: var(--danger); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.user-line { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 520px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 9px 12px 9px 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
.search input::placeholder { color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.demo-banner {
  background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600;
  padding: 6px 28px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center;
}
.content { container: content / inline-size; width: 100%; max-width: 1180px; padding: 26px 28px 56px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Кнопки, переключатель, поля */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-icon { width: 36px; padding: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--line); gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 550; font-size: 14px; white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }

/* Поверхности */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head .count { color: var(--muted); font-size: 13px; }
.panel-head .link { margin-left: auto; font-size: 13px; }
.panel-body { padding: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }

/* Счётчики */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.counters.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.counter {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow);
}
.counter:hover { text-decoration: none; border-color: var(--line-strong); }
.counter .value { font-size: 30px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; }
.counter .name { color: var(--ink-2); font-size: 13.5px; }
.counter .hint { color: var(--muted); font-size: 12px; }
.counter.is-danger .value { color: var(--danger); }
.counter.is-warn .value { color: var(--warn); }
.counter.is-zero .value { color: var(--muted); }

/* Бейджи и чипы */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--line); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-new { background: var(--accent-soft); color: var(--accent); }
.badge-progress { background: var(--accent-soft); color: var(--accent); }
.badge-wait { background: var(--warn-soft); color: var(--warn); }
.badge-decision { background: var(--teal-soft); color: var(--teal); }
.badge-done { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: var(--line); color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.tag { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 13.5px; cursor: pointer;
}
.chip:hover { text-decoration: none; background: var(--surface-2); }
.chip.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }

/* Строки задач: «рельса риска» слева показывает уровень риска без чтения текста */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 18px 12px 21px;
  border-top: 1px solid var(--line); color: var(--ink);
}
.rows > .row:first-child { border-top: 0; }
.row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.row.risk-high::before { background: var(--warn); }
.row.risk-critical::before { background: var(--danger); }
a.row:hover { background: var(--surface-2); text-decoration: none; }
.row-title { font-weight: 550; overflow-wrap: anywhere; }
.row-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13px; align-items: center; }
.row-side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; justify-content: center; }
.risk-reason { color: var(--danger); font-weight: 550; }
.risk-reason.is-warn { color: var(--warn); }
.due { font-size: 13px; color: var(--ink-2); }
.due.is-overdue { color: var(--danger); font-weight: 600; }

/* Таблица задач (десктоп) */
.table-wrap { overflow-x: auto; }
table.tasks { width: 100%; border-collapse: collapse; }
table.tasks th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tasks td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.tasks tr:first-child td { border-top: 0; }
table.tasks tbody tr:hover { background: var(--surface-2); }
table.tasks .num-col { color: var(--muted); width: 72px; white-space: nowrap; }
table.tasks .title-cell a { color: var(--ink); font-weight: 550; }
table.tasks td.risk { position: relative; }
.list-cards { display: none; }

/* Карточка задачи */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.detail > * { min-width: 0; }
.detail > aside { position: sticky; top: 76px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.crumbs { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.title-line { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.title-line h1 { flex: 1; min-width: 240px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.subnav a { padding: 8px 12px; color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.subnav a:hover { text-decoration: none; color: var(--ink); }
.subnav a[aria-current="true"] { color: var(--accent); border-color: var(--accent); }
.kv { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.callout { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.callout.is-risk { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.callout.is-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
details.fold summary { cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; gap: 8px; align-items: center; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold[open] summary .icon { transform: rotate(90deg); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-size: 12.5px; }
.diff { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.diff del { color: var(--muted); }
.diff ins { text-decoration: none; font-weight: 600; }
.comment { padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.comment.is-internal { background: var(--warn-soft); margin: 0 -18px; padding: 12px 18px; border-color: transparent; }

/* Напоминания */
.reminder { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; }
.rows > .reminder:first-child { border-top: 0; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.reminder .when { font-size: 13px; color: var(--muted); }

/* Состояния */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty .icon { width: 32px; height: 32px; color: var(--muted); }
.empty p { color: var(--muted); max-width: 44ch; }
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; align-items: flex-start; }
.alert.is-info { background: var(--accent-soft); color: var(--accent); }
.alert.is-warn { background: var(--warn-soft); color: var(--warn); }
.alert.is-ok { background: var(--ok-soft); color: var(--ok); }
.skeleton { background: linear-gradient(90deg, var(--line), var(--surface-2), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Поиск */
mark { background: color-mix(in srgb, var(--warn-soft) 80%, #f5c542); color: inherit; padding: 0 2px; border-radius: 3px; }
.found-in { font-size: 12.5px; color: var(--teal); font-weight: 600; }

/* Диалог */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 12, 16, 0.45); }
.dialog-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { flex: 1; }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 14px 14px; }

/* Вход и страницы ошибок */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }

/* Дополнения к базовым блокам */
.filters-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.filters-actions { display: flex; gap: 10px; align-items: center; }
.filters-actions .chip input { margin: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.brand-mobile { display: none; padding: 0; }
.seg-desktop { display: inline-flex; }
.auth-card .demo-banner { padding: 8px 12px; }
.bottom-nav { display: none; }
.mobile-switch { display: none; }
.nav a { position: relative; }
.content.is-wide { max-width: none; }
.back-to-list { display: none; align-self: flex-start; }
.view-split { display: none; }

/* Диалог: тело прокручивается, кнопки внизу всегда доступны */
dialog[open] { display: flex; flex-direction: column; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
dialog form { display: flex; flex-direction: column; min-height: 0; }
.dialog-body { overflow-y: auto; }

/* Список + карточка рядом (раскладные экраны, планшеты) */
.split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.split-list { position: sticky; top: 76px; max-height: calc(100dvh - 100px); overflow-y: auto; }
.split-detail { container: detail / inline-size; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.row.is-selected { background: var(--accent-soft); }
.row.is-selected::before { background: var(--accent); }
.row.is-selected.risk-high::before { background: var(--warn); }
.row.is-selected.risk-critical::before { background: var(--danger); }

/* Раскладки по ширине самого содержимого: учитывают и боковую колонку, и разворот экрана */
@container content (max-width: 959px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail > aside { position: static; }
}
@container detail (max-width: 959px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail > aside { position: static; }
}
@container content (max-width: 799px) {
  .counters.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container content (max-width: 759px) {
  .grid-2 { grid-template-columns: 1fr; }
  .table-wrap { display: none; }
  .list-cards { display: block; }
  .row, .reminder { padding-left: 16px; padding-right: 16px; }
}
@container content (max-width: 639px) {
  .counters, .counters.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container content (max-width: 759px) {
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-actions { grid-column: 1 / -1; justify-content: space-between; }
}
@container content (max-width: 699px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.has-selection .split-list { display: none; }
  .split:not(.has-selection) .split-detail { display: none; }
  .split.has-selection .back-to-list { display: inline-flex; }
  .split-list { position: static; max-height: none; overflow: visible; }
}
@container content (max-width: 559px) {
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px minmax(0, 1fr); }
  .timeline li { grid-template-columns: 76px minmax(0, 1fr); }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .counter .value { font-size: 26px; }
}
@container content (max-width: 479px) {
  .counters, .counters.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: 1fr; }
}

/* Оболочка. Узкий экран (телефон, внешний экран раскладного): нижняя навигация */
@media (max-width: 599px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; }
  .topbar .seg-wrap { display: none; }
  .demo-banner { padding: 6px 16px; }
  .content { padding: 18px 16px 96px; gap: 18px; }
  h1 { font-size: 20px; }
  .brand-mobile { display: flex; }
  .hide-mobile { display: none; }
  .seg-desktop { display: none; }
  .mobile-switch { display: flex; }
  .topbar-actions .btn { width: 38px; padding: 0; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px calc(6px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; color: var(--muted); font-size: 11.5px; font-weight: 550; border-radius: 8px; min-height: 48px; justify-content: center; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); }
}

/* Средний экран (развёрнутый раскладной телефон, планшет): узкая колонка навигации слева */
@media (min-width: 600px) and (max-width: 1099px) {
  :root { --sidebar: 84px; }
  .sidebar { padding: 14px 8px; align-items: stretch; gap: 18px; }
  .brand { justify-content: center; padding: 0; }
  .brand-text, .user-info { display: none; }
  .nav a { flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 11.5px; text-align: center; line-height: 1.2; }
  .nav .count { position: absolute; top: 2px; right: 3px; margin: 0; padding: 0 6px; border-radius: 999px; background: var(--line); font-size: 11px; }
  .nav .count.alert { background: var(--danger-soft); }
  .sidebar-foot { padding: 0; align-items: center; }
  .sidebar-foot .btn { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 4px; min-height: 44px; width: 100%; }
  .topbar { padding: 12px 20px; }
  .content { padding: 22px 20px 48px; }
  .demo-banner { padding: 6px 20px; }
  /* Задачи: вместо таблицы — список и карточка рядом */
  .view-split { display: block; }
  .view-table { display: none; }
}

/* Два экрана с шарниром (если браузер сообщает о сегментах): список и карточка по разные стороны */
@media (horizontal-viewport-segments: 2) {
  .split {
    grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0);
    column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0));
  }
  .split-list { max-height: none; }
}

/* Сенсорные экраны: крупные цели нажатия (не меньше 44 px) */
@media (pointer: coarse) {
  .btn, .chip, .seg a, .input, .select, .nav a, .subnav a { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .btn-icon { width: 44px; }
  .check { width: 32px; height: 32px; }
  .subnav a { display: inline-flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Напоминания только для чтения: без кнопки отметки */
.reminder.is-readonly { grid-template-columns: minmax(0, 1fr) auto; }
.decision-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.decision-form .input { flex: 1; min-width: 200px; }

/* Выход: в боковой колонке — кнопка с подписью, на узком экране (нет колонки) — значок в шапке */
.logout-compact { display: none; }
@media (max-width: 599px) { .logout-compact { display: block; } }
