/* Help for this ticket (GitHub issue 488, stage 2; docs/adr/0241; public/js/app/ticket-help-panel.js). A staff ticket's
   right-hand column as one card of sections, each a heading line with its count that folds the section, and its body.
   An empty section is one short line: its heading, a 0, and its sentence in muted words, no box of its own. A list shows
   a few rows, then "Show N more"; a row's title is two lines at most (.title-cap), and everything else wraps, never
   with an ellipsis. The reply box's own parts (the To / CC line, the article hint, "N people will get this") are new elements
   with their own classes: no rule of the reply box itself changes here. Colors are the palette's tokens, so the dark
   theme follows. */

.th-panel { display:flex; flex-direction:column; min-width:0; border:1px solid var(--line); border-radius:var(--radius-xl); background:var(--surface); }
.th-panel [hidden] { display:none !important; }
.th-panel-title { margin:0; padding:var(--space-150) var(--space-200) var(--space-100); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); letter-spacing:.02em; text-transform:uppercase; }
.th-section { min-width:0; border-top:1px solid var(--line); }
.th-head { margin:0; font-size:var(--text-md); }
.th-fold { display:flex; align-items:center; gap:var(--space-100); width:100%; min-height:28px; padding:var(--space-100) var(--space-200); border:0; background:transparent; color:var(--ink); font:inherit; font-weight:var(--weight-semibold); text-align:left; cursor:pointer; }
.th-fold:hover { background:var(--hover-bg); }
.th-fold:focus-visible { outline:2px solid var(--spruce); outline-offset:-2px; }
.th-title { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }
.th-count { flex:0 0 auto; padding:0 var(--space-75); border-radius:var(--radius-pill); background:var(--surface-2, var(--hover-bg)); color:var(--ink-2); font-size:var(--text-xs); font-weight:var(--weight-semibold); line-height:1.6; white-space:nowrap; }
.th-chev { flex:0 0 auto; width:.45em; height:.45em; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); margin-left:var(--space-50); }
.th-section.is-folded .th-chev { transform:rotate(-45deg); }
.th-body { min-width:0; padding:0 var(--space-200) var(--space-150); overflow-wrap:anywhere; }
.th-section.is-empty .th-body { padding-bottom:var(--space-100); }
/* An empty section is one row: its heading, then its sentence and its action, wrapping only where the column is narrow. */
.th-section.is-empty { display:flex; flex-wrap:wrap; align-items:baseline; }
.th-section.is-empty > .th-head { flex:0 0 auto; }
.th-section.is-empty > .th-head .th-fold { width:auto; }
.th-section.is-empty > .th-body:not([hidden]) { display:flex; flex:1 1 12rem; flex-wrap:wrap; align-items:baseline; gap:var(--space-25) var(--space-100); padding-top:var(--space-100); }
.th-section.is-empty .th-empty .nt-link, .th-section.is-empty .th-body > .nt-link { margin:0; }
.th-empty { margin:0; color:var(--muted); font-size:var(--text-sm); }
.th-sub { margin:var(--space-50) 0; color:var(--muted); font-size:var(--text-sm); }
.th-none { color:var(--muted); font-size:var(--text-sm); }

/* The parts moved in (the fields' cards, the requester, the approval, the runbook, Linked): no box of their own. */
.tw .th-body > .detail-side-card, .tw .th-body > article.detail-side-card { margin:0; padding:0; border:0; border-radius:0; background:none; box-shadow:none; }
.tw .th-body > .detail-side-card + .detail-side-card { margin-top:var(--space-150); }
/* The compact layout pulls Classification up under the fields' card; inside Work fields it keeps its own space. */
.ticket-detail.tw.ts-compact .th-body > .detail-side-card.tw-classify { margin-top:var(--space-150); }
.th-section[data-help-section="linked"] #tpLinkedCard > h2,
.th-section[data-help-section="runbook"] #trbHeading { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.th-people-lists { display:flex; flex-direction:column; gap:var(--space-50); margin-top:var(--space-100); }
.th-people-lists .detail-cc-field { display:block; margin:0; }

