/* ============================================================================
   PEARL MODAL — .pact luxe aesthetic (v3-aligned 2026-05-11)
   ----------------------------------------------------------------------------
   Pearl card on void scrim. Lavender-tinted hairline. Soft mocha shadow.
   Mocha-ink typography on Satoshi headlines + Inter body. Teal eyebrows.
   Iris CTA. Radii on the 8/12/16/20 scale. Iridescent edge gradient on top.

   Reference: public/brand-guidelines-v3.html Sections 02 (typography),
   03 (palette), 05 (composition), 08 (voice on field labels).
   Aligns with .pact card chrome at public/pages/action-queue.html line 936.
   Replaces the prior #FFFFFF + iris-teal-gradient styling (LAW 23 violation).
   ============================================================================ */

:root {
    /* Canonical v3 palette tokens — pearl base + lavender hairline + mocha ink. */
    --pearl-modal-bg-from: #FDFCFA;
    --pearl-modal-bg-to: #F8F6F1;
    --pearl-modal-border: rgba(184, 169, 201, 0.20);
    --pearl-modal-border-strong: rgba(184, 169, 201, 0.32);
    --pearl-modal-text: #2C2C2C;
    --pearl-modal-text-muted: #6B6B6B;
    --pearl-modal-text-dim: #9A95A0;
    --pearl-modal-input-bg: #F8F6F1;
    --pearl-modal-input-border: rgba(184, 169, 201, 0.30);
    --pearl-modal-section-bg-from: #F8F6F1;
    --pearl-modal-section-bg-to: #F5F0E8;
    --pearl-modal-overlay: rgba(26, 21, 32, 0.55);
    --pearl-modal-shadow: 0 32px 80px rgba(45, 36, 56, 0.32), 0 8px 24px rgba(138, 122, 187, 0.10), 0 1px 3px rgba(45, 36, 56, 0.06);
    --pearl-modal-iris: #8A7ABB;
    --pearl-modal-iris-faded: #7A6FA8;
    --pearl-modal-teal: #4A9999;
    --pearl-modal-brick: #B85060;
}

/* ============================================================================
   Overlay (void-tinted scrim with iridescent blur)
   ============================================================================ */
.pearl-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--pearl-modal-overlay);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pearl-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   Container — pearl card on pearl, iridescent edge accent at the top.
   ============================================================================ */
.pearl-modal-container {
    position: relative;
    /* Three-stop pearl gradient + subtle mesh tint for dimensional depth. */
    background:
        radial-gradient(ellipse at top right, rgba(138, 122, 187, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(74, 153, 153, 0.05) 0%, transparent 50%),
        linear-gradient(145deg, var(--pearl-modal-bg-from) 0%, #FBF8F2 45%, var(--pearl-modal-bg-to) 100%);
    border: 1px solid var(--pearl-modal-border);
    /* Generous radius — v3 spec 20px on hero modals, push to 24px for stunning. */
    border-radius: 24px;
    width: 100%;
    max-width: 820px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--pearl-modal-shadow);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* 2026-05-20 ROOT-CAUSE-2 fix: orbs (position:absolute with negative
       top/bottom) were inflating container's scrollHeight to 1165px,
       hitting max-height: 88vh cap and forcing 968px even when content
       was 560px. Fix: overflow: clip prevents BOTH visual overflow AND
       contribution to scroll dimensions. Browsers since 2022 (Chrome 90+,
       Firefox 81+, Safari 16+). Fallback to overflow:hidden + contain. */
    overflow: clip;
    overflow: hidden;       /* fallback */
    contain: paint;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--pearl-modal-text);
}

.pearl-modal-overlay.visible .pearl-modal-container {
    transform: translateY(0) scale(1);
}

/* Decorations as CHILD DIVS — verifiable via querySelector. Previous
   ::before / ::after approach lost a cascade race + the LAW 17 audit
   couldn't reliably read pseudo-element computed-styles. Reference
   incident: 2026-05-11 Cowork audit found content:'none' on prod while
   the deployed CSS clearly defined ::before content. Child divs avoid
   that whole class of failure. */
/* Iridescent edge — pulses subtly when modal opens for "alive" feel. */
.pearl-modal-decoration-edge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
        rgba(138, 122, 187, 0.0) 0%,
        rgba(122, 111, 168, 1.0) 18%,
        rgba(138, 122, 187, 1.0) 32%,
        rgba(184, 169, 201, 0.85) 50%,
        rgba(106, 186, 186, 1.0) 68%,
        rgba(74, 153, 153, 1.0) 82%,
        rgba(74, 153, 153, 0.0) 100%);
    pointer-events: none;
    z-index: 3;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 1px 12px rgba(138, 122, 187, 0.45), 0 2px 18px rgba(74, 153, 153, 0.28);
    background-size: 200% 100%;
    animation: pearlEdgeShimmer 14s linear infinite;
}
@keyframes pearlEdgeShimmer {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

/* 2026-05-20 Elle directive: REMOVE the background orbs. They were
   inflating the container layout (pearl-modal-decoration-glow div was
   being counted as a flex column item at 320px tall, pushing the header
   down to y=327 and creating 250+px of empty space at the top). Static
   pearl gradient (already baked into .pearl-modal-container background)
   provides depth without layout pollution.
   The iridescent edge strip stays — it's a 6px decoration that doesn't
   inflate anything. */
.pearl-modal-decoration-glow { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .pearl-modal-decoration-edge { animation: none !important; }
}

.pearl-modal-container > * { position: relative; z-index: 1; }
.pearl-modal-container > .pearl-modal-decoration-edge,
.pearl-modal-container > .pearl-modal-decoration-glow { z-index: 0; }
.pearl-modal-container > .pearl-modal-decoration-edge { z-index: 3; }

/* ============================================================================
   Header
   ============================================================================ */
.pearl-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 24px 6px;
    gap: 14px;
    flex-shrink: 0;
}

