/* Shared profile UI for /profile and /u/{username} */

.profile-page,
.public-profile-page {
    padding: 28px 16px 64px;
}

.profile-card,
.public-profile-shell {
    max-width: 860px;
    margin: 0 auto;
    background: var(--card-bg, #ffffff);
    border: var(--border, 1px solid #e5e7eb);
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.profile-cover {
    position: relative;
    height: 125px;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 48%, #16a34a 100%);
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.profile-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(120% 85% at 50% 0%, rgba(15, 23, 42, 0.06) 0%, rgba(15, 23, 42, 0) 55%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.18) 42%, rgba(15, 23, 42, 0.52) 100%);
}

.cover-edit-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cover-edit-btn:hover {
    background: rgba(15, 23, 42, 0.5);
}

.cover-edit-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.cover-share-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.35);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cover-share-btn[hidden] {
    display: none !important;
}

.cover-share-btn:hover {
    background: rgba(15, 23, 42, 0.55);
}

.cover-share-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

.profile-identity {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 28px 26px;
    margin-top: -55px;
}

.avatar-wrap {
    position: relative;
    width: 135px;
    height: 135px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 4px solid var(--card-bg, #ffffff);
    background: var(--avatar-bg, #0f766e);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.avatar-media {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--avatar-bg, #0f766e);
}

.avatar-media [data-avatar-image],
.avatar-media [data-avatar-initials] {
    position: absolute;
    inset: 0;
}

.avatar-media [data-avatar-image][hidden],
.avatar-media [data-avatar-initials][hidden] {
    display: none !important;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    user-select: none;
}

.avatar-edit-btn {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.avatar-edit-btn svg {
    width: 22px;
    height: 22px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-wrap:hover .avatar-edit-btn {
    background: rgba(0, 0, 0, 0.45);
}

.avatar-wrap:hover .avatar-edit-btn svg {
    opacity: 1;
}
.identity-text {
    flex: 1;
    min-width: 0;
    padding-top: 70px;
}
@media (max-width: 700px) {
    .identity-name-row {
        justify-content: center;
    }
}

.identity-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.identity-name {
    margin: 0 0 4px;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--details-text, #0f172a);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.identity-status-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: -4px;
}

.identity-status-icon[hidden] {
    display: none !important;
}

.identity-status-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.identity-active-indicator {
    width: 10px;
    height: 10px;
    display: inline-flex;
    flex-shrink: 0;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
    margin-top: -3px;
}

.identity-active-indicator--avatar {
    position: absolute;
    right: 8px;
    bottom: 4px;
    width: 24px;
    height: 24px;
    margin-top: 0;
    border: 4px solid var(--card-bg, #ffffff);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06), 0 10px 18px rgba(22, 163, 74, 0.28);
    z-index: 3;
}

.identity-active-indicator[hidden] {
    display: none !important;
}

.private-lock-icon {
    color: #64748b;
}

.verified-badge-icon {
    color: #1877f2;
}

.identity-username {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 15px;
}

.identity-headline {
    margin: 6px 0 4px;
    color: #0f766e;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.identity-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.identity-meta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.profile-completion-card {
    padding: 18px 15px 15px;
    border-radius: 15px;
    background: #f0fff8;
    border: 1px solid #9ccfae;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 25px;
    position: relative;
}

.profile-completion-card.incomplete {
    background: #fff0f0;
    border: 1px solid #cf9c9c;
}

html.profile-completion-card-hidden .profile-completion-card[data-profile-completion="100"] {
    display: none !important;
}

.completion-card-close {
    position: absolute;
    top: 11px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #edecec;
    background: #f7f7f7;
    color: dimgray;
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.completion-card-close:hover {
    background: #ffecec;
}

.completion-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.completion-badge {
    font-size: 15px;
    font-weight: 700;
    color: #505050;
}

.completion-status {
    font-size: 13px;
    color: var(--details-text);
}

.profile-completion-card[data-profile-completion="100"] .completion-status {
    padding-inline-end: 35px;
}
.completion-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.completion-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e 0%, #14b8a6 100%);
    transition: width 0.3s ease;
}

.completion-checklist {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    color: #334155;
    font-size: 14px;
}

.completion-checklist-inline {
    gap: 8px;
}

.completion-checklist li {
    position: relative;
    padding-left: 22px;
}

.completion-checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.completion-inline-copy {
    color: #454545;
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
}
@media (min-width: 1024px) {
    .completion-inline-copy {
        text-align: left;
    }
}

.profile-completion-form {
    display: grid !important;
    gap: 12px !important;
}

.profile-completion-section {
    padding: 14px 16px 12.5px;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.profile-completion-avatar-btn {
    width: 100%;
}

.profile-completion-field {
    gap: 6px;
}

.profile-completion-inline-row {
    display: grid;
    grid-template-columns: minmax(56px, auto) minmax(0, 1fr);
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
}

.profile-completion-inline-row label {
    padding-inline-start: 0;
    justify-content: flex-start;
    white-space: nowrap;
}

.profile-completion-inline-row > input,
.profile-completion-inline-row > select,
.profile-completion-inline-row > button {
    width: 100%;
    min-width: 0;
}

.profile-completion-inline-row--dob {
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
}

.profile-completion-actions {
    display: flex;
    gap: 15px;
}

.profile-completion-actions.is-visible {
    animation: profileActionsFadeIn 0.18s ease-out;
}

@media (min-width: 1024px) {
    .profile-completion-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .profile-completion-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .profile-completion-inline-row {
        grid-template-columns: 1fr;
    }
}

.role-badge {
    display: inline-block;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 999px;
}

.member-since {
    color: #6b7280;
    font-size: 14px;
}

.member-meta-separator {
    color: #94a3b8;
}

.member-last-seen {
    color: #006ba0;
}

.profile-header {
    border-top: var(--border, 1px solid #e5e7eb);
    border-bottom: var(--border, 1px solid #e5e7eb);
}

.profile-tabs {
    display: flex;
    width: 100%;
}

.tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tab-btn:hover {
    background: rgba(15, 118, 110, 0.06);
    color: #0f766e;
}

.tab-btn.active {
    color: #0f766e;
    border-bottom-color: #0f766e;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.tab-btn svg path {
    fill: currentColor;
}

.tab-panel {
    display: none;
    padding: 25px 15px;
}
@media (min-width: 1023px) {
    .tab-panel {
        padding: 25px 50px;
    }
}

.tab-panel.active {
    display: block;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-editor-cards {
    padding: 0;
}

.profile-editor-cards .public-card--editable {
    display: flex;
    flex-direction: column;
    padding: 18px 15px 15px;
    background: #ebf9de;
    border: 1px solid lightgray;
}

.public-card-form-row {
    gap: 0;
}

.teacher-profile-editor {
    gap: 12px;
}

.teacher-profile-field {
    border: 1px solid #dbe4ea;
    border-radius: 12px;
    background: #f8fbfd;
    padding: 12px;
}

.public-card-form-row textarea {
    min-height: 0;
    height: auto;
    overflow: hidden;
    resize: none;
    line-height: 1.55;
}

.public-card-form-meta {
    display: flex;
    justify-content: flex-end;
    margin-inline-end: 5px;
}

.public-card-form-meta[hidden] {
    display: none !important;
}

.about-character-count {
    color: dimgray;
    font-size: 12px;
}

.about-character-count.is-near-limit {
    color: #b45309;
}

.form-actions--about {
    justify-content: flex-end;
}

.account-info-actions.is-visible {
    animation: profileActionsFadeIn 0.18s ease-out;
}

.public-card-form-meta.is-visible {
    animation: profileActionsFadeIn 0.18s ease-out;
}

@keyframes profileActionsFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-page .form-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
}

.profile-page .form-row label {
    font-size: 18px;
    font-weight: 700;
    color: #376d50;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.account-identity-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.profile-page .account-identity-grid .form-row-inline {
    display: grid;
    grid-template-columns: minmax(35px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.profile-page .account-identity-grid .form-row-inline label {
    padding-inline-start: 0;
    justify-content: flex-start;
}

.profile-page .account-identity-grid .form-row-inline > input,
.profile-page .account-identity-grid .form-row-inline > .input-prefix-wrap {
    width: 100%;
}

.account-contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.profile-page .personal-details-grid .form-row-inline {
    display: grid;
    grid-template-columns: minmax(50px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.profile-page .personal-details-grid .form-row-inline label {
    padding-inline-start: 0;
    justify-content: flex-start;
}

.profile-page .personal-details-grid .form-row-inline > input,
.profile-page .personal-details-grid .form-row-inline > select,
.profile-page .personal-details-grid .form-row-inline > .country-select-container,
.profile-page .personal-details-grid .form-row-inline > .city-input-wrapper {
    width: 100%;
    min-width: 0;
}

#timezoneManualFields .form-row-inline {
    display: grid;
    grid-template-columns: minmax(50px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

#timezoneManualFields .timezone-country-input-wrap {
    position: relative;
}

#timezoneManualFields .timezone-country-input-wrap .country-select {
    width: 100%;
}

#timezoneManualFields .timezone-country-input-wrap .country-select input {
    width: 100%;
    box-sizing: border-box;
}

.profile-page .personal-primary-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 3.25fr 2fr;
    gap: 16px;
}

.profile-page .personal-primary-grid .dob-row {
    grid-column: 1 / -1;
}

.profile-page #age_display_settings {
    cursor: pointer;
    background: #f8fafc;
}

.profile-page #ageDerivedHelp {
    grid-column: 1 / -1;
}

/* countrySelect inside profile grid */
.profile-page .personal-details-grid .country-select-container {
    position: relative;
}

.profile-page .personal-details-grid .country-select-container input {
    width: 100%;
    box-sizing: border-box;
}

/* City input with inline flag */
.city-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.city-input-wrapper input {
    flex: 1;
    min-width: 0;
    width: auto !important;
}

.city-flag-icon {
    flex-shrink: 0;
    display: inline-block;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    background-size: cover;
}

.inline-add-btn {
    display: inline-flex;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #93b19b;
    border-radius: 999px;
    background: none;
    color: #93b19b;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

/* DOB Picker Styles */
.dob-display-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #555555;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dob-display-btn:hover,
.dob-display-btn:focus-visible {
    border-color: #0f766e;
    outline: none;
}

.dob-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
    flex-shrink: 0;
}

.dob-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.dob-picker-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dob-picker-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dob-picker-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    text-align: center;
}

.dob-picker-display {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #0f766e;
    text-align: center;
}

.dob-picker-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.dob-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dob-input-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dob-input-field {
    padding: 10px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dob-input-field:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.dob-input-field::placeholder {
    color: #cbd5e1;
}

.dob-month-select {
    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='%23%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    cursor: pointer;
}

.dob-month-select.is-placeholder {
    color: #cbd5e1;
}

.dob-month-select option {
    color: #0f172a;
    background: #ffffff;
}

.dob-picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dob-btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.dob-btn-confirm {
    background: #0f766e;
    color: #ffffff;
}

.dob-btn-confirm:hover:not(:disabled) {
    background: #0d5d56;
}

.dob-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.dob-btn-cancel:hover {
    background: #e2e8f0;
}

.dob-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.label-hint {
    font-size: 12px;
    color: var(--details-text-secondary);
    font-weight: 500;
}

.profile-page input,
.profile-page textarea,
.profile-page select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--details-text);
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-page textarea {
    min-height: 80px;
    resize: vertical;
}

.profile-page input:focus,
.profile-page textarea:focus,
.profile-page select:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.input-prefix-wrap {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: cadetblue;
    font-weight: 700;
}

.input-prefix-wrap input {
    padding-left: 28px;
}

.field-help {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    padding-inline-start: 8px;
}
.field-help-email {
    font-size: 13px;
    color: gray;
    background: white;
    border: 1px solid lightgray;
    border-radius: 8px;
    padding: 6px 0 4px;
    margin: 8px 0;
    padding-inline-start: 8px;
    margin-inline-start: 6px;
}

.settings-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin: 16px 0;
    padding: 25px 15px 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

#tab-settings .settings-section {
    margin: 12px 0;
}

.settings-accordion {
    --section-accent: #94a3b8;
    --section-accent-strong: #64748b;
    padding: 0;
    overflow: hidden;
    border: 1px solid lightgray;
    border-left: 5px solid var(--section-accent);
    transition: box-shadow 0.24s ease, border-color 0.24s ease, transform 0.2s ease;
}

.settings-accordion:hover {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.settings-accordion.is-open {
    border-color: var(--section-accent);
    border-left-color: var(--section-accent-strong);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.09);
}

#tab-settings .settings-accordion:nth-of-type(1) {
    --section-accent: #14b8a6;
    --section-accent-strong: #0f766e;
}

#tab-settings .settings-accordion:nth-of-type(2) {
    --section-accent: #3b82f6;
    --section-accent-strong: #1d4ed8;
}

#tab-settings .settings-accordion:nth-of-type(3) {
    --section-accent: #8b5cf6;
    --section-accent-strong: #6d28d9;
}

#tab-settings .settings-accordion[data-timezone-section] {
    --section-accent: #ef4444;
    --section-accent-strong: #b91c1c;
}

#tab-settings .settings-accordion:nth-of-type(4) {
    --section-accent: #06b6d4;
    --section-accent-strong: #0e7490;
}

#tab-settings .settings-accordion:nth-of-type(5) {
    --section-accent: #f97316;
    --section-accent-strong: #c2410c;
}

