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

:root {
    --primary: #C9A84C;
    --primary-dark: #8B6B2A;
    --primary-light: rgba(201,168,76,0.14);
    --accent: #9B1C1C;
    --accent-warm: #9B1C1C;
    --bg-dark: #FAF9F7;
    --bg-card: #ffffff;
    --bg-card-hover: #F8F4EC;
    --text-primary: #1A1614;
    --text-secondary: #3D3430;
    --text-muted: #8A7E6E;
    --border: #E8DEC8;
    --success: #16a34a;
    --error: #dc2626;
    --info: #C9A84C;
    --modal-frame-bg: #FAF9F7;
    --modal-input-bg: #ffffff;
    --modal-chip-bg: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.landing {
    min-height: 100vh;
    background: linear-gradient(135deg, #FAF9F7 0%, #F5F0EE 50%, #FAF9F7 100%);
    position: relative;
    overflow: hidden;
}

.landing::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(201,168,76,0.07) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(201,162,39,0.07) 0%, transparent 40%);
    animation: gradientMove 20s ease-in-out infinite;
}

@keyframes gradientMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-img {
    height: 56px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    vertical-align: middle;
}

/* Icon PNG + text side-by-side layout */
.logo-icon-img {
    height: 62px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    mix-blend-mode: multiply;
}

.logo-text-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
}

.logo-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #1A1614;
    display: block;
    letter-spacing: -0.01em;
}

.logo-ai {
    color: #C9A84C;
}

.logo-sub {
    font-family: Georgia, serif;
    font-size: 0.78rem;
    color: #C9A84C;
    font-style: italic;
    display: block;
    letter-spacing: 0.01em;
}

.logo-tag {
    font-size: 0.6rem;
    color: #8A7E6E;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link-investors {
    color: var(--primary);
    font-weight: 600;
}

.btn-get-started {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-get-started:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 3rem;
    position: relative;
    z-index: 10;
    min-height: 70vh;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.22);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--accent-warm) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

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

.hero-signup-wrap {
    align-items: flex-start;
}

.btn-primary-large {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: fit-content;
}

.btn-primary-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(201,168,76,0.35);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn-primary-large:hover .btn-arrow {
    transform: translateX(4px);
}

.hero-note {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-premium-link {
    display: inline-block;
    font-size: 0.82rem;
    color: var(--accent-warm);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.07);
    transition: all 0.2s ease;
    margin-top: 2px;
}

.hero-premium-link:hover {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.5);
    color: #d97706;
}

.hero-visual {
    flex: 1;
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.floating-card {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.floating-card span {
    font-size: 2rem;
}

.floating-card p {
    font-weight: 500;
    color: var(--text-secondary);
}

.card-1 { top: 5%; left: 15%; animation-delay: 0s; }
.card-2 { top: 15%; right: 10%; animation-delay: -1s; }
.card-3 { top: 45%; left: 5%; animation-delay: -2s; }
.card-4 { top: 50%; right: 0%; animation-delay: -3s; }
.card-5 { bottom: 20%; left: 15%; animation-delay: -4s; }
.card-6 { bottom: 5%; right: 10%; animation-delay: -5s; }

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

.site-footer {
    padding: 1.75rem 3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.footer-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.footer-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-link.investors-link {
    color: var(--primary);
}

.footer-link.investors-link:hover {
    color: var(--primary-dark);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .site-footer {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 0.75rem;
    }
    .footer-links {
        gap: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 3rem;
    position: relative;
    z-index: 10;
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    background: var(--bg-card);
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(201,168,76,0.12);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    background: var(--bg-dark);
    opacity: 1;
    transition: opacity 0.3s ease;
    width: 100%;
    overflow-x: clip;
}

.app-container.hidden {
    display: none;
}

.app-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat span {
    color: var(--primary-light);
    font-weight: 600;
}

main {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.app-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    max-width: 100%;
}

.app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-width: 0;
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    margin-bottom: 0;
}

.count-badge {
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-content {
    pointer-events: none;
}

.upload-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--bg-card-hover);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.upload-icon {
    font-size: 1.5rem;
    color: var(--primary-light);
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

#advanced-toggle {
    margin-top: 0.75rem;
}

.preview-container {
    position: relative;
    display: inline-block;
}

.preview-count {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.75);
    color: white;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.preview-container img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    object-fit: cover;
}

.preview-container .btn-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--error);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary.subtle {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary.subtle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.upload-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

select {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    width: min(1040px, 92vw);
    max-height: 90vh;
    border-radius: 28px;
    padding: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 32px 70px rgba(15, 23, 42, 0.22);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: #ffffff;
    padding-bottom: 8px;
}

.modal-header-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-header-text h3 {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.32;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--bg-card-hover, #f1f5f9);
    color: var(--text-primary);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    overflow: auto;
    align-items: start;
    padding-top: 24px;
    padding-bottom: 24px;
    background: #ffffff;
}

.modal-media-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    align-self: stretch;
}

.modal-media {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(320px, 100%);
    height: 420px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 16px;
}

.modal-media img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    margin: 0 auto;
    display: block;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px 0;
}

