/* ==========================================================================
   TaskDesk — app layer (layout + app-specific components)
   Loads after tokens.css and components.css (design system v1 «Мягкий и дружелюбный»).
   ========================================================================== */

:root {
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --vh: var(--tg-viewport-stable-height, 100dvh);
  --mbar-h: 56px;
  --panel-w: 440px;
}

/* iOS zoom guard: every field ≥16px on every width */
input, select, textarea { font-size: 16px; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
body { min-height: 100vh; overflow-wrap: break-word; }
button { color: inherit; }
a { -webkit-tap-highlight-color: transparent; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-13); }
.hint { font-size: var(--fs-13); color: var(--muted); line-height: 1.45; }
.kbd { font-family: var(--font); }
#offline:empty { display: none; }

/* ---------- boot ---------- */
.boot-splash { min-height: 100vh; display: grid; place-items: center; }
.boot-splash .logo { width: 48px; height: 48px; border-radius: 16px; animation: pulse 1.4s ease-in-out infinite; }
.boot { max-width: 760px; margin: 0 auto; padding: calc(var(--safe-top) + 20px) 16px; display: grid; gap: 18px; }
.boot-head { display: grid; gap: 8px; }

/* ---------- shell (desktop) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
body.rail .shell { grid-template-columns: 68px minmax(0, 1fr); }
body.has-panel .shell { grid-template-columns: 68px minmax(0, 1fr) var(--panel-w); }
.panel-wrap { display: none; }
body.has-panel .panel-wrap { display: block; position: sticky; top: 0; height: 100vh; padding: 12px 12px 12px 0; }
.panel-wrap .drawer { width: auto; height: 100%; }

.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.side .spacer { flex: 1 1 auto; min-height: 12px; }
.side a { text-decoration: none; }
.side a:hover { text-decoration: none; }
.side .brand { color: var(--text); }
.side-add { justify-content: flex-start; margin: 0 0 12px; width: 100%; }
.side-add .kbd { margin-left: auto; border-color: color-mix(in srgb, var(--accent-text) 30%, transparent); color: var(--accent-text); }
.nav-item { width: 100%; text-align: left; }
.nav-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.stream .sdot { margin: 0 5px 0 5px; }
.nav-item.add { color: var(--accent-text); background: var(--accent-soft); margin-bottom: 8px; }
.nav-item.add .i { color: inherit; }
.side .me { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; margin-top: 8px; }
.side .me:hover { background: var(--surface-2); }
.me-txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.me-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { font-size: 12px; color: var(--muted); }
.me-chev { color: var(--faint); }
.side.rail { width: 68px; }
.side.rail .me { justify-content: center; padding: 8px 0; }
.side.rail .spacer { flex: 1 1 auto; }

.main { min-width: 0; padding: 22px 28px 48px; display: grid; gap: 16px; align-content: start; grid-auto-rows: max-content; }
#head { display: contents; }
#content { display: grid; gap: 16px; align-content: start; min-width: 0; }
.main[data-w="narrow"] { width: 100%; max-width: 920px; justify-self: center; }
.main[data-w="settings"] { width: 100%; max-width: 760px; justify-self: center; }
.main[data-w="settings"] .settings { max-width: none; }
body.has-panel .main[data-w="narrow"] { max-width: 820px; }

.page-head { min-height: 44px; flex-wrap: wrap; }
.page-head h1 { white-space: nowrap; }
.page-head .search { width: 280px; position: relative; }
.page-head .search input { min-height: 40px; font-size: 16px; padding-right: 34px; background: var(--surface); box-shadow: var(--shadow-1), var(--ring); border-radius: var(--r-pill); }
.page-head .search input:focus { box-shadow: 0 0 0 4px var(--focus); }
.page-head .search .kbd { position: absolute; right: 12px; pointer-events: none; }
body.has-panel .page-head .search { width: 240px; }
.toolbar .chip.select.on { background: var(--text); color: var(--bg); }
.toolbar .chip .n { font-weight: 700; }

/* ---------- mobile shell ---------- */
@media (max-width: 759px) {
  .shell { display: block; }
  .side, .panel-wrap { display: none !important; }
  .main { display: block; padding: 0 16px calc(var(--tabbar-h) + var(--safe-bottom) + 28px); }
  #content { gap: 14px; }
}
@media (min-width: 760px) {
  .bottomnav { display: none !important; }
  .m-only { display: none !important; }
}
/* desktop: the page head (title, search, «Задача») stays on screen while the content scrolls */
@media (min-width: 760px) {
  .page-head { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg);
    margin: -22px -28px -10px; padding: 22px 28px 10px; transition: box-shadow var(--dur-2) var(--ease-out); }
  html.scrolled .page-head { box-shadow: 0 1px 0 var(--border); }
  .main .sec-head, .main .psec-head { top: var(--dhead-h, 76px); }
  html { scroll-padding-top: calc(var(--dhead-h, 76px) + 8px); }
}

/* mobile header: large title that collapses into a translucent compact bar */
.m-head { display: contents; }
.m-bar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 8px;
  height: calc(var(--mbar-h) + var(--safe-top)); padding: var(--safe-top) 12px 0 16px; margin: 0 -16px;
  background: color-mix(in srgb, var(--bg) 0%, transparent);
  transition: background var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
body.scrolled .m-bar, .m-head.search-mode .m-bar {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 1px 0 var(--border);
}
.m-title { flex: 1; min-width: 0; font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: font-size var(--dur-2) var(--ease-out); }
body.scrolled .m-title { font-size: 19px; letter-spacing: -.01em; }
.m-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.m-actions .icon-btn { width: 40px; height: 40px; }
.m-back { margin-left: -8px; }
.m-sub { font-size: 14px; color: var(--muted); margin: -4px 0 14px; }
.m-tools { display: grid; gap: 10px; margin: 2px 0 14px; min-width: 0; }
.m-head.search-mode .m-bar { gap: 6px; padding-right: 6px; }
.m-head.search-mode .input-icon { flex: 1; min-width: 0; }
.m-head.search-mode input { min-height: 40px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1), var(--ring); }
.icon-btn.dot::before { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface-2); }
.input-icon.grow { flex: 1; }

/* bottom tab bar */
.bottomnav a { text-decoration: none; }
.bn-item { -webkit-tap-highlight-color: transparent; }
.bn-item .bn-badge { left: calc(50% + 4px); }
body.kb-open .bottomnav { display: none; }

