/* Browser phone (softphone) dock. All colors come from admin theme tokens. */

.sp-dock,
.sp-dock *,
.sp-dock *::before,
.sp-dock *::after {
  box-sizing: border-box;
}

.sp-dock {
  --sp-ring: var(--border-strong);
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  width: 360px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 840px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--card);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  overflow: hidden;
  animation: sp-rise 180ms ease;
}

html[data-theme="dark"] .sp-dock {
  color-scheme: dark;
}

.sp-dock button,
.sp-dock select {
  font: inherit;
  color: inherit;
}

.sp-dock button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sp-dock button:focus {
  outline: none;
}

.sp-dock button:focus-visible,
.sp-dock select:focus-visible,
.sp-transcript:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus);
}

.sp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sp-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Status ring color */
.sp-status-idle { --sp-ring: var(--border-strong); }
.sp-status-incoming { --sp-ring: var(--success); }
.sp-status-connecting { --sp-ring: var(--primary); }
.sp-status-connected { --sp-ring: var(--success); }
.sp-status-on_hold { --sp-ring: var(--warning); }
.sp-status-ended { --sp-ring: var(--muted); }
.sp-status-error { --sp-ring: var(--danger); }

.sp-statusbar {
  flex: none;
  height: 4px;
  background: var(--sp-ring);
}

.sp-dock-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 12px;
}

/* Header */
.sp-header {
  flex: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.sp-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--sp-ring);
}

.sp-avatar span {
  position: relative;
  z-index: 1;
}

.sp-status-incoming .sp-avatar::before,
.sp-status-incoming .sp-avatar::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 2px solid var(--sp-ring);
  animation: sp-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

.sp-status-incoming .sp-avatar::after {
  animation-delay: 0.65s;
}

.sp-status-connecting .sp-avatar {
  box-shadow: none;
}

.sp-status-connecting .sp-avatar::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: sp-spin 0.8s linear infinite;
  pointer-events: none;
}

.sp-id {
  min-width: 0;
}

.sp-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-sub,
.sp-lead {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.sp-chip,
.sp-interest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.sp-chip i,
.sp-interest i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sp-ring);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  flex: none;
}

.sp-interest-hot i { background: var(--danger); }
.sp-interest-warm i { background: var(--warning); }
.sp-interest-cold i { background: var(--primary); }
.sp-interest-other i { background: var(--primary); }

.sp-mode {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sp-header-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sp-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  font-feature-settings: "tnum" 1;
}

.sp-header-actions {
  display: flex;
  gap: 2px;
}

.sp-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  padding: 0;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sp-icon-btn:hover {
  background: var(--accent-soft);
  border-color: var(--border);
}

.sp-icon-btn:active {
  transform: scale(0.96);
}

/* Minimized pill */
.sp-dock.is-min {
  width: auto;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: none;
  border-radius: 999px;
  display: block;
  animation: none;
}

.sp-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  text-align: left;
}

button.sp-pill:hover {
  background: var(--accent-soft);
}

.sp-pill-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.sp-pill-status {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-pill-sub {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-pill .sp-avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
  flex: none;
}

.sp-pill-chevron {
  flex: none;
  color: var(--muted);
}

/* Banners and context */
.sp-context,
.sp-note,
.sp-banner {
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--fg);
}

.sp-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sp-reason {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
}

.sp-note {
  font-size: 13px;
  line-height: 1.45;
}

.sp-note p,
.sp-banner p {
  margin: 0;
}

.sp-banner-error {
  background: var(--card);
  border-color: var(--danger);
  box-shadow: inset 3px 0 0 var(--danger);
}

.sp-banner-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.sp-hint {
  margin-top: 6px !important;
  color: var(--muted);
  font-size: 12.5px;
}

.sp-holdbar {
  margin: 12px 14px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--warning);
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

html[data-theme="dark"] .sp-holdbar {
  color: var(--bg);
}

.sp-join {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 28px);
  margin: 10px 14px 0;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--bg);
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.sp-join:hover {
  transform: translateY(-1px);
}

.sp-join:active {
  transform: translateY(0) scale(0.98);
}

/* Incoming answer controls */
.sp-answer-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 18px 16px 4px;
}

