*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f4f4f5;
  --surface-hover: #f8fafc;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;
  --primary: #09090b;
  --primary-hover: #27272a;
  --primary-foreground: #ffffff;
  --success: #16a34a;
  --warning: #a16207;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow-lg: 0 18px 50px rgba(9, 9, 11, 0.12);
}

body {
  min-height: 100vh;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(228, 228, 231, 0.55),
      transparent 34rem
    ),
    var(--background);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  width: min(100% - 80px, 1120px);
  margin: 0 auto;
  padding: 22px 0 32px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}


.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1a1a1a 0%, #09090b 60%, #000000 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 2px 4px rgba(0,0,0,0.25),
    0 8px 24px rgba(0,0,0,0.35);
  position: relative;
}

h1 {
  font-size: clamp(18px, 1.8vw, 20px);
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

.view-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 16px;
  overflow: hidden;
  isolation: isolate;
  min-width: 246px;
}

.view-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc((100% - 6px) / 2);
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 0;
}

.view-toggle.is-dashboard .view-toggle-indicator {
  transform: translateX(100%);
}

.tab-btn {
  position: relative;
  z-index: 1;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tab-btn.active {
  color: var(--text);
}

.tab-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.view-panel.hidden {
  display: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-faint);
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.status-dot.ok {
  background: var(--success);
}
.status-dot.error {
  background: var(--danger);
}

.muted {
  color: var(--text-muted);
  font-size: 11px;
}

#last-updated {
  display: inline-block;
  white-space: nowrap;
}

.customer-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  align-items: start;
}

.customer-phone {
  height: 280px;
  padding: 12px;
  background: #0b0d11;
  color: #fff;
  border-color: #1f2430;
  display: flex;
  flex-direction: column;
}

.phone-top,
.phone-footer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-top {
  justify-content: space-between;
  padding: 4px 6px 2px;
}

.phone-notch {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #2a3140;
}

.phone-top-status {
  font-size: 10px;
  color: #9aa4b4;
  line-height: 1;
}

.phone-main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 180px;
}

.phone-selected {
  margin: 0 auto 6px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  color: #bdc7d6;
  background: #121722;
  font-size: 10px;
}

.phone-call-state {
  text-align: center;
  margin-top: auto;
  margin-bottom: 5px;
}

.phone-footer {
  color: #9aa4b4;
  font-size: 10px;
  margin-bottom: 2px;
}

.btn-call-customer {
  width: 100%;
}

/* ── Active call UI ─────────────────────────────────────────────────────────── */
.phone-active-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 8px;
}

.pac-number {
  font-size: 13px;
  font-weight: 600;
  color: #09090b;
  letter-spacing: 0.02em;
}

.pac-timer {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #09090b;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pac-pulse-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  position: relative;
}
.pac-pulse-ring::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid #16a34a;
  opacity: 0;
  animation: pac-pulse 1.6s ease-out infinite;
}
@keyframes pac-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.pac-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.pac-ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  padding: 10px 12px 8px;
  cursor: pointer;
  color: #09090b;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  width: 70px;
  flex-shrink: 0;
}
.pac-ctrl-btn:hover {
  background: #e4e4e7;
  border-color: #d4d4d8;
}
.pac-ctrl-btn.active {
  background: #09090b;
  border-color: #09090b;
  color: #fff;
}

.pac-ctrl-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}

.pac-end {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.pac-end:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.call-error-text {
  min-height: 0;
  font-size: 10px;
  line-height: 1.3;
  color: #dc2626;
  text-align: center;
  display: none;
}

.call-error-text:not(:empty) {
  display: block;
}

.btn-mic-permission {
  border: none;
  background: #09090b;
  color: #fafafa;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}

.btn-mic-permission:hover {
  background: #27272a;
}

.direct-call-note {
  text-align: center;
  font-size: 10px;
  color: #8b95a8;
  line-height: 1.5;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  border-top: 1px solid #e4e4e7;
  padding-top: 8px;
  width: 100%;
}

.direct-call-link {
  display: inline-block;
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.direct-call-link:hover {
  color: #1d4ed8;
}

/* ── Mic permission modal ─────────────────────────────────────────────────── */
.mic-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.mic-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mic-modal {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(9, 9, 11, 0.18);
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s;
}

.mic-modal-overlay.open .mic-modal {
  transform: translateY(0) scale(1);
}

.mic-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mic-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mic-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #09090b;
  line-height: 1.2;
  margin-bottom: 3px;
}

.mic-modal-subtitle {
  font-size: 12px;
  color: #71717a;
}

.mic-modal-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #a1a1aa;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.mic-modal-close:hover {
  color: #09090b;
}

.mic-modal-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.mic-modal-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #3f3f46;
  line-height: 1.4;
}

.mic-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #09090b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.mic-step-detail {
  color: #71717a;
  font-size: 12px;
}

.mic-modal-footer {
  display: flex;
  gap: 8px;
}

.mic-modal-reload {
  flex: 1;
  background: #09090b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.mic-modal-reload:hover {
  background: #27272a;
}

.mic-modal-cancel {
  flex: 1;
  background: #f4f4f5;
  color: #09090b;
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.mic-modal-cancel:hover {
  background: #e4e4e7;
}

.customer-details {
  min-height: 280px;
}

.customer-details h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.customer-flow-hint {
  margin-bottom: 8px;
}

.customer-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fcfcfd;
}

.talk-guide {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fcfcfd;
  padding: 10px;
}

.talk-guide-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.talk-guide-sub {
  margin-top: 2px;
  margin-bottom: 8px;
  font-size: 10px;
}

.talk-item {
  border-top: 1px solid #eceff3;
  padding-top: 6px;
  margin-top: 6px;
}

.talk-item:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.talk-item summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #1f2937;
}

