/* Meu Pet Social uses the normal platform page and its navigation. */
#tab-meuPetSocial {
    width: min(880px, 100%);
    min-width: 0;
    margin-inline: auto;
    padding: 16px 0 28px;
}
#tab-meuPetSocial .amlealt-social-page-header {
    padding: 4px 0 10px;
}
#tab-meuPetSocial .amlealt-social-page-header h2 {
    margin: 0;
    color: var(--text-primary, #172033);
    font-size: clamp(1.25rem, 2.8vw, 1.7rem);
    line-height: 1.2;
    letter-spacing: -.02em;
}
#tab-meuPetSocial .amlealt-social-page-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}
#tab-meuPetSocial .amlealt-social-page-nav button {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 0;
    padding: 7px 2px;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-secondary, #475569);
    font: inherit;
    font-size: .8rem;
    font-weight: 650;
}
#tab-meuPetSocial .amlealt-social-page-nav button[aria-pressed="true"] {
    color: var(--secondary) !important;
    box-shadow: inset 0 -2px var(--secondary) !important;
}
#tab-meuPetSocial .amlealt-social-page-nav button:focus-visible { outline: 2px solid var(--secondary); outline-offset: -2px; }
#tab-meuPetSocial .amlealt-social-page-nav svg { width: 20px; height: 20px; flex: none; stroke: currentColor; }
#tab-meuPetSocial .minha-social-view { min-height: 0; padding-block: 1rem 0; }
#tab-meuPetSocial .minha-post-composer { box-shadow: none; }
#tab-meuPetSocial .minha-social-feed,
#minhaProfilePostsList { background: transparent !important; gap: 0; }
:is(#minhaSocialFeed, #minhaProfilePostsList) > .minha-social-post {
    min-width: 0;
    padding: 18px 0;
    border: 0;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
}
:is(#minhaSocialFeed, #minhaProfilePostsList) > .minha-social-post:last-child { border-bottom-color: transparent; }
:is(#minhaSocialFeed, #minhaProfilePostsList) .minha-post-body { overflow-wrap: anywhere; }
@media (max-width: 540px) {
    #tab-meuPetSocial { padding-top: 12px; }
    #tab-meuPetSocial .amlealt-social-page-nav button { flex-direction: column; gap: 3px; font-size: .68rem; }
}

/* The profile layout uses the shared feed, avoiding legacy placeholder paragraph styling. */
.amlealt-profile-posts-section {
    width: min(880px, 100%);
    margin-inline: auto;
    display: grid;
    gap: .85rem;
    padding-bottom: 2rem;
}
.amlealt-profile-posts-section[hidden] { display: none !important; }
.amlealt-profile-posts-section > h3 {
    color: var(--text-primary, var(--gray-900));
    font-size: 1.18rem;
    font-weight: 800;
    text-align: left;
}
.minha-panel:not(.minha-hide-social-nav) .amlealt-profile-posts-section {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
/* Legacy Profile/League handoffs keep their own dock; let it remain viewport-fixed in dark modes. */
body.app-theme-dark #minhaAmlealtOverlay .minha-panel:has(.amlealt-profile-posts-section:not([hidden])) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Use the same dark-theme text tokens inside and outside the former dialog. */
body.app-theme-dark :is(#minhaSocialFeed, #minhaProfilePostsList)
:is(.minha-post-author, .minha-post-body, .minha-post-actions, .minha-comment-author, .minha-comment-text) {
    color: var(--text-primary, #f8fafc) !important;
}
body.app-theme-dark :is(#minhaSocialFeed, #minhaProfilePostsList)
:is(.minha-post-username, .minha-post-date, .minha-comment-username, .minha-comment-date) {
    color: var(--text-secondary, #cbd5e1) !important;
}
/* Dark Perfil Social: let the pet's blue hero/header stand against a true-black canvas. */
body.app-theme-dark #minhaAmlealtOverlay:not([data-social-profile-pending]) > .minha-panel.minha-profile-mode:not(:has(#minhaProfileView[aria-busy="true"])),
body.app-theme-dark #minhaAmlealtOverlay:not([data-social-profile-pending]):has(> .minha-panel.minha-profile-mode #minhaProfileView:not([aria-busy="true"])),
body.app-theme-dark #minhaAmlealtOverlay .minha-panel.minha-profile-mode > .minha-profile-page {
    background: #000 !important;
}
body.app-theme-dark #minhaAmlealtOverlay #minhaProfileTabs {
    background: #121212 !important;
}
body.app-theme-dark #minhaAmlealtOverlay #minhaProfileTabs .minha-profile-tab {
    background: transparent !important;
    color: #f8fafc !important;
    box-shadow: none !important;
}
body.app-theme-dark #minhaAmlealtOverlay #minhaProfileTabs .minha-profile-tab[aria-pressed="true"] {
    background: #303030 !important;
    color: #fff !important;
}
body.app-theme-dark #minhaAmlealtOverlay #minhaProfileTabs .minha-profile-tab:focus-visible {
    outline: 2px solid #a3a3a3 !important;
    outline-offset: -2px;
}

/* Meu Pet Social has its own user search in the local navigation. */
#app-view:has(> .main-container > #tab-meuPetSocial.active) > .laco-strip {
    display: none !important;
}

/* Keep drafting and publishing visually primary; extras are only an optional disclosure. */
#tab-meuPetSocial .minha-post-composer {
    gap: 8px;
    padding: clamp(10px, 2.3vw, 16px);
    background: transparent !important;
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 14px;
}
#tab-meuPetSocial .minha-post-composer:focus-within { border-color: var(--border-default, #cbd5e1); }
#tab-meuPetSocial .minha-post-compose-main {
    min-height: 62px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
}
#tab-meuPetSocial #minhaPostComposerAvatar { width: 38px; height: 38px; font-size: .9rem; }
#tab-meuPetSocial #minhaPostInput {
    min-width: 0;
    min-height: 60px;
    padding: 7px 0;
    font-size: 1rem;
    line-height: 1.4;
    max-height: 180px;
    resize: none;
    field-sizing: content;
}
/* Composer and text entry share the surrounding black surface in Escuro. */
body.app-theme-dark #tab-meuPetSocial .minha-post-composer,
body.app-theme-dark #tab-meuPetSocial #minhaPostInput:is(:hover, :focus, :focus-visible, :active),
body.app-theme-dark #tab-meuPetSocial #minhaPostInput {
    background: #000 !important;
}
body.app-theme-dark #tab-meuPetSocial #minhaPostInput::placeholder {
    color: var(--text-muted, #a3a3a3) !important;
}
#tab-meuPetSocial .minha-post-compose-footer {
    justify-content: flex-start;
    gap: 8px;
    padding-top: 5px;
    border-top: 1px solid var(--border-subtle, #e2e8f0);
}
#tab-meuPetSocial .minha-post-visibility {
    margin-inline-start: 2px;
    color: var(--text-secondary, #64748b);
    font-size: .76rem;
    font-weight: 650;
}
#tab-meuPetSocial .minha-post-publish {
    margin-inline-start: auto;
    min-height: 44px;
    padding-inline: 15px;
    font-size: .82rem;
    font-weight: 750;
    color: #fff !important;
    background: var(--secondary) !important;
    box-shadow: none !important;
}
#tab-meuPetSocial .minha-post-publish:is(:hover,:focus-visible) { filter: brightness(1.07); }
.amlealt-post-extras { position: relative; flex: none; }
.amlealt-post-extras-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--secondary, #3038ff) !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
}
.amlealt-post-extras-toggle svg { width: 22px; height: 22px; }
.amlealt-post-extras-toggle:is(:hover,[aria-expanded="true"]) { background: rgba(var(--secondary-rgb, 48,56,255), .08) !important; }
.amlealt-post-extras-panel {
    position: absolute;
    inset-block-start: calc(100% + 5px);
    inset-inline-start: 0;
    z-index: 4;
    min-width: min(170px, calc(100vw - 52px));
    padding: 3px;
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 11px;
    background: var(--surface-primary, #fff);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .12);
}
.amlealt-post-extras-panel[hidden] { display: none !important; }
.amlealt-post-extras-option {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 44px;
    width: 100%;
    padding: 5px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent !important;
    color: var(--text-primary, #172033) !important;
    box-shadow: none !important;
    font: inherit;
    font-size: .85rem;
    font-weight: 650;
    text-align: start;
    cursor: pointer;
}
.amlealt-post-extras-option:is(:hover,:focus-visible) { background: rgba(var(--secondary-rgb, 48,56,255), .08) !important; }
.amlealt-post-extras :is(button):focus-visible { outline: 2px solid var(--secondary); outline-offset: -2px; }

/* Preserve readable, centered labels when text or page zoom grows. */
#tab-meuPetSocial .amlealt-social-page-nav button {
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}
#tab-meuPetSocial .amlealt-social-page-nav button > span {
    min-inline-size: 0;
    max-inline-size: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
    text-wrap: balance;
}
@media (max-width: 360px) {
    #tab-meuPetSocial .amlealt-social-page-nav {
        grid-template-columns: minmax(0, .84fr) minmax(0, 1fr) minmax(0, 1.32fr) minmax(0, .84fr);
    }
}
#tab-meuPetSocial .minha-post-compose-footer { flex-wrap: wrap; }
#tab-meuPetSocial .minha-post-publish,
.amlealt-milestone-dialog :is(.amlealt-milestone-actions button, [data-save]),
.amlealt-milestone-notice [data-share] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-inline-size: 0;
    max-inline-size: 100%;
    min-block-size: 44px;
    padding-block: 8px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Pet username setup is neutral even when the input receives autofocus. */
