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

   30.09.2026 раздел переделан как почтовая программа: объекты слева,
   переписки посередине, письмо справа; на телефоне и в узком окне —
   лестница экранов. Главный язык раздела — мяч: «Надо ответить»
   фирменным цветом (действие за нами), «Ждём ответа» синим (ждём их),
   «Закрыто» зелёным. Дни ожидания краснеют отдельно от цвета стороны. */

.lx { --lx-p1: 264px; --lx-p2: 380px; }
.lx .pg-body, .lx-convs, .lx-objs, .lx-read-b { overscroll-behavior: contain; }
.lx svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── колонки ──────────────────────────────────────────────── */
.pg.lx-split { flex-direction: row; background: var(--card); }
.lx-p1, .lx-p2 {
  flex: none; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line2);
}
.lx-p1 { width: var(--lx-p1); background: var(--raise); }
.lx-p2 { width: var(--lx-p2); background: var(--card); }
.lx-p3, .lx-files { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.lx-p3 { background: color-mix(in srgb, var(--raise) 55%, var(--card)); container-type: inline-size; }
.lx-p3.reading { background: var(--card); }
.lx-split.mid { --lx-p2: 340px; }
@media (max-width: 1440px) { .lx-split.wide { --lx-p1: 240px; --lx-p2: 350px; } }

/* Поле поиска внутри колонки. */
.lx-find {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center;
}
.lx-find svg {
  position: absolute; left: 10px; width: 13.5px; height: 13.5px; color: var(--ink3); pointer-events: none;
}
.lx-find input {
  width: 100%; height: 32px; padding: 0 10px 0 30px;
  border: 1px solid var(--line2); border-radius: 9px; background: var(--card); color: var(--ink);
  font: 400 11.5px var(--sans); outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.lx-find input::placeholder { color: var(--ink3); }
.lx-find input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lx-ib {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line2); border-radius: 9px; background: var(--card);
  color: var(--ink2); font: 400 20px/1 var(--sans); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.lx-ib:hover { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-tint); }
.lx-ib svg { width: 15px; height: 15px; }

/* ── объекты: колонка слева ───────────────────────────────── */
.lx-p1-h { flex: none; display: flex; gap: 8px; padding: 14px 12px 10px; }
.lx-objs { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 14px; }
.lx-obj {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 1px 0; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background .12s var(--ease);
}
.lx-obj:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.lx-obj.sel { background: var(--card); box-shadow: 0 1px 2px rgba(29, 28, 25, .08), 0 0 0 1px var(--line2); }
.lx-obj.sel::before {
  content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.lx-obj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lx-obj-main b {
  font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lx-obj-main i { font-style: normal; font-size: 10.5px; color: var(--ink3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.lx-obj.s1 .lx-obj-main i { color: var(--warn); }
.lx-obj.s2 .lx-obj-main i { color: var(--bad); }
.lx-obj.quiet .lx-obj-main b { font-weight: 500; color: var(--ink2); }
.lx-obj.all { margin-bottom: 6px; }
.lx-obj-ic {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand); color: var(--on-brand);
  box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--brand) 70%, transparent);
}
.lx-obj-ic svg { width: 16px; height: 16px; }
.lx-bdgs { flex: none; display: inline-flex; gap: 4px; }
.lx-bdg {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center;
  border-radius: 999px; font: 600 10.5px var(--sans); font-variant-numeric: tabular-nums;
}
.lx-bdg.need { background: var(--brand); color: var(--on-brand); }
.lx-bdg.wait { background: var(--info-soft); color: var(--info); }
.lx-h {
  display: flex; align-items: center; gap: 6px; width: 100%; margin: 10px 0 4px; padding: 0 10px;
  border: 0; background: none; font: 600 9.5px var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink3); text-align: left;
}
.lx-h i { font-style: normal; font-weight: 500; letter-spacing: 0; color: var(--ink4, var(--ink3)); }
.lx-h-tog { cursor: pointer; padding-top: 4px; padding-bottom: 4px; border-radius: 8px; }
.lx-h-tog:hover { color: var(--ink); }
.lx-h-tog svg { width: 12px; height: 12px; transform: rotate(-90deg); transition: transform .15s var(--ease); }
.lx-h-tog.on svg { transform: none; }
.lx-none { padding: 14px 12px; font-size: 11.5px; line-height: 1.5; color: var(--ink3); }

/* ── переписки: средняя колонка ───────────────────────────── */
.lx-p2-h { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; }
.lx-p2-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lx-p2-t b { font-size: 15px; font-weight: 650; letter-spacing: -.015em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-p2-t i { font-style: normal; font-size: 10.5px; color: var(--ink3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.lx-p2-tools { flex: none; display: flex; gap: 8px; padding: 0 14px 8px 16px; }
.lx-tool {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border: 1px solid var(--line2); border-radius: 9px; background: var(--card); color: var(--ink2);
  font: 500 11.5px var(--sans); cursor: pointer;
}
.lx-tool:hover, .lx-tool.on { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-tint); }
.lx-tool svg { width: 14px; height: 14px; }

.lx-chips {
  flex: none; display: flex; gap: 6px; padding: 2px 14px 10px 16px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line2);
}
.lx-chips::-webkit-scrollbar { display: none; }
.lx-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--card); color: var(--ink2);
  font: 500 11px var(--sans); white-space: nowrap; cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease), border-color .12s var(--ease);
}
.lx-chip:hover { border-color: var(--line); color: var(--ink); }
.lx-chip i { font-style: normal; font-size: 10.5px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.lx-chip.need::before, .lx-chip.wait::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
}
.lx-chip.wait::before { background: var(--info); }
.lx-chip.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.lx-chip.on i { color: color-mix(in srgb, var(--card) 70%, transparent); }