.pearl-modal-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.pearl-modal-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    width: fit-content;
    /* Subtle dimensional shadow + inset highlight for jewel-pill feel */
    box-shadow:
        0 1px 2px rgba(45, 36, 56, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.pearl-modal-title {
    font-family: 'Satoshi', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--pearl-modal-text);
    margin: 0;
    line-height: 1.22;
    letter-spacing: -0.014em;
    /* Subtle ink-gradient — pure mocha-ink at left fading to iris-tinted
       graphite at the right edge. Reads as polished, not flat. */
    background: linear-gradient(95deg, var(--pearl-modal-text) 0%, #3A2F4C 80%, #4A3E5E 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.pearl-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--pearl-modal-border);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--pearl-modal-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(45, 36, 56, 0.05);
}

.pearl-modal-close:hover {
    background: var(--pearl-modal-iris);
    color: #FDFCFA;
    border-color: var(--pearl-modal-iris);
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(138, 122, 187, 0.35);
}

/* ============================================================================
   Body
   ============================================================================ */
.pearl-modal-body {
    /* 2026-05-20 ROOT-CAUSE fix for Elle's wasted-space complaint:
       Eyes-on screenshot showed massive empty area between last field
       and footer. Root cause: body had flex:1 1 auto which GROWS to
       fill 88vh container even when content is short. Now flex:0 1 auto
       — body sizes to content; shrinks (with internal scroll) only if
       content exceeds available height. */
    padding: 4px 22px 16px;
    overflow-y: auto;
    flex: 0 1 auto;
    min-height: 0;
}

/* Subtle scrollbar — pearl ivory track, iris thumb. */
.pearl-modal-body::-webkit-scrollbar { width: 8px; }
.pearl-modal-body::-webkit-scrollbar-track { background: transparent; }
.pearl-modal-body::-webkit-scrollbar-thumb {
    background: rgba(138, 122, 187, 0.20);
    border-radius: 999px;
}
.pearl-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(138, 122, 187, 0.35); }

/* ============================================================================
   Form
   ============================================================================ */
.pearl-modal-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pearl-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pearl-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pearl-form-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--pearl-modal-teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pearl-form-input {
    width: 100%;
    padding: 11px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--pearl-modal-text);
    background: var(--pearl-modal-input-bg);
    border: 1px solid var(--pearl-modal-input-border);
    border-radius: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    /* Subtle inset highlight for crystalline depth */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.pearl-form-input:hover:not(:focus) {
    border-color: var(--pearl-modal-border-strong);
    background: var(--pearl-modal-bg-from);
}

.pearl-form-input:focus {
    outline: none;
    background: var(--pearl-modal-bg-from);
    border-color: var(--pearl-modal-iris);
    box-shadow:
        0 0 0 3px rgba(138, 122, 187, 0.22),
        0 0 18px rgba(138, 122, 187, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.pearl-form-input::placeholder {
    color: var(--pearl-modal-text-dim);
}

.pearl-form-textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.55;
}

/* Custom select chevron — iris-tinted, replaces default browser chrome. */
.pearl-form-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A7ABB' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.pearl-form-section-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--pearl-modal-teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 8px;
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pearl-modal-border);
}

/* ============================================================================
   Contact Type Selector
   ============================================================================ */
