/* Font import & typographic scale live in typography.css */

:root {
    color-scheme: light;
    --wedly-blush: #eae8e3;
    --wedly-dusty-rose: #AB8000;
    --wedly-charcoal: #434a42;
    --wedly-cream: #f5f4f0;
    --wedly-gold: #e6c873;
    --wedlybluishgray: #2f362e;
    --wedlypeach: #AB8000;

    /* Wedly primary accent */
    --wedly-primary: #AB8000;
    --wedly-primary-dark: #AB8000;
    --wedly-primary-light: #e6c873;
    --wedly-border: rgba(216, 176, 74, 0.2);

    /* Admin theme variables */
    --admin-surface: #eae8e3;
    --admin-surface-hover: #e2e0db;
    --admin-accent: rgba(216, 176, 74, 0.2);
    --admin-accent-strong: rgba(216, 176, 74, 0.3);
    --admin-accent-border: rgba(216, 176, 74, 0.35);
    --admin-accent-solid: #d8b04a;
    --admin-accent-hover: #c9a042;
    --admin-text: #434a42;
    --admin-text-muted: #6b7280;
    
    /* Global Breakpoints (Bootstrap 5) */
    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;

    /* AI/Wedly VA styling variables */
    --ai-primary: #e6c873;
    --ai-primary-dark: #AB8000;
    --ai-primary-light: #e6c873;
    --ai-bg-start: #faf8f2;
    --ai-bg-mid: #f5f0e0;
    --ai-bg-end: #eee8d5;
    --ai-border: #d8b04a;
    --ai-border-light: rgba(216, 176, 74, 0.2);
    --ai-text: #374151;
    --ai-text-muted: #6b7280;
    --ai-label: #AB8000;
    --ai-shadow: rgba(216, 176, 74, 0.15);
    --ai-shadow-hover: rgba(216, 176, 74, 0.3);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.validation-message {
    color: #d9534f;
    font-size: 0.8rem;
    margin-top: 4px;
}

.invalid {
    border-color: #d9534f !important;
}

.required {
    color: #d9534f;
}

html {
    color-scheme: light;
    overflow-y: auto;
}

body {
    min-height: 100svh;
    background-color: var(--wedly-cream);
}

/* ============ Global Button Defaults ============ */
/* Single source of truth for button sizing. Override per-class only
   for intentionally different controls (icon buttons, FABs, CTA). */
button {
    padding: 0.5rem 1rem;
    min-height: 2.25rem!important;
    box-sizing: border-box;
}

/* ============ Responsive Icon SVGs ============ */
/* FluentIcon renders <svg> with fixed pixel width/height attributes
   (e.g. Size16 = 16px). Override to rem so icons participate in the
   root-based responsive system. CSS properties take precedence over
   SVG presentation attributes. 1.25rem ≈ 20px at default root. */
button svg,
a svg,
label svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDgINjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


.sub-header {
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500 !important;
    color: #ffffff;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.125rem;
}

.hero-landing {
    background-color: #434a42;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60 10 C55 30, 40 40, 20 45 C40 48, 55 55, 60 80 C65 55, 80 48, 100 45 C80 40, 65 30, 60 10Z' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='0.8'/%3E%3Cpath d='M15 70 Q30 60 25 80 Q35 75 20 90' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='0.6'/%3E%3Cpath d='M90 85 Q105 75 100 95 Q110 90 95 105' fill='none' stroke='rgba(255,255,255,0.03)' stroke-width='0.6'/%3E%3Ccircle cx='12' cy='20' r='1.5' fill='rgba(255,255,255,0.03)'/%3E%3Ccircle cx='108' cy='25' r='1' fill='rgba(255,255,255,0.025)'/%3E%3Ccircle cx='55' cy='110' r='1.2' fill='rgba(255,255,255,0.025)'/%3E%3C/svg%3E");
    background-size: 120px 120px;
    background-repeat: repeat;
    border-radius: 0;
    min-height: 560px;
    position: relative;
    overflow: hidden;
}

#hero-overlay {
    background: transparent;
    display: flex;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

@media (min-width: 768px) {
    #hero-overlay {
        padding-top: 5.5rem;
        padding-bottom: 1.25rem;
    }
}

.frame {
    border-radius: 0;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 700px;
    justify-self: center;
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.frame h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.15rem, 2.6vw, 2.7rem);
    text-transform: none;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 1.25rem;
    line-height: 1.18;
    margin-inline: auto;
    max-width: 16ch;
}

.frame .sub-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.6;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .frame {
        padding: 1.75rem 1.5rem;
        max-width: 660px;
    }

    .frame h1 {
        font-size: 2rem;
        max-width: 15.5ch;
    }

    .frame .sub-header {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) and (max-width: 1439px) {
    #hero-overlay {
        padding-top: 5.75rem;
    }

    .frame h1 {
        font-size: 2.2rem;
        max-width: 15.5ch;
    }

    .frame .sub-header {
        font-size: 1.0625rem;
    }
}

@media (max-width: 767px) {
    .frame h1 {
        font-size: 2.25rem;
    }

    .frame .sub-header {
        font-size: 1rem;
    }
}

@media (max-width: 575px) {
    .frame {
        padding: 2rem 1.5rem;
    }

    .frame h1 {
        font-size: 1.85rem;
    }
}

.navi-link {
    font-family: 'Josefin Sans', serif;
    font-weight: 600;
    color: var(--wedly-charcoal);
    font-size: 1rem !important;
    text-decoration: none;
}

.navi-link:hover {
    text-decoration: underline;
    color: var(--wedly-charcoal);
}

.navi-link-light {
    color: #fff;
}

.navi-link-light:hover {
    color: #fff;
}


/*small mob*/
@media(max-width: 320px) {
    .hero-landing {
        height: 400px;
    }
}

/*medium mob*/
@media(min-width: 321px) and (max-width: 375px) {
    .hero-landing {
        height: 420px;
    }
}

/*large mob*/
@media(min-width: 376px) and (max-width: 480px) {
    .hero-landing {
        height: 531.5px;
    }
}

/*tablet*/
@media(min-width: 481px) and (max-width: 1023px) {
    .hero-landing {
        height: 524px;
    }
}

/*small laptop*/
@media(min-width: 1024px) and (max-width: 1439px) {
    .hero-landing {
        height: 524px;
    }
}

/*large laptop*/
@media(min-width: 1440px) and (max-width: 1919px) {
    .hero-landing {
        min-height: 700px;
    }
}

/*desktop*/
@media(min-width: 1920px) {
    .hero-landing {
        min-height: 768px;
    }
}

/* ============ Shared app-wide UI primitives ============ */

/* Shared header used in modals and cards where needed */
.wedly-header {
    width: 100%;
    background-color: var(--admin-text);
    color: #d8b04a;
    text-transform: uppercase;
    font-size: 1rem;
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0 1rem;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.wedly-panel {
    background: #fff;
    border: 1px solid rgba(216, 176, 74, 0.4);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(216, 176, 74, 0.13);
    padding: 0 !important;
}

.wedly-panel-header {
    background-color: var(--admin-surface);
    border-bottom: 1px solid rgba(216, 176, 74, 0.27);
    padding: .75rem 1rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--admin-text);
    border-radius: 8px 8px 0 0;
}

.wedly-panel-header>*:first-child {
    margin: 0;
}

.wedly-panel-body {
    padding: 1rem;
}

/* Wedly panel header variant - dark style for accordions/sections */
.wedly-panel-header-dark {
    width: 100%;
    background-color: var(--admin-text);
    color: #d8b04a;
    text-transform: uppercase;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 1rem;
}

