/* Pet Book application — styling entry point (Pet-owned, not Business author.css) */

:root {
    --pet-bg: #fff8f3;
    --pet-surface: #ffffff;
    --pet-text: #2d2438;
    --pet-muted: #6b5f76;
    --pet-accent: #e86b5a;
    --pet-accent-dark: #c94d3d;
    /* Action ink — primary CTAs. Brand/selection stay --pet-accent. */
    --pet-ink: #3A312C;
    --pet-ink-hover: #2F2A28;
    --pet-ink-rgb: 58, 49, 44;
    --pet-border: rgba(45, 36, 56, 0.1);
    --pet-shadow: 0 18px 50px rgba(232, 107, 90, 0.12);
    --pet-radius: 18px;
    /* Compact Previous/Next bar. Do not use position:fixed — #pet-app-root
       has container-type:inline-size, which is a containing block for fixed
       descendants, so bottom:0 cannot attach to the visual viewport. The bar
       is in-flow at the bottom of the locked 100dvh flex shell instead.
       --pet-safe-area-bottom is a placement token (tests may override it);
       do not add it as extra blank padding under the controls. */
    --pet-page-nav-pad-y: 10px;
    --pet-page-nav-pad-x: 20px;
    --pet-page-nav-btn-height: 44px;
    --pet-safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    /* Phone chrome: no pinch / double-tap zoom — keep layout locked. */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: linear-gradient(165deg, #fff8f3 0%, #ffe8dc 45%, #ffd9c8 100%);
    color: var(--pet-text);
}

#pet-app-root {
    /* Inside Phone sim, --wmb-vp-sim-app-height is the frame (not desktop 100vh). */
    height: var(--wmb-vp-sim-app-height, 100dvh);
    max-height: var(--wmb-vp-sim-app-height, 100dvh);
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
    /* Layout breakpoints use this box — so Phone viewport sim (375px) matches real mobile. */
    container-type: inline-size;
    container-name: pet-shell;
    /* Deny chrome selection; allow-list below re-enables draft / chat / forms. */
    -webkit-user-select: none;
    user-select: none;
}

/*
 * Pet shell text selection (mirrors Author Studio broader policy):
 * Chapter list / stage chrome must not highlight on drag; chapter prose,
 * chat answers, and form fields stay copyable.
 */
#pet-app-root :is(
    .pet-read-book-prose,
    .pet-chat-msg-body,
    .pet-chat-msg-answer,
    .pet-discover-ask-feedback-answer-text,
    .wmb-selectable,
    input,
    textarea,
    select,
    [contenteditable="true"]
) {
    -webkit-user-select: text;
    user-select: text;
}

.wmb-selectable {
    -webkit-user-select: text;
    user-select: text;
}

#pet-app-root:has(.pet-interview-chat),
#pet-app-root:has(.pet-discover),
#pet-app-root:has(.pet-read-book--reading),
#pet-app-root:has(.pet-hub),
#pet-app-root:has(.pet-dashboard) {
    height: var(--wmb-vp-sim-app-height, 100dvh);
    max-height: var(--wmb-vp-sim-app-height, 100dvh);
    overflow: hidden;
}

/*
 * Installed iOS PWA (WebKit): 100dvh + position:fixed on html/body sizes the
 * layout viewport to screen.height minus safeTop (812 − 53 = 759), leaving a
 * physical gap under the app. 100vh with static html/body fills screen.height
 * without body scroll. Browser (non-standalone) keeps the dvh/fixed shell.
 */
@media (display-mode: standalone) {
    html, body {
        position: static;
        inset: auto;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    #pet-app-root,
    #pet-app-root:has(.pet-interview-chat),
    #pet-app-root:has(.pet-discover),
    #pet-app-root:has(.pet-read-book--reading),
    #pet-app-root:has(.pet-hub),
    #pet-app-root:has(.pet-dashboard) {
        height: var(--wmb-vp-sim-app-height, 100vh);
        max-height: var(--wmb-vp-sim-app-height, 100vh);
    }
}

.pet-app {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    overscroll-behavior: none;
}

.pet-app:has(.pet-interview-chat),
.pet-app:has(.pet-discover),
.pet-app:has(.pet-read-book--reading),
.pet-app:has(.pet-hub),
.pet-app:has(.pet-dashboard) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    /* Content reaches Talk; compact Prev/Next sits in-flow under it. */
    padding-bottom: 0;
}

.pet-app:has(.pet-interview-chat) .pet-main,
.pet-app:has(.pet-discover) .pet-main,
.pet-app:has(.pet-read-book--reading) .pet-main,
.pet-app:has(.pet-hub) .pet-main,
.pet-app:has(.pet-dashboard) .pet-main {
    margin-bottom: 0;
}

.pet-chrome-menu {
    position: relative;
    flex: 0 0 auto;
    margin-left: 0.15rem;
}

.pet-nav--menu-only .pet-chrome-menu {
    margin-left: auto;
}

.pet-chrome-menu-toggle {
    appearance: none;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    background: #fff;
    color: var(--pet-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pet-chrome-menu-toggle:hover {
    border-color: rgba(232, 107, 90, 0.35);
    color: var(--pet-accent-dark);
}

.pet-chrome-menu-toggle:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 2px;
}

.pet-chrome-menu-icon,
.pet-chrome-menu-icon::before,
.pet-chrome-menu-icon::after {
    display: block;
    width: 1rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: '';
}

.pet-chrome-menu-icon {
    position: relative;
}

.pet-chrome-menu-icon::before {
    position: absolute;
    top: -5px;
    left: 0;
}

.pet-chrome-menu-icon::after {
    position: absolute;
    top: 5px;
    left: 0;
}

.pet-chrome-menu-list {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 400;
    min-width: 11rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(45, 36, 56, 0.14);
}

.pet-chrome-menu-list.hidden,
.pet-chrome-menu-list[hidden] {
    display: none;
}

.pet-chrome-menu-item {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--pet-text);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
}

.pet-chrome-menu-item:hover {
    background: rgba(232, 107, 90, 0.08);
    color: var(--pet-accent-dark);
}

.pet-chrome-menu-item:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 1px;
}

.pet-chrome-menu-item--danger {
    color: #8a3b32;
}

.pet-chrome-menu-divider {
    margin: 0.2rem 0.35rem;
    border: 0;
    border-top: 1px solid var(--pet-border);
}

.pet-admin-link.hidden,
.pet-admin-link[hidden],
.pet-viewport-sim-link.hidden,
.pet-viewport-sim-link[hidden] {
    display: none;
}

/* Shared App Feedback panel (same screen as Author; Pet token mapping). */
#app-feedback-panel {
    --c-text: var(--pet-text);
    --c-muted: var(--pet-muted);
    --c-border: var(--pet-border);
    --c-surface: var(--pet-surface);
    --c-bg: var(--pet-bg);
    --c-primary: var(--pet-ink);
    --c-primary-h: var(--pet-ink-hover);
    --c-danger: #b42318;
    --c-success: #1f7a4d;
    --radius: 12px;
    --header-h: 0px;
    position: fixed;
    inset: 0;
    z-index: 400;
    width: 100%;
    height: var(--wmb-vp-sim-app-height, 100dvh);
    background: var(--pet-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app-feedback-panel.hidden {
    display: none !important;
}

#app-feedback-panel .my-desk-head {
    display: none;
}

#app-feedback-panel.my-desk-panel--workspace .my-desk-body,
#app-feedback-panel .app-feedback-host,
#app-feedback-panel .desk-workspace-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#app-feedback-panel .desk-workspace-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--pet-border);
    background: var(--pet-surface);
}

#app-feedback-panel .desk-workspace-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pet-text);
}

#app-feedback-panel .reader-close {
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pet-muted);
    cursor: pointer;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 8px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#app-feedback-panel .desk-workspace-intro {
    flex-shrink: 0;
    margin: 0;
    padding: 0.8rem 0.85rem 0;
    font-size: 0.84rem;
    color: var(--pet-muted);
    line-height: 1.45;
}

#app-feedback-panel .desk-workspace-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.8rem;
    background: var(--pet-bg);
}

#app-feedback-panel .desk-app-requests-body {
    background: var(--pet-surface);
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    padding: 0.95rem 1.15rem;
    gap: 0.28rem;
}

#app-feedback-panel .qa-answer-area {
    width: 100%;
    min-height: 120px;
    max-height: 28vh;
    padding: 0.8rem 0.95rem;
    border: 2px solid var(--pet-border);
    border-radius: 12px;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--pet-text);
    background: #fff;
    resize: vertical;
    line-height: 1.6;
    box-sizing: border-box;
    flex: 0 1 auto;
}

#app-feedback-panel .qa-answer-area:focus {
    outline: none;
    border-color: var(--pet-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pet-accent) 18%, transparent);
}

#app-feedback-panel .desk-app-requests-attachments-block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

#app-feedback-panel .desk-app-requests-attachment-heading {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pet-text);
}

#app-feedback-panel .desk-app-requests-attachment-hint,
#app-feedback-panel .desk-app-requests-tip {
    margin: 0;
    font-size: 0.66rem;
    color: var(--pet-muted);
}

#app-feedback-panel .desk-app-requests-attachment-input {
    display: block;
    max-width: 100%;
    min-height: 2.75rem;
    font-size: 0.9rem;
}

#app-feedback-panel .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

#app-feedback-panel .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#app-feedback-panel .btn-primary {
    background: var(--pet-ink);
    color: #fff;
}

#app-feedback-panel .btn-ghost {
    background: #fff8f3;
    color: var(--pet-ink);
    border: 2px solid var(--pet-ink);
}

#app-feedback-panel .desk-workspace-foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.85rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--pet-border);
    background: var(--pet-surface);
}

#app-feedback-panel .desk-workspace-status {
    font-size: 0.76rem;
    min-height: 1.1em;
    color: var(--pet-muted);
}

.app-request-attachment-summary-meta {
    margin: 0 0 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pet-text);
}

#app-feedback-panel .desk-app-requests-attachment-summary {
    flex-shrink: 0;
    margin-top: 0.35rem;
}

#app-feedback-panel .desk-app-requests-attachment-summary[hidden] {
    display: none !important;
}

#app-feedback-panel .app-request-attachment-thumb {
    width: 120px;
    height: 120px;
}

.app-request-attachment-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-request-attachment-thumb {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--pet-border);
    background: var(--pet-surface);
}

.app-request-attachment-thumb-expand {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.app-request-attachment-thumb-expand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-request-attachment-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 0.72rem;
    cursor: pointer;
}

.app-request-attachment-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.app-request-attachment-lightbox-backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
}

.app-request-attachment-lightbox-inner {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 1100px);
    max-height: min(92vh, 900px);
    pointer-events: none;
}

.app-request-attachment-lightbox-image {
    display: block;
    max-width: min(96vw, 1100px);
    max-height: min(92vh, 900px);
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    pointer-events: none;
}

.app-request-attachment-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.pet-nav {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 30;
    /* viewport-fit=cover: keep brand + tabs below the iOS status bar. */
    padding: max(0.35rem, env(safe-area-inset-top, 0px))
        max(0.6rem, env(safe-area-inset-right, 0px))
        0.35rem
        max(0.6rem, env(safe-area-inset-left, 0px));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--pet-border);
    overscroll-behavior: none;
}

.pet-nav-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Compact brand → more room between Meet / Stories / Read / Share. */
    gap: 0.4rem;
    min-width: 0;
}

.pet-nav-brand {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    color: var(--pet-accent-dark);
    letter-spacing: 0.01em;
    cursor: pointer;
    flex-shrink: 0;
}

.pet-nav-brand-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 5px;
}

.pet-nav-brand:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.pet-section-tabs {
    display: flex;
    flex: 1 1 auto;
    gap: 0.45rem;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
}

.pet-section-tabs::-webkit-scrollbar {
    display: none;
}

.pet-section-tab-wrap {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.pet-section-tab {
    appearance: none;
    flex: 0 0 auto;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--pet-muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 1rem;
    font-weight: 650;
    justify-content: center;
    line-height: 1.2;
    padding: 0.42rem 0.65rem;
    white-space: nowrap;
}

.pet-section-tab:hover {
    background: rgba(232, 107, 90, 0.09);
    color: var(--pet-accent-dark);
}

.pet-section-tab.is-active {
    border-color: rgba(232, 107, 90, 0.32);
    background: rgba(232, 107, 90, 0.14);
    color: var(--pet-accent-dark);
}

.pet-section-tab:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 1px;
}

.pet-section-tab[aria-busy="true"] {
    cursor: progress;
}

.pet-page-spinner {
    position: absolute;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--pet-bg) 58%, transparent);
    backdrop-filter: blur(2px);
}

.pet-page-spinner[hidden] {
    display: none !important;
}

.pet-page-spinner-body {
    display: grid;
    justify-items: center;
    gap: 0.85rem;
    max-width: min(18rem, calc(100vw - 2.5rem));
    padding: 1.1rem 1.25rem;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--pet-surface, #fff) 92%, transparent);
    box-shadow: 0 0.35rem 1.25rem color-mix(in srgb, #000 12%, transparent);
}

.pet-page-spinner-ring {
    box-sizing: border-box;
    width: 4.25rem;
    height: 4.25rem;
    border: 0.38rem solid color-mix(in srgb, var(--pet-accent) 22%, transparent);
    border-top-color: var(--pet-accent);
    border-radius: 50%;
    animation: pet-page-spin 0.75s linear infinite;
}

.pet-page-spinner-label {
    margin: 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--pet-ink, #1c1917);
}

.pet-page-spinner-bar {
    display: block;
    width: 100%;
    height: 0.35rem;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pet-accent) 18%, transparent);
}

.pet-page-spinner-bar-fill {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: var(--pet-accent);
    animation: pet-page-bar 1.1s ease-in-out infinite;
}

@keyframes pet-page-spin {
    to { transform: rotate(360deg); }
}

@keyframes pet-page-bar {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

/* Keep every primary destination visible on a phone; tabs are navigation, not a carousel. */
@container pet-shell (max-width: 520px) {
    .pet-section-tabs {
        justify-content: space-between;
        gap: 0.35rem;
        overflow-x: visible;
    }

    .pet-section-tab-wrap {
        flex: 1 1 0;
        min-width: 0;
    }

    .pet-section-tab {
        flex: 1 1 auto;
        font-size: 0.9rem;
        padding: 0.42rem 0.2rem;
        text-align: center;
    }
}

.pet-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    overscroll-behavior: none;
    padding: 0.5rem 0.5rem 1rem;
}

/* No sticky nav (welcome / pre-book): keep content below the status bar. */
.pet-app:not(:has(.pet-nav)) .pet-main {
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
}

