/* The call panel: in the business's colour (--cw-brand, set from its configuration), neutral otherwise. */
:root {
  --cw-brand: #1f2937;
  --cw-on-brand: #ffffff;
  --ink: #111318;
  --ink-2: #353b47;
  --muted: #5e6675;
  --line: #d5d9e0;
  --subtle: #f1f3f5;
  --surface: #ffffff;
  --canvas: #f3f4f6;
  --bad: #b42318;
  --bad-bg: #fef1f0;
  --ok: #15803d;
  --ok-bg: #eef8f1;
  --focus: color-mix(in srgb, var(--cw-brand) 55%, #2563eb);
  --pop-shadow: 0 12px 28px rgba(17, 19, 24, .16), 0 2px 6px rgba(17, 19, 24, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceef2;
    --ink-2: #c4cad3;
    --muted: #a2aab8;
    --line: #333a45;
    --subtle: #1e2229;
    --surface: #14171d;
    --canvas: #0b0d11;
    --bad: #f7a59c;
    --bad-bg: #2e1614;
    --ok: #74d99f;
    --ok-bg: #12261b;
    --focus: #93c5fd;
    --pop-shadow: 0 12px 28px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
#cw-root { height: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.cw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }

/* The frame: the business's header, the step's body, the security check. */
.cw { display: flex; flex-direction: column; height: 100%; background: var(--surface); overflow: hidden; }
.cw-head { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 8px 10px 16px; background: var(--cw-brand); color: var(--cw-on-brand); flex: none; }
.cw-logo { display: block; height: 36px; width: auto; max-width: 132px; padding: 3px; border-radius: 8px; background: #fff; object-fit: contain; flex: none; }
.cw-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: color-mix(in srgb, var(--cw-on-brand) 18%, transparent); font-weight: 600; flex: none; }
.cw-business { flex: 1 1 auto; min-width: 0; font-size: 16px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; flex: none; }
.cw-x:hover { background: color-mix(in srgb, var(--cw-on-brand) 14%, transparent); }
.cw-x:focus-visible { outline-color: var(--cw-on-brand); outline-offset: -3px; }
.cw-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 16px; overflow-y: auto; }
.cw-ts { padding: 0 20px 12px; flex: none; }
.cw-ts:empty { display: none; }

/* Words. */
.cw-title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; outline: none; }
.cw-intro { margin: 0; color: var(--ink-2); }
.cw-small, .cw-hint { margin: 0; font-size: 13px; line-height: 19px; color: var(--muted); }
.cw-center { text-align: center; }
.cw-notice { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--subtle); color: var(--ink-2); font-size: 13px; line-height: 19px; }
.cw-err { margin: 0; color: var(--bad); font-size: 13px; line-height: 19px; }
.cw-msg { padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); }
.cw-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The form. */
.cw-form { display: flex; flex-direction: column; gap: 14px; }
.cw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cw-field label { font-size: 14px; line-height: 20px; font-weight: 500; }
.cw-field input, .cw-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cw-field textarea { resize: vertical; }
.cw-field input:focus, .cw-field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.cw-field input[aria-invalid="true"] { border-color: var(--bad); }
.cw-field input[type="tel"] { font-variant-numeric: tabular-nums; }
.cw-when { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.cw-when legend { padding: 0; margin-bottom: 4px; font-size: 14px; font-weight: 500; }
.cw-choice { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.cw-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--cw-brand); }