#guidedSignupOverlay .guided-signup-username-field {
    --amlealt-username-border: #d4d4d4;
    --amlealt-username-focus: #737373;
    border-color: var(--amlealt-username-border);
}
body.app-dark-theme #guidedSignupOverlay .guided-signup-username-field {
    --amlealt-username-border: #525252;
    --amlealt-username-focus: #a3a3a3;
    background: #000 !important;
    box-shadow: none;
}
body.app-dark-theme #guidedSignupOverlay #guidedSocialUsername {
    background: #000 !important;
}
#guidedSignupOverlay .guided-signup-username-field:has(#guidedSocialUsername:focus-visible) {
    outline: 2px solid var(--amlealt-username-focus);
    outline-offset: 2px;
}
#guidedSignupOverlay #guidedSocialUsername:is(:focus, :focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}
#guidedSignupOverlay .guided-signup-username-field:has(#guidedSocialUsername:placeholder-shown) .guided-signup-username-prefix {
    display: none;
}

/* Shared loading presentation for Perfil Social; loaded profiles keep their existing surface. */
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))),
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))) .minha-panel {
    background: var(--surface-page, #f7f8fa) !important;
    box-shadow: none !important;
}
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))) .minha-profile-topline {
    position: relative;
    background: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    min-height: 54px;
}
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))) .minha-profile-topline > * {visibility: hidden !important;}
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))) .minha-profile-topline::after {
    content: "";
    position: absolute;
    width: min(128px, 36vw);
    height: 14px;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    background: color-mix(in srgb, var(--text-primary,#0f172a) 9%, transparent);
    border-radius: 999px;
}
#minhaAmlealtOverlay[data-social-profile-pending] #minhaProfileView > :not(#minhaProfileLoading,#minhaProfileLoadingSkeleton) {display:none !important;}
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))) #minhaSocialNav {visibility:hidden !important;}
#minhaAmlealtOverlay #minhaProfileView #minhaProfileLoadingSkeleton {display:none;}
#minhaAmlealtOverlay[data-social-profile-pending] #minhaProfileView #minhaProfileLoadingSkeleton,
#minhaAmlealtOverlay #minhaProfileView[aria-busy="true"] #minhaProfileLoadingSkeleton {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    width: min(780px,100%);
    margin-inline: auto;
    padding: clamp(20px,5vw,42px) clamp(12px,4vw,28px) 40px;
    border: 0;
    border-radius: 0;
    background: transparent;
    gap: 24px;
    --amlealt-profile-sk-tone: color-mix(in srgb, var(--text-primary,#0f172a) 9%, transparent);
}
#minhaProfileLoadingSkeleton :is(i,.amlealt-skeleton-circle) {
    display:block;
    background:var(--amlealt-profile-sk-tone);
    border-radius:999px;
    animation: none;
}
#minhaProfileLoadingSkeleton i {height:12px;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-hero {
    display:grid;
    grid-template-columns: clamp(76px,20vw,108px) repeat(2,minmax(0,1fr));
    gap:clamp(8px,4vw,30px);
    align-items:center;
}
#minhaProfileLoadingSkeleton .amlealt-skeleton-circle {width:100%;height:auto;aspect-ratio:1;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-count {display:grid;gap:9px;justify-items:center;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-count i:first-child {width:38%;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-count i:last-child {width:65%;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-identity {display:grid;gap:10px;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-identity i:nth-child(1) {width:min(48%,190px);height:20px;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-identity i:nth-child(2) {width:min(36%,135px);}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-identity i:nth-child(3) {width:min(45%,160px);height:32px;margin-top:3px;}
#minhaProfileLoadingSkeleton :is(.amlealt-profile-sk-tabs,.amlealt-profile-sk-stats) {display:grid;gap:12px;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-tabs {
    grid-template-columns:repeat(3,minmax(0,1fr));
    padding-block:10px;
    border-block-end:1px solid var(--border-subtle,#e2e8f0);
}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-tabs i {width:65%;margin:auto;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-stats > div {display:grid;gap:9px;padding:14px 10px 16px;border-radius:12px;border:1px solid var(--border-subtle,#e2e8f0);}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-stats i:first-child {width:48%;height:15px;}
#minhaProfileLoadingSkeleton .amlealt-profile-sk-stats i:last-child {width:70%;}
@media(prefers-reduced-motion:no-preference) {
    #minhaProfileLoadingSkeleton :is(i,.amlealt-skeleton-circle) {animation:amlealt-profile-sk-breathe 1.65s ease-in-out infinite alternate;}
}
@keyframes amlealt-profile-sk-breathe {from{opacity:.68}to{opacity:1}}

#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))).active,
#minhaAmlealtOverlay:is([data-social-profile-pending],:has(.minha-profile-mode #minhaProfileView[aria-busy="true"]:not([hidden]))).active > .minha-panel {
    opacity: 1 !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
}
body.app-dark-theme #minhaProfileLoadingSkeleton {
    --amlealt-profile-sk-tone: color-mix(in srgb, var(--text-primary,#f8fafc) 15%, transparent);
}

/* In-app social activity, using the same quiet surface as the feed. */
#minhaNotificationsView .minha-notifications-title { font-size: 1.12rem; margin: 0 0 .75rem; }
#minhaNotificationsView .minha-notifications-list { display: grid; padding: 0; margin: 0; list-style: none; }
#minhaNotificationsView .minha-notifications-list > li + li { border-top: 1px solid var(--border-subtle, #e2e8f0); }
#minhaNotificationsView .minha-notifications-item {
    display: flex; width: 100%; align-items: center; gap: .7rem; text-align: left; padding: .75rem .5rem;
    background: transparent; border: 1px solid transparent; border-radius: .55rem;
    color: var(--text-primary, #1e293b); cursor: pointer;
}
#minhaNotificationsView .minha-notifications-item:is(:hover, :focus-visible) { background: var(--surface-hover, #f1f5f9); box-shadow: none !important; }
#minhaNotificationsView .minha-notifications-item:focus-visible { outline: 2px solid var(--secondary) !important; outline-offset: -2px; }
#minhaNotificationsView :is(.minha-notifications-item strong, .minha-notifications-item small) { overflow-wrap: anywhere; }
#minhaNotificationsView .minha-notifications-item small { display: block; color: var(--text-secondary, #475569); margin-top: .15rem; }
#minhaNotificationsView .minha-notifications-item > .minha-social-avatar { flex: none; }
#minhaNotificationsView .minha-notifications-retry {
    background: var(--surface-secondary, #f8fafc); color: var(--text-primary, #1e293b);
    border: 1px solid var(--border-subtle, #e2e8f0); border-radius: .55rem; padding: .5rem .75rem;
}

/* Keep the compact social search hit target inside the sticky header in reduced motion too. */
#app-view:has(> .main-container > #tab-meuPetSocial.active) > .header.scrolled .header-search-btn {
    transform: none;
    animation: none;
}

/* The social search field follows the same true-black input surface as the composer. */
body.app-theme-dark #minhaSearchView .minha-search-box,
body.app-theme-dark #minhaSearchView #minhaSocialSearchInput {
    background: #000 !important;
    color: var(--text-primary, #f8fafc) !important;
}
body.app-theme-dark #minhaSearchView #minhaSocialSearchInput::placeholder {
    color: var(--text-muted, #a3a3a3) !important;
}
