/*
 * The pal's activity panel (chat header face), the chats list's pal rows, streaks and episode row,
 * and the streak / badge celebrations in a chat. A copy of the phone's
 * chat/CharacterCurrentActivityBottomSheet.kt, home/ChatListsComposable.kt, chat/StreakComposable.kt,
 * characterProfile/RelationshipTabBody.kt and the two celebration overlays. Colours use the phone's
 * roles (--md-* in web-app.css) plus the few status colours below; sizes follow dimens.kt.
 */

:root {
    --wa-pal-surface-variant: #666666;
    --wa-pal-warning: #F59E0B;
    --wa-pal-warning-container: rgba(255, 193, 7, 0.10);
    --wa-pal-on-warning-container: #92400E;
    --wa-pal-success-container: rgba(76, 175, 80, 0.10);
    --wa-pal-on-success-container: #005E04;
    --wa-pal-celestial-blue: #1E88E5;
    --wa-pal-red-300: #E02544;
    --wa-pal-hairline: color-mix(in srgb, var(--md-outline-variant) 40%, transparent);
    /* the relationship tab: the phone's surfaceBright / surfaceDim (Color.kt), the white drawn on the success green,
       and its short highlight text, which is yellow only in the dark theme (relationshipTabHighlightTextColor) */
    --wa-pal-surface-bright: #FFFAFA;
    --wa-pal-surface-dim: #F5D6D6;
    --wa-pal-on-success: #FFFFFF;
    --wa-pal-relationship-highlight-text: var(--md-on-surface);
    /* the photo viewer's dots pill, the phone's dark-theme colours in both themes (the viewer is always on black) */
    --wa-pal-viewer-chrome: #383838;
    --wa-pal-on-viewer-chrome: #FFFFFF;
    /* the share card pictures (web-app-pal-share-cards.js): the phone's fixed palettes from Color.kt, the same in
       both themes, like the phone's cards (the feelings card is always dark, the badge card always light) */
    --wa-share-card-dark-primary: #BD0C23;
    --wa-share-card-dark-secondary: #DBC826;
    --wa-share-card-dark-error: #FFB4AB;
    --wa-share-card-dark-background: #1B1A1A;
    --wa-share-card-dark-on-surface: #FFFFFF;
    --wa-share-card-dark-on-surface-variant: #D8C2C0;
    --wa-share-card-dark-outline-variant: #524947;
    --wa-share-card-dark-surface-container-lowest: #1B0808;
    --wa-share-card-dark-surface-container-high: #3D1818;
    --wa-share-card-light-primary: #BD0C23;
    --wa-share-card-light-secondary: #DBC826;
    --wa-share-card-light-on-surface: #1B1A1A;
    --wa-share-card-light-on-surface-variant: #534342;
    --wa-share-card-light-outline-variant: #E4CECC;
    --wa-share-card-light-surface-container-lowest: #FFFFFF;
    --wa-share-card-light-surface-container: #FFEFEF;
    --wa-share-card-light-surface-container-high: #FFE7E7;
    /* the letter on the yellow photo stand-in: the phone draws it in plain black (DrawProfilePhoto) */
    --wa-share-card-initial-on-yellow: #000000;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --wa-pal-surface-variant: #B3B3B3;
        --wa-pal-warning: #FFCA28;
        --wa-pal-warning-container: rgba(255, 202, 40, 0.10);
        --wa-pal-on-warning-container: #FFE082;
        --wa-pal-success-container: rgba(102, 187, 106, 0.10);
        --wa-pal-on-success-container: #A5D6A7;
        --wa-pal-surface-bright: #522424;
        --wa-pal-surface-dim: #160606;
        --wa-pal-relationship-highlight-text: var(--md-secondary);
    }
}
:root[data-theme="dark"] {
    --wa-pal-surface-variant: #B3B3B3;
    --wa-pal-warning: #FFCA28;
    --wa-pal-warning-container: rgba(255, 202, 40, 0.10);
    --wa-pal-on-warning-container: #FFE082;
    --wa-pal-success-container: rgba(102, 187, 106, 0.10);
    --wa-pal-on-success-container: #A5D6A7;
    --wa-pal-surface-bright: #522424;
    --wa-pal-surface-dim: #160606;
    --wa-pal-relationship-highlight-text: var(--md-secondary);
}

/* shimmering placeholders (the phone's placeholder modifier) */
@keyframes wa-pal-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.wa-memory-tile--placeholder,
.wa-media-tile--placeholder {
    background: linear-gradient(90deg, var(--md-surface-container-high) 25%, var(--md-surface-container-highest) 50%, var(--md-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: wa-pal-shimmer 1.4s linear infinite;
}

.wa-pal-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--md-on-surface);
    font: inherit;
    font-size: calc(14px * var(--wa-text-scale, 1));
    font-weight: 600;
    cursor: pointer;
}
.wa-pal-text-button:hover { background: var(--md-surface-container-low); }

.wa-pal-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid var(--md-outline-variant);
    background: transparent;
    color: var(--md-on-surface);
    font: inherit;
    font-size: calc(14px * var(--wa-text-scale, 1));
    font-weight: 500;
    cursor: pointer;
}
.wa-pal-chip.is-selected { background: var(--md-secondary); border-color: var(--md-secondary); color: #000; }

/* ==================== pal photo with status (presence dot, magic potions) ==================== */

.wa-pal-photo-frame {
    position: relative;
    display: inline-block;
    flex: none;
}
.wa-pal-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--md-background);
    background: var(--md-surface-container-highest);
}
.wa-pal-photo--empty { display: block; }
.wa-pal-photo-frame--row { width: 56px; height: 56px; }
.wa-pal-photo-frame--activity { width: 64px; height: 64px; }
.wa-pal-photo-frame--activity .wa-pal-photo { border-color: var(--md-outline); }
/* with a streak the photo rises 6px and its square bottom meets the strip */
.wa-pal-photo-frame--with-streak { height: 56px; }
.wa-pal-photo-frame--with-streak .wa-pal-photo {
    position: absolute;
    top: -6px;
    left: 0;
    height: 56px;
    border-radius: 12px 12px 0 0;
}
.wa-magic-potion-badge {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid var(--md-background);
    object-fit: cover;
}
.wa-magic-potion-badge--romantic { top: 0; left: 0; }
.wa-magic-potion-badge--super-love { bottom: 0; left: 0; }
.wa-pal-photo-frame--with-streak .wa-magic-potion-badge--romantic { top: -6px; }