#tab-settings .settings-accordion:nth-of-type(6) {
    --section-accent: #f43f5e;
    --section-accent-strong: #be123c;
}

.settings-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 15px 10px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #e5e5e5);
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-accordion.is-open .settings-accordion-toggle {
    border-bottom-color: lightgray;
    border-radius: 16px 16px 0 0;
}

.settings-accordion-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-accordion-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--details-text);
}

.settings-accordion.is-open .settings-accordion-title {
    color: var(--section-accent-strong);
}

.settings-accordion-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.4;
}

.settings-accordion-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
    margin-top: 2px;
    transition: transform 0.24s ease, color 0.2s ease;
}

.settings-accordion-toggle:hover .settings-accordion-icon,
.settings-accordion-toggle:focus-visible .settings-accordion-icon {
    color: #0f766e;
}

.settings-accordion.is-open .settings-accordion-icon {
    transform: rotate(180deg);
}

.settings-accordion-toggle:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.3);
}

.settings-accordion-toggle.is-danger .settings-accordion-title {
    color: #991b1b;
}

.settings-accordion-toggle.is-danger .settings-accordion-subtitle {
    color: #b45309;
}

.settings-accordion-toggle.is-danger:hover .settings-accordion-icon,
.settings-accordion-toggle.is-danger:focus-visible .settings-accordion-icon {
    color: #b91c1c;
}

