.app-profile-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 64rem) {
    .app-profile-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    }
}

.app-profile-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cs-text);
}

.app-profile-referral {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cs-border);
}

.app-profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-profile-avatar-wrap {
    position: relative;
    width: 4rem;
    height: 4rem;
    border-radius: 999px;
    border: 1px solid var(--cs-border);
    background: var(--cs-surface-elevated);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex-shrink: 0;
}

.app-profile-avatar-media {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-profile-avatar-fallback {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cs-text);
}

.app-profile-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-profile-avatar-upload {
    position: absolute;
    right: -0.35rem;
    bottom: -0.35rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: var(--cs-btn-primary-bg);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
}

.app-profile-avatar-upload:hover {
    background: var(--cs-btn-primary-hover);
}

.app-profile-image-help {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
}

.app-profile-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.app-profile-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.app-profile-status-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
}

.app-profile-status-pill.is-verified {
    color: #0f766e;
    background: color-mix(in srgb, #14b8a6 18%, transparent);
}

.app-profile-status-pill.is-verified .app-profile-status-dot {
    background: #0d9488;
}

.app-profile-status-pill.is-pending {
    color: #a16207;
    background: color-mix(in srgb, #eab308 20%, transparent);
}

.app-profile-status-pill.is-pending .app-profile-status-dot {
    background: #ca8a04;
}

.app-profile-status-pill.is-public {
    color: #0369a1;
    background: color-mix(in srgb, #0ea5e9 20%, transparent);
}

.app-profile-status-pill.is-public .app-profile-status-dot {
    background: #0284c7;
}

.app-profile-status-pill.is-private {
    color: var(--cs-text-muted);
    background: color-mix(in srgb, var(--cs-text-muted) 18%, transparent);
}

.app-profile-status-pill.is-private .app-profile-status-dot {
    background: var(--cs-text-muted);
}

.app-profile-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.app-profile-inline-action {
    border-radius: 0.5rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.app-profile-inline-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.app-profile-btn-fixed {
    width: 8.75rem;
    justify-content: center;
    text-align: center;
}

.app-profile-btn-max {
    max-width: 13rem;
    width: 100%;
    justify-content: center;
}

.app-profile-inline-status {
    margin-top: 0.45rem;
    margin-bottom: 0;
    line-height: 1;
}

.app-profile-form-hint {
    text-align: left;
}

.app-profile-password-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.app-profile-password-hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
}

.app-profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.app-profile-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.app-profile-card-span-2 {
    grid-column: 1 / -1;
}

.app-profile-cards-grid > .app-auth-card {
    height: 100%;
}

.app-profile-form-span-2 {
    grid-column: 1 / -1;
}

.app-profile-cep-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.app-profile-cep-btn {
    min-width: 7.5rem;
}

.app-profile-readonly-text {
    margin: 0;
    min-height: 2.625rem;
    border: 1px solid var(--cs-border);
    border-radius: 0.75rem;
    background: var(--cs-surface-elevated);
    padding: 0.65rem 0.8rem;
    font-size: 0.875rem;
    color: var(--cs-text);
    display: flex;
    align-items: center;
}

.app-profile-soon-box {
    border: 1px dashed color-mix(in srgb, var(--cs-text-muted) 35%, transparent);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: color-mix(in srgb, var(--cs-surface-elevated) 70%, transparent);
}

.app-profile-soon-title {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--cs-text);
}

.app-profile-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.app-profile-address-row {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.6fr);
}

@media (max-width: 52rem) {
    .app-profile-cards-grid,
    .app-profile-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-profile-card-span-2,
    .app-profile-form-span-2 {
        grid-column: auto;
    }

    .app-profile-two-col,
    .app-profile-address-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Form principal participa do grid ao lado do card de indicação (sem form aninhado) */
.app-profile-main-form-as-contents {
    display: contents;
}

.app-profile-indicacao-destaque {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--cs-brand, #2563eb) 35%, var(--cs-border));
    background: color-mix(in srgb, var(--cs-brand, #2563eb) 10%, var(--cs-surface-soft));
}

.app-profile-indicacao-destaque__line {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--cs-text);
}

.app-profile-indicacao-destaque__line + .app-profile-indicacao-destaque__line {
    margin-top: 0.45rem;
}

.app-profile-referral-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.app-profile-referral-list__item {
    border: 1px solid var(--cs-border);
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: var(--cs-surface-elevated);
}

.app-profile-referral-list__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.app-profile-referral-list__url {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.app-profile-referral-list__code {
    flex: 1 1 12rem;
    font-size: 0.72rem;
    word-break: break-all;
    margin: 0;
    color: var(--cs-text-muted);
}

/* Plano atual: texto em destaque, sem aparência de campo de formulário */
.app-profile-plan-resumo {
    margin-top: 0.65rem;
}

.app-profile-plan-resumo__lead {
    margin: 0 0 0.4rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--cs-text-muted);
}

.app-profile-plan-resumo__nome {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: var(--cs-text);
}

.app-profile-plan-upgrade-btn {
    margin-top: 1.35rem;
}

.app-profile-card-divider {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--cs-border);
}

.app-profile-card-divider--before-contato {
    margin-top: 1.75rem;
    margin-bottom: 1.35rem;
}

.app-profile-section-title--pos-divider {
    margin-top: 0;
    margin-bottom: 0.5rem;
}
