/* Telefón screen, availability switch, onboarding, install hint and the incoming-call banner. */

/* availability: dots */
.availability-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8cdd5;
  flex: none;
  vertical-align: 0;
}

.availability-dot.softphone_then_mobile {
  background: var(--fl-success);
}

.availability-dot.softphone_only {
  background: var(--fl-secondary);
}

.availability-dot.mobile_only {
  background: var(--fl-info);
}

.availability-dot.dnd {
  background: var(--fl-danger);
}

/* availability: compact header switch */
.availability-switch.compact {
  position: relative;
}

.availability-switch.compact > summary {
  list-style: none;
}

.availability-switch.compact > summary::-webkit-details-marker {
  display: none;
}

.availability-label {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.availability-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: 300px;
  background: #fff;
  border-radius: var(--fl-radius);
  box-shadow: 0 12px 30px rgba(7, 10, 46, 0.2);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.availability-menu .menu-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.availability-menu .menu-item b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.availability-menu .menu-item.on {
  background: var(--fl-gray);
}

.availability-menu .menu-item .small {
  padding-left: 18px;
}

/* availability: big switch (Telefón, onboarding) */
.availability-switch.big {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.availability-cell {
  margin: 0;
  display: flex;
}

.availability-tile {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  align-content: start;
  text-align: left;
  min-height: 72px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--fl-light);
  background: #fff;
  font: inherit;
  color: var(--fl-dark);
  cursor: pointer;
}

.availability-tile b {
  font-size: 14px;
}

.availability-tile small {
  grid-column: 1 / -1;
  color: var(--fl-text);
  font-size: 11.5px;
  line-height: 1.35;
}

.availability-tile:hover {
  border-color: #c5cfdd;
}

.availability-tile.on {
  border-color: var(--fl-primary);
  background: #f2f4fb;
  box-shadow: inset 0 0 0 1px var(--fl-primary);
}

.dnd-tile {
  cursor: default;
}

.dnd-tile.on {
  border-color: var(--fl-danger);
  box-shadow: inset 0 0 0 1px var(--fl-danger);
  background: var(--bad-bg);
}

.dnd-options {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Telefón screen */
.phone-screen {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
}

.phone-col {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.phone-col .card {
  margin: 0;
}

.phone-card h2 {
  font-size: 16px;
}

.phone-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.phone-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--fl-light);
  border-radius: var(--fl-pill);
  padding: 4px 4px 4px 14px;
  background: #fff;
}

.phone-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 15px;
  padding: 6px 0;
  background: transparent;
  color: var(--fl-dark);
}

.phone-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.phone-results li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--fl-radius);
  background: var(--fl-zebra);
  color: var(--fl-dark);
}

.phone-results .grow,
.recent-call .grow {
  flex: 1;
  min-width: 0;
}

.phone-results-title {
  margin: 12px 0 0;
  font-weight: 600;
}

.softphone-only-note {
  margin: 8px 0 0;
}

.dial-pad {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 14px;
}

.dial-number {
  width: 100%;
  max-width: 320px;
  text-align: center;
  font: inherit;
  font-size: 24px;
  letter-spacing: 1px;
  color: var(--fl-dark);
  border: 0;
  border-bottom: 2px solid var(--fl-light);
  padding: 6px 4px;
  background: transparent;
  outline: 0;
}

.dial-number:focus {
  border-color: var(--fl-secondary);
}

.dial-keys {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 10px;
}

.dial-key {
  width: 72px;
  height: 56px;
  border-radius: 28px;
  border: 0;
  background: var(--fl-gray);
  color: var(--fl-primary);
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}

.dial-key:hover,
.dial-key:active {
  background: var(--fl-light);
}

.dial-key.erase {
  font-size: 20px;
}

.dial-call {
  min-width: 232px;
  justify-content: center;
  font-size: 15px;
  padding: 12px 24px;
}

.dial-call .ic {
  width: 18px;
  height: 18px;
}

.dial-pad .hint {
  text-align: center;
  max-width: 340px;
}

.recent-calls {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-call {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--fl-row-border);
  color: var(--fl-dark);
}

.recent-call:last-child {
  border-bottom: 0;
}

.recent-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-bg);
  color: var(--ok-fg);
  flex: none;
}

.recent-call.out .recent-icon {
  background: var(--info-bg);
  color: var(--info-fg);
}

