/* ===================================================================
   Design Tokens — single source of truth for type, color, spacing.
   Spacing is on an 8px grid (4px half-steps allowed).
=================================================================== */
:root {
    /* Brand */
    --color-brand: #008BFF;
    --color-brand-hover: #0070d6;
    --color-brand-ring: rgba(0, 139, 255, 0.15);

    /* Neutral ramp */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Semantic */
    --color-text: var(--color-gray-900);
    --color-text-secondary: var(--color-gray-600);
    --color-text-muted: var(--color-gray-500);
    --color-bg: #f8faff;
    --color-surface: #fff;
    --color-surface-subtle: #fafbff;
    --color-border: var(--color-gray-200);
    --color-border-strong: var(--color-gray-300);

    /* Type */
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 36px;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;

    /* Spacing (8px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

    /* Transitions */
    --transition-fast: 0.12s ease;
    --transition-base: 0.18s ease;
}

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6) var(--space-16);
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.page-header-text {
    flex: 1;
    min-width: 0;
}
.dash-link-btn {
    display: inline-block;
    padding: var(--space-3) var(--space-5);
    background: var(--color-gray-900);
    color: #fff;
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
    margin-top: var(--space-2);
}
.dash-link-btn:hover {
    background: var(--color-gray-800);
    transform: translateY(-1px);
}
.hinge-meme {
    width: 220px;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    flex-shrink: 0;
    position: relative;
    background: #fff;
}
.hinge-meme img {
    /* Crop the gray border around the original */
    position: absolute;
    width: 122%;
    height: auto;
    top: -8%;
    left: -11%;
    display: block;
}

.meme-bottom {
    max-width: 540px;
    margin: 56px auto 0;
    aspect-ratio: 640 / 450; /* visible area after cropping top header */
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    position: relative;
}
.meme-bottom img {
    position: absolute;
    top: -22%; /* crop the top iOS chrome (status bar + Messages header) */
    left: 0;
    width: 100%;
    height: auto;
    display: block;
}

.page-header {
    margin-bottom: var(--space-8);
}
.page-header h1,
.page-header a.page-title-with-mark {
    font-size: var(--text-4xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    color: inherit;
    text-decoration: none;
}
.page-title-with-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
a.page-title-with-mark {
    cursor: pointer;
    transition: opacity 0.15s;
}
a.page-title-with-mark:hover {
    opacity: 0.7;
}
.page-title-mark {
    height: 72px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.beta-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #008BFF 0%, #6366f1 60%, #a855f7 100%);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    vertical-align: middle;
    position: relative;
    top: -14px;
    animation: beta-shimmer 3s ease-in-out infinite;
}
@keyframes beta-shimmer {
    0%, 100% { box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
    50% { box-shadow: 0 6px 22px rgba(168, 85, 247, 0.55); }
}
.page-header p {
    color: #6b7280;
    margin-top: 10px;
    font-size: 18px;
    font-style: italic;
}

.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .page { padding: 20px 16px 48px; }
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-header h1 { font-size: 28px; }
    .page-title-with-mark { flex-wrap: wrap; }
    .page-title-mark { height: 44px; }
    .beta-badge { top: -8px; font-size: 11px; padding: 3px 8px; }
    .page-header p { font-size: 15px; margin-top: 6px; }
    .dash-link-btn { margin-top: 0; }
}

/* ---------- Controls ---------- */
.controls {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.control-group {
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}
.control-group:last-child { border-bottom: 0; }

.control-group h2 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 10px;
}
.optional-note {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #9ca3af;
    margin-left: 6px;
    font-size: 11px;
}

.controls label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
}
.controls input[type="text"],
.controls textarea {
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    background: #fafafa;
    color: #111;
    resize: vertical;
}
.controls input[type="text"]:focus,
.controls textarea:focus {
    outline: none;
    border-color: #2d6cdf;
    background: #fff;
}
.controls input[type="file"] {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.ae-dropdown {
    position: relative;
    margin-top: 6px;
}
.ae-field-label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}
.ae-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    font-family: inherit;
    font-size: 13px;
    color: #111;
    cursor: pointer;
    text-align: left;
}
.ae-dropdown-toggle:focus {
    outline: none;
    border-color: #2d6cdf;
    background: #fff;
}
.ae-dropdown-toggle .ae-name { flex: 1; }
.ae-dropdown-toggle .ae-caret {
    color: #9ca3af;
    font-size: 11px;
    transition: transform 0.15s ease;
}
.ae-dropdown[data-open="true"] .ae-caret { transform: rotate(180deg); }
.ae-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.ae-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    z-index: 20;
}
.ae-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #111;
    cursor: pointer;
}
.ae-dropdown-option:hover,
.ae-dropdown-option[aria-selected="true"] {
    background: #f3f4f6;
}
.ae-dropdown-option .ae-check {
    margin-left: auto;
    color: #2d6cdf;
    font-weight: 600;
    visibility: hidden;
}
.ae-dropdown-option[aria-selected="true"] .ae-check { visibility: visible; }