/* Modal shell */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    max-height: inherit;
}

/* Modal header & footer must never shrink when body overflows */
.modal-content > .wedly-header {
    flex-shrink: 0;
}

.modal-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: var(--wedly-cream);
    border-top: 1px solid rgba(216, 176, 74, 0.27);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Admin modal normalization: keep headers/footers consistent across all admin pages */
.admin-shell .modal-content > .wedly-header {
    background-color: var(--admin-surface);
    color: var(--admin-text);
    border-bottom: 1px solid rgba(216, 176, 74, 0.27);
    min-height: auto;
    padding: 0.75rem 1rem;
    border-radius: 8px 8px 0 0;
    text-transform: none;
}

.admin-shell .modal-content > .wedly-header h3,
.admin-shell .modal-content > .wedly-header h4,
.admin-shell .modal-content > .wedly-header h5 {
    margin: 0;
    color: var(--admin-text);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
}

.admin-shell .modal-content > .modal-footer {
    background-color: var(--wedly-cream);
    border-top: 1px solid rgba(216, 176, 74, 0.27);
}

/* When a nested confirmation is shown, dim the parent modal content */
.modal-container.dimmed::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.25);
    pointer-events: none;
    border-radius: 8px;
    z-index: 1002;
}

/* Stronger backdrop for nested delete modal so it visually sits above the parent */
.modal-backdrop.delete-backdrop {
    z-index: 1100;
    background-color: rgba(0, 0, 0, 0.64);
}

/* Generic small modal for simple confirmations */
.modal-container.small {
    max-width: 480px;
}

/* Small delete modal: higher z-index and slight vertical offset so it sits 'inside' the parent */
.modal-container.small.delete-modal {
    z-index: 1102;
    transform: translate(-50%, -45%);
    max-width: 420px;
}

/* On mobile, delete modals use inset positioning so remove the offset transform */
@media (max-width: 767px) {
    .modal-container.small.delete-modal {
        transform: none;
    }
}

.page-info {
    display: flex;
    flex-direction: column;
    border: 1px solid color-mix(in srgb, var(--wedly-charcoal), transparent 90%);
    font-size: .875rem;
    border-radius: 8px 8px 0 0;
}

.page-info span {
    padding: 1rem;
}

/* Generic form elements */
.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 1px solid #d8b04a;
    background: #fff;
    font-size: 0.95rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

/* Shared action buttons */
.save-button {
    background-color: var(--admin-accent);
    color: var(--admin-text);
    border: 1px solid var(--admin-accent-border);
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-main .save-button,
.admin-main .save-button.action-button-idle,
.admin-main .save-button.action-button-loading,
.admin-main .save-button.action-button-success {
    color: var(--admin-text) !important;
}

.save-button:hover:not(:disabled) {
    background-color: var(--admin-accent-strong);
    border-color: var(--admin-accent-border);
}

.save-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--admin-accent);
}

.save-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Shared Badges */
.wedly-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: middle;
    background-color: #f3f4f6; /* Default neutral gray */
    color: #374151;
    border: 1px solid #e5e7eb;
}

.wedly-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.wedly-badge.info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.cancel-button {
    background-color: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-button:hover {
    background-color: #dde2e6;
}

.ghost-button {
    background-color: transparent;
    color: #6c757d;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ghost-button:hover {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
}

/* AI quote navigation button (shared across chat surfaces) */
.ai-draft-ready-to-quote {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    font-size: 0.85rem;
    font-weight: 600;
    border: none !important;
    transition: all 0.2s ease;
}

.ai-draft-ready-to-quote:hover:not(:disabled) {
    background-color: #e5e7eb !important;
    color: #4b5563 !important;
}

.ai-draft-ready-to-quote:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

/* Payment section button styles */
.payment-button {
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    letter-spacing: 0.5px;
    text-transform: none;
    line-height: normal;
}

.payment-button-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    flex: 1;
    min-width: 160px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    border: 2px solid transparent;
}

.payment-button-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.payment-button-primary:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.payment-button-primary:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
}

.payment-button-primary:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.payment-button-cancel {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border: 1.5px solid #d1d5db !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.payment-button-cancel:hover:not(:disabled) {
    background-color: #e5e7eb !important;
    border-color: #9ca3af !important;
    color: var(--admin-text) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.payment-button-cancel:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(209, 213, 219, 0.4), 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.payment-button-cancel:active:not(:disabled) {
    background-color: #d1d5db !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.payment-button-cancel:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    border-color: #e5e7eb !important;
}

/* Inline icon buttons */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    border: 1px solid #d8b04a;
    background: #fff;
    color: var(--admin-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
}

.icon-button:hover,
.icon-button:focus-visible {
    background-color: var(--wedly-cream);
    box-shadow: 0 0 0 3px rgba(216, 176, 74, 0.2);
    outline: none;
}

.icon-button:active {
    transform: scale(0.95);
}

.icon-button.edit {
    color: var(--wedly-gold);
}

.icon-button.success {
    color: #10b981;
}

.icon-button.success:hover,
.icon-button.success:focus-visible {
    background-color: #d1fae5;
}

.icon-button.info {
    color: var(--wedly-gold);
}

.icon-button.info:hover,
.icon-button.info:focus-visible {
    background-color: rgba(216, 176, 74, 0.2);
}

.icon-button.delete {
    border-color: #e5b0a5;
    color: #b91c1c;
    background: #fffaf8;
}

.icon-button.delete:hover,
.icon-button.delete:focus-visible {
    background: #fdece7;
    color: #981b1b;
}

.status-inquiry {
    background-color: #e9ecef;
    color: #495057;
}

.status-quote {
    background-color: #cff4fc;
    color: #055160;
}

.status-confirmed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-balancedue {
    background-color: #d1e7dd;
    color: #e32d2d;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-complete {
    background-color: #0f5132;
    color: #d1e7dd;
}

.status-pastdue {
    background-color: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-rejected {
    background-color: #f5c6cb;
    color: #721c24;
}

/* Price display */
.price-meta {
    font-size: 0.875rem;
    color: var(--admin-text-muted);
    font-weight: 500;
    background: var(--wedly-cream);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Settings radios */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    /* row and column gap */
    align-items: center;
}

.radio-group .radio-inline {
    display: inline-flex;
    align-items: center;
    /* vertically align circle and text */
    gap: .5rem;
    line-height: 1.2;
}

.radio-group input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--wedly-gold);
    /* #dabcae */
}

/* Optional: improve focus visibility */
.radio-group input[type="radio"]:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--wedly-gold), #000 20%);
    outline-offset: 2px;
}

.admin-main>.page-scroll {
    overflow: auto !important;
}

/* ============ Admin Shell Layout (global fallback) ============ */
/* These critical structural rules MUST live in app.css, not in scoped CSS,
   because CSS isolation scope identifiers differ between Debug and Release
   builds. If only in AdminLayout.razor.css, container (Release) builds get
   mismatched scope IDs and the entire layout collapses. */

.admin-shell {
    display: flex;
    width: 100%;
    height: 100svh;
    min-height: 0;
    position: relative;
}

/* Admin: align Bootstrap primary buttons to the calmer accent style */
.admin-shell .btn-primary,
.admin-shell .btn.btn-primary {
    color: var(--admin-text);
    background-color: var(--admin-accent);
    border-color: var(--admin-accent-border);
}

.admin-shell .btn-primary:hover,
.admin-shell .btn.btn-primary:hover {
    color: var(--admin-text);
    background-color: var(--admin-accent-strong);
    border-color: var(--admin-accent-border);
}

