.lpt-box { margin: 30px 0 0; scroll-margin-top: 96px; color: var(--lpt-ink); font: 400 14px/1.5 var(--lpt-font); }
.lpt-box * { box-sizing: border-box; }
.lpt-box__head { margin-bottom: 12px; }
.lpt-box__title { margin: 0 0 4px; font: 800 20px/1.25 var(--lpt-font); color: var(--lpt-ink); letter-spacing: -.02em; }
.lpt-box__sub { margin: 0; color: var(--lpt-muted); font: 500 13.5px/1.5 var(--lpt-font); max-width: 68ch; }

.lpt-fold { display: none; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--lpt-line); border-radius: var(--lpt-r); background: var(--lpt-panel); box-shadow: 0 16px 36px -28px rgba(26, 16, 60, .35); }
.lpt-box.is-folded .lpt-fold { display: flex; }
.lpt-box.is-folded .lpt-chat { display: none; }
.lpt-fold__ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: var(--lpt-brass); color: #fff; box-shadow: 0 8px 18px -10px rgba(124, 58, 237, .65), inset 0 1px 0 rgba(255, 255, 255, .25); display: inline-flex; align-items: center; justify-content: center; }
.lpt-fold__ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lpt-fold__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lpt-fold__txt b { font: 700 15px/1.35 var(--lpt-font); color: var(--lpt-ink); }
.lpt-fold__txt span { font: 500 13px/1.45 var(--lpt-font); color: var(--lpt-muted); }
.lpt-fold__acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.lpt-chat { width: 100%; border: 1px solid var(--lpt-line); border-radius: var(--lpt-r); overflow: hidden; background: var(--lpt-panel); box-shadow: 0 16px 36px -28px rgba(26, 16, 60, .35); color: var(--lpt-ink); font: 400 14px/1.5 var(--lpt-font); }
.lpt-chat * { box-sizing: border-box; }
.lpt-chat--empty { padding: 26px 22px; text-align: center; }
.lpt-chat__hint { margin: 0 0 16px; color: var(--lpt-muted); font: 500 14px/1.5 var(--lpt-font); }

.lpt-chat__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--lpt-line); background: var(--lpt-paper); }
.lpt-chat__id { font: 500 12.5px/1.2 var(--lpt-font); color: var(--lpt-muted); }
.lpt-chat__tz { font: 600 10.5px/1 var(--lpt-font); letter-spacing: .04em; color: var(--lpt-muted); border: 1px solid var(--lpt-line); border-radius: 6px; padding: 4px 6px; cursor: help; }
.lpt-chat__ctl { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.lpt-chat__ctl > span { font: 500 12.5px/1 var(--lpt-font); color: var(--lpt-muted); }
.lpt-chat__select { height: 34px; padding: 0 10px; border: 1px solid var(--lpt-line); border-radius: 9px; font: 500 13px/1 var(--lpt-font); background: var(--lpt-panel); color: var(--lpt-ink); max-width: 100%; }

.lpt-chat__body { height: clamp(300px, 50vh, 460px); overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--lpt-canvas); scrollbar-width: thin; }

