/* #693 Support calls (staff only), on the Finances page's base (finances.css): same palette, 44px targets, text at least
   14px. What's added: the summary cards' headings, the alert switch, the view chips, the call list, and the call's detail
   (a side panel on a computer, the whole screen on a phone) with its transcript. */

/* Several blocks here set their own display; hidden always wins. */
[hidden] { display: none !important; }

.sc-cards .card h2 { margin: 0; font-size: 14px; font-weight: 650; color: var(--muted); }
.sc-cards .card.attention { border-color: #f0c98a; background: linear-gradient(180deg, var(--warn-bg), #fff 70%); }
.sc-cards .card.attention .big { color: var(--warn); }

/* Shown at the top only while this staff member's phone alerts are off; the switch itself is at the bottom. */
.sc-prompt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 14px 0 4px; padding: 12px 14px 12px 16px;
  border-radius: 12px; background: #e6f2f8; border: 1px solid #a9d3e6; }
.sc-prompt p { margin: 0; flex: 1 1 320px; font-weight: 600; }

.sc-alerts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-top: 24px; }
.sc-alerts-main { flex: 1 1 420px; min-width: 0; }
.sc-alerts h2 { margin-bottom: 2px; }
.sc-alerts p { margin: 2px 0; }
.sc-switch { align-items: flex-start; font-size: 15px; font-weight: 600; }
.sc-switch span { padding-top: 11px; }
#push-note.warn { color: var(--warn); font-weight: 600; }