/* Lists: a few rows, each a title (two lines at most), a small line, and its actions on one line that wraps. */
.th-list { display:flex; flex-direction:column; gap:var(--space-100); margin:0; padding:0; list-style:none; }
.th-row { display:flex; flex-direction:column; gap:var(--space-25); min-width:0; }
.th-row-title { display:block; width:100%; padding:0; border:0; background:none; color:var(--spruce-dark); font:inherit; font-size:var(--text-md); font-weight:var(--weight-semibold); text-align:left; cursor:pointer; }
.th-row-title:hover .title-cap { text-decoration:underline; }
.th-row small { color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.th-row .th-why { color:var(--ink-2); }
.th-actions { display:flex; flex-wrap:wrap; gap:var(--space-25) var(--space-150); }
.th-actions .nt-link[aria-disabled="true"], .th-actions .nt-link:disabled { opacity:.6; cursor:not-allowed; }
.th-more { margin-top:var(--space-100); }
.th-foot { margin:var(--space-100) 0 0; color:var(--muted); font-size:var(--text-sm); }
.th-hidden-list { margin-top:var(--space-100); opacity:.85; }
.th-ask { margin-top:var(--space-50); }

/* Tasks: the progress, then the open ones with their done box. */
.th-progress { height:6px; margin-top:var(--space-50); border-radius:var(--radius-pill); background:var(--line); overflow:hidden; }
.th-progress > span { display:block; height:100%; background:var(--spruce); }
.th-task label { display:flex; align-items:flex-start; gap:var(--space-75); font-size:var(--text-md); color:var(--ink); }
.th-task input { margin-top:.2em; }

/* The strips that moved into the panel are parked where they were. */
.tp-suggest.th-parked { display:none !important; }
.th-section[data-help-section="problems"] .tw-problem-suggest { margin:0; padding:0; border:0; background:none; }

/* ---------- The reply box ---------- */
.tp-to-cc { display:flex; flex-direction:column; gap:var(--space-50); padding:var(--space-100) var(--space-150); border-bottom:1px solid var(--line); font-size:var(--text-sm); color:var(--ink-2); }
.tp-to-line, .tp-cc-line { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-100); min-width:0; }
.tp-to-label { color:var(--muted); font-weight:var(--weight-semibold); }
.tp-to-name { color:var(--ink); font-weight:var(--weight-semibold); overflow-wrap:anywhere; }
.tp-cc-chips { display:flex; flex-wrap:wrap; gap:var(--space-50); min-width:0; }
.tp-cc-chip { display:inline-flex; align-items:center; gap:var(--space-25); max-width:100%; padding:0 var(--space-75); border:1px solid var(--line); border-radius:var(--radius-pill); background:var(--surface); color:var(--ink); overflow-wrap:anywhere; }
.tp-cc-chip button { padding:0 var(--space-25); border:0; background:none; color:var(--muted); cursor:pointer; }
.tp-cc-none { color:var(--muted); }
.tp-cc-help { margin:0; color:var(--muted); }
.tp-cc-pick { display:flex; flex-direction:column; gap:var(--space-50); }
.tp-cc-pick input { width:100%; max-width:24rem; padding:var(--space-75) var(--space-100); border:1px solid var(--line-strong, var(--line)); border-radius:var(--radius-md); background:var(--surface); color:var(--ink); }
.tp-cc-results { display:flex; flex-direction:column; max-width:24rem; }
.tp-cc-results button { display:flex; flex-direction:column; align-items:flex-start; padding:var(--space-75) var(--space-100); border:0; border-radius:var(--radius-md); background:none; color:var(--ink); text-align:left; cursor:pointer; }
.tp-cc-results button:hover, .tp-cc-results button:focus-visible { background:var(--hover-bg); }
.tp-cc-results small { color:var(--muted); overflow-wrap:anywhere; }
.tp-to-cc-note { margin:0; color:var(--ink-2); font-weight:var(--weight-semibold); }
.tp-to-cc.is-note { background:var(--saffron-pale); }
.tp-article-hint { margin:0; padding:var(--space-75) var(--space-150); border-bottom:1px solid var(--line); color:var(--ink-2); font-size:var(--text-sm); overflow-wrap:anywhere; }
.tp-hint-label { color:var(--muted); font-weight:var(--weight-semibold); }
.tp-reach { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-100); min-width:0; color:var(--muted); font-size:var(--text-sm); }
/* The composer footer keeps each of its items at its own width (styles.css); the line and its Who list wrap within it. */
.comment-composer .composer-footer > .tp-reach { flex:0 1 auto; max-width:100%; }
.tp-who { flex:1 1 100%; margin:var(--space-50) 0 0; padding-left:var(--space-200); color:var(--ink-2); overflow-wrap:anywhere; }
.tp-who-line { color:var(--muted); font-weight:var(--weight-semibold); }
.tp-who-missed { color:var(--ink-2); }