.lx-convs { flex: 1; min-height: 0; overflow-y: auto; }
.lx-conv {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px;
  padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line2);
  color: inherit; text-decoration: none; -webkit-touch-callout: none;
  transition: background .12s var(--ease);
}
.lx-conv:hover { background: var(--raise); }
.lx-conv:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.lx-conv.sel { background: color-mix(in srgb, var(--brand-tint) 80%, var(--card)); }
.lx-conv.sel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand);
}
.lx-conv-ic {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
}
.lx-conv-ic svg { width: 15px; height: 15px; stroke-width: 2.2; }
.lx-conv-ic.need { background: var(--brand-tint); color: var(--brand-deep); }
.lx-conv-ic.wait { background: var(--info-soft); color: var(--info); }
.lx-conv-ic.done { background: var(--ok-soft); color: var(--ok); opacity: .75; }
.lx-conv-b { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lx-conv-t { display: flex; align-items: flex-start; gap: 8px; }
.lx-conv-t b {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.38; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lx-conv.done .lx-conv-t b { font-weight: 500; color: var(--ink2); }
.lx-conv-m {
  display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 10.5px; color: var(--ink3); line-height: 1.45;
}
.lx-conv-m > * { flex: none; }
.lx-conv-m > .lx-conv-site { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lx-conv-m > i { font-style: normal; color: var(--ink4, var(--ink3)); }
.lx-side { font-weight: 600; }
.lx-side.need { color: var(--brand-deep); }
.lx-side.wait { color: var(--info); }
.lx-conv-site { font-weight: 600; color: var(--ink2); }
.lx-conv-n { display: inline-flex; align-items: center; gap: 3px; }
.lx-conv-n svg { width: 11px; height: 11px; }
.lx-conv-l {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  font-size: 11px; color: var(--ink2); line-height: 1.45;
}
.lx-conv-l, .lx-conv-l > b, .lx-conv-l > em { white-space: nowrap; }
.lx-conv-l { overflow: hidden; text-overflow: ellipsis; }
.lx-conv-l > b { flex: none; font-weight: 600; color: var(--ink); }
.lx-conv-l > b::after { content: ":"; }
.lx-conv-l > em { flex: none; margin-left: auto; padding-left: 6px; font-style: normal; font-size: 10.5px;
  color: var(--ink4, var(--ink3)); }
.lx-hit > b::after { content: ":"; }
.lx-l-dir { flex: none; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; }
.lx-l-dir svg { width: 10px; height: 10px; stroke-width: 2.6; }
.lx-l-dir.in { background: var(--info-soft); color: var(--info); }
.lx-l-dir.out { background: var(--brand-tint); color: var(--brand-deep); }
.lx-found-h {
  padding: 12px 16px 6px; font: 600 9.5px var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink3); border-bottom: 1px solid var(--line2);
}
.lx-conv mark, .lx-hit mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Дни ожидания: неделя — жёлтым, две — красным. */
.lx-age {
  flex: none; display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 999px;
  background: var(--box-bg); color: var(--ink2);
  font: 600 10.5px var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lx-age.s1 { background: var(--warn-soft); color: var(--warn); }
.lx-age.s2 { background: var(--bad-soft); color: var(--bad); }

/* Пусто и загрузка. */
.lx-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 26px; text-align: center; color: var(--ink3); font-size: 11.5px; line-height: 1.55;
}
.lx-empty > svg {
  width: 46px; height: 46px; padding: 12px; border-radius: 50%;
  background: var(--raise); color: var(--ink3); stroke-width: 1.8;
}
.lx-empty.good > svg { background: var(--ok-soft); color: var(--ok); stroke-width: 2.4; }
.lx-empty b { font-size: 13px; font-weight: 600; color: var(--ink); }
.lx-empty span { max-width: 34ch; }
.lx-state-msg {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 160px; padding: 24px; text-align: center; color: var(--ink3); font-size: 11.5px;
}
.lx-state-msg b { color: var(--ink); font-size: 13px; }
.lx-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line2); border-top-color: var(--brand);
  animation: lx-spin .75s linear infinite;
}
@keyframes lx-spin { to { transform: rotate(360deg); } }

