/* ============================================================================
   /help — «Поддержка»: тикеты. Стили страницы (обе темы через токены шелла).
   Префикс классов: hlp-. Токены: css/marketplace.css (—canvas/—surface/—text…).
   Вью: список ↔ тикет ↔ новый тикет; переходы — лёгкий fade+slide без модалок.
   ========================================================================== */

/* Атрибут hidden должен всегда побеждать классовые display: наши .hlp-*
   (flex/grid/inline-flex) имеют ту же специфичность, что [hidden], и без этого
   правила перекрывают его — тогда скрытые через .hidden=true узлы остаются видимы. */
.hlp-wrap [hidden], .hlp-view[hidden], .hlp-lightbox[hidden], #hlpToast[hidden]{ display:none !important; }

.hlp-wrap{ max-width:880px; margin:0 auto; }
/* список и форма прокручиваются страницей; у тикета — свой чат-лейаут (см. ниже) */
.hlp-view-list, .hlp-view-new{ padding:28px 24px 48px; }

/* Тикет = чат на весь экран: шапка сверху и композер снизу закреплены,
   прокручивается только лента сообщений. Замок body убирает скролл страницы. */
body.hlp-chat-lock{ overflow:hidden; }
body.hlp-chat-lock .page{ min-height:0; }

/* ── вью-контейнеры и «бесшовный» переход ── */
.hlp-view{ display:none; }
.hlp-view.is-active{ display:block; animation:hlp-in var(--dur,200ms) var(--ease,ease) both; }
@keyframes hlp-in{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
.hlp-view-ticket.is-active{
  display:flex; flex-direction:column;
  height:calc(100dvh - var(--hdr-h, 58px));
  animation-name:hlp-fade;
}
@keyframes hlp-fade{ from{ opacity:0; } to{ opacity:1; } }
@media (prefers-reduced-motion: reduce){
  .hlp-view.is-active{ animation:none; }
}

/* ── кнопки ── */
.hlp-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 16px; border-radius:var(--r-sm,10px); border:1px solid var(--line);
  background:var(--raised); color:var(--text); font:600 14px/1 var(--font-body);
  cursor:pointer; text-decoration:none; white-space:nowrap;
  transition:background var(--dur,200ms) var(--ease,ease), border-color var(--dur,200ms) var(--ease,ease), transform .12s ease;
}
.hlp-btn:hover{ background:var(--wash); }
.hlp-btn:active{ transform:scale(.98); }
.hlp-btn svg{ width:16px; height:16px; flex:none; }
.hlp-btn-primary{ background:var(--btn,#f0f0f0); color:var(--canvas,#141416); border-color:transparent; }
.hlp-btn-primary:hover{ background:var(--btn,#f0f0f0); opacity:.88; }
.hlp-btn-ghost{ background:transparent; }
.hlp-btn-ghost:hover{ background:var(--raised); }
.hlp-btn-lg{ padding:12px 22px; font-size:15px; }
.hlp-btn[disabled]{ opacity:.55; pointer-events:none; }

/* ── шапка списка ── */
.hlp-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.hlp-title{ font:700 30px/1.15 var(--font-display); color:var(--text); margin:0 0 6px; letter-spacing:.2px; }
.hlp-sub{ margin:0; color:var(--text-2); font:400 14px/1.5 var(--font-body); }
.hlp-sub a{ color:var(--text); text-decoration:underline; text-underline-offset:3px; }
.hlp-sub a:hover{ opacity:.8; }

/* ── тулбар: поиск + вкладки ── */
.hlp-toolbar{ display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.hlp-search{
  flex:1 1 260px; min-width:0; position:relative; display:flex; align-items:center;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm,10px);
  transition:border-color var(--dur,200ms) var(--ease,ease);
}
.hlp-search:focus-within{ border-color:var(--ring, rgba(240,240,240,.35)); }
.hlp-search svg{ width:16px; height:16px; margin-left:12px; color:var(--text-3); flex:none; }
.hlp-search input{
  flex:1; min-width:0; padding:10px 36px 10px 10px; background:none; border:0; outline:0;
  color:var(--text); font:400 14px/1.4 var(--font-body);
}
.hlp-search input::placeholder{ color:var(--text-3); }
.hlp-q-clear{
  position:absolute; right:6px; width:26px; height:26px; display:flex; align-items:center; justify-content:center;
  border:0; border-radius:8px; background:transparent; color:var(--text-3); cursor:pointer;
}
.hlp-q-clear:hover{ background:var(--raised); color:var(--text); }
.hlp-q-clear svg{ width:14px; height:14px; margin:0; }

.hlp-tabs{ display:flex; gap:4px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm,10px); padding:4px; }
.hlp-tab{
  border:0; background:transparent; color:var(--text-2); font:600 13px/1 var(--font-body);
  padding:8px 14px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:6px;
  transition:background var(--dur,200ms) var(--ease,ease), color var(--dur,200ms) var(--ease,ease);
}
.hlp-tab:hover{ color:var(--text); }
.hlp-tab.is-on{ background:var(--raised); color:var(--text); }
.hlp-tab-n{ font-weight:500; color:var(--text-3); font-size:12px; }
.hlp-tab.is-on .hlp-tab-n{ color:var(--text-2); }

/* ── список тикетов ── */
.hlp-items{ display:flex; flex-direction:column; gap:10px; }
.hlp-card{
  display:block; width:100%; text-align:left; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md,14px); padding:16px 18px; cursor:pointer; color:inherit; text-decoration:none;
  transition:border-color var(--dur,200ms) var(--ease,ease), background var(--dur,200ms) var(--ease,ease), transform .12s ease;
}
.hlp-card:hover{ background:var(--raised); border-color:var(--ring, rgba(240,240,240,.18)); }
.hlp-card:active{ transform:scale(.995); }
.hlp-card-top{ display:flex; align-items:center; gap:10px; margin-bottom:6px; min-width:0; }
.hlp-card-subj{
  font:600 15px/1.35 var(--font-body); color:var(--text); min-width:0; flex:1;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.hlp-card-subj .hlp-unread-dot{
  display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--verified,#3b9eff);
  margin-right:8px; vertical-align:1px;
}
.hlp-card-prev{
  color:var(--text-2); font:400 13.5px/1.45 var(--font-body); margin-bottom:10px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.hlp-card-prev b{ font-weight:600; color:var(--text-2); }
.hlp-card-prev .bi-paperclip{ margin-right:4px; }
.hlp-card-meta{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; color:var(--text-3); font:500 12.5px/1 var(--font-body); }
.hlp-card-meta .hlp-num{ font-variant-numeric:tabular-nums; }
.hlp-unread-badge{
  margin-left:auto; background:var(--verified,#3b9eff); color:#fff; font:700 11.5px/1 var(--font-body);
  border-radius:999px; padding:4px 8px; min-width:22px; text-align:center;
}

/* статус-бейджи */
.hlp-status{
  display:inline-flex; align-items:center; gap:6px; flex:none;
  font:600 12px/1 var(--font-body); padding:5px 10px; border-radius:999px; white-space:nowrap;
}
.hlp-status::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.hlp-status--waiting { color:var(--pro,#f5b301);      background:color-mix(in srgb, var(--pro,#f5b301) 12%, transparent); }
.hlp-status--progress{ color:var(--verified,#3b9eff); background:color-mix(in srgb, var(--verified,#3b9eff) 12%, transparent); }
.hlp-status--closed  { color:var(--text-3);           background:var(--raised); }
.hlp-status--other   { color:var(--text-2);           background:var(--raised); }

/* пустые состояния и «ещё» */
.hlp-empty{ text-align:center; padding:56px 20px; }
.hlp-empty-ic{ font-size:40px; color:var(--text-3); margin-bottom:12px; }
.hlp-empty-t{ font:700 18px/1.3 var(--font-display); color:var(--text); margin-bottom:6px; }
.hlp-empty-s{ color:var(--text-2); font:400 14px/1.5 var(--font-body); margin-bottom:18px; }
.hlp-more{ display:flex; justify-content:center; padding:16px 0 4px; }

/* гость */
.hlp-guest{ text-align:center; padding:64px 24px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg,18px); }
.hlp-guest-ic{ font-size:44px; color:var(--text-2); margin-bottom:14px; }
.hlp-guest-t{ font:700 20px/1.3 var(--font-display); color:var(--text); margin-bottom:8px; }
.hlp-guest-s{ color:var(--text-2); font:400 14px/1.55 var(--font-body); max-width:460px; margin:0 auto 20px; }

/* ── info/FAQ для гостя (SEO/AEO — контент виден людям и нейросетям) ── */
.hlp-info{ margin-top:36px; }
.hlp-info-h{ font:700 18px/1.3 var(--font-display); color:var(--text); margin:28px 0 14px; }
.hlp-info-h:first-child{ margin-top:0; }
.hlp-info-cats{ display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:10px; }
.hlp-info-cat{
  display:flex; gap:12px; padding:14px; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r-md,14px);
}
.hlp-info-cat i{ font-size:18px; color:var(--text-2); flex:none; margin-top:1px; }
.hlp-info-cat-t{ font:600 14px/1.3 var(--font-body); color:var(--text); margin-bottom:3px; }
.hlp-info-cat-s{ font:400 12.5px/1.45 var(--font-body); color:var(--text-3); }
.hlp-faq{ display:flex; flex-direction:column; gap:8px; }
.hlp-faq-i{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md,14px);
  padding:2px 16px; overflow:hidden;
}
.hlp-faq-i summary{
  list-style:none; cursor:pointer; padding:14px 24px 14px 0; position:relative;
  font:600 14.5px/1.4 var(--font-body); color:var(--text);
}
.hlp-faq-i summary::-webkit-details-marker{ display:none; }
.hlp-faq-i summary::after{
  content:''; position:absolute; right:2px; top:50%; width:9px; height:9px; margin-top:-6px;
  border-right:2px solid var(--text-3); border-bottom:2px solid var(--text-3);
  transform:rotate(45deg); transition:transform var(--dur,200ms) var(--ease,ease);
}
.hlp-faq-i[open] summary::after{ transform:rotate(-135deg); }
.hlp-faq-i p{ margin:0 0 14px; color:var(--text-2); font:400 13.5px/1.6 var(--font-body); }

/* ── скелетоны ── */
.hlp-skel{ display:flex; flex-direction:column; gap:10px; }
.hlp-sk-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md,14px); padding:16px 18px; display:flex; flex-direction:column; gap:9px; }
.hlp-sk-a{ width:46%; height:14px; border-radius:6px; }
.hlp-sk-b{ width:88%; height:11px; border-radius:6px; }
.hlp-sk-c{ width:30%; height:10px; border-radius:6px; }
.hlp-sk-line{ display:inline-block; width:220px; max-width:60vw; height:18px; border-radius:6px; }
.hlp-sk-msg{ display:flex; }
.hlp-sk-msg .sk{ width:min(420px,72%); height:64px; border-radius:14px; }
.hlp-sk-msg.r{ justify-content:flex-end; }
.hlp-sk-msg.l{ justify-content:flex-start; }

/* ── тикет: шапка (закреплена сверху, квадратная — минимум скруглений) ── */
.hlp-tk-top{
  flex:none; display:flex; align-items:center; gap:12px;
  padding:12px 16px; margin:0;
  background:var(--canvas); border-bottom:1px solid var(--line);
}
.hlp-view-new .hlp-tk-top{ padding:0 0 4px; background:none; border:0; }
.hlp-back{
  flex:none; width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text-2); cursor:pointer;
  transition:background var(--dur,200ms) var(--ease,ease), color var(--dur,200ms) var(--ease,ease);
}
.hlp-back:hover{ background:var(--raised); color:var(--text); }
.hlp-back svg{ width:18px; height:18px; }
.hlp-tk-head{ min-width:0; flex:1; }
.hlp-tk-subjrow{ display:flex; align-items:center; gap:10px; min-width:0; }
.hlp-tk-subject{ font:700 17px/1.3 var(--font-display); color:var(--text); margin:0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hlp-view-new .hlp-tk-subject{ white-space:normal; overflow:visible; font-size:20px; }
.hlp-tk-meta{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:3px; color:var(--text-3); font:500 12.5px/1 var(--font-body); }
.hlp-tk-num{
  display:inline-flex; align-items:center; gap:5px; border:0; background:none; padding:0;
  color:var(--text-3); font:500 13px/1 var(--font-body); font-variant-numeric:tabular-nums; cursor:pointer;
}
.hlp-tk-num:hover{ color:var(--text); }
.hlp-tk-num svg{ width:13px; height:13px; }
.hlp-tk-cat{ color:var(--text-3); }
.hlp-tk-cat::before{ content:'·'; margin-right:12px; }
.hlp-tk-date::before{ content:'·'; margin-right:12px; }

/* ── лента сообщений (единственный скроллящийся блок в тикете) ── */
.hlp-thread{
  flex:1; min-height:0; overflow-y:auto; overflow-x:hidden;
  padding:16px; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
}
.hlp-msgs{ display:flex; flex-direction:column; gap:12px; max-width:760px; margin:0 auto; width:100%; }
.hlp-thread .hlp-skel{ max-width:760px; margin:0 auto; }
.hlp-datechip{ align-self:center; color:var(--text-3); font:600 12px/1 var(--font-body); padding:6px 0; }
.hlp-syschip{
  align-self:center; max-width:88%; text-align:center; color:var(--text-2); background:var(--surface);
  border:1px solid var(--line); border-radius:999px; padding:7px 14px; font:400 12.5px/1.45 var(--font-body);
}
.hlp-msg{ display:flex; flex-direction:column; max-width:min(560px, 82%); }
.hlp-msg.me{ align-self:flex-end; align-items:flex-end; }
.hlp-msg.op{ align-self:flex-start; align-items:flex-start; }
.hlp-bubble{
  position:relative; padding:11px 14px 8px; border-radius:16px; border:1px solid var(--line);
  background:var(--surface); color:var(--text); font:400 14.5px/1.55 var(--font-body);
  overflow-wrap:anywhere; white-space:pre-wrap;
}
.hlp-msg.me .hlp-bubble{ background:var(--raised); border-bottom-right-radius:6px; }
.hlp-msg.op .hlp-bubble{
  background:color-mix(in srgb, var(--verified,#3b9eff) 9%, var(--surface));
  border-color:color-mix(in srgb, var(--verified,#3b9eff) 22%, var(--line));
  border-bottom-left-radius:6px;
}
.hlp-msg-author{ font:600 12.5px/1 var(--font-body); color:var(--text-2); margin-bottom:6px; }
.hlp-msg.op .hlp-msg-author{ color:var(--verified,#3b9eff); }
.hlp-bubble a{ color:var(--verified,#3b9eff); text-decoration:underline; text-underline-offset:2px; }
.hlp-msg-time{ display:block; text-align:right; margin-top:4px; color:var(--text-3); font:500 11px/1 var(--font-body); }

/* вложения в сообщении */
.hlp-att-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:6px; margin-top:8px; }
.hlp-att-grid.single{ grid-template-columns:minmax(0, 300px); }
.hlp-att-img{
  display:block; width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:10px;
  border:1px solid var(--line); cursor:zoom-in; background:var(--raised);
}
.hlp-att-grid.single .hlp-att-img{ aspect-ratio:auto; max-height:320px; object-fit:contain; background:var(--void,#0e0e10); }
.hlp-att-files{ display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.hlp-att-file{
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px;
  border:1px solid var(--line); background:var(--raised); color:var(--text); text-decoration:none;
  font:500 13px/1.3 var(--font-body); min-width:0;
}
.hlp-att-file:hover{ border-color:var(--ring, rgba(240,240,240,.25)); }
.hlp-att-file i{ font-size:18px; color:var(--neg,#e5484d); flex:none; }
.hlp-att-file .n{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hlp-att-file .b{ flex:none; font:700 10px/1 var(--font-body); color:var(--text-3); border:1px solid var(--line); border-radius:5px; padding:3px 5px; }

/* ── плашка закрытого тикета (нижний бар вместо композера) ── */
.hlp-closedbar{
  flex:none; display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  background:var(--canvas); border-top:1px solid var(--line);
  padding:14px 16px calc(14px + env(safe-area-inset-bottom));
}
.hlp-closedbar-inner{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; width:100%; max-width:760px; margin:0 auto; }
.hlp-closedbar-t{ color:var(--text-2); font:400 14px/1.5 var(--font-body); flex:1 1 320px; }
.hlp-closedbar-a{ display:flex; gap:10px; }

/* ── композер (закреплён внизу экрана, прямоугольный с малым скруглением) ── */
.hlp-composer{
  flex:none; z-index:5; margin:0;
  background:var(--canvas); border-top:1px solid var(--line);
  padding:12px 16px calc(12px + env(safe-area-inset-bottom));
}
.hlp-composer-row{
  display:flex; align-items:flex-end; gap:8px; max-width:760px; margin:0 auto;
  background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:7px 8px;
  transition:border-color var(--dur,200ms) var(--ease,ease);
}
.hlp-composer-row:focus-within{ border-color:var(--ring, rgba(240,240,240,.35)); }
.hlp-composer-row.is-drag{ border-color:var(--verified,#3b9eff); background:color-mix(in srgb, var(--verified,#3b9eff) 5%, var(--surface)); }
.hlp-attach,.hlp-send{
  flex:none; width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border:0; border-radius:8px; cursor:pointer; transition:background var(--dur,200ms) var(--ease,ease), opacity .15s ease;
}
.hlp-attach{ background:transparent; color:var(--text-2); }
.hlp-attach:hover{ background:var(--raised); color:var(--text); }
.hlp-attach svg{ width:19px; height:19px; }
.hlp-send{ background:var(--btn,#f0f0f0); color:var(--canvas,#141416); }
.hlp-send:hover{ opacity:.85; }
.hlp-send[disabled]{ opacity:.4; pointer-events:none; }
.hlp-send svg{ width:17px; height:17px; }
.hlp-input{
  flex:1; min-width:0; max-height:160px; resize:none; border:0; outline:0; background:none;
  color:var(--text); font:400 14.5px/1.5 var(--font-body); padding:8px 4px;
}
.hlp-input::placeholder{ color:var(--text-3); }
.hlp-composer-hint{ margin:7px auto 0; max-width:760px; color:var(--text-3); font:400 11px/1.4 var(--font-body); text-align:center; }
.hlp-composer .hlp-files{ max-width:760px; margin:0 auto 8px; }

/* превью выбранных файлов (композер и форма создания) */
.hlp-files{ display:flex; flex-wrap:wrap; gap:8px; padding:0 0 8px; }
.hlp-file{
  position:relative; display:flex; align-items:center; gap:8px; max-width:200px;
  background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:6px 28px 6px 6px;
}
.hlp-file img{ width:34px; height:34px; object-fit:cover; border-radius:7px; flex:none; background:var(--raised); }
.hlp-file .fi{ width:34px; height:34px; display:flex; align-items:center; justify-content:center; border-radius:7px; background:var(--raised); color:var(--neg,#e5484d); font-size:16px; flex:none; }
.hlp-file .n{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-2); font:500 12px/1.3 var(--font-body); }
.hlp-file .x{
  position:absolute; top:50%; right:5px; transform:translateY(-50%); width:20px; height:20px;
  display:flex; align-items:center; justify-content:center; border:0; border-radius:6px;
  background:transparent; color:var(--text-3); cursor:pointer; font-size:14px; line-height:1;
}
.hlp-file .x:hover{ background:var(--raised); color:var(--text); }

/* ── форма нового тикета ── */
.hlp-newform{ max-width:720px; }
.hlp-label{ display:block; font:600 13.5px/1 var(--font-body); color:var(--text); margin:22px 0 10px; }
.hlp-label:first-child{ margin-top:6px; }
.hlp-label-hint{ font-weight:400; color:var(--text-3); margin-left:6px; }
.hlp-cats{ display:grid; grid-template-columns:repeat(auto-fill, minmax(215px, 1fr)); gap:10px; }
.hlp-cat input{ position:absolute; opacity:0; pointer-events:none; }
.hlp-cat-card{
  display:flex; flex-direction:column; gap:6px; height:100%; padding:13px 14px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md,14px); cursor:pointer;
  transition:border-color var(--dur,200ms) var(--ease,ease), background var(--dur,200ms) var(--ease,ease);
}
.hlp-cat-card:hover{ background:var(--raised); }
.hlp-cat input:checked + .hlp-cat-card{
  border-color:var(--text); background:var(--raised);
  box-shadow:0 0 0 1px var(--text) inset;
}
.hlp-cat input:focus-visible + .hlp-cat-card{ outline:2px solid var(--verified,#3b9eff); outline-offset:2px; }
.hlp-cat-t{ display:flex; align-items:center; gap:8px; font:600 14px/1.25 var(--font-body); color:var(--text); }
.hlp-cat-t i{ font-size:15px; color:var(--text-2); }
.hlp-cat-s{ font:400 12.5px/1.45 var(--font-body); color:var(--text-3); }

.hlp-field{
  width:100%; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm,10px);
  color:var(--text); font:400 14.5px/1.5 var(--font-body); padding:11px 14px; outline:0;
  transition:border-color var(--dur,200ms) var(--ease,ease);
}
.hlp-field:focus{ border-color:var(--ring, rgba(240,240,240,.35)); }
.hlp-field::placeholder{ color:var(--text-3); }
.hlp-field-area{ resize:vertical; min-height:130px; }
.hlp-field.is-err{ border-color:var(--neg,#e5484d); }

.hlp-drop{
  display:flex; align-items:center; justify-content:center; gap:10px; padding:20px 16px;
  border:1.5px dashed var(--line); border-radius:var(--r-md,14px); color:var(--text-2);
  font:400 13.5px/1.4 var(--font-body); cursor:pointer; text-align:center;
  transition:border-color var(--dur,200ms) var(--ease,ease), background var(--dur,200ms) var(--ease,ease);
}
.hlp-drop:hover,.hlp-drop.is-drag{ border-color:var(--verified,#3b9eff); background:color-mix(in srgb, var(--verified,#3b9eff) 5%, transparent); }
.hlp-drop svg{ width:18px; height:18px; flex:none; }
.hlp-drop b{ font-weight:600; color:var(--text); }
.hlp-newform .hlp-files{ padding-top:10px; }
.hlp-newform-a{ display:flex; gap:10px; margin-top:26px; }

/* ── лайтбокс ── */
.hlp-lightbox{
  position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center;
  background:rgba(0,0,0,.88); padding:44px;
}
.hlp-lightbox.is-open{ display:flex; }
.hlp-lb-img{ max-width:min(1200px,92vw); max-height:84vh; border-radius:10px; object-fit:contain; }
.hlp-lb-close{
  position:absolute; top:14px; right:14px; width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  border:0; border-radius:12px; background:rgba(255,255,255,.1); color:#fff; cursor:pointer;
}
.hlp-lb-close:hover{ background:rgba(255,255,255,.2); }
.hlp-lb-close svg{ width:18px; height:18px; }
.hlp-lb-nav{
  position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px;
  display:flex; align-items:center; justify-content:center; border:0; border-radius:12px;
  background:rgba(255,255,255,.1); color:#fff; cursor:pointer;
}
.hlp-lb-nav:hover{ background:rgba(255,255,255,.2); }
.hlp-lb-nav svg{ width:20px; height:20px; }
.hlp-lb-prev{ left:14px; }
.hlp-lb-next{ right:14px; }
.hlp-lb-nav[hidden]{ display:none; }
.hlp-lb-cap{
  position:absolute; bottom:14px; left:50%; transform:translateX(-50%); max-width:80vw;
  color:rgba(255,255,255,.75); font:500 12.5px/1.4 var(--font-body);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* ── тост ── */
.hlp-toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%); z-index:320;
  background:var(--raised); color:var(--text); border:1px solid var(--line); border-radius:12px;
  padding:11px 18px; font:500 13.5px/1.4 var(--font-body); max-width:min(480px, calc(100vw - 32px));
  box-shadow:0 12px 32px rgba(0,0,0,.35); animation:hlp-in .18s ease both;
}
.hlp-toast.is-err{ border-color:color-mix(in srgb, var(--neg,#e5484d) 45%, var(--line)); }

/* ── светлая тема: точечные подстройки ── */
[data-theme="light"] .hlp-att-grid.single .hlp-att-img{ background:#eceff3; }
[data-theme="light"] .hlp-toast{ box-shadow:0 12px 32px rgba(15,23,42,.18); }
[data-theme="light"] .hlp-msg.op .hlp-bubble{
  background:color-mix(in srgb, var(--verified,#2b7fd9) 7%, var(--surface));
}

/* ── адаптив ── */
/* iOS зумит при фокусе на любой input <16px — не только на телефонах, но и на
   iPad. Гейтим по тач-указателю, а не по ширине, чтобы покрыть планшеты. */
@media (pointer: coarse){
  .hlp-search input, .hlp-input, .hlp-field{ font-size:16px; }
}

@media (max-width: 900px){
  .hlp-view-list, .hlp-view-new{ padding:18px 14px 40px; }
  .hlp-title{ font-size:24px; }
  .hlp-search input, .hlp-input, .hlp-field{ font-size:16px; }
  .hlp-msg{ max-width:92%; }
  .hlp-tk-top{ padding:10px 12px; }
  .hlp-thread{ padding:14px 12px; }
  .hlp-composer{ padding:10px 12px calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px){
  .hlp-head{ flex-direction:column; align-items:stretch; gap:12px; }
  .hlp-head .hlp-btn{ align-self:stretch; }
  .hlp-toolbar{ gap:10px; }
  .hlp-tabs{ width:100%; }
  .hlp-tab{ flex:1; justify-content:center; }
  .hlp-cats{ grid-template-columns:1fr; }
  .hlp-newform-a{ flex-direction:column; }
  .hlp-newform-a .hlp-btn{ width:100%; }
  .hlp-tk-subject{ font-size:17px; }
  .hlp-card{ padding:14px; }
  .hlp-lightbox{ padding:12px; }
  .hlp-lb-nav{ width:38px; height:38px; }
  .hlp-lb-prev{ left:6px; }
  .hlp-lb-next{ right:6px; }
  .hlp-att-grid{ grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); }
}

/* iPhone 12 mini (375px) и уже */
@media (max-width: 400px){
  .hlp-view-list, .hlp-view-new{ padding:14px 10px 36px; }
  .hlp-title{ font-size:22px; }
  .hlp-card-meta{ gap:8px; font-size:12px; }
  .hlp-status{ font-size:11px; padding:4px 8px; }
  .hlp-bubble{ font-size:14px; }
  .hlp-msg{ max-width:96%; }
  .hlp-composer-hint{ display:none; }
  .hlp-file{ max-width:160px; }
  .hlp-tk-meta{ gap:8px; }
  .hlp-tk-cat::before,.hlp-tk-date::before{ margin-right:8px; }
}