.small-btn {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background var(--transition-fast);
}
.small-btn:hover { background: #f9fafb; }

.primary-btn {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-brand);
    color: #fff;
    border: 0;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    font-family: inherit;
    transition: background var(--transition-fast), transform var(--transition-fast);
    cursor: pointer;
    transition: background 0.15s;
}
.primary-btn:hover { background: var(--color-brand-hover); transform: translateY(-1px); }
.primary-btn:focus-visible { outline: 2px solid var(--color-brand-ring); outline-offset: 2px; }

.secondary-btn {
    width: 100%;
    margin-top: var(--space-2);
    padding: var(--space-3);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-family: inherit;
    transition: background var(--transition-fast);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}
.secondary-btn:hover { background: var(--color-gray-50); }

.hint { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; }

/* ---------- Proposal Preview ---------- */
.proposal-preview-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}
.preview-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #111;
}
.proposal-preview-frame {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    overflow: hidden;
}
.proposal-preview-inner {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
}
.pp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pp-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: #4b5563;
    flex-shrink: 0;
    overflow: hidden;
}
.pp-brand-mark img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.pp-eyebrow {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}
.pp-client {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0;
}
.pp-contact {
    font-size: 11px;
    color: #6b7280;
    margin: 0;
}
.pp-contact-title {
    font-size: 10px;
    color: #9ca3af;
    margin: 0;
}
.pp-wordmark {
    height: 28px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.pp-section {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
}
.pp-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111;
}
.pp-section-eyebrow {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #008BFF;
    margin-bottom: 4px;
}
.pp-section-lead {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    margin: 0;
}

.pp-phones-placeholder {
    text-align: center;
    padding: 28px 24px;
    background: #f9fafb;
}
.pp-phones-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.pp-cta-wrap {
    margin-top: 12px;
    text-align: center;
}
.pp-cta {
    display: inline-block;
    padding: 10px 28px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.pp-cta-blue {
    background: #008BFF;
}

.pp-footer {
    padding: 16px 24px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
}
.pp-link {
    color: #008BFF;
}
.slug-hint { text-align: left; margin-top: -4px; margin-bottom: 12px; }
.slug-hint code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #1f2937;
}
.file-name {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
}

.integration-hint {
    text-align: left;
    margin-top: 0;
    margin-bottom: 12px;
    font-style: italic;
}
.integration-option {
    display: flex !important;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    min-height: 64px;
    background: var(--color-gray-50);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: not-allowed;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
}
.integration-option .integration-logo {
    width: 36px;
    height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 4px;
    box-sizing: border-box;
}
.controls label.integration-option {
    font-weight: 600;
    color: #111827;
}
.integration-option input[type="checkbox"] {
    margin: 0;
    cursor: not-allowed;
    accent-color: #008BFF;
}
.integration-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}
.integration-option.integration-active,
.integration-option.integration-active input[type="checkbox"] {
    cursor: pointer;
}
.integration-option span:nth-child(2) {
    flex: 1;
}
.integration-lock {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 700;
}
.controls label.integration-suboption {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 32px;
    margin-top: -2px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}
.integration-suboption input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.payment-link-field {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 4px;
}
.payment-link-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}
.payment-link-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.payment-link-input-wrap:focus-within {
    border-color: #008BFF;
    box-shadow: 0 0 0 3px rgba(0, 139, 255, 0.15);
}
.payment-link-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 12px;
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}
.payment-link-input {
    flex: 1;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    padding: 10px 14px 10px 10px;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    border-radius: 10px;
}
.payment-link-input::placeholder {
    color: #9ca3af;
}
.intro-body p + p {
    margin-top: var(--space-3);
}
.plan-dependent-group {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--color-border);
}
.plan-dependent-hint {
    text-align: left;
    margin: 0 0 var(--space-2);
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
}
.api-signup-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}
#ppIntroBody,
#introBody {
    white-space: pre-line;
}

