/* The Calls tab (calls.js), on the page's own tokens (app.css). */

/* Its sections: a row of buttons under the title, the open one underlined like the page's tabs. */
.wc-subnav { display: flex; gap: 4px; margin: -8px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.wc-subnav::-webkit-scrollbar { display: none; }
.wc-subnav button { flex: none; height: 40px; padding: 0 12px; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; }
.wc-subnav button:hover { color: var(--ink); }
.wc-subnav button[aria-current="page"] { color: var(--ink); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.wc-view { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* Not set up yet: calm, no colour of alarm. */
.wc-calm { align-items: flex-start; gap: 8px; padding: 28px; }
.wc-calm p { max-width: 560px; }
.wc-calm-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 12px; background: var(--subtle); color: var(--ink-2); }

/* The console (console.js draws it in its own shadow root, on these colours). */
.wc-console { --wcc-accent: var(--accent); --wcc-on-accent: var(--on-accent); --wcc-ink: var(--ink); --wcc-ink-2: var(--ink-2); --wcc-muted: var(--muted); --wcc-line: var(--line); --wcc-subtle: var(--subtle); --wcc-surface: var(--surface); --wcc-ok: var(--ok); --wcc-ok-bg: var(--ok-bg); --wcc-bad: var(--bad); --wcc-bad-bg: var(--bad-bg); }
.wc-you .card-head { align-items: baseline; }
.wc-hint { margin-top: 12px; }
/* Nobody can answer: the two ways to take calls (no gap while it is empty). */
.wc-nobody:empty { display: none; }
.wc-ways { padding-left: 20px; }
.wc-ways li + li { margin-top: 4px; }

/* Recent: filters in a row, the table (cards on a phone). */
.wc-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 640px) { .wc-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .wc-search { grid-column: 1 / -1; } }
.wc-table { min-width: 980px; }
.wc-table td { vertical-align: top; }
.wc-table .wc-caller { min-width: 190px; }
.wc-table .wc-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-table td.text { max-width: 220px; }
.wc-table .text a { text-decoration: none; }
.wc-table .wc-comment { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-actions-cell .row { flex-wrap: nowrap; }
@media (max-width: 760px) {
  .table-box:has(.wc-table) { overflow: visible; margin: 0; padding: 0; }
  .wc-table { min-width: 0; }
  .wc-table thead { display: none; }
  .wc-table, .wc-table tbody, .wc-table tr, .wc-table td { display: block; width: 100%; }
  .wc-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--subtle); }
  .wc-table tr:first-child { border-top: 0; padding-top: 0; }
  .wc-table td { padding: 0; border: 0; }
  .wc-table td[data-label="Caller"] { grid-column: 1; grid-row: 1 / span 2; }
  .wc-table td[data-label="Time"] { grid-column: 2; grid-row: 1; text-align: right; }
  .wc-table td[data-label="Outcome"] { grid-column: 2; grid-row: 2; text-align: right; }
  .wc-table td[data-label="Page"], .wc-table td[data-label="Answered by"], .wc-table td[data-label="Wait"], .wc-table td[data-label="Talk"], .wc-table td[data-label="Feedback"], .wc-table td[data-label="Recording"] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; line-height: 20px; color: var(--ink-2); max-width: none; }
  .wc-table td[data-label="Page"]::before, .wc-table td[data-label="Answered by"]::before, .wc-table td[data-label="Wait"]::before, .wc-table td[data-label="Talk"]::before, .wc-table td[data-label="Feedback"]::before, .wc-table td[data-label="Recording"]::before { content: attr(data-label); min-width: 96px; color: var(--muted); font-family: var(--sans); }
  .wc-table .wc-comment { max-width: 100%; white-space: normal; }
  .wc-table td[data-label="Page"] a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wc-table td.wc-actions-cell { grid-column: 1 / -1; padding-top: 4px; }
  .wc-table td.wc-actions-cell .row { justify-content: flex-start; }
}

/* Callbacks. */
.wc-cb .side { gap: 8px; }
@media (max-width: 640px) {
  .wc-cb { flex-direction: column; align-items: stretch; gap: 8px; }
  .wc-cb .side { align-items: flex-start; text-align: left; }
  .wc-cb .side .row { justify-content: flex-start; }
}

/* Call flow. */
.wc-range { display: flex; align-items: center; gap: 12px; }
.wc-range input[type=range] { flex: 1 1 auto; height: var(--control-h); padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--accent); }
.wc-range output { min-width: 96px; text-align: right; color: var(--ink-2); }
.wc-fieldset { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.wc-fieldset legend { padding: 0; margin-bottom: 4px; font-size: 13px; line-height: 20px; font-weight: 500; }
.wc-choose { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0 26px; }
.wc-hours { gap: 8px; }
.wc-day { display: grid; grid-template-columns: 140px 120px auto 120px auto; align-items: center; gap: 8px 12px; }
.wc-day .field-error { grid-column: 1 / -1; }
.wc-day input[type=time] { font-family: var(--mono); }
@media (max-width: 640px) { .wc-day { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr); } .wc-day > .check { grid-column: 1 / -1; } }

/* Widget. */
.wc-color { flex-wrap: nowrap; }
.wc-color input[type=color] { width: 56px; flex: none; padding: 4px; cursor: pointer; }
.wc-color .mono-input { max-width: 140px; }
.wc-preview { position: relative; height: 132px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); overflow: hidden; }
.wc-fake-site { position: absolute; inset: 16px 16px auto; display: flex; flex-direction: column; gap: 8px; }
.wc-fake-line { height: 10px; width: 70%; border-radius: 6px; background: var(--subtle); }
.wc-fake-line.short { width: 45%; }
.wc-fake-btn { position: absolute; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.wc-fake-btn.right { right: 16px; }
.wc-fake-btn.left { left: 16px; }
.wc-fake-btn svg { width: 18px; height: 18px; }
.wc-texts summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; cursor: pointer; }
.wc-texts[open] summary { margin-bottom: 4px; }
.wc-code { min-height: 84px; font-size: 13px; line-height: 20px; word-break: break-all; }
.wc-linkrow { flex-wrap: nowrap; }
.wc-linkrow input { flex: 1 1 auto; min-width: 0; }

