/* Сайт мозга. Стиль — «бухгалтерская книга без цвета» поверх «Тишины» (владелец, 22.10.2026):
   интерфейс без цвета, один синий — только на главных данных (Пульс, сегодняшний день), красный и жёлтый — только у проблем.
   Системный шрифт (выбор владельца), цифры табличные. Радиусы: 8 у панелей, 6 у контролов. Тени — только у того, что всплывает.
   Сетка канвы: 12 колонок, gap 16; 8+4 = 12, 6+6 = 12 — края панелей совпадают с краями заголовка страницы. */
@view-transition { navigation: auto; }
:root {
  color-scheme: light;
  --ground: #f4f5f7; --surface: #ffffff; --raised: #f0f1f3; --active: #e6e8eb;
  --border: #e3e5e9; --rule: #eef0f2; --control: #d3d6db;
  --text: #0b0c0e; --muted: #5d6169; --faint: #686c74;
  --accent: #1d5fbf; --accent-soft: rgba(29, 95, 191, .14);
  --bar: #b9bdc4; --bar-hover: #0b0c0e;
  --positive: #247b50; --negative: #c4242a; --warning: #9a5a00;
  --neg-bg: #ffedea; --neg-ink: #831c1e; --warn-bg: #fff6e0; --warn-ink: #7a4a00; --pos-bg: #dcfae5; --pos-ink: #04250e;
  --primary: #111214; --on-primary: #ffffff;
  --scrim: rgba(10, 12, 16, .32); --float: 0 16px 48px rgba(10, 12, 16, .16), 0 2px 6px rgba(10, 12, 16, .06);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-card: 8px; --r-ctl: 6px; --gap: 16px; --pad: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0b0b0c; --surface: #141416; --raised: #1b1b1e; --active: #222226;
    --border: #232327; --rule: #1d1d21; --control: #3a3a40;
    --text: #f4f4f5; --muted: #a9a9b0; --faint: #8b8b93;
    --accent: #5b9cf5; --accent-soft: rgba(91, 156, 245, .18);
    --bar: #4a4a52; --bar-hover: #f4f4f5;
    --positive: #3fc07a; --negative: #ff6b63; --warning: #f0b13a;
    --neg-bg: #2c1a1c; --neg-ink: #ff8a83; --warn-bg: #2a2214; --warn-ink: #f0b13a; --pos-bg: #172a1d; --pos-ink: #3fc07a;
    --primary: #f4f4f5; --on-primary: #0b0b0c;
    --scrim: rgba(0, 0, 0, .55); --float: 0 16px 48px rgba(0, 0, 0, .55), 0 0 0 1px #2a2a2f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0b0b0c; --surface: #141416; --raised: #1b1b1e; --active: #222226;
  --border: #232327; --rule: #1d1d21; --control: #3a3a40;
  --text: #f4f4f5; --muted: #a9a9b0; --faint: #8b8b93;
  --accent: #5b9cf5; --accent-soft: rgba(91, 156, 245, .18);
  --bar: #4a4a52; --bar-hover: #f4f4f5;
  --positive: #3fc07a; --negative: #ff6b63; --warning: #f0b13a;
  --neg-bg: #2c1a1c; --neg-ink: #ff8a83; --warn-bg: #2a2214; --warn-ink: #f0b13a; --pos-bg: #172a1d; --pos-ink: #3fc07a;
  --primary: #f4f4f5; --on-primary: #0b0b0c;
  --scrim: rgba(0, 0, 0, .55); --float: 0 16px 48px rgba(0, 0, 0, .55), 0 0 0 1px #2a2a2f;
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  background: var(--ground); color: var(--text); min-height: 100vh;
  font: 400 14px/1.5 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; text-align: inherit; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
code, pre { font-family: var(--mono); }
kbd { font: 500 11px var(--sans); color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--surface); }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mute { color: var(--muted); } .faint { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- оболочка ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1px;
  padding: 14px 10px 12px; overflow-y: auto; scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.ws { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; border-radius: var(--r-ctl); }
.mark { width: 28px; height: 28px; border-radius: 7px; flex: none; display: block; background: #0c0c0d; }
.ws b { display: block; font-weight: 600; font-size: 14px; line-height: 1.2; }
.ws small { display: block; font-size: 12px; color: var(--faint); line-height: 1.2; }
.find {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; margin: 0 0 12px;
  border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border); color: var(--faint);
  transition: border-color .15s;
}
.find:hover { border-color: var(--control); }
.find span { flex: 1; font-size: 13px; }
.nl { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r-ctl);
  color: var(--muted); font-size: 14px; transition: background .12s, color .12s; width: 100%; }