/* ---------- Preview ---------- */
/* ---------- Mobile Preview (inside preview column) ---------- */
.previews-divider {
    margin: 48px 0 0;
    border-top: 1px solid #e5e7eb;
}
.preview-label-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 24px;
    margin-bottom: 20px;
}
.preview-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}
.mobile-preview-standalone {
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
}
.mobile-frame {
    width: 375px;
    height: 812px;
    background: #111;
    border-radius: 44px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2), 0 0 0 2px #1d1d1f;
    position: relative;
    overflow: hidden;
}
.mobile-notch {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 26px;
    background: #000;
    border-radius: 999px;
    z-index: 5;
}
.mobile-screen {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 34px;
    background: #fafafa;
    display: block;
}

.preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-width: 0;
}
.preview-wrap > .proposal {
    max-width: none;
    padding: 0;
}
.preview-wrap .proposal-content {
    background: #fafafa;
    border-radius: 16px;
    overflow: hidden;
}
.preview-wrap .comparison-section {
    background: #fff;
}

.comparison {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    padding: 48px 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.comparison.mode-without .side-right,
.comparison.mode-without .vs,
.comparison.mode-with .side-left,
.comparison.mode-with .vs {
    display: none;
}
.comparison.mode-without,
.comparison.mode-with {
    justify-content: center;
}

.comparison-mode-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.controls label.comparison-mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
}
.controls label.comparison-mode-option:has(input:checked) {
    border-color: #008BFF;
    background: #eff6ff;
    color: #111827;
}
.comparison-mode-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.side {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.side-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1f2937;
    margin-bottom: 16px;
    padding: 6px 14px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.side-label-right {
    background: #d6e8ff;
    color: #1a1a2e;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sendblue-logo-inline {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    mix-blend-mode: multiply;
    margin-top: -4px;
}

.vs {
    font-size: 18px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.1em;
    padding: 8px 14px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ---------- Template-based phones (real screenshots) ---------- */
.phone-template {
    width: 320px;
    aspect-ratio: 1320 / 2868;
    border-radius: 44px;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25), 0 0 0 2px #1d1d1f;
    line-height: 0;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.template-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    user-select: none;
}
.tpl-overlay {
    position: absolute;
    line-height: 1.3;
    box-sizing: border-box;
}

/* SMS avatar overlay — overlaps pill from above */
.tpl-avatar-sms {
    top: 4.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 16%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(180deg, #8e8a9e 0%, #6c6a7a 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px #000;
    z-index: 5;
}
.tpl-avatar-sms svg {
    width: 62%;
    height: 62%;
    color: #ffffff;
    display: block;
    margin-top: 10%;
}

/* iMessage avatar overlay — overlaps pill from above */
.tpl-avatar {
    top: 4.5%;
    left: 50%;
    transform: translateX(-50%);
    width: 16%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #3a3a3c;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ebebf0;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 0 0 3px #000;
    z-index: 5;
}
.tpl-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Name pill overlays — masks existing pill text */
.tpl-name-sms,
.tpl-name-imsg {
    left: 50%;
    transform: translateX(-50%);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.08) 100%),
        rgba(60, 60, 67, 0.55);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    color: #fff;
    padding: 6px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    z-index: 4;
    letter-spacing: -0.01em;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.tpl-name-sms { top: 12%; }
.tpl-name-imsg { top: 12%; }
/* Wide black strip behind pills to cover original text */
.phone-template-sms::before,
.phone-template-imsg::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 11%;
    height: 5%;
    background: #000;
    z-index: 3;
    pointer-events: none;
}

/* Message bubble overlays — masks existing bubbles */
.tpl-bubbles {
    left: 3%;
    right: 3%;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 6px;
    align-items: flex-start;
    z-index: 1;
}
.tpl-bubbles-sms {
    top: 21%;
    bottom: 16%;
}
.tpl-spam-bottom {
    margin-top: 12px;
    margin-left: -6px;
    margin-right: -6px;
    align-self: stretch;
    text-align: center;
    left: 4%;
    right: 4%;
    text-align: center;
    z-index: 2;
}
.tpl-spam-bottom .tpl-spam-text {
    font-size: 9.5px;
    color: #8e8e93;
    line-height: 1.35;
    margin-bottom: 7px;
    padding: 0 8px;
}
.tpl-spam-bottom .tpl-spam-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    width: 100%;
}
.tpl-spam-bottom .tpl-spam-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 999px;
    border: 0;
    background: #1c1c1e;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    font-family: inherit;
}
.tpl-spam-bottom .tpl-spam-btn-delete { color: #ff453a; }
.tpl-spam-bottom .tpl-spam-btn-known { color: #0a84ff; }
.tpl-bubbles-imsg {
    top: 21%;
    bottom: 13%;
}
.tpl-bubbles .bubble {
    max-width: 78%;
    padding: 7px 12px 8px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.3;
    color: #fff;
    background: #2c2c2e;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin-left: 4px;
    letter-spacing: -0.01em;
}

/* ---------- Phone frame (iOS dark) ---------- */
.phone {
    width: 320px;
    height: 660px;
    background: #111;
    border-radius: 44px;
    padding: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25), 0 0 0 2px #1d1d1f;
    position: relative;
}
.phone-notch {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 26px;
    background: #000;
    border-radius: 999px;
    z-index: 5;
}
.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    border-radius: 36px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    font-size: 14px;
}