/* ── выбор объекта над списком (средняя ширина) ───────────── */
.lx-ctxw { position: relative; flex: 1; min-width: 0; }
.lx-ctx {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 8px 4px 4px;
  border: 1px solid transparent; border-radius: 11px; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.lx-ctx:hover, .lx-ctx[aria-expanded="true"] { border-color: var(--line2); background: var(--raise); }
.lx-ctx-ic {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand); color: var(--on-brand);
}
.lx-ctx-ic svg { width: 16px; height: 16px; }
.lx-ctx-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lx-ctx-t b { font-size: 14px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.lx-ctx-t i { font-style: normal; font-size: 10.5px; color: var(--ink3); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.lx-ctx > svg { flex: none; width: 15px; height: 15px; color: var(--ink3); transition: transform .15s var(--ease); }
.lx-ctx[aria-expanded="true"] > svg { transform: rotate(180deg); }
.lx-ctxpop {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(340px, 86vw);
  max-height: min(520px, 70vh); overflow-y: auto; padding: 6px 8px 10px;
  background: var(--raise); border: 1px solid var(--line2); border-radius: 14px;
  box-shadow: var(--shadow-float);
}

/* ── правая колонка без письма: сводка и объект ───────────── */
.lx-dash {
  width: 100%; max-width: 780px; margin: 0 auto; padding: 44px 32px 32px;
  display: flex; flex-direction: column; gap: 24px; overflow-y: auto;
}
.lx-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.lx-hero-ic {
  display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 4px; border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: var(--on-brand);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 80%, transparent);
}
.lx-hero-ic svg { width: 28px; height: 28px; stroke-width: 1.8; }
.lx-hero.calm .lx-hero-ic { background: linear-gradient(135deg, #34c07a, var(--ok));
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--ok) 80%, transparent); }
.lx-hero h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.lx-hero p { margin: 0; font-size: 12px; color: var(--ink3); }
.lx-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lx-kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (min-width: 640px) { .lx-kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lx-kpi {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 16px 15px; border: 1px solid var(--line2); border-radius: 14px; background: var(--card);
  color: inherit; font: inherit; text-align: left;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
button.lx-kpi { cursor: pointer; }
button.lx-kpi:hover { transform: translateY(-1px); border-color: var(--line);
  box-shadow: 0 10px 24px -16px rgba(29, 28, 25, .45); }
.lx-kpi-ic {
  display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 8px; border-radius: 8px;
  background: var(--raise); color: var(--ink2);
}
.lx-kpi-ic svg { width: 15px; height: 15px; stroke-width: 2.2; }
.lx-kpi > b { font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.lx-kpi > span:not(.lx-kpi-ic) { font-size: 11.5px; font-weight: 600; color: var(--ink2); }
.lx-kpi > i { font-style: normal; font-size: 10.5px; color: var(--ink3); }
.lx-kpi.need .lx-kpi-ic { background: var(--brand-tint); color: var(--brand-deep); }
.lx-kpi.need > b { color: var(--brand-deep); }
.lx-kpi.wait .lx-kpi-ic { background: var(--info-soft); color: var(--info); }
.lx-kpi.wait > b { color: var(--info); }
.lx-kpi.hot .lx-kpi-ic { background: var(--bad-soft); color: var(--bad); }
.lx-kpi.hot > b { color: var(--bad); }
.lx-kpi.ok .lx-kpi-ic { background: var(--ok-soft); color: var(--ok); }
.lx-kpi.ok > b { color: var(--ok); }

.lx-home { max-width: none; padding: 26px 28px 30px; gap: 20px; }
.lx-home-h { display: flex; align-items: center; gap: 14px; }
.lx-home-ic {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: var(--brand-tint); color: var(--brand-deep);
}
.lx-home-ic svg { width: 22px; height: 22px; stroke-width: 1.8; }
.lx-home-h h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.lx-home-h i { display: block; margin-top: 2px; font-style: normal; font-size: 11.5px; color: var(--ink3); }

/* Секции справа: подпись мелкими прописными, счётчик, действия. */
.lx-sec { display: flex; flex-direction: column; gap: 8px; }
.lx-sec-h {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 0;
  border: 0; background: none; color: var(--ink3); font: inherit; text-align: left;
}
.lx-sec-h > span:first-child {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 9.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3);
}
.lx-sec-h > span:first-child svg { width: 12px; height: 12px; }
.lx-sec-h > i { font-style: normal; font-size: 10.5px; color: var(--ink4, var(--ink3)); }
.lx-sec-h .grow { flex: 1; }
.lx-sec-h .lnk { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.lx-sec-h .lnk svg { width: 12px; height: 12px; }

/* ── письмо ───────────────────────────────────────────────── */
.lx-read { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lx-read-h { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 24px 14px;
  border-bottom: 1px solid var(--line2); }
.lx-read-h .lx-subj { margin: 0; }
.lx-read-top { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.lx-read-top .lx-ib:first-of-type { margin-left: auto; }
.lx-crumb {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 70%;
  padding: 4px 9px 4px 7px; border: 1px solid var(--line2); border-radius: 999px; background: var(--raise);
  color: var(--ink2); font: 500 11px var(--sans); cursor: pointer;
}
.lx-crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-crumb svg { flex: none; width: 13px; height: 13px; }
.lx-crumb:hover { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-tint); }
.lx-crumb-sp { flex: 1; }
.lx-subj {
  margin: 8px 0 0; font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.015em; color: var(--ink);
  overflow-wrap: anywhere;
}
.lx-read-b {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
  padding: 14px 24px 22px;
}
.lx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 11.5px; color: var(--ink2); }
.lx-meta-dir { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.lx-meta-dir svg { width: 14px; height: 14px; stroke-width: 2.4; }
.lx-meta-dir.in { color: var(--info); }
.lx-meta-dir.out { color: var(--brand-deep); }
.lx-meta-by { color: var(--ink3); }

/* Состояние — крупной плашкой с действиями: главное на экране письма. */
.lx-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px;
  padding: 13px 14px; border-radius: 14px; border: 1px solid;
}
.lx-status.need { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.lx-status.wait { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.lx-status.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.lx-status-ic {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff;
}
.lx-status-ic svg { width: 18px; height: 18px; stroke-width: 2.4; }
.lx-status.need .lx-status-ic { background: var(--brand); }
.lx-status.wait .lx-status-ic { background: var(--info); }
.lx-status.done .lx-status-ic { background: var(--ok); }
.lx-status-t { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lx-status-t b { font-size: 14px; font-weight: 650; color: var(--ink); }
.lx-status-t b .lx-age { vertical-align: 1px; }
.lx-status-t i { font-style: normal; font-size: 11px; color: var(--ink2); }
.lx-status-acts { flex: none; display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.lx-act {
  display: inline-flex; align-items: center; gap: 6px; height: 33px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  font: 600 11.5px var(--sans); cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.lx-act svg { width: 14px; height: 14px; stroke-width: 2.2; }
.lx-act:hover { border-color: var(--brand); color: var(--brand-deep); }
.lx-act.prim { background: var(--ok); border-color: var(--ok); color: #fff; }
.lx-act.prim:hover { filter: brightness(.94); color: #fff; }

/* Переписка — заголовок секции и стрелка свернуть. */
.lx-chain-h { cursor: pointer; }
.lx-chain-h > svg:last-child { width: 14px; height: 14px; color: var(--ink3); transform: rotate(-90deg);
  transition: transform .15s var(--ease); }
.lx-chain.on .lx-chain-h > svg:last-child { transform: none; }

/* ── переписка целиком (09.10.2026) ─────────────────────────
   Каждое письмо цепочки — карточкой на общей линии по датам: что за
   письмо и на что отвечает, сканы и файлы, записи. Это письмо — рамкой
   фирменного цвета; его журнал — ниже. */
.lx-chain-bar { display: flex; align-items: center; gap: 10px; }
.lx-chain-bar .lx-chain-h { flex: 1; min-width: 0; }
.lx-th-all { flex: none; font-size: 11px; }
.lx-thread:not(.on) .lx-th-all, .lx-thread:not(.on) .lx-th-l, .lx-thread:not(.on) .lx-links { display: none; }
.lx-th-l { position: relative; display: flex; flex-direction: column; gap: 8px; }
.lx-th-l::before {
  content: ""; position: absolute; left: 7px; top: 18px; bottom: 18px; width: 2px;
  border-radius: 2px; background: var(--line2);
}
.lx-th { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; }
.lx-th-dot {
  position: relative; margin-top: 15px; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid var(--card); background: var(--ink4, var(--line)); box-shadow: 0 0 0 1px var(--line2);
}
.lx-th.need .lx-th-dot { background: var(--brand); }
.lx-th.wait .lx-th-dot { background: var(--info); }
.lx-th.done .lx-th-dot { background: var(--ok); }
.lx-th-c {
  min-width: 0; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px 11px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card);
}
.lx-th.cur .lx-th-c { border-color: color-mix(in srgb, var(--brand) 55%, var(--line2));
  background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.lx-th.cur .lx-th-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent); }
.lx-th-h {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 0; border: 0;
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.lx-chain-h i { white-space: nowrap; }
@media (max-width: 684px) {
  .lx-th-all { display: none; }
  .lx-th { grid-template-columns: 14px minmax(0, 1fr); gap: 8px; }
  .lx-th-l::before { left: 6px; }
  .lx-th-dot { width: 14px; height: 14px; margin-top: 13px; }
  .lx-th-c { padding: 9px 10px 10px; }
  .lx-th-no { flex-shrink: 0; }
}
.lx-th-h:disabled { cursor: default; }
.lx-th-h .grow { flex: 1; }
.lx-th-h > svg { flex: none; width: 14px; height: 14px; color: var(--ink3); transition: transform .15s var(--ease); }
.lx-th.shut .lx-th-h > svg { transform: rotate(-90deg); }
.lx-th-dir {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px;
  border-radius: 999px; font: 600 10.5px var(--sans);
}
.lx-th-dir svg { width: 12px; height: 12px; stroke-width: 2.4; }
.lx-th-dir.in { background: var(--brand-tint); color: var(--brand-deep); }
.lx-th-dir.out { background: var(--info-soft, color-mix(in srgb, var(--info) 12%, var(--card))); color: var(--info); }
.lx-th-no { min-width: 0; font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; }
.lx-th-st { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.lx-th-st svg { width: 11px; height: 11px; stroke-width: 3; }
.lx-th-st.need { color: var(--brand-deep); }
.lx-th-st.wait { color: var(--info); }
.lx-th-st.done { color: var(--ok); }
.lx-th-here { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff;
  font: 600 10px var(--sans); }
.lx-th-s { font-size: 13px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.lx-th.done:not(.cur) .lx-th-s { color: var(--ink2); }
.lx-th-sub { font-size: 11px; color: var(--ink3); line-height: 1.45; }
.lx-th-files { display: flex; flex-wrap: wrap; gap: 6px; }
.lx-th-files .lt-chip { max-width: 100%; }
.lx-th-nof, .lx-th-more { font-size: 10.5px; color: var(--ink3); }
button.lx-th-more { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
button.lx-th-more svg { width: 12px; height: 12px; }
.lx-th-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--line2); padding-top: 8px; }
.lx-th-notes li { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lx-th-who { font-size: 10.5px; font-weight: 600; color: var(--ink2); }
.lx-th-who time { margin-left: 6px; font-weight: 400; color: var(--ink3); }
.lx-th-t { font-size: 12px; color: var(--ink); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.lx-th-notes li.status .lx-th-t { color: var(--ok); font-weight: 600; }
.lx-th-acts { display: flex; justify-content: flex-end; }
.lx-th-go { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--brand-deep);
  text-decoration: none; }
.lx-th-go svg { width: 13px; height: 13px; }
.lx-th.shut .lx-th-acts { margin-top: -2px; }

.lx-links {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border: 1px dashed var(--line2); border-radius: 12px;
}
.lx-link-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.lx-link-k {
  flex: none; width: 64px; padding-top: 4px;
  font: 600 9px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3);
}
.lx-link-v { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lx-link-v .lnk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.lx-link-v .lnk svg { width: 13px; height: 13px; flex: none; }
.lx-link-v .lnk.lt-warn { color: var(--bad); }
.lx-log .lt-feed { padding: 0; }
.lx-solo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 11px; color: var(--ink3);
}
.lx-solo svg { width: 13px; height: 13px; }
.lx-solo .lnk { font-size: 11px; }
/* Служебные записи — тихой строкой: связали, перенесли, закрыли. Журнал
   читается по людям и делам, а не по тому, что платформа сделала сама. */
.lt-item.move, .lt-item.link { padding: 5px 0; grid-template-columns: 30px minmax(0, 1fr); align-items: center; }
.lt-item.move .lt-av, .lt-item.link .lt-av { width: 22px; height: 22px; justify-self: center; }
.lt-item.move .lt-av svg, .lt-item.link .lt-av svg { width: 11px; height: 11px; }
.lt-item.move .lt-item-b, .lt-item.link .lt-item-b { display: flex; flex-direction: row-reverse;
  justify-content: flex-end; align-items: baseline; gap: 8px; min-width: 0; }
.lt-item.move .lt-item-h, .lt-item.link .lt-item-h { flex: none; min-height: 0; }
.lt-item.move .lt-item-h b, .lt-item.link .lt-item-h b { display: none; }
.lt-item.move p.lt-sys, .lt-item.link p.lt-sys { margin: 0; font-size: 11px; color: var(--ink3);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-item.move + .lt-item.move, .lt-item.link + .lt-item.link, .lt-item.move + .lt-item.link,
.lt-item.link + .lt-item.move { border-top: 0; }

/* ── файлы объекта на широком экране ──────────────────────── */
.lx-files-h { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line2); }
.lx .fl-host { flex: 1; min-height: 0; height: auto; }

/* ── лестница экранов: узкое окно и телефон ───────────────── */
.lx-one .lx-body { flex: 1; min-height: 0; overflow-y: auto; }
.pg.lx-one #lxObjs { padding: 10px 12px 18px; }
.lx-one .lx-obj { padding: 11px 12px; }
.lx-one .lx-obj-main b { font-size: 13px; }
.lx-one .lx-obj.all {
  margin-bottom: 8px; padding: 13px 14px; background: var(--card);
  border: 1px solid var(--line2); border-radius: 14px;
}
.lx-one-tools { position: sticky; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px;
  padding: 10px var(--gut) 0; background: var(--card); }
.lx-one-tools .lx-chips { padding: 0 0 10px; margin: 0 calc(-1 * var(--gut)); padding-left: var(--gut);
  padding-right: var(--gut); }
.lx-one .lx-conv { padding-left: var(--gut); padding-right: var(--gut); }
.lx-seg2 {
  flex: none; display: flex; gap: 4px; margin: 0 var(--gut) 0; padding: 3px;
  background: var(--raise); border: 1px solid var(--line2); border-radius: 11px;
}
.lx-seg2 button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px;
  border: 0; border-radius: 8px; background: none; color: var(--ink2); font: 500 12px var(--sans); cursor: pointer;
}
.lx-seg2 button svg { width: 14px; height: 14px; }
.lx-seg2 button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 28, 25, .08); }
.lx-one .lt-top + .lx-seg2 { margin-top: 2px; margin-bottom: 4px; }
.lx-one.lt-card .lx-read-b { padding-left: var(--gut); padding-right: var(--gut); }

/* ── прежние части: шапки телефона, журнал, поле записи, окна ── */
.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-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-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-feed { padding: 0; }
.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: 700;
}
.lt-av svg { width: 14px; height: 14px; stroke-width: 2.4; }
.lt-av.who { background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 45% 34%); }
[data-theme="dark"] .lt-av.who { background: hsl(var(--h) 28% 24%); color: hsl(var(--h) 70% 80%); }
.lt-item.sys .lt-av { background: none; color: var(--ink4, var(--ink3)); 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.link .lt-av { background: var(--info-soft); color: var(--info); }
.lt-item.move .lt-av { background: var(--raise); color: var(--ink3); }
.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, var(--ink3)); }
.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, var(--ink3)); }
.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: 600; }
.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 24px 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 12px; border-radius: 10px; background: var(--raise);
}
.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-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.lt-fold {
  position: relative; display: flex; min-width: 0;
  border: 1px solid var(--line2); border-radius: 10px; 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: 8px 10px;
  border: 0; border-radius: 10px; 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; }
