/* Pointer sorting works on the photos; controls remain scrollable and keyboard accessible. */
.photo-instructions { white-space: pre-line; }
.photo-face-check { display: grid; gap: 8px; padding: 16px; border: 1px solid #ded8ee; border-radius: 18px; background: #f7f3ff; color: var(--ink); overflow-wrap: anywhere; }
.photo-face-check p { margin: 0; font-size: .92rem; line-height: 1.5; }
.photo-face-check small { color: var(--muted); font-size: .78rem; }
.photo-face-check[data-state="success"] { border-color: #9ccdb5; background: #effaf4; }
.photo-face-check[data-state="warning"], .photo-face-check[data-state="error"] { border-color: #dfb775; background: #fff8ec; }
.photo-face-check:focus { outline: 3px solid var(--purple); outline-offset: 3px; }
.photo-face-check button { justify-self: start; }
.photo-face-check [hidden] { display: none; }
.photo-face-badge { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 5px 6px; border-radius: 8px; background: #fff9efed; color: #614000; text-align: center; font-size: .68rem; font-weight: 700; line-height: 1.25; pointer-events: none; }
.photo-face-badge[data-state="face"] { background: #eaf8eeed; color: #145536; }
[data-face-min] .photo-position { top: 6px; bottom: auto; }
[data-face-min] [data-existing-photo] .photo-face-badge { bottom: 50px; }
[data-face-min] [data-photo-submit][aria-disabled="true"] { opacity: .65; }

[data-photo-sort] [data-photo-id] > img { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
[data-photo-sort][aria-busy="true"] [data-photo-id] > img { cursor: progress; }
[data-photo-sort] .is-sort-dragging { opacity: .35; outline: 2px dashed var(--purple); border-radius: 14px; }
.photo-sort-ghost { position: fixed; z-index: 150; object-fit: cover; pointer-events: none; opacity: .9; border-radius: 14px; box-shadow: 0 12px 30px #0004; transform: scale(1.03); }
.photo-order-controls { display: none; position: absolute; left: 4px; right: 4px; top: 4px; justify-content: space-between; gap: 4px; }
.photo-sort-ready .photo-order-controls { display: flex; }
.photo-order-controls button { min-width: 36px; min-height: 36px; border: 0; border-radius: 10px; color: #fff; background: #17152bcf; font-size: 1.2rem; cursor: pointer; }
.photo-order-controls button:disabled { opacity: .4; cursor: default; }
.photo-order-controls button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.photo-sort-status { margin: 0; min-height: 1.5em; color: var(--muted); font-size: .85rem; }
.photo-sort-error { color: #98223c; font-weight: 700; }
.live-toast-stack { position: fixed; z-index: 120; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(500px, calc(100% - 24px)); display: grid; gap: 8px; pointer-events: none; }
.live-toast { pointer-events: auto; display: flex; align-items: stretch; background: #fff; border: 2px solid var(--purple); border-radius: 18px; box-shadow: 0 6px 28px #17152b26; overflow: hidden; }
.live-toast a { flex: 1; padding: 14px 16px; min-width: 0; text-decoration: none; color: var(--ink); }
.live-toast strong, .live-toast span { display: block; overflow-wrap: anywhere; }
.live-toast span { margin-top: 3px; color: var(--muted); font-size: .82rem; }
.live-toast button { min-width: 42px; min-height: 44px; align-self: flex-start; border: 0; background: transparent; color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.profile-card__bot { display: inline-block; background: #ffffffed; color: #312953; border-radius: 8px; padding: 4px 8px; margin-bottom: 8px; font-size: .73rem; font-weight: 800; }
.profile-card__report { font-size: 1.35rem; }
.match-count { display: inline-flex; justify-content: center; align-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--purple); color: #fff; font-size: .65rem; font-weight: 900; vertical-align: middle; }
.match-count[hidden] { display: none; }
.photo-sort-ready .photo-position { bottom: 48px; }
@media (max-width: 400px) {
    .photo-grid--editable { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Chat is one viewport, with only its history scrolling. Rendered route classes
   apply before JS runs so Android cannot first pan an oversized document toward
   the composer. Chrome can then resize/pan the visual viewport for its keyboard. */
html.chat-document { height: 100%; min-height: 0; overflow: hidden; overscroll-behavior: none; }
.app-body.chat-body { position: fixed; inset: 0; width: 100%; height: 100%; min-height: 0; overflow: hidden; overscroll-behavior: none; }
html.chat-document .app-body.chat-body .page-main {
    position: fixed; top: var(--chat-viewport-top, 0px); right: 0; bottom: auto; left: 0;
    height: 100vh; height: var(--chat-viewport-height, 100dvh);
    min-height: 0; padding: 0; overflow: hidden;
}
.chat-body .app-header, .chat-body .bottom-nav { display: none; }
.chat-shell { height: 100dvh; grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-body .chat-shell { height: 100%; min-height: 0; overflow: hidden; }
.chat-body .message-list { overscroll-behavior-y: contain; }
.chat-header--bot { flex-wrap: wrap; }
.chat-bot-notice { flex-basis: 100%; margin: 0; padding: 8px 14px; border-radius: 0; font-size: .78rem; }
.chat-header > div:last-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chat-header .avatar, .chat-header .back-button, .chat-header .icon-button { flex-shrink: 0; }
.blacklist-hit-photo { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