.pearl-contact-type-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pearl-contact-type-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--pearl-modal-input-bg);
    border: 1px solid var(--pearl-modal-input-border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--pearl-modal-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pearl-contact-type-option:hover {
    border-color: var(--pearl-modal-iris);
    color: var(--pearl-modal-text);
    background: rgba(138, 122, 187, 0.04);
}

.pearl-contact-type-option.active {
    background: rgba(138, 122, 187, 0.12);
    border-color: var(--pearl-modal-iris);
    color: var(--pearl-modal-iris-faded);
    font-weight: 600;
}

.pearl-contact-type-option input { display: none; }

.pearl-contact-type-icon { font-size: 14px; }

.pearl-contact-type-label { font-weight: 500; }

/* ============================================================================
   Form Notices
   ============================================================================ */
.pearl-form-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.pearl-form-notice-info {
    background: rgba(138, 122, 187, 0.08);
    border: 1px solid rgba(138, 122, 187, 0.20);
    color: var(--pearl-modal-iris-faded);
}

.pearl-form-notice-new {
    background: rgba(74, 153, 153, 0.08);
    border: 1px solid rgba(74, 153, 153, 0.20);
    color: var(--pearl-modal-teal);
}

.pearl-form-notice-warning {
    background: rgba(184, 80, 96, 0.08);
    border: 1px solid rgba(184, 80, 96, 0.20);
    color: var(--pearl-modal-brick);
}

.pearl-notice-icon { font-size: 16px; }

/* ============================================================================
   Collapsible Sections
   ============================================================================ */
.pearl-modal-section {
    /* Pearl card on pearl — subtle drop shadow + iris hairline that
       intensifies on hover. Replaces the flat border for dimensional depth. */
    margin-top: 10px;
    border: 1px solid var(--pearl-modal-border);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--pearl-modal-bg-from), var(--pearl-modal-section-bg-from));
    box-shadow:
        0 1px 2px rgba(45, 36, 56, 0.04),
        0 2px 8px rgba(138, 122, 187, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.pearl-modal-section:hover {
    border-color: var(--pearl-modal-border-strong);
    box-shadow:
        0 1px 2px rgba(45, 36, 56, 0.04),
        0 4px 14px rgba(138, 122, 187, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.pearl-modal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background:
        linear-gradient(135deg, var(--pearl-modal-section-bg-from), var(--pearl-modal-section-bg-to)),
        linear-gradient(90deg, rgba(74, 153, 153, 0.04), rgba(138, 122, 187, 0.04));
    border-bottom: 1px solid rgba(184, 169, 201, 0.12);
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    /* Iridescent gradient text — teal -> iris sweep on section eyebrows.
       Replaces flat teal for v3-luxe shimmer. */
    background-clip: padding-box;
    color: transparent;
    background-image: linear-gradient(135deg, var(--pearl-modal-section-bg-from), var(--pearl-modal-section-bg-to));
    text-transform: uppercase;
    letter-spacing: 0.10em;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}
/* Use a span-wrap workaround: section-header text node gets the gradient
   via :first-child > span if present. Fallback: solid teal text. */
.pearl-modal-section-header > span:first-child {
    background: linear-gradient(135deg, var(--pearl-modal-teal) 0%, var(--pearl-modal-iris) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 700;
}
/* Fallback for the existing markup pattern */
.pearl-modal-section-header {
    color: var(--pearl-modal-teal);
}

.pearl-modal-section-header:hover {
    color: var(--pearl-modal-iris);
}

.pearl-section-toggle {
    transition: transform 0.2s ease;
    font-size: 10px;
    color: var(--pearl-modal-iris);
}

.pearl-modal-section-collapsible.collapsed .pearl-section-toggle {
    transform: rotate(-90deg);
}

.pearl-modal-section-content {
    /* Density: padding 18 -> 12. */
    padding: 12px 14px;
    border-top: 1px solid var(--pearl-modal-border);
    background: var(--pearl-modal-bg-from);
}

.pearl-modal-section-collapsible.collapsed .pearl-modal-section-content {
    display: none;
}

.pearl-reasoning-text {
    font-size: 13.5px;
    color: var(--pearl-modal-text);
    line-height: 1.65;
    margin: 0;
}

.pearl-evidence-item {
    background: rgba(138, 122, 187, 0.04);
    border-left: 3px solid var(--pearl-modal-iris);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 0 12px 12px 0;
    font-size: 13px;
    font-style: italic;
    color: var(--pearl-modal-text-muted);
    line-height: 1.55;
}

.pearl-evidence-item:last-child { margin-bottom: 0; }

.pearl-evidence-quote {
    margin-top: 6px;
    color: var(--pearl-modal-text-muted);
    font-style: italic;
}

.pearl-evidence-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pearl-modal-iris);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.pearl-evidence-link:hover { border-color: var(--pearl-modal-iris); }

/* Email evidence — structured row per LAW 19 (avatar + sender + date +
   subject + preview + expand). Replaces flat-text dump. */
.pearl-evidence-email {
    display: flex;
    gap: 12px;
    background: rgba(138, 122, 187, 0.05);
    border-left: 3px solid var(--pearl-modal-iris);
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 0 12px 12px 0;
    font-style: normal;
    font-size: 13px;
    color: var(--pearl-modal-text);
    line-height: 1.45;
}
.pearl-evidence-email:last-child { margin-bottom: 0; }

.pearl-evidence-email-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--pearl-modal-iris), var(--pearl-modal-iris-faded));
    color: #FDFCFA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pearl-evidence-email-body {
    flex: 1;
    min-width: 0;
}

.pearl-evidence-email-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.pearl-evidence-email-sender {
    font-weight: 600;
    color: var(--pearl-modal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pearl-evidence-email-addr {
    font-weight: 400;
    color: var(--pearl-modal-text-muted);
    font-size: 12px;
}

.pearl-evidence-email-date {
    font-size: 11px;
    color: var(--pearl-modal-text-muted);
    font-weight: 500;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.pearl-evidence-email-subject {
    font-weight: 600;
    font-size: 13px;
    color: var(--pearl-modal-text);
    margin: 1px 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pearl-evidence-email-quote {
    color: var(--pearl-modal-text-muted);
    font-size: 12.5px;
    padding-left: 10px;
    border-left: 2px solid rgba(138, 122, 187, 0.18);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.pearl-evidence-email-expand {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pearl-modal-iris);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.pearl-evidence-email-expand:hover { border-color: var(--pearl-modal-iris); }

/* ============================================================================
   Footer — Dismiss (left-anchored, danger ghost) + Cancel + Approve (iris).
   ============================================================================ */
.pearl-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--pearl-modal-border);
    /* Pearl Warm gradient + subtle teal hairline glow above for "platform"
       feel. The button row sits in a slight golden-pearl wash. */
    background: linear-gradient(180deg, transparent 0%, rgba(245, 240, 232, 0.65) 100%);
    position: relative;
}
.pearl-modal-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 153, 153, 0.32), rgba(138, 122, 187, 0.32), transparent);
    pointer-events: none;
}

.pearl-modal-btn {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
    letter-spacing: 0.01em;
}

.pearl-modal-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Primary — iris gradient with shimmer sweep on hover. v3 contract: iris
   is the CTA color. The shimmer pseudo-element sweeps a translucent
   highlight across the button on hover for a "ready to act" feel. */