.admin-shell .btn-primary:focus,
.admin-shell .btn-primary:active:focus,
.admin-shell .btn.btn-primary:focus,
.admin-shell .btn.btn-primary:active:focus {
    box-shadow: 0 0 0 0.15rem var(--admin-accent-strong);
}

.admin-shell .btn-primary:disabled,
.admin-shell .btn.btn-primary:disabled {
    background-color: var(--wedly-cream);
    border-color: var(--wedly-border);
    color: var(--admin-text-muted);
}

.admin-sidebar {
    width: 15.625rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.admin-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    --accent-fill-rest: var(--wedly-gold);
}

.admin-main > header {
    flex-shrink: 0;
    background-color: var(--admin-text);
    width: 100%;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    min-height: 6.5rem;
    max-height: 6.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.admin-main > header .headertitle {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-main > header .headertitle span {
    color: #fff;
    text-transform: uppercase;
    font-size: .825rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
}

.admin-main > header .headertitle h1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
    color: var(--wedly-gold);
}

.admin-shell h1 {
    color: var(--wedly-gold);
}

.admin-main > .upgrade-banner {
    flex: 0 0 auto;
}

.admin-main > *:not(header):not(.upgrade-banner) {
    flex: 1 1 auto;
    min-height: 0;
}

/* Desktop: contain overflow for split-pane layouts */
@media (min-width: 992px) {
    .admin-main {
        overflow: hidden;
    }

    .admin-main > *:not(header) {
        overflow: hidden;
    }
}

#wedlogo {
    width: 100%;
    background-color: var(--admin-text);
    height: 6.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wedlogo img {
    width: 8.8125rem;
}

/* Mobile: allow vertical scrolling in main-stack */
@media (max-width: 991px) {
    .main-stack {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

/* Desktop: contain overflow for split-pane layouts */
@media (min-width: 992px) {
    .main-stack {
        overflow: hidden;
    }
}

.main-stack {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    /* Standard comfortable padding for mobile readability */
    padding: 2rem 1.25rem 0 1.25rem;
}

/* Ensure bottom content isn't covered by mobile browser chrome, FABs, or gestures */
.page-scroll {
    overflow-y: auto !important;
}

.page-scroll::after {
    content: '';
    display: block;
    min-height: 6rem;
    flex-shrink: 0;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#sm-nav-wrapper {
    position: absolute;
    top: 6.5rem;
    bottom: 0;
    width: 100%;
}

/* ============ Shared Signup/Login Styles ============ */

/* Container & Layout */
.signup-container {
    background: linear-gradient(180deg, #fefefe 0%, #fef9f7 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}

/* Signup Box */
.signup-box {
    background: linear-gradient(180deg, #ffffff 0%, #fefaf8 100%);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    border: 2px solid rgba(216, 176, 74, 0.25);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.signup-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d8b04a, #e6c878, #d8b04a);
}

/* Logo - Centered */
.signup-logo {
    fill: currentColor;
    color: var(--wedly-charcoal);
    margin: 0 auto;
    display: block;
}

/* Header */
.signup-header {
    text-align: center;
    margin: 0;
}

.signup-header h1,
.signup-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--admin-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.signup-subtitle {
    font-size: 1.1rem;
    color: var(--admin-text);
    line-height: 1.6;
    margin: 0;
}

/* Form Content */
.signup-content {
    margin: 0;
}

/* Form Label */
.signup-command {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    text-align: center;
}

/* Form Fields Container */
.signup-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.signup-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.signup-helper-text {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.signup-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.signup-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--admin-text);
    background: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.signup-input::placeholder {
    color: #9ca3af;
}

.signup-input:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.signup-input:focus {
    outline: none;
    border-color: #d8b04a;
    box-shadow: 0 0 0 3px rgba(216, 176, 74, 0.15), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.signup-input:read-only {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.signup-input-error {
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
}

/* Form Actions - Button container with gap */
.form-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
}

/* CTA Button — global base styles (used by SpinnerButton, LoginSite, Orchard auth) */
.cta-button {
    background: #ffffff;
    color: var(--wedly-primary, #d8b04a);
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem; /* overridden at ≤575 px via typography.css */
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(216, 176, 74, 0.18);
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(216, 176, 74, 0.25);
    background: #f9f8f5;
    color: var(--wedly-primary, #d8b04a);
    text-decoration: none;
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button-primary {
    background: linear-gradient(135deg, var(--wedly-primary-light, #d8b04a) 0%, var(--wedly-primary-light, #e6c873) 100%);
    color: var(--wedly-charcoal, #434a42);
    border: none;
}

.cta-button-primary:hover {
    background: linear-gradient(135deg, var(--wedly-primary-light, #e6c873) 0%, var(--wedly-primary, #d8b04a) 100%);
    color: var(--wedly-charcoal, #434a42);
}

.cta-button-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--wedly-charcoal, #36454F);
    border: 2px solid var(--wedly-border, rgba(216, 176, 74, 0.3));
}

.cta-button-secondary:hover {
    background: #ffffff;
    border-color: var(--wedly-primary, #d8b04a);
    color: var(--wedly-charcoal, #36454F);
}

/* Footer Note */
.signup-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(216, 176, 74, 0.2);
    margin: 0;
}

.portal-plain-layout {
    min-height: 100vh;
    background-color: #f9fafb;
}

.signup-footer p {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.signup-footer a {
    color: #d8b04a;
    text-decoration: underline;
}

.signup-footer a:hover {
    color: #aa8a32;
}

.signup-footer strong {
    color: #059669;
    font-weight: 600;
}

/* Signup Step Wrapper - Consistent spacing */
.signup-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Hide Fluent UI components that conflict */
fluent-text-field {
    display: none !important;
}

fluent-validation-message {
    display: none !important;
}

/* Responsive Design for Signup/Login */
@media (max-width: 991px) {
    .signup-box {
        padding: 2.5rem 2rem;
    }

    .signup-header h1 {
        font-size: 2rem;
    }

    .signup-subtitle {
        font-size: 1rem;
    }

    .cta-button {
        padding: 0.75rem 2rem;
    }
}

@media (max-width: 767px) {
    .signup-container {
        padding: 1.5rem 1rem;
    }

    .signup-box {
        padding: 2rem 1.5rem;
    }

    .signup-header h1 {
        font-size: 1.75rem;
    }

    .signup-subtitle {
        font-size: 0.95rem;
    }

    .signup-footer {
        padding-top: 1.5rem;
    }

    .signup-footer p {
        font-size: 0.875rem;
    }
}

@media (max-width: 575px) {
    .signup-container {
        padding: 1rem 0.75rem;
    }

    .signup-box {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }

    .signup-header h1 {
        font-size: 1.5rem;
    }

    .signup-logo {
        width: 120px;
    }

    .cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 100%;
    }
}

/* ============ Reusable Typography & Detail Patterns ============ */

/* Section subheaders (h4/h5 with compact style) */
.section-subheader,
h4.section-subheader,
h5.section-subheader {
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--admin-text);
}

/* Smaller subheader variant */
.section-subheader-sm,
h5.section-subheader-sm,
h6.section-subheader-sm {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
    color: var(--admin-text);
}

/* Detail row pattern (label: value) */
.detail-row {
    display: flex;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.detail-label {
    font-weight: 500;
    min-width: 120px;
    color: var(--admin-text);
    flex-shrink: 0;
}

.detail-value {
    flex-grow: 1;
    color: var(--admin-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Compact detail variant for tighter spacing */
.detail-row-compact {
    display: flex;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.detail-row-compact .detail-label {
    min-width: 100px;
    font-size: 0.9rem;
}

.detail-row-compact .detail-value {
    font-size: 0.9rem;
}

/* Detail list container */
.detail-list {
    display: flex;
    flex-direction: column;
}

/* Meta text (dates, counts, subtle info) */
.meta-text {
    font-size: 0.9rem;
    color: var(--admin-text);
}

.meta-text-sm {
    font-size: 0.85rem;
    color: var(--admin-text);
}

/* FluentUI Toast Notifications - Basic z-index to appear above modals */
fluent-toast-provider {
    z-index: 9999 !important;
}

/* ============ Shared Tab Navigation Pattern ============ */

.tabs-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 60px;
}

.tabs-container::after {
    content: '';
    display: block;
    min-height: 6rem;
    flex-shrink: 0;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid #d8b04a;
    padding: 1.5rem 1rem 0 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.tab-item {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-right: 1rem;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
}

.tab-item.active {
    border-bottom: 3px solid var(--admin-text);
    color: var(--admin-text);
}

.tab-item:hover:not(.active) {
    border-bottom: 3px solid #d8b04a;
}

.tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.5rem 1rem 2rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Ensure default tab content areas grow to fill space */
.tabs-container > *:not(.tabs-nav):not(style) {
    flex: 1 1 auto;
    min-height: 60px;
}

/* ============ Marketing Page Shared Styles ============ */

/* Section titles and subtitles - reusable across marketing pages */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--admin-text);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* CTA button group pattern - reusable for marketing CTAs */
.cta-buttons {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

/* Marketing section titles responsive breakpoints */
@media (max-width: 991px) {
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) {
    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 575px) {
    .section-title {
        font-size: 1.5rem;
    }
}

/* Accordion styles */
.accordion {
    border: 1px solid #d8b04a;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-header {
    background-color: var(--admin-surface);
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--admin-text);
    cursor: pointer;
}

.accordion-body {
    padding: 1rem;
    background-color: #fff;
    color: var(--admin-text);
}

.accordion-button {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--admin-text);
    width: 100%;
    text-align: left;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

.accordion-button:not(.collapsed) {
    color: #1b6ec2;
    background-color: #e7f1ff;
}

.accordion-button.collapsed {
    color: var(--admin-text);
}

.accordion-icon {
    margin-left: auto;
    transition: transform 0.2s;
}

.accordion-button:not(.collapsed) .accordion-icon {
    transform: rotate(90deg);
}

/* Custom styles for shared use within Wedly applications */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: #d8b04a transparent;
}

.custom-scroll::-webkit-scrollbar {
    width: 8px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background-color: #d8b04a;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* ============ Mobile-Responsive Breakpoints & Utilities ============ */

/* CSS custom properties for responsive breakpoints */
:root {
    --breakpoint-xs: 320px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
    
    /* Touch-friendly sizing */
    --touch-target-min: 44px;
    --mobile-padding: 1rem;
    --mobile-gap: 0.75rem;
}

/* Mobile scrolling fixes */
@media (max-width: 991px) {
    html {
        overflow-y: auto;
        overflow-x: hidden;
        height: 100%;
    }
    
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: 100%;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure content can scroll */
    #app {
        overflow-y: auto;
        overflow-x: hidden;
        height: 100%;
    }
}

/* Mobile-first responsive utilities */
@media (max-width: 767px) {
    /* Stack form rows on mobile */
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Full-screen modal on mobile — avoids clipping on narrow/notched/edge devices */
    .modal-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        box-sizing: border-box;
    }

    .modal-content {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    /* Keep small/confirmation modals compact and centered on mobile */
    .modal-container.small .modal-content,
    .modal-container.small.delete-modal .modal-content {
        width: 92%;
        max-width: 420px;
        border-radius: 8px;
        max-height: 90vh;
        max-height: 90dvh;
    }

    .modal-body {
        padding: 1rem;
        min-height: 0;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    /* Touch-friendly buttons */
    .save-button,
    .cancel-button,
    .cta-button {
        min-height: var(--touch-target-min);
    }
    
    /* Larger icon buttons for touch */
    .icon-button {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* Reduce panel padding on mobile */
    .wedly-panel-body {
        padding: 0.75rem;
    }
    
    .wedly-panel-header {
        padding: 0.625rem 0.75rem;
        font-size: 0.95rem;
    }
    
    /* Stack detail rows on narrow screens */
    .detail-row,
    .detail-row-compact {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .detail-label {
        min-width: auto;
        font-size: 0.85rem;
    }
    
    .detail-value {
        white-space: normal;
        font-size: 0.9rem;
    }
    
    /* Tabs scroll horizontally on mobile */
    .tabs-nav {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 1rem 0 1rem;
        scrollbar-width: thin;
    }
    
    .tab-item {
        white-space: nowrap;
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }
    
    /* Page info responsive */
    .page-info {
        font-size: 0.8rem;
    }
    
    .page-info span {
        padding: 0.75rem;
    }

    .wedly-header {
        border-radius: 0;
        padding: 0 1rem;
    }
}

@media (max-width: 575px) {
    .wedly-header {
        font-size: 0.9rem;
        min-height: 56px;
        padding: 0 0.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .section-subheader,
    h4.section-subheader,
    h5.section-subheader {
        font-size: 0.95rem;
    }
    
    /* Radio group stacks on very small screens */
    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    /* Empty state adjustments */
    .empty-state {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .wedly-header {
        min-height: 56px;
        font-size: 0.9rem;
        padding: 0 0.875rem;
    }
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
    /* Increase hit areas for touch devices */
    button,
    a,
    .tab-item,
    .icon-button,
    .cal-item,
    .checklist-card,
    .feature-item {
        -webkit-tap-highlight-color: rgba(218, 188, 174, 0.3);
    }
    
    /* Remove hover effects on touch devices */
    .icon-button:hover,
    .save-button:hover,
    .cancel-button:hover,
    .tab-item:hover {
        transform: none;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    .modal-container {
        max-height: 85vh;
        max-height: 85dvh;
    }
    
    .calendar-shell {
        min-height: 50vh;
    }
}

/* Horizontal scroll containers with touch momentum */
.horizontal-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Safe area insets for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===================== Client Portal (Tenant Customers) ===================== */

/* Portal Theme Variables (scoped: only applies under .portal-theme) */
.portal-theme {
    /* Core palette */
    --portal-cream: #f7f8fb;
    --portal-rose: #4a6d96;
    --portal-rose-deep: #2f4f73;
    --portal-blush: #eef2f7;
    --portal-gold: #a38e74;
    --portal-gold-dark: #846c56;
    --portal-blue: #355f8a;
    --portal-blue-muted: #e6edf5;
    --portal-ink: #1f2937;

    /* Typography */
    --portal-font-body: 'Montserrat', sans-serif;
    --portal-font-display: 'Playfair Display', serif;
    --portal-text-size-1: 0.875rem;
    --portal-text-size-2: 1rem;
    --portal-text-size-3: 1.125rem;
    --portal-title-size-1: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem);
    --portal-title-size-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --portal-line-height-body: 1.6;

    /* Spacing + radius */
    --portal-space-1: 0.25rem;
    --portal-space-2: 0.5rem;
    --portal-space-3: 0.75rem;
    --portal-space-4: 1rem;
    --portal-space-5: 1.25rem;
    --portal-space-6: 1.5rem;
    --portal-space-8: 2rem;
    --portal-space-10: 2.5rem;
    --portal-radius-sm: 10px;
    --portal-radius-md: 14px;
    --portal-radius-lg: 18px;

    /* Derived tokens */
    --portal-bg: var(--portal-cream);
    --portal-surface: #ffffff;
    --portal-surface-muted: rgba(255, 255, 255, 0.75);
    --portal-text: var(--portal-ink);
    --portal-text-muted: #5f6776;
    --portal-border: rgba(31, 41, 55, 0.14);
    --portal-border-strong: rgba(31, 41, 55, 0.22);
    --portal-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
    --portal-card-shadow: 0 10px 24px rgba(17, 24, 39, 0.10);

    --portal-primary: var(--portal-blue);
    --portal-primary-dark: var(--portal-rose-deep);
    --portal-accent: var(--portal-rose);
    --portal-accent-strong: var(--portal-rose-deep);
    --portal-accent-soft: var(--portal-blue-muted);
    --portal-accent-light: var(--portal-accent-soft);
    --portal-accent-border: rgba(74, 109, 150, 0.35);
    --portal-info: var(--portal-blue);
    --portal-info-soft: var(--portal-blue-muted);
    --portal-info-border: rgba(53, 95, 138, 0.28);

    --portal-link: var(--portal-primary-dark);
    --portal-link-hover: var(--portal-primary);
    --portal-focus-ring: 0 0 0 0.25rem rgba(53, 95, 138, 0.25);

    /* Feature tints */
    --portal-tint-messages: var(--portal-info-soft);
    --portal-tint-quotes: rgba(53, 95, 138, 0.12);
    --portal-tint-payments: rgba(31, 41, 55, 0.06);
    --portal-tint-vendors: rgba(53, 95, 138, 0.08);

    /* Chat */
    --portal-bubble-outgoing: var(--portal-accent-soft);
    --portal-bubble-incoming: var(--portal-surface);
}

.portal-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--portal-bg);
    font-family: var(--portal-font-body);
    color: var(--portal-text);
    line-height: var(--portal-line-height-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.portal-shell a {
    color: var(--portal-link);
}

.portal-shell a:hover {
    color: var(--portal-link-hover);
}

.portal-shell :focus-visible {
    outline: none;
    box-shadow: var(--portal-focus-ring);
    border-radius: 6px;
}

.portal-main {
    flex: 1;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.portal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.portal-loading,
.portal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    height: 100vh;
    width: 100%;
    background-color: var(--portal-bg);
    color: var(--portal-text);
}

.portal-loading p,
.portal-error h2 {
    font-weight: 600;
    color: var(--portal-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portal-error p {
    color: var(--portal-text-muted);
    max-width: 400px;
    text-align: center;
    line-height: 1.6;
}

@media (min-width: 992px) {
    .portal-shell {
        flex-direction: row;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    .portal-main {
        padding: 2.5rem;
        overflow: hidden;
    }

    .portal-content {
        min-height: 0;
        overflow: hidden;
    }

    .portal-shell .portal-section {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        gap: 0;
        padding-top: var(--portal-space-2);
        padding-bottom: var(--portal-space-6);
    }

    .portal-shell .section-header {
        margin-bottom: var(--portal-space-8);
        flex-shrink: 0;
    }

    .portal-shell .section-content {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 1.5rem 0.5rem 1.5rem 1.5rem;
    }

    .portal-shell .section-content::-webkit-scrollbar {
        width: 8px;
    }

    .portal-shell .section-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .portal-shell .section-content::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 999px;
    }

    .portal-shell .section-content::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    .portal-shell .portal-chat-page {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .portal-shell .chat-header {
        flex-shrink: 0;
    }

    .portal-shell .chat-content-wrapper {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-right: 0.5rem;
    }

    .portal-shell .chat-content-wrapper::-webkit-scrollbar {
        width: 8px;
    }

    .portal-shell .chat-content-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .portal-shell .chat-content-wrapper::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 999px;
    }

    .portal-shell .chat-content-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Portal navigation */
.portal-shell .portal-nav {
    background-color: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    width: 100%;
    padding: var(--portal-space-6);
    display: flex;
    flex-direction: column;
    gap: var(--portal-space-6);
}

.portal-shell .portal-brand {
    display: flex;
    flex-direction: column;
    gap: var(--portal-space-2);
    padding-bottom: var(--portal-space-6);
    border-bottom: 1px solid var(--portal-border);
}

.portal-shell .brand-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--portal-space-4);
}

.portal-shell .brand-wordmark {
    display: flex;
    flex-direction: column;
}

.portal-shell .customer-name {
    font-family: var(--portal-font-display);
    font-weight: 700;
    font-size: 1.55rem;
    color: var(--portal-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.portal-shell .brand-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--portal-primary-dark);
    font-weight: 600;
    margin-top: var(--portal-space-1);
}

.portal-shell .meta-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--portal-text-muted);
    margin: 0;
}

.portal-shell .meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--portal-text);
    margin: 0;
}

.portal-shell .event-date {
    font-size: 0.85rem;
    color: var(--portal-text-muted);
    margin: var(--portal-space-1) 0 0 0;
}

.portal-shell .active-vendor-display {
    margin-top: var(--portal-space-4);
    padding: var(--portal-space-4);
    background: linear-gradient(135deg, var(--portal-accent-soft) 0%, rgba(255, 255, 255, 0.7) 120%);
    border-radius: var(--portal-radius-md);
    border: 1px solid var(--portal-accent-border);
    box-shadow: var(--portal-card-shadow);
}

.portal-shell .active-vendor-card {
    display: flex;
    align-items: center;
    gap: var(--portal-space-3);
    margin-top: var(--portal-space-2);
}

.portal-shell .active-vendor-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--portal-text);
}

.portal-shell .event-dropdown {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--portal-text);
    background-color: var(--portal-surface);
    cursor: pointer;
}

.portal-shell .event-dropdown:focus-visible {
    box-shadow: var(--portal-focus-ring);
}

.portal-shell .other-vendors-section {
    margin-top: var(--portal-space-4);
    padding-top: var(--portal-space-4);
    border-top: 1px solid var(--portal-border);
}

.portal-shell .vendor-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--portal-space-2);
    margin-top: var(--portal-space-2);
}

.portal-shell .vendor-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--portal-space-2);
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--portal-text);
    text-decoration: none;
    background-color: var(--portal-surface);
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.portal-shell .vendor-chip:hover {
    background-color: var(--portal-accent-soft);
    border-color: var(--portal-border-strong);
    transform: translateY(-1px);
}

.portal-shell .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--portal-space-2);
}

.portal-shell .nav-item {
    display: flex;
    align-items: center;
    gap: var(--portal-space-3);
    padding: 0.75rem 0.9rem;
    border-radius: var(--portal-radius-sm);
    color: var(--portal-text);
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
    font-weight: 650;
    font-size: 0.95rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.6);
}

.portal-shell .nav-item .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-primary-dark);
}

.portal-shell .nav-item:hover {
    background-color: var(--portal-accent-soft);
    border-color: var(--portal-accent-border);
}

.portal-shell .nav-item.active {
    background-color: var(--portal-primary);
    color: #ffffff;
    box-shadow: var(--portal-card-shadow);
}

.portal-shell .nav-item.active .icon {
    color: #ffffff;
}

.portal-shell .nav-item.highlight {
    border: 1px solid var(--portal-accent-border);
    color: var(--portal-accent-strong);
    background-color: var(--portal-accent-soft);
}

.portal-shell .nav-item.highlight:hover {
    background-color: var(--portal-accent);
    color: #ffffff;
}

.portal-shell .nav-item.highlight:hover .icon {
    color: #ffffff;
}

/* Portal sections + headings */
.portal-shell .portal-section {
    display: flex;
    flex-direction: column;
    gap: var(--portal-space-8);
    padding-top: var(--portal-space-4);
    padding-bottom: var(--portal-space-10);
}

.portal-shell .section-header {
    border-bottom: 1px solid var(--portal-border);
    padding-bottom: var(--portal-space-6);
}

.portal-shell .section-content {
    display: flex;
    flex-direction: column;
}

.portal-shell .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    margin: 0 0 var(--portal-space-3) 0;
    color: var(--portal-text-muted);
}

.portal-shell .portal-section h1,
.portal-shell .dashboard-header h1 {
    font-family: var(--portal-font-display);
    font-size: var(--portal-title-size-1);
    font-weight: 700;
    color: var(--portal-text);
    margin: 0 0 var(--portal-space-2) 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.portal-shell .portal-section h2,
.portal-shell .chat-header h2 {
    font-size: var(--portal-title-size-2);
    font-weight: 750;
    margin: 0 0 var(--portal-space-1) 0;
}

.portal-shell .lede,
.portal-shell .dashboard-header p,
.portal-shell .chat-header p {
    margin: 0;
    color: var(--portal-text-muted);
    max-width: 70ch;
    font-size: var(--portal-text-size-2);
    line-height: 1.65;
}

.portal-shell .title-stack {
    display: flex;
    gap: var(--portal-space-4);
    align-items: center;
}

.portal-shell .title-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--portal-radius-md);
    background: linear-gradient(135deg, var(--portal-tint-vendors) 0%, rgba(255, 255, 255, 0.8) 120%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--portal-border);
}

/* Portal buttons (override Bootstrap btn-primary only within portal) */
.portal-shell .btn-primary,
.portal-shell a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 120%);
    color: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.15s ease, filter 0.15s ease;
    border: none;
}

.portal-shell .btn-primary:hover {
    filter: brightness(0.98);
    transform: translateY(-1px);
}

.portal-shell .btn-secondary,
.portal-shell a.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--portal-text);
    border: 1px solid var(--portal-border-strong);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.portal-shell .btn-secondary:hover {
    background-color: var(--portal-surface-muted);
    transform: translateY(-1px);
}

.portal-shell .inline-link {
    color: var(--portal-link);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--portal-space-1);
    font-size: 0.95rem;
}

.portal-shell .inline-link:hover {
    text-decoration: underline;
}

/* Dashboard cards */
.portal-shell .dashboard-header {
    margin-bottom: var(--portal-space-10);
    padding-bottom: var(--portal-space-6);
    border-bottom: 1px solid var(--portal-border);
}

.portal-shell .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--portal-space-6);
}

