.profile-page {
    width: min(920px, calc(100% - 32px));
    margin: 32px auto 56px;
}

.profile-page__card,
.profile-editor__sheet {
    color: var(--hodl-text);
    background: var(--hodl-surface);
    border: 1px solid var(--hodl-border);
    border-radius: var(--hodl-radius-lg);
    box-shadow: var(--hodl-shadow-lg);
    overflow: hidden;
}

.profile-editor-modal .modal-dialog {
    max-width: 790px;
}

.profile-editor__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(90, 111, 255, .12), rgba(29, 41, 57, 0) 62%);
    border-bottom: 1px solid var(--hodl-border);
}

.profile-editor__header--page {
    grid-template-columns: auto minmax(0, 1fr);
}

.profile-editor__header-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--hodl-accent-text);
    background: var(--hodl-accent-soft);
    border: 1px solid var(--hodl-accent-muted);
    border-radius: var(--hodl-radius-lg);
    font-size: 18px;
}

.profile-editor__header-copy {
    min-width: 0;
}

.profile-editor__eyebrow {
    display: block;
    margin-bottom: 2px;
    color: var(--hodl-text-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

/* w modalu edycji profilu tytuł zostaje własny; na STRONIE ustawień konta rozmiar bierze
   nagłówek strony (.hodl-page-head__title, wariant C) — agent design 2026-09-06 */
.profile-editor__title {
    margin: 0;
    color: var(--hodl-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.hodl-page-head .profile-editor__title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}

.profile-editor__intro {
    margin: 2px 0 0;
    color: var(--hodl-text-2);
    font-size: 13px;
}

.profile-editor__close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--hodl-text-2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--hodl-radius-lg);
    font-size: 18px;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.profile-editor__close:hover,
.profile-editor__close:focus-visible {
    color: var(--hodl-text);
    background: var(--hodl-surface);
    border-color: var(--hodl-border-strong);
    outline: none;
}

.profile-editor__body {
    padding: 24px;
}

.profile-editor__avatar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--hodl-surface-2);
    border: 1px solid var(--hodl-border);
    border-radius: var(--hodl-radius-lg);
}

.profile-editor__avatar-frame {
    position: relative;
    flex: 0 0 auto;
}

.profile-editor__avatar-image {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    background: var(--hodl-surface);
    border: 3px solid var(--hodl-border-strong);
    border-radius: 50%;
}

.profile-editor__avatar-badge {
    position: absolute;
    right: -1px;
    bottom: 1px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--hodl-text-on-accent);
    background: var(--hodl-accent);
    border: 3px solid var(--hodl-border-subtle);
    border-radius: 50%;
    font-size: 12px;
}

.profile-editor__avatar-copy {
    min-width: 0;
}

.profile-editor__avatar-copy h2 {
    margin: 0 0 2px;
    color: var(--hodl-text);
    font-size: 16px;
}

.profile-editor__avatar-copy p {
    margin: 0 0 8px;
    color: var(--hodl-text-3);
    font-size: 12px;
}

.profile-editor__upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    color: var(--hodl-text);
    background: var(--hodl-surface-3);
    border: 1px solid var(--hodl-border-strong);
    border-radius: var(--hodl-radius-md);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.profile-editor__upload:hover {
    background: var(--hodl-surface-3);
}

.profile-editor__file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.profile-editor__file-name {
    display: inline-block;
    max-width: 230px;
    margin-left: 8px;
    overflow: hidden;
    color: var(--hodl-text-3);
    font-size: 11px;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.profile-cropper {
    margin-top: 16px;
    padding: 16px;
    background: var(--hodl-surface);
    border: 1px solid var(--hodl-border-strong);
    border-radius: var(--hodl-radius-lg);
}

.profile-cropper__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.profile-cropper__head strong,
.profile-cropper__head span {
    display: block;
}

.profile-cropper__head strong {
    color: var(--hodl-text);
    font-size: 14px;
}

.profile-cropper__head span {
    margin-top: 2px;
    color: var(--hodl-text-3);
    font-size: 11px;
}

.profile-cropper__workspace {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(180px, 1fr);
    align-items: center;
    gap: 24px;
}

.profile-cropper__canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--hodl-bg);
    border: 1px solid var(--hodl-border-strong);
    border-radius: var(--hodl-radius-lg);
    touch-action: none;
    cursor: grab;
}

.profile-cropper__canvas-wrap:active {
    cursor: grabbing;
}

.profile-cropper__canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.profile-cropper__guide {
    position: absolute;
    inset: 7%;
    border: 2px solid var(--hodl-border-subtle);
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(5, 10, 18, .38);
    pointer-events: none;
}

.profile-cropper__controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--hodl-text);
    font-size: 12px;
    font-weight: 700;
}

.profile-cropper__controls input[type="range"] {
    width: 100%;
    accent-color: #6f80ff;
}

.profile-cropper__actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.profile-editor__identity-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 16px;
    color: var(--hodl-text-3);
    font-size: 12px;
}

.profile-editor__handle {
    flex: 0 0 auto;
    padding: 4px 8px;
    color: var(--hodl-text);
    background: var(--hodl-accent-soft);
    border: 1px solid var(--hodl-accent-muted);
    border-radius: var(--hodl-radius-pill);
    font-weight: 700;
}

.profile-editor__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.profile-editor__field {
    min-width: 0;
}

.profile-editor__field--wide {
    grid-column: 1 / -1;
}

