/* Supp · Studio 2 — каркас и общие компоненты. Экраны — в screens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 450 var(--fs-body)/1.5 var(--font); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }    /* обводка повторяет форму элемента: круглые кнопки остаются круглыми */
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* ---------- иконки ---------- */
[data-i] { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
[data-i] svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- каркас ---------- */
.shell {
  display: grid; height: calc(100dvh - var(--tb-h));
  grid-template-columns: var(--side-w) minmax(0, 1fr) 0;
  transition: grid-template-columns .5s var(--ease-out);
}
@media (min-width: 1200px) {
  .shell {
    --main-min: 440px;
    --chat-min: 320px;
    --dialog-list-w: clamp(0px, calc(100vw - var(--side-w) - var(--main-min) - var(--chat-min)), 260px);
  }
  .shell.assist-open { grid-template-columns: var(--side-w) minmax(var(--main-min), 1fr) minmax(0, var(--assist-w)); }
  .shell.assist-open.assist-list { grid-template-columns: var(--side-w) minmax(var(--main-min), 1fr) minmax(0, calc(var(--assist-w) + var(--dialog-list-w))); }
}
.main {
  position: relative; min-width: 0; height: calc(100dvh - var(--tb-h) - 20px); margin: 10px 10px 10px 0;
  background: var(--bg); border-radius: var(--r-xl); overflow: auto; overflow-x: hidden;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--glass-line);
  scroll-behavior: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
}
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }
.view { position: relative; padding: 8px clamp(20px, 3.2vw, 48px) 64px; max-width: 1280px; margin: 0; outline: none; min-height: calc(100% - 72px); }   /* к левому краю, не по центру */
.view.v-projects { max-width: none; }   /* канбану нужна вся ширина; шапка проекта и остальные вкладки — в обычной ширине */
.view.v-projects > :not(#pj-body):not(.bd-editor), .view.v-projects #pj-body > :not(.board):not(.board-xbar) { max-width: 1232px; }
.view.v-projects #pj-body.notes-wide > :not(.board):not(.board-xbar) { max-width: none; }   /* заметки карточками и граф — во всю ширину */

/* ---------- боковая панель ---------- */
.side { display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px 16px; min-height: 0; overflow: hidden; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-cat { width: 34px; height: 34px; flex: none; }
.wordmark {
  display: block; width: 74px; height: 23px; font-size: 0;
  background: url(../brand-supp.png) no-repeat 76.7% 55.2% / 192.8% auto;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .wordmark { filter: invert(1); mix-blend-mode: screen; }
.side-search {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 12px; margin-bottom: 8px;
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--t-fast), color var(--t-fast);
}
.side-search:hover { color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.side-search span:nth-child(2) { flex: 1; text-align: left; font-size: 14px; }
kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); }
.side-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.side-nav .nav-glow {
  position: absolute; left: 0; right: 0; top: 0; height: 40px; border-radius: var(--r-sm);
  background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); pointer-events: none; opacity: 0;
}
.side-nav a, .side-projects a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--ink-2); font-weight: 520; font-size: 14.5px; transition: color var(--t-fast);
}
.side-nav a:hover, .side-projects a:hover { color: var(--ink); }
.side-nav a.on { color: var(--ink); font-weight: 620; }
.side-nav a .badge { margin-left: auto; }
.side-nav hr { border: 0; height: 1px; background: var(--line); margin: 10px 12px; }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px 12px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.side-projects { flex: 1; min-height: 0; overflow: auto; margin-right: -6px; padding-right: 6px; }
.side-projects a { height: 36px; font-size: 14px; }
.side-projects a .dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.side-projects a .count { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.side-projects a.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.side-projects a.side-all { color: var(--ink-3); } .side-projects a.side-all [data-i] { width: 16px; height: 16px; flex: none; }
.side-label-acts { display: flex; gap: 2px; }
.qp-list { display: flex; flex-direction: column; gap: 4px; }
.qp-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 8px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.qp-row .qp-grip { display: grid; place-items: center; width: 22px; height: 28px; color: var(--ink-3); cursor: grab; touch-action: none; }
.qp-row .qp-grip [data-i] { width: 16px; height: 16px; }
.qp-row .dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.qp-row .qp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-row.drag-on { box-shadow: var(--shadow-2); }
.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 650; }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.badge.coral { background: var(--coral); color: #141518; }

/* карточка Pro внизу панели */
.pro-card {
  position: relative; overflow: hidden; display: block; padding: 16px 16px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--on-ink); isolation: isolate;
}
.pro-card b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.pro-card small { display: block; margin-top: 2px; opacity: .66; font-size: 12.5px; line-height: 1.35; max-width: 150px; }
.pro-card .pro-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 650; padding: 7px 12px; border-radius: 99px; background: var(--on-ink); color: var(--ink); }
.pro-card .shape { position: absolute; z-index: -1; }
.pro-card .s1 { width: 70px; height: 70px; border-radius: 50%; background: var(--cobalt); right: -14px; top: -16px; }
.pro-card .s2 { width: 42px; height: 42px; border-radius: 10px; background: var(--sun); right: 30px; bottom: -12px; transform: rotate(18deg); }
.pro-card .s3 { width: 26px; height: 26px; border-radius: 50% 50% 50% 8px; background: var(--coral); right: 10px; top: 52px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); transition: background var(--t-fast); }
.me-row:hover { background: var(--surface); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); color: #141518; font-weight: 750; font-size: 14px; flex: none; }
.me-row b { display: block; font-size: 14px; font-weight: 620; line-height: 1.2; }
.me-row small { display: block; font-size: 12px; color: var(--ink-3); }