.portal-shell .dashboard-grid .card {
    display: flex;
    gap: var(--portal-space-5);
    padding: var(--portal-space-6);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    background: var(--portal-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: var(--portal-shadow);
}

.portal-shell .dashboard-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--portal-card-shadow);
    border-color: var(--portal-border-strong);
}

.portal-shell .dashboard-grid .card.highlight {
    border-color: var(--portal-primary);
}

.portal-shell .card-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--portal-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--portal-border);
    background: rgba(255, 255, 255, 0.65);
}

.portal-shell .card-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.portal-shell .card-icon.messages {
    background: linear-gradient(135deg, var(--portal-tint-messages) 0%, rgba(255, 255, 255, 0.8) 120%);
}

.portal-shell .card-icon.quotes {
    background: linear-gradient(135deg, var(--portal-tint-quotes) 0%, rgba(255, 255, 255, 0.82) 120%);
}

.portal-shell .card-icon.payments {
    background: linear-gradient(135deg, var(--portal-tint-payments) 0%, rgba(255, 255, 255, 0.82) 120%);
}

.portal-shell .card-icon.vendors {
    background: linear-gradient(135deg, var(--portal-tint-vendors) 0%, rgba(255, 255, 255, 0.82) 120%);
}

.portal-shell .card-body h3 {
    font-size: 1.1rem;
    font-weight: 750;
    color: var(--portal-text);
    margin: 0 0 var(--portal-space-2) 0;
}