.nl .ic { color: var(--faint); }
.nl:hover { color: var(--text); background: var(--raised); }
.nl[aria-current="page"] { background: var(--active); color: var(--text); font-weight: 500; }
.nl[aria-current="page"] .ic { color: var(--text); }
.nl span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl em { font-style: normal; font-size: 12px; color: var(--faint); }
.nl em.hot { color: var(--negative); font-weight: 500; }
.ng { font-size: 12px; color: var(--faint); padding: 22px 10px 6px; }
.side .sp { flex: 1; min-height: 16px; }
.side form { display: contents; }

.canvas { min-width: 0; padding: 28px 36px 64px; }
.page { max-width: 1180px; margin: 0 auto; }

.mbar, .tabs { display: none; }

/* ---------- заголовок страницы ---------- */
.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.ph > div:first-child { flex: 1; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--faint); margin-bottom: 6px; }
.crumbs a:hover { color: var(--text); }
.crumbs i { font-style: normal; opacity: .6; }
.title { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.012em; text-wrap: balance; overflow-wrap: anywhere; }
.lead { margin-top: 4px; font-size: 14px; color: var(--muted); max-width: 72ch; }
.lead b { color: var(--text); font-weight: 500; }
.lead .bad { color: var(--negative); font-weight: 500; }
.acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- контролы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-ctl); background: var(--primary); color: var(--on-primary); font-weight: 500; font-size: 14px;
  transition: opacity .15s, transform .15s var(--ease); white-space: nowrap;
}
.btn:hover { opacity: .88; } .btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--control); }
.btn.ghost:hover { opacity: 1; background: var(--raised); }
.seg { display: inline-flex; background: var(--raised); border-radius: 8px; padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { height: 30px; padding: 0 12px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); white-space: nowrap; transition: color .12s, background .12s; }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg [aria-current="true"], .seg [aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500;
  outline: 1px solid var(--border); outline-offset: -1px; }
.seg em { font-style: normal; color: var(--faint); font-weight: 400; }
.field { position: relative; display: flex; align-items: center; }
.field .ic { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.field input { height: 34px; width: 240px; max-width: 100%; padding: 0 12px 0 34px; border-radius: var(--r-ctl);
  background: var(--surface); border: 1px solid var(--control); font-size: 14px; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--gap); }