.pet-main:has(.pet-hub) {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

.pet-hub {
    display: flex;
    flex-direction: column;
    width: min(100%, 840px);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.pet-hub > header {
    flex: 0 0 auto;
}

.pet-hub .pet-dashboard-ask {
    flex: 0 0 auto;
    margin-top: 0.55rem;
    max-width: none;
    width: 100%;
    background: var(--pet-surface);
}

.pet-share-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pet-interviews .pet-interview-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pet-read-book .pet-read-book-empty {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pet-main:has(.pet-discover) {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.15rem 0.4rem 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Book Dashboard (home): same shell gutters as Stories / Read / Share. */
.pet-main:has(.pet-dashboard) {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.32rem 0.42rem 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pet-main:has(.pet-interview-chat),
.pet-main:has(.pet-stories-screen) {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.32rem 0.42rem 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pet-main:has(.pet-read-book--reading) {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.pet-welcome,
.pet-meet,
.pet-dashboard {
    width: min(100%, 840px);
    background: var(--pet-surface);
    border: 1px solid var(--pet-border);
    border-radius: var(--pet-radius);
    box-shadow: var(--pet-shadow);
    padding: clamp(0.4rem, 1.25vw, 0.6rem);
}

.pet-dashboard {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/*
 * Destination hubs (Meet panel, Stories, Read, Share) share Read My Book
 * page chrome: panel padding, header rhythm, title size/color, lead copy.
 */
.pet-read-book,
.pet-interviews,
.pet-share,
.pet-discover-panel {
    width: min(100%, 840px);
    box-sizing: border-box;
    background: var(--pet-surface);
    border: 1px solid var(--pet-border);
    border-radius: var(--pet-radius);
    box-shadow: var(--pet-shadow);
    padding: clamp(0.4rem, 1.25vw, 0.6rem);
    padding-bottom: 0;
}

.pet-interview-chat {
    width: min(100%, 720px);
    background: var(--pet-surface);
    border: 1px solid var(--pet-border);
    border-radius: var(--pet-radius);
    box-shadow: var(--pet-shadow);
}

.pet-welcome {
    text-align: center;
}

.pet-welcome-badge {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.pet-welcome-title,
.pet-screen-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.65rem, 4.5vw, 2.15rem);
    line-height: 1.12;
    color: var(--pet-accent-dark);
}

/* Home title matches Stories / Read / Share hub titles (not the larger welcome size). */
.pet-dashboard-title {
    margin: 0 0 0.2rem;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    line-height: 1.2;
    color: var(--pet-text);
}

.pet-dashboard-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0 0 0.5rem;
}

.pet-dashboard-title-row .pet-dashboard-title {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.pet-dashboard-title-row .pet-meta--inline {
    margin: 0.15rem 0 0;
    flex: 0 0 auto;
    text-align: right;
}

.pet-dashboard-title-row .pet-meta--inline .pet-meta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.1rem;
    justify-items: end;
}

.pet-dashboard-title-row .pet-meta--inline dt,
.pet-dashboard-title-row .pet-meta--inline dd {
    color: var(--pet-text);
}

.pet-dashboard-title-row .pet-meta--inline dt {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
}

.pet-dashboard-title-row .pet-meta--inline dd {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;
}

.pet-welcome-lead,
.pet-screen-lead {
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--pet-muted);
    margin: 0 0 0.65rem;
}

.pet-screen-hint {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--pet-muted);
    margin: 0 0 1rem;
}

.pet-welcome-copy {
    margin: 0 0 1rem;
    line-height: 1.5;
}

.pet-welcome-resume {
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    background: #fff4f0;
    border: 1px solid rgba(232, 107, 90, 0.25);
    color: var(--pet-text);
    line-height: 1.45;
}

.pet-welcome-resume a {
    color: var(--pet-ink);
    font-weight: 700;
}

.pet-btn {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.pet-btn-primary {
    background: var(--pet-ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(var(--pet-ink-rgb), 0.22);
}

.pet-btn-primary:hover {
    background: var(--pet-ink-hover);
}

.pet-btn-secondary,
.pet-btn-ghost {
    background: #fff8f3;
    color: var(--pet-ink);
    border: 1.5px solid var(--pet-ink);
    box-shadow: none;
}

.pet-btn-ghost:hover,
.pet-btn-secondary:hover {
    background: #fff;
}

.pet-btn-soft {
    background: #fff4f0;
    color: var(--pet-ink);
    border: 1.5px solid rgba(var(--pet-ink-rgb), 0.22);
    width: 100%;
}

.pet-link-btn {
    appearance: none;
    border: none;
    background: none;
    color: var(--pet-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.25rem 0;
}

.pet-discover {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    margin: 0 auto;
    width: min(100%, 840px);
    /* Shell only — Pet/Family/… pills sit above the white panel. */
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    gap: 0.35rem;
}

.pet-discover-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    width: 100%;
}

.pet-discover-panel.wmb-card-swipe-follow,
.pet-hub.wmb-card-swipe-follow,
.pet-dashboard.wmb-card-swipe-follow,
.pet-read-book.wmb-card-swipe-follow,
.pet-share.wmb-card-swipe-follow,
.pet-interviews.wmb-card-swipe-follow,
.pet-stories-screen.wmb-card-swipe-follow,
.pet-interview-chat.wmb-card-swipe-follow {
    transition: none;
    will-change: transform;
}

.pet-discover-panel.wmb-card-swipe-snap,
.pet-hub.wmb-card-swipe-snap,
.pet-dashboard.wmb-card-swipe-snap,
.pet-read-book.wmb-card-swipe-snap,
.pet-share.wmb-card-swipe-snap,
.pet-interviews.wmb-card-swipe-snap,
.pet-stories-screen.wmb-card-swipe-snap,
.pet-interview-chat.wmb-card-swipe-snap {
    will-change: transform;
}

.pet-discover-body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.pet-discover-body > .pet-form {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.pet-discover-body .pet-discover-nav {
    margin-top: auto;
    padding-top: 0.4rem;
    flex-shrink: 0;
}

.pet-discover-ask-row {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
}

.pet-discover-ask-main {
    flex: 1 1 auto;
    min-width: 0;
}

.pet-discover-progress {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: 0;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.pet-discover-card-nav {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    box-sizing: border-box;
    margin: 0;
    flex: 0 0 auto;
    flex-grow: 0;
    /* Compact bar at the physical shell bottom. viewport-fit=cover already
       lets this in-flow nav paint through the iPhone home-indicator region.
       Bottom padding is only the 10px gap — never
       calc(pad-y + env(safe-area-inset-bottom)), which reserved a blank
       footer and shoved Previous/Next upward. Left/right still honor
       landscape safe-area. --pet-safe-area-bottom is a placement token,
       not extra space under the controls. */
    padding: var(--pet-page-nav-pad-y)
        max(var(--pet-page-nav-pad-x), env(safe-area-inset-right, 0px))
        var(--pet-page-nav-pad-y)
        max(var(--pet-page-nav-pad-x), env(safe-area-inset-left, 0px));
    background: var(--pet-bg);
    border-top: 1px solid var(--pet-border);
    box-shadow: none;
}

.pet-discover-card-nav-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    min-height: var(--pet-page-nav-btn-height);
    padding: 0.2rem 0.15rem;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.2;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--pet-ink);
}

.pet-discover-card-nav-btn.pet-btn-primary,
.pet-discover-card-nav-btn.pet-btn-ghost {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--pet-ink);
}

.pet-discover-card-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pet-discover-card-nav-btn:first-child::before,
.pet-discover-card-nav-btn:last-child::after {
    font-size: 1.2em;
    line-height: 1;
    font-weight: 700;
}

.pet-discover-card-nav-btn:first-child::before {
    content: '‹';
    margin-right: 0.35rem;
}

.pet-discover-card-nav-btn:last-child::after {
    content: '›';
    margin-left: 0.35rem;
}

@container pet-shell (max-width: 520px) {
    .pet-discover-card-nav {
        gap: 0.5rem;
    }

    .pet-discover-card-nav-btn {
        min-height: var(--pet-page-nav-btn-height);
        padding: 0.2rem 0.1rem;
        font-size: 0.9rem;
    }
}

.pet-stories-screen {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 0;
    min-height: 0;
    width: min(100%, 42rem);
    margin: 0 auto;
    gap: 0.12rem;
    min-width: 0;
    box-sizing: border-box;
}

.pet-stories-screen > .pet-interview-chat {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    width: 100%;
    overflow: hidden;
}

.pet-stories-bottom-chrome {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
    padding-bottom: 0;
}

.pet-stories-bottom-chrome .pet-chat-compose-stack {
    margin: 0;
    padding-top: 0.08rem;
    border-top: 1px solid var(--pet-border);
}

.pet-stories-card-nav {
    flex: 0 0 auto;
    z-index: 60;
    margin-top: 0;
}

.pet-linear-bottom-chrome {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
    padding-bottom: 0;
}

.pet-hub .pet-linear-bottom-chrome {
    margin-top: 0.55rem;
}

.pet-hub .pet-linear-bottom-chrome .pet-dashboard-ask {
    margin-top: 0;
}

.pet-linear-card-nav {
    flex: 0 0 auto;
}

/* Equal side columns keep the center control on the row midline
   even when Previous is wider than Next. */
.pet-discover-card-nav.pet-linear-card-nav--has-center,
.pet-discover-card-nav.pet-discover-card-nav--has-center {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    justify-content: stretch;
    align-items: center;
}

.pet-linear-card-nav--has-center [data-linear-step="prev"],
.pet-discover-card-nav--has-center [data-discover-step="prev"],
.pet-discover-card-nav--has-center [data-interview-step="prev"] {
    justify-self: start;
}

.pet-linear-card-nav--has-center [data-linear-step="next"],
.pet-discover-card-nav--has-center [data-discover-step="next"],
.pet-discover-card-nav--has-center [data-interview-step="next"] {
    justify-self: end;
}

.pet-linear-card-nav--has-center .pet-read-narrate-btn,
.pet-linear-card-nav--has-center .pet-nav-speak-btn,
.pet-linear-card-nav--has-center .pet-linear-card-nav-center,
.pet-discover-card-nav--has-center .pet-nav-speak-btn {
    justify-self: center;
}

.pet-linear-card-nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
}

.pet-linear-card-nav-center .pet-read-narrate-btn {
    max-width: 8.5rem;
}

.pet-discover-progress-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pet-discover-step-btn {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    position: relative;
    color: var(--pet-accent);
}

.pet-discover-step-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.72rem;
    height: 0.72rem;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
}

.pet-discover-step-btn--prev::before {
    transform: rotate(-135deg) translate(1.5px, -1.5px);
}

.pet-discover-step-btn--next::before {
    transform: rotate(45deg) translate(-1.5px, 1.5px);
}

.pet-discover-step-btn:hover:not(:disabled) {
    background: rgba(232, 107, 90, 0.1);
}

.pet-discover-step-btn:disabled {
    opacity: 0.28;
    cursor: default;
    color: rgba(232, 107, 90, 0.55);
}

.pet-progress-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(232, 107, 90, 0.22);
}

.pet-progress-dot.is-active,
.pet-progress-dot.is-done {
    background: var(--pet-accent);
}

.pet-discover-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.pet-discover-ask {
    margin-top: 0;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(232, 107, 90, 0.18);
    flex: 0 0 auto;
    min-height: 0;
}

.pet-discover-bottom-chrome {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 0.1rem;
    margin-top: 0.15rem;
    min-width: 0;
    padding-bottom: 0;
}

.pet-discover-bottom-chrome .pet-discover-card-nav {
    margin-top: 0;
}

.pet-discover-ask .pet-discover-ask-row {
    width: 100%;
}

/* Journey screens: denser chrome so home ↔ Meet ↔ Stories ↔ Read ↔ Share match. */
.pet-app:has(.pet-discover) .pet-nav,
.pet-app:has(.pet-dashboard) .pet-nav,
.pet-app:has(.pet-hub) .pet-nav,
.pet-app:has(.pet-interview-chat) .pet-nav {
    padding: max(0.18rem, env(safe-area-inset-top, 0px))
        max(0.42rem, env(safe-area-inset-right, 0px))
        0.18rem
        max(0.42rem, env(safe-area-inset-left, 0px));
}

.pet-app:has(.pet-discover) .pet-section-tab,
.pet-app:has(.pet-dashboard) .pet-section-tab,
.pet-app:has(.pet-hub) .pet-section-tab,
.pet-app:has(.pet-interview-chat) .pet-section-tab {
    padding: 0.28rem 0.55rem;
}

.pet-app:has(.pet-discover) .pet-chrome-menu-toggle,
.pet-app:has(.pet-dashboard) .pet-chrome-menu-toggle,
.pet-app:has(.pet-hub) .pet-chrome-menu-toggle,
.pet-app:has(.pet-interview-chat) .pet-chrome-menu-toggle {
    width: 2.1rem;
    height: 2.1rem;
}

.pet-discover .pet-screen-title {
    margin: 0 0 0.2rem;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    line-height: 1.2;
    color: var(--pet-text);
}

.pet-discover .pet-screen-lead {
    margin: 0 0 0.4rem;
    font-size: 0.88rem;
    line-height: 1.35;
    color: var(--pet-muted);
}

.pet-discover .pet-form {
    gap: 0.48rem;
}

.pet-discover .pet-field {
    display: grid;
    grid-template-columns: 7.75rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.55rem;
    row-gap: 0.12rem;
}

.pet-discover .pet-field-label {
    font-size: 0.84rem;
    line-height: 1.2;
}

.pet-discover .pet-field--stack,
.pet-discover .pet-field:has(textarea) {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.pet-discover .pet-field-hint {
    grid-column: 2;
}

.pet-discover .pet-field--stack .pet-field-hint,
.pet-discover .pet-field:has(textarea) .pet-field-hint {
    grid-column: 1;
}

.pet-discover .pet-input {
    padding: 0.4rem 0.65rem;
}

.pet-discover .pet-choice-row {
    gap: 0.32rem;
    min-width: 0;
    width: 100%;
}

.pet-discover .pet-choice {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.32rem 0.28rem;
    gap: 0.22rem;
    box-sizing: border-box;
}

.pet-discover .pet-choice input[type="radio"] {
    margin: 0;
    flex: 0 0 auto;
    width: 0.9em;
    height: 0.9em;
}

.pet-discover .pet-choice span {
    min-width: 0;
    white-space: nowrap;
}

.pet-discover .pet-btn-soft {
    margin-top: 0.35rem;
    padding: 0.48rem 1rem;
}

.pet-discover .pet-family-row {
    padding: 0.48rem 0.7rem;
}

.pet-discover .pet-family-empty {
    padding: 0.5rem 0.7rem;
}

.pet-discover .pet-upload-zone {
    padding: 0.6rem 0.7rem;
    margin: 0.3rem 0 0.25rem;
}

.pet-discover .pet-upload-icon {
    font-size: 1.2rem;
}

@container pet-shell (max-width: 520px) {
    .pet-app:has(.pet-discover) .pet-section-tab,
    .pet-app:has(.pet-dashboard) .pet-section-tab,
    .pet-app:has(.pet-hub) .pet-section-tab,
    .pet-app:has(.pet-interview-chat) .pet-section-tab {
        padding: 0.28rem 0.2rem;
    }
}

.pet-discover-ask-reply {
    margin: 0.3rem 0 0;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: rgba(255, 244, 240, 0.95);
    color: var(--pet-accent-dark);
    font-size: 0.86rem;
    line-height: 1.3;
    white-space: pre-wrap;
    max-height: min(40vh, 14rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Keep the open feedback sheet visible (do not clip under overflow). */
.pet-discover-ask-reply:has(.pet-discover-ask-feedback-menu:not([hidden])) {
    overflow: visible;
    max-height: none;
}

.pet-discover-ask-feedback-ask {
    color: rgba(92, 58, 52, 0.72);
    font-size: 0.82rem;
    margin: 0 0 0.2rem;
}

.pet-discover-ask-feedback-answer {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.35rem 0.4rem;
    margin: 0;
    color: var(--pet-accent-dark);
    width: 100%;
    box-sizing: border-box;
}

.pet-discover-ask-feedback-answer-text {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}

.pet-discover-ask-done {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--pet-accent-dark);
}

.pet-discover-ask-done-check {
    color: #2e7d32;
    font-size: 1.05em;
    line-height: 1;
}

.pet-discover-ask-feedback-menu-button {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 5;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
}

.pet-discover-ask-feedback-menu-button:hover,
.pet-discover-ask-feedback-menu-button:focus-visible {
    background: rgba(232, 107, 90, 0.14);
}

.pet-discover-ask-feedback-menu[hidden] {
    display: none !important;
}

/* LessonCaddie-style popover under … */
.pet-discover-ask-feedback-menu {
    position: absolute;
    top: calc(100% + 0.2rem);
    right: 0;
    z-index: 12;
    display: grid;
    gap: 0.15rem;
    min-width: 9.5rem;
    margin: 0;
    padding: 0.35rem;
    border: 1px solid rgba(232, 107, 90, 0.22);
    border-radius: 0.6rem;
    background: #fff;
    box-shadow: 0 0.45rem 1.15rem rgba(73, 45, 40, 0.14);
    box-sizing: border-box;
}

.pet-discover-ask-feedback-menu button {
    display: block;
    width: 100%;
    min-height: 2.1rem;
    margin: 0;
    padding: 0.45rem 0.7rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: #5c3a34;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
}

.pet-discover-ask-feedback-menu button:hover,
.pet-discover-ask-feedback-menu button:focus-visible {
    background: rgba(232, 107, 90, 0.12);
    outline: none;
}

.pet-discover-ask-reply.is-error {
    background: #fff1f0;
    color: #9b2c2c;
}

.pet-discover-ask-reply.is-error .pet-discover-ask-feedback-ask {
    color: rgba(155, 44, 44, 0.75);
}

/* Pet Ask turn feedback dialog (LessonCaddie pattern, Pet chrome) */
.pet-ask-turn-feedback-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(2.5rem, 12vh, 5rem) 1rem 1rem;
    background: rgba(45, 36, 56, 0.42);
    backdrop-filter: blur(3px);
}

.pet-ask-turn-feedback-dialog {
    width: min(24rem, 100%);
    background: var(--pet-surface);
    color: var(--pet-text);
    border-radius: 1.1rem;
    box-shadow: 0 18px 48px rgba(73, 45, 40, 0.28);
    overflow: hidden;
}

.pet-ask-turn-feedback-dialog__header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem 0.55rem;
}

.pet-ask-turn-feedback-dialog__back {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--pet-text);
    cursor: pointer;
    font-size: 0.95rem;
}

.pet-ask-turn-feedback-dialog__back:hover,
.pet-ask-turn-feedback-dialog__back:focus-visible {
    background: rgba(232, 107, 90, 0.12);
    outline: none;
}

.pet-ask-turn-feedback-dialog__header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
}

