/*
 * Peekopals web app: the feed, drawn like the phone (feed/, feedPostDetail/, userFeedPosts/, the pal
 * profile's Posts tab): the Feed tab and its "+" button, the post card (AppSocialFeedPostCard),
 * reactions (FeedPostReactionSummary), a post's options sheets and the post composer
 * (CreateUserFeedPostComposable). Loaded on every signed-in page, since the tabs live in one page.
 */

/* ==================== the Feed tab ==================== */

.wa-feed-tab-screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* one column at a readable width, like the phone's list; centred on wide screens */
.wa-feed-post-list { max-width: 600px; margin: 0 auto; padding: 4px 0 96px; }
.wa-pal-posts { max-width: 600px; margin: 0 auto; padding: 4px 0 24px; }
.wa-feed-post-list > .wa-empty-state, .wa-pal-posts > .wa-empty-state { margin-top: 48px; }

/* the phone's floating "+" (PlatformFloatingActionButton): surface colour, the on-surface plus.
   Phones: in the tab's corner, above the "Get the app" bar and the tabs (the list scrolls inside the tab) */
.wa-feed-new-post-button {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--md-surface);
    color: var(--md-on-surface);
    box-shadow: var(--wa-shadow);
    text-decoration: none;
    transition: transform 120ms ease;
}
.wa-feed-new-post-button .wa-icon svg { width: 24px; height: 24px; }
.wa-feed-new-post-button:hover { transform: translateY(-1px); }
.wa-feed-new-post-button:focus-visible { outline: none; box-shadow: var(--wa-focus-ring); }
/* only while the Feed tab is on view */
.wa-home-tab-screen[hidden] .wa-feed-new-post-button { display: none; }
/* wide screens post from the composer at the top of the Feed and the rail's Post button */
@media (min-width: 900px) {
    .wa-feed-new-post-button { display: none; }
}

/* ==================== the composer at the top of the Feed (wide screens) ==================== */

.wa-feed-inline-composer { display: none; }
@media (min-width: 900px) {
    /* the phone's composer (styled further down), in the same 600px column as the posts under it */
    .wa-feed-inline-composer {
        display: block;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        border-bottom: 1px solid var(--md-outline-variant);
    }
    /* as tall as what is in it, where the composer screen fills the window */
    .wa-feed-inline-composer .wa-feed-composer { flex: none; }
    /* no close cross above this one, so it keeps its top padding */
    .wa-feed-inline-composer .wa-feed-composer-body { flex: none; overflow: visible; padding-top: 16px; }
    /* three lines tall at first, like the pop-up's */
    .wa-feed-inline-composer .wa-feed-composer-text {
        height: calc(3 * 28px * var(--wa-text-scale, 1));
        min-height: calc(3 * 28px * var(--wa-text-scale, 1));
    }
}

/* ==================== the post card ==================== */