.profile-editor__field > label,
.profile-editor__label-row label {
    display: block;
    margin: 0 0 6px;
    color: var(--hodl-text);
    font-size: 12px;
    font-weight: 700;
}

.profile-editor__label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-editor__label-row > span {
    color: var(--hodl-text-3);
    font-size: 11px;
}

.profile-editor__control-wrap {
    position: relative;
}

.profile-editor__control-wrap > i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--hodl-text-3);
    font-size: 14px;
    transform: translateY(-50%);
    pointer-events: none;
}

.profile-editor__control-wrap .profile-editor__control {
    padding-left: 36px;
}

.profile-editor__control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    color: var(--hodl-text);
    background: var(--hodl-surface);
    border: 1px solid var(--hodl-border);
    border-radius: var(--hodl-radius-lg);
    font-size: 13px;
    line-height: 1.35;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.profile-editor__control::placeholder {
    color: var(--hodl-text-3);
}

.profile-editor__control:hover {
    border-color: var(--hodl-border-strong);
}

.profile-editor__control:focus {
    background: var(--hodl-surface-2);
    border-color: var(--hodl-accent);
    box-shadow: 0 0 0 3px rgba(91, 111, 255, .13);
}

.profile-editor__control--textarea {
    min-height: 82px;
    resize: vertical;
}

.profile-editor__hint {
    margin: 6px 0 0;
    color: var(--hodl-text-3);
    font-size: 11px;
}

.profile-editor__error {
    display: block;
    margin-top: 4px;
    color: var(--hodl-down-text);
    font-size: 11px;
}

.profile-editor__privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 12px;
    color: var(--hodl-text-3);
    background: rgba(118, 139, 168, .06);
    border-radius: var(--hodl-radius-md);
    font-size: .69rem;
    line-height: 1.45;
}

.profile-editor__privacy i {
    margin-top: 1px;
    color: var(--hodl-accent-text);
}

.profile-editor__form-error {
    margin: 0 24px 16px;
    padding: 8px 12px;
    color: var(--hodl-down-text);
    background: var(--hodl-down-soft);
    border: 1px solid var(--hodl-down);
    border-radius: var(--hodl-radius-md);
    font-size: .75rem;
}

.profile-editor__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    background: var(--hodl-surface-2);
    border-top: 1px solid var(--hodl-border);
}

.profile-editor__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    color: var(--hodl-text-3);
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
}

.profile-editor__footer-link:hover {
    color: var(--hodl-text);
}

.account-settings__notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 12px;
    color: var(--hodl-text-2);
    background: var(--hodl-accent-soft);
    border: 1px solid var(--hodl-accent-muted);
    border-radius: var(--hodl-radius-lg);
    font-size: 12px;
}

.account-settings__notice > i {
    color: var(--hodl-accent-text);
    font-size: 18px;
}

.account-settings__notice strong,
.account-settings__notice span {
    display: block;
}

.account-settings__notice strong {
    margin-bottom: 2px;
    color: var(--hodl-text);
}

.account-settings__password-field {
    max-width: 360px;
}

.account-settings__divider {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
    padding-top: 16px;
    border-top: 1px solid var(--hodl-border);
}

.account-settings__divider span {
    color: var(--hodl-text);
    font-size: 13px;
    font-weight: 700;
}

.account-settings__divider small {
    color: var(--hodl-text-3);
    font-size: 11px;
}

.account-settings__password-wrap .profile-editor__control {
    padding-right: 42px;
}

.account-settings__password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--hodl-text-3);
    background: transparent;
    border: 0;
    border-radius: var(--hodl-radius-md);
    transform: translateY(-50%);
}

.account-settings__password-toggle:hover {
    color: var(--hodl-text);
    background: var(--hodl-surface);
}

.profile-editor__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--hodl-radius-md);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.profile-editor__button:hover {
    transform: translateY(-1px);
}

.profile-editor__button--ghost {
    color: var(--hodl-text-2);
    background: transparent;
    border-color: var(--hodl-border);
}

.profile-editor__button--ghost:hover {
    color: var(--hodl-text);
    background: var(--hodl-surface);
}

.profile-editor__button--primary {
    color: var(--hodl-text-on-accent);
    background: var(--hodl-accent);
    border-color: var(--hodl-accent);
    box-shadow: 0 8px 22px rgba(72, 90, 230, .22);
}

.profile-editor__button--primary:hover {
    color: var(--hodl-text-on-accent);
    background: var(--hodl-accent);
}

.profile-editor__button:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

@media (max-width: 640px) {
    .profile-page {
        width: min(100% - 20px, 920px);
        margin-top: 12px;
    }

    .profile-editor-modal .modal-dialog {
        margin: 8px;
    }

    .profile-editor__header,
    .profile-editor__body,
    .profile-editor__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .profile-editor__avatar {
        align-items: flex-start;
    }

    .profile-editor__avatar-image {
        width: 70px;
        height: 70px;
    }

    .profile-editor__file-name {
        display: block;
        margin: 6px 0 0;
    }

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

    .profile-editor__field--wide {
        grid-column: auto;
    }

    .profile-editor__identity-note {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

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

    .profile-cropper__canvas-wrap {
        max-width: 320px;
        margin: 0 auto;
    }

    .profile-editor__footer {
        flex-wrap: wrap;
    }

    .profile-editor__footer-link {
        flex-basis: 100%;
        margin-bottom: 4px;
    }
}
