.profile-view {
    display: grid;
    gap: 16px;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.profile-view__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.profile-view__header h1 {
    margin: 2px 0 4px;
    color: var(--shell-text);
    font-size: 1.5rem;
}

.profile-view__header p {
    margin: 0;
    color: var(--shell-text-soft);
}

.profile-hero {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

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

.profile-hero__identity h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--shell-text);
    font-size: 1.28rem;
}

.profile-hero__identity p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: var(--shell-text-soft);
}

.profile-hero__bio {
    max-width: 68ch;
    color: var(--shell-text) !important;
}

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

.profile-grid .profile-card:last-child {
    grid-column: 1 / -1;
}

.profile-card,
.profile-form,
.profile-card__header {
    display: grid;
    gap: 14px;
}

.profile-card__header h2 {
    margin: 0;
    color: var(--shell-text);
    font-size: 1rem;
}

.profile-card__header p {
    margin: 3px 0 0;
    color: var(--shell-text-soft);
    font-size: 0.88rem;
}

.profile-field {
    display: grid;
    gap: 7px;
}

.profile-field span {
    color: var(--shell-text-soft);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-field input,
.profile-field textarea {
    width: 100%;
    border: 1px solid var(--shell-line-strong);
    border-radius: var(--shell-radius-sm);
    background: var(--shell-control);
    color: var(--shell-text);
    font: inherit;
}

.profile-field input {
    min-height: 40px;
    padding: 8px 10px;
}

.profile-field textarea {
    min-height: 108px;
    resize: vertical;
    padding: 10px;
}

.profile-field input[readonly] {
    color: var(--shell-text-soft);
    background: color-mix(in srgb, var(--shell-control) 76%, transparent);
}

.profile-avatar-editor {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.profile-avatar,
.app-shell-user-menu__avatar {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--shell-line-strong);
    border-radius: 50%;
    background: color-mix(in srgb, var(--shell-accent-soft) 70%, var(--shell-panel) 30%);
    color: var(--shell-text);
    font-weight: 800;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.05rem;
}

.profile-avatar--large {
    width: 92px;
    height: 92px;
    font-size: 1.35rem;
}

.profile-avatar img,
.app-shell-user-menu__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-editor__actions {
    display: grid;
    justify-items: start;
    gap: 7px;
}

.profile-avatar-editor__actions p,
.profile-status {
    margin: 0;
    color: var(--shell-text-soft);
    font-size: 0.82rem;
}

.profile-status.is-error {
    color: var(--shell-danger);
}

.profile-card__actions {
    display: flex;
    justify-content: flex-end;
}

.profile-notice {
    padding: 10px 12px;
    border: 1px solid var(--shell-line);
    border-radius: var(--shell-radius-sm);
    background: var(--shell-panel);
    color: var(--shell-text);
}

.profile-notice.is-success {
    border-color: color-mix(in srgb, var(--shell-success) 44%, var(--shell-line));
    background: color-mix(in srgb, var(--shell-success) 12%, var(--shell-panel));
}

.profile-notice.is-error {
    border-color: color-mix(in srgb, var(--shell-danger) 48%, var(--shell-line));
    background: color-mix(in srgb, var(--shell-danger) 12%, var(--shell-panel));
}

@media (max-width: 880px) {
    .profile-grid,
    .profile-hero,
    .profile-avatar-editor {
        grid-template-columns: 1fr;
    }
}
