/* Письма — проект и переписка по объектам (src/letters.js).

   Строится поверх общего шаблона раздела (page.css): та же полоса сверху,
   то же поле --gut, та же прокрутка одного тела. Своё здесь — строки-
   карточки вместо таблиц: у мастера телефон, и колонки таблицы на нём не
   читаются, а крупная строка с одним главным словом — читается. */

.lt-page { --lt-row: 64px; }
.lt-body { overscroll-behavior: contain; }

/* ── полоса сверху ────────────────────────────────────────── */
.pg-head.lt-head { gap: 9px; }
.lt-find { flex: 1; min-width: 0; }
.lt-find input { width: 100%; max-width: 380px; }
.lt-head .btn-brand { flex: none; }

.pg-head.strip.lt-top { min-height: 56px; }
/* Селектор той же силы, что у общей полосы: иначе заголовок не растёт и
   карандаш прилипает к нему, а не стоит у правого края. */
.pg-head.strip.lt-top .lt-h1 { flex: 1 1 auto; flex-direction: column; flex-wrap: nowrap;
  align-items: flex-start; gap: 1px; padding-right: 8px; }
.lt-top .lt-h1 h2 { max-width: 100%; }
.lt-top .lt-h1 > i {
  font-style: normal; font-size: 11px; color: var(--ink3);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-crumb {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 11px; color: var(--ink3);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-crumb:hover { color: var(--brand-deep); }
.lt-top .lt-edit { flex: none; align-self: center; width: 32px; height: 32px; margin-left: auto; }

.lt-hint {
  padding: 11px var(--gut); border-bottom: 1px solid var(--line2);
  background: var(--raise); font-size: 11.5px; color: var(--ink2); line-height: 1.5;
}
.lt-hint b { color: var(--ink); }

/* ── строки: объекты и письма ─────────────────────────────── */
.lt-list { display: flex; flex-direction: column; }
.lt-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: var(--lt-row);
  padding: 12px var(--gut);
  border: 0; border-bottom: 1px solid var(--line2);
  background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.lt-row:hover { background: var(--raise); }
.lt-row:active { background: var(--box-bg-h); }
.lt-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lt-row-main > b {
  font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35;
  overflow-wrap: anywhere;
}
.lt-row:hover .lt-row-main > b { color: var(--brand-deep); }
.lt-row-main > i {
  font-style: normal; font-size: 11px; color: var(--ink3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lt-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 3px; }
.lt-go { flex: none; color: var(--ink4); display: grid; place-items: center; }
.lt-go svg, .lt-cnt svg, .lt-st svg, .lt-dir svg, .lt-block-h h3 svg, .lt-file-ico svg,
.lt-chip svg, .lt-av svg, .lt-attach svg, .lt-more svg, .lt-pickb svg, .lt-dirseg svg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lt-go svg { width: 16px; height: 16px; }
.lt-row:hover .lt-go { color: var(--brand); }

.lt-cnt { display: inline-flex; align-items: center; gap: 3.5px; font-size: 11px; color: var(--ink3);
  font-variant-numeric: tabular-nums; }
.lt-cnt svg { width: 13px; height: 13px; }

/* Состояние письма — главное слово строки. Цвет — сколько ждём. */
.lt-st {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1.5px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; line-height: 16px; white-space: nowrap;
}
.lt-st svg { width: 11px; height: 11px; stroke-width: 2.6; }
.lt-st.info { background: var(--info-soft); color: var(--info); }
.lt-st.warn { background: var(--warn-soft); color: var(--warn); }
.lt-st.bad { background: var(--bad-soft); color: var(--bad); }
.lt-st.done { background: var(--ok-soft); color: var(--ok); }

/* Кто кому: наше исходящее — фирменным, входящее — синим. */
.lt-dir {
  flex: none; display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 999px;
}
.lt-dir svg { width: 15px; height: 15px; stroke-width: 2.2; }
.lt-dir.out { background: var(--brand-tint); color: var(--brand-deep); }
.lt-dir.in { background: var(--info-soft); color: var(--info); }
.lt-let { align-items: flex-start; }
.lt-let .lt-dir { margin-top: 1px; }
.lt-let .lt-go { align-self: center; }
.lt-let.closed .lt-row-main > b { font-weight: 500; color: var(--ink2); }
.lt-let.closed .lt-dir { filter: grayscale(1); opacity: .6; }
.lt-last {
  margin-top: 2px; font-size: 11px; color: var(--ink2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lt-last b { font-weight: 600; color: var(--ink); }

/* ── блоки объекта ────────────────────────────────────────── */
.lt-block { padding-bottom: 8px; }
.lt-block + .lt-block { border-top: 6px solid var(--raise); }
.lt-block-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px var(--gut) 10px;
}
.lt-block-h h3 {
  flex: 1; min-width: 0; margin: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: -.01em;
}
.lt-block-h h3 svg { width: 16px; height: 16px; color: var(--ink3); flex: none; }
.lt-block-h h3 i {
  font-style: normal; font-weight: 500; font-size: 11px; color: var(--ink3);
  padding: 0 6px; border-radius: 999px; background: var(--raise); line-height: 17px;
}
.lt-empty {
  padding: 2px var(--gut) 14px; max-width: 64ch;
  font-size: 11.5px; line-height: 1.55; color: var(--ink3);
}
.lt-seg { margin: 0 var(--gut) 8px; }
.lt-seg .seg-b i { font-style: normal; margin-left: 5px; color: var(--ink3); font-weight: 500; }

/* Файлы проекта: значок, что это и кто положил, действия. */
.lt-files { border-top: 1px solid var(--line2); }
.lt-file {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--gut);
  border-bottom: 1px solid var(--line2);
}
.lt-file:last-child { border-bottom: 0; }
.lt-file-ico {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--raise); color: var(--ink3);
}
.lt-file-ico svg { width: 17px; height: 17px; stroke-width: 1.8; }
.lt-file:first-child .lt-file-ico { background: var(--brand-tint); color: var(--brand-deep); }
.lt-file-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
  padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: inherit; text-align: left; color: inherit;
}
.lt-file-main b {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lt-file-main:hover b { color: var(--brand-deep); text-decoration: underline; }
.lt-file-main i {
  font-style: normal; font-size: 11px; color: var(--ink3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lt-file-main i em { font-style: normal; color: var(--brand-deep); }
.lt-file-main .lt-file-name { color: var(--ink4); font-size: 10.5px; }
.lt-file-acts { flex: none; display: flex; gap: 2px; }
.lt-file-acts .ico { width: 30px; height: 30px; }
.lt-more {
  display: block; width: calc(100% - 2 * var(--gut)); margin: 0 var(--gut) 8px;
  padding: 7px 10px; border: 1px dashed var(--line); border-radius: 9px;
  background: none; cursor: pointer; font: inherit; font-size: 11px; color: var(--ink2);
}
.lt-more:hover { border-color: var(--brand); color: var(--brand-deep); }

/* ── письмо ───────────────────────────────────────────────── */
.lt-sum {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px var(--gut);
  border-bottom: 1px solid var(--line2); background: var(--raise);
}
.lt-facts {
  flex: 1 1 360px; min-width: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px 18px;
}
.lt-facts dt {
  font: 600 9px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3);
}
.lt-facts dd {
  margin: 3px 0 0; display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink);
}
.lt-facts .lt-dir { width: 22px; height: 22px; }
.lt-facts .lt-dir svg { width: 12px; height: 12px; }
.pg .btn-ghost.lt-close { flex: none; height: 34px; background: var(--card); }
@media (hover: hover) { #ltClose:hover { color: var(--ok); border-color: var(--ok); } }
/* Тему письма читают целиком: две строки, а не обрезок в одну. */
.lt-card .lt-top .lt-h1 h2 {
  white-space: normal; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lt-card .pg-head.strip.lt-top { padding-top: 8px; padding-bottom: 8px; }

.lt-feed { padding: 6px var(--gut) 16px; }
.lt-item {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px;
  padding: 10px 0;
}
.lt-item + .lt-item { border-top: 1px solid var(--line2); }
.lt-av {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--raise); color: var(--ink2);
  font-size: 12px; font-weight: 600;
}
.lt-av svg { width: 14px; height: 14px; stroke-width: 2.4; }
.lt-item.sys .lt-av { background: none; color: var(--ink4); border: 1px dashed var(--line); }
.lt-item.sys .lt-av svg { fill: currentColor; stroke: none; width: 9px; height: 9px; }
.lt-item.status .lt-av { background: var(--ok-soft); color: var(--ok); }
.lt-item-h { display: flex; align-items: baseline; gap: 8px; min-height: 18px; }
.lt-item-h b { font-size: 12px; font-weight: 600; color: var(--ink); }
.lt-item-h time { font-size: 10.5px; color: var(--ink3); white-space: nowrap; }
.lt-item-h .lt-del, .lt-item-h .lt-ed { align-self: center; width: 26px; height: 26px; margin: 0;
  opacity: 0; transition: opacity .15s var(--ease); }
.lt-item-h .lt-ed, .lt-item-h .lt-del:first-of-type { margin-left: auto; }
.lt-item-h .lt-ed + .lt-del { margin-left: 2px; }
.lt-item:hover .lt-del, .lt-item:hover .lt-ed, .lt-del:focus-visible, .lt-ed:focus-visible { opacity: 1; }
@media (hover: none) { .lt-item-h .lt-del, .lt-item-h .lt-ed { opacity: .7; } }
.lt-edited { font-style: normal; font-size: 10.5px; color: var(--ink4); }
.lt-ied { display: flex; flex-direction: column; gap: 6px; margin-top: 5px; }
.lt-ied textarea {
  width: 100%; min-height: 64px; padding: 8px 10px; resize: vertical; outline: none;
  border: 1px solid var(--brand); border-radius: 9px; background: var(--card); color: var(--ink);
  font: 400 12.5px/1.45 var(--sans); box-shadow: 0 0 0 3px var(--brand-soft);
}
.lt-ied-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lt-ied-acts i { margin-left: 4px; font-style: normal; font-size: 10.5px; color: var(--ink4); }
.lt-item.link .lt-av { background: var(--info-soft); color: var(--info); }
.lt-item p {
  margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.lt-item p.lt-sys { color: var(--ink2); }
.lt-item.status p.lt-sys { color: var(--ok); font-weight: 500; }
.lt-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  margin-top: 6px; padding: 8px 12px 8px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); cursor: pointer; font: inherit; text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.lt-chip:hover { border-color: var(--brand); background: var(--brand-tint); }
.lt-chip svg { width: 17px; height: 17px; flex: none; color: var(--brand-deep); stroke-width: 1.8; }
.lt-chip b { min-width: 0; font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-chip i { flex: none; font-style: normal; font-size: 10.5px; color: var(--ink3); }

/* Поле записи — прижато к низу раздела, как в мессенджере. */
.lt-compose {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line2); background: var(--card);
}
.lt-compose textarea {
  flex: 1; min-width: 0; min-height: 38px; max-height: 160px; resize: none;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--raise); color: var(--ink);
  font: 400 12.5px/1.45 var(--sans); outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.lt-compose textarea:focus { border-color: var(--brand); background: var(--card); }
.lt-attach {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); color: var(--ink2); cursor: pointer;
  transition: .15s var(--ease);
}
.lt-attach:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }
.lt-attach svg { width: 18px; height: 18px; }
.pg .btn-brand.lt-send { flex: none; height: 38px; border-radius: 11px; }

/* Загрузки: полоса на файл. */
.lt-queue {
  display: flex; flex-direction: column; gap: 6px;
  padding: 9px var(--gut); border-bottom: 1px solid var(--line2); background: var(--raise);
}
.lt-card .lt-queue { border-top: 1px solid var(--line2); }
.lt-q {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 4px 10px;
  align-items: center; font-size: 11px;
}
.lt-q-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-q-bar { height: 4.5px; border-radius: 3px; background: var(--line2); overflow: hidden; }
.lt-q-bar i { display: block; height: 100%; background: var(--brand); transition: width .3s linear; }
.lt-q-st { color: var(--ink3); white-space: nowrap; text-align: right; }
.lt-q.bad .lt-q-name, .lt-q-err { color: var(--bad); }
.lt-q-err { grid-column: 2 / -1; text-align: right; }
.lt-queue #ltQClear { align-self: flex-start; margin-left: -7px; }

/* ── окна ─────────────────────────────────────────────────── */
.lt-form { display: flex; flex-direction: column; gap: 11px; width: min(470px, 94vw); }
.lt-form h3 { margin: 0 0 2px; font-size: 14.5px; }
.lt-form .fld textarea { resize: vertical; }
.lt-form .pf-modal-foot { margin-top: 4px; }
.lt-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lt-form-err {
  padding: 8px 11px; border-radius: 9px;
  background: var(--bad-soft); color: var(--bad); font-size: 11.5px;
}
.lt-form-err[hidden] { display: none; }
.lt-dirseg { display: flex; width: 100%; }
.lt-dirseg .seg-b {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; cursor: pointer; font-size: 12px;
}
.lt-dirseg .seg-b svg { width: 14px; height: 14px; }
.lt-dirseg .seg-b.on:first-child { color: var(--brand-deep); background: var(--brand-tint); }
.lt-dirseg .seg-b.on:last-child { color: var(--info); background: var(--info-soft); }
.lt-pickb {
  display: inline-flex; align-items: center; gap: 7px; width: fit-content;
  padding: 8px 13px; cursor: pointer; font-size: 12px;
}
.lt-pickb svg { width: 15px; height: 15px; }
.lt-pickf [data-picked] { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.lt-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-preset {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink2); cursor: pointer; font: inherit; font-size: 11.5px;
}
.lt-preset:hover { border-color: var(--ink3); color: var(--ink); }
.lt-preset.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.lt-danger { display: inline-flex; align-items: center; gap: 5px; color: var(--bad) !important; }
.lt-danger svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── цепочки ──────────────────────────────────────────────────
   Головное письмо и ответы под ним (заказчик, 28.09.2026). Слева у
   каждой строки — колонка цепочки: у головного — стрелка «раскрыть» и
   число писем, у ответов — линия от головного с отводом к письму.
   Колонки сведений у головного и у ответов одни и те же — на компьютере
   встают друг под другом. */
a.lt-row { text-decoration: none; -webkit-touch-callout: none; }
.lt-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.lt-page { --tg: calc(var(--gut) + 18px); }
.lt-th { border-bottom: 1px solid var(--line2); }
.lt-th .lt-row { border-bottom: 0; }
.lt-th.on { background: color-mix(in srgb, var(--raise) 55%, transparent); }
.lt-th-h { display: flex; align-items: stretch; }
.lt-th-h > .lt-row { flex: 1; min-width: 0; padding-left: 4px; }
.lt-tog {
  flex: none; width: var(--tg); display: flex; flex-direction: column; align-items: flex-end;
  justify-content: center; gap: 1px; padding: 0 3px 0 0;
  border: 0; background: none; color: var(--ink3); font: inherit;
}
button.lt-tog { cursor: pointer; }
button.lt-tog:hover { color: var(--brand-deep); }
.lt-tog svg { width: 15px; height: 15px; transform: rotate(-90deg); transition: transform .18s var(--ease); }
.lt-th.on .lt-tog svg { transform: none; }
.lt-tog i {
  min-width: 15px; font-style: normal; font-size: 10px; font-weight: 600; line-height: 1;
  text-align: center; font-variant-numeric: tabular-nums;
}
.lt-tog.hot i { color: var(--warn); }       /* среди ответов есть открытые */
.lt-th-b { display: none; padding-bottom: 4px; }
.lt-th.on .lt-th-b { display: block; }
.lt-th-b .lt-row { position: relative; min-height: 0; padding-left: calc(var(--tg) + 4px); }
.lt-th-b .lt-row::before, .lt-th-b .lt-row::after {
  content: ""; position: absolute; left: calc(var(--tg) - 11px); background: var(--line);
}
.lt-th-b .lt-row::before { top: 0; bottom: 0; width: 1.5px; }
.lt-th-b .lt-row.end::before { bottom: 50%; }
.lt-th-b .lt-row::after { top: 50%; width: 12px; height: 1.5px; }
.lt-to { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--ink2); }
.lt-to svg { width: 11px; height: 11px; flex: none; }
.lt-tog svg, .lt-to svg, .lt-gchip svg, .lt-chain svg, .lt-opt > svg, .lt-opt .lt-dir svg,
.lt-linkb svg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Поиск писем: в объекте — поле в шапке блока «Письма»; найденное —
   плоским списком, найденные слова подсвечены. */