.sp-answer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
}

.sp-answer-circle {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: transform 160ms ease;
}

.sp-fill-success {
  background: var(--success);
  color: #fff;
}

.sp-fill-danger {
  background: var(--danger);
  color: #fff;
}

html[data-theme="dark"] .sp-fill-success,
html[data-theme="dark"] .sp-fill-danger {
  color: var(--bg);
}

.sp-answer:hover .sp-answer-circle {
  transform: translateY(-2px);
}

.sp-answer:active .sp-answer-circle {
  transform: scale(0.97);
}

.sp-answer-label {
  font-size: 13px;
  font-weight: 700;
}

.sp-secondary-row,
.sp-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px 0;
}

.sp-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sp-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--primary);
}

.sp-secondary:active,
.sp-block-btn:active {
  transform: scale(0.98);
}

.sp-block-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 28px);
  margin: 12px 14px 0;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--fg);
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sp-block-btn:hover {
  background: var(--accent-soft);
  border-color: var(--primary);
}

/* Meters */
.sp-meters {
  display: grid;
  gap: 8px;
  padding: 12px 14px 0;
}

.sp-meter-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
}

.sp-meter-label,
.sp-meter-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
}

.sp-meter-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.sp-meter-row.is-muted .sp-meter-value {
  color: var(--fg);
}

.sp-meter-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.sp-meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 120ms linear;
}

.sp-meter-fill.is-caller {
  background: var(--success);
}

.sp-meter-fill.is-hot {
  background: var(--danger);
}

/* In-call controls */
.sp-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  padding: 14px 10px 0;
}

.sp-ctrl {
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
}

.sp-ctrl-end {
  width: 72px;
}

.sp-ctrl-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--fg);
  display: grid;
  place-items: center;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sp-ctrl-end .sp-ctrl-icon {
  width: 64px;
  border: 0;
  background: var(--danger);
  color: #fff;
}

html[data-theme="dark"] .sp-ctrl-end .sp-ctrl-icon {
  color: var(--bg);
}

.sp-ctrl:hover .sp-ctrl-icon {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.sp-ctrl-end:hover .sp-ctrl-icon {
  background: var(--danger);
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.14);
}

.sp-ctrl:active .sp-ctrl-icon {
  transform: scale(0.96);
}

.sp-ctrl.is-muted .sp-ctrl-icon {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.sp-ctrl.is-muted:hover .sp-ctrl-icon,
.sp-ctrl.is-hold:hover .sp-ctrl-icon,
.sp-ctrl.is-open:hover .sp-ctrl-icon {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.14);
}

.sp-ctrl.is-hold .sp-ctrl-icon {
  background: var(--warning);
  color: var(--fg);
  border-color: transparent;
}

html[data-theme="dark"] .sp-ctrl.is-hold .sp-ctrl-icon {
  color: var(--bg);
}