/* Admin settings › Tickets › Ticket page: the sections of Help for this ticket, in order. */
.ts-help-sections { margin-top:var(--space-200); }
.ts-help-list { display:flex; flex-direction:column; gap:var(--space-75); margin:var(--space-100) 0; padding-left:var(--space-250); }
.ts-help-item { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-150); }
.ts-help-item small { color:var(--muted); }
.ts-help-moves { display:inline-flex; flex-wrap:nowrap; gap:var(--space-100); margin-left:auto; }
.ts-help-moves .nt-link:disabled { color:var(--muted); text-decoration:none; cursor:default; opacity:.6; }

/* Send later (GitHub issue 513; public/js/app/send-later.js): the replies waiting in the conversation, the Send later part
   of the Send reply drop-down, and the date and time picker under the reply box. */
.sl-scheduled { display:flex; flex-direction:column; gap:var(--space-100); margin:var(--space-150) 0; }
.comment-history[style*="display: none"] ~ .sl-scheduled { display:none; }
.sl-scheduled[hidden] { display:none; }
.sl-title { display:flex; align-items:center; gap:var(--space-75); margin:0; color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.sl-count { padding:0 var(--space-75); border-radius:var(--radius-pill); background:var(--surface-2); color:var(--muted); font-size:var(--text-xs); }
.sl-reply { display:flex; flex-direction:column; gap:var(--space-100); min-width:0; padding:var(--space-150) var(--space-200); border:1px dashed var(--line-strong); border-radius:var(--radius-md); background:var(--surface); }
.sl-reply.is-held { border-style:solid; border-color:var(--saffron); }
.sl-head { display:flex; align-items:flex-start; gap:var(--space-100); min-width:0; }
.sl-head > div { min-width:0; }
.sl-clock { color:var(--spruce); font-size:var(--text-lg); line-height:1; }
.sl-head h3 { margin:0; color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); overflow-wrap:anywhere; }
.sl-when { margin:var(--space-25) 0 0; color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.sl-text { margin:0; color:var(--ink); font-size:var(--text-md); white-space:pre-wrap; overflow-wrap:anywhere; }
.sl-held, .sl-wait { margin:0; padding:var(--space-75) var(--space-100); border-radius:var(--radius-sm); background:var(--saffron-pale); color:var(--ink); font-size:var(--text-sm); overflow-wrap:anywhere; }
.sl-actions { display:flex; flex-wrap:wrap; gap:var(--space-100); }
.sl-edit { display:flex; flex-direction:column; gap:var(--space-100); }
.sl-field { display:flex; flex-direction:column; gap:var(--space-25); min-width:0; color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.sl-field textarea, .sl-field input { width:100%; min-width:0; padding:var(--space-75) var(--space-100); border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); font:inherit; font-weight:var(--weight-regular); }
.sl-field textarea { resize:vertical; }
.sl-times { display:flex; flex-wrap:wrap; gap:var(--space-100) var(--space-150); }
.sl-times .sl-field { flex:1 1 140px; }
.sl-picked { margin:0; color:var(--ink-2); font-size:var(--text-sm); overflow-wrap:anywhere; }
.sl-picked.is-problem { color:var(--warn-ink); font-weight:var(--weight-semibold); }
.sl-menu-part { margin-top:var(--space-75); padding-top:var(--space-75); border-top:1px solid var(--line); }
.sl-menu-head { margin:0; padding:var(--space-50) var(--space-150); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); text-transform:uppercase; letter-spacing:.04em; }
.sl-menu-note { margin:0; padding:var(--space-50) var(--space-150) var(--space-100); max-width:320px; color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.tw-post-menu .sl-menu-item { display:flex; flex-direction:column; gap:var(--space-25); }
.sl-menu-item small { color:var(--muted); font-size:var(--text-xs); overflow-wrap:anywhere; }
.sl-picker { display:flex; flex-direction:column; gap:var(--space-100); margin:var(--space-100) var(--space-150) var(--space-150); padding:var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface-2); }
.sl-picker[hidden] { display:none; }
.sl-picker h3 { margin:0; color:var(--ink); font-size:var(--text-md); }
.sl-picker-zone { margin:0; color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