.pearl-modal-btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pearl-modal-iris) 0%, var(--pearl-modal-iris-faded) 100%);
    color: #FDFCFA;
    box-shadow:
        0 1px 2px rgba(138, 122, 187, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.pearl-modal-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
    transform: skewX(-22deg);
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.pearl-modal-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pearl-modal-iris-faded) 0%, #6B5BA3 100%);
    transform: translateY(-1px);
    box-shadow:
        0 4px 18px rgba(138, 122, 187, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.pearl-modal-btn-primary:hover:not(:disabled)::after {
    left: 125%;
}

/* Secondary — pearl-ivory bg with iris-tinted hairline. */
.pearl-modal-btn-secondary {
    background: var(--pearl-modal-input-bg);
    color: var(--pearl-modal-text-muted);
    border: 1px solid var(--pearl-modal-border);
}

.pearl-modal-btn-secondary:hover:not(:disabled) {
    background: rgba(138, 122, 187, 0.06);
    color: var(--pearl-modal-text);
    border-color: var(--pearl-modal-border-strong);
}

/* Danger — brick-tinted ghost. Dismiss sits on the left of the footer. */
.pearl-modal-btn-danger {
    background: rgba(184, 80, 96, 0.06);
    color: var(--pearl-modal-brick);
    border: 1px solid rgba(184, 80, 96, 0.20);
}

.pearl-modal-btn-danger:hover:not(:disabled) {
    background: var(--pearl-modal-brick);
    color: #FDFCFA;
    border-color: var(--pearl-modal-brick);
}

/* Complete — teal-tinted ghost. v3 contract: teal (#4A9999) is the
   eyebrow/status accent. "Mark complete" sits between Dismiss and Cancel:
   the user is acknowledging the action was already handled, distinct from
   rejecting it (Dismiss) or executing it now (Approve). */
.pearl-modal-btn-complete {
    background: rgba(74, 153, 153, 0.07);
    color: #4A9999;
    border: 1px solid rgba(74, 153, 153, 0.25);
}

.pearl-modal-btn-complete:hover:not(:disabled) {
    background: #4A9999;
    color: #FDFCFA;
    border-color: #4A9999;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(74, 153, 153, 0.28);
}

/* ============================================================================
   Loading
   ============================================================================ */
.pearl-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px;
}

.pearl-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--pearl-modal-border);
    border-top-color: var(--pearl-modal-iris);
    border-radius: 50%;
    animation: pearl-modal-spin 0.8s linear infinite;
}

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

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 640px) {
    .pearl-modal-overlay { padding: 14px; }

    .pearl-modal-container {
        max-height: 92vh;
        border-radius: 16px;
    }

    .pearl-modal-header { padding: 20px 20px 16px; }
    .pearl-modal-body { padding: 4px 20px 20px; }

    .pearl-modal-footer {
        padding: 14px 20px;
        flex-direction: column;
    }

    .pearl-modal-btn { width: 100%; }

    .pearl-form-row { grid-template-columns: 1fr; }

    .pearl-contact-type-selector { flex-direction: column; }
    .pearl-contact-type-option { justify-content: center; }
}

/* ============================================================================
   BESPOKE PER-ACTION-TYPE CHASSIS — #46 real luxe body composition 2026-05-11
   ----------------------------------------------------------------------------
   Each .pearl-modal--<type> modifier class scopes a bespoke layout. The
   chassis JS in pearl-modal.js attaches the modifier class to .pearl-modal-
   container on open(). These rules tune typography, color, hero shape, and
   form composition per action type — sample requests get a tracking-number
   hero, draft emails get an email-card aesthetic, pipeline wins get a
   celebratory iridescent shimmer banner, update_contact gets a side-by-side
   diff layout, escalate gets a brick-tinted risk-card hero, human_judgment
   gets a Question hero.
   ============================================================================ */

/* Tiny "optional" hint after a form label. */
.pearl-form-label-opt {
    font-weight: 400;
    font-size: 10px;
    color: var(--pearl-modal-text-dim);
    letter-spacing: 0;
    text-transform: lowercase;
    margin-left: 4px;
}

.pearl-modal-form--two-col .pearl-form-row {
    gap: 16px;
}

/* ===== SAMPLE REQUEST ===== */
.pearl-modal--sample-request {
    background: linear-gradient(165deg, #FDFCFA 0%, #F5F0E8 100%);
}

.pearl-sr-tracking-hero {
    background: linear-gradient(135deg, rgba(74, 153, 153, 0.10) 0%, rgba(138, 122, 187, 0.08) 100%);
    border: 1px solid rgba(74, 153, 153, 0.20);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.pearl-sr-tracking-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4A9999 0%, #6ABABA 100%);
}

.pearl-sr-tracking-ribbon {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #4A9999;
    margin-bottom: 6px;
}

.pearl-sr-tracking-number {
    font-family: 'SF Mono', 'Menlo', 'Courier New', monospace;
    font-size: 22px;
    font-weight: 600;
    color: #2C2C2C;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.pearl-sr-tracking-meta {
    font-size: 12px;
    color: var(--pearl-modal-text-muted);
    margin-top: 4px;
}

/* PROMISE — sample request: pill card with an iris checkmark badge on the
   left, body block on the right. Reads as a commitment, not a notice. The
   badge is a flex sibling, not a pseudo-element, so the body block keeps its
   full width. */
.pearl-sr-promise-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(138, 122, 187, 0.10) 0%, rgba(106, 186, 186, 0.08) 100%);
    border: 1px solid rgba(138, 122, 187, 0.24);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 26px;
    position: relative;
    overflow: hidden;
}

.pearl-sr-promise-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pearl-modal-iris) 0%, var(--pearl-modal-teal) 100%);
    color: #FDFCFA;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(138, 122, 187, 0.35);
    flex: 0 0 44px;
}

.pearl-sr-promise-body {
    flex: 1 1 auto;
    min-width: 0;
}

.pearl-sr-promise-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--pearl-modal-iris-faded);
    margin-bottom: 4px;
}

.pearl-sr-promise-text {
    font-size: 14px;
    color: var(--pearl-modal-text);
    line-height: 1.55;
}

.pearl-sr-divider {
    height: 1px;
    background: var(--pearl-modal-border);
    margin: 4px 0 4px;
}

/* ===== DRAFT EMAIL ===== */
.pearl-modal--draft-email {
    background: linear-gradient(145deg, #FDFCFA 0%, #F8F6F1 100%);
}

/* WHY — draft email: aurora-wash card with no border, eyebrow in italic
   serif-feel mocha, body wider. Reads as a quoted insight, not a chip. */
.pearl-de-why-card {
    background:
        radial-gradient(circle at 90% 0%, rgba(138, 122, 187, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 10% 100%, rgba(74, 153, 153, 0.14) 0%, transparent 55%),
        linear-gradient(145deg, rgba(184, 169, 201, 0.06) 0%, rgba(253, 252, 250, 0.0) 100%);
    border: none;
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(184, 169, 201, 0.25), 0 8px 24px rgba(138, 122, 187, 0.10);
}

.pearl-de-why-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-iris-faded);
    margin-bottom: 6px;
}

