/* ── Skyler AI — animated voice-first agent (draggable cartoon) ───────────── */

#skylerAiAgent {
    position: fixed;
    top: 50%;
    left: 50%;            /* JS recenters precisely on open; this is a fallback */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    user-select: none;
    color: #e8eaed;
    font-family: inherit;
    animation: skylerAiPop 0.3s cubic-bezier(0.18, 0.9, 0.32, 1.2);
}

@keyframes skylerAiPop {
    from { opacity: 0; transform: translateY(16px) scale(0.85); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

#skylerAiAgent.dragging { transition: none; }
#skylerAiAgent.dragging .sai-character { cursor: grabbing; }

/* ── The character (photo avatar) ───────────────────────────────────────── */
.sai-character {
    /* --sai-react: 0..1 live audio loudness, set by the lip-sync engine in JS */
    --sai-react: 0;
    position: relative;
    width: 112px;
    height: 112px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: skylerBob 3.6s ease-in-out infinite;
}

@keyframes skylerBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* Circular frame around the photo. Scales subtly with the AI's live loudness so
   the avatar visibly "reacts" while speaking (a flat photo can't lip-sync a mouth). */
.sai-photo-wrap {
    position: relative;
    z-index: 2;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.15);
    background: #1b2a4d;
    transform: scale(calc(1 + var(--sai-react) * 0.05));
    transition: transform 0.06s linear, box-shadow 0.2s ease;
}

/* Zoomed crop focusing on the character's face. The source is a SQUARE card with
   branding text across the bottom, so object-position can't crop it — we enlarge
   the image and position it to show only the face. Tune these two knobs:
     width  → zoom level   |   top → vertical framing (more negative = look lower) */
.sai-photo {
    position: absolute;
    width: 172%;
    height: auto;
    left: 50%;
    top: -4%;
    transform: translateX(-50%);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;       /* clicks/drags go to the character, not the img */
}

/* Glowing aura behind the photo — reflects AI state + live loudness. Centered
   with margin:auto so the state keyframes can scale() without breaking centering. */
.sai-aura {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 128, 237, 0.5) 0%, rgba(47, 128, 237, 0) 70%);
    opacity: 0.6;
    z-index: 1;
}

@keyframes skylerAuraPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.55; }
    50%      { transform: scale(1.18); opacity: 0.95; }
}

/* ── State: SPEAKING — bright blue aura. While lip-sync is active the aura is
   driven by live loudness instead of the canned pulse. ───────────────────── */
#skylerAiAgent.speaking .sai-aura {
    background: radial-gradient(circle, rgba(47, 128, 237, 0.75) 0%, rgba(47, 128, 237, 0) 70%);
    animation: skylerAuraPulse 0.9s ease-in-out infinite;
}
#skylerAiAgent.speaking .sai-photo-wrap {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(90, 160, 236, 0.55);
}
#skylerAiAgent.lipsync .sai-aura {
    animation: none;
    transform: scale(calc(0.92 + var(--sai-react) * 0.3));
    opacity: calc(0.45 + var(--sai-react) * 0.5);
    transition: transform 0.06s linear, opacity 0.06s linear;
}

/* ── State: LISTENING — warm green glow ─────────────────────────────────── */
#skylerAiAgent.listening .sai-aura {
    background: radial-gradient(circle, rgba(46, 204, 113, 0.6) 0%, rgba(46, 204, 113, 0) 70%);
    animation: skylerAuraPulse 1.4s ease-in-out infinite;
}
#skylerAiAgent.listening .sai-photo-wrap {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(46, 204, 113, 0.6);
}

