:root {
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-soft: rgba(14, 165, 233, 0.12);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --purple: #8b5cf6;

  --bg: #e8eef5;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-app: 0 24px 64px -20px rgba(15, 23, 42, 0.18);
  --shadow-soft: 0 8px 24px -8px rgba(15, 23, 42, 0.1);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Instrument Sans", "DM Sans", system-ui, sans-serif;
  --voice-gradient: linear-gradient(
    180deg,
    #ffffff 0%,
    #f8fafc 35%,
    #f1f5f9 65%,
    #e8eef5 100%
  );
}

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

html {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* Ambient background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.orb-a {
  width: 420px;
  height: 420px;
  background: #bae6fd;
  top: -120px;
  right: -80px;
  animation: drift-a 18s ease-in-out infinite;
}

.orb-b {
  width: 360px;
  height: 360px;
  background: #c7d2fe;
  bottom: -100px;
  left: -60px;
  animation: drift-b 22s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 30px); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}

/* App shell */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(440px, 100%);
  height: min(92dvh, 860px);
  height: min(92svh, 860px);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-app);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-pane-voice {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--voice-gradient);
}

.app-pane-log {
  flex: 1;
  min-height: 0;
}

/* Header */
.header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.logo-ring {
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 4s linear infinite;
}

.logo-core {
  position: absolute;
  inset: 13px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.header-text h1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.connection-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}

.pill-active,
.pill-listening,
.pill-speaking,
.pill-thinking {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #047857;
}

.pill-connecting {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: #4338ca;
}

.pill-speaking {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.25);
  color: #6d28d9;
}

.pill-thinking {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #b45309;
}

.pill-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