.sp-ctrl.is-open .sp-ctrl-icon {
  background: var(--accent-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.sp-ctrl-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.sp-ctrl.is-muted .sp-ctrl-label,
.sp-ctrl.is-hold .sp-ctrl-label,
.sp-ctrl.is-open .sp-ctrl-label,
.sp-ctrl-end .sp-ctrl-label {
  color: var(--fg);
}

/* Keypad */
.sp-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px 0;
}

.sp-dial {
  grid-column: 1 / -1;
  min-height: 28px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.sp-dial.is-empty {
  color: var(--muted);
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
}

.sp-key {
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.sp-key b {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.sp-key small {
  min-height: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.sp-key:hover {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.sp-key:active,
.sp-key.is-pressed {
  transform: scale(0.97);
  background: var(--accent-soft);
  border-color: var(--primary);
}

/* Devices */
.sp-devices {
  display: grid;
  gap: 10px;
  padding: 12px 14px 0;
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
}

.sp-field select {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
}

.sp-devices-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Summary */
.sp-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 28px);
  margin: 12px 14px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease;
}

.sp-summary:hover {
  background: var(--accent-soft);
  border-color: var(--primary);
}

.sp-summary-chevron {
  color: var(--muted);
  transition: transform 160ms ease;
}

.sp-summary.is-open .sp-summary-chevron {
  transform: rotate(180deg);
}

.sp-summary-body {
  margin: 8px 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Notes tab. The panel itself is styled in notes.css. */
.sp-tabs {
  display: flex;
  gap: 6px;
  margin: 14px 14px 0;
}

.sp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.sp-tab.is-on {
  background: var(--accent-soft);
  border-color: var(--primary);
  color: var(--fg);
}

.sp-notes {
  margin: 8px 10px 0;
  max-height: 280px;
  overflow: auto;
}

/* Transcript */
.sp-section-label {
  margin: 14px 14px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sp-transcript {
  max-height: 196px;
  margin: 8px 14px 0;
  padding: 2px 2px 8px 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.sp-transcript.is-incoming {
  max-height: 132px;
}

.sp-transcript::-webkit-scrollbar {
  width: 8px;
}

.sp-transcript::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.sp-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
  gap: 3px;
}

.sp-line.is-you {
  align-items: flex-end;
}

.sp-who {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sp-line.is-you .sp-who {
  color: var(--primary);
}

.sp-bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sp-line.is-ai .sp-bubble {
  background: var(--accent-soft);
}

.sp-line.is-you .sp-bubble {
  background: var(--primary);
  border-color: transparent;
  color: var(--bg);
}

.sp-empty {
  margin: 8px 14px 0;
  color: var(--muted);
  font-size: 13px;
}

/* Ended, connecting, idle */
.sp-ended,
.sp-connect,
.sp-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 18px 8px;
  gap: 6px;
}

.sp-ended-mark,
.sp-idle-mark {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--primary);
  margin-bottom: 4px;
}

.sp-ended-mark {
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
}

.sp-ended-kicker,
.sp-connect p,
.sp-idle-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sp-ended-time {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.sp-idle-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sp-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: sp-spin 0.8s linear infinite;
  margin-bottom: 6px;
}

.sp-connect .sp-secondary,
.sp-ended .sp-block-btn,
.sp-idle .sp-block-btn {
  width: 100%;
  margin: 8px 0 0;
}

@keyframes sp-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes sp-pulse {
  0% { transform: scale(0.96); opacity: 0.65; }
  100% { transform: scale(1.35); opacity: 0; }
}

@keyframes sp-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-dock,
  .sp-dock *,
  .sp-dock *::before,
  .sp-dock *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .sp-status-incoming .sp-avatar::before,
  .sp-status-incoming .sp-avatar::after {
    opacity: 0.85;
    transform: none;
  }
}

@media (max-width: 639px) {
  .sp-dock:not(.is-min) {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sp-dock.is-min {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
  }
}

/* Preview page — scoped so it does not restyle the admin shell */
body.sp-preview-page {
  display: block;
  height: auto;
  min-height: 100%;
  overflow: auto;
}

body.sp-preview-page #root {
  display: block;
  min-height: 100vh;
  flex: none;
}

.sp-preview-page {
  color: var(--fg);
  padding-bottom: 48px;
}

.sp-preview-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.sp-preview-bar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sp-preview-bar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sp-preview-toggle {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sp-preview-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--primary);
}

.sp-preview-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus);
}

.sp-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 28px 20px;
  align-items: start;
  padding: 24px;
}

.sp-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.sp-preview-label {
  align-self: stretch;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sp-preview-slot {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sp-preview-slot .sp-dock {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  top: auto;
  animation: none;
}

.sp-preview-slot .sp-dock:not(.is-min) {
  width: min(360px, 100%);
  max-height: none;
  border-radius: 16px;
}

.sp-preview-slot .sp-dock-body {
  overflow: visible;
}

.sp-preview-sheet {
  padding: 0 24px 12px;
}

.sp-preview-sheet h2 {
  margin: 8px 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.sp-preview-sheet p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  max-width: 62ch;
}

.sp-preview-phoneframe {
  width: min(390px, 100%);
  height: 740px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background:
    radial-gradient(420px 220px at 20% 0%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.sp-preview-phoneframe .sp-dock:not(.is-min) {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: auto;
  max-width: none;
  max-height: 92%;
  border-radius: 16px 16px 0 0;
}

.sp-preview-phoneframe .sp-dock-body {
  overflow: auto;
}