.settings-accordion-panel {
    padding: 25px 15px 20px;
    border-top: 0;
    border-radius: 0 0 15px 15px;
    background: #ffffff;
    animation: settingsPanelEnter 0.22s ease;
}

.settings-accordion.is-open .settings-accordion-panel {
    background: rgb(238 245 245 / 58%);
}

.settings-accordion-panel[hidden] {
    display: none !important;
}

/* Simple fix: allow country dropdown lists to escape clipped containers in Profile settings */
.profile-page .settings-accordion {
    overflow: visible;
}

.profile-page .iti__dropdown,
.profile-page .country-list {
    z-index: 10000;
}
@media (max-width: 500px) {
    .country-select .country-list {
        min-width: 200px;
    }
}


@keyframes settingsPanelEnter {
    0% {
        opacity: 0;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-heading {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 900;
    color: var(--details-text);
}

.settings-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.settings-section-head .settings-heading {
    margin: 0;
}

.btn-tertiary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-tertiary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f766e;
}

.visibility-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vis-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 65px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    padding: 5px;
    gap: 6px;
    cursor: pointer;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: background 0.22s ease, box-shadow 0.2s ease, transform 0.15s ease;
    outline: none;
}

.vis-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.28);
}

.vis-toggle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.vis-toggle.is-off {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    flex-direction: row;
}