/* flat, Instagram-style: header, edge-to-edge media, caption, meta line, a thin line under it */
.wa-feed-post {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0 20px;
    border-bottom: 1px solid var(--md-outline-variant);
}
.wa-feed-post[data-web-opens-post-page] { cursor: pointer; }
.wa-feed-post-header { display: flex; align-items: center; gap: 6px; padding-left: 16px; min-height: 48px; }
.wa-feed-post-author { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.wa-feed-post-author-name { font-size: calc(14px * var(--wa-text-scale, 1)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-feed-post-own-face { width: 40px; height: 40px; flex: none; font-size: calc(16px * var(--wa-text-scale, 1)); }
.wa-feed-post-meta-dot { width: 3px; height: 3px; flex: none; border-radius: 50%; background: var(--md-on-surface-variant); }
.wa-feed-post-time { font-size: calc(11px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); white-space: nowrap; }
.wa-feed-post-header-actions { margin-left: auto; display: flex; align-items: center; padding-right: 4px; }
.wa-feed-post-share { color: var(--md-outline); }

/* photos: square, edge to edge, swiped sideways; the dots under them follow (web-app-feed.js) */
.wa-feed-post-photos {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* a trackpad swipe past the last photo stays here instead of going Back in the browser */
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background: var(--md-inverse-surface);
}
.wa-feed-post-photos::-webkit-scrollbar { display: none; }
.wa-feed-post-photo { flex: none; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: center; scroll-snap-stop: always; }
/* the arrows on the photo (computers): round see-through buttons at the sides, shown while the
   pointer is over the photos; the one at an end hides (web-app-feed.js) */
.wa-feed-post-photos-box { position: relative; }
/* a mouse drag never selects text or lifts the picture out; snapping is off while dragging and while
   the photos slide to where the drag let go (web-app-feed.js) */
.wa-feed-post-photos[data-web-feed-photo-pager] { -webkit-user-select: none; user-select: none; }
.wa-feed-post-photos[data-web-feed-photo-pager] .wa-feed-post-photo { -webkit-user-drag: none; }
.wa-feed-post-photos.is-being-dragged,
.wa-feed-post-photos.is-sliding { scroll-snap-type: none; }
/* beats the hover rule's grab cursor below */
.wa-feed-post-photos[data-web-feed-photo-pager].is-being-dragged { cursor: grabbing; }
.wa-feed-post-photo-arrow {
    position: absolute;
    top: calc(50% - 14px);
    z-index: 2;
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #FFFFFF;
    cursor: pointer;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 160ms ease, background 160ms ease;
}
.wa-feed-post-photo-arrow .wa-icon svg { width: 24px; height: 24px; }
.wa-feed-post-photo-arrow--previous { left: 12px; }
.wa-feed-post-photo-arrow--previous .wa-icon { transform: scaleX(-1); }
.wa-feed-post-photo-arrow--next { right: 12px; }
.wa-feed-post-photo-arrow:hover { background: rgba(0, 0, 0, 0.65); }
@media (hover: hover) and (pointer: fine) {
    .wa-feed-post-photo-arrow { display: inline-flex; }
    .wa-feed-post-photos[data-web-feed-photo-pager] { cursor: grab; }
    .wa-feed-post-photos-box:hover .wa-feed-post-photo-arrow,
    .wa-feed-post-photo-arrow:focus-visible { opacity: 1; }
}
.wa-feed-post-photo-arrow[hidden] { display: none; }
.wa-feed-post-dots { display: flex; justify-content: center; gap: 4px; padding-top: 8px; }
.wa-feed-post-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--md-on-surface); opacity: 0.3; transition: width 160ms ease, opacity 160ms ease; }
.wa-feed-post-dot.is-active { width: 12px; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .wa-feed-post-dot,
    .wa-feed-post-photo-arrow { transition: none; }
}

/* a video: portrait 9:16 like the phone, never taller than the window on a computer */
.wa-feed-post-video { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 85vh; background: var(--wa-feed-video-backdrop); }
.wa-feed-post-video-player { width: 100%; height: 100%; object-fit: contain; display: block; }
.wa-feed-post-video-sound {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--wa-feed-video-chrome);
    color: var(--wa-feed-video-chrome-icon);
    cursor: pointer;
}
.wa-feed-post-video-sound .wa-icon svg { width: 24px; height: 24px; }
.wa-feed-post-video-sound .wa-feed-post-video-sound--on { display: none; }
.wa-feed-post-video-sound.is-sound-on .wa-feed-post-video-sound--on { display: inline-flex; }
.wa-feed-post-video-sound.is-sound-on .wa-feed-post-video-sound--off { display: none; }
/* the phone's full screen button in the media's top-right corner (opens the Reels viewer); the
   video's sound button sits just left of it, 8px apart, like the phone's row */
.wa-feed-post-video-sound--beside-full-screen { right: 60px; }
.wa-feed-post-open-reels {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--wa-feed-video-chrome);
    color: var(--wa-feed-video-chrome-icon);
    text-decoration: none;
}
.wa-feed-post-open-reels .wa-icon svg { width: 24px; height: 24px; }
/* the phone's 40px circle, with a 48px touch area */
.wa-feed-post-open-reels::before { content: ""; position: absolute; inset: -4px; }
.wa-feed-post-open-reels:focus-visible,
.wa-feed-post-video-sound:focus-visible { outline: none; box-shadow: var(--wa-focus-ring); }
:root {
    /* the phone draws the video's buttons white on 35% black over any picture, in both themes */
    --wa-feed-video-backdrop: #000000;
    --wa-feed-video-chrome: rgba(0, 0, 0, 0.35);
    --wa-feed-video-chrome-icon: #FFFFFF;
}