.pearl-de-why-text {
    font-size: 13.5px;
    color: var(--pearl-modal-text);
    line-height: 1.55;
    margin-bottom: 8px;
}

.pearl-de-why-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pearl-de-why-pill {
    background: rgba(138, 122, 187, 0.10);
    color: var(--pearl-modal-iris-faded);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.pearl-de-why-pill-teal {
    background: rgba(74, 153, 153, 0.10);
    color: var(--pearl-modal-teal);
}

.pearl-de-to-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pearl-de-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8A7ABB 0%, #4A9999 100%);
    color: #FDFCFA;
    font-family: 'Satoshi', sans-serif;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 18px;
}

.pearl-de-to-fields {
    flex: 1;
    min-width: 0;
}

.pearl-de-recipient-name {
    font-size: 11px;
    color: var(--pearl-modal-text-muted);
    margin-top: 4px;
    padding-left: 2px;
    font-style: italic;
}

.pearl-de-subject {
    font-family: 'Satoshi', sans-serif;
    font-size: 17px !important;
    font-weight: 500;
    color: var(--pearl-modal-text) !important;
    padding: 14px 16px !important;
}

.pearl-de-body-card {
    position: relative;
    background: linear-gradient(165deg, rgba(138, 122, 187, 0.04) 0%, rgba(138, 122, 187, 0.01) 100%);
    border: 1px solid rgba(138, 122, 187, 0.18);
    border-radius: 14px;
    padding: 14px 14px 12px;
    margin-top: 4px;
}

.pearl-de-body-label {
    margin-bottom: 8px;
    color: var(--pearl-modal-iris-faded) !important;
}

.pearl-de-body {
    background: var(--pearl-modal-bg-from) !important;
    min-height: 180px;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    border-color: rgba(138, 122, 187, 0.20) !important;
}

.pearl-de-ai-instruction {
    margin-top: 8px;
    font-size: 12px !important;
    color: var(--pearl-modal-text-muted) !important;
    background: rgba(138, 122, 187, 0.03) !important;
    border-style: dashed !important;
}

.pearl-de-ai-corner {
    position: absolute;
    top: 12px;
    right: 14px;
    background: linear-gradient(135deg, #8A7ABB 0%, #4A9999 100%);
    color: #FDFCFA;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(138, 122, 187, 0.30);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    z-index: 2;
}

.pearl-de-ai-corner:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(138, 122, 187, 0.40);
}

.pearl-de-ai-corner:disabled {
    opacity: 0.5;
    cursor: wait;
}

.pearl-de-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    margin-top: 4px;
}

.pearl-de-notice-draft {
    background: rgba(138, 122, 187, 0.08);
    border: 1px solid rgba(138, 122, 187, 0.18);
    color: var(--pearl-modal-iris-faded);
}

.pearl-de-notice-send {
    background: rgba(184, 80, 96, 0.06);
    border: 1px solid rgba(184, 80, 96, 0.18);
    color: var(--pearl-modal-brick);
}

/* Email thread context card — "Replying to" section in draft_email/send_email
   chassis. Elle 2026-05-20 ask: "i need the email thread history and my
   signature ...". Loads via async fetch in _hydrateThreadCard. */
.pearl-de-thread-card {
    margin: 10px 0 12px;
    border: 1px solid var(--pearl-modal-border);
    border-radius: 12px;
    background: rgba(248, 246, 241, 0.55);
    padding: 10px 14px;
}
.pearl-de-thread-eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: #4A9999;
    margin-bottom: 6px;
}
.pearl-de-thread-loading {
    font-weight: 500;
    color: var(--pearl-modal-text-muted);
    text-transform: none;
    letter-spacing: 0;
}
.pearl-de-thread-skeleton {
    height: 32px;
    background: linear-gradient(90deg, rgba(138,122,187,0.06), rgba(138,122,187,0.12), rgba(138,122,187,0.06));
    border-radius: 6px;
    animation: pearlDeThreadShimmer 1.6s linear infinite;
}
@keyframes pearlDeThreadShimmer {
    0% { background-position: -200px 0 }
    100% { background-position: 200px 0 }
}
.pearl-de-thread-msg {
    padding: 8px 0;
    border-top: 1px solid rgba(138,122,187,0.10);
}
.pearl-de-thread-msg:first-child { border-top: none; padding-top: 0; }
.pearl-de-thread-msg-latest {
    background: rgba(74, 153, 153, 0.04);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 4px -6px 0;
    border: 1px solid rgba(74, 153, 153, 0.15);
}
.pearl-de-thread-msg-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--pearl-modal-text);
    margin-bottom: 3px;
}
.pearl-de-thread-msg-meta strong {
    font-weight: 600;
}
.pearl-de-thread-msg-email {
    color: var(--pearl-modal-text-muted);
    font-size: 11px;
}
.pearl-de-thread-msg-date {
    color: var(--pearl-modal-text-muted);
    font-size: 11px;
    margin-left: auto;
}
.pearl-de-thread-msg-subject {
    font-weight: 600;
    font-size: 12.5px;
    margin-bottom: 3px;
    color: var(--pearl-modal-text);
}
.pearl-de-thread-msg-body {
    font-size: 12px;
    line-height: 1.5;
    color: var(--pearl-modal-text-muted);
    white-space: pre-wrap;
    word-break: break-word;
}
.pearl-de-thread-empty {
    color: var(--pearl-modal-text-muted);
    font-style: italic;
    font-size: 12px;
    padding: 6px 0;
}

