/**
 * PrefNest - Main Stylesheet
 * Modern, accessible CSS following best practices
 */

:root {
    --primary-color: #1e3a8a;   /* GanooTech navy */
    --primary-hover: #172e6e;
    --primary-soft: #eef2fb;    /* tinted backgrounds, hovers */
    --accent-color: #d62839;    /* logo swoosh red, used sparingly */
    --brand-coral: #E0533D;     /* PrefNest logo: the heart string and "Nest" */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #ffffff;
    --bg-secondary: #f5f7fb;
    --text-color: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.nav-brand h1,
.btn,
.btn-primary,
label.form-label,
.persona-table thead th,
.current-badge {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.02em;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* Navigation */
.navbar {
    background-color: var(--bg-color);
    border-bottom: 3px solid var(--primary-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.9;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.nav-brand h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: 700;
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s, color 0.15s;
    display: block;
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
}

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

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

.nav-link--logout {
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Cards */
.card {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.required {
    color: var(--danger-color);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    padding: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    min-width: 18px;
    min-height: 18px;
}

/* Brand List */
.brand-list {
    margin-top: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
}

.brand-list .checkbox-label {
    display: block;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.brand-list .checkbox-label:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* Persona Form Grid */
.persona-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.persona-form-left,
.persona-form-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.persona-form-left .form-group,
.persona-form-right .form-group {
    margin-bottom: 0;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.btn-save {
    padding: 0.875rem 3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1rem;
}

/* Height Input Group */
.height-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.height-feet,
.height-inches {
    width: 80px;
}

.height-separator {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Weight Input Group */
.weight-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weight-input {
    flex: 1;
    max-width: 200px;
}

.weight-unit {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Date Picker */
.date-picker {
    cursor: pointer;
}

/* Pictures Section */
.pictures-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Gallery grid for uploaded persona pictures */
.persona-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.gallery-item {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.gallery-item--primary {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.18);
}

.gallery-primary-badge {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    display: block;
    text-align: center;
    letter-spacing: 0.02em;
}

.gallery-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.gallery-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
}

.gallery-btn {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.gallery-btn:hover {
    background: var(--primary-soft);
}

.gallery-btn--primary {
    background: var(--primary-soft);
    color: var(--primary-color);
    border-color: transparent;
}

.gallery-btn--primary:hover {
    background: #dde5f7;
}

.gallery-btn--delete {
    background: #fee2e2;
    color: #b91c1c;
    border-color: transparent;
}

.gallery-btn--delete:hover {
    background: #fecaca;
}

/* keep old thumbnail class for any other usages */
.picture-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 2px solid var(--border-color);
}

.picture-action {
    text-align: right;
    width: 20%;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.no-pictures {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
    font-style: italic;
}

.no-pictures-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.picture-upload-note {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.picture-upload-section {
    margin-top: 1.5rem;
}

.btn-upload {
    cursor: pointer;
    display: inline-block;
}

.btn-upload input[type="file"] {
    display: none;
}

.picture-preview {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.preview-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 2px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    min-height: 44px; /* Touch target size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

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

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    width: 100%;
    display: block;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.oauth-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.oauth-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Google Button - Official Brand Style */
.oauth-btn.google {
    background-color: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
}

.oauth-btn.google:hover {
    background-color: #f8f9fa;
    border-color: #d2d3d4;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px rgba(60, 64, 67, 0.15);
}

.oauth-btn.google:active {
    background-color: #f1f3f4;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}

.oauth-btn.google svg {
    width: 18px;
    height: 18px;
}

/* Facebook Button */
.oauth-btn.facebook {
    background-color: #1877f2;
    border-color: #1877f2;
    color: #ffffff;
}

.oauth-btn.facebook:hover {
    background-color: #0c63d4;
    border-color: #0c63d4;
}

.oauth-btn.facebook:active {
    background-color: #0a58ca;
}

/* Apple Button */
.oauth-btn.apple {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.oauth-btn.apple:hover {
    background-color: #1a1a1a;
    border-color: #1a1a1a;
}

.oauth-btn.apple:active {
    background-color: #0a0a0a;
}

/* GitHub Button */
.oauth-btn.github {
    background-color: #24292e;
    border-color: #24292e;
    color: #ffffff;
}

.oauth-btn.github:hover {
    background-color: #2c3236;
    border-color: #2c3236;
}

.oauth-btn.github:active {
    background-color: #1b1f23;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

@media (max-width: 640px) {
    .divider {
        margin: 1.25rem 0;
    }

    .divider span {
        padding: 0 0.75rem;
        font-size: 0.875rem;
    }
}

/* Persona List */
.persona-list {
    display: grid;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .persona-list {
        gap: 1rem;
    }

    .persona-item {
        padding: 1rem;
    }

    .persona-name {
        font-size: 1.125rem;
    }
}

.persona-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.persona-item:hover {
    box-shadow: var(--shadow-lg);
}

.persona-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.persona-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.persona-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.profile-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-img {
    height: 30px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    opacity: 0.8;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-toggle:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Responsive Breakpoints */
/* Mobile: 0-640px */
@media (max-width: 640px) {
    /* Navigation */
    .navbar .container {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .nav-brand h1 {
        font-size: 1.25rem;
    }

    .logo-img {
        height: 32px;
        max-width: 150px;
    }

    .footer-logo-img {
        height: 24px;
        max-width: 120px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        margin-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.85rem 0.75rem;
        text-align: left;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link.active {
        border-left: 3px solid var(--primary-color);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Main Content */
    .main-content {
        padding: 1rem 0;
    }

    .container {
        padding: 0 0.75rem;
    }

    /* Cards */
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.625rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    /* Button groups - stack on mobile */
    .btn-group,
    div[style*="display: flex"] {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .btn-group .btn,
    div[style*="display: flex"] .btn {
        width: 100%;
        display: block;
    }

    /* Alerts */
    .alert {
        padding: 0.875rem;
        font-size: 0.875rem;
    }

    /* Profile */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-info h2 {
        font-size: 1.5rem;
    }

    /* Persona List */
    .persona-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Auth Pages */
    .auth-container {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.875rem;
    }

    /* OAuth Buttons */
    .oauth-btn {
        padding: 0 1rem;
        height: 44px;
        font-size: 14px;
    }

    .oauth-btn svg {
        width: 16px;
        height: 16px;
    }

    .oauth-btn span {
        font-size: 14px;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0;
        font-size: 0.875rem;
    }
}

/* Tablet: 641px-1024px */
@media (min-width: 641px) and (max-width: 1024px) {
    .navbar .container {
        padding: 1rem 1.5rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .card {
        padding: 1.75rem;
    }

    .profile-form-grid {
        gap: 1.5rem;
    }
}

/* Desktop: 1025px+ */
@media (min-width: 1025px) {
    .nav-menu {
        gap: 0.5rem;
    }
}

/* Login/Register Pages */
.auth-container {
    max-width: 450px;
    margin: 1rem auto;
}

.auth-card {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.auth-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Sign-in and sign-up forms: tighter, so the buttons stay in view in small windows (e.g. a store's popup) */
.auth-card .form-group {
    margin-bottom: 1.1rem;
}

@media (max-width: 700px) {
    .auth-card {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    /* The top bar already shows the brand; drop the card's own logo and shrink its heading */
    .auth-card .auth-logo {
        display: none;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .auth-subtitle {
        margin-bottom: 1.1rem;
    }
}

/* My Account Page Styles */
.account-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-section {
    background-color: var(--bg-color);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.profile-form-left,
.profile-form-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* The column gap already spaces the fields */
.profile-form-left .form-group,
.profile-form-right .form-group {
    margin-bottom: 0;
}

.emails-textarea {
    min-height: 80px;
    font-family: inherit;
    resize: vertical;
}

.btn-edit-profile {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    width: auto;
    align-self: flex-start;
}

.persona-section {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.persona-table-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.persona-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
}

.persona-table thead {
    background-color: var(--bg-secondary);
}

.persona-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.persona-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.persona-table tbody tr.row-even {
    background-color: var(--bg-color);
}

.persona-table tbody tr.row-odd {
    background-color: var(--bg-secondary);
}

.persona-title {
    font-weight: 500;
    color: var(--text-color);
}

.persona-current {
    text-align: center;
}

.current-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--success-color);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.not-current {
    color: var(--text-secondary);
}

.persona-action {
    text-align: center;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.btn-delete:active {
    background-color: rgba(239, 68, 68, 0.2);
}

.no-personas {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.persona-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-add-persona {
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* My Account Page Responsive */
@media (max-width: 640px) {
    .account-container {
        padding: 1rem 0.75rem;
    }

    .persona-form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .brand-list {
        max-height: 150px;
    }

    .btn-save {
        width: 100%;
        padding: 0.875rem 2rem;
    }

    .height-input-group {
        flex-wrap: wrap;
    }

    .height-feet,
    .height-inches {
        width: 70px;
    }

    .weight-input {
        max-width: 150px;
    }

    .pictures-table {
        font-size: 0.875rem;
    }

    .picture-thumbnail {
        width: 80px;
        height: 80px;
    }

    .preview-thumbnail {
        width: 80px;
        height: 80px;
    }
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.dashboard-header {
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

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

/* Search and Filter Section */
.search-filter-section {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.search-form {
    margin-bottom: 1rem;
    width: 100%;
}

.search-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.search-input {
    flex: 1;
    min-width: 250px;
    max-width: 600px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    white-space: nowrap;
}

.clear-results-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.clear-results-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.filters-section {
    margin-top: 1rem;
}

.filters-btn {
    display: inline-flex;
    align-items: center;
}

/* Personas Grid */
.personas-grid-container {
    margin-top: 2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 300px));
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    justify-items: stretch;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
}

#personaSelectForm {
    width: 100%;
    display: flex;
    justify-content: center;
}

#personaSelectForm > .personas-grid {
    width: 100%;
}

.persona-card {
    position: relative;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.persona-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.persona-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.persona-radio {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 1;
}

.persona-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.persona-image-container {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-color);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.persona-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.persona-image-not-found {
    object-fit: contain;
    background-color: var(--bg-secondary);
}

.persona-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    font-size: 3rem;
    font-weight: 700;
}

.persona-info {
    width: 100%;
}

.persona-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.persona-role {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.no-personas {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-personas a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.no-personas a:hover {
    text-decoration: underline;
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .personas-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
        gap: 1.25rem;
    }
}

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

    .dashboard-title {
        font-size: 1.5rem;
    }

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

    .search-filter-section {
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .search-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .search-input {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }

    .search-btn {
        width: 100%;
    }

    .clear-results-link {
        text-align: center;
        display: block;
        margin-top: 0.5rem;
    }

    .filters-section {
        width: 100%;
    }

    .filters-btn {
        width: 100%;
    }

    .personas-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 280px));
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .persona-card {
        max-width: 100%;
        width: 100%;
    }

    .persona-image-container {
        width: 120px;
        height: 120px;
    }
}

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

    .dashboard-title {
        font-size: 1.25rem;
    }

    .dashboard-subtitle {
        font-size: 0.9375rem;
    }

    .search-filter-section {
        padding: 0;
    }

    .personas-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
        width: 100%;
    }

    .persona-card {
        max-width: 100%;
        width: 100%;
        padding: 1.25rem;
    }

    .persona-image-container {
        width: 100px;
        height: 100px;
    }

    .persona-name {
        font-size: 1.125rem;
    }

    .persona-role {
        font-size: 0.8125rem;
    }
}

@media (max-width: 360px) {
    .dashboard-container {
        padding: 0.75rem 0.5rem;
    }

    .persona-card {
        padding: 1rem;
    }

    .persona-image-container {
        width: 80px;
        height: 80px;
    }
}

    .profile-section,
    .persona-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .profile-form-left,
    .profile-form-right {
        gap: 1.25rem;
    }

    .btn-add-persona {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }

    /* Persona Table - Make scrollable on mobile */
    .persona-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }

    .persona-table {
        min-width: 500px;
        font-size: 0.875rem;
    }

    .persona-table th,
    .persona-table td {
        padding: 0.75rem 0.5rem;
    }

    .persona-title {
        font-size: 0.9375rem;
    }

    .current-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .btn-delete {
        padding: 0.375rem;
    }

    .btn-delete svg {
        width: 14px;
        height: 14px;
    }

    /* Form button groups */
    form div[style*="display: flex"] {
        flex-direction: column;
    }

    form div[style*="display: flex"] .btn {
        width: 100%;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .account-container {
        padding: 1.5rem;
    }

    .profile-section,
    .persona-section {
        padding: 1.75rem;
    }

    .profile-form-grid {
        gap: 1.75rem;
    }
}

/* Link chips: "Shop direct" brand links and similar pill buttons */
.chip-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.chip-link:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* Dashboard card "Edit persona" link (inside the card's select label) */
.persona-edit-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--primary-soft);
    border-radius: 999px;
    text-decoration: none;
}

.persona-edit-link:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* ---------- My Account: quick links and collapsible sections ---------- */
.account-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.account-jump .chip-link {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

details.account-details > summary,
details.account-subsection > summary {
    list-style: none;
    cursor: pointer;
}

details.account-details > summary::-webkit-details-marker,
details.account-subsection > summary::-webkit-details-marker {
    display: none;
}

details.account-details > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    position: relative;
    padding-right: 2rem;
}

details.account-details > summary .section-title {
    margin: 0;
}

details.account-details > summary .summary-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Chevron: points down when closed, up when open */
details.account-details > summary::after {
    content: '';
    position: absolute;
    right: 0.4rem;
    top: 0.55rem;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: transform 0.15s;
}

details.account-details[open] > summary::after {
    transform: rotate(-135deg);
    top: 0.85rem;
}

details.account-details[open] > summary {
    margin-bottom: 1.5rem;
}

details.account-subsection {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

details.account-subsection > summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text-color);
}

details.account-subsection > summary::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

details.account-subsection[open] > summary::before {
    transform: rotate(45deg);
}

details.account-subsection[open] > summary {
    margin-bottom: 0.75rem;
}

details.account-details > summary:focus-visible,
details.account-subsection > summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Tables become stacked cards on phones instead of scrolling sideways */
@media (max-width: 640px) {
    .persona-table.stack-table {
        min-width: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .stack-table thead {
        display: none;
    }

    .stack-table,
    .stack-table tbody,
    .stack-table tr,
    .stack-table td {
        display: block;
        width: 100%;
    }

    .stack-table tr {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.6rem;
    }

    .stack-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.3rem 0;
        border: none;
        text-align: right;
    }

    .stack-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        white-space: nowrap;
    }

    .persona-table-container:has(> .stack-table) {
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    /* Short tables fit the screen without sideways scrolling */
    .persona-table.fit-table {
        min-width: 0;
    }

    .stack-table td.no-personas {
        justify-content: center;
        text-align: center;
    }

    .stack-table td.no-personas::before {
        content: none;
    }
}

/* ---------- Trips & Occasions ---------- */
.occasion-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1rem 0 0.5rem;
}

.occasion-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.occasion-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.08);
}

.occasion-card.is-past {
    opacity: 0.7;
}

.occasion-card__title {
    font-weight: 600;
    color: var(--primary-color);
}

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

.occasion-card__status {
    align-self: flex-start;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--text-secondary);
}

.occasion-card__status.is-ready {
    background: #dcfce7;
    color: #166534;
}

.occasion-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0 1rem;
}

.occasion-form .form-group {
    display: flex;
    flex-direction: column;
}

.occasion-facts {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 0.25rem;
}

.weather-box {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: var(--primary-soft);
    line-height: 1.5;
}

.weather-box strong {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.plan-person {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.plan-person h3 {
    margin: 0 0 0.25rem;
}

.plan-person__summary {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 0.75rem;
}

.plan-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.plan-item__category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.plan-item__optional {
    font-size: 0.75rem;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--text-secondary);
}

.plan-item__name {
    font-weight: 600;
    margin: 0.15rem 0;
}

.plan-item__why {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.plan-item__shop {
    flex-shrink: 0;
    padding: 0.35rem 0.9rem;
}

/* AI usage left today, next to AI buttons */
.ai-quota-hint {
    display: inline-block;
    margin-left: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Dashboard: Coming up (birthdays and trips) */
.coming-up {
    /* The dashboard centers its children; without a fixed width the strip grows to fit
       all cards and the whole page scrolls sideways on phones */
    width: 100%;
    min-width: 0;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
}

.coming-up__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--text-color);
}

.coming-up__list {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.coming-up__card {
    /* On phones the next card peeks in, showing there's more to swipe */
    flex: 0 0 min(240px, 78%);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color);
    text-decoration: none;
}

.coming-up__card--link:hover {
    border-color: var(--primary-color);
}

.coming-up__kind {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
}

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

.coming-up__action {
    align-self: flex-start;
    margin-top: 0.4rem;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
}

/* Persona page: important dates */
.date-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.5rem;
}

.date-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.date-list__item > div {
    flex: 1;
    min-width: 160px;
}

.date-list__date {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.date-add-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0 1rem;
    align-items: end;
}

.date-add-form .form-group {
    display: flex;
    flex-direction: column;
}

.date-add-form__options {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.date-add-form button {
    margin-bottom: 1rem;
    justify-self: start;
}

/* Trip form: budget */
.occasion-budget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.occasion-budget__currency {
    font-weight: 600;
    color: var(--text-secondary);
}

.occasion-budget input {
    width: 8rem;
}

.occasion-budget select {
    width: auto;
}

/* Trip plan: budget */
.budget-box {
    margin: 0.75rem 0 0.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    background: #dcfce7;
    color: #166534;
    line-height: 1.5;
}

.budget-box.is-over {
    background: #fef3c7;
    color: #92400e;
}

.plan-person__spend {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.4rem;
}

.plan-item__price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.2rem;
}

.plan-item__shop.is-secondary {
    opacity: 0.6;
}

/* Search: price chips */
.price-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.price-chips > span {
    font-weight: 600;
}

.price-chips .chip-link {
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
}

.chip-link.is-active {
    background: var(--primary-color);
    color: #ffffff;
}

.price-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
}

.coming-up__prices {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.coming-up__prices a {
    color: var(--text-secondary);
}

/* Dashboard: "Shop for someone" heading above the search and the people */
.shop-for {
    width: 100%;
    max-width: 1200px;
    margin: 0.5rem auto 0.75rem;
    text-align: center;
}

.shop-for__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--text-color);
}

.shop-for__hint {
    margin: 0;
    color: var(--text-secondary);
}

.shop-for__hint.is-warning {
    color: var(--accent-color);
    font-weight: 600;
}

.coming-up__prices a {
    white-space: nowrap;
}

/* Keep the search and the people it searches for close together */
.shop-for ~ .search-filter-section {
    margin-bottom: 0.5rem;
}

.shop-for ~ .search-filter-section .search-form {
    margin-bottom: 0;
}

.shop-for ~ .personas-grid-container {
    margin-top: 1rem;
}

/* ---------- Home page (logged out) ---------- */
.lp {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
    color: var(--text-color);
}

.lp h1, .lp h2, .lp h3 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}

.lp-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-decoration: none;
}

.lp-brand__mark {
    width: 1.9rem;
    height: 1.9rem;
    background: url('/assets/images/brand/prefnest-mark.svg') center / contain no-repeat;
}

/* Logo: the tag mark plus the name, "Nest" in the brand coral */
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.brand-lockup__mark {
    width: 40px;
    height: 40px;
    flex: none;
}

.brand-lockup__name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--primary-color);
}

.brand-accent {
    color: var(--brand-coral);
}

.brand-lockup--small .brand-lockup__mark {
    width: 28px;
    height: 28px;
}

.brand-lockup--small .brand-lockup__name {
    font-size: 1.05rem;
}

.lp-top__links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.lp-top__links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.lp-top__links a.lp-top__cta {
    color: #ffffff;
    padding: 0.55rem 1.1rem;
}

.lp-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem 0 4rem;
}

.lp-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.12;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.lp-lead {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.lp-hero__actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 1.75rem 0 0.75rem;
}

.lp-btn-lg {
    padding: 0.85rem 1.6rem;
    font-size: 1.05rem;
}

.lp-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

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

.lp-hero__visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.lp-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: var(--shadow-lg);
}

.lp-card--small {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-left: 2.5rem;
    padding: 1rem 1.2rem;
}

.lp-card__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.lp-card__head > div {
    display: flex;
    flex-direction: column;
}

.lp-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

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

.lp-facts div {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--border-color);
}

.lp-facts dt {
    width: 4.5rem;
    flex-shrink: 0;
    font-weight: 600;
}

.lp-facts dd {
    margin: 0;
    color: var(--text-secondary);
}

.lp-kind {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
}

.lp-chip {
    align-self: flex-start;
    margin-top: 0.4rem;
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.lp-section {
    padding: 3.5rem 0;
}

.lp-section h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.lp-section--tint {
    background: var(--primary-soft);
    border-radius: 24px;
    padding: 3.5rem 2rem;
}

.lp-section--dark {
    background: var(--primary-color);
    color: #ffffff;
    border-radius: 24px;
    padding: 3.5rem 2rem;
    text-align: center;
}

.lp-section--dark h2 {
    color: #ffffff;
    margin-bottom: 1rem;
}

.lp-section--dark .lp-lead {
    color: #dbe4ff;
    max-width: 720px;
    margin: 0 auto;
}

.lp-section--dark .lp-hero__actions {
    justify-content: center;
}

.lp-btn-light {
    background: #ffffff;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1.4rem;
}

.lp-link--light {
    color: #ffffff;
}

.lp-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.lp-steps li {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.lp-step__num {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent-color);
    color: #ffffff;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.lp-steps h3, .lp-feature h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

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

.lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.lp-feature {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.4rem;
}

.lp-privacy {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 2rem;
    align-items: center;
}

.lp-privacy h2 {
    text-align: left;
    margin-bottom: 0.5rem;
}

.lp-checks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.lp-checks li {
    position: relative;
    padding-left: 2rem;
    line-height: 1.55;
}

.lp-checks li::before {
    content: '';
    position: absolute;
    left: 0.35rem;
    top: 0.25rem;
    width: 0.5rem;
    height: 0.9rem;
    border-right: 3px solid var(--success-color);
    border-bottom: 3px solid var(--success-color);
    transform: rotate(45deg);
}

.lp-faq {
    max-width: 760px;
    margin: 0 auto 1rem;
    display: grid;
    gap: 0.6rem;
}

.lp-faq details {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    background: #ffffff;
}

.lp-faq summary {
    cursor: pointer;
    font-weight: 600;
}

.lp-faq details p {
    margin-top: 0.6rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.lp-final {
    text-align: center;
    padding: 2rem 0 4rem;
}

.lp-final h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    margin-bottom: 1.25rem;
}

@media (max-width: 860px) {
    .lp-hero,
    .lp-privacy {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lp-hero {
        padding-top: 1.5rem;
    }

    .lp-steps,
    .lp-features {
        grid-template-columns: 1fr;
    }

    .lp-card--small {
        margin-left: 0;
    }

    .lp-top__links {
        gap: 0.9rem;
        font-size: 0.95rem;
    }

    .lp-top__links a[href^="#"] {
        display: none;
    }

    .lp-section--tint,
    .lp-section--dark {
        padding: 2.5rem 1.25rem;
    }
}

/* Home page: security grid */
.lp-center {
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.lp-security {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    margin: 2rem 0 1.25rem;
}

.lp-sec {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
}

.lp-sec__badge {
    display: inline-block;
    margin-bottom: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.lp-sec h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.lp-sec p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Why / what / how: three cards across */
.lp-security--3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Sign-up: short promise above the form */
.auth-promise {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--primary-soft);
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

@media (max-width: 1000px) {
    .lp-security,
    .lp-security--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .lp-security,
    .lp-security--3 {
        grid-template-columns: 1fr;
    }
}

/* Home page: feature cards with mini product previews (example data) */
.lp-fgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.lp-fcard {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 1.6rem 1.5rem 1.5rem;
}

.lp-fcard h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

.lp-fcard > p {
    color: #334155;
    line-height: 1.55;
    margin-bottom: 1.2rem;
}

.lp-fcard--blue   { background: #e3edff; }
.lp-fcard--rose   { background: #fde8e4; }
.lp-fcard--mint   { background: #dff6ea; }
.lp-fcard--butter { background: #fff4d6; }
.lp-fcard--lilac  { background: #ece7ff; }
.lp-fcard--sky    { background: #dff3fb; }

.lp-mini {
    margin-top: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.9rem;
}

.lp-mini small {
    font-size: 0.78rem;
}

.lp-mini__person {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lp-mini__person > div {
    display: flex;
    flex-direction: column;
}

.lp-mini__person small,
.lp-mini__muted {
    color: var(--text-secondary);
}

.lp-mini__avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.lp-mini__avatar--alt {
    background: #fde8e4;
    color: var(--accent-color);
}

.lp-mini__label {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lp-mini__swatches {
    display: flex;
    gap: 0.45rem;
}

.lp-dot {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lp-sq {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lp-mini__row,
.lp-mini__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.lp-mini__item {
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-color);
}

.lp-mini__temp {
    color: var(--primary-color);
    font-weight: 600;
}

.lp-mini__item em {
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.lp-mini__item em.lp-mini__pack {
    color: var(--text-secondary);
}

.lp-mini__kind {
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lp-mini__chips {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.lp-mini__chip {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
}

.lp-mini__chip--soft {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.lp-mini--chat {
    gap: 0.5rem;
}

.lp-bubble {
    align-self: flex-start;
    max-width: 88%;
    padding: 0.5rem 0.75rem;
    border-radius: 14px 14px 14px 4px;
    background: #f1f5f9;
    font-size: 0.85rem;
    line-height: 1.4;
}

.lp-bubble--me {
    align-self: flex-end;
    border-radius: 14px 14px 4px 14px;
    background: var(--primary-color);
    color: #ffffff;
}

.lp-mini__sizes {
    display: flex;
    gap: 0.35rem;
}

.lp-mini__sizes span {
    min-width: 2.1rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}

.lp-mini__sizes span.is-fit {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 1000px) {
    .lp-fgrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .lp-fgrid {
        grid-template-columns: 1fr;
    }
}

/* Holidays: who to find a gift for, and the hint to choose holidays */
.coming-up__for {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.coming-up__gifts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.coming-up__gifts .chip-link {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.coming-up__hint {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.coming-up__list:empty {
    display: none;
}

/* My Account: holiday checkboxes */
.holiday-picks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.4rem 1rem;
}

.lp-lead.lp-center + .lp-fgrid {
    margin-top: 1.5rem;
}

/* Home page: "You're signed out" after logging out */
.lp-notice {
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: #e3edff;
    color: var(--text-color);
    text-align: center;
}

.lp-notice a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Persona form: style keywords derived from the style inspiration */
.inspiration__help {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-secondary);
}

.inspiration {
    margin-top: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    background: var(--primary-soft);
}

.inspiration__summary {
    margin: 0 0 0.45rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.inspiration__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.inspiration__chip {
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.inspiration__colors {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Home hero: the pain point above the headline, and where you can shop */
.lp-kicker {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent-color);
}

.lp-points {
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.lp-points li {
    position: relative;
    padding-left: 1.7rem;
    color: var(--text-color);
    font-weight: 500;
}

.lp-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231e3a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
}

/* Home hero: the real app on a phone, with the example profile card overlapping it */
.lp-hero__visual:has(.lp-phone) {
    position: relative;
    align-items: flex-end;
    padding-bottom: 1rem;
}

.lp-phone {
    position: relative;
    width: min(300px, 72%);
    margin-right: 0.5rem;
    border: 10px solid #0f172a;
    border-radius: 38px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
}

.lp-phone::before {
    /* the camera notch */
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 72px;
    height: 18px;
    transform: translateX(-50%);
    border-radius: 99px;
    background: #0f172a;
    z-index: 1;
}

.lp-phone img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 780 / 1240;
    object-fit: cover;
    object-position: top;
    border-radius: 28px;
}

.lp-card--float {
    position: absolute;
    left: -2rem;
    bottom: -0.5rem;
    width: min(250px, 55%);
    padding: 0.9rem 1rem;
}

.lp-card--float .lp-card__head {
    margin-bottom: 0.4rem;
}

.lp-card--float .lp-facts div {
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.lp-card--float .lp-facts dt {
    width: 3.6rem;
}

@media (max-width: 860px) {
    .lp-hero__visual:has(.lp-phone) {
        align-items: center;
    }

    .lp-phone {
        margin-right: 0;
    }

    .lp-card--float {
        position: relative; /* on top of the phone it overlaps */
        left: auto;
        bottom: auto;
        z-index: 2;
        width: 100%;
        margin-top: -3rem;
    }
}

/* Home: the explainer video */
.lp-video {
    max-width: 960px;
    margin: 1.5rem auto 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #0f172a;
}

.lp-video {
    position: relative;
}

.lp-video video {
    display: block;
    width: 100%;
    height: auto;
}

/* The whole cover is the play button, so wherever people click, it plays */
.lp-video__cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    border: 0;
    background: transparent;
    color: #ffffff;
    text-align: center;
    cursor: pointer;
    font: inherit;
}

.lp-video__cover[hidden] {
    display: none;
}

.lp-video__play {
    width: clamp(56px, 9vw, 88px);
    height: clamp(56px, 9vw, 88px);
    margin-bottom: 0.4rem;
    border-radius: 50%;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%231e3a8a'/%3E%3C/svg%3E") 58% 50% / 48% no-repeat;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.lp-video__cover:hover .lp-video__play,
.lp-video__cover:focus-visible .lp-video__play {
    transform: scale(1.08);
}

.lp-video__title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: clamp(1.1rem, 2.6vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
    max-width: 22em;
}

.lp-video__sub {
    font-size: clamp(0.9rem, 1.6vw, 1.15rem);
    opacity: 0.9;
}

@media (max-width: 600px) {
    .lp-video__cover {
        gap: 0.35rem;
    }

    .lp-video__play {
        width: 52px;
        height: 52px;
        margin-bottom: 0.2rem;
    }

    .lp-video__title {
        font-size: 1rem;
    }

    .lp-video__sub {
        display: none;
    }
}

.lp-section--dark .lp-lead__strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1.3rem;
    color: #ffffff;
}

/* Public top bar (includes/public-top.php): full width even where the body centers its children */
body > .lp {
    width: 100%;
}

/* Back to top (assets/js/back-to-top.js) */
.to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 900;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.to-top:hover,
.to-top:focus-visible {
    background: var(--primary-hover);
}

.to-top svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
    .to-top {
        transition: none;
    }
}

/* Home: "Like a digital wallet" band under the hero */
.lp-wallet {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 0 0 1rem;
    padding: 1.4rem 1.6rem;
    border-radius: 18px;
    background: var(--primary-soft);
    border: 1px solid #dbe3f5;
}

.lp-wallet__icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--primary-color);
}

.lp-wallet__icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lp .lp-wallet__title {
    margin: 0 0 0.3rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.lp-wallet__text {
    margin: 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .lp-wallet {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 1.2rem;
    }
}

/* Phones: the vertical video uses the full width */
@media (max-width: 640px) {
    .lp-video--tall {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
}

/* The vertical phone video has room for the full cover text again */
@media (max-width: 600px) {
    .lp-video--tall .lp-video__play {
        width: 72px;
        height: 72px;
    }

    .lp-video--tall .lp-video__title {
        font-size: 1.4rem;
    }

    .lp-video--tall .lp-video__sub {
        display: block;
    }
}

/* Shared profiles: owner's Sharing section, viewer's read-only page, My Account overview */
.share-subtitle {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.share-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.5rem;
}

.share-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.share-list__who {
    flex: 1;
    min-width: 180px;
}

.share-list__meta {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.share-list__edit {
    flex-basis: 100%;
    order: 3;
}

.share-list__edit summary {
    cursor: pointer;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.share-new {
    margin-top: 1rem;
}

.share-new > summary {
    display: inline-block;
    list-style: none;
    cursor: pointer;
}

.share-new > summary::-webkit-details-marker {
    display: none;
}

.share-new[open] > summary {
    display: none;
}

.share-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.share-form > .btn {
    justify-self: start;
}

.share-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-preset input {
    position: absolute;
    opacity: 0;
}

.share-preset span {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
}

.share-preset input:checked + span {
    border-color: var(--primary-color);
    background: var(--primary-soft);
    color: var(--primary-color);
    font-weight: 600;
}

.share-preset input:focus-visible + span {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.share-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.35rem 1rem;
}

.share-checks .checkbox-label {
    margin: 0;
}

.share-link {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    background: var(--primary-soft);
}

.share-link__title {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}

.share-link__help {
    margin: 0.25rem 0 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.share-link__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-link__row .form-input {
    flex: 1 1 260px;
    min-width: 0;
}

.share-fields {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    line-height: 1.7;
}

.persona-shared-tag {
    color: var(--primary-color);
    font-weight: 600;
}

.coming-up__card--update {
    border-color: var(--primary-color);
    background: var(--primary-soft);
}

.shared-view {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.shared-view__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.shared-view__head h1 {
    margin: 0;
}

.shared-view__by {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
}

.shared-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem 1.5rem;
    margin: 0;
}

.shared-facts dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.shared-facts dd {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

.shared-view__summary {
    margin: 1rem 0 0;
    line-height: 1.6;
}

.shared-view__remove {
    margin-top: 1.5rem;
    text-align: center;
}

/* Shared profiles: "use the shared profile instead of my copy" */
.share-replace {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    display: grid;
    gap: 0.5rem;
}

.share-replace__title {
    margin: 0;
    font-weight: 600;
}

details.share-replace > summary {
    cursor: pointer;
}

.share-replace small {
    display: block;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0.4rem 0 0.6rem;
}

.share-link__web {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.share-link [hidden] {
    display: none;
}

/* Shared profiles: "ask them to fill it in", and filtering long share lists */
.share-ask {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--primary-color);
    border-radius: 10px;
}

.share-ask p {
    margin: 0 0 0.75rem;
    line-height: 1.6;
}

.share-filter {
    margin-bottom: 0.6rem;
}

.share-list > li[hidden] {
    display: none;
}

/* "Who's it for?" (snap.php) */
.shop-for__snap {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.snap {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.snap__title {
    margin: 0 0 0.25rem;
}

.snap__lead {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.snap__hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.snap-form {
    display: grid;
    gap: 1rem;
}

.snap-form > .btn {
    justify-self: start;
}

.snap-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.75rem 1rem;
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    background: var(--primary-soft);
    cursor: pointer;
    text-align: center;
}

.snap-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.snap-drop:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.snap-drop__icon {
    font-size: 2rem;
}

.snap-drop__text {
    font-weight: 600;
    color: var(--primary-color);
    overflow-wrap: anywhere;
}

.snap-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
}

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

.snap-matches {
    display: grid;
    gap: 0.75rem;
}

.snap-match {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
}

.snap-match--great {
    border-left-color: #15803d;
}

.snap-match--good {
    border-left-color: var(--primary-color);
}

.snap-match__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}

.snap-match__head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.snap-match__verdict {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.snap-match--great .snap-match__verdict {
    color: #15803d;
}

.snap-match--good .snap-match__verdict {
    color: var(--primary-color);
}

.snap-match__by,
.snap-match__soon {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.snap-match__soon {
    color: var(--primary-color);
    font-weight: 600;
}

.snap-match__reasons {
    margin: 0.6rem 0;
    padding-left: 1.2rem;
    line-height: 1.6;
}

.snap-match__size,
.snap-match__caution {
    margin: 0.3rem 0;
    line-height: 1.5;
}

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

.snap-match__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.snap-skips {
    margin-top: 1rem;
    color: var(--text-secondary);
}

.snap-skips summary {
    cursor: pointer;
}

.snap-skips ul {
    padding-left: 1.2rem;
    line-height: 1.6;
}

.snap__none {
    color: var(--text-secondary);
}

.snap__again {
    margin-top: 1.5rem;
}

/* Shopify app: the shopper's size popup (shopify/fit.php) and the store owner's settings page (shopify/admin/) */
.fit-popup {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: var(--bg-secondary);
}

.fit-popup__card {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--bg-color);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    text-align: center;
}

.fit-popup__brand {
    margin: 0 0 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.fit-popup__title {
    margin: 0 0 1rem;
    font-size: 1.3rem;
}

.fit-popup__label {
    margin: 0;
    color: var(--text-secondary);
}

.fit-popup__size {
    margin: 0.25rem 0 0.75rem;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.fit-popup__note {
    margin: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.fit-popup__actions,
.fit-popup__choices {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.fit-popup__link {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.shopify-admin {
    background: #f1f2f4;
}

.shopify-admin__main {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.shopify-admin__card {
    padding: 1.25rem;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
}

.shopify-admin__card h1,
.shopify-admin__card h2 {
    margin-top: 0;
}

.shopify-admin__hint,
.shopify-admin__status {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