/* the caption: three lines in the lists, then "Show more" */
.wa-feed-post-caption-box { padding: 0 16px; }
.wa-feed-post-caption {
    margin: 0;
    font-size: calc(16px * var(--wa-text-scale, 1));
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.wa-feed-post-caption[data-web-collapsible-caption]:not(.is-expanded) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wa-feed-post-caption .wa-mention { color: var(--md-insights); font-weight: 600; }
.wa-feed-post-caption-more {
    padding: 0;
    border: 0;
    background: none;
    color: var(--md-on-surface-variant);
    font: inherit;
    font-size: calc(14px * var(--wa-text-scale, 1));
    cursor: pointer;
}
.wa-feed-post-caption-more[hidden] { display: none; }

/* the meta line: reactions · comments, reply in chat at the end */
.wa-feed-post-meta { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 16px; min-height: 40px; }
.wa-feed-post-comment-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 6px;
    border-radius: 999px;
    color: var(--md-on-surface-variant);
    font-size: calc(12px * var(--wa-text-scale, 1));
    font-weight: 500;
    text-decoration: none;
}
.wa-feed-post-comment-entry .wa-icon svg { width: 16px; height: 16px; transform: translateY(2px); }
.wa-feed-post-comment-entry:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
/* the post page's "N reactions": the comment count's look on a button (opens who reacted) */
.wa-feed-post-reactions-count { border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.wa-feed-post-reactions-count-holder:empty { display: none; }
.wa-feed-post-reactions-count:focus-visible, .wa-feed-post-comment-entry:focus-visible { outline: none; box-shadow: var(--wa-focus-ring); }
.wa-feed-post-reply { margin-left: auto; color: var(--md-on-surface-variant); }

/* the post's own page: the card edge to edge like the phone's (out of the page's 16 px sides), no
   line under it, the comments follow */
.wa-feed-post-page .wa-page-body { max-width: 600px; margin: 0 auto; width: 100%; }
.wa-feed-post-page .wa-page-body > .wa-feed-post { margin: 0 -16px; border-bottom: 0; padding-bottom: 8px; }

/* the phone's placeholder card while a page of posts loads */
.wa-feed-post--loading { cursor: default; }
.wa-feed-post-loading-face { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.wa-feed-post-loading-name { width: 120px; height: 16px; }
.wa-feed-post-loading-photo { width: 100%; aspect-ratio: 1 / 1; border-radius: 0; }
.wa-feed-post-loading-line { height: 14px; margin: 0 16px; }
.wa-feed-post-loading-line--short { width: 40%; }
.wa-feed-next-page { cursor: pointer; }

/* ==================== reactions (FeedPostReactionSummary) ==================== */

.wa-feed-post-reactions { position: relative; display: flex; align-items: center; min-width: 0; }
.wa-reaction-summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    height: 36px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--md-on-surface-variant);
    font: inherit;
    font-size: calc(12px * var(--wa-text-scale, 1));
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    -webkit-touch-callout: none;
}
.wa-reaction-summary:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.wa-reaction-summary .wa-icon svg { width: 16px; height: 16px; }
.wa-reaction-count-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 6px; border-radius: 999px; }
.wa-reaction-count-chip.is-mine { background: var(--md-surface-container-highest); }
.wa-reaction-count-emoji { font-size: calc(14px * var(--wa-text-scale, 1)); color: initial; }
.wa-reaction-count-number { font-size: calc(12px * var(--wa-text-scale, 1)); color: var(--md-on-surface-variant); }
/* the palette: all five emoji with their counts; it stays open while you tap, kept inside the window */
.wa-reaction-palette {
    position: fixed;
    top: var(--wa-palette-top, 0px);
    left: var(--wa-palette-left, 0px);
    z-index: 1200;
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 16px;
    background: var(--md-surface-container);
    box-shadow: var(--wa-shadow);
}
.wa-reaction-palette[hidden] { display: none; }
.wa-reaction-palette-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: none;
    color: var(--md-on-surface-variant);
    font: inherit;
    cursor: pointer;
}
.wa-reaction-palette-cell:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.wa-reaction-palette-cell.is-mine { border-color: var(--md-primary); color: var(--md-primary); }
.wa-reaction-palette-emoji { font-size: calc(24px * var(--wa-text-scale, 1)); line-height: 1.33; }
.wa-reaction-palette-count { font-size: calc(12px * var(--wa-text-scale, 1)); }
@media (max-width: 380px) {
    .wa-reaction-palette { gap: 4px; padding: 8px; }
    .wa-reaction-palette-cell { padding: 8px; }
}

