.support-avatar { position:relative; display:inline-flex; flex:none; }
.support-dot { position:absolute; right:-2px; top:-2px; width:9px; height:9px; border-radius:50%; background:#b83d1b; box-shadow:0 0 0 2px var(--bg-secondary,#f1ece4); }
.support-dot[hidden] { display:none; }
.support-panel { padding:clamp(14px,3vw,28px); overflow-wrap:anywhere; }
.support-panel textarea { width:100%; }
.support-message,.support-replies article,.ticket-list li { padding:.75rem 0; border-bottom:1px solid var(--border-subtle,#e2d9cc); overflow-wrap:anywhere; }
.support-message p,.support-replies p { margin:.35rem 0; }
.ticket-list { list-style:none; padding:0; }
.ticket-list small,.support-message small { display:block; }
.private-note { background:#f1ece4; padding:.75rem; }
.support-replies { border-inline-start:3px solid #b83d1b; padding:0 1rem; margin-block:1rem; }

.support-desk { --desk-line:#e2d9cc; color:#22201e; }
.desk-heading,.desk-heading nav,.desk-assignment { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem 1.2rem; }
.desk-heading { justify-content:space-between; margin-bottom:1rem; }
.desk-heading h1 { margin:0; }
.desk-shortcuts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.6rem; }
.desk-shortcuts a,.desk-panel,.desk-tickets,.desk-filters { border:1px solid var(--desk-line); border-radius:12px; background:#faf8f5; }
.desk-shortcuts a { display:flex; flex-direction:column; justify-content:space-between; color:#5e5852; padding:.75rem; text-decoration:none; }
.desk-shortcuts strong { font-size:1.5rem; color:#22201e; }
.desk-shortcuts a[aria-current] { outline:2px solid #b83d1b; text-decoration:underline; }
.desk-filters,.desk-panel { padding:1rem; margin:1rem 0; }
.desk-filters { display:flex; flex-wrap:wrap; align-items:end; gap:.75rem; background:#f1ece4; }
.support-desk :is(select,input,textarea) { font:inherit; max-width:100%; }
.desk-filters label { flex:1 1 10rem; min-width:0; }
.desk-filters :is(select,input) { display:block; width:100%; min-height:44px; border:1px solid #81776d; border-radius:8px; padding:.4rem; }
.desk-tickets { list-style:none; padding:0; }
.desk-tickets li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem; padding:.85rem 1rem; }
.desk-tickets li+li { border-top:1px solid var(--desk-line); }
.desk-tickets li>a { flex:1 1 14rem; text-decoration:none; }
.desk-tickets li>a:hover strong { text-decoration:underline; }
.desk-tickets small { display:block; color:#5e5852; margin-top:.2rem; }
.ticket-state { display:inline-block; background:#f1ece4; color:#554c42; padding:.15rem .5rem; border-radius:8px; font-size:.85rem; font-weight:600; }
.state-staff { background:#fbe6de; color:#8b3118; }
.state-customer { background:#e1ecde; color:#315d39; }
.desk-assignment { padding:.7rem 0; }
.support-message { margin:.75rem 0; padding:.85rem 1rem; border:1px solid #e2d9cc; border-radius:12px; }
.message-staff { background:#f1ece4; }
.private-note { background:#fbefd3; border-inline-start:4px solid #816022; }
.support-desk textarea { width:100%; }
.support-desk :focus-visible { outline:3px solid #9e3417; outline-offset:2px; }

.desk-panel summary,.support-message,.desk-tickets { overflow-wrap:anywhere; }
.desk-panel form { display:grid; gap:.75rem; }
.desk-panel form p { margin:0; }
.desk-panel form button { justify-self:start; }

.evidence-tools { min-width:0; border:1px solid #a99c8a; border-radius:12px; padding:1rem; margin:1rem 0; }
.evidence-tools legend { font-weight:600; }
.evidence-tools small { display:block; color:#5e5852; }
.evidence-tools legend small { display:inline; }
.evidence-picker { display:block; margin-top:.8rem; }
.evidence-tools input[type=file] { display:block; width:100%; }
.evidence-tools [data-previews] { display:flex; flex-wrap:wrap; gap:.5rem; padding:0; list-style:none; }
.evidence-tools [data-previews] img,.support-shot img { width:110px; height:80px; object-fit:contain; display:block; }
.support-shot { display:inline-block; }
.recording-list,[data-events] { max-height:18rem; overflow:auto; overflow-wrap:anywhere; }
.capture-bar { display:flex; justify-content:center; align-items:center; gap:.65rem; background:#f1ece4; color:#22201e; padding:.3rem .6rem; flex-wrap:wrap; font-size:.9rem; border-bottom:1px solid #a99c8a; }
body.application-shell > header:has(.capture-bar) { flex-wrap:wrap; }
header > .capture-bar { flex-basis:100%; }
.capture-bar button { min-height:36px; }
.evidence-tools [hidden],.evidence-tools[hidden] { display:none!important; }

/* Customer support */
.application-shell .support-surface {
  padding:clamp(18px,4vw,34px); background:var(--bg-primary);
  border:1px solid var(--border-subtle); border-radius:12px; box-shadow:var(--shadow);
}
.support-surface .support-title { margin-block:0 1.35rem; }
.support-surface .support-title h1 { margin:0; line-height:1.12; text-wrap:balance; }
.support-title p,.ticket-empty p,.composer-footer small { color:var(--text-secondary); }
.support-title p { margin:.65rem 0 0; }
.support-title-row,.support-links,.composer-footer,.ticket-meta,.attachment-actions {
  display:flex; align-items:center; flex-wrap:wrap; gap:.65rem 1rem;
}
.support-title-row,.support-links,.composer-footer { justify-content:space-between; }
.support-surface .support-links { margin-bottom:1.3rem; }
.support-links a,.support-footnote a { font-weight:600; text-underline-offset:.22em; }
.back-link::before { content:""; display:inline-block; width:.48em; height:.48em; margin-right:.55em;
  border-left:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); vertical-align:.08em; }
.support-surface .new-ticket,.support-surface .send-action { min-height:44px; padding:.65rem 1.15rem; }
.support-surface .ticket-filters {
  display:flex; flex-wrap:wrap; gap:4px; padding:.3rem; background:var(--bg-secondary);
  border-radius:12px; margin:0 0 1rem;
}
.support-surface .ticket-filters a { flex:1 0 auto; display:grid; place-items:center; text-align:center; padding:.55rem .65rem; font-size:.875rem;
  color:var(--text-secondary); border:1px solid transparent; border-radius:9px; text-decoration:none; }
.support-surface .ticket-filters a[aria-current] { background:var(--bg-primary); color:var(--text-primary);
  border-color:#aea08f; box-shadow:0 1px 3px rgba(34,32,30,.08); font-weight:700; text-decoration:underline; text-underline-offset:.22em; }
.support-surface .ticket-list { margin:0; }
.support-surface .ticket-list li { padding:0; }
.ticket-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.45rem 1rem; text-decoration:none; padding:.65rem 0; }
.ticket-row:hover strong,.ticket-row:focus-visible strong { text-decoration:underline; }
.ticket-summary { flex:1 1 12rem; min-width:0; }
.ticket-summary strong { color:var(--text-primary); }
.ticket-summary small { color:var(--text-secondary); margin-top:.22rem; }
.support-surface .ticket-row { padding:1rem .4rem; }
.ticket-meta { margin-bottom:.6rem; color:var(--text-secondary); font-size:.88rem; }
.ticket-empty,.application-shell .support-surface .evidence-tools { background:var(--bg-secondary); border-radius:12px; padding:1rem; }
.ticket-empty h2 { margin:0; }
.ticket-empty p { margin:.4rem 0; }
.support-footnote { margin-top:1.4rem; }
.support-surface [data-composer] > p { margin:0 0 1rem; }
.support-surface [data-composer] > p > label { display:block; font-weight:650; margin-bottom:.35rem; }
.support-surface [data-composer] :is(input[type=text],textarea) { width:100%; box-sizing:border-box; border:1px solid var(--field);
  border-radius:10px; padding:.75rem; background:var(--bg-primary); color:var(--text-primary); }
.support-surface [data-composer] textarea { min-height:7rem; resize:vertical; }
.support-surface .evidence-tools { margin:1.2rem 0; border:1px solid var(--border-subtle); }
.evidence-tools legend small { font-weight:400; }
.attachment-actions { gap:.55rem; margin:.15rem 0 .6rem; }
.attachment-actions button,.attachment-upload { font:inherit; font-weight:600; font-size:.9rem; }
.attachment-upload { position:relative; display:inline-flex; align-items:center; cursor:pointer; min-height:44px;
  padding:.45rem .85rem; box-sizing:border-box; background:var(--bg-primary); border:1px solid var(--field); border-radius:12px; }
.attachment-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.attachment-upload:focus-within,.support-surface :focus-visible { outline:3px solid var(--action-hover); outline-offset:2px; }
.evidence-tools [data-consent],.evidence-tools [data-review] { margin-top:.85rem; padding-top:.8rem; border-top:1px solid var(--border-subtle); }
.evidence-tools :is([data-previews],[data-feedback]):empty { display:none; }
.composer-footer small { flex:1 1 12rem; line-height:1.4; }
.ticket-notice { padding:.75rem 1rem; background:var(--bg-secondary); border-left:3px solid var(--action-primary); }
.support-history { display:flow-root; margin-bottom:1.1rem; }
.support-history .support-message { max-width:94%; border:1px solid var(--border-subtle); background:var(--bg-secondary); }
.support-history .message-customer { margin-left:auto; background:var(--bg-primary); }
.support-history .support-message > small { margin-bottom:.55rem; color:var(--text-secondary); }
.support-surface #reply { border-top:1px solid var(--border-subtle); padding-top:1.1rem; }
.support-surface #reply h2 { margin-top:0; }
@media(max-width:599px) {
  .support-surface .ticket-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .support-surface .ticket-filters a { min-height:44px; height:100%; box-sizing:border-box; }
  .support-surface .ticket-row { display:grid; justify-items:start; }
  .support-surface .attachment-actions { display:grid; grid-template-columns:1fr; gap:.55rem; }
  .support-surface .attachment-actions > :is(button,label) { margin:0; width:100%; justify-content:center; }
  .composer-footer { align-items:stretch; }
  .composer-footer small,.composer-footer .send-action { flex:1 0 100%; }
  .support-history .support-message { max-width:98%; }
}

.support-faq > details { border-bottom:1px solid var(--border-subtle); padding:.75rem .1rem; }
.support-faq > details > summary { cursor:pointer; font-weight:650; }
.support-faq > details p { color:var(--text-secondary); margin-bottom:.15rem; }
.desk-heading nav a,.desk-thread-links a { text-underline-offset:.22em; }
.desk-thread-links { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.5rem 1rem; margin:0 0 1rem; }
.desk-shortcuts a { padding:clamp(.65rem,2vw,1rem); gap:.3rem; }
.desk-shortcuts a:hover,.desk-tickets li:focus-within { background:#f1ece4; }
.desk-shortcuts a[aria-current] { background:#f1ece4; color:#22201e; }
.agent-thread .desk-assignment { background:#f1ece4; border:1px solid var(--desk-line); border-radius:12px; padding:.8rem 1rem; margin:1rem 0; }
.agent-thread > form:has(textarea) { padding:1rem; border:1px solid var(--desk-line); border-radius:12px; margin:1rem 0; }
.agent-thread > form textarea { border:1px solid #81776d; border-radius:8px; padding:.6rem; background:#faf8f5; }