/* Status bar */
.status-bar {
    height: 50px;
    padding: 16px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.01em;
}
.status-left {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.status-moon {
    width: 13px;
    height: 13px;
    color: #fff;
    opacity: 0.95;
}
.status-icons { display: flex; gap: 6px; align-items: center; }
.signal-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}
.signal-bars i {
    width: 3px;
    background: #fff;
    border-radius: 1px;
    display: block;
}
.signal-bars i:nth-child(1) { height: 4px; }
.signal-bars i:nth-child(2) { height: 6px; }
.signal-bars i:nth-child(3) { height: 8px; }
.signal-bars i:nth-child(4) { height: 10px; opacity: 0.4; }
.wifi-icon { width: 16px; height: 12px; color: #fff; }

.battery-pill {
    width: 28px;
    height: 13px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 4px;
    position: relative;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.battery-pill::before {
    content: '';
    position: absolute;
    inset: 1.5px;
    background: #34d158;
    border-radius: 2px;
}
.battery-pill::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 3.5px;
    width: 2px;
    height: 4px;
    background: rgba(255,255,255,0.45);
    border-radius: 0 1px 1px 0;
}
.battery-text {
    position: relative;
    z-index: 1;
    font-size: 8px;
    font-weight: 700;
    color: #000;
    line-height: 1;
}
.battery-bolt {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 12px;
    z-index: 2;
}
.battery-bolt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    clip-path: polygon(55% 0, 0 60%, 38% 60%, 25% 100%, 80% 35%, 45% 35%);
}

/* Chat header */
.chat-header-ios {
    padding: 4px 14px 8px;
    display: grid;
    grid-template-columns: 44px 1fr 36px;
    align-items: start;
    gap: 4px;
    background: #000;
    position: relative;
    min-height: 96px;
}
.back-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #fff;
    justify-self: start;
    align-self: center;
    padding: 4px 6px 4px 2px;
    background: #1c1c1e;
    border-radius: 999px;
    height: 30px;
    margin-top: 6px;
}
.back-arrow {
    font-size: 20px;
    line-height: 1;
    font-weight: 500;
    color: #fff;
    padding: 0 4px;
}
.back-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #fff;
    color: #000;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.chat-peer-col {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 0;
    padding-top: 0;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar-sms {
    background: #555;
}
.avatar-sms svg {
    width: 38px;
    height: 38px;
    color: #d1d1d6;
}
.avatar-imsg {
    background: #3a3a3c;
    font-size: 18px;
    font-weight: 600;
    color: #ebebf0;
}
.avatar-imsg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.peer-name-large {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    padding: 4px 12px;
    background: #1c1c1e;
    border-radius: 999px;
    white-space: nowrap;
    margin-top: -8px;
    position: relative;
    z-index: 2;
}

.header-action {
    grid-column: 3;
    align-self: center;
    margin-top: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1c1c1e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.header-action svg {
    width: 16px;
    height: 12px;
}

/* Message meta (type + date) */
.message-meta {
    padding: 4px 12px 8px;
    text-align: center;
    background: #000;
}
.message-type {
    font-size: 11px;
    color: #8e8e93;
    font-weight: 400;
}
.message-date {
    font-size: 11px;
    color: #8e8e93;
    font-weight: 600;
    margin-top: 1px;
}

/* Messages */
.messages {
    flex: 1;
    padding: 4px 12px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #000;
}

.bubble {
    max-width: 78%;
    padding: 9px 15px 10px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.3;
    word-wrap: break-word;
    white-space: pre-wrap;
    color: #fff;
    background: #2c2c2e;
    position: relative;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.bubble-group + .bubble-group { margin-top: 4px; }

.bubble-sms,
.bubble-imsg {
    align-self: flex-start;
    background: #2c2c2e;
    color: #fff;
    border-bottom-left-radius: 5px;
    margin-left: 6px;
}

/* iOS-style tail on incoming bubbles */
.bubble-sms::before,
.bubble-imsg::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -7px;
    width: 14px;
    height: 16px;
    background: #2c2c2e;
    border-bottom-right-radius: 14px;
    z-index: -1;
}
.bubble-sms::after,
.bubble-imsg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 10px;
    height: 16px;
    background: #000;
    border-bottom-right-radius: 10px;
    z-index: -1;
}