.pet-ask-turn-feedback__dialog-body {
    padding: 0.25rem 1.1rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pet-ask-turn-feedback__dialog-lead {
    margin: 0;
    color: var(--pet-muted);
    font-size: 0.92rem;
}

.pet-ask-turn-feedback__dialog-lead--secondary {
    margin-top: 0.15rem;
}

.pet-ask-turn-feedback__dialog-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--pet-muted);
}

.pet-ask-turn-feedback__btn {
    appearance: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.55rem;
    border: 1px solid var(--pet-border);
    background: #fff8f3;
    color: var(--pet-muted);
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pet-ask-turn-feedback__btn:hover,
.pet-ask-turn-feedback__btn:focus-visible {
    border-color: rgba(232, 107, 90, 0.45);
    color: var(--pet-accent-dark);
    outline: none;
}

.pet-ask-turn-feedback__btn.is-selected,
.pet-ask-turn-feedback__btn[aria-pressed="true"] {
    border-color: var(--pet-accent);
    background: rgba(232, 107, 90, 0.12);
    color: var(--pet-accent-dark);
}

.pet-ask-turn-feedback__dialog-details[hidden] {
    display: none !important;
}

.pet-ask-turn-feedback__dialog-details {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pet-ask-turn-feedback__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pet-ask-turn-feedback__category {
    appearance: none;
    border: 1px solid var(--pet-border);
    background: #fff;
    color: var(--pet-muted);
    border-radius: 0.45rem;
    padding: 0.45rem 0.65rem;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
}

.pet-ask-turn-feedback__category:hover,
.pet-ask-turn-feedback__category:focus-visible {
    border-color: rgba(232, 107, 90, 0.45);
    color: var(--pet-text);
    outline: none;
}

.pet-ask-turn-feedback__category.is-selected,
.pet-ask-turn-feedback__category[aria-pressed="true"] {
    border-color: var(--pet-accent);
    background: rgba(232, 107, 90, 0.12);
    color: var(--pet-accent-dark);
    font-weight: 600;
}

.pet-ask-turn-feedback__explanation-label {
    display: block;
    font-size: 0.82rem;
    color: var(--pet-muted);
}

.pet-ask-turn-feedback__explanation {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--pet-border);
    border-radius: 0.5rem;
    padding: 0.55rem 0.65rem;
    font: inherit;
    resize: vertical;
    min-height: 4.5rem;
    background: #fff;
    color: var(--pet-text);
}

.pet-ask-turn-feedback__explanation:focus-visible {
    outline: 2px solid rgba(232, 107, 90, 0.45);
    outline-offset: 1px;
}

.pet-ask-turn-feedback-dialog__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem 1rem;
}

.pet-ask-turn-feedback-dialog__footer .pet-btn {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    border-radius: 0.55rem;
}

.pet-ask-turn-feedback-dialog__footer .pet-btn-ghost {
    border: 1.5px solid var(--pet-ink);
    color: var(--pet-ink);
}

.pet-discover-ask .pet-talk-composer--dock {
    margin: 0;
}

.pet-dashboard-ask {
    margin-top: 1.25rem;
    width: 100%;
    max-width: 36rem;
}

.pet-interviews .pet-dashboard-ask,
.pet-share .pet-dashboard-ask,
.pet-read-book.pet-hub .pet-dashboard-ask {
    margin-top: 1rem;
    max-width: none;
}

.pet-read-book--reading .pet-talk-composer-box {
    background: transparent;
}

.pet-discover-ask .pet-composer-stuck-wrap.is-hidden,
.pet-discover-ask .pet-composer-progress-wrap.is-hidden,
.pet-discover-ask .pet-composer-finish-up-wrap.is-hidden,
.pet-discover-ask [data-composer-stuck][hidden],
.pet-discover-ask [data-composer-progress][hidden],
.pet-discover-ask [data-composer-finish-up][hidden] {
    display: none !important;
}

[data-ask-updated] {
    outline: 2px solid rgba(232, 107, 90, 0.65);
    outline-offset: 2px;
    transition: outline-color 0.3s ease;
}

.pet-choice-stack {
    display: grid;
    gap: 0.55rem;
}

.pet-choice--stack {
    justify-content: flex-start;
}

.pet-family-list {
    display: grid;
    gap: 0.45rem;
}

.pet-family-empty {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px dashed rgba(232, 107, 90, 0.35);
    background: rgba(255, 248, 243, 0.75);
}

.pet-family-empty-text {
    margin: 0;
    color: var(--pet-muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.pet-family-row {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(232, 107, 90, 0.22);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 14px rgba(232, 107, 90, 0.06);
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.pet-family-row:hover {
    border-color: rgba(232, 107, 90, 0.45);
    background: #fff;
}

.pet-family-row:active {
    transform: scale(0.99);
}

.pet-family-row-text {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    flex: 1;
}

.pet-family-row-name {
    font-weight: 650;
    font-size: 0.98rem;
    color: var(--pet-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-family-row-rel {
    font-size: 0.84rem;
    color: var(--pet-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-family-row-chevron {
    flex-shrink: 0;
    color: var(--pet-accent);
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    opacity: 0.85;
}

.pet-family-editor {
    position: fixed;
    inset: 0;
    /* Above Discover Ask / compose stacks trapped in the same shell stacking context. */
    z-index: 11000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

/*
 * Hide Ask while any modal dialog is open so the prompt cannot cover dialog fields
 * (e.g. Meet Family name edit under the Answer/Ask/Do bar).
 */
#pet-app-root:has(.pet-family-editor) .pet-discover-ask,
#pet-app-root:has(.pet-draft-progress-backdrop) .pet-discover-ask,
#pet-app-root:has(.pet-photo-lightbox) .pet-discover-ask,
#pet-app-root:has([data-summary-panel]) .pet-discover-ask,
#pet-app-root:has([role="dialog"][aria-modal="true"]) .pet-discover-ask,
#pet-app-root:has(.pet-family-editor) .pet-chat-compose-stack,
#pet-app-root:has(.pet-draft-progress-backdrop) .pet-chat-compose-stack,
#pet-app-root:has(.pet-photo-lightbox) .pet-chat-compose-stack,
#pet-app-root:has([data-summary-panel]) .pet-chat-compose-stack,
#pet-app-root:has([role="dialog"][aria-modal="true"]) .pet-chat-compose-stack,
body:has(.wmb-dialog-backdrop) #pet-app-root .pet-discover-ask,
body:has(.pet-ask-turn-feedback-backdrop) #pet-app-root .pet-discover-ask,
body:has(.wmb-dialog-backdrop) #pet-app-root .pet-chat-compose-stack,
body:has(.pet-ask-turn-feedback-backdrop) #pet-app-root .pet-chat-compose-stack {
    display: none !important;
}

.pet-family-editor-backdrop {
    appearance: none;
    position: absolute;
    inset: 0;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(45, 36, 56, 0.45);
    cursor: pointer;
}

.pet-family-editor-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    max-height: min(88vh, 560px);
    overflow-y: auto;
    background: var(--pet-surface);
    border-radius: 20px 20px 0 0;
    padding: 0.65rem 1.25rem 1.35rem;
    box-shadow: 0 -12px 40px rgba(45, 36, 56, 0.18);
    display: grid;
    gap: 0.55rem;
    animation: pet-family-sheet-in 0.22s ease-out;
}

@keyframes pet-family-sheet-in {
    from {
        transform: translateY(18px);
        opacity: 0.7;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pet-family-editor-handle {
    width: 2.5rem;
    height: 0.28rem;
    border-radius: 999px;
    background: rgba(45, 36, 56, 0.18);
    margin: 0.15rem auto 0.35rem;
}

.pet-family-editor-title {
    margin: 0 0 0.15rem;
    font-size: 1.15rem;
}

.pet-family-editor-sheet select.pet-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--pet-ink-muted, #78716c) 50%),
        linear-gradient(135deg, var(--pet-ink-muted, #78716c) 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) calc(50% - 0.15rem),
        calc(100% - 0.75rem) calc(50% - 0.15rem);
    background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
    background-repeat: no-repeat;
    padding-right: 2.25rem;
}

.pet-family-relationship-other.hidden {
    display: none !important;
}

.pet-family-editor-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.pet-family-editor-actions .pet-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.pet-family-editor-remove {
    color: #fff;
    background: var(--pet-accent);
    border-color: var(--pet-accent-dark);
}

.pet-family-editor-remove:hover:not(:disabled) {
    background: var(--pet-accent-dark);
    color: #fff;
}

@container pet-shell (min-width: 640px) {
    .pet-family-editor {
        align-items: center;
        padding: 1.25rem;
    }

    .pet-family-editor-sheet {
        border-radius: var(--pet-radius);
        box-shadow: var(--pet-shadow);
        animation-name: pet-family-dialog-in;
    }

    .pet-family-editor-handle {
        display: none;
    }

    @keyframes pet-family-dialog-in {
        from {
            transform: translateY(10px) scale(0.98);
            opacity: 0.7;
        }
        to {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }
}

.pet-discover-body > .pet-form.pet-form--personality {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 0.4rem 0.7rem;
}

.pet-form--personality .pet-field {
    min-width: 0;
}

.pet-form--personality .pet-field--full-width {
    grid-column: 1 / -1;
}

.pet-form--personality .pet-field-label {
    font-size: 0.84rem;
    line-height: 1.25;
}

.pet-form--personality .pet-input {
    padding: 0.38rem 0.6rem;
}

.pet-form--personality .pet-form-error {
    grid-column: 1 / -1;
}

@container pet-shell (max-width: 480px) {
    .pet-discover-body > .pet-form.pet-form--personality {
        grid-template-columns: 1fr;
        gap: 0.38rem;
    }
}

@container pet-shell (min-width: 481px) {
    .pet-form--personality .pet-field:not(.pet-field--full-width) {
        grid-template-columns: minmax(0, 1fr);
    }
}

/*
 * Wide shells: keep page content packed at the top (no leftover-height
 * gaps between rows). Dashboard Ask stays pinned with margin-top: auto.
 */
@container pet-shell (min-width: 640px) {
    /*
     * Do not include .pet-interview-grid here: justify-content:flex-start
     * shrinks single-column auto tracks to content width and shoves cards left
     * between phone and the 720px two-column breakpoint.
     */
    .pet-discover-body > .pet-form,
    .pet-discover-body > .pet-form.pet-form--personality,
    .pet-discover-body > .pet-family-list,
    .pet-discover-body > .pet-photo-grid,
    .pet-discover-body > .pet-photos-empty,
    .pet-form--voice,
    .pet-share-body,
    .pet-read-book-empty:has(.pet-read-book-drafts),
    .pet-read-book-empty:has(.pet-read-book-draftable) {
        justify-content: flex-start;
        align-content: start;
        align-items: start;
    }

    .pet-discover-body > .pet-form,
    .pet-discover-body > .pet-family-list,
    .pet-discover-body > .pet-photo-grid,
    .pet-discover-body > .pet-photos-empty {
        flex: 0 0 auto;
        min-height: 0;
    }

    .pet-main:has(.pet-dashboard) {
        align-items: stretch;
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }

    .pet-dashboard {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        margin-inline: auto;
    }

    /* Keep destination rows stacked; leftover height sits above Previous/Next. */
    .pet-journey {
        flex: 0 0 auto;
        align-content: start;
        align-items: start;
    }

    .pet-dashboard-hero {
        flex: 1 1 auto;
        min-height: 8rem;
        max-height: min(36vh, 14rem);
    }

    .pet-dashboard-hero-img {
        max-height: min(36vh, 14rem);
        max-width: min(100%, 12rem);
    }

    .pet-dashboard .pet-linear-bottom-chrome {
        margin-top: auto;
    }

    .pet-dashboard .pet-dashboard-ask {
        margin-top: 0;
    }
}

.pet-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1rem 0.85rem;
    border: 2px dashed rgba(232, 107, 90, 0.45);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    margin: 0.65rem 0 0.5rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pet-upload-zone.is-dragover {
    border-color: var(--pet-accent);
    background: rgba(232, 107, 90, 0.1);
}

.pet-upload-icon {
    font-size: 1.5rem;
}

.pet-upload-label {
    font-weight: 700;
    color: var(--pet-accent-dark);
}

.pet-upload-hint {
    font-size: 0.92rem;
    color: var(--pet-muted);
}

.pet-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pet-photo-card {
    display: block;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    user-select: none;
    touch-action: manipulation;
}

.pet-photo-card.is-selected {
    border-color: var(--pet-accent);
}

.pet-photo-card.is-animation {
    box-shadow: 0 0 0 1px rgba(196, 98, 45, 0.28);
}

.pet-photo-card.is-avatar {
    box-shadow: 0 0 0 1px rgba(74, 98, 120, 0.28);
}

.pet-photo-card.is-selected.is-animation,
.pet-photo-card.is-selected.is-avatar {
    box-shadow: none;
}

.pet-photo-card:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 2px;
}

.pet-photo-card.is-saving {
    opacity: 0.82;
}

.pet-photo-meta {
    display: grid;
    gap: 0.45rem;
    align-content: start;
}

.pet-photo-meta-label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pet-accent-dark);
}

.pet-photo-meta-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--pet-muted);
}

.pet-photo-subject-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pet-photo-subject-pill {
    margin: 0;
    padding: 0.32rem 0.58rem;
    border: 1px solid var(--pet-border);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 650;
    color: var(--pet-text);
    cursor: pointer;
}

.pet-photo-subject-pill.is-active,
.pet-photo-subject-pill[aria-pressed="true"] {
    border-color: rgba(196, 98, 45, 0.55);
    background: rgba(255, 214, 196, 0.45);
    color: var(--pet-accent-dark);
}

.pet-photo-desc-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--pet-border);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font: inherit;
    font-size: 0.88rem;
}

.pet-photo-choice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.1rem;
    margin: 0.15rem 0 0;
}

.pet-photo-choice-row .pet-photo-animation-choice {
    margin: 0;
}

.pet-photo-animation-choice {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.15rem 0 0;
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--pet-text);
    cursor: pointer;
}

.pet-photo-animation-choice input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--pet-accent);
    flex-shrink: 0;
}

