/* messaging screens (claude.ai/design). Uses tokens.css and the shared classes in app.css. */

/* ---------- Inbox: conversation list beside the chat, each pane scrolls on its own ---------- */
.main:has(> .page.inbox-page) { display: flex; flex-direction: column; }
.page.inbox-page { flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.inbox-page > .flash { margin: var(--space-sm) var(--space-md) 0; }
.inbox { flex: 1; min-height: 0; display: flex; }
.ib-list { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; border-right: var(--rule); background: var(--color-surface); }
.ib-head { padding: 14px var(--space-md) 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: var(--rule); }
.ib-title { display: flex; align-items: center; gap: var(--space-xs); }
.ib-title :is(h1, h2) { margin: 0; font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; }
.ib-title .sub { flex: 1; }
.ib-head .pills { align-items: center; }
.ib-head .pills a { gap: 4px; }
.ib-sep { width: 1px; height: 16px; background: var(--color-rule); margin: 0 2px; }
.ib-head .search-box { max-width: none; flex: none; }
.ib-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.ib-scroll .pager { padding: var(--space-sm) var(--space-md); flex-wrap: wrap; }
.ib-row { display: flex; gap: 10px; padding: 12px var(--space-md); border-bottom: var(--rule); color: var(--color-ink); text-decoration: none; transition: background-color var(--dur-short) var(--ease-out); }
.ib-row:hover { background: var(--color-paper-2); color: var(--color-ink); }
.ib-row[aria-current] { background: var(--color-accent-soft); }
.ib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-top { display: flex; gap: var(--space-xs); align-items: baseline; }
.ib-top b { flex: 1; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-top time { font-size: var(--text-xs); color: var(--color-ink-3); }
.ib-row.waiting .ib-top b { font-weight: 600; }
.ib-row.waiting .ib-top time { color: var(--color-accent-text); font-weight: 600; }
.ib-last { font-size: var(--text-sm); color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-win { display: flex; gap: 6px; align-items: center; font-size: var(--text-xs); color: var(--color-ink-3); }
.ib-win.open { color: var(--color-ok); }
.ib-win.stopped { color: var(--color-warn); }

.ib-chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--color-paper); }
.ib-none { justify-content: center; }
.ib-chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px var(--space-md); background: var(--color-surface); border-bottom: var(--rule); }
.ib-chat-head .grow { flex: 1; min-width: 0; }
.ib-chat-head h1 { margin: 0; font-size: var(--text-base); line-height: 1.25rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-chat-head h1 a { color: var(--color-ink); }
.ib-chat-head .sub { font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-chat-head form { margin: 0; }
.ib-chat-head .ib-back { display: none; width: 44px; min-height: 44px; margin-left: -10px; place-items: center; border-radius: var(--radius); color: var(--color-ink); }
.ib-chat-head .ib-back:hover { background: var(--color-paper-3); }
/* column-reverse keeps the newest message in view without a script. */
.ib-thread-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column-reverse; }
.ib-thread { list-style: none; margin: 0; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); }
.ib-day { align-self: center; font-size: var(--text-xs); color: var(--color-ink-3); }
.ib-sys { align-self: center; font-size: var(--text-xs); color: var(--color-warn); background: var(--color-warn-soft); padding: 4px 10px; border-radius: var(--radius-pill); text-align: center; }
.bub { max-width: min(78%, 36rem); padding: var(--space-xs) var(--space-sm); overflow-wrap: anywhere; }
.bub.in { align-self: flex-start; background: var(--color-surface); border: var(--rule); border-radius: 12px 12px 12px 4px; }
.bub.out { align-self: flex-end; background: var(--color-accent-soft); border-radius: 12px 12px 4px 12px; }
.bub-meta { display: block; font-size: 11px; color: var(--color-ink-3); margin-bottom: 2px; }
.bub-subject { display: flex; gap: var(--space-2xs); align-items: center; font-weight: 600; margin-bottom: 2px; }
.bub-body { white-space: pre-wrap; }
.bub-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; color: var(--color-ink-3); margin-top: 2px; }
.bub.out .bub-foot { justify-content: flex-end; }
.bub-st { display: inline-flex; gap: 3px; align-items: center; color: inherit; text-decoration: none; }
.bub-st:hover { color: var(--color-ink); text-decoration: underline; }
.bub-st.s-read { color: var(--color-accent-text); }
.bub-st.s-failed { color: var(--color-bad); }
.bub-st.s-blocked { color: var(--color-warn); }
.bub-err { display: block; font-size: var(--text-xs); color: var(--color-bad); margin-top: 2px; }
/* WhatsApp extras: media, files, the message replied to, and the reaction menu. */
.bub-media { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 2px 0 4px; }
.bub audio { display: block; max-width: 100%; margin: 2px 0 4px; }
.bub-file { display: inline-flex; gap: 4px; align-items: center; font-size: var(--text-sm); margin: 2px 0 4px; }
.bub-quote { display: block; font-size: var(--text-xs); color: var(--color-ink-3); border-left: 2px solid var(--color-line, currentColor); padding-left: 6px; margin-bottom: 4px; }
.bub-react { display: inline-block; margin-top: 2px; }
.bub-react > summary { list-style: none; cursor: pointer; color: var(--color-ink-3); display: inline-flex; }
.bub-react > summary::-webkit-details-marker { display: none; }
.bub-react form { display: inline-flex; gap: 2px; margin-left: 4px; }
.bub-react button { font-size: 18px; line-height: 1; padding: 2px; }
.ib-more { margin-top: var(--space-xs); }
.ib-interactive[open] { flex-basis: 100%; }