.modal-details label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    line-height: 44px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    background: #ffffff;
}

.modal-input {
    width: 100%;
}

select.form-control {
    height: 44px;
    padding: 0 14px;
    line-height: 44px;
    font-size: 0.875rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa4b2' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.form-control[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-control:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.form-control:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.multi-select {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.multi-select-input {
    width: 100%;
}

.multi-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.multi-select-chip {
    background: var(--modal-chip-bg);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    padding: 0 10px;
    font-size: 0.78rem;
    color: #334;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
}

.multi-select-chip:hover {
    background: rgba(148, 163, 184, 0.1);
    cursor: pointer;
}

.multi-select-chip button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.7rem;
    color: rgba(15, 23, 42, 0.35);
    line-height: 1;
}

.multi-select-dropdown {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 8px;
    display: none;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 5;
}

.multi-select.open .multi-select-dropdown {
    display: block;
}

.multi-option {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #334;
}

.multi-option:hover {
    background: #f3f5f7;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.25);
    margin: 4px 0 6px;
}

.meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-tag,
.meta-tags span {
    background: var(--modal-chip-bg);
    color: #334;
    border: 1px solid rgba(148, 163, 184, 0.12);
    padding: 1px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
}

.meta-tag:hover,
.meta-tags span:hover {
    background: rgba(148, 163, 184, 0.1);
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
}

.modal-description-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}

.modal-description {
    font-size: 0.88rem;
    color: #7b8494;
    font-weight: 400;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-header {
    padding-bottom: 6px;
}

.modal-description.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.text-link {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
}

.text-link.hidden {
    display: none;
}

.modal-footer {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    align-items: start;
    padding: 32px 24px 20px;
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: #ffffff;
}

.modal-footer .btn-primary,
.modal-footer .btn-danger {
    height: 44px;
    border-radius: 12px;
    padding: 0 24px;
    font-size: 0.875rem;
    font-weight: 600;
}

.modal-footer .btn-primary {
    background: #C9A84C;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.modal-footer .btn-primary:hover:not(:disabled) {
    background: #8B6B2A;
}

.modal-footer .btn-danger {
    background: #ffffff;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.modal-footer .btn-danger:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.modal-footer .modal-actions {
    justify-content: flex-end;
}

#item-status-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.btn-secondary.danger {
    border-color: var(--error);
    color: var(--error);
}

@media (max-width: 900px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    .modal-footer {
        grid-template-columns: 1fr;
    }
}