.wa-magic-tint--super-love { background: color-mix(in srgb, var(--wa-pal-celestial-blue) 12%, transparent); border-color: var(--wa-pal-celestial-blue) !important; }
.wa-magic-tint--romantic { background: color-mix(in srgb, var(--wa-pal-red-300) 12%, transparent); border-color: var(--wa-pal-red-300) !important; }

/* round faces (streak sheet, voice notes, permission ask) */
.wa-round-face {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 999px;
    overflow: hidden;
    background: var(--md-surface-container-highest);
    color: var(--md-on-surface);
    font-weight: 700;
}
.wa-round-face-image { width: 100%; height: 100%; object-fit: cover; }
.wa-round-face-letter { display: inline-flex; align-items: center; justify-content: center; }
.wa-round-face--hero { width: 64px; height: 64px; font-size: calc(24px * var(--wa-text-scale, 1)); }
.wa-round-face--step { width: 48px; height: 48px; font-size: calc(18px * var(--wa-text-scale, 1)); }
.wa-round-face--voice { width: 40px; height: 40px; font-size: calc(16px * var(--wa-text-scale, 1)); }
.wa-round-face--permission { width: 80px; height: 80px; font-size: calc(28px * var(--wa-text-scale, 1)); }

/* ==================== chats list: pal rows (phone DrawChatListItem) ==================== */

.wa-chat-row.wa-chat-row--pal {
    display: block;
    padding: 0;
    border-radius: 0;
    background: transparent;
}
.wa-chat-row.wa-chat-row--pal:hover,
.wa-chat-row.wa-chat-row--pal.wa-chat-row--open { background: transparent; }
.wa-pal-row-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 8px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
}
.wa-pal-row-card:hover { background: var(--md-surface-container-low); }
.wa-pal-row-card.wa-magic-tint--super-love:hover,
.wa-pal-row-card.wa-magic-tint--romantic:hover { filter: brightness(0.98); }
.wa-pal-row-link { position: absolute; inset: 0; border-radius: 12px; z-index: 1; }
.wa-pal-row-link:focus-visible { box-shadow: var(--wa-focus-ring); }
.wa-pal-row-photo-box { position: relative; width: 56px; height: 56px; flex: none; }
/* the name and up to two lines of preview, like the phone; the row grows instead of cropping the second line */
.wa-chat-row--pal .wa-chat-row-text {
    flex: 1;
    min-width: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wa-pal-row-name-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wa-chat-row--pal .wa-chat-row-name {
    flex: 0 1 auto;
    font-size: calc(16px * var(--wa-text-scale, 1));
    line-height: calc(24px * var(--wa-text-scale, 1));
    font-weight: 600;
    color: var(--md-on-surface);
}
.wa-chat-row--pal .wa-chat-row-preview,
.wa-chat-row--pal.wa-chat-row--unread .wa-chat-row-preview {
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    font-size: calc(14px * var(--wa-text-scale, 1));
    line-height: calc(20px * var(--wa-text-scale, 1));
    font-weight: 400;
    color: var(--wa-pal-surface-variant);
}
.wa-pal-row-preview-icon { display: inline-flex; vertical-align: -3px; margin-right: 4px; }
.wa-pal-row-preview-icon svg { width: 16px; height: 16px; }
.wa-chat-row--pal .wa-chat-row-typing { font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); font-weight: 700; color: var(--md-success); }
.wa-chat-row--pal.wa-chat-row--typing .wa-chat-row-preview { display: none; }
.wa-chat-row--pal.wa-chat-row--typing .wa-chat-row-typing { display: block; }
.wa-pal-row-side {
    flex: none;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}
.wa-chat-row--pal .wa-chat-row-time,
.wa-chat-row--pal.wa-chat-row--unread .wa-chat-row-time {
    font-size: calc(11px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 500;
    color: var(--md-on-surface);
}
.wa-pal-row-signs { display: flex; align-items: center; gap: 4px; min-height: 20px; }
.wa-chat-row--pal .wa-chat-row-muted { display: inline-flex; color: var(--md-on-surface-variant); }
.wa-chat-row--pal .wa-chat-row-muted svg { width: 16px; height: 16px; }
.wa-chat-row--pal .wa-pal-row-unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--md-secondary);
    color: #000;
    font-size: calc(11px * var(--wa-text-scale, 1));
    font-weight: 500;
}
.wa-pal-row-divider {
    margin: 0 0 0 84px;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--md-outline-variant) 50%, transparent);
}

/* the "Game active" / "Roleplay active" chip next to the name */
.wa-play-mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
    padding: 4px 8px;
    border-radius: 12px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    font-size: calc(11px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 500;
    white-space: nowrap;
}

/* ==================== streaks ==================== */

.wa-streak-strip {
    position: absolute;
    left: 0;
    bottom: -6px;
    z-index: 2;
    width: 56px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 4px;
    border: 1px solid var(--md-background);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    font: inherit;
    cursor: pointer;
}
.wa-streak-strip-count { font-size: calc(11px * var(--wa-text-scale, 1)); line-height: calc(14px * var(--wa-text-scale, 1)); font-weight: 700; }
.wa-streak-pill {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 48px;
    padding: 4px 8px;
    border: 0;
    border-radius: 12px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    font: inherit;
    font-size: calc(14px * var(--wa-text-scale, 1));
    cursor: pointer;
}
.wa-streak-pill--compact { padding: 2px 6px; font-size: calc(12px * var(--wa-text-scale, 1)); }
.wa-streak-pill-count { font-weight: 700; }

