:root {
  --bg: #f2f3f5;
  --panel: #ffffff;
  --ink: #14161a;
  --ink-soft: #3d434e;
  --muted: #6a7280;
  --line: #e2e5ea;
  --line-soft: #eceef2;
  --accent: #2a63d6;
  --accent-soft: #e8efff;
  --ok: #0d7a46;
  --ok-soft: #e4f4ea;
  --err: #c62f26;
  --err-soft: #fdeceb;
  --radius: 12px;
  /* Непрозрачный цвет: им подсвечивается строка, в том числе закреплённые колонки */
  --row-hover: #f1f5fe;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --panel: #1e2128;
    --ink: #eceef2;
    --ink-soft: #c3c8d2;
    --muted: #99a1ae;
    --line: #2f343d;
    --line-soft: #272b33;
    --accent: #7aa5ff;
    --accent-soft: #24304a;
    --ok: #5fc78e;
    --ok-soft: #1b3527;
    --err: #ff8e86;
    --err-soft: #3a201e;
    --row-hover: #242a35;
  }
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любые display из правил ниже */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

/* --- боковое меню --- */
.side {
  width: 236px;
  flex: 0 0 236px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { font-weight: 600; font-size: 17px; padding: 0 12px 20px; line-height: 1.3; }
.brand span { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav a {
  padding: 11px 14px; border-radius: 9px; color: var(--ink-soft);
  text-decoration: none; font-size: 15.5px;
}
.side nav a:hover { background: var(--bg); color: var(--ink); }
.side nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.logout { margin-top: auto; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 11px 14px; font: inherit; }
.link:hover { color: var(--ink); }

/* --- основная область --- */
main { flex: 1; padding: 34px 40px 80px; max-width: 1460px; min-width: 0; }
main.center { display: flex; align-items: center; justify-content: center; max-width: none; }

h1 { font-size: 28px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 19px; line-height: 1.35; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 26px 0 10px; }
p { margin: 0 0 12px; }
h1 + p.muted, h2 + p.muted { margin-top: -2px; }
a { color: var(--accent); text-underline-offset: 2px; }

code {
  background: var(--line-soft); border-radius: 6px; padding: 2px 7px;
  font-size: 14px; font-family: ui-monospace, Consolas, monospace; word-break: break-all;
}
pre {
  background: var(--line-soft); border-radius: 10px; padding: 16px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.65;
  font-family: ui-monospace, Consolas, monospace;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 30px; }

/* --- карточки --- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px; margin: 22px 0;
}
.card > h2:first-child { margin-bottom: 4px; }
.card.danger { border-color: color-mix(in srgb, var(--err) 30%, var(--line)); }
.empty {
  background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px 28px; text-align: center;
}
.empty p { margin: 6px 0; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 22px 0; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; min-width: 150px; flex: 1;
}
.stat b { display: block; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }

.note { margin-top: 16px; padding: 16px; background: var(--line-soft); border-radius: 10px; }
.note div + div { margin-top: 8px; }
.err-text { color: var(--err); }

.flash { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 15px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--err-soft); color: var(--err); }

/* --- таблицы --- */
table { width: 100%; border-collapse: collapse; }
.list, .feed {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
th {
  text-align: left; font-size: 14px; color: var(--muted); font-weight: 600;
  padding: 13px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--panel);
}
td {
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top; font-size: 15px; line-height: 1.5;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
td.right, th.right { text-align: right; font-variant-numeric: tabular-nums; }
.msg { width: 100%; word-break: break-word; }
.msg.out { color: var(--accent); }
.json { display: block; max-width: 460px; white-space: pre-wrap; word-break: break-word; }

/* Широкие таблицы прокручиваются внутри себя, а не растягивают страницу */
.scroll-x { overflow-x: auto; border-radius: var(--radius); }
/* overflow:hidden у .list ломает position:sticky — внутри прокрутки он не нужен,
   скругление углов берёт на себя сама обёртка .scroll-x */
.scroll-x > table { min-width: 100%; overflow: visible; }
.scroll-x th { white-space: nowrap; }
.scroll-x td.wrap { min-width: 220px; max-width: 420px; }

/* Закреплённые колонки: дата и фамилия остаются на месте при прокрутке вбок */
.pinned th:nth-child(1), .pinned td:nth-child(1),
.pinned th:nth-child(2), .pinned td:nth-child(2) {
  position: sticky; z-index: 2; background: var(--panel);
}
.pinned th:nth-child(1), .pinned td:nth-child(1) {
  left: 0; width: 134px; min-width: 134px;
}
.pinned th:nth-child(2), .pinned td:nth-child(2) {
  left: 134px; min-width: 230px; border-right: 1px solid var(--line);
}
.pinned tbody tr:hover td:nth-child(1),
.pinned tbody tr:hover td:nth-child(2) { background: var(--row-hover); }

@media (max-width: 860px) {
  /* На узком экране закрепление съедает половину ширины — отключаем */
  .pinned th:nth-child(1), .pinned td:nth-child(1),
  .pinned th:nth-child(2), .pinned td:nth-child(2) { position: static; min-width: 0; width: auto; }
}

.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 7px; padding: 3px 10px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.pill { display: inline-block; border-radius: 20px; padding: 4px 13px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pill.poll { background: var(--ok-soft); color: var(--ok); }
.pill.webhook { background: var(--accent-soft); color: var(--accent); }
.pill.off { background: var(--line-soft); color: var(--muted); }

/* --- формы --- */
input[type=text], input[type=password], input:not([type]), select, textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; min-width: 0;
}
textarea { resize: vertical; width: 100%; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  padding: 12px 20px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger { background: var(--err); border-color: var(--err); color: #fff; }
/* Неприметная ссылка-кнопка: удалить сводку можно, но случайно не нажмёшь. */
button.link-btn {
  background: none; border: 0; padding: 2px 0; margin-top: 2px;
  font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer;
}
button.link-btn.danger { background: none; color: var(--err); }
button.link-btn:hover { color: var(--err); }
.small-btn { padding: 7px 13px; font-size: 14px; }
.small-btn:disabled { opacity: .35; cursor: default; }
.rowbtns { display: inline-flex; gap: 6px; margin-left: 6px; }
.btn {
  display: inline-block; padding: 8px 15px; border: 1px solid var(--line);
  border-radius: 9px; text-decoration: none; font-size: 14.5px; color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.inline { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.steps { margin: 0 0 18px; padding-left: 22px; }
.steps li { margin: 7px 0; }

.stack { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.stack > button { align-self: flex-start; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.field > span { font-size: 14px; color: var(--muted); }
.two { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.two > input { flex: 1 1 260px; }

.modes { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.mode {
  display: block; width: 100%; padding: 15px 17px; border: 1px solid var(--line);
  border-radius: 11px; cursor: pointer;
}
.mode:hover { border-color: var(--muted); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); }
.mode b { margin-left: 10px; font-size: 16px; }
.mode span { display: block; margin-left: 30px; margin-top: 3px; line-height: 1.5; }
.key { user-select: all; }

/* --- диаграммы --- */
.progress { margin-top: 14px; }
.progress-bar {
  height: 22px; border-radius: 11px; background: var(--line-soft); overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; border-radius: 11px;
  background: linear-gradient(90deg, var(--accent), #2fa36b);
  transition: width .4s ease;
}
.progress-legend {
  display: flex; gap: 16px; margin-top: 10px; font-size: 15px; flex-wrap: wrap;
}
.progress-legend .right { margin-left: auto; font-size: 19px; }

.chart { width: 100%; height: auto; margin-top: 12px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; }
.chart .axis.mid, .chart .bar-value { text-anchor: middle; }
.chart .axis.right-anchor { text-anchor: end; }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .bar:hover { opacity: 1; }
.chart .bar-value { fill: var(--ink-soft); font-size: 12px; }
.chart .cum { fill: none; stroke: #2fa36b; stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot { fill: #2fa36b; }

.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.hbar { display: flex; align-items: center; gap: 14px; }
.hbar-label { flex: 0 0 230px; font-size: 14.5px; }
.hbar-track { flex: 1; height: 16px; border-radius: 8px; background: var(--line-soft); overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.hbar-value { flex: 0 0 90px; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
  .hbar-label { flex-basis: 120px; font-size: 13.5px; }
}

/* --- отчёты секциями --- */
.worksection { margin: 38px 0; }
.worksection:first-of-type { margin-top: 26px; }

.totals { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px; }
.total {
  background: var(--accent-soft); border-radius: 10px; padding: 12px 18px; min-width: 140px;
}
.total b { display: block; font-size: 24px; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.total span { font-size: 13.5px; color: var(--accent); opacity: .85; }

.reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); gap: 16px; }
.report {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
}
.report > header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.report > header b { font-size: 16px; }

.volumes { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.volume {
  flex: 1 1 140px; background: var(--line-soft); border-radius: 10px; padding: 12px 16px;
}
.volume b {
  display: block; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.volume span { font-size: 13.5px; color: var(--muted); line-height: 1.35; display: block; margin-top: 2px; }
.volume.people { background: var(--ok-soft); }
.volume.people b, .volume.people span { color: var(--ok); }

.props { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.props dt { color: var(--muted); font-size: 14px; }
.props dd { margin: 0; font-size: 15px; word-break: break-word; }

/* --- просмотр 3D-модели --- */
.model-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.viewer {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; height: min(76vh, 820px);
}
#viewer-canvas { width: 100%; height: 100%; }
#viewer-canvas canvas { display: block; width: 100%; height: 100%; }
.viewer-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; background: var(--panel);
}
.legend {
  position: absolute; left: 14px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; color: var(--ink-soft);
}
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.viewer-note {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  max-width: min(560px, calc(100% - 28px)); text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; font-size: 13.5px; color: var(--ink-soft);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .10);
}
.offmodel-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.offmodel-row:first-child { border-top: 0; }
.offmodel-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.offmodel-row .warn { color: #b4442f; }
.model-side .totals { margin: 12px 0 0; }
.model-side .total { min-width: 0; flex: 1 1 120px; padding: 10px 14px; }
.model-side .total b { font-size: 21px; }

@media (max-width: 1100px) {
  .model-layout { grid-template-columns: minmax(0, 1fr); }
  .viewer { height: 60vh; }
}

/* --- дерево отчётов по секциям --- */
.tree { margin-top: 12px; }
.tree details { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tree-section { margin-top: 10px; }
.tree-section > summary { padding: 12px 14px; }
.tree-level, .tree-kind { margin-top: 8px; border-color: color-mix(in srgb, var(--line) 70%, transparent); }
.tree-level > summary, .tree-kind > summary { padding: 9px 12px; font-size: 14.5px; }
.tree summary {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  list-style: none; user-select: none;
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before {
  content: '▸'; flex: 0 0 auto; color: var(--muted); font-size: 12px;
  transition: transform .12s ease;
}
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree summary:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 10px; }
.tree-name { flex: 1 1 auto; min-width: 0; }
.tree-name .muted { margin-left: 8px; }
.tree-body { padding: 4px 14px 14px 30px; }
.tree-kind .tree-body { padding: 4px 12px 12px 26px; }

/* короткая полоса выполнения в строке дерева */
.mini { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.mini-bar {
  display: block; width: 90px; height: 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden;
}
.mini-bar i { display: block; height: 100%; background: var(--muted); }
.mini-bar.part i { background: #efb034; }
.mini-bar.done i { background: #2fa36b; }
.mini-bar.over i { background: var(--err); }
.mini .pc { min-width: 42px; text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mini b { font-variant-numeric: tabular-nums; }

@media (max-width: 680px) {
  .tree summary { flex-wrap: wrap; gap: 8px; }
  .mini-bar { width: 60px; }
}

/* --- виды работ --- */
.worktype {
  border: 1px solid var(--line); border-radius: 11px;
  margin: 12px 0; background: var(--bg);
}
.worktype > summary {
  cursor: pointer; padding: 15px 18px; font-size: 16px; font-weight: 600;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.worktype > summary::-webkit-details-marker { display: none; }
.worktype > summary::after { content: '▾'; color: var(--muted); font-size: 14px; }
.worktype[open] > summary { border-bottom: 1px solid var(--line); }
.worktype[open] > summary::after { content: '▴'; }
.worktype > summary .count { font-weight: 400; font-size: 14px; color: var(--muted); margin-left: auto; }
.worktype-body { padding: 16px 18px; }
.worktype .list { background: var(--panel); }

/* --- печатная инструкция --- */
.paper {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 46px 54px; max-width: 820px; margin: 34px auto; line-height: 1.65;
}
.paper h1 { font-size: 27px; margin-bottom: 14px; }
.paper h2 { font-size: 19px; margin: 30px 0 10px; }
.paper .lead { font-size: 17px; color: var(--ink-soft); margin-bottom: 8px; }
.paper ol, .paper ul { padding-left: 24px; margin: 0 0 14px; }
.paper li { margin: 6px 0; }
.paper .list { margin: 14px 0; }
.paper .list td:first-child { width: 210px; }

@media print {
  body { display: block; background: #fff; }
  .side, .print-hide { display: none !important; }
  main { padding: 0; max-width: none; }
  .paper { border: 0; margin: 0; padding: 0; max-width: none; }
  .paper h2 { break-after: avoid; }
  .list { break-inside: avoid; }
}

/* --- вход --- */
.login { width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-size: 22px; }
.login p { margin: 0; }

/* --- переписка --- */
.chat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto;
}
.bubble { max-width: 72%; padding: 11px 15px; border-radius: 16px; background: var(--line-soft); line-height: 1.5; white-space: pre-wrap; }
.bubble.out { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble time { display: block; font-size: 12px; opacity: .7; margin-top: 5px; }

@media (max-width: 860px) {
  body { flex-direction: column; }
  .side {
    width: auto; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; overflow-x: auto; padding: 12px 14px;
  }
  .side nav { flex-direction: row; }
  .brand { padding: 0 14px 0 0; font-size: 15px; }
  .brand span { display: none; }
  .logout { margin-top: 0; }
  main { padding: 22px 16px 60px; }
  h1 { font-size: 24px; }
  .bubble { max-width: 88%; }
}

/* --- отдельные боты: Даша и Малой --- */
.side nav .nav-cap {
  margin: 18px 14px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.gap { margin-top: 30px; }
.late { color: var(--err); }
.prewrap { white-space: pre-wrap; word-break: break-word; }
h1.text { white-space: pre-wrap; word-break: break-word; }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 24px; }
.tabs a {
  padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--ink-soft); text-decoration: none; font-size: 15px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.chip {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-soft); text-decoration: none; font-size: 14px; white-space: nowrap;
}
.chip:hover { border-color: var(--muted); }
.chip b { margin-left: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.chip.on b { color: var(--accent); }

a.stat { color: inherit; text-decoration: none; transition: border-color .15s; }
a.stat:hover { border-color: var(--accent); }
.stat small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.stat small.err-text { color: var(--err); }
.pill.late { background: var(--err-soft); color: var(--err); }
.volume.warn { background: var(--err-soft); }
.volume.warn b, .volume.warn span { color: var(--err); }

.bots-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.botchip {
  display: inline-flex; flex-direction: column; padding: 9px 16px; line-height: 1.35;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.botchip span { font-size: 13px; font-weight: 400; color: var(--muted); }
a.botchip:hover { border-color: var(--accent); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 6px 0 10px; font-size: 15px; }
.meta .muted { margin-right: 2px; }
.card.tight { padding: 10px 22px 14px; margin-top: 10px; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

.dots { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.dots i { display: block; width: 13px; height: 13px; border-radius: 3px; background: var(--line); }
.dots i.on { background: #2fa36b; }
.dots i.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.habit { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.habit:last-of-type { border-bottom: 0; }
.habit .name { flex: 1 1 180px; text-decoration: none; }
.weeks { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; align-items: center; margin-top: 14px; }
.weeks .dots i { width: 24px; height: 24px; border-radius: 6px; }

.notes { display: flex; flex-direction: column; gap: 12px; }
.note-card {
  display: block; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.note-card:hover { border-color: var(--accent); }
.note-card p { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; }
.money-in { color: var(--ok); }

.bot-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 12px 0 8px; }
.card.botcard { display: block; margin: 0; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.card.botcard:hover { border-color: var(--accent); }
.botcard h3 { margin: 0 0 2px; font-size: 19px; }
.botcard .more { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 600; font-size: 15px; }

@media (max-width: 860px) {
  .side nav .nav-cap { display: none; }
  .weeks .dots i { width: 18px; height: 18px; }
}
td.task { min-width: 240px; word-break: break-word; }
main > .tabs:first-child { margin-top: 0; }
.card .progress + p { margin-top: 10px; }
