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

/* ===== Accessibility ===== */

/* Skip navigation link - visible only on focus */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #667eea;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #764ba2;
    outline-offset: 2px;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators - visible outlines for keyboard navigation */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

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

    .progress-bar {
        transition: none !important;
    }
}

/* ===== End Accessibility ===== */

.environment-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 1000;
    color: white;
}

.environment-banner.test {
    background-color: #f59e0b;
}

.environment-banner.prod {
    background-color: #ef4444;
}

/* Demo Notice Banner */
.demo-banner {
    position: fixed;
    top: 44px; /* Below environment banner */
    left: 0;
    right: 0;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    z-index: 999;
    background-color: #1e40af;
    color: white;
}

/* Auth Navbar */
.auth-navbar {
    position: fixed;
    top: 88px; /* Below environment banner + demo banner */
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.12);
    z-index: 999;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
    text-decoration: none;
}

.nav-brand:hover {
    transform: scale(1.02);
}

.nav-brand:focus-visible {
    outline: 3px solid #764ba2;
    outline-offset: 4px;
    border-radius: 4px;
}

.nav-brand::before {
    content: "";
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: inline-block;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 6H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H4V8h16v8zM6 10h2v4H6z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 6H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H4V8h16v8zM6 10h2v4H6z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
}

.brand-tooltip {
    font-size: 0.85em;
    cursor: help;
    opacity: 0.6;
    -webkit-text-fill-color: #764ba2;
    transition: opacity 0.2s;
}

.brand-tooltip:hover {
    opacity: 1;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.08), transparent);
    transition: left 0.4s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    background: #f8f9fc;
    border-color: #764ba2;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.nav-btn-primary::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.nav-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a71d4 0%, #6a4296 100%);
}

.user-email {
    color: #555;
    font-size: 0.9rem;
    margin-right: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 6px;
    font-weight: 500;
}

/* Pro Banner */
.pro-banner {
    position: fixed;
    top: 100px; /* Below navbar */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    text-align: center;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 998;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    padding-top: 164px; /* Account for env banner + demo banner + navbar */
    color: #333;
}