.recent-call.missed .recent-icon {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.recent-call.missed b {
  color: var(--fl-danger);
}

/* Prebiehajúce hovory (Prehľad, Telefón): where each caller is now; a ringing phone and a taken call stand out. */
.live-step {
  font-size: 13px;
}

.live-call .recent-icon {
  background: var(--info-bg);
  color: var(--info-fg);
}

.live-call.ringing .recent-icon,
.live-call.ringing_number .recent-icon,
.live-call.taking .recent-icon {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.live-call.connected .recent-icon,
.live-call.outbound_connected .recent-icon {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.live-call .take-call {
  flex: none;
}

.push-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--fl-dark);
}

.push-status[data-push-state="on"] .push-state .availability-dot {
  background: var(--fl-success);
}

.push-status[data-push-state="denied"] .push-state .availability-dot,
.push-status[data-push-state="error"] .push-state .availability-dot {
  background: var(--fl-danger);
}

.push-actions,
.phone-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.install-hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--fl-row-border);
}

.install-hint p {
  margin: 0 0 6px;
  color: var(--fl-dark);
}

.phone-links {
  margin-top: 14px;
}

@media (min-width: 1100px) {
  .phone-screen {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
  }

  .availability-switch.big {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  /* The phone header keeps icons only, so the availability dot, profile and logout fit at 375 px. */
  .header {
    gap: 6px;
    padding: 0 8px;
  }

  .header-stack {
    gap: 4px;
  }

  .header-stack .hbtn > span:not(.availability-dot):not(.softphone-dot),
  .header-stack [data-action="shortcuts#help"],
  .header-stack .env-pill {
    display: none;
  }

  .header-stack .hbtn {
    padding: 0 9px;
  }

  .availability-label {
    display: none;
  }

  .availability-switch.compact > summary {
    padding: 0 10px;
  }

  .availability-menu {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 64px;
    width: auto;
  }

  .phone-search {
    padding-left: 10px;
  }

  .dial-keys {
    grid-template-columns: repeat(3, 76px);
  }

  .dial-key {
    width: 76px;
    height: 58px;
  }

  .phone-results li .btn {
    font-size: 12px;
  }
}

/* onboarding */
.onboarding {
  max-width: 920px;
  margin: 0 auto;
}

.onboarding-lead {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--fl-dark);
}

.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.onboarding-steps > li {
  margin: 0;
}

.onboarding h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fl-primary);
  color: #fff;
  font-size: 13px;
  flex: none;
}

.onboarding p,
.onboarding-list {
  color: var(--fl-dark);
}

.onboarding-list {
  padding-left: 18px;
  margin: 6px 0 10px;
  display: grid;
  gap: 4px;
}

.onboarding-list.plain {
  list-style: none;
  padding-left: 0;
}

.app-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.app-link {
  display: grid;
  padding: 10px 12px;
  border-radius: var(--fl-radius);
  border: 1px solid var(--fl-light);
  color: var(--fl-dark);
}

.app-link:hover {
  border-color: var(--fl-secondary);
  text-decoration: none;
}

.app-link span {
  font-size: 11.5px;
  color: var(--fl-text);
}

.sip-data {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 8px 0;
  color: var(--fl-dark);
}

.sip-data dt {
  font-weight: 600;
}