/* ==================== a post's options sheets ==================== */

.wa-feed-post-option-rows { display: flex; flex-direction: column; padding: 4px 0 12px; }
.wa-feed-post-option-rows .wa-option-row { color: inherit; text-decoration: none; }
.wa-user-feed-post-visible-to { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px 4px; }
.wa-user-feed-post-visible-to-label { font-size: calc(12px * var(--wa-text-scale, 1)); font-weight: 500; color: var(--md-on-surface-variant); }
.wa-user-feed-post-visible-to-faces { display: inline-flex; }
.wa-user-feed-post-visible-to-faces .wa-avatar { width: 24px; height: 24px; font-size: calc(10px * var(--wa-text-scale, 1)); border: 2px solid var(--md-background); }
.wa-user-feed-post-visible-to-faces .wa-avatar + .wa-avatar { margin-left: -6px; }

/* ==================== the post composer (CreateUserFeedPostComposable) ==================== */

.wa-feed-composer-page { display: flex; flex-direction: column; min-height: 100%; background: var(--md-background); }
/* only 8px above the close cross and none under it, so the author row sits right under it like the phone */
.wa-feed-composer-header { display: flex; justify-content: flex-end; padding: 8px 16px 0; padding-top: max(8px, env(safe-area-inset-top)); }
.wa-feed-composer { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wa-feed-composer-body { flex: 1; overflow-y: auto; width: 100%; max-width: 600px; margin: 0 auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.wa-feed-composer-author-row { display: flex; align-items: center; gap: 12px; }
.wa-feed-composer-visibility-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 6px 10px 6px 14px;
    border: 1px solid var(--md-outline-variant);
    border-radius: 999px;
    background: none;
    color: var(--md-on-surface);
    font: inherit;
    font-size: calc(14px * var(--wa-text-scale, 1));
    cursor: pointer;
}
.wa-feed-composer-visibility-pill .wa-icon svg { width: 18px; height: 18px; }
.wa-feed-composer-visibility-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* X's plain writing area (the phone's BasicTextField): no border or background, TitleLarge words in the
   regular weight, lined up under the "Visible to" pill (past the 40 px face and its 12 px gap) */
.wa-feed-composer-text-box { position: relative; margin-left: 52px; }
/* the box and the coloured copy behind it lay text out the same, letter for letter */
.wa-feed-composer-text,
.wa-feed-composer-text-colours {
    margin: 0;
    padding: 0;
    border: 0;
    font-family: var(--wa-font);
    font-size: calc(22px * var(--wa-text-scale, 1));
    font-weight: 400;
    line-height: calc(28px * var(--wa-text-scale, 1));
    letter-spacing: normal;
    word-spacing: normal;
    text-align: start;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}
/* 4 lines tall at first (the phone's minLines), growing with the text (web-app-feed-composer.js) */
.wa-feed-composer-text {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    min-height: calc(4 * 28px * var(--wa-text-scale, 1));
    border-radius: 0;
    background: none;
    color: var(--md-on-surface);
    caret-color: var(--md-primary);
    resize: none;
    overflow-y: hidden;
}
/* the caret shows where the typing goes, like the phone's and X's box */
.wa-feed-composer-text:focus { outline: none; box-shadow: none; }
.wa-feed-composer-text::placeholder { color: var(--md-on-surface-variant); opacity: 1; }
.wa-feed-composer-text-colours {
    position: absolute;
    inset: 0;
    display: none;
    overflow: hidden;
    color: var(--md-on-surface);
    pointer-events: none;
}
/* the script draws the coloured copy, then the box's own letters go see-through (the caret stays) */
.wa-feed-composer-text-box.is-showing-tag-colours .wa-feed-composer-text-colours { display: block; }
.wa-feed-composer-text-box.is-showing-tag-colours .wa-feed-composer-text { color: transparent; }
.wa-feed-composer-text-box.is-showing-tag-colours .wa-feed-composer-text::selection {
    color: transparent;
    background: color-mix(in srgb, var(--md-primary) 24%, transparent);
}
/* the phone's row above Post: @, gallery and camera, a third each, thin upright lines between, a
   thin line above; 48 px tall, 24 px icons */