.portal-shell .card-body p {
    color: var(--portal-text-muted);
    line-height: 1.6;
    margin: 0 0 var(--portal-space-4) 0;
    font-size: var(--portal-text-size-1);
}

/* Empty states (portal scoped override) */
.portal-shell .empty-state {
    text-align: center;
    padding: 4.5rem 2rem;
    background: var(--portal-surface);
    border-radius: var(--portal-radius-lg);
    border: 1px dashed var(--portal-border);
    box-shadow: var(--portal-shadow);
    color: var(--portal-text);
}

.portal-shell .empty-state h3 {
    font-size: 1.45rem;
    font-weight: 750;
    color: var(--portal-text);
    margin: 0 0 var(--portal-space-3) 0;
}

.portal-shell .empty-state p {
    color: var(--portal-text-muted);
    font-size: var(--portal-text-size-3);
    line-height: 1.65;
    max-width: 52ch;
    margin: 0 auto;
}

.portal-shell .empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto var(--portal-space-6) auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--portal-info-soft) 0%, rgba(255, 255, 255, 0.85) 120%);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    border-radius: var(--portal-radius-md);
}

.portal-shell .empty-icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.portal-shell .documents-empty-icon {
    font-size: 1.75rem;
    line-height: 1;
}

/* Vendors */
.portal-shell .invite-box {
    margin-top: var(--portal-space-4);
    padding: 2.75rem 2rem;
    background: var(--portal-surface);
    border-radius: var(--portal-radius-lg);
    text-align: center;
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
}