.vis-toggle.is-on {
    background: linear-gradient(135deg, #0f766e 0%, #16a34a 100%);
    flex-direction: row-reverse;
}

.vis-toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.vis-toggle-text {
    flex: 1;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.visibility-account-label {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.visibility-account-label.is-private {
    color: #b91c1c;
}

.visibility-account-label.is-public {
    color: #166534;
}

.visibility-view-link {
    font-size: 12px;
    font-weight: 600;
    padding-left: 18px;
    color: gray;
    text-decoration: underline;
}

.visibility-view-link:hover {
    color: dimgray;
}

.share-icon-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    line-height: 0;
    color: #64748b;
    cursor: pointer;
}

.share-icon-btn:hover {
    color: #0f766e;
}

.share-icon-btn:focus-visible {
    outline: none;
    color: #0f766e;
}

.share-icon-btn svg {
    width: 25px;
    height: 25px;
    display: block;
    fill: currentColor;
}

.profile-form.is-readonly input:disabled,
.profile-form.is-readonly textarea:disabled {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.profile-form:not(.is-readonly) .form-summary {
    display: none;
}

.form-actions {
    padding-top: 2px;
}

.account-info-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions[hidden],
.account-info-actions[hidden] {
    display: none !important;
}

.password-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.password-forgot-link {
    color: #0f766e;
    font-size: 15px;
    font-weight: 700;
    margin-inline-start: 5px;
}

.password-forgot-link:hover {
    color: #115e59;
    text-decoration: underline;
}

.password-forgot-link:focus-visible {
    outline: none;
    text-decoration: underline;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 0;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 11px 18px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e 0%, #16a34a 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 118, 110, 0.25);
}

.btn-secondary {
    background: #f8fafc;
    color: #0f766e;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #eef6f6;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.profile-alert {
    margin-bottom: 12px;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
}

.alert-success {
    color: #166534;
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.35);
}

.alert-error {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.verified-badge,
.unverified-badge {
    font-size: 11px;
    border-radius: 999px;
    padding: 2px 8px 1.5px;
    font-weight: 700;
}

.verified-badge {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #98c5a8;
}

.unverified-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #ddd1a0;
}

.email-change-status {
    margin-top: 10px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    border-radius: 12px;
    padding: 10px 12px;
}

.email-change-status .field-help {
    margin: 0;
    color: #78350f;
}

.email-change-status .field-help + .field-help {
    margin-top: 3px;
}

.email-change-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.email-change-code-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.email-change-code-row input[type="text"] {
    flex: 1 1 140px;
    min-width: 100px;
    max-width: 300px;
    font-size: 13px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s;
}

.email-change-code-row input[type="text"]:focus {
    border-color: #6366f1;
}

.email-change-code-row .btn-primary {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 10px;
    white-space: nowrap;
}

.email-change-actions .btn-secondary {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 10px;
}

.secondary-email-row.has-linked-email {
    margin-top: 10px;
}

.secondary-email-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.secondary-email-row[hidden],
.secondary-phone-row[hidden] {
    display: none !important;
}

.secondary-email-row input[type="email"] {
    flex: 1 1 230px;
    max-width: 585px;
}

.secondary-remove-btn {
    display: none;
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 10px;
}

.secondary-email-row.has-value:hover .secondary-remove-btn,
.secondary-email-row.has-value:focus-within .secondary-remove-btn,
.secondary-email-row.has-value.is-actions-visible .secondary-remove-btn,
.secondary-phone-row.has-value:hover .secondary-remove-btn,
.secondary-phone-row.has-value:focus-within .secondary-remove-btn,
.secondary-phone-row.has-value.is-actions-visible .secondary-remove-btn {
    display: inline-flex;
    animation: secondaryActionIn 0.18s ease-out;
}

@keyframes secondaryActionIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.secondary-email-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 42px;
    width: 100%;
    max-width: 415px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid darkseagreen;
    background: #ffffff;
    color: dimgray;
    font-weight: 600;
}

.secondary-email-trigger {
    cursor: pointer;
    text-align: left;
}

.secondary-email-row.has-linked-email .btn-secondary {
    display: none;
}

.secondary-email-row.has-linked-email:hover .btn-secondary,
.secondary-email-row.has-linked-email:focus-within .btn-secondary,
.secondary-email-row.has-linked-email.is-secondary-email-actions-visible .btn-secondary {
    display: inline-flex;
}

.settings-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#timezoneManualFields[hidden] {
    display: none !important;
}