/* ---------- сетка и панели ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; margin-bottom: var(--gap); }
.grid > * { display: flex; flex-direction: column; min-width: 0; }
.grid > * > .panel { flex: 1; }
.grid.start { align-items: start; }
.s12 { grid-column: span 12; } .s8 { grid-column: span 8; } .s6 { grid-column: span 6; } .s4 { grid-column: span 4; } .s7 { grid-column: span 7; } .s5 { grid-column: span 5; }
.grid > .stack { gap: var(--gap); }
.grid > .stack > .panel { flex: none; }
.grid > .stack > .panel:last-child { flex: 1; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; display: flex; flex-direction: column; }
.page > .panel, .page > .strip { margin-bottom: var(--gap); }
.panel > header { display: flex; align-items: baseline; gap: 8px; padding: 14px var(--pad) 10px; }
.panel > header h2 { font-size: 14px; font-weight: 600; letter-spacing: -.003em; }
.panel > header .cnt { font-size: 13px; color: var(--faint); }
.panel > header .more { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.panel > header .more:hover { color: var(--text); }
.panel > .body { padding: 0 var(--pad) var(--pad); }
.panel > footer { margin-top: auto; padding: 10px var(--pad) 12px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.panel > footer a:hover, .panel > footer button:hover { color: var(--text); }
.empty { padding: 2px var(--pad) 18px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 500; }

/* ---------- полоса цифр ---------- */
.strip { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-card); margin-bottom: var(--gap); }
.strip.n3 { --n: 3; } .strip.n4 { --n: 4; } .strip.n5 { --n: 5; }
.cell { padding: 16px var(--pad) 18px; min-width: 0; display: block; transition: background .12s; }
.cell + .cell { border-left: 1px solid var(--rule); }
a.cell:hover { background: var(--raised); }
.cell:first-child { border-radius: var(--r-card) 0 0 var(--r-card); } .cell:last-child { border-radius: 0 var(--r-card) var(--r-card) 0; }
.cell .k { font-size: 13px; color: var(--muted); }
.cell .v { font-size: 30px; line-height: 1.15; margin-top: 6px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .v small { font-size: 15px; color: var(--faint); letter-spacing: 0; margin-left: 2px; }
.cell .v.bad { color: var(--negative); } .cell .v.warn { color: var(--warning); } .cell .v.zero { color: var(--faint); }
.cell .c { font-size: 13px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- точки статуса ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--positive); }
.dot.bad { background: var(--negative); box-shadow: 0 0 0 3px color-mix(in srgb, var(--negative) 18%, transparent); }
.dot.warn { background: var(--warning); }
.dot.idle { background: var(--bar); }
.dot.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--control); }