.portal-shell .invite-box > p {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--portal-text);
    margin-bottom: var(--portal-space-6);
}

.portal-shell .vendor-list {
    list-style: none;
    margin: var(--portal-space-8) 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--portal-space-3);
}

.portal-shell .vendor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.05rem 1.25rem;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    background: rgba(255, 255, 255, 0.65);
    flex-wrap: wrap;
    gap: var(--portal-space-4);
}

.portal-shell .vendor-name {
    margin: 0;
    font-weight: 750;
    color: var(--portal-text);
}

.portal-shell .vendor-meta {
    margin: var(--portal-space-1) 0 0 0;
    color: var(--portal-text-muted);
    font-size: 0.9rem;
}

.portal-shell .btn-copy {
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 120%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-weight: 750;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.portal-shell .btn-copy:hover {
    filter: brightness(0.98);
    transform: translateY(-1px);
}

/* Portal chat */
.portal-shell .portal-chat-page {
    display: flex;
    flex-direction: column;
    padding-top: var(--portal-space-4);
    padding-bottom: var(--portal-space-10);
}

.portal-shell .chat-header {
    margin-bottom: var(--portal-space-8);
    padding-bottom: var(--portal-space-6);
    border-bottom: 1px solid var(--portal-border);
    display: flex;
    gap: var(--portal-space-4);
    align-items: center;
}

.portal-shell .chat-header-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--portal-radius-md);
    background: linear-gradient(135deg, var(--portal-tint-messages) 0%, rgba(255, 255, 255, 0.85) 120%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--portal-border);
}

.portal-shell .chat-content-wrapper {
    display: flex;
    flex-direction: column;
}