.wa-streak-sheet { position: relative; }
.wa-streak-sheet-body { display: flex; flex-direction: column; align-items: center; padding-top: 20px; padding-bottom: 16px; }
.wa-streak-hero-faces { display: flex; align-items: center; padding: 12px 24px; }
.wa-streak-hero-faces > * + * { margin-left: -12px; }
.wa-streak-hero-face-ring { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--md-background); }
.wa-streak-hero-flame {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    font-size: calc(24px * var(--wa-text-scale, 1));
}
.wa-streak-hero-count { margin: 8px 0 0; font-size: calc(57px * var(--wa-text-scale, 1)); line-height: calc(64px * var(--wa-text-scale, 1)); font-weight: 900; color: var(--md-on-surface); }
.wa-streak-hero-label { margin: 0; font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface-variant); }
.wa-streak-rules-card {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    border-radius: 20px;
    background: var(--md-surface-container-low);
}
.wa-streak-rules-heading { margin: 0 0 12px; font-size: calc(11px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); font-weight: 600; letter-spacing: 0.04em; color: var(--md-on-surface-variant); }
.wa-streak-growth-row { display: flex; align-items: flex-start; justify-content: space-between; }
.wa-streak-person-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 80px; }
.wa-streak-person-name { font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.wa-streak-step-connector { height: 48px; display: inline-flex; align-items: center; color: var(--md-on-surface-variant); }
.wa-streak-message-glyph {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--md-surface-container-highest);
    color: var(--md-on-surface);
}
.wa-streak-message-glyph svg { width: 16px; height: 16px; }
.wa-streak-plus-one { display: inline-flex; align-items: center; gap: 4px; }
.wa-streak-plus-one-flame,
.wa-streak-reset-moon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 999px;
    background: var(--md-surface);
    border: 1px solid var(--md-outline-variant);
    color: var(--md-on-surface);
    font-size: calc(16px * var(--wa-text-scale, 1));
}
.wa-streak-plus-one-text { font-size: calc(14px * var(--wa-text-scale, 1)); font-weight: 900; color: var(--md-on-surface); }
.wa-streak-rules-caption { margin: 12px 0 0; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-streak-rules-divider { margin: 16px 0; border: 0; border-top: 1px solid var(--md-outline-variant); }
.wa-streak-reset-row { display: flex; align-items: center; gap: 12px; }
.wa-streak-reset-text { flex: 1; min-width: 0; }
.wa-streak-reset-title { margin: 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); font-weight: 600; color: var(--md-on-surface); }
.wa-streak-reset-body { margin: 2px 0 0; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }

/* ==================== the activity panel (phone CharacterCurrentActivityBottomSheet) ==================== */

button.wa-thread-header-avatar { border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; }

/* above the chat (its tray is 30), below dialogs (40) and sheets (50), so the panel's own report
   form and sheets open on top of it */
.wa-pal-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 38;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--md-background);
    animation: wa-pal-panel-rise 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* the phone's activity screen rises from below the screen and drops back down on close
   (its navigation tween: 250 ms, fast-out-slow-in); web-app-bottom-sheets.js adds is-closing */
@keyframes wa-pal-panel-rise { from { transform: translateY(100%); } }
@keyframes wa-pal-panel-drop { to { transform: translateY(100%); } }
.wa-pal-panel-backdrop.is-closing {
    animation: wa-pal-panel-drop 250ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
.wa-pal-panel {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--md-background);
    color: var(--md-on-surface);
    padding-top: max(56px, calc(env(safe-area-inset-top) + 56px));
}
.wa-pal-panel-close { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 16px; z-index: 3; }
.wa-pal-panel-tabs {
    display: flex;
    margin-top: 24px;
    border-bottom: 1px solid var(--md-outline-variant);
    overflow-x: auto;
    scrollbar-width: none;
}
.wa-pal-panel-tabs::-webkit-scrollbar { display: none; }
.wa-pal-panel-tab {
    flex: 1 0 auto;
    padding: 14px 16px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: color-mix(in srgb, var(--md-on-surface) 50%, transparent);
    font: inherit;
    font-size: calc(12px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.wa-pal-panel-tab.is-selected { color: var(--md-on-surface); border-bottom-color: var(--md-on-surface); }
.wa-pal-panel-page { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wa-pal-panel-page[hidden] { display: none; }
.wa-pal-panel-page-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 16px 112px;
}
.wa-pal-panel-fab {
    position: absolute;
    right: 16px;
    bottom: max(16px, var(--wa-bottom-inset));
    z-index: 2;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    background: var(--md-primary);
    color: var(--md-on-primary);
    box-shadow: var(--wa-shadow);
    cursor: pointer;
}
.wa-pal-panel-fab .wa-icon svg { width: 24px; height: 24px; }

/* Feelings page: sticky Share bar with a short fade above it */
.wa-feelings-share-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 16px max(16px, var(--wa-bottom-inset));
    background: linear-gradient(to bottom, transparent, var(--md-background) 20px);
    padding-top: 20px;
}
.wa-feelings-share-button { width: 100%; }

/* the activity card */
.wa-activity-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--md-outline-variant);
    background: var(--md-surface);
}
.wa-activity-card-link { position: absolute; inset: 0; border-radius: 16px; z-index: 1; }
.wa-activity-card-photo-column { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: none; }
.wa-local-time-pill,
.wa-activity-card-photo-button { position: relative; z-index: 2; }
.wa-local-time-pill {
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--md-surface-container-high);
    color: var(--md-on-surface);
    font: inherit;
    font-size: calc(11px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 500;
    cursor: pointer;
}
.wa-activity-card-photo-button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.wa-activity-card-text { flex: 1; min-width: 0; }
.wa-activity-card-title { display: flex; align-items: center; gap: 4px; margin: 0; font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 500; }
.wa-activity-card-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wa-activity-chip {
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--md-surface-container-high);
    color: var(--md-on-surface-variant);
    font-size: calc(11px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 500;
}
.wa-activity-chip .wa-icon { margin-top: 2px; }
.wa-activity-card-trailing { display: flex; align-items: center; flex: none; }

