/* Размеры сняты с кадров референса при ширине экрана 440pt. Монохромная палитра; геометрия референса сохранена. */
:root {
  --ink: #0d0d0d;
  --text: #1f1f1f;
  --text-2: #5c5c5c;
  --muted: #a3a3a3;
  --muted-2: #c7c7c7;
  --line: #e6e6e6;
  --card: #efefef;
  --card-2: #f6f6f6;
  --page: #fafafa;
  --white: #ffffff;
  --dark: #161616;
  --dark-btn: #2b2b2b;
  --dark-line: #333333;
  --off: #d9d9d9;
  /* Аватары — единственный цвет в интерфейсе: приглушённые тона одной светлоты, чтобы не спорить с ч/б. */
  --avatar-0-start: #cf9a86;
  --avatar-0-end: #b9806b;
  --avatar-1-start: #d2b07c;
  --avatar-1-end: #bb9762;
  --avatar-2-start: #9db896;
  --avatar-2-end: #839f7c;
  --avatar-3-start: #8db5b1;
  --avatar-3-end: #739c98;
  --avatar-4-start: #98add0;
  --avatar-4-end: #7e93b9;
  --avatar-5-start: #ad9fce;
  --avatar-5-end: #9485b7;
  --avatar-6-start: #cd9db0;
  --avatar-6-end: #b68398;
  --page-90: rgba(250,250,250,.9);
  --page-92: rgba(250,250,250,.92);
  --page-clear: rgba(250,250,250,0);
  --chip-bg: rgba(246,246,246,.86);
  --chip-active: rgba(230,230,230,.94);
  --dark-clear: rgba(22,22,22,0);
  --shadow-03: rgba(0,0,0,.03);
  --shadow-04: rgba(0,0,0,.04);
  --shadow-05: rgba(0,0,0,.05);
  --shadow-06: rgba(0,0,0,.06);
  --shadow-08: rgba(0,0,0,.08);
  --shadow-09: rgba(0,0,0,.09);
  --shadow-10: rgba(0,0,0,.1);
  --shadow-12: rgba(0,0,0,.12);
  --shadow-18: rgba(0,0,0,.18);
  --shadow-20: rgba(0,0,0,.2);
  --shadow-32: rgba(0,0,0,.32);
  --shadow-55: rgba(0,0,0,.55);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 420ms;
  --dur-draw: 720ms;
  --dur-loop: 1260ms;
  --intro-min: 1120ms;
  --stagger: 18ms;
  --stagger-max: 90ms;
  --intro-back-delay: 20ms;
  --intro-mid-delay: 90ms;
  --intro-name-delay: 320ms;
  --intro-letter-step: 36ms;
  --intro-check-delay: 600ms;
  --intro-strike-delay: 820ms;
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.22,1.12,.36,1);
  --top: calc(max(var(--tg-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --hdr: calc(var(--top) + 104px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Inter, Arial, sans-serif, "Apple Color Emoji", "Noto Color Emoji";
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--dark); overscroll-behavior: none; }
body { font-family: var(--font); font-variant-numeric: tabular-nums; color: var(--text); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
input, textarea, select { accent-color: var(--ink); caret-color: var(--ink); }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--line); color: var(--ink); }
button { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); border: 0; background: none; padding: 0; cursor: pointer; }
svg { display: block; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; height: var(--tg-viewport-stable-height, 100%); overflow: hidden; }

/* ---------- светлый контейнер ---------- */
.page {
  position: relative; flex: 1 1 0; min-height: 0; background: var(--page);
  border-radius: 0 0 32px 32px; overflow: hidden;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
#app.collapsed .page { flex: 0 0 calc(var(--top) + 67px); }

.hdr {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding-top: var(--top);
  pointer-events: none; text-align: center;
}
.hdr::before {
  content: ""; position: absolute; inset: 0 0 -22px 0; z-index: -1;
  background: linear-gradient(to bottom, var(--page) 0, var(--page) calc(var(--top) + 30px), var(--page-90) calc(var(--top) + 64px), var(--page-clear) 100%);
}
.hdr > * { pointer-events: auto; }
.title { margin: 0; font-size: 19px; line-height: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.2px; }
.sub { margin-top: 1px; font-size: 15px; line-height: 20px; color: var(--muted-2); font-weight: 500; }
.seg {
  position: relative; display: inline-flex; gap: 0; margin-top: 18px; padding: 3px; border-radius: 20px;
  background: var(--white); box-shadow: 0 10px 34px var(--shadow-09), 0 1px 3px var(--shadow-04);
}
.seg button { width: 50px; height: 29px; border-radius: 15px; display: grid; place-items: center; color: var(--muted); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.seg button.on { background: var(--card); color: var(--ink); }
.seg button + button { margin-left: 8px; }
.seg svg { width: 21px; height: 21px; }
.hdr.no-seg .seg { display: none; }

.scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: calc(var(--top) + 100px) 16px 120px; overscroll-behavior: contain;
}
.hdr.no-seg + .scroll { padding-top: calc(var(--top) + 59px); }
.page::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; pointer-events: none; z-index: 4;
  background: linear-gradient(to bottom, var(--page-clear), var(--page-92));
}