.wa-feed-composer-actions {
    flex: none;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 600px;
    height: 48px;
    margin: 0 auto;
    border-top: 1px solid var(--md-outline-variant);
}
.wa-feed-composer-action {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--md-on-surface-variant);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.wa-feed-composer-action .wa-icon svg { width: 24px; height: 24px; }
.wa-feed-composer-action:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.wa-feed-composer-action:focus-visible { outline: none; box-shadow: inset var(--wa-focus-ring); }
/* gallery and camera while editing or once a photo is picked: faded to 38% and inert */
.wa-feed-composer-photo-button:has(input:disabled) { cursor: default; background: none; }
.wa-feed-composer-photo-button:has(input:disabled) .wa-icon { opacity: 0.38; }
/* the @ button's circle: the comment bar's green @ (wa-comment-tag-button) at 36 px inside the 48 px row */
.wa-feed-composer-tag-circle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--md-success-container);
    color: var(--md-on-success-container);
    font-family: var(--wa-font);
    font-size: calc(16px * var(--wa-text-scale, 1));
    line-height: 1;
    font-weight: 700;
}
.wa-feed-composer-action-divider { flex: none; width: 1px; margin: 8px 0; background: var(--md-outline-variant); }

/* the @ list (the comment bar's panel and rows): right above the @ button, 16 px in from it, 80% of
   the screen wide (360px at most), 30% of the window tall but at most 240px, growing up from the
   button; on the composer screen it takes its room from the scrolling part above */
.wa-comment-tag-panel.wa-feed-composer-tag-panel {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: auto;
    flex: none;
    height: auto;
    max-height: min(30vh, 240px);
    align-self: flex-start;
    margin: 0 16px 8px;
    display: none;
    visibility: visible;
    opacity: 1;
    clip-path: none;
    transition: none;
}
.wa-comment-tag-panel.wa-feed-composer-tag-panel.is-open {
    display: flex;
    animation: wa-feed-composer-tag-panel-grow 260ms cubic-bezier(0.2, 0, 0, 1);
}
@keyframes wa-feed-composer-tag-panel-grow {
    from { opacity: 0; clip-path: inset(100% -12px -12px -12px); }
    to { opacity: 1; clip-path: inset(-12px -12px -12px -12px); }
}
/* a pal who can't see the post: dimmed like the phone's (60%), a tap says why instead of tagging */
.wa-feed-composer-tag-panel .wa-comment-tag-row[data-web-tag-not-visible] > * { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) {
    .wa-comment-tag-panel.wa-feed-composer-tag-panel.is-open { animation: none; }
}
/* the phone's PostTextCharactersLeftCounter: LabelMedium, right-aligned just above the buttons (outside the
   scrolling words, so it is always in view); onSurfaceVariant, then the error red in semi-bold once over */
.wa-feed-composer-characters-left {
    flex: none;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px 8px;
    text-align: right;
    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-variant);
}
.wa-feed-composer-characters-left.is-over-limit { color: var(--md-error); font-weight: 600; }
.wa-feed-composer-characters-left[hidden] { display: none; }
/* the letters past the limit in the coloured copy (the phone's errorContainer background); tags keep their green */
.wa-feed-composer-text-over-limit { background: var(--md-error-container); }
/* Post while over the limit: looks off like a disabled button, but a tap still reaches the script to say why */
.wa-button.wa-feed-composer-submit[aria-disabled="true"] { opacity: 0.55; cursor: default; transform: none; filter: none; }