/* A call ringing while another section is open. */
.wc-ring-banner { position: fixed; left: 50%; top: 72px; z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; border: 1px solid var(--ok); border-radius: 14px; background: var(--ok-bg); color: var(--ink); box-shadow: var(--shadow-pop); }
.wc-ring-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--ok); flex: none; animation: wc-blink 1s ease-in-out infinite; }
@keyframes wc-blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .wc-ring-dot { animation: none; } }

/*
 * Call stats. The data colours are their own (validated for colour vision on this page's surfaces, light
 * and dark): never the accent, which a partner's brand replaces. Text stays in the ink tokens.
 */
.wc-stats-root, .wc-view { --wc-viz-1: #2a78d6; --wc-viz-2: #eb6834; --wc-viz-3: #1baf7a; }
@media (prefers-color-scheme: dark) { .wc-stats-root, .wc-view { --wc-viz-1: #3987e5; --wc-viz-2: #d95926; --wc-viz-3: #199e70; } }
/* A words line under a figure in a table's number column. */
.table .num .wc-sub { font-family: var(--sans); white-space: normal; }
/* By person on a phone: one block per person, each figure on a labelled line. */
@media (max-width: 640px) {
  .table-box:has(.wc-people-table) { overflow: visible; margin: 0; padding: 0; }
  .wc-people-table thead { display: none; }
  .wc-people-table, .wc-people-table tbody, .wc-people-table tr, .wc-people-table td { display: block; width: 100%; }
  .wc-people-table tr { padding: 12px 0; border-top: 1px solid var(--subtle); }
  .wc-people-table tr:first-child { border-top: 0; padding-top: 0; }
  .wc-people-table td { padding: 2px 0; border: 0; text-align: left; }
  .wc-people-table td.num { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: 13px; line-height: 20px; color: var(--ink-2); white-space: normal; }
  .wc-people-table td.num::before { content: attr(data-label); min-width: 112px; color: var(--muted); font-family: var(--sans); }
  .wc-people-table td.num .wc-sub { flex-basis: auto; }
}
.wc-s1 { background: var(--wc-viz-1); }
.wc-s2 { background: var(--wc-viz-2); }
.wc-s3 { background: var(--wc-viz-3); }
.wc-stats-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.wc-stats-bar .field { min-width: 160px; }
.wc-custom { display: flex; flex-wrap: wrap; gap: 12px; }
.wc-stats-actions { display: flex; gap: 8px; margin-left: auto; }
.wc-stats { display: flex; flex-direction: column; gap: 16px; min-width: 0; transition: opacity .15s; }
.wc-stats.wc-refreshing { opacity: .55; }
.wc-zone { margin: 0; }
.wc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wc-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.wc-tile-label { font-size: 13px; line-height: 20px; color: var(--muted); }
.wc-tile-value { font-size: 28px; line-height: 36px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.wc-tile-sub { font-size: 13px; line-height: 20px; color: var(--ink-2); }
.wc-delta { font-size: 12px; line-height: 18px; color: var(--muted); }
.wc-delta.up-good { color: var(--ok); }
.wc-delta.up-bad { color: var(--bad); }
@media (max-width: 900px) { .wc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .wc-stats-actions { margin-left: 0; width: 100%; }
  .wc-stats-actions .btn { flex: 1 1 0; }
  .wc-tile { padding: 12px; }
  .wc-tile-value { font-size: 22px; line-height: 30px; }
}

/* The chart: columns of 24 px at most, a 2 px gap between stacked parts, rounded at the top only, one axis. */
.wc-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 13px; line-height: 20px; color: var(--ink-2); }
.wc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.wc-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.wc-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.wc-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font: 12px/1 var(--mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.wc-yaxis span { transform: translateY(-50%); }
.wc-yaxis span:first-child { transform: none; }
.wc-yaxis span:last-child { transform: translateY(0); }
.wc-plot-wrap { min-width: 0; }
.wc-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 200px; border-bottom: 1px solid var(--border-strong); }
.wc-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.wc-grid span { border-top: 1px solid var(--line); }
.wc-grid span:last-child { border-top: 0; }
.wc-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; border-radius: 4px; outline: none; cursor: default; }
.wc-col:hover, .wc-col:focus-visible { background: var(--subtle); }
.wc-col:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.wc-seg { width: min(24px, 100%); flex: none; }
.wc-col .wc-seg:last-child { border-radius: 4px 4px 0 0; }
.wc-xaxis { display: flex; gap: 2px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--muted); }
.wc-xaxis span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; overflow: visible; }
.wc-tip { position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 5; min-width: 180px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop); font-size: 13px; line-height: 20px; color: var(--ink-2); pointer-events: none; }
.wc-tip[hidden] { display: none; }
.wc-tip-title { color: var(--muted); font-size: 12px; }
.wc-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.wc-tip-row b { color: var(--ink); font-weight: 600; }
.wc-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.wc-chart-table td:first-child { white-space: nowrap; }
.wc-pages-title { margin-top: 16px; }
.wc-oneline { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (forced-colors: active) { .wc-seg { forced-color-adjust: none; border: 1px solid CanvasText; } }
