/* Тимлид AI, панель владельца v2 (docs/design/panel-v2.md). Перенесено из prototype/proto.css.
   Токены v1 (роли srvpanel) плюс v2: --auto, --auto-bg, --row-h. Без внешних шрифтов и url().
   Без style="" в разметке: CSP default-src 'self'. Геометрия графиков через атрибуты SVG. */
:root {
  color-scheme: dark;
  --bg: #0f1012;
  --side: #141518;
  --surface: #1a1b1e;
  --surface-2: #222327;
  --surface-3: #2a2b30;
  --border: #2c2d32;
  --text: #f4f4f2;
  --text-2: #c3c2b7;
  --text-3: #8d8c86;
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, .14);
  --on-accent: #ffffff;
  --good: #0ca30c;
  --good-text: #3fcf3f;
  --good-bg: rgba(12, 163, 12, .14);
  --warning: #fab219;
  --warning-text: #fab219;
  --warning-bg: rgba(250, 178, 25, .14);
  --critical: #d03b3b;
  --critical-text: #f07272;
  --critical-bg: rgba(208, 59, 59, .16);
  --info-text: #7fb2f0;
  --s1: #3987e5;
  --s7: #9085e9;
  --auto: #9085e9;                    /* v2: всё, что Тимлид делает сам */
  --auto-bg: rgba(144, 133, 233, .16);/* v2 */
  --row-h: 40px;                      /* v2: высота строки списков */
  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .25);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 14px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f3f1; --side: #fbfbfa; --surface: #ffffff; --surface-2: #f4f4f2; --surface-3: #ebebe8; --border: #e4e3de;
  --text: #0b0b0b; --text-2: #52514e; --text-3: #6f6e69; --accent: #2a78d6; --accent-soft: rgba(42, 120, 214, .10);
  --good-text: #0a7f0a; --good-bg: #e7f5e7; --warning-text: #8a5b00; --warning-bg: #fdf3dc;
  --critical-text: #b42f2f; --critical-bg: #fbe7e7; --info-text: #1f64b8; --s1: #2a78d6; --s7: #4a3aa7;
  --auto: #5b4bc4; --auto-bg: #eeebfb;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f3f1; --side: #fbfbfa; --surface: #ffffff; --surface-2: #f4f4f2; --surface-3: #ebebe8; --border: #e4e3de;
    --text: #0b0b0b; --text-2: #52514e; --text-3: #6f6e69; --accent: #2a78d6; --accent-soft: rgba(42, 120, 214, .10);
    --good-text: #0a7f0a; --good-bg: #e7f5e7; --warning-text: #8a5b00; --warning-bg: #fdf3dc;
    --critical-text: #b42f2f; --critical-bg: #fbe7e7; --info-text: #1f64b8; --s1: #2a78d6; --s7: #4a3aa7;
    --auto: #5b4bc4; --auto-bg: #eeebfb;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- controls ---------- */
button, .btn {
  font: inherit; font-size: 13px; cursor: pointer; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); padding: 7px 13px; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; transition: background .12s, border-color .12s; white-space: nowrap; text-decoration: none; min-height: 34px;
}
button:hover, .btn:hover { background: var(--surface-3); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.sm, .btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; min-height: 28px; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover, button.primary:hover { filter: brightness(1.08); }
.btn.danger, button.danger { background: var(--critical); border-color: var(--critical); color: #fff; font-weight: 600; }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.quiet, button.quiet { color: var(--critical-text); }
.btn.auto { background: var(--auto-bg); border-color: transparent; color: var(--auto); font-weight: 600; }
input[type="text"], input[type="search"], input[type="number"], input[type="time"], textarea, select {
  font: inherit; font-size: 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 10px; width: 100%; min-height: 34px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
label.field { display: grid; gap: 5px; font-size: 12px; color: var(--text-2); }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
form.inline { display: inline; margin: 0; }
kbd { font: 600 11px/1 var(--mono); padding: 2px 5px; border-radius: 5px; border: 1px solid var(--border); border-bottom-width: 2px; color: var(--text-3); background: var(--surface); }
.btn kbd { margin-left: 4px; background: transparent; border-color: color-mix(in srgb, currentColor 30%, transparent); color: inherit; opacity: .75; }

/* segmented: links or submit buttons */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12px; color: var(--text-2); min-height: 26px; display: inline-flex; align-items: center; gap: 6px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg .on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* filter chips (links) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); min-height: 28px; }
.chip:hover { text-decoration: none; color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--text); font-weight: 600; }
.chip b { font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--side) 247px, var(--border) 247px, var(--border) 248px, transparent 248px); }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px;
  background: linear-gradient(135deg, var(--s1), var(--s7)); color: #fff; letter-spacing: .5px; flex: none; }
