/* Экран «Сделки» и общая карточка списка CRM (public/js/screens/cards.js). Классы .dl-…
   Образец — мобильный Битрикс24: docs/02 A2–A7, D «Списки»; десктоп — docs/02 B (канбан). */

:root {
  --dl-on-accent: #fff;
  /* Иконки связи: голубой акцент, чуть темнее в светлой теме и светлее в тёмной — чтобы читались. */
  --dl-ic: color-mix(in srgb, var(--accent) 74%, var(--text));
  /* Доля цвета очень светлой стадии в тексте бейджа: в светлой теме мало (иначе жёлтый на белом не читается) */
  --dl-bright-mix: 36%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --dl-bright-mix: 60%; }
}
:root[data-theme='dark'] { --dl-bright-mix: 60%; }

/* ---------- телефон: шапка, поиск ---------- */
/* Чипы «Сделки · Контакты · Товары»: на вид 36 px, как в Битриксе, а цель касания — 44 px */
.dl-ent .chip::after { content: ''; position: absolute; inset: -6px -3px; } /* от рамки: 36 + 2×(6 − 1,5) ≈ 45 px */
.dl-screen .icon-btn .dl-fdot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); border: 1.5px solid var(--bg); }
.dl-search { display: flex; align-items: center; gap: 4px; padding: 0 0 8px; }
.dl-search .searchbar { flex: 1; margin: 0; height: 40px; }
.dl-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.dl-sclear { width: 40px; height: 40px; margin-right: -10px; display: grid; place-items: center; color: var(--text-3); flex: none; }
.dl-scancel { height: 44px; padding: 0 4px 0 8px; color: var(--link); font-size: 16px; flex: none; }

/* ---------- плашка воронки (ios/01, ios2/35) и компактная (ios/02) ---------- */
.dl-scroll { padding: 0 8px; }
.dl-platebox { margin: 2px 0 8px; }
.dl-plate { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 10px; background: var(--surface); border-radius: var(--radius); text-align: left; box-shadow: var(--shadow-card); transition: transform 100ms var(--ease-out); }
.dl-plate:active { transform: scale(0.99); }
.dl-plate-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); color: var(--text-4); display: grid; place-items: center; flex: none; }
.dl-plate-ic.stage { color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
/* Без выбранной стадии — значок бренда: сразу видно, в каком бренде работаешь. */
.dl-plate-ic.brand { background: none; border-radius: 11px; }
.dl-plate-ic.brand .brand-icon, .dl-plate-ic.brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 19px; }
.dl-plate-txt { display: flex; flex-direction: column; min-width: 0; }
.dl-plate-small { display: block; font-size: 14px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-plate-main { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 18px; color: var(--text); }
.dl-plate-main .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dl-plate-main .n { flex: none; white-space: nowrap; }
.dl-plate-main svg.ic { flex: none; color: var(--text-3); }
.dl-plate-sum { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; max-width: 40%; }
.dl-plate-big { font-size: 18px; color: var(--text); white-space: nowrap; }
.dl-plate.compact { min-height: 52px; padding: 0 14px; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: none; color: var(--text-3); }
.dl-plate.compact .dl-plate-main { font-size: 17px; }
.dl-plate-tot { flex: none; font-size: 16px; color: var(--text); white-space: nowrap; }
.dl-dot-c { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.dl-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.dl-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: transform 160ms var(--ease-out), background 160ms; }
.dl-dots span.on { background: var(--c, var(--text-3)); transform: scale(1.4); }

/* «Обновите список…» — висит над первой карточкой, не закрывая плашку воронки */
.dl-fresh-wrap { position: sticky; top: 6px; z-index: 6; height: 0; display: flex; justify-content: center; }
.dl-fresh { height: 40px; padding: 0 18px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 92%, transparent); color: var(--dl-on-accent); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); animation: dl-pill-in 240ms var(--ease-out); transition: transform 100ms var(--ease-out); }
.dl-fresh:active { transform: scale(0.96); }

