.lk-profile {
    padding-bottom: 16px;
}

.lk-profile-section-label {
    color: var(--lk-muted);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.lk-profile-card,
.lk-method-row {
    border: 1px solid var(--lk-line);
    border-radius: var(--lk-radius);
    background: var(--lk-soft);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

:root[data-theme="dark"] .lk-profile-card,
:root[data-theme="dark"] .lk-method-row {
    border-color: rgba(255, 255, 255, .07);
    background: #1a1a1a;
    box-shadow: none;
}

.lk-profile-card {
    margin-top: 10px;
    padding: 16px 18px;
}

.lk-profile-person {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lk-profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--lk-accent);
    color: var(--lk-accent-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.lk-profile-person__main {
    min-width: 0;
}

.lk-profile-person__name {
    color: var(--lk-text);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.lk-profile-person__meta {
    margin-top: 2px;
    color: var(--lk-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.lk-profile-edit-action {
    margin-left: auto;
    min-height: 38px;
    border-radius: 12px;
    padding: 0 15px;
    font-size: 14px;
    white-space: nowrap;
}

.lk-profile-card__divider {
    height: 1px;
    margin: 14px 0;
    background: var(--lk-line);
}

:root[data-theme="dark"] .lk-profile-card__divider {
    background: rgba(255, 255, 255, .08);
}

.lk-profile-facts {
    display: flex;
    gap: 42px;
    flex-wrap: wrap;
}

.lk-profile-fact__label {
    color: var(--lk-muted);
    font-size: 13px;
    font-weight: 700;
}

.lk-profile-fact__value {
    margin-top: 5px;
    color: var(--lk-text);
    font-size: 16px;
    font-weight: 900;
}

.lk-profile-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.lk-profile-form[hidden] {
    display: none;
}

.lk-profile-form .lk-form-message {
    grid-column: 1 / -1;
    margin: 0;
}

.lk-profile-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.lk-profile-field__label {
    color: var(--lk-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.lk-profile-field__input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--lk-line-strong);
    border-radius: 12px;
    background: var(--lk-soft-2);
    color: var(--lk-text);
    padding: 0 13px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.lk-profile-field__input:focus {
    border-color: var(--lk-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 238, 0, .18);
}

.lk-profile-form__actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.lk-profile-form__actions .lk-action {
    min-height: 40px;
    border-radius: 12px;
}

.lk-security-strip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    border: 1px solid #f4d677;
    border-radius: 14px;
    background: #fff7de;
    color: #6b5a1e;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.lk-security-strip strong {
    color: #111111;
    font-weight: 900;
}

:root[data-theme="dark"] .lk-security-strip {
    border-color: rgba(255, 196, 0, .28);
    background: rgba(255, 196, 0, .10);
    color: #d9d3c2;
}

:root[data-theme="dark"] .lk-security-strip strong {
    color: #ffffff;
}

.lk-security-strip__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffc400;
    color: #111111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.lk-profile-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 10px 2px;
}

.lk-profile-section-note {
    color: var(--lk-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: right;
}

.lk-profile-methods {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.lk-profile-loading {
    border: 1px dashed var(--lk-line-strong);
    border-radius: var(--lk-radius);
    color: var(--lk-muted);
    padding: 18px;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.lk-method-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 11px 16px;
}

.lk-method-row--warning {
    border-color: #f0d58a;
}

:root[data-theme="dark"] .lk-method-row--warning {
    border-color: rgba(255, 196, 0, .35);
}

.lk-method-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.lk-method-icon--phone {
    background: #2ba84a;
}

.lk-method-icon--email {
    background: #2d7ff9;
}

.lk-method-icon--telegram {
    background: #2aabee;
}

.lk-method-main {
    min-width: 0;
}

.lk-method-title {
    color: var(--lk-text);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
}

.lk-method-value {
    margin-top: 2px;
    color: var(--lk-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.lk-method-hint {
    margin-top: 5px;
    color: #b42318;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

:root[data-theme="dark"] .lk-method-hint {
    color: #ff8a80;
}

.lk-method-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.lk-badge {
    min-height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: #efedef;
    color: #6c6c71;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

:root[data-theme="dark"] .lk-badge {
    background: rgba(255, 255, 255, .07);
    color: #cfcfcf;
}

.lk-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: none;
}

.lk-badge--ok {
    background: #e6f6ec;
    color: #1f9d55;
}

:root[data-theme="dark"] .lk-badge--ok {
    background: rgba(63, 191, 106, .16);
    color: #5fd389;
}

.lk-badge--ok::before,
.lk-badge--warn::before,
.lk-badge--danger::before,
.lk-badge--muted::before {
    display: block;
}

.lk-badge--warn {
    background: #fff4d6;
    color: #9a6b00;
}

:root[data-theme="dark"] .lk-badge--warn {
    background: rgba(255, 196, 0, .16);
    color: #ffce3a;
}

.lk-badge--danger {
    background: #fff0ee;
    color: #c6281d;
}

:root[data-theme="dark"] .lk-badge--danger {
    background: rgba(255, 92, 79, .16);
    color: #ff8a80;
}

.lk-badge--muted {
    background: #efedef;
    color: #8a8790;
}

:root[data-theme="dark"] .lk-badge--muted {
    background: rgba(255, 255, 255, .07);
    color: #8a8a8a;
}

.lk-method-action {
    min-height: 38px;
    border-radius: 11px;
    padding: 0 15px;
    font-size: 14px;
    white-space: nowrap;
}

.lk-action--outline-danger {
    border-color: #f0c4c0;
    background: transparent;
    color: #d6453c;
}

.lk-action--outline-danger:hover {
    border-color: #ff7a7a;
    color: #d6453c;
    background: rgba(255, 98, 98, .04);
}

:root[data-theme="dark"] .lk-action--outline-danger {
    border-color: rgba(255, 107, 107, .35);
    color: #ff7a7a;
}

.lk-profile-modal-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.lk-profile-modal-icon--email {
    background: #2d7ff9;
    color: #ffffff;
}

.lk-profile-modal-icon--phone {
    background: #2ba84a;
    color: #ffffff;
}

.lk-profile-modal-icon--telegram {
    background: #2aabee;
    color: #ffffff;
}

.lk-profile-modal-icon--warn {
    border-radius: 50%;
    border: 1.5px solid #e0a400;
    background: #fff4d6;
    color: #9a6b00;
}

.lk-code-fields {
    display: grid;
    grid-template-columns: repeat(var(--code-length, 4), minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.lk-code-input {
    width: 100%;
    height: 58px;
    border: 1px solid var(--lk-line-strong);
    border-radius: 12px;
    background: var(--lk-soft-2);
    color: var(--lk-text);
    text-align: center;
    font-size: 26px;
    font-weight: 900;
}

.lk-code-input:focus {
    border-color: var(--lk-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 238, 0, .18);
}

.lk-modal__actions .lk-action--danger {
    grid-column: auto;
}

@media (max-width: 780px) {
    .lk-method-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .lk-method-controls {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 56px;
    }
}

@media (max-width: 640px) {
    .lk-profile-card {
        padding: 16px;
    }

    .lk-profile-person {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .lk-profile-edit-action {
        margin-left: 64px;
    }

    .lk-profile-facts {
        display: grid;
        gap: 14px;
    }

    .lk-profile-form {
        grid-template-columns: 1fr;
    }

    .lk-profile-section-head {
        display: grid;
        gap: 8px;
    }

    .lk-profile-section-note {
        text-align: left;
    }

    .lk-method-row {
        padding: 12px;
        gap: 12px;
    }

    .lk-method-controls {
        padding-left: 54px;
    }

    .lk-method-action {
        width: auto;
    }
}

@media (max-width: 430px) {
    .lk-profile-edit-action {
        width: 100%;
        margin-left: 0;
    }

    .lk-method-row {
        grid-template-columns: 1fr;
    }

    .lk-method-icon {
        width: 42px;
        height: 42px;
    }

    .lk-method-controls {
        padding-left: 0;
    }

    .lk-code-fields {
        gap: 7px;
    }

    .lk-code-input {
        height: 50px;
        font-size: 22px;
    }
}

/* Fixed to the viewport (not the document), so it always appears where the user is
   currently looking regardless of scroll position — no need to jump to a top banner.
   `bottom` is padded past env(safe-area-inset-bottom): mobile browsers reserve a bottom
   toolbar strip that a plain `bottom: 16px` can end up sitting behind/under, which reads
   as "the toast just doesn't show up" even though it's technically in the DOM. Tappable
   to dismiss — see profile.js. */
.lk-toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
    z-index: 1000;
    max-width: min(90vw, 420px);
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transform: translate(-50%, 12px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.lk-toast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.lk-toast.err {
    background: var(--lk-danger);
}

.lk-toast.ok {
    background: #2fb86f;
}

@media (max-width: 430px) {
    .lk-toast {
        left: 16px;
        right: 16px;
        bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
        max-width: none;
        transform: translateY(12px);
    }

    .lk-toast.show {
        transform: translateY(0);
    }
}