/* ---------- задачи ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.task, .task-delete-ghost {
  position: relative; display: flex; align-items: center; min-height: 63px; padding: 12px 16px 12px 0;
  background: var(--card); border-radius: 17px; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.chk { flex: none; width: 48px; align-self: stretch; display: grid; place-items: center; }
.chk i { width: 20px; height: 20px; border-radius: 50%; border: 1.3px solid var(--off); display: grid; place-items: center; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.chk svg { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); width: 12px; height: 12px; opacity: 0; color: var(--white); }
.task.done .chk i { background: var(--ink); border-color: var(--ink); }
.task.done .chk svg { opacity: 1; }
.tx { flex: 1; min-width: 0; padding-right: 12px; cursor: pointer; }
.tt { font-size: 15px; line-height: 18px; color: var(--text); overflow-wrap: anywhere; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.td { margin-top: 5px; font-size: 13px; line-height: 16px; color: var(--muted); }
.td.over { color: var(--ink); font-weight: 600; }
/* закреплённая задача: маленькая булавка перед датой, высота строки не меняется */
/* только что добавленная задача: короткая подсветка карточки */
.task.flash::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--white); box-shadow: inset 0 0 0 1px var(--muted-2); pointer-events: none; animation: taskflash var(--dur-slow) var(--ease); opacity: 0; }
@keyframes taskflash { from { opacity: .55; } to { opacity: 0; } }
.td .pin { display: inline-block; width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; color: var(--ink); }
.td .pin svg { width: 100%; height: 100%; }
.task { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.td.over::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 5px; border-radius: 50%; background: var(--ink); vertical-align: 2px; }
.task.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.task.done .td { opacity: .6; }
.av { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: visible; }
.av .face { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: var(--white); font-size: 16px; font-weight: 500; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Буквенный аватар: стрелка «открыть сообщение» — значком в углу, чтобы не налезать на букву. */
.av .go { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; padding: 3.5px; border-radius: 50%; background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
/* Фото: как в видео — белая стрелка по центру. */
.av:has(.face img) .go { right: auto; bottom: auto; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0; background: none; color: var(--white); box-shadow: none; filter: drop-shadow(0 0 2px var(--shadow-55)); }
.av .face.me { background: var(--line); color: var(--muted); }

.skel { background-size: 200% 100%; animation: shimmer var(--dur-loop) ease-in-out infinite; height: 96px; border-radius: 17px; border: 1px solid var(--line); background-image: linear-gradient(100deg, var(--card-2) 20%, var(--card) 45%, var(--card-2) 70%); }
.skel + .skel { margin-top: 10px; }

.fab {
  position: absolute; z-index: 6; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--white); display: grid; place-items: center; color: var(--ink);
  box-shadow: 0 8px 26px var(--shadow-12), 0 1px 2px var(--shadow-06);
}
.fab svg { width: 20px; height: 20px; }

/* ---------- пустые состояния ---------- */
.empty { padding-top: 26px; text-align: center; color: var(--text-2); font-size: 15px; line-height: 20px; }
.empty .note { color: var(--muted); font-size: 13px; line-height: 17px; margin: 8px auto 0; max-width: 300px; }
.dark-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 18px; margin-top: 18px;
  border-radius: 21px; background: var(--ink); color: var(--white); font-size: 15px; font-weight: 500;
  box-shadow: 0 10px 28px var(--shadow-18);
}
.dark-btn svg { width: 14px; height: 14px; }
.dark-btn[disabled] { opacity: .5; }
.link-btn { color: var(--text-2); font-size: 14px; padding: 8px 10px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--off); border-top-color: var(--text-2); animation: spin var(--dur-draw) linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- бриф ---------- */
.sec-h { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 15px; line-height: 20px; color: var(--muted); margin: 4px 0 14px; }
.sec + .sec { margin-top: 26px; }
/* важность в монохроме: «срочно» — темнее и плотнее, «не срочно» — тише; геометрия карточек та же */
.cat-attention .sec-h { color: var(--ink); }
.cat-attention .btext { color: var(--ink); font-weight: 500; }
.cat-minor .sec-h { color: var(--muted-2); }
.cat-minor .bcard { background: var(--card-2); }
.cat-minor .btext { color: var(--text-2); }
.cat-minor .spill { background: var(--card); }
.bcard { padding: 14px 16px 13px; background: var(--card); border-radius: 17px; }
.bcard + .bcard { margin-top: 14px; }
.btext { font-size: 15px; line-height: 18px; color: var(--text); overflow-wrap: anywhere; }
.spill { display: inline-flex; align-items: center; max-width: 100%; height: 26px; margin-top: 12px; padding: 0 10px; border-radius: 13px; background: var(--card-2); color: var(--muted); font-size: 13px; text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bmeta { text-align: center; color: var(--muted-2); font-size: 12px; line-height: 16px; margin-top: 22px; }
.bstate { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 16px; }
.bstate .spin { width: 14px; height: 14px; }
.bstate.err { color: var(--text-2); }
.chips {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 22px; display: flex; gap: 10px; padding: 0 16px 0 18px;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 0 13px 0 10px; border-radius: 19px;
  background: var(--chip-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--muted); font-size: 15px;
  box-shadow: 0 2px 10px var(--shadow-04);
}
.chips button.on { background: var(--chip-active); color: var(--text); }
.em { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 17px; height: 17px; line-height: 1; }
.em svg { width: 17px; height: 17px; }

/* ---------- выбор чатов ---------- */
.chatcard {
  position: relative; display: flex; flex-direction: column; background: var(--white); border-radius: 24px;
  margin: 0 8px; height: max(360px, calc(var(--page-h, 760px) - var(--top) - 108px));
  box-shadow: 0 14px 44px var(--shadow-06), 0 1px 3px var(--shadow-03);
}
.chips-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 18px 16px 51px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 8px; mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 40px), transparent); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; max-width: 100%; padding: 0 10px 0 0; border-radius: 14px; background: var(--card-2); cursor: pointer; }
.chip .cav { flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: var(--white); font-size: 13px; font-weight: 500; }
.chip .cav img { width: 100%; height: 100%; object-fit: cover; }
.chip .cn { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: lowercase; }
.chip.paused { opacity: .45; }
.chip .st { width: 6px; height: 6px; border-radius: 50%; flex: none; margin-left: -1px; }
.chip .st.err { background: var(--ink); }
.chip .st.sync { background: var(--muted); animation: pulse var(--dur-loop) ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.addrow { flex: none; text-align: left; padding: 10px 16px 17px; color: var(--muted-2); font-size: 17px; }

.connect { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px; text-align: center; }
.connect h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--ink); }
.connect p { margin: 0 auto; max-width: 320px; color: var(--muted); font-size: 14px; line-height: 19px; }
.connect .dark-btn { align-self: center; }
.connect .alt { margin-top: 10px; }
.field { width: 100%; height: 48px; margin-top: 18px; padding: 0 16px; border-radius: 14px; border: 0; outline: none; background: var(--card); font-size: 17px; text-align: center; color: var(--ink); }
.field::placeholder { color: var(--muted-2); }
.err { color: var(--ink); font-size: 13px; margin-top: 8px; min-height: 17px; }
.qr { width: 220px; height: 220px; margin: 18px auto 6px; border-radius: 18px; background: var(--white); box-shadow: 0 6px 24px var(--shadow-08); display: grid; place-items: center; overflow: hidden; }
.qr img { width: 100%; height: 100%; }