/* ---------- chips / segmented additions ---------- */
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips.fade { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); margin-right: -16px; padding-right: 24px; }
.chip.filt { gap: 6px; padding-right: 10px; }
.chip .av.xs { margin-left: -8px; box-shadow: none; }
.chip .sdot { margin-left: -2px; }
.seg { max-width: 100%; }
.seg button { white-space: nowrap; }
.hscroll { overflow-x: auto; scrollbar-width: none; touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
.hscroll::-webkit-scrollbar { display: none; }
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 4px; background: var(--dot, var(--faint)); flex: none; }
.sdot.lg { width: 14px; height: 14px; border-radius: 5px; }
.gdot { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--st-bg); color: var(--st-fg); flex: none; }
.gdot .g { width: 15px; height: 15px; }
.switch.accent.on { background: var(--accent); }
.switch.sm { transform: scale(.85); transform-origin: right center; }
.btn { text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn.danger-fill { background: var(--danger); color: #fff; border-color: transparent; box-shadow: none; }
.btn.flag { background: var(--st-discuss-bg); color: var(--st-discuss-fg); border-color: transparent; box-shadow: none; }
.btn.flag .g { width: 16px; height: 16px; }
.btn.soft .i, .btn.ok .i { stroke-width: 2.2; }
.linkbtn { color: var(--accent-text); font-weight: 600; font-size: 15px; padding: 8px 0; text-align: left; }
.linkbtn.danger { color: var(--danger); }
.linkbtn.center { text-align: center; width: 100%; padding: 12px 0; }
.row-btns { display: flex; gap: 8px; }
.row-btns > .btn { flex: 1 1 0; }
.row-btns.end { justify-content: flex-end; }
.row-btns.end > .btn { flex: 0 0 auto; }
.row-btns.wrap { flex-wrap: wrap; }
.row-btns.wrap > .btn { flex: 0 0 auto; }
@media (max-width: 759px) { .row-btns.end > .btn { flex: 1 1 0; } }

/* ---------- stats strip ---------- */
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px 0 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1), var(--ring); font-size: 13px; color: var(--text-2); white-space: nowrap; transition: background var(--dur-2), color var(--dur-2); }
.stat b { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .g { width: 15px; height: 15px; }
.stat.done .g { color: var(--st-done-dot); } .stat.wip .g { color: var(--st-wip-dot); } .stat.to_check .g { color: var(--st-to_check-dot); } .stat.discuss .g { color: var(--st-discuss-dot); }
.stat.overdue .i { color: var(--urgent-fg); }
button.stat:active { transform: scale(.97); }
.stat.on { background: var(--text); color: var(--bg); box-shadow: none; }
.stat.on b, .stat.on .g, .stat.on .i { color: inherit; }
@media (max-width: 759px) {
  .stats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
  .stats::-webkit-scrollbar { display: none; }
}
.ov-controls { display: grid; gap: 10px; min-width: 0; }

/* ---------- sections ---------- */
.secs { display: grid; gap: 20px; min-width: 0; }
.sec { min-width: 0; }
.sec-head {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 6px 4px 6px 2px;
  font-size: 15px; font-weight: 650; color: var(--text); text-align: left;
  background: var(--bg);
}
@media (max-width: 759px) { .sec-head, .psec-head { top: calc(var(--mbar-h) + var(--safe-top)); } }
.sec-head .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.sec-head.hot .sec-title { color: var(--urgent-fg); }
.sec-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.sec-head.hot .sec-ic { background: var(--urgent-bg); color: var(--urgent-fg); }
.sec-head .sdot { margin: 0 4px 0 6px; }
.sec-hint { color: var(--muted); font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sec-chev { color: var(--faint); transition: transform var(--dur-2) var(--ease-out); flex: none; }
.sec.collapsed .sec-chev, .psec.collapsed .sec-chev { transform: rotate(-90deg); }
.sec-body { display: grid; gap: 8px; min-width: 0; padding-top: 2px; }
.more-link { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; font-weight: 600; color: var(--accent-text); }
.m-group { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--text-2); margin: 4px 4px 0; }
.m-group .n { color: var(--muted); font-weight: 500; }

/* ---------- task row (card) ---------- */
.item-wrap { position: relative; border-radius: var(--r-lg); min-width: 0; }
.item {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 11px; align-items: start;
  padding: 12px 14px 12px 11px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1), var(--ring);
  cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: box-shadow var(--dur-2) var(--ease-out), background var(--dur-2), transform var(--dur-1) var(--ease-out);
}
@media (hover: hover) { .item:hover { box-shadow: var(--shadow-2), var(--ring); } }
.item.pressed { transform: scale(.985); }
.item.sel { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.item.kb { box-shadow: 0 0 0 2px var(--accent); }
.item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ind { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--st-bg); color: var(--st-fg); transition: transform var(--dur-2) var(--ease-spring); }
.ind .g { width: 18px; height: 18px; }
button.ind::after { content: ""; position: absolute; inset: -7px; }
button.ind:active { transform: scale(.9); }
.ind.flat { cursor: default; }
.item-body { min-width: 0; }
.item-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.item-title { flex: 1; min-width: 0; margin: 0; padding-top: 5px; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-due { flex: none; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-due.today { color: var(--accent-text); }
.item-due.overdue { color: var(--urgent-fg); }
.item-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; min-height: 22px; }
.item-meta > * { flex: 0 0 auto; min-width: 0; }
.item-meta > .tag { flex: 0 1 auto; overflow: hidden; min-width: 44px; }
.item-meta > .sig.quote { flex: 0 6 auto; overflow: hidden; min-width: 40px; }
.item-meta > .who { flex: 0 0 auto; overflow: hidden; max-width: 46%; }
.item-meta .who { gap: 6px; }
.item-meta .status .g { display: none; }
.item-meta .status.sm { padding: 0 8px; }
.item-meta .who .nm { overflow: hidden; text-overflow: ellipsis; }
.item-meta .sep { color: var(--faint); }
.item-meta .status { margin-right: 2px; }
.sig { display: inline-flex; align-items: center; gap: 4px; }
.sig .i { width: 13px; height: 13px; }
.sig.urgent { color: var(--urgent-fg); font-weight: 600; }
.sig.stale { color: var(--stale-fg); font-weight: 500; }
.sig.quote { display: block; text-overflow: ellipsis; color: var(--text-2); }
.item .tcard-upd { margin-top: 10px; }
.item .tcard-upd .av { margin-top: 1px; }
.item-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
.item-actions .btn { min-height: 36px; }
.item-actions.assign { justify-content: flex-start; gap: 8px; }
.item-actions .lbl { font-size: 13px; color: var(--muted); flex: none; }
.av-row { display: flex; gap: 6px; min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 16px; }
.av-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 12px 0 4px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; transition: background var(--dur-1), transform var(--dur-1); }
.av-btn .av { box-shadow: none; }
.av-btn:hover { background: var(--surface-3); color: var(--text); }
.av-btn:active { transform: scale(.95); }
.av-btn.more { padding: 0 10px; color: var(--muted); }
.item.done .item-title { color: var(--muted); font-weight: 500; }
.item.muted { background: color-mix(in srgb, var(--surface) 55%, transparent); box-shadow: inset 0 0 0 1px var(--border); }
.item.muted .item-title { color: var(--text-2); }
.sec.muted .item { background: color-mix(in srgb, var(--surface) 55%, transparent); box-shadow: inset 0 0 0 1px var(--border); }

/* swipe underlay */
.swipe-bg { position: absolute; inset: 0; border-radius: var(--r-lg); overflow: hidden; opacity: 0; }
.item-wrap.swiping .swipe-bg { opacity: 1; }
.sw { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 20px; font-size: 14px; font-weight: 600; transition: background var(--dur-2), color var(--dur-2); }
.sw-r { justify-content: flex-start; background: var(--accent-soft); color: var(--accent-text); }
.sw-l { justify-content: flex-end; background: var(--surface-3); color: var(--text-2); }
.sw-r.ok { background: var(--st-done-bg); color: var(--st-done-fg); }
.sw-l.dis { background: var(--st-discuss-bg); color: var(--st-discuss-fg); }
.item-wrap.dir-r .sw-l, .item-wrap.dir-l .sw-r { display: none; }
.item-wrap.armed .sw { font-weight: 800; }
.item-wrap.armed .sw-r { background: var(--accent); color: var(--on-accent); }
.item-wrap.armed .sw-r.ok { background: var(--st-done-dot); color: #fff; }
.item-wrap.armed .sw-l.dis { background: var(--st-discuss-dot); color: #fff; }
.item-wrap.armed .sw-l { background: var(--text-2); color: var(--surface); }
/* row leaving (accept / assign) */
.item-wrap.leaving { overflow: hidden; transition: height .28s var(--ease-out), opacity .24s var(--ease-out), margin .28s var(--ease-out); }
.item-wrap.leaving.ok .item { background: var(--st-done-bg); }
.item-wrap.leaving.go { height: 0 !important; opacity: 0; margin-top: -8px; }

/* ---------- desktop table additions ---------- */
.thead, .trow { grid-template-columns: 44px minmax(0, 1fr) 150px 110px 128px; }
body.has-panel .thead, body.has-panel .trow { grid-template-columns: 34px minmax(0, 1fr) 32px 96px 120px; column-gap: 10px; }
body.has-panel .t-who .nm, body.has-panel .thead span:nth-child(3) { display: none; }
@media (max-width: 1100px) { .thead, .trow { grid-template-columns: 36px minmax(0, 1fr) 36px 100px 124px; } .t-who .nm, .thead span:nth-child(3) { font-size: 0; } .t-who .nm { display: none; } }
.trow { cursor: pointer; }
.trow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.trow.kb { box-shadow: inset 0 0 0 2px var(--accent); }
.trow.done .txt { color: var(--muted); }
.t-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--text-2); }
.t-who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-who .nm.unassigned { color: var(--muted); }
.btn-plain { padding: 4px 8px 4px 4px; margin-left: -4px; border-radius: 12px; text-align: left; transition: background var(--dur-1); }
.btn-plain:hover { background: var(--surface-2); }
.t-due .d.none { color: var(--faint); }
.t-st { display: flex; }
.t-title .marker { flex: none; }
.t-quick { margin-left: auto; display: inline-flex; gap: 6px; flex: none; opacity: 0; transition: opacity var(--dur-1); }
.trow:hover .t-quick, .trow:focus-within .t-quick { opacity: 1; }
.tpad { height: 6px; }
.tgroup .done-n, .sec-head .done-n { display: inline-flex; align-items: center; gap: 3px; color: var(--st-done-fg); }
.tgroup .sdot { margin-right: 2px; }
.tlist .tgroup:first-of-type { padding-top: 12px; }
.pin-block { display: grid; gap: 10px; }
.pin-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pin-head .n { color: var(--muted); }
.pin-head .muted { font-size: 13px; }
.search-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; }

