/* Help desk ("Get help") and the sign-in code step. Kept apart from app.css. Mobile first: everything works at 375 px, tap targets
   are at least 44 px, and the reply box and the approval buttons sit where a thumb reaches. */

/* sign-in code */
.code-input { font: 600 1.6rem/1.2 var(--mono); letter-spacing: .25em; text-transform: uppercase; text-align: center; }
.check { display: grid; grid-template-columns: 1.5rem 1fr; gap: .1rem .6rem; align-items: start; }
.check input[type=checkbox] { width: 1.4rem; height: 1.4rem; margin: .15rem 0 0; }
.check label { margin: 0; font-weight: 600; }
.check p { grid-column: 2; margin: 0; }

/* new request */
.hd-big { min-height: 9rem; font-size: 1.05rem; }
.hd-send { min-width: 7rem; }
.hd-form button.hd-send { width: 100%; min-height: 48px; font-size: 1.05rem; }
.hd-get-help { min-height: 48px; font-size: 1.05rem; }
.hd-list { gap: .5rem; }
.hd-job { padding: 0; }
.hd-job-link { display: grid; gap: .25rem; padding: .85rem 1rem; text-decoration: none; color: inherit; min-height: 44px; }
.hd-job-title { font-weight: 600; overflow-wrap: anywhere; }
.hd-title { margin-bottom: .25rem; overflow-wrap: anywhere; }

/* thread */
.hd-status { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; margin: .25rem 0 .75rem; }
.hd-items { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.hd-items > li { min-width: 0; }
.hd-fix { min-width: 0; overflow-wrap: anywhere; }
.card > h2:first-child { margin-top: 0; }
.hd-msg { display: grid; gap: .15rem; max-width: 92%; }
.hd-msg.mine { justify-self: end; }
.hd-msg.theirs { justify-self: start; }
.hd-bubble { padding: .6rem .85rem; border-radius: 14px; border: 1px solid var(--border); background: var(--card); overflow-wrap: anywhere; }
.hd-msg.mine .hd-bubble { background: var(--accent-soft); border-color: var(--accent); border-bottom-right-radius: 4px; }
.hd-msg.theirs .hd-bubble { border-bottom-left-radius: 4px; }
.hd-msg.tech .hd-bubble { border-color: var(--ok); }
.hd-msg.mine .hd-who { text-align: right; }
.hd-system { display: block; }
.hd-notice { margin: 0; padding: .5rem .75rem; text-align: center; color: var(--muted); font-size: .92rem; }
.hd-notice.esc { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius); color: var(--fg); }
.hd-tool { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; padding: .35rem .75rem; border-left: 3px solid var(--border); color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.hd-tool.ok { border-left-color: var(--ok); }
.hd-tool.refused, .hd-tool.error { border-left-color: var(--warn); }
.hd-tool.blocked, .hd-tool.invalid { border-left-color: var(--bad); }
.hd-tool.hidden-from-client { background: var(--bad-soft); }
.hd-tool details { flex-basis: 100%; }
.hd-tool-text { color: var(--fg); }
.hd-step { text-transform: uppercase; letter-spacing: .04em; }
.hd-fix { border-left: 4px solid var(--accent); }
.hd-decide, .hd-yesno { display: grid; gap: .6rem; }
.hd-decide button, .hd-yesno button { width: 100%; min-height: 52px; font-size: 1.05rem; }
.hd-confirm { border-left: 4px solid var(--ok); }
.hd-person { margin-top: .75rem; }
.hd-person button { width: 100%; }

/* reply box: stays at the bottom of the viewport on a phone */
.hd-reply { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; position: sticky; bottom: 0; padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
.hd-reply textarea { min-height: 3rem; resize: vertical; }
.hd-reply .hd-send { min-width: 4.5rem; min-height: 48px; }
.hd-reply.staff { position: static; display: grid; grid-template-columns: 1fr; max-width: 40rem; border: 0; }
.hd-hint { margin: .25rem 0 0; }

@media (max-width: 40rem) {
  .hd-msg { max-width: 100%; }
  .hd-tool { padding-left: .6rem; }
}
@media (prefers-reduced-motion: no-preference) { .hd-bubble { transition: background-color .2s; } }

/* the proposed-change card inside the thread: no second title, and on a phone the table becomes stacked rows */
.hd-fix .recdiff > p:first-child { display: none; }
.hd-fix .recdiff { border-left-width: 2px; }
.hd-fix .table-wrap { border: 0; }
@media (max-width: 40rem) {
  .hd-fix .recdiff thead { display: none; }
  .hd-fix .recdiff table, .hd-fix .recdiff tbody, .hd-fix .recdiff tr, .hd-fix .recdiff td { display: block; width: 100%; }
  .hd-fix .recdiff tr { padding: .35rem 0; border-bottom: 1px solid var(--border); }
  .hd-fix .recdiff tr:last-child { border-bottom: 0; }
  .hd-fix .recdiff td { border: 0; padding: .1rem 0; overflow-wrap: anywhere; }
  .hd-fix .recdiff td::before { color: var(--muted); font: 600 .72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .05em; display: block; }
  .hd-fix .recdiff td:nth-child(1)::before { content: "Change"; }
  .hd-fix .recdiff td:nth-child(2)::before { content: "Setting"; }
  .hd-fix .recdiff td:nth-child(3)::before { content: "Now"; }
  .hd-fix .recdiff td:nth-child(4)::before { content: "New value"; }
}