/* ── State: THINKING — slow amber shimmer ───────────────────────────────── */
#skylerAiAgent.thinking .sai-aura {
    background: radial-gradient(circle, rgba(241, 196, 15, 0.5) 0%, rgba(241, 196, 15, 0) 70%);
    animation: skylerAuraPulse 1.8s ease-in-out infinite;
}
/* A rotating amber ring hugging the avatar makes "Preparing response…" unmistakable
   at a glance — far more visible than the status pill alone, so attendees know she's
   working and wait. The ring sits just outside the 104px photo frame (z-index 1, behind
   the photo at z-index 2) so only its outer band shows; the conic gradient + mask carve a
   thin arc that spins. */
#skylerAiAgent.thinking .sai-character::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 122px;
    height: 122px;
    border-radius: 50%;
    z-index: 1;
    background: conic-gradient(from 0deg,
        rgba(241, 196, 15, 0) 0deg,
        rgba(241, 196, 15, 0.95) 300deg,
        rgba(241, 196, 15, 0) 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    animation: skylerThinkSpin 0.9s linear infinite;
    pointer-events: none;
}
@keyframes skylerThinkSpin {
    to { transform: rotate(360deg); }
}

/* ── Status line ────────────────────────────────────────────────────────── */
.sai-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(20, 22, 28, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 11px;
    border-radius: 999px;
    white-space: nowrap;
}

.skyler-ai-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.8);
    animation: skylerPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes skylerPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Speaking dots tucked into the status pill */
#skylerAiSpeakingIndicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
}
.sai-speaking-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #5aa0ec;
    animation: skylerDot 1.1s ease-in-out infinite;
    flex-shrink: 0;
}
.sai-speaking-dot:nth-child(2) { animation-delay: 0.18s; }
.sai-speaking-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes skylerDot {
    0%, 100% { transform: translateY(0);    opacity: 0.45; }
    50%      { transform: translateY(-4px); opacity: 1; }
}
/* Tint the dots per state so each cue is unmistakable: green = listening, amber =
   thinking/processing, blue = speaking. */
#skylerAiAgent.listening .sai-speaking-dot { background: #2ecc71; }
#skylerAiAgent.thinking  .sai-speaking-dot { background: #f1c40f; }

/* Make the whole status pill light up while Skyler is engaged, so the indicator is far
   more visible than a small grey pill — users can tell at a glance she heard them and is
   working on a reply. */
#skylerAiAgent.listening .sai-status {
    color: #eafff2;
    background: rgba(46, 204, 113, 0.22);
    border-color: rgba(46, 204, 113, 0.55);
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.35);
}
#skylerAiAgent.thinking .sai-status {
    color: #fff7e0;
    background: rgba(241, 196, 15, 0.22);
    border-color: rgba(241, 196, 15, 0.55);
    box-shadow: 0 0 14px rgba(241, 196, 15, 0.35);
}
#skylerAiAgent.speaking .sai-status {
    color: #e7f1ff;
    background: rgba(90, 160, 236, 0.22);
    border-color: rgba(90, 160, 236, 0.55);
    box-shadow: 0 0 14px rgba(90, 160, 236, 0.35);
}
/* Drive the status dot's colour from the active state too. */
#skylerAiAgent.thinking  .skyler-ai-dot { background: #f1c40f; box-shadow: 0 0 8px rgba(241, 196, 15, 0.9); }
#skylerAiAgent.speaking  .skyler-ai-dot { background: #5aa0ec; box-shadow: 0 0 8px rgba(90, 160, 236, 0.9); }

/* ── Caption (latest AI line, auto-fades) ───────────────────────────────── */
.sai-caption {
    max-width: 230px;
    background: rgba(20, 22, 28, 0.78);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    border-bottom-right-radius: 4px;
    padding: 9px 13px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #eef1f5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-height: 0;
    overflow: hidden;
    margin-bottom: -8px;
}
.sai-caption.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 160px;
    margin-bottom: 0;
}

/* ── Control dock ───────────────────────────────────────────────────────── */
.sai-dock {
    display: flex;
    gap: 6px;
    padding: 5px 7px;
    background: rgba(20, 22, 28, 0.6);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
    opacity: 0.55;
    transition: opacity 0.2s ease;
}
/* Fully opaque on hover, while dragging, or whenever the live host is on; stays
   touchable (semi-visible) at rest so mobile users can reach the controls. */