/* ---------- board & people columns ---------- */
.board { grid-auto-columns: minmax(210px, 1fr); overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board.people { grid-auto-columns: minmax(196px, 1fr); }
.bcol { min-height: 120px; transition: background var(--dur-2), box-shadow var(--dur-2); }
.bcol.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.bcol.over.deny { background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger); }
.bcol-empty { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 18px 10px; text-align: center; font-size: 13px; color: var(--muted); }
.bcard { cursor: grab; }
.bcard:active { cursor: grabbing; }
.bcard.sel { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.bcard.kb { box-shadow: 0 0 0 2px var(--accent); }
.bcard .tcard-title { margin: 0; overflow-wrap: anywhere; }
.bcard .muted-tag { color: var(--muted); }
body.dragging .bcard:not(.lifted) { transition: none; }
.pcol .phead .name { display: flex; align-items: baseline; gap: 2px; }
.pcol .empty.sm { padding: 16px 8px; }
.pcol .empty.sm .art { width: 48px; height: 48px; border-radius: 16px; }
.load.load-none span { background: var(--border); }

/* ---------- mobile people sections ---------- */
.psec { min-width: 0; }
.psec-head { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 4px; background: var(--bg); text-align: left; }
.psec-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.psec-txt b { font-size: 16px; font-weight: 650; }
.psec-txt small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psec .load { margin: 0 4px 6px; }
.psec-foot { display: flex; align-items: center; gap: 6px; padding: 2px 6px; font-size: 13px; color: var(--muted); }

/* ---------- search & Claude ---------- */
.ask-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1), var(--ring); text-align: left; font-size: 15px; min-width: 0; }
.ask-row:hover { box-shadow: var(--shadow-2), var(--ring); }
.ask-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-txt b { color: var(--accent-text); font-weight: 600; }
.ask-row .chev { color: var(--faint); }
.answer-head small { margin-left: auto; }
.answer-head .icon-btn { margin-right: -8px; }
.answer p { white-space: pre-wrap; }
.mini { width: 100%; text-align: left; min-width: 0; }
.mini .t { min-width: 0; overflow-wrap: anywhere; }
.mini .chev { color: var(--faint); }
.mini .m { min-width: 0; }
.mini:hover { background: var(--surface-3); }
.answer.loading { gap: 8px; }
.search-hint { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.search-hint .i { color: var(--faint); margin-bottom: 4px; }
.search-hint b { color: var(--text); font-size: 16px; }

/* ---------- offline ---------- */
.offline { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: var(--st-to_check-bg); color: var(--st-to_check-fg); font-size: 13px; font-weight: 500; margin: 0 0 12px; }
.offline span { flex: 1; }
.offline .btn { color: inherit; }

/* ---------- sheets (phone) ---------- */
.overlay { z-index: var(--z-overlay); transition: opacity .2s var(--ease-out); }
.overlay.out { opacity: 0; }
.sheet {
  top: auto; max-height: calc(var(--vh) - var(--safe-top) - 12px);
  display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: 0; touch-action: pan-y;
}
.sheet.full { height: calc(var(--vh) - var(--safe-top) - 10px); }
.sheet.closing { animation: sheet-out .22s var(--ease-out) forwards; }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px 4px 20px; flex: none; }
.sheet-title { font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot { flex: none; padding: 10px 16px calc(10px + var(--safe-bottom)); background: var(--elevated); box-shadow: 0 -1px 0 var(--border); }
.sheet .sheet-x { flex: none; }
.sheet .seg { flex: none; }
body.has-sheet .toast-host { bottom: auto; top: calc(var(--safe-top) + 12px); }

/* desktop modal */
.modal-wrap { position: fixed; inset: 0; z-index: calc(var(--z-overlay) + 1); display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.modal { padding: 0; gap: 0; display: flex; flex-direction: column; max-height: calc(100vh - 48px); overflow: hidden; }
.modal.tall { height: min(780px, calc(100vh - 48px)); width: min(720px, calc(100vw - 48px)); }
.modal.closing { animation: none; opacity: 0; transition: opacity .1s; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 8px 24px; flex: none; }
.modal .sheet-body { padding: 8px 24px 20px; }
.modal .sheet-foot { padding: 14px 24px 16px; box-shadow: 0 -1px 0 var(--border); background: transparent; }
.modal.create-sheet.wide { width: min(660px, calc(100vw - 48px)); }

/* desktop popover */
.popover {
  position: fixed; z-index: calc(var(--z-overlay) + 5); min-width: 240px; max-width: min(360px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--elevated); border-radius: var(--r-lg); box-shadow: var(--shadow-3), var(--ring);
  animation: pop-in .14s var(--ease-out);
}
.popover.closing { opacity: 0; transition: opacity .1s; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.popover .sheet-body { padding: 6px; overflow-y: auto; }
.popover .sheet-foot { padding: 10px 12px; box-shadow: 0 -1px 0 var(--border); background: transparent; }
.pop-title { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px 2px; }
.popover.filter-sheet { width: 400px; max-width: calc(100vw - 24px); }
.popover.filter-sheet .sheet-body { padding: 14px 16px 6px; }
.popover.qa-menu, .popover.avatar-menu { width: 300px; }

/* picker list */
.pl { display: grid; gap: 2px; }
.pl-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 10px; border-radius: 12px; text-align: left; font-size: 16px; color: var(--text); position: relative; cursor: pointer; transition: background var(--dur-1); }
.pl-row:hover, .pl-row:focus-visible { background: var(--surface-2); }
.pl-row:active { background: var(--surface-3); }
.pl-row.sel { font-weight: 600; }
.pl-row.danger { color: var(--danger); }
.pl-row[disabled] { opacity: .45; }
.pl-label { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.pl-label small { font-size: 13px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-lead { width: 28px; height: 28px; display: inline-grid; place-items: center; color: var(--muted); flex: none; border-radius: 50%; }
.pl-lead.ok { background: var(--st-done-bg); color: var(--st-done-fg); }
.pl-lead.urgent { background: var(--urgent-bg); color: var(--urgent-fg); }
.pl-lead.danger, .pl-row.danger .pl-lead { color: var(--danger); }
.pl-row .gdot { width: 28px; height: 28px; }
.pl-check { color: var(--accent); width: 20px; height: 20px; stroke-width: 2.4; }
.pl-chev { color: var(--faint); }
.pl-sep { height: 1px; background: var(--border); margin: 4px 10px; }
.pl-head { padding: 8px 10px 10px; }
.pl-me { display: flex; align-items: center; gap: 12px; }
.pl-me b { display: block; font-size: 16px; }
.pl-me small { font-size: 13px; color: var(--muted); }
.pl-row .switch { flex: none; }
.native-date { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; cursor: pointer; }
.native-date::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.popover .pl-row { min-height: 42px; font-size: 14.5px; padding: 5px 10px; }
.popover .pl-lead, .popover .pl-row .gdot { width: 24px; height: 24px; }
.popover .pl-label small { font-size: 12px; }
.confirm-text { color: var(--text-2); font-size: 15px; }

/* forms */
.form { display: grid; gap: 14px; min-width: 0; }
.form.center { justify-items: stretch; text-align: center; }
.field > label { display: block; }
.field-note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.field-note.warn { color: var(--st-to_check-fg); background: var(--st-to_check-bg); padding: 8px 10px; border-radius: 10px; }
.field-err { color: var(--danger); font-size: 13.5px; font-weight: 500; margin-top: -6px; }
.invalid, .invalid:focus { border-color: var(--danger) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 22%, transparent) !important; }
.big-input { font-size: 18px; font-weight: 600; min-height: 54px; border-radius: 14px; padding: 12px 16px; letter-spacing: -.01em; }
.big-ta { resize: none; min-height: 96px; line-height: 1.5; }
.desc-ta { resize: none; min-height: 84px; }
.shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.linkbox { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); overflow-wrap: anywhere; text-align: left; }
.ok-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--st-done-bg); color: var(--st-done-fg); font-weight: 500; }
.ok-txt { color: var(--success); }
.warn-txt { color: var(--st-to_check-fg); }

/* filter sheet */
.filter { display: grid; gap: 18px; }
.f-group { display: grid; gap: 8px; }
.f-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 14px; background: var(--surface-2); font-size: 15px; text-align: left; }
.f-row .i { color: var(--urgent-fg); }
.f-row span:not(.switch) { flex: 1; }

/* ---------- create sheet ---------- */
.create-head { min-width: 0; }
.create-seg button { padding: 0 12px; }
.create-seg .i { color: var(--accent); }
.props-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.props-chips .pick, .qa-meta .pick { min-height: 36px; font-size: 14px; }
.pick { cursor: pointer; transition: background var(--dur-1), transform var(--dur-1); max-width: 100%; }
.pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pick:active { transform: scale(.96); }
.pick:hover { background: var(--surface-3); }
.pick.empty-val:hover { background: var(--surface-2); }
.pick .av { box-shadow: none; }
.pick.txt .tag { font-size: 13px; }
.drafts { display: grid; gap: 10px; }
.qa-note { font-weight: 500; }
.qa-task { box-shadow: var(--shadow-1), var(--ring); transition: opacity var(--dur-2); }
.qa-task .check { transition: background var(--dur-2), transform var(--dur-1); }
.qa-task .check:active { transform: scale(.9); }
input.qa-title { border: 0; border-bottom: 1px dashed var(--border-strong); border-radius: 0; background: transparent; padding: 0 0 6px; min-height: 0; width: 100%; box-shadow: none; }
input.qa-title:hover, input.qa-title:focus { background: transparent; box-shadow: none; border-bottom-color: var(--accent); }
.qa-task.skel { opacity: .8; }
.qa-loading { display: grid; gap: 10px; }
.spin { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.9); } }
.create-foot { width: 100%; }