/* Signature note — informs the user that their Outlook signature appends
   automatically. Elle 2026-05-20: "i need the email thread history and
   my signature ...". The signature itself is appended server-side by
   Outlook on send, so this is a status note rather than a preview. */
.pearl-de-signature-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 11.5px;
    color: var(--pearl-modal-text-muted);
    background: rgba(138, 122, 187, 0.04);
    border: 1px dashed rgba(138, 122, 187, 0.20);
    margin-top: 6px;
    margin-bottom: 4px;
}
.pearl-de-signature-icon {
    color: var(--pearl-modal-iris);
    font-size: 14px;
}

.pearl-de-notice-icon {
    font-size: 14px;
    font-weight: 700;
}

/* ===== PIPELINE WIN ===== */
.pearl-modal--pipeline-win {
    background: linear-gradient(155deg, #FDFCFA 0%, #F5F0E8 100%);
}

.pearl-pw-shimmer-banner {
    position: relative;
    background:
        linear-gradient(135deg, rgba(74, 153, 153, 0.25) 0%, rgba(138, 122, 187, 0.35) 50%, rgba(184, 169, 201, 0.3) 100%),
        linear-gradient(95deg, #2C2C2C 0%, #4A4258 25%, #6B5BA3 50%, #7A6FA8 70%, #4A9999 100%);
    background-size: 100% 100%, 220% 100%;
    animation: pearl-pw-shimmer 7s ease-in-out infinite;
    border-radius: 16px 16px 0 0;
    padding: 36px 36px 30px;
    margin: 0 -32px 24px;
    overflow: hidden;
    color: #FDFCFA;
    min-height: 130px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 -1px 0 rgba(253, 252, 250, 0.10);
}

@keyframes pearl-pw-shimmer {
    0%, 100% { background-position: 0% 50%, 0% 50%; }
    50% { background-position: 100% 50%, 100% 50%; }
}

.pearl-pw-shimmer-banner::after {
    content: '🎉';
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 28px;
    opacity: 0.55;
    transform: rotate(12deg);
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.20));
}

.pearl-pw-shimmer-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 30%, rgba(253, 252, 250, 0.22) 0%, transparent 35%),
        radial-gradient(circle at 75% 70%, rgba(184, 169, 201, 0.20) 0%, transparent 40%);
    pointer-events: none;
}

.pearl-pw-shimmer-content {
    position: relative;
    z-index: 1;
}

.pearl-pw-eyebrow {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #FDFCFA;
    background: rgba(253, 252, 250, 0.12);
    border: 1px solid rgba(253, 252, 250, 0.20);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.pearl-pw-headline {
    font-family: 'Satoshi', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: #FDFCFA;
    line-height: 1.12;
    letter-spacing: -0.018em;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.20);
}

.pearl-pw-subhead {
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    color: rgba(253, 252, 250, 0.92);
    margin-top: 8px;
    font-weight: 400;
}

/* Analytic hero — non-win pipeline updates (in_review, pitched, samples_*, etc.)
   render a calmer hero, NO shimmer celebration. Same proportions, different tone. */
.pearl-pw-analytic-hero {
    position: relative;
    border-radius: 16px 16px 0 0;
    padding: 30px 36px 26px;
    margin: 0 -32px 22px;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.pearl-pw-analytic-hero--midfunnel {
    background:
        radial-gradient(circle at 80% 0%, rgba(138, 122, 187, 0.20) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(74, 153, 153, 0.14) 0%, transparent 55%),
        linear-gradient(145deg, rgba(184, 169, 201, 0.10) 0%, rgba(253, 252, 250, 0.7) 100%);
    color: var(--pearl-modal-text);
    box-shadow: inset 0 -1px 0 rgba(138, 122, 187, 0.18);
}

.pearl-pw-analytic-hero--loss {
    background:
        radial-gradient(circle at 75% 0%, rgba(184, 80, 96, 0.18) 0%, transparent 45%),
        linear-gradient(145deg, rgba(184, 80, 96, 0.08) 0%, rgba(253, 252, 250, 0.6) 100%);
    color: var(--pearl-modal-text);
    box-shadow: inset 0 -1px 0 rgba(184, 80, 96, 0.22);
}

.pearl-pw-analytic-eyebrow {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--pearl-modal-iris-faded);
    background: rgba(138, 122, 187, 0.12);
    border: 1px solid rgba(138, 122, 187, 0.22);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.pearl-pw-analytic-hero--loss .pearl-pw-analytic-eyebrow {
    color: var(--pearl-modal-brick);
    background: rgba(184, 80, 96, 0.10);
    border-color: rgba(184, 80, 96, 0.24);
}

.pearl-pw-analytic-headline {
    font-family: 'Satoshi', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.014em;
    color: var(--pearl-modal-text);
}

.pearl-pw-analytic-sub {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    color: var(--pearl-modal-text-muted);
    margin-top: 6px;
}

/* ===== PEARL NARRATIVE CARD — Pearl-detected detection / estimate / milestones.
   The intelligence-layer artifact that turns a form into a brief. Used across
   chassis (pipeline_win + sample_request + escalate) so Pearl's analysis is
   primary content, not buried below editable fields. ===== */
.pearl-narr-card {
    background:
        radial-gradient(circle at 85% 0%, rgba(138, 122, 187, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(74, 153, 153, 0.10) 0%, transparent 50%),
        linear-gradient(145deg, rgba(253, 252, 250, 0.95) 0%, rgba(248, 246, 241, 0.85) 100%);
    border: 1px solid rgba(184, 169, 201, 0.30);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(45, 36, 56, 0.04), 0 8px 28px rgba(138, 122, 187, 0.10);
}

.pearl-narr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--pearl-modal-iris-faded);
    margin-bottom: 12px;
}