#skylerAiAgent:hover .sai-dock,
#skylerAiAgent.dragging .sai-dock,
#skylerAiAgent.live .sai-dock {
    opacity: 1;
}

.sai-dock-btn {
    background: rgba(255, 255, 255, 0.07);
    color: #cfe0f5;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.sai-dock-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; transform: translateY(-1px); }
.sai-dock-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sai-dock-btn.activeControl {
    background: linear-gradient(135deg, #2f80ed, #2563eb);
    color: #fff;
    border-color: transparent;
    width: auto;
    padding: 0 11px;
    border-radius: 999px;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
}

/* Labeled pill buttons (Start / Stop / Hide) — replace the bare icon buttons. */
.sai-dock-btn.sai-text-btn {
    width: auto;
    min-width: 64px;
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.sai-dock-btn.sai-text-btn i { font-size: 11px; }
.sai-dock-btn.sai-start {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border-color: transparent;
}
.sai-dock-btn.sai-start:hover { background: linear-gradient(135deg, #2ad36a, #18b14e); color: #fff; }
.sai-dock-btn.sai-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: transparent;
}
.sai-dock-btn.sai-stop:hover { background: linear-gradient(135deg, #f15a5a, #e22d2d); color: #fff; }
.sai-dock-btn.sai-hide {
    background: rgba(255, 255, 255, 0.08);
    color: #cfe0f5;
}

/* Mic listening state */
#skylerAiMic.listening {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    animation: skylerMicPulse 1.2s ease-in-out infinite;
}
@keyframes skylerMicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
    50%      { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .sai-character,
    .sai-aura,
    #skylerAiAgent.speaking .sai-aura,
    #skylerAiAgent.listening .sai-aura,
    #skylerAiAgent.thinking .sai-aura,
    #skylerAiAgent.thinking .sai-character::after {
        animation: none !important;
    }
}

/* ── End Skyler AI agent ──────────────────────────────────────────────────── */

/* ── Skyler AI — schedule a call ───────────────────────────────────────────
   The popup Skyler opens to confirm who a call is for, to ask each participant
   whether the proposed time works, and to confirm the booking.

   Markup: public/pages/r.html (#aiSchedulePopup) — a fixed shell whose body and
   footer are rendered by public/js/Room.js (aiSchedule*).

   Styled to match the Skyler agent above (dark translucent glass, hairline light
   border, #5aa0ec accent) rather than as a generic white dialog: it sits on top of
   a dark video call and is spoken about by the same assistant, so a bright light
   modal read as a foreign element bolted onto the product.                     */

:root {
    --ais-surface:      rgba(24, 27, 36, 0.88);
    --ais-surface-soft: rgba(255, 255, 255, 0.055);
    --ais-surface-hover:rgba(255, 255, 255, 0.09);
    --ais-line:         rgba(255, 255, 255, 0.10);
    --ais-text:         #eaecf0;
    --ais-muted:        rgba(234, 236, 240, 0.58);
    --ais-accent:       #5aa0ec;
    --ais-accent-deep:  #3d7fd0;
    --ais-success:      #35d07f;
    --ais-warn:         #f0b429;
}

.ai-schedule-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;               /* above the video grid and the Skyler dock */
    display: none;                 /* JS switches to flex */
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 10, 15, 0.58);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: aisFade 0.18s ease-out;
}

@keyframes aisFade { from { opacity: 0; } to { opacity: 1; } }

.ai-schedule-card {
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    color: var(--ais-text);
    background: var(--ais-surface);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--ais-line);
    border-radius: 18px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 2px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    animation: aisPop 0.28s cubic-bezier(0.18, 0.9, 0.32, 1.15);
}

@keyframes aisPop {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.ai-schedule-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ais-line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent);
}