.session-timer {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* Status + visualizer */
.status-card {
  flex: 0 0 auto;
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border-bottom: none;
}

.status {
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 12px;
  transition: color 0.25s ease;
  max-width: 320px;
  line-height: 1.45;
}

.status-idle { color: var(--text-muted); }
.status-connecting { color: #4338ca; }
.status-active { color: var(--primary-hover); }
.status-listening { color: #047857; }
.status-thinking { color: #b45309; }
.status-speaking { color: #6d28d9; }
.status-error { color: var(--danger); }

.visualizer-wrapper {
  position: relative;
  width: min(220px, 72vw);
  height: min(220px, 72vw);
  max-width: 260px;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.visualizer-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(14, 165, 233, 0.2);
  animation: spin 24s linear infinite reverse;
}

#voice-visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.pulse {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  z-index: 1;
  transition: background 0.4s ease, opacity 0.3s ease;
  animation: pulse-glow 2.2s ease-in-out infinite alternate;
}

.pulse[data-state="active"],
.pulse[data-state="listening"] {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
}

.pulse[data-state="thinking"] {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
}

.pulse[data-state="speaking"] {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, transparent 70%);
}

.pulse[data-state="connecting"] {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
}

.pulse.hidden {
  opacity: 0;
  animation: none;
}

/* Quick prompts */
.quick-prompts {
  width: 100%;
  margin-top: 8px;
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.35s ease;
}

.quick-prompts.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.quick-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.quick-chip {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Workflows */
.workflow-panel {
  width: 100%;
  margin: 0;
}

.workflow-panel-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
}

.workflow-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.workflow-card {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  padding: 14px 12px;
  min-height: 48px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (hover: hover) {
  .workflow-card:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
  }
}

.workflow-card:disabled {
  opacity: 0.6;
  cursor: wait;
}

.workflow-book.is-selected,
.workflow-book:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.workflow-reschedule.is-selected,
.workflow-reschedule:hover:not(:disabled) {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.workflow-card.is-selected {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.workflow-reschedule.is-selected {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Controls + workflow actions (stacked) */
.controls {
  flex-shrink: 0;
  margin-top: 0;
  padding: 8px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
}

.controls .workflow-panel-label {
  margin-bottom: 8px;
}

.mic-btn {
  width: 100%;
  padding: 16px 20px;
  min-height: 52px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (hover: hover) {
  .mic-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(14, 165, 233, 0.4);
  }
}

.mic-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.mic-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.mic-btn.is-active {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.mic-btn.is-active:hover:not(:disabled) {
  box-shadow: 0 10px 28px rgba(239, 68, 68, 0.35);
}

.btn-icon {
  position: relative;
  width: 22px;
  height: 22px;
}

.mic-icon {
  width: 22px;
  height: 22px;
  position: absolute;
  inset: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mic-icon-end {
  opacity: 0;
  transform: scale(0.8);
}

.mic-btn.is-active .mic-icon-start {
  opacity: 0;
  transform: scale(0.8);
}

.mic-btn.is-active .mic-icon-end {
  opacity: 1;
  transform: scale(1);
}

.control-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.secondary-btn {
  flex: 1;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (hover: hover) {
  .secondary-btn:hover:not(:disabled) {
    background: var(--surface-2);
    color: var(--text);
    border-color: #cbd5e1;
  }
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn.is-muted {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.mute-icon {
  width: 18px;
  height: 18px;
}

.mute-slash {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.secondary-btn.is-muted .mute-slash {
  opacity: 1;
}

.hidden {
  display: none !important;
}

/* Transcript */
.transcript-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.transcript-header {
  padding: 14px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transcript-header h2 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.live-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: blink 1.4s ease-in-out infinite;
}

.transcript-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 12px;
  scroll-behavior: smooth;
}

.transcript-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  gap: 12px;
}

.transcript-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}

.transcript-empty p {
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 240px;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.transcript-item {
  display: flex;
  gap: 10px;
  animation: slide-up 0.3s ease-out forwards;
}

.transcript-user {
  flex-direction: row-reverse;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.transcript-user .avatar {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.transcript-assistant .avatar {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
}

.bubble {
  max-width: 82%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-soft);
}

.transcript-user .bubble {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border-color: rgba(14, 165, 233, 0.2);
}

.transcript-assistant.is-streaming .bubble {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.08);
}

.bubble-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.bubble-meta .role {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.bubble-meta .time {
  font-size: 0.65rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.bubble-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.transcript-user.is-hearing .bubble {
  border-color: rgba(14, 165, 233, 0.45);
}

.transcript-user.is-hearing .bubble-text {
  color: #64748b;
  font-style: italic;
}

.heard-note {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
}

/* Footer */
.app-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.app-footer p {
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.app-footer strong {
  color: var(--danger);
  font-weight: 700;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
  from { transform: scale(0.85); opacity: 0.5; }
  to { transform: scale(1.15); opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
.transcript-scroll::-webkit-scrollbar {
  width: 5px;
}

.transcript-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* ——— Responsive: phones ——— */
@media (max-width: 480px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .app {
    max-width: 100%;
    width: 100%;
    height: 100dvh;
    height: 100svh;
    min-height: 100dvh;
    min-height: 100svh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .header {
    padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  }

  .header-text h1 {
    font-size: clamp(0.95rem, 4.2vw, 1.05rem);
  }

  .subtitle {
    font-size: 0.72rem;
  }

  .logo {
    width: 40px;
    height: 40px;
  }

  .logo-core {
    inset: 12px;
  }

  .status-card {
    padding: 14px 16px 12px;
  }

  .status {
    font-size: 0.88rem;
    max-width: 100%;
    padding: 0 4px;
  }

  .visualizer-wrapper {
    width: min(200px, 78vw);
    height: min(200px, 78vw);
  }

  .controls {
    padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  }

  .transcript-header,
  .transcript-scroll {
    padding-left: 14px;
    padding-right: 14px;
  }

  .bubble {
    max-width: 88%;
  }

  .app-footer {
    padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  }
}

/* Small phones */
@media (max-width: 360px) {
  .workflow-card {
    padding: 16px;
  }

  .brand {
    gap: 10px;
  }

  .header-meta {
    align-items: flex-end;
  }

  .connection-pill {
    font-size: 0.62rem;
    padding: 4px 8px;
  }
}

/* Landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .app {
    height: 100dvh;
    height: 100svh;
  }

  .status-card {
    padding: 10px 16px;
  }

  .visualizer-wrapper {
    width: min(140px, 38vh);
    height: min(140px, 38vh);
    margin-bottom: 4px;
  }

  .workflow-panel {
    margin-top: 6px;
  }

  .workflow-cards {
    max-width: 420px;
    margin: 0 auto;
  }

  .transcript-panel {
    min-height: 120px;
  }
}

/* ——— Responsive: tablets (portrait) ——— */
@media (min-width: 481px) and (max-width: 767px) {
  body {
    padding: 20px;
  }

  .app {
    max-width: 520px;
    height: min(94dvh, 900px);
    height: min(94svh, 900px);
  }

  .visualizer-wrapper {
    width: 240px;
    height: 240px;
  }
}

/* ——— Responsive: tablets (landscape) & small desktops ——— */
@media (min-width: 768px) {
  body {
    padding: 24px;
  }

  .app {
    max-width: min(920px, 96vw);
    height: min(94dvh, 880px);
    height: min(94svh, 880px);
  }

  .app-body {
    flex-direction: row;
    align-items: stretch;
    border-top: 1px solid var(--border);
  }

  .app-pane-voice {
    flex: 0 0 min(48%, 400px);
    max-width: 420px;
    min-height: 0;
    align-self: stretch;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .status-card {
    flex: 1;
    border-bottom: none;
  }

  .controls {
    margin-top: auto;
    padding-top: 16px;
  }

  .app-pane-log {
    flex: 1;
    min-width: 0;
    border-top: none;
  }

  .transcript-panel {
    height: 100%;
  }

  .visualizer-wrapper {
    width: 200px;
    height: 200px;
  }
}

/* Large tablets / desktop */
@media (min-width: 1024px) {
  .app {
    max-width: 960px;
  }

  .app-pane-voice {
    flex-basis: 420px;
  }

  .visualizer-wrapper {
    width: 220px;
    height: 220px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo-ring,
  .visualizer-ring {
    animation: none;
  }
}

body.calendly-modal-open {
  overflow: hidden;
}

.calendly-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.calendly-modal.hidden {
  display: none;
}

.calendly-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.calendly-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(92dvh, 640px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.calendly-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.calendly-modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.calendly-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 4px 8px;
  border-radius: 8px;
}

.calendly-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.calendly-embed {
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.calendly-embed.calendly-embed--confirm {
  min-height: 240px;
}

.calendly-embed iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-height: 240px;
  border: 0;
}

.calendly-loading {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: #64748b;
}

.calendly-modal-footer {
  flex-shrink: 0;
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  background: #f8fafc;
}

.calendly-modal-footer a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-hover);
  text-decoration: none;
}

.calendly-modal-footer a:hover {
  text-decoration: underline;
}

/* Hide stray Calendly popup overlay when using inline modal only */
.calendly-overlay,
.calendly-popup-content {
  z-index: 9999 !important;
}