/* ---------- detail (sheet / panel) ---------- */
.detail { display: flex; flex-direction: column; overflow: hidden; }
.drawer.detail { background: var(--elevated); }
.drawer.float { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(var(--panel-w), calc(100vw - 24px)); z-index: calc(var(--z-overlay) + 1); }
.detail .drawer-head { flex: none; min-height: 52px; padding: 8px 10px 4px 20px; }
.sheet.detail .drawer-head { padding-top: 0; }
.detail .drawer-head .tag { min-width: 0; }
.detail .drawer-body { flex: 1 1 auto; min-height: 0; padding: 4px 20px 24px; gap: 16px; overscroll-behavior: contain; }
.d-title { font-size: var(--fs-20); font-weight: 700; line-height: 1.28; letter-spacing: -.015em; overflow-wrap: anywhere; margin: 0; }
@media (max-width: 759px) { .d-title { font-size: 22px; } }
textarea.d-title-edit { display: block; width: 100%; resize: none; border: 0; background: transparent; padding: 2px 8px; margin: -2px -8px; min-height: 0; border-radius: 10px; font-family: inherit; color: var(--text); overflow: hidden; width: calc(100% + 16px); }
textarea.d-title-edit:hover { background: var(--surface-2); }
textarea.d-title-edit:focus { background: var(--surface-2); box-shadow: 0 0 0 3px var(--focus); border: 0; }
.d-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: -8px; }
.marker.arch { background: var(--surface-2); color: var(--muted); }
.act { display: grid; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); }
.act.st-discuss-soft { background: var(--st-discuss-bg); color: var(--st-discuss-fg); }
.act-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.act-status { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.act.st-discuss-soft .act-status { color: inherit; font-weight: 500; }
.act-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.act-btns > .btn { flex: 1 1 auto; }
.act-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 36px; flex-wrap: wrap; }
.act-foot .btn { min-height: 36px; font-size: 14px; }
.av-row.big { padding-bottom: 2px; }
.av-row.big .av-btn { min-height: 44px; padding-right: 14px; background: var(--surface); box-shadow: var(--shadow-1), var(--ring); font-size: 14px; }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 14px; background: var(--surface-3); }
.step { display: grid; justify-items: center; gap: 3px; min-height: 54px; padding: 7px 2px 6px; border-radius: 11px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; transition: background var(--dur-2), color var(--dur-2), transform var(--dur-1); }
.step span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.step .g { width: 18px; height: 18px; }
.step:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text-2); }
.step:active { transform: scale(.96); }
.step.past { color: var(--text-2); }
.step.past .g { color: var(--st-dot); }
.step.on { background: var(--st-bg); color: var(--st-fg); box-shadow: var(--shadow-1); }
.reviewbar .rb-g { width: 24px; height: 24px; flex: none; }
.reviewbar .btn { min-height: 44px; }
.props .prop { width: 100%; text-align: left; font-size: 15px; }
.prop.tap { cursor: pointer; transition: background var(--dur-1); }
.prop.tap:hover { background: var(--surface-3); }
.prop .v { min-width: 0; }
.prop .v .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .v .tag { font-size: 15px; color: var(--text); }
.prop .due { font-size: 15px; color: var(--text); white-space: normal; }
.prop .due.overdue { color: var(--urgent-fg); }
.prop .due.today .due-rel { color: var(--accent-text); font-weight: 600; }
.prop .due.none { color: var(--muted); }
.prop .switch { margin-left: auto; }
.prop .chev { margin-left: auto; flex: none; }
@media (min-width: 760px) { .prop .k { width: 112px; font-size: 14px; } .props .prop { min-height: 44px; } }
.d-sec { display: grid; gap: 8px; min-width: 0; }
.d-sec .section-title { gap: 6px; }
.section-title .icon-btn.sm-ic { width: 28px; height: 28px; margin-left: auto; }
.desc { white-space: pre-wrap; font-size: 15px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.add-desc { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; font-size: 15px; padding: 6px 0; justify-self: start; }
.desc-edit { resize: none; min-height: 96px; }
.feed .thread { gap: 10px; }
.comment { min-width: 0; }
.comment .bubble { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.system { text-align: center; line-height: 1.35; padding: 0 8px; flex-wrap: wrap; justify-content: center; }
.comment.system .i { color: var(--faint); }
.gmini { display: inline-grid; color: var(--st-dot); }
.gmini .g { width: 14px; height: 14px; }
.comment.pending .bubble { opacity: .7; }
.c-sending, .c-fail { display: block; font-size: 12px; margin-top: 3px; text-align: right; color: var(--muted); }
.c-fail { color: var(--danger); }
.c-fail .linkbtn { font-size: 12px; padding: 0; color: inherit; text-decoration: underline; }
.history-toggle { width: 100%; text-align: left; margin-top: 6px; }
.detail .composer { flex: none; padding: 10px 12px calc(10px + var(--safe-bottom)); background: var(--elevated); }
.drawer.detail .composer { padding-bottom: 12px; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; padding: 10px 16px; border-radius: 22px; resize: none; line-height: 1.45; background: var(--surface-2); }
.composer .send-btn { flex: none; margin-bottom: 4px; transition: background var(--dur-2), transform var(--dur-1); }
.composer .send-btn:active { transform: scale(.92); }
.d-skel { display: grid; gap: 12px; }
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk.line { height: 12px; margin: 5px 0; }
.sk.line.tall { height: 22px; }
.sk.block { height: 110px; border-radius: 16px; }
.sk.block.short { height: 64px; }
.w90 { width: 90%; } .w80 { width: 80%; } .w70 { width: 70%; } .w60 { width: 60%; } .w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-list { display: grid; gap: 8px; }
.item.skel { pointer-events: none; box-shadow: var(--ring); }
.ind.sk { background: var(--surface-2); }

/* ---------- settings ---------- */
.settings { display: grid; gap: 18px; max-width: 680px; min-width: 0; }
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1), var(--ring); }
.profile b { display: block; font-size: 18px; font-weight: 700; }
.profile span { color: var(--muted); font-size: 14px; }
.group { display: grid; gap: 6px; min-width: 0; }
.group-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.group-foot { font-size: 13px; color: var(--muted); padding: 0 6px; }
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1), var(--ring); overflow: hidden; }
.lrow { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; text-align: left; font-size: 16px; color: var(--text); min-width: 0; }
.lrow + .lrow::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: 1px; background: var(--border); }
.lrow.tap { cursor: pointer; transition: background var(--dur-1); }
.lrow.tap:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.lrow.tap:active { background: var(--surface-2); }
.lr-lead { display: grid; place-items: center; min-width: 32px; color: var(--muted); flex: none; }
.lr-main { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.lr-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.lrow .chev { color: var(--faint); flex: none; }
.lrow.danger .lr-title, .lrow.danger .lr-lead { color: var(--danger); }
.lrow.off .lr-main, .lrow.off .lr-lead { opacity: .5; }
.fineprint { text-align: center; font-size: 12px; color: var(--faint); }
.page-hint { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 640px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; background: var(--surface); box-shadow: var(--shadow-1), var(--ring); }
.rep-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--stale-bg); color: var(--stale-fg); }
.rep-ic.off { background: var(--surface-2); color: var(--muted); }
.switch-btn { padding: 10px 4px; flex: none; }
.chips.wd .chip { min-width: 46px; justify-content: center; padding: 0 10px; }
.md-row { display: flex; align-items: center; gap: 10px; }
input.md-input { width: 96px; }
.report { display: grid; gap: 10px; }
textarea.report-text { min-height: 320px; resize: none; line-height: 1.55; }
.report-sheet .sheet-body { display: flex; flex-direction: column; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; min-height: var(--vh); display: grid; }
.login { width: 100%; max-width: 420px; margin: 0 auto; padding: calc(var(--safe-top) + 32px) 16px 32px; display: grid; gap: 20px; align-content: center; }
.login-brand { display: grid; justify-items: center; gap: 8px; text-align: center; }
.logo.lg { width: 60px; height: 60px; border-radius: 20px; margin-bottom: 6px; }
.logo.lg .i { width: 32px; height: 32px; stroke-width: 2.4; }
.login-brand h1 { font-size: 30px; letter-spacing: -.025em; }
.login-brand p { color: var(--muted); font-size: 15px; }
.login-card { display: grid; gap: 16px; padding: 20px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-2), var(--ring); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--text-2); line-height: 1.4; }
.steps b { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.steps code { font-size: 14px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.otp { position: relative; display: block; cursor: text; }
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 2; caret-color: transparent; min-height: 0; padding: 0; }
.otp-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-cells span { height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; transition: box-shadow var(--dur-1), background var(--dur-1); }
.otp-cells span.filled { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.otp-cells span.cur { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--focus); background: var(--surface); }
.login-foot { text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- toast host ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 90; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast-host .toast { pointer-events: auto; max-width: 560px; min-width: 0; padding: 6px 6px 6px 12px; }
.toast-msg { flex: 1; min-width: 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 6px 4px 6px 0; }
.toast .ok, .toast .bad { flex: none; }
.toast .bad { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: grid; place-items: center; }
.toast .undo { flex: none; white-space: nowrap; }
@media (max-width: 759px) { .toast-host { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); } }

/* ---------- empty state ---------- */
.empty { padding: 36px 16px; }
.empty > span { max-width: 340px; line-height: 1.45; }
.empty .btn { margin-top: 8px; }

/* ---------- misc ---------- */
@media (prefers-reduced-motion: reduce) { .item-wrap.leaving { transition: none; } }
.create { display: grid; gap: 14px; }
.create-seg.block { margin-top: 2px; }
.stat.mine .i { color: var(--accent); }
.stat.mine.on .i { color: inherit; }
.row-btns > .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chips.wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; overflow: visible; }
.chips.wd .chip { min-width: 0; padding: 0; justify-content: center; }
.lrow.wrap-sub .lr-sub { white-space: normal; }