/* Glowing ring around Skyler's photo — same treatment as .sai-photo-wrap above,
   so the popup is recognisably from the same assistant. */
.ai-schedule-avatar-ring {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(140deg, var(--ais-accent), rgba(90, 160, 236, 0.15));
    box-shadow: 0 0 14px rgba(90, 160, 236, 0.35);
}
.ai-schedule-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #1b2a4d;
}

.ai-schedule-heading { flex: 1 1 auto; min-width: 0; }
.ai-schedule-heading h5 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 650;
    letter-spacing: -0.15px;
    color: var(--ais-text);
}
.ai-schedule-sub {
    margin: 2px 0 0;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: var(--ais-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-schedule-sub:empty { display: none; }

.ai-schedule-x {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--ais-muted);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ai-schedule-x:hover {
    background: var(--ais-surface-hover);
    border-color: var(--ais-line);
    color: var(--ais-text);
}

/* ── Body ────────────────────────────────────────────────────────────────── */

.ai-schedule-body {
    padding: 18px;
    flex: 1 1 auto;
    overflow-y: auto;              /* long rosters scroll in the card, not the page */
    overscroll-behavior: contain;
}
.ai-schedule-body::-webkit-scrollbar { width: 8px; }
.ai-schedule-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 99px;
}

.ai-schedule-lead {
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ais-text);
}
.ai-schedule-lead strong { font-weight: 650; }
.ai-schedule-ok   { color: var(--ais-success); }
.ai-schedule-warn { color: var(--ais-warn); }

.ai-schedule-note {
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ais-muted);
}
.ai-schedule-note.ai-schedule-warn { color: #ffd98a; }

/* ── Loader ──────────────────────────────────────────────────────────────
   Every waiting state renders this, and _aiScheduleSet falls back to it rather
   than ever painting an empty card. */

.ai-schedule-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 26px 10px 22px;
    text-align: center;
}
.ai-schedule-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--ais-accent);
    animation: aisSpin 0.75s linear infinite;
}
@keyframes aisSpin { to { transform: rotate(360deg); } }

.ai-schedule-loading-text {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ais-muted);
    animation: aisBreathe 1.9s ease-in-out infinite;
}
@keyframes aisBreathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ── People (confirm step + waiting tally) ───────────────────────────────── */

.ai-schedule-people { list-style: none; margin: 0; padding: 0; }
.ai-schedule-people li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--ais-line);
    border-radius: 12px;
    background: var(--ais-surface-soft);
    font-size: 14px;
}
.ai-schedule-people li:last-child { margin-bottom: 0; }

/* Initials chip — avoids shipping a real avatar just to make a name list scannable. */
.ai-schedule-ava {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #dbe9ff;
    background: linear-gradient(140deg, rgba(90, 160, 236, 0.5), rgba(90, 160, 236, 0.18));
    border: 1px solid rgba(90, 160, 236, 0.35);
    text-transform: uppercase;
}

.ai-schedule-people .ai-schedule-state { margin-left: auto; font-size: 13px; }
.ai-schedule-state.ok    { color: var(--ais-success); }
.ai-schedule-state.no    { color: #ff7b7b; }
.ai-schedule-state.muted { color: var(--ais-muted); }

/* ── Picker ──────────────────────────────────────────────────────────────── */

.ai-schedule-picker {
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--ais-line);
    border-radius: 14px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.16);
}
.ai-schedule-pick {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.14s ease;
}
.ai-schedule-pick:hover { background: var(--ais-surface-hover); }
.ai-schedule-pick input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    accent-color: var(--ais-accent);
    cursor: pointer;
}
.ai-schedule-pick span { flex: 1 1 auto; }
.ai-schedule-pick:has(input:checked) {
    background: rgba(90, 160, 236, 0.14);
    box-shadow: inset 0 0 0 1px rgba(90, 160, 236, 0.35);
}