.pearl-narr-eyebrow::before {
    content: '✦';
    color: var(--pearl-modal-iris);
    font-size: 14px;
    letter-spacing: 0;
}

.pearl-narr-detection {
    font-family: 'Satoshi', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--pearl-modal-text);
    line-height: 1.45;
    margin-bottom: 14px;
    letter-spacing: -0.005em;
}

.pearl-narr-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px dashed rgba(184, 169, 201, 0.30);
}

.pearl-narr-row-key {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-teal);
}

.pearl-narr-row-val {
    font-family: 'Satoshi', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--pearl-modal-iris-faded);
}

.pearl-narr-row-basis {
    font-size: 12px;
    color: var(--pearl-modal-text-muted);
    font-style: italic;
    padding: 0 0 8px;
    line-height: 1.45;
}

.pearl-narr-milestones {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px dashed rgba(184, 169, 201, 0.30);
}

.pearl-narr-milestones-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-teal);
    margin-bottom: 10px;
}

.pearl-narr-milestones-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pearl-narr-milestones-list li {
    padding-left: 26px;
    position: relative;
    font-size: 14px;
    color: var(--pearl-modal-text);
    line-height: 1.5;
}

.pearl-narr-milestones-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pearl-modal-iris) 0%, var(--pearl-modal-teal) 100%);
    box-shadow: 0 1px 4px rgba(138, 122, 187, 0.30);
}

.pearl-narr-milestones-list li::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pearl-modal-bg-from);
}

/* Refine details expandable — collapses the editable form behind a summary so
   the narrative is primary, form is secondary. Approve commits whatever's in
   the form whether it was expanded or not. */
.pearl-narr-refine {
    border: 1px solid var(--pearl-modal-border);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 14px;
    background: rgba(253, 252, 250, 0.5);
    overflow: hidden;
}

.pearl-narr-refine-summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--pearl-modal-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.15s ease;
}

.pearl-narr-refine-summary::-webkit-details-marker { display: none; }
.pearl-narr-refine-summary::marker { display: none; content: ''; }

.pearl-narr-refine-summary::after {
    content: '▼';
    font-size: 10px;
    color: var(--pearl-modal-iris);
    transition: transform 0.2s ease;
}

.pearl-narr-refine[open] .pearl-narr-refine-summary::after {
    transform: rotate(180deg);
}

.pearl-narr-refine-summary:hover { background: rgba(138, 122, 187, 0.04); }

.pearl-narr-refine-hint {
    font-weight: 400;
    font-size: 10px;
    color: var(--pearl-modal-text-muted);
    text-transform: lowercase;
    letter-spacing: 0;
    margin-left: 6px;
    font-style: italic;
}

.pearl-narr-refine > form,
.pearl-narr-refine > .pearl-modal-form {
    padding: 6px 16px 16px;
    border-top: 1px solid var(--pearl-modal-border);
    background: var(--pearl-modal-bg-from);
}

/* ===== UPDATE CONTACT (side-by-side diff) ===== */
.pearl-modal--update-contact {
    background: linear-gradient(145deg, #FDFCFA 0%, #F5F0E8 100%);
}

.pearl-uc-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(196, 149, 10, 0.06);
    border: 1px solid rgba(196, 149, 10, 0.22);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.pearl-uc-alert--new {
    background: linear-gradient(135deg, rgba(74, 153, 153, 0.06) 0%, rgba(138, 122, 187, 0.06) 100%);
    border-color: rgba(74, 153, 153, 0.28);
}

.pearl-uc-alert--new .pearl-uc-alert-icon { color: var(--pearl-modal-teal); }
.pearl-uc-alert--new .pearl-uc-alert-title { color: var(--pearl-modal-teal); }

.pearl-uc-alert-icon {
    color: #C4950A;
    font-size: 20px;
    font-weight: 700;
    margin-top: 1px;
}

.pearl-uc-alert-title {
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #2C2C2C;
}

.pearl-uc-alert-sub {
    font-size: 12px;
    color: var(--pearl-modal-text-muted);
    margin-top: 2px;
}

.pearl-uc-diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.pearl-uc-diff-grid--single {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.pearl-uc-diff-card {
    border-radius: 14px;
    padding: 14px 16px;
    background: var(--pearl-modal-bg-from);
}

.pearl-uc-diff-card-existing {
    border: 1px solid var(--pearl-modal-border);
    opacity: 0.85;
}

.pearl-uc-diff-card-proposed {
    border: 1px solid rgba(138, 122, 187, 0.32);
    background: linear-gradient(145deg, rgba(138, 122, 187, 0.04) 0%, rgba(138, 122, 187, 0.01) 100%);
}

.pearl-uc-diff-card-header {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-teal);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pearl-modal-border);
}

.pearl-uc-diff-card-proposed .pearl-uc-diff-card-header {
    color: var(--pearl-modal-iris-faded);
}

.pearl-uc-diff-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 12.5px;
    border-bottom: 1px dashed rgba(184, 169, 201, 0.18);
}

.pearl-uc-diff-row:last-child { border-bottom: none; }

.pearl-uc-diff-key {
    color: var(--pearl-modal-text-muted);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 56px;
}

.pearl-uc-diff-val {
    color: var(--pearl-modal-text);
    text-align: right;
    word-break: break-word;
    flex: 1;
}

.pearl-uc-diff-row.pearl-uc-diff-changed .pearl-uc-diff-val {
    color: var(--pearl-modal-iris-faded);
    font-weight: 600;
}

.pearl-uc-diff-empty {
    color: var(--pearl-modal-text-dim);
    font-style: italic;
}

.pearl-uc-footnote {
    font-size: 12px;
    color: var(--pearl-modal-text-muted);
    padding: 10px 14px;
    background: rgba(138, 122, 187, 0.04);
    border-radius: 10px;
    margin-bottom: 16px;
}

