/* Phones setup (web/js/views/phones.js): the Telnyx section and, from t3-phones-offices, the
   Offices board (t1-phones-office-tiles), the Numbers and Ringing and forwarding sections of the
   approved 1280 and 375 screens. Quiet cards with the status on the right, using the app's
   existing card, field, button and badge pieces. */

.phones-page {
  max-width: 900px;
}

.phones-card {
  margin-top: 18px;
}

.phones-card h3 {
  margin: 22px 0 8px;
  font-size: 15px;
  color: var(--heading);
}

.phones-note {
  margin: 8px 0 0;
  color: var(--muted);
}

.phones-note.phones-again {
  margin-top: 16px;
  font-size: 13px;
}

.phones-form {
  margin-top: 18px;
}

.phones-field + .phones-field {
  margin-top: 14px;
}

.phones-field input {
  width: 100%;
}

.phones-field-hint {
  display: block;
  margin-top: 5px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* The shared `.field > span` rule is more specific than a single class; keep the hints quiet
   underneath every Phones field. */
.phones-field .phones-field-hint {
  margin-top: 5px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.phones-saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-height: 44px;
}

.phones-saved-label {
  color: var(--muted);
  font-size: 13px;
}

.phones-key {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.phones-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.phones-actions .btn {
  min-height: 44px;
}

.phones-remove {
  margin-left: auto;
  color: var(--danger);
}

.phones-made {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.phone-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.phone-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
}

.phone-step + .phone-step {
  border-top: 1px solid var(--line);
}

.phone-step-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%; /* true circle */
}

.phone-step-mark.done {
  color: var(--ok);
  background: var(--ok-soft);
}

.phone-step-mark.failed {
  color: var(--danger-text);
  background: var(--danger);
  font-weight: 700;
  font-size: 13px;
}

.phone-step-mark.pending {
  border: 1px dashed var(--line-strong);
}

.phone-step-text {
  flex: 1 1 auto;
  min-width: 0;
}

.phone-step-label {
  display: block;
}

.phone-step-message {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.phone-step.failed .phone-step-message {
  color: var(--danger);
}

.phone-step-chip {
  flex: none;
  margin-top: 1px;
}

@media (max-width: 600px) {
  .phones-page {
    max-width: none;
  }

  .phones-card {
    margin-top: 12px;
  }

  .phones-actions {
    align-items: stretch;
  }

  .phones-actions .btn {
    flex: 1 1 auto;
  }

  .phones-remove {
    margin-left: 0;
  }

  .phone-step {
    gap: 8px;
  }
}

/* The sections after Telnyx (t3-phones-offices): the account's numbers, each office's Phones
   switch, and its greeting, ring time and forward number. Two columns on a computer, stacked on
   a phone, all from the approved 1280 and 375 screens. */

.phone-number-list {
  max-height: 360px;
  margin-top: 14px;
  padding-right: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.phone-number-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 6px 20px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.phone-number-row:first-child {
  border-top: 0;
}

.phone-number-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.phone-number {
  color: var(--heading);
  font-size: 16px;
  font-weight: 600;
}

.phones-number-label {
  width: min(100%, 340px);
  min-height: 28px;
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
}

.phones-number-label:hover:not(:disabled) {
  border-color: var(--line);
}

.phones-number-label:focus {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

.phones-number-hint {
  padding-left: 5px;
  color: var(--muted);
  font-size: 12px;
}

.phones-number-office {
  width: 100%;
}

/* t1b: the number's source, and the Outgoing check on an Office line number, under its office. */
.phones-number-source-row,
.phones-number-outgoing {
  grid-column: 2;
}

.phones-number-source-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.phones-number-source,
.phones-number-other {
  min-width: 0;
  flex: 1 1 120px;
}

/* The typed source name gets the whole width under the Source choice, so 24 characters show. */
.phones-number-other {
  flex-basis: 100%;
}

.phones-number-outgoing {
  font-size: 13px;
}

.phone-number-row .error,
.phone-number-row .phones-not-saved {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

/* The Numbers tile (t6-phones-numbers): one line per office, the no-office warning and Change. */
.settings-tile.phone-numbers-tile .phone-numbers-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.settings-tile.phone-numbers-tile .phone-numbers-line {
  display: block;
  margin: 0;
  min-width: 0;
}

.settings-tile.phone-numbers-tile .phone-numbers-line .phone-tile-line-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-tile.phone-numbers-tile .phone-numbers-unassigned {
  margin: 8px 0 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
}

.settings-tile.phone-numbers-tile .phone-numbers-change {
  margin-top: 12px;
  justify-content: flex-end;
}

.phones-number-note {
  margin-top: 14px;
}

/* The moved rows get the sheet's phone targets: full-size fields and 44 px controls. */
.settings-sheet.phone-numbers-sheet .phone-number-list {
  margin-top: 0;
}

.settings-sheet.phone-numbers-sheet :is(.phones-number-label, .phones-number-office, .phones-number-source, .phones-number-other) {
  min-height: 44px;
}

.settings-sheet.phone-numbers-sheet .phones-number-outgoing {
  min-height: 44px;
}

.phones-not-saved {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding-left: 5px;
  color: var(--muted);
  font-size: 13px;
}

.phones-try-again {
  padding: 0;
  font-size: 13px;
}

/* Offices board (t1-phones-office-tiles): the kit's Board and Tile on Phones setup. Each switch
   keeps its own bordered box (.tile-switch-cell) so its "Saved.", "Not saved" and refusal show
   under that switch; the box looks like the kit's direct-child switch box. */
.settings-tile.phone-office-tile {
  margin-top: 0;
  padding: 12px 14px;
  container-type: inline-size;
}

/* The board's notes at 12px so a long legend stays short enough for the board's height budget. */
.settings-tile.phone-office-tile .tile-note {
  margin: 4px 0 8px;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
}

.settings-tile.phone-office-tile p.phone-warning {
  display: block;
  margin: 2px 0 4px;
}

.settings-tile.phone-office-tile .tile-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}

/* A tile too narrow for two boxes side by side (a phone): one box per row, as the kit wraps. */
@container (max-width: 320px) {
  .settings-tile.phone-office-tile .tile-switches {
    grid-template-columns: minmax(0, 1fr);
  }
}

.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-inline: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell > .switch-control {
  flex: 1 0 auto;
  width: 100%;
  min-height: 44px;
  padding-block: 2px;
  padding-inline: 4px;
  gap: 0;
  border: 0;
  border-radius: calc(var(--radius-control) - 3px);
  background: transparent;
}

.settings-tile.phone-office-tile .tile-switch-cell .switch-word {
  margin-left: 4px;
}

.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell > .tile-switch-state {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding-inline: 9px;
}

.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell .phones-saved-note,
.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell .phones-not-saved,
.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell .error {
  margin: 0 0 4px;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
}

.settings-tile.phone-office-tile .tile-switches > .tile-switch-cell .phones-not-saved {
  padding-left: 3px;
}

/* A tile in two columns (a phone, or the Offices board at 1280 px): a shorter track, as the kit
   does for its own tile switches, so two boxes fit per row and the labels stay with their tracks. */
@container (max-width: 430px) {
  .settings-tile.phone-office-tile .tile-switch-cell > .switch-control .switch-track {
    flex-basis: 40px;
    width: 40px;
  }

  .settings-tile.phone-office-tile .tile-switch-cell > .switch-control.is-on .switch-thumb {
    transform: translateX(10px);
  }
}

@media (hover: hover) {
  .settings-tile.phone-office-tile .tile-switch-cell > .switch-control:not(.is-disabled):not(.is-busy):hover {
    background: var(--surface-2);
  }
}

.settings-tile.phone-office-tile.phone-closed-on {
  border-color: var(--warn-ink);
  background: var(--warn-soft);
}

.phone-tile-line-copy-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 8px;
}

.phone-tile-line-copy-inline .phones-saved-note {
  grid-column: 1 / -1;
}

.phone-tile-line-copy-inline .phone-tile-line-value {
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
}

.phone-tile-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.phone-tile-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.phone-tile-line-copy {
  display: flex;
  flex: 1 1 180px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.phone-tile-line-label {
  color: var(--muted);
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  font-weight: 600;
}

.phone-tile-line-value {
  color: var(--heading);
  font-size: round(nearest, calc(13px * var(--font-scale)), 1px);
  line-height: 1.35;
}

/* The five ringing lines share one Change button: label and value on each line; the warning
   style marks a forward choice with no number saved and Forward every call while it is on.
   12 px keeps the longest lines ("Forward every call: On: …") on one line in a half-width tile. */
.phone-tile-line-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
}

.phone-tile-line-row .phone-tile-line-label {
  flex: 0 1 auto;
  white-space: nowrap;
}

.phone-tile-line-row .phone-tile-line-value {
  flex: 1 1 7em;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
}

.phone-tile-line-copy .phones-saved-note {
  margin: 2px 0 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
}

.phone-tile-line-btn {
  flex: none;
  min-height: 44px;
  min-width: 0;
  padding-inline: 10px;
}

.phone-sheet-intro {
  margin-top: 0;
}

.phone-sheet-sub {
  margin-top: 4px;
}

.settings-sheet.phone-sheet .phone-live-hours,
.settings-sheet.phone-sheet .phone-closed {
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.settings-sheet.phone-sheet .settings-sheet-foot .btn {
  min-height: 44px;
}

@media (max-width: 860px), (pointer: coarse) {
  .settings-sheet.phone-sheet :is(.input, .select, .textarea) {
    font-size: max(16px, round(nearest, calc(14px * var(--font-scale)), 1px));
  }

  .settings-sheet.phone-numbers-sheet .phones-number-label {
    font-size: max(16px, round(nearest, calc(14px * var(--font-scale)), 1px));
  }
}

/* Phone service board and Telnyx tile / key sheet (t4-phones-telnyx). */
.settings-tile.phone-telnyx-tile .phone-telnyx-key-line .phone-tile-line-copy-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.settings-tile.phone-telnyx-tile .phones-actions {
  margin-top: 12px;
}

.settings-tile.phone-telnyx-tile .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}

.settings-tile.phone-telnyx-tile .error {
  margin: 12px 0 0;
}

.settings-tile.phone-telnyx-tile .phones-made {
  margin-top: 16px;
  padding-top: 14px;
}

.settings-tile.phone-telnyx-tile .phones-made h3 {
  margin-top: 0;
}

.settings-tile.phone-telnyx-tile .phones-made-summary {
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.settings-tile.phone-telnyx-tile .phones-made-fold[open] .phones-made-summary {
  margin-bottom: 8px;
}

@media (max-width: 860px), (pointer: coarse) {
  .settings-tile.phone-telnyx-tile .phones-made-summary {
    min-height: 44px;
    padding-block: 11.5px;
  }
}

.settings-sheet.phone-telnyx-sheet .phones-form {
  margin-top: 0;
}

.settings-sheet.phone-telnyx-sheet .error {
  margin: 14px 0 0;
}

/* Criterion 3 (t5-phones-backup): at 1280×900 the first 900 px reach the badges of both tiles
   on the Phone service board, so the two board sections above keep tight spacing. The space is
   won here, in the page's own sections, while the shared board gap stays at 12 px. */
.phones-page > section[data-phone-section="offices"] {
  margin-top: 0;
  padding-top: 6px;
  padding-bottom: 2px;
}

.phones-page > section[data-phone-section="offices"] .card-head {
  padding-bottom: 4px;
}

.phones-page > section[data-phone-section="offices"] .card-head h2 {
  font-size: 16px;
  line-height: 20px;
}

.phones-page > section[data-phone-section="offices"] .phones-note {
  margin-top: 0;
  font-size: 13px;
  line-height: 16px;
}

.phones-page > section[data-phone-section="offices"] .phones-switches-help {
  margin: 2px 0 6px;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
}

.phones-page > section[data-phone-section="service"] {
  margin-top: 2px;
  padding-top: 2px;
}

.phones-page > section[data-phone-section="service"] .card-head {
  padding-bottom: 0;
}

.phones-page > section[data-phone-section="service"] .card-head h2 {
  font-size: 16px;
  line-height: 18px;
}

.phones-page > section[data-phone-section="service"] .phones-note {
  margin-top: 0;
  font-size: 13px;
  line-height: 16px;
}

.settings-tile.phone-service-tile {
  padding-top: 2px;
}

/* The "When Huddle is down" tile and its sheets (t5-phones-backup): the backup's status lines
   sit right under the tile's note; the connection form and the outage boxes live in sheets,
   where they need no card borders of their own. */
.settings-tile.phone-outage-tile .phones-backup-status {
  margin: 8px 0 2px;
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-tile.phone-outage-tile .phones-backup-owner-only {
  margin-top: 10px;
}

.settings-sheet.phone-backup-sheet .phones-backup {
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-sheet.phone-backup-sheet .phones-backup h3 {
  margin-top: 0;
}

.settings-sheet.phone-backup-sheet .phones-backup .btn {
  min-height: 44px;
}

.settings-sheet.phone-outage-sheet .phone-outage-box {
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
}

.settings-sheet.phone-outage-sheet .phones-outage-save {
  min-height: 44px;
}

.phone-warning {
  color: var(--danger);
  font-size: 13px;
}

.phone-offices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  margin-top: 16px;
}

.phone-office-settings {
  min-width: 0;
  padding-top: 4px;
}

.phone-office-settings h3 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

/* Backup cells and Ring my cell (t7-cells): the holiday list's rows, with 44 px controls. */
.phone-cells { margin-top: 12px; }
.phone-my-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.phone-my-cell .input { flex: 1 1 160px; min-width: 0; min-height: 44px; }
.phone-my-cell .btn, .phone-cell-actions .btn, .phone-cell-rename .btn { min-height: 44px; }
.phone-cell-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.phone-cell-rename { display: flex; flex: 1 1 auto; gap: 8px; min-width: 0; }
.phone-cell-rename .input { flex: 1 1 120px; min-width: 0; min-height: 44px; }
@media (max-width: 720px) {
  .phone-cell { flex-wrap: wrap; }
}

/* Live people answer (t12-live-answer-hours): one row per weekday, 44 px controls. */
.phone-live-hours {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.phone-live-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.phone-live-head h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.phone-live-state { color: var(--muted); font-size: 13px; white-space: nowrap; }
.phone-live-days { margin: 10px 0 0; padding: 0; list-style: none; }
.phone-live-day {
  display: grid;
  grid-template-columns: minmax(84px, 0.5fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.phone-live-day-name { font-weight: 700; }
.phone-live-times { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.phone-live-time { display: flex; align-items: center; gap: 6px; }
.phone-live-time span { color: var(--muted); font-size: 13px; }
.phone-live-time .input { width: max-content; max-width: 100%; min-height: 44px; }
.phone-live-no-answer { width: auto; min-height: 44px; gap: 8px; padding: 4px 8px; }
.phone-live-no-answer .switch-copy { flex: 0 0 auto; }
.phone-live-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.phone-live-actions .btn { min-height: 44px; }

@media (max-width: 720px) {
  .phone-live-day { grid-template-columns: minmax(0, 1fr); }
  .phone-live-times .phone-live-time { flex: 1 1 100%; }
  .phone-live-time .input { width: 100%; }
  .phone-live-actions .btn { flex: 1 1 100%; }
}

/* Closed now and holidays (t1-call-hours): amber while Closed now is on. */
.phone-closed {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.phone-closed-on { border-color: var(--warn-ink); background: var(--warn-soft); }
.phone-closed-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.phone-closed-head h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.phone-closed-switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.phone-closed-title { margin: 14px 0 6px; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.phone-closed-list { margin: 0; padding: 0; list-style: none; }
.phone-closed-day { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.phone-closed-day-copy { display: flex; min-width: 0; flex-direction: column; overflow-wrap: anywhere; }
.phone-closed-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.phone-closed-add .input { flex: 1 1 140px; min-width: 0; min-height: 44px; }
.phone-closed-add .btn, .phone-closed-remove { min-height: 44px; }
.phone-closed-day-message { min-height: 1.25em; margin: 6px 0 0; color: var(--danger); font-size: 13px; line-height: 1.25; }

.phone-office-settings .phones-field input,
.phone-office-settings .phones-field textarea {
  width: 100%;
}

.phone-office-settings .phones-field textarea {
  min-height: 82px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.phone-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

/* Forward every call now, and the situations (t5-call-choices). */
.phone-forward-all {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.phone-forward-all-row {
  display: grid;
  grid-template-columns: auto minmax(18ch, 240px) minmax(0, 1fr);
  align-items: end;
  gap: 14px;
}

.phone-forward-all-switch {
  min-height: 44px;
}

/* Between the phone and wide layouts the sidebar leaves the three columns too little room:
   the switch takes the full row and the two destinations share the next one. */
@media (max-width: 1100px) {
  .phone-forward-all-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .phone-forward-all-switch {
    grid-column: 1 / -1;
  }
}

/* In the Ringing and forwarding sheet the switch keeps its visible title on its own row and the
   number and label fields follow it, side by side where both fit (the 640 px sheet) and one
   under the other on a phone's bottom sheet. */
.settings-sheet .phone-forward-all-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.settings-sheet .phone-forward-all-switch {
  grid-column: 1 / -1;
}

@media (max-width: 860px), (pointer: coarse) {
  .settings-sheet .phone-forward-all-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.phone-situation {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.phone-situation h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.phone-situation select.input {
  display: block;
  min-height: 44px;
  max-width: 460px;
}

.phone-situation .phones-field + .phones-field {
  margin-top: 12px;
}

.phone-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.phone-save-row .btn {
  min-height: 44px;
}

.phones-saved-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.phone-office-settings .error {
  margin-top: 12px;
}

.phone-office-settings .phones-not-saved {
  margin-top: 12px;
  padding-left: 0;
}

/* When Huddle is down (t6-backup-status): the backup's check lines under the intro. */
.phones-backup-status {
  list-style: none;
  margin: 4px 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.phones-backup-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.phones-backup-line.problem {
  color: var(--danger);
}

/* When Huddle is down (t5-backup-link): the owner's backup connection, above where calls go. */
.phones-backup {
  margin-top: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.phones-backup .phones-field {
  margin-top: 12px;
}

.phones-backup .phone-save-row {
  gap: 12px;
}

/* When Huddle is down (t4-outage-numbers): one bordered box per office, side by side. */
.phones-outage-where {
  margin: 16px 0 10px;
  font-size: 14px;
}

.phone-outage-boxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.phone-outage-box {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.phone-outage-box h4 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.phone-outage-box .phones-field input {
  width: 100%;
}

.phone-outage-box .phones-field input:disabled { background: var(--surface-2); color: var(--muted); }

.phone-outage-box .phones-field-hint {
  margin: 8px 0 0;
}

@media (max-width: 720px) {
  .phone-outage-boxes,
  .phone-number-row,
  .phone-settings-row,
  .phone-forward-all-row,
  .phone-offices {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-sheet.phone-outage-sheet .phone-outage-box + .phone-outage-box {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .phone-number-row {
    gap: 8px;
  }

  .phones-number-source-row,
  .phones-number-outgoing {
    grid-column: 1;
  }

  .phone-offices {
    gap: 22px;
  }

  .phone-save-row .btn {
    width: 100%;
  }
}

/* Computers that ring (t6-mark-computer): the shared front desk computers marked for calls,
   each with its own rename and Remove, and the button that marks this one. */

.phone-computer-list {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
}

.phone-computer-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.phone-computer-row:first-child {
  border-top: 0;
}

.phone-computer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--heading);
}

.phone-computer-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.phone-computer-name {
  align-self: flex-start;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--heading);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.phone-computer-name:hover,
.phone-computer-name:focus-visible {
  text-decoration: underline;
}

.phone-computer-line {
  color: var(--muted);
  font-size: 13px;
}

.phone-computer-chip,
.phone-computer-remove {
  justify-self: end;
}

.phone-computer-row .error {
  grid-column: 2 / -1;
  margin: 4px 0 0;
}

.phone-computer-rename {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.phone-computer-name-input {
  width: min(100%, 320px);
}

.phone-computer-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.phone-computer-name-field {
  flex: 1 1 280px;
  margin: 0;
}

.phone-computer-add .btn {
  min-height: 44px;
}

.phone-computers-why {
  flex-basis: 100%;
  margin: 0;
}

.phone-computers-help {
  margin-top: 16px;
  font-size: 13px;
}

.phone-computers-empty {
  margin-top: 14px;
}

.phone-computers-actions,
.phone-desk-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.settings-tile.phone-computers-tile .tile-note,
.settings-tile.phone-desk-tile .tile-note {
  margin-bottom: 4px;
}

.phone-computer-tile-line .phone-tile-line-value,
.phone-desk-tile-line .phone-tile-line-value {
  overflow-wrap: anywhere;
}

/* A not-ready line's visible text takes the warning colour from its row, not the heading colour
   the shared line value sets. */
.phone-computer-tile-line.phone-warning .phone-tile-line-value {
  color: inherit;
}

/* The computer name opens the rename form; on a phone it is a 44 px tap target, and on a
   wider touch screen it keeps the desktop row height with an invisible 44 px hit area. */
@media (max-width: 860px) {
  .settings-sheet.phone-computers-sheet .phone-computer-name {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (min-width: 861px) and (pointer: coarse) {
  .settings-sheet.phone-computers-sheet .phone-computer-name {
    position: relative;
  }

  .settings-sheet.phone-computers-sheet .phone-computer-name::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 44px;
    transform: translateY(-50%);
  }
}

.phone-computers-tile .phone-computer-tile-lines {
  margin-top: 0;
  padding-top: 2px;
}

.phone-desk-tile .phone-desk-tile-lines {
  margin-top: 0;
  padding-top: 2px;
}

.phone-desk-tile > .phone-desk-empty {
  margin-top: 4px;
  margin-bottom: 0;
}

.phone-computers-tile .phone-computer-add {
  margin-top: 0;
  padding-top: 0;
}

.phone-computers-tile .phone-computers-help {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.phone-computers-mark {
  margin-top: 0;
}

.phone-computer-mark-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.phone-computer-mark-form .phone-computer-name-field {
  width: 100%;
}

.phone-computer-mark-form .phones-ring-this {
  min-height: 44px;
}

.phone-computer-mark-form .error {
  width: 100%;
}

.phone-computers-mark .phones-ring-this {
  min-height: 44px;
}

/* Desk phones (t12-desk-phone): each desk phone's row, its login when Show login is pressed,
   and the setting-up list that is the same for every phone. */

.phone-desk-list {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
}

.phone-desk-item {
  display: flex;
  flex-direction: column;
}

.phone-desk-item:first-child .phone-computer-row {
  border-top: 0;
}

.phone-desk-name {
  overflow-wrap: anywhere;
  cursor: default;
}

.phone-desk-show-login,
.phone-desk-remove {
  justify-self: end;
}

.phone-desk-login {
  margin: 0 0 16px 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.phone-desk-login h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.phone-desk-credentials {
  display: grid;
  gap: 6px 18px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
}

.phone-desk-credentials > div {
  display: contents;
}

.phone-desk-credentials dt {
  color: var(--muted);
  font-size: 13px;
}

.phone-desk-credentials dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.phone-desk-setting-up {
  margin: 22px 0 8px;
  font-size: 16px;
}

.phone-desk-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--text);
}

.phone-desk-steps li + li {
  margin-top: 4px;
}

.phone-desk-add {
  margin-top: 18px;
}

.phone-desk-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.phone-desk-add-form .btn,
.phone-desk-add-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.phone-desk-add-form .btn .icon,
.phone-desk-add-start .icon {
  width: 18px;
  height: 18px;
}

.phone-desk-empty {
  margin-top: 14px;
}

@media (max-width: 600px) {
  .phone-desk-login {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .phone-desk-item .phone-computer-row {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
  }

  .phone-desk-item .phone-desk-show-login,
  .phone-desk-item .phone-desk-remove {
    grid-column: 2;
    justify-self: start;
  }

  .phone-computer-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .phone-computer-chip {
    grid-column: 2;
    justify-self: start;
  }

  .phone-computer-remove {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .phone-computer-add {
    align-items: stretch;
  }

  .phone-computer-add .btn {
    flex: 1 1 auto;
  }
}

/* The phone readiness chip (t7-phone-ready): the top bar's green pill and the lock card's. */
.phone-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--ok-soft);
  color: var(--ok);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
.phone-chip-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%; /* true circle */
  background: currentColor;
}
.phone-chip-warn { background: var(--warn-soft); color: var(--warn-ink); }
.phone-chip-danger { background: var(--danger-soft); color: var(--danger); }
.phone-chip-waiting { background: var(--surface-2); color: var(--muted); }
/* Closed now (t1-call-hours): amber beside the phone chip, with a little room between them. */
.phone-chip-closed { margin-left: 6px; background: var(--warn-soft); color: var(--warn-ink); }
.phone-chip-action { cursor: pointer; }
.phone-chip-action:hover { filter: brightness(0.97); }
/* On the lock card the pills sit level, with room on their right, so a pill that wraps starts on the same left edge. */
.phone-chip-lock { margin: 2px 6px 10px 0; vertical-align: top; }
.phone-chip-closed.phone-chip-lock { margin-left: 0; }
/* New voicemails at the computer's office (t4-voicemail-words-count): blue, the count in a dot. */
.phone-chip-voicemail { margin-left: 6px; gap: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.phone-chip-voicemail.phone-chip-lock { margin-left: 0; }
.phone-chip-vm-mark { width: 16px; height: 16px; flex: none; }
.phone-chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.75rem;
}
.phone-chip-short { display: none; }
.phone-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 52px;
  margin: -16px -24px 16px;
  padding: 4px 24px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 860px) {
  .phone-topbar { margin: -22px -16px 16px; padding: 4px 16px; }
}
@media (max-width: 640px) {
  .phone-chip-long { display: none; }
  .phone-chip-short { display: inline; }
}

/* The ringing call's banner (t9-ring-card): under the top bar on every workspace screen, and at
   the top of the lock screen. Light blue with the round phone mark, the office and line, the
   caller, and Decline and Answer. */
.phone-ring {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -16px -24px 16px;
  padding: 11.5px 24px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--note-line);
  color: var(--text);
}
.phone-ring-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%; /* true circle */
  background: var(--accent);
  color: var(--accent-text);
}
.phone-ring-icon .icon { width: 20px; height: 20px; }
.phone-ring-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}
.phone-ring-line {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.phone-ring-error {
  color: var(--danger);
  font-size: 0.875rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.phone-ring-who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 12px;
  min-width: 0;
}
.phone-ring-name {
  color: var(--heading);
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.phone-ring-number {
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.25;
  white-space: nowrap;
}
.phone-ring-actions {
  display: flex;
  flex: none;
  gap: 12px;
}
.phone-ring-actions .btn { min-height: 44px; padding-block: 8px; }
.phone-ring-answer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.phone-ring-answer .icon { width: 18px; height: 18px; }

/* The lock screen's banner spans the window above the card. */
.lock {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 56px;
}
.lock .phone-ring {
  width: 100%;
  margin: 0 0 0;
  border: 0;
  border-bottom: 1px solid var(--note-line);
}
.lock > .card {
  width: calc(100% - 32px);
  margin-top: 56px;
}

@media (max-width: 860px) {
  .phone-ring {
    flex-wrap: wrap;
    gap: 12px;
    margin: -16px -16px 16px;
    padding: 14px 16px;
  }
  .phone-ring-who {
    flex-direction: column;
    gap: 0;
  }
  .phone-ring-name { font-size: 1.4rem; }
  .phone-ring-number { font-size: 1.2rem; }
  .phone-ring-actions {
    flex: 1 0 100%;
    gap: 8px;
  }
  .phone-ring-actions .btn {
    flex: 1 1 0;
    min-height: 44px;
    justify-content: center;
    font-size: 1.125rem;
  }
  .phone-ring-actions .phone-ring-decline { flex: 0.78 1 0; }
  .lock .phone-ring {
    margin: 0;
    padding: 14px 16px;
  }
}

/* The sound check after an answered call (t11-guide-on-answer): one quiet question with Good,
   Problem and Skip, where the strip was. It never covers the call guide's own bar. */
.phone-sound {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: -16px -24px 16px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--note-line);
  color: var(--heading);
}
.phone-sound-question {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.phone-sound-call {
  color: var(--muted);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.phone-sound-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.phone-sound-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.phone-sound-actions .btn.link {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.phone-sound-error {
  flex: 1 0 100%;
  margin: 0;
  color: var(--danger);
  font-size: 0.9375rem;
  font-weight: 650;
}
@media (max-width: 860px) {
  .phone-sound {
    margin: -16px -16px 16px;
    padding: 10px 16px;
  }
}
@media (max-width: 640px) {
  .phone-sound {
    margin: -22px -16px 16px;
    padding: 10px 16px;
  }
  .phone-sound-actions {
    flex: 1 0 100%;
  }
  .phone-sound-actions .btn {
    flex: 1 1 0;
    min-height: 44px;
  }
}

/* The green call strip (t10-call-strip): the top bar while this computer is on a call, on every
   screen and over the lock. It replaces the phone chip, not the call guide's own bar. Hold and
   Unhold say their state; the keypad opens only when pressed. */
/* Keep the bar's office name, My numbers and the Call guide button; only the phone chip the
   strip replaces goes away. The chip's own bar holds nothing else, so it hides whole. */
.on-phone-call .cg-bar .phone-chip,
.on-phone-call .phone-topbar {
  display: none;
}

.phone-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: -16px -24px 16px;
  padding: 10px 24px;
  background: var(--ok-soft);
  border-bottom: 1px solid var(--note-line);
  color: var(--heading);
}
.phone-strip-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.phone-strip-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%; /* true circle */
  background: var(--ok);
}
.phone-strip-time {
  flex: none;
  min-width: 2.6em;
  color: var(--ok);
  font-size: 1.125rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.phone-strip-who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  min-width: 0;
}
.phone-strip-name {
  color: var(--heading);
  font-size: 1.125rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.phone-strip-line {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.phone-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.phone-strip-actions .btn,
.phone-strip-hangup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.phone-strip-actions .icon,
.phone-strip-hangup .icon {
  width: 18px;
  height: 18px;
}
.phone-strip-hangup {
  flex: none;
  border-color: var(--danger);
  background: var(--danger);
  color: var(--danger-text);
}
.phone-strip-hangup:hover {
  background: var(--danger);
  color: var(--danger-text);
  filter: brightness(0.96);
}
.phone-strip-held .phone-strip-dot { background: var(--warn); }
.phone-strip-add-state {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.phone-strip-add-short { display: none; }
/* Talk first (t9-talk-first): the caller is held, so the dot is the hold colour; Complete is the
   one primary action, Cancel beside it. */
.phone-strip-talk-first .phone-strip-dot { background: var(--warn); }
.phone-strip-talk-first .phone-strip-actions .phone-strip-complete {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}
.phone-strip-lost {
  background: var(--warn-soft);
  border-bottom-color: var(--warn);
}
.phone-strip-lost .phone-strip-dot { background: var(--warn); }
.phone-strip-message {
  flex: 1 0 100%;
  margin: 0;
  color: var(--danger);
  font-size: 0.9375rem;
  font-weight: 650;
}
.phone-strip-error { color: var(--danger); }
.phone-strip-pad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  flex: 1 0 100%;
  max-width: 380px;
}
.phone-strip-pad .phone-strip-key {
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}
.lock .phone-strip {
  width: 100%;
  margin: 0;
  border-radius: 0;
}
.lock .phone-strip-message { padding-bottom: 4px; }

@media (max-width: 860px) {
  .phone-strip {
    margin: -16px -16px 16px;
    padding: 10px 16px;
  }
  .phone-strip-actions .btn,
  .phone-strip-hangup {
    min-height: 44px;
  }
  .lock .phone-strip {
    margin: 0;
    padding: 12px 16px;
  }
}

@media (max-width: 640px) {
  .phone-strip {
    gap: 8px 12px;
    margin: -22px -16px 16px;
    padding: 10px 16px;
  }
  .phone-strip-main { flex: 1 1 0; }
  .phone-strip-name { font-size: 1.25rem; }
  .phone-strip-line {
    flex-basis: 100%;
    font-size: 0.9375rem;
  }
  .phone-strip-actions {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: wrap;
  }
  .phone-strip-actions .btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
    min-height: 48px;
    padding: 6px 8px;
  }
  /* The strip's buttons share the row (the approved strip at 375): words only. */
  .phone-strip-actions .btn .icon { display: none; }
  .phone-strip-add-text { display: none; }
  .phone-strip-add-short { display: inline; }
  .phone-strip-hangup {
    order: 2;
    min-height: 48px;
    padding: 6px 12px;
  }
  .phone-strip-pad {
    order: 4;
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lock .phone-strip {
    margin: 0;
  }
}
@media (max-width: 640px) {
  .phone-strip-hangup-text { display: none; }
  .phone-strip-hangup { width: 52px; }
}

/* Park (t10-park): Park on the strip, and the office's Parked calls card floating over the page
   (and the lock screen) on every marked computer, above the tab bar on a phone. */
.phone-strip-park-icon,
.phone-parked-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 50%; /* true circle */
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
}
.phone-parked {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 14;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.16);
  color: var(--text);
}
/* The stacking order, bottom to top: the page's own layers (the thread pane 10, the running-PC
   bar 11, the insurance sheets 11-12, the done note 13), then the Parked calls card (14), then the
   ring bar, the strip and the sound question (15), then the top bar's office switcher (16), then
   dialogs and the Transfer sheet (20 and up). The card is the only place to pick up a parked
   caller, so no page layer may cover it; the ring bar's Answer and Decline, the strip's buttons
   and the switcher's menu stay over it. */
.phone-ring, .phone-strip, .phone-sound {
  position: relative;
  z-index: 15;
}
.phone-parked-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--heading);
  font-size: 1rem;
}
.phone-parked-count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface-2, var(--note-line));
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  text-align: center;
}
.phone-parked-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.phone-parked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0 2px;
}
.phone-parked-row + .phone-parked-row { border-top: 1px solid var(--line); }
.phone-parked-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.phone-parked-number {
  color: var(--heading);
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.phone-parked-detail {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.phone-parked-row .btn {
  min-height: 40px;
  font-weight: 600;
}
.phone-parked-desk {
  grid-column: 1;
  justify-self: start;
}
.phone-parked-desks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}
.phone-parked-desk-choice .icon {
  width: 16px;
  height: 16px;
}
.phone-parked-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.9375rem;
  font-weight: 650;
}
@media (max-width: 860px) {
  .phone-parked {
    right: 16px;
    left: 16px;
    bottom: calc(var(--phone-island-height, 72px) + 12px);
    width: auto;
    max-height: 50vh;
  }
  .phone-parked-row .btn { min-height: 44px; }
}
@media (max-width: 640px) {
  .phone-strip-actions .phone-strip-park-icon { display: none; }
}

/* ---- The call guide's owner report tabs (t3a, t9, t15) ---- */
/* These links share the open-call tab shape without taking part in the open-call count. */
.cg-log-tab, .cg-vm-tab {
  display: flex;
  flex: 0 1 280px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.cg-log-tab:hover, .cg-vm-tab:hover { background: var(--surface); }
.cg-log-tab.active, .cg-vm-tab.active { background: var(--surface); color: var(--heading); margin-bottom: -1px; padding-bottom: 7px; }
.cg-log-tab .icon, .cg-vm-tab .icon { flex: none; width: 18px; height: 18px; }

.phone-log { min-width: 0; }
.phone-log-title { margin: 0 0 10px; color: var(--muted); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.phone-log-pilot {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.phone-log-stat { display: grid; gap: 2px; padding: 12px 14px; border-left: 1px solid var(--line); }
.phone-log-stat:first-child { border-left: 0; }
.phone-log-stat strong { color: var(--heading); font-size: 1.5rem; line-height: 1.1; }
.phone-log-stat span { color: var(--muted); font-size: 0.8125rem; }
.phone-log-table-wrap { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.phone-log-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.phone-log-table th, .phone-log-table td { box-sizing: border-box; }
.phone-log-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}
.phone-log-table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.phone-log-table tbody tr:first-child td { border-top: 0; }
.phone-log-table th:nth-child(1), .phone-log-table td:nth-child(1) { width: 17%; white-space: nowrap; color: var(--muted); }
.phone-log-table th:nth-child(2), .phone-log-table td:nth-child(2) { width: 18%; }
.phone-log-table th:nth-child(3), .phone-log-table td:nth-child(3) { width: 16%; }
.phone-log-table th:nth-child(4), .phone-log-table td:nth-child(4) { width: 21%; }
.phone-log-table th:nth-child(5), .phone-log-table td:nth-child(5) { width: 9%; white-space: nowrap; }
.phone-log-table th:nth-child(6), .phone-log-table td:nth-child(6) { width: 9%; white-space: nowrap; }
.phone-log-table th:nth-child(7), .phone-log-table td:nth-child(7) { width: 10%; text-align: right; white-space: nowrap; }
.phone-log-table td:nth-child(6) .phone-log-chip { white-space: nowrap; }
.phone-log-caller { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.phone-log-caller strong, .phone-log-call-link { color: var(--heading); font-weight: 700; overflow-wrap: anywhere; }
.phone-log-call-link { text-decoration: underline; text-decoration-color: var(--line-strong); }
.phone-log-number { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.phone-log-chip {
  display: inline-block;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}
.phone-log-chip.ok { background: var(--ok-soft); color: var(--ok); }
.phone-log-chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.phone-log-chip.danger { background: var(--danger-soft); color: var(--danger); }
.phone-log-outage { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; min-width: 0; }
.phone-log-outage-tag {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: normal;
}
/* The attention left edge on a missed outage row: on the row's leading cell at desktop widths,
   where a table row can't show it, and on the whole card where the table stacks. */
.phone-log-row.phone-log-missed td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.phone-log-play {
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.phone-log-play:hover { background: var(--surface-2); }
.phone-log-play-wrap { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.phone-log-play-wrap audio { display: none; }
.phone-log-play-error { max-width: 180px; color: var(--danger); font-size: 0.75rem; }
.phone-log-no-recording { color: var(--muted); font-size: 0.8125rem; }
.phone-log-result { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.phone-log-transcript-state { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.phone-log-transcript-state.pending::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%; /* true circle */
  background: var(--accent);
}
.phone-log-transcript-state.danger { color: var(--danger); }
.phone-log-summary-toggle {
  align-self: flex-start;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
}
.phone-log-table tr.phone-log-detail td { width: auto; padding: 16px; background: var(--surface-2); white-space: normal; color: var(--text); }
.phone-log-detail-title { margin: 0 0 4px; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.phone-log-summary { max-width: 72ch; margin: 0 0 12px; overflow-wrap: anywhere; }
.phone-log-transcript { max-width: 72ch; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.phone-log-transcript summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.phone-log-transcript-text { margin: 10px 0 0; max-height: 50vh; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.phone-log-ai-lines { max-width: 72ch; max-height: 50vh; margin: 0; padding: 10px 12px; overflow-y: auto; list-style: none; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.phone-log-ai-line { padding: 6px 0; }
.phone-log-ai-line + .phone-log-ai-line { border-top: 1px solid var(--line); }
.phone-log-ai-line-who { font-weight: 700; }
.phone-log-ai-line.ai .phone-log-ai-line-who { color: var(--accent); }
.phone-log-ai-line-meta { margin-left: 8px; color: var(--muted); }
.phone-log-ai-line-words { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.phone-log-chart { max-width: 72ch; margin-top: 12px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.phone-log-chart-title { display: block; margin: 0 0 8px; font-weight: 700; }
.phone-log-chart-text { box-sizing: border-box; width: 100%; min-height: 96px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; resize: vertical; }
.phone-log-chart-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.phone-log-chart-count { color: var(--muted); font-size: 0.8125rem; }
.phone-log-chart-count.danger, .phone-log-chart-error { color: var(--danger); }
.phone-log-chart-error { margin: 8px 0 0; }
.phone-log-chart-hint { margin: 8px 0 0; font-size: 0.8125rem; }
.phone-log-chart-added { margin: 12px 0 0; color: var(--ok, inherit); font-weight: 600; }
.phone-log-chart-added.muted { color: var(--muted); font-weight: 400; }
.phone-log-empty { color: var(--muted); }
.phone-log-more { margin: 14px 0 0; }

@media (max-width: 860px) {
  .cg-log-tab, .cg-vm-tab { flex: 1 0 160px; max-width: 280px; gap: 8px; padding: 6px 10px; }
  .phone-log-pilot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-log-stat { border-top: 1px solid var(--line); }
  .phone-log-stat:nth-child(odd) { border-left: 0; }
  .phone-log-stat:nth-child(-n + 2) { border-top: 0; }
}

@media (max-width: 640px) {
  .phone-log-folds { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  .phone-log-folds .kit-fold-head { padding: 6px 14px; }
  .phone-log-folds .kit-row { padding: 2px 14px; min-height: 44px; }
  .phone-log-folds .kit-more { padding: 6px 14px; }
  .phone-log-short { min-width: 0; }
  .phone-log-short-top { color: var(--heading); font-size: round(nearest, calc(14px * var(--font-scale)), 1px); line-height: 1.2; }
  .phone-log-short-time, .phone-log-short-sep { color: var(--muted); font-weight: 400; }
  .phone-log-short-name { color: var(--heading); font-weight: 700; }
  .phone-log-short-bottom { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px; margin-top: 1px; min-width: 0; overflow: hidden; font-size: round(nearest, calc(12px * var(--font-scale)), 1px); line-height: 1.25; }
  .phone-log-short-bottom .phone-log-chip,
  .phone-log-short-bottom .phone-log-outage-tag { padding: 1px 7px; font-size: round(nearest, calc(12px * var(--font-scale)), 1px); line-height: 1.3; }
  .phone-log-short-bottom .phone-log-chip { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .phone-log-short-bottom .phone-log-outage { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; align-items: center; gap: 4px; }
  .phone-log-short-bottom .phone-log-outage-tag { flex: none; white-space: nowrap; }
  .phone-log-short-bottom .phone-log-transcript-state { flex: none; font-size: round(nearest, calc(12px * var(--font-scale)), 1px); line-height: 1.25; white-space: nowrap; }
  .phone-log-short-length { flex: none; color: var(--muted); font-size: round(nearest, calc(12px * var(--font-scale)), 1px); line-height: 1.25; white-space: nowrap; }
  .phone-log-row.phone-log-missed,
  .phone-log-row.phone-log-missed > .kit-row { box-shadow: inset 3px 0 0 var(--danger); }
  .phone-log-details-pane .kit-detail-body { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
  .phone-log-detail-fields { margin: 0; display: grid; gap: 0; }
  .phone-log-detail-row { display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); align-items: center; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
  .phone-log-detail-row:first-child { border-top: 0; }
  .phone-log-detail-row dt { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
  .phone-log-detail-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .phone-log-detail-fields .phone-log-play-wrap { align-items: flex-start; }
  .phone-log-detail-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .phone-log-detail-toggles .phone-log-summary-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 0; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface); color: var(--heading); font-size: 0.9375rem; }
  .phone-log-details .phone-log-detail { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
  .phone-log-details .phone-log-play { min-height: 44px; padding: 6px 14px; }
  .phone-log-details .phone-log-transcript summary { display: flex; align-items: center; min-height: 44px; }
  .phone-log-details .phone-log-chart-text { font-size: max(16px, 1em); }
  .phone-log-phone .phone-log-more { margin-top: 8px; }
  .phone-log-phone .phone-log-more .btn { min-height: 44px; }
}
.phones-recording-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-weight: 650;
}

/* The owner's By source counts (web/js/views/call-sources.js). At 640 px and under each source is
   one block with every number labelled, and 7 / 30 / 90 stay one row of three. */
.phone-sources h2 { margin: 0 0 6px; }
.phone-sources-picks { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.phone-sources-dates { margin: 0 0 14px; color: var(--heading); }
.phone-sources-dates .cg-muted { margin-left: 8px; font-size: 0.8125rem; }
.phone-sources-subhead { margin: 18px 0 8px; color: var(--heading); font-size: 1rem; }
.phone-sources-empty { color: var(--muted); }
.phone-sources-error { color: var(--danger); }
.phone-sources-error .btn { margin-left: 8px; }
.phone-sources-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.phone-sources-table thead th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
  vertical-align: bottom;
}
.phone-sources-table thead th:first-child { width: 20%; text-align: left; }
.phone-sources-table td, .phone-sources-table tbody th, .phone-sources-table tfoot th {
  padding: 12px 8px;
  border-top: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.phone-sources-name { color: var(--heading); font-weight: 700; text-align: left !important; overflow-wrap: anywhere; }
.phone-sources-row.twilio th, .phone-sources-row.twilio td { font-style: italic; }
.phone-sources-row.total th, .phone-sources-row.total td { border-top: 2px solid var(--line-strong); color: var(--heading); font-weight: 700; }
.phone-sources-foot { margin: 14px 0 0; color: var(--muted); font-size: 0.8125rem; }

/* The owner's By source bars (t3b-source-bars): the legend and one stacked bar per source above
   the numbers. The four fills are this widget's own, one set for light and one for dark, so the
   owner's accent choice cannot rewrite them; the table below carries every number, so colour is
   never the only cue. At 640 px and under the name line holds the Calls and Texts in above its
   bar. */
.phone-source-bars {
  --phone-source-answered: #405ec9;
  --phone-source-went-on: #93a8ff;
  --phone-source-hung-up: #5f646e;
  --phone-source-outage: #b8791b;
  margin: 16px 0 4px;
}
@media (prefers-color-scheme: dark) {
  .phone-source-bars {
    --phone-source-answered: #7f95ff;
    --phone-source-went-on: #c9d3ff;
    --phone-source-hung-up: #9096a1;
    --phone-source-outage: #e2b35a;
  }
}
.phone-source-bars-head,
.phone-source-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 24%) minmax(0, 1fr) 56px 72px;
  align-items: center;
  column-gap: 14px;
}
.phone-source-bars-head { align-items: end; padding-bottom: 8px; }
.phone-source-legend {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  grid-column: 1 / 3;
  align-items: center;
  gap: 6px 16px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.phone-source-legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.phone-source-legend-swatch { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; }
.phone-source-bars-head-calls,
.phone-source-bars-head-texts {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}
.phone-source-bar-row { padding: 8px 0; }
.phone-source-bar-name { color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.phone-source-bar-track {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  height: 10px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  overflow: hidden;
}
.phone-source-bar-part { flex: none; height: 100%; }
.phone-source-bar-track:has(.phone-source-bar-texts-only) { height: 16px; }
.phone-source-bar-part.part-answered,
.phone-source-legend-swatch.part-answered { background: var(--phone-source-answered); }
.phone-source-bar-part.part-went_on,
.phone-source-legend-swatch.part-went_on { background: var(--phone-source-went-on); }
.phone-source-bar-part.part-hung_up_ringing,
.phone-source-legend-swatch.part-hung_up_ringing { background: var(--phone-source-hung-up); }
.phone-source-bar-part.part-outage,
.phone-source-legend-swatch.part-outage { background: var(--phone-source-outage); }
@media (forced-colors: active) {
  .phone-source-bar-part,
  .phone-source-legend-swatch { forced-color-adjust: none; }
  .phone-source-bar-track,
  .phone-source-legend-swatch { box-sizing: border-box; border: 1px solid CanvasText; }
}
.phone-source-bar-calls,
.phone-source-bar-texts {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.phone-source-bar-calls b,
.phone-source-bar-texts b { font-weight: 600; }
.phone-source-bar-calls small,
.phone-source-bar-texts small { display: none; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.phone-source-bar-texts-only {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .phone-sources-picks { display: grid; gap: 10px; }
  .phone-sources-picks .segmented { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; width: 100%; }
  .phone-sources-table, .phone-sources-table tbody, .phone-sources-table tfoot { display: block; width: 100%; }
  .phone-sources-table thead { display: none; }
  .phone-sources-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    margin: 0 0 12px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
  }
  .phone-sources-table tbody th, .phone-sources-table tfoot th { grid-column: 1 / -1; padding: 8px 0; border-top: 0; }
  .phone-sources-table td { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 0; min-width: 0; }
  .phone-sources-table td::before { content: attr(data-label); color: var(--muted); text-align: left; font-size: 0.8125rem; }
  .phone-sources-row.total td { border-top: 0; }
  .phone-source-bars { margin-top: 14px; }
  .phone-source-bars-head { display: block; padding: 0; }
  .phone-source-legend { gap: 4px 12px; margin-bottom: 4px; font-size: 0.75rem; }
  .phone-source-bars-head-calls,
  .phone-source-bars-head-texts { display: none; }
  .phone-source-bar-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name calls texts" "track track track";
    column-gap: 10px;
    row-gap: 6px;
    padding: 9px 0;
  }
  .phone-source-bar-name { grid-area: name; }
  .phone-source-bar-calls { grid-area: calls; }
  .phone-source-bar-texts { grid-area: texts; }
  .phone-source-bar-track { grid-area: track; height: 8px; }
  .phone-source-bar-track:has(.phone-source-bar-texts-only) { height: 14px; }
  .phone-source-bar-calls small,
  .phone-source-bar-texts small { display: inline; }
  .phone-source-bar-texts-only { font-size: 0.625rem; }
}
/* The office's voicemail box (t3-voicemail-box): Call guide › Voicemail, cards with a big Play. */
.vm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.vm-title { margin: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.vm-filter { display: inline-flex; gap: 6px; }
.vm-filter .btn { min-height: 44px; min-width: 64px; }
.vm-filter .btn.active { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.vm-list { display: grid; gap: 12px; }
.vm-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.vm-card.new { border: 2px solid var(--brand); padding: 15px; }
.vm-player { display: grid; align-content: start; gap: 10px; }
.vm-player audio { display: none; }
.vm-play { min-height: 56px; width: 100%; font-size: 1.0625rem; font-weight: 700; }
.vm-seek-row { display: flex; align-items: center; gap: 10px; }
.vm-seek { flex: 1; min-width: 0; min-height: 24px; accent-color: var(--brand); }
.vm-time { flex: none; color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.vm-no-audio { color: var(--muted); font-size: 0.8125rem; }
.vm-error { color: var(--danger); font-size: 0.75rem; }
.vm-body { min-width: 0; }
.vm-body p { margin: 8px 0 0; }
.vm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vm-chip { display: inline-block; padding: 3px 10px; border-radius: var(--radius-control); background: var(--surface-2); color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.vm-chip.new { background: var(--brand); color: #fff; }
.vm-chip.ok { background: var(--ok-soft); color: var(--ok); }
.vm-chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.vm-number { color: var(--heading); font-size: 1rem; }
.vm-when { color: var(--muted); font-size: 0.8125rem; }
.vm-outage { color: var(--warn-ink); font-size: 0.8125rem; font-weight: 700; }
.vm-words { color: var(--heading); overflow-wrap: anywhere; white-space: pre-line; }
.vm-words-note { color: var(--muted); font-style: italic; }
.vm-mark { min-height: 44px; }
.vm-called-back { font-size: 0.875rem; }
.vm-ok { color: var(--ok); font-weight: 700; }
.vm-undo { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; }
.vm-empty { color: var(--muted); }
.vm-more { margin: 14px 0 0; }
.vm-more .btn { min-height: 44px; }

@media (max-width: 640px) {
  .vm-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .vm-player { grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr); align-items: center; }
  .vm-player .vm-error, .vm-player .vm-no-audio { grid-column: 1 / -1; }
}

/* The strip's Transfer sheet (t8-transfer-now): a panel on the right on a wide screen, a sheet
   from the bottom on a phone. Each row is a name, never a number; Send now is at least 44 px. */
.phone-move-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: var(--scrim);
}
.phone-move {
  display: flex;
  flex-direction: column;
  width: 440px;
  max-width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
  color: var(--text);
}
.phone-move:focus-visible { outline: none; }
.phone-move-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.phone-move-who {
  color: var(--heading);
  font-size: 1.125rem;
  font-weight: 750;
}
.phone-move-number { color: var(--muted); }
.phone-move-close {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  align-self: center;
}
.phone-move-hint {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 0.9375rem;
}
.phone-move-error {
  margin: 8px 0;
  color: var(--danger);
  font-weight: 650;
}
.phone-move-list {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.phone-move-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.phone-move-row:last-child { border-bottom: 0; }
.phone-move-row-off { opacity: 0.55; }
.phone-move-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%; /* true circle */
  background: var(--surface-2);
}
.phone-move-icon .icon { width: 18px; height: 18px; }
.phone-move-name {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}
.phone-move-name strong { color: var(--heading); }
.phone-move-name span {
  color: var(--muted);
  font-size: 0.875rem;
}
.phone-move-buttons {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.phone-move-send,
.phone-move-add,
.phone-move-talk {
  flex: none;
  min-height: 44px;
  padding: 6px 14px;
}
.phone-move-talk {
  border: 1px solid var(--line-strong);
  font-weight: 600;
}
.phone-move-foot {
  position: sticky;
  bottom: 0;
  margin: 0 -18px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.phone-move-voicemail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
}
.phone-move-voicemail .icon { width: 18px; height: 18px; }

@media (max-width: 640px) {
  .phone-move-overlay { align-items: flex-end; }
  .phone-move {
    width: 100%;
    height: auto;
    max-height: calc(100% - 44px);
    border-left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }
}
/* The owner's Texting tile on the Phone service board and wide Texting sheet (t7-phones-texting),
   holding today's Texting card body (t7-texting-panel, t8-carry-stops, t14-texting-table-fits):
   up to 960 px wide on a computer so all six columns sit inside the sheet with no inside scroll,
   and the kit's bottom sheet on a phone where the table scrolls sideways inside its own box. */
@media (min-width: 861px) {
  .dialog.settings-sheet.phone-texting-sheet {
    max-width: 960px;
  }
}

.settings-sheet.phone-texting-sheet .settings-sheet-body,
.settings-sheet.phone-texting-sheet .phones-texting-body {
  min-width: 0;
}

.settings-sheet.phone-texting-sheet :is(button, .phones-texting-test-input) {
  min-height: 44px;
}

@media (max-width: 860px), (pointer: coarse) {
  .settings-sheet.phone-texting-sheet .phones-texting-test-input {
    font-size: max(16px, round(nearest, calc(14px * var(--font-scale)), 1px));
  }
}

.settings-tile.phone-texting-tile .phones-texting-backup,
.settings-tile.phone-texting-tile .phones-texting-off {
  margin: 8px 0 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.35;
}

.settings-tile.phone-texting-tile .phones-texting-waiting {
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-tile.phone-texting-tile .phones-texting-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.settings-tile.phone-texting-tile .phone-texting-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.settings-tile.phone-texting-tile .phone-texting-office-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-tile.phone-texting-tile .phones-texting-error,
.settings-tile.phone-texting-tile .phones-texting-test-status,
.settings-tile.phone-texting-tile .phone-texting-tile-needs {
  margin: 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.35;
}

.settings-tile.phone-texting-tile .phones-texting-needs {
  margin: 2px 0 0;
}

.settings-tile.phone-texting-tile .phone-texting-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.phones-owner-only {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8125rem;
}
.phones-texting-waiting {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

.phones-texting-waiting > span:not(.phones-texting-waiting-mark) {
  min-width: 0;
}
.phones-texting-waiting-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 2px solid currentColor;
  border-radius: 50%; /* true circle */
  font-weight: 800;
  line-height: 1;
}
.phones-texting-link {
  color: var(--link, #2f5fbf);
  font-weight: 700;
  text-decoration: underline;
}
.phones-texting-off {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 650;
}
.phones-texting-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* The columns past the edge are only a swipe away, so the sheet says so while the table
   overflows its box (the script adds the line only then). */
.phones-texting-swipe {
  margin: 0 0 8px;
  font-size: 13px;
}
.phones-texting-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}
.phones-texting-table th,
.phones-texting-table td {
  padding: 12px 10px 12px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.phones-texting-table td {
  font-size: 0.75rem;
}
.phones-texting-table th {
  padding-bottom: 10px;
  border-top: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.phones-texting-table th:nth-child(1) { width: 11%; }
.phones-texting-table th:nth-child(2) { width: 16%; }
.phones-texting-table th:nth-child(3) { width: 13%; }
.phones-texting-table th:nth-child(4) { width: 16%; }
.phones-texting-table th:nth-child(5) { width: 24%; }
.phones-texting-table th:nth-child(6) { width: 20%; }
.phones-texting-office strong { display: block; color: var(--heading); font-size: 1rem; }
.phones-texting-mode {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.phones-texting-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.phones-texting-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 50%; /* true circle */
  color: transparent;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}
.phones-texting-mark.done { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.phones-texting-mark.moved { border-color: var(--warn); background: var(--warn-soft); color: var(--warn-ink); }
.phones-texting-mark.failed { border-color: var(--danger); background: var(--danger-soft, var(--warn-soft)); color: var(--danger); }
.phones-texting-state { color: var(--heading); font-weight: 650; }
/* A Telnyx setup error or a delivery reason can run to hundreds of words, so it gets three
   lines and a scrollbar: the whole reason stays readable inside the cell, and a long one can't
   stretch the whole row. */
.phones-texting-error {
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 650;
  overflow-wrap: anywhere;
  max-height: 4.5em;
  overflow-y: auto;
}
.phones-texting-number { color: var(--heading); font-weight: 650; }
.phones-texting-missing { color: var(--muted); }
.phones-texting-service-badge { white-space: normal; }
.phones-texting-mode-note { margin-top: 16px; }
.phones-texting-carryover-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.phones-texting-carryover-line .phones-texting-mark { flex: none; }
.phones-texting-link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}
.phones-texting-link-btn:disabled { cursor: default; opacity: 0.65; }
.phones-texting-carryover-go { white-space: normal; text-align: left; }

.phones-texting-service-badge.on { background: var(--ok-soft); color: var(--ok); }
.phones-texting-since { color: var(--muted); }
.phones-texting-needs {
  margin: 0;
  padding-left: 18px;
  color: var(--warn-ink);
  font-weight: 650;
}
.phones-texting-needs li { margin: 2px 0; }
.phones-texting-switch { white-space: normal; text-align: left; }
.phones-texting-test-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.phones-texting-test-line .phones-texting-mark { flex: none; }
.phones-texting-test-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 190px;
}
.phones-texting-test-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--heading);
  font: inherit;
}
.phones-texting-test-go { white-space: normal; text-align: center; }
.phones-texting-readout-wrap { margin-top: 20px; }
.phones-texting-readout-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.phones-texting-readout-head { margin: 0 0 10px; font-size: 1.05rem; }
.phones-texting-readout {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
}
.phones-texting-readout th,
.phones-texting-readout td {
  padding: 12px 12px 12px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.phones-texting-readout th {
  border-top: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.phones-texting-readout th:nth-child(1) { width: 24%; }
.phones-texting-readout th:nth-child(2),
.phones-texting-readout th:nth-child(3),
.phones-texting-readout th:nth-child(4) { width: 11%; }
.phones-texting-readout th:nth-child(5) { width: 25%; }
.phones-texting-readout th:nth-child(6) { width: 18%; }
.phones-texting-readout-note { color: var(--muted); }
.phones-texting-readout-failed { color: var(--danger); font-weight: 750; }
.phones-texting-readout-reason { display: block; color: var(--muted); font-weight: 500; }
.phones-texting-last4 { color: var(--muted); font-size: 0.8125rem; }

/* Website tracking (t1-tracking-card): one block per office with its mode, site addresses,
   the number the site shows, Save and the one script line with Copy. The page's other cards'
   field, button and grid pieces are reused; these keep the long script line inside the card
   and every control a fingertip tall. */

.phones-tracking-addresses {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.phones-tracking-addresses legend {
  padding: 0;
  color: var(--heading);
  font-weight: 600;
}

.phones-tracking-addresses .phones-field-hint {
  margin-top: 5px;
}

.phones-tracking-origin + .phones-tracking-origin {
  margin-top: 8px;
}

.phones-tracking-mode,
.phones-tracking-origin,
.phones-tracking-swap,
.phones-tracking-hold,
.phones-tracking-pool-for,
.phones-tracking-copy {
  min-height: 44px;
}

.phones-tracking-pool {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.phones-tracking-pool legend {
  padding: 0;
  color: var(--heading);
  font-weight: 600;
}

.phones-tracking-pool .phones-field-hint {
  margin-top: 5px;
}

.phones-tracking-pool-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  margin-top: 6px;
}

.phones-tracking-pool-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.phone-office-settings .phones-field .phones-tracking-pool-check {
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
}

.phones-tracking-rules {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.phones-tracking-live-reason {
  color: var(--muted);
}

.phones-tracking-live-empty {
  color: var(--danger, #b42318);
}

.phones-tracking-visits {
  margin: 4px 0 0;
  font-size: 13px;
}

.phones-tracking-leads-from {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 12px 0;
}

.phones-tracking-leads-switch {
  min-height: 44px;
}

.phones-tracking-beside-note {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

/* The lead-source row sits between Visits and Mode and supplies the field spacing itself. */

.phones-tracking-script-hint {
  overflow-wrap: anywhere;
}

.phones-tracking-match {
  margin: 12px 0 0;
}

.phones-tracking-match-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.phones-tracking-office .error,
.phones-tracking-office .phones-not-saved {
  margin-top: 12px;
}

/* Website tracking tiles on the Phone service board and sheet (t10-phones-tracking). */
.settings-tile.phone-tracking-tile .phone-tile-lines {
  min-width: 0;
  margin-top: 2px;
  padding-top: 4px;
  gap: 3px;
}

.settings-tile.phone-tracking-tile .phones-tracking-retry {
  min-height: 44px;
  margin-top: 8px;
}

.settings-tile.phone-tracking-tile .phones-tracking-mode-line,
.settings-tile.phone-tracking-tile .phones-tracking-key-line {
  min-width: 0;
}

.settings-tile.phone-tracking-tile .phones-tracking-mode-line .phone-tile-line-value,
.settings-tile.phone-tracking-tile .phones-tracking-key-line .phone-tile-line-value {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.settings-tile.phone-tracking-tile .phones-tracking-visits,
.settings-tile.phone-tracking-tile .phones-tracking-forms,
.settings-tile.phone-tracking-tile .phones-tracking-calls {
  min-width: 0;
  margin: 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.settings-tile.phone-tracking-tile .phones-tracking-leads-from {
  min-width: 0;
  margin: 2px 0 0;
  gap: 4px 10px;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
}

.settings-tile.phone-tracking-tile .phones-tracking-leads-from span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-tile.phone-tracking-tile .phones-tracking-leads-switch {
  max-width: 100%;
}

.settings-tile.phone-tracking-tile .phones-tracking-beside-note {
  min-width: 0;
  margin: 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.settings-tile.phone-tracking-tile .error,
.settings-tile.phone-tracking-tile .phones-tracking-google-result {
  min-width: 0;
  margin: 2px 0 0;
  font-size: round(nearest, calc(12px * var(--font-scale)), 1px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.phones-tracking-tile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  min-width: 0;
  margin-top: 6px;
}

.phones-tracking-tile-actions .phones-tracking-match-link {
  padding-inline: 0;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.phones-tracking-tile-actions .phones-tracking-change {
  margin-left: auto;
}

.settings-sheet.phone-tracking-sheet > h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-sheet.phone-tracking-sheet .phones-tracking-sheet-body,
.settings-sheet.phone-tracking-sheet .phones-tracking-office {
  min-width: 0;
}

.settings-sheet.phone-tracking-sheet .phones-tracking-office {
  padding-top: 0;
}

.settings-sheet.phone-tracking-sheet :is(.phones-tracking-mode, .phones-tracking-pool-for) {
  min-width: 0;
  max-width: 100%;
}

.settings-sheet.phone-tracking-sheet .error {
  min-width: 0;
  overflow-wrap: anywhere;
}

.settings-sheet.phone-tracking-sheet :is(.phones-tracking-save, .phones-try-again, .phones-tracking-copy, .phones-tracking-google-key-save, .phones-tracking-google-key-clear, .phones-tracking-google-save, .phones-tracking-google-check) {
  min-height: 44px;
}

.settings-sheet.phone-tracking-sheet .phones-tracking-google-key-input {
  width: 100%;
  box-sizing: border-box;
}

.settings-sheet.phone-tracking-sheet .phones-tracking-script code {
  flex: 1 1 180px;
  max-width: 100%;
}

.settings-sheet.phone-tracking-sheet .phones-tracking-google-sends {
  font-size: round(nearest, calc(13px * var(--font-scale)), 1px);
}

.phones-tracking-script {
  min-width: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.phones-tracking-script-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.phones-tracking-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  margin-top: 8px;
}

.phones-tracking-script code {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.phones-tracking-copy {
  flex: none;
}

/* Google Ads on Website tracking (t7-google-setup): the key's status and paste box, the account
   and action ids, the minimum call length, Send and Check connection. A long Google error has to
   wrap inside the card rather than widen it. */

.phones-tracking-google {
  min-width: 0;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.phones-tracking-google-title {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 1em;
  font-weight: 600;
}

.phones-tracking-google-key {
  min-width: 0;
  margin: 0 0 10px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.phones-tracking-google-keybox .phones-tracking-google-key-input {
  min-height: 44px;
  resize: vertical;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
}

.phones-tracking-google-key-actions,
.phones-tracking-google-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.phones-tracking-google-account,
.phones-tracking-google-action,
.phones-tracking-google-wc-action,
.phones-tracking-google-completed-action,
.phones-tracking-google-min,
.phones-tracking-google-key-save,
.phones-tracking-google-key-clear,
.phones-tracking-google-save,
.phones-tracking-google-check {
  min-height: 44px;
}

.phones-tracking-google-send,
.phones-tracking-google-send-forms {
  min-height: 44px;
  margin-top: 10px;
}

.phones-tracking-google-completed {
  margin-top: 14px;
}

.phones-tracking-google-completed-label {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-weight: 600;
}

.phones-tracking-google-completed-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phones-tracking-google-completed-choice {
  flex: 1 1 120px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.phones-tracking-google-completed-choice.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.phones-tracking-google-completed-choice:disabled {
  cursor: progress;
}

.phones-tracking-google-completed-choice:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.phones-tracking-google-result {
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

.phones-tracking-google-sends {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.phones-tracking-google-result.is-ok {
  color: var(--success, #067647);
}

.phones-tracking-google-result.is-bad,
.phones-tracking-google .phones-not-saved {
  color: var(--danger, #b42318);
}

.phones-tracking-google .error,
.phones-tracking-google .phones-not-saved {
  margin-top: 12px;
}

/* AI receptionist on calls (lib/phones/ai-calls.js): one block per office. */
.ai-call-office { border: 1px solid var(--line, #e3e5ea); border-radius: 8px; padding: 12px; margin-top: 12px; display: grid; gap: 8px; min-width: 0; }
.ai-call-office h3 { margin: 0; font-size: 0.95rem; }
.ai-call-modes { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; width: 100%; }
.ai-call-testers { background: var(--surface-2, #f4f5f7); border-radius: 6px; padding: 10px; display: grid; gap: 6px; }
.ai-call-testers-head { display: flex; justify-content: space-between; gap: 8px; }
.ai-call-tester-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ai-call-tester-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ai-call-remove { color: var(--danger, #b42318); }
.ai-call-add-row { display: flex; gap: 8px; }
.ai-call-add-row input { flex: 1; min-width: 0; }
.ai-call-voice { font-weight: 600; }
.ai-call-voice-row { display: flex; align-items: center; gap: 8px; }
.ai-call-voice-row select { flex: 1; min-width: 0; }
.ai-call-voice-sample { white-space: nowrap; }
@media (max-width: 560px) {
  .ai-call-voice-row { flex-direction: column; align-items: stretch; }
  .ai-call-voice-row select { flex: none; width: 100%; }
  .ai-call-voice-sample { width: 100%; min-height: 44px; }
}
.ai-call-office audio { display: none; }
.ai-call-actions { display: flex; align-items: center; gap: 8px; }
.ai-call-office > *, .ai-call-testers > * { min-width: 0; }
.ai-call-modes button { white-space: normal; min-width: 0; }
.ai-call-add-row input { width: 100%; }
.ai-call-tester-list li span { overflow-wrap: anywhere; }
.ai-call-warning { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--warn-bg, #fdf3dc); color: var(--warn-ink, #7a5200); }
.ai-call-voice-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; column-gap: 8px; row-gap: 4px; margin: 12px 0 0; padding: 9px 12px; border-radius: 6px; }
.ai-call-voice-status.connected { background: var(--ok-soft, #e2f2e7); color: var(--ok, #2a7047); }
.ai-call-voice-status.warning { background: var(--warn-soft, #fdf3dc); color: var(--warn-ink, #7a5200); }
.ai-call-voice-mark { grid-column: 1; font-weight: 700; line-height: 1.4; }
.ai-call-voice-text { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
.ai-call-voice-change { grid-column: 3; justify-self: end; }
.ai-call-voice-status a { color: inherit; font-weight: 600; }
@media (max-width: 600px) {
  .ai-call-voice-status { grid-template-columns: auto minmax(0, 1fr); }
  .ai-call-voice-change { grid-column: 2; grid-row: 2; justify-self: start; }
}

/* The AI receptionist tile on the Phone service board (t8-phones-ai-tile): the voice line and
   one line per office in the kit's tile-line look, the office's warnings in today's style under
   its line, and its Change at the line's right. */
.settings-tile.phone-ai-calls-tile .ai-call-voice-status { margin-top: 12px; }
.settings-tile.phone-ai-calls-tile .phone-tile-lines { gap: 10px; }
.settings-tile.phone-ai-calls-tile .phone-tile-line-copy { gap: 4px; }
/* The phone voice line's links keep today's words and destination with a target at least
   44 px: the Change link as a centred box, the inline one with hit-area padding. */
.settings-tile.phone-ai-calls-tile .ai-call-voice-change { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; }
.settings-tile.phone-ai-calls-tile .ai-call-voice-text a { padding: 14px 4px; margin: -14px -4px; }

/* The "AI receptionist at <Office>" sheet: today's office block, whole, without the card's
   box; controls at least 44 px and fields 16 px text on a phone. */
.settings-sheet.phone-ai-calls-sheet .ai-call-office { border: 0; border-radius: 0; padding: 0; margin: 0; }
.settings-sheet.phone-ai-calls-sheet :is(.ai-call-modes button, .ai-call-remove, .ai-call-add .btn, .ai-call-actions .btn, .ai-call-voice-sample) { min-height: 44px; }
.settings-sheet.phone-ai-calls-sheet :is(.ai-call-add-row input, .ai-call-office select) { min-height: 44px; }
@media (max-width: 860px), (pointer: coarse) {
  .settings-sheet.phone-ai-calls-sheet :is(.ai-call-add-row input, .ai-call-office select) {
    font-size: max(16px, round(nearest, calc(14px * var(--font-scale)), 1px));
  }
}