.me-row [data-i] { margin-left: auto; color: var(--ink-3); }

/* ---------- верхняя полоса ---------- */
.topbar {
  container: topbar / inline-size;
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 clamp(16px, 2.4vw, 28px) 0 clamp(20px, 3.2vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: var(--topline, 0); }
.topbar-title { flex: 1; min-width: 0; font-weight: 680; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: var(--toptitle, 0); transform: translateY(calc((1 - var(--toptitle, 0)) * 6px)); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.demo-pill { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 99px; color: var(--ink-3); font-size: 12px; font-weight: 560; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.demo-pill:hover { color: var(--ink); }
.demo-pill [data-i] { width: 14px; height: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm [data-i] { width: 16px; height: 16px; }
.ask-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 6px; border-radius: 99px;
  background: var(--ink); color: var(--on-ink); font-weight: 620; font-size: 14px;
  transition: transform .3s var(--ease-spring), box-shadow var(--t-med);
}
.ask-btn:hover { box-shadow: 0 8px 20px -8px rgba(20, 21, 24, .55); }
.ask-btn .ask-cat { width: 30px; height: 30px; border-radius: 50%; background: var(--on-ink); display: grid; place-items: center; }
.ask-btn .ask-cat svg { width: 22px; height: 22px; }
.shell.assist-open .ask-btn { background: var(--accent); }

/* ---------- кнопки ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 99px; font-weight: 620; font-size: 14.5px; white-space: nowrap;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: transform .35s var(--ease-spring), box-shadow var(--t-med), background var(--t-fast), color var(--t-fast);
  -webkit-user-select: none; user-select: none;
}
.btn:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn.primary:hover { box-shadow: 0 10px 24px -10px rgba(20, 21, 24, .6); }
:root[data-theme="dark"] .btn.primary:hover { box-shadow: 0 10px 24px -10px rgba(255, 255, 255, .25); }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.accent:hover { box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent); background: transparent; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn.lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn [data-i] { width: 18px; height: 18px; }
.link { color: var(--accent-text); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 560; }
.input, .textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--r-sm); border: 0; outline: 0;
  background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.textarea { resize: none; min-height: 96px; line-height: 1.55; }

/* ---------- чипы и сегменты ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad, 0px)); padding: 2px var(--pad, 0px); scroll-snap-type: x proximity; scroll-padding-inline: var(--pad, 0px); }
.chips.scroll::-webkit-scrollbar { display: none; }
@media (hover: hover) and (pointer: fine) {
  .chips.scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding-bottom: 6px; }
  .chips.scroll::-webkit-scrollbar { display: block; height: 6px; }
  .chips.scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 99px; flex: none;
  background: var(--surface); color: var(--ink-2); font-weight: 560; font-size: 13.5px; box-shadow: inset 0 0 0 1px var(--line);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform .3s var(--ease-spring); scroll-snap-align: start;
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.chip .dot { width: 8px; height: 8px; border-radius: 3px; }
.chip [data-i] { width: 16px; height: 16px; }

.seg {
  position: relative; display: inline-flex; padding: 4px; border-radius: 99px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.seg .seg-pill { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); pointer-events: none; }
:root[data-theme="dark"] .seg .seg-pill { background: var(--surface-3); }
.seg button, .seg a {
  position: relative; z-index: 1; height: 34px; padding: 0 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); transition: color var(--t-fast); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;      /* растянутая кнопка (ряд на всю ширину на телефоне) держит подпись по центру, в одну строку */
}
.seg .on { color: var(--ink); }

/* ---------- карточки ---------- */
.card {
  position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: var(--fs-h3); font-weight: 680; letter-spacing: -.02em; }
.card-head .spacer { flex: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 680; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow [data-i] { width: 15px; height: 15px; }
.tilt { transform-style: preserve-3d; will-change: transform; }

/* ---------- заголовки экранов ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 18px 0 26px; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head h1 { font-size: var(--fs-display); font-weight: 760; letter-spacing: -.045em; line-height: 1.02; }
.page-head h1 .dot { color: var(--accent); }
.page-head p { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; max-width: 560px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* слово выезжает снизу: режем только нижний край (clip-path), по бокам и сверху глифы не обрезаются —
   при отрицательном letter-spacing последняя буква жирного шрифта выступает за свой блок */
.split-line { display: inline-block; clip-path: inset(-.5em -.3em 0 -.3em); vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-line > span { display: inline-block; }

/* ---------- строки задач ---------- */
.tasks { display: flex; flex-direction: column; }
.task {
  container: task-row / inline-size;
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px;
  min-height: 60px; padding: 10px 12px 10px 14px; border-radius: var(--r-md); cursor: pointer;
  transition: background var(--t-fast);
}
.task + .task::before { content: ''; position: absolute; left: 54px; right: 12px; top: 0; height: 1px; background: var(--line); }
.task:hover { background: var(--surface-2); }
.task:hover + .task::before, .task:hover::before { opacity: 0; }
.task .t-main { min-width: 0; }
.task .t-title { position: relative; display: inline; font-weight: 540; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.task .t-title::after { content: ''; position: absolute; left: 0; right: 0; top: 54%; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out) .08s; }
.task .t-title { transition: color .4s; }
.task.done .t-title { color: var(--ink-3); }
.task.done .t-title::after { transform: scaleX(1); }
.task .t-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.task .t-meta:empty { display: none; }
.task .t-side { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 45cqi; }
.task .t-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; min-width: 0; gap: 4px 8px; }
.task .t-tags .tag { max-width: 100%; min-height: 24px; height: auto; white-space: normal; overflow-wrap: anywhere; }
.task .t-tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 560; white-space: nowrap; }
.tag .dot { width: 7px; height: 7px; border-radius: 3px; }
.tag.today { background: var(--accent-soft); color: var(--accent-text); }
.tag.late { background: var(--danger-soft); color: var(--danger-text, var(--danger)); }
.tag.soon { background: var(--warn-soft); color: color-mix(in srgb, var(--ink) 70%, #8a6100); }
.star { color: var(--sun); }
.star [data-i] svg { fill: currentColor; stroke: none; }

.check {
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 2px var(--line-strong); color: #fff; transition: box-shadow var(--t-fast);
}
.check:hover { box-shadow: inset 0 0 0 2px var(--ink-3); }
.check .fill { position: absolute; inset: 0; border-radius: 50%; background: var(--accent); transform: scale(0); }
.check svg { position: relative; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.check svg path { stroke-dasharray: 20; stroke-dashoffset: 20; }
.task.done .check .fill { transform: scale(1); background: var(--ink-3); }
.task.done .check svg path { stroke-dashoffset: 0; }
.task.important .check { box-shadow: inset 0 0 0 2px var(--coral); }
.spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; pointer-events: none; }

.quick-add {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 8px 0 16px; border-radius: var(--r-md);
  background: var(--surface-2); transition: box-shadow var(--t-fast), background var(--t-fast);
}
.quick-add:focus-within { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.quick-add > [data-i] { color: var(--ink-3); }
.quick-add input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; font-size: 15px; }
.quick-add input::placeholder { color: var(--ink-3); }
.quick-add .qa-hint { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.parsed { display: flex; gap: 6px; flex-wrap: wrap; }
.parsed:empty { display: none; }

.group-title { display: flex; align-items: center; gap: 10px; padding: 22px 14px 8px; font-size: 13px; font-weight: 680; color: var(--ink-2); letter-spacing: -.01em; }
.group-title .badge { height: 22px; }
.group-title.late { color: var(--danger); }
.group-title button { margin-left: auto; color: var(--ink-3); font-size: 13px; font-weight: 560; }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--ink-2); }
.empty .cat-wrap { width: 96px; height: 96px; }
.empty b { color: var(--ink); font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.empty p { max-width: 320px; font-size: 14px; }

/* ---------- кот ---------- */
.cat { width: 100%; height: 100%; overflow: visible; }
.cat .c-body { fill: #141518; }
:root[data-theme="dark"] .cat.adaptive .c-body { fill: #f4f3ef; }
:root[data-theme="dark"] .cat.adaptive .c-pupil { fill: #141518; }
.cat .c-eye { fill: #fff; }
.cat .c-pupil { fill: #141518; }
.cat .c-happy { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; opacity: 0; }
.cat .c-blush { fill: var(--coral); opacity: 0; }
[data-cat] { display: inline-block; }

/* ---------- нижняя панель (телефон) ---------- */
.tabbar { display: none; }

/* ---------- слои: листы, диалоги ---------- */
.layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; pointer-events: auto; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet {
  position: absolute; inset: 0; margin: auto; width: min(560px, calc(100vw - 32px)); height: fit-content; max-height: min(780px, calc(100dvh - 48px));
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3), inset 0 0 0 1px var(--glass-line); pointer-events: auto; overflow: hidden;
}
.sheet.wide { width: min(760px, calc(100vw - 32px)); }
.sheet .grab { display: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 6px 24px; }
.sheet-head h2 { flex: 1; font-size: 19px; font-weight: 720; letter-spacing: -.03em; }
.sheet-body { padding: 8px 24px 20px; overflow: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 14px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .spacer { flex: 1; }
.sheet.full { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }

/* ---------- тосты ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; min-height: 48px; border-radius: 99px;
  background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-3); font-weight: 560; font-size: 14px; pointer-events: auto; white-space: nowrap;
}
.toast [data-i] { width: 18px; height: 18px; }
@media (min-width: 760px) { .toast { white-space: normal; max-width: min(560px, calc(100vw - 32px)); line-height: 1.3; } }   /* длинная ошибка — переносом, а не за край окна */
/* данные экрана грузятся — спокойный индикатор посреди рабочей области */
.view[aria-busy="true"], :is(#pj-body, #task-body)[aria-busy="true"] { visibility: hidden; }
.main.loading::after, .main:has(.slow-pane)::after { content: ''; position: absolute; left: 50%; top: 42%; width: 26px; height: 26px; margin: -13px; border-radius: 50%; border: 2.5px solid var(--ink-3); border-right-color: transparent; animation: spin .7s linear infinite; pointer-events: none; }
.empty.oops .row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.toast button { padding: 7px 12px; border-radius: 99px; background: color-mix(in srgb, var(--on-ink) 14%, transparent); font-weight: 650; font-size: 13px; }
.toast:not(:has(button)) { padding-right: 18px; }

.fx { position: fixed; inset: 0; z-index: 90; pointer-events: none; width: 100vw; height: 100dvh; }

/* ---------- палитра команд ---------- */
.palette { inset: 13vh 0 auto 0; margin: 0 auto; width: min(640px, calc(100vw - 32px)); }
.palette-in { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 20px; border-bottom: 1px solid var(--line); }
.palette-in input { flex: 1; height: 58px; border: 0; outline: 0; background: none; font-size: 17px; }
.palette-list { max-height: 50vh; overflow: auto; padding: 8px; }
.palette-list .p-sec { padding: 10px 12px 6px; font-size: var(--fs-xs); font-weight: 680; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.p-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--r-sm); text-align: left; color: var(--ink-2); }
.p-item b { font-weight: 560; color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item small { color: var(--ink-3); font-size: 12.5px; }
.p-item.on { background: var(--surface-2); }
.p-item .dot { width: 10px; height: 10px; border-radius: 4px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }

/* ---------- меню свёрнуто до значков кнопкой в шапке (ПК, шире планшета) ---------- */
@media (min-width: 1100px) {
  .shell.side-mini { --side-w: 84px; }
  .shell.side-mini .side { align-items: center; padding: 18px 10px; }
  .shell.side-mini .side-brand { padding: 4px 0 12px; }
  .shell.side-mini .side-brand .wordmark, .shell.side-mini .side-search > span:not([data-i]), .shell.side-mini .side-search kbd, .shell.side-mini .side-label span,
  .shell.side-mini .side-nav a span:not([data-i]), .shell.side-mini .side-nav a .badge, .shell.side-mini .side-projects a span:not(.dot), .shell.side-mini .pro-card, .shell.side-mini .me-row div { display: none; }
  .shell.side-mini .side-search { width: 48px; justify-content: center; padding: 0; }
  .shell.side-mini .side-nav, .shell.side-mini .side-projects { width: 100%; }
  .shell.side-mini .side-nav a, .shell.side-mini .side-projects a { justify-content: center; padding: 0; }
  .shell.side-mini .side-label { justify-content: center; padding: 14px 0 4px; }
  .shell.side-mini .me-row { justify-content: center; }
  .shell.side-mini .me-row [data-i] { display: none; }
}
.topbar .main-collapse { margin-right: 6px; }
.topbar #web-toggle.on { background: var(--accent-soft); color: var(--accent-text); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-top .side-brand { flex: 1; min-width: 0; }
.side-collapse { color: var(--ink-3); }
.side-collapse:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
@media (min-width: 1100px) {
  .shell.side-mini .side-top { flex-direction: column; gap: 2px; }
  .shell.side-mini .side-top .side-brand { padding-bottom: 6px; }
}
@media (max-width: 1199px) { .topbar .main-collapse { display: none; } }
@media (max-width: 1099px) { .side-collapse { display: none; } }
/* рабочая область свёрнута: полоска с кнопкой, всё место — помощнику */
@media (min-width: 1200px) {
  .shell.assist-open.main-mini { grid-template-columns: var(--side-w) 56px minmax(0, 1fr); }
  .shell.main-mini .main { overflow: hidden; scrollbar-gutter: auto; height: auto; }   /* без резерва под скроллбар — стрелка по центру полоски; высота — от сетки, как у помощника */
  .shell.main-mini .topbar { padding-left: 8px; padding-right: 8px; justify-content: center; }
  .shell.main-mini .topbar-title, .shell.main-mini .topbar-actions, .shell.main-mini .view { display: none; }
  .shell.main-mini .main-collapse { margin: 0; }
}
/* своя шапка окна (окно ПК без рамки Windows) */
:root { --tb-h: 0px; }
body.framed { --tb-h: 40px; }
.titlebar { position: relative; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: var(--tb-h); padding: 0 0 0 24px; background: var(--bg-deep, var(--bg)); user-select: none; -webkit-user-select: none; }
.titlebar .tb-brand { display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
.titlebar .brand-cat { width: 22px; height: 22px; }
.tb-controls { display: flex; justify-self: end; height: 100%; }
.tb-btn { display: grid; place-items: center; width: 46px; height: 100%; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast); }
.tb-btn [data-i] { width: 16px; height: 16px; }
.tb-btn:hover { background: var(--surface-2); color: var(--ink); }
.tb-close:hover { background: #e5484d; color: #fff; }
body.framed .side .side-brand { display: none; }
body.framed .side-top { display: none; }
/* строка поиска: поле + стрелка сворачивания меню */
.side-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.side-row .side-search { flex: 1; min-width: 0; margin-bottom: 0; }
.side-collapse { width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.side-collapse [data-i] { width: 18px; height: 18px; }
@media (min-width: 1100px) {
  .shell.side-mini .side-row { flex-direction: column; gap: 6px; }
  .shell.side-mini .side-row .side-search { flex: none; }
}
/* подсказка при наведении (Chrome.tips): плашка под элементом, вместо системного title */
.tip { position: fixed; z-index: 400; max-width: 320px; padding: 5px 9px; border-radius: 7px; background: var(--surface-3); color: var(--ink); font-size: 12px; font-weight: 520; line-height: 1.35; letter-spacing: 0; pointer-events: none; box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-2); animation: tip-in .16s var(--ease-out); }   /* приглушённая, чтобы не читалась как подсветка кнопки */
@keyframes tip-in { from { opacity: 0; transform: translateY(-3px); } }
.tip.up { animation-name: tip-in-up; }
@keyframes tip-in-up { from { opacity: 0; transform: translateY(3px); } }
/* края окна без рамки: зоны захвата для изменения размера (Chrome.windowResize) */
.win-edges i { position: fixed; z-index: 1000; display: block; touch-action: none; }
body.resizing { user-select: none; cursor: inherit; }
.win-edges [data-edge="n"] { top: 0; left: 14px; right: 14px; height: 8px; cursor: ns-resize; }
.win-edges [data-edge="s"] { bottom: 0; left: 14px; right: 14px; height: 10px; cursor: ns-resize; }
.win-edges [data-edge="w"] { left: 0; top: 14px; bottom: 14px; width: 10px; cursor: ew-resize; }
.win-edges [data-edge="e"] { right: 0; top: 14px; bottom: 14px; width: 10px; cursor: ew-resize; }
.win-edges [data-edge="nw"] { left: 0; top: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.win-edges [data-edge="se"] { right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.win-edges [data-edge="ne"] { right: 0; top: 0; width: 16px; height: 16px; cursor: nesw-resize; }
.win-edges [data-edge="sw"] { left: 0; bottom: 0; width: 16px; height: 16px; cursor: nesw-resize; }
.topbar .main-collapse [data-i] { width: 18px; height: 18px; }
.titlebar .wordmark { width: 58px; height: 18px; }   /* те же пропорции 74×23, чуть меньше */
body.framed .shell.side-mini .side-top { align-items: center; }

/* ---------- окно компьютера 760–1099 px: панель со словами, но уже ---------- */
@media (max-width: 1099px) and (min-width: 760px) and (pointer: fine) {
  :root { --side-w: 212px; }
  .side-search kbd { display: none; }
  .shell.assist-open { grid-template-columns: var(--side-w) minmax(0, 1fr) 0; }
}
/* ---------- планшет: узкая панель ---------- */
@media (max-width: 1099px) and (min-width: 760px) and (pointer: coarse) {
  :root { --side-w: 84px; }
  .side { align-items: center; padding: 18px 10px; }
  .side-brand { padding: 4px 0 12px; }
  .side-brand .wordmark, .side-search > span:not([data-i]), .side-search kbd, .side-label span, .side-nav a span:not([data-i]), .side-nav a .badge,
  .side-projects a span:not(.dot), .pro-card, .me-row div { display: none; }
  .side-search { width: 48px; justify-content: center; padding: 0; }
  .side-nav, .side-projects { width: 100%; }
  .side-nav a, .side-projects a { justify-content: center; padding: 0; }
  .side-label { justify-content: center; padding: 14px 0 4px; }
  .me-row { justify-content: center; }
  .me-row [data-i] { display: none; }
  .shell.assist-open { grid-template-columns: var(--side-w) minmax(0, 1fr) 0; }
}

/* ---------- телефон ---------- */
@media (max-width: 759px) {
  /* нижняя панель: 58px, опущена к полоске «домой» (на iPhone — 16px над краем); --tab-space — сколько она занимает снизу */
  :root { --fs-body: 16px; --tab-h: 58px; --tab-b: max(6px, calc(var(--safe-b) - 18px)); --tab-space: calc(var(--tab-h) + var(--tab-b) + 8px); --top-h: 48px; }
  .shell, .shell.assist-open { grid-template-columns: minmax(0, 1fr) 0; }
  .side { display: none; }
  .main { margin: 0; height: var(--app-h, 100dvh); border-radius: 0; box-shadow: none; scrollbar-gutter: auto; }
  .view { padding: 0 16px calc(var(--tab-space) + 16px); }
  .topbar { height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0 16px; }
  .hide-mobile, .demo-pill, .ask-btn .ask-label { display: none; }
  .topbar .ask-btn { display: none; }               /* помощник — котом в нижней панели */
  .ask-btn { padding: 0; width: 42px; justify-content: center; background: transparent; }
  .ask-btn .ask-cat { width: 38px; height: 38px; background: var(--ink); }
  .ask-btn .ask-cat svg { width: 26px; height: 26px; }
  .ask-btn .ask-cat .c-body { fill: var(--on-ink); }
  .ask-btn .ask-cat .c-pupil { fill: var(--on-ink); }
  .ask-btn .ask-cat .c-eye { fill: var(--ink); }
  .page-head { padding: 4px 0 20px; }
  .page-head p { font-size: 15px; }

  .tabbar {
    position: fixed; z-index: 40; left: 10px; right: 10px; bottom: var(--tab-b);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: var(--tab-h); padding: 0 5px;
    border-radius: 22px; background: var(--glass); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--glass-line);
    -webkit-backdrop-filter: saturate(1.6) blur(22px); backdrop-filter: saturate(1.6) blur(22px);
  }
  .tabbar a, .tabbar button { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--ink-3); font-size: 11px; font-weight: 620; letter-spacing: 0; }
  .tabbar a [data-i] { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar .tab-pill { position: absolute; z-index: 0; top: 5px; height: 48px; border-radius: 17px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
  :root[data-theme="dark"] .tabbar .tab-pill { background: var(--surface-3); }
  .tabbar .tab-add { justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border-radius: 20px; background: var(--ink); color: var(--on-ink); box-shadow: 0 10px 24px -8px rgba(20, 21, 24, .5); }
  .tabbar .tab-add [data-i] { width: 26px; height: 26px; }
  .tabbar .tab-add [data-i] svg { stroke-width: 2.4; }
  .tabbar .tab-cat { justify-self: center; display: grid; place-items: center; width: 50px; height: 46px; padding: 0; border-radius: 17px; background: var(--ink); box-shadow: 0 10px 24px -8px rgba(20, 21, 24, .5); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: background var(--t-fast); }
  .tabbar .tab-cat .tab-cat-face { display: grid; place-items: center; pointer-events: none; }
  .tabbar .tab-cat .tab-cat-face svg { width: 32px; height: 32px; }
  .tabbar .tab-cat .c-body, .tabbar .tab-cat .c-pupil { fill: var(--on-ink); }
  .tabbar .tab-cat .c-eye { fill: var(--ink); }
  .tabbar .tab-cat.on { background: var(--accent); }
  .tabbar .tab-cat.on .c-eye { fill: var(--accent); }
  .tabbar .tab-cat.rec { background: var(--coral); box-shadow: 0 0 0 7px color-mix(in srgb, var(--coral) 22%, transparent), 0 10px 24px -8px rgba(20, 21, 24, .5); }
  .tabbar .tab-cat.rec .c-eye { fill: var(--coral); }
  body.kb .tabbar { transform: translateY(140%) !important; pointer-events: none; }

  .sheet, .sheet.wide, .palette {
    inset: auto 0 0 0; margin: 0; width: 100%; max-height: calc(100dvh - 28px - var(--safe-t));
    border-radius: 30px 30px 0 0;
  }
  .sheet .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
  .sheet-head { padding: 10px 14px 4px 20px; }
  .sheet-body { padding: 6px 20px 18px; }
  .toasts { bottom: calc(var(--tab-space) + 6px); left: 12px; right: 12px; transform: none; }
  .toast { white-space: normal; max-width: 100%; border-radius: 22px; line-height: 1.3; }   /* длинное сообщение — в две строки, а не за край экрана */
  .task { padding-left: 6px; padding-right: 4px; gap: 12px; }
  .task + .task::before { left: 46px; right: 4px; }
  .task .t-side .tag:not(.today):not(.late) { display: none; }
}

@media (hover: none) {
  .task:hover { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  /* бесконечные анимации (мигающий курсор, пульс) — один раз, а не мельтешение каждый кадр */
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
.side-nav a.soon { opacity: .6; }
.side-nav .soon-tag { margin-left: auto; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 2px 7px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 1099px) and (min-width: 760px) { .side-nav .soon-tag { display: none; } }
.side-nav { flex: none; }
.side { overflow-y: auto; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
/* длинное меню: проекты не сжимаются, панель листается целиком, низ прижат книзу */
.side-projects { flex: none; overflow: visible; margin-right: 0; padding-right: 0; }
.side-foot { margin-top: auto; }
.side-nav a { height: 38px; }
@media (max-height: 960px) and (min-width: 1100px) { .pro-card small { display: none; } .pro-card .pro-go { margin-top: 8px; } }
.side > * { flex-shrink: 0; }
.view, .welcome { overflow-x: clip; }

/* Android: размытие под панелями пересчитывается на каждом кадре прокрутки и даёт рывки — на телефоне панели плотные */
body.native .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
body.native .tabbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
/* кнопка-ссылка в строке текста («Повторить» рядом с «Не сохранено») */
.pw-wrap { position: relative; display: block; }
.pw-wrap > .input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.pw-eye:hover { background: var(--surface-2); color: var(--ink); }
.pw-eye [data-i], .pw-eye svg { width: 18px; height: 18px; }
.pw-eye svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.field .field-hint { font-size: 12.5px; color: var(--ink-2); font-weight: 450; }
.link-btn { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0; }

/* ---------- касание: цели не меньше 40 px; поля ввода 16 px (iPhone не приближает страницу при фокусе) ---------- */
@media (pointer: coarse) {
  .icon-btn.sm { min-width: 40px; min-height: 40px; }
  .seg button, .seg a { min-height: 40px; }
  .btn.sm { min-height: 40px; }
  .check::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; }   /* промах мимо кружка не открывает карточку */
}
@media (max-width: 759px) {
  /* только поля мельче 16 px; крупные (название задачи и заметки, сумма, время) остаются крупными */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.huge):not(.big):not(.time-in):not(.note-title):not(.sh-in),
  textarea:not(.ed-title):not(.wk-title):not(.note-title), select { font-size: 16px !important; }
}
/* действия, которые раньше появлялись только при наведении: видны с клавиатуры и на сенсорном экране */
.wk-plus:focus-visible, .conv-more:focus-visible { opacity: 1; }

/* ---------- не загрузилось: причина и «Повторить» вместо пустого списка ---------- */
.load-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--danger-soft); color: var(--ink); text-align: left; }
.load-fail .lf-ico { color: var(--danger-text, var(--danger)); display: inline-flex; }
.load-fail .lf-text { display: grid; gap: 2px; flex: 1 1 170px; min-width: 0; }
.load-fail .lf-text b { font-size: 14px; font-weight: 650; }
.load-fail .lf-text small { color: var(--ink-2); font-size: 13px; }
/* сообщение помощнику не ушло */
.msg.err .msg-text { color: var(--danger-text, var(--danger)); }
.msg-retry { display: flex; gap: 8px; margin-top: 8px; }
/* поиск на телефоне: подсказки клавиатуры не нужны */
@media (max-width: 759px), (pointer: coarse) { .palette-foot, .palette-in kbd { display: none; } }
.kcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