/* one-time swipe hint */
.item-wrap.hint-swipe .swipe-bg { opacity: 1; }
.item-wrap.hint-swipe .sw-l { display: none; }
.item-wrap.hint-swipe .item { animation: nudge 1.1s var(--ease-out) .4s 1; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 35%, 55% { transform: translateX(64px); } }
.item.has-side { grid-template-columns: 32px minmax(0, 1fr) auto; }
.item-side { align-self: center; }
.item-side .item-actions { margin-top: 0; }
.prop .due { display: flex; flex-wrap: wrap; column-gap: 6px; }
.prop .due > span { white-space: nowrap; }
.sig { overflow: hidden; text-overflow: ellipsis; }
.switch { display: inline-block; vertical-align: middle; }
.switch-btn { display: inline-grid; place-items: center; }

/* ---------- права в карточке человека ---------- */
.perms { display: grid; gap: 10px; }
.perm-list { display: grid; gap: 6px; }
.perm-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); text-align: left; }
.perm-row .perm-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.perm-row .perm-txt b { font-weight: 500; font-size: 15px; }
.perm-row .perm-txt small { color: var(--text-3, var(--muted)); font-size: 12.5px; line-height: 1.3; }
.perm-row.locked { opacity: .7; }
.chip.ghosty { pointer-events: none; }
.chips.small .chip { font-size: 13px; min-height: 30px; padding: 4px 10px; }

/* ==========================================================================
   v3 — вложения · чек-лист · зависимости · прочтения · напоминания · «отложить»
        · голос · @упоминания · массовые действия · шаблоны · уведомления · журнал
   ========================================================================== */

/* ---------- row flags («2/5», скрепка, «ждёт #7», «не открывал(а)», «отложена») ---------- */
.item-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; min-width: 0; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1; }
.flag .i { width: 14px; height: 14px; stroke-width: 2; }
.flag.ck.full { color: var(--st-done-fg); }
.flag.wait, .flag.snz { height: 22px; padding: 0 8px 0 6px; border-radius: var(--r-pill); }
.flag.wait { background: var(--stale-bg); color: var(--stale-fg); }
.flag.snz { background: var(--surface-2); color: var(--text-2); }
.t-flags { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.t-flags .flag.wait, .t-flags .flag.snz { height: 20px; font-size: 12px; }
.bcard .flag { font-size: 12px; }
.bcard .flag.wait { height: 20px; }
.marker.wait { background: var(--stale-bg); color: var(--stale-fg); }
.item.blocked .ind { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--stale-fg); }

/* ---------- selection (bulk) ---------- */
.selbox { position: relative; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--surface); color: transparent; box-shadow: inset 0 0 0 1.8px var(--border-strong); transition: background var(--dur-1), box-shadow var(--dur-1), opacity var(--dur-1); }
.selbox .i { stroke-width: 2.8; }
button.selbox::after { content: ""; position: absolute; inset: -11px; }
.selbox:hover { box-shadow: inset 0 0 0 1.8px var(--accent); }
.picked .selbox, .picked > .ind.selbox { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.item .ind.selbox { width: 26px; height: 26px; margin: 3px; background: transparent; }
.item.picked .ind.selbox, .trow.picked .selbox, .bcard.picked .selbox { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.item .ind.selbox .i { width: 14px; height: 14px; }
.item.picked { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); }
.item .selbox.hov { position: absolute; left: -32px; top: 50%; margin-top: -11px; opacity: 0; }
.item:hover .selbox.hov, .item .selbox.hov:focus-visible { opacity: 1; }
body.bulk .item-wrap .swipe-bg { display: none; }
.trow .num.has-sel { position: relative; display: grid; justify-items: end; align-items: center; }
.trow .num.has-sel .selbox { grid-area: 1 / 1; justify-self: end; margin-right: -2px; }
.trow .num.has-sel .n-txt { grid-area: 1 / 1; }
.trow .num .selbox.hov { opacity: 0; }
.trow:hover .num .selbox.hov, .trow .num .selbox.hov:focus-visible { opacity: 1; }
.trow:hover .num.has-sel .n-txt { opacity: 0; }
.trow .num.picking .n-txt { display: none; }
.trow.picked { background: var(--accent-soft); }
.trow.picked::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.bcard.picked { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }

.bulkbar { position: fixed; z-index: calc(var(--z-tabbar) + 2); display: flex; align-items: center; gap: 4px;
  background: var(--elevated); box-shadow: var(--shadow-3), var(--ring); color: var(--text); animation: toast-in var(--dur-3) var(--ease-spring); }
.bb-top { display: contents; }
.bb-count { order: 0; display: inline-flex; align-items: baseline; gap: 5px; padding: 0 8px 0 6px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.bb-count b { font-size: 17px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.bb-all { order: 1; font-size: 13px; font-weight: 600; color: var(--accent-text); padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.bb-all:hover { background: var(--accent-soft); }
.bb-acts { order: 2; display: flex; gap: 2px; min-width: 0; }
.bb-top .spacer { display: none; }
.bb-x { order: 3; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.bb-x:hover { background: var(--surface-2); }
.bb-act { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 11px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; transition: background var(--dur-1), transform var(--dur-1); }
.bb-act .i { color: var(--muted); }
.bb-act:hover { background: var(--surface-2); }
.bb-act:active { transform: scale(.95); }
.bb-act.urgent .i { color: var(--urgent-fg); }
.bb-act[disabled] { opacity: .4; pointer-events: none; }
@media (min-width: 760px) {
  body { --bb-l: var(--sidebar-w); --bb-r: 0px; }
  body.rail { --bb-l: 68px; }
  body.has-panel { --bb-r: calc(var(--panel-w) + 12px); }
  .bulkbar { bottom: 20px; left: calc((var(--bb-l) + 100vw - var(--bb-r)) / 2); transform: translateX(-50%); padding: 6px 6px 6px 10px; border-radius: 18px; max-width: calc(100vw - var(--bb-l) - var(--bb-r) - 32px); }
  .bb-acts { border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0 4px; margin: 0 2px; }
  body.bulk .main { padding-bottom: 96px; }
  body.bulk .toast-host { bottom: 88px; }
}
@media (max-width: 759px) {
  .bulkbar { left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 8px calc(6px + var(--safe-bottom));
    border-radius: 20px 20px 0 0; background: color-mix(in srgb, var(--elevated) 94%, transparent); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); animation: sheet-in var(--dur-3) var(--ease-sheet); }
  .bb-top { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; min-height: 36px; }
  .bb-top .spacer { display: block; }
  .bb-x { color: var(--accent-text); padding: 0 8px; min-height: 36px; }
  .bb-acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
  .bb-act { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 0; font-size: 11.5px; border-radius: 12px; }
  .bb-act .i { width: 22px; height: 22px; color: var(--text-2); }
  .bb-act span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  body.bulk .bottomnav { display: none !important; }
  body.bulk .main { padding-bottom: calc(132px + var(--safe-bottom)); }
  body.bulk .toast-host { bottom: calc(118px + var(--safe-bottom)); }
}
.bulk-errs { display: grid; gap: 8px; }
.bulk-err { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.bulk-err b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.bulk-err span { font-size: 13px; color: var(--muted); }

/* ---------- detail: section headers ---------- */
.d-sec > .section-title { min-height: 32px; }
.section-title .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.section-title .spacer { flex: 1; }
.section-title .btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; gap: 5px; }
.att-add { display: flex; gap: 6px; }
.detail .drawer-body > .d-sec + .d-sec { margin-top: 2px; }

/* ---------- tools: напомнить / отложить ---------- */
.tools-sec { display: grid; gap: 10px; min-width: 0; }
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px 0 11px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; font-weight: 600; transition: background var(--dur-1), transform var(--dur-1); }
.tool-btn:hover { background: var(--surface-3); color: var(--text); }
.tool-btn:active { transform: scale(.96); }
.tool-btn .i { color: var(--muted); }
.rem-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 3px 0 11px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rem-x { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: inherit; opacity: .75; position: relative; }
.rem-x::after { content: ""; position: absolute; inset: -6px; }
.rem-x:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); opacity: 1; }
.snz-bar { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--stale-bg); color: var(--stale-fg); }
.snz-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 70%, transparent); flex: none; }
.snz-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.snz-txt b { font-size: 14px; font-weight: 650; }
.snz-txt small { font-size: 12.5px; color: inherit; opacity: .85; }
.snz-bar .btn { flex: none; background: var(--surface); color: var(--stale-fg); border-color: transparent; box-shadow: none; }