.pet-photo-caricature-choice {
    position: relative;
}

.pet-photo-caricature-soon {
    position: absolute;
    left: calc(100% + 0.45rem);
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--pet-accent);
    white-space: nowrap;
    pointer-events: none;
}

.pet-photo-caricature-soon.is-idle {
    visibility: hidden;
}

.pet-photo-chapter-select {
    width: 100%;
    box-sizing: border-box;
    min-height: 2.6rem;
    border: 1px solid var(--pet-border);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font: inherit;
    font-size: 0.92rem;
    background: #fff;
    color: var(--pet-text);
}

.pet-photo-chapter-badge {
    position: absolute;
    left: auto;
    right: 0.35rem;
    top: 0.35rem;
    bottom: auto;
    max-width: calc(100% - 0.7rem);
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(75, 48, 28, 0.82);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-photo-animation-badge {
    position: absolute;
    left: 0.35rem;
    bottom: 0.35rem;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: rgba(196, 98, 45, 0.92);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pet-photo-avatar-badge {
    position: absolute;
    left: 0.35rem;
    top: 0.35rem;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: rgba(74, 98, 120, 0.9);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pet-ask-avatar {
    display: none;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid rgba(232, 107, 90, 0.35);
    background: rgba(255, 214, 196, 0.35);
    align-self: flex-end;
    margin-bottom: 0.35rem;
}

.pet-talk-composer-box--with-avatar .pet-ask-avatar {
    width: 1.85rem;
    height: 1.85rem;
    margin: 0;
    border-width: 1px;
    align-self: center;
}

.pet-talk-composer-box .pet-talk-hear-toggle {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    align-self: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: transparent;
    color: #9a9388;
}

.pet-talk-composer-box .pet-talk-hear-toggle.is-quiet,
.pet-talk-composer-box .pet-talk-hear-toggle[data-hear="off"] {
    background: transparent;
    border: none;
    color: #5c564c;
}

.pet-ask-avatar.is-ready {
    display: block;
}

.pet-ask-avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pet-photo-thumb {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--pet-border);
    background: #fff;
}

.pet-photo-thumb-media {
    position: relative;
}

.pet-photo-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #fdeee8;
}

.pet-photo-thumb-image {
    cursor: pointer;
}

.pet-photo-card:focus-visible .pet-photo-thumb {
    outline: none;
}

.pet-photo-remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.55rem;
    height: 1.55rem;
    border: none;
    border-radius: 999px;
    background: rgba(45, 36, 56, 0.78);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(45, 36, 56, 0.25);
}

.pet-photo-remove:hover {
    background: rgba(180, 35, 24, 0.92);
}

.pet-photo-remove:disabled {
    opacity: 0.55;
    cursor: wait;
}