.sip-data dd {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sip-data code {
  background: var(--fl-gray);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .sip-data {
    grid-template-columns: 1fr;
  }

  .sip-data dd {
    margin-bottom: 6px;
  }
}

/* incoming-call banner */
.toast.incoming-call {
  border-color: var(--fl-secondary);
}

.toast-icon.ringing {
  animation: ring 1s ease-in-out infinite;
  color: var(--fl-success);
}

.toast.incoming-call .btn {
  margin-top: 6px;
}

@keyframes ring {
  0%,
  100% {
    transform: rotate(0);
  }

  20% {
    transform: rotate(-15deg);
  }

  40% {
    transform: rotate(15deg);
  }

  60% {
    transform: rotate(-10deg);
  }

  80% {
    transform: rotate(10deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast-icon.ringing {
    animation: none;
  }
}

/* Zmeškané: missed calls grouped by number (Telefón and Inbox) */
.missed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.missed-group {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--fl-row-border);
  color: var(--fl-dark);
  flex-wrap: wrap;
}

.missed-group:last-child {
  border-bottom: 0;
}

.missed-group > .grow {
  flex: 1 1 260px;
  min-width: 0;
}

.missed-icon {
  background: var(--bad-bg);
  color: var(--bad-fg);
}

.missed-who {
  overflow-wrap: anywhere;
}

.missed-group .muted.small {
  margin-top: 3px;
  line-height: 1.7;
}

.missed-goal {
  margin-top: 3px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.missed-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.missed-note {
  margin: 0 0 6px;
}

.phone-col .missed-actions {
  justify-content: flex-start;
}

.number-dialog {
  width: min(520px, calc(100vw - 32px));
}

.caller-number-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

body:not(:has(dialog.number-dialog)) .caller-number-actions {
  display: none;
}

@media (max-width: 640px) {
  .missed-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

.number-dialog form[hidden] {
  display: none;
}

.number-dialog .form.compact .row.end > * {
  flex: 0 0 auto;
}

/* browser softphone (WebRTC): header pill, call panel, Telefón card */
.softphone-pill .softphone-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c8cdd5;
  flex: none;
}

.softphone-pill[data-state="registered"] .softphone-dot,
.softphone-pill[data-state="in_call"] .softphone-dot {
  background: var(--fl-success);
}

.softphone-pill[data-state="connecting"] .softphone-dot,
.softphone-pill[data-state="elsewhere"] .softphone-dot {
  background: var(--fl-warning);
}

.softphone-pill[data-state="failed"] .softphone-dot,
.softphone-pill[data-state="unsupported"] .softphone-dot {
  background: var(--fl-danger);
}

.softphone-pill[data-state="in_call"] {
  color: var(--fl-dark);
  font-weight: 600;
}

:root {
  --softphone-panel-width: min(360px, calc(100vw - 32px));
}

/* Top right, under the top bar; on a wide screen the page makes room for it on the right during the call (below), so it
   covers no button; while a side panel or dialog is open beside the call it moves to the bottom left. */
.softphone-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 70;
  width: var(--softphone-panel-width);
  background: #fff;
  border-radius: var(--fl-radius);
  border-left: 4px solid var(--fl-secondary);
  box-shadow: 0 16px 40px rgba(7, 10, 46, 0.25);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  color: var(--fl-dark);
}

.softphone-panel[hidden],
.softphone-panel [hidden],
.softphone-pill[hidden],
#browser-softphone [hidden] {
  display: none;
}

.softphone-panel[data-status="active"] {
  border-color: var(--fl-success);
}

.softphone-panel[data-status="ended"] {
  border-color: var(--fl-light);
}

.softphone-panel[data-status="ringing"] .softphone-icon {
  animation: ring 1s ease-in-out infinite;
  color: var(--fl-success);
}

.softphone-warning {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--fl-radius);
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 13px;
}