/* ── The proposed time, per participant ──────────────────────────────────
   One row each, because two attendees can be hours apart and a single printed
   time would be wrong for at least one of them. */

.ai-schedule-times { list-style: none; margin: 0; padding: 0; }
.ai-schedule-times li {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--ais-line);
    border-radius: 13px;
    background: var(--ais-surface-soft);
}
.ai-schedule-times li:last-child { margin-bottom: 0; }
.ai-schedule-times li.me {
    background: rgba(90, 160, 236, 0.13);
    border-color: rgba(90, 160, 236, 0.38);
}

.ai-schedule-meta { flex: 1 1 auto; min-width: 0; }
.ai-schedule-who {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ais-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-schedule-who em {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--ais-accent);
    margin-left: 6px;
}
.ai-schedule-tz {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--ais-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-schedule-tz.muted { font-style: italic; }

.ai-schedule-when {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.25;
}
.ai-schedule-when strong {
    display: block;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.2px;
    color: var(--ais-text);
    font-variant-numeric: tabular-nums;
}
.ai-schedule-when small {
    display: block;
    margin-top: 1px;
    font-size: 11.5px;
    color: var(--ais-muted);
}

/* ── Success hero (booked) ───────────────────────────────────────────────── */

.ai-schedule-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 4px 0 16px;
}
.ai-schedule-hero-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--ais-success);
    background: rgba(53, 208, 127, 0.14);
    border: 1px solid rgba(53, 208, 127, 0.4);
    box-shadow: 0 0 22px rgba(53, 208, 127, 0.22);
    animation: aisPopIn 0.4s cubic-bezier(0.18, 0.9, 0.32, 1.3);
}
@keyframes aisPopIn {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}
.ai-schedule-hero h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    color: var(--ais-text);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.ai-schedule-foot {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 18px;
    border-top: 1px solid var(--ais-line);
    background: rgba(0, 0, 0, 0.18);
    flex-wrap: wrap;
}
.ai-schedule-foot:empty { display: none; }

.ai-schedule-btn {
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ai-schedule-btn:active { transform: translateY(1px); }
.ai-schedule-btn:focus-visible {
    outline: 2px solid var(--ais-accent);
    outline-offset: 2px;
}
.ai-schedule-btn.primary {
    color: #fff;
    background: linear-gradient(180deg, var(--ais-accent), var(--ais-accent-deep));
    box-shadow: 0 6px 16px rgba(61, 127, 208, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.ai-schedule-btn.primary:hover {
    background: linear-gradient(180deg, #6bacf0, #4589d9);
    box-shadow: 0 8px 20px rgba(61, 127, 208, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ai-schedule-btn.ghost {
    color: var(--ais-text);
    background: var(--ais-surface-soft);
    border-color: var(--ais-line);
}
.ai-schedule-btn.ghost:hover { background: var(--ais-surface-hover); }

/* ── Responsive: bottom sheet on phones ──────────────────────────────────── */

@media (max-width: 520px) {
    .ai-schedule-backdrop { padding: 0; align-items: flex-end; }
    .ai-schedule-card {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
        animation: aisSheet 0.28s cubic-bezier(0.18, 0.9, 0.32, 1.1);
    }
    .ai-schedule-foot { justify-content: stretch; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
    .ai-schedule-btn  { flex: 1 1 auto; padding: 12px 16px; }
}
@keyframes aisSheet {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-schedule-backdrop,
    .ai-schedule-card,
    .ai-schedule-hero-badge,
    .ai-schedule-loading-text { animation: none !important; }
    .ai-schedule-ring { animation-duration: 1.6s; }
    .ai-schedule-btn  { transition: none; }
}

/* Some deployments force a light page theme; keep the card readable there too. */
@media (prefers-color-scheme: light) {
    .ai-schedule-backdrop { background: rgba(18, 22, 30, 0.42); }
}

/* ── End Skyler AI schedule ───────────────────────────────────────────────── */