.lt-lfind { flex: 0 1 260px; margin-left: auto; min-width: 0; }
.lt-lfind input { width: 100%; height: 30px; }
.lt-block-h:has(.lt-lfind) h3 { flex: none; }
.lt-found-h {
  padding: 12px var(--gut) 7px;
  font: 600 9.5px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3);
}
.lt-found .lt-list, #ltList .lt-found-h + .lt-list { border-top: 1px solid var(--line2); }
.lt-row mark, .lt-hit mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.lt-hit b { color: var(--ink2); font-weight: 600; }

/* Письмо: «ответ на» в карточке, кнопки ответа и закрытия, цепочка под
   карточкой. */
.lt-sum-acts { flex: none; display: flex; gap: 8px; }
@media (hover: hover) { #ltReply:hover { color: var(--brand-deep); border-color: var(--brand); } }
/* Связи письма: на что отвечает и что отвечает на него — две строки с
   явными «Изменить» и «Отвязать». */
.lt-links {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px var(--gut); border-bottom: 1px solid var(--line2);
}
.lt-link-row { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.lt-link-k {
  flex: none; width: 70px; padding-top: 5px;
  font: 600 9px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3);
}
.lt-link-v { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.lt-link-v .lnk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.lt-link-v .lnk svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lt-link-v .lnk.lt-warn { color: var(--bad); }
.lt-link-v .lt-gchip { max-width: 100%; }
.lt-gchip > a {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0;
  color: inherit; text-decoration: none;
}
.lt-gchip > a:hover { color: var(--brand-deep); }
.lt-kid { padding-right: 3px; }
.lt-x {
  flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-left: 2px;
  border: 0; border-radius: 999px; background: none; color: var(--ink4);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.lt-x:hover { background: var(--bad-soft); color: var(--bad); }
.lt-kids-for {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  font-size: 12px; color: var(--ink2);
}
.lt-kids-for span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-kids-for svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.lt-gchip { text-decoration: none; }
.lt-gchip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-width: 0;
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--ink); font: inherit; font-size: 11.5px; line-height: 17px; cursor: pointer;
}
.lt-gchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-gchip svg { width: 12px; height: 12px; flex: none; color: var(--ink3); }
.lt-gchip.none { border-style: dashed; color: var(--ink3); }
.lt-gchip:hover { border-color: var(--brand); color: var(--brand-deep); }

.lt-chain { border-bottom: 1px solid var(--line2); }
.lt-chain-h {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px var(--gut); border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; color: var(--ink2); text-align: left;
}
.lt-chain-h > span { flex: 1; min-width: 0; }
.lt-chain-h b { color: var(--ink); font-weight: 600; }
.lt-chain-h svg { width: 14px; height: 14px; flex: none; color: var(--ink3); }
.lt-chain-h svg:last-child { transform: rotate(-90deg); transition: transform .18s var(--ease); }
.lt-chain.on .lt-chain-h svg:last-child { transform: none; }
.lt-chain-h:hover { color: var(--ink); }
.lt-chain:not(.on) .lt-chain-list { display: none; }
.lt-chain-list { display: flex; flex-direction: column; gap: 1px; padding: 0 calc(var(--gut) - 8px) 10px; }
.lt-ch {
  display: grid; grid-template-columns: 16px 22px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none;
}
.lt-ch:hover { background: var(--raise); }
.lt-ch.cur { background: var(--brand-tint); cursor: default; }
.lt-ch-n { font-size: 10.5px; color: var(--ink3); text-align: right; font-variant-numeric: tabular-nums; }
.lt-ch .lt-dir { width: 22px; height: 22px; }
.lt-ch .lt-dir svg { width: 12px; height: 12px; }
.lt-ch-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lt-ch-main b {
  font-size: 12px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lt-ch.cur .lt-ch-main b { font-weight: 600; }
.lt-ch-main i {
  font-style: normal; font-size: 10.5px; color: var(--ink3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lt-ch.closed .lt-ch-main b { color: var(--ink2); }
.lt-ch.closed .lt-dir { filter: grayscale(1); opacity: .6; }
.lt-item.move .lt-av { background: var(--raise); color: var(--ink3); }

/* Окно письма: «Ответ на письмо» — кнопка с выбранным, под ней список
   писем объекта с поиском. */
.lt-linkb {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink3);
  font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.lt-linkb span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-linkb.on { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); }
.lt-linkb svg { width: 14px; height: 14px; flex: none; }
.lt-linkb svg:last-child { color: var(--ink4); transition: transform .18s var(--ease); }
.lt-linkb.open svg:last-child { transform: rotate(180deg); }
.lt-linkp { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lt-linkp[hidden] { display: none; }
.lt-linkp .lt-opts { max-height: 36vh; }
.lt-opts {
  display: flex; flex-direction: column; max-height: 44vh; overflow-y: auto;
  border: 1px solid var(--line2); border-radius: 10px;
}
.lt-opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 12.5px;
}
.lt-opt:last-child { border-bottom: 0; }
.lt-opt:hover { background: var(--raise); }
.lt-opt.on { background: var(--brand-tint); }
.lt-opt[hidden] { display: none; }
.lt-opt input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.lt-opt > svg { width: 15px; height: 15px; flex: none; color: var(--ink3); }
.lt-opt .lt-dir { width: 22px; height: 22px; }
.lt-opt .lt-dir svg { width: 12px; height: 12px; stroke-width: 2.2; }
.lt-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lt-opt-main b { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.lt-opt-main i { font-style: normal; font-size: 10.5px; color: var(--ink3); }

/* ── файлы объекта ────────────────────────────────────────────
   Те же папки, что во вкладке «Файлы» в «Объектах» (28.09.2026). На
   экране объекта — плитками, чтобы письма не уехали за край; нажал —
   тот же файловый экран, что в «Объектах», во всю высоту. */
.lt-folders {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px;
  padding: 0 var(--gut) 12px;
}
.lt-fold {
  position: relative; display: flex; min-width: 0;
  border: 1px solid var(--line2); border-radius: 9px; background: var(--card);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.lt-fold:hover { border-color: var(--brand); background: var(--brand-tint); }
.lt-fold-go {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  border: 0; border-radius: 9px; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.lt-fold:has(.lt-fold-del):hover .lt-fold-go { padding-right: 40px; }
/* Корзина — при наведении, чтобы четырнадцать значков не рябили. */
.lt-fold-del {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 0; border-radius: 7px; background: var(--card); color: var(--ink3);
  cursor: pointer; opacity: 0; transition: opacity .15s var(--ease);
}
.lt-fold:hover .lt-fold-del, .lt-fold-del:focus-visible { opacity: 1; }
.lt-fold-del:hover { background: var(--bad-soft); color: var(--bad); }
.lt-fold-del svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
@media (hover: none) { .lt-fold-del { opacity: .8; } }
.lt-fold.pin { border-color: color-mix(in srgb, var(--brand) 40%, var(--line2)); background: var(--brand-tint); }
.lt-fold-ico {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--raise); color: var(--ink2);
}
.lt-fold.pin .lt-fold-ico { background: var(--card); color: var(--brand-deep); }
.lt-fold-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.lt-fold-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lt-fold-main b {
  font-size: 12px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-fold-main i {
  font-style: normal; font-size: 10.5px; color: var(--ink3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-fpage .fl-host { flex: 1; min-height: 0; height: auto; }

/* ── телефон ──────────────────────────────────────────────────
   Поля уже, строки крупнее, окна встают снизу во всю ширину — до кнопок
   дотягивается большой палец. Шрифт в полях — 16px: на меньшем iPhone
   сам увеличивает страницу при вводе, и она так и остаётся увеличенной. */
/* Кнопка главного действия внизу экрана — «Новое письмо», «Загрузить». */
.lt-foot {
  flex: none; padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line2); background: var(--card);
}
.pg .lt-foot .btn-brand { width: 100%; height: 44px; border-radius: 12px; font-size: 13.5px;
  font-weight: 600; }
.pg .lt-foot .btn-brand svg { width: 16px; height: 16px; }
.lt-sub { font-size: 11.5px; color: var(--ink3); line-height: 1.4; }
.lt-proj .lt-file-ico { background: var(--brand-tint); color: var(--brand-deep); }
.lt-empty-top { padding-top: 16px; }

@media (max-width: 684px) {
  .lt-page { --gut: 14px; --lt-row: 52px; }
  /* Первые экраны — только главное: название и состояние. Номер, дата,
     заказчик, счётчики и последняя запись — внутри письма. */
  .lt-row { gap: 10px; padding: 10px var(--gut); }
  .lt-row-main { gap: 4px; }
  .lt-row-main > b { font-size: 14px; }
  .lt-row-main > i, .lt-cnt, .lt-last, .lt-hint, .lt-top .lt-h1 > i { display: none; }
  .lt-row-meta { margin-top: 0; }
  .lt-row-meta:not(:has(.lt-st)) { display: none; }
  .lt-dir { width: 26px; height: 26px; }
  .lt-dir svg { width: 13px; height: 13px; }
  .lt-let .lt-dir { margin-top: 0; }
  .lt-let { align-items: center; }
  .lt-block-h { padding: 12px var(--gut) 8px; }
  .lt-block-h h3 { font-size: 13px; }
  .lt-block + .lt-block, .lt-proj + .lt-block { border-top: 6px solid var(--raise); }
  .lt-proj { border-bottom: 0; }
  .lt-seg .seg-b { padding: 5px 11px; font-size: 12px; }
  .lt-file { padding: 9px var(--gut); }
  .lt-file-main .lt-file-name { display: none; }
  /* Письмо: карточка одной строкой без подписей. */
  .lt-sum { padding: 10px var(--gut); gap: 8px; }
  .lt-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
  .lt-facts dt { display: none; }
  .lt-facts dd { margin: 0; font-size: 12.5px; color: var(--ink2); }
  .lt-item { grid-template-columns: 26px minmax(0, 1fr); gap: 9px; padding: 9px 0; }
  .lt-av { width: 26px; height: 26px; font-size: 11px; }
  .lt-item p { font-size: 13.5px; }
  .lt-item-h .lt-del, .lt-item-h .lt-ed { display: none; }
  .lt-item.sel .lt-item-h .lt-del, .lt-item.sel .lt-item-h .lt-ed { display: grid; opacity: 1; }
  .lt-item.sel { background: var(--raise); margin: 0 calc(-1 * var(--gut)); padding-left: var(--gut);
    padding-right: var(--gut); }
  .lt-file-acts .ico.warn { display: none; }
  .lt-find input { max-width: none; }
  .lt-head .btn-brand span { display: none; }
  .lt-head .btn-brand { width: 36px; padding: 0; }
  .lt-head .btn-brand svg { width: 16px; height: 16px; }
  .pg-head.strip.lt-top { padding: 0 10px 0 var(--gut); }
  .lt-top .lt-h1 h2 {
    font-size: 14.5px; white-space: normal; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .pg-head.strip.lt-top { padding-top: 8px; padding-bottom: 8px; min-height: 52px; }
  .lt-block-h .btn-ghost.sm span { display: none; }
  .lt-block-h .btn-ghost.sm, .lt-block-h .btn-brand.sm { height: 34px; min-width: 38px; }
  .lt-block-h .btn-brand.sm span { display: inline; }
  .lt-sum { gap: 10px; }
  .pg .btn-ghost.lt-close { width: 100%; height: 36px; }
  .pg .btn-brand.lt-send { width: 42px; padding: 0; }
  .pg .btn-brand.lt-send span { display: none; }
  .pg .btn-brand.lt-send svg { width: 18px; height: 18px; }
  .lt-compose { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .lt-q { grid-template-columns: minmax(0, 1fr) 70px; }
  .lt-q-st, .lt-q-err { grid-column: 1 / -1; text-align: left; }
  .lt-compose textarea { font-size: 13.5px; }
  .lt-form input, .lt-form textarea, .lt-form select { font-size: 13.5px; }
  .lt-modal { align-items: flex-end; padding: 0; }
  .lt-form {
    width: 100%; max-width: 100%; max-height: 92vh; overflow-y: auto;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .lt-form .pf-modal-foot .btn { height: 42px; padding: 0 18px; }
  /* Цепочки, поиск, правка записи. */
  .lt-page { --tg: calc(var(--gut) + 16px); }
  .lt-tog i { font-size: 10.5px; }
  .lt-lfind { flex: 1 1 auto; }
  .lt-sum-acts { width: 100%; }
  .pg .lt-sum-acts .btn-ghost.lt-close { flex: 1 1 0; width: auto; min-width: 0; padding: 0 8px; }
  /* Найденное поиском — с объектом, номером и где нашлось: иначе на
     телефоне не понять, какое из похожих писем открывать. */
  .lt-let.found .lt-row-main > i { display: block; }
  .lt-let.found .lt-hit { display: -webkit-box; }
  .lt-ied textarea { font-size: 13.5px; }
  .lt-ied-acts i { display: none; }
  .lt-ied-acts .btn-brand, .lt-ied-acts .btn-ghost { height: 34px; }
  .lt-link-k { width: 58px; }
  .lt-link-v .lt-gchip { padding: 4px 10px; font-size: 12.5px; }
  .lt-link-v .lnk { font-size: 12.5px; }
  .lt-x { width: 24px; height: 24px; font-size: 16px; }
  .lt-ch { grid-template-columns: 14px 22px minmax(0, 1fr); }
  .lt-ch .lt-st { display: none; }
  .lt-opt { padding: 11px 12px; font-size: 13.5px; }
  .lt-opts { max-height: 50vh; }
}

/* ── компьютер: строка в одну линию ───────────────────────────
   Пользователь, 24.09.2026: «строки потоньше, распредели информацию на
   всю строку, чтобы больше входило». На широком экране сведения строки
   разложены по колонкам, а не стопкой у левого края. Колонки у всех строк
   одни и те же — встают друг под другом, как в таблице. Телефон — как был. */
@media (min-width: 685px) {
  .lt-page { --lt-row: 40px; }
  .lt-page .lt-row.lt-let, .lt-page .lt-row[data-site] {
    display: grid; align-items: center; column-gap: 16px;
    padding-top: 6px; padding-bottom: 6px;
  }
  .lt-row.lt-let .lt-row-main, .lt-row[data-site] .lt-row-main { display: contents; }
  .lt-row.lt-let .lt-row-main > b, .lt-row[data-site] .lt-row-main > b {
    font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .lt-row.lt-let .lt-row-meta, .lt-row[data-site] .lt-row-meta { margin: 0; flex-wrap: nowrap; }
  .lt-row.lt-let .lt-go, .lt-row[data-site] .lt-go { grid-column: -2; }
  .lt-row .lt-go svg { width: 14px; height: 14px; }

  /* Письмо: кто кому · о чём · номер и дата · состояние · последнее. */
  .lt-page .lt-row.lt-let {
    grid-template-columns: 26px minmax(0, 2.2fr) minmax(0, 1fr) 232px minmax(0, 1.6fr) 16px;
  }
  .lt-row.lt-let .lt-dir { width: 26px; height: 26px; margin: 0; }
  .lt-row.lt-let .lt-dirtxt { display: none; }      /* кто кому — значок слева */
  .lt-row.lt-let .lt-dir svg { width: 13px; height: 13px; }
  .lt-row.lt-let .lt-last {
    display: block; margin: 0; -webkit-line-clamp: unset;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink3);
  }
  .lt-row.lt-let .lt-last b { font-weight: 500; color: var(--ink2); }

  /* Объект: название · заказчик и адрес · состояние и счётчики. */
  .lt-page .lt-row[data-site] {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) 280px 16px;
  }

  /* Файл проекта: что это · кто и когда · файл и размер · действия. */
  .lt-file { gap: 12px; padding-top: 5px; padding-bottom: 5px; }
  .lt-file-ico { width: 28px; height: 28px; border-radius: 8px; }
  .lt-file-ico svg { width: 15px; height: 15px; }
  .lt-file-main {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: 16px; align-items: center;
  }
  .lt-file-main .lt-file-name { font-size: 11px; }
}
/* Поуже — без колонки «последнее»: о чём письмо важнее. */
@media (min-width: 685px) and (max-width: 1199px) {
  .lt-page .lt-row.lt-let { grid-template-columns: 26px minmax(0, 2fr) minmax(0, 1fr) 232px 16px; }
  .lt-row.lt-let .lt-last { display: none; }
  .lt-page .lt-row[data-site] { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 280px 16px; }
}
