/* ==========================================================================
   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);
  --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; }
}

/* 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; }