/* the feelings card and its rings (phone FeelingAxisCircle) */
.wa-feelings-card {
    margin-top: 20px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: var(--md-inverse-on-surface);
}
.wa-feelings-magic-face-row { display: flex; justify-content: center; margin-bottom: 12px; }
.wa-feelings-magic-face { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.wa-feelings-magic-face-button { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; line-height: 0; }
.wa-feelings-card-title { margin: 0 0 16px; text-align: center; font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 500; }
.wa-feeling-rings { display: flex; flex-direction: column; gap: 8px; }
.wa-feeling-rings-row { display: flex; justify-content: center; gap: 8px; }
.wa-feeling-ring-cell {
    --wa-feeling-color: var(--md-secondary);
    flex: 0 0 calc((100% - 8px) / 2);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    border-radius: 16px;
    background: var(--md-background);
    border: 0.5px solid color-mix(in srgb, var(--wa-feeling-color) calc(10% + 45% * var(--wa-feeling-fraction)), transparent);
}
.wa-feeling-ring-cell--hurt { --wa-feeling-color: var(--md-error); }
.wa-feeling-ring-cell--strongest { border-width: 2px; }
.wa-feeling-ring {
    position: relative;
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}
.wa-feeling-ring-cell { position: relative; }
.wa-feeling-ring-glow,
.wa-feeling-ring-emoji { position: absolute; }
/* the ring: yellow (warm) or red (hurt) up to the percentage over a quiet track, thicker when stronger */
.wa-feeling-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: conic-gradient(var(--wa-feeling-color) calc(var(--wa-feeling-fraction) * 360deg), var(--md-on-surface) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px - 3px * var(--wa-feeling-fraction)), #000 calc(100% - 1.5px - 3px * var(--wa-feeling-fraction)));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px - 3px * var(--wa-feeling-fraction)), #000 calc(100% - 1.5px - 3px * var(--wa-feeling-fraction)));
    animation: wa-feeling-ring-fill 600ms ease-out;
}
@keyframes wa-feeling-ring-fill { from { opacity: 0.2; transform: rotate(-30deg); } }
.wa-feeling-ring-glow {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: radial-gradient(circle, color-mix(in srgb, var(--wa-feeling-color) calc(5% + 30% * var(--wa-feeling-fraction)), transparent), transparent 70%);
}
.wa-feeling-ring-emoji { font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); }
.wa-feeling-ring-cell--strongest .wa-feeling-ring { animation: wa-feeling-pulse 1.8s ease-in-out infinite alternate; }
@keyframes wa-feeling-pulse { to { transform: scale(1.04); } }
.wa-feeling-ring-percentage { margin: 8px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); font-weight: 700; color: var(--md-on-surface); }
.wa-feeling-ring-name {
    margin: 2px 0 0;
    max-width: 100%;
    font-size: calc(11px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 500;
    color: var(--md-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-feelings-card-footer { margin: 16px 0 0; text-align: center; font-size: calc(11px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }

/* the mood and local time sheets */
.wa-local-time-sheet, .wa-badge-sheet { position: relative; }
.wa-local-time-sheet-body { display: flex; flex-direction: column; align-items: center; padding: 48px 24px 24px; text-align: center; }
.wa-local-time-sheet-clock-icon,
.wa-local-time-sheet-pin {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--md-inverse-on-surface);
    color: var(--md-on-surface);
}
.wa-local-time-sheet-pin { background: var(--md-surface); }
.wa-local-time-sheet-time { margin: 12px 0 0; font-size: calc(45px * var(--wa-text-scale, 1)); line-height: calc(52px * var(--wa-text-scale, 1)); font-weight: 700; }
.wa-local-time-sheet-label { margin: 4px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface-variant); }
.wa-local-time-sheet-location-card {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 16px;
    background: var(--md-inverse-on-surface);
}
.wa-local-time-sheet-location { margin: 8px 0 0; font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 500; }
.wa-local-time-sheet-pal { margin: 4px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface-variant); }
.wa-local-time-sheet-lives-here { margin: 2px 0 0; font-size: calc(12px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }

/* ==================== Memories and Selfies tabs ==================== */

.wa-memories-grid,
.wa-selfies-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.wa-selfies-photo-grid { gap: 4px; }
.wa-selfies-photo-grid[hidden] { display: none; }
.wa-memories-grid--few { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wa-memory-tile,
.wa-media-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--md-surface-container-high);
    cursor: pointer;
    -webkit-touch-callout: none;
    user-select: none;
}
.wa-memory-tile-image,
.wa-media-tile-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.wa-media-tile--locked { background: var(--md-surface-container-highest); cursor: pointer; }
.wa-media-tile-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--md-on-surface); }
.wa-media-tile-lock svg { width: 24px; height: 24px; }
.wa-panel-older-page-row {
    grid-column: 1 / -1;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wa-panel-older-page-spinner { width: 24px; height: 24px; }
/* the phone's "Couldn't load …" and "Try again" when a tab's first page fails (ChatMediaPage) */
.wa-panel-tab-loading.is-load-failed { display: block; }
.wa-panel-tab-loading.is-load-failed > span { display: none; }
.wa-panel-tab-load-failed { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px 24px; text-align: center; }
.wa-panel-tab-load-failed-text { margin: 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface); }
.wa-panel-empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 24px; text-align: center; }
.wa-panel-empty-state-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--md-surface-container-high);
    color: var(--md-on-surface-variant);
}
.wa-panel-empty-state-icon svg { width: 28px; height: 28px; }
.wa-panel-empty-state-title { margin: 16px 0 0; font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 600; }
.wa-panel-empty-state-body { margin: 6px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }

/* while the ask is up it is the whole empty page; "Not now" removes it and the explainer shows */
.wa-memory-permission-ask + .wa-panel-empty-state { display: none; }
.wa-memory-permission-ask { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px 32px; }
.wa-memory-permission-faces { display: flex; align-items: center; gap: 4px; }
.wa-memory-permission-heart { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--md-secondary); color: var(--md-on-secondary); }
.wa-memory-permission-heart svg { width: 20px; height: 20px; }
.wa-memory-permission-title { margin: 24px 0 0; font-size: calc(24px * var(--wa-text-scale, 1)); line-height: calc(32px * var(--wa-text-scale, 1)); font-weight: 400; color: var(--md-on-surface); }
.wa-memory-permission-body { margin: 8px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-memory-permission-points { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 24px; text-align: left; }
.wa-memory-permission-point { display: flex; align-items: center; gap: 12px; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface); }
.wa-memory-permission-point .wa-icon { color: var(--md-on-surface-variant); }
.wa-memory-permission-allow { width: 100%; margin-top: 24px; }
.wa-memory-permission-not-now { margin-top: 4px; color: var(--md-on-surface-variant); }

