/* Clockface Online support: /support (support.php, partials/support/) and the admin inbox
   (account/admin_support.php). Loads after cfo-tokens.css, cfo.css, cfo-pages.css and, on the
   public pages, cfo-legal.css. Tokens only, so light and dark both follow the shell's theme. */

/* ---------- Breadcrumb overline ---------- */
.cfo-support-crumb { color: var(--text-secondary); text-decoration: none; }
.cfo-support-crumb:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Search ---------- */
.cfo-support-search { position: relative; }
.cfo-support-search .cfo-input { height: 48px; padding-left: 44px; font-size: 15px; background: var(--surface); }
.cfo-support-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.cfo-support-search-status { min-height: 16px; margin-top: calc(var(--space-3) * -1); }
.cfo-support-search-status:empty { display: none; }

/* ---------- Article lists ---------- */
.cfo-legal-doc .cfo-support-cat h2 { display: flex; align-items: center; gap: var(--space-2); }
.cfo-legal-doc .cfo-support-cat h2 i { color: var(--accent-ink); font-size: 16px; }
.cfo-legal-doc .cfo-support-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.cfo-legal-doc .cfo-support-list li { margin: 0; }
/* The list has no bottom margin, so give the "New request" button below it room to breathe. */
.cfo-legal-doc .cfo-support-tickets + p { margin-top: var(--space-5); }
.cfo-support-list a {
  display: grid;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none !important;
  font-weight: 400 !important;
}
.cfo-support-list a:hover { background: var(--surface-hover); border-color: var(--border-control); }
.cfo-support-list a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cfo-support-list-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.cfo-support-list-summary { font-size: 13px; line-height: 20px; color: var(--text-secondary); }
.cfo-support-list-summary .cfo-badge { margin-right: var(--space-1); }
.cfo-support-empty { margin: var(--space-4) 0 0; color: var(--text-secondary); }
/* Dividers only between the categories still showing while a search filters them. */
.cfo-legal-doc.cfo-support-index section + section { margin-top: 0; padding-top: 0; border-top: 0; }
.cfo-legal-doc.cfo-support-index .cfo-support-cat:not([hidden]) ~ .cfo-support-cat:not([hidden]) { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--border); }
.cfo-support-empty[hidden], .cfo-support-cat[hidden], .cfo-support-list li[hidden] { display: none; }

/* ---------- "Still need help" ---------- */
.cfo-support-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--primary-tint);
  border: 1px solid var(--primary-line);
}
.cfo-support-cta-title { margin: 0 0 var(--space-1); font-size: 18px; line-height: 26px; font-weight: 700; color: var(--ink); }
.cfo-support-cta-text { margin: 0; font-size: 14px; line-height: 22px; color: var(--text-primary); }
.cfo-support-cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 600px) {
  .cfo-support-cta { padding: var(--space-5) var(--space-4); }
  .cfo-support-cta-actions, .cfo-support-cta-actions .cfo-btn { width: 100%; }
}

/* ---------- Article page ---------- */
.cfo-support-article kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--border-control);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font: inherit;
  font-size: 13px;
  line-height: 20px;
}
.cfo-support-related ul { margin: 0; }

