/* Use the existing discovery, cast-profile and chat components. Only pet layout
   and selectors that differ from the human chat are defined here. */
.pet-page [hidden]{display:none!important}
.pet-list-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:0}
.pet-list-heading h1{margin:0;font-size:16px;font-weight:700;color:var(--text-primary)}
.app-header .pet-list-heading{box-sizing:border-box;width:100%;max-width:450px;padding:0 var(--app-content-inline-padding);background:#fff}
.pet-page .chatted-sort-option[aria-current="true"]{background:#eef0f3;color:#1f2328}
.pet-page .discovery-cast-tag-button:focus-visible,.pet-page #pet-sort-control :is(button,a):focus-visible{outline:2px solid var(--text-primary);outline-offset:2px}
.pet-page a.chatted-sort-option{text-decoration:none}
.pet-list-caption{font-size:12px;color:var(--text-secondary)}
.pet-list-caption{margin:0 0 14px}
.pet-profile-active .app-header,.pet-profile-active .app-header-auto-hide-spacer,.pet-profile-active .app-bottom-nav{display:none!important}
body.pet-profile-active{padding:0;background:linear-gradient(90deg,rgba(255,47,125,.08),rgba(246,161,26,.06) 45%,rgba(29,155,240,.06)),var(--page-bg)}
/* The profile shell owns the column shadow, as on human cast profiles. */
body.pet-page.pet-profile-active:not(.chat-active)::before{content:none}
.pet-profile-active .pet-main{max-width:450px;padding:0;min-height:100vh;background:var(--surface)}
.pet-profile-loading .skeleton-card{width:100%;height:14px;border-radius:6px}
.pet-profile-loading-header{display:flex;align-items:center;justify-content:center;height:calc(48px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px)}
.pet-profile-loading-header .skeleton-card{width:80px}
.pet-profile-loading .pet-profile-loading-avatar{width:96px;height:96px;border-radius:50%}
.pet-profile-loading-lines{display:grid;gap:12px}
.pet-profile-loading-lines .pet-profile-loading-name{width:60%;height:20px}
.pet-profile-loading-bio{margin:20px 0}
.pet-profile-loading-bio .skeleton-card:last-child{width:75%}
.pet-profile-loading .pet-profile-loading-button{height:44px;border-radius:8px}
.pet-profile-active .pet-page-status{margin:16px}
.pet-profile-active #page-back{margin:0 16px 16px}
@media(prefers-reduced-motion:reduce){.pet-page .skeleton-card::after{animation:none}}
.pet-profile-meta{margin:4px 0;color:var(--text-secondary);font-size:12px}
.pet-page .profile-header{border-bottom:0}
/* A compact field guide: quick facts, observations, then growing closer. */
.pet-profile-details{
  --pet-guide-ink:#3f493f;
  --pet-guide-muted:#646d61;
  --pet-guide-line:#e4e8de;
  --pet-guide-inset:20px;
  margin:8px 16px 28px;
  padding:0;
  border:0;
}
.pet-profile-basics{padding-top:20px;border-radius:18px;background:#f4f6ef}

.pet-profile-facts,.pet-profile-observations{margin:0;font-size:14px;line-height:1.85}
.pet-profile-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;padding:0 20px 20px}
.pet-profile-facts>div{min-width:0}
.pet-profile-details dt{margin:0 0 5px;color:var(--pet-guide-muted);font-size:11px;font-weight:700;line-height:1.5;letter-spacing:.03em}
.pet-profile-details dd{margin:0;min-width:0;overflow-wrap:anywhere;white-space:pre-wrap;color:var(--pet-guide-ink)}
.pet-profile-facts dd{font-size:13px;font-weight:700;line-height:1.7}
.pet-profile-observations{display:grid;gap:20px;padding:20px var(--pet-guide-inset);background:#fff;font-size:14px;line-height:1.85}
.pet-profile-observations>div{min-width:0}
.pet-profile-observations dt{display:flex;align-items:center;gap:7px;margin-bottom:6px;font-size:13px}
.pet-profile-observations dt::before{content:"";width:4px;height:4px;border-radius:50%;background:#9baa8d;flex-shrink:0}
.pet-profile-observations #profile-closerBehavior-row{margin-inline:calc(-1 * var(--pet-guide-inset));padding:14px var(--pet-guide-inset);border-radius:12px;background:#fff4eb}
.pet-profile-observations #profile-closerBehavior-row dt{color:#805b3e}
.pet-profile-observations #profile-closerBehavior-row dt::before{background:#bd906b}
@media(max-width:360px){
  .pet-profile-details{--pet-guide-inset:16px;margin-right:12px;margin-left:12px}
  .pet-profile-facts{gap:14px 16px;padding-right:16px;padding-left:16px}
  .pet-profile-observations{padding:16px}
}
/* Keep the human chat viewport, timeline mask, bubbles and input. */
body.pet-page.chat-active .pet-main{max-width:none;min-height:0;padding:0;background:transparent}
.pet-page #chatSection{margin:auto}
.pet-page #chat-name{margin:0;line-height:1.4;text-align:left}
.pet-chat-profile{display:flex;align-items:center;min-height:36px;min-width:0;color:inherit;text-decoration:none}
.pet-page .chat-title-with-thoughts{min-width:0;max-width:100%}
.pet-page #chat-place{margin:0;max-width:100%;color:#fff;line-height:1.5;text-shadow:0 1px 3px rgba(0,0,0,.5);text-align:left}
.pet-page .header-icon-button{text-decoration:none}
.pet-page .header-icon-button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.pet-page a.sender-info{text-decoration:none}
.pet-page .message-content{overflow-wrap:anywhere;white-space:pre-wrap}
.pet-page .pet-chat-notice{position:relative;z-index:2;align-self:center;max-width:calc(100% - 30px);margin:4px 15px;padding:7px 10px;border-radius:8px;background:rgba(255,255,255,.9);font-size:11px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text-secondary)}
.pet-page #chat-status:empty{display:none}
.pet-page #chat-status.error{color:#a43843}
.pet-page .pet-retry{position:relative;z-index:2;margin:4px auto}
.pet-page #messageInput{max-height:120px;min-height:36px;overflow-y:auto}
/* Align overlays with the flex content, excluding bottom padding and the safe area. */
.pet-page .chat-form .situation-notation-button,.pet-page .chat-form .item-toolbar{top:auto;align-self:center;transform:none}
.pet-page .pet-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.pet-page-status{font-size:12px;color:var(--text-secondary);margin:12px 0}
.pet-page-status:empty{display:none}
.pet-page .profile-name{color:var(--text-primary)}
.pet-profile-feature{align-self:center;font-size:14px;line-height:1.3}
/* Portrait artwork includes the complete foreground down to the composer. */
.pet-page #chatSection .chat-background-image{object-position:center 20%;pointer-events:none}
.pet-switch-choice{display:flex;align-items:center;gap:10px;padding:12px;color:var(--text-primary);text-decoration:none;border-radius:12px;background:var(--secondary-bg)}
.pet-switch-choice .cast-icon{width:48px;height:48px;object-fit:cover;border-radius:50%;order:-1}
#pet-switch-list{grid-template-columns:1fr;gap:8px}

.pet-group-members{position:relative;z-index:2;display:flex;gap:6px;overflow-x:auto;padding:4px 12px;flex-shrink:0}
.pet-member-chip{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-size:11px;background:rgba(255,255,255,.9);border-radius:16px;padding:3px 5px;color:var(--text-primary)}
.pet-member-chip .cast-icon{width:24px;height:24px;border-radius:50%;object-fit:cover}
.pet-member-affinity{color:var(--button-primary-bg,#f657b5);font-size:12px;line-height:1}
.pet-call-list{display:grid;gap:8px}
.pet-member-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;background:#f3f4f6;color:var(--text-primary);border:0;border-radius:8px;font:inherit;font-size:13px;text-decoration:none;cursor:pointer}
.pet-call-search-row{display:flex;align-items:center;gap:8px;justify-content:space-between}
.pet-call-search-row input{min-width:0;flex:1}
.pet-participants-content input,.pet-participants-content select{min-height:44px;border:1px solid #ddd;border-radius:8px;padding:8px;background:#fff;font:inherit;font-size:13px}
.pet-participants-content label{display:block;font-size:12px;margin:8px 0 4px}

.pet-page #chat-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.pet-outing-status{position:relative;z-index:2;display:flex;align-items:center;gap:8px;margin:4px 12px;padding:4px 8px;border-radius:8px;background:rgba(255,255,255,.92);flex-shrink:0}
.pet-outing-status[hidden]{display:none}
.pet-outing-status p{flex:1;margin:0;font-size:11px;line-height:1.6;color:var(--text-primary)}
.pet-outing-status button{flex-shrink:0}
.pet-outing-choice{display:flex;align-items:center;gap:12px;width:100%;padding:8px;border:1px solid transparent;border-radius:8px;background:#f3f4f6;color:var(--text-primary);text-align:left;font:inherit}
.pet-outing-choice[aria-pressed="true"]{border-color:var(--text-primary);background:#eef0f3}
.pet-outing-choice img{width:72px;height:90px;object-fit:cover;border-radius:6px;flex-shrink:0}
.pet-outing-choice strong,.pet-outing-choice span span{display:block;font-size:13px;line-height:1.6}
.pet-outing-choice span span{margin-top:4px;font-size:12px;color:var(--text-secondary)}

/* Reuse the human chat item toolbar and parameter rings. */
.pet-page #petFullnessRingProgress{stroke:var(--primary-accent)}
.pet-food-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0}
.pet-food-row p{margin:4px 0;font-size:12px;color:var(--text-secondary)}
.pet-food-row .item-button{flex-shrink:0;min-width:44px;min-height:44px}
.pet-page #petFoodModal .modal-content{max-height:80svh;overflow-y:auto}
.pet-page .pet-music-content{display:flex;flex-direction:column;height:min(620px,80svh);overflow:hidden}
