/* Help centre (/support), customer tickets and the admin ticket desk. Chat bubbles reuse assistant.css. */

/* ---------- Help centre ---------- */
.sp-ask-section { padding-top: 28px; }
.sp-ask-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.sp-ask-card { background: var(--sheet, #fbfcfa); border: 1px solid var(--rule, #c7d4cd); border-radius: 16px; padding: clamp(16px, 3vw, 26px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sp-ask-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.sp-ask-head h2 { margin: 0; font-size: 20px; }
.sp-ask-card .as-composer { position: static; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chips .as-example { min-height: 44px; font-size: 13.5px; }
.sp-handoff { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--emerald-tint, #e2f1e9); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.sp-handoff p { margin: 0; font-size: 14px; font-weight: 600; }

.sp-actions { display: grid; gap: 10px; }
.sp-action { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--rule, #c7d4cd); background: #fff; color: var(--ink, #0f2b25); text-decoration: none; transition: border-color var(--dur-1, 120ms) ease, transform var(--dur-2, 220ms) ease; }
.sp-action:hover { border-color: var(--emerald, #0a7350); transform: translateY(-1px); }
.sp-action:focus-visible { outline: 3px solid var(--emerald, #0a7350); outline-offset: 2px; }
.sp-action b { display: block; font-size: 15px; }
.sp-action small { display: block; color: var(--steel, #4b5f59); font-size: 13px; line-height: 1.8; margin-top: 2px; }
.sp-action-icon { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--emerald-tint, #e2f1e9); color: var(--emerald-deep, #075a3e); font-weight: 800; font-size: 16px; }
.sp-badge { display: inline-block; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--flame, #e8922a); border-radius: 999px; padding: 1px 9px; vertical-align: 2px; }
.sp-safety { border-radius: 12px; padding: 12px 14px; background: #fff7ed; border: 1px solid #f5c58c; }
.sp-safety b { color: #8a4b05; }
.sp-safety p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.8; color: #5c3404; }

.sp-faq-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sp-faq-filter .lib-chip { cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; }
.sp-faq-filter .lib-chip[aria-pressed="true"] { background: var(--ink, #0f2b25); color: #fff; border-color: var(--ink, #0f2b25); }
.sp-faq-list { display: grid; gap: 8px; max-width: 900px; }
.sp-faq { border: 1px solid var(--rule, #c7d4cd); border-radius: 12px; background: #fff; scroll-margin-top: 110px; }
.sp-faq[hidden] { display: none; }
.sp-faq summary { cursor: pointer; list-style: none; padding: 14px 16px; min-height: 52px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary::after { content: "+"; font-size: 20px; color: var(--emerald, #0a7350); flex: none; transition: transform var(--dur-2, 220ms) ease; }
.sp-faq[open] summary::after { transform: rotate(45deg); }
.sp-faq summary:focus-visible { outline: 3px solid var(--emerald, #0a7350); outline-offset: -3px; border-radius: 12px; }
.sp-faq-body { padding: 0 16px 14px; }
.sp-faq-body p { margin: 0 0 10px; line-height: 2; color: var(--ink-2, #2b4741); white-space: pre-line; }
.sp-vote { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--steel, #4b5f59); }
.sp-vote .button { min-height: 36px; }
.sp-contact, .sp-empty { margin-top: 18px; color: var(--steel, #4b5f59); }

/* ---------- Customer tickets ---------- */
.sp-narrow { max-width: 860px; }
.sp-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-ticket a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule, #c7d4cd); border-radius: 12px; background: #fff; color: var(--ink, #0f2b25); text-decoration: none; }
.sp-ticket a:hover { border-color: var(--emerald, #0a7350); }
.sp-ticket.is-unread a { border-inline-start: 4px solid var(--flame, #e8922a); }
.sp-ticket.is-closed a { opacity: .75; }
.sp-ticket-main { display: grid; gap: 2px; min-width: 0; }
.sp-ticket-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-ticket-main small { color: var(--steel, #4b5f59); }
.sp-ticket-side { display: flex; align-items: center; gap: 8px; flex: none; }
.sp-thread-list { list-style: none; padding: 0; }
.sp-body { white-space: pre-wrap; }
.sp-attachment { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; min-height: 36px; color: var(--emerald-deep, #075a3e); }
.sp-reply-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.sp-attach-label { font-size: 13px; font-weight: 700; }
.sp-reply-row .file-control { flex: 1 1 240px; }
.sp-close-form { margin-top: 6px; }
.sp-rate { margin-top: 18px; border-top: 1px dashed var(--rule, #c7d4cd); padding-top: 14px; }
.sp-rate fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; max-width: 520px; }
.sp-rate legend { font-weight: 700; margin-bottom: 6px; }
.sp-rate-row { display: flex; gap: 10px; }
.sp-rate-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule, #c7d4cd); border-radius: 10px; cursor: pointer; }
.sp-rate-opt:has(input:checked) { border-color: var(--emerald, #0a7350); background: var(--emerald-tint, #e2f1e9); }
.sp-suggest { border: 1px solid var(--emerald, #0a7350); background: var(--emerald-tint, #e2f1e9); border-radius: 10px; padding: 10px 14px; }
.sp-suggest ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.sp-suggest summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.sp-suggest p { margin: 4px 0 6px; white-space: pre-line; line-height: 1.9; font-size: 14px; }
.sp-from-assistant { background: var(--emerald-tint, #e2f1e9); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; }
.sp-privacy { color: var(--steel, #4b5f59); font-size: 12.5px; max-width: 460px; line-height: 1.8; }

/* ---------- Admin ticket desk ---------- */
.sp-admin-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sp-stat { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--rule, #c7d4cd); background: #fff; color: var(--ink, #0f2b25); text-decoration: none; min-height: 44px; }
.sp-stat b { font-size: 22px; }
.sp-stat.is-on { border-color: var(--emerald, #0a7350); box-shadow: 0 0 0 2px var(--emerald-tint, #e2f1e9); }
.sp-stat-urgent b { color: #b42318; }
.sp-row-unread td { background: #fffaf3; }
.sp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--flame, #e8922a); margin-inline-end: 6px; vertical-align: 1px; }
.sp-suggested { color: #8a4b05 !important; }
.sp-pri-urgent { color: #b42318; font-weight: 800; }
.sp-pri-high { color: #8a4b05; font-weight: 700; }
.sp-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sp-admin-side { display: grid; gap: 12px; }
.sp-side-title { font-size: 15px; margin: 0 0 10px; }
.sp-triage p { margin: 0 0 8px; line-height: 1.8; }
.sp-reply-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sp-draft-note { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; background: #fff7ed; border: 1px solid #f5c58c; font-size: 13px; }
.sp-ai-tag { font-size: 10.5px; font-weight: 700; color: var(--emerald-deep, #075a3e); background: #fff; border-radius: 4px; padding: 1px 6px; }
.sp-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; }
.sp-ai-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 0; }
.sp-ai-facts div { border: 1px solid var(--rule-soft, #dfe7e2); border-radius: 8px; padding: 8px 12px; }
.sp-ai-facts dt { font-size: 12px; color: var(--steel, #4b5f59); }
.sp-ai-facts dd { margin: 2px 0 0; font-weight: 700; }
.sp-down ul { padding-inline-start: 18px; }

@media (max-width: 980px) {
  .sp-ask-shell, .sp-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sp-ticket a { flex-direction: column; align-items: flex-start; }
  .sp-ticket-main b { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .sp-action, .sp-faq summary::after { transition: none; } .sp-action:hover { transform: none; } }