/* ---------- строки ---------- */
.li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 11px var(--pad); min-height: 52px; border-top: 1px solid var(--rule); transition: background .12s; }
.li.d { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 4px 12px; }
.panel > .list > .li:first-child { border-top: 0; }
a.li:hover { background: var(--raised); }
a.li:active { background: var(--active); }
.li .m { min-width: 0; }
.li .m b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .m b.wrap { white-space: normal; overflow-wrap: anywhere; }
.li .m .s { font-size: 13px; color: var(--muted); margin-top: 1px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.li .r { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.li .r b { display: block; font-size: 14px; font-weight: 400; color: var(--text); }
.li .r .bad { color: var(--negative); font-weight: 500; } .li .r .warn { color: var(--warning); font-weight: 500; }
.li code, .task code { font: 12.5px var(--mono); background: var(--raised); padding: 0 4px; border-radius: 4px; }

/* задачи «ждёт вас» */
.task { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 12px; padding: 12px var(--pad); border-top: 1px solid var(--rule); }
.list > .task:first-child { border-top: 0; }
.task .box { width: 14px; height: 14px; border: 1.5px solid var(--control); border-radius: 4px; margin-top: 3px; }
.task .t { overflow-wrap: anywhere; line-height: 1.5; min-width: 0; }
.task .t.clip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.task[data-open] .t.clip { -webkit-line-clamp: unset; display: block; }
.task .t a { text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.task .t strong { font-weight: 600; }
.task .p { grid-column: 2; font-size: 12px; color: var(--faint); }
.task .p a:hover { color: var(--text); }
.grp + .grp { border-top: 1px solid var(--border); }
.grp > header { display: flex; align-items: baseline; gap: 8px; padding: 14px var(--pad) 4px; }
.grp > header a { font-weight: 600; } .grp > header a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); }
.grp > header span { font-size: 13px; color: var(--faint); }
.grp .task { border-top: 0; padding-top: 8px; padding-bottom: 8px; }
.grp .task:last-child { padding-bottom: 16px; }
.grp .task .p { display: none; }

/* ---------- таблицы ---------- */
.tw { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; font-weight: 400; color: var(--faint); text-align: left; padding: 0 12px 8px; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--pad); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--pad); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--raised); }
.tbl td .n { display: flex; align-items: center; gap: 10px; font-weight: 500; min-width: 0; }
.tbl td .n a { overflow-wrap: anywhere; }
.tbl td .s { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.tbl td .s.pad { padding-left: 18px; }
.tbl a:hover { text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.tbl .bad { color: var(--negative); } .tbl .warn { color: var(--warning); }
.tbl td.mute, .tbl td .mute { color: var(--muted); }

/* шкала (диск, память): длина = настоящая доля */
.meter { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.meter svg { width: 72px; height: 6px; flex: none; }
.meter .tr { fill: var(--raised); }
.srv .meter .fl:not(.warn):not(.bad) { fill: var(--accent); } .meter .fl { fill: var(--muted); } .meter .fl.warn { fill: var(--warning); } .meter .fl.bad { fill: var(--negative); }

.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  white-space: nowrap; flex: none; background: var(--raised); color: var(--muted); }
.pill.bad { background: var(--neg-bg); color: var(--neg-ink); } .pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.ok { background: var(--pos-bg); color: var(--pos-ink); }

/* ---------- Пульс: сессии по дням ---------- */
.pk { display: flex; gap: 6px 18px; align-items: baseline; flex-wrap: wrap; padding: 0 var(--pad) 8px; }
.pk b { font-size: 30px; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; }
.pk span { font-size: 13px; color: var(--muted); }
.pc { position: relative; height: 120px; margin: 4px var(--pad) 0 calc(var(--pad) + 26px); }
.pc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pc .gl { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pc .gl.base { stroke: var(--border); }
.pc rect { fill: var(--bar); transition: fill .12s; }
.pc rect.hit { fill: transparent; }
.pc a:hover rect:not(.hit), .pc a:focus rect:not(.hit) { fill: var(--bar-hover); }
.pc rect.today { fill: var(--accent); }
.pc .yt { position: absolute; left: -26px; width: 20px; text-align: right; font-size: 11px; color: var(--faint); transform: translateY(-50%); line-height: 1; }
.pc .yt.a { top: 0; } .pc .yt.b { top: 50%; } .pc .yt.c { top: 100%; }
.px { display: flex; justify-content: space-between; margin: 8px var(--pad) 16px calc(var(--pad) + 26px); font-size: 11px; color: var(--faint); }

/* полоса активности проекта: дни */
.act { display: block; width: 120px; height: 16px; margin-left: auto; }
.act rect { fill: var(--rule); } .act rect.on { fill: var(--bar); } .act rect.on.today { fill: var(--accent); }
.act.wide { width: 100%; height: 22px; }

/* календарь дней */
.heat { padding: 4px var(--pad) 8px; overflow-x: auto; scrollbar-width: thin; }
.heat svg { display: block; width: 100%; min-width: 760px; max-width: 1120px; height: auto; }
.heat rect { fill: var(--raised); }
.heat rect.l1 { fill: color-mix(in srgb, var(--accent) 30%, var(--raised)); }
.heat rect.l2 { fill: color-mix(in srgb, var(--accent) 55%, var(--raised)); }
.heat rect.l3 { fill: color-mix(in srgb, var(--accent) 78%, var(--raised)); }
.heat rect.l4 { fill: var(--accent); }
.heat a:hover rect { stroke: var(--text); stroke-width: 1.5; }
.heat text { font-size: 11px; fill: var(--faint); font-family: var(--sans); }
.hk { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-size: 11px; color: var(--faint); padding: 0 var(--pad) 14px; }
.hk i { width: 10px; height: 10px; border-radius: 2px; background: var(--raised); display: inline-block; }
.hk i.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--raised)); } .hk i.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--raised)); }
.hk i.l3 { background: color-mix(in srgb, var(--accent) 78%, var(--raised)); } .hk i.l4 { background: var(--accent); }