.talk-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.24s ease,
    opacity 0.18s ease;
}

.talk-content > * {
  overflow: clip;
}

.talk-item pre {
  min-height: 0;
  margin-top: 6px;
  white-space: pre-wrap;
  font-size: 10px;
  line-height: 1.45;
  color: #374151;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 7px;
}

/* Hide horizontal scrollbar indicator while preserving scrollability */
.customer-table-wrap {
  scrollbar-width: none;
}
.customer-table-wrap::-webkit-scrollbar {
  height: 0;
}

.customer-caller-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.customer-caller-table th {
  height: 30px;
  padding: 0 8px;
  text-align: left;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
  text-transform: uppercase;
}

.customer-caller-table td {
  padding: 7px 8px;
  font-size: 11px;
  border-bottom: 1px solid #eceff3;
  white-space: nowrap;
}

/* Emphasize phone numbers for quick scanning */
.phone-number {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-decoration: none;
}

.customer-caller-table tr:last-child td {
  border-bottom: none;
}

.customer-caller-table td.phone-cell {
  background: #fffde8;
}

.customer-caller-table td.docs-cell {
  max-width: 160px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.row-unknown td {
  opacity: 0.55;
  font-style: italic;
}

.field-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.field-value {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.card {
  min-height: 96px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-title {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.card-sub {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 11px;
}
.card-bar {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}
.card-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.45s ease;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.status-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
}

.sync-hint {
  font-size: 10px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

section h2 {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: 0;
}

.btn-call,
.btn-refresh,
.pg-btn,
.drawer-close,
.row-play-btn {
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.btn-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12px;
  font-weight: 650;
  box-shadow: var(--shadow);
}
.btn-call svg {
  width: 14px;
  height: 14px;
  display: block;
}

#call-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.btn-call:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-call.active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-call:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-refresh {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
}
.btn-refresh:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th {
  height: 34px;
  padding: 0 12px;
  text-align: left;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  background: #fcfcfd;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f1f3;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--surface-hover);
}

.time-cell {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.caller-name {
  color: var(--text);
  font-weight: 650;
  font-size: 12px;
}
.caller-phone {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 10px;
}
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.badge-resolved {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}
.badge-escalated {
  background: #fffbeb;
  color: var(--warning);
  border-color: #fde68a;
}
.badge-auth_failed {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.badge-positive {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.badge-neutral {
  background: var(--surface-muted);
  color: #52525b;
  border-color: var(--border);
}
.badge-negative {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

/* Escalation reason badges */
.badge-escalation-representative_requested {
  background: #fffbeb;
  color: #a16207;
  border-color: #fde68a;
}
.badge-escalation-unsupported_question {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}
.badge-escalation-emergency {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.badge-escalation-verification_failed {
  background: #fdf4ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.drawer-meta-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-right: 4px;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.link:hover {
  text-decoration: underline;
}

.summary-clickable {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  cursor: pointer;
  font-weight: 560;
}
.summary-clickable:hover {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
tr.clickable-row {
  cursor: pointer;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.32);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 101;
  width: 420px;
  max-width: 95vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-caller-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 740;
}
.drawer-caller-phone {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.drawer-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drawer-close:hover {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border-strong);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.drawer-meta-time {
  margin-right: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.drawer-section-label {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-summary-text {
  color: var(--text);
  line-height: 1.75;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.drawer-transcript {
  max-height: 280px;
  overflow-y: auto;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
  background: #fcfcfd;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
  font-family: inherit;
}
.drawer-transcript::-webkit-scrollbar {
  width: 6px;
}
.drawer-transcript::-webkit-scrollbar-track {
  background: transparent;
}
.drawer-transcript::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.drawer-link-btn:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.row-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  flex-shrink: 0;
}
.row-play-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.audio-player {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ap-bottom {
  gap: 8px;
  padding: 0 2px;
}

.ap-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}
.ap-play-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.04);
}
.ap-play-btn:active {
  transform: scale(0.98);
}

.ap-progress-wrap {
  flex: 1;
}
.ap-progress {
  position: relative;
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
}
.ap-progress:hover .ap-thumb {
  opacity: 1;
}
.ap-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #fff;
  border-radius: inherit;
  pointer-events: none;
  transition: width 0.05s linear;
}
.ap-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ap-times {
  display: flex;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ap-sep {
  color: rgba(255, 255, 255, 0.35);
  margin: 0 1px;
}
.ap-vol-icon {
  color: rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.ap-vol-slider {
  flex: 1;
  max-width: 90px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.ap-vol-slider::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
}
.ap-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  border: none;
  cursor: pointer;
}
.ap-error {
  color: #fecaca;
  font-size: 11px;
  text-align: center;
  padding-top: 2px;
}

@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}
.skeleton {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e4e4e7 25%, #fafafa 50%, #e4e4e7 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.pagination:empty {
  display: none;
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 560;
  line-height: 1;
}
.pg-btn:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}
.pg-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pg-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  font-weight: 700;
}
.pg-dots {
  color: var(--text-faint);
  font-size: 13px;
  padding: 6px 4px;
  user-select: none;
}

@media (max-width: 980px) {
  .customer-shell {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 1240px);
    padding-top: 22px;
  }
  header {
    align-items: flex-start;
  }
  .header-right {
    margin-left: 52px;
  }
  #last-updated {
    max-width: calc(100vw - 120px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .view-toggle {
    width: 100%;
    justify-content: center;
  }
  .card {
    min-height: 108px;
    padding: 16px;
  }
  .card-value {
    font-size: 29px;
  }
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .section-actions {
    width: 100%;
    justify-content: space-between;
  }
  td,
  th {
    padding-left: 14px;
    padding-right: 14px;
  }
  .detail-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .drawer-header,
  .drawer-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}
