:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #f8f9fb; --text: #161b26; --muted: #5b6474; --faint: #8a92a0;
  --line: #e3e6ec; --grid: #eceef2; --axis: #c9ced8;
  --accent: #2c56c9; --accent-weak: #e9eefc; --ok: #1b7443; --warn: #8f5a00; --bad: #b3261e;
  --ok-dot: #0ca30c; --warn-dot: #fab219; --bad-dot: #d03b3b;
  --data: #4a3aa7; --data-weak: #ecebf7; --mark: #fff0b3;
  /* Цвета областей — постоянные: цвет принадлежит области, а не месту в списке (проверены на различимость) */
  --a-amerika: #2a78d6; --a-krov: #eb6834; --a-lichnoe: #1baf7a; --a-zdorovie: #eda100; --a-other: #8a92a0;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 1px 1px rgba(20, 30, 50, .03);
  --shadow-lift: 0 6px 20px rgba(20, 30, 50, .08);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --surface: #1a1e26; --surface-2: #151920; --text: #e8ebf0; --muted: #a2abba; --faint: #7d8697;
    --line: #2a303b; --grid: #242a34; --axis: #3a414d;
    --accent: #8cb0ff; --accent-weak: #1f2a44; --ok: #62cf92; --warn: #e2b447; --bad: #ff8078;
    --data: #9085e9; --data-weak: #262440; --mark: #5b4a00;
    --a-amerika: #3987e5; --a-krov: #d95926; --a-lichnoe: #199e70; --a-zdorovie: #c98500;
    --shadow: none; --shadow-lift: 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
select, input, button, textarea {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
button { cursor: pointer; }
button:hover { border-color: var(--axis); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
button:focus-visible, a:focus-visible, .card:focus-visible, select:focus-visible, input:focus-visible,
.col:focus-visible, .hbar:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }
/* Пока раздел перезагружается, прежний вид остаётся на месте, чуть приглушённый */
main.loading > * { opacity: .55; transition: opacity .15s; }

/* --- каркас: боковое меню + содержимое -------------------------------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: inherit; text-decoration: none; }
.logo {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--data)); color: #fff; font-weight: 700; font-size: 17px;
}
.brand-text { display: grid; line-height: 1.2; }
.brand-text b { font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group {
  margin: 14px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.nav-group:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14.5px;
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.nav .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 400; }
.count:not(:empty) {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--surface); font-size: 12px; text-align: center;
}
.side-foot { margin-top: auto; display: grid; gap: 4px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.badge { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.logout { justify-self: start; margin-top: 6px; font-size: 13px; padding: 4px 12px; }

/* --- вход из интернета ----------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(380px, 100%); display: grid; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-lift);
}
.login-card .brand { padding: 0 0 10px; }
.login-card label { font-size: 13.5px; color: var(--muted); }
.login-card input[type=password] { font-size: 16px; padding: 10px 12px; }
.login-card button { padding: 10px 12px; }
.login-card .error:empty { display: none; }
.login-card p { margin: 0; }
.st-healthy { color: var(--ok); } .st-degraded { color: var(--warn); } .st-critical { color: var(--bad); }
.st-healthy, .st-degraded, .st-critical { white-space: nowrap; }

.main { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.crumb { margin: 0 auto 0 0; font-size: 17px; font-weight: 650; }
.area-pick { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; overflow-wrap: anywhere; }
/* Длинные пути и имена файлов переносятся, а не раздвигают страницу; в таблицах — обычный перенос */
table { overflow-wrap: break-word; }

/* --- общие блоки --------------------------------------------------------------- */
h2 { font-size: 16px; margin: 28px 0 12px; }
h2:first-child { margin-top: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { flex: 1 1 280px; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.list { display: grid; gap: 10px; }
.box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); min-width: 0;
}
.box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.box-head h2 { margin: 0; }
.box-head p { margin: 2px 0 0; }
.box-head .more { font-size: 13.5px; white-space: nowrap; text-decoration: none; }
.box-head .more:hover { text-decoration: underline; }
.row2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 16px; }
.row-wide { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-title h2 { margin: 0; }

.card, .tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.card { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.card h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.card time { color: var(--muted); font-size: 12.5px; display: block; margin-top: 6px; }
.card.prio { border-left: 3px solid var(--line); }
.card.prio.hot { border-left-color: var(--bad-dot); }
.preview { margin: 6px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-weak); color: var(--text); white-space: nowrap; text-decoration: none;
}
a.chip:hover { background: var(--line); }
.chip.area { font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.chip.hot { background: var(--bad); color: var(--surface); }
.chip.soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--a-other); }
[data-area="amerika"] > .dot, .dot[data-area="amerika"] { background: var(--a-amerika); }
[data-area="krov"] > .dot, .dot[data-area="krov"] { background: var(--a-krov); }
[data-area="lichnoe"] > .dot, .dot[data-area="lichnoe"] { background: var(--a-lichnoe); }
[data-area="zdorovie"] > .dot, .dot[data-area="zdorovie"] { background: var(--a-zdorovie); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chips button { border-radius: 999px; padding: 3px 12px; font-size: 13.5px; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* --- главная ---------------------------------------------------------------------- */
.hero {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 20px;
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; }
.hero h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
.lead { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; max-width: 640px; }
.lamps { display: flex; flex-wrap: wrap; gap: 8px; text-decoration: none; }
a.lamps:hover .lamp { border-color: var(--axis); }
.lamp {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 13px;
}
.lamp b { font-weight: 600; }
.lamp span { color: var(--muted); }
.lamp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.lamp.st-healthy .lamp-dot { background: var(--ok-dot); }
.lamp.st-degraded .lamp-dot { background: var(--warn-dot); }
.lamp.st-critical .lamp-dot { background: var(--bad-dot); }
.lamp.st-healthy, .lamp.st-degraded, .lamp.st-critical { color: var(--text); }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); color: inherit; text-decoration: none;
  transition: border-color .12s, box-shadow .12s;
}
a.kpi:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.kpi-label { color: var(--muted); font-size: 13.5px; }
.kpi-value { font-size: 30px; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; }
.kpi-sub { color: var(--muted); font-size: 13px; }
.kpi .spark { margin-top: 8px; }
.spark { display: block; width: 100%; height: 30px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--data); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area-fill { fill: var(--data); opacity: .1; stroke: none; }