/* ---------- проекты ---------- */
.proj td:first-child { width: 56%; }
.proj .s { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tabsu { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 0 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabsu::-webkit-scrollbar { display: none; }
.tabsu a { padding: 0 0 10px; font-size: 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabsu a:hover { color: var(--text); }
.tabsu a[aria-current="page"] { color: var(--text); border-color: var(--text); font-weight: 500; }
.tabsu em { font-style: normal; font-size: 12px; color: var(--faint); margin-left: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--muted); align-items: center; }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta a:hover { color: var(--text); }

/* ---------- чтение заметки ---------- */
.reader { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 48px; align-items: start; }
.reader > article { min-width: 0; }
.rail { position: sticky; top: 24px; display: grid; gap: 28px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: none; padding-bottom: 8px; }
.rail::-webkit-scrollbar { display: none; }
.rail h3 { font-size: 12px; font-weight: 400; color: var(--faint); margin-bottom: 8px; }
.toc a { display: block; font-size: 13px; color: var(--muted); padding: 3px 0 3px 12px; border-left: 1px solid var(--border); line-height: 1.4; }
.toc a.l3 { padding-left: 24px; }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--text); border-left: 2px solid var(--text); padding-left: 11px; }
.toc a.l3[aria-current="true"] { padding-left: 23px; }
.links a { display: block; font-size: 13px; color: var(--muted); padding: 4px 0; line-height: 1.4; overflow-wrap: anywhere; }
.links a:hover { color: var(--text); }
.links small { display: block; font-size: 12px; color: var(--faint); }
.hist { display: grid; gap: 12px; }
.hist div { font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.hist div > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hist time { display: block; font-size: 12px; color: var(--faint); }
.rtask { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; padding: 6px 0 6px 20px; position: relative; }
.rtask::before { content: ""; position: absolute; left: 0; top: 9px; width: 10px; height: 10px; border: 1.5px solid var(--control); border-radius: 3px; }
.rtask code { font-size: 12px; background: var(--raised); padding: 0 4px; border-radius: 4px; }
.rtask > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.prose { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; max-width: 720px; }
.prose > * + * { margin-top: 14px; }
.prose h1 { font-size: 22px; font-weight: 600; margin-top: 40px; }
.prose h2 { font-size: 19px; font-weight: 600; letter-spacing: -.012em; margin-top: 44px; line-height: 1.3; }
.prose h3 { font-size: 16px; font-weight: 600; margin-top: 30px; }
.prose h4, .prose h5 { font-size: 15px; font-weight: 600; color: var(--muted); margin-top: 22px; }
.prose > :first-child { margin-top: 0; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 8px; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s; }
.prose a:hover { text-decoration-color: var(--accent); color: var(--accent); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 5px; }
.prose li > ul, .prose li > ol { margin-top: 5px; }
.prose li::marker { color: var(--faint); }
.prose .task-list-item { list-style: none; margin-left: -22px; }
.prose .task-list-item-checkbox { accent-color: var(--accent); margin: 0 8px 0 0; vertical-align: -1px; }
.prose strong { font-weight: 600; }
.prose blockquote { border-left: 2px solid var(--control); padding: 2px 0 2px 16px; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.prose code { font: 13.5px var(--mono); background: var(--raised); padding: 1px 5px; border-radius: 5px; }
.prose pre { font-family: var(--mono); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; overflow-x: auto; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: 13px; }
.prose .tw { margin: 18px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.prose table { border-collapse: collapse; font-size: 14px; line-height: 1.5; min-width: 100%; }
.prose th { text-align: left; font-weight: 400; font-size: 12px; color: var(--faint); padding: 10px 14px 8px; white-space: nowrap; }
.prose td { padding: 9px 14px; border-top: 1px solid var(--rule); vertical-align: top; }
.prose td code { font-size: 12.5px; }
.prose td:first-child code { white-space: nowrap; }
.note { font-size: 13px; color: var(--muted); background: var(--raised); border-radius: 8px; padding: 10px 14px; }
.foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--faint);
  display: flex; gap: 8px 16px; flex-wrap: wrap; max-width: 720px; }
.foot a { color: var(--muted); } .foot a:hover { color: var(--text); }

/* последний день, свёрнутые строки */
.dsum { font-size: 15px; line-height: 1.6; max-width: 72ch; }
.panel .body + .list { border-top: 1px solid var(--rule); }
.dproj { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.dproj span { color: var(--faint); }
.dproj a { color: var(--text); text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.dproj a:hover { text-decoration-color: var(--text); }
.morerows summary { list-style: none; cursor: pointer; padding: 11px var(--pad); border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.morerows summary::-webkit-details-marker { display: none; }
.morerows summary:hover { color: var(--text); background: var(--raised); }
.morerows[open] summary { display: none; }
.morerows .tbl tr:first-child td { border-top: 1px solid var(--rule); }
button.li { width: 100%; text-align: left; } button.li:hover { background: var(--raised); }
.page > .acts { margin-top: 8px; }

/* ---------- главная: вопрос мозгу ---------- */
.askbar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; margin-bottom: var(--gap);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.askbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.askbar > .ic { color: var(--faint); width: 18px; height: 18px; }
.askbar input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 15px; outline: none; }
.askbar input::placeholder { color: var(--faint); }

/* ---------- вход ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate .card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px 28px 28px; }
.gate .mark { width: 44px; height: 44px; border-radius: 11px; margin-bottom: 20px; }
.gate h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.gate p { color: var(--muted); margin-top: 6px; }
.gate form { margin-top: 24px; display: grid; gap: 10px; }
.gate .btn { width: 100%; height: 44px; }
.gate input { height: 52px; width: 100%; text-align: center; font: 500 24px var(--mono); letter-spacing: .28em; padding: 0 0 0 .28em;
  background: var(--ground); border: 1px solid var(--control); border-radius: 8px; }
.gate input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { margin-top: 14px; color: var(--negative); font-size: 13px; }
.hint { margin-top: 16px; color: var(--faint); font-size: 13px; }

/* ---------- публичная «Обо мне» ---------- */
.pub { max-width: 680px; margin: 0 auto; padding: 72px 20px 96px; }
.pub .mark { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 28px; }
.pub h1 { font-size: 36px; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.pub .prose { margin-top: 20px; font-size: 17px; }

/* ---------- ⌘K ---------- */
.pal { width: min(660px, calc(100% - 32px)); max-height: min(560px, 76vh); margin: 12vh auto auto; padding: 0;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--float); overflow: hidden; }
.pal[open] { display: flex; flex-direction: column; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.985) translateY(-6px); } }
.pal::backdrop { background: var(--scrim); }
.pal .pin { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.pal .pin .ic { width: 18px; height: 18px; color: var(--faint); }
.pal input { flex: 1; font-size: 16px; background: none; border: 0; height: 54px; outline: none; min-width: 0; }
.pal ul { list-style: none; padding: 6px; overflow-y: auto; flex: 1; margin: 0; }
.pal .gh { font-size: 12px; color: var(--faint); padding: 10px 10px 4px; }
.pal li.o { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 42px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.pal li.o .ic { color: var(--faint); }
.pal li.o[aria-selected="true"] { background: var(--active); }
.pal li.o b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal li.o small { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.pal .none { padding: 18px 10px; color: var(--faint); }
.pal footer { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }

/* ---------- чат ---------- */
.chatwrap { max-width: 760px; margin: 0 auto; }
.chat { margin-top: 8px; }
.turn + .turn { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.uq { font-size: 17px; font-weight: 500; letter-spacing: -.01em; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn .prose { margin-top: 12px; }
.turn .prose:empty { display: none; }
.txt { white-space: pre-wrap; } .txt.html { white-space: normal; } .txt.g { color: var(--muted); }
.steps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--faint); }
.steps:not(:empty) { margin-top: 10px; }
.step { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 50% { opacity: .25; } }
.turn .meta { display: block; margin-top: 14px; font-size: 13px; color: var(--faint); overflow-wrap: anywhere; }
.turn .meta a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.turn .meta a:hover { color: var(--text); }
.askf { position: sticky; bottom: 0; z-index: 5; margin-top: 28px; padding: 12px 0 18px; background: var(--ground); }
.composer { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 10px 10px 14px;
  transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.askf textarea { display: block; width: 100%; font: 400 15px/1.5 var(--sans); background: none; border: 0; outline: none; resize: none;
  min-height: 28px; max-height: 40vh; overflow-y: auto; padding: 4px 0; }
.askf textarea::placeholder { color: var(--faint); }
.askf .acts { margin-top: 6px; justify-content: flex-end; }
.lnk { font-size: 13px; color: var(--muted); height: 36px; padding: 0 8px; border-radius: 6px; margin-right: auto; }
.lnk:hover { color: var(--text); background: var(--raised); }
.sugg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.chat:empty + .askf { position: static; margin-top: 4px; }
.sugg button { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  font-size: 14px; color: var(--text); transition: border-color .15s, background .15s; line-height: 1.4; }
.sugg button:hover { border-color: var(--control); background: var(--raised); }
.sugg small { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.sform { display: flex; gap: 10px; margin-bottom: var(--gap); }
.sform input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--control); font-size: 15px; }
.sform input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sform .btn { height: 44px; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1180px) {
  .reader { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .rail { position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
  .rail .toc-box { display: none; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mbar { display: flex; position: sticky; top: 0; z-index: 30; height: 52px; align-items: center; gap: 10px;
    padding: 0 max(8px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--ground); border-bottom: 1px solid var(--border); }
  .mbar .mark { width: 26px; height: 26px; border-radius: 7px; }
  .mbar b { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mbar button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
  .mbar button .ic { width: 20px; height: 20px; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--border); }
  .tabs a { position: relative; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--faint); }
  .tabs a .ic { width: 22px; height: 22px; }
  .tabs a[aria-current="page"] { color: var(--text); }
  .tabs a i { position: absolute; top: 8px; left: calc(50% + 7px); width: 7px; height: 7px; border-radius: 50%; background: var(--negative); }
  .canvas { padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }
  .grid > * { grid-column: span 12; }
  .askf { bottom: calc(54px + env(safe-area-inset-bottom)); }
}
@media (max-width: 720px) {
  :root { --pad: 16px; }
  .title { font-size: 22px; }
  .ph { display: block; }
  .ph > .acts { margin-top: 12px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { padding: 14px var(--pad); }
  .cell .v { font-size: 26px; }
  .cell:nth-child(n) { border-radius: 0; border-left: 0; }
  .cell:nth-child(2n) { border-left: 1px solid var(--rule); }
  .cell:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .strip.n3 .cell:last-child, .strip.n5 .cell:last-child { grid-column: span 2; border-left: 0; }
  .field, .field input { width: 100%; }
  .bar > .field { flex: 1 1 100%; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px var(--pad); border-top: 1px solid var(--rule); align-items: center; }
  .tbl.cards tbody tr:first-child { border-top: 0; }
  .tbl.cards td { display: block; padding: 0; border: 0; min-width: 0; }
  .tbl.cards td:first-child { grid-column: 1 / -1; }
  .tbl.cards td.hm { display: none; }
  .tbl.cards td.num { text-align: left; font-size: 13px; color: var(--muted); }
  .tbl.cards td.num:last-child { text-align: right; }
  .proj .s { -webkit-line-clamp: 2; }
  .sugg { grid-template-columns: minmax(0, 1fr); }
  .pk b { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; }
