/* پشتیبانی واسط — تیکت، سوالات متداول و تماس. فقط از توکن‌های vaset.css استفاده می‌کند. */
.support { display: grid; gap: 18px; }
.support > *, .sp-grid > *, .sp-new > *, .sp-ticket > *, .sp-thread-wrap > *, .sp-side > * { min-width: 0; }
.support.support-public { padding-block: 32px 48px; }
.support h1 { margin: 0; }
.support .eyebrow { display: inline-block; font-size: .8rem; color: var(--accent-ink); margin-bottom: 4px; }
.support code { font-family: var(--f-code); background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: 6px; padding: 0 5px; font-size: .86em; direction: ltr; unicode-bidi: isolate; }

/* سرصفحه و جست‌وجو */
.sp-hero { background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: var(--r-lg); padding: 26px 26px 22px; position: relative; }
.sp-hero h1 { font-size: 1.6rem; color: var(--brand-deep); }
.sp-hero p { color: var(--ink-2); max-width: 62ch; margin: 8px 0 16px; line-height: 1.9; }
.sp-search { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--brand-line); border-radius: var(--r-md); padding: 6px 6px 6px 6px; box-shadow: var(--e1); max-width: 720px; }
.sp-search:focus-within { box-shadow: var(--focus); border-color: var(--brand-mid); }
.sp-search-icon { display: grid; place-items: center; width: 34px; color: var(--ink-3); }
.sp-search-icon svg { width: 20px; height: 20px; }
.sp-search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; font: inherit; padding: 8px 2px; box-shadow: none; }
.sp-quick { margin-top: 10px; max-width: 720px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e2); overflow: hidden; }
.sp-quick a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.sp-quick a:hover, .sp-quick a:focus { background: var(--brand-tint); }
.sp-quick a small { display: block; color: var(--ink-3); font-size: .8rem; }
.sp-quick .more { color: var(--brand); font-weight: 600; }

/* سه کارت اصلی */
.sp-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp-action { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; color: var(--ink); text-decoration: none; box-shadow: var(--e1); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
a.sp-action:hover { transform: translateY(-2px); box-shadow: var(--e2); }
.sp-action b { font-size: 1.05rem; }
.sp-action small { color: var(--ink-2); line-height: 1.8; }
.sp-action.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.sp-action.primary small { color: rgba(255, 255, 255, .85); }
.sp-action.primary .sp-action-icon { background: rgba(255, 255, 255, .14); color: #fff; }
.sp-action.soon { border-style: dashed; background: var(--paper); }
.sp-action-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; flex: none; }
.sp-action-icon svg { width: 21px; height: 21px; }

/* چیدمان دوستونه */
.sp-grid, .sp-new, .sp-ticket { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sp-side { display: grid; gap: 14px; position: sticky; top: 76px; }
.sp-side-title { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.sp-side-title svg { width: 18px; height: 18px; color: var(--brand); }
.sp-popular { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
.sp-popular li { padding: 7px 0; border-bottom: 1px dashed var(--line); line-height: 1.8; font-size: .92rem; }
.sp-popular li:last-child { border-bottom: 0; }
.sp-popular a { color: var(--ink); text-decoration: none; }
.sp-popular a:hover { color: var(--brand); text-decoration: underline; }

/* تراشه‌های موضوع */
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .86rem; cursor: pointer; text-decoration: none; }
.sp-chip em { font-style: normal; font-size: .76rem; color: var(--ink-3); background: var(--muted-soft); border-radius: 999px; padding: 0 7px; }
.sp-chip:hover { border-color: var(--brand-line); color: var(--brand); }
.sp-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.sp-chip.on em { background: rgba(255, 255, 255, .2); color: #fff; }

/* فهرست تیکت‌ها */
.sp-tickets .sp-subject { color: var(--ink); font-weight: 600; text-decoration: none; }
.sp-tickets .sp-subject:hover { color: var(--brand); text-decoration: underline; }
.sp-tickets tr.unread td { background: var(--accent-soft); }
.sp-fresh { display: inline-block; margin-inline-start: 8px; font-size: .72rem; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.sp-empty-state { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 20px; color: var(--ink-2); }
.sp-empty-state p { max-width: 46ch; margin: 0 0 6px; line-height: 1.9; }

/* سوالات متداول */
.sp-faq-tools { display: grid; gap: 12px; }
.sp-faq-tools .sp-search { max-width: none; box-shadow: none; }
.sp-faq-group { display: grid; gap: 8px; }
.sp-faq-group h2 { font-size: 1.05rem; color: var(--brand-deep); margin: 8px 0 2px; }
.sp-faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e1); }
.sp-faq[open] { border-color: var(--brand-line); }
.sp-faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 600; line-height: 1.8; }
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); transform: rotate(-90deg); transition: transform .15s var(--ease); }
.sp-faq[open] summary svg { transform: rotate(90deg); color: var(--brand); }
.sp-faq summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-md); }
.sp-answer { padding: 0 16px 14px; color: var(--ink-2); line-height: 2; border-top: 1px solid var(--line-2); }
.sp-answer p { margin: 10px 0; }
.sp-answer ul, .sp-answer ol, .sp-msg-body ul, .sp-msg-body ol { margin: 8px 0; padding-inline-start: 22px; }
.sp-answer li, .sp-msg-body li { margin: 4px 0; }
.sp-answer a, .sp-msg-body a { color: var(--brand); }
.sp-vote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .88rem; }
.sp-vote form { display: inline; margin: 0; }
.sp-permalink { margin-inline-start: auto; color: var(--ink-3); }
.sp-faq:target { box-shadow: var(--focus); }
.sp-cta { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: center; background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: var(--r-lg); padding: 22px; }
.sp-cta p { color: var(--ink-2); margin: 6px 0 12px; }

