/* =============================================
   User Profile page
   ============================================= */

.profile-main {
    flex: 1;
    padding: 2rem;
    max-width: 800px;
}

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

.profile-section-title {
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
}

.profile-subtitle {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: 1.03rem;
}

.profile-help-text {
    margin: -0.5rem 0 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-field {
    margin-bottom: 1.5rem;
}

.profile-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
    width: 100%;
}

.profile-top-card {
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    overflow-wrap: anywhere;
}

.profile-separator {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    margin: 1rem 0 1.2rem;
}

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

.profile-label--bold {
    color: var(--text-primary);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.profile-value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-value--mb {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.profile-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.profile-toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.profile-toggle-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-toggle-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-save-message {
    color: var(--color-success);
    font-weight: 600;
    display: none;
    margin-top: 0.5rem;
    margin-left: 1rem;
}

.profile-save-message--inline {
    color: var(--color-success);
    font-weight: 600;
    display: none;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.menu-style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    width: 100%;
}

.menu-style-card {
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    border-radius: 10px;
    padding: 0.65rem;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
}

.menu-style-card:hover {
    border-color: var(--border-primary);
    background: var(--bg-input-hover);
    transform: translateY(-1px);
}

.menu-style-card--active {
    border-color: var(--color-primary);
    background: var(--bg-primary-muted);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.menu-style-card__name {
    display: block;
    font-weight: 700;
    margin-bottom: 0.2rem;
    word-break: break-word;
}

.menu-style-card__key {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    word-break: break-word;
}

#usernameForm,
#usernameForm .form-group,
#usernameForm .form-input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Theme selector */
.theme-group {
    margin-bottom: 1.25rem;
}

.theme-group__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-card:hover {
    border-color: var(--border-primary);
    background: var(--bg-input-hover);
    transform: translateY(-2px);
}

.theme-card--active {
    border-color: var(--color-primary);
    background: var(--bg-primary-muted);
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 6px;
    background: var(--preview-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    box-sizing: border-box;
}

.theme-preview__bar {
    height: 8px;
    border-radius: 3px;
    background: var(--preview-accent);
    opacity: 0.9;
    width: 60%;
}

.theme-preview__lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
}

.theme-preview__line {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.theme-preview__line--accent {
    background: var(--preview-accent);
    opacity: 0.6;
    width: 80%;
}

.theme-preview__line--short {
    width: 50%;
}

.theme-card__label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
}

.theme-card--active .theme-card__label {
    color: var(--color-primary);
    font-weight: 700;
}

@media (max-width: 980px) {
    .profile-top-grid {
        grid-template-columns: 1fr;
    }
}