/* ---------- checklist ---------- */
.ck-prog { width: 64px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; flex: none; }
.ck-prog i { display: block; height: 100%; border-radius: 3px; background: var(--st-wip-dot); transition: width var(--dur-3) var(--ease-out); }
.ck-prog.full i { background: var(--st-done-dot); }
.ck-list { display: grid; gap: 0; padding: 4px; border-radius: var(--r-lg); background: var(--surface-2); }
.ck-row { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 12px; }
.ck-row + .ck-row::before { content: ""; position: absolute; top: 0; left: 42px; right: 10px; height: 1px; background: var(--border); }
.ck-box { position: relative; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; flex: none; display: inline-grid; place-items: center; background: var(--surface); color: transparent;
  box-shadow: inset 0 0 0 1.8px var(--border-strong); transition: background var(--dur-2) var(--ease-out), box-shadow var(--dur-1), transform var(--dur-1) var(--ease-spring); }
.ck-box .i { stroke-width: 2.8; width: 13px; height: 13px; }
button.ck-box::after { content: ""; position: absolute; inset: -11px; }
button.ck-box:hover { box-shadow: inset 0 0 0 1.8px var(--st-done-dot); }
button.ck-box:active { transform: scale(.88); }
.ck-box.on { background: var(--st-done-dot); color: #fff; box-shadow: none; }
.ck-box[disabled] { cursor: default; }
.ck-box.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); opacity: .7; }
.ck-box.sm { width: 16px; height: 16px; border-radius: 5px; margin-top: 0; box-shadow: inset 0 0 0 1.5px var(--border-strong); background: transparent; }
.ck-text { flex: 1; min-width: 0; text-align: left; font-size: 15px; line-height: 1.42; color: var(--text); overflow-wrap: anywhere; padding-top: 1px; }
button.ck-text { cursor: text; border-radius: 6px; }
.ck-row.done .ck-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.ck-by { flex: none; font-size: 12px; color: var(--muted); padding-top: 3px; }
.ck-row.editing, .ck-row.adding { align-items: center; padding-top: 5px; padding-bottom: 5px; }
.ck-input { flex: 1; min-width: 0; min-height: 36px !important; padding: 6px 10px; font-size: 16px; background: var(--surface); }
.ck-tools { display: flex; gap: 0; flex: none; }
.ck-tools .icon-btn { width: 32px; height: 32px; }
.ck-tools .icon-btn.danger { color: var(--danger); }
.ck-tools .icon-btn[disabled] { opacity: .3; }
.ck-add { display: inline-flex; align-items: center; gap: 8px; justify-self: start; color: var(--accent-text); font-weight: 600; font-size: 15px; padding: 6px 2px; }
.ck-sec > .ck-row.adding { background: var(--surface-2); border-radius: 14px; }
.ck-list + .ck-row.adding { margin-top: -2px; }

/* ---------- dependencies ---------- */
.dep-group { display: grid; gap: 6px; min-width: 0; }
.dep-group + .dep-group { margin-top: 4px; }
.dep-label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 2px; }
.dep-group.waiting { padding: 10px; border-radius: var(--r-lg); background: var(--stale-bg); }
.dep-group.waiting .dep-label { color: var(--stale-fg); }
.dep { display: flex; align-items: center; min-width: 0; border-radius: 12px; background: var(--surface-2); }
.dep-group.waiting .dep { background: var(--surface); box-shadow: var(--shadow-1); }
.dep-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; text-align: left; border-radius: 12px; }
.dep-main:hover { background: color-mix(in srgb, var(--surface-3) 50%, transparent); }
.dep-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; font-weight: 600; }
.dep-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep .av { box-shadow: none; }
.dep.done .dep-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.dep-x { width: 32px; height: 32px; margin-right: 4px; color: var(--muted); flex: none; }
.dep-sec .hint { font-size: 13px; }
.dep-form { gap: 10px; }
.dep-form .input-icon input { background: var(--surface-2); }
.dep-pl { gap: 0; }
.dep-pl .pl-row { min-height: 50px; }
.dep-pl-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.dep-pl-t b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dep-err { margin-top: 0; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft); }
.modal.dep-sheet { height: min(640px, calc(100vh - 48px)); }

/* ---------- attachments ---------- */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.att-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: var(--ring); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-3) var(--ease-out); }
.att-thumb:hover img { transform: scale(1.04); }
.att-thumb:active { transform: scale(.97); }
.att-badge { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--accent); box-shadow: var(--shadow-1); }
.att-item { border-radius: 14px; background: var(--surface-2); min-width: 0; }
.att-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 6px 8px 10px; border-radius: 14px; cursor: pointer; min-width: 0; transition: background var(--dur-1); }
.att-row:hover { background: var(--surface-3); }
.att-item.up .att-row, .att-item.expired .att-row { cursor: default; }
.att-item.up .att-row:hover { background: transparent; }
.att-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; background: var(--surface-3); color: var(--text-2); }
.att-ic.k-pdf { background: var(--urgent-bg); color: var(--urgent-fg); }
.att-ic.k-xls { background: var(--st-done-bg); color: var(--st-done-fg); }
.att-ic.k-doc { background: var(--st-wip-bg); color: var(--st-wip-fg); }
.att-ic.k-ppt { background: var(--st-to_check-bg); color: var(--st-to_check-fg); }
.att-ic.k-link { background: var(--accent-soft); color: var(--accent-text); }
.att-ic.k-img { background: var(--stale-bg); color: var(--stale-fg); }
.att-ic.k-up { background: var(--surface); color: var(--accent); }
.att-item.failed .att-ic.k-up { color: var(--danger); background: var(--danger-soft); }
.att-main { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.att-name { font-size: 14.5px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-main small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-main small.err { color: var(--danger); white-space: normal; }
.att-item.expired .att-name { color: var(--muted); }
.att-sum-btn { flex: none; color: var(--accent-text); padding: 0 10px; min-height: 32px; gap: 5px; }
.att-sum-btn .i { color: var(--accent); }
.att-more { flex: none; color: var(--muted); }
.att-prog { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.att-prog i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .2s linear; }
.att-pct { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-right: 8px; flex: none; }
.att-sum { display: flex; gap: 8px; margin: 0 8px 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: 14px; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.att-sum > .i { color: var(--accent); margin-top: 3px; flex: none; }
.att-empty { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--border-strong); color: var(--text-2); text-align: left; font-size: 14.5px; font-weight: 500; transition: background var(--dur-1), border-color var(--dur-1); }
.att-empty:hover { background: var(--surface-2); border-color: var(--accent); }
.att-empty > span { display: grid; gap: 2px; }
.att-empty small { font-size: 12.5px; font-weight: 400; }
.att-empty .i { color: var(--accent); flex: none; }
.drawer.detail:not(.float) { position: relative; }
.detail.drop-on::after { content: "Отпусти — прикреплю к задаче"; position: absolute; inset: 8px; z-index: 6; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 18px;
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--accent-text); font-weight: 650; font-size: 16px; pointer-events: none; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: calc(var(--z-overlay) + 8); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(12, 12, 16, .95); color: #fff; animation: fade var(--dur-2) var(--ease-out); }
.lb.out { opacity: 0; transition: opacity .15s; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 10px) 12px 8px 18px; min-width: 0; }
.lb-title { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.lb-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { font-size: 12.5px; opacity: .65; font-variant-numeric: tabular-nums; }
.lb-x { color: #fff; background: rgba(255, 255, 255, .12); width: 40px; height: 40px; }
.lb-x:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 8px; touch-action: none; overflow: hidden; }
/* картинка вписывается в сцену по центру при любых пропорциях (длинный скриншот с телефона, панорама) */
.lb-img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 16px); max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.lb-nav { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; transition: background var(--dur-1); }
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
@media (hover: none) { .lb-nav { display: none; } }
.lb-cap { display: grid; gap: 10px; width: 100%; max-width: 760px; justify-self: center; padding: 12px 16px calc(14px + var(--safe-bottom)); }
.lb-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .8; min-width: 0; }
.lb-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-meta .av { box-shadow: none; }
.lb-sum { display: flex; gap: 8px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .09); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; max-height: 30vh; overflow: auto; }
.lb-sum > .i { color: #A7B0FF; margin-top: 3px; flex: none; }
.lb-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.lb-btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: transparent; box-shadow: none; min-height: 38px; }
.btn.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.btn.lb-btn.danger { color: #FF9C91; }
.btn.lb-btn.confirm { background: #C0372F; color: #fff; }

/* ---------- comments: mentions, voice, attachments ---------- */
.mention { color: var(--accent-text); font-weight: 600; }
.mention.soft { font-weight: 500; }
.mention.me { background: var(--st-to_check-bg); color: var(--st-to_check-fg); border-radius: 6px; padding: 0 3px; margin: 0 -1px; }
.comment.mentions-me .bubble { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--st-to_check-dot) 55%, transparent); }
.c-body { min-width: 0; }
.c-mic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); margin-right: 6px; vertical-align: -4px; }
.comment.mine .c-mic { background: var(--surface); color: var(--accent-text); }
.c-kind { color: var(--muted); }
.c-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.comment.mine .c-atts { justify-content: flex-end; }
.c-thumb { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: var(--ring); }
.c-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 12px 5px 5px; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--text); min-width: 0; }
.c-file span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-file .att-ic { width: 28px; height: 28px; border-radius: 8px; font-size: 8.5px; }
.bubble.voice-pending { display: inline-flex; align-items: center; gap: 10px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.vp-dots { display: inline-flex; gap: 3px; }
.vp-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: vp 1s ease-in-out infinite; }
.vp-dots i:nth-child(2) { animation-delay: .15s; } .vp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes vp { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- composer: clip, mic, recording, @-popup ---------- */
.composer { position: relative; }
.comp-clip { flex: none; width: 40px; height: 40px; margin-bottom: 2px; color: var(--muted); }
.send-btn.mic { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; flex: none; margin-bottom: 4px; transition: transform var(--dur-1); }
.send-btn.mic:active { transform: scale(.9); }
.composer.rec > :not(.rec-bar):not(.mention-pop) { display: none !important; }
.rec-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.rec-cancel { flex: none; width: 40px; height: 40px; color: var(--danger); background: var(--danger-soft); }
.rec-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--urgent-bg); color: var(--urgent-fg); overflow: hidden; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; animation: pulse 1.1s ease-in-out infinite; }
.rec-time { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; flex: none; min-width: 36px; }
.rec-wave { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; height: 22px; overflow: hidden; }
.rec-wave i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; opacity: .5; flex: none; transform-origin: center; animation: wave .9s ease-in-out infinite alternate; }
@keyframes wave { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.rec-hint { display: none; }
.rec-send { flex: none; width: 40px; height: 40px; }
.mention-pop { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 8; max-height: 280px; overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--elevated); box-shadow: var(--shadow-3), var(--ring); animation: pop-in .12s var(--ease-out); }
.mp-head { display: flex; align-items: center; gap: 6px; padding: 4px 8px 6px; font-size: 12px; color: var(--muted); }
.mp-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border-radius: 10px; text-align: left; }
.mp-row.on, .mp-row:hover { background: var(--surface-2); }
.mp-row .av { box-shadow: none; }
.mp-name { font-size: 15px; font-weight: 600; }
.mp-row small { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mic-denied { display: flex; gap: 12px; align-items: flex-start; text-align: left; }
.md-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--urgent-bg); color: var(--urgent-fg); flex: none; }
.mic-denied p { font-size: 15px; line-height: 1.5; color: var(--text-2); }