.btn-primary {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-primary:disabled {
    background: var(--bg-card-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.generate-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gender-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card-hover);
    padding: 0.25rem;
    border-radius: 10px;
}

.gender-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gender-btn:hover {
    color: var(--text-secondary);
}

.gender-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gender-btn span {
    font-size: 1.1rem;
}

.weather-section {
    background: var(--bg-card-hover);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.weather-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-icon {
    font-size: 1.25rem;
}

.weather-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.weather-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.weather-status.detecting {
    color: var(--info);
}

.weather-status.ready {
    color: var(--success);
}

.weather-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.weather-option-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.weather-option-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.weather-option-btn.active {
    border-color: var(--primary);
    background: rgba(201,168,76,0.08);
    color: var(--primary);
}

.weather-option-btn span {
    font-size: 0.9rem;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.input-wrapper input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-wrapper.occasion-notes {
    flex-direction: column;
    gap: 0.4rem;
}

.input-wrapper.occasion-notes label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.input-wrapper.occasion-notes textarea {
    width: 100%;
    min-height: 108px;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    resize: vertical;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.input-wrapper.occasion-notes textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.14), 0 8px 20px rgba(201,168,76,0.08);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-small:hover {
    background: var(--primary-dark);
}

.profile-section {
    margin-bottom: 0.75rem;
}

.profile-field {
    flex: 1;
}

.profile-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.profile-field input,
.profile-field select {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.profile-field input:focus,
.profile-field select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(201,168,76,0.22);
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201,168,76,0.35);
}

.btn-generate:disabled {
    background: var(--bg-card-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-generate.loading {
    position: relative;
}

.btn-generate.loading .btn-text,
.btn-generate.loading .btn-sparkle {
    opacity: 0;
}

.btn-generate.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.status {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.status.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.hidden {
    display: none !important;
}

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

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 0.25rem;
}

.empty-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

.item-card {
    background: var(--bg-card-hover);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.item-media {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    overflow: hidden;
}

.item-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.placeholder-image span {
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.placeholder-image.small {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.placeholder-image.small span {
    display: none;
}

.item-card .item-info {
    padding: 0.75rem;
}

.item-card .item-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.item-card .item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-card .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-card:hover .delete-btn {
    opacity: 1;
}

.outfits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    min-width: 0;
}

.outfit-card {
    background: var(--bg-card-hover);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.outfit-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(201,168,76,0.12);
}

.outfit-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.outfit-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #FAF9F7 0%, #F5F0EE 100%);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.outfit-card .occasion-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.outfit-items {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.outfit-items img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.outfit-reasoning {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    overflow-wrap: anywhere;
}

.outfit-tips {
    list-style: none;
}

.outfit-tips li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.outfit-tips li::before {
    content: '✨';
    position: absolute;
    left: 0;
}

@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        max-width: 100%;
    }
    
    .hero-cta {
        align-items: center;
    }

    .hero-signup-wrap {
        align-items: center;
    }
    
    .hero-visual {
        height: auto;
        margin-top: 2rem;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        overflow: visible;
    }

    .floating-card {
        position: relative;
        top: auto; left: auto; right: auto; bottom: auto;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        animation: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
    }

    .floating-card span {
        font-size: 1.5rem;
    }

    .floating-card p {
        font-size: 0.78rem;
    }

    .card-1, .card-2, .card-3, .card-4, .card-5, .card-6 {
        top: auto; left: auto; right: auto; bottom: auto;
    }
    
    .features {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
    }
    
    .app-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .app-sidebar .card {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 600px) {
    .landing-nav {
        padding: 1rem 1.5rem;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-visual {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .floating-card {
        padding: 0.6rem 0.75rem;
        border-radius: 10px;
    }

    .floating-card span {
        font-size: 1.25rem;
    }

    .floating-card p {
        font-size: 0.72rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .item-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .outfits-grid {
        grid-template-columns: 1fr;
    }
}

.beauty-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg-card-hover);
    border-radius: 8px;
}

.beauty-fields select {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-card);
}

.beauty-fields select[multiple] {
    height: 100px;
}

.expiration-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.expiration-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.expiration-field input[type="date"] {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-card);
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

.wardrobe-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    background: var(--bg-secondary, #f0f4f8);
    border-radius: 10px;
    padding: 4px;
}

.wardrobe-tab {
    flex: 1;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wardrobe-tab:hover {
    background: rgba(255,255,255,0.6);
    color: var(--text-primary);
}

.wardrobe-tab.active {
    background: #fff;
    color: var(--primary, #C9A84C);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.tab-pro-badge {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-left: 0.1rem;
}

.pro-collection-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(201,168,76,0.05) 0%, rgba(201,168,76,0.02) 100%);
    border: 1.5px dashed rgba(201,168,76,0.18);
    border-radius: 12px;
    margin-top: 0.5rem;
}

.pro-lock-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.pro-lock-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary, #C9A84C);
    letter-spacing: 0.03em;
}

.pro-lock-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.5;
}

.btn-pro-lock {
    background: var(--primary, #C9A84C);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: background 0.2s;
}

.btn-pro-lock:hover {
    background: var(--primary-dark, #8B6B2A);
}

.wardrobe-section {
    margin-top: 1.25rem;
    margin-bottom: 2rem;
}

.collection-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.collection-emoji {
    font-size: 1.2rem;
    line-height: 1;
}

.collection-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.collection-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.expiration-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: 500;
}

.expiration-expired {
    background: rgba(244, 63, 94, 0.15);
    color: var(--error);
}

.expiration-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.expiration-good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.outfit-category {
    margin-bottom: 1rem;
}

.outfit-category h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.outfit-item-wrapper {
    position: relative;
    display: inline-block;
}

.outfit-item-exp {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.outfit-beauty-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-card-hover);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.beauty-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.beauty-item-name {
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: capitalize;
}

.beauty-item-reason {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.exp-warning {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.color-badge {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
}

.item-category {
    display: flex;
    align-items: center;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-controls select {
    width: 100%;
}

.dress-code-filters {
    margin-bottom: 1rem;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.dress-code-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ── Freemium nav ── */
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.free-badge {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.clothing-stat {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-upgrade-nav {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.35rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-upgrade-nav:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

/* ── Clothing usage bar ── */
.clothing-usage-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.usage-bar-track {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.usage-bar-fill-warn {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.usage-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 130px;
    text-align: right;
}

/* ── Locked wardrobe tabs ── */
.wardrobe-tab-locked {
    cursor: pointer;
    opacity: 0.65;
    position: relative;
}

.wardrobe-tab-locked:hover {
    opacity: 0.85;
    color: #d97706;
}

.tab-pro-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    margin-left: 0.3rem;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

/* ── Upgrade modal ── */
.upgrade-modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.18);
    z-index: 1001;
    animation: modalIn 0.25s ease;
}

.upgrade-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.upgrade-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upgrade-crown {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.upgrade-title {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.upgrade-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.upgrade-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 540px) {
    .upgrade-plans { grid-template-columns: 1fr; }
}

.plan-card {
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
}

.plan-card.plan-pro {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.plan-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.popular-label {
    color: #d97706;
}

.plan-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.plan-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.plan-features li {
    font-size: 0.88rem;
    padding: 0.2rem 0;
}

.feature-included {
    color: var(--text-primary);
}

.feature-locked {
    color: #94a3b8;
    text-decoration: line-through;
}

.btn-upgrade-cta {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upgrade-cta:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.upgrade-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── Profile Measurements Button ──────────────────────────────────────────── */
.btn-profile-nav {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn-profile-nav:hover {
    background: var(--surface-hover, #f3f4f6);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(201,168,76,0.1);
}

/* ── Profile / Measurements Modal ─────────────────────────────────────────── */
.profile-modal-content {
    background: #fff;
    border-radius: 18px;
    width: 660px;
    max-width: calc(100vw - 32px);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    position: relative;
    z-index: 1001;
    animation: modalSlideIn 0.22s ease;
}
.profile-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 0;
}
.profile-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.profile-modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}
.profile-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.profile-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.profile-tab:not(.active):hover {
    border-color: var(--primary);
    color: var(--primary);
}
.profile-form {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.profile-tab-panel {
    padding: 20px 24px;
    flex: 1;
}
.profile-section-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 0 16px;
    border-left: 3px solid var(--primary);
}
.profile-section-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 10px;
}
.profile-section-heading:first-child { margin-top: 0; }
.profile-unit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.profile-unit-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.unit-toggle {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}
.unit-btn {
    padding: 5px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.unit-btn.active {
    background: var(--primary);
    color: #fff;
}
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.profile-grid-wide {
    grid-template-columns: 1fr;
}
.profile-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.input-unit-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.input-unit-wrap .profile-input {
    flex: 1;
}
.unit-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 22px;
}
.profile-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.profile-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1.5px solid var(--border);
    background: var(--surface);
    border-radius: 0 0 18px 18px;
    flex-shrink: 0;
}
.profile-modal-actions {
    display: flex;
    gap: 10px;
}
.profile-save-status {
    font-size: 0.83rem;
    font-weight: 600;
}
.profile-save-status.success { color: #16a34a; }
.profile-save-status.error { color: #dc2626; }

@media (max-width: 600px) {
    .profile-modal-content {
        border-radius: 16px;
        max-height: 88vh;
        max-width: calc(100vw - 24px);
        align-self: center;
        margin: auto;
    }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-tabs { padding: 12px 12px 0; }
    .profile-tab-panel { padding: 16px 12px; }
    .profile-modal-header { padding: 16px 12px 0; }
    .profile-modal-footer { padding: 12px; }
}

/* ===========================================
   THEME SWITCHER COMPONENT
   =========================================== */

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--bg-card-hover, #f1f5f9);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 100px;
    padding: 3px;
    flex-shrink: 0;
}

.theme-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.theme-pill:hover {
    color: var(--text-primary, #0f172a);
    background: var(--bg-card, #ffffff);
}

.theme-pill.active {
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #0f172a);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.theme-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.theme-swatch-editorial {
    background: #1c1917;
}

.theme-swatch-boutique {
    background: linear-gradient(135deg, #e8c9b0, #c4a882);
}

/* ===========================================
   THEME: EDITORIAL
   Crisp magazine aesthetic — off-white,
   charcoal black, serif headings, no shadows
   =========================================== */

[data-theme="editorial"] {
    --bg-dark: #FCFCFB;
    --bg-card: #ffffff;
    --bg-card-hover: #f7f7f6;
    --text-primary: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #a8a29e;
    --border: #e7e5e4;
    --primary: #1c1917;
    --primary-dark: #0c0a09;
    --primary-light: #57534e;
    --accent: #1c1917;
    --accent-warm: #92400e;
}

[data-theme="editorial"] body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #FCFCFB;
}

[data-theme="editorial"] .app-nav {
    background: #FCFCFB;
    border-bottom: 1px solid #e7e5e4;
    box-shadow: none;
}

[data-theme="editorial"] .card {
    border-radius: 2px;
    border: 1px solid #e7e5e4;
    box-shadow: none;
}

[data-theme="editorial"] .card h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

[data-theme="editorial"] .wardrobe-tab {
    border-radius: 0;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

[data-theme="editorial"] .wardrobe-tab.active {
    color: #1c1917;
    border-bottom-color: #1c1917;
    background: transparent;
}

[data-theme="editorial"] .btn-primary,
[data-theme="editorial"] .btn-generate {
    background: #1c1917;
    background-image: none;
    border-radius: 2px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

[data-theme="editorial"] .btn-primary:hover,
[data-theme="editorial"] .btn-generate:hover {
    background: #0c0a09;
    box-shadow: none;
    transform: none;
}

[data-theme="editorial"] .count-badge {
    background: #1c1917;
    border-radius: 2px;
}

[data-theme="editorial"] .plan-badge {
    border-color: #1c1917;
    color: #1c1917;
    background: transparent;
}

[data-theme="editorial"] .item-card {
    border-radius: 2px;
    box-shadow: none;
    border: 1px solid #e7e5e4;
}

[data-theme="editorial"] .item-card:hover {
    box-shadow: none;
    border-color: #1c1917;
}

[data-theme="editorial"] .upload-area {
    border-radius: 2px;
    border-color: #e7e5e4;
}

[data-theme="editorial"] .upload-area:hover {
    border-color: #1c1917;
    background: rgba(28, 25, 23, 0.02);
}

[data-theme="editorial"] .btn-upgrade-nav {
    background: transparent;
    border: 1px solid #1c1917;
    color: #1c1917;
    border-radius: 2px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

[data-theme="editorial"] .btn-upgrade-nav:hover {
    background: #1c1917;
    color: #FCFCFB;
}

[data-theme="editorial"] .modal-content {
    border-radius: 4px;
}

[data-theme="editorial"] .theme-switcher {
    background: #f7f7f6;
    border-color: #e7e5e4;
}

/* ===========================================
   THEME: SOFT BOUTIQUE
   Warm luxury service aesthetic — parchment,
   warm taupe, rounded forms, soft shadows
   =========================================== */

[data-theme="boutique"] {
    --bg-dark: #faf8f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f4f1eb;
    --text-primary: #3d3935;
    --text-secondary: #5a554f;
    --text-muted: #8a857f;
    --border: #e8e4db;
    --primary: #3d3935;
    --primary-dark: #2d2a27;
    --primary-light: #78716c;
    --accent: #9fa69b;
    --accent-warm: #b45309;
}

[data-theme="boutique"] body {
    background: #faf8f5;
}

[data-theme="boutique"] .app-nav {
    background: rgba(244, 241, 235, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: #e8e4db;
}

[data-theme="boutique"] .card {
    border-radius: 16px;
    border-color: #e8e4db;
    box-shadow: 0 4px 24px -6px rgba(61, 57, 53, 0.07);
}

[data-theme="boutique"] .card h2 {
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #2d2a27;
}

[data-theme="boutique"] .wardrobe-tab {
    border-radius: 100px;
    font-size: 0.8rem;
}

[data-theme="boutique"] .wardrobe-tab.active {
    color: #3d3935;
    border-bottom-color: #3d3935;
    background: #f4f1eb;
}

[data-theme="boutique"] .btn-primary,
[data-theme="boutique"] .btn-generate {
    background: #3d3935;
    background-image: none;
    border-radius: 100px;
}

[data-theme="boutique"] .btn-primary:hover,
[data-theme="boutique"] .btn-generate:hover {
    background: #2d2a27;
    box-shadow: 0 8px 24px -4px rgba(61, 57, 53, 0.28);
    transform: translateY(-1px);
}

[data-theme="boutique"] .count-badge {
    background: #3d3935;
    border-radius: 100px;
}

[data-theme="boutique"] .plan-badge {
    border-color: #e8e4db;
    color: #5a554f;
    background: #f4f1eb;
}

[data-theme="boutique"] .item-card {
    border-radius: 12px;
    border-color: #e8e4db;
    box-shadow: 0 2px 12px -2px rgba(61, 57, 53, 0.06);
}

[data-theme="boutique"] .item-card:hover {
    box-shadow: 0 8px 28px -4px rgba(61, 57, 53, 0.12);
    border-color: #c4b89e;
}

[data-theme="boutique"] .upload-area {
    border-radius: 12px;
    border-color: #e8e4db;
}

[data-theme="boutique"] .upload-area:hover {
    border-color: #3d3935;
    background: rgba(61, 57, 53, 0.02);
}

[data-theme="boutique"] .btn-upgrade-nav {
    background: #3d3935;
    color: #faf8f5;
    border-radius: 100px;
    border: none;
}

[data-theme="boutique"] .btn-upgrade-nav:hover {
    background: #2d2a27;
    box-shadow: 0 4px 16px -2px rgba(61, 57, 53, 0.3);
}

[data-theme="boutique"] .modal-content {
    border-radius: 20px;
    border: 1px solid #e8e4db;
}

[data-theme="boutique"] select,
[data-theme="boutique"] input[type="text"],
[data-theme="boutique"] input[type="date"],
[data-theme="boutique"] textarea {
    border-color: #e8e4db;
    background: #faf8f5;
    color: #3d3935;
    border-radius: 10px;
}

[data-theme="boutique"] select:focus,
[data-theme="boutique"] input[type="text"]:focus,
[data-theme="boutique"] textarea:focus {
    border-color: #3d3935;
    box-shadow: 0 0 0 3px rgba(61, 57, 53, 0.1);
}

[data-theme="boutique"] .theme-switcher {
    background: #f4f1eb;
    border-color: #e8e4db;
}

/* ===========================================
   SETTINGS NAV BUTTON
   =========================================== */

.btn-settings-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-settings-nav:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

/* ===========================================
   SIDEBAR PLAN / UPGRADE CARD
   =========================================== */

.sidebar-plan-card {
    padding: 1.1rem 1.25rem;
}

.sidebar-plan-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
}

.sidebar-plan-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.sidebar-plan-limit {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-plan-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.sidebar-usage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.sidebar-usage-warn {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.sidebar-plan-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

.btn-upgrade-sidebar {
    width: 100%;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.btn-upgrade-sidebar:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* ===========================================
   MOBILE RESPONSIVENESS — Comprehensive
   =========================================== */

/* ── Tablet (≤ 900px): wrap nav, stack sidebar ── */
@media (max-width: 900px) {
    .app-nav {
        flex-wrap: wrap;
        gap: 0.4rem 0;
        padding: 0.75rem 1.25rem;
    }
    .nav-stats {
        gap: 0.6rem;
        flex-wrap: wrap;
        align-items: center;
    }
    .user-email-stat {
        display: none;
    }
    .nav-left {
        gap: 0.75rem;
    }
    .theme-switcher {
        background: none;
        border: none;
        box-shadow: none;
        padding: 2px 0;
    }
    .app-sidebar {
        flex-direction: column !important;
    }
    .app-sidebar .card {
        flex: none !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
    /* NAV */
    .app-nav {
        padding: 0.6rem 0.9rem;
    }
    .logo-icon-img {
        height: 42px;
    }
    .logo-name {
        font-size: 1.2rem;
    }
    .logo-sub,
    .logo-tag {
        display: none;
    }
    .theme-switcher {
        display: none;
    }
    .nav-stats {
        gap: 0.4rem;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        flex: 1;
    }
    .clothing-stat {
        display: none;
    }
    .nav-btn-label {
        display: none;
    }
    .btn-profile-nav {
        min-width: 32px;
        padding: 0.3rem 0.5rem;
        justify-content: center;
    }
    .btn-upgrade-nav {
        font-size: 0.74rem;
        padding: 0.32rem 0.7rem;
        white-space: nowrap;
    }

    /* MAIN PADDING */
    main {
        padding: 0.9rem 0.75rem;
    }

    /* CARDS */
    .card {
        padding: 1.1rem;
        border-radius: 12px;
    }
    .card h2 {
        font-size: 0.95rem;
    }

    /* UPLOAD */
    .upload-area {
        padding: 1.25rem 0.75rem;
        min-height: 100px;
    }
    .upload-content p {
        font-size: 0.8rem;
    }

    /* FILTER BUTTONS */
    .dress-code-filters .filter-buttons {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    .filter-btn {
        font-size: 0.74rem;
        padding: 0.3rem 0.6rem;
    }

    /* GENDER TOGGLE */
    .gender-btn {
        font-size: 0.82rem;
        padding: 0.6rem 0.5rem;
    }

    /* CARD HEADER — stack title and controls on separate rows */
    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: flex-start;
        margin-bottom: 0.75rem;
    }
    .card-header h2 {
        flex: 1 1 100%;
        font-size: 1rem;
    }
    .wardrobe-controls {
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
        row-gap: 0.35rem;
    }
    .favorites-only-toggle {
        font-size: 0.8rem;
    }

    /* WARDROBE TABS — horizontally scrollable */
    .wardrobe-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        /* ensure the pill container doesn't clip scrolled tabs */
        padding-right: 0.75rem;
    }
    .wardrobe-tabs::-webkit-scrollbar {
        display: none;
    }
    .wardrobe-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 0.76rem;
        padding: 0.4rem 0.9rem;
    }

    /* USAGE BAR — allow label to shrink on narrow screens */
    .clothing-usage-bar {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }
    .usage-bar-track {
        flex: 1 1 100%;
    }
    .usage-bar-label {
        min-width: unset;
        white-space: nowrap;
        text-align: left;
        font-size: 0.72rem;
    }

    /* ITEM GRID */
    .item-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
    .item-media {
        height: 115px;
    }

    /* OUTFITS */
    .outfits-grid {
        grid-template-columns: 1fr;
    }
    .outfit-card {
        padding: 1rem;
    }

    /* COLLECTION HEADER — emoji+title stay on same row, desc wraps below */
    .collection-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem 0.4rem;
    }
    .collection-desc {
        display: none;
    }
    .usage-bar-desc {
        display: none;
    }
    .usage-bar-label {
        white-space: nowrap;
    }

    /* LANDING PAGE */
    .landing-nav {
        padding: 0.9rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .landing-nav .nav-links {
        gap: 0.75rem;
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
    .hero {
        padding: 1.5rem 1.25rem 2rem;
        min-height: auto;
    }
    .hero-title {
        font-size: 1.9rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.75rem;
    }
    .btn-primary-large {
        font-size: 0.95rem;
        padding: 0.85rem 1.5rem;
    }
    .features {
        grid-template-columns: 1fr;
        padding: 2rem 1.25rem;
        gap: 1rem;
    }

    /* AUTH */
    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }

    /* UPGRADE MODAL — sheet style (bottom sheet on mobile) */
    .upgrade-plans {
        grid-template-columns: 1fr;
    }
    #upgrade-modal {
        align-items: flex-end;
    }
    #upgrade-modal .upgrade-modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 93vh;
        overflow-y: auto;
        margin: 0;
    }
}

/* ── Small phones (≤ 390px) ── */
@media (max-width: 390px) {
    .logo-icon-img {
        height: 36px;
    }
    .logo-name {
        font-size: 1rem;
    }
    main {
        padding: 0.65rem 0.5rem;
    }
    .card {
        padding: 0.9rem;
    }
    .item-grid {
        gap: 0.5rem;
    }
    .item-media {
        height: 100px;
    }
}

/* Beta usage progress bar */
.beta-prog-fill.warn  { background: #d97706 !important; }
.beta-prog-fill.danger { background: #dc2626 !important; }

/* ── Profile nav button & dropdown ── */
.profile-nav-wrap {
    position: relative;
}
.profile-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-dark);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s, box-shadow 0.18s;
    flex-shrink: 0;
}
.profile-nav-btn:hover,
.profile-nav-btn.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.profile-nav-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-nav-initials {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    pointer-events: none;
}

/* Dropdown panel */
.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(26,22,20,0.13), 0 2px 8px rgba(26,22,20,0.06);
    z-index: 200;
    overflow: hidden;
}
.profile-dropdown.open {
    display: block;
    animation: dropdownFadeIn 0.18s ease;
}
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Top: big avatar + email */
.profile-dropdown-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.4rem 1.25rem 1rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    gap: 0.6rem;
}
.profile-avatar-upload-wrap {
    position: relative;
    cursor: pointer;
    display: inline-block;
}
.profile-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    transition: border-color 0.18s;
}
.profile-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-avatar-upload-wrap:hover .profile-avatar-lg {
    border-color: var(--primary);
}
.profile-avatar-camera {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 2px solid var(--bg-card);
}
.profile-dropdown-name {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-dropdown-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    word-break: break-all;
    max-width: 100%;
    margin-top: -0.1rem;
}

/* Body: name field */
.profile-dropdown-body {
    padding: 1rem 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.profile-field-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}
.profile-name-inp {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-dark);
    transition: border-color 0.18s, box-shadow 0.18s;
}
.profile-name-inp:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.profile-save-btn {
    width: 100%;
    padding: 0.55rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s;
    letter-spacing: 0.01em;
}
.profile-save-btn:hover { background: var(--primary-dark); }
.profile-save-msg {
    font-size: 0.78rem;
    color: var(--success);
    min-height: 1rem;
    text-align: center;
}

/* Footer: settings + sign out */
.profile-dropdown-footer {
    border-top: 1px solid var(--border);
    padding: 0.35rem 0;
}
.profile-footer-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.13s, color 0.13s;
    border-radius: 0;
}
.profile-footer-link:hover {
    background: var(--bg-dark, #f8f5f0);
    color: var(--text-primary);
}
.profile-footer-link.danger:hover {
    background: rgba(220, 38, 38, 0.06);
    color: #c0392b;
}

/* ── Context AI Chat (outfit notes) ── */
.ctx-chat-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
}
.ctx-chat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.6rem 0.9rem 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ctx-chat-label span {
    color: var(--accent);
}
.ctx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.9rem 0.6rem;
}
.ctx-chip {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}
.ctx-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(201,168,76,0.06);
}
.ctx-messages {
    max-height: 160px;
    overflow-y: auto;
    padding: 0 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ctx-messages:not(:empty) {
    padding-bottom: 0.6rem;
    padding-top: 0.2rem;
}
.ctx-msg {
    font-size: 0.78rem;
    line-height: 1.45;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    max-width: 92%;
    word-break: break-word;
}
.ctx-msg.user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    font-weight: 500;
}
.ctx-msg.ai {
    background: rgba(201,168,76,0.1);
    color: var(--ink, #1a1614);
    border: 1px solid rgba(201,168,76,0.2);
    align-self: flex-start;
}
.ctx-msg.typing {
    color: var(--muted);
    font-style: italic;
    background: transparent;
    border: none;
    padding-left: 0;
}
.ctx-input-row {
    display: flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
}
.ctx-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    padding: 0.6rem 0.9rem;
    color: var(--text, #1a1614);
    font-family: inherit;
}
.ctx-input::placeholder {
    color: var(--muted);
}
.ctx-send-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 0 0 9px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s;
}
.ctx-send-btn:hover {
    background: var(--accent-dark, #8b6b2a);
}
.ctx-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.ctx-noted {
    font-size: 0.68rem;
    color: var(--accent);
    padding: 0.25rem 0.9rem 0.35rem;
    font-style: italic;
}

/* ── Save to Style History button ── */
.save-worn-btn { margin-top: 0.75rem; width: 100%; }
.save-worn-btn.saved {
    background: #2d6a4f !important;
    border-color: #2d6a4f !important;
    color: #fff !important;
    cursor: default;
    opacity: 0.9;
}

/* ── Save name inline area ── */
.save-name-area {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.save-name-input {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.75rem;
    border: 1.5px solid var(--accent);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--ink);
    outline: none;
}
.save-name-input:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(201,168,76,0.15); }
.save-confirm-btn { white-space: nowrap; font-size: 0.85rem; padding: 0.45rem 1rem; }
.save-done-msg { font-size: 0.88rem; color: #2d6a4f; font-weight: 600; }

/* ── Style History grid ── */
.style-history-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.style-history-card {
    background: #fff;
    border: 1.5px solid #e8e2d8;
    border-radius: 12px;
    padding: 0.9rem 1rem;
}
.sh-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.sh-outfit-name {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sh-date {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}
.sh-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
    transition: color 0.2s;
}
.sh-delete-btn:hover { color: #c0392b; }
.sh-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.sh-item-chip {
    background: #f5f0e8;
    border: 1px solid #e0d8cc;
    border-radius: 20px;
    font-size: 0.75rem;
    padding: 0.2rem 0.65rem;
    color: var(--ink);
    white-space: nowrap;
}
.sh-item-chip.sh-more {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* ── Outfit actions row ── */
.outfit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: stretch;
}
.outfit-actions .save-worn-btn {
    margin-top: 0;
    flex: 1;
}
.share-outfit-btn {
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1.5px solid var(--accent, #C9A84C);
    background: transparent;
    color: var(--accent, #C9A84C);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    white-space: nowrap;
}
.share-outfit-btn:hover {
    background: var(--accent, #C9A84C);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Share Outfit modal ── */
.share-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    width: min(540px, 92vw);
    max-height: 90vh;
    border-radius: 22px;
    padding: 2rem 2rem 1.75rem;
    overflow-y: auto;
    box-shadow: 0 32px 70px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.share-modal-content .modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
}
.share-modal-header {
    text-align: center;
    padding-bottom: 0.5rem;
}
.share-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8B6B2A;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.share-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-style: italic;
    color: #1c1917;
    font-weight: 600;
    margin: 0 0 0.4rem;
    line-height: 1.2;
}
.share-sub {
    font-size: 0.85rem;
    color: #78716c;
    margin: 0;
    line-height: 1.5;
}

.share-loading {
    text-align: center;
    padding: 1.5rem 0;
    color: #78716c;
    font-size: 0.9rem;
}
.share-spinner {
    width: 32px; height: 32px;
    border: 3px solid #e8e5e0;
    border-top-color: #C9A84C;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    animation: shareSpin 0.8s linear infinite;
}
@keyframes shareSpin { to { transform: rotate(360deg); } }

.share-link-row {
    display: flex; gap: 0.4rem;
    background: #FAF9F7;
    border: 1px solid #e8e5e0;
    border-radius: 999px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    align-items: center;
}
.share-link-row input {
    flex: 1; min-width: 0;
    background: transparent; border: none; outline: none;
    font-family: inherit; font-size: 0.85rem;
    color: #1c1917;
}
.share-link-row button {
    background: #1c1917; color: #fff;
    border: none; border-radius: 999px;
    padding: 0.55rem 1.15rem;
    font-family: inherit; font-size: 0.82rem; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.share-link-row button:hover { background: #8B6B2A; }
.share-link-row button.copied { background: #2d6a4f; }

.share-divider {
    text-align: center;
    position: relative;
    color: #a8a29e;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.share-divider::before, .share-divider::after {
    content: ''; position: absolute; top: 50%;
    width: calc(50% - 60px); height: 1px;
    background: #e8e5e0;
}
.share-divider::before { left: 0; }
.share-divider::after { right: 0; }

.share-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
}
.share-social-btn {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.35rem;
    background: #FAF9F7;
    border: 1px solid #e8e5e0;
    border-radius: 14px;
    padding: 0.85rem 0.5rem;
    text-decoration: none;
    color: #1c1917;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.share-social-btn:hover {
    background: rgba(201,168,76,0.10);
    border-color: rgba(201,168,76,0.45);
    transform: translateY(-2px);
}
.share-social-btn .share-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.share-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
    padding: 0.85rem;
    text-align: center;
    font-size: 0.88rem;
}
.share-error p { margin: 0; }

@media (max-width: 480px) {
    .share-modal-content { padding: 1.5rem 1.25rem 1.25rem; }
    .share-buttons-grid { grid-template-columns: repeat(2, 1fr); }
    .share-link-row { flex-direction: column; padding: 0.6rem; border-radius: 14px; gap: 0.5rem; }
    .share-link-row input { text-align: center; padding: 0.3rem 0; width: 100%; }
    .share-link-row button { width: 100%; }
}