/* the photo, square like the feed shows it, a quiet cross on it */
.wa-feed-composer-photo { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--wa-radius); overflow: hidden; background: var(--md-inverse-surface); }
.wa-feed-composer-photo[hidden] { display: none; }
.wa-feed-composer-photo-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.wa-feed-composer-photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    color: var(--wa-feed-video-chrome-icon);
    opacity: 0.85;
    cursor: pointer;
}
.wa-feed-composer-photo-remove .wa-icon svg { width: 24px; height: 24px; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6)); }
.wa-feed-composer-edit-hint { margin: 0; }

/* the composer screen's @ list lines up with the @ button in the centred 600 px column on a wide window */
.wa-feed-composer-page .wa-comment-tag-panel.wa-feed-composer-tag-panel { margin-left: max(16px, calc((100% - 600px) / 2 + 16px)); }

/* Post at the bottom, under the buttons */
.wa-feed-composer-footer { padding: 8px 16px; padding-bottom: max(8px, var(--wa-bottom-inset)); }

/* the wide screens' composers (top of the Feed, the pop-up): X's last row under a thin line, the
   phone's three buttons (still a third each, 80 px) on the left and Post on the right */
.wa-feed-composer-bottom-row {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 16px;
    padding: 8px 0 12px;
    border-top: 1px solid var(--md-outline-variant);
}
.wa-feed-composer-bottom-row .wa-feed-composer-actions { flex: 0 1 240px; max-width: none; margin: 0; border-top: 0; }
.wa-feed-composer-bottom-row .wa-feed-composer-submit {
    flex: none;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0 0 0 auto;
    padding: 0 20px;
    height: 40px;
    border-radius: 999px;
}
.wa-feed-composer-submit { display: flex; width: 100%; max-width: 600px; margin: 0 auto; justify-content: center; }

/* the "Who can see this?" sheet, the phone's CharacterVisibilityPickerSheet: full height like the phone's
   fillScreenHeight sheet (it opts out of the web-wide "as tall as its content" rule, Anudeep 2026-11-05), no handle,
   the cross 10 px from the top and 18 px from the right (8 / 16 px plus the button's own 2 px), a left-aligned title
   and hint, the pal list scrolling on its own, Done pinned below it */
.wa-sheet.wa-sheet--full-height.wa-feed-composer-visibility-sheet {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    /* the phone's statusBarsPadding: only a home-screen web app has a status bar inside the page */
    padding-top: env(safe-area-inset-top, 0px);
}
.wa-feed-composer-visibility-sheet > .wa-sheet-close { top: calc(10px + env(safe-area-inset-top, 0px)); right: 18px; }
/* wide windows: the web app's centred sheet width, as tall as the window less a gap at the top */
@media (min-width: 900px) {
    .wa-sheet.wa-sheet--full-height.wa-feed-composer-visibility-sheet { height: calc(100% - 5vh); max-height: calc(100% - 5vh); }
}
.wa-feed-composer-visibility-sheet > .wa-profile-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    align-items: stretch;
    text-align: left;
    overflow: hidden;
}
/* the phone's title Row: 8 px top, 16 px start, then (while a pal is picked) Clear all with its 2 px padding,
   8 px, and the cross's 48 px kept free before the 16 px end */
.wa-feed-composer-visibility-title-row {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 8px calc(16px + 48px + 8px) 0 16px;
}
/* TitleMedium filling the row */
.wa-feed-composer-visibility-title {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: 48px;
    margin: 0;
    font-size: calc(18px * var(--wa-text-scale, 1));
    line-height: calc(24px * var(--wa-text-scale, 1));
    font-weight: 400;
    color: var(--md-on-surface);
}
/* Clear all: the cross's round floating look (web-app.css), shown only while a pal is picked */
button.wa-feed-composer-visibility-clear-all { margin: 2px; }
button.wa-feed-composer-visibility-clear-all:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
button.wa-feed-composer-visibility-clear-all:focus-visible { outline: none; box-shadow: var(--wa-focus-ring); }
/* BodyMedium, 12 px under the title and 16 px above the list */
.wa-feed-composer-visibility-hint {
    margin: 12px 0 16px;
    padding: 0 16px;
    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-feed-composer-visibility-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* three pals a row, a short last row centred (7 pals = 3 + 3 + 1); 16 px sides, 12 px gaps */
.wa-feed-composer-visibility-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0 16px 16px; }
/* UserFeedPostVisibleToPalTile: a 64 px face over the first name (TitleMedium) on a surfaceContainerLow
   card with 16 px corners, yellow while picked */