/* ---------- create: templates, checklist ---------- */
.tpl-slot:empty { display: none; }
.tpl-entry { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); text-align: left; min-width: 0; transition: background var(--dur-1); }
.tpl-entry:hover { background: var(--surface-3); }
.tpl-ic, .tpl-tile { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.tpl-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; font-size: 15px; font-weight: 600; }
.tpl-txt small { font-size: 12.5px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-entry .chev { color: var(--faint); }
.tpl-on { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; min-width: 0; }
.tpl-on > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-on b { font-weight: 650; }
.tpl-on .icon-btn { color: inherit; width: 32px; height: 32px; }
.pl-lead.tpl { background: var(--accent-soft); color: var(--accent-text); }
.cf { display: grid; gap: 2px; padding: 10px 12px 6px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.cf-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.cf-row { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 15px; min-width: 0; }
.cf-row .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cf-row .icon-btn { width: 30px; height: 30px; color: var(--muted); flex: none; }
.cf-add { display: flex; align-items: center; gap: 10px; color: var(--muted); min-width: 0; }
.cf-add input { flex: 1; min-width: 0; min-height: 38px; padding: 4px 0; background: transparent; border: 0; border-radius: 0; font-size: 16px; }
.cf-add input:hover, .cf-add input:focus { background: transparent; box-shadow: none; border: 0; }
.qa-ck { display: grid; gap: 1px; padding: 8px 10px 6px; border-radius: 12px; background: var(--surface-2); }
.qa-ck-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.qa-ck-row { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 14px; color: var(--text-2); }
.qa-ck-row .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qa-ck-x { width: 28px; height: 28px; color: var(--muted); flex: none; }

/* ---------- search results with snippets ---------- */
mark { background: color-mix(in srgb, var(--st-to_check-dot) 36%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sres-extra { display: grid; gap: 6px; margin-top: 8px; justify-items: start; min-width: 0; }
.snips { display: grid; gap: 5px; width: 100%; min-width: 0; }
.snip { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); min-width: 0; }
.snip-k { display: inline-flex; align-items: center; gap: 4px; flex: none; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 2px; }
.snip-v { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (max-width: 759px) { .snip-k span { display: none; } }
@media (min-width: 760px) { .sres-list { max-width: 880px; } .snip-k { width: 104px; } }
.srch-spin { display: inline-flex; color: var(--accent); margin-left: 4px; }
.search-hint.small { padding: 16px; }

/* ---------- snoozed link / sheet ---------- */
.snz-link { color: var(--muted); font-size: 14px; font-weight: 600; width: 100%; }
.snz-link .i { color: var(--stale-fg); }
.snz-hint { margin-bottom: 10px; }
.pl-note { font-size: 12.5px; color: var(--muted); line-height: 1.4; padding: 8px 10px 4px; }

/* ---------- settings: notifications ---------- */
.nt-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); transition: background var(--dur-2), color var(--dur-2); }
.nt-ic.off { background: var(--surface-2); color: var(--muted); }
.lrow.nt-row .lr-title { white-space: normal; }
.nt-times { min-height: 56px; padding-left: 58px !important; }
.nt-times .lr-lead { display: none; }
@media (max-width: 400px) { .nt-times { padding-left: 14px !important; } }
.nt-t { flex: 1; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.nt-t label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
input.nt-time { width: 136px; min-height: 40px; font-size: 16px; font-variant-numeric: tabular-nums; }
.lrow.nt-mode { padding-top: 10px; padding-bottom: 10px; }
.nt-mode .seg { width: 100%; }
.lrow.nt-hours { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 12px; }
.nt-lbl { font-size: 15px; color: var(--muted); }
.lrow.nt-hours .chips { flex: 1; min-width: 0; }
.lrow.nt-hours .chip { min-height: 34px; padding: 0 12px; }
.settings .group-foot { line-height: 1.45; }

/* ---------- settings: куда присылать · это устройство (pwa.js) ---------- */
.lrow.pw-mode { padding-top: 10px; padding-bottom: 10px; }
.pw-mode .seg { width: 100%; }
.pw-seg button { min-width: 0; padding: 0 8px; }
.lrow.pw-warn { min-height: 0; padding-top: 10px; padding-bottom: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--st-to_check-fg); background: var(--st-to_check-bg); }
.lrow.pw-warn .lr-lead { color: inherit; min-width: 24px; padding-top: 1px; }
.lrow.pw-warn .lr-main { display: block; }
.pw-card { display: grid; gap: 14px; padding: 16px; min-width: 0; }  /* inside .list (group) */
.pw-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.pw-ic { width: 36px; height: 36px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.pw-ic.ok { background: var(--st-done-bg); color: var(--st-done-fg); }
.pw-card.warn .pw-ic { background: var(--st-to_check-bg); color: var(--st-to_check-fg); }
.pw-card.muted .pw-ic { background: var(--surface-2); color: var(--muted); }
.pw-tx { display: grid; gap: 3px; min-width: 0; font-size: 14.5px; line-height: 1.45; color: var(--text-2); }
.pw-tx > b { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.35; }
.pw-card.on .pw-tx > b { color: var(--st-done-fg); }
.pw-tx b b, .pw-tx span b { font-weight: 600; color: var(--text); }
.pw-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-btns .btn { flex: 1 1 auto; }
.pw-off { color: var(--muted); }
.pw-off:hover { color: var(--danger); }
.pw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pw-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 15px; line-height: 1.35; color: var(--text-2); min-width: 0; }
.pw-step > b { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.pw-step-tx { flex: 1; min-width: 0; }
.pw-step-tx b { color: var(--text); font-weight: 600; }
.pw-art { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-1), var(--ring); }
.pw-art .i-sm { width: 20px; height: 20px; }
.pw-art .logo.pw-mini { width: 38px; height: 38px; border-radius: 11px; box-shadow: none; }
.pw-art .logo.pw-mini .i { width: 20px; height: 20px; }
.pw-enable { margin-top: 2px; }

/* ---------- login в приложении с экрана «Домой» ---------- */
.pw-flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 2px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.pw-flow > span { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: var(--r-pill); background: var(--surface-2); white-space: nowrap; }
.pw-flow code { font-size: 13.5px; }
.pw-flow .pw-arr { font-style: normal; color: var(--muted); padding: 0 1px; }
.pw-login-row { display: flex; gap: 8px; }
.pw-login-row .btn { flex: 1; }
.pw-login-note { font-size: 13px; color: var(--muted); line-height: 1.45; text-align: center; }

/* ---------- settings: templates / reminders ---------- */
.tpl-use { flex: none; }
.rem-tile { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--st-to_check-bg); color: var(--st-to_check-fg); flex: none; }
.rem-del { color: var(--muted); flex: none; }
.rem-del:hover { color: var(--danger); }
textarea.tpl-ck { resize: none; line-height: 1.55; min-height: 110px; }

/* ---------- audit log ---------- */
.au-filters { display: grid; gap: 10px; min-width: 0; }
.au-q input { background: var(--surface); box-shadow: var(--shadow-1), var(--ring); border-radius: var(--r-pill); min-height: 44px; }
.au-q input:focus { box-shadow: 0 0 0 4px var(--focus); }
.au-chips .chip.select.on { background: var(--text); color: var(--bg); }
.au-chips .chip.select.on .i-xs { color: inherit; }
.au-chips .chip .av.xs { margin-left: -8px; box-shadow: none; }
.au-list { display: grid; gap: 8px; min-width: 0; }
.au-day { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 6px 0; }
.au-card { overflow: hidden; }
.au-row { position: relative; display: grid; grid-template-columns: 42px 26px minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 11px 14px; min-width: 0; }
.au-row + .au-row::before { content: ""; position: absolute; top: 0; left: 92px; right: 0; height: 1px; background: var(--border); }
.au-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.au-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.au-ic.a-task_view, .au-ic.a-attach_download { background: var(--st-wip-bg); color: var(--st-wip-fg); }
.au-ic.a-task_create, .au-ic.a-comment, .au-ic.a-attach_upload, .au-ic.a-attach_link { background: var(--st-done-bg); color: var(--st-done-fg); }
.au-ic.a-task_delete, .au-ic.a-attach_delete, .au-ic.a-login_failed { background: var(--urgent-bg); color: var(--urgent-fg); }
.au-ic.a-login, .au-ic.a-export, .au-ic.a-report_make, .au-ic.a-report_send { background: var(--stale-bg); color: var(--stale-fg); }
.au-ic.a-task_status, .au-ic.a-task_assign, .au-ic.a-bulk { background: var(--st-to_check-bg); color: var(--st-to_check-fg); }
.au-main { min-width: 0; display: grid; gap: 2px; }
.au-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 14.5px; line-height: 1.35; }
.au-who { display: inline-flex; align-items: center; gap: 6px; }
.au-who b { font-weight: 600; }
.au-who .av { box-shadow: none; }
.au-who.anon { color: var(--muted); }
.au-act { color: var(--text-2); }
.au-row.bad .au-act { color: var(--danger); font-weight: 600; }
.au-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.au-task { color: var(--accent-text); font-size: 13.5px; text-align: left; min-width: 0; overflow-wrap: anywhere; border-radius: 6px; }
.au-task:hover { text-decoration: underline; text-underline-offset: 2px; }
.au-task b { font-variant-numeric: tabular-nums; font-weight: 600; }
.au-target { color: var(--text-2); overflow-wrap: anywhere; }
.au-detail { overflow-wrap: anywhere; min-width: 0; }
.au-ip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 4px; }
.au-more { display: flex; justify-content: center; padding: 6px 0 12px; }
@media (max-width: 759px) {
  .au-row { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 11px 12px; }
  .au-row + .au-row::before { left: 48px; }
  .au-time { grid-column: 3; grid-row: 1; padding-top: 3px; font-size: 12.5px; }
  .au-ic { grid-column: 1; grid-row: 1 / span 2; }
  .au-main { grid-column: 2; grid-row: 1 / span 2; }
  .au-ip { display: none; }
}