.wa-media-kind-switch { display: flex; gap: 8px; margin-bottom: 8px; }
.wa-media-kind-switch[hidden] { display: none; }
/* the loading grid's chip stand-ins span the whole row; the grid's 4px row gap tops up the 8px below */
.wa-media-kind-switch--placeholder { grid-column: 1 / -1; margin-bottom: 4px; }
.wa-media-kind-switch--placeholder .wa-pal-chip { color: transparent; border-color: transparent; cursor: default; }
.wa-selfies-voice-list { display: flex; flex-direction: column; gap: 4px; }
.wa-selfies-voice-list[hidden] { display: none; }
.wa-media-voice-row { padding: 8px; border-radius: 12px; background: var(--md-surface-container); }
.wa-media-voice-date { margin: 0; padding: 4px 8px; font-size: calc(11px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface-variant); }
.wa-media-voice-player { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.wa-media-voice-player .wa-voice-player { flex: 1; width: auto; }
.wa-media-voice-player .wa-voice-note-player { flex: 1; width: auto; }
.wa-media-voice-locked { display: flex; align-items: center; gap: 8px; color: var(--md-on-surface-variant); font-size: calc(14px * var(--wa-text-scale, 1)); }
.wa-panel-unlock-button { width: 100%; margin-top: 8px; gap: 6px; }

/* ==================== Relationship tab (phone RelationshipMilestoneSections: a dashboard of tiles) ==================== */

.wa-relationship-sections { display: flex; flex-direction: column; gap: 12px; }

/* the tile every section sits in (phone RelationshipTabTile): 24 corners, 16 padding, a quiet edge */
.wa-relationship-tile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--md-surface-container-highest);
    border-radius: 24px;
    background: var(--md-surface-container-low);
    color: var(--md-on-surface);
    font: inherit;
    text-align: left;
}
button.wa-relationship-tile { width: 100%; cursor: pointer; }
button.wa-relationship-tile:focus-visible,
.wa-relationship-ladder-row:focus-visible,
.wa-relationship-pal-photo:focus-visible { outline: none; box-shadow: var(--wa-focus-ring); }
.wa-relationship-tile--raised { background: var(--md-surface-container-high); }
.wa-relationship-tile--highlighted { border-color: var(--md-secondary); }
.wa-relationship-tile--centred { align-items: center; text-align: center; }
.wa-relationship-tile-eyebrow {
    display: block;
    font-size: calc(10px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 600;
    color: var(--md-on-surface-variant);
}

/* messages together: the wide gradient tile */
.wa-relationship-together-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(to bottom right, var(--wa-pal-surface-bright), var(--md-surface-container-low));
}
.wa-relationship-together-text { flex: 1; min-width: 0; }
.wa-relationship-together-total {
    margin: 0;
    font-size: calc(36px * var(--wa-text-scale, 1));
    line-height: calc(52px * var(--wa-text-scale, 1));
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-relationship-together-caption { margin: 0; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-relationship-together-faces { display: flex; align-items: center; flex-shrink: 0; }
.wa-relationship-together-faces > * + * { margin-left: -12px; }
.wa-relationship-you-chip {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid var(--md-background);
    background: var(--wa-pal-surface-bright);
    font-size: calc(12px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 700;
}
.wa-relationship-pal-photo {
    position: relative;
    width: 56px;
    height: 56px;
    display: inline-block;
    padding: 0;
    border-radius: 999px;
    border: 2px solid var(--md-secondary);
    overflow: hidden;
    background: var(--md-surface-container-highest);
}
button.wa-relationship-pal-photo { cursor: pointer; }
.wa-relationship-pal-photo-image { width: 100%; height: 100%; object-fit: cover; display: block; }

/* your badge + next badge: two tiles of the same height */
.wa-relationship-badge-tiles { display: flex; align-items: stretch; gap: 12px; }
.wa-relationship-badge-tiles > .wa-relationship-tile { flex: 1 1 0; width: auto; }
.wa-relationship-badge-art-frame { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wa-relationship-badge-art-frame--tile { width: 88px; height: 88px; margin: 12px 0; }
.wa-relationship-badge-art-frame--ladder { width: 48px; height: 48px; }
/* the badge picture, enlarged 1.6x inside its circle to trim the empty border round the medal (phone ZoomedBadgeArt) */
.wa-relationship-badge-art { width: 100%; height: 100%; display: block; border-radius: 999px; overflow: hidden; background: var(--md-surface-container-highest); }
.wa-relationship-badge-art--far-away { opacity: 0.38; }
.wa-relationship-badge-art--empty { background: var(--md-surface-container-highest); }
.wa-relationship-badge-art-image { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.6); }
/* inside the progress ring the picture is one ring stroke smaller on each side */
.wa-relationship-badge-art-frame--in-ring .wa-relationship-badge-art { width: 80px; height: 80px; }
.wa-relationship-next-badge-ring { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.wa-relationship-ring-track { stroke: var(--wa-pal-surface-bright); }
.wa-relationship-ring-user-side { stroke: var(--md-secondary); }
.wa-relationship-ring-pal-side { stroke: var(--md-on-surface-variant); }
.wa-relationship-ring-empty { stroke: var(--md-surface-container-highest); }
.wa-relationship-badge-marker {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid var(--md-background);
}
.wa-relationship-badge-marker--small { width: 16px; height: 16px; }
.wa-relationship-badge-marker--earned { background: var(--md-success); color: var(--wa-pal-on-success); }
.wa-relationship-badge-marker--next { background: var(--md-secondary); color: var(--md-on-secondary); }
.wa-relationship-badge-marker .wa-icon { display: inline-flex; }
.wa-relationship-badge-tile-name { font-size: calc(18px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 700; overflow-wrap: anywhere; }
.wa-relationship-badge-tile-detail { margin-top: 2px; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-relationship-badge-tile-detail--highlighted { font-weight: 600; color: var(--wa-pal-relationship-highlight-text); }
.wa-relationship-all-badges-earned-line { width: 100%; margin-top: 12px; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }

/* message balance: the ring chart beside both counts */
.wa-relationship-balance-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.wa-relationship-balance-ring { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.wa-relationship-balance-ring svg { width: 100%; height: 100%; display: block; }
.wa-relationship-balance-ring-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wa-relationship-balance-ring-percent { font-size: calc(18px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 700; }
.wa-relationship-balance-ring-label { font-size: calc(10px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface-variant); }
.wa-relationship-balance-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wa-relationship-balance-legend-row { display: flex; align-items: center; gap: 8px; }
.wa-relationship-balance-dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 999px; }
.wa-relationship-balance-dot--user { background: var(--md-secondary); }
.wa-relationship-balance-dot--pal { background: var(--md-on-surface-variant); }
.wa-relationship-balance-legend-label { flex: 1; min-width: 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-relationship-balance-legend-count { font-size: calc(18px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 700; white-space: nowrap; }
.wa-relationship-balance-body { margin: 0; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-balance-paused-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--wa-pal-warning-container);
}
.wa-balance-paused-icon { color: var(--wa-pal-warning); }
.wa-balance-paused-note p { margin: 0; flex: 1; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--wa-pal-on-warning-container); }

/* the badge ladder: one full-width row per badge */
.wa-relationship-ladder-header { display: flex; align-items: center; gap: 8px; }
.wa-relationship-ladder-header .wa-relationship-tile-eyebrow { flex: 1; min-width: 0; }
.wa-relationship-pill-label {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--wa-pal-surface-bright);
    font-size: calc(10px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 600;
    white-space: nowrap;
}
.wa-relationship-ladder-primer { margin: 4px 0 12px; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-relationship-ladder-rows { display: flex; flex-direction: column; gap: 8px; }
.wa-relationship-ladder-row {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: var(--md-surface-container-high);
    color: var(--md-on-surface);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.wa-relationship-ladder-row--next { border-color: var(--md-secondary); }
.wa-relationship-ladder-row--far-away { background: var(--wa-pal-surface-dim); }
.wa-relationship-ladder-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: 12px; }
.wa-relationship-ladder-row-name {
    font-size: calc(16px * var(--wa-text-scale, 1));
    line-height: calc(20px * var(--wa-text-scale, 1));
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-relationship-ladder-row--far-away .wa-relationship-ladder-row-name { font-weight: 400; color: var(--md-on-surface-variant); }
.wa-relationship-ladder-row-meaning {
    margin-top: 2px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: calc(12px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    color: var(--md-on-surface-variant);
}
.wa-relationship-ladder-row-goal { margin-left: 8px; flex-shrink: 0; font-size: calc(12px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); font-weight: 500; white-space: nowrap; color: var(--md-on-surface-variant); }
.wa-relationship-ladder-row--next .wa-relationship-ladder-row-goal { font-weight: 600; color: var(--wa-pal-relationship-highlight-text); }

/* ==================== badge detail sheet (phone BadgeDetailBottomSheet) ==================== */

/* no close cross, like the phone: the handle, the scrim and Escape close it */
.wa-badge-sheet .wa-badge-sheet-content { display: flex; flex-direction: column; align-items: center; padding: 4px 16px 20px; text-align: center; }
.wa-badge-sheet-content > .wa-relationship-tile-eyebrow { margin-bottom: 12px; }
/* the big picture: 140 across, always in full colour; inside the 6 px ring it is one stroke smaller on each side */
.wa-relationship-badge-art-frame--sheet-hero { width: 140px; height: 140px; }
.wa-relationship-badge-art-frame--sheet-hero.wa-relationship-badge-art-frame--in-ring .wa-relationship-badge-art { width: 128px; height: 128px; }
.wa-relationship-badge-marker--large { width: 32px; height: 32px; }
/* the marker inside the status chip sits in the row instead of on a picture's corner */
.wa-relationship-badge-marker--in-chip { position: static; flex-shrink: 0; }
.wa-badge-sheet-name { margin: 16px 0 0; font-size: calc(24px * var(--wa-text-scale, 1)); line-height: calc(32px * var(--wa-text-scale, 1)); font-weight: 700; overflow-wrap: anywhere; }
.wa-badge-sheet-meaning { margin: 4px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
/* the goal and status tile (phone BadgeDetailSheetGoalAndStatusTile): the tab's tile, full width */
.wa-badge-sheet-goal-tile { align-self: stretch; margin-top: 20px; }
.wa-badge-sheet-goal-row { display: flex; align-items: center; gap: 8px; }
.wa-badge-sheet-goal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-badge-sheet-goal-value { font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 700; }
.wa-badge-sheet-goal-tile--next .wa-badge-sheet-goal-value { color: var(--wa-pal-relationship-highlight-text); }
.wa-badge-sheet-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--wa-pal-surface-bright);
    font-size: calc(10px * var(--wa-text-scale, 1));
    line-height: calc(16px * var(--wa-text-scale, 1));
    font-weight: 600;
    white-space: nowrap;
}
.wa-badge-sheet-status-chip--locked { color: var(--md-on-surface-variant); }
.wa-badge-sheet-messages-left { margin: 8px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
.wa-badge-sheet-goal-tile--next .wa-badge-sheet-messages-left { font-weight: 600; color: var(--wa-pal-relationship-highlight-text); }
.wa-badge-sheet-share { margin-top: 24px; }

/* ==================== full-screen photo viewer (phone PhotoViewSwipeableComposable) ==================== */

/* the activity panel's viewer only (its strip is marked data-viewer-track): the chat's own viewer
   (web-app-chat-photos.css) shares the class names but pages by moving its strip, so these must not reach it */
.wa-photo-viewer:has(> [data-viewer-track]) {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: #000;
    color: #fff;
}
.wa-photo-viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 16px; z-index: 3; }
.wa-photo-viewer-step { position: absolute; top: 50%; z-index: 3; margin-top: -22px; }
.wa-photo-viewer-step--previous { left: 16px; }
.wa-photo-viewer-step--next { right: 16px; }
.wa-photo-viewer-step[hidden] { display: none; }
.wa-photo-viewer-track[data-viewer-track] {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.wa-photo-viewer-track[data-viewer-track]::-webkit-scrollbar { display: none; }
.wa-photo-viewer-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
}
.wa-photo-viewer-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* a locked photo: a 9:16 frame as tall as the strip, the pal's blurred picture behind a round lock, on the
   viewer's black, not a coloured box across the window (Anudeep, 2026-10-28) */
.wa-photo-viewer-slide--locked { background: transparent; color: #FFFFFF; }
.wa-photo-viewer-locked-frame { position: relative; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #2B1414; display: flex; align-items: center; justify-content: center; }
.wa-photo-viewer-locked-stand-in { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(28px); transform: scale(1.15); }
.wa-photo-viewer-locked-badge { position: relative; width: 64px; height: 64px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); }
.wa-photo-viewer-locked-badge svg { width: 30px; height: 30px; }
.wa-photo-viewer-locked-hint { margin: 0; padding: 0 16px; text-align: center; font-size: calc(14px * var(--wa-text-scale, 1)); color: rgba(255, 255, 255, 0.85); }
.wa-photo-viewer-locked-hint[hidden], .wa-photo-viewer-unlock-slot:empty { display: none; }
.wa-photo-viewer-unlock-slot { padding: 8px 16px 0; }
/* the Unlock button keeps a phone-like width in the middle on wide windows */
.wa-photo-viewer:has(> [data-viewer-track]) .wa-photo-viewer-unlock-slot { box-sizing: border-box; width: 100%; max-width: 640px; margin: 0 auto; }
.wa-photo-viewer-reply {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px max(12px, var(--wa-bottom-inset));
}
.wa-photo-viewer-reply[hidden] { display: none; }
/* the phone's dots pill over the photo (more than one photo) */
.wa-photo-viewer-dots {
    position: absolute;
    top: max(24px, calc(env(safe-area-inset-top) + 8px));
    left: 50%;
    z-index: 3;
    display: flex;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--wa-pal-viewer-chrome);
    transform: translateX(-50%);
    pointer-events: none;
    /* the phone shows at most nine dots and slides the row so the current one stays in the middle,
       so a pal with many photos never runs the row off the screen and under the close button */
    max-width: calc(6px * 10 + 4px * 8 + 24px);
    overflow-x: auto;
    scrollbar-width: none;
}
.wa-photo-viewer-dots::-webkit-scrollbar { display: none; }
.wa-photo-viewer-dots[hidden] { display: none; }
.wa-photo-viewer-dot { flex: none; width: 6px; height: 6px; border-radius: 999px; background: var(--wa-pal-on-viewer-chrome); opacity: 0.3; }
.wa-photo-viewer-dot.is-current { width: 12px; opacity: 1; }
/* a tap on an unlocked photo hides the controls until the next tap; a locked photo keeps them */
#wa-pal-photo-viewer :is(.wa-photo-viewer-close, .wa-photo-viewer-download, .wa-photo-viewer-step, .wa-photo-viewer-dots, .wa-photo-viewer-reply) { transition: opacity 180ms ease; }
#wa-pal-photo-viewer.is-chrome-hidden:not(.is-current-locked) :is(.wa-photo-viewer-close, .wa-photo-viewer-download, .wa-photo-viewer-step, .wa-photo-viewer-dots, .wa-photo-viewer-reply) {
    opacity: 0;
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    #wa-pal-photo-viewer :is(.wa-photo-viewer-close, .wa-photo-viewer-download, .wa-photo-viewer-step, .wa-photo-viewer-dots, .wa-photo-viewer-reply) { transition: none; }
}
/* the whole locked frame takes the tap that opens the coin confirm sheet (the lock badge shows through) */
.wa-photo-viewer-locked-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}
.wa-photo-viewer-locked-still:focus-visible { outline: none; box-shadow: inset var(--wa-focus-ring); }
/* the "Send message…" bar keeps a phone-like width in the middle on wide windows (Anudeep, 2026-10-28) */
.wa-photo-viewer:has(> [data-viewer-track]) .wa-photo-viewer-reply { box-sizing: border-box; width: 100%; max-width: 640px; margin: 0 auto; }
.wa-photo-viewer-reply-input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: calc(16px * var(--wa-text-scale, 1));
}
.wa-photo-viewer-reply-input::placeholder { color: rgba(255, 255, 255, 0.7); }
.wa-photo-viewer-reply-send {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--md-primary);
    color: var(--md-on-primary);
    cursor: pointer;
}
.wa-report-preview-photo { width: 72px; height: 128px; object-fit: cover; border-radius: 12px; }

/* ==================== celebrations in a chat ==================== */

.wa-celebration-host {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}
.wa-thread-page { position: relative; }

/* the streak card: slide in with a bounce, roll the number, hold, slide off (380 + 700 + 1400 + 380 ms) */
.wa-streak-celebration-card {
    margin-top: max(12px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    box-shadow: var(--wa-shadow);
    animation: wa-celebration-slide 2860ms both;
}
@keyframes wa-celebration-slide {
    0% { transform: translateY(-120%) scale(0.88); opacity: 0; }
    10% { transform: translateY(6%) scale(1.02); opacity: 1; }
    14% { transform: translateY(0) scale(1); }
    86.7% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-120%) scale(0.92); opacity: 0; }
}
.wa-streak-pair-avatars { position: relative; width: 52px; height: 32px; flex: none; }
.wa-streak-pair-face {
    position: absolute;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--md-outline-variant);
    background: var(--md-surface-container-highest);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wa-streak-pair-face--pal { left: 0; }
.wa-streak-pair-face--user { right: 0; }
.wa-streak-pair-face-image { width: 100%; height: 100%; object-fit: cover; }
.wa-streak-pair-face-letter { font-size: calc(14px * var(--wa-text-scale, 1)); font-weight: 700; }
.wa-streak-celebration-flame { font-size: calc(14px * var(--wa-text-scale, 1)); }
.wa-rolling-number { position: relative; display: inline-block; height: 24px; overflow: hidden; font-size: calc(16px * var(--wa-text-scale, 1)); line-height: calc(24px * var(--wa-text-scale, 1)); font-weight: 700; font-variant-numeric: tabular-nums; }
.wa-rolling-number-old, .wa-rolling-number-new { display: block; }
.wa-rolling-number-old { animation: wa-rolling-number-out 700ms linear 380ms both; }
.wa-rolling-number-new { position: absolute; left: 0; top: 0; animation: wa-rolling-number-in 700ms linear 380ms both; }
@keyframes wa-rolling-number-out { to { transform: translateY(-100%); opacity: 0; } }
@keyframes wa-rolling-number-in { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* the badge card: slide in, hold about five seconds (a tap ends it early), slide off */
.wa-milestone-celebration-card {
    width: calc(100% - 32px);
    max-width: 560px;
    margin-top: max(12px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    box-shadow: var(--wa-shadow);
    pointer-events: auto;
    cursor: pointer;
    animation: wa-milestone-slide 5960ms both;
}
.wa-celebration-host.is-dismissing .wa-milestone-celebration-card { animation: wa-milestone-dismiss 380ms both; }
@keyframes wa-milestone-slide {
    0% { transform: translateY(-120%) scale(0.88); opacity: 0; }
    6.4% { transform: translateY(0) scale(1); opacity: 1; }
    93.6% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-120%) scale(0.92); opacity: 0; }
}
@keyframes wa-milestone-dismiss { to { transform: translateY(-120%) scale(0.92); opacity: 0; } }
.wa-milestone-badge-cell { position: relative; width: 96px; height: 96px; flex: none; display: flex; align-items: center; justify-content: center; }
.wa-milestone-badge-image { width: 56px; height: 56px; border-radius: 999px; border: 1px solid var(--md-secondary); object-fit: cover; }
.wa-milestone-celebration-text { flex: 1; min-width: 0; }
.wa-milestone-celebration-eyebrow { margin: 0; font-size: calc(11px * var(--wa-text-scale, 1)); line-height: calc(16px * var(--wa-text-scale, 1)); font-weight: 600; color: var(--md-on-surface-variant); }
.wa-milestone-celebration-name { margin: 4px 0 0; font-size: calc(14px * var(--wa-text-scale, 1)); line-height: calc(20px * var(--wa-text-scale, 1)); font-weight: 700; }
.wa-heart-burst { position: absolute; inset: 0; pointer-events: none; }
.wa-heart-burst-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: calc(14px * var(--wa-text-scale, 1));
    margin: -10px 0 0 -8px;
    opacity: 0;
    animation: wa-heart-burst 1100ms ease-out 200ms both;
}
@keyframes wa-heart-burst {
    0% { transform: rotate(var(--wa-heart-angle)) translateY(0) scale(0.4); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: rotate(var(--wa-heart-angle)) translateY(-42px) scale(1); opacity: 0; }
}
.wa-confetti-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.wa-confetti {
    position: absolute;
    top: -16px;
    left: var(--wa-confetti-left);
    width: 8px;
    height: 12px;
    border-radius: 2px;
    opacity: 0;
    animation: wa-confetti-fall 2600ms ease-in var(--wa-confetti-delay) both;
}
@keyframes wa-confetti-fall {
    0% { transform: translateY(0) rotate(var(--wa-confetti-turn)); opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(calc(var(--wa-confetti-turn) + 540deg)); opacity: 0; }
}
.wa-confetti--red { background: #BD0C23; }
.wa-confetti--yellow { background: #DBC826; }
.wa-confetti--orange { background: #F77737; }
.wa-confetti--pink { background: #E1306C; }
.wa-confetti--purple { background: #833AB4; }
.wa-confetti--green { background: #15B119; }

@media (prefers-reduced-motion: reduce) {
    .wa-confetti, .wa-heart-burst-heart, .wa-feeling-ring::before, .wa-feeling-ring-cell--strongest .wa-feeling-ring { animation: none; }
    .wa-confetti { display: none; }
}

/* ==================== large screens: the panel and viewer become centred windows ==================== */

@keyframes wa-pal-panel-scrim-in { from { opacity: 0; } }
@keyframes wa-pal-panel-scrim-out { to { opacity: 0; } }
@keyframes wa-pal-panel-window-in { from { transform: translateY(24px); opacity: 0; } }
@keyframes wa-pal-panel-window-out { to { transform: translateY(24px); opacity: 0; } }

@media (min-width: 900px) {
    .wa-pal-panel-backdrop { align-items: center; background: rgba(0, 0, 0, 0.45); padding: 24px; }
    /* a centred window: the scrim fades and the window takes a short rise instead of crossing the monitor */
    .wa-pal-panel-backdrop { animation: wa-pal-panel-scrim-in 250ms ease-out; }
    .wa-pal-panel-backdrop > .wa-pal-panel { animation: wa-pal-panel-window-in 250ms ease-out; }
    .wa-pal-panel-backdrop.is-closing { animation: wa-pal-panel-scrim-out 200ms ease-in forwards; }
    .wa-pal-panel-backdrop.is-closing > .wa-pal-panel { animation: wa-pal-panel-window-out 200ms ease-in forwards; }
    .wa-pal-panel {
        max-width: 560px;
        height: min(860px, 92dvh);
        border-radius: 28px;
        overflow: hidden;
        padding-top: 56px;
        box-shadow: var(--wa-shadow);
    }
    .wa-pal-panel-close { top: 12px; }
    .wa-chat-row--pal .wa-pal-row-card { margin: 4px 16px; }
    /* group rows keep the pal rows' sides and divider */
    .wa-chat-row.wa-chat-row--group { margin: 4px 16px; }
    .wa-chat-row--group::after { right: -16px; }
    .wa-pal-row-divider { margin-left: 92px; }
    .wa-photo-viewer-track[data-viewer-track] { padding: 0 72px; }
}

/* after the large-screen rules so it wins at every width */
@media (prefers-reduced-motion: reduce) {
    .wa-pal-panel-backdrop, .wa-pal-panel-backdrop.is-closing,
    .wa-pal-panel-backdrop > .wa-pal-panel, .wa-pal-panel-backdrop.is-closing > .wa-pal-panel { animation: none; }
}

/* ==================== quotes in chat bubbles that open what they quote ==================== */

/* a quoted story or feed post is a link (pals/WebAppQuotedPalContent.kt); it looks like the other quotes */
a.wa-quote {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-touch-callout: none;
}
a.wa-quote:hover { background: color-mix(in srgb, var(--md-on-surface) 12%, transparent); }