/* столбчатый график */
.colchart { --plot-h: 190px; }
.plot { position: relative; height: var(--plot-h); margin-left: 34px; }
.gridline { position: absolute; left: 0; right: 0; bottom: var(--at); border-top: 1px solid var(--grid); }
.gridline.base { border-top-color: var(--axis); }
.gridline span {
  position: absolute; right: calc(100% + 8px); top: -9px; color: var(--faint); font-size: 11.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.col {
  flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center;
  border: 0; border-radius: 6px; padding: 0; background: transparent; cursor: default;
}
.col:hover, .col:focus-visible { background: var(--surface-2); }
.bar {
  width: min(24px, 70%); height: var(--h); min-height: 0; background: var(--data);
  border-radius: 4px 4px 0 0; transition: opacity .12s;
}
.bar.zero { height: 0; }
.col:hover .bar, .col:focus-visible .bar { opacity: .82; }
.xaxis { display: flex; gap: 2px; margin: 6px 0 0 34px; }
.xaxis span {
  flex: 1 1 0; min-width: 0; text-align: center; color: var(--faint); font-size: 11.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.xaxis span.today { color: var(--text); font-weight: 600; }
.chart-note { margin: 12px 0 0; }
details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.table-view .table-wrap { margin-top: 8px; }

/* горизонтальные полосы */
.hbars { display: grid; gap: 4px; }
.hbar {
  display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 4px 6px; margin: 0 -6px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 14px;
}
a.hbar:hover { background: var(--surface-2); }
.hbar-label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hbar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { height: 10px; background: var(--data-weak); border-radius: 0 4px 4px 0; overflow: hidden; }
.fill { display: block; width: var(--w); height: 100%; background: var(--data); border-radius: 0 4px 4px 0; }
.hbar-value { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; min-width: 34px; }

/* доли областей */
.share { display: flex; gap: 2px; height: 12px; margin: 4px 0 10px; }
.share .seg { flex: var(--g) 1 0%; min-width: 4px; background: var(--a-other); }
.share .seg:first-child { border-radius: 4px 0 0 4px; }
.share .seg:last-child { border-radius: 0 4px 4px 0; }
.share .seg:only-child { border-radius: 4px; }
.share .seg[data-area="amerika"] { background: var(--a-amerika); }
.share .seg[data-area="krov"] { background: var(--a-krov); }
.share .seg[data-area="lichnoe"] { background: var(--a-lichnoe); }
.share .seg[data-area="zdorovie"] { background: var(--a-zdorovie); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.areas { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.area-card { display: flex; flex-direction: column; gap: 8px; }
.area-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.area-card header { display: flex; align-items: center; gap: 8px; }
.area-card header b { font-size: 15px; }
.area-card header .dot { width: 10px; height: 10px; }
.area-card .big { font-size: 26px; font-weight: 650; line-height: 1.1; }
.area-card .desc { margin: 0; color: var(--muted); font-size: 13.5px; }
.area-card footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.area-card footer button { font-size: 13px; padding: 4px 10px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--grid);
}
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline a.t-title { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.timeline a.t-title:hover { color: var(--accent); text-decoration: underline; }
.timeline .t-when { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.timeline .meta { grid-column: 1 / -1; }
.src { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.src[data-src="claude"] { background: var(--data-weak); border-color: transparent; }
.feed-text { font-size: 14px; overflow-wrap: anywhere; }
.feed-text a { color: var(--text); }

.who { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.who li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; align-items: start; }
.who .lamp-dot { margin-top: 7px; }
.who .lamp-dot.on { background: var(--ok-dot); }
.who .lamp-dot.off { background: var(--axis); }
.who b { font-size: 14px; }
.who p { margin: 0; }

/* --- таблицы, карточка записи ---------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(660px, 100%);
  background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto;
  padding: 22px 24px 40px; box-shadow: -8px 0 28px rgba(0, 0, 0, .14); z-index: 20;
}
.panel h2 { margin: 0 36px 10px 0; font-size: 19px; line-height: 1.3; }
.close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  font-size: 22px; line-height: 1; padding: 0;
}
.body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0; font-size: 14.5px; }
.panel details { margin-top: 14px; }
.panel pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; background: var(--bg); padding: 10px; border-radius: 8px; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tip {
  position: fixed; z-index: 30; pointer-events: none; min-width: 150px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; box-shadow: var(--shadow-lift); font-size: 13px;
}
.tip b { display: block; font-size: 15px; }
.tip .tip-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }

/* --- задачи и цели ---------------------------------------------------------------------- */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; }
.task {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 10px 0; border-top: 1px solid var(--grid);
}
.task:first-child { border-top: 0; padding-top: 0; }
.task-main { display: grid; gap: 5px; min-width: 0; }
.task .t-title { color: var(--text); text-decoration: none; font-weight: 500; }
.task .t-title:hover { color: var(--accent); text-decoration: underline; }
.task.closed .t-title { color: var(--muted); text-decoration: line-through; }
.task select { font-size: 13px; padding: 3px 6px; }
.tick {
  width: 22px; height: 22px; margin-top: 1px; padding: 0; border-radius: 50%;
  border: 2px solid var(--axis); background: transparent; color: #fff;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.tick:hover { border-color: var(--ok-dot); }
.tick.on { background: var(--ok-dot); border-color: var(--ok-dot); }
.task-groups { display: grid; gap: 14px; }
.group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.nav .n.alert { color: var(--bad); font-weight: 600; }
.add-box { margin-bottom: 16px; }
.add-box > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; list-style: none; width: fit-content; }
.add-box > summary::-webkit-details-marker { display: none; }
.plan-form { display: grid; gap: 12px; margin-top: 8px; }
.plan-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.plan-form label.grow { flex: 1 1 100%; }
.plan-form label.wide { flex: 1 1 220px; }
.plan-form input, .plan-form select, .plan-form textarea { font-size: 14.5px; color: var(--text); min-width: 0; }
.plan-form textarea { resize: vertical; min-height: 44px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.form-msg p { margin: 0; }
.form-msg .ok { color: var(--ok); }
.form-msg .warn { color: var(--warn); }
.form-msg ul { margin: 4px 0 0; padding-left: 20px; }
.progress { height: 8px; background: var(--data-weak); border-radius: 4px; overflow: hidden; }
.progress-fill { display: block; width: var(--w); height: 100%; background: var(--ok-dot); border-radius: 4px; }
.goal-card { display: flex; flex-direction: column; gap: 10px; }
.goal-card h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.goal-card .t-title, .goal-line .t-title { color: var(--text); text-decoration: none; }
.goal-card .t-title:hover, .goal-line .t-title:hover { color: var(--accent); text-decoration: underline; }
.goal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.goal-foot select { font-size: 13px; padding: 3px 6px; }
.goal-list { display: grid; gap: 16px; }
.goal-line { display: grid; gap: 6px; }
.goal-line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.plan-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0;
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.plan-box .spacer { flex: 1; }
@media (max-width: 520px) {
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task select { grid-column: 2; justify-self: start; }
}

/* --- идеи -------------------------------------------------------------------------------- */
.idea-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 18px;
  background: var(--data-weak); border: 1px solid var(--data); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.idea-banner:hover { box-shadow: var(--shadow-lift); }
.idea-banner .more { margin-left: auto; color: var(--accent); font-weight: 600; white-space: nowrap; }
.idea-icon { font-size: 20px; color: var(--data); }
.idea-card { display: grid; gap: 8px; }
.idea-card h3 { margin: 0; font-size: 16px; }
.idea-card .t-title { color: var(--text); text-decoration: none; }
.idea-card .t-title:hover { color: var(--accent); text-decoration: underline; }
.idea-card .preview { margin: 0; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions .ok { color: var(--ok); margin: 0; }

/* --- люди -------------------------------------------------------------------------------- */
.gaps { margin-bottom: 16px; }
.gaps .chips { margin: 8px 0 0; }
.person h3 { margin-bottom: 4px; }
.plain-list { padding-left: 18px; margin: 0 0 10px; }
.plain-list li { margin: 4px 0; }

/* --- диагностика -------------------------------------------------------------------- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; }
.checklist li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: start;
  padding: 12px 0; border-top: 1px solid var(--grid);
}
.checklist li:first-child { border-top: 0; padding-top: 0; }
.checklist .lamp-dot { margin-top: 6px; }
.checklist li.lvl-healthy .lamp-dot { background: var(--ok-dot); }
.checklist li.lvl-degraded .lamp-dot { background: var(--warn-dot); }
.checklist li.lvl-critical .lamp-dot { background: var(--bad-dot); }
.checklist li.lvl-idle .lamp-dot { background: var(--axis); }
.checklist li { color: var(--text); }
.checklist b { font-size: 14.5px; }
.checklist p { margin: 2px 0 0; }
.checklist .state { font-size: 13px; font-weight: 600; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px 18px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 20px; font-weight: 650; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--grid); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.step-n {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--axis); color: var(--muted); font-size: 13px; font-weight: 600;
}
.steps li.done .step-n { background: var(--ok-dot); border-color: var(--ok-dot); color: #fff; }
.steps li.now .step-n { border-color: var(--accent); color: var(--accent); }
.steps b { font-size: 14.5px; }
.steps p { margin: 2px 0 0; }
.steps .state { font-size: 12.5px; white-space: nowrap; color: var(--muted); }
.steps li.done .state { color: var(--ok); } .steps li.now .state { color: var(--accent); font-weight: 600; }
.howto { display: grid; gap: 12px; }
.howto p { margin: 0 0 4px; }
.howto code, .mono { font: 12.5px/1.5 ui-monospace, Consolas, monospace; background: var(--bg); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* --- Markdown ------------------------------------------------------------------------- */
.body.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4, .md h5 { margin: 20px 0 8px; line-height: 1.3; }
.md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4, .md h5 { font-size: 15px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 10px; }
.md li { margin: 3px 0; }
.md code { font: 13px/1.45 ui-monospace, Consolas, monospace; background: var(--bg); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.md pre { background: var(--bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 0 0 12px; white-space: pre; }
.md pre code { background: none; padding: 0; overflow-wrap: normal; }
.md blockquote { border-left: 3px solid var(--line); margin: 0 0 10px; padding: 2px 12px; color: var(--muted); }
.md .table-wrap { margin: 0 0 12px; }

/* --- вики -------------------------------------------------------------------------------- */
a.tile { display: block; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
a.tile h3 { margin: 8px 0 4px; font-size: 15px; }
.back { display: inline-block; margin-bottom: 12px; }
.wiki-doc { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.wiki-article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 28px; max-width: 820px; min-width: 0;
}
.wiki-article h1 { font-size: 24px; line-height: 1.25; margin: 10px 0 12px; }
.wiki-article > h2 { font-size: 19px; margin: 0 0 12px; color: var(--muted); }
.wiki-article .md { font-size: 15.5px; line-height: 1.6; }
.lessons { position: sticky; top: 72px; }
.lessons ol { padding-left: 20px; margin: 6px 0 0; }
.lessons li { margin: 5px 0; }
.pager {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line);
}
.glossary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 12px; margin: 0; }
.glossary dt { font-weight: 600; margin-top: 10px; }
.glossary dd { margin: 2px 0 0; color: var(--muted); }

/* --- узкие экраны ------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .row-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .side {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 6px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; margin-right: auto; }
  .side-foot { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 8px; }
  .side-foot .muted { display: none; }
  .nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; gap: 2px; padding-bottom: 2px; }
  .nav-group { display: none; }
  .nav a { flex: none; white-space: nowrap; padding: 6px 10px; }
  .nav .n { display: none; }
  .top { position: static; padding: 10px 16px; gap: 8px 12px; }
  .area-pick { width: 100%; }
  .area-pick select { flex: 1; min-width: 0; }
  main { padding: 16px 16px 40px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .wiki-doc { grid-template-columns: 1fr; }
  .lessons { position: static; order: -1; }
  .wiki-article { padding: 16px; }
  .hero h1 { font-size: 24px; }
}
@media (max-width: 520px) {
  .box { padding: 14px; }
  .kpi-value { font-size: 26px; }
  .hbar { grid-template-columns: minmax(80px, 42%) minmax(0, 1fr) auto; }
  .checklist li { grid-template-columns: auto minmax(0, 1fr); }
  .checklist .state { grid-column: 2; }
}
