/* v0.7.7.4.156 — «Служба поддержки»: same adaptation approach as
   static/css/ideas.css's own opening comment — reference mockups
   translated into FXPulse's existing --accent/--good/--bad/.info-card/
   .button visual language, not copied verbatim at the cost of the
   design system (per ТЗ §2's own explicit instruction). */
.support-page,.support-detail-page{--muted-2:#4f5b73;display:flex;flex-direction:column;gap:18px}
html[data-theme="dark"] .support-page,
html[data-theme="dark"] .support-detail-page{--muted-2:var(--muted)}

.support-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.support-header h1{margin:0 0 4px;font-size:24px}
.support-header p{margin:0;color:var(--muted-2);font-size:15px}

.support-section-nav{display:flex;gap:20px;border-bottom:1px solid var(--line);margin-bottom:-2px}
.support-section-link{padding:10px 2px;font-size:15px;font-weight:600;color:var(--muted-2);text-decoration:none;border-bottom:2px solid transparent}
.support-section-link.active{color:var(--accent);border-bottom-color:var(--accent)}
.support-section-link:hover{color:var(--accent)}

.support-tabs{display:flex;gap:6px;background:var(--surface-2,#f0f2f6);padding:4px;border-radius:12px;width:fit-content;max-width:100%}
html[data-theme="dark"] .support-tabs{background:#1a2230}
.support-tab{
  display:flex;align-items:center;gap:8px;padding:9px 16px;border-radius:9px;
  font-size:15px;font-weight:600;color:var(--muted-2);text-decoration:none;cursor:pointer;border:0;background:none;
}
.support-tab.active{background:var(--surface);color:var(--accent);box-shadow:0 1px 3px rgba(20,30,55,.08)}
.support-tab-count{
  display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;
  border-radius:999px;background:var(--line);color:var(--muted-2);font-size:12px;font-weight:700;
}
.support-tab.active .support-tab-count{background:var(--accent-soft);color:var(--accent)}

.support-list{display:flex;flex-direction:column;gap:12px}
.support-ticket-card{
  display:flex;align-items:stretch;background:var(--surface);
  border:1px solid var(--line);border-radius:14px;
  transition:border-color .15s ease,box-shadow .15s ease;
}
.support-ticket-card:hover{border-color:var(--accent);box-shadow:0 4px 14px rgba(20,30,55,.08)}
.support-ticket-link{
  display:flex;flex:1;min-width:0;gap:16px;align-items:center;
  padding:18px 20px;text-decoration:none;color:inherit;
}
.support-ticket-delete-form{display:flex;align-items:center;padding-right:10px;flex:0 0 auto}
.support-ticket-delete-btn{border:0;background:none;padding:8px;color:var(--muted);cursor:pointer;border-radius:8px}
.support-ticket-delete-btn:hover{background:var(--surface-2,#f5f6fa);color:var(--bad,#d64545)}
.support-ticket-main{flex:1;min-width:0}
.support-ticket-number{font-size:13px;color:var(--muted-2);font-weight:600}
.support-ticket-subject{font-size:16px;font-weight:700;color:var(--text);margin:2px 0 6px}
.support-ticket-preview{font-size:15px;color:var(--muted-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.support-ticket-activity{font-size:13px;color:var(--muted-2);margin-top:8px;display:flex;align-items:center;gap:6px}
.support-ticket-side{display:flex;flex-direction:column;align-items:flex-end;gap:10px;flex-shrink:0}

.support-status-pill{
  display:inline-flex;align-items:center;padding:4px 12px;border-radius:999px;
  font-size:13px;font-weight:700;white-space:nowrap;
}
.support-status-needs_reply{color:#c8790f;background:#fff4e0}
.support-status-waiting_user{color:#2f5fd6;background:#eaf0ff}
.support-status-closed{color:#5b6472;background:#f0f2f6}

.support-empty{
  display:flex;flex-direction:column;align-items:center;text-align:center;
  padding:60px 24px;background:var(--surface);border:1px solid var(--line);border-radius:16px;gap:14px;
}
.support-empty-illustration{position:relative;width:110px;height:80px;margin-bottom:4px}
.support-empty-illustration .bubble-1{
  position:absolute;left:0;top:14px;width:56px;height:56px;color:var(--muted);opacity:.35;
  fill:currentColor;stroke:none;
}
.support-empty-illustration .bubble-2{
  position:absolute;right:0;top:0;width:64px;height:64px;color:var(--accent);
  fill:var(--accent);stroke:#fff;stroke-width:0;
}
.support-empty-illustration .bubble-2 path{stroke:#fff;fill:none;stroke-width:1.6}
.support-empty h2{margin:0;font-size:20px}
/* v0.7.7.4.161 — Telegram button: base .button's default gray
   border/text (static/css/app.css) intentionally left untouched (used
   site-wide) — scoped override here instead of a global change. */
.support-telegram-btn{border-color:var(--accent)!important;color:var(--accent)!important}
.support-telegram-btn:hover{background:var(--accent-soft)}
.support-empty p{margin:0;color:var(--muted-2);font-size:15px;max-width:420px}
.support-empty-faq{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;
  padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:14px;margin-top:8px;
}
.support-empty-faq-item{display:flex;align-items:flex-start;gap:10px;padding:10px;border-radius:10px;text-decoration:none;color:inherit}
.support-empty-faq-item:hover{background:var(--accent-soft)}
.support-empty-faq-item strong{display:block;font-size:15px;color:var(--text)}
.support-empty-faq-item span{display:block;font-size:12.5px;color:var(--muted-2);margin-top:2px}

.support-popular-faq-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:4px;margin-top:6px}
.support-popular-faq-item{display:flex;align-items:flex-start;gap:10px;padding:10px;border-radius:10px;text-decoration:none;color:inherit}
.support-popular-faq-item:hover{background:var(--accent-soft)}
.support-popular-faq-icon{
  flex:0 0 32px;width:32px;height:32px;border-radius:9px;background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;
}
.support-popular-faq-item strong{display:block;font-size:16px;color:var(--text)}
.support-popular-faq-sub{display:block;font-size:12.5px;color:var(--muted-2);margin-top:2px}

.support-detail-grid{display:grid;grid-template-columns:1fr 340px;gap:20px;align-items:start}
@media(max-width:980px){.support-detail-grid{grid-template-columns:1fr}}

.support-conversation{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:16px}
.support-conv-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.support-conv-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.support-conv-title h1{margin:0;font-size:19px}
.support-conv-meta{font-size:13px;color:var(--muted-2)}

.support-messages{display:flex;flex-direction:column;gap:14px;max-height:60vh;overflow-y:auto;padding:2px}
.support-msg{display:flex;gap:10px;max-width:80%}
.support-msg.mine{align-self:flex-end;flex-direction:row-reverse}
.support-msg-avatar{
  width:34px;height:34px;border-radius:50%;flex:0 0 34px;
  display:flex;align-items:center;justify-content:center;background:var(--accent-soft);color:var(--accent);
  font-size:13px;font-weight:700;overflow:hidden;
}
.support-msg-avatar img{width:100%;height:100%;object-fit:cover}
.support-msg-body{display:flex;flex-direction:column;gap:4px;min-width:0}
.support-msg-author{font-size:12.5px;font-weight:700;color:var(--accent)}
.support-msg.mine .support-msg-author{text-align:right}
.support-msg-bubble{padding:12px 14px;border-radius:14px;font-size:15px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.support-msg:not(.mine) .support-msg-bubble{background:var(--surface-2,#f5f6fa);border-bottom-left-radius:4px}
html[data-theme="dark"] .support-msg:not(.mine) .support-msg-bubble{background:#1a2230}
.support-msg.mine .support-msg-bubble{background:var(--accent-soft);border-bottom-right-radius:4px}
.support-msg-time{font-size:11.5px;color:var(--muted);align-self:flex-end}
.support-msg.mine .support-msg-time{align-self:flex-start}
.support-msg-images{display:flex;gap:8px;flex-wrap:wrap;margin-top:2px}
.support-msg-image{
  width:84px;height:84px;border-radius:10px;object-fit:cover;cursor:pointer;
  border:1px solid var(--line);transition:transform .12s ease;
}
.support-msg-image:hover{transform:scale(1.03)}
.support-msg-edit-btn{border:0;background:none;padding:0;font-size:12px;color:var(--muted-2);cursor:pointer;text-decoration:underline;align-self:flex-end}
.support-msg.mine .support-msg-edit-btn{align-self:flex-start}

.support-reply-form{border-top:1px solid var(--line);padding-top:14px;display:flex;flex-direction:column;gap:10px}
.support-reply-form textarea{
  width:100%;min-height:70px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;
  font-size:15px;font-family:inherit;resize:vertical;background:var(--bg,#fff);color:var(--text);
}
.support-reply-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.support-reply-attach{display:flex;align-items:center;gap:10px}
.support-reply-attach label{
  display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:9px;
  border:1px solid var(--line);cursor:pointer;font-size:13px;color:var(--muted-2);
}
.support-reply-attach input[type=file]{display:none}
.support-reply-preview{display:flex;gap:8px;flex-wrap:wrap}
.support-reply-preview img{width:52px;height:52px;border-radius:8px;object-fit:cover;border:1px solid var(--line)}

.support-info-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px 20px;display:flex;flex-direction:column;gap:14px}
.support-info-card h3{margin:0;font-size:15px}

.legal-document{gap:0}
.legal-document p{margin:0 0 12px}
.legal-document h2{margin:14px 0 10px}
.legal-document h3{margin:12px 0 8px}
.legal-document ul{margin:0 0 12px;padding-left:22px}
.legal-document li+li{margin-top:4px}
.legal-document > :last-child{margin-bottom:0}
.support-info-row{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13.5px}
.support-info-row span:first-child{color:var(--muted-2)}
.support-info-row span:last-child{font-weight:600;text-align:right}
.support-participant{display:flex;align-items:center;gap:10px}
.support-participant-avatar{
  width:36px;height:36px;border-radius:50%;background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px;overflow:hidden;flex:0 0 36px;
}
.support-participant-avatar img{width:100%;height:100%;object-fit:cover}
.support-participant-name{font-size:15px;font-weight:600}
.support-participant-sub{font-size:12.5px;color:var(--muted-2)}

.support-lightbox{
  position:fixed;inset:0;background:rgba(10,14,24,.86);z-index:2000;
  display:flex;align-items:center;justify-content:center;padding:32px;
}
.support-lightbox[hidden]{display:none}
.support-lightbox img{max-width:min(90vw,900px);max-height:86vh;border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.4)}
.support-lightbox-close{
  position:absolute;top:20px;right:24px;width:40px;height:40px;border-radius:10px;
  background:rgba(255,255,255,.12);border:0;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.support-lightbox-close svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}

.support-faq-grid{display:grid;grid-template-columns:280px 1fr;gap:20px;align-items:start}
@media(max-width:820px){.support-faq-grid{grid-template-columns:1fr}}
.support-faq-search{
  display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--surface);
  border:1px solid var(--line);border-radius:12px;font-size:15px;
}
.support-faq-search input{border:0;outline:0;flex:1;font-size:15px;background:none;color:var(--text)}
.support-faq-categories{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:8px;display:flex;flex-direction:column;gap:2px}
.support-faq-cat{
  display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:9px;
  text-decoration:none;color:var(--text);font-size:15px;font-weight:600;
}
.support-faq-cat.active{background:var(--accent-soft);color:var(--accent)}
.support-faq-cat-count{font-size:12.5px;color:var(--muted-2);font-weight:600}
.support-faq-cat.active .support-faq-cat-count{color:var(--accent)}
.support-faq-cta{background:var(--accent-soft);border-radius:12px;padding:16px;margin-top:8px}
.support-faq-cta p{margin:0 0 10px;font-size:13.5px;color:var(--muted-2)}
.support-faq-cta a{color:var(--accent);font-weight:700;font-size:13.5px;text-decoration:none}

.support-faq-items{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.support-faq-item{border-bottom:1px solid var(--line)}
.support-faq-item:last-child{border-bottom:0}
.support-faq-q{
  display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px;
  cursor:pointer;font-size:15px;font-weight:700;
}
.support-faq-a{padding:0 20px 18px;font-size:14.5px;line-height:1.6;color:var(--muted-2)}
/* v0.7.7.4.166 — was white-space:pre-wrap, which rendered every blank
   line in the stored text literally (a double newline between
   paragraphs became a full empty line at 1.6 line-height each,
   compounding into the "огромный отступ" between paragraphs). Answers
   are now pre-parsed server-side (render_faq_answer_html() in
   app/support.py) into real <p>/<ol>/<ul> — normal, consistent
   paragraph/list spacing via margin below, not however many blank
   lines happened to be typed into the textarea. */
.support-faq-a-text p{margin:0 0 12px}
.support-faq-a-text p:last-child{margin-bottom:0}
.support-faq-a-text ol,.support-faq-a-text ul{margin:0 0 12px;padding-left:22px}
.support-faq-a-text ol:last-child,.support-faq-a-text ul:last-child{margin-bottom:0}
.support-faq-a-text li{margin-bottom:4px}
.support-faq-a-text li:last-child{margin-bottom:0}
.support-faq-item:not(.open) .support-faq-a{display:none}
.support-faq-q svg{width:16px;height:16px;flex:0 0 16px;transition:transform .15s ease}
.support-faq-item.open .support-faq-q svg{transform:rotate(180deg)}
.support-faq-manage{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin-top:10px}
.support-faq-manage form{margin:0}
.support-faq-manage button{border:0;background:none;padding:2px 0;font-size:12.5px;color:var(--muted-2);cursor:pointer;text-decoration:underline}

@media(max-width:640px){
  .support-ticket-link{flex-direction:column;align-items:flex-start;gap:10px}
  .support-ticket-main{width:100%}
  .support-ticket-side{align-items:flex-start;flex-direction:row;width:100%;justify-content:space-between}
  .support-ticket-card{align-items:flex-start}
  .support-ticket-delete-form{padding:14px 14px 0 0}
  .support-msg{max-width:92%}
  /* v0.7.7.4.167 — по явному запросу: горизонтальный скролл убран
     (не нужен), вместо него вкладки, которые не помещаются в строку,
     переносятся на следующую — .support-tabs больше не растягивает
     родителя, "Архив" корректно уходит на вторую строку, если места
     не хватает. */
  .support-tabs{flex-wrap:wrap;width:auto;max-width:100%;overflow-x:visible}
  .support-tab{flex:0 0 auto;white-space:nowrap}
}

/* v0.7.7.4.167 — pagination controls (.support-list/.support-faq-items)
   reuse the same class names as /ideas' own pagination for visual
   consistency, but ideas.css itself is only ever loaded on /ideas
   pages (see templates/ideas/list.html's own {% block extra_css %}) —
   these classes were never actually styled anywhere under /support
   until now. Duplicated here (a small, stable ruleset) rather than
   pulling in the whole of ideas.css as a new cross-module dependency. */
.ideas-pagination{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:14px;flex-wrap:wrap}
.ideas-page-link,.ideas-page-ellipsis{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:40px;height:40px;padding:0 6px;border-radius:9px;
  font-size:13px;font-weight:700;color:var(--text);text-decoration:none;
  border:1px solid var(--line);background:var(--surface);
}
.ideas-page-link:hover{border-color:var(--accent);color:var(--accent)}
.ideas-page-link.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.ideas-page-ellipsis{color:var(--muted);cursor:default}
