.ta-profile-edit {
    --ta-pe-bg: #f9f9fb;
    --ta-pe-surface: #fff;
    --ta-pe-input: #f0f0f5;
    --ta-pe-primary: #000;
    --ta-pe-text: #1d1d1f;
    --ta-pe-muted: #86868b;
    --ta-pe-accent: #ff2d55;
    min-height: 100%;
    background: var(--ta-pe-bg);
    color: var(--ta-pe-text);
    display: flex;
    flex-direction: column;
    position: relative;
}

html[data-lp-color-scheme="dark"] .ta-profile-edit {
    --ta-pe-bg: #0a0a0a;
    --ta-pe-surface: #161616;
    --ta-pe-input: #222;
    --ta-pe-primary: #fff;
    --ta-pe-text: #f5f5f7;
    --ta-pe-muted: rgba(255, 255, 255, 0.55);
}

.ta-profile-edit__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--ta-pe-bg) 88%, transparent);
    backdrop-filter: blur(12px);
}

.ta-profile-edit__title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.ta-profile-edit__spacer {
    width: 40px;
}

.ta-profile-edit__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ta-pe-input);
    color: var(--ta-pe-text);
    text-decoration: none;
}

.ta-profile-edit__content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 120px;
}

.ta-profile-edit__avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 8px 0 24px;
}

.ta-profile-edit__avatar-wrap {
    position: relative;
    width: 112px;
    height: 112px;
}

.ta-profile-edit__avatar,
.ta-profile-edit__avatar-fallback {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
}

.ta-profile-edit__avatar-fallback {
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(145deg, #ff6b62, #ff3b30);
    color: #fff;
}

.ta-profile-edit__avatar-pencil {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--ta-pe-primary);
    color: var(--ta-pe-bg);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.ta-profile-edit__avatar-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--ta-pe-muted);
    font-weight: 600;
}

.ta-profile-edit__section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 8px;
    letter-spacing: -0.03em;
}

.ta-profile-edit__section-lead {
    font-size: 14px;
    color: var(--ta-pe-muted);
    margin: 0 0 16px;
    font-weight: 500;
}

.ta-profile-edit__field {
    margin-bottom: 18px;
    position: relative;
}

.ta-profile-edit__field label,
.ta-profile-edit__field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ta-pe-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ta-profile-edit__input-prefix-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.ta-profile-edit__input-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 10px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
    font-size: 0.95rem;
}

.ta-profile-edit__input--prefixed {
    border-radius: 0 10px 10px 0;
    flex: 1 1 auto;
    min-width: 0;
}

.ta-profile-edit__input,
.ta-profile-edit__textarea {
    width: 100%;
    padding: 16px;
    background: var(--ta-pe-surface);
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ta-pe-text);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.ta-profile-edit__input:focus,
.ta-profile-edit__textarea:focus {
    outline: none;
    border-color: var(--ta-pe-primary);
}

.ta-profile-edit__input[readonly] {
    opacity: 0.65;
}

.ta-profile-edit__textarea {
    resize: none;
    min-height: 100px;
    line-height: 1.45;
}

.ta-profile-edit__char-count {
    position: absolute;
    right: 14px;
    bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ta-pe-muted);
}

.ta-profile-edit__char-count.is-limit {
    color: var(--ta-pe-accent);
}

.ta-profile-edit__hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ta-pe-muted);
}

.ta-profile-edit__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.ta-profile-edit__chip {
    padding: 11px 16px;
    background: var(--ta-pe-surface);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    user-select: none;
}

.ta-profile-edit__chip input {
    display: none;
}

.ta-profile-edit__chip:has(input:checked) {
    background: var(--ta-pe-primary);
    color: var(--ta-pe-bg);
}

.ta-profile-edit__divider {
    height: 1px;
    margin: 32px 0;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent);
}

html[data-lp-color-scheme="dark"] .ta-profile-edit__divider {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.ta-profile-edit__fab-wrap {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--ta-pe-bg) 65%, transparent);
    z-index: 30;
}

.ta-profile-edit__fab {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 999px;
    background: var(--ta-pe-primary);
    color: var(--ta-pe-bg);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(120px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1), opacity 0.2s ease, background 0.2s ease;
    opacity: 0.45;
    pointer-events: none;
}

.ta-profile-edit__fab.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ta-profile-edit__fab.is-success {
    background: #34c759;
    color: #fff;
}

.ta-profile-edit__fab:disabled:not(.is-visible) {
    opacity: 0;
}

.ta-social-profile__avatar-wrap {
    position: relative;
}

.ta-social-profile__avatar-edit {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    display: grid;
    place-items: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

html:not([data-lp-color-scheme="dark"]) .ta-social-profile__avatar-edit {
    background: #0f172a;
}