.timezone-preview-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1.05fr);
    gap: 15px;
    align-items: stretch;
}

@media (min-width: 701px) {
    .timezone-preview-row > .timezone-preview-card {
        order: 1;
    }

    .timezone-preview-row > .timezone-local-time-values,
    .timezone-preview-row > .timezone-local-time-card {
        order: 2;
    }
}

.timezone-local-time-card,
.timezone-preview-card {
    border: 1px solid lightgray;
    border-radius: 10px;
    padding: 15px 0 10px;
    padding-inline-start: 15px;
    background: white;
}

.timezone-local-time-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.timezone-local-time-label {
    color: dimgray;
    font-size: 13px;
    font-weight: 500;
}

.timezone-local-time-values {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
}
@media (min-width: 1023px) {
    .timezone-local-time-values {
        gap: 8px;
    }
}

.timezone-local-time-parts {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.timezone-local-time-weekday,
.timezone-local-time-date,
.timezone-local-time-time {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    border: 1px solid lightgray;
    background: aliceblue;
    color: steelblue;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 10px 5px;
    letter-spacing: 0.01em;
    line-height: 1;
}

.timezone-local-time-time {
    font-size: 20px;
}

.timezone-egypt-difference {
    color: #585858;
    background: #fffdf5;
    border: 1px solid #efe4ca;
    border-radius: 12px;
    padding: 10px 35px 8px;
    font-size: 14px;
    font-weight: 400;
}

.timezone-egypt-difference[hidden] {
    display: none !important;
}

@media (min-width: 1023px) {
    .timezone-local-time-weekday,.timezone-local-time-date {
        font-size: 18px;
    }
    .timezone-local-time-time {
        font-size: 22px;
    }
}

.timezone-preview-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.timezone-preview-main strong {
    color: #454545;
    font-size: 18px;
}

.timezone-preview-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    display: inline-block;
}