.brand b { display: block; font-size: 14px; }
.brand small { display: block; font-size: 12px; color: var(--text-3); }
.state { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.state b { color: var(--text); font-weight: 600; }
.state.paused { background: var(--critical-bg); color: var(--critical-text); }
.nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 10px 4px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active svg { color: var(--accent); }
.nav a.alarm { color: var(--critical-text); }
.badge { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.badge.accent { background: var(--accent); color: var(--on-accent); }
.badge.critical { background: var(--critical-bg); color: var(--critical-text); }
.badge.warning { background: var(--warning-bg); color: var(--warning-text); }
.side .foot { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 4px 0; display: grid; gap: 10px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; padding: 12px 28px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.top h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.top .sub { font-size: 12px; color: var(--text-3); }
.top .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.search { position: relative; width: 280px; }
.search input { padding-left: 32px; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.crumbs { font-size: 12px; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.view { padding: 8px 28px 48px; max-width: 1320px; width: 100%; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
.g-split { grid-template-columns: minmax(340px, .9fr) minmax(0, 1.4fr); align-items: start; }
.sticky { position: sticky; top: 72px; }

/* ---------- blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 14px 16px 0; }
.card > h2, .card-h { font-size: 14px; font-weight: 650; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > h2 .right, .card-h .right { margin-left: auto; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.card.danger-zone { border-color: color-mix(in srgb, var(--critical) 55%, var(--border)); }
.card.auto-zone { border-color: color-mix(in srgb, var(--auto) 45%, var(--border)); }
.lead { color: var(--text-2); font-size: 13px; max-width: 78ch; }
.section-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-h h2 { font-size: 15px; font-weight: 650; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--good-bg); color: var(--good-text); }
.pill.warning { background: var(--warning-bg); color: var(--warning-text); }
.pill.critical { background: var(--critical-bg); color: var(--critical-text); }
.pill.info { background: var(--accent-soft); color: var(--info-text); }
.pill.idle { background: var(--surface-3); color: var(--text-3); }
.pill.auto { background: var(--auto-bg); color: var(--auto); }
.pill.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.bot { background: var(--accent-soft); color: var(--info-text); }
.tag.risk { background: var(--critical-bg); color: var(--critical-text); }
.tag.warn { background: var(--warning-bg); color: var(--warning-text); }
.tag.auto { background: var(--auto-bg); color: var(--auto); }
.tag.ok { background: var(--good-bg); color: var(--good-text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot.ok { background: var(--good); } .dot.warning { background: var(--warning); } .dot.critical { background: var(--critical); } .dot.auto { background: var(--auto); } .dot.info { background: var(--accent); }
.flash { padding: 10px 14px; border-radius: 10px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flash.ok { background: var(--good-bg); color: var(--good-text); }
.flash.info { background: var(--accent-soft); color: var(--info-text); }
.flash.warning { background: var(--warning-bg); color: var(--warning-text); }
.flash.error { background: var(--critical-bg); color: var(--critical-text); }
.flash .btn { margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
  background: var(--surface-3); color: var(--text-2); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.c1 { background: rgba(57, 135, 229, .22); color: var(--info-text); }
.avatar.c2 { background: var(--auto-bg); color: var(--auto); }
.avatar.c3 { background: var(--good-bg); color: var(--good-text); }
.avatar.c4 { background: var(--warning-bg); color: var(--warning-text); }
.avatar.group { border-radius: 9px; }

/* KPI tiles with sparkline (srvpanel) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 0; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; color: var(--text); }
a.kpi:hover { text-decoration: none; border-color: var(--surface-3); }
.kpi .label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.kpi .sub { font-size: 12px; color: var(--text-2); min-height: 18px; }
.kpi svg.spark { display: block; width: calc(100% + 28px); margin: 6px -14px 0; height: 36px; }
.kpi.nospark { padding-bottom: 12px; }
.delta { font-size: 12px; font-weight: 600; }
.delta.up-bad, .delta.down-bad { color: var(--critical-text); }
.delta.up-good, .delta.down-good { color: var(--good-text); }
.delta.flat { color: var(--text-3); }

/* svg charts: geometry in attributes, colors in classes */
svg.spark .line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
svg.spark .area { fill: var(--accent); opacity: .14; }
svg.spark .ref { fill: none; stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; opacity: .7; }
svg.spark.warning .line { stroke: var(--warning); } svg.spark.warning .area { fill: var(--warning); }
svg.spark.critical .line { stroke: var(--critical); } svg.spark.critical .area { fill: var(--critical); }
svg.spark.good .line { stroke: var(--good); } svg.spark.good .area { fill: var(--good); }
svg.mini { width: 64px; height: 20px; display: block; }
svg.mini .line { fill: none; stroke: var(--text-2); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
svg.mini.critical .line { stroke: var(--critical); }
svg.mini .bar { fill: var(--text-3); }
svg.mini .bar.hot { fill: var(--critical); }
svg.plot { display: block; width: 100%; height: auto; overflow: visible; }
svg.plot .grid line { stroke: var(--border); stroke-width: 1; }
svg.plot text { fill: var(--text-3); font-size: 10px; font-family: var(--sans); }
svg.plot .b1 { fill: var(--accent); }
svg.plot .b2 { fill: var(--auto); }
svg.plot .b0 { fill: var(--surface-3); }
svg.plot .bw { fill: var(--warning); }
svg.plot .bc { fill: var(--critical); }
svg.plot .ln { fill: none; stroke: var(--warning); stroke-width: 2; vector-effect: non-scaling-stroke; }
svg.plot .target { stroke: var(--critical); stroke-width: 1; stroke-dasharray: 4 3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l1 { background: var(--accent); } .legend .l2 { background: var(--auto); } .legend .lw { background: var(--warning); } .legend .l0 { background: var(--surface-3); }
/* heatmap: hours x days */
svg.heat { display: block; width: 100%; height: auto; }
svg.heat rect { rx: 2px; }
svg.heat .h0 { fill: var(--surface-3); }
svg.heat .h1 { fill: color-mix(in srgb, var(--accent) 25%, var(--surface-3)); }
svg.heat .h2 { fill: color-mix(in srgb, var(--accent) 50%, var(--surface-3)); }
svg.heat .h3 { fill: color-mix(in srgb, var(--accent) 75%, var(--surface-3)); }
svg.heat .h4 { fill: var(--accent); }
svg.heat text { fill: var(--text-3); font-size: 9px; font-family: var(--sans); }
/* meters */
progress.meter { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--surface-3); overflow: hidden; display: block; }
progress.meter::-webkit-progress-bar { background: var(--surface-3); border-radius: 3px; }
progress.meter::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress.meter::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
progress.meter.warning::-webkit-progress-value { background: var(--warning); }
progress.meter.warning::-moz-progress-bar { background: var(--warning); }
progress.meter.critical::-webkit-progress-value { background: var(--critical); }
progress.meter.critical::-moz-progress-bar { background: var(--critical); }
progress.meter.auto::-webkit-progress-value { background: var(--auto); }
progress.meter.auto::-moz-progress-bar { background: var(--auto); }
.usage { display: grid; gap: 12px; }
.usage .row { display: grid; gap: 5px; }
.usage .row .head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }

/* autonomy level: 4 steps */
.lvl { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.lvl .steps { display: inline-grid; grid-template-columns: repeat(4, 6px); gap: 2px; align-items: end; }
.lvl .steps i { display: block; width: 6px; border-radius: 1px; background: var(--surface-3); }
.lvl .steps i:nth-child(1) { height: 5px; } .lvl .steps i:nth-child(2) { height: 8px; } .lvl .steps i:nth-child(3) { height: 11px; } .lvl .steps i:nth-child(4) { height: 14px; }
.lvl.l1 .steps i:nth-child(-n+1), .lvl.l2 .steps i:nth-child(-n+2) { background: var(--accent); }
.lvl.l3 .steps i:nth-child(-n+3), .lvl.l4 .steps i { background: var(--auto); }
.lvl.l3, .lvl.l4 { color: var(--auto); }
.lvl.l0 { color: var(--text-3); }

/* ---------- attention list ("Требует вас") ---------- */
.attn { display: grid; }
.attn li { display: grid; grid-template-columns: 4px 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px 10px 0; border-top: 1px solid var(--border); }
.attn li:first-child { border-top: 0; }
.attn .bar { width: 4px; align-self: stretch; border-radius: 0 2px 2px 0; background: var(--surface-3); }
.attn li.critical .bar { background: var(--critical); } .attn li.warning .bar { background: var(--warning); }
.attn li.info .bar { background: var(--accent); } .attn li.auto .bar { background: var(--auto); }
.attn .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.attn li.critical .ico { background: var(--critical-bg); color: var(--critical-text); }
.attn li.warning .ico { background: var(--warning-bg); color: var(--warning-text); }
.attn li.info .ico { background: var(--accent-soft); color: var(--info-text); }
.attn li.auto .ico { background: var(--auto-bg); color: var(--auto); }
.attn .ico svg { width: 16px; height: 16px; }
.attn .t { min-width: 0; }
.attn .t b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.attn .t small { display: block; color: var(--text-3); font-size: 12px; }
.attn .t q { color: var(--text-2); font-size: 13px; display: block; quotes: "«" "»"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn .act { display: flex; gap: 6px; align-items: center; }
.attn-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- digest ---------- */
.digest { display: grid; gap: 10px; }
.digest li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.digest li .n { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.digest li p { margin: 0; }
.src { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 4px; }
.src a { font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-3); }
.src a:hover { color: var(--text); text-decoration: none; }

/* ---------- draft card ---------- */
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.dcard.focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.dcard .dh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dcard .dh .who { min-width: 0; flex: 1; }
.dcard .dh .who b { display: block; font-size: 14px; }
.dcard .dh .who small { display: block; color: var(--text-3); font-size: 12px; }
.dcard .db { padding: 12px 16px; display: grid; gap: 10px; }
.inq { border-left: 3px solid var(--border); padding: 2px 0 2px 10px; font-size: 13px; color: var(--text-2); }
.inq time { display: block; font-size: 11px; color: var(--text-3); }
.draft-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--accent-soft); border-radius: 12px 12px 4px 12px; padding: 10px 12px; font-size: 14px; }
.draft-text.auto { background: var(--auto-bg); }
.why { font-size: 12px; color: var(--text-3); }
.why svg.icon { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }
.why b { color: var(--text-2); font-weight: 600; }
.dcard .da { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 16px 14px; }
.dcard .da .btn.primary { min-width: 132px; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 14px; }
.reasons .chip { font-size: 11px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--auto); }

/* queue list (left column) */
.qlist { display: grid; }
.qlist a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text); }
.qlist a:first-child { border-top: 0; }
.qlist a:hover { background: var(--surface-2); text-decoration: none; }
.qlist a.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.qlist .t b { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; }
.qlist .t span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlist .meta { text-align: right; font-size: 11px; color: var(--text-3); display: grid; gap: 3px; justify-items: end; }
.qlist .sect { padding: 8px 14px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface-2); }
.keys { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.keys span { display: inline-flex; gap: 5px; align-items: center; }

/* ---------- chats ---------- */
.clist { display: grid; }
.clist a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; color: var(--text); border-top: 1px solid var(--border); }
.clist a:first-child { border-top: 0; }
.clist a:hover { background: var(--surface-2); text-decoration: none; }
.clist a.on { background: var(--accent-soft); }
.clist .avatar { width: 36px; height: 36px; }
.clist .t b { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; min-width: 0; }
.clist .t b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clist .t small { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clist .meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--text-3); }
.chat-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 0; height: calc(100vh - 74px); border-top: 1px solid var(--border); }
.chat-wrap > * { min-width: 0; min-height: 0; overflow-y: auto; }
.chat-wrap .pane-l { border-right: 1px solid var(--border); background: var(--surface); }
.chat-wrap .pane-r { border-left: 1px solid var(--border); background: var(--side); padding: 14px; display: grid; gap: 14px; align-content: start; }
.pane-l .pane-tools { padding: 10px 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.thread { display: flex; flex-direction: column; }
.thread-h { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); z-index: 2; flex-wrap: wrap; }
.thread-h .who { flex: 1; min-width: 0; }
.thread-h .who b { display: block; }
.thread-h .who small { color: var(--text-3); font-size: 12px; }
.msgs { padding: 14px 18px; display: grid; gap: 6px; align-content: start; flex: 1; }
.day { text-align: center; font-size: 11px; color: var(--text-3); margin: 8px 0; }
.bubble { max-width: 74%; padding: 7px 11px; border-radius: 12px 12px 12px 4px; background: var(--surface-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; justify-self: start; }
.bubble .au { display: block; font-size: 11px; font-weight: 700; color: var(--info-text); }
.bubble.out { justify-self: end; background: var(--accent-soft); border-radius: 12px 12px 4px 12px; }
.bubble.bot { justify-self: end; background: var(--auto-bg); border-radius: 12px 12px 4px 12px; }
.bubble time { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; text-align: right; }
.bubble .mark { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.bubble.hl { box-shadow: 0 0 0 1px var(--warning); }
.composer { position: sticky; bottom: 0; border-top: 1px solid var(--border); background: var(--surface); padding: 12px 18px; display: grid; gap: 8px; }
.composer .ch { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.composer textarea { min-height: 70px; background: var(--accent-soft); border-color: transparent; }
.pane-r h3 { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 8px; }
.pane-r .pbox { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.opts { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; text-align: left; width: 100%; justify-content: stretch; white-space: normal; }
.opt small { grid-column: 2; color: var(--text-3); font-size: 11px; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on.l3, .opt.on.l4 { border-color: var(--auto); background: var(--auto-bg); }
.opt[disabled], .opt.locked { opacity: .55; cursor: not-allowed; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 600; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th.r, table.data td.r { text-align: right; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; height: var(--row-h); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr.bad td { background: var(--critical-bg); }
table.data .person { display: flex; align-items: center; gap: 10px; color: var(--text); }
table.data .person b { display: block; font-weight: 600; }
table.data .person small { display: block; font-size: 12px; color: var(--text-3); }
table.data .load { width: 110px; }
.empty { color: var(--text-3); font-size: 13px; padding: 18px 0; text-align: center; display: grid; gap: 8px; justify-items: center; }
.empty b { color: var(--text); font-size: 14px; }

/* projects (srvpanel prow) */
.prow { display: grid; grid-template-columns: 4px minmax(0, 1.5fr) 96px 80px 90px 120px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 14px 8px 0; border-top: 1px solid var(--border); color: var(--text); font-size: 13px; }
.prow:hover { background: var(--surface-2); text-decoration: none; }
.prow .bar { width: 4px; height: 32px; border-radius: 0 2px 2px 0; background: var(--good); }
.prow .bar.warning { background: var(--warning); } .prow .bar.critical { background: var(--critical); } .prow .bar.idle { background: var(--text-3); }
.prow .t b { display: block; font-weight: 600; }
.prow .t small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .c { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.prow .c b { display: block; color: var(--text); font-size: 13px; }
.prow.phead { border-top: 0; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 2px; }
.prow.phead:hover { background: transparent; }
.problems { display: grid; gap: 6px; }
.problems li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; flex-wrap: wrap; }
.problems li.critical { background: var(--critical-bg); }
.problems li.warning { background: var(--warning-bg); }
.problems .area { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; min-width: 96px; }
.problems li > span:nth-child(2) { flex: 1 1 180px; min-width: 0; }
.problems .go { margin-left: auto; display: flex; gap: 6px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); padding: 3px 8px; border-radius: 8px; background: var(--surface-2); }
.dots a:hover { text-decoration: none; color: var(--text); }
.timeline { display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 52px 14px minmax(0, 1fr); gap: 8px; font-size: 13px; padding: 6px 0; }
.timeline time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline .dot { margin-top: 6px; }
.timeline .tag { white-space: normal; } /* long «после неё: …» notes wrap inside the card */

/* tasks */
.tasks { display: grid; }
.tasks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.tasks li:first-child { border-top: 0; }
.tasks .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--text-3); margin-top: 2px; }
.tasks li.overdue .box { border-color: var(--critical); }
.tasks li.done .box { background: var(--good); border-color: var(--good); }
.tasks li.done .t b { text-decoration: line-through; color: var(--text-3); }
.tasks .t b { font-weight: 600; display: block; font-size: 13px; }
.tasks .t small { display: flex; gap: 8px; flex-wrap: wrap; color: var(--text-3); font-size: 12px; margin-top: 2px; align-items: center; }
.tasks .t q { display: block; font-size: 12px; color: var(--text-2); margin-top: 3px; quotes: "«" "»"; }
.tasks .when { font-size: 12px; font-weight: 600; text-align: right; white-space: nowrap; }
.tasks li.overdue .when { color: var(--critical-text); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; margin-bottom: 8px; }

/* ask */
.ask-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.qa { display: grid; gap: 16px; }
.q { justify-self: end; max-width: 80%; background: var(--accent-soft); padding: 9px 13px; border-radius: 14px 14px 4px 14px; font-size: 14px; }
.q time { display: block; font-size: 11px; color: var(--text-3); text-align: right; }
.a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.a .body { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow); min-width: 0; }
.a .body p:last-child { margin-bottom: 0; }
.a .body ul { list-style: disc; padding-left: 18px; margin: 4px 0 10px; display: grid; gap: 3px; }
.a .foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }
.ask-box { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, var(--bg) 30%); display: grid; gap: 8px; }
.ask-box .row { display: flex; gap: 8px; align-items: flex-end; }
.ask-box textarea { min-height: 52px; }

/* rules */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rung { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); display: grid; gap: 6px; align-content: start; }
.rung b { font-size: 13px; }
.rung p { font-size: 12px; color: var(--text-2); margin: 0; }
.rung .count { font-size: 12px; color: var(--text-3); margin-top: auto; }
.rung.l3, .rung.l4 { background: var(--auto-bg); border-color: transparent; }
.rung.locked { opacity: .6; }
.switch { width: 40px; height: 22px; padding: 0; min-height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: left .12s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on.auto { background: var(--auto); border-color: var(--auto); }
.switch.on::after { left: 20px; background: #fff; }
.hours { display: grid; grid-template-columns: 60px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--text-3); align-items: center; }
.hours i { height: 16px; border-radius: 3px; background: var(--surface-3); display: block; }
.hours i.w { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.hours i.a { background: var(--auto-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--auto) 45%, transparent); }
.hours span.h { text-align: center; }

/* drawer via :target, no JS */
.drawer { position: fixed; inset: 0; z-index: 50; display: none; }
.drawer:target { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.drawer .sheet { position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg); border-left: 1px solid var(--border); overflow-y: auto; padding: 16px 18px 40px; display: grid; gap: 14px; align-content: start; box-shadow: -20px 0 40px rgba(0, 0, 0, .3); }
.drawer .sheet-h { display: flex; align-items: center; gap: 12px; }
.drawer .sheet-h h2 { font-size: 18px; }

/* "Ещё" page */
.more { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.more a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); min-height: 64px; }
.more a:hover { text-decoration: none; border-color: var(--surface-3); }
.more a .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.more a b { display: block; }
.more a small { display: block; color: var(--text-3); font-size: 12px; }
.more a.alarm .ico { background: var(--critical-bg); color: var(--critical-text); }