.portal-shell .empty-chat {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--portal-text-muted);
    background: rgba(255, 255, 255, 0.55);
    border-radius: var(--portal-radius-lg);
    margin-top: var(--portal-space-6);
    border: 1px dashed var(--portal-border);
}

.portal-shell .chat-thread-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 420px;
    background: var(--portal-surface);
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
}

.portal-shell .chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: var(--portal-space-6);
    display: flex;
    flex-direction: column;
    gap: var(--portal-space-3);
}

.portal-shell .empty-thread {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--portal-text-muted);
    padding: var(--portal-space-10) var(--portal-space-6);
}

.portal-shell .message-shell {
    display: flex;
    width: 100%;
    margin-bottom: var(--portal-space-2);
}

.portal-shell .message-shell-sender {
    justify-content: flex-end;
}

.portal-shell .message-shell-receiver {
    justify-content: flex-start;
}

.portal-shell .message-group {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: var(--portal-space-1);
}

.portal-shell .message-bubble {
    padding: 0.9rem 1.1rem;
    border-radius: 18px;
    word-wrap: break-word;
    animation: portal-slide-in 0.18s ease-out;
}

.portal-shell .message-sender {
    background: linear-gradient(135deg, var(--portal-bubble-outgoing) 0%, rgba(255, 255, 255, 0.8) 140%);
    color: var(--portal-ink);
    border-bottom-right-radius: 6px;
    border: 1px solid var(--portal-accent-border);
    box-shadow: var(--portal-card-shadow);
}

.portal-shell .message-receiver {
    background: var(--portal-bubble-incoming);
    color: var(--portal-text);
    border: 1px solid var(--portal-border);
    border-bottom-left-radius: 6px;
}

.portal-shell .message-content {
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: var(--portal-space-1);
    white-space: pre-wrap;
}

.portal-shell .message-time {
    font-size: 0.78rem;
    opacity: 0.75;
    text-align: right;
}

.portal-shell .message-status {
    font-size: 0.78rem;
    color: var(--portal-text-muted);
    text-align: right;
    padding: 0 var(--portal-space-2);
}

.portal-shell .message-input-container {
    display: flex;
    gap: var(--portal-space-3);
    padding: var(--portal-space-5);
    background: var(--portal-surface);
    border-top: 1px solid var(--portal-border);
    align-items: flex-end;
}

.portal-shell .message-input {
    flex: 1;
    min-height: 48px;
    max-height: 140px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--portal-border-strong);
    border-radius: var(--portal-radius-md);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--portal-surface);
    color: var(--portal-text);
}

.portal-shell .message-input:focus {
    border-color: var(--portal-primary);
    box-shadow: var(--portal-focus-ring);
}

.portal-shell .message-input:disabled {
    background: rgba(255, 255, 255, 0.55);
    cursor: not-allowed;
    opacity: 0.7;
}

.portal-shell .message-input::placeholder {
    color: var(--portal-text-muted);
}

.portal-shell .send-button {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 120%);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, filter 0.15s ease;
    box-shadow: 0 10px 20px rgba(201, 176, 140, 0.25);
}

.portal-shell .send-button:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.portal-shell .send-button:disabled {
    background: var(--portal-text-muted);
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

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

@media (min-width: 992px) {
    .portal-shell .portal-nav {
        width: 300px;
        height: 100vh;
        position: sticky;
        top: 0;
        border-right: 1px solid var(--portal-border);
        border-bottom: none;
    }

    .portal-shell .nav-links {
        display: flex;
        flex-direction: column;
        gap: var(--portal-space-2);
        flex: 1;
    }

    .portal-shell .nav-item.highlight {
        margin-top: auto;
    }
}

@media (max-width: 768px) {
    .portal-shell .message-group {
        max-width: 85%;
    }

    /* Mobile portal header layout */
    .portal-shell .portal-nav {
        padding: var(--portal-space-4);
        gap: var(--portal-space-4);
    }

    .portal-shell .portal-brand {
        gap: var(--portal-space-4);
        padding-bottom: var(--portal-space-4);
    }

    .portal-shell .brand-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .portal-shell .brand-wordmark {
        flex: 1;
    }

    .portal-shell .customer-name {
        font-size: 1.25rem;
        word-break: break-word;
    }

    .portal-shell .active-vendor-display {
        margin-top: 0;
        margin-bottom: var(--portal-space-2);
    }

    /* Hide other vendors section on mobile */
    .portal-shell .other-vendors-section {
        display: none;
    }

    /* Event section on mobile - inline layout */
    .portal-shell .event-selector,
    .portal-shell .event-display {
        margin: 0;
    }

    .portal-shell .event-display {
        padding: var(--portal-space-2) 0;
    }

    .portal-shell .meta-label {
        font-size: 0.65rem;
        margin-bottom: var(--portal-space-1);
    }

    .portal-shell .meta-value {
        font-size: 0.9rem;
    }

    .portal-shell .event-date {
        margin-top: 0.25rem;
    }

    /* Mobile navigation toggle button */
    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        color: var(--wedly-charcoal);
        transition: transform 0.2s ease;
        margin-top: 0.5rem;
    }

    .mobile-nav-toggle:hover {
        transform: scale(1.1);
    }

    /* Navigation links collapse/expand on mobile */
    .portal-shell .nav-links {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        visibility: hidden;
    }

    .portal-shell .nav-links.expanded {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
    }

    .portal-shell .nav-links.collapsed {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
    }

    .portal-shell .nav-item {
        display: flex;
        align-items: center;
        width: 100%;
        margin: 0.25rem 0;
    }

    /* Payment button mobile styles */
    .payment-actions {
        flex-direction: column !important;
    }

    .payment-button {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 1rem !important;
    }

    .payment-button-primary {
        flex: none !important;
        min-width: unset !important;
        width: 100% !important;
    }

    .payment-button-cancel {
        width: 100% !important;
    }
}

/* ============ AI / Wedly VA Shared Styles ============ */

/* AI assistant warning banner (shared) */
.ai-assistant-banner {
    background: var(--wedly-cream);
    border: 1px solid var(--admin-accent-border);
    padding: 0.35rem 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
}

.ai-assistant-banner .banner-icon {
    flex-shrink: 0;
    color: var(--admin-accent-solid);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-assistant-banner .banner-content {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.ai-assistant-banner .banner-title {
    font-weight: 600;
    color: var(--admin-text);
    font-size: 0.82rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.ai-assistant-banner .banner-text {
    color: var(--admin-text);
    font-size: 0.78rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-assistant-banner .setup-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: auto !important;
    flex: 0 0 auto;
    padding: 0.25rem 0.5rem;
    background: var(--admin-surface);
    color: var(--admin-text);
    border: 1px solid var(--admin-accent-border);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.ai-assistant-banner .setup-button:hover {
    background: var(--admin-surface-hover);
}

/* AI progress animations - shared across all AI components */
@keyframes ai-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ai-icon-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px var(--ai-shadow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px var(--ai-shadow-hover);
    }
}

@keyframes ai-sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes ai-progress-indeterminate {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}

@keyframes ai-step-fade-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* AI progress container base */
.ai-progress-base {
    background: linear-gradient(135deg, var(--ai-bg-start) 0%, var(--ai-bg-mid) 100%);
    border: 1px solid var(--ai-border);
    border-radius: 12px;
    animation: ai-slide-in 0.3s ease-out;
}

/* AI icon styling */
.ai-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-dark) 100%);
    border-radius: 10px;
    animation: ai-icon-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.ai-icon-container :deep(svg) {
    color: #fff !important;
}

/* AI progress bar */
.ai-progress-bar-track {
    height: 6px;
    background-color: rgba(139, 92, 246, 0.2);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.ai-progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--ai-primary) 0%, var(--ai-primary-light) 50%, var(--ai-primary) 100%);
    border-radius: 999px;
    animation: ai-progress-indeterminate 1.5s ease-in-out infinite;
}