.container {
    width: 100%;
    max-width: 500px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="number"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

input[type="number"]:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

button[type="submit"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none !important;
}

.result {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 10px;
    color: white;
}

.result-content {
    text-align: center;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-value {
    font-size: 3rem;
    font-weight: bold;
    margin: 10px 0;
}

.calculation {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 10px;
}

.error {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    border-radius: 10px;
    color: white;
    text-align: center;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Member Info Display */
.member-info {
    max-width: 480px;
    margin: 1rem auto;
}

.member-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.member-info-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.member-info-card p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.member-info-card strong {
    opacity: 0.9;
}

/* Card Generator Section */
.card-generator-section h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Collapsed Form Summary (shown after generation) */
.form-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.form-summary-content {
    flex: 1;
    min-width: 0;
}

.form-summary-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-summary-text strong {
    color: #667eea;
    font-weight: 600;
}

.form-summary-edit-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: #667eea;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.form-summary-edit-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

textarea {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #636363;
    margin-top: 5px;
}

.generate-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading message during generation (CM-27) */
.generating-message {
    margin-top: 15px;
    padding: 20px;
    text-align: center;
    color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.generating-message p {
    margin: 0;
}

/* Progress bar container */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
    margin: 12px 0;
    overflow: hidden;
}

/* Progress bar fill */
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Card Preview */
.card-preview {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    scroll-margin-top: 180px; /* 164px fixed headers + breathing room */
}

.card-preview h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.card-image-container {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.card-image-container a {
    display: block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.card-image-container a:hover {
    opacity: 0.9;
}

.card-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.preview-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #636363;
}

/* Usage Display */
.usage-display {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.usage-display.limit-reached {
    color: #ef4444;
    font-weight: 600;
}

/* Checkout Section */
.checkout-section {
    margin-top: 25px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
}

.checkout-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.price {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

select {
    cursor: pointer;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(17, 153, 142, 0.3);
}

.checkout-btn:active:not(:disabled) {
    transform: translateY(0);
}

.checkout-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Container adjustments */
.container {
    max-width: 700px;
}

/* Responsive design */
@media (max-width: 600px) {
    /* Compact banners for mobile — reduce from 164px to ~100px total */
    .environment-banner {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .demo-banner {
        top: 32px; /* Reduced env banner height */
        padding: 4px 12px;
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .auth-navbar {
        top: 58px; /* 32px env + 26px demo */
        padding: 8px 16px;
    }

    .nav-brand {
        font-size: 1.15rem;
    }

    .nav-brand::before {
        width: 22px;
        height: 22px;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .user-email {
        font-size: 0.78rem;
        padding: 4px 8px;
        margin-right: 4px;
    }

    body {
        padding-top: 106px; /* 32 + 26 + 48 env+demo+nav */
    }

    .card-preview {
        scroll-margin-top: 120px; /* 106px mobile headers + breathing room */
    }

    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .card-generator-section h1 {
        font-size: 1.5rem;
    }

    .result-value {
        font-size: 2.5rem;
    }

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

    .checkout-section {
        padding: 20px 15px;
    }

    .price {
        font-size: 1.3rem;
    }
}

/* Checkout Flow Styles */
.buy-btn {
    width: 100%;
    padding: 16px 24px;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.buy-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Sticky Buy Button Wrapper */
.buy-btn-sticky-wrapper {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid rgba(102, 126, 234, 0.12);
}

.buy-btn-sticky-wrapper .buy-btn {
    margin-top: 0;
    font-size: 1.2rem;
    padding: 18px 24px;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.35);
}

.buy-btn-sticky-wrapper .buy-btn:hover {
    box-shadow: 0 6px 24px rgba(40, 167, 69, 0.5);
}

/* Legal / Info Pages */
.legal-page body,
body.legal-page {
    align-items: flex-start;
}

.legal-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.legal-card {
    background: white;
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.legal-card h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-align: left;
}

.legal-card .last-updated {
    color: #636363;
    font-size: 0.85rem;
    margin-bottom: 32px;
}

.legal-card h2 {
    font-size: 1.3rem;
    color: #333;
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.15);
}

.legal-card h3 {
    font-size: 1.1rem;
    color: #444;
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-card p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-card ul,
.legal-card ol {
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 24px;
}

.legal-card li {
    margin-bottom: 6px;
}

.legal-card a {
    color: #667eea;
    text-decoration: none;
}

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

.legal-card .contact-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    padding: 20px;
    border-radius: 10px;
    margin-top: 24px;
}

.legal-card .contact-info p {
    margin-bottom: 4px;
}

.legal-card .disclaimer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #636363;
    font-style: italic;
}

/* Hub page link cards (CM-159) */
.hub-links { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.hub-link { display: block; padding: 1rem 1.5rem; color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.hub-link:hover { opacity: 0.92; }
.hub-link span { display: block; font-weight: 400; font-size: 0.875rem; opacity: 0.85; margin-top: 0.25rem; }
.hub-link.blue { background: #2563eb; }
.hub-link.purple { background: #7c3aed; }
.hub-link.green { background: #059669; }
.hub-link.pink { background: #ec4899; }

/* Site Footer */
.site-footer {
    text-align: center;
    margin-top: 24px;
    padding: 16px 0;
}

.site-footer .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.site-footer .footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 2px;
    font-size: 0.85rem;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus {
    color: white;
    text-decoration-color: white;
}

.site-footer .footer-links a[aria-current="page"] {
    font-weight: 600;
    text-decoration-color: rgba(255, 255, 255, 0.7);
}

.site-footer .footer-copy {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-top: 8px;
}

/* Product Type Picker */
.product-type-picker {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
}

.product-type-card {
    flex: 1;
    max-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.product-type-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.product-type-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.product-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: inherit;
}

.product-type-label {
    text-align: center;
    line-height: 1.2;
}

/* Variant Selector */
.variant-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.variant-pill {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.variant-pill:hover {
    border-color: #667eea;
    color: #667eea;
}

.variant-pill.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Transparent Background Toggle (CM-133) */
.shape-mismatch-warning {
    margin-bottom: 12px;
    padding: 10px 16px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    color: #7b6b00;
    font-size: 0.85rem;
    line-height: 1.4;
}

.transparency-toggle-group {
    margin-bottom: 16px;
}

.transparency-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.transparency-label:hover {
    border-color: #667eea;
}

.transparency-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.transparency-label-text {
    font-weight: 500;
}

.transparency-hint {
    font-size: 0.8rem;
    color: #999;
    font-weight: 400;
}

/* Options Toggle & Collapsible Panel (CM-128) */
.options-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    color: #777;
    transition: all 0.2s ease;
}

.options-toggle:hover {
    border-color: #667eea;
    color: #667eea;
}

.options-toggle-summary {
    font-weight: 500;
}

.options-toggle-chevron {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.options-toggle[aria-expanded="true"] .options-toggle-chevron {
    transform: rotate(180deg);
}

.options-panel {
    margin-bottom: 16px;
    overflow: hidden;
}

.options-panel[hidden] {
    display: none;
}

/* Art Style Chooser (CM-128) */
.style-chooser {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.style-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.style-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.style-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.style-swatch {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f0f0;
}

.style-swatch-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.style-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    line-height: 1.2;
}

.style-card.selected .style-name {
    color: #667eea;
}

@media (max-width: 600px) {
    .style-chooser {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 8px;
    }

    .style-swatch,
    .style-swatch-placeholder {
        width: 60px;
        height: 60px;
    }

    .style-name {
        font-size: 0.7rem;
    }

    .product-type-picker {
        gap: 8px;
    }

    .product-type-card {
        padding: 12px 8px;
        font-size: 0.8rem;
    }

    .variant-pill {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Mockup Gallery */
.mockup-gallery {
    margin-top: 20px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.mockup-gallery h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1rem;
    text-align: center;
}

.mockup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    color: #667eea;
    font-size: 0.9rem;
}

.mockup-loading p {
    margin: 0;
}

.mockup-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
}

.mockup-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* Column layouts — items sized by percentage minus gap */
.mockup-grid.mockup-cols-1 .mockup-item {
    width: 60%;
}

.mockup-grid.mockup-cols-2 .mockup-item {
    width: calc(50% - 6px);  /* 2 per row, half of 12px gap */
}

.mockup-grid.mockup-cols-3 .mockup-item {
    width: calc(33.333% - 8px);  /* 3 per row, 2/3 of 12px gap */
}

.mockup-item {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.mockup-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.mockup-item.mockup-default {
    border: 2px solid #667eea;
}

.mockup-item a {
    display: block;
}

.mockup-item img {
    width: 100%;
    height: auto;
    display: block;
}

.mockup-caption {
    display: block;
    padding: 6px 4px;
    font-size: 0.75rem;
    color: #636363;
    text-align: center;
}

.mockup-error {
    text-align: center;
    color: #636363;
    font-size: 0.85rem;
    padding: 8px 0;
}

@media (max-width: 600px) {
    /* On mobile, 3-col becomes 2-col with last row centered */
    .mockup-grid.mockup-cols-3 .mockup-item {
        width: calc(50% - 6px);
    }

    .mockup-grid.mockup-cols-1 .mockup-item {
        width: 80%;
    }
}

/* Info page specific */
.info-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.info-card h2,
.info-card h3 {
    margin-top: 0;
    color: #667eea;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    color: #333;
    margin-bottom: 6px;
}

@media (max-width: 600px) {
    .legal-card {
        padding: 28px 20px;
    }

    .legal-card h1 {
        font-size: 1.5rem;
    }

    .legal-card h2 {
        font-size: 1.15rem;
    }
}

/* ── Multi-Item Selector (CM-152) ──────────────────────────── */
.multi-item-selector {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 12px;
}

.multi-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.multi-item-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.multi-item-counter {
    font-size: 0.85rem;
    color: var(--text-secondary, #8a8aaf);
    font-weight: 500;
}

.multi-item-counter.at-limit {
    color: var(--accent-color, #f59e0b);
    font-weight: 600;
}

.multi-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.multi-item-card {
    background: var(--input-bg, #16162a);
    border: 2px solid var(--border-color, #2a2a4a);
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.2s, border-color 0.2s;
}

.multi-item-card.excluded {
    opacity: 0.4;
    border-color: transparent;
}

.multi-item-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.multi-item-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.multi-item-controls .quantity-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
}

.multi-item-controls .quantity-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 600;
}

@media (max-width: 600px) {
    .multi-item-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
}
