/* Support (frontend/support.js). Only what the shared classes in styles.css cannot do: the
   page is built from .lib-wrap/.lib-head, .lib-tabs, .seg-group, .lib-list/.lib-row,
   .lib-tag, .pb-field and the .btn-* buttons. Every colour is a token, so both themes
   follow; nothing here names a hex. */
.sup-wrap { max-width: 860px; }
.sup-wrap button:disabled, .sup-wrap select:disabled { opacity: .55; cursor: default; }
.sup-empty { padding: 24px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-dim); }
.sup-empty p { margin: 0; }
.sup-empty .btn-mini { height: 30px; margin-top: 12px; }

/* The row above a list: its filter, and (an admin) who new cases go to. */
.sup-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.sup-bar:empty { display: none; }
.sup-default { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.sup-select { max-width: 100%; padding: 7px 10px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sup-select:focus { outline: none; border-color: var(--accent); }

/* A status is .lib-tag's colours, in ordinary words rather than capitals. */
.sup-pill { font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }

/* Lists: .lib-row as a button. Not read yet = a dot and a heavier subject. */
.sup-list { margin: 0; padding: 0; list-style: none; }
.sup-row { width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.sup-row:hover { border-color: var(--accent); }
.sup-row .lib-row-main, .sup-row .lib-row-sub, .sup-line { display: block; }
.sup-row .sup-subject { font-weight: 500; overflow-wrap: anywhere; }
.sup-row.unread .sup-subject, .sup-co { font-weight: 700; }
.sup-line { margin-top: 2px; font-size: 13.5px; }
.sup-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.sup-server { font-size: 12px; font-weight: 400; color: var(--text-faint); }
.sup-when { flex-shrink: 0; font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* The New request form and the reply box. */
.sup-card { display: flex; flex-direction: column; gap: 14px; margin: 0 0 18px; padding: 16px 18px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
.sup-card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.sup-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sup-kinds legend { margin-bottom: 6px; padding: 0; font-size: 12.5px; color: var(--text-dim); }
.sup-kind { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sup-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sup-kind input { margin: 4px 0 0; accent-color: var(--accent); }
.sup-kind b { display: block; font-size: 13.5px; font-weight: 600; }
.sup-kind small { display: block; font-size: 12.5px; color: var(--text-dim); }
.sup-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.sup-count { margin-right: auto; font-size: 12px; color: var(--warn); }
.sup-seen { margin: 0; font-size: 12.5px; color: var(--text-dim); }

/* One thread: the reader's own side on the right, the other side on the left. */
.sup-head .sup-from { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 14px; }
.sup-title { margin: 0 0 8px; font-size: 22px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.sup-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 13px; color: var(--text-dim); }
.sup-thread { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.sup-msg { display: flex; flex-direction: column; align-items: flex-start; align-self: flex-start; max-width: 82%; min-width: 0; }
.sup-msg.ours { align-items: flex-end; align-self: flex-end; }
.sup-msg-meta { margin-bottom: 3px; font-size: 12px; color: var(--text-faint); }
/* ⚠️ pre-wrap is what keeps a person's line breaks: the body is escaped text, not markup. */
.sup-bubble { padding: 10px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
.sup-msg.ours .sup-bubble { background: var(--user-bubble); border-color: transparent; }
.sup-note { align-self: center; margin: 0; font-size: 12px; text-align: center; color: var(--text-faint); }
.sup-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sup-acts label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }

@media (max-width: 640px) {
  .sup-card { padding: 12px; }
  .sup-msg { max-width: 94%; }
  .sup-default { margin-left: 0; }
}