.softphone-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.softphone-name {
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.softphone-timer {
  font-size: 14px;
  color: var(--fl-dark);
}

.softphone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.softphone-actions .btn[aria-pressed="true"] {
  background: var(--fl-primary);
  color: #fff;
}

.btn.softphone-answer {
  background: var(--fl-success);
  border-color: var(--fl-success);
  color: var(--fl-primary);
}

.softphone-pill {
  white-space: nowrap;
  flex: none;
}

.softphone-keypad {
  grid-template-columns: repeat(3, 64px);
  justify-content: center;
}

.softphone-keypad .dial-key {
  width: 64px;
  height: 48px;
  font-size: 20px;
}

.softphone-transfer:not([hidden]) {
  display: block;
  max-height: 50vh;
  overflow-y: auto;
}

.softphone-state {
  padding: 2px 10px;
  border-radius: var(--fl-pill);
  background: var(--fl-gray);
  color: var(--fl-dark);
}

[data-state="registered"] > .phone-card-head .softphone-state {
  background: var(--success-bg, #eef6dc);
}

[data-state="failed"] > .phone-card-head .softphone-state,
[data-state="unsupported"] > .phone-card-head .softphone-state {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.softphone-error:empty {
  display: none;
}

.softphone-error {
  color: var(--fl-danger);
  margin: 6px 0 0;
}

.softphone-devices {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.softphone-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-weight: 400;
  color: var(--fl-dark);
}

.softphone-row[hidden] {
  display: none;
}

.softphone-row > span:first-child {
  font-weight: 600;
}

.softphone-row select {
  max-width: 100%;
}

.softphone-test {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fl-row-border);
}

.softphone-test h3 {
  margin: 0;
  font-size: 14px;
}

.softphone-test p {
  margin: 0;
}

.softphone-test-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.softphone-level {
  width: 160px;
  max-width: 100%;
  height: 10px;
}

.softphone-result:empty {
  display: none;
}

.softphone-result[data-tone] {
  padding: 8px 10px;
  border-radius: var(--fl-radius);
  font-size: 13px;
}

.softphone-result[data-tone="ok"] {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.softphone-result[data-tone="warning"] {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.dial-pad .dial-call + .dial-call {
  margin-top: -2px;
}

/* Windows dragged by their handle (floating_controller.js): the call panel by its head, the live-call toast by its
   title. Once moved (data-placed) the controller keeps them at that spot; on a phone the layout above stays. */
@media (min-width: 641px) {
  [data-floating-target~="handle"] {
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  .dragging,
  .dragging [data-floating-target~="handle"] {
    cursor: grabbing;
    user-select: none;
  }

  .toasts > .toast[data-placed] {
    position: fixed;
    width: min(360px, calc(100vw - 32px));
  }
}

/* While the call panel sits in its corner, the toasts (the live call with its transfer controls) stay clear of it: to
   its left where the screen has room for both, otherwise between it and the bottom edge, scrolling. */
@media (min-width: 780px) {
  body:has(.softphone-panel:not([hidden], [data-placed])):not(:has(dialog.beside-call[open])) .toasts {
    right: calc(var(--softphone-panel-width) + 28px);
  }
}

/* A call in the browser works: the "Priprav telefón" pop-up waits until it is over instead of covering the toasts. */
body:has(.softphone-panel:not([hidden])) .phone-ready.popup {
  display: none;
}

@media (min-width: 641px) and (max-width: 779px) {
  body:has(.softphone-panel:not([hidden], [data-placed])):not(:has(dialog.beside-call[open])) .toasts {
    max-height: calc(100dvh - 88px - var(--softphone-sheet, 240px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.live-call-title {
  display: block;
}

/* Collapsed ("–" in its head): one line with the caller, the time and Hang up; a ringing call always shows in full. */
.softphone-collapse {
  flex: none;
  margin: -2px -4px 0 0;
}

.softphone-panel[data-status="ringing"] .softphone-collapse {
  display: none;
}

.softphone-panel[data-collapsed]:not([data-status="ringing"]) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.softphone-panel[data-collapsed]:not([data-status="ringing"])
  > :not(.softphone-head, .softphone-actions, .softphone-warning),
.softphone-panel[data-collapsed]:not([data-status="ringing"])
  .softphone-actions
  > :not([data-softphone-target="hangup"]),
.softphone-panel[data-collapsed]:not([data-status="ringing"]) .softphone-head b,
.softphone-panel[data-collapsed]:not([data-status="ringing"])
  .softphone-name:not(:empty)
  + [data-softphone-target="number"] {
  display: none;
}

.softphone-panel[data-collapsed]:not([data-status="ringing"]) .softphone-head {
  align-items: center;
  min-width: 0;
}

.softphone-panel[data-collapsed]:not([data-status="ringing"]) .softphone-head .grow {
  min-width: 0;
}

.softphone-panel[data-collapsed]:not([data-status="ringing"]) :is(.softphone-name, [data-softphone-target="number"]) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.softphone-panel[data-collapsed]:not([data-status="ringing"]) .softphone-warning {
  grid-column: 1 / -1;
}

/* Away from a phone's bottom sheet, the line widens for a long name instead of cutting it short. */
@media (min-width: 641px) {
  .softphone-panel[data-collapsed]:not([data-status="ringing"]) {
    width: max-content;
    min-width: var(--softphone-panel-width);
    max-width: min(480px, calc(100vw - 32px));
  }
}

@media (max-width: 640px) {
  .softphone-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    border-radius: 14px 14px 0 0;
    border-left: 0;
    border-top: 4px solid var(--fl-secondary);
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .softphone-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Toasts (live call with the transfer controls) sit above the call sheet and scroll, instead of hiding behind it. */
  body:has(.softphone-panel:not([hidden])) .toasts {
    bottom: calc(var(--softphone-sheet, 240px) + 8px);
    max-height: calc(100dvh - var(--softphone-sheet, 240px) - 88px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .softphone-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .softphone-panel[data-status="ringing"] .softphone-icon {
    animation: none;
  }
}

/* During a call dialogs open beside the call panel instead of over it (lib/call_overlays.js): non-modal and fixed in
   place under the panel's layer, and the panel moves to the bottom left, clear of a side panel on the right and of the
   toasts at the bottom right. On a phone the panel stays the bottom sheet over the dialog, whose content scrolls clear
   of it. */
dialog.beside-call[open] {
  position: fixed;
  z-index: 60;
  inset: 0;
  margin: auto;
  box-shadow: 0 30px 60px rgba(7, 10, 46, 0.35);
}

dialog.drawer.beside-call[open] {
  inset: 0 0 0 auto;
  margin: 0;
  box-shadow: -12px 0 40px rgba(7, 10, 46, 0.25);
}

body:has(dialog.beside-call[open]) .softphone-panel {
  top: auto;
  right: auto;
  bottom: 16px;
  left: 16px;
}

@media (min-width: 1200px) {
  :root {
    --softphone-panel-width: 320px;
  }

  body:has(.softphone-panel:not([hidden])) .content {
    margin-right: 344px;
  }
}

@media (max-width: 640px) {
  body:has(dialog.beside-call[open]) .softphone-panel {
    left: 0;
    right: 0;
    bottom: 0;
  }

  dialog.beside-call[open] {
    padding-bottom: var(--softphone-sheet, 0px);
  }
}

/* No device of the rep's softphone is online: the calls ring the mobile (warning) or skip the rep (danger). */
.softphone-offline .softphone-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--fl-warning);
}

.softphone-offline.nowhere {
  color: #9b1c12;
  font-weight: 600;
}

.softphone-offline.nowhere .softphone-dot {
  background: var(--fl-danger);
}

#softphone-offline[hidden] {
  display: none;
}

/* "Priprav telefón" (phone/_ready): a pop-up bottom left next to the menu (the call panel and toasts are on the right), inline on the guide */
.phone-ready[hidden],
.phone-ready [hidden] {
  display: none !important;
}

.phone-ready.popup {
  position: fixed;
  left: 236px;
  bottom: 16px;
  z-index: 65;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 14px 16px;
  background: #fff;
  border-radius: var(--fl-radius);
  border-left: 4px solid var(--fl-secondary);
  box-shadow: 0 12px 30px rgba(7, 10, 46, 0.2);
}

.phone-ready-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ready-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ready-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
}

.ready-body {
  display: grid;
  gap: 2px;
}

.ready-mark {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--fl-text);
}

.ready-item[data-state="ok"] .ready-mark,
.ready-item[data-state="app"] .ready-mark {
  border-color: var(--ok-fg);
  background: var(--ok-fg);
}

.ready-item[data-state="blocked"] .ready-mark,
.ready-item[data-state="brave"] .ready-mark {
  border-color: var(--fl-danger);
}

.ready-steps {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.ready-steps p {
  margin: 0;
}

.ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phone-ready:not([data-ready="true"]) .ready-done {
  display: none;
}

@media (min-width: 961px) {
  .nav-collapsed .phone-ready.popup {
    left: 80px;
  }
}

@media (max-width: 960px) {
  .phone-ready.popup {
    left: 16px;
  }
}

@media (max-width: 640px) {
  .phone-ready.popup {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
}

/* "Aplikácia na zvonenie v mobile" (asterisk/_softphone_setup): one column per device, numbered steps */
.app-setup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 18px;
  margin-bottom: 12px;
}

.app-platform h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.app-platform p {
  margin: 0 0 6px;
}

.setup-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.softphone-account .provisioning-link {
  font-size: 11px;
}

.onboarding details > summary {
  cursor: pointer;
}

/* Ako budem telefonovať: the detected browser next to step 1, help with the browser closed (phone/_closed_browser),
   whether the phone app is registered, Linphone as the fold-out alternative and the step 3 test buttons. */
.guide-for {
  font-size: 13px;
  font-weight: 400;
}

.closed-browser {
  margin: 8px 0 0;
}

.closed-browser .closed-ring {
  display: block;
  margin-top: 4px;
}

.app-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 600;
}

.app-alternative {
  margin-top: 12px;
  min-width: 0;
}

.app-alternative .provisioning-link {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.app-alternative > summary {
  cursor: pointer;
  font-weight: 600;
}

.app-alternative .softphone-qr {
  float: right;
  margin: 0 0 8px 12px;
}

.onboarding-tests {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.onboarding-tests > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.onboarding-tests .softphone-result {
  flex-basis: 100%;
  margin: 0;
}