.lpt-msg { max-width: min(76%, 540px); padding: 10px 14px; border-radius: var(--lpt-r); line-height: 1.45; overflow-wrap: anywhere; animation: lpt-in .18s ease-out; }
@keyframes lpt-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lpt-msg__meta { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font: 500 11px/1.4 var(--lpt-font); opacity: .7; margin-bottom: 4px; }
.lpt-msg__who { font-weight: 700; }
.lpt-msg__text { white-space: pre-wrap; }
.lpt-msg--mine { align-self: flex-end; background: var(--lpt-ink); color: #fff; border-bottom-right-radius: 6px; }
.lpt-msg--mine .lpt-msg__meta { opacity: .75; }
.lpt-msg--theirs { align-self: flex-start; background: var(--lpt-panel); border: 1px solid var(--lpt-line); color: var(--lpt-ink); border-bottom-left-radius: 6px; }
.lpt-msg--system { align-self: center; max-width: 92%; text-align: center; background: var(--lpt-panel); border: 1px dashed var(--lpt-line-h); color: var(--lpt-muted); font: 500 12.5px/1.5 var(--lpt-font); border-radius: var(--lpt-r-sm); }
.lpt-msg--system .lpt-msg__time { display: block; margin-top: 4px; font-size: 11px; opacity: .7; }
.lpt-msg__att img { max-width: 220px; max-height: 220px; border-radius: var(--lpt-r-sm); display: block; margin-top: 7px; cursor: zoom-in; background: var(--lpt-paper); }
.lpt-msg.is-old { display: none; }
.lpt-chat__earlier { align-self: center; border: 1px solid var(--lpt-line2); background: var(--lpt-panel); color: var(--lpt-brass-d); font: 700 12.5px/1 var(--lpt-font); padding: 9px 14px; border-radius: 999px; cursor: pointer; }

.lpt-chat__foot { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--lpt-line); background: var(--lpt-panel); }
.lpt-chat__inwrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.lpt-chat__input { width: 100%; resize: none; height: 46px; min-height: 46px; max-height: 140px; margin: 0; padding: 12px 42px 12px 14px; border: 1px solid var(--lpt-line); border-radius: 14px; font: 400 15px/1.4 var(--lpt-font); color: var(--lpt-ink); background: var(--lpt-paper); overflow-y: auto; box-shadow: none; transition: .15s; }
.lpt-chat__input:focus { outline: none; border-color: #b9a5ff; background: var(--lpt-panel); box-shadow: 0 0 0 3px rgba(139, 92, 246, .14); }
.lpt-chat__clear { position: absolute; right: 10px; top: 11px; width: 24px; height: 24px; min-height: 0; border: 0; border-radius: 50%; background: rgba(31, 35, 48, .08); color: var(--lpt-muted); cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 16px; line-height: 1; padding: 0; z-index: 2; }
.lpt-chat__attach { flex: 0 0 auto; width: 46px; height: 46px; margin: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--lpt-line2); border-radius: 50%; cursor: pointer; color: var(--lpt-muted); background: var(--lpt-panel); transition: .15s; }
.lpt-chat__attach:hover { background: var(--lpt-hover); color: var(--lpt-brass-d); border-color: var(--lpt-line-h); }
.lpt-chat__attach input { display: none; }
.lpt-chat__attach svg { width: 20px; height: 20px; display: block; }
.lpt-chat__attach.has-file { border-color: var(--lpt-line-h); color: var(--lpt-brass-d); background: var(--lpt-soft); }
.lpt-chat__send { height: 46px; }
.lpt-chat__filename { font: 500 12px/1.4 var(--lpt-font); color: var(--lpt-muted); padding: 0 14px 10px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lpt-chat__filename:empty { display: none; }
.lpt-chat__fileremove { border: 0; background: rgba(31, 35, 48, .08); color: var(--lpt-muted); border-radius: 50%; width: 18px; height: 18px; min-height: 0; line-height: 1; cursor: pointer; font-size: 14px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

.lpt-chat__note { padding: 10px 14px; font: 500 12px/1.45 var(--lpt-font); color: var(--lpt-muted); background: var(--lpt-paper); border-top: 1px solid var(--lpt-line); }
.lpt-chat__note a { color: var(--lpt-brass-d); }
.lpt-chat__closed { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; font: 500 13px/1.5 var(--lpt-font); color: var(--lpt-warn-text); background: var(--lpt-warn-tint); border-top: 1px solid rgba(180, 83, 9, .26); }
.lpt-chat__error { padding: 10px 14px; font: 500 12.5px/1.45 var(--lpt-font); color: var(--lpt-bad); background: rgba(179, 54, 60, .08); border-top: 1px solid rgba(179, 54, 60, .2); }

.lpt-lightbox { position: fixed; inset: 0; background: rgba(14, 12, 26, .88); display: flex; align-items: center; justify-content: center; z-index: 99999; cursor: zoom-out; padding: 20px; }
.lpt-lightbox img { max-width: 95%; max-height: 95%; border-radius: var(--lpt-r-sm); box-shadow: 0 18px 60px rgba(0, 0, 0, .45); }

.lpt-box.is-target .lpt-chat { box-shadow: 0 0 0 3px rgba(139, 92, 246, .22); transition: box-shadow .8s ease-out; }
.lpt-box.is-target.is-faded .lpt-chat { box-shadow: none; }

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .lpt-chat__body { height: auto; max-height: none; overflow: visible; overscroll-behavior: auto; padding: 12px; }
}

@media (max-width: 600px) {
  .lpt-box { margin-top: 24px; scroll-margin-top: 72px; }
  .lpt-box__title { font-size: 18px; }
  .lpt-fold { flex-wrap: wrap; padding: 14px; }
  .lpt-fold__txt { flex-basis: calc(100% - 60px); }
  .lpt-fold__acts { width: 100%; justify-content: stretch; }
  .lpt-fold__acts .lpt-btn { flex: 1 1 auto; }
  .lpt-chat__head { padding: 10px 12px; }
  .lpt-chat__ctl { margin-left: 0; width: 100%; }
  .lpt-chat__select { flex: 1; }
  .lpt-msg { max-width: 88%; }
  .lpt-chat__foot { padding: 10px; flex-wrap: wrap; row-gap: 10px; justify-content: flex-end; }
  .lpt-chat__inwrap { flex: 1 1 100%; }
  .lpt-chat__input { height: 54px; padding: 15px 42px 15px 14px; font-size: 16px; }
  .lpt-chat__clear { top: 15px; }
  .lpt-chat__attach { width: 44px; height: 44px; }
  .lpt-chat__send { height: 44px; padding: 0 18px; }
  .lpt-chat__closed .lpt-btn { width: 100%; }
}

.lpt-chat[data-ticket="0"] .lpt-chat__body { height: auto; min-height: 110px; max-height: none; }

/* светлая тема: кружок-иконка — фирменный градиент, как иконки привилегий в кабинете */
html:not(.lp-dark) .lpt-fold__ico { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