/* ---------- Forms ---------- */
.cfo-support-hint { margin: 0 0 var(--space-5) !important; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-subtle); font-size: 14px; line-height: 22px; }
.cfo-support-hint i { color: var(--gold-ink); margin-right: var(--space-1); }
.cfo-support-form { display: grid; gap: var(--space-4); margin: 0; }
.cfo-support-form .cfo-field + .cfo-field { margin-top: 0; }
.cfo-support-form .cfo-field-label, .cfo-support-admin-status .cfo-field-label, .cfo-support-admin-reply-row .cfo-field-label, .cfo-support-filters .cfo-field-label {
  font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text-primary);
}
.cfo-support-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
/* Fields in a row stretch to the tallest one; keep label + input at the top instead of spreading them. */
.cfo-support-row .cfo-field { align-content: start; }
/* Help text with inline links reads as a sentence, not flex columns. */
.cfo-support-form .cfo-field-help { display: block; }
.cfo-support-form select.cfo-input { cursor: pointer; }
.cfo-support-form .cfo-input[readonly] { color: var(--text-secondary); cursor: default; }
.cfo-support-textarea { height: auto; min-height: 140px; padding: var(--space-3); line-height: 22px; resize: vertical; }
.cfo-support-form .cfo-field-help a { font-size: inherit; }
.cfo-support-count:empty { display: none; }
.cfo-support-form .cfo-notice { margin: 0; }
.cfo-legal-doc > .cfo-notice { margin: 0 0 var(--space-4); }
.cfo-support-privacy { margin: 0 !important; }
.cfo-support-form > .cfo-btn { justify-self: start; }
@media (max-width: 600px) { .cfo-support-form > .cfo-btn { justify-self: stretch; } }
.cfo-support-sent-text { margin: var(--space-4) 0 !important; }

/* Honeypot: off-screen for people, still in the DOM for bots. */
.cfo-support-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Ticket conversation ---------- */
.cfo-support-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-5); font-size: 13px; line-height: 20px; color: var(--text-secondary); }
.cfo-support-thread { display: grid; gap: var(--space-3); margin: 0 0 var(--space-6) !important; padding: 0 !important; list-style: none; }
.cfo-legal-doc .cfo-support-thread li, .cfo-support-thread li { margin: 0; }
.cfo-support-msg { padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.cfo-support-msg-staff { border-color: var(--primary-line); background: var(--primary-tint); }
.cfo-support-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: 14px; line-height: 20px; color: var(--ink); }
.cfo-support-msg-body { font-size: 15px; line-height: 24px; color: var(--text-primary); overflow-wrap: anywhere; }
.cfo-support-status-open { background: var(--info-tint); color: var(--info); box-shadow: none; }
.cfo-support-status-answered { background: var(--primary-tint); color: var(--primary-ink); box-shadow: none; }
.cfo-support-reply { padding-top: var(--space-5); border-top: 1px solid var(--border); }

/* ---------- Admin inbox ---------- */
a.cfo-support-stat { text-decoration: none; color: inherit; }
a.cfo-support-stat:hover { background: var(--surface-hover); }
a.cfo-support-stat[aria-current="true"] { border-color: var(--ink); }
.cfo-support-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: 0 !important; }
.cfo-support-filters .cfo-field { min-width: 160px; }
.cfo-support-filter-q { flex: 1 1 240px; }
.cfo-support-admin-status, .cfo-support-admin-reply-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.cfo-support-admin-status .cfo-input, .cfo-support-admin-reply-row .cfo-input { width: auto; min-width: 160px; }
.cfo-support-pager { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-3) !important; }
.cfo-admin-main > .cfo-notice { margin: 0 0 var(--space-5); }

/* ---------- Service status banner (/support) ---------- */
.cfo-notice.cfo-support-status { margin: 0; }
.cfo-support-status .cfo-link { font-size: inherit; }