/* تماس */
.sp-contact { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--e1); }
.sp-contact-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.sp-contact-icon svg { width: 20px; height: 20px; }
.sp-contact-body { display: grid; gap: 3px; min-width: 0; }
.sp-contact-body small { color: var(--ink-2); line-height: 1.8; }
.sp-phone { font-size: 1.25rem; font-weight: 700; color: var(--brand-deep); text-decoration: none; letter-spacing: .02em; }
.sp-phone.soon { font-size: 1rem; color: var(--accent-ink); }
.sp-contact-more { display: grid; gap: 2px; font-size: .86rem; margin-top: 4px; }

/* فرم تیکت */
.sp-form { display: grid; gap: 18px; }
.sp-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.sp-form legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.sp-form legend small, .support label small { font-weight: 400; color: var(--ink-3); }
.sp-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.sp-topic { position: relative; display: block; cursor: pointer; }
.sp-topic input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sp-topic span { display: grid; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .12s, background .12s; }
.sp-topic b { font-size: .92rem; color: var(--ink); }
.sp-topic small { color: var(--ink-3); font-size: .78rem; line-height: 1.7; }
.sp-topic:hover span { border-color: var(--brand-line); }
.sp-topic input:checked + span { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.sp-topic input:focus-visible + span { box-shadow: var(--focus); }
.sp-topic.unsure span { border-style: dashed; border-color: var(--accent-rose); background: var(--accent-soft); }
.sp-topic.unsure input:checked + span { border-style: solid; border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.sp-fields label, .sp-reply label, .sp-settings label, .sp-form-grid label { display: grid; gap: 6px; }
.sp-fields textarea, .sp-reply textarea { resize: vertical; min-height: 120px; line-height: 1.9; }
.sp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.sp-file input[type=file] { padding: 8px; border: 1px dashed var(--brand-line); border-radius: var(--r-sm); background: var(--paper); }
.sp-submit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sp-from-faq a { color: inherit; font-weight: 700; }

/* پیشنهاد پاسخ در فرم */
.sp-suggest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-suggest-list li { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.sp-suggest-list button.sp-sq { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 12px; cursor: pointer; font-weight: 600; line-height: 1.8; font-size: .9rem; }
.sp-suggest-list button.sp-sq:focus-visible { box-shadow: var(--focus); border-radius: var(--r-md); }
.sp-suggest-list .sp-sa { padding: 0 12px 10px; font-size: .88rem; color: var(--ink-2); line-height: 1.9; border-top: 1px solid var(--line-2); }
.sp-suggest-list .sp-sa p { margin: 8px 0; }
.sp-suggest-list .sp-sa ul, .sp-suggest-list .sp-sa ol { padding-inline-start: 18px; margin: 6px 0; }

/* گفت‌وگوی تیکت */
.sp-ticket-head h1 { font-size: 1.35rem; margin: 2px 0 8px; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.sp-thread-wrap { display: grid; gap: 14px; }
.sp-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sp-msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--e1); max-width: 92%; }
.sp-msg.user { justify-self: start; border-start-start-radius: 6px; }
.sp-msg.staff { justify-self: end; background: var(--brand-tint); border-color: var(--brand-line); border-start-end-radius: 6px; }
.sp-msg.internal { background: var(--warn-soft); border-color: #ecd9b0; border-style: dashed; }
.sp-msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sp-msg-head .avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .8rem; font-weight: 700; }
.sp-msg.staff .avatar { background: var(--brand); color: #fff; }
.sp-msg-head small { margin-inline-start: auto; }
.sp-msg-body { line-height: 2; color: var(--ink); overflow-wrap: anywhere; }
.sp-msg-body p { margin: 6px 0; }
.sp-attach { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .86rem; }
.sp-attach svg { width: 16px; height: 16px; color: var(--ink-3); }
.sp-attach small { color: var(--ink-3); }
.sp-attach.image { display: grid; padding: 6px; gap: 4px; max-width: 320px; }
.sp-attach.image img { max-width: 100%; max-height: 240px; border-radius: 6px; object-fit: contain; background: var(--paper); }
.sp-attach.image span { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--ink-3); }
.sp-reply { display: grid; gap: 12px; }
.sp-close { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sp-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.sp-dl dt { color: var(--ink-3); }
.sp-dl dd { margin: 0; overflow-wrap: anywhere; }
.sp-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .82rem; line-height: 1.8; }
.sp-log li { padding: 6px 8px; border-radius: var(--r-xs); background: var(--ok-soft); }
.sp-log li.failed { background: var(--err-soft); }

/* مدیر */
.sp-status-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-status-tabs a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.sp-status-tabs a em { font-style: normal; font-size: .78rem; background: var(--muted-soft); border-radius: 999px; padding: 0 7px; }
.sp-status-tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.sp-status-tabs a.on em { background: rgba(255, 255, 255, .2); color: #fff; }
.sp-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.sp-filter label { display: grid; gap: 4px; flex: 1 1 200px; }
.sp-card-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sp-card-title > div { flex: 1; }
.sp-card-title h2 { margin: 0 0 4px; font-size: 1.05rem; }
.sp-card-title .hint { margin: 0; }
.sp-switch { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; white-space: nowrap; }
.sp-switch:has(input:checked) { background: var(--ok-soft); border-color: #b9dcc8; color: var(--ok); }
.sp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 10px; }
.sp-form-grid .wide { grid-column: 1 / -1; }
.sp-settings { display: grid; gap: 18px; }
.sp-help { margin-top: 10px; font-size: .9rem; color: var(--ink-2); }
.sp-help summary { cursor: pointer; color: var(--brand); }
.sp-help ol { line-height: 2; padding-inline-start: 20px; }
.sp-tests { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sp-tests h2 { width: 100%; margin: 0; font-size: 1.05rem; }
.sp-tests .hint { width: 100%; margin: 0; }
.sp-tests form { margin: 0; }
.sp-inline-search { display: flex; align-items: center; gap: 6px; flex: 1; }
.sp-inline-search svg { width: 18px; height: 18px; color: var(--ink-3); }
.sp-inline-search input { flex: 1; }
.muted-row td { opacity: .55; }
.sp-danger { margin-top: 12px; }
.sp-danger summary { cursor: pointer; color: var(--err); font-size: .88rem; }

@media (max-width: 1100px) {
  .sp-grid, .sp-new, .sp-ticket, .sp-cta { grid-template-columns: minmax(0, 1fr); }
  .sp-side { position: static; }
  .sp-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-topic:not(.unsure) small { display: none; }
  .sp-topic.unsure { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .sp-actions { grid-template-columns: minmax(0, 1fr); }
  .sp-hero { padding: 20px 16px; }
  .sp-hero h1 { font-size: 1.3rem; }
  .sp-search { flex-wrap: wrap; }
  .sp-search .btn { width: 100%; }
  .sp-msg { max-width: 100%; }
}
@media (max-width: 420px) {
  .sp-topic-grid { grid-template-columns: minmax(0, 1fr); }
}

/* فرم سریع ثبت تیکت */
.sp-quick-form { gap: 14px; }
.sp-quick-form textarea { width: 100%; min-height: 160px; font-size: 1rem; }
.sp-file-inline { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.sp-file-inline svg { width: 18px; height: 18px; }
.sp-file-inline input[type=file] { flex: 1 1 220px; }
.sp-more { border: 1px solid var(--brand-line); border-radius: var(--r-sm); padding: 8px 12px; }
.sp-more summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.sp-more[open] summary { margin-bottom: 10px; }
.sp-more .sp-row label { display: grid; gap: 6px; }
.sp-submit .hint { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