/* «Потяните, чтобы обновить» */
.dl-pull { display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; color: var(--text-3); font-size: 13px; }
.dl-pull .spinner { margin: 0; width: 22px; height: 22px; border-width: 2.5px; }
.dl-pull-ic { display: grid; color: var(--text-3); }
.dl-pull-ic.ready { color: var(--primary); }

.dl-feed { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 96px); }
.dl-feed.slide-l { animation: dl-slide-l 260ms var(--ease-out); }
.dl-feed.slide-r { animation: dl-slide-r 260ms var(--ease-out); }
.dl-skel .skeleton { height: 236px; margin-bottom: 8px; border-radius: var(--radius); }
.dl-end { text-align: center; color: var(--text-4); font-size: 13px; padding: 14px 0 4px; }
.dl-empty-act { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---------- большая карточка (cards.js ListCard): заголовок, лента, сетка «поля | колонка 56 px» ---------- */
.dl-card { position: relative; background: var(--surface); border-radius: var(--radius); padding: 10px 6px 16px 16px; margin: 0 0 8px; box-shadow: var(--shadow-card); overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background 120ms; }
.dl-card:active { background: color-mix(in srgb, var(--text) 3%, var(--surface)); }
.dl-card-head { display: flex; align-items: flex-start; gap: 2px; }
.dl-card-title { font-size: 17px; font-weight: 700; line-height: 1.25; padding-top: 4px; word-break: break-word; }
.dl-card-sub { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.dl-card .dl-more { margin: -2px 0 -6px; color: var(--text-3); }
.dl-card-top { margin: 8px -6px 2px -16px; }
.dl-card-top .stage-ribbon { margin: 0; }
.dl-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) 56px; column-gap: 6px; align-items: start; }
.dl-fields { min-width: 0; }
.dl-f { margin-top: 12px; }
.dl-fl { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-3); }
.dl-fv { margin-top: 3px; font-size: 16px; line-height: 1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-fv.big { font-size: 22px; }
/* Образец карточки в настройках (menu.js «Карточка в канбане»): пустая строка — бледная подпись на месте значения */
.dl-fv-empty { color: var(--text-4); }
.dl-client { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 11px 0; margin: -11px 0; color: var(--link); vertical-align: top; }
.dl-client .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dl-kind { flex: none; font-size: 11px; line-height: 16px; padding: 0 7px; border-radius: 9px; border: 1px solid var(--accent); color: var(--text-2); }
.dl-tools { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; }
.dl-tl { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; padding: 2px 0; }
.dl-tl .ring { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--primary); display: grid; place-items: center; transition: transform 100ms var(--ease-out); }
.dl-tl:active .ring { transform: scale(0.92); }
.dl-tl .n { position: absolute; top: -6px; right: -9px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; border: 2px solid var(--surface); background: var(--text-4); color: var(--dl-on-accent); font-size: 11px; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.dl-tl .n.on { background: var(--green-badge); }
.dl-tl .lb { font-size: 11px; color: var(--text-3); }
.dl-tools .comm-pill { margin-top: 4px; padding: 2px 0; gap: 0; border-radius: 24px; }
.dl-tools .comm-pill button .disc { width: 30px; height: 30px; background: transparent; color: var(--dl-ic); }
.dl-tools .comm-pill button .disc svg.ic { width: 22px; height: 22px; }
.dl-tools .comm-pill button.off .disc { background: transparent; color: var(--text-4); }
.dl-tools .comm-pill button:active .disc { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- строка компактного списка (cards.js ListRow) ---------- */
.dl-rows { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.dl-row { padding: 12px 12px 10px 16px; border-bottom: 0.5px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background 120ms; }
.dl-row:last-child { border-bottom: 0; }
.dl-row:active { background: var(--surface-2); }
.dl-row-top { display: flex; align-items: baseline; gap: 10px; padding-right: 4px; }
.dl-row-top .t { flex: 1; min-width: 0; font-size: 17px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row-top .tm { flex: none; font-size: 14px; color: var(--text-3); white-space: nowrap; }
.dl-row-mid { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 3px; padding-right: 4px; font-size: 16px; color: var(--text); }
.dl-row-bot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.dl-row-badge { display: flex; min-width: 0; }
.dl-row .comm-pill.h { flex: none; height: 40px; align-items: center; padding: 0 2px; gap: 0; background: transparent; border: 1px solid var(--line-2); border-radius: 22px; }
.dl-row .comm-pill.h button { width: 44px; height: 44px; color: var(--dl-ic); }
.dl-row .comm-pill.h button.off { color: var(--text-4); }

/* Бейдж стадии с многоточием: текст — цвет стадии, приглушённый к цвету текста (жёлтая стадия читается на белом) */
.dl-tag { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-width: 0; max-width: 100%; padding: 0 12px 0 8px; border-radius: 14px; border: 1.5px solid var(--c); color: color-mix(in srgb, var(--c) 60%, var(--text)); font-size: 14px; }
.dl-tag svg.ic { flex: none; }
.dl-tag .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Очень светлая стадия (cards.js isBright: жёлтая, бледно-голубая): 60% её цвета на белом не читается */
.dl-tag.light { color: color-mix(in srgb, var(--c) var(--dl-bright-mix), var(--text)); border-color: color-mix(in srgb, var(--c) 82%, var(--text)); }

/* ---------- шторки: воронки, фильтр, период, дело, быстрая сделка ---------- */
.dl-plist { margin: 0 -8px; }
.dl-prow { display: flex; align-items: center; gap: 4px; padding-left: 8px; border-radius: 10px; }
.dl-prow.on { background: var(--accent-soft); }
.dl-prow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 56px; padding-right: 8px; font-size: 17px; text-align: left; }
.dl-prow-main > svg.ic { color: var(--text-2); }
.dl-prow-main .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-prow-main .s { display: block; font-size: 13px; color: var(--text-3); }
.dl-prow-main .ck { color: var(--primary); display: grid; }

.dl-fsec { font-size: 15px; color: var(--text-3); margin: 22px 0 8px; }
.dl-fsec:first-child { margin-top: 4px; }
.dl-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-presets .chip.pill { height: 40px; }
.dl-sort { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; font-size: 17px; text-align: left; color: var(--text); border-bottom: 0.5px solid var(--line); }
.dl-sort:last-child { border-bottom: 0; }
.dl-sort > svg.ic { color: var(--text-3); }
.dl-sort.on, .dl-sort.on > svg.ic { color: var(--link); }
.dl-frow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; font-size: 17px; text-align: left; border-bottom: 0.5px solid var(--line); }
.dl-frow:last-child { border-bottom: 0; }
.dl-frow:active { opacity: 0.6; }
.dl-frow .l { flex: none; color: var(--text); }
.dl-frow .v { flex: 1; min-width: 0; text-align: right; font-size: 16px; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-frow > svg.ic { flex: none; color: var(--text-4); }
.dl-range-note { font-size: 13px; margin: 10px 0 4px; }

.dl-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; -webkit-appearance: none; appearance: none; cursor: pointer; }


@keyframes dl-pill-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
@keyframes dl-slide-l { from { opacity: 0.35; transform: translateX(32px); } }
@keyframes dl-slide-r { from { opacity: 0.35; transform: translateX(-32px); } }

@media (hover: hover) and (pointer: fine) {
  .dl-card:hover, .dl-row:hover { background: color-mix(in srgb, var(--text) 2%, var(--surface)); }
  .dl-frow:hover, .dl-sort:hover, .dl-prow-main:hover { opacity: 0.8; }
  .dl-kcard:hover { box-shadow: 0 3px 12px color-mix(in srgb, var(--text) 12%, transparent); }
  .dl-kc:hover { background: var(--accent-soft); }
  .dl-kc.off:hover { color: var(--text-3); }
  .dl-kplan:hover { background: var(--surface-3); color: var(--text-2); }
  .dl-kadd:hover { background: var(--surface); color: var(--text-2); }
  .dl-table tbody tr:hover { background: var(--surface-2); }
  .dl-pipe:hover, .dl-dsearch:hover { border-color: var(--text-4); }
  .dl-karrow:hover { color: var(--text); }
  .dl-pchip button:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
}

/* ======================= десктоп: канбан колонками (desktop/01) и таблица ======================= */
@media (min-width: 1024px) {
  .dl-desk .dl-dtop { padding: 16px 24px 4px; }
  .dl-dtop-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
  .dl-dtop-row .topbar-title { flex: none; }
  .dl-create { background: var(--success); color: var(--dl-on-accent); flex: none; }
  .dl-pipe { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 280px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 15px; flex: none; }
  .dl-pipe > svg.ic { color: var(--text-3); }
  .dl-pipe .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .dl-dsearch { flex: 1 1 260px; min-width: 240px; max-width: 600px; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 5px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
  .dl-dsearch:focus-within { border-color: var(--primary); }
  .dl-dsearch input { flex: 1; min-width: 60px; height: 36px; border: 0; outline: none; background: transparent; text-overflow: ellipsis; }
  .dl-dsearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
  .dl-pchip { display: inline-flex; align-items: center; gap: 2px; height: 28px; max-width: 170px; padding: 0 2px 0 10px; border-radius: 8px; background: var(--primary-soft); color: var(--link); font-size: 14px; white-space: nowrap; flex: none; overflow: hidden; }
  .dl-pchip button { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: inherit; }
  .dl-pchip.more { padding: 0 10px; }
  .dl-sic { display: grid; padding: 0 2px; color: var(--text-4); flex: none; }
  .dl-dsearch .dl-pchip + .dl-pchip + .dl-sic, .dl-dsearch .dl-pchip + .dl-sic { display: none; }
  .dl-dsearch .dl-fbtn { flex: none; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; width: 40px; }
  .dl-dsearch .dl-fbtn.on { color: var(--primary); }
  @media (max-width: 1279px) { .dl-pipe { max-width: 190px; } }
  .dl-dbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 4px; }
  .dl-vs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); }
  .dl-vs button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14px; color: var(--text-2); }
  .dl-vs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 12%, transparent); }
  .dl-dtotal { font-size: 14px; color: var(--text-3); }
  /* Узкий десктоп: «Настроить карточку» — только значок с подсказкой, иначе кнопка уходила второй строкой и опускала доску */
  @media (max-width: 1199px) {
    .dl-kcfg { width: 38px; padding: 0; }
    .dl-kcfg-l { display: none; }
  }

  .dl-board-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .dl-board-wrap > .spinner { margin-top: 60px; }
  .dl-board-note { padding: 0 24px 6px; color: var(--text-3); font-size: 14px; }
  .dl-board-note .link-btn { font-size: 14px; padding: 0; }
  .dl-board { flex: 1; min-height: 0; display: flex; gap: 10px; padding: 6px 24px 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .dl-kcol { width: 272px; flex: none; display: flex; flex-direction: column; min-height: 0; border-radius: 12px; transition: background 120ms; }
  .dl-khead { flex: none; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 22px 0 12px; background: var(--c); font-size: 14px; font-weight: 600; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
  .dl-khead .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .dl-khead .c { flex: none; font-weight: 400; opacity: 0.85; }
  .dl-ksum { flex: none; margin: 8px 0; padding: 3px 0; border-radius: 8px; background: color-mix(in srgb, var(--surface) 60%, transparent); text-align: center; font-size: 20px; color: var(--text-2); }
  .dl-kadd { flex: none; height: 34px; margin-bottom: 8px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text-3); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 4px; }
  .dl-kbody { flex: 1; min-height: 60px; overflow-y: auto; padding: 0 2px 20px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .dl-kmore { margin-top: 2px; }
  .dl-kcard { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; margin-bottom: 8px; padding: 10px 6px 8px 12px; border-radius: 10px; border-left: 3px solid var(--c); background: var(--surface); cursor: pointer; transition: box-shadow 140ms, opacity 140ms; }
  /* Таймлайн и связь скрыты в настройке карточки — правая колонка не держит пустое место */
  .dl-kcard.solo { grid-template-columns: minmax(0, 1fr); }
  .dl-kmain { min-width: 0; }
  .dl-kmain .kt { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-word; }
  .dl-kmain .ka { margin-top: 4px; font-size: 14px; color: var(--text-2); }
  .dl-kmain .kc { display: block; margin-top: 4px; font-size: 13px; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dl-kmain .kd { margin-top: 2px; font-size: 12px; color: var(--text-4); }
  .dl-kf { margin-top: 8px; }
  .dl-kf .l { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); }
  .dl-kf .v { font-size: 12px; font-weight: 500; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .dl-kplan { display: inline-flex; align-items: center; gap: 4px; height: 28px; margin: 6px 0 0 -8px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--text-3); }
  .dl-kplan.has { color: var(--success); }
  .dl-kplan.over { color: var(--danger-text); }
  .dl-kside { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .dl-kcomm { display: flex; flex-direction: column; gap: 2px; }
  .dl-kc { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--dl-ic); }
  .dl-kc.off { color: var(--text-4); }
  .dl-karrow { position: absolute; top: 45%; z-index: 7; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-pop); display: grid; place-items: center; }
  .dl-karrow.l { left: 10px; }
  .dl-karrow.r { right: 10px; }
  .dl-quick { margin-bottom: 8px; padding: 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 2px 10px color-mix(in srgb, var(--text) 10%, transparent); }
  .dl-quick input { width: 100%; height: 40px; margin-bottom: 8px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; background: var(--surface); }
  .dl-quick input:focus { border-color: var(--primary); }
  /* Над карточками, ниже шапок колонок (стрелка 36 + сумма + «+»), чтобы не закрывать названия стадий */
  .dl-fresh-wrap.desk { position: absolute; top: 136px; left: 0; right: 0; height: auto; pointer-events: none; }
  .dl-fresh-wrap.desk .dl-fresh { pointer-events: auto; }

  .dl-table-wrap { padding: 4px 24px 24px; }
  .dl-table-box { background: var(--surface); border-radius: 12px; overflow: hidden; }
  .dl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .dl-table th { padding: 10px 12px; text-align: left; font-weight: 500; color: var(--text-3); background: var(--surface-2); white-space: nowrap; }
  .dl-table td { padding: 8px 12px; border-top: 0.5px solid var(--line); vertical-align: middle; }
  .dl-table tbody tr { cursor: pointer; }
  .dl-table td.t { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dl-table td.t a { color: var(--link); }
  .dl-table td.src { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dl-table .nw { white-space: nowrap; }
  .dl-table .dl-kcomm { flex-direction: row; }
  .dl-table-more { display: flex; justify-content: center; padding: 12px 0; }
}

/* ======================= устаревшее ======================= */
/* Классы старого app.css, которыми пока пользуются контакты, товары, задачи и мессенджер (до перехода на cards.js). */
.side-tools { position: absolute; right: 12px; top: 132px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* Карточка контакта (contacts.js ставит колонке top: 62px): колонка «Таймлайн» + капсула ≈ 215 px, поэтому карточка
   не ниже 62 + 215 + 16 px и текст полей не заходит под колонку — капсула не вылезает за низ короткой карточки (CP-12). */
.card:has(> .side-tools) { min-height: 296px; padding-right: 76px; }
.tl-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--primary); position: relative; background: var(--surface); }
.tl-btn .n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--text-4); color: var(--dl-on-accent); font-size: 11px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--surface); }
.tl-btn .n.on { background: var(--green-badge); }
.tl-label { font-size: 11px; color: var(--text-3); margin-top: -6px; }
.crow { display: block; padding: 12px 16px; border-bottom: 0.5px solid var(--line); background: var(--surface); color: var(--text); }
.crow:active { background: var(--surface-2); }
.crow-top { display: flex; align-items: baseline; gap: 10px; }
.crow-title { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow-time { font-size: 14px; color: var(--text-3); white-space: nowrap; }
.crow-mid { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.crow-bot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .crow:hover, .chat-row:hover, .task-row:hover { background: var(--surface-2); }
}
@media (min-width: 1024px) {
  .desk-create { display: inline-flex !important; }
}

/* Телефон: справа пять кнопок, слева переключатель бренда. Кнопки по 40 px без зазоров (касание 40×44) — логотипу
   остаётся место, чтобы быть крупным, а не сжиматься в полоску. */
@media (max-width: 480px) {
  .dl-screen .topbar-row { gap: 0; }
  .dl-screen .topbar-row > .icon-btn { width: 40px; }
}