/* archive / delete at the bottom of a task */
.d-danger { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.d-danger .btn { gap: 6px; }
.d-danger .btn.danger-txt { color: var(--danger); }
.d-danger .btn.danger-txt:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.sheet .grabber { position: relative; }
.sheet .grabber::after { content: ""; position: absolute; left: -60px; right: -60px; top: -10px; bottom: -12px; }

/* «Из WhatsApp» */
.share .sh-step .sh-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft, var(--surface-2)); color: var(--accent); font-weight: 700; font-size: 14px; }
.share .sh-step .btn { flex: none; }
.share .sh-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .02em; }
.share .sh-how { display: grid; gap: 10px; padding: 14px 16px; margin: 4px 0 18px; border-radius: var(--r-lg, 16px); background: var(--elevated); box-shadow: 0 0 0 1px var(--border); }
.share .sh-how-row { display: flex; gap: 10px; align-items: flex-start; line-height: 1.35; color: var(--text-2); }
.share .sh-how-row .i { flex: none; margin-top: 2px; color: var(--accent); }
.share .sh-how-row b { color: var(--text); font-weight: 600; }
.share .lrow.danger .lr-title { color: var(--danger); }
.share .lr-sub { white-space: normal; }

/* «назначено автоматически» (исполнителя выбрал Claude) и «Не моя задача» */
.marker.auto { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.act-auto { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--text-2); }
.act-auto .i { flex: none; margin-top: 2px; color: var(--accent); }
.act-btns .act-decline { color: var(--text-2); margin-left: auto; }

/* ---------- персональные данные: экран согласия, «Мои данные», удаление ---------- */
.consent .login-brand h1 { font-size: 24px; line-height: 1.2; }
.consent .login-card { gap: 14px; }
.cs-lead { font-size: 15px; line-height: 1.45; color: var(--text); margin: 0; }
.cs-list { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.cs-list li::marker { color: var(--accent); }
.cs-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; }
.cs-links a, .cs-links .linkbtn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); text-decoration: none; font: inherit; }
.consent .btn.danger-txt { color: var(--danger); }
.consent .linkbtn.center { justify-self: center; }
.erase-list { margin: 0 0 14px; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.erase-sheet input { text-transform: uppercase; letter-spacing: .08em; }
.cs-name { display: grid; gap: 6px; }
.cs-name-l { font-size: 14px; font-weight: 600; color: var(--text); }
.cs-name input { font-size: 16px; }
.cs-name small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.cs-name .field-err { margin-top: 0; }
.cs-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--st-to_check-bg); color: var(--st-to_check-fg); font-size: 14px; line-height: 1.4; }

/* ---------- iPhone in landscape: keep everything clear of the Dynamic Island / notch and the home indicator ---------- */
@media (min-width: 760px) {
  .shell { padding-left: var(--safe-l); padding-right: var(--safe-r); }
  .shell > .side { padding-bottom: calc(18px + var(--safe-bottom)); }
  .drawer.float { right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-bottom)); width: min(var(--panel-w), calc(100vw - 24px - var(--safe-l) - var(--safe-r))); }
  body { --bb-l: calc(var(--sidebar-w) + var(--safe-l)); --bb-r: var(--safe-r); }
  body.rail { --bb-l: calc(68px + var(--safe-l)); }
  body.has-panel { --bb-r: calc(var(--panel-w) + 12px + var(--safe-r)); }
  .bulkbar { bottom: calc(20px + var(--safe-bottom)); }
  .toast-host { bottom: calc(24px + var(--safe-bottom)); }
}
/* short landscape screens: a tighter sticky head so the list keeps its room */
@media (min-width: 760px) and (max-height: 520px) {
  .main { padding-top: 10px; }
  .page-head { margin-top: -10px; padding-top: 10px; }
}
@media (max-width: 759px) {
  .main { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
  .m-bar { margin-left: calc(-16px - var(--safe-l)); margin-right: calc(-16px - var(--safe-r)); padding-left: calc(16px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
  .bottomnav { padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r)); }
}
.toast-host { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
.modal-wrap { padding: 24px calc(24px + var(--safe-r)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-l)); }
.lb-top { padding-left: calc(18px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
.lb-cap { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
.lb-nav.prev { left: calc(14px + var(--safe-l)); } .lb-nav.next { right: calc(14px + var(--safe-r)); }

/* ---------- скрытые задачи ---------- */
.lock-mark { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--text-2); }
.lock-mark .i { width: 14px; height: 14px; stroke-width: 2.1; }
.t-title .lock-mark { flex: none; margin-right: 0; }
.d-title-row { display: flex; align-items: flex-start; gap: 8px; }
.d-title-row .lock-mark { margin: 5px 0 0; }
.d-title-row .lock-mark .i { width: 18px; height: 18px; }
.d-title-row .d-title { flex: 1; min-width: 0; }
.sig.lock { color: var(--text); font-weight: 600; }
.v-stack { display: grid; gap: 2px; min-width: 0; }
.prop-sub { font-size: 12px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.prop.hide-row { align-items: center; }
.pick.hidden-on { background: var(--text); color: var(--bg); box-shadow: none; }
.pick.hidden-on .i { color: inherit; }
.hide-row .switch.on { background: var(--text); }