@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; stroke-width: 1.8; }
.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-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; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.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-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; }
.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; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.lt-linkb svg:last-child { color: var(--ink4, var(--ink3)); 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); fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lt-opt .lt-dir { width: 22px; height: 22px; }
.lt-opt .lt-dir svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round;
  stroke-linejoin: round; }
.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); }
.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; }
.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:hover { border-color: var(--brand); color: var(--brand-deep); }
.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, var(--ink3));
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.lt-x:hover { background: var(--bad-soft); color: var(--bad); }

/* ── средняя ширина: колонка объектов — выпадающим выбором ─── */
.lx-split.mid .lx-p2-h { padding-left: 12px; }

/* ── телефон ──────────────────────────────────────────────────
   Поля уже, строки крупнее, окна встают снизу во всю ширину — до кнопок
   дотягивается большой палец. Шрифт в полях — 16px: на меньшем iPhone
   сам увеличивает страницу при вводе. */
@media (max-width: 684px) {
  .lx { --gut: 14px; }
  .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: 8px 10px 8px var(--gut); min-height: 52px; }
  .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;
  }
  .lx-find input, .lt-compose textarea, .lt-form input, .lt-form textarea, .lt-form select,
  .lt-ied textarea { font-size: 16px; }
  .lx-conv { gap: 10px; padding-top: 11px; padding-bottom: 11px; }
  .lx-conv-t b { font-size: 13.5px; }
  .lx-conv-l { font-size: 11.5px; }
  .lx-read-b { padding: 12px var(--gut) 18px; gap: 14px; }
  .lx-status { padding: 12px; }
  .lx-status-acts { width: 100%; }
  .lx-act { flex: 1 1 0; justify-content: center; height: 40px; }
  .lx-link-k { width: 56px; }
  .lx-link-v .lt-gchip { padding: 4px 10px; font-size: 12.5px; }
  .lx-link-v .lnk { font-size: 12.5px; }
  .lt-x { width: 24px; height: 24px; font-size: 16px; }
  .lt-item { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .lt-av { width: 28px; height: 28px; 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-compose { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .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-q { grid-template-columns: minmax(0, 1fr) 70px; }
  .lt-q-st, .lt-q-err { grid-column: 1 / -1; text-align: left; }
  .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-opt { padding: 11px 12px; font-size: 13.5px; }
  .lt-opts { max-height: 50vh; }
  .lt-folders { grid-template-columns: 1fr; }
}

/* ── реестр корреспонденции в «Письмах» (06.10.2026) ───────── */
/* Вход в реестр — под объектами, как отдельная полка: не объект и не
   письмо, а журнал. Видят те, кому выдано право. */
.lx-regb {
  flex: none; display: flex; align-items: center; gap: 10px; margin: 0 8px 10px; padding: 8px 10px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--card);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.lx-regb:hover { border-color: var(--brand); background: var(--brand-tint); }
.lx-regb .lx-obj-ic { background: var(--raise); color: var(--brand-deep); box-shadow: none; }
.lx-regb > svg { width: 14px; height: 14px; flex: none; color: var(--ink3); }
.lt-head .lt-regb { flex: none; width: 36px; padding: 0; }
.lt-head .lt-regb svg { width: 16px; height: 16px; }
.lx-reg-add { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; }
.lx-reg-add svg { width: 13px; height: 13px; }

/* Письмо из реестра: номер регистрации и сканы — плашкой под шапкой. */
.lx-reg {
  display: flex; flex-direction: column; gap: 5px; margin-top: 8px; padding: 8px 11px;
  border-radius: 10px; background: var(--raise); font-size: 11.5px;
}
.lx-reg-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.lx-reg-no { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); }
.lx-reg-no svg { width: 14px; height: 14px; flex: none; color: var(--brand-deep); }
.lx-reg-no b { font-weight: 600; color: var(--ink); }
.lx-reg-no i { font-style: normal; color: var(--ink3); margin-left: 4px; }
.lx-reg-h .lnk { margin-left: auto; font-size: 11.5px; }
.lx-reg-who { color: var(--ink2); line-height: 1.45; }
.lx-reg-files { display: flex; flex-wrap: wrap; gap: 6px; }
.lx-reg-files .lt-chip { margin-top: 2px; padding: 6px 10px 6px 8px; }

/* Приказы по объекту — мастеру на странице объекта. */
.lx-ord-l { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: 10px;
  background: var(--card); }
.lx-ord { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--line2); }
.lx-ord:last-child { border-bottom: 0; }
.lx-ord-no { display: flex; flex-direction: column; gap: 1px; font-size: 12px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums; }
.lx-ord-no i { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--ink3); }
.lx-ord-b { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lx-ord-b b { font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.lx-ord-b > i { font-style: normal; font-size: 10.5px; color: var(--ink3); }
.lx-ord-f { display: flex; flex-wrap: wrap; gap: 6px; }
.lx-ord-f .lt-chip { margin-top: 4px; padding: 5px 9px 5px 7px; }
.lx-ord-f .lt-chip svg { width: 15px; height: 15px; }
.lx-ord-none { padding: 10px 12px; border: 1px dashed var(--line2); border-radius: 10px;
  font-size: 11.5px; color: var(--ink3); line-height: 1.45; }
/* На телефоне — свёрнутой строкой над письмами объекта. */
.lx-ord-d { margin: 0 var(--gut, 16px) 8px; border: 1px solid var(--line2); border-radius: 11px; background: var(--card); }
.lx-ord-d > summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--ink);
}
.lx-ord-d > summary::-webkit-details-marker { display: none; }
.lx-ord-d > summary svg { width: 15px; height: 15px; flex: none; color: var(--brand-deep); }
.lx-ord-d > summary b { font-weight: 600; }
.lx-ord-d > summary i { font-style: normal; color: var(--ink3); }
.lx-ord-d > summary svg:last-child { margin-left: auto; color: var(--ink3); transition: transform .15s var(--ease); }
.lx-ord-d[open] > summary svg:last-child { transform: rotate(180deg); }
.lx-ord-d .lx-orders { padding: 0 10px 10px; }
.lx-ord-d .lx-orders .lx-sec-h { display: none; }
@media (max-width: 684px) {
  .lx-ord { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .lx-ord-no { flex-direction: row; gap: 8px; align-items: baseline; }
}

/* Наши компании (06.10.2026): переписка у АДС-ЭЛЕКТРО и АДС-ЭЛЕКТРОМОНТАЖ
   своя — кнопки над объектами и в окне письма, метка в карточке. */
.lx-orgs { display: flex; width: 100%; margin: 0 0 8px; }
.lx-orgs .seg-b { flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 6px; font-size: 11px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-orgs .seg-b:first-child { flex: none; padding: 0 10px; }
.lx-orgs .seg-b.on { color: var(--brand-deep); background: var(--brand-tint); }
.lx-body .lx-orgs { margin: 8px 0; }
.lt-orgseg { display: flex; width: 100%; }
.lt-orgseg .seg-b { flex: 1; display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 10px; font-size: 12px; cursor: pointer; }
.lt-orgseg .seg-b.on { color: var(--brand-deep); background: var(--brand-tint); }
.lx-meta-org { padding: 1px 8px; border-radius: 999px; background: var(--raise); color: var(--ink2);
  font-size: 11px; font-weight: 500; }

/* Тема письма (заказчик, 12.10.2026): финансы и сметный видят не все —
   метка заметная. Способ получения или передачи — строкой в плашке
   реестра: для суда. */
.lx-tp { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px; font-size: 10.5px;
  font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--raise); color: var(--ink2); }
.lx-tp.fin { background: var(--warn-soft); color: var(--warn); }
.lx-tp.est { background: var(--viol-soft); color: var(--viol); }
.lx-ord-b b .lx-tp { margin-left: 6px; vertical-align: 1px; }
.lx-reg-via { display: flex; align-items: center; gap: 6px; color: var(--ink2); line-height: 1.45; }
.lx-reg-via svg { width: 13px; height: 13px; flex: none; color: var(--ink3); }