/* Staggered bubble animation (proposal page) */
.bubble-anim {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.bubble-anim.bubble-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---- Reply-to-reply multi-type fieldset ---- */
.r2r-group {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px 6px;
    margin: 10px 0 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.r2r-group * { min-width: 0; }
.r2r-group input[type="file"] {
    max-width: 100%;
}
.r2r-group legend {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    padding: 0 6px;
}
.controls label.r2r-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    padding: 6px 4px;
    margin: 0;
    cursor: pointer;
}
.controls label.r2r-check input[type="checkbox"] {
    margin: 0;
}
.controls label.r2r-input {
    display: block;
    margin: 2px 0 8px 24px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}
.controls label.r2r-check.r2r-locked {
    color: #9ca3af;
    cursor: not-allowed;
}
.controls label.r2r-check.r2r-locked input[type="checkbox"] {
    cursor: not-allowed;
}
.r2r-lock {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.7;
}

/* ---- Special bubbles: video / voice memo / contact card ---- */
.bubble-special {
    align-self: flex-start;
    margin-left: 6px;
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Video tile */
.bubble-special-video .video-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bubble-special-video .video-thumb {
    width: 180px;
    height: 240px;
    border-radius: 14px;
    background: linear-gradient(160deg, #1f1f21 0%, #3a3a3c 100%);
    position: relative;
    overflow: hidden;
}
.bubble-special-video .video-play {
    position: absolute;
    top: 50%; left: 50%;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%);
}
.bubble-special-video .video-play::after {
    content: '';
    position: absolute;
    top: 50%; left: 56%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #fff;
}
.bubble-special-video .video-caption {
    color: #fff;
    font-size: 13px;
    padding: 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Voice memo */
.bubble-special-voice {
    background: #2c2c2e;
    color: #fff;
    border-radius: 10px 10px 10px 5px;
    padding: 5px 10px 7px 5px;
    gap: 2px;
    max-width: 80%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
}
.bubble-special-voice .voice-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    box-sizing: border-box;
}
.bubble-special-voice .voice-transcript {
    color: #a1a1a6;
    font-size: 11px;
    line-height: 1.35;
    padding: 0 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}
.bubble-special-voice .voice-play {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: #0b84ff;
    position: relative;
}
.bubble-special-voice .voice-play::after {
    content: '';
    position: absolute;
    top: 50%; left: 57%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 5px 0 5px 7.5px;
    border-color: transparent transparent transparent #fff;
}
.bubble-special-voice .voice-waveform {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.8px;
    height: 24px;
    overflow: hidden;
}
.bubble-special-voice .voice-bar {
    display: inline-block;
    width: 1.8px;
    background: #0b84ff;
    border-radius: 2px;
    min-height: 1.8px;
    flex: 0 0 1.8px;
}
.bubble-special-voice .voice-duration {
    font-size: 11px;
    color: #d1d1d6;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Contact card */
.bubble-special-contact .contact-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2c2c2e;
    color: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 5px;
    padding: 7px 10px 7px 12px;
    max-width: 190px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    position: relative;
}
.bubble-special-contact .contact-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -7px;
    width: 14px;
    height: 16px;
    background: #2c2c2e;
    border-bottom-right-radius: 14px;
    z-index: -1;
}
.bubble-special-contact .contact-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 10px;
    height: 16px;
    background: #000;
    border-bottom-right-radius: 10px;
    z-index: -1;
}
.bubble-special-contact .contact-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}
.bubble-special-contact .contact-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #3a3a3c;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    flex-shrink: 0;
}
.bubble-special-contact .contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bubble-special-contact .contact-chevron {
    color: #8e8e93;
    font-size: 14px;
    line-height: 1;
}