.wa-feed-composer-visibility-tile {
    position: relative;
    flex: 0 0 calc((100% - 24px) / 3);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: 16px;
    background: var(--md-surface-container-low);
    color: var(--md-on-surface);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.wa-feed-composer-visibility-tile:has(.wa-feed-composer-visibility-tick:checked) { background: var(--md-secondary); color: var(--md-on-secondary); }
.wa-feed-composer-visibility-tile:has(.wa-feed-composer-visibility-tick:focus-visible) { box-shadow: var(--wa-focus-ring); }
/* the tick is only for the form and screen readers; the yellow card shows it */
.wa-feed-composer-visibility-tick { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.wa-feed-composer-visibility-face { width: 64px; height: 64px; flex: none; font-size: calc(24px * var(--wa-text-scale, 1)); }
.wa-feed-composer-visibility-name {
    max-width: 100%;
    font-size: calc(16px * var(--wa-text-scale, 1));
    line-height: calc(24px * var(--wa-text-scale, 1));
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* PrimaryButton pinned under the list: 8 px above, 12 px below (the sheet adds the safe area) */
.wa-feed-composer-visibility-footer { flex: none; padding: 8px 16px 12px; }
.wa-feed-composer-visibility-done { display: flex; width: 100%; justify-content: center; }
/* the phone's disabled PrimaryButton: the red at 40%, the words unchanged; a tap explains why (web-app-feed-composer.js) */
.wa-feed-composer-visibility-done[aria-disabled="true"] {
    background: color-mix(in srgb, var(--wa-primary) 40%, transparent);
    border-color: transparent;
    cursor: default;
    filter: none;
    transform: none;
}
/* the phone caps PrimaryButton at 400 px on wide windows */
@media (min-width: 900px) {
    .wa-feed-composer-visibility-done { max-width: 400px; margin: 0 auto; }
}

/* ==================== the composer pop-up (wide screens, like X's) ==================== */

/* the page behind stays still while it is open (the window scrolls on wide screens) */
html:has(> body > .wa-feed-composer-pop-up-backdrop) { overflow: hidden; }
/* a card near the top of the dimmed page; it shows once its styles and scripts are in (web-app-feed-composer-pop-up.js) */
.wa-dialog-backdrop.wa-feed-composer-pop-up-backdrop { align-items: flex-start; padding: 5vh 16px 16px; }
.wa-feed-composer-pop-up-backdrop[data-web-pop-up-loading] .wa-feed-composer-pop-up { visibility: hidden; }
.wa-dialog.wa-feed-composer-pop-up {
    max-width: 600px;
    max-height: calc(100dvh - 5vh - 16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: var(--wa-radius);
    background: var(--md-background);
    color: var(--md-on-surface);
}
/* the close cross at the card's top left */
.wa-feed-composer-pop-up-header { flex: none; display: flex; align-items: center; padding: 8px 8px 0; }
/* the face on the left; "Visible to", the box, the @ list, the photo and the refusals beside it. This part scrolls */
.wa-feed-composer-pop-up-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 16px 12px;
}
.wa-feed-composer-pop-up-face { flex: none; margin-top: 2px; }
.wa-feed-composer-pop-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wa-feed-composer-pop-up .wa-feed-composer-visibility-pill { align-self: flex-start; }
/* the plain box sits in the column beside the face already, three lines tall at first; the last row is
   .wa-feed-composer-bottom-row (above) */
.wa-feed-composer-pop-up .wa-feed-composer-text-box { margin-left: 0; }
.wa-feed-composer-pop-up .wa-feed-composer-text {
    height: calc(3 * 28px * var(--wa-text-scale, 1));
    min-height: calc(3 * 28px * var(--wa-text-scale, 1));
}
/* a window made narrow while it is open: the whole screen, like the phone's composer */
@media (max-width: 899px) {
    .wa-dialog-backdrop.wa-feed-composer-pop-up-backdrop { padding: 0; }
    .wa-dialog.wa-feed-composer-pop-up {
        max-width: none;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        padding: env(safe-area-inset-top) 0 var(--wa-bottom-inset);
    }
}