/* The four views wrap rather than scroll, so none is cut off on a phone. */
.sc-views { flex-wrap: wrap; overflow: visible; }
.sc-views button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; }
.sc-views button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sc-views button[aria-pressed="true"] .count { background: #fff; color: var(--ink); }
.count:empty { display: none; }

.sc-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.sc-list { min-width: 0; }
.sc-calls { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.sc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; min-height: 44px; padding: 12px 14px; text-align: left;
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.sc-row:hover { border-color: #a9d3e6; background: #fbfdfe; }
.sc-row[aria-current="true"] { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); background: #f2fafd; }
.sc-row .who { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.sc-row .when { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }
.sc-row .what { grid-column: 1 / -1; font-size: 14px; color: var(--ink); }
.sc-row .reason { grid-column: 1 / -1; font-size: 14px; color: var(--muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-row .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.sc-empty { padding: 18px 4px; }
.sc-more { margin-top: 12px; width: 100%; }

.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.plain { background: #eef1f3; color: #3f525c; }
.tag.live { background: #e6f2f8; color: #075e82; }

.sc-detail { margin: 0; position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow-y: auto; }
.sc-placeholder { margin: 0; display: grid; place-items: center; min-height: 240px; color: var(--muted); text-align: center; }
.sc-placeholder p { margin: 0; }
.sc-back { display: none; margin: -8px 0 4px -8px; }
.sc-detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-detail-head h2 { margin: 0; font-size: 22px; }
.sc-detail-head h2:focus { outline: none; }
.sc-detail-head p { margin: 2px 0 0; }
.sc-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sc-call-from-line { min-height: 44px; }
.sc-call-back { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand);
  color: var(--brand); font-weight: 650; text-decoration: none; background: #fff; }
/* With the line able to call back itself, dialling from this phone is the quiet second choice. */
.sc-call-from-line:not([hidden]) + .sc-call-back { border-color: var(--line); color: var(--muted); font-weight: 600; }

/* Calling someone from the line's number (2026-11-01): a number, one button, and what the call is doing right now. */
.sc-dial { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px 28px; margin: 18px 0; }
.sc-dial h2 { margin-bottom: 2px; }
.sc-dial-sub { margin: 16px 0 4px; font-size: 15px; font-weight: 650; }
.sc-dial-form label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
.sc-dial-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-dial-row input { flex: 1 1 200px; min-width: 0; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 17px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sc-dial-row button { min-height: 44px; }
.sc-dial-status { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; background: #e6f2f8; color: #075e82; }
.sc-dial-status.good { background: var(--good-bg); color: var(--good); }
.sc-dial-status.warn { background: var(--warn-bg); color: var(--warn); }
.sc-dial-status.bad { background: var(--bad-bg); color: var(--bad); }
.sc-dial-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sc-dial-recent li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sc-dial-recent .who { font-weight: 650; }
.sc-dial-recent .when { color: var(--muted); white-space: nowrap; }
.sc-dial-recent .what { grid-column: 1 / -1; color: var(--muted); }
.sc-dial-recent:empty + p { display: block; }
.sc-dial-recent:not(:empty) + p { display: none; }
@media (max-width: 899px) {
  .sc-dial { grid-template-columns: minmax(0, 1fr); }
}

.sc-follow { margin: 16px 0 4px; padding: 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid #f0c98a; display: grid; gap: 10px; }
.sc-follow.done { background: var(--good-bg); border-color: #b5dcc4; }
.sc-message { display: grid; gap: 2px; }
.sc-message h3 { margin: 0; font-size: 14px; color: var(--muted); }
.sc-message p { margin: 0; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.sc-follow-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sc-follow-actions p { margin: 0; }

.sc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin: 16px 0 6px; }
.sc-facts div { display: grid; gap: 2px; align-content: start; }
.sc-facts .wide { grid-column: 1 / -1; }
.sc-facts dt { font-size: 14px; color: var(--muted); font-weight: 650; }
.sc-facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

.sc-transcript-title { font-size: 16px; margin: 18px 0 8px; }

/* #476 The call's recording: a play button, then the browser's own player, as wide as the panel allows. */
.sc-recording-body { display: grid; gap: 8px; justify-items: start; }
.sc-recording-note { margin: 0; }
.sc-play { min-height: 44px; }
.sc-audio { display: block; width: 100%; max-width: 560px; height: 44px; }
.sc-transcript { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sc-turn { display: grid; gap: 2px; max-width: 88%; }
.sc-turn .meta { font-size: 14px; color: var(--muted); }
.sc-turn .text { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }
.sc-turn.line .text { background: #eef3f6; border-top-left-radius: 4px; }
.sc-turn.caller { justify-self: end; text-align: left; }
.sc-turn.caller .meta { text-align: right; }
.sc-turn.caller .text { background: #e2f1f8; border: 1px solid #c3e2f0; border-top-right-radius: 4px; }

@media (max-width: 899px) {
  .sc-layout { grid-template-columns: minmax(0, 1fr); }
  .sc-placeholder { display: none; }
  /* A phone shows the list or one call, never both, and a call on its own. */
  .sc-layout.showing-call .sc-list, body.showing-call .sc-cards, body.showing-call .sc-prompt, body.showing-call .sc-alerts { display: none; }
  .sc-detail { position: static; max-height: none; overflow: visible; }
  .sc-back { display: inline-flex; }
}
@media (max-width: 640px) {
  .sc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sc-cards .card { padding: 14px; }
  .sc-cards .card .big { font-size: 26px; }
  .sc-cards .card .sub { font-size: 14px; }
  #push-test { width: 100%; }
  .sc-turn { max-width: 100%; }
  .sc-call-back { width: 100%; justify-content: center; }
  .sc-play { width: 100%; }
  .sc-recording-body { justify-items: stretch; }
}

/* Checklist #14: problems customers sent from the chat, open ones first, until someone marks them handled. */
.sc-chat { margin: 18px 0; }
.sc-chat.attention { border-color: #f0c98a; }
.sc-chat h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.sc-chat > p { margin: 0 0 10px; }
.sc-chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sc-chat-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.sc-chat-item.done { background: #fafbfc; }
.sc-chat-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.sc-chat-head .who { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.sc-chat-head .when { color: var(--muted); font-size: 14px; }
.sc-chat-item .reason { margin: 6px 0 8px; overflow-wrap: anywhere; }
.sc-chat-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.sc-chat-foot button { min-height: 44px; }
/* #697 Sent to agents, with a link to its common problem. */
.sc-routed { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sc-routed a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
/* The way to Common problems, under the intro: a whole 44px target. */
.sc-elsewhere { margin: 4px 0 0; }
.sc-elsewhere a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--brand); }