.ib-compose { flex: none; background: var(--color-surface); border-top: var(--rule); padding: 12px var(--space-md); display: flex; flex-direction: column; gap: 10px; }
.ib-note { display: flex; align-items: flex-start; gap: var(--space-xs); margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.ib-note .icon { margin-top: 2px; }
.ib-note.ok { font-size: var(--text-xs); color: var(--color-ok); }
.ib-note.ok .icon { margin-top: 3px; }
.ib-note.warn { color: var(--color-warn); background: var(--color-warn-soft); padding: var(--space-xs) 10px; border-radius: var(--radius); }
.ib-compose .pills a { gap: 6px; }
.ib-send { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: flex-end; margin: 0; }
.ib-send textarea { flex: 1 1 14rem; min-width: 0; min-height: 0; }
.ib-send select { flex: 1 1 12.5rem; width: auto; }
.ib-email { margin: 0; }
.ib-email label { margin-bottom: var(--space-sm); }
.ib-email textarea { min-height: 5rem; }

@media (max-width: 56rem) {
  .ib-list { width: 100%; border-right: 0; }
  .inbox:not(.has-chat) .ib-chat, .inbox.has-chat .ib-list { display: none; }
  .ib-chat-head .ib-back { display: grid; }
  .ib-row { min-height: 56px; }
  .bub { max-width: 88%; }
}

/* ---------- Messages log ---------- */
.msg-filter { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin-bottom: var(--space-md); }
.msg-filter select { width: auto; }
.msg-filter .search-box { max-width: 21rem; }
.rows > .msg-all { min-height: 0; padding-block: 6px; background: var(--color-paper-2); }
.msg-all label.check { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.rows .pick { width: 1rem; margin: 0; flex: none; }
.msg-status { width: 110px; flex: none; }
.msg-chan { display: flex; color: var(--color-ink-3); }
.msg-what { color: var(--color-ink); text-decoration: none; }
.msg-what:hover { color: var(--color-ink); }
.msg-what:hover .msg-name { text-decoration: underline; }
.msg-name { font-weight: 500; }
.msg-tpl { color: var(--color-ink-3); }
.msg-why { display: block; font-size: var(--text-xs); }
.msg-why.bad { color: var(--color-bad); }
.msg-why.warn { color: var(--color-warn); }
.msg-src { width: 150px; font-size: var(--text-xs); color: var(--color-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { width: 48px; font-size: var(--text-xs); color: var(--color-ink-3); text-align: right; }
.msg-act { width: 96px; display: flex; gap: 6px; justify-content: flex-end; }
.msg-act button { gap: 6px; }
.msg-act .cancel { color: var(--color-bad); }
@media (max-width: 56rem) {
  .msg-status { width: auto; }
  .msg-what { flex-basis: 100%; order: 5; }
  .msg-src { width: auto; flex: 1; }
  .msg-act { width: auto; order: 6; }
  .msg-act:empty { display: none; }
}

/* Message detail */
.msg-h1 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.page-head form { margin: 0; }
.msg-notice { align-items: flex-start; }
.msg-notice .icon { margin-top: 2px; }
.msg-notice p { margin: 2px 0 0; font-size: var(--text-sm); color: var(--color-ink); }
.msg-notice p.mono { color: var(--color-ink-2); overflow-wrap: anywhere; }
.facts { grid-template-columns: 8rem minmax(0, 1fr); gap: var(--space-xs) var(--space-sm); margin: 0; }
.facts dt { color: var(--color-ink-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hist li { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--text-sm); }
.hist li::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--color-ink-3); }
.hist li.ok::before { background: var(--color-ok); }
.hist li.info::before { background: var(--color-info); }
.hist li.warn::before { background: var(--color-warn); }
.hist li.bad::before { background: var(--color-bad); }
.hist .grow { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.hist time { color: var(--color-ink-3); }
.bubble-sent { max-width: 26rem; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--color-accent-soft); border-radius: 12px 12px 4px 12px; }
.bubble-sent.in { background: var(--color-paper-2); border-radius: 12px 12px 12px 4px; }

/* ---------- Tickets ---------- */
.tk-id { width: 48px; color: var(--color-ink-3); }
.tk-what { color: var(--color-ink); text-decoration: none; }
.tk-what b { font-weight: 500; }
.tk-what:hover { color: var(--color-ink); }
.tk-what:hover b { text-decoration: underline; }
.tk-pri { width: 90px; display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-ink-2); }
.tk-pri.bad { color: var(--color-bad); }
.tk-who { width: 140px; font-size: var(--text-sm); color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-who.warn, .tk-fact .warn { color: var(--color-warn); }
.tk-age { width: 48px; text-align: right; font-size: var(--text-xs); color: var(--color-ink-3); }
@media (max-width: 56rem) {
  .tk-what { flex-basis: calc(100% - 90px); order: 3; }
  .tk-pri, .tk-who { width: auto; }
  .tk-age { margin-left: auto; }
}
.tk-note { display: flex; flex-direction: column; gap: 10px; }
.tk-note label { margin: 0; }
.tk-note label b { font-weight: 600; font-size: var(--text-base); }
.tk-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tk-notes > .panel { margin: 0; padding: 12px var(--space-md); }
.tk-note-head { display: flex; flex-wrap: wrap; gap: var(--space-xs); font-size: var(--text-sm); margin-bottom: 4px; }
.tk-note-head b { font-weight: 600; }
.tk-note-head time, .tk-event time { color: var(--color-ink-3); }
.tk-body { overflow-wrap: anywhere; }
.tk-event { display: flex; flex-wrap: wrap; gap: 4px var(--space-xs); align-items: center; padding: 0 var(--space-md); font-size: var(--text-xs); color: var(--color-ink-2); }
.tk-event b { font-weight: 500; }
.tk-side { display: flex; flex-direction: column; gap: var(--space-sm); }
.tk-side label { margin: 0; font-size: var(--text-sm); color: var(--color-ink); }
.tk-fact, .tk-contact { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); }
.tk-fact > span, .tk-contact > span { font-weight: 500; }
.tk-fact b { font-weight: 400; }
.tk-contact { padding-top: 10px; border-top: var(--rule); }
.tk-contact .small { display: inline-flex; gap: 6px; align-items: center; }
.tk-person { display: flex; gap: 10px; align-items: center; }
.tk-person > div { min-width: 0; }
.tk-person a { font-weight: 500; }

/* Ticket notes: edit and delete sit at the end of the note's header. */
.tk-note-act { margin-left: auto; display: inline-flex; gap: var(--space-sm); align-items: baseline; }
.tk-note-act form { display: inline; margin: 0; }
.tk-contact label { margin: 6px 0 0; }

/* Ticket settings: statuses and priorities, one row each. */
.tk-opts .r { gap: var(--space-sm); }
.tk-opts .move { display: flex; gap: 2px; }
.tk-opts .move form { display: flex; }
.tk-opts .move .icon-btn { width: 24px; min-height: 24px; }
.tk-opts .move .icon-btn:disabled { opacity: .35; background: transparent; cursor: default; }
.tk-opts form.tk-opt-edit { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; flex: 1; min-width: 0; margin: 0; }
.tk-opts form.tk-opt-edit input[type=text] { flex: 1 1 10rem; min-width: 0; }
.tk-opts .tk-opt-n { font-size: var(--text-sm); color: var(--color-ink-3); white-space: nowrap; }
.tk-opts details.menu { flex: none; }
.tk-opt-remove { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 16rem; }
.tk-opt-remove label { margin: 0; font-size: var(--text-sm); }

/* ---------- Inbox: matches the "AppInbox" board ---------- */
.inbox-page .ib-list { width: 330px; max-width: 40%; }
.inbox-page .ib-head { padding: 18px var(--space-md) 12px; gap: 12px; border-bottom-color: var(--color-paper-2); }
.inbox-page .ib-title :is(h1, h2) { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: var(--tracking-display); }
.inbox-page .ib-new { width: 36px; min-height: 36px; padding: 0; justify-content: center; border-radius: 9px; }
.inbox-page .ib-head .pills { gap: 6px; }
.inbox-page .ib-head .pills a { padding: 0 12px; font-size: var(--text-sm); }
.inbox-page .ib-row { gap: 12px; padding: 14px var(--space-md); border-bottom-color: var(--color-paper-2); }
.inbox-page .ib-row[aria-current] { background: var(--color-accent-soft); box-shadow: inset 3px 0 0 var(--color-accent); }
.inbox-page .ib-row .round { width: 40px; height: 40px; font-size: var(--text-sm); }
.inbox-page .ib-main { gap: 3px; }
.inbox-page .ib-top b { font-weight: 600; }
.inbox-page .ib-top time { flex: none; }
.ib-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.inbox-page .ib-win { display: inline-flex; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink-2); }
.inbox-page .ib-win.ch-whatsapp { background: var(--color-ok-soft); color: var(--color-ok); }
.inbox-page .ib-win.ch-whatsapp.stopped { background: var(--color-warn-soft); color: var(--color-warn); }
.inbox-page .ib-win.ch-email { background: var(--color-info-soft); color: var(--color-info); }
.ib-needs { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--color-warn-soft); color: var(--color-warn); }
.inbox-page .ib-chat-head { gap: 12px; padding: 14px 20px; }
.inbox-page .ib-chat-head .round { width: 40px; height: 40px; font-size: var(--text-sm); }
.inbox-page .ib-chat-head h1 { font-size: var(--text-md); line-height: 1.5rem; font-weight: 700; font-family: var(--font-body); letter-spacing: 0; }
.inbox-page .ib-chat-head .sub { font-size: var(--text-sm); color: var(--color-ink-3); }
.inbox-page .ib-chat-head button { min-height: 36px; padding: 0 12px; border-radius: 9px; }
.inbox-page .ib-chat-head button .icon { color: var(--color-ok); }
.inbox-page .ib-thread { padding: 24px 24px 12px; gap: 12px; }
.inbox-page .ib-day { font-size: var(--text-xs); color: var(--color-ink-3); padding: 4px 10px; border-radius: var(--radius-pill); background: var(--color-paper-2); }
.inbox-page .bub { max-width: min(70%, 36rem); padding: 11px 14px; font-size: 0.9375rem; line-height: 1.45; }
.inbox-page .bub.in { border-radius: 16px 16px 16px 4px; }
.inbox-page .bub.out { background: var(--color-accent); color: var(--color-accent-ink); border-radius: 16px 16px 4px 16px; }
.inbox-page .bub.out :is(.bub-meta, .bub-foot, .bub-st, .bub-quote, .bub-file, .bub-react > summary) { color: inherit; opacity: .85; }
.inbox-page .bub.out a { color: inherit; }
.inbox-page .bub.out .bub-st { background: transparent; padding: 0; }
.inbox-page .bub.out .bub-err { color: inherit; font-weight: 600; }
.inbox-page .bub-foot, .inbox-page .bub-meta { font-size: var(--text-xs); }
/* The reply box is a card floating at the foot of the thread. */
.inbox-page .ib-compose { margin: 0 20px 20px; padding: 10px; gap: 8px; border: 1px solid var(--color-rule-strong); border-radius: var(--radius-lg); box-shadow: 0 4px 14px -10px var(--color-shadow-pop); }
.inbox-page .ib-compose .pills { gap: 4px; }
.inbox-page .ib-compose .pills a { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--color-ink-3); }
.inbox-page .ib-compose .pills a:hover { background: var(--color-paper-2); color: var(--color-ink); }
.inbox-page .ib-compose .pills a[aria-current] { background: var(--color-accent-soft); color: var(--color-accent-text); }
.inbox-page .ib-send { padding-top: 8px; border-top: 1px solid var(--color-paper-2); }
.inbox-page .ib-send textarea { border: 0; box-shadow: none; padding: 6px 4px; font-size: 0.9375rem; resize: none; background: transparent; }
.inbox-page .ib-send textarea:focus-visible { outline: 0; }
.inbox-page .ib-compose:focus-within { border-color: var(--color-accent); }
.inbox-page .ib-send button { min-height: 38px; padding: 0 18px; font-weight: 700; }
/* Supporter summary beside the thread. */
.ib-about { width: 300px; flex: none; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; background: var(--color-surface); border-left: var(--rule); }
.ib-about-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.ib-about-top .round.big { width: 64px; height: 64px; font-size: 1.25rem; }
.ib-about-top b { font-size: 1.0625rem; overflow-wrap: anywhere; }
.ib-about-top a { font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.ib-stage { font-size: var(--text-xs); font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--color-warn-soft); color: var(--color-warn); }
.ib-facts, .ib-about-tags { display: flex; flex-direction: column; gap: 10px; font-size: var(--text-sm); }
.ib-facts > b, .ib-about-tags > b { font-size: var(--text-base); }
.ib-facts dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.ib-facts dt { color: var(--color-ink-3); }
.ib-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.ib-about-tags > div { display: flex; flex-wrap: wrap; gap: 6px; }
.ib-about-tags .tag { margin: 0; padding: 4px 10px; border-radius: var(--radius-pill); }
@media (max-width: 75rem) { .ib-about { display: none; } }