/* ---------- "Your account" box (/support, /support/contact) ---------- */
.cfo-support-acct {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.cfo-support-acct-title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 18px; line-height: 26px; font-weight: 700; color: var(--ink); }
.cfo-support-acct-title i { color: var(--accent-ink); font-size: 16px; }
.cfo-support-acct .cfo-notice { margin: 0; }
.cfo-support-acct-list { display: grid; gap: var(--space-2); margin: 0; }
.cfo-support-acct-list > div { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: var(--space-1) var(--space-4); align-items: baseline; }
.cfo-support-acct-list dt { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text-secondary); }
.cfo-support-acct-list dd { margin: 0; font-size: 14px; line-height: 22px; color: var(--text-primary); overflow-wrap: anywhere; }
.cfo-support-acct-list .cfo-badge { margin-right: var(--space-1); }
.cfo-support-acct-list .cfo-link { font-size: inherit; margin-left: var(--space-1); }
.cfo-support-acct-detail { color: var(--text-secondary); }
.cfo-support-acct-reset { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.cfo-support-acct-reset .cfo-caption { margin: 0; }
@media (max-width: 600px) {
  .cfo-support-acct { padding: var(--space-5) var(--space-4); }
  .cfo-support-acct-list > div { grid-template-columns: 1fr; }
}

/* ---------- Screenshot attachments ---------- */
.cfo-support-file { height: auto; padding: var(--space-2); cursor: pointer; }
.cfo-support-file-error[hidden] { display: none; }
.cfo-support-attach { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 0 !important; padding: 0 !important; list-style: none; }
.cfo-legal-doc .cfo-support-attach li, .cfo-support-attach li { margin: 0; }
.cfo-support-attach a { display: block; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-subtle); line-height: 0; }
.cfo-support-attach a:hover { border-color: var(--border-control); }
.cfo-support-attach a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cfo-support-attach img { display: block; width: auto; height: auto; max-width: 160px; max-height: 120px; object-fit: contain; }

/* ---------- "These might help" (contact form) ---------- */
.cfo-support-suggest { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4) var(--space-4); border: 1px solid var(--primary-line); border-radius: var(--radius-lg); background: var(--primary-tint); }
.cfo-support-suggest[hidden] { display: none; }
.cfo-support-suggest-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-2); }
.cfo-legal-doc .cfo-support-suggest-title, .cfo-support-suggest-title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 700; color: var(--ink); }
.cfo-support-suggest-title i { color: var(--gold-ink); margin-right: var(--space-1); }

/* ---------- Rating confirm page ---------- */
.cfo-support-rate-choice { display: flex; align-items: center; gap: var(--space-2); margin: 0 !important; font-size: 16px; line-height: 24px; }
.cfo-support-rate-emoji { font-size: 28px; line-height: 1; }

/* ---------- "Was this article helpful?" ---------- */
.cfo-support-feedback { padding: var(--space-4) var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); }
.cfo-support-feedback[hidden], .cfo-support-feedback-form[hidden], .cfo-support-feedback-more[hidden] { display: none; }
.cfo-support-feedback-form { display: grid; gap: var(--space-3); margin: 0; }
.cfo-support-feedback-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cfo-support-feedback-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 700; color: var(--ink); }
.cfo-support-feedback-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cfo-support-feedback-more .cfo-field-help { display: block; }
.cfo-support-feedback-status { margin: 0; font-size: 14px; line-height: 22px; color: var(--text-secondary); }
.cfo-support-feedback-status:empty { display: none; }
.cfo-support-feedback-form:not([hidden]) + .cfo-support-feedback-status:not(:empty) { margin-top: var(--space-2); }
@media (max-width: 600px) { .cfo-support-feedback { padding: var(--space-4); } }

/* ---------- "Include technical details" (contact form) ---------- */
.cfo-support-diag[hidden] { display: none; }
.cfo-support-diag-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 14px; line-height: 22px; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.cfo-support-diag-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.cfo-support-diag-more { font-size: 13px; line-height: 20px; color: var(--text-secondary); }
.cfo-support-diag-more summary { display: inline; cursor: pointer; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.cfo-support-diag-more summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cfo-legal-doc .cfo-support-diag-more ul, .cfo-support-diag-more ul { margin: var(--space-2) 0 !important; padding-left: var(--space-5) !important; }
.cfo-legal-doc .cfo-support-diag-more li, .cfo-support-diag-more li { margin: 0; font-size: 13px; line-height: 20px; }
.cfo-legal-doc .cfo-support-diag-more p, .cfo-support-diag-more p { margin: 0 !important; font-size: 13px; line-height: 20px; }
