.profile-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
}

.profile-page {
    flex: 1 0 auto;
}

.profile-header-nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.profile-header-nav__item {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-header-nav__item + .profile-header-nav__item::before {
    content: "";
    position: absolute;
    left: -17px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.58);
    transform: translate(-50%, -50%);
}

.profile-header-nav__dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-header-nav__link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted-color);
    transition: color 0.2s ease;
}

.profile-header-nav__link:hover {
    color: var(--text-color);
    text-shadow: 0 0 4px rgba(30, 58, 138, 0.26);
}

.profile-header-nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    display: none;
    min-width: 240px;
    max-width: 320px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #d8dce4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
}

.profile-header-nav__dropdown:hover .profile-header-nav__menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-header-nav__menu-link {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.96rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.profile-header-nav__menu-link:hover {
    background: rgba(30, 58, 138, 0.08);
    color: var(--primary-color);
}

.profile-header-nav__link--active {
    color: var(--text-color);
    font-weight: 700;
}

.profile-header-nav__form {
    margin: 0;
}

.profile-header-nav__logout {
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.profile-header-nav__auth-btn {
    min-width: 104px;
    height: 48px;
    padding: 0 20px;
    font-size: 0.95rem;
    border-radius: 12px;
}

.profile-main {
    padding: 56px 0 72px;
}

.profile-container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 32px;
}

.profile-page-header {
    margin-bottom: 26px;
}

.profile-page-header--spacious {
    margin-top: 40px;
}

.profile-main [x-cloak] {
    display: none !important;
}

.profile-title-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.profile-title {
    margin: 0;
    font-size: 3rem;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.profile-title-toggle__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--muted-color);
    transition: transform 0.2s ease, color 0.2s ease;
}

.profile-title-toggle:hover .profile-title-toggle__icon,
.profile-title-toggle:focus-visible .profile-title-toggle__icon {
    color: var(--primary-color);
}

.profile-title-toggle__icon--open {
    transform: rotate(180deg);
}

.profile-card {
    margin-bottom: 20px;
    border: 1px solid #d8dce4;
    border-radius: 16px;
    background: var(--bg-color);
    padding: 28px;
}

.profile-statistics-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
}

.profile-card--danger {
    margin-bottom: 0;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-section__header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-section__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-color);
}

.profile-section__description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--muted-color);
}

.profile-statistics-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: #fff;
}

.profile-statistics-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-statistics-table th,
.profile-statistics-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    text-align: left;
    vertical-align: middle;
}

.profile-statistics-table tr:last-child th,
.profile-statistics-table tr:last-child td {
    border-bottom: 0;
}

.profile-statistics-table th {
    width: 48%;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-color);
    background: rgba(248, 250, 252, 0.8);
}

.profile-statistics-table td {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-label {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-color);
}

.profile-input {
    width: 100%;
    height: 56px;
    border-radius: 14px;
    border: 1px solid #c8ced9;
    background: #f8fafc;
    padding: 0 18px;
    font-size: 1.02rem;
    color: var(--text-color);
}

.profile-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.profile-input-prefix-wrap {
    position: relative;
}

.profile-input-prefix {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-color);
    font-size: 1.02rem;
    font-weight: 700;
    pointer-events: none;
}

.profile-input--with-prefix {
    padding-left: 40px;
}

.profile-error {
    margin-top: 2px;
    font-size: 0.88rem;
    color: #b91c1c;
}

.profile-inline-status {
    margin-top: 4px;
    font-size: 0.95rem;
    color: var(--muted-color);
}

.profile-telegram-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.profile-telegram-status__state,
.profile-telegram-status__hint {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--muted-color);
}

.profile-telegram-status__label {
    font-weight: 700;
    color: var(--text-color);
}

.profile-telegram-status__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    margin-left: 8px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
}

.profile-telegram-status__badge--success {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.profile-telegram-status__badge--muted {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.profile-inline-link {
    border: 0;
    background: none;
    padding: 0;
    margin-left: 6px;
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.profile-success {
    margin-top: 8px;
    color: #0f766e;
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-actions {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-submit-btn {
    height: 56px;
    min-width: 176px;
    border-radius: 14px;
    font-size: 1rem;
}

.profile-muted-status {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted-color);
}

.profile-delete-trigger {
    height: 52px;
    min-width: 176px;
    border: 1px solid #ef4444;
    border-radius: 14px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
}

.profile-delete-trigger:hover {
    background: #fecaca;
}

.profile-modal-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-modal-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.3;
    color: var(--text-color);
}

.profile-modal-text {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.95rem;
    line-height: 1.45;
}

.profile-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.profile-modal-cancel-btn {
    min-width: 156px;
}

.profile-danger-btn {
    min-width: 142px;
    height: 48px;
    border: 1px solid #dc2626;
    border-radius: 12px;
    background: #dc2626;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.profile-danger-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 992px) {
    .profile-container {
        padding: 0 24px;
    }

    .profile-title {
        font-size: 2.3rem;
    }

    .profile-title-toggle {
        gap: 14px;
    }

    .profile-card {
        padding: 22px;
    }

    .profile-statistics-table th,
    .profile-statistics-table td {
        padding: 16px 18px;
    }

    .profile-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-submit-btn {
        width: 100%;
    }

    .profile-delete-trigger {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .profile-header-nav {
        width: 100%;
        justify-content: center;
        gap: 20px;
    }

    .profile-header-nav__link,
    .profile-inline-link {
        min-height: 44px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        border-radius: 10px;
    }

    .profile-header-nav__menu {
        left: 50%;
        transform: translateX(-50%);
        min-width: 220px;
        max-width: min(280px, calc(100vw - 32px));
    }

    .profile-header-nav__auth-btn {
        min-width: 96px;
        height: 52px;
        padding: 0 18px;
    }

    .profile-main {
        padding: 38px 0 56px;
    }

    .profile-page {
        padding-bottom: 20px;
    }

    .profile-container {
        padding: 0 20px;
    }

    .profile-page-header {
        margin-bottom: 20px;
    }

    .profile-page-header--spacious {
        margin-top: 28px;
    }

    .profile-title {
        font-size: 2rem;
        line-height: 1.08;
    }

    .profile-title-toggle__icon {
        width: 22px;
        height: 22px;
    }

    .profile-section__title {
        font-size: 1.65rem;
    }

    .profile-card {
        padding: 18px;
    }

    .profile-statistics-table th,
    .profile-statistics-table td {
        display: block;
        width: 100%;
    }

    .profile-statistics-table th {
        padding-bottom: 6px;
        border-bottom: 0;
        background: rgba(248, 250, 252, 0.92);
    }

    .profile-statistics-table td {
        padding-top: 0;
        padding-bottom: 18px;
    }

    .profile-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-modal-cancel-btn,
    .profile-danger-btn {
        width: 100%;
    }
}