/* ---------- Inbox on narrow screens: the list or the open conversation, full width; a back link from the chat to the list.
   (The design-parity rule above gives the list 330px / 40%, so it has to be undone here.) ---------- */
@media (max-width: 56rem) {
  .inbox-page .ib-list { width: 100%; max-width: none; }
  .inbox-page .ib-chat-head { padding: 10px var(--space-md) 10px var(--space-sm); gap: var(--space-xs); }
  .inbox-page .ib-chat-head .ib-back { margin-left: 0; }
  .inbox-page .ib-chat-head .round { display: none; }
  .inbox-page .ib-thread { padding: var(--space-md) var(--space-md) var(--space-sm); }
  .inbox-page .bub { max-width: 88%; }
  .inbox-page .ib-compose { margin: 0 var(--space-sm) var(--space-sm); }
  .ib-collapse { display: none; }
}
.ib-row:hover { text-decoration: none; }
/* Wide screens: the button in the chat header hides and shows the list (client/app.ts, data-inbox-toggle). */
.inbox-page .ib-chat-head .ib-collapse { flex: none; width: 36px; min-height: 36px; padding: 0; margin-left: -6px; color: var(--color-ink-2); }
.inbox-page .ib-chat-head .ib-collapse:hover { color: var(--color-ink); }
.inbox-page .ib-chat-head .ib-collapse .icon { color: inherit; }
.ib-collapse .ib-c-closed, .inbox.list-hidden .ib-collapse .ib-c-open { display: none; }
.inbox.list-hidden .ib-collapse .ib-c-closed { display: inline-flex; }
@media (min-width: 56.0625rem) { .inbox.list-hidden .ib-list { display: none; } }