.pearl-uc-footnote strong {
    color: var(--pearl-modal-iris-faded);
    font-weight: 600;
}

.pearl-uc-divider {
    height: 1px;
    background: var(--pearl-modal-border);
    margin: 4px 0;
}

/* ===== ESCALATE ===== */
.pearl-modal--escalate {
    background: linear-gradient(145deg, #FDFCFA 0%, #F8F0F1 100%);
}

.pearl-esc-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(184, 80, 96, 0.06);
    border: 1px solid rgba(184, 80, 96, 0.22);
    border-left: 3px solid var(--pearl-modal-brick);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.pearl-esc-alert-icon {
    color: var(--pearl-modal-brick);
    font-size: 20px;
    font-weight: 700;
    margin-top: 1px;
}

.pearl-esc-alert-title {
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--pearl-modal-brick);
}

.pearl-esc-alert-sub {
    font-size: 12.5px;
    color: var(--pearl-modal-text);
    margin-top: 2px;
    line-height: 1.5;
}

.pearl-esc-hero {
    background: var(--pearl-modal-bg-from);
    border: 1px solid var(--pearl-modal-border);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.pearl-esc-hero-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(184, 169, 201, 0.20);
    font-size: 13px;
}

.pearl-esc-hero-row:last-child { border-bottom: none; }

.pearl-esc-hero-key {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-teal);
}

.pearl-esc-hero-val {
    color: var(--pearl-modal-text);
    font-weight: 500;
}

.pearl-esc-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pearl-esc-pill--critical, .pearl-esc-pill--high {
    background: rgba(184, 80, 96, 0.12);
    color: var(--pearl-modal-brick);
}

.pearl-esc-pill--medium {
    background: rgba(196, 149, 10, 0.12);
    color: #C4950A;
}

.pearl-esc-pill--low {
    background: rgba(74, 153, 153, 0.12);
    color: var(--pearl-modal-teal);
}

/* RECOMMEND — escalate: dual-bordered card (iris top + iris bottom rule)
   with a "✦" sparkle decoration. Reads as Pearl's voice speaking forward. */
.pearl-esc-recommend-card {
    background: linear-gradient(180deg, rgba(138, 122, 187, 0.06) 0%, rgba(253, 252, 250, 0.0) 100%);
    border-top: 2px solid rgba(138, 122, 187, 0.45);
    border-bottom: 2px solid rgba(138, 122, 187, 0.45);
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 16px 4px 18px;
    margin: 8px 0 4px;
    position: relative;
}

.pearl-esc-recommend-card::before {
    content: '✦';
    position: absolute;
    top: -14px;
    left: 18px;
    background: var(--pearl-modal-bg-from);
    color: var(--pearl-modal-iris);
    font-size: 18px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(138, 122, 187, 0.45);
}

.pearl-esc-recommend-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-iris-faded);
    margin-bottom: 6px;
}

.pearl-esc-recommend-text {
    font-size: 13px;
    color: var(--pearl-modal-text);
    line-height: 1.5;
    margin-bottom: 10px;
}

.pearl-esc-recommend-textarea {
    background: var(--pearl-modal-bg-from) !important;
}

/* ===== HUMAN JUDGMENT ===== */
.pearl-modal--human-judgment {
    background: linear-gradient(145deg, #FDFCFA 0%, #F5F0E8 100%);
}

.pearl-hj-question-hero {
    background: linear-gradient(135deg, rgba(138, 122, 187, 0.08) 0%, rgba(138, 122, 187, 0.02) 100%);
    border: 1px solid rgba(138, 122, 187, 0.24);
    border-left: 3px solid var(--pearl-modal-iris);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 18px;
}

.pearl-hj-question-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--pearl-modal-iris-faded);
    margin-bottom: 8px;
}

.pearl-hj-question-text {
    font-family: 'Satoshi', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--pearl-modal-text);
    line-height: 1.4;
}

.pearl-hj-examples {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--pearl-modal-border);
}

.pearl-hj-examples-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--pearl-modal-teal);
    margin-bottom: 8px;
}

.pearl-hj-example-chip {
    display: inline-block;
    background: rgba(74, 153, 153, 0.06);
    border: 1px solid rgba(74, 153, 153, 0.20);
    color: var(--pearl-modal-text);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    margin: 0 4px 6px 0;
    transition: all 0.15s ease;
}

.pearl-hj-example-chip:hover {
    background: rgba(74, 153, 153, 0.14);
    border-color: var(--pearl-modal-teal);
}

.pearl-hj-footnote {
    font-size: 12px;
    color: var(--pearl-modal-text-muted);
    padding: 10px 14px;
    background: rgba(138, 122, 187, 0.04);
    border-radius: 10px;
    margin-top: 8px;
    font-style: italic;
}

/* Body padding scoped per chassis — luxe layouts get more breathing room. */
.pearl-modal-body--sample-request,
.pearl-modal-body--draft-email,
.pearl-modal-body--pipeline-win,
.pearl-modal-body--update-contact,
.pearl-modal-body--escalate,
.pearl-modal-body--human-judgment {
    padding: 4px 32px 24px;
}

/* Pipeline Win has a celebratory shimmer hero that fills the top edge —
   it needs zero top padding so the banner sits flush against the
   decoration-edge gradient. */
.pearl-modal-body--pipeline-win { padding: 0 32px 24px; }
.pearl-modal--pipeline-win .pearl-modal-header { padding-bottom: 6px; }

@media (max-width: 640px) {
    .pearl-uc-diff-grid { grid-template-columns: 1fr; }
    .pearl-modal-form--two-col .pearl-form-row { grid-template-columns: 1fr; }
    .pearl-de-to-row { flex-direction: column; gap: 8px; }
    .pearl-de-avatar { margin-top: 0; }
}