/* The mobile number: one field on one row, the country's button (its flag, calling code and a caret) in front of the number. */
.cw-tel { position: relative; display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cw-tel:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.cw-tel.is-invalid { border-color: var(--bad); }
.cw-cc { position: relative; display: flex; align-items: center; gap: 6px; flex: none; min-width: 44px; min-height: 44px; padding: 0 8px 0 12px; border: 0; border-radius: 9px 0 0 9px; background: transparent; cursor: pointer; }
.cw-cc::after { content: ""; position: absolute; top: 10px; right: 0; bottom: 10px; width: 1px; background: var(--line); }
.cw-cc:hover, .cw-cc[aria-expanded="true"] { background: var(--subtle); }
.cw-cc:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cw-cc-dial { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-chev { flex: none; margin-left: -2px; color: var(--muted); }
.cw-cc[aria-expanded="true"] .cw-chev { transform: rotate(180deg); }
.cw-field .cw-tel .cw-tel-input { flex: 1 1 auto; width: auto; min-width: 0; min-height: 44px; padding: 0 12px 0 10px; border: 0; border-radius: 0 9px 9px 0; background: transparent; box-shadow: none; }
.cw-field .cw-tel .cw-tel-input:focus { box-shadow: none; }
/* A flag from flags/flags.png (its place set by the panel), on a neutral tile until it loads. */
.cw-flag { display: inline-block; flex: none; width: 20px; height: 15px; border-radius: 2px; background: var(--subtle) url(flags/flags.png) no-repeat; background-size: 336px 256px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); }
/* The list: under the field and as wide (above it when the panel has more room there; the panel sets its height), the search on top, the widget's country first. */
.cw-cc-pop { position: absolute; z-index: 5; top: calc(100% + 6px); left: -1px; right: -1px; display: flex; flex-direction: column; max-height: 320px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--pop-shadow); overflow: hidden; }
.cw-cc-pop.is-up { top: auto; bottom: calc(100% + 6px); }
.cw-cc-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; color: var(--muted); }
.cw-field .cw-cc-pop .cw-cc-q { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; outline: none; }
.cw-cc-q::placeholder { color: var(--muted); }
.cw-cc-list { position: relative; flex: 1 1 auto; margin: 0; padding: 4px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.cw-cc-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 10px; border-radius: 8px; cursor: pointer; }
.cw-cc-opt .cw-cc-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-cc-opt .cw-cc-dial { font-size: 14px; }
.cw-cc-opt:hover { background: var(--subtle); }
.cw-cc-opt.is-active { background: color-mix(in srgb, var(--cw-brand) 13%, var(--surface)); }
.cw-cc-opt[aria-selected="true"] { font-weight: 600; }
.cw-cc-opt.is-home { position: relative; margin-bottom: 9px; }
.cw-cc-opt.is-home::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -5px; height: 1px; background: var(--line); }
.cw-check { flex: none; width: 16px; color: var(--ink); }
.cw-cc-none { margin: 0; padding: 14px 12px; color: var(--muted); font-size: 14px; }
.cw-cc-none:empty { display: none; }
@media (forced-colors: active) {
  .cw-cc-opt.is-active { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* Buttons: the business's colour for the main action, red to hang up. */
.cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.cw-btn:hover { background: var(--subtle); }
.cw-primary { width: 100%; border-color: var(--cw-brand); background: var(--cw-brand); color: var(--cw-on-brand); }
.cw-primary:hover { background: var(--cw-brand); filter: brightness(.94); }
.cw-danger { border-color: #c62828; background: #c62828; color: #fff; }
.cw-danger:hover { background: #b71c1c; }
.cw-btn:disabled { opacity: .6; cursor: progress; }
.cw-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.cw-link { align-self: center; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--ink-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cw-link:hover { color: var(--ink); }
.cw-actions { display: flex; flex-direction: column; gap: 8px; }
.cw-row { flex-direction: row; }
.cw-row > * { flex: 1 1 0; }

/* A call: who, how long, and the controls at thumb height. */
.cw-call { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 16px; }
.cw-avatar { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 999px; background: var(--cw-brand); color: var(--cw-on-brand); font-size: 32px; font-weight: 600; margin-bottom: 8px; }
.cw-avatar.is-ringing { animation: cw-ring 1.6s ease-out infinite; }
@keyframes cw-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cw-brand) 45%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
@media (prefers-reduced-motion: reduce) { .cw-avatar.is-ringing { animation: none; box-shadow: 0 0 0 6px color-mix(in srgb, var(--cw-brand) 25%, transparent); } }
.cw-timer { margin: 0; font-size: 28px; line-height: 36px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.cw-badge { margin: 0; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); font-size: 13px; font-weight: 600; }
.cw-badge::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.cw-controls { display: flex; gap: 10px; margin-top: auto; padding-top: 16px; }
.cw-controls .cw-btn { flex: 1 1 0; min-height: 56px; border-radius: 16px; }
.cw-volume { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.cw-volume input { flex: 1 1 auto; accent-color: var(--cw-brand); min-height: 32px; }
.cw-confirm { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); }
.cw-confirm p { margin: 0; font-weight: 600; }

/* Waiting for the microphone. */
.cw-spin { width: 32px; height: 32px; margin: 12px auto; border: 3px solid var(--subtle); border-top-color: var(--cw-brand); border-radius: 999px; animation: cw-spin .9s linear infinite; }
@keyframes cw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cw-spin { animation-duration: 3s; } }

/* Done, and feedback. */
.cw-done { display: grid; place-items: center; width: 56px; height: 56px; margin: 16px auto 0; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.cw-feedback { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; border: 0; }
.cw-feedback legend { padding: 0; margin-bottom: 8px; font-weight: 600; text-align: center; width: 100%; }
.cw-thumbs { display: flex; gap: 10px; }
.cw-thumb { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 500; cursor: pointer; }
.cw-thumb:hover { background: var(--subtle); }
.cw-thumb[aria-pressed="true"] { border-color: var(--cw-brand); box-shadow: inset 0 0 0 1px var(--cw-brand); background: color-mix(in srgb, var(--cw-brand) 8%, var(--surface)); }

/* A page of its own (?full=1): a card in the middle of a wide screen, the whole screen on a phone. */
html.cw-full body { background: var(--canvas); }
html.cw-full #cw-root { height: auto; min-height: 100%; }
html.cw-full .cw { height: auto; min-height: 100vh; min-height: 100dvh; max-width: 440px; margin: 0 auto; }
@media (min-width: 600px) {
  html.cw-full .cw { min-height: 0; margin: 48px auto; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 32px rgba(17, 19, 24, .10); }
  html.cw-full .cw-body { min-height: 440px; }
}

/* Video (a video call, a meeting): the cameras on a dark stage above the words and controls. */
.cw-stage { position: relative; flex: none; aspect-ratio: 16 / 9; background: #0b0d11; overflow: hidden; }
.cw-stage video { display: block; background: #0b0d11; }
.cw-remote-video { width: 100%; height: 100%; object-fit: cover; }
.cw-stage:not(.has-remote):not(.is-room) .cw-self { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; }
.cw-self { position: absolute; right: 10px; bottom: 10px; width: 30%; max-width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid rgba(255, 255, 255, .9); border-radius: 10px; transform: scaleX(-1); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.cw-stage.is-room { aspect-ratio: auto; min-height: 0; padding: 6px; }
.cw-grid { display: grid; gap: 6px; grid-template-columns: 1fr; }
.cw-grid[data-n="2"], .cw-grid[data-n="3"], .cw-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.cw-grid[data-n="3"] .cw-tile:first-child { grid-column: 1 / -1; }
.cw-tile.is-self video { position: static; width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; transform: scaleX(-1); }
.cw-tile { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #1e2229; }
.cw-tile video { width: 100%; height: 100%; object-fit: cover; }
.cw-tile.no-video video { opacity: 0; }
.cw-tile-initial { position: absolute; inset: 0; display: none; place-items: center; color: #fff; font-size: 30px; font-weight: 600; }
.cw-tile.no-video .cw-tile-initial { display: grid; }
.cw-tile-name { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-controls .cw-btn { padding: 0 10px; white-space: nowrap; }
.cw-call.is-video { padding-top: 4px; }
.cw-call.is-video .cw-title { font-size: 18px; line-height: 24px; }
.cw-call.is-video .cw-timer { font-size: 22px; line-height: 28px; }
.cw-btn svg { flex: none; }
/* A meeting on a page of its own: wider on a wide screen, the tiles two by two. */
html.cw-full.cw-room .cw { max-width: 880px; }
@media (max-width: 480px) {
  /* A phone: two people stacked; four two by two, square, to use the screen. */
  .cw-grid[data-n="2"] { grid-template-columns: 1fr; }
  .cw-grid[data-n="4"] .cw-tile, .cw-grid[data-n="3"] .cw-tile:not(:first-child) { aspect-ratio: 1 / 1; }
}
/* With the cameras on a wide screen's card, the words and controls take only the room they need. */
@media (min-width: 600px) {
  html.cw-full .cw-stage:not([hidden]) + .cw-body { min-height: 0; }
}

/* Text us and the codes (the business's switches). */
.cw-pair { display: flex; gap: 8px; }
.cw-pair > .cw-btn { flex: 1 1 0; min-width: 0; padding: 0 12px; }
.cw-field .cw-otp { font-size: 22px; line-height: 28px; letter-spacing: .32em; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; padding-left: 14px; }
.cw-field .cw-otp::placeholder { letter-spacing: normal; }
.cw-sent { overflow-wrap: anywhere; }
.cw-sent b, .cw-notice b { color: var(--ink); font-weight: 600; }
.cw-addr { word-break: break-all; }
.cw-inline { display: inline; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cw-inline:hover { color: var(--ink); }
.cw-resend { display: flex; justify-content: center; margin-top: -6px; }
.cw-resend .cw-link:disabled { cursor: default; text-decoration: none; color: var(--muted); opacity: 1; }
.cw-field textarea#cw-message { min-height: 128px; line-height: 1.45; }
.cw-count { align-self: flex-end; font-variant-numeric: tabular-nums; }
.cw-count.is-near { color: var(--ink); font-weight: 600; }