/* Who looks after a conversation: a compact select in the chat header. */
.ib-assign { margin: 0; }
.ib-assign select { width: auto; max-width: 11rem; min-height: 36px; }
@media (max-width: 520px) { .ib-assign select { max-width: 7.5rem; } }
.ib-about .ib-assign select { max-width: none; width: 100%; }
/* With the side panel showing, the picker lives there; the header keeps room for the name. */
@media (min-width: 75.0625rem) { .ib-assign-head { display: none; } }

/* New message pop-up: search as you type, then the chosen person's channels as cards. */
.nm .search-box { max-width: none; }
.nm-search .hint { margin: var(--space-xs) 0 0; }
.nm-list { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; gap: 2px; }
.nm-person { display: flex; justify-content: flex-start; align-items: center; gap: var(--space-sm); width: 100%; min-height: 56px; padding: var(--space-xs) var(--space-sm); border: 0; border-radius: var(--radius); background: transparent; color: var(--color-ink); font: inherit; text-align: left; }
button.nm-person { cursor: pointer; transition: background var(--dur-short) var(--ease-out); }
/* A person row is a list row, not a button: none of the blue button hover (white text, glow, press). */
button.nm-person:hover, button.nm-person:focus-visible, button.nm-person:active { background: var(--color-paper-2); color: var(--color-ink); box-shadow: none !important; transform: none; }
button.nm-person:hover > .icon:last-child { color: var(--color-accent); }
.nm-person .round { flex: none; }
.nm-person .grow { flex: 1; min-width: 0; }
.nm-person > .icon:last-child { color: var(--color-ink-3); flex: none; }
.nm-person .cell-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-count { flex: none; font-size: var(--text-xs); color: var(--color-ink-3); }
.nm-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: var(--space-xs); margin: var(--space-xs) 0 var(--space-sm); }
.nm-ch { display: flex; align-items: center; gap: var(--space-sm); min-height: 56px; padding: var(--space-xs) var(--space-sm); border: var(--rule); border-radius: var(--radius); background: var(--color-surface); color: var(--color-ink); text-decoration: none; transition: border-color var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
.nm-ch:hover { border-color: var(--color-accent); transform: translateY(-1px); }
.nm-ch > .icon { color: var(--color-accent); flex: none; }
.nm-ch b { display: block; font-weight: 600; }
.nm-ch small { display: block; font-size: var(--text-xs); color: var(--color-ink-3); }
.nm-ch.is-off { background: var(--color-paper-2); border-style: dashed; cursor: not-allowed; }
.nm-ch.is-off > .icon, .nm-ch.is-off b { color: var(--color-ink-3); }
.nm-ch.is-off:hover { transform: none; border-color: var(--color-rule); }
.nm-profile { grid-column: 1 / -1; }
.nm-back { display: inline-flex; align-items: center; gap: var(--space-3xs); margin-bottom: var(--space-xs); }
/* Once someone is chosen, only they and their channels show. */
.nm.is-picked .nm-match:not(.is-picked) { display: none; }
.nm.is-picked .nm-person { min-height: 0; padding-inline: 0; pointer-events: none; }
.nm.is-picked .nm-person > .icon:last-child, .nm.is-picked .nm-count, .nm.is-picked [role="status"] { display: none; }
@media (prefers-reduced-motion: reduce) { .nm-ch, button.nm-person { transition: none; } .nm-ch:hover { transform: none; } }
.nm-person { white-space: normal; }
.nm-person .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-ch, .nm-ch:hover, .nm-ch:focus, .nm-ch:focus-visible { text-decoration: none; color: var(--color-ink); }
.nm-ch:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
/* Phones: the pop-up fills the screen; a row keeps its name and arrow, and the channel count moves under the details. */
@media (max-width: 40rem) {
  .nm-person { padding-inline: var(--space-2xs); gap: var(--space-xs); }
  .nm-person .grow { display: grid; }
  .nm-count { display: none; }
  .nm-channels { grid-template-columns: minmax(0, 1fr); }
  .nm .search-box input { font-size: 16px; } /* no zoom-in on focus in iOS Safari */
}