/* bottom tab bar (phones) */
.phone-only { display: none; }
.tabbar { display: none; }

/* ---------- breakpoints ---------- */
@media (max-width: 1240px) {
  .chat-wrap { grid-template-columns: 280px minmax(0, 1fr); }
  .chat-wrap .pane-r { display: none; }
  .chat-wrap.show-r .pane-r { display: grid; }
  .ask-wrap { grid-template-columns: minmax(0, 1fr); }
  .ask-wrap aside { display: none; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g-main, .g-split, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prow { grid-template-columns: 4px minmax(0, 1fr) 80px 90px minmax(0, 120px); }
  .prow .hide-md { display: none; }
  .search { width: 200px; }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { display: none; }
  .top { padding: 10px 16px; gap: 8px; flex-wrap: nowrap; }
  .top h1 { font-size: 18px; }
  .top .sub { display: none; }
  .top .tools { gap: 4px; }
  .search { display: none; }
  .phone-only { display: inline-flex; }
  .view { padding: 8px 16px calc(88px + env(safe-area-inset-bottom)); }
  .stack > * + * { margin-top: 12px; }
  .card { padding: 14px; border-radius: 12px; }
  button, .btn { min-height: 44px; padding: 9px 14px; font-size: 14px; }
  button.sm, .btn.sm { min-height: 36px; font-size: 13px; }
  .seg a, .seg button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .chip { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .value { font-size: 21px; }
  .attn li { grid-template-columns: 4px 28px minmax(0, 1fr); padding: 12px 14px 12px 0; }
  .attn .act { grid-column: 3; }
  .attn .act .btn { flex: 1; }
  .attn .t q { white-space: normal; }
  .dcard .da .btn { flex: 1; }
  .dcard .da .btn.primary { flex-basis: 100%; }
  .dcard .da .keyhint, .keys { display: none; }
  .chat-wrap { display: block; height: auto; border-top: 0; }
  .chat-wrap .pane-l { display: none; }
  .chat-wrap > * { overflow: visible; }
  .thread-h { top: 57px; padding: 8px 16px; }
  .msgs { padding: 12px 16px; }
  .bubble { max-width: 88%; font-size: 14px; }
  .composer { bottom: calc(64px + env(safe-area-inset-bottom)); padding: 10px 16px; }
  .clist a { padding: 10px 16px; min-height: 60px; }
  .prow { grid-template-columns: 4px minmax(0, 1fr) auto; padding-right: 14px; }
  .prow .hide-sm, .prow.phead { display: none; }
  .problems li .area { min-width: 0; }
  .problems .go { margin-left: 0; width: 100%; }
  .ladder { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .hours { grid-template-columns: 44px repeat(24, minmax(0, 1fr)); }
  .hours span.h:nth-child(even) { visibility: hidden; }
  .q { max-width: 92%; }
  .ask-box { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hide-phone { display: none !important; }
  table.data.cards thead { display: none; }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; width: 100%; height: auto; }
  table.data.cards tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  table.data.cards tr:last-child { border-bottom: 0; }
  table.data.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
  table.data.cards td[data-label]::before { content: attr(data-label); color: var(--text-3); font-size: 12px; }
  table.data.cards td:first-child { display: block; }
  table.data.cards td.r { text-align: left; }
  table.data.cards tbody tr:hover td { background: transparent; }
  table.data .load { width: 50%; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--side) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-3);
    padding: 4px 0; border-radius: 10px; position: relative; min-height: 52px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg.icon { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 2px; left: 54%; margin: 0; font-size: 10px; padding: 0 5px; min-width: 18px; }
}

/* v2 additions */
.card > h2 .badge, .card-h .badge { margin-left: 0; }
.card-pad { padding: 0 16px 14px; margin: 0; }
.card.flush table.data th:first-child, .card.flush table.data td:first-child { padding-left: 16px; }
.card.flush table.data th:last-child, .card.flush table.data td:last-child { padding-right: 16px; }
.dcard.swipe-no { box-shadow: inset -6px 0 0 var(--critical), var(--shadow); }
.attn-foot a, .digest a { overflow-wrap: anywhere; }
.phone-block { display: none; }
.a .logo { width: 32px; height: 32px; font-size: 11px; }
@media (max-width: 860px) {
  .phone-block { display: block; }
  .card.flush table.data.cards td:first-child { padding-left: 0; }
  .card.flush table.data.cards tr { padding: 10px 14px; }
  .card.flush table.data.cards td { padding-left: 0; padding-right: 0; }
  .card.flush > h2 { padding: 12px 14px 0; }
  .pane-r { padding: 16px; }
  .chat-wrap.show-r .pane-r, .chat-wrap .pane-r:target { display: grid; }
}
.hours + .legend { margin: 10px 0 12px; }
@media (max-width: 860px) {
  .thread-h .who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thread-h .right { display: none; }
  .composer .ch .right { display: none; }
  .composer textarea { min-height: 60px; }
  .composer .actions { flex-wrap: nowrap; }
  .composer .actions .btn { flex: 1; min-height: 40px; padding: 8px 10px; font-size: 13px; }
}
@media (max-width: 860px) {
  .chat-wrap:has(.pane-r:target) .thread { display: none; }
}
.pane-r { scroll-margin-top: 72px; }

/* ---------- panel additions (v1 carry-over and server-rendered forms) ---------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--s1) 18%, transparent), transparent),
              radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--s7) 16%, transparent), transparent), var(--bg); }
.center .card { width: 100%; max-width: 400px; padding: 26px; display: grid; gap: 14px; }
.center h1 { font-size: 20px; }
.center .brand { padding: 0; }
.btn.tg, button.tg { width: 100%; padding: 11px; font-size: 14px; }
.switches { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.switch-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.switch-row .what { flex: 1; min-width: 0; font-size: 13px; }
.switch-row .what small { display: block; font-size: 11px; color: var(--text-3); }
.switch-row.wide { flex-wrap: wrap; }
.switch-row.wide .what { flex-basis: 100%; }
.switch[disabled] { opacity: .45; cursor: not-allowed; }
.retention { display: flex; align-items: center; gap: 8px; width: 100%; }
.retention input { flex: 1; min-width: 0; }
.row-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.row-form input, .row-form select { width: auto; min-width: 0; flex: 1 1 120px; }
.row-form input[type="number"] { flex: 0 1 110px; }
form.pair { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
details.more-actions { display: inline-block; position: relative; }
details.more-actions > summary { list-style: none; }
details.more-actions > summary::-webkit-details-marker { display: none; }
details.more-actions[open] > .card, details.more-actions[open] > form.card { position: absolute; right: 0; z-index: 30; width: min(420px, calc(100vw - 32px)); margin-top: 6px; }
details.more-actions:not(.new-task):not(.right) > form { margin-top: 6px; }
details.opt-details > summary { list-style: none; cursor: pointer; }
details.opt-details > summary::-webkit-details-marker { display: none; }
details.opt-details[open] { display: grid; gap: 8px; padding-bottom: 6px; }
.opts form { margin: 0; }
.pausebar { background: var(--critical-bg); color: var(--critical-text); padding: 8px 28px; font-size: 13px; font-weight: 600; }
.state.warning { background: var(--warning-bg); color: var(--warning-text); }
.legend .lc { background: var(--critical); height: 2px; vertical-align: 3px; }
.msgs.flat { padding: 0; }
.faq-inline { display: none; }
.top .title { min-width: 0; }
.top .title h1 { overflow-wrap: anywhere; }
.qa .empty { padding: 18px; }
@media (max-width: 1240px) {
  .faq-inline { display: flex; }
}
@media (max-width: 860px) {
  .pausebar { padding: 8px 16px; }
  .top .title { flex: 1; }
  details.more-actions[open] > .card, details.more-actions[open] > form.card { position: static; width: 100%; }
  details.more-actions { display: block; width: 100%; }
  .section-h .seg.right, .section-h .chips.right { margin-left: 0; }
  .row-form input, .row-form select { flex-basis: 100%; }
}
.chat-wrap { grid-template-rows: minmax(0, 1fr); }
.chat-wrap > * { position: relative; } /* contains .sr labels inside the scrolling panes */
.opt.on[disabled] { opacity: 1; cursor: default; }
.pane-r .tasks li { grid-template-columns: 22px minmax(0, 1fr); }
.pane-r .tasks .when { grid-column: 2; text-align: left; font-weight: 500; }
@media (max-width: 860px) {
  .dcard .dh .who { flex: 1 1 calc(100% - 50px); }
  .chat-wrap { grid-template-rows: none; }
}
.problems + .kv, .problems + p { margin-top: 10px; }
.flash > span { flex: 1 1 240px; min-width: 0; }
/* panel v2: day x hour heat map (svg.heat), undo plate after «Отправить» */
svg.heat { display: block; width: 100%; height: auto; }
svg.heat .h0 { fill: var(--surface-3); }
svg.heat .h1 { fill: color-mix(in srgb, var(--accent) 25%, var(--surface-3)); }
svg.heat .h2 { fill: color-mix(in srgb, var(--accent) 50%, var(--surface-3)); }
svg.heat .h3 { fill: color-mix(in srgb, var(--accent) 75%, var(--surface-3)); }
svg.heat .h4 { fill: var(--accent); }
svg.heat text { fill: var(--text-3); font-size: 9px; font-family: var(--sans); }
.flash.undo .countdown { color: inherit; }

/* ---------- Phase 4: menu «Ещё» and page «Сейчас» (docs/design/phase4-now.md) ---------- */
.nav-more > summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500;
  font-size: 13.5px; cursor: pointer; list-style: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { background: var(--surface-2); color: var(--text); }
.nav-more > summary .badge { margin-left: auto; }
.nav-more > summary .chev { transition: transform .15s; }
.nav-more > summary .badge + .chev { margin-left: 4px; }
.nav-more > summary .icon:not(.chev) + .chev { margin-left: auto; }
.nav-more[open] > summary .chev { transform: rotate(180deg); }
.nav-more .sub { display: flex; flex-direction: column; gap: 1px; margin-top: 1px; }
.nav-more .sub a { padding-left: 38px; font-size: 13px; }
.nav-more:has(.sub a.active) > summary { color: var(--text); }

.now { display: grid; gap: 14px; }
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 14px; align-items: start; }
.card.flush > h2.bh { padding: 14px 16px 10px; margin: 0; font-size: 15px; }
.card.flush > h2.bh .right { margin-left: auto; font-weight: 400; }
.bfoot { margin: 0; padding: 10px 16px 14px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.hot + .bfoot, .calm + .bfoot { border-top: 1px solid var(--border); }
.bfoot .right { margin-left: auto; }

.pulse { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.pulse a { background: var(--surface); padding: 10px 14px; color: var(--text); display: grid; gap: 1px; min-width: 0; }
.pulse a:hover { background: var(--surface-2); text-decoration: none; }
.pulse .l, .pulse .s { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; }
.pulse .v small { font-size: 12px; font-weight: 600; color: var(--text-3); }
.pulse .bad { color: var(--critical-text); } .pulse .warn { color: var(--warning-text); } .pulse .good { color: var(--good-text); }

.hot { display: grid; gap: 10px; padding: 0 12px 12px; }
.hc { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 12px 14px 12px 18px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hc::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--text-3); }
.hc.critical::before { background: var(--critical); } .hc.warning::before { background: var(--warning); } .hc.info::before { background: var(--accent); }
.hc:target { box-shadow: 0 0 0 2px var(--accent); }
.hc.is-snoozed { opacity: .7; }
.hc .h { display: flex; gap: 10px; align-items: flex-start; }
.hc .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.hc.critical .ico { background: var(--critical-bg); color: var(--critical-text); }
.hc.warning .ico { background: var(--warning-bg); color: var(--warning-text); }
.hc .t { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.hc .t b { display: block; font-size: 14.5px; line-height: 1.35; }
.hc .t small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.hc .age { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prop { margin-left: 40px; border-radius: 10px; background: var(--surface-2); padding: 9px 12px; display: grid; gap: 4px; min-width: 0; }
.prop .who { font-size: 12px; color: var(--text-3); }
.prop .who b { color: var(--text-2); font-weight: 600; }
.prop .msg { font-size: 13.5px; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.acts { margin-left: 40px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acts form.inline { display: contents; }
.acts button[disabled] { opacity: .55; cursor: not-allowed; }
details.act-d > summary { list-style: none; }
details.act-d > summary::-webkit-details-marker { display: none; }
details.act-d[open] > summary { background: var(--surface-3); }
.act-pop { margin-top: 8px; display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  width: min(560px, calc(100vw - 64px)); }
.act-pop.skip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.act-pop.skip > span { flex-basis: 100%; }
.act-pop.skip form.inline { display: contents; }
.calm { margin: 0 12px 12px; padding: 14px; border-radius: 12px; background: var(--good-bg); color: var(--good-text); display: flex; gap: 10px; align-items: flex-start; }
.calm b { color: var(--text); display: block; }
.calm small { color: var(--text-2); font-size: 12.5px; }
.watch { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.watch .tag { font-weight: 500; }
.tag.critical { background: var(--critical-bg); color: var(--critical-text); }
.tag.warning { background: var(--warning-bg); color: var(--warning-text); }
.tag.info { background: var(--accent-soft); color: var(--info-text); }
.dot.idle { background: var(--text-3); }

.now > .note, .card > .note { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 12.5px; color: var(--text-2);
  display: flex; gap: 8px; align-items: flex-start; }
.card > .note { margin: 0 16px 10px; }
.note b { color: var(--text); }
.note a { overflow-wrap: anywhere; }
.tsum { display: flex; gap: 6px 16px; flex-wrap: wrap; padding: 0 16px 10px; font-size: 12.5px; color: var(--text-3); }
.tsum b { color: var(--text); font-variant-numeric: tabular-nums; }
table.team { width: 100%; border-collapse: collapse; font-size: 13px; }
table.team th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 6px 10px; border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border); white-space: nowrap; }
table.team td { padding: 0 10px; height: 44px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.team tr:last-child td { border-bottom: 0; }
table.team td:first-child, table.team th:first-child { padding-left: 16px; }
table.team td:last-child, table.team th:last-child { padding-right: 16px; }
table.team .nm a { color: var(--text); }
table.team .nm b { font-weight: 600; }
table.team .nm small { color: var(--text-3); margin-left: 6px; }
table.team tr.off td { color: var(--text-3); }
table.team tr.bad td { background: color-mix(in srgb, var(--critical-bg) 55%, transparent); }
table.team td.c-dev { white-space: normal; }
table.team .load { display: flex; align-items: center; gap: 8px; }
table.team progress.meter { width: 72px; flex: none; }
.bad-n { color: var(--critical-text); font-weight: 600; }
table.team.week td.num { white-space: nowrap; }

details.srv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; min-height: 48px; }
details.srv > summary::-webkit-details-marker { display: none; }
details.srv > summary b { font-size: 14px; font-weight: 600; }
details.srv > summary:hover { background: var(--surface-2); }
details.srv[open] > summary .chev { transform: rotate(180deg); }
details.srv .chev { margin-left: auto; transition: transform .15s; color: var(--text-3); }
.prj { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.prj > div { background: var(--surface); padding: 10px 16px; display: grid; gap: 2px; }
.prj b { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13px; }
.prj small { color: var(--text-3); font-size: 12px; }
.prj .warning small { color: var(--warning-text); } .prj .critical small { color: var(--critical-text); }
.srv-off { margin: 0; padding: 14px 16px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.sources { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-3); }
.sources > span { display: inline-flex; gap: 6px; align-items: center; }

@media (max-width: 1180px) {
  .pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pulse a:nth-child(n+4) { display: none; }
}
@media (max-width: 860px) {
  .tabbar { grid-template-columns: repeat(4, 1fr); }
  .now { gap: 12px; }
  .now-grid { gap: 12px; }
  .pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse a:nth-child(4) { display: grid; }
  .pulse a { padding: 9px 12px; }
  .card.flush > h2.bh { padding: 12px 14px 8px; }
  .bfoot { padding: 10px 14px 12px; }
  .hot { padding: 0 8px 8px; }
  .hc { padding: 12px 12px 12px 16px; }
  .hc .ico { display: none; }
  .prop, .acts { margin-left: 0; }
  .acts { display: grid; grid-template-columns: 1fr 1fr; }
  .acts > .primary, .acts > form > .primary, .acts button.primary, .acts a.primary { grid-column: 1 / -1; }
  .acts details.act-d > summary { width: 100%; }
  .acts details.act-d[open] { grid-column: 1 / -1; }
  .act-pop { width: 100%; }
  .acts .sm, .act-pop .sm { min-height: 44px; }
  .acts.f-acts { display: flex; }
  .acts.f-acts .btn { flex: 1 1 auto; }
  .act-pop.skip button { flex: 1 1 40%; }
  .tsum { padding: 0 14px 10px; }
  .card > .note { margin: 0 14px 10px; }
  table.team, table.team tbody, table.team tr, table.team td { display: block; }
  table.team thead { display: none; }
  table.team tr { padding: 10px 14px; border-top: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  table.team td { height: auto; padding: 0 !important; border: 0; white-space: normal; }
  table.team td.nm { grid-column: 1; }
  table.team td.c-st { grid-column: 1; font-size: 13px; color: var(--text-3); }
  table.team td.c-load { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  table.team td.c-x { display: none; }
  table.team td.c-dev { grid-column: 1 / -1; }
  table.team td.c-dev:empty { display: none; }
  table.team.week td.num { grid-column: 1 / -1; display: flex; gap: 10px; align-items: baseline; }
  table.team.week td.num::before { content: attr(data-label); color: var(--text-3); font-size: 12px; flex: 1; }
  table.team tr.bad { background: color-mix(in srgb, var(--critical-bg) 55%, transparent); }
  table.team tr.bad td { background: transparent; }
  details.srv > summary { padding: 12px 14px; }
}