/* iMessage typing indicator — three pulsing dots */
.typing-indicator {
    align-self: flex-start;
    background: #2c2c2e;
    padding: 10px 14px;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    margin-left: 6px;
    margin-bottom: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.typing-indicator.typing-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.typing-indicator.typing-outgoing {
    align-self: flex-end;
    background: #2c2c2e;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 6px;
    margin-left: 0;
    margin-right: 6px;
}
/* Outgoing typing uses iMessage blue / SMS green */
.typing-indicator.typing-sms-reply { background: #34c759; }
.typing-indicator.typing-imsg-reply { background: #007aff; }

/* Incoming bubble tail for typing indicator */
.typing-indicator:not(.typing-outgoing)::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -7px;
    width: 14px;
    height: 16px;
    background: #2c2c2e;
    border-bottom-right-radius: 14px;
    z-index: -1;
}
.typing-indicator:not(.typing-outgoing)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 10px;
    height: 16px;
    background: #000;
    border-bottom-right-radius: 10px;
    z-index: -1;
}
/* Outgoing tail */
.typing-indicator.typing-outgoing::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -7px;
    width: 14px;
    height: 16px;
    background: inherit;
    border-bottom-left-radius: 14px;
    z-index: -1;
}
.typing-indicator.typing-outgoing::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 10px;
    height: 16px;
    background: #000;
    border-bottom-left-radius: 10px;
    z-index: -1;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8e8e93;
    animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing-indicator.typing-sms-reply .typing-dot,
.typing-indicator.typing-imsg-reply .typing-dot {
    background: rgba(255, 255, 255, 0.7);
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Reply bubbles — outgoing, aligned right with tail */
.bubble-reply-sms,
.bubble-reply-imsg {
    align-self: flex-end !important;
    border-bottom-right-radius: 5px !important;
    border-bottom-left-radius: 18px !important;
    margin-left: 0 !important;
    margin-right: 6px;
    position: relative;
}
.bubble-reply-sms::before,
.bubble-reply-imsg::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -7px;
    width: 14px;
    height: 16px;
    z-index: -1;
}
.bubble-reply-sms::after,
.bubble-reply-imsg::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 10px;
    height: 16px;
    background: #000;
    border-bottom-left-radius: 10px;
    z-index: -1;
}
.bubble-reply-sms {
    background: #34c759 !important;
    color: #fff !important;
}
.bubble-reply-sms::before {
    background: #34c759;
    border-bottom-left-radius: 14px;
}
.bubble-reply-imsg {
    background: #007aff !important;
    color: #fff !important;
}
.bubble-reply-imsg::before {
    background: #007aff;
    border-bottom-left-radius: 14px;
}