.timezone-preview-meta {
    color: dimgray;
    font-size: 13px;
}

.timezone-auto-row {
    margin-top: -6px;
}

.timezone-auto-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 400;
    padding-inline-start: 8px;
}

.timezone-auto-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.phone-field-group {
    margin-top: 6px;
}

.phone-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 350px;
}

.phone-code-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 10px 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
    color: dimgray;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}

.phone-input-row .iti {
    width: 100%;
}

.phone-input-row .iti input[type="tel"] {
    padding: 10px 0 8px 50px;
}

.secondary-phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.danger-warning {
    display: flex;
    align-items: end;
    font-size: 18px;
    gap: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 12px;
    padding: 10px 15px 12px;
    margin-bottom: 20px;
}

.danger-warning svg {
    width: 25px;
    height: 25px;
    color: #c2410c;
    flex-shrink: 0;
    margin-bottom: -1px;
}

.danger-warning strong {
    color: #9a3412;
}

.upload-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 999px;
    padding: 11px 20px;
    color: #ffffff;
    background: #0f172a;
    font-size: 14px;
    font-weight: 700;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.upload-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.upload-toast.toast-error {
    background: #dc2626;
}

.upload-toast.toast-success {
    background: #16a34a;
}

.public-profile-page .public-profile-cards {
    padding: 0 25px 25px;
}

.public-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    padding: 18px;
}

.public-card-caption {
    margin-top: 14px !important;
    color: #64748b !important;
    font-size: 13px !important;
}

.profile-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 14px;
    font-weight: 700;
}

.public-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #519168;
}

.public-card p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

@media (max-width: 700px) {
    .profile-page,
    .public-profile-page {
        padding: 18px 8px 60px;
    }

    .profile-identity {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -68px;
        gap: 12px;
        padding: 0 16px 18px;
    }

    .avatar-wrap {
        width: 135px;
        height: 135px;
    }

    .identity-text {
        padding-top: 0;
    }

    .identity-name {
        font-size: 26px;
        white-space: normal;
    }

    .identity-meta {
        justify-content: center;
    }

    .identity-meta-secondary {
        white-space: normal;
    }

    .visibility-row {
        flex-wrap: wrap;
    }

    .settings-grid-two {
        grid-template-columns: 1fr;
    }

    .timezone-preview-row {
        grid-template-columns: 1fr;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }

    .profile-page .personal-primary-grid .age-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    /* DOB Picker on mobile */
    .dob-picker-modal {
        max-width: 100%;
        padding: 20px;
    }

    .dob-picker-inputs {
        grid-template-columns: 0.9fr 1.1fr 1.3fr;
    }

    .dob-input-field {
        font-size: 14px;
        padding: 8px 6px;
    }
}

@media (min-width: 701px) {
    .account-identity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .account-contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .profile-page .personal-primary-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr) minmax(0, 1.5fr);
        gap: 45px;
    }

    .profile-page .personal-primary-grid .dob-row {
        grid-column: auto;
    }
}