.settings { margin: 22px 8px 0; display: flex; flex-direction: column; gap: 12px; }
.sgroup { background: var(--card); border-radius: 17px; padding: 4px 16px; }
.sgroup h4 { margin: 12px 0 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; font-size: 15px; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow .v { color: var(--muted); }
.srow input[type=time] { border: 0; background: var(--white); border-radius: 10px; height: 32px; padding: 0 8px; font-size: 15px; }
.tfield { display: inline-flex; align-items: center; gap: 4px; }
.tset { height: 32px; padding: 0 12px; border-radius: 10px; background: var(--white); color: var(--muted); font-size: 15px; }
.tclear { height: 32px; padding: 0 6px; color: var(--muted); font-size: 13px; }
.srow select { border: 0; background: var(--white); border-radius: 10px; height: 32px; padding: 0 6px; font-size: 14px; max-width: 190px; }
.danger { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.srow .danger { height: 34px; padding: 0 14px; border-radius: 17px; font-size: 14px; }
.toggle { position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--off); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px var(--shadow-20); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.toggle.on { background: var(--ink); }
.toggle.on::after { transform: translateX(18px); }
.snote { font-size: 12px; line-height: 16px; color: var(--muted); padding: 0 6px; }

/* ---------- поиск ---------- */
.qa + .qa { margin-top: 22px; }
.q { font-size: 15px; line-height: 19px; color: var(--ink); font-weight: 600; padding: 0 4px; }
.q .rec { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.a { margin-top: 10px; }
.a .state { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 6px 4px; }
.srcs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.src { display: block; text-align: left; width: 100%; padding: 10px 14px; border-radius: 14px; background: var(--card-2); }
.src .sh { display: flex; gap: 6px; font-size: 12px; color: var(--muted); text-transform: lowercase; }
.src .sh b { font-weight: 500; color: var(--text-2); }
.src .sx { margin-top: 3px; font-size: 13px; line-height: 17px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dock { position: absolute; z-index: 7; left: 16px; right: 16px; bottom: 16px; display: flex; align-items: flex-end; gap: 8px; }
.dock .inp { flex: 1; display: flex; align-items: flex-end; min-height: 46px; padding: 0 6px 0 16px; border-radius: 23px; background: var(--white); box-shadow: 0 8px 26px var(--shadow-10), 0 1px 2px var(--shadow-05); }
.dock textarea { flex: 1; resize: none; border: 0; outline: none; background: none; font-size: 16px; line-height: 20px; padding: 13px 0; max-height: 120px; }
.dock textarea::placeholder { color: var(--muted-2); }
.dock .send { width: 34px; height: 34px; margin: 6px 0; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; }
.dock .send svg { width: 16px; height: 16px; }
.dock .send[disabled] { opacity: .35; cursor: default; }
.dock .mic { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; box-shadow: 0 8px 22px var(--shadow-18); }
.dock .mic svg { width: 20px; height: 20px; }
.dock .mic.rec { position: relative; background: var(--ink); }
.dock .mic.rec::before { content: ""; position: absolute; inset: -8px; border: 8px solid var(--shadow-12); border-radius: 50%; pointer-events: none; animation: recpulse var(--dur-loop) var(--ease) infinite; }
@keyframes recpulse { from { opacity: .8; transform: scale(.75); } to { opacity: 0; transform: scale(1.12); } }
.rec-line { position: absolute; z-index: 7; left: 0; right: 0; bottom: 72px; text-align: center; font-size: 13px; color: var(--ink); }

/* ---------- нижняя панель ---------- */
.bar { flex: none; position: relative; display: flex; align-items: center; gap: 10px; padding: 17px 20px max(14px, calc(var(--bottom) - 4px)); }
.bar .btn { height: 44px; min-width: 47px; padding: 0 14px; border-radius: 22px; background: var(--dark-btn); color: var(--white); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.bar .btn svg { width: 18px; height: 18px; flex: none; }
.bar .btn.wide { min-width: 70px; }
.bar .grow { flex: 1; }
.bar .btn.search { background: var(--white); color: var(--ink); min-width: 77px; }
.bar .btn.search svg { width: 19px; height: 19px; }
#app.collapsed .bar { visibility: hidden; }

/* ---------- тёмная шторка выбора чатов ---------- */
.dsheet { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; top: calc(var(--top) + 67px); display: flex; flex-direction: column; color: var(--white); opacity: 0; transform: translateY(40px); pointer-events: none; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.dsheet.open { opacity: 1; transform: none; pointer-events: auto; }
.dsheet .grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--text-2); margin: 14px auto 0; }
/* язычок — кнопка «закрыть» с удобной зоной нажатия; геометрия шторки прежняя */
.dsheet .grab-hit { display: block; width: 100%; height: 26px; margin-bottom: -7px; }
.dsheet .grab-hit:active { transform: none; }
.dsheet .derr { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 20px 0; padding: 10px 14px; border-radius: 14px; background: var(--dark-btn); color: var(--muted-2); font-size: 13px; line-height: 17px; }
.dsheet .derr button { flex: none; color: var(--white); font-size: 14px; font-weight: 500; }
.dsheet .cap { text-align: center; color: var(--muted); font-size: 15px; line-height: 20px; margin-top: 15px; }
.dsheet .dsearch { display: flex; align-items: center; gap: 12px; height: 44px; margin: 15px 20px 0; padding: 0 16px; border-radius: 15px; background: var(--dark-btn); }
.dsheet .dsearch svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.dsheet .dsearch input { flex: 1; border: 0; outline: none; background: none; color: var(--white); font-size: 17px; }
.dsheet .dsearch input::placeholder { color: var(--muted); }
.dlist { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px 110px; -webkit-overflow-scrolling: touch; scrollbar-color: var(--text-2) var(--dark); }
.drow { display: flex; align-items: center; height: 66px; width: 100%; text-align: left; }
.drow .rc { flex: none; width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid var(--text-2); margin-right: 11px; display: grid; place-items: center; }
.drow .rc svg { width: 12px; height: 12px; opacity: 0; }
.drow.on .rc { background: var(--white); border-color: var(--white); color: var(--ink); }
.drow.on .rc svg { opacity: 1; }
.drow .dav { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--white); font-size: 18px; font-weight: 500; margin-right: 10px; overflow: hidden; }
.drow .dn { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; border-bottom: 1px solid var(--dark-line); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: lowercase; }
.drow.was { opacity: .5; }
.dsheet input { caret-color: var(--white); }
.dsheet button:focus-visible { outline-color: var(--white); }
.dsheet ::selection { background: var(--dark-line); color: var(--white); }
.dsec { color: var(--muted); font-size: 13px; margin: 14px 0 0 52px; }
.dsheet::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 150px; pointer-events: none; background: linear-gradient(to bottom, var(--dark-clear), var(--dark) 70%); }
.dsheet .done { z-index: 1; position: absolute; left: 50%; bottom: max(30px, calc(var(--bottom) + 2px)); transform: translateX(-50%); width: 220px; height: 47px; border-radius: 24px; background: var(--white); color: var(--ink); font-size: 15px; font-weight: 500; }
.dsheet .dempty { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 10px; }

/* ---------- светлые шторки ---------- */
.backdrop { position: fixed; inset: 0; z-index: 30; background: var(--shadow-32); opacity: 0; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.backdrop.open { opacity: 1; }
.lsheet { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; max-height: 86%; display: flex; flex-direction: column; background: var(--page); border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); padding-bottom: max(16px, var(--bottom)); }
.lsheet.open { transform: none; }
.lsheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--off); margin: 8px auto 0; flex: none; }
.lsheet .body { overflow-y: auto; padding: 14px 20px 8px; }
.lsheet h3 { margin: 4px 0 4px; font-size: 17px; line-height: 22px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.lsheet .meta { color: var(--muted); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.lsheet .body { min-width: 0; overflow-x: hidden; overflow-wrap: anywhere; }
.lsheet .acts { display: flex; flex-direction: column; gap: 8px; padding: 10px 20px 0; }
.lsheet .act { height: 48px; border-radius: 15px; background: var(--card); font-size: 15px; font-weight: 500; color: var(--ink); }
.lsheet .act.primary { background: var(--ink); color: var(--white); }
.lsheet .act.danger { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ev { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--card); }
.ev .sh { font-size: 12px; color: var(--muted); }
.ev .sx { margin-top: 3px; font-size: 14px; line-height: 19px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ev a { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ta { width: 100%; min-height: 96px; resize: none; border: 0; outline: none; border-radius: 15px; background: var(--white); padding: 14px; font-size: 16px; line-height: 21px; box-shadow: inset 0 0 0 1px var(--line); }
.dchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dchips button { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--card); font-size: 14px; color: var(--text-2); }
.dchips button.on { background: var(--ink); color: var(--white); }
.cal { margin-top: 6px; }
.cal .mh { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 16px; padding: 4px 4px 10px; }
.cal .mh button { width: 36px; height: 36px; border-radius: 50%; background: var(--card); display: grid; place-items: center; color: var(--text-2); }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .wd { font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal .d { height: 40px; border-radius: 50%; font-size: 15px; color: var(--text); }
.cal .d.today { color: var(--ink); font-weight: 600; }
.cal .d.sel { background: var(--ink); color: var(--white); }
.cal .d.fut { color: var(--muted-2); }

.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(110px + var(--bottom)); transform: translate(-50%, 20px); max-width: calc(100% - 40px); padding: 11px 16px; border-radius: 14px; background: var(--ink); color: var(--white); font-size: 14px; line-height: 18px; text-align: center; opacity: 0; pointer-events: none; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fatal { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; background: var(--page); color: var(--text-2); font-size: 15px; line-height: 21px; }

/* Состояния сохраняют размеры и положение элементов. */
button:active, .task:active, .bcard:active, .chip:active { transform: scale(.98); }
.dsheet .done:active { transform: translateX(-50%) scale(.98); }
.bcard, .chip { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.av .face, .cav, .dav { box-shadow: inset 0 0 0 .5px rgba(0,0,0,.08); }
.av img, .cav img, .dav img { filter: saturate(.92); }
.sec-h, .connect h3, .lsheet h3, .sgroup h4, .cal .mh { font-weight: 600; letter-spacing: -.2px; }
.q .rec svg { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
@keyframes shimmer { from { transform: translateX(-100%); opacity: .3; } 50% { opacity: .8; } to { transform: translateX(100%); opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Кнопка «разделы» со счётчиком «ждут ответа» и плашка фильтра задач по человеку. */
.bar .btn.more { position: relative; }
.bar .btn.more .i svg { width: 18px; height: 18px; }
.bar .btn.more .n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--white); color: var(--ink); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--dark); }
.fbar { display: flex; justify-content: center; margin: -6px 0 12px; }
.fpill { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--ink); color: var(--white); font-size: 13px; text-transform: lowercase; }

/* «мои / поручённые / все», исполнитель «?» и выбор исполнителя. */
.scopes { display: flex; justify-content: center; gap: 6px; margin: -8px 0 12px; }
.scopes button { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--card); color: var(--text-2); font-size: 13px; }
.scopes button i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.scopes button.on { background: var(--ink); color: var(--white); }
.scopes button.on i { color: var(--muted-2); }
.av .face.none, .pick .face.none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--muted-2); }
.picks { display: flex; flex-direction: column; margin-top: 12px; border-radius: 17px; background: var(--card); overflow: hidden; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; text-align: left; }
.pick + .pick { border-top: 1px solid var(--line); }
.pick .face { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--white); font-size: 14px; overflow: hidden; flex: none; }
.pick .face img { width: 100%; height: 100%; object-fit: cover; }
.pick .face.me { background: var(--line); color: var(--text-2); }
.pick .pn { display: flex; flex-direction: column; font-size: 15px; color: var(--text); text-transform: lowercase; }
.pick .pn i { font-style: normal; font-size: 12px; color: var(--muted); }
.pickname { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.pickname .field { margin-top: 0; text-align: left; }
.pickname .dark-btn { margin-top: 0; flex: none; }

/* ---------- плавность: мягко, быстро, только transform/opacity ---------- */

/* вход экрана: карточки въезжают снизу короткой волной */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* заголовок экрана сменяется мягко */
.title.swap { animation: titleswap var(--dur) var(--ease); }
@keyframes titleswap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* переключатель «задачи / бриф»: подложка переезжает к выбранной вкладке */
.seg::before { content: ""; position: absolute; z-index: 0; top: 3px; left: 3px; width: 50px; height: 29px; border-radius: 15px;
  background: var(--card); transform: translateX(calc(var(--seg-i, 0) * 58px)); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.seg button { position: relative; z-index: 1; }
.seg button.on { background: transparent; }
/* выполнено: кружок «вспыхивает», зачёркивание прорисовывается слева направо (по каждой строке) */
.task.pop .chk i { animation: checkpop var(--dur-slow) var(--spring); }
@keyframes checkpop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.task.pop .chk svg { animation: checkdraw var(--dur) var(--ease) var(--dur-fast) both; }
@keyframes checkdraw { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.ttx { background: linear-gradient(var(--muted-2), var(--muted-2)) no-repeat 0 60% / 0 1px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.task.done .tt { text-decoration: none; }
.task.done .ttx { background-size: 100% 1px; }
/* удаление: карточка схлопывается */
.task.leaving { opacity: 0; transform: scale(.96); pointer-events: none; }
/* шторки: мягкая пружина и проявление содержимого */
.lsheet { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.lsheet.open .body > *, .lsheet.open .acts > * { animation: rise var(--dur-slow) var(--ease) both; }
.lsheet.open .body > :nth-child(2), .lsheet.open .acts > :nth-child(1) { animation-delay: calc(var(--dur-fast) / 4); }
.lsheet.open .body > :nth-child(3), .lsheet.open .acts > :nth-child(2) { animation-delay: calc(var(--dur) / 4); }
.lsheet.open .acts > :nth-child(n+3) { animation-delay: calc(var(--dur-fast) * .625); }
/* счётчик «ждут ответа» подпрыгивает при изменении */
.bar .btn.more .n.bump { animation: bump var(--dur-slow) var(--spring); }
@keyframes bump { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
/* вкладки «мои / поручённые / все» и чипы брифа — плавная смена */
.scopes button, .chips button { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.toast { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
@media (prefers-reduced-motion: reduce) {
  #content.anim-in > :not(.list):not(.sec), #content.anim-in .list > *, #content.anim-in .sec > .sec-h, #content.anim-in .sec > .bcard, .lsheet.open .body > *, .lsheet.open .acts > * { animation: none !important; }
  .seg::before, .ttx, .task.leaving { transition: none !important; }
}

/* ---------- заставка входа ---------- */
#intro { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; background: var(--dark); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
#intro.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
#intro.quick { display: none; }
#intro .stack { position: relative; width: 176px; height: 82px; }
#intro .ic { position: absolute; left: 0; right: 0; height: 50px; border-radius: 16px; opacity: 0; }
#intro .c3 { top: 4px; background: #2a2a2a; animation: ic3 var(--dur-draw) var(--spring) var(--dur-fast) forwards; }
#intro .c2 { top: 16px; background: #3d3d3d; animation: ic2 var(--dur-draw) var(--spring) var(--dur-fast) forwards; }
#intro .c1 { top: 30px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #f4f4f4;
  box-shadow: 0 14px 34px rgba(0,0,0,.35); animation: ic1 var(--dur-draw) var(--spring) var(--dur) forwards; }
@keyframes ic1 { from { opacity: 0; transform: translateY(46px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes ic2 { from { opacity: 0; transform: translateY(46px) scale(.86) rotate(-5deg); } to { opacity: 1; transform: scale(.92); } }
@keyframes ic3 { from { opacity: 0; transform: translateY(46px) scale(.8) rotate(5deg); } to { opacity: .9; transform: scale(.84); } }
#intro .ck { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #c9c9c9; display: grid; place-items: center;
  animation: ckfill var(--dur) var(--ease) var(--dur-draw) forwards; }
#intro .ck svg { width: 14px; height: 14px; fill: none; stroke: #fafafa; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 20; stroke-dashoffset: 20; animation: ckdraw var(--dur) var(--ease) var(--dur-loop) forwards; }
@keyframes ckfill { from { opacity: 0; transform: scale(.65); } 65% { opacity: 1; transform: scale(1.14); } to { opacity: 1; transform: scale(1); } }
@keyframes ckdraw { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
#intro .ln { position: relative; display: flex; flex-direction: column; gap: 7px; }
#intro .ln i { display: block; height: 6px; border-radius: 3px; background: #d0d0d0; }
#intro .ln i:first-child { width: 96px; }
#intro .ln i:last-child { width: 58px; background: #e0e0e0; }
#intro .ln::after { content: ""; position: absolute; left: -2px; top: 5px; height: 1.5px; width: 104px; transform-origin: left; transform: scaleX(0); background: #8a8a8a; animation: strike var(--dur-slow) var(--ease) var(--dur-loop) forwards; }
@keyframes strike { to { transform: scaleX(1); } }
#intro .word { color: #fafafa; font-size: 22px; font-weight: 600; letter-spacing: -.2px; }
#intro .word span { display: inline-block; opacity: 0; transform: translateY(10px); animation: letter var(--dur-slow) var(--ease) forwards;
  animation-delay: calc(var(--intro-name-delay) + var(--i,0) * var(--intro-letter-step)); }
@keyframes letter { to { opacity: 1; transform: none; } }
/* после заставки светлый контейнер и панель мягко выезжают снизу */
#app .page, #app .bar { transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
body.booting #app .page { transform: translateY(46px); opacity: 0; }
body.booting #app .bar { transform: translateY(24px); opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  #intro { display: none; }
  body.booting #app .page, body.booting #app .bar { transform: none; opacity: 1; }
}

/* ---------- единое движение; геометрия экранов остаётся прежней ---------- */
#content { position: relative; }
#app { overflow: clip; }
.page, #app .page { transition: transform var(--dur) var(--spring), opacity var(--dur) var(--ease); }
#app .bar { transition: transform var(--dur) var(--spring), opacity var(--dur) var(--ease); }
.seg::before, .lsheet, .dsheet { transition: transform var(--dur-slow) var(--spring), opacity var(--dur-fast) var(--ease); }
.toast { transition: transform var(--dur) var(--spring), opacity var(--dur-fast) var(--ease); }
.ttx { transition: background-size var(--dur) var(--ease); }
.skel, .skel-snapshot { position: relative; height: 96px; border-radius: 17px; border: 1px solid var(--line); background: var(--card-2); overflow: hidden; animation: none; }
.skel::after, .skel-snapshot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, var(--line), transparent); animation: shimmer var(--dur-loop) linear infinite; }
.skel-snapshot + .skel-snapshot { margin-top: 10px; }
.load-ghost, .task-delete-ghost { position: absolute; pointer-events: none; z-index: 2; }
.load-ghost { left: 0; right: 0; top: 0; }
.task-delete-ghost { margin: 0; }
.lsheet.dragging, .dsheet.dragging { transition: none; }
.backdrop:not(.open), .lsheet:not(.open) { pointer-events: none; }
.lsheet .grab, .dsheet .grab-hit, .dsheet .cap { touch-action: none; }
.dsheet.swipe-exit:not(.open) { transform: translateY(100%); }
.ptr { position: absolute; z-index: 5; left: 50%; width: 26px; height: 26px; opacity: 0; pointer-events: none; transform: translate(-50%,-12px); color: var(--ink); }
.ptr svg { width: 26px; height: 26px; }
.ptr.refreshing svg { animation: spin var(--dur-draw) linear infinite; }
.ptr path { transition: opacity var(--dur-fast) var(--ease); }
.count-number { display: inline-block; position: relative; font-variant-numeric: tabular-nums; }
.count-number.counting .count-value { opacity: 0; }
.count-number.counting::after { content: attr(data-count-display); position: absolute; inset: 0; text-align: inherit; font: inherit; color: inherit; }
.chips .chip-track { position: absolute; z-index: 0; left: 0; top: 0; height: 38px; width: 1px; border-radius: 19px; background: var(--chip-active); pointer-events: none; transform-origin: left center; }
.chips button { position: relative; z-index: 1; }
.chips button.on { background: transparent; color: var(--ink); }
.chips button:not(.on) { background: var(--chip-bg); }
.empty { position: relative; }
.empty-art { position: absolute; left: 50%; top: -8px; width: 64px; height: 32px; transform: translateX(-50%); color: var(--muted-2); pointer-events: none; }
.art-reveal { transform-box: fill-box; transform-origin: left; animation: artReveal var(--dur-draw) var(--ease) both; }
@keyframes artReveal { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
#intro { transition: opacity var(--dur) var(--ease); }
#intro.out { transform: none; }
#intro.waiting .stack { animation: breathe var(--dur-loop) var(--ease) infinite alternate; }
@keyframes breathe { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(-3px) scale(1.02); opacity: .85; } }
#intro .ck { position: relative; animation: none; }
#intro .ck::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--ink); opacity: 0; animation: ckfill var(--dur) var(--spring) var(--intro-check-delay) forwards; }
#intro .ck svg { position: relative; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0; animation: ckdraw var(--dur) var(--ease) var(--dur-draw) forwards; }
#intro .ln::after { animation: strike var(--dur) var(--ease) var(--intro-strike-delay) forwards; }
#intro .c1 { animation-duration: var(--dur-slow); animation-delay: var(--dur-fast); }
#intro .c2 { animation-duration: var(--dur-slow); animation-delay: var(--intro-mid-delay); }
#intro .c3 { animation-duration: var(--dur-slow); animation-delay: var(--intro-back-delay); }
#intro .word span { animation-duration: var(--dur-slow); animation-delay: calc(var(--intro-name-delay) + var(--i,0) * var(--intro-letter-step)); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  #intro { display: none; }
  body.booting #app .page, body.booting #app .bar { transform: none; opacity: 1; }
  #intro .ck::before, #intro .ck svg { opacity: 1; }
  .art-reveal { transform: none; opacity: 1; }
  .count-number.counting .count-value { opacity: 1; }
  .count-number.counting::after { content: none; }
}

.empty-answer { position: relative; }
.empty-answer .empty-art { left: auto; right: 12px; top: 50%; width: 48px; height: 24px; transform: translateY(-50%); opacity: .18; }
.empty-answer .btext { position: relative; }

/* ---------- задачи v2: срок, отметки, «на разбор», давние ---------- */
.td.due { color: var(--text-2); }
.tchip { display: inline-block; margin-left: 6px; padding: 0 7px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--white); color: var(--text-2); font-size: 11.5px; font-weight: 500; vertical-align: 0; box-shadow: inset 0 0 0 1px var(--line); }
.tchip.hot { background: var(--ink); color: var(--white); box-shadow: none; }
.task.done .tchip { display: none; }

.rvw { margin: 0 0 12px; border-radius: 17px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.rvw-h { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px 0 16px; text-align: left; }
.rvw-h b { font-size: 14px; font-weight: 600; color: var(--ink); }
.rvw-h i { font-style: normal; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rvw-h small { flex: 1; font-size: 12.5px; color: var(--muted); text-align: right; }
.rvw-h .xchev { display: grid; color: var(--muted); transition: transform var(--dur-fast) var(--ease); }
.rvw.open .rvw-h .xchev { transform: rotate(90deg); }
.rvw-b { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; animation: rvwin var(--dur-base, .28s) var(--ease); }
@keyframes rvwin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rv { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 12px; border-radius: 13px; background: var(--white); }
.rv .tx { padding-right: 4px; }
.rv .tt { font-size: 14px; line-height: 18px; }
.rv .td { margin-top: 3px; font-size: 12px; }
.rv-ok { flex: none; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--ink); color: var(--white); font-size: 13px; }
.rv-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); color: var(--text-2); display: grid; place-items: center; }
.rv-no svg { width: 15px; height: 15px; }
.rv-ok:active, .rv-no:active { transform: scale(.94); }

.stale { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; padding: 12px 12px 12px 16px; border-radius: 17px; box-shadow: inset 0 0 0 1px var(--line); }
.stale > div:first-child { flex: 1 1 200px; min-width: 0; }
.stale b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.stale small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.stale-a { display: flex; gap: 6px; flex: none; }
.stale-a button { height: 30px; padding: 0 11px; border-radius: 15px; background: var(--card); color: var(--text-2); font-size: 13px; }
.stale-a button:first-child { background: var(--ink); color: var(--white); }

.hintq { margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--ink); }
.hintq .hl { font-size: 13px; font-weight: 600; color: var(--white); }
.hintq .ev { margin-top: 8px; background: var(--white); }
.evcap { margin-top: 14px; font-size: 12px; color: var(--muted); }
.dpick { position: relative; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--card); font-size: 14px; color: var(--text-2); overflow: hidden; }
.dpick.on { background: var(--ink); color: var(--white); }
.dpick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.lsheet .dchips + .snote { margin-top: 12px; }

/* ---------- поиск: ссылки и доступы ---------- */
.ulinks, .creds { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ulink { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 15px; background: var(--ink); }
.ulink-o { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; text-align: left; color: var(--white); }
.ulink-o i { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--dark-btn); display: grid; place-items: center; }
.ulink-o svg { width: 17px; height: 17px; }
.ulink-o span { min-width: 0; }
.ulink-o b { display: block; font-size: 14px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ulink-o small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ucopy { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.ucopy svg { width: 17px; height: 17px; }
.ulink .ucopy { color: var(--muted-2); }
.ucopy:active { transform: scale(.92); }
.cred { padding: 12px 8px 8px 14px; border-radius: 17px; background: var(--card); }
.chd { display: flex; align-items: center; gap: 10px; padding-right: 4px; margin-bottom: 6px; }
.chd > span { flex: 1; min-width: 0; }
.chd b { display: block; font-size: 15px; line-height: 19px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.chd small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.cshow { flex: none; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--ink); color: var(--white); font-size: 13px; }
.crow { display: flex; align-items: center; gap: 8px; min-height: 38px; border-top: 1px solid var(--line); }
.cl { flex: none; width: 56px; font-size: 12px; color: var(--muted); }
.cv { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; color: var(--muted); letter-spacing: .08em; overflow-wrap: anywhere; }
.cv.on { color: var(--ink); letter-spacing: 0; user-select: text; -webkit-user-select: text; }
.clink { display: block; padding: 8px 0 4px; font-size: 12px; color: var(--text-2); }

/* думающие орбы (thinking-orbs, MIT © Jakub Antalik) вместо крутилок там, где штаб «думает» */
thinking-orb { display: inline-block; flex: none; vertical-align: middle; line-height: 0; }
.state thinking-orb, .bstate thinking-orb { margin-right: 8px; }
.empty thinking-orb { display: block; margin: 0 auto 14px; }
.dempty thinking-orb { display: block; margin: 0 auto; }