/* Blue-looking "links" in bubbles */
.bubble a,
.bubble .link { color: #0a84ff; text-decoration: underline; }

/* Spam footer (SMS side only) */
.spam-footer {
    padding: 14px 16px 12px;
    background: #000;
    text-align: center;
}
.spam-notice {
    font-size: 12px;
    color: #8e8e93;
    line-height: 1.35;
    margin-bottom: 10px;
    padding: 0 8px;
}
.spam-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.spam-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 999px;
    border: 0;
    background: #1c1c1e;
    font-size: 15px;
    font-weight: 500;
    cursor: default;
    font-family: inherit;
}
.spam-btn-delete { color: #ff453a; }
.spam-btn-known { color: #0a84ff; }

/* Input bar */
.input-bar {
    padding: 8px 12px 18px;
    background: #000;
}
.input-bar-ios {
    display: flex;
    align-items: center;
    gap: 8px;
}
.input-plus {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1c1c1e;
    color: #8e8e93;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    flex-shrink: 0;
    line-height: 1;
}
.input-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 14px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    font-size: 14px;
    color: #8e8e93;
    min-height: 32px;
    position: relative;
}
.input-mic {
    width: 14px;
    height: 16px;
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    background:
        radial-gradient(ellipse 5px 7px at 50% 35%, #8e8e93 50%, transparent 51%) no-repeat,
        linear-gradient(#8e8e93, #8e8e93) no-repeat 50% 78% / 8px 1.5px,
        linear-gradient(#8e8e93, #8e8e93) no-repeat 50% 100% / 1.5px 4px;
}
.input-placeholder::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 16px;
    margin-left: 8px;
    background:
        radial-gradient(ellipse 5px 7px at 50% 35%, #8e8e93 50%, transparent 51%) no-repeat,
        linear-gradient(#8e8e93, #8e8e93) no-repeat 50% 78% / 8px 1.5px,
        linear-gradient(#8e8e93, #8e8e93) no-repeat 50% 100% / 1.5px 4px;
}
.input-mic { display: none; }

/* ---------- Proposal page ---------- */
.proposal-body {
    background: #fafafa;
}

.proposal {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.not-found {
    max-width: 520px;
    margin: 80px auto;
    text-align: center;
    background: #fff;
    padding: 40px 28px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.not-found h1 { font-size: 22px; margin-bottom: 10px; }
.not-found p { color: #6b7280; margin-bottom: 20px; font-size: 14px; }

.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}
.proposal-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand-mark {
    height: 56px;
    min-width: 56px;
    max-width: 120px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 600;
    font-size: 20px;
    color: #4b5563;
    flex-shrink: 0;
}
.brand-mark.brand-mark-initials {
    width: 56px;
    padding: 0;
}
.brand-mark img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.proposal-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 2px;
}
.proposal-client-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.proposal-contact-name {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}
.proposal-contact-title {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    margin-top: 1px;
}
.call-cta-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.integration-heading {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-2);
    min-height: 64px;
}
.integration-logo {
    height: 56px;
    width: 56px;
    object-fit: contain;
    border-radius: var(--radius-md);
    display: block;
    align-self: center;
}
.integration-logo-sendblue {
    height: 64px;
    width: 64px;
    border-radius: 0;
}
.heading-inline-logo {
    height: 0.85em;
    width: auto;
    margin-left: 0.35em;
    vertical-align: middle;
    position: relative;
    top: -0.15em;
}
.integration-logo-company {
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-weight: 700;
    font-size: 20px;
}
.integration-logo-company img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.integration-plus {
    font-size: 28px;
    font-weight: 300;
    color: #9ca3af;
}
.ghl-video-caption {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 16px;
    margin-bottom: 8px;
}
.ghl-video-wrap + .ghl-video-caption {
    margin-top: 32px;
}
.ghl-video-wrap {
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
}
.ghl-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}
.api-docs-wrap {
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.api-docs-frame {
    width: 100%;
    height: 720px;
    border: 0;
    display: block;
}
.api-docs-fallback {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}
.api-docs-fallback a {
    color: #2d6cdf;
    font-weight: 600;
    text-decoration: none;
}
.api-docs-fallback a:hover { text-decoration: underline; }

/* Checkbox styling */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-top: 12px;
    font-weight: 500;
    color: #374151;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #008BFF;
}
.proposal-edit-link {
    font-size: 13px;
    color: #2d6cdf;
    text-decoration: none;
    font-weight: 500;
}
.proposal-edit-link:hover { text-decoration: underline; }

.proposal-sendblue-mark {
    height: 72px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.proposal-section {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-8);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--color-border);
}

/* ---------- Onboarding & next steps ---------- */
.onboarding-section .section-lead { margin-bottom: 24px; }
.onboarding-block {
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-subtle);
    margin-bottom: var(--space-4);
}
.onboarding-block-heading {
    font-size: var(--text-md);
    font-weight: var(--fw-bold);
    color: var(--color-brand);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-3);
}
.onboarding-steps {
    list-style: none;
    counter-reset: onboarding-step;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.onboarding-steps li {
    position: relative;
    padding-left: 36px;
    font-size: 14px;
    line-height: 1.5;
    color: #0f172a;
    counter-increment: onboarding-step;
}
.onboarding-steps li::before {
    content: counter(onboarding-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: #0b84ff;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.onboarding-bullets {
    counter-reset: none;
}
.onboarding-bullets li {
    counter-increment: none;
    padding-left: 22px;
}
.onboarding-bullets li::before {
    content: '';
    width: 8px;
    height: 8px;
    top: 8px;
    left: 4px;
    background: #0b84ff;
}
.onboarding-note {
    font-size: 13px;
    color: #475569;
    margin-top: 14px;
    line-height: 1.5;
}
.onboarding-support {
    background: linear-gradient(180deg, #f0f7ff 0%, #fafbff 100%);
    border-color: #c7dcff;
}

/* ---------- Zapier ---------- */
.zapier-section .section-lead { margin-bottom: 20px; }
.zapier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 8px;
}
.zapier-col-heading {
    font-size: var(--text-base);
    font-weight: var(--fw-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-brand);
    margin-bottom: var(--space-3);
}
.zapier-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.zapier-list li {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.zapier-item-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 1px;
}
.zapier-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.zapier-item-name {
    font-size: var(--text-base);
    font-weight: var(--fw-bold);
    color: var(--color-text);
}
.zapier-item-desc {
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    color: var(--color-text-secondary);
}
.zapier-footnote {
    margin-top: 20px;
    font-size: 13px;
    color: #475569;
}
.zapier-footnote a {
    color: #0b84ff;
    text-decoration: none;
    font-weight: 600;
}
.zapier-footnote a:hover { text-decoration: underline; }

/* ---------- Plans ---------- */
.plans-section h2 { margin-bottom: 20px; }
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: stretch;
}
.plan-card {
    display: flex;
    flex-direction: column;
    background: #fafbff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px 22px;
    text-align: left;
}
.plan-card-featured {
    background: linear-gradient(180deg, #f0f7ff 0%, #fafbff 100%);
    border-color: #c7dcff;
    box-shadow: 0 2px 12px rgba(11, 132, 255, 0.06);
}
.plan-name {
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    color: var(--color-brand);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-3);
}
.plan-price {
    margin-bottom: 18px;
}
.plan-price-primary {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.plan-price-unit {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-left: 2px;
}
.plan-price-secondary {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-top: 4px;
}
.plan-price-tertiary {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}
.plan-features-heading {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-2);
}
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.plan-features li {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.4;
    color: #0f172a;
}
.plan-features li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0b84ff;
}
.plan-feature-note {
    color: #64748b;
    font-weight: 500;
    font-size: 12px;
}
.plan-note {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
    margin-top: auto;
}
.plan-trial {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px dashed #d1d5db;
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
}
.plan-trial-heading {
    font-size: 12px;
    font-weight: 700;
    color: #0b84ff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.section-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2d6cdf;
    margin-bottom: 8px;
}
.proposal-section h2 {
    font-size: var(--text-3xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.015em;
    line-height: var(--leading-tight);
    color: var(--color-text);
    margin-top: 0;
    margin-bottom: var(--space-3);
}
.section-lead {
    font-size: var(--text-md);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
    max-width: 720px;
}

.comparison-section {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}
.comparison-section .comparison {
    align-items: flex-start;
}
.comparison-section .side {
    flex-shrink: 0;
}
.comparison-section .phone-template {
    width: 280px;
}

.invoice-section { text-align: left; }
.invoice-wrap {
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fafafa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.invoice-image {
    width: 100%;
    height: auto;
    display: block;
}
.invoice-pdf {
    width: 100%;
    height: 720px;
    border: 0;
    display: block;
}
.invoice-section .secondary-btn {
    width: auto;
    margin-top: 16px;
    padding: 10px 18px;
}

.invoice-cta-wrap {
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    padding: 24px 0 0;
    justify-content: center;
}
.invoice-cta {
    display: inline-block;
    padding: 18px 44px;
    background: #008BFF;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 139, 255, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    letter-spacing: -0.01em;
}
.invoice-cta:hover {
    background: #0070d6;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 139, 255, 0.35);
}

.proposal-footer {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 13px;
}
.proposal-footer a { color: #2d6cdf; text-decoration: none; }
.proposal-footer a:hover { text-decoration: underline; }

@media (max-width: 720px) {
    .comparison { padding: 20px 12px; gap: 16px; flex-direction: column; }
    .comparison .side { width: 100%; }
    .phone-template { width: 100%; max-width: 280px; margin: 0 auto; }
    .vs { font-size: 14px; padding: 6px 14px; align-self: center; }
    .side-label { font-size: 12px; padding: 4px 12px; margin-bottom: 10px; }
    .proposal-section { text-align: center; }
    .proposal-section.comparison-section { text-align: left; }
    .proposal-section .section-lead { margin-left: auto; margin-right: auto; }
    .integration-heading { justify-content: center; }
    .ghl-video-wrap, .api-docs-wrap { margin-left: auto; margin-right: auto; }
    .api-docs-frame { height: 480px; }
    .proposal-section { padding: 20px 16px; }
    .proposal-section h2 { font-size: 18px; }
    .section-lead { font-size: 13px; }
    .proposal-header { gap: 10px; padding: 16px; flex-wrap: nowrap; }
    .proposal-sendblue-mark { height: 40px; }
    .proposal-client-name { font-size: 16px; }
    .proposal-eyebrow { font-size: 9px; }
    .brand-mark { width: 40px; height: 40px; min-width: 40px; padding: 6px 8px; font-size: 14px; }
    .proposal-footer { padding: 16px; font-size: 11px; }
    .invoice-cta { padding: 14px 32px; font-size: 14px; }
    .tpl-bubbles .bubble { font-size: 11px; padding: 6px 10px 7px; }
    .tpl-name-sms, .tpl-name-imsg { font-size: 11px; padding: 4px 14px; }
    .tpl-spam-bottom .tpl-spam-text { font-size: 8px; }
    .tpl-spam-bottom .tpl-spam-btn { font-size: 10px; padding: 6px 0; }
}