/* AI step list styling */
.ai-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.ai-step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ai-text-muted);
    animation: ai-step-fade-in 0.3s ease-out;
}

.ai-step-item.active {
    color: var(--ai-primary);
    font-weight: 500;
}

.ai-step-item.completed {
    color: #10b981;
}

.ai-step-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI label styling */
.ai-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ai-label);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* AI bubble gradient background */
.ai-bubble-gradient {
    background: linear-gradient(135deg, var(--ai-bg-start) 0%, var(--ai-bg-mid) 50%, var(--ai-bg-end) 100%);
    border: 2px dashed var(--ai-border);
    box-shadow: 0 2px 12px var(--ai-shadow);
}

/* ===================== Portal: Image Uploader ===================== */

.image-uploader-container {
    width: 100%;
}

.image-uploader-container .uploader-zone {
    border: 2px dashed color-mix(in srgb, var(--neutral-stroke-strong) 75%, transparent);
    border-radius: 16px;
    padding: 2.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--neutral-fill-subtle) 92%, white) 0%,
        var(--neutral-fill-subtle) 100%
    );
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-uploader-container .uploader-zone:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-fill-rest) 40%, transparent);
    outline-offset: 4px;
}

.image-uploader-container .uploader-zone .file-input-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.image-uploader-container .uploader-zone.has-images .file-input-overlay {
    pointer-events: none;
}

.image-uploader-container .uploader-zone:hover {
    border-color: color-mix(in srgb, var(--accent-fill-rest) 65%, var(--neutral-stroke-strong));
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-fill-subtle) 40%, var(--neutral-fill-subtle)) 0%,
        var(--neutral-fill-subtle) 100%
    );
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.image-uploader-container .uploader-zone.dragging {
    border-color: var(--accent-fill-rest);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-fill-subtle) 70%, white) 0%,
        var(--accent-fill-subtle) 100%
    );
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.image-uploader-container .uploader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.image-uploader-container .upload-icon {
    color: var(--accent-fill-rest);
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-uploader-container .upload-icon svg {
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.12));
}

.image-uploader-container .uploader-content h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
}

.image-uploader-container .upload-hint {
    margin: 0.5rem 0 0 0;
    color: var(--neutral-foreground-secondary);
    font-size: 0.95rem;
}

.image-uploader-container .file-types {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--neutral-foreground-tertiary);
    margin-top: 0.5rem;
}

.image-uploader-container .uploading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.image-uploader-container .spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-uploader-container .uploading-content p {
    margin: 0;
    color: var(--neutral-foreground-rest);
    font-weight: 500;
}

.image-uploader-container .progress-text {
    font-size: 0.875rem;
    color: var(--neutral-foreground-secondary);
}

.image-uploader-container .uploaded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    width: 100%;
    padding: 1rem 0;
}

.image-uploader-container .image-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-uploader-container .image-card:hover {
    transform: translateY(-2px);
}

.image-uploader-container .image-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    border: 1px solid var(--neutral-stroke-layer);
    background-color: var(--neutral-fill-subtle);
    transition: box-shadow 0.2s ease;
}

.image-uploader-container .image-preview:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.image-uploader-container .remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: var(--accent-fill-rest);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.image-uploader-container .image-preview:hover .remove-btn {
    opacity: 1;
}

.image-uploader-container .remove-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.image-uploader-container .remove-btn:active {
    transform: scale(0.95);
}

.image-uploader-container .image-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.image-uploader-container .image-name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-uploader-container .image-size {
    font-size: 0.75rem;
    color: var(--neutral-foreground-tertiary);
}

.image-uploader-container .add-more-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    aspect-ratio: 1;
    border: 2px dashed var(--neutral-stroke-strong);
    border-radius: 8px;
    background: var(--neutral-fill-subtle);
    color: var(--accent-fill-rest);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0;
}

.image-uploader-container .add-more-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-fill-rest) 40%, transparent);
    outline-offset: 4px;
}

.image-uploader-container .add-more-btn:hover {
    border-color: var(--accent-fill-rest);
    background: var(--accent-fill-subtle);
    transform: scale(1.02);
}

.image-uploader-container .add-more-btn:active {
    transform: scale(0.98);
}

.image-uploader-container .error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--system-red-fill-subtle, rgba(196, 43, 28, 0.08));
    border: 1px solid var(--system-red-stroke, rgba(196, 43, 28, 0.3));
    border-radius: 6px;
    color: var(--system-red-foreground, #c41c16);
    font-size: 0.875rem;
}

.image-uploader-container .error-message svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .image-uploader-container .uploader-zone {
        padding: 1.5rem;
        min-height: 200px;
    }

    .image-uploader-container .uploaded-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .image-uploader-container .uploader-content h3 {
        font-size: 1.1rem;
    }

    .image-uploader-container .upload-hint {
        font-size: 0.875rem;
    }
}

/* ============ Global Mobile Optimizations (Buttons & Inputs) ============ */
@media (max-width: 768px) {
    /* Enforce touch-friendly targets */
    .save-button,
    .cancel-button,
    .ghost-button,
    .btn,
    .payment-button {
        font-size: 0.875rem; /* 14px */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Icon buttons */
    .icon-button {
        width: 2.75rem; /* 44px */
        height: 2.75rem;
    }
    
    .icon-button svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Form Inputs */
    .form-control, 
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        min-height: 2.5rem; /* 40px */
        font-size: 1rem !important; /* 16px - Force 1rem to prevent zoom while scaling */
        padding: 0.5rem 0.75rem;
    }

    /* Form Groups Spacing */
    .form-group,
    .form-row {
        margin-bottom: 1.5rem;
    }

    /* Keep action bars wrappable on small screens */
    .branding-editor-actions,
    .forms-header-actions,
    .detail-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Modal footer: keep buttons inline and compact; wrap only if needed */
    .modal-footer {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    .modal-footer > button,
    .modal-footer > .save-button,
    .modal-footer > .cancel-button {
        flex: 0 1 auto;
        width: auto;
        margin-left: 0 !important;
        min-height: 2.75rem;
        padding: 0.5rem 1.25rem;
    }
}

/* ═══════════════════════════════════════════════════════
   Legal pages (Terms / Privacy)
   ═══════════════════════════════════════════════════════ */
.legal-page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 1rem 2rem;
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    color: var(--neutral-800, var(--wedly-charcoal));
    line-height: 1.6;
}

.legal-page-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-900, #111);
}

.legal-page-content .last-updated {
    color: var(--neutral-500, #666);
    font-style: italic;
    margin-bottom: 3rem;
}

.legal-page-content section {
    margin-bottom: 2.5rem;
}

.legal-page-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-800, #222);
    border-bottom: 2px solid var(--primary-100, #eee);
    padding-bottom: 0.5rem;
}

.legal-page-content h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-700, var(--wedly-charcoal));
}

.legal-page-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-page-content li {
    margin-bottom: 0.5rem;
}

.legal-page-content p {
    margin-bottom: 1rem;
}

.legal-page-content a {
    color: var(--wedly-dusty-rose, #d8b04a);
}

.legal-page-content a:hover {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .legal-page-container {
        padding-top: 110px;
    }
}

@media (max-width: 575px) {
    .legal-page-container {
        padding-top: 95px;
    }
}