.pet-photo-remove-btn {
    margin: 0.35rem 0 0;
    padding: 0.55rem 0.75rem;
    min-height: 2.75rem;
    border: 1px solid var(--pet-border);
    border-radius: 10px;
    background: #fff;
    color: var(--pet-text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    cursor: pointer;
}

.pet-photo-remove-btn:hover,
.pet-photo-remove-btn:focus-visible {
    border-color: rgba(180, 35, 24, 0.45);
    color: #9b1c12;
}

.wmb-dialog.wmb-dialog--pet-photo {
    width: min(520px, 100%);
    max-height: min(92dvh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.wmb-dialog--pet-photo .wmb-dialog-header,
.wmb-dialog--pet-photo .wmb-dialog-actions {
    flex: 0 0 auto;
}

.wmb-dialog--pet-photo .wmb-dialog-body {
    max-height: none;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
}

.pet-photo-details {
    display: grid;
    gap: 0.75rem;
}

.pet-photo-details-thumb {
    margin: 0 auto;
    width: min(168px, 46vw);
}

.pet-photo-details-lightbox {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    font: inherit;
    color: inherit;
    border-radius: inherit;
}

.pet-photo-details-lightbox:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 2px;
}

.wmb-dialog--pet-photo .pet-photo-thumb-image,
.wmb-dialog--pet-photo .pet-photo-details-lightbox {
    cursor: zoom-in;
}

.wmb-dialog--pet-photo .pet-photo-caricature-soon {
    position: static;
    transform: none;
    margin-left: 0.4rem;
}

.wmb-dialog--pet-photo .pet-photo-caricature-soon.is-idle {
    display: none;
}

.wmb-dialog--pet-photo .pet-photo-subject-pill {
    padding: 0.45rem 0.7rem;
    min-height: 2.2rem;
}

.wmb-dialog--pet-photo .pet-photo-animation-choice {
    min-height: 2.2rem;
}

@media (max-width: 720px), (max-height: 780px) {
    .wmb-dialog-backdrop:has(.wmb-dialog--pet-photo) {
        align-items: stretch;
        padding: max(0.4rem, env(safe-area-inset-top, 0px))
            max(0.4rem, env(safe-area-inset-right, 0px))
            max(0.4rem, env(safe-area-inset-bottom, 0px))
            max(0.4rem, env(safe-area-inset-left, 0px));
    }

    .wmb-dialog.wmb-dialog--pet-photo {
        width: 100%;
        max-height: 100%;
        margin: auto 0;
        padding: 0.7rem 0.75rem 0.65rem;
    }

    .wmb-dialog--pet-photo .wmb-dialog-header {
        margin: 0 0 0.3rem;
    }

    .wmb-dialog--pet-photo .wmb-dialog-title {
        font-size: 0.95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wmb-dialog--pet-photo .wmb-dialog-actions {
        margin-top: 0.45rem;
    }

    .wmb-dialog--pet-photo .pet-photo-details {
        gap: 0.4rem;
    }

    .wmb-dialog--pet-photo .pet-photo-details-thumb {
        width: 5.75rem;
        margin: 0 auto;
    }

    .wmb-dialog--pet-photo .pet-photo-details-thumb figcaption {
        display: none;
    }

    .wmb-dialog--pet-photo .pet-photo-meta {
        gap: 0.32rem;
    }

    .wmb-dialog--pet-photo .pet-photo-subject-pill {
        padding: 0.28rem 0.52rem;
        min-height: 2rem;
        font-size: 0.72rem;
    }

    .wmb-dialog--pet-photo .pet-photo-chapter-select {
        min-height: 2.35rem;
        padding: 0.4rem 0.5rem;
        font-size: 0.88rem;
    }

    .wmb-dialog--pet-photo .pet-photo-chapter-hint-long,
    .wmb-dialog--pet-photo .pet-photo-optional-hint {
        display: none;
    }

    .wmb-dialog--pet-photo .pet-photo-animation-choice {
        min-height: 2rem;
        font-size: 0.8rem;
    }

    .wmb-dialog--pet-photo .pet-photo-remove-btn {
        margin-top: 0.15rem;
        min-height: 2.4rem;
        padding: 0.4rem 0.65rem;
    }
}

/* Phone viewport sim sits in a desktop window — match the compact sheet there too. */
html.wmb-vp-sim--phone .wmb-dialog-backdrop:has(.wmb-dialog--pet-photo) {
    align-items: stretch;
    padding: 0.4rem;
}

html.wmb-vp-sim--phone .wmb-dialog.wmb-dialog--pet-photo {
    width: 100%;
    max-height: 100%;
    margin: auto 0;
    padding: 0.7rem 0.75rem 0.65rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .wmb-dialog-header {
    margin: 0 0 0.3rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .wmb-dialog-title {
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .wmb-dialog-actions {
    margin-top: 0.45rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-details {
    gap: 0.4rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-details-thumb {
    width: 5.75rem;
    margin: 0 auto;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-details-thumb figcaption,
html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-chapter-hint-long,
html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-optional-hint {
    display: none;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-meta {
    gap: 0.32rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-subject-pill {
    padding: 0.28rem 0.52rem;
    min-height: 2rem;
    font-size: 0.72rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-chapter-select {
    min-height: 2.35rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.88rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-animation-choice {
    min-height: 2rem;
    font-size: 0.8rem;
}

html.wmb-vp-sim--phone .wmb-dialog--pet-photo .pet-photo-remove-btn {
    margin-top: 0.15rem;
    min-height: 2.4rem;
    padding: 0.4rem 0.65rem;
}

.pet-photo-thumb figcaption {
    font-size: 0.72rem;
    padding: 0.35rem 0.45rem;
    color: var(--pet-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-photos-empty {
    color: var(--pet-muted);
    margin: 0 0 0.5rem;
}

.pet-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.pet-photo-lightbox-backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(45, 36, 56, 0.78);
    cursor: pointer;
}

.pet-photo-lightbox-inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.65rem;
    justify-items: center;
    max-width: min(96vw, 1100px);
    max-height: min(92vh, 900px);
}

.pet-photo-lightbox-image {
    display: block;
    max-width: min(96vw, 1100px);
    max-height: min(84vh, 860px);
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(45, 36, 56, 0.4);
    background: #1a1420;
}

.pet-photo-lightbox-caption {
    margin: 0;
    max-width: min(92vw, 640px);
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pet-photo-lightbox-close {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 36, 56, 0.92);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.pet-photo-lightbox-close:hover,
.pet-photo-lightbox-close:focus-visible {
    background: var(--pet-accent-dark, #b4531e);
    outline: none;
}

.pet-dashboard-sub {
    margin: 0 0 0.4rem;
    color: var(--pet-muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.pet-dashboard-edit {
    width: 100%;
    margin-top: 0.65rem;
}

.pet-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.pet-form {
    display: grid;
    gap: 0.85rem;
}

.pet-field {
    display: grid;
    gap: 0.35rem;
    border: 0;
    margin: 0;
    padding: 0;
}

.pet-field-label {
    font-weight: 700;
}

.pet-input {
    width: 100%;
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    font: inherit;
    background: #fff;
}

.pet-choice-row {
    display: flex;
    gap: 0.75rem;
}

.pet-choice {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem;
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}

.pet-choice:has(input:checked) {
    border-color: var(--pet-accent);
    background: rgba(232, 107, 90, 0.08);
}

.pet-form-error,
.pet-boot-error {
    color: #b42318;
    margin: 0;
}

.pet-form-error.hidden,
.pet-toast.hidden {
    display: none;
}

.pet-dashboard {
    width: min(100%, 840px);
}

.pet-meta {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.5rem;
}

.pet-meta-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
}

.pet-meta dt {
    margin: 0;
    color: var(--pet-muted);
    font-weight: 600;
}

.pet-meta dd {
    margin: 0;
}

.pet-code {
    font-size: 0.82rem;
    word-break: break-all;
}

.pet-journey {
    display: grid;
    gap: 0.65rem;
}

.pet-journey-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--pet-border);
    background: #fff;
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.pet-journey-btn:hover,
.pet-journey-btn:focus-visible {
    border-color: rgba(232, 107, 90, 0.45);
    background: #fffefb;
    outline: none;
}

.pet-journey-btn:active {
    transform: scale(0.99);
}

.pet-journey-trailing {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.pet-journey-chevron {
    flex-shrink: 0;
    color: var(--pet-accent);
    font-size: 1.35rem;
    line-height: 1;
    width: 1em;
    text-align: center;
}

/*
 * Dashboard pet photo fills leftover white space between journey rows and Ask.
 * Always constrain intrinsic full-res photos — never paint at native pixels.
 */
.pet-dashboard-hero {
    margin: 0.65rem 0 0;
    padding: 0;
    min-width: 0;
    min-height: 0;
    max-height: min(36vh, 14rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
}

.pet-dashboard-hero[hidden] {
    display: none !important;
}

.pet-dashboard-hero-img {
    display: block;
    width: auto;
    max-width: min(100%, 12rem);
    max-height: min(36vh, 14rem);
    height: auto;
    object-fit: contain;
    border-radius: 14px;
}

/*
 * The dashboard is the Pet Book's phone home screen. Keep its four destinations
 * and the Ask dock together inside the viewport instead of making the shell
 * scroll past the composer.
 */
@container pet-shell (max-width: 520px) {
    .pet-app:has(.pet-dashboard) {
        height: var(--wmb-vp-sim-app-height, 100dvh);
        min-height: 0;
        max-height: var(--wmb-vp-sim-app-height, 100dvh);
        overflow: hidden;
    }

    .pet-main:has(.pet-dashboard) {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        padding: 0.32rem 0.38rem 0;
    }

    .pet-dashboard {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        padding: clamp(0.4rem, 1.25vw, 0.6rem);
        padding-bottom: 0;
    }

    .pet-dashboard-sub {
        margin-bottom: 0.2rem;
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .pet-journey {
        gap: 0.45rem;
    }

    .pet-journey-btn {
        padding: 0.58rem 0.75rem;
    }

    .pet-dashboard-hero {
        flex: 1 1 auto;
        min-height: 7rem;
        max-height: min(32vh, 14rem);
        margin-top: 0.4rem;
    }

    .pet-dashboard-hero-img {
        max-height: min(32vh, 14rem);
        max-width: min(100%, 11rem);
    }

    .pet-linear-bottom-chrome {
        margin-top: auto;
        padding-top: 0.55rem;
    }

    .pet-dashboard-ask {
        margin-top: 0;
        padding-top: 0;
    }

}

/*
 * Phone hubs: tighter padding. Title bar and Ask stay pinned by the
 * global hub lock; only the destination body scrolls.
 */
@container pet-shell (max-width: 520px) {
    .pet-main:has(.pet-hub) {
        padding: 0.32rem 0.38rem 0;
    }

    .pet-hub,
    .pet-discover-panel {
        width: 100%;
        /* Talk + compact Prev/Next sit in-flow at the shell bottom. */
        padding: 0.42rem 0.42rem 0;
    }

    .pet-interviews .pet-interview-grid {
        padding-right: 0.1rem;
    }

    .pet-read-book .pet-read-book-header {
        flex: 0 0 auto;
        margin-bottom: 0.4rem;
    }

    .pet-read-book .pet-read-book-empty {
        margin: 0;
    }
}

.pet-nav-status {
    font-size: 1.05rem;
    color: var(--pet-muted);
    white-space: nowrap;
}

.pet-nav-status--done {
    color: #15803d;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1;
}

.pet-nav-status--count {
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--pet-muted);
}

.pet-nav-status--soon {
    font-style: italic;
}

.pet-toast {
    position: fixed;
    left: 50%;
    /* Last chrome on the phone: sit on the home-indicator edge. */
    bottom: 0;
    z-index: 280;
    width: min(22rem, calc(100vw - 2rem));
    margin: 0;
    padding: 0.7rem 1rem max(0.55rem, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    text-align: center;
    color: var(--pet-text);
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.35;
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--pet-border);
    background: var(--pet-surface);
    box-shadow: 0 10px 28px rgba(45, 36, 56, 0.16);
    pointer-events: none;
}

.pet-app:has(.pet-read-book--reading) .pet-toast {
    bottom: 0;
}

.pet-read-book-header,
.pet-interviews-header,
.pet-share-header,
.pet-dashboard-header {
    margin-bottom: 0.4rem;
}

.pet-read-book-title,
.pet-interviews-title,
.pet-share-title {
    margin: 0 0 0.2rem;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    line-height: 1.2;
    color: var(--pet-text);
}

.pet-read-book-sub,
.pet-interviews-sub,
.pet-share-sub {
    margin: 0;
    color: var(--pet-muted);
    line-height: 1.35;
    font-size: 0.88rem;
}

.pet-read-book-empty {
    margin: 0;
    padding: 0.4rem 0.45rem;
    border: 1px dashed var(--pet-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.pet-read-book-empty:has(.pet-read-book-drafts),
.pet-read-book-empty:has(.pet-read-book-draftable) {
    /* Fill leftover hub height so Ask stays pinned to the card bottom. */
    flex: 1 1 0;
    min-height: 0;
    padding: 0.28rem 0.32rem;
    text-align: left;
    border: none;
    background: transparent;
}

.pet-read-book-empty-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.pet-read-book-empty-message {
    margin: 0 0 1rem;
    color: var(--pet-muted);
    line-height: 1.4;
    font-size: 0.92rem;
}

.pet-read-book-draft-warning {
    margin: 0 0 0.95rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: rgba(191, 120, 40, 0.12);
    color: #7a4510;
    line-height: 1.4;
    font-size: 0.86rem;
    text-align: left;
}

.pet-read-book-loading {
    margin: 0 0 0.65rem;
    color: var(--pet-muted);
    font-size: 0.85rem;
}

.pet-read-book-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin: 0 0 0.85rem;
}

.pet-read-book-chip {
    display: inline-block;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.pet-read-book-chip--met {
    background: rgba(46, 125, 50, 0.12);
    color: #1b5e20;
}

.pet-read-book-chip-check {
    display: inline-block;
    margin-left: 0.12em;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.08em;
}

.pet-read-book-chip--thin {
    background: rgba(191, 120, 40, 0.14);
    color: #8a4b12;
}

.pet-read-book-hint {
    flex: 1 1 100%;
    margin: 0.15rem 0 0;
    color: var(--pet-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.pet-read-book-drafts {
    list-style: none;
    margin: 0 0 0.45rem;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pet-read-book-draft-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--pet-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.pet-read-book-draft-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.pet-read-book-draft-copy strong {
    display: block;
    color: var(--pet-accent-dark);
    font-size: 0.92rem;
}

.pet-read-book-draft-meta {
    display: block;
    margin-top: 0.1rem;
    color: var(--pet-muted);
    font-size: 0.8rem;
}

.pet-read-book-draft-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    box-shadow: none;
}

.pet-read-book-draft-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 0.4rem;
}

.pet-read-book-draft-actions .pet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
}

.pet-read-book-erase-btn {
    width: auto;
    margin-top: 0;
    padding: 0 0.6rem;
    background: var(--pet-accent);
    border: 1px solid var(--pet-accent-dark);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 650;
}

.pet-read-book-erase-btn:hover:not(:disabled) {
    background: var(--pet-accent-dark);
}

.pet-read-book-draftable {
    margin: 0;
    /* Keep the gap the former "Ready to draft" heading occupied. */
    padding-top: calc(0.88rem * 1.2 + 0.4rem);
    text-align: left;
}

.pet-read-book-draftable-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pet-read-book-draftable-item {
    display: block;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(191, 90, 36, 0.28);
    border-radius: 10px;
    background: rgba(255, 248, 240, 0.75);
}

.pet-read-book-draftable-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.pet-read-book-draftable-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.pet-read-book-draftable-copy strong {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.92rem;
    color: var(--pet-accent-dark);
}

.pet-read-book-draftable-copy .pet-read-book-progress {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.25rem;
    margin: 0;
}

.pet-read-book-draftable-copy .pet-read-book-chip {
    padding: 0.2rem 0.32rem;
    font-size: 0.72rem;
    white-space: nowrap;
}

.pet-read-book-draftable-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    box-shadow: none;
}

/* Focused draft chapter: fill leftover hub height with standing progress. */
.pet-read-book-empty:has(.pet-read-book-draftable--focused) {
    display: flex;
    flex-direction: column;
}

.pet-read-book-draftable--focused {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: 0.35rem;
}

.pet-read-book-draftable--focused .pet-read-book-draftable-list {
    flex: 1 1 0;
    min-height: 0;
    gap: 0;
}

.pet-read-book-draftable-item--focused {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.8rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 248, 240, 0.92);
}

.pet-read-book-draftable-item--focused .pet-read-book-draftable-main {
    flex: 1 1 0;
    min-height: 0;
    align-items: flex-start;
}

.pet-read-book-draftable-item--focused .pet-read-book-draftable-copy {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.pet-read-book-draftable-item--focused .pet-read-book-draftable-copy strong {
    margin-bottom: 0.45rem;
    font-size: 1.12rem;
    line-height: 1.25;
}

.pet-read-book-draftable-item--focused .pet-read-book-progress {
    gap: 0.4rem;
    margin: 0 0 0.75rem;
}

.pet-read-book-draftable-item--focused .pet-read-book-chip {
    padding: 0.42rem 0.7rem;
    font-size: 0.88rem;
}

.pet-read-book-draftable-item--focused .pet-read-book-draftable-btn {
    align-self: flex-start;
    padding: 0.5rem 1.05rem;
    font-size: 0.9rem;
}

.pet-read-book-draftable-standing {
    margin: 0;
    padding-top: 0.15rem;
    color: var(--pet-muted);
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 28rem;
}

.pet-draft-progress-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(43, 34, 28, 0.42);
    backdrop-filter: blur(3px);
}

.pet-draft-progress-dialog {
    width: min(100%, 25rem);
    padding: 1.5rem;
    border: 1px solid rgba(191, 90, 36, 0.22);
    border-radius: 18px;
    background: #fffaf1;
    box-shadow: 0 1.25rem 3rem rgba(43, 34, 28, 0.28);
    text-align: center;
}

.pet-draft-progress-dialog h2 {
    margin: 0 0 0.6rem;
    color: var(--pet-text);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    line-height: 1.25;
}

.pet-draft-progress-dialog p {
    margin: 0;
    color: var(--pet-muted);
    line-height: 1.45;
}

.pet-draft-progress-bar {
    position: relative;
    height: 0.55rem;
    margin: 1.25rem 0 0.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(191, 90, 36, 0.14);
}

.pet-draft-progress-bar-fill {
    position: absolute;
    inset: 0 auto 0 -45%;
    width: 45%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--pet-accent), transparent);
    animation: pet-draft-progress-sweep 1.5s ease-in-out infinite;
}

@keyframes pet-draft-progress-sweep {
    to { transform: translateX(325%); }
}

.pet-draft-progress-elapsed {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.pet-draft-progress-note {
    margin-top: 1rem !important;
    font-size: 0.82rem;
}

.pet-read-book--reading {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    padding: 0;
}

.pet-read-book--reading .pet-linear-bottom-chrome {
    flex: 0 0 auto;
    margin: 0;
    max-width: none;
    width: 100%;
    padding: 0.1rem 0.55rem 0;
    background: transparent;
}

.pet-read-book--reading .pet-dashboard-ask {
    flex: 0 0 auto;
    margin: 0;
    max-width: none;
    width: 100%;
    padding: 0;
    background: transparent;
    border-top: none;
}

.pet-read-book-reader {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    color: var(--pet-text);
    background: #f7f0e3;
}

.pet-read-book-page-status {
    position: absolute;
    z-index: 2;
    top: 0.35rem;
    left: clamp(2.5rem, 4.5vw, 3.1rem);
    color: var(--pet-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
}

.pet-read-book-draft-tools {
    position: absolute;
    z-index: 3;
    top: 0.2rem;
    right: max(0.15rem, env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.14rem;
    width: 1.65rem;
    max-width: 1.65rem;
    overflow: visible;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.pet-read-narrate-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 11rem;
    min-width: 0;
    height: var(--pet-page-nav-btn-height);
    min-height: var(--pet-page-nav-btn-height);
    margin: 0;
    padding: 0 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
}

.pet-read-narrate-btn.is-playing,
.pet-read-narrate-btn[aria-pressed="true"] {
    background: var(--pet-accent-dark, #c94d3d);
    box-shadow: none;
}

.pet-read-reset-draft-btn {
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(63, 50, 40, 0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pet-read-reset-draft-btn svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
}

.pet-read-reset-draft-btn:hover,
.pet-read-reset-draft-btn:focus-visible {
    color: #3f3228;
    background: rgba(191, 90, 36, 0.1);
    outline: none;
}

.pet-read-book--editing .pet-read-reset-draft-btn {
    color: rgba(63, 50, 40, 0.85);
}

.pet-draft-tools-open,
.pet-draft-tools-close {
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(63, 50, 40, 0.72);
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pet-draft-tools-close {
    font-size: 1.15rem;
    font-weight: 600;
}

.pet-draft-tools-open:hover,
.pet-draft-tools-open:focus-visible,
.pet-draft-tools-close:hover,
.pet-draft-tools-close:focus-visible {
    color: #3f3228;
    background: rgba(191, 90, 36, 0.1);
    box-shadow: none;
    outline: none;
}

.pet-read-book-draft-tools.is-open .pet-draft-tools-open {
    display: none;
}

.pet-read-book-draft-tools:not(.is-open) .pet-read-book-draft-tools-panel {
    display: none;
}

.pet-read-book-draft-tools-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.14rem;
    width: 1.65rem;
    max-height: min(70vh, 28rem);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.pet-draft-tool-btn {
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(63, 50, 40, 0.78);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pet-draft-tool-btn--text {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.pet-draft-tool-btn:hover,
.pet-draft-tool-btn:focus-visible {
    color: #3f3228;
    background: rgba(191, 90, 36, 0.1);
    box-shadow: none;
    outline: none;
}

.pet-read-book--editing .pet-read-book-prose {
    overflow-y: auto;
    column-width: auto;
    column-count: 1;
}

.pet-read-book--editing .pet-read-book-page-turn,
.pet-read-book--editing .pet-read-book-tap-zone {
    visibility: hidden;
    pointer-events: none;
}

.pet-draft-comment {
    background: #fff4bf;
    border-bottom: 2px dotted #d97706;
    padding: 0 0.08em;
}

.pet-narration-active {
    background: #ffe566;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.pet-book-narration-stop {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(191, 90, 36, 0.35);
    border-radius: 999px;
    background: #fff7ed;
    color: var(--pet-accent-dark, #8a4b12);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.pet-book-narration-stop:hover,
.pet-book-narration-stop:focus-visible {
    border-color: rgba(191, 90, 36, 0.6);
    box-shadow: 0 0 0 3px rgba(191, 90, 36, 0.14);
    outline: none;
}

.pet-read-book-page-shell {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    /* Clip CSS-column bleed — next page must not paint colorful edge fragments. */
    overflow: hidden;
    padding: clamp(1.1rem, 2.5vw, 1.5rem) clamp(2.5rem, 4.5vw, 3.1rem) 0.45rem;
}

.pet-read-book-prose {
    height: 100%;
    overflow: hidden;
    contain: paint;
    isolation: isolate;
    column-fill: auto;
    /* Gap keeps the next page off the clip edge (subpixel AA bleed). */
    --pet-read-column-gap: 1.25rem;
    column-gap: var(--pet-read-column-gap);
    column-width: 100%;
    color: #2f261d;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.03rem, 1.7vw, 1.16rem);
    line-height: 1.75;
    outline: none;
    scroll-behavior: smooth;
    text-align: left;
    touch-action: pan-y;
}

.pet-read-book-prose:focus-visible {
    box-shadow: 0 0 0 3px rgba(232, 107, 90, 0.4);
}

.pet-read-book-prose > :first-child { margin-top: 0; }
.pet-read-book-prose p { margin: 0 0 1.1em; }
.pet-read-book-chapter-title {
    font-size: 1.16em;
    margin: 0 0 0.45em;
    padding-right: 2.1rem;
    min-height: 1.65rem;
    box-sizing: border-box;
    break-after: avoid;
    font-weight: 700;
}
.pet-read-book-chapter-photo {
    margin: 0 0 1.1em;
    break-inside: avoid;
    /* Reserve space before async photo hydrate so CSS columns do not reflow late. */
    aspect-ratio: 4 / 3;
    max-height: 42vh;
    width: 100%;
    overflow: hidden;
    background: rgba(111, 82, 50, 0.06);
    border-radius: 4px;
}
.pet-read-book-chapter-photo-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 42vh;
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
}
.pet-read-book-prose h1,
.pet-read-book-prose h2,
.pet-read-book-prose h3 {
    break-after: avoid;
    color: #422e20;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.25;
}
.pet-read-book-prose h1 { font-size: 1.16em; margin: 0 0 0.5em; }
.pet-read-book-prose h2 { font-size: 1.05em; margin: 1em 0 0.45em; }
.pet-read-book-prose h3 { font-size: 1em; margin: 0.85em 0 0.4em; }
.pet-read-book-prose blockquote {
    margin: 0 0 1.1em;
    padding-left: 1em;
    border-left: 3px solid rgba(191, 90, 36, 0.55);
    color: #5d4b3d;
    font-style: italic;
}
.pet-read-book-prose ul,
.pet-read-book-prose ol { margin: 0 0 1.1em; padding-left: 1.45em; }
.pet-read-book-prose li { break-inside: avoid; margin-bottom: 0.35em; }
.pet-read-book-prose hr { margin: 1.5em 0; border: 0; border-top: 1px solid rgba(111, 82, 50, 0.28); }
.pet-read-book-prose code { padding: 0.08em 0.25em; border-radius: 3px; background: rgba(111, 82, 50, 0.1); font-family: ui-monospace, monospace; font-size: 0.86em; }
.pet-read-book-prose a { color: var(--pet-accent-dark); text-decoration-thickness: 1px; }
.pet-read-book-prose-empty { color: var(--pet-muted); }

/* Legacy chevron controls — kept in markup for tests; Kindle tap zones own paging. */
.pet-read-book-page-turn {
    display: none;
}

.pet-read-book-tap-zone {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pet-read-book-tap-zone:focus-visible {
    outline: 2px solid rgba(75, 68, 61, 0.32);
    outline-offset: -2px;
}

.pet-read-book-tap-zone:disabled {
    visibility: hidden;
    pointer-events: none;
}

.pet-read-book-tap-zone--previous {
    left: 0;
    width: 40%;
}

.pet-read-book-tap-zone--next {
    right: 0;
    width: 60%;
}

/* Stop-in-composer while chapter narration plays — stop only, no other icons. */
.pet-discover-ask[data-book-narrating] .pet-talk-input,
.pet-discover-ask[data-book-narrating] .pet-ask-avatar,
.pet-discover-ask[data-book-narrating] .pet-talk-hear-toggle,
.pet-discover-ask[data-book-narrating] .pet-talk-composer-actions {
    display: none !important;
}

.pet-discover-ask[data-book-narrating] .pet-talk-composer-box {
    gap: 0;
    justify-content: stretch;
}

.pet-discover-ask[data-book-narrating] .pet-book-narration-stop--composer {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(191, 90, 36, 0.35);
    border-radius: 999px;
    background: #fff7ed;
    color: var(--pet-accent-dark, #8a4b12);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.pet-book-narration-stop--composer {
    display: none;
}

.pet-discover-ask[data-book-narrating] .pet-book-narration-stop--composer:hover,
.pet-discover-ask[data-book-narrating] .pet-book-narration-stop--composer:focus-visible {
    border-color: rgba(191, 90, 36, 0.6);
    box-shadow: 0 0 0 3px rgba(191, 90, 36, 0.14);
    outline: none;
}

.pet-read-book-empty--ready_to_draft {
    border-style: solid;
    border-color: rgba(191, 90, 36, 0.35);
    background: rgba(255, 248, 240, 0.9);
}

.pet-read-book-empty--gathering {
    border-color: rgba(191, 120, 40, 0.28);
}

.pet-read-book-empty > .pet-btn-secondary {
    margin-top: 0.55rem;
}

.pet-share-card {
    padding: 0.85rem 1rem;
    border: 1px dashed var(--pet-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.pet-share-card-kicker {
    margin: 0 0 0.25rem;
    color: var(--pet-accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.pet-share-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.pet-share-card > p:not(.pet-share-card-kicker) {
    margin: 0;
    color: var(--pet-muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.pet-share-soon {
    display: inline-block;
    margin-top: 0.55rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(191, 120, 40, 0.14);
    color: #8a4b12;
    font-size: 0.78rem;
    font-weight: 700;
}

.pet-back-link {
    display: inline-block;
    margin-bottom: 0.2rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pet-accent-dark);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.pet-interview-chat-title {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.2;
    min-width: 0;
    flex: 1 1 auto;
}

.pet-interview-chat-sub {
    margin: 0;
    color: var(--pet-muted);
    line-height: 1.45;
    font-size: 0.95rem;
}

.pet-interviews-loading {
    color: var(--pet-muted);
    font-style: italic;
}

/* Match Read My Book chapter cards (.pet-read-book-draft-item / draftable). */
.pet-interview-grid {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.45rem;
    width: 100%;
    justify-items: stretch;
    align-content: start;
}

@container pet-shell (min-width: 720px) {
    .pet-interview-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }
}

.pet-interview-card {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--pet-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
}

.pet-interview-card-done {
    display: none;
    margin-left: 0.28em;
    color: #1b5e20;
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1;
}

.pet-interview-card--soon {
    opacity: 0.78;
    background: rgba(255, 248, 240, 0.55);
}

.pet-interview-card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.pet-interview-card-text {
    min-width: 0;
    flex: 1 1 auto;
}

.pet-interview-card-title {
    margin: 0 0 0.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pet-accent-dark);
}

.pet-interview-card-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 0.12rem;
}

.pet-interview-chip {
    display: inline-block;
    padding: 0.2rem 0.32rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.pet-interview-chip--met {
    background: rgba(46, 125, 50, 0.12);
    color: #1b5e20;
}

.pet-interview-chip--thin {
    background: rgba(191, 120, 40, 0.14);
    color: #8a4b12;
}

.pet-interview-chip--new {
    background: rgba(120, 100, 90, 0.1);
    color: var(--pet-muted);
}

.pet-interview-chip--soon {
    background: rgba(120, 100, 90, 0.1);
    color: var(--pet-muted);
}

.pet-interview-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.3rem;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.25;
    color: var(--pet-muted);
}

.pet-interview-card-meta-sep {
    color: var(--pet-border);
    font-weight: 700;
}

.pet-interview-card-meta-item {
    color: var(--pet-muted);
}

.pet-interview-card-cta {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    white-space: nowrap;
    box-shadow: none;
    min-height: 2rem;
}

/*
 * Phone destination chrome matches Read My Book. Stories cards stay denser so
 * the topic list fits one screen; pills hide and complete uses a check.
 */
@container pet-shell (max-width: 520px) {
    .pet-interviews-header,
    .pet-read-book-header,
    .pet-share-header,
    .pet-dashboard-header {
        margin-bottom: 0.2rem;
    }

    .pet-interviews-title,
    .pet-read-book-title,
    .pet-share-title,
    .pet-dashboard-title,
    .pet-discover .pet-screen-title {
        margin: 0 0 0.1rem;
        font-size: 1.18rem;
        line-height: 1.12;
        color: var(--pet-text);
    }

    .pet-interviews-sub,
    .pet-read-book-sub,
    .pet-share-sub,
    .pet-dashboard-sub,
    .pet-discover .pet-screen-lead {
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .pet-discover .pet-screen-lead {
        margin: 0 0 0.2rem;
    }

    .pet-interview-grid {
        gap: 0.22rem;
        margin-top: 0.04rem;
    }

    .pet-interview-card {
        padding: 0.28rem 0.4rem;
        border-radius: 8px;
    }

    .pet-interview-card-body {
        align-items: center;
        gap: 0.4rem;
    }

    .pet-interview-card-title {
        margin: 0;
        font-size: 0.86rem;
        line-height: 1.2;
    }

    .pet-interview-card-chips {
        display: none;
    }

    .pet-interview-card-done {
        display: inline;
    }

    .pet-interview-card-meta {
        margin-top: 0.04rem;
        font-size: 0.7rem;
        line-height: 1.15;
    }

    .pet-interview-card-cta {
        padding: 0.28rem 0.55rem;
        font-size: 0.74rem;
        min-height: 1.7rem;
        box-shadow: none;
    }

    .pet-interviews .pet-dashboard-ask,
    .pet-share .pet-dashboard-ask,
    .pet-read-book.pet-hub .pet-dashboard-ask {
        margin-top: 0.2rem;
    }
}

.pet-interview-chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    padding: 0.32rem 0.55rem 0.18rem;
    overflow: hidden;
}

.pet-interview-chat-header {
    flex: 0 0 auto;
    margin-bottom: 0.55rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--pet-border);
}

.pet-interview-chat-header-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

.pet-interview-chat-header-row + .pet-interview-chat-sub {
    margin-top: 0.35rem;
}

.pet-interview-chat-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.15rem;
    flex: 0 0 auto;
    margin: 0;
    min-width: 0;
}

.pet-chat-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pet-chat-compose-stack {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    padding-top: 0.35rem;
    border-top: 1px solid var(--pet-border);
}

.pet-chat-compose-stack .pet-discover-ask-row {
    align-items: flex-end;
}

.pet-chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
    padding: 0.12rem 0 0.28rem;
}

.pet-chat-thread::-webkit-scrollbar {
    display: none;
}

/* Topic pager chrome removed — Kindle edge taps + swipe; proxies stay visually-hidden. */
.pet-interview-nav-row {
    margin: 0;
    padding: 0;
    border: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    position: absolute;
}

.pet-interview-nav-clear,
.pet-interview-nav-restore {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.35rem 0.55rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

/* Phone: icon-only Clear/Restore on the title stub row. */
@container pet-shell (max-width: 520px) {
    .pet-interview-chat-header-row {
        gap: 0.3rem;
    }

    .pet-interview-chat-actions {
        margin: 0;
    }

    .pet-interview-nav-clear,
    .pet-interview-nav-restore {
        gap: 0;
        padding: 0.4rem;
        min-width: 2rem;
        min-height: 2rem;
        justify-content: center;
    }

    .pet-interview-nav-clear > span,
    .pet-interview-nav-restore > span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .pet-main:has(.pet-interview-chat) {
        padding-left: 0.28rem;
        padding-right: 0.28rem;
    }

    .pet-interview-chat {
        padding-left: 0.38rem;
        padding-right: 0.38rem;
    }
}

.pet-interview-nav-clear {
    color: #c45c4e;
}

.pet-interview-nav-restore {
    color: #5a6b7a;
}

.pet-interview-nav-clear > i,
.pet-interview-nav-restore > i {
    font-size: 0.85rem;
    line-height: 1;
}

.pet-interview-nav-clear:hover {
    background: rgba(196, 92, 78, 0.1);
}

.pet-interview-nav-restore:hover:not(:disabled) {
    background: rgba(90, 107, 122, 0.12);
}

.pet-interview-nav-restore:disabled {
    opacity: 0.38;
    cursor: default;
}

.pet-interview-nav-clear:focus-visible,
.pet-interview-nav-restore:focus-visible {
    outline: 2px solid var(--pet-accent);
    outline-offset: 1px;
}

.pet-chat-msg {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
}

.pet-chat-msg--user {
    align-self: flex-end;
    margin-left: 30px;
    max-width: min(calc(100% - 30px), 36rem);
}

.pet-chat-msg--pet {
    align-self: flex-start;
    max-width: 100%;
}

.pet-chat-msg-answer {
    width: 100%;
}

.pet-chat-msg--pet .pet-discover-ask-feedback-menu-button {
    color: var(--pet-muted);
}

.pet-chat-msg-body {
    margin: 0;
    padding: 0.06rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--pet-text);
    line-height: 1.32;
    white-space: pre-wrap;
    text-align: left;
    word-break: break-word;
}

.pet-chat-msg--pet .pet-chat-msg-body {
    background: transparent;
    color: var(--pet-text);
}

.pet-chat-msg--user .pet-chat-msg-body {
    padding: 0.28rem 0.55rem;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid var(--pet-border);
    line-height: 1.32;
}

/* LessonCaddie-style Thinking… while Agent Core works */
.pet-chat-msg--thinking .pet-chat-thinking-text,
.pet-ask-thinking-text {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0.06rem 0;
    color: var(--pet-muted);
    font-weight: 600;
    letter-spacing: 0.01em;
    background-image: linear-gradient(
        110deg,
        var(--pet-muted) 35%,
        var(--pet-text) 50%,
        var(--pet-muted) 65%
    );
    background-position: 100% 50%;
    background-repeat: no-repeat;
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pet-ask-thinking-shimmer 1.8s ease-in-out infinite;
}

.pet-discover-ask-reply.is-thinking .pet-ask-thinking,
.pet-discover-ask-reply.is-thinking {
    color: var(--pet-muted);
}

@keyframes pet-ask-thinking-shimmer {
    to {
        background-position: 0 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pet-chat-msg--thinking .pet-chat-thinking-text,
    .pet-ask-thinking-text {
        background: none;
        -webkit-text-fill-color: currentColor;
        animation: none;
    }
}

/* ── Pet talk composer (Discuss-style) ─────────────────────────────────────── */

.pet-btn-ghostwriter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem;
    border: 1.5px solid var(--pet-ink);
    border-radius: 8px;
    background: transparent;
    color: var(--pet-ink);
    font: inherit;
    font-size: clamp(0.72rem, 1.2vw, 0.86rem);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-height: 1.38rem;
    line-height: 1.2;
}

.pet-btn-ghostwriter:hover:not(:disabled) {
    background: rgba(var(--pet-ink-rgb), 0.08);
}

.pet-btn-ghostwriter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pet-btn-ghostwriter--talk-active {
    background: rgba(var(--pet-ink-rgb), 0.12);
}

.pet-composer-tools-row--right .pet-composer-tools-middle {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

.pet-composer-answering-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: auto;
}

.pet-composer-answering {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.2rem 0.15rem;
    font-size: 0.78rem;
    color: #5c534a;
}

.pet-composer-answering-label {
    flex: 0 0 auto;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pet-composer-answering-select {
    min-width: 0;
    max-width: 11rem;
    border: 1px solid rgba(92, 83, 74, 0.22);
    border-radius: 999px;
    background: #fff;
    color: #2f2a26;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 1.6rem 0.28rem 0.65rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c534a' d='M1.2 1.3 6 6l4.8-4.7 1.1 1.1L6 8.2.1 2.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 0.65rem;
    cursor: pointer;
}

.pet-composer-answering-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pet-composer-stuck-wrap,
.pet-composer-progress-wrap,
.pet-composer-finish-up-wrap {
    position: relative;
}

.pet-composer-progress {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #fff;
    --pet-progress-pct: 0%;
    --pet-progress-fill: #3f9d6a;
}

.pet-composer-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--pet-progress-pct, 0%);
    background: var(--pet-progress-fill);
    opacity: 0.88;
    transition: width 0.35s ease;
    z-index: 0;
    pointer-events: none;
}

.pet-composer-progress-label {
    position: relative;
    z-index: 1;
    color: var(--pet-ink);
    mix-blend-mode: multiply;
}

.pet-composer-progress[aria-valuenow="0"] .pet-composer-progress-fill {
    opacity: 0;
}

.pet-composer-progress:hover:not(:disabled) {
    background: #fff;
}

.pet-composer-progress:hover:not(:disabled) .pet-composer-progress-fill {
    opacity: 1;
}

.pet-talk-composer {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.pet-talk-composer-box {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.4rem 0.35rem 0.45rem;
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pet-talk-composer-box:hover,
.pet-talk-composer-box:focus-within {
    border-color: rgba(232, 107, 90, 0.45);
    box-shadow: 0 0 0 2px rgba(232, 107, 90, 0.12);
}

.pet-talk-input {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: none;
    border-radius: 12px;
    padding: 0.45rem 2.6rem 0.45rem 0;
    min-height: 2.1rem;
    max-height: none;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    resize: none;
    overflow-y: hidden;
    background: transparent;
}

.pet-talk-input:focus {
    outline: none;
}

.pet-talk-input::placeholder {
    color: var(--pet-muted);
}

.pet-talk-composer-actions {
    position: absolute;
    top: 0.35rem;
    right: 0.32rem;
    bottom: 0.35rem;
    display: grid;
    grid-template-areas: "slot";
    align-items: center;
    justify-items: end;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

.pet-talk-composer-actions > * {
    grid-area: slot;
    pointer-events: auto;
}

.pet-talk-composer--voice-mode .pet-talk-composer-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.28rem;
    z-index: 5;
}

.pet-talk-composer--voice-mode .pet-talk-composer-actions > * {
    grid-area: auto;
}

.pet-talk-composer--voice-mode .pet-talk-input {
    pointer-events: none;
    padding-right: 6.4rem;
}

.pet-talk-composer-box[data-voice-phase="listening"] .pet-talk-input {
    z-index: 0;
}

.pet-talk-composer-box[data-voice-phase="listening"] .pet-talk-composer-actions {
    z-index: 5;
}

.pet-talk-hear,
.workspace-talk-hear.pet-talk-hear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--pet-text) 18%, transparent);
    border-radius: 999px;
    background: #fff;
    color: var(--pet-text);
    cursor: pointer;
    z-index: 3;
}

.pet-talk-hear.is-quiet,
.pet-talk-hear[data-hear="off"],
.workspace-talk-hear.pet-talk-hear.is-quiet,
.workspace-talk-hear.pet-talk-hear[data-hear="off"] {
    background: #111;
    border-color: #111;
    color: #fff;
}

.pet-talk-dictate,
.pet-talk-mute,
.workspace-talk-dictate.pet-talk-dictate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--pet-text);
    cursor: pointer;
}

.pet-talk-start-voice,
.workspace-talk-start-voice.pet-talk-start-voice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--pet-ink, #3A312C);
    color: #fff;
    cursor: pointer;
    overflow: hidden;
}

.pet-talk-start-voice .workspace-talk-start-voice__label {
    display: none;
}

.pet-talk-voice-end,
.workspace-talk-voice-end.pet-talk-voice-end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.pet-talk-hear .voice-icon,
.workspace-talk-hear.pet-talk-hear .voice-icon {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    min-height: 1.15rem;
}

.pet-talk-composer .voice-icon,
.pet-talk-dictate .voice-icon,
.pet-talk-start-voice .voice-icon,
.pet-talk-mute .voice-icon,
.pet-talk-voice-end .voice-icon {
    display: block;
    width: 0.95rem;
    height: 0.95rem;
    min-width: 0.95rem;
    min-height: 0.95rem;
}

.pet-talk-dictate[hidden],
.pet-talk-mute[hidden],
.pet-talk-hear[hidden],
.pet-talk-start-voice[hidden],
.pet-talk-voice-end[hidden],
.workspace-talk-hear.pet-talk-hear[hidden],
.workspace-talk-start-voice.pet-talk-start-voice[hidden],
.workspace-talk-voice-end.pet-talk-voice-end[hidden] {
    display: none !important;
}

.pet-chat-body > .discuss-voice-stage,
.pet-chat-body .discuss-voice-stage {
    display: none !important;
}

.pet-talk-composer-box {
    --ask-mic-level: 0;
}

.pet-talk-composer-box[data-voice-phase="listening"] {
    cursor: pointer;
    overflow: visible;
    isolation: isolate;
    transition: border-color 0.15s ease, background 0.15s ease;
    background: radial-gradient(
        circle at 38% 32%,
        #fff 0%,
        color-mix(in srgb, #059669 calc(48% + (var(--ask-mic-level, 0) * 18%)), #6ee7b7) 55%,
        color-mix(in srgb, #059669 20%, #ecfdf5) 100%
    );
    border-color: color-mix(in srgb, #059669 calc(55% + (var(--ask-mic-level, 0) * 20%)), transparent);
    box-shadow:
        0 0 0 calc(2px + (var(--ask-mic-level, 0) * 4px)) color-mix(in srgb, #059669 calc(22% + (var(--ask-mic-level, 0) * 38%)), transparent),
        0 0 calc(6px + (var(--ask-mic-level, 0) * 10px)) color-mix(in srgb, #34d399 calc(16% + (var(--ask-mic-level, 0) * 28%)), transparent);
}

.pet-talk-composer-box[data-voice-phase="listening"]::before,
.pet-talk-composer-box[data-voice-phase="listening"]::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    border: 2px solid color-mix(in srgb, #059669 calc(38% + (var(--ask-mic-level, 0) * 32%)), transparent);
}

.pet-talk-composer-box[data-voice-phase="listening"]::before {
    inset: calc(-3px - (var(--ask-mic-level, 0) * 4px));
    opacity: calc(0.28 + var(--ask-mic-level, 0) * 0.5);
}

.pet-talk-composer-box[data-voice-phase="listening"]::after {
    inset: calc(-6px - (var(--ask-mic-level, 0) * 6px));
    opacity: calc(0.14 + var(--ask-mic-level, 0) * 0.4);
}

.pet-talk-composer-box[data-voice-hearing="1"] {
    box-shadow:
        0 0 0 calc(3px + (var(--ask-mic-level, 0) * 5px)) color-mix(in srgb, #059669 calc(32% + (var(--ask-mic-level, 0) * 36%)), transparent),
        0 0 calc(8px + (var(--ask-mic-level, 0) * 12px)) color-mix(in srgb, #34d399 calc(22% + (var(--ask-mic-level, 0) * 30%)), transparent);
}

.pet-talk-composer-box[data-voice-hearing="1"]::before {
    opacity: calc(0.5 + var(--ask-mic-level, 0) * 0.4);
}

.pet-talk-composer-box[data-voice-hearing="1"]::after {
    animation: pet-talk-listen-ring 0.9s ease-out infinite;
}

.pet-talk-composer-box[data-voice-phase="listening"] > * {
    position: relative;
    z-index: 1;
}

.pet-talk-composer-box[data-voice-phase="listening"]:hover,
.pet-talk-composer-box[data-voice-phase="listening"]:focus-within {
    border-color: color-mix(in srgb, #059669 80%, #047857);
}

.pet-talk-composer-box[data-voice-phase="listening"] .pet-talk-voice-end,
.pet-talk-composer-box[data-voice-phase="listening"] .workspace-talk-voice-end {
    overflow: visible;
    box-shadow:
        0 0 0 calc(2px + (var(--ask-mic-level, 0) * 4px)) color-mix(in srgb, #059669 calc(36% + (var(--ask-mic-level, 0) * 34%)), transparent),
        0 0 0 calc(5px + (var(--ask-mic-level, 0) * 7px)) color-mix(in srgb, #34d399 calc(16% + (var(--ask-mic-level, 0) * 28%)), transparent);
}

.pet-talk-composer-box[data-voice-hearing="1"] .pet-talk-voice-end,
.pet-talk-composer-box[data-voice-hearing="1"] .workspace-talk-voice-end {
    animation: pet-talk-listen-end-pulse 0.85s ease-out infinite;
}

.pet-talk-composer-box[data-voice-phase="listening"] .pet-talk-input,
.pet-talk-composer-box[data-voice-phase="listening"] .pet-talk-input::placeholder,
.pet-talk-composer-box[data-voice-phase="listening"] .workspace-talk-input,
.pet-talk-composer-box[data-voice-phase="listening"] .workspace-talk-input::placeholder {
    color: #064e3b;
    cursor: text;
}

/* Pet is talking — warm coral, not the green “your turn” treatment. */
.pet-talk-composer-box[data-voice-phase="speaking"] {
    cursor: pointer;
    overflow: visible;
    isolation: isolate;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    background: radial-gradient(
        circle at 62% 28%,
        #fff 0%,
        color-mix(in srgb, #e86b5a 38%, #ffe8e2) 52%,
        color-mix(in srgb, #e86b5a 14%, #fff5f2) 100%
    );
    border-color: color-mix(in srgb, #e86b5a 55%, transparent);
    box-shadow:
        0 0 0 2px color-mix(in srgb, #e86b5a 18%, transparent),
        0 0 10px color-mix(in srgb, #e86b5a 14%, transparent);
}

.pet-talk-composer-box[data-voice-phase="speaking"]::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    border: 2px solid color-mix(in srgb, #e86b5a 32%, transparent);
    opacity: 0.55;
    animation: pet-talk-speak-glow 1.4s ease-in-out infinite;
}

.pet-talk-composer-box[data-voice-phase="speaking"] > * {
    position: relative;
    z-index: 1;
}

.pet-talk-composer-box[data-voice-phase="speaking"] .pet-talk-input,
.pet-talk-composer-box[data-voice-phase="speaking"] .pet-talk-input::placeholder,
.pet-talk-composer-box[data-voice-phase="speaking"] .workspace-talk-input,
.pet-talk-composer-box[data-voice-phase="speaking"] .workspace-talk-input::placeholder {
    color: #7a2e24;
    cursor: pointer;
}

.pet-talk-composer-box[data-voice-phase="speaking"]:hover,
.pet-talk-composer-box[data-voice-phase="speaking"]:focus-within {
    border-color: color-mix(in srgb, #e86b5a 78%, #c44a3a);
}

/* Waiting / thinking — calm neutral, neither green nor coral. */
.pet-talk-composer-box[data-voice-phase="thinking"] {
    cursor: default;
    overflow: visible;
    isolation: isolate;
    transition: border-color 0.15s ease, background 0.15s ease;
    background: radial-gradient(
        circle at 40% 30%,
        #fff 0%,
        color-mix(in srgb, #64748b 16%, #f1f5f9) 55%,
        #e8eef4 100%
    );
    border-color: color-mix(in srgb, #64748b 28%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, #94a3b8 14%, transparent);
}

.pet-talk-composer-box[data-voice-phase="thinking"] .pet-talk-input,
.pet-talk-composer-box[data-voice-phase="thinking"] .pet-talk-input::placeholder,
.pet-talk-composer-box[data-voice-phase="thinking"] .workspace-talk-input,
.pet-talk-composer-box[data-voice-phase="thinking"] .workspace-talk-input::placeholder {
    color: #475569;
    cursor: default;
}

@keyframes pet-talk-speak-glow {
    0%,
    100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

.pet-talk-mic.pet-talk-orb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--pet-text);
    cursor: pointer;
    overflow: visible;
    --ask-mic-level: 0;
}

.pet-talk-orb__ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--pet-ink, #3A312C) 45%, transparent);
    opacity: 0;
    pointer-events: none;
}

.pet-talk-orb__ring--outer {
    inset: -11px;
}

.pet-talk-orb__ring--mid {
    inset: -7px;
}

.pet-talk-orb__ring--inner {
    inset: -3px;
}

.pet-talk-orb__core {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: visible;
    font-size: 0.92rem;
    line-height: 1;
    color: inherit;
    background: color-mix(in srgb, #fff 82%, var(--pet-ink, #3A312C));
    box-shadow: 0 1px 4px rgba(45, 36, 56, 0.12);
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

/* Size both webfont <i> and FA kit <svg> — grid + 1em SVG can collapse to a blank circle, especially in phone/narrow frames. */
.pet-talk-orb__core i,
.pet-talk-orb__core svg {
    display: block;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
    font-size: 1em;
    line-height: 1;
    flex: 0 0 auto;
    overflow: visible;
    color: inherit;
    fill: currentColor;
    text-align: center;
    transform: translateZ(0);
}

.pet-talk-orb:hover .pet-talk-orb__core {
    background: color-mix(in srgb, var(--pet-ink, #3A312C) 16%, #fff);
    color: var(--pet-ink, #3A312C);
}

.pet-talk-orb--active .pet-talk-orb__core,
.pet-talk-mic--recording .pet-talk-orb__core {
    background: var(--pet-ink, #3A312C);
    color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pet-ink, #3A312C) 28%, transparent),
        0 4px 12px rgba(var(--pet-ink-rgb), 0.28);
}

/* Ask / command voice: listening stays a green mic with rings. End ends the session. */
.pet-talk-composer--command-voice .pet-talk-orb--active .pet-talk-orb__core,
.pet-talk-composer--command-voice .pet-talk-mic--recording .pet-talk-orb__core {
    background: #059669;
    color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, #059669 28%, transparent),
        0 4px 12px rgba(5, 150, 105, 0.28);
}

.pet-talk-composer--command-voice .pet-talk-orb--active .pet-talk-orb__ring,
.pet-talk-composer--command-voice .pet-talk-mic--recording .pet-talk-orb__ring {
    border-color: color-mix(in srgb, #059669 55%, transparent);
}

.pet-talk-composer--command-voice.pet-talk-composer--voice-mode [data-composer-talk] {
    pointer-events: none;
    cursor: default;
}

.pet-talk-orb--active .pet-talk-orb__ring,
.pet-talk-mic--recording .pet-talk-orb__ring {
    opacity: 0.9;
    animation: pet-talk-orb-ring 1.6s ease-out infinite;
}

.pet-talk-orb--active .pet-talk-orb__ring--mid,
.pet-talk-mic--recording .pet-talk-orb__ring--mid {
    animation-delay: 0.2s;
}

.pet-talk-orb--active .pet-talk-orb__ring--inner,
.pet-talk-mic--recording .pet-talk-orb__ring--inner {
    animation-delay: 0.4s;
}

/* Ask / command voice: no decorative loop. Listening uses real RMS. */
.pet-talk-composer--command-voice .pet-talk-orb--active .pet-talk-orb__ring,
.pet-talk-composer--command-voice .pet-talk-mic--recording .pet-talk-orb__ring {
    animation: none;
}

.pet-talk-composer--command-voice .pet-talk-orb--active:not(.pet-talk-orb--mic-live) .pet-talk-orb__ring,
.pet-talk-composer--command-voice .pet-talk-mic--recording:not(.pet-talk-orb--mic-live) .pet-talk-orb__ring {
    opacity: 0.55;
}

.pet-talk-orb--mic-live .pet-talk-orb__ring {
    animation: none;
}

.pet-talk-orb--mic-live .pet-talk-orb__ring--outer {
    transform: scale(calc(1 + var(--ask-mic-level) * 0.8));
    opacity: calc(0.24 + var(--ask-mic-level) * 0.72);
}

.pet-talk-orb--mic-live .pet-talk-orb__ring--mid {
    transform: scale(calc(1 + var(--ask-mic-level) * 0.55));
    opacity: calc(0.2 + var(--ask-mic-level) * 0.68);
}

.pet-talk-orb--mic-live .pet-talk-orb__ring--inner {
    transform: scale(calc(1 + var(--ask-mic-level) * 0.32));
    opacity: calc(0.16 + var(--ask-mic-level) * 0.64);
}

.pet-talk-orb--hearing .pet-talk-orb__core {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pet-ink, #3A312C) 42%, transparent),
        0 4px 12px rgba(var(--pet-ink-rgb), 0.28);
}

.pet-talk-composer--command-voice .pet-talk-orb--hearing .pet-talk-orb__core {
    box-shadow: 0 0 0 2px color-mix(in srgb, #059669 42%, transparent),
        0 4px 12px rgba(5, 150, 105, 0.28);
}

@keyframes pet-talk-orb-ring {
    0% { transform: scale(0.92); opacity: 0.85; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes pet-talk-listen-ring {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(1.08); opacity: 0; }
}

@keyframes pet-talk-listen-end-pulse {
    0% {
        box-shadow:
            0 0 0 2px color-mix(in srgb, #059669 50%, transparent),
            0 0 0 6px color-mix(in srgb, #34d399 24%, transparent);
    }
    100% {
        box-shadow:
            0 0 0 6px color-mix(in srgb, #059669 10%, transparent),
            0 0 0 11px color-mix(in srgb, #34d399 0%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pet-talk-orb--active .pet-talk-orb__ring,
    .pet-talk-mic--recording .pet-talk-orb__ring,
    .pet-talk-orb--mic-live .pet-talk-orb__ring--outer,
    .pet-talk-orb--mic-live .pet-talk-orb__ring--mid,
    .pet-talk-orb--mic-live .pet-talk-orb__ring--inner,
    .pet-talk-composer-box[data-voice-hearing="1"]::before,
    .pet-talk-composer-box[data-voice-hearing="1"]::after,
    .pet-talk-composer-box[data-voice-hearing="1"] .pet-talk-voice-end,
    .pet-talk-composer-box[data-voice-hearing="1"] .workspace-talk-voice-end,
    .pet-talk-composer-box[data-voice-phase="speaking"]::before {
        animation: none;
        transform: none !important;
    }
}

.pet-talk-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--pet-ink);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: opacity 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.pet-talk-composer-box:has(.pet-talk-input:not(:placeholder-shown)) .pet-talk-send {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.pet-talk-composer-box:has(.pet-talk-input:not(:placeholder-shown)) .pet-talk-start-voice,
.pet-talk-composer-box:has(.pet-talk-input:not(:placeholder-shown)) .workspace-talk-start-voice {
    display: none !important;
}

.pet-talk-composer--voice-mode .pet-talk-send {
    opacity: 0 !important;
    pointer-events: none !important;
}

.pet-talk-send:hover:not(:disabled) {
    filter: brightness(1.06);
}

.pet-talk-send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.pet-talk-composer--busy .pet-talk-mic,
.pet-talk-composer--busy .pet-composer-stuck,
.pet-talk-composer--busy .pet-composer-finish-up,
.pet-talk-composer--busy .pet-composer-progress {
    opacity: 0.5;
    pointer-events: none;
}

.pet-talk-composer--disabled .pet-talk-composer-box {
    opacity: 0.72;
}

.pet-talk-composer--voice-mode {
    overflow: visible;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.12);
}

.pet-talk-composer--command-voice.pet-talk-composer--voice-mode .pet-talk-composer-box {
    align-items: center;
    overflow: visible;
    min-height: 0;
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
}

.discuss-voice-dock {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    --ask-mic-level: 0;
}

.discuss-voice-dock[hidden] {
    display: none !important;
}

.discuss-voice-dock-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.45rem;
}

.discuss-voice-dock-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--pet-text);
}

.discuss-voice-dock-status {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--pet-text);
    min-height: 0;
    flex: 1 1 6rem;
}

.discuss-voice-dock-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.discuss-voice-dock-actions .btn-ghostwriter {
    font-size: 0.78rem;
    min-height: 1.75rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--pet-border);
    background: var(--pet-surface);
    color: var(--pet-text);
    font-weight: 600;
    cursor: pointer;
}

.discuss-voice-dock-actions .btn-ghostwriter:hover:not(:disabled) {
    background: var(--pet-surface-muted, #f5f0fa);
}

.discuss-voice-dock-actions .btn-ghostwriter--done-primary {
    background: var(--pet-primary);
    border-color: var(--pet-primary);
    color: #fff;
}

.discuss-voice-dock-indicator {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--pet-muted);
    flex: 0 0 auto;
}

.discuss-voice-dock-indicator--speaking {
    background: var(--pet-primary);
    animation: pet-discuss-voice-pulse 1.1s ease-in-out infinite;
}

.discuss-voice-dock-indicator--listening {
    background: #059669;
    animation: pet-discuss-voice-pulse 0.9s ease-in-out infinite;
}

.discuss-voice-dock[data-voice-phase="listening"] .discuss-voice-dock-indicator--listening {
    animation: none;
    transform: scale(calc(1 + var(--ask-mic-level, 0) * 1.1));
    opacity: calc(0.45 + var(--ask-mic-level, 0) * 0.55);
}

.discuss-voice-dock-indicator--hearing {
    background: #059669;
    animation: pet-discuss-voice-pulse 0.45s ease-in-out infinite;
}

.discuss-voice-dock[data-voice-phase="listening"] .discuss-voice-dock-indicator--hearing {
    animation: none;
    transform: scale(calc(1 + var(--ask-mic-level, 0) * 1.35));
    opacity: calc(0.55 + var(--ask-mic-level, 0) * 0.45);
}

.discuss-voice-dock-indicator--processing {
    background: #d97706;
    animation: pet-discuss-voice-pulse 0.7s ease-in-out infinite;
}

.discuss-voice-dock-indicator--error {
    background: #dc2626;
}

@keyframes pet-discuss-voice-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    .discuss-voice-dock-indicator--speaking,
    .discuss-voice-dock-indicator--listening,
    .discuss-voice-dock-indicator--hearing,
    .discuss-voice-dock-indicator--processing {
        animation: none;
    }
}

.pet-interview-summary {
    position: fixed;
    inset: 0;
    background: rgba(45, 36, 56, 0.45);
    display: flex;
    /* flex-start + overlay scroll: avoids tall-modal top clipping from center alignment */
    align-items: flex-start;
    justify-content: center;
    padding: max(1rem, 3vh) 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 20;
}

.pet-interview-summary-inner {
    position: relative;
    width: min(100%, 560px);
    height: fit-content;
    max-height: min(88dvh, 860px);
    display: flex;
    flex-direction: column;
    background: var(--pet-surface);
    border-radius: var(--pet-radius);
    padding: 1.5rem;
    box-shadow: var(--pet-shadow);
    margin: 0 auto;
}

.pet-interview-summary-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--pet-ink, #1f2937);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.pet-interview-summary-close:hover,
.pet-interview-summary-close:focus-visible {
    background: color-mix(in srgb, var(--pet-muted) 18%, transparent);
    outline: none;
}

.pet-interview-summary-close:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pet-interview-summary-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Keep title clear of the always-visible close control */
    padding-right: 1.75rem;
}

.pet-interview-summary-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.pet-interview-summary-intro {
    margin: 0 0 1rem;
    color: var(--pet-muted);
}

.pet-interview-summary-inner section {
    margin-bottom: 1rem;
}

.pet-interview-summary-progress {
    border-top: 1px solid color-mix(in srgb, var(--pet-muted) 28%, transparent);
    padding-top: 0.85rem;
}

.pet-interview-summary-progress-shared {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--pet-ink, #1f2937);
}

.pet-interview-summary-progress-draft {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 650;
}

.pet-interview-summary-loading {
    color: var(--pet-muted);
    font-style: italic;
}

.pet-interview-summary-progress-chapter {
    margin: 0 0 0.5rem;
    color: var(--pet-muted);
    font-size: 0.95rem;
}

.pet-interview-summary-progress-rule {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
}

.pet-interview-summary-dims {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.pet-interview-summary-dim {
    display: grid;
    /* Fixed status column so Ready / Keep deepening / Still needed text columns align */
    grid-template-columns: 7.5rem 1fr;
    gap: 0.55rem;
    align-items: start;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    border: 1px solid var(--pet-border);
    background: rgba(255, 255, 255, 0.55);
}

.pet-interview-summary-dim.is-ready {
    border-color: rgba(46, 125, 50, 0.28);
    background: rgba(46, 125, 50, 0.08);
}

.pet-interview-summary-dim.is-thin {
    border-color: rgba(191, 120, 40, 0.28);
    background: rgba(191, 120, 40, 0.08);
}

.pet-interview-summary-dim-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.1rem;
    padding: 0.15rem 0.35rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-align: center;
}

.pet-interview-summary-dim.is-ready .pet-interview-summary-dim-status {
    background: rgba(46, 125, 50, 0.16);
    color: #1b5e20;
}

.pet-interview-summary-dim.is-thin .pet-interview-summary-dim-status {
    background: rgba(191, 120, 40, 0.18);
    color: #8a4b12;
}

.pet-interview-summary-dim-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.pet-interview-summary-dim-copy strong {
    font-size: 0.9rem;
}

.pet-interview-summary-dim-copy span {
    color: var(--pet-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

.pet-interview-summary-invite {
    margin: 0.65rem 0 0;
    color: var(--pet-ink, inherit);
    font-size: 0.95rem;
}

.pet-interview-summary-empty {
    margin: 0;
    color: var(--pet-muted);
    font-size: 0.95rem;
}

.pet-interview-questions-progress {
    border-top: 1px solid color-mix(in srgb, var(--pet-muted) 28%, transparent);
    padding-top: 0.85rem;
}

.pet-interview-summary-inner .pet-interview-question-progress-list {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
}

.pet-interview-question-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--pet-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
}

.pet-interview-question-progress-text {
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.35;
}

.pet-interview-question-progress-status {
    display: inline-flex;
    justify-content: center;
    min-width: 4.8rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(120, 140, 170, 0.16);
    color: #3d4f66;
}

.pet-interview-question-progress-row.is-partial .pet-interview-question-progress-status {
    background: rgba(191, 120, 40, 0.18);
    color: #8a4b12;
}

.pet-interview-question-progress-row.is-complete .pet-interview-question-progress-status {
    background: rgba(46, 125, 50, 0.16);
    color: #1b5e20;
}

.pet-interview-summary-inner h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.pet-interview-summary-inner ul {
    margin: 0;
    padding-left: 1.15rem;
}

.pet-interview-summary-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

.pet-interview-summary-actions--with-read {
    flex-wrap: wrap;
}

.pet-interview-summary-actions .pet-btn {
    flex: 1 1 calc(33.333% - 0.4rem);
    min-width: 5.5rem;
    padding: 0.55rem 0.5rem;
    font-size: clamp(0.72rem, 2.4vw, 0.86rem);
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.pet-interview-summary-actions--with-read .pet-btn {
    flex: 1 1 calc(25% - 0.4rem);
    min-width: 5.5rem;
}

.pet-inline-error {
    color: #b91c1c;
    font-weight: 600;
    margin-top: 0.5rem;
}

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

.hidden {
    display: none !important;
}

@container pet-shell (max-width: 520px) {
    .pet-meta-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

.pet-form--voice {
    gap: 0.55rem;
}

.pet-voice-grid,
.pet-voice-carousel {
    margin: 0.15rem 0 0.35rem;
}

.pet-voice-carousel-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
}

.pet-voice-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.pet-voice-carousel-count {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pet-muted);
}

.pet-voice-carousel-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--pet-border);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.pet-voice-carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pet-voice-carousel-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.6rem;
    height: 0.6rem;
    border-top: 2px solid var(--pet-accent-dark);
    border-right: 2px solid var(--pet-accent-dark);
}

.pet-voice-carousel-btn--prev::before {
    transform: rotate(-135deg) translate(1px, -1px);
}

.pet-voice-carousel-btn--next::before {
    transform: rotate(45deg) translate(-1px, 1px);
}

.pet-voice-carousel-viewport {
    overflow: hidden;
    border-radius: 14px;
    min-width: 0;
}

.pet-voice-carousel-track {
    display: flex;
    transition: transform 0.28s ease;
}

.pet-voice-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.pet-voice-pick {
    display: grid;
    grid-template-columns: 4.35rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
}

.pet-voice-carousel-art {
    position: relative;
    width: 4.35rem;
    max-width: 4.35rem;
    aspect-ratio: 1 / 1;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(232, 107, 90, 0.18), rgba(255, 255, 255, 0.9));
}

.pet-voice-carousel-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pet-voice-carousel-art.has-portrait .pet-voice-carousel-photo {
    opacity: 1;
}

.pet-voice-carousel-art-placeholder {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 55%),
        linear-gradient(145deg, rgba(232, 107, 90, 0.12), rgba(255, 241, 236, 0.85));
}

.pet-voice-carousel-art.has-portrait .pet-voice-carousel-art-placeholder {
    opacity: 0.15;
}

.pet-voice-carousel-card,
.pet-voice-card {
    display: block;
    position: relative;
    border: 1px solid var(--pet-border);
    border-radius: 14px;
    background: var(--pet-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 0;
}

.pet-voice-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.pet-voice-carousel-dot {
    width: 0.48rem;
    height: 0.48rem;
    border: 0;
    border-radius: 999px;
    background: rgba(232, 107, 90, 0.25);
    padding: 0;
    cursor: pointer;
}

.pet-voice-carousel-dot.is-active {
    background: var(--pet-accent);
    transform: scale(1.15);
}

.pet-voice-carousel--compact .pet-voice-carousel-art {
    width: 3.75rem;
    max-width: 3.75rem;
}

.pet-voice-carousel--compact .pet-voice-pick {
    grid-template-columns: 3.75rem minmax(0, 1fr);
}

.pet-voice-carousel--compact .pet-voice-design-card {
    border: 1px solid var(--pet-border);
    border-radius: 14px;
    background: var(--pet-surface);
    display: block;
    position: relative;
    min-width: 0;
}

.pet-voice-carousel-card:hover,
.pet-voice-card:hover {
    border-color: rgba(232, 107, 90, 0.35);
}

.pet-voice-carousel-slide.is-selected .pet-voice-carousel-card,
.pet-voice-card.is-selected {
    border-color: var(--pet-accent);
    box-shadow: 0 0 0 2px rgba(232, 107, 90, 0.15);
    background: rgba(232, 107, 90, 0.04);
}

.pet-voice-carousel-card input[type="radio"],
.pet-voice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.pet-voice-carousel-card-body,
.pet-voice-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
}

.pet-voice-select {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 0.35rem 0.5rem;
    min-width: 0;
    cursor: pointer;
}

.pet-voice-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: auto;
}

.pet-voice-radio {
    flex-shrink: 0;
    width: 0.95rem;
    height: 0.95rem;
    border: 2px solid var(--pet-border);
    border-radius: 50%;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pet-voice-carousel-slide.is-selected .pet-voice-radio,
.pet-voice-card.is-selected .pet-voice-radio {
    border-color: var(--pet-accent);
    box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--pet-accent);
}

.pet-voice-name {
    min-width: 0;
    font-weight: 700;
    color: var(--pet-text);
    font-size: 0.92rem;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.pet-voice-selected-tag {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--pet-accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pet-voice-preview,
.pet-voice-design-play {
    flex-shrink: 0;
    width: auto;
    min-width: 0;
    padding: 0.38rem 0.7rem;
    font-size: 0.82rem;
}

.pet-voice-icon-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--pet-accent-dark);
    cursor: pointer;
}

.pet-voice-icon-btn:hover,
.pet-voice-icon-btn:focus-visible {
    background: rgba(232, 107, 90, 0.12);
}

.pet-voice-rename-input {
    min-width: 0;
    width: 100%;
    max-width: 11rem;
    font-weight: 700;
}

.pet-voice-save-status {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pet-accent-dark);
}

.pet-voice-save-status.hidden {
    display: none;
}

.pet-voice-loading,
.pet-voice-empty {
    margin: 0.45rem 0;
    color: var(--pet-muted);
}

.pet-voice-custom-tag {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--pet-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pet-voice-design {
    margin: 0.25rem 0 0.15rem;
    border: 1px solid var(--pet-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    overflow: hidden;
}

.pet-voice-design-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    background: transparent;
    color: var(--pet-text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.pet-voice-design-toggle::after {
    content: '+';
    color: var(--pet-accent-dark);
    font-size: 1.15rem;
    line-height: 1;
}

.pet-voice-design.is-open .pet-voice-design-toggle::after {
    content: '−';
}

.pet-voice-design-panel {
    padding: 0 0.75rem 0.65rem;
}

.pet-voice-design-lead {
    margin: 0 0 0.45rem;
    color: var(--pet-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.pet-voice-design-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 0.55rem;
    align-items: end;
    margin: 0.35rem 0 0.45rem;
}

.pet-voice-design-name {
    margin: 0;
}

.pet-voice-design-toolbar .pet-btn-primary {
    white-space: nowrap;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
}

.pet-voice-design-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.45rem 0 0;
}

.pet-voice-design-actions .pet-btn-soft {
    width: auto;
}

.pet-voice-design-actions.hidden {
    display: none;
}

.pet-voice-design-grid {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.pet-voice-design-card {
    display: block;
    border: 1px solid var(--pet-border);
    border-radius: 12px;
    background: var(--pet-surface);
    cursor: pointer;
}

.pet-voice-design-card.is-selected,
.pet-voice-design-slide.is-selected .pet-voice-design-card {
    border-color: var(--pet-accent);
    box-shadow: 0 0 0 2px rgba(232, 107, 90, 0.12);
}

.pet-voice-design-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.pet-voice-design-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
}

.pet-voice-design-label {
    font-weight: 700;
    color: var(--pet-text);
    font-size: 0.9rem;
}

.pet-voice-design-empty,
.pet-voice-design-status {
    margin: 0.45rem 0 0;
    color: var(--pet-muted);
    font-size: 0.86rem;
}

.pet-voice-design-status.hidden {
    display: none;
}

.pet-voice-design-remix {
    margin-top: 0.45rem;
}

.pet-voice-design-remix.hidden {
    display: none;
}

.pet-form--voice .pet-field {
    gap: 0.22rem;
}

.pet-form--voice .pet-field-label {
    font-size: 0.84rem;
}

.pet-form--voice .pet-field-hint {
    font-size: 0.78rem;
    color: var(--pet-muted);
}

.pet-form--voice .pet-input,
.pet-form--voice .pet-textarea {
    padding: 0.48rem 0.65rem;
    font-size: 0.92rem;
}

.pet-form--voice .pet-textarea {
    min-height: 0;
    resize: vertical;
}

@container pet-shell (max-width: 520px) {
    .pet-voice-carousel-card-body,
    .pet-voice-card-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 0.22rem;
        padding: 0.4rem 0.5rem;
    }

    .pet-voice-select {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        column-gap: 0.4rem;
        row-gap: 0.1rem;
    }

    .pet-voice-radio {
        margin-top: 0.16rem;
    }

    .pet-voice-name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        font-size: 0.88rem;
        line-height: 1.22;
    }

    .pet-voice-custom-tag {
        grid-column: 2;
    }

    .pet-voice-card-actions {
        margin-left: 0;
        width: 100%;
        min-height: 2.5rem;
    }

    .pet-voice-selected-tag {
        margin-right: auto;
    }

    .pet-voice-preview,
    .pet-voice-design-play {
        min-height: 2.5rem;
        padding: 0.4rem 0.7rem;
        font-size: 0.84rem;
    }

    .pet-voice-icon-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .pet-voice-rename-input {
        max-width: none;
    }
}

@container pet-shell (max-width: 420px) {
    .pet-voice-design-toolbar {
        grid-template-columns: 1fr;
    }

    .pet-voice-design-toolbar .pet-btn-primary {
        width: 100%;
    }

    .pet-voice-pick {
        grid-template-columns: 3.75rem minmax(0, 1fr);
        gap: 0.45rem;
    }

    .pet-voice-carousel-art {
        width: 3.75rem;
        max-width: 3.75rem;
    }
}
