/* ═══════════════════════════════════════════
   TapShare — Mobile-First Dark Theme
   ═══════════════════════════════════════════ */

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #222222;
    --text-primary: #f0f0f0;
    --text-secondary: #999999;
    --accent-red: #c0392b;
    --accent-red-hover: #e74c3c;
    --accent-leather: #8b4513;
    --border-color: #333333;
    --success: #27ae60;
    --error: #e74c3c;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* Links: never the browser's blue on this dark background (anything with its own class, like .btn, keeps its look) */
a, a:visited { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--accent-red-hover); }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100dvh;
}

.hidden { display: none !important; }

/* ── Buttons ──────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    touch-action: manipulation;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-red);
    color: white;
}
.btn-primary:hover { background: var(--accent-red-hover); }
/* A link styled as a red button keeps its white text: the plain link rules above (a:hover red, a:visited) would
   otherwise win and leave red text on red. */
a.btn-primary, a.btn-primary:visited, a.btn-primary:hover, a.btn-primary:focus-visible,
a.btn-danger, a.btn-danger:visited, a.btn-danger:hover, a.btn-danger:focus-visible { color: #fff; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-full { width: 100%; }

.btn-link {
    background: var(--bg-card);
    color: var(--accent-red-hover);
    border: 1px solid var(--accent-red);
}

.btn-location {
    background: var(--bg-card);
    color: #c8935a;
    border: 1px solid var(--accent-leather);
}
.btn-location:hover { background: rgba(139, 69, 19, 0.15); }

.btn-icon {
    background: var(--bg-card);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 20px;
}

.icon-share,
.icon-qr {
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: var(--error);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
}

/* ── Inputs ───────────────────────────────── */
.input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent-red); }

/* ── Setup Page ───────────────────────────── */
.setup-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80dvh;
    text-align: center;
}

.logo-area { margin-bottom: 32px; }
.app-icon { font-size: 64px; margin-bottom: 8px; }
.app-icon-img {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
}

.home-icon {
    width: 140px;
    height: 140px;
    margin-bottom: 12px;
}

.gyro-eye { display: block; }
.gyro-eye-ring { fill: var(--accent-red); }
.gyro-eye-white { fill: #ffffff; }
.gyro-eye-pupil {
    fill: #0d0d0d;
    /* No CSS transition here — the spring-damper simulation in
       initGyroEyes() already animates every frame itself; a CSS
       transition on top would just add lag on top of the physics. */
}

.home-page {
    max-width: 560px;
    margin: 0 auto;
}

.home-page .card {
    margin-bottom: 20px;
    text-align: left;
}

.home-tagline {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}

.home-copy {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: left;
}
.home-copy:last-child { margin-bottom: 0; }

.home-steps {
    text-align: left;
    padding-left: 20px;
    line-height: 1.8;
}

.home-footnote {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 24px;
}

.directory-cta,
.hunt-cta {
    display: block;
    color: inherit;
    text-decoration: none;
    text-align: left;
    border: 1px solid var(--border-color);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.directory-cta:active,
.hunt-cta:active {
    transform: scale(0.98);
}

.directory-cta {
    border-color: var(--accent-red-hover, #c0392b);
}

.directory-cta h2,
.hunt-cta h2 {
    margin-bottom: 4px;
}

.directory-cta .subtitle,
.hunt-cta .subtitle {
    margin-bottom: 0;
}

.directory-page,
.share-pending-page {
    max-width: 560px;
    margin: 0 auto;
}

.directory-page .card {
    margin-bottom: 20px;
    text-align: left;
}

.nearby-map {
    width: 100%;
    height: 280px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    z-index: 0;
}

.leaflet-div-icon.map-marker-icon {
    background: transparent;
    border: none;
}

.map-marker-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-red);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    background: var(--bg-card);
    cursor: pointer;
}

.map-marker-thumb img,
.map-marker-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-marker-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.directory-tile {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.directory-tile-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.directory-tile-link img,
.directory-tile-link video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.directory-tile-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: var(--bg-secondary);
}

.directory-tile-name {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The 18+ warning on every page (base.html #age-gate) until this browser agrees: html.age-ok (set in base.html's
   head before anything paints) hides it. Above everything (modals are 100+, the dev banner too), page behind blurred. */
.age-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
}
html.age-ok .age-gate-overlay { display: none; }
html:not(.age-ok) body { overflow: hidden; }

/* The 18+ pop-up card */
.card.age-gate-card {
    max-width: 500px;
    width: 100%;
    text-align: center;
    padding: 28px 24px;
}
.age-gate-icon { width: 52px; height: 47px; display: block; margin: 0 auto 14px; }
.age-gate-icon path { fill: var(--text-secondary); }
.age-gate-icon text { fill: var(--bg-card); font: 800 17px system-ui, sans-serif; }
.card.age-gate-card h2 { font-size: 26px; font-weight: 700; margin: 0 0 14px; text-align: center; }
.age-gate-copy { font-size: 15px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 20px; text-align: center; }
.age-gate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.age-gate-actions .btn { flex: 0 1 auto; min-width: 180px; margin: 0; white-space: nowrap; }
@media (max-width: 480px) { .age-gate-actions .btn { flex: 1 1 100%; } }

.raccoon-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 2px;
}

.raccoon-avatar-option {
    /* Safari can otherwise render an unstyled <button> using its native
       widget box, ignoring the grid track size entirely and collapsing
       every item to the same spot — appearance:none opts it out of that
       so it lays out as a plain grid item like everywhere else. */
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: pointer;
    aspect-ratio: 1;
}

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

.raccoon-avatar-option.selected {
    border-color: var(--accent-red-hover, #c0392b);
}

.hunt-targets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hunt-target-tile {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    opacity: 0.55;
    filter: grayscale(0.6);
}

.hunt-target-tile.hunt-target-found {
    opacity: 1;
    filter: none;
    outline: 2px solid var(--accent-red-hover, #c0392b);
}

.hunt-target-tile img,
.hunt-target-tile video {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.hunt-target-name {
    display: block;
    padding: 6px 8px 2px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hunt-target-check {
    display: block;
    padding: 0 8px 8px;
    font-size: 12px;
    color: var(--accent-red-hover, #c0392b);
}

.directory-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.directory-remove-btn:hover { background: var(--accent-red); }

.profile-page-icon {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
}

.profile-name {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.logo-area h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent-red), #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    box-shadow: var(--shadow);
}

.card h2 { font-size: 22px; margin-bottom: 8px; }
.subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

.form-group {
    margin-bottom: 16px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 20px;
    letter-spacing: 4px;
    text-align: center;
    outline: none;
}
.form-group input:focus { border-color: var(--accent-red); }

.result-area { margin-top: 16px; min-height: 40px; }
.success { padding: 16px; background: rgba(39, 174, 96, 0.1); border-radius: var(--radius); }
.success h3 { color: var(--success); margin-bottom: 8px; }
.error { color: var(--error); padding: 12px; }

.tag-id {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.tap-counter {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.stink-chart-link-wrap {
    text-align: center;
    margin-top: 6px;
}

.stink-chart-link {
    font-size: 13px;
    color: var(--accent-red-hover);
    text-decoration: none;
}

/* ── Stink Chart (stick figure) ──────────────────────── */
.stink-chart-card {
    text-align: center;
}

.stink-figure {
    width: 100%;
    max-width: 320px;
    height: auto;
    color: var(--text-secondary);
    margin: 0 auto 12px;
    display: block;
}

.stink-figure-outline {
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
}

.stink-leader {
    stroke: var(--border-color);
    stroke-width: 1.5;
}

.stink-leader-arrowhead {
    fill: var(--border-color);
}

.stink-dot {
    fill: var(--accent-red);
    stroke: var(--bg-card);
    stroke-width: 2;
}

.stink-dot-unset {
    fill: var(--text-secondary);
    opacity: 0.5;
}

/* Tap-to-rate mode (add-sheet flow) — bigger, pulsing, obviously-
   tappable dots with a pointer cursor, like tapping a pain-scale body
   chart. The pulse itself is the "invite touching" cue. */
.stink-figure.stink-editable .stink-dot {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    animation: stink-dot-pulse 0.9s ease-in-out infinite;
}

@keyframes stink-dot-pulse {
    0%, 100% { transform: scale(2); filter: drop-shadow(0 0 0 rgba(231, 76, 60, 0)); }
    50% { transform: scale(2.9); filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.9)); }
}

.stink-add-hint {
    text-align: center;
    font-weight: 600;
}

/* Scent wafts — view mode only (edit mode pulses the dots instead).
   The group's own scale (from --stink-intensity, set in JS to
   value/10) sizes the whole cloud per rating; the puffs inside
   independently drift up and fade on a loop regardless of intensity. */
.stink-scent {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(var(--stink-intensity, 0));
    transition: transform 0.4s ease;
    pointer-events: none;
}

.stink-figure.stink-editable .stink-scent {
    display: none;
}

.stink-scent-puff {
    fill: gold;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: stink-waft 3.4s ease-out infinite;
}

.stink-scent-puff:nth-child(2) { animation-delay: 0.85s; }
.stink-scent-puff:nth-child(3) { animation-delay: 1.7s; }
.stink-scent-puff:nth-child(4) { animation-delay: 2.55s; }

@keyframes stink-waft {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0.75; }
    30% { transform: translate(8px, -22px) scale(0.9); opacity: 0.65; }
    60% { transform: translate(-10px, -48px) scale(1.4); opacity: 0.4; }
    100% { transform: translate(6px, -80px) scale(2.1); opacity: 0; }
}

/* Junk and butt sit close together, so their clouds drift apart to the
   sides (instead of both wafting straight up) to keep it obvious which
   is which. */
.stink-scent[data-part="junk"] .stink-scent-puff { animation-name: stink-waft-left; }
.stink-scent[data-part="butt"] .stink-scent-puff { animation-name: stink-waft-right; }

@keyframes stink-waft-left {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0.75; }
    30% { transform: translate(-14px, -18px) scale(0.9); opacity: 0.65; }
    60% { transform: translate(-30px, -38px) scale(1.4); opacity: 0.4; }
    100% { transform: translate(-48px, -60px) scale(2.1); opacity: 0; }
}

@keyframes stink-waft-right {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0.75; }
    30% { transform: translate(14px, -18px) scale(0.9); opacity: 0.65; }
    60% { transform: translate(30px, -38px) scale(1.4); opacity: 0.4; }
    100% { transform: translate(48px, -60px) scale(2.1); opacity: 0; }
}

.stink-label {
    fill: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.stink-sheet-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.stink-sheet-meta strong {
    color: var(--text-primary);
}

.stink-sheet-note {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 6px;
}

#stink-edit-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

#stink-edit-controls {
    margin-top: 12px;
}

#stink-draft-note-input {
    margin-top: 12px;
    margin-bottom: 12px;
    resize: vertical;
}

/* ── Tap-to-rate slider modal ────────────────────────── */
.stink-slider-value {
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    color: var(--accent-red-hover);
    margin: 8px 0;
}

#stink-slider-input {
    width: 100%;
    accent-color: var(--accent-red);
    margin-bottom: 8px;
}

.stink-slider-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ── Stink sheet comments ────────────────────────────── */
.stink-comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.stink-comments-section h3 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stink-comment-item {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 36px 10px 12px;
    margin-bottom: 8px;
}

.stink-comment-meta {
    font-size: 13px;
    margin-bottom: 4px;
}

.stink-comment-meta strong {
    color: var(--text-primary);
}

.stink-comment-info-btn {
    opacity: 0.7;
}

.stink-comment-text {
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.stink-comment-snapshot {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 8px;
    padding: 6px 8px;
    margin-top: 6px;
}

.stink-comment-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

#stink-comment-form {
    margin-top: 12px;
}

#stink-comment-input {
    margin-bottom: 8px;
    resize: vertical;
}

.stink-chart-card > .btn-ghost {
    margin-top: 20px;
}

.tap-counter-milestone {
    color: var(--accent-red-hover);
    font-weight: 600;
    animation: milestone-pop 0.5s ease;
}

@keyframes milestone-pop {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Reveal Effect ──────────────────────────
   A soft ripple carries the reveal — it alone reads as an intentional
   "unlock" pulse. The sparkle particles are a light accent on top: each
   starts already spread a little from the tap point (not stacked on it)
   so there's no instant of them clumped into one tiny dot before they
   fan out. */
.reveal-ripple {
    position: fixed;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.25) 45%, transparent 72%);
    animation: reveal-ripple-burst 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes reveal-ripple-burst {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(9); opacity: 0; }
}

.confetti-particle {
    position: fixed;
    pointer-events: none;
    font-size: 18px;
    z-index: 1000;
    opacity: 0;
    animation: confetti-burst 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes confetti-burst {
    0% { transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(0.5); opacity: 0; }
    25% { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.85); opacity: 0; }
}


/* ── Profile / Gallery Page ───────────────── */
.profile-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* Plain flex:1 used to grow this to fill all remaining vertical space
   regardless of width, so on a tall/wide desktop window the box ended up
   extremely tall-and-narrow (width capped at 480px by .container, height
   2-3x that); object-fit:cover on a landscape photo then crops it down to
   an unrecognizable vertical sliver to fill that shape. A fixed aspect
   ratio keeps the frame reasonable regardless of viewport height, on
   every page that uses this class (profile_view.html, private_gallery.html). */
.gallery-viewer {
    flex: 0 1 auto;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    min-height: 0;
    aspect-ratio: 4 / 5;
    max-height: 70dvh;
}

/* Widen the page specifically for a shared-gallery view (the only content
   on the page is the viewer itself, so there's no body text whose line
   length would suffer) — every other page keeps .container's normal
   480px mobile-first cap. Scoped with :has() rather than a body/page
   class so it lives entirely in CSS, no template plumbing needed. */
.container:has(.gallery-viewer-standalone) {
    max-width: 720px;
}

.gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.gallery-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    filter: blur(24px) brightness(0.7);
    transform: scale(1.03);
    transition: filter 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.gallery-audio-card {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
}

.gallery-audio-card > canvas.audio-waveform-canvas {
    position: absolute;
    inset: 20px;
    display: block;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    max-width: none;
    filter: opacity(0.55);
    transition: filter 0.3s ease;
}

.gallery-audio-card:active > canvas.audio-waveform-canvas { filter: opacity(0.85); }

.audio-tap-hint {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.55);
    padding: 8px 16px;
    border-radius: 999px;
    pointer-events: none;
    white-space: nowrap;
}

.gallery-audio-card.revealed {
    cursor: pointer;
}

.gallery-audio-card.revealed > canvas.audio-waveform-canvas {
    filter: none;
}

.audio-play-btn {
    position: absolute;
    z-index: 2;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent-red);
    color: white;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}

.audio-play-btn:active { transform: scale(0.9); }
.audio-play-btn:hover { background: var(--accent-red-hover); }

.audio-time {
    position: absolute;
    z-index: 2;
    top: 16px;
    right: 16px;
    font-size: 12px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.55);
    padding: 4px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.audio-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}

.gallery-image.blurred {
    filter: blur(24px) brightness(0.7);
    transform: scale(1.03);
}

.gallery-image:not(.blurred) {
    filter: blur(0) brightness(1);
    transform: scale(1);
}

.heart-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.heart-btn:active { transform: scale(0.92); }
/* 💬 a photo's comments (static/js/photo_comments.js): bottom left, shown with the ❤️ once the photo's revealed */
.comment-btn {
    position: absolute; bottom: 12px; left: 12px; z-index: 2; display: flex; align-items: center; gap: 4px;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); border: none; border-radius: 999px;
    padding: 6px 12px; color: white; font-size: 14px; cursor: pointer;
}
.comment-btn:active { transform: scale(0.92); }
.comment-btn .comment-count:empty { display: none; }
.heart-btn.hidden + .comment-btn { display: none; }
.photo-comments-content { max-height: 85vh; overflow-y: auto; }
.photo-comments-content .blog-comment-list, .photo-comments-content form .hint { text-align: left; }
.photo-comments-content h2 small { color: var(--text-secondary); font-weight: 400; font-size: 0.7em; }
.photo-comments-section .photo-comments-modes { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.heart-btn.hearted { background: rgba(192, 57, 43, 0.6); cursor: default; }
.heart-btn .heart-icon { font-size: 16px; display: inline-block; }
.heart-btn.hearted .heart-icon { animation: heart-icon-pop 0.4s ease; }

@keyframes heart-icon-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.6); }
    100% { transform: scale(1); }
}

.heart-burst-main {
    position: fixed;
    pointer-events: none;
    font-size: 64px;
    z-index: 1001;
    transform: translate(-50%, -50%);
    animation: heart-pop 0.7s cubic-bezier(0.17, 0.89, 0.32, 1.49) forwards;
}

@keyframes heart-pop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.heart-burst-mini {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    z-index: 1000;
    transform: translate(-50%, -50%);
    animation: heart-float 0.9s ease-out forwards;
}

@keyframes heart-float {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), -140px) scale(1); opacity: 0; }
}

.gallery-nav {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-dot.active {
    background: white;
    transform: scale(1.3);
}

/* Prev/next arrows on the profile gallery. Desktop-only: touch devices
   already swipe, so these stay hidden unless there's a real mouse. */
.gallery-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: white;
    font-size: 28px;
    line-height: 1;
    padding: 0 0 4px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.gallery-arrow-prev { left: 10px; }
.gallery-arrow-next { right: 10px; }

@media (hover: hover) and (pointer: fine) {
    .gallery-arrow { display: flex; }
    .gallery-viewer:hover .gallery-arrow { opacity: 1; }
    .gallery-arrow:hover { background: rgba(0, 0, 0, 0.55); }
}

.gallery-arrow:focus-visible {
    opacity: 1;
    outline: 2px solid white;
    outline-offset: 2px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 32px;
}

.empty-state .hint {
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.7;
}

/* ── Controls Bar ─────────────────────────── */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-top: 12px;
}

/* ── Modals ───────────────────────────────── */
/* z-index is assigned dynamically per modal at open time (see
   initModalStacking() in app.js) rather than hand-maintained per-id
   tiers here — a modal opened from inside another already-open modal
   (crop from conversation from manage, etc.) always lands above it
   automatically, for any modal present now or added later. This base
   value is just the floor everything starts from and the fallback
   z-index if JS hasn't run yet. Stays well under the toast (200) and
   confetti/heart-burst (999-1001) layers, which must always stay on
   top of every modal. */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.nfc-write-illustration {
    display: flex;
    justify-content: center;
    margin: 4px 0 20px;
    color: var(--text-secondary);
}

.nfc-write-illustration svg {
    animation: nfc-phone-nudge 1.6s ease-in-out infinite;
}

@keyframes nfc-phone-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

.nfc-wave {
    opacity: 0;
    animation: nfc-wave-pulse 1.6s ease-in-out infinite;
}

.nfc-wave-1 { animation-delay: 0s; }
.nfc-wave-2 { animation-delay: 0.2s; }
.nfc-wave-3 { animation-delay: 0.4s; }

@keyframes nfc-wave-pulse {
    0%, 25% { opacity: 0; }
    45%, 65% { opacity: 1; }
    90%, 100% { opacity: 0; }
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px 24px;
    width: 90%;
    max-width: 400px;
    max-height: 85dvh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    text-align: center;
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.media-lightbox-content {
    background: transparent;
    box-shadow: none;
    padding: 0;
    width: 92vw;
    height: 75dvh;
    overflow: visible;
}

#media-lightbox-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* A fixed frame with object-fit: cover, same as the main gallery's own
   slides — a portrait phone video/photo otherwise renders as a narrow
   letterboxed sliver (width shrinks to match its tall aspect ratio under
   plain max-width/max-height), which reads as broken rather than just
   "a portrait photo, correctly not cropped". */
.media-lightbox-content img,
.media-lightbox-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.media-lightbox-content audio {
    width: 100%;
    max-width: 420px;
    display: block;
}

.media-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.trim-waveform-wrap {
    position: relative;
    width: 100%;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.trim-waveform-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.trim-mask {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.trim-mask-left { left: 0; width: 0; }
.trim-mask-right { right: 0; width: 0; }

.trim-range-row {
    text-align: left;
    margin-bottom: 12px;
}

.trim-range-row label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.trim-range-row input[type="range"] {
    width: 100%;
}

/* Video trim modal */
.vtrim-video {
    display: block;
    width: 100%;
    max-height: 45vh;
    background: #000;
    border-radius: 8px;
    margin-bottom: 12px;
}
.vtrim-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--border, rgba(127, 127, 127, 0.3));
    overflow: hidden;
    margin-bottom: 12px;
}
.vtrim-progress > div {
    height: 100%;
    width: 0;
    background: var(--accent-red);
    transition: width 0.2s linear;
}
#vtrim-selection.over { color: var(--accent-red); }

/* PIN digit inputs */
.pin-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.pin-digit {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    caret-color: var(--accent-red);
}
.pin-digit:focus { border-color: var(--accent-red); }
.signin-digit { width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 700; background: var(--bg-secondary);
    border: 2px solid var(--border-color); border-radius: 10px; color: var(--text-primary); outline: none; caret-color: var(--accent-red); padding: 0; }
.signin-digit:focus { border-color: var(--accent-red); }
.signin-digits { margin-bottom: 4px; justify-content: flex-start; }

.modal-error {
    color: var(--error);
    font-size: 13px;
    margin-top: 12px;
}

/* ── Manage Panel ─────────────────────────── */
.manage-panel {
    text-align: left;
}

.manage-panel h2 { text-align: center; margin-bottom: 20px; }

.manage-tabs {
    display: flex;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.manage-tabs::-webkit-scrollbar { display: none; }

.manage-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    padding: 8px 2px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.manage-tab .tab-icon {
    font-size: 16px;
    line-height: 1;
}

.manage-tab .tab-label {
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.manage-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-red);
    font-weight: 600;
}

.manage-tab-panel { display: none; }
.manage-tab-panel.active { display: block; }

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 14px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-red);
    cursor: pointer;
}

/* Generic rather than a per-class-name list — that list approach has
   silently missed newly-added sections twice now (dob/stink-score/
   raccoon-avatar, then stink-chart/stink-history), since every new
   section needs remembering to add it here too. Any <section> inside a
   manage-tab-panel gets this treatment automatically instead. */
.manage-tab-panel section {
    margin-bottom: 20px;
}

.manage-tab-panel section > h3 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* A divider before every section that follows another one, rather than
   a manually maintained list of class names per section — the previous
   per-class approach is exactly how dob/stink-score/raccoon-avatar
   ended up missing this treatment above until now. Naturally skips the
   first section in each tab (nothing above it to separate from) and
   keeps working as new sections get added. */
.manage-tab-panel section + section {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.gallery-section {
    border-radius: var(--radius);
    transition: background 0.15s, box-shadow 0.15s;
    padding: 8px;
    margin-left: -8px;
    margin-right: -8px;
}

.gallery-section.drag-over,
.tag-row-details.drag-over {
    background: rgba(192, 57, 43, 0.08);
    outline: 2px dashed var(--accent-red);
    outline-offset: -2px;
}

.manage-photo-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.manage-photo-card img, .manage-photo-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.manage-audio-thumb {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
}

.manage-photo-card .btn-delete {
    position: absolute;
    top: 4px;
    right: 4px;
}

.manage-photo-card-audio {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-secondary);
}

.gallery-create-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gallery-create-row .input {
    flex: 1;
}

.gallery-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.upload-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.crop-container {
    max-height: 60vh;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

.crop-container img {
    display: block;
    max-width: 100%;
}

.crop-panel {
    max-width: 90vw;
    width: 420px;
}

.crop-tools { display: flex; justify-content: center; gap: 8px; margin: -6px 0 12px; }

.link-section .input, .pin-section .input, .name-section .input, .bio-section .input, .password-section .input { margin-bottom: 8px; }

.manage-tab-panel section .subtitle { margin-bottom: 12px; }

.stink-chart-field-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stink-chart-field-label:not(:first-of-type) {
    margin-top: 12px;
}

#view-stink-chart-link {
    margin-top: 12px;
    display: inline-flex;
}

.directory-tags-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
}

.tag-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-red);
    cursor: pointer;
}

.nfc-unsupported-section {
    background: rgba(230, 126, 34, 0.12);
    border: 1px solid rgba(230, 126, 34, 0.4);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.nfc-unsupported-title {
    color: #e67e22;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.nfc-unsupported-text {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.nfc-unsupported-section.flash {
    animation: nfc-warning-flash 0.6s ease-in-out 2;
}

@keyframes nfc-warning-flash {
    0%, 100% { background: rgba(230, 126, 34, 0.12); }
    50% { background: rgba(230, 126, 34, 0.3); }
}

#reset-tag-result, #factory-reset-result {
    text-align: left;
}

#message-list {
    max-height: 260px;
    overflow-y: auto;
    text-align: left;
}

.message-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.message-sender-link,
.message-sender-link:visited {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
}

.message-sender-link:hover {
    text-decoration: underline;
}

.message-thread-card {
    text-align: left;
}

.message-image {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 8px;
    margin: 6px 0 4px;
}

/* Conversation thread modal */
.conversation-panel {
    max-width: 440px;
    text-align: left;
    display: flex;
    flex-direction: column;
    max-height: 85dvh;
}

.conversation-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 40px;
}

.conversation-header h2 {
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-header .btn-icon-inline {
    position: absolute;
    right: 32px;
    margin-left: 0;
}

.conversation-header .conversation-close-x {
    right: 0;
}

/* Given its own corner (mirroring the close X) instead of being squeezed
   next to it, and sized/backed as an actual button rather than a bare
   low-contrast glyph — the old right:32px placement made it easy to miss
   or misclick as part of the close button. */
.conversation-header #conversation-refresh-btn {
    left: 0;
    right: auto;
    width: 32px;
    height: 32px;
    font-size: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    opacity: 1;
}

.conversation-header #conversation-refresh-btn:hover {
    background: var(--border-color);
}

.conversation-header #conversation-refresh-btn:active {
    transform: scale(0.92);
}

.conversation-header .btn-icon-inline.spinning {
    animation: spin 0.6s linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.call-panel {
    margin: 10px 0;
}

#mic-choice-modal .btn-full {
    margin-bottom: 10px;
}

/* Calling/incoming/connected: a bigger, clearly-labeled status plus
   large circular controls — sized well past the usual minimum touch
   target since these get tapped in a hurry. */
.call-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.call-panel-status {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.call-panel-hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

.call-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

#remote-call-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#local-call-video {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 84px;
    height: 112px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--bg-card);
    background: #000;
    transform: scaleX(-1); /* mirror, like a selfie camera preview */
}

.call-panel-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    align-self: stretch;
}

.call-panel-actions .btn {
    flex-direction: column;
    gap: 4px;
    width: 84px;
    height: 84px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
}

.btn-call-answer {
    background: var(--success);
    color: #fff;
}

.btn-call-decline,
.btn-call-hangup {
    background: var(--accent-red);
    color: #fff;
}

.call-panel-actions .btn-call-hangup {
    border-radius: var(--radius);
}

/* Solo (while calling, before Mute joins it once connected): fill the
   row like a normal full-width button instead of sitting as a small
   square by itself. */
.call-panel-actions .btn-call-hangup.solo {
    flex: 1;
    flex-direction: row;
    width: auto;
    height: 52px;
    border-radius: var(--radius);
    font-size: 16px;
}

.btn-call-decline:hover,
.btn-call-hangup:hover {
    background: var(--accent-red-hover);
}

.btn-call-mute {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    font-size: 26px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
}

.btn-call-mute.call-muted {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

.conversation-thread {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px; /* extra room for the heart badge peeking below a bubble's corner */
    margin: 12px 0;
    padding-right: 4px;
}

.conversation-bubble {
    position: relative;
    max-width: 85%;
    border-radius: 12px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    user-select: none; /* double-tap-to-heart shouldn't also select the text */
}

.conversation-bubble-mine {
    align-self: flex-end;
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

.conversation-bubble-theirs {
    align-self: flex-start;
}

.conversation-bubble .message-text {
    margin: 0 0 2px;
}

.conversation-bubble .hint {
    margin: 0;
    opacity: 0.75;
}

/* Small badge in the bubble's corner, toggled by double-tapping the
   bubble — not a button, since there's nothing to click, just tap. */
.conversation-heart-indicator {
    position: absolute;
    bottom: -8px;
    right: -6px;
    font-size: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.3;
}

.conversation-heart-indicator.heart-pop {
    animation: heart-pop 0.3s ease-out;
}

@keyframes heart-pop {
    0% { transform: scale(0.4); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Opposite corner from the heart badge — a real button (not a tap
   gesture), so it stays low-key until hovered/tapped. */
.conversation-report-btn {
    position: absolute;
    bottom: -8px;
    left: -6px;
    font-size: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.3;
    opacity: 0.4;
    cursor: pointer;
}

.conversation-report-btn:hover,
.conversation-report-btn:focus-visible {
    opacity: 1;
}

.conversation-reply {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.conversation-reply-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attach-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attach-thumbnail {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius);
}

.attach-gallery-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.attach-gallery-chip {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 8px 12px;
}

.shared-gallery-card {
    display: block;
    margin: 6px 0 4px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    color: inherit;
    text-decoration: none;
}

.shared-gallery-thumb {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.shared-gallery-thumb-audio {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--bg-primary);
}

.shared-gallery-card-label {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
}

.conversation-reply-actions .btn-primary {
    flex: 1;
}

.message-text {
    font-size: 14px;
    margin: 6px 0 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-audio {
    width: 100%;
    height: 32px;
    margin: 6px 0 4px;
}

.btn-delete-message {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    opacity: 0.7;
}
.btn-delete-message:hover { opacity: 1; }

#location-status, #reset-tag-result, #factory-reset-result {
    margin-top: 10px;
}

.location-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.location-status-actions .btn {
    flex: 1 1 auto;
    min-width: 110px;
    text-align: center;
}

.location-status-actions .btn-icon {
    flex: 0 0 auto;
    min-width: 0;
}

textarea.input {
    width: 100%;
    resize: vertical;
    font-family: inherit;
}

.profile-bio {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    max-width: 90%;
    margin: 8px auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 90%;
    margin: 8px auto;
}

.profile-tag-pill {
    padding: 5px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-secondary);
}

.location-caption {
    text-align: center;
    margin-top: 8px;
}

.controls-bar .location-caption {
    flex-basis: 100%;
    margin: 8px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* The owner's own "Refresh Location" button under the caption: a full
   button, so it's easy to find and to hit on a phone. */
.btn-refresh-location {
    flex-basis: 100%;
    width: 100%;
    margin-top: 8px;
    border: 2px solid var(--accent-red);
    font-size: 17px;
}
.btn-refresh-location:not(:disabled):hover { background: var(--bg-secondary, var(--bg-card)); }

.btn-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    background: none;
    border: none;
    font-size: 14px;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    opacity: 0.85;
}

.btn-icon-inline:hover {
    opacity: 1;
}

/* ── Toast Notifications ──────────────────── */
#toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--error);
    color: white;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-16px); }
}

/* ── Responsive ───────────────────────────── */
@media (min-width: 481px) {
    .container { padding: 24px; }
    .card { padding: 40px 32px; }
}

/* ── Admin Page ───────────────────────────── */
.admin-page {
    max-width: 560px;
    margin: 0 auto;
}

.admin-page .card {
    text-align: left;
    margin-bottom: 16px;
}

/* desktop: the dashboard's tiles fill the screen in columns (packed like a masonry wall) */
@media (min-width: 960px) {
    .container:has(.admin-tiles) { max-width: 1800px; }
    .admin-page:has(.admin-tiles) { max-width: none; }
    .admin-page:has(.admin-tiles) .logo-area { max-width: 560px; margin-left: auto; margin-right: auto; }
    .admin-tiles { column-width: 440px; column-gap: 16px; }
    .admin-tiles > .card { break-inside: avoid; display: inline-block; width: 100%; vertical-align: top; }
}

.admin-page h2 {
    font-size: 18px;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.result-box {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.result-item {
    font-size: 14px;
    margin-bottom: 8px;
    word-break: break-all;
}

.result-item code {
    display: block;
    background: var(--bg-primary);
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 4px;
    font-size: 13px;
    word-break: break-all;
}

.result-item a {
    color: var(--accent-red);
    text-decoration: underline;
}

.write-nfc-btn {
    display: block;
    width: 100%;
    margin: 12px 0 8px;
}

.tag-row {
    margin-top: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.tag-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* .gallery-picker-item reuses .tag-row-header's resets (button chrome
   stripped, full-width, left-aligned) but stacks its own content —
   name/count on top, a preview strip of what's actually in the
   gallery below, so picking one to share isn't a guess. */
.gallery-picker-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 2px solid transparent;
}

.gallery-picker-item.selected {
    border-color: var(--accent-red-hover, #c0392b);
    background: var(--bg-secondary);
}

.gallery-picker-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gallery-picker-checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
}

.gallery-picker-item.selected .gallery-picker-checkbox {
    border-color: var(--accent-red-hover, #c0392b);
    background: var(--accent-red-hover, #c0392b);
    position: relative;
}

.gallery-picker-item.selected .gallery-picker-checkbox::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.gallery-picker-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.gallery-picker-actions .btn {
    flex: 1;
}

.gallery-picker-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.gallery-picker-thumbs img,
.gallery-picker-thumbs video,
.gallery-picker-thumbs .manage-photo-card-audio {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-primary);
}

.gallery-picker-thumb-more {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.tag-row-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-primary);
}

.tag-row-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.tag-row-summary {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tag-row-summary-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.tag-row-chevron {
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.tag-row-expanded .tag-row-chevron {
    transform: rotate(180deg);
}

.tag-row-details {
    padding: 0 12px 12px;
    border-top: 1px solid var(--border-color);
}

.tag-row-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-top: 12px;
}

.tag-row-info code {
    font-size: 12px;
    word-break: break-all;
}

.tag-row-info a {
    color: var(--accent-red-hover);
    text-decoration: underline;
}

.tag-row-info strong {
    font-size: 15px;
}

.admin-label-tag {
    display: inline-block;
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 6px;
    width: fit-content;
}

.test-account-tag {
    color: #f0ad4e;
    border-color: #f0ad4e;
    background: rgba(240, 173, 78, 0.12);
}

.recognized-owner-banner {
    align-self: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--success);
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid var(--success);
    border-radius: 6px;
    padding: 3px 8px;
}

.hunt-found-banner {
    align-self: center;
    margin-bottom: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-red-hover, #c0392b);
    background: rgba(192, 57, 43, 0.12);
    border: 1px solid var(--accent-red-hover, #c0392b);
    border-radius: 6px;
    padding: 6px 10px;
}

.tag-row-pending {
    border-style: dashed;
    opacity: 0.8;
}

.audit-log {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 10px;
}

.audit-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.audit-row:last-child { border-bottom: none; }

.audit-row .audit-action {
    font-weight: 600;
}

.audit-row .audit-action.action-login_failed,
.audit-row .audit-action.action-reset_tag,
.audit-row .audit-action.action-delete_tag {
    color: var(--error);
}

.audit-row .audit-meta {
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
}

.directory-tag-row {
    margin-top: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.directory-tag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
}

.directory-tag-expand {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.directory-tag-expand .tag-count {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 12px;
}

.directory-tag-profiles {
    padding: 0 10px 10px;
    border-top: 1px solid var(--border-color);
}

.directory-tag-profiles .directory-grid {
    margin-top: 10px;
}

.directory-tag-profiles .directory-tile-link {
    cursor: pointer;
}

#tags-search {
    margin-bottom: 10px;
}

.tags-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tags-toolbar select,
.tags-toolbar input {
    width: auto;
    flex: 1;
}

.tags-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.site-menu {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 100;
}

.site-menu-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 16px;
    line-height: 1.3;
    cursor: pointer;
}

.site-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 170px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow);
}

.site-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: 6px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.site-menu-item:visited {
    color: var(--text-primary);
}

.site-menu-item:hover {
    background: var(--bg-secondary);
}

.logout-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}
/* .btn-small's grey would otherwise win over a primary button's red */
.btn-primary.btn-small { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.btn-primary.btn-small:hover { background: var(--accent-red-hover); }

.tag-row .btn {
    flex-shrink: 0;
}

.tag-row-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Blocked Profiles ─────────────────────── */
.block-add-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.block-add-row .input {
    flex: 1;
    min-width: 0;
}

.blocked-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.blocked-row-name {
    font-size: 14px;
    min-width: 0;
    word-break: break-all;
}

.conversation-footer-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* "Not signed in" note in the site menu: text, not a button */
.site-menu-item.site-menu-note { cursor: default; white-space: normal; max-width: 240px; font-size: 0.85em; opacity: 0.75; }
.site-menu-item.site-menu-note:hover { background: none; }
.site-menu-accounts { display: flex; flex-direction: column; border-bottom: 1px solid rgba(127,127,127,.3); margin-bottom: 4px; padding-bottom: 4px; }
.site-menu-accounts.hidden { display: none; }
.blog-admin-bar { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.blog-admin-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.blog-admin-confirm.hidden { display: none; }
.request-google { margin: 4px 0 14px; }
.request-or { display: flex; align-items: center; gap: 10px; margin-top: 14px; opacity: .7; font-size: .9em; }
.request-or::before, .request-or::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .35; }
.site-menu-item.site-menu-acct-on { opacity: 1; font-weight: 600; }

/* ── Recovery-email reminder, authenticator app, first-run page ── */
.nudge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--accent-red);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    font-size: 14px;
}
.nudge.hidden { display: none; }
.nudge .btn { padding: 8px 14px; font-size: 14px; }
.two-factor-qr svg {
    display: block;
    width: 200px;
    height: 200px;
    margin: 8px 0;
    background: #fff;
    border-radius: 8px;
}
.two-factor-codes-list {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 16px;
    letter-spacing: 1px;
    user-select: all;
}
.two-factor-section .btn,
.two-factor-section .input { margin-top: 8px; }
.welcome-done-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.welcome-page code { word-break: break-all; }
.link-time { margin-top: 10px; }
.link-time-short { color: var(--accent-red); font-weight: 600; }

/* Authenticator code step (sign-in box and "Confirm it's you" box) */
.two-factor-code-input {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 16px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
}
.code-step-links { margin-top: 16px; margin-bottom: 0; }
.confirm-field { display: block; text-align: left; margin-bottom: 14px; }
.confirm-field > span { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.confirm-field .input { width: 100%; }
.confirm-field .two-factor-code-input { max-width: none; margin: 0 0 6px; }
.confirm-field small { font-size: 12px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
/* Links inside the sign-in boxes (default blue was hard to read on dark) */
#pin-modal .modal-hint a, #confirm-panel a { color: var(--accent-red-hover); }
.confirm-inline {
    margin: 12px 0;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius);
    text-align: left;
}
.confirm-purpose { font-size: 14px; color: var(--text-primary); margin: 0 0 12px; }

/* "A new version is ready" bar */
.update-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
    color: var(--text-primary);
    max-width: 520px;
    margin: 0 auto;
}
.update-bar span { flex: 1; }
.update-bar .btn { padding: 8px 14px; width: auto; margin: 0; }
.update-bar-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}

/* ☰ > About */
.about-content { text-align: left; }
.about-content h2 { text-align: center; }
.about-list { margin: 0 0 18px; }
.about-list dt { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; }
.about-list dd { margin: 4px 0 0; font-size: 15px; word-break: break-word; }
.about-list dd small { display: block; color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
#about-loaded { font-family: ui-monospace, monospace; }
.about-content .btn { width: 100%; margin-top: 8px; }

/* ☰ > Report an Issue */
.issue-content { text-align: left; }
.issue-content h2 { text-align: center; }
.issue-content .modal-hint { text-align: center; }
.issue-content textarea { width: 100%; resize: vertical; min-height: 120px; font: inherit; }
.issue-check { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 6px; font-size: 14px; }
.issue-check input { margin-top: 3px; }
.issue-extra { font-size: 12px; margin: 0 0 8px; }

/* ── Confirmed email, Google sign-in, sign-up location check ── */
.setup-step { text-align: left; margin-bottom: 20px; }
.setup-step-title { font-size: 16px; margin-bottom: 4px; }
.setup-step .hint { margin-bottom: 12px; }
.form-group input.setup-email-input,
.email-gate-content .input { font-size: 17px; letter-spacing: normal; text-align: left; }
.email-confirmed { color: var(--success); font-weight: 600; word-break: break-all; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 13px; margin: 14px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border-color); }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.google-g { flex: none; background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
.location-note { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px 14px; margin: 4px 0 16px; font-size: 14px; color: var(--text-secondary); }
.location-note strong { color: var(--text-primary); display: block; margin-bottom: 4px; }
/* Registering after Google found no account (templates/request.html ?via=google) */
.register-steps { margin: 4px 0 14px; padding-left: 22px; font-size: 14px; color: var(--text-secondary); }
.register-steps li { margin: 4px 0; }
.register-steps strong { color: var(--text-primary); }
.wny-warning { border-color: #d4a017; border-left-width: 4px; }
.wny-warning p { margin: 4px 0; }
.location-note a { color: var(--accent-red-hover); }
.register-email { margin: 0; overflow-wrap: anywhere; }
.held-result h3 { color: var(--text-primary); }
.held-card { text-align: left; }
.held-card .btn { margin-top: 12px; }
.held-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }
.google-redirect-uri { word-break: break-all; user-select: all; }
.email-gate-content .input { width: 100%; margin-bottom: 10px; }
.email-gate-content .btn { width: 100%; margin-top: 6px; }
.pin-google-row { margin-top: 12px; }
.pin-google-row .btn { width: 100%; }

/* ── Request an account (/request) and its admin list ── */
.request-page .card { text-align: left; }
.request-page .form-group input#request-name,
.request-page .form-group input#request-email { font-size: 17px; letter-spacing: normal; text-align: left; }
.request-page textarea { width: 100%; padding: 12px 14px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-primary); font: inherit; font-size: 16px; resize: vertical; outline: none; }
.request-page textarea:focus { border-color: var(--accent-red); }
.request-cta { display: block; color: inherit; text-decoration: none; text-align: left; border: 1px solid var(--border-color); }
.request-cta:active { transform: scale(0.98); }
.request-cta h2 { margin-bottom: 4px; }
.request-cta .subtitle { margin-bottom: 0; }
.site-menu-note a { color: inherit; text-decoration: underline; }
.account-request-note { white-space: pre-wrap; color: var(--text-secondary); }
.account-request-link { word-break: break-all; user-select: all; }
.account-requests-heading { font-size: 15px; margin: 16px 0 6px; }

/* ═══════════════════════════════════════════
   Blogs (a profile's blog, News, the writer)
   ═══════════════════════════════════════════ */
.blog-page { text-align: left; padding-bottom: 40px; }
.blog-back { display: inline-block; color: var(--text-secondary); text-decoration: none; font-size: 14px; margin: 8px 0 10px; }
.blog-back:hover { color: var(--text-primary); }
.blog-heading { font-size: 26px; line-height: 1.2; margin-bottom: 6px; }
.blog-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; }
.blog-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.blog-grow { flex: 1 1 auto; }
.blog-owner-bar { margin: 12px 0 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.blog-empty { text-align: left; padding: 20px; margin-top: 12px; }
.blog-empty a, .blog-page .home-copy a { color: var(--accent-red-hover); }
.blog-noscroll { overflow: hidden; }

.blog-badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 1px 8px; vertical-align: 1px; white-space: nowrap; }
.blog-badge-members { background: rgba(139, 69, 19, 0.25); color: #e0a86c; border: 1px solid var(--accent-leather); }
.blog-badge-draft { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); border: 1px dashed var(--border-color); }

.blog-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); border-radius: 99px; padding: 5px 11px; font-size: 14px; text-decoration: none; cursor: pointer; font-family: inherit; }
.blog-chip small { color: var(--text-secondary); }
.blog-chip.active { border-color: var(--accent-red); background: rgba(192, 57, 43, 0.15); }
.blog-cat-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }

/* Post cards */
.blog-cards { display: flex; flex-direction: column; gap: 12px; }
.blog-card { display: block; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.blog-card:hover { border-color: var(--accent-red); }
.blog-card:active { transform: scale(0.99); }
.blog-card-cover { display: block; width: 100%; max-height: 260px; object-fit: cover; background: var(--bg-secondary); }
.blog-card-body { padding: 12px 14px; min-width: 0; }
.blog-card-title { font-size: 17px; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; }
.blog-card-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.blog-card-cat { color: var(--text-secondary); }
.blog-card-excerpt { font-size: 14px; line-height: 1.45; color: var(--text-primary); opacity: .85; overflow-wrap: anywhere; }
.blog-card-lock { font-style: italic; opacity: .7; }
.blog-cards-compact { gap: 8px; }
.blog-cards-compact .blog-card { display: flex; align-items: stretch; }
.blog-cards-compact .blog-card-body { flex: 1; padding: 10px 12px; }
.blog-cards-compact .blog-card-title { font-size: 15px; }
.blog-cards-compact .blog-card-excerpt { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-thumb { width: 84px; flex: none; object-fit: cover; background: var(--bg-secondary); }
.blog-drafts { margin: 0 0 20px; }
.blog-drafts h2 { font-size: 18px; margin-bottom: 2px; }
.blog-drafts .hint { margin-bottom: 8px; }

/* Homepage News and the profile page's Blog */
.home-news .home-news-head, .profile-blog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.home-news-all, .profile-blog-all { color: var(--accent-red-hover); text-decoration: none; font-size: 14px; white-space: nowrap; }
.home-news .blog-card { background: var(--bg-secondary); }
.home-news-write { margin-top: 12px; }
.profile-blog { width: 100%; text-align: left; margin: 18px 0 8px; }
.profile-blog h2 { font-size: 18px; }
.profile-blog-write { margin-top: 10px; width: 100%; }
.manage-blog-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; font-size: 14px; }
.manage-blog-row > span { flex: 1 1 auto; font-weight: 600; }
.manage-blog-row .btn { padding: 8px 14px; font-size: 14px; }

/* A post */
.blog-post { margin-top: 4px; }
.blog-post-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.blog-post-meta a { color: inherit; }
.blog-post-title { font-size: 26px; line-height: 1.25; margin-bottom: 10px; overflow-wrap: anywhere; }
.blog-post-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.blog-post-cats:empty { display: none; }
.blog-body { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.blog-body p { margin: 0 0 14px; }
.blog-body a { color: var(--accent-red-hover); }
.blog-figure { margin: 6px 0 18px; }
.blog-figure img { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--bg-secondary); }
.blog-linkbtn { margin: 6px 0 18px; }
.blog-body .blog-linkbtn .btn, .blog-body .blog-linkbtn .btn:visited { color: #fff; }
.blog-linkbtn .btn { display: flex; width: 100%; box-sizing: border-box; justify-content: center; text-align: center; overflow-wrap: anywhere; text-decoration: none; }
.blog-figure figcaption { font-size: 14px; color: var(--text-secondary); margin-top: 6px; text-align: center; }
.blog-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 18px; }
.blog-gallery .blog-figure { margin: 0; }
.blog-gallery .blog-figure img { aspect-ratio: 1; object-fit: cover; }
.blog-gallery .blog-figure figcaption { font-size: 13px; }
@media (min-width: 700px) { .blog-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.blog-locked { text-align: left; padding: 20px; margin-top: 8px; }

/* The writer */
.blog-writer { margin-top: 8px; }
.blog-field { display: block; margin-bottom: 16px; border: 0; padding: 0; }
.blog-field > span, .blog-field legend, .blog-field-head > span:first-child { display: block; font-weight: 600; font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.blog-field-head { display: flex; flex-direction: column; margin-bottom: 6px; }
.blog-field-head .hint { font-size: 12px; margin: -2px 0 0; }
.wblocks { display: flex; flex-direction: column; margin-bottom: 14px; }
.wblk { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 4px 10px 10px; }
.sortable-chosen .wblk { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); border-color: var(--accent-red); }
.sortable-ghost { opacity: .4; }
.wblk-tools { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; }
.wblk-tools button { background: none; border: 0; color: var(--text-secondary); font: inherit; font-size: 16px; width: 36px; height: 34px; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
.wblk-tools button:disabled { opacity: .3; cursor: default; }
.wblk-tools button:not(:disabled):hover { background: var(--border-color); color: var(--text-primary); }
.wblk-tools .wblk-handle { cursor: grab; touch-action: none; font-size: 18px; }
.wblk-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); }
.wblk-ta { display: block; width: 100%; min-height: 110px; resize: none; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 16px; line-height: 1.5; padding: 4px 2px; }
.wblk-ta.wblk-drop { outline: 2px dashed var(--accent-red); outline-offset: 2px; border-radius: 8px; }
.wblk-pic { position: relative; border-radius: 8px; overflow: hidden; background: var(--bg-secondary); min-height: 80px; margin-bottom: 6px; }
.wblk-pic img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.wblk-uploading { position: absolute; inset: auto 8px 8px auto; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 99px; }
.wblk-cap { padding: 7px 9px; font-size: 14px; }
/* a photo block: a grid of photos (one shown bigger), each with a caption; ＋ / 📷 add more to the block */
.wgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wgrid.wgrid-one { grid-template-columns: 2fr 1fr; }
.wtile { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wtile.sortable-ghost { opacity: .4; }
.wtile-pic { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-secondary); }
.wgrid-one .wtile-pic { aspect-ratio: 4 / 3; }
.wtile-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wtile-th, .wtile-x { position: absolute; top: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.wtile-th { left: 4px; cursor: grab; touch-action: none; }
.wtile-x { right: 4px; }
.wtile-more { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; aspect-ratio: 1; }
.wgrid-one .wtile-more { aspect-ratio: auto; }
.wtile-more label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px dashed var(--border-color); border-radius: 8px; cursor: pointer; color: var(--text-secondary); font-size: 12px; }
.wtile-plus { font-size: 20px; line-height: 1; }
@media (max-width: 480px) { .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wblk-link .input { padding: 10px 12px; font-size: 16px; }
.wblk-link .input + .input { margin-top: 6px; }
.wadd { display: flex; flex-direction: column; align-items: center; margin: 0 0 6px; }
.wadd-stem { width: 2px; height: 10px; background: var(--border-color); }
.wadd.open .wadd-stem { background: var(--accent-red); }
.wadd-pill { display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 99px; border: 1px solid transparent; }
.wadd.open .wadd-pill { background: var(--bg-card); border-color: var(--border-color); box-shadow: var(--shadow); }
.wadd-plus { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--accent-red); background: var(--bg-card); color: var(--accent-red-hover); cursor: pointer; display: grid; place-items: center; padding: 0; }
.wadd-plus span { font-size: 20px; line-height: 1; transition: transform .2s; }
.wadd.open .wadd-plus { background: var(--accent-red); color: #fff; }
.wadd.open .wadd-plus span { transform: rotate(45deg); }
.wadd-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 56px; height: 48px; border-radius: 14px; border: 0; background: transparent; color: var(--text-primary); cursor: pointer; font: inherit; animation: wadd-slide .18s ease-out backwards; }
.wadd-opt:hover, .wadd-opt:focus-within, .wadd-opt:focus-visible { background: var(--bg-secondary); }
.wadd-opt svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wadd-az { font-weight: 800; font-size: 13px; line-height: 22px; font-family: Georgia, 'Times New Roman', serif; }
.wadd-opt small { font-size: 10px; color: var(--text-secondary); }
@keyframes wadd-slide { from { opacity: 0; transform: translateX(-8px) scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wadd-opt { animation: none; } .wadd-plus span { transition: none; } }

.cat-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 6px 8px; min-height: 50px; cursor: text; }
.cat-box:focus-within { border-color: var(--accent-red); }
.cat-chips { display: contents; }
.cat-chip { display: inline-flex; align-items: center; background: var(--accent-red); color: #fff; border-radius: 99px; padding: 3px 3px 3px 11px; font-size: 15px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.cat-chip button { border: 0; background: transparent; color: inherit; font-size: 19px; line-height: 1; min-width: 30px; min-height: 30px; border-radius: 99px; cursor: pointer; }
.cat-chip button:hover { background: rgba(0, 0, 0, .2); }
#cat-input { flex: 1 1 8em; min-width: 6em; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 16px; padding: 6px 2px; }
.cat-hint { margin: 4px 0 6px; min-height: 0; }
.cat-hint:empty { display: none; }
.cat-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.blog-visibility { display: flex; flex-direction: column; gap: 8px; }
.vis-option { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.vis-option:has(input:checked) { border-color: var(--accent-red); background: rgba(192, 57, 43, 0.1); }
.vis-option input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent-red); flex: none; }
.vis-option span { display: flex; flex-direction: column; gap: 2px; }
.vis-option small { color: var(--text-secondary); font-size: 13px; }
#writer-status a { color: var(--accent-red-hover); }
.blog-actions { margin-top: 8px; position: sticky; bottom: 0; background: var(--bg-primary); padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 2; }
.blog-actions .btn { padding: 12px 16px; }
.blog-manage { margin-top: 24px; padding: 16px; border: 1px dashed var(--border-color); box-shadow: none; text-align: left; }
.blog-manage-label { font-weight: 600; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.blog-manage .hint { margin: 6px 0 14px; }
.blog-delete-confirm { margin-top: 4px; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: var(--accent-red); }
.blog-done { text-align: left; padding: 24px 20px; margin-top: 8px; }
.blog-done-big { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.blog-done .hint { margin-bottom: 14px; }
.wundo { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); background: var(--text-primary); color: var(--bg-primary); border-radius: 99px; padding: 8px 8px 8px 16px; font-size: 14px; display: flex; gap: 10px; align-items: center; z-index: 50; box-shadow: var(--shadow); }
.wundo.hidden { display: none; }
.wundo button { background: var(--accent-red); color: #fff; border: 0; border-radius: 99px; padding: 5px 12px; font-family: inherit; font-weight: 600; cursor: pointer; }

.blog-preview { position: fixed; inset: 0; z-index: 200; background: var(--bg-primary); display: flex; flex-direction: column; }
.blog-preview-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: calc(max(env(safe-area-inset-top, 0px), var(--dev-banner-h, 0px)) + 10px) 16px 10px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); }
.blog-preview-bar .hint { flex: 1; min-width: 0; margin: 0; }
.blog-preview-bar .btn { padding: 8px 14px; font-size: 14px; }
.blog-preview-scroll { flex: 1; overflow-y: auto; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px); width: 100%; max-width: 640px; margin: 0 auto; text-align: left; }
.blog-page .hint, .blog-preview .hint, .home-news .hint { color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

/* Admin > Account Requests: sign-up notifications switch */
.admin-push { margin: 0.5rem 0 1rem; }
.admin-push .toggle-label { margin-bottom: 0.25rem; }
.admin-push .hint { margin-top: 0.25rem; }

/* ── Sign in without the tag (/signin) ── */
.signin-page .form-group input#signin-email,
.signin-page .form-group input#signin-pin,
.signin-page .form-group input#signin-forgot-email,
.signin-page .form-group input#signin-code,
.signin-page .form-group input#signin-emailcode,
.signin-page .form-group input#signin-newpin,
.signin-page .form-group input#signin-newpin-confirm,
.request-page .form-group input#pwreset-new,
.request-page .form-group input#pwreset-confirm { font-size: 17px; letter-spacing: normal; text-align: left; }
.signin-page .google-btn { margin-bottom: 6px; }
.signin-tag-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.signin-pick-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.signin-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-primary); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.signin-pick:hover, .signin-pick:focus-visible { border-color: var(--accent-red); }
.signin-pick img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.signin-cta h2 { margin-bottom: 4px; }
/* Someone is signed in on this device (base.html / updateSiteMenuAuthItems): no "Sign In" prompts on the homepage */
html.signed-in .signed-out-only { display: none !important; }
html.signed-in .home-members-only.hidden { display: block !important; }   /* the Directory tile: signed in on this device */
.password-section .input { width: 100%; }
.signin-page #signin-passkey-btn { margin-bottom: 6px; }
.signin-forgot-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.signin-forgot-box h2 { margin: 0 0 10px; }
.signin-page .signin-toggle-btn { margin-top: 8px; }
.signin-actions { display: flex; flex-direction: column; }
/* Small secondary actions in the sign-in / confirm pop-ups (were links) */
/* /signin: I Forgot My PIN pop-up (templates/signin.html #fp-modal) */
.fp-content { text-align: left; }
.fp-content h2 { text-align: center; }
.fp-step { display: flex; flex-direction: column; gap: 10px; }
.fp-step .modal-hint { margin: 0; text-align: left; }
.fp-content .input { width: 100%; font-size: 17px; }
.fp-digits { letter-spacing: 3px; text-align: center; }
.fp-steps { display: flex; justify-content: center; gap: 8px; margin: 0 0 14px; }
.fp-steps span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border-color); }
.fp-steps span.on { background: var(--accent-red); color: #fff; border-color: var(--accent-red); }
.fp-signout { margin: 2px 0; }
.fp-done-icon { font-size: 44px; text-align: center; margin: 0; }
.fp-cancel { margin-top: 12px; }
#fp-error { margin-top: 10px; }
.modal-link-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.modal-link-btn { margin-top: 6px; }
.modal-link-row .modal-link-btn { margin-top: 0; }
.signin-forgot-box .btn { margin-bottom: 4px; }
.signin-forgot-box .hint { margin: 0 0 12px; }
/* Settings > Passkeys */
.passkey-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.passkey-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); }
.passkey-row span { min-width: 0; overflow-wrap: anywhere; }

/* Manage > Invite a Friend (app/routes/invites.py) */
.invite-section { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.invite-section h3 { margin-top: 0; }
.invite-section form { display: flex; flex-direction: column; gap: 8px; }
.invite-section .location-note { margin: 4px 0 8px; background: var(--bg-primary, transparent); }
.invite-note-count { text-align: right; margin: -4px 0 0; }
.invite-off-note { color: var(--text-primary); font-weight: 600; }
.invite-list-heading { margin: 16px 0 6px; font-size: 15px; }
.invite-list-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border-color); font-size: 14px; }
.invite-list-row:first-child { border-top: none; }
.invite-list-row .invite-who { overflow-wrap: anywhere; }
.invite-list-row .invite-status { color: var(--text-secondary); white-space: nowrap; text-align: right; }
.invite-banner { background: var(--bg-secondary); border: 1px solid var(--border-color); border-left: 4px solid var(--accent-red, #e33); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 14px; color: var(--text-secondary); }
.invite-banner strong { display: block; color: var(--text-primary); font-size: 16px; margin-bottom: 4px; }
.invite-banner p { margin: 0; }

/* Get your tap + Invite your friends cards (static/js/tap.js, app/routes/taps.py) */
.owner-cards { width: 100%; max-width: 480px; margin: 0 auto; }
.owner-cards:empty { display: none; }
.owner-gear-slot { margin-top: 16px; margin-bottom: 16px; }
.tap-card { text-align: left; margin: 12px 0; }
.tap-card h3 { margin-top: 0; }
.tap-card h4 { margin: 8px 0; }
.tap-choices { display: flex; flex-direction: column; gap: 10px; }
.tap-intro { margin-bottom: 16px; }
.tap-choice .hint { margin: 4px 0 0; }
.tap-mail-form { display: flex; flex-direction: column; gap: 6px; }
.tap-ship-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tap-ship-row .form-group { flex: 1 1 120px; }
.tap-ship-row .form-group:nth-child(2) { flex: 0 0 64px; }
.tap-ship-row .form-group:nth-child(3) { flex: 0 1 110px; }
.tap-status { font-weight: 600; }
.tap-venmo-btn { display: block; text-align: center; text-decoration: none; margin-bottom: 10px; }
.tap-qr { display: none; text-align: center; }
.tap-qr img { border-radius: 8px; background: #fff; padding: 6px; }
@media (min-width: 760px) and (hover: hover) { .tap-qr { display: block; } }
.tap-address { margin: 4px 0 8px; padding: 6px 10px; border-left: 3px solid var(--border-color); }
.tap-card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 8px; }
.tap-result { margin: 8px 0 0; }
.invite-card { position: relative; text-align: left; margin: 12px 0; padding-right: 40px; }
.invite-card-text { margin: 0 0 8px; }
.invite-card-close { position: absolute; top: 6px; right: 8px; background: none; border: none; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; opacity: .7; }
.invite-thanks { margin: 0 0 6px; }
.tap-admin-address { margin: 4px 0; padding: 4px 8px; border-left: 3px solid var(--border-color); }
.tap-order-actions { margin-top: 6px; }
.tap-order-actions .tap-tracking { max-width: 220px; }
.tap-order-closed { opacity: .75; }


/* ── Bottom nav (signed in on this device; base.html #bottom-nav, app.js initBottomNav) ── */
/* The phone's bottom inset only counts in the installed app. In a browser tab the browser's own toolbar is already
   under the nav, and some browsers (Firefox on Android 15) still report the system bar's inset, leaving a big empty band. */
:root { --bn-safe: 0px; }
@media (display-mode: standalone) { :root { --bn-safe: env(safe-area-inset-bottom, 0px); } }
.bottom-nav { display: none; }
/* Signed in: the eye logo (a link home) at the top of profiles goes, since Home is in the bottom nav */
html.signed-in .profile-page-icon { display: none; }
html.signed-in .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;   /* under modals (50+) and toasts */
    display: flex; background: var(--bg-secondary); border-top: 1px solid var(--border-color);
    padding-bottom: var(--bn-safe);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px;
    text-decoration: none; color: var(--text-secondary); font-size: 12px;
}
.bottom-nav a.on { color: var(--accent-red-hover); }
.bottom-nav a:focus-visible { outline: 2px solid var(--accent-red-hover); outline-offset: -4px; }
.bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html.signed-in body { padding-bottom: calc(64px + var(--bn-safe)); }
/* the nav sits over the open Manage panel: keep the panel (and its Done button) above it */
html.signed-in.bottom-nav-over-panel #manage-modal { padding-bottom: calc(64px + var(--bn-safe)); }

/* Messages page (/<id>/inbox) */
.inbox-page { max-width: 640px; margin: 0 auto; }
.inbox-page .inbox-settings-hint { font-size: 14px; color: var(--text-secondary); margin: 4px 0 16px; }
.inbox-page .inbox-settings-hint a { color: var(--accent-red-hover); }
.inbox-page .message-card .hint { font-size: 13px; color: var(--text-secondary); }

/* Wank Log: private badge and post locations */
.blog-badge-private { background: rgba(120, 120, 120, 0.2); color: #cfcfcf; border: 1px solid #555; }
.blog-post-location { color: var(--text-secondary); font-size: 14px; margin: -4px 0 12px; }
.blog-post-location a { color: var(--accent-red-hover); }
.blog-card-place { color: var(--text-secondary); }
.blog-location-row { margin-bottom: 8px; }
.blog-location-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.invite-section { position: relative; }
.invite-section-close { position: absolute; top: 4px; right: 4px; background: none; border: 0; color: var(--text-secondary); font-size: 24px; line-height: 1; padding: 4px 8px; cursor: pointer; }

/* Merch page (/<id>/merch) */
.merch-page { max-width: 640px; margin: 0 auto; }
.merch-item h2 { margin-bottom: 8px; }
.merch-prices { margin: 12px 0 0 18px; display: grid; gap: 8px; color: var(--text-primary); }
.merch-page #merch-order { margin-top: 16px; }
.gear-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gear-items { display: grid; gap: 16px; }
.gear-item h2 { margin: 4px 0 8px; }
.gear-description { white-space: pre-line; }
.gear-price { font-weight: 600; margin: 8px 0 0; color: var(--text-primary); }
.gear-cart-summary { margin: 4px 0 12px; }
.gear-carousel { position: relative; margin: -4px -4px 12px; border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary); }
.gear-carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gear-carousel-track::-webkit-scrollbar { display: none; }
.gear-carousel-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; scroll-snap-align: center; user-select: none; }
.gear-carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gear-carousel-arrow:disabled { opacity: 0; pointer-events: none; }
.gear-carousel-arrow.prev { left: 8px; }
.gear-carousel-arrow.next { right: 8px; }
.gear-carousel-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gear-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); cursor: pointer; }
.gear-dot.active { background: #fff; transform: scale(1.25); }
.gear-editing.gear-hidden { opacity: 0.75; border-style: dashed; }
.gear-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gear-edit-moves { margin-left: auto; display: flex; gap: 4px; }
.gear-form { display: grid; gap: 10px; margin-top: 12px; }
.gear-field { display: grid; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.gear-field .input { margin: 0; }
.gear-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gear-check { display: flex; align-items: center; gap: 8px; }
.gear-delete { margin-top: 10px; }
.gear-photos-edit { display: grid; gap: 8px; justify-items: start; }
.gear-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.gear-thumb { width: 104px; display: grid; gap: 2px; }
.gear-thumb img { width: 104px; height: 78px; object-fit: cover; border-radius: 6px; background: var(--bg-secondary); }
.gear-thumb-actions { display: flex; justify-content: space-between; }
.gear-thumb-actions .btn { padding: 2px 6px; min-width: 0; }
@media (max-width: 420px) { .gear-form-row { grid-template-columns: 1fr; } }
.bottom-nav a { font-size: 11px; }

/* Buds page (/<id>/buds) and the invite modal */
.buds-page { max-width: 640px; margin: 0 auto; }
.buds-invite-hint { margin: 8px 0 20px; color: var(--text-secondary); font-size: 14px; }
.buds-section { margin-bottom: 24px; }
.buds-section h2 { font-size: 18px; margin-bottom: 4px; }
.buds-section > .hint { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.buds-list { display: grid; gap: 8px; }
.bud-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); color: var(--text-primary); text-decoration: none; }
.bud-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-secondary); flex: none; }
.bud-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bud-extra { color: var(--text-secondary); font-size: 13px; }
.bud-row-pending { opacity: 0.85; }
.invite-modal-content { max-height: 90vh; overflow-y: auto; }
#favorite-btn[aria-pressed="true"] { border-color: #d4a017; }
.bottom-nav a { font-size: 10px; }
.bottom-nav svg { width: 22px; height: 22px; }

/* Tap orders: how many for me / blank */
.tap-qty { display: grid; gap: 10px; margin: 12px 0; padding: 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); }
.tap-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tap-qty-label { display: flex; flex-direction: column; min-width: 0; }
.tap-qty-label small { color: var(--text-secondary); font-size: 12px; }
.tap-qty-stepper { display: flex; align-items: center; gap: 8px; flex: none; }
.tap-qty-stepper .btn { min-width: 40px; font-size: 18px; line-height: 1; }
.tap-qty-count { min-width: 1.5em; text-align: center; font-weight: 700; font-size: 18px; }
.tap-gift-note { margin: 0; }
.tap-order-what { margin-bottom: 4px; }

/* Bottom nav: the Home tab's eye keeps its own colours */
.bottom-nav svg.bn-eye { stroke: none; }
.bottom-nav a:not(.on) svg.bn-eye { opacity: 0.75; }

/* Admin notifications (Messages page, admins only) */
.admin-notes { margin-bottom: 24px; }
.admin-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-notes-head h2 { font-size: 18px; }
.admin-notes-count { font-size: 12px; font-weight: 600; color: #fff; background: var(--accent-red); border-radius: 99px; padding: 2px 8px; vertical-align: middle; }
.admin-notes-toggle { font-size: 13px; color: var(--text-secondary); display: flex; gap: 6px; align-items: center; }
.admin-notes-list { display: grid; gap: 8px; }
.admin-note { background: var(--bg-card); border: 1px solid var(--border-color); border-left: 3px solid var(--accent-red); border-radius: var(--radius); padding: 10px 12px; }
.admin-note-done { border-left-color: var(--success); opacity: 0.8; }
.admin-note-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.admin-note-head .hint { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.admin-note-body { margin: 4px 0; overflow-wrap: anywhere; }
.admin-note-order { font-size: 13px; color: var(--text-secondary); margin: 0 0 4px; }
.admin-note-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.admin-note-complete { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.admin-note-complete input { width: 20px; height: 20px; accent-color: var(--success); }
.inbox-convos-heading { font-size: 18px; margin: 8px 0; }

/* Conversations: the Messages list, group bar, people picker */
.inbox-convos-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.conversation-list { display: grid; gap: 8px; margin-bottom: 20px; }
.conversation-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; background: var(--bg-card);
    border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-primary); cursor: pointer; font: inherit; }
.conversation-row-unread { border-color: var(--accent-red); }
.conversation-row-avatars { display: flex; flex: none; }
.conversation-row-avatars-group .bud-avatar { width: 30px; height: 30px; margin-left: -10px; border: 2px solid var(--bg-card); }
.conversation-row-avatars-group .bud-avatar:first-child { margin-left: 0; }
.conversation-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.conversation-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row-last { color: var(--text-secondary); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row-unread .conversation-row-last { color: var(--text-primary); }
.conversation-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.conversation-row-side .hint { font-size: 11px; color: var(--text-secondary); }
.conversation-row-unread-badge { background: var(--accent-red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 18px; padding: 1px 6px; text-align: center; }
.conversation-group-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 4px 0 8px; border-bottom: 1px solid var(--border-color); margin-bottom: 8px; }
.conversation-members { color: var(--text-secondary); font-size: 13px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.conversation-group-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.conversation-sender { font-size: 12px; font-weight: 600; color: var(--accent-red-hover); margin: 0 0 2px; }
.conversation-heart-count { font-size: 11px; font-weight: 700; }
.people-picker { max-height: 90vh; display: flex; flex-direction: column; gap: 10px; }
.people-picker-list { overflow-y: auto; max-height: 50vh; display: grid; gap: 6px; }
.people-picker-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; }
.people-picker-row input { width: 20px; height: 20px; accent-color: var(--accent-red); flex: none; }
.people-picker-actions { display: flex; justify-content: flex-end; gap: 8px; }
.owner-share-location { margin: 16px 0; }
.owner-share-location .hint { color: var(--text-secondary); font-size: 13px; margin-top: 6px; text-align: center; }
.btn-refresh-location { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn-refresh-location .loc-btn-sub { font-size: 12px; font-weight: 400; color: var(--text-secondary); }

/* "Already waiting" pop-up (base.html #waiting-modal, app.js showWaitingModal) */
.waiting-content { text-align: center; border-top: 4px solid #d4a017; }
.waiting-icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.waiting-message { font-size: 16px; color: var(--text-primary); margin: 8px 0 12px; }
.waiting-wny { margin-bottom: 18px; }
.waiting-wny a { color: var(--accent-red-hover); }

/* Admin > Test Location (templates/admin_test_location.html) */
.test-location-map { height: 360px; border-radius: var(--radius); margin: 8px 0 14px; z-index: 0; }
.test-location-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.test-location-steps { padding-left: 22px; font-size: 14px; color: var(--text-secondary); }
.test-location-steps li { margin: 8px 0; }
.test-location-steps code, .test-location-url { overflow-wrap: anywhere; }

/* Home page tiles (templates/home.html, static/js/home.js, app/routes/home_tiles.py) */
.home-tile-body .home-bullets { padding-left: 22px; }
.home-tile-body .home-bullets li { margin: 4px 0; }
.home-tile-title { margin-bottom: 10px; }
.home-gallery { position: relative; margin: 0 -4px 12px; border-radius: var(--radius); overflow: hidden; background: var(--bg-secondary); }
.home-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.home-gallery-track::-webkit-scrollbar { display: none; }
.home-tile-form.drop-over, .expenses-form.drop-over { outline: 2px dashed var(--accent-red, #c0392b); outline-offset: 4px; }
.home-tile-thumb { cursor: grab; }
.home-gallery-track img[data-src] { color: transparent; background: var(--bg-secondary); }   /* not loaded yet: no alt text showing */
.home-gallery-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; scroll-snap-align: center; user-select: none; }
.home-gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.home-gallery-arrow.prev { left: 8px; }
.home-gallery-arrow.next { right: 8px; }
.home-gallery-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.home-gallery-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); cursor: pointer; }
.home-gallery-dot.active { background: #fff; transform: scale(1.25); }
/* The home page's tiles: photos edge to edge of the card and tall (2:3, the shape most of them are), capped to the screen;
   portrait photos fill the frame, landscape ones fit inside it; a tile of only landscape photos keeps a 4:3 frame */
.home-gallery-tall { margin: 4px -24px 16px; border-radius: 0; background: #111; }
.home-gallery-tall .home-gallery-track img { aspect-ratio: 2 / 3; max-height: min(80vh, 840px); object-fit: cover; }
.home-gallery-tall .home-gallery-track img.wide { object-fit: contain; }
@media (min-width: 481px) { .home-gallery-tall { margin-left: -32px; margin-right: -32px; } }
.home-gallery-tall.home-gallery-wide .home-gallery-track img { aspect-ratio: 4 / 3; object-fit: cover; }
/* Admins: edit mode */
.home-edit-only { display: none; }
.home-editing .home-edit-only { display: block; }
.home-editing .home-tile-tools.home-edit-only { display: flex; }
.home-admin-bar { text-align: center; margin: 0 0 16px; }
.home-tagline-form { max-width: 460px; margin: 8px auto 0; }
.home-tagline-form .input { width: 100%; margin-bottom: 6px; }
.home-tile-tools { align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 4px; font-size: 13px; color: var(--text-secondary); }
.home-tile-handle { cursor: grab; font-size: 18px; padding: 2px 6px; user-select: none; touch-action: none; }
.home-tile-label { flex: 1 1 auto; }
.home-tile-off { display: none; }
.home-editing .home-tile-off { display: block; opacity: 0.55; }
html.signed-in .home-editing .home-tile-signin .signed-out-only { display: block !important; opacity: 0.55; }
.home-editing .home-tile-slot > .card, .home-editing .home-tile-slot > section.card { outline: 1px dashed var(--border-color); }
.home-tile-form textarea { width: 100%; resize: vertical; font: inherit; }
.home-tile-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.home-tile-thumb { width: 104px; text-align: center; }
.home-tile-thumb img { width: 104px; height: 78px; object-fit: cover; border-radius: 6px; display: block; }
.home-tile-thumb .btn { padding: 2px 6px; }
.home-add-tile { margin: 4px 0 16px; }

/* Wank Log likes and comments (templates/blog_post.html, static/js/blog_social.js) */
.blog-card-author { color: var(--text-primary); font-weight: 600; }
.blog-like-bar { margin: 18px 0 8px; }
.blog-like-btn .blog-like-heart { color: var(--accent-red-hover); font-size: 1.1em; }
.blog-like-btn.liked { border-color: var(--accent-red-hover); }
.blog-comments { margin-top: 12px; }
.blog-comments h2 small { color: var(--text-secondary); font-weight: 400; font-size: 0.7em; }
.blog-comment { border-top: 1px solid var(--border-color); padding: 10px 0; }
.blog-comment:first-child { border-top: none; }
.blog-comment-meta { font-size: 13px; color: var(--text-secondary); margin: 0 0 4px; }
.blog-comment-meta a { color: var(--text-primary); font-weight: 600; }
.blog-comment-guest { font-size: 11px; border: 1px solid var(--border-color); border-radius: 8px; padding: 0 6px; }
.blog-comment-body p { margin: 0 0 6px; overflow-wrap: anywhere; }
.blog-comment-delete { background: none; border: none; color: var(--accent-red-hover); font-size: 12px; cursor: pointer; padding: 0 4px; }
.blog-comment-form { margin-top: 14px; }
.blog-comment-form textarea { width: 100%; resize: vertical; font: inherit; }
.blog-comment-guest-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.home-tile-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.home-tile-link-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; margin-bottom: 6px; }
@media (max-width: 480px) { .home-tile-link-row { grid-template-columns: 1fr auto; } .home-tile-link-row .tf-link-url { grid-column: 1 / 2; } }

/* Flag pop-up (base.html #flag-modal, app.js openFlagModal) */
.flag-content { text-align: left; }
.flag-reasons { border: none; padding: 0; margin: 8px 0 12px; }
.flag-reasons legend { font-weight: 600; margin-bottom: 6px; }
.flag-reason { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 4px 0; border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; }
.flag-reason:has(input:checked) { border-color: var(--accent-red-hover); }
.flag-content textarea { width: 100%; resize: vertical; font: inherit; }
.flag-content .btn + .btn { margin-top: 8px; }


/* ── Around now, tap to connect (app/routes/activity.py) ── */
.around-chip { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px;
    background: rgba(39, 174, 96, 0.15); color: #5fd68f; border: 1px solid rgba(39, 174, 96, 0.6); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.around-chip.around-chat { background: rgba(52, 152, 219, 0.15); color: #74b9ff; border-color: rgba(52, 152, 219, 0.6); }
.around-chip.around-at { background: rgba(243, 156, 18, 0.15); color: #f8c471; border-color: rgba(243, 156, 18, 0.6); }
.around-chip-profile { align-self: center; margin: 0 0 8px; }
.around-until { font-weight: 400; opacity: 0.85; }
.around-chip-tile { position: absolute; top: 6px; left: 6px; right: 6px; width: fit-content; z-index: 1;
    font-size: 11px; padding: 2px 8px; background: rgba(13, 13, 13, 0.8); }
.around-chip-row { font-size: 11px; padding: 2px 8px; margin-left: auto; }
.directory-tile-around { outline: 2px solid var(--success); }
.map-marker-thumb.map-marker-around { border-color: var(--success); }
.around-card h3 { margin-bottom: 4px; }
.around-toggle { flex: 0 0 auto; border: 2px solid transparent; background: var(--bg-secondary, transparent); color: var(--text-primary); margin: 0; }
.around-toggle.active { border-color: var(--success); color: #5fd68f; background: rgba(39, 174, 96, 0.12); }
.around-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.around-hours { width: auto; margin: 0; }
.tap-connect { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 10px; padding: 10px 12px; border-radius: var(--radius); background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.5); font-weight: 600; }

/* The words of a voice message */
.message-transcript {
    margin: 0.35rem 0 0;
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.85;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Private chats (app/routes/chats.py): the keep-your-link pop-up, the chat page, the Messages page's chats */
.chat-keep-content { text-align: left; }
.chat-keep-content h2 { text-align: center; }
.chat-keep-qr { width: min(230px, 72vw); margin: 12px auto; background: #fff; padding: 10px; border-radius: 16px; text-align: center; }
.chat-keep-qr svg { display: block; width: 100%; height: auto; }
.chat-keep-qr small { color: #333; font-size: 12px; }
.chat-keep-url { width: 100%; margin: 8px 0; font-size: 14px; }
.chat-keep-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.chat-keep-actions .btn { white-space: nowrap; text-decoration: none; text-align: center; }
.chat-keep-later { margin-top: 8px; }
.chat-page { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chat-head h1 { font-size: 22px; margin: 0; }
.chat-keep-banner { background: var(--bg-secondary); border: 1px solid var(--accent-red); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.chat-bubble { max-width: 82%; padding: 10px 12px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border-color); overflow-wrap: anywhere; }
.chat-bubble.mine { align-self: flex-end; background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.chat-bubble .chat-meta { font-size: 12px; opacity: .75; margin-top: 4px; }
.chat-bubble img { display: block; max-width: 100%; border-radius: 10px; margin-top: 6px; }
.chat-bubble audio { width: 100%; margin-top: 6px; }
.chat-compose { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: 0; background: var(--bg-primary); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); }
.chat-compose textarea { width: 100%; resize: vertical; min-height: 70px; }
.chat-compose-row { display: flex; gap: 8px; }
.chat-compose-row .btn { flex: 1; }
.chat-closed { text-align: center; color: var(--text-secondary); }
.inbox-chat-card { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-primary); font: inherit; cursor: pointer; margin-bottom: 8px; }
.inbox-chat-card .chat-unread { color: var(--accent-red-hover); font-weight: 700; }
.inbox-chat-card .chat-tag { font-size: 12px; color: var(--text-secondary); }
#chat-view-modal .modal-content { text-align: left; max-width: 560px; }
#chat-view-modal .chat-thread { max-height: 50dvh; overflow-y: auto; margin: 10px 0; }

/* Request an account, in steps (templates/request.html) */
.req-progress { display: flex; justify-content: center; gap: 6px; list-style: none; margin: 0 auto 16px; padding: 0; max-width: 420px; }
.req-progress li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); position: relative; }
.req-progress li + li::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; border-top: 2px solid var(--border-color); z-index: 0; }
.req-progress li.done + li::before, .req-progress li.done + li.active::before { border-top-color: var(--accent-red); }
.req-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--bg-secondary); border: 2px solid var(--border-color); color: var(--text-secondary); }
.req-progress li.active .req-dot { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.req-progress li.done .req-dot { border-color: var(--accent-red); color: var(--accent-red-hover); }
.req-progress li.active .req-label { color: var(--text-primary); font-weight: 600; }
.req-note { margin: 4px 0 16px; font-size: 14px; color: var(--text-secondary); }
.req-note summary { cursor: pointer; margin-bottom: 8px; }
.req-loc-result { margin-top: 12px; }
.req-loc-result .success { margin-bottom: 12px; }
.req-privacy { margin-bottom: 14px; }
.req-footer { margin-top: 14px; text-align: center; }
.req-nav { display: flex; justify-content: space-between; gap: 12px; }
.req-nav .req-fwd { margin-left: auto; }
.req-footer a, .req-code-links a { color: var(--accent-red-hover); }
.req-code-input { text-align: center; letter-spacing: 6px; margin-bottom: 12px; }
.req-code-links { margin-top: 12px; }
.tap-qr img.tap-venmo-qr { padding: 0; background: none; max-width: 100%; height: auto; }
.tap-gallery { margin: 4px 0 14px; }

/* After setup: steps 5 (first pic) and 6 (raccoon) (templates/setup.html startOnboarding) */
.ob-step { text-align: left; }
.ob-step h3 { margin: 2px 0 6px; }
.ob-step-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-red-hover); font-weight: 700; margin: 0; }
.ob-examples-label { font-size: 14px; font-weight: 600; margin: 12px 0 6px; color: var(--text-primary); }
.ob-examples-label span { font-weight: 400; color: var(--text-secondary); }
.ob-examples .home-gallery-track figure { flex: 0 0 100%; width: 100%; margin: 0; position: relative; scroll-snap-align: center; }
.ob-examples .home-gallery-track figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; user-select: none; }
.ob-examples figcaption { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; }
.ob-pic-added { text-align: center; margin: 10px 0; }
.ob-pic-added img { max-width: 60%; border-radius: var(--radius); }
.ob-raccoon-grid { max-height: 50dvh; overflow-y: auto; margin: 10px 0; }
#ob-ready > .btn, #ob-pic .btn, #ob-raccoon .btn { margin-top: 16px; }

/* The profile page's one-time pointer to the ⚙️ gear (app.js gearCoach) */
.gear-coach { position: absolute; z-index: 90; background: var(--bg-card); color: var(--text-primary); border: 2px solid var(--accent-red); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); font-size: 14px; text-align: left; }
.gear-coach p { margin: 0 0 6px; }
.gear-coach::before { content: ""; position: absolute; top: -10px; left: calc(var(--arrow-left, 50%) - 9px); border: 9px solid transparent; border-top: 0; border-bottom-color: var(--accent-red); }
.coach-pulse { animation: coach-pulse 1.2s ease-in-out infinite; border-radius: 50%; }
@keyframes coach-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, .7); } 50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); } }

/* Home tile editor: "Has tap example pics" (static/js/home.js) */
.tf-tap-examples-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; cursor: pointer; }
.tf-tap-examples-row input { width: 18px; height: 18px; }
.home-tile-flag { font-size: 13px; color: var(--text-muted, #888); margin: -4px 0 8px; }

/* Your own profile, under Update My Location: auto-update and clear (templates/profile_view.html) */
.profile-location-owner { margin-top: 10px; text-align: center; }
.profile-location-owner .toggle-label { justify-content: center; }
.profile-location-owner .hint { color: var(--text-secondary); font-size: 13px; margin: 4px 0 6px; }

/* Your own profile: ＋ (add media) / raccoon picker on each gallery slide (templates/profile_view.html setupOwnerGalleryButtons) */
.slide-owner-btn {
    position: absolute; top: 10px; right: 10px; z-index: 3; width: 44px; height: 44px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.85); background: rgba(0,0,0,0.55); color: #fff; font-size: 26px; line-height: 1;
    display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.slide-owner-btn:hover, .slide-owner-btn:focus-visible { background: var(--accent-red); }
.slide-owner-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
#profile-bio-status { min-height: 1.2em; margin-top: 4px; }

/* Top of the profile: "where", in their words (templates/profile_view.html) */
.location-open { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 6px;
    border: 2px solid var(--accent-red); text-decoration: none; word-break: break-word; }
.location-open .loc-open-main { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.location-open .loc-open-sub { font-size: 13px; font-weight: 500; color: var(--accent-red-hover); }
.location-open:hover { background: var(--bg-secondary); }
.loc-box .loc-where { display: block; width: 100%; margin: 0; }
.loc-where-status { display: block; min-height: 1.2em; margin: 2px 0 6px; font-size: 12px; color: var(--success); text-align: right; }

/* Your own profile: the Location card (where, Update My Realtime Location, auto-update) */
.loc-box { border: 2px solid var(--accent-red); border-radius: var(--radius, 10px); padding: 12px; margin-top: 8px; text-align: left; }
.loc-box-title { margin: 0 0 10px; text-align: center; }
.loc-box .btn-refresh-location { margin: 0; border: 0; }
.loc-box .btn-refresh-location:not(:disabled):hover { background: var(--accent-red-hover); }
.loc-box .btn-refresh-location .loc-btn-sub { color: rgba(255, 255, 255, 0.85); }
.loc-box-auto { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 10px;
    font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.loc-box-auto input { width: 18px; height: 18px; margin: 0; }
.around-card .around-row + .around-row { margin-top: 10px; }
.around-toggle.around-off.active { border-color: var(--text-secondary); color: var(--text-primary); background: var(--bg-secondary, transparent); }
.around-card .around-row .around-toggle { flex: 1 1 0; }

/* A profile, nobody signed in on this device: Sign In (templates/profile_view.html setupSignInPrompt) */
.profile-signin { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 12px; }
.profile-signin .btn-primary { min-width: 180px; }

/* ⚙️ Manage on a desktop: wide, each section of the open tab a card, packed in columns like the admin dashboard.
   Phones keep the single column above. */
@media (min-width: 960px) {
    #manage-modal .modal-content.manage-panel { width: 94vw; max-width: 1500px; max-height: 90dvh; padding: 28px 24px; }
    #manage-modal .manage-tabs, #manage-modal .nudge { max-width: 560px; margin-left: auto; margin-right: auto; }
    #manage-modal .manage-tab-panel.active { column-width: 380px; column-gap: 16px; }
    #manage-modal .manage-tab-panel > section {
        break-inside: avoid; display: inline-block; width: 100%; vertical-align: top;
        background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px;
        padding: 16px; margin: 0 0 16px;
    }
    #manage-modal .manage-tab-panel > section + section { padding-top: 16px; border-top: 1px solid var(--border-color); }
}

/* A profile: Flag this profile, at the very bottom, a plain red link (templates/profile_view.html) */
.profile-flag-link { display: block; margin: 24px auto 4px; background: none; border: 0; padding: 6px 10px;
    color: var(--accent-red-hover); font-size: 14px; font-weight: 600; cursor: pointer; }
.profile-flag-link:hover { text-decoration: underline; }

/* "I'm not a robot" pop-up (base.html #captcha-modal) */
.captcha-box { display: flex; justify-content: center; min-height: 78px; margin: 12px 0; }

/* Sign-in page: Need an Account? stands out, right under Sign In (templates/signin.html) */
.signin-need-account { margin: 18px 0 4px; padding: 16px; border: 2px solid var(--accent-red); border-radius: 12px;
    background: rgba(192, 57, 43, 0.10); text-align: center; }
.signin-need-account h2 { margin: 0 0 4px; font-size: 20px; }
.signin-need-account .hint { margin: 0 0 12px; color: var(--text-secondary); }
.setup-pin.pin-mismatch .signin-digit { border-color: var(--accent-red); }

/* ── Events calendar (/events, templates/events.html, event.html, event_edit.html, static/js/events.js) ── */
.events-page, .event-page, .event-edit-page { max-width: 760px; margin: 0 auto; }
.events-actions { margin: 4px 0 16px; }
.events-review { margin-bottom: 16px; }
.events-review h2 { font-size: 18px; margin-bottom: 4px; }
.events-cal-card { margin: 12px 0 20px; padding: 12px; }
.events-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.events-cal-head h2 { font-size: 18px; margin: 0; text-align: center; flex: 1; }
.events-today { display: block; margin: 0 auto 8px; }
.events-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.events-cal-dow { text-align: center; font-size: 12px; color: var(--text-secondary); padding: 2px 0; }
.events-cal-day { min-height: 64px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 4px; text-align: left;
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary);
    font-family: inherit; cursor: pointer; overflow: hidden; min-width: 0; }
.events-cal-day.other { opacity: 0.45; }
.events-cal-day.today .events-cal-num { background: var(--accent-red); color: #fff; border-radius: 99px; padding: 0 6px; }
.events-cal-day.has { border-color: var(--accent-red); }
.events-cal-day.picked { outline: 2px solid var(--accent-red-hover); outline-offset: -2px; }
.events-cal-num { font-size: 13px; font-weight: 700; align-self: flex-start; }
.events-cal-ev { font-size: 11px; line-height: 1.25; background: rgba(192, 57, 43, 0.2); border-radius: 4px; padding: 1px 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.events-cal-more { font-size: 11px; color: var(--text-secondary); }
@media (max-width: 520px) {
    .events-cal-day { min-height: 46px; align-items: center; }
    .events-cal-num { align-self: center; }
    .events-cal-ev { display: none; }
    .events-cal-day.has::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-red); }
    .events-cal-more { display: none; }
}
.events-day h2 { font-size: 18px; margin-bottom: 8px; }
.events-list { display: grid; gap: 10px; }
.event-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); color: var(--text-primary); text-decoration: none; }
.event-card img, .event-card-icon { width: 76px; height: 76px; flex: none; border-radius: 8px; object-fit: cover; background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center; font-size: 30px; }
.event-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.event-card-when, .event-card-where, .event-card-checkins { font-size: 13px; color: var(--text-secondary); }
.event-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.event-card-tags .blog-chip { font-size: 12px; padding: 2px 8px; }
.event-card-past { opacity: 0.6; }
.event-review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 6px; }
.event-status { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.event-status-pending { background: rgba(212, 160, 23, 0.15); border: 1px solid #d4a017; }
.event-status-declined { background: var(--bg-secondary); border: 1px solid var(--border-color); }
.event-when, .event-where { color: var(--text-secondary); margin: 4px 0; }
.event-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.event-checkin { margin: 14px 0; }
.event-checkin-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.event-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.event-person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px; background: var(--bg-secondary);
    border: 1px solid var(--border-color); color: var(--text-primary); text-decoration: none; font-size: 13px; }
.event-person img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.event-photos { display: flex; gap: 8px; overflow-x: auto; margin: 14px 0; scroll-snap-type: x mandatory; }
.event-photos img { height: 220px; max-width: 85vw; border-radius: var(--radius); object-fit: cover; scroll-snap-align: start; }
.event-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin: 14px 0; }
.event-map { height: 260px; border-radius: var(--radius); border: 1px solid var(--border-color); margin: 12px 0 6px; z-index: 0; }
.event-map-edit { height: 300px; }
.event-map-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.event-admin { margin-top: 18px; }
.event-admin-row { display: flex; flex-wrap: wrap; gap: 8px; }
.event-form .form-group { margin-bottom: 16px; }
.event-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .event-times { grid-template-columns: 1fr; } }
.event-edit-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.event-edit-photo { width: 110px; margin: 0; display: grid; gap: 2px; }
.event-edit-photo img { width: 110px; height: 82px; object-fit: cover; border-radius: 6px; background: var(--bg-secondary); }
.event-edit-photo div { display: flex; justify-content: space-between; align-items: center; }
.event-edit-photo .btn { padding: 2px 6px; min-width: 0; }
.home-events .event-card img, .home-events .event-card-icon { width: 56px; height: 56px; font-size: 24px; }

/* Admin › Active Now (templates/admin.html) */
.active-now-verdict { font-weight: 700; padding: 10px 12px; border-radius: 10px; margin: 6px 0 10px; }
.active-now-safe { background: rgba(39, 174, 96, 0.15); color: #5fd68f; }
.active-now-ok { background: rgba(241, 196, 15, 0.12); color: #f7dc6f; }
.active-now-wait { background: rgba(192, 57, 43, 0.18); color: #ff8a80; }
.active-now-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--border-color); font-size: 14px; }
.active-now-who { font-weight: 600; }
.active-now-doing { text-align: right; }
.active-now-busy { color: #ff8a80; font-weight: 600; }
.active-now-when { grid-column: 1 / -1; font-size: 12px; color: var(--text-secondary); }
.active-now-idle, .active-now-bot { opacity: 0.55; }
/* Events: the red eye (taps available), going, links */
.event-eye { width: 1.1em; height: 1.1em; vertical-align: -0.15em; flex: none; }
.event-taps { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent-red-hover); margin: 6px 0; }
.event-taps .event-eye { width: 22px; height: 22px; }
.event-card-taps { font-size: 12px; font-weight: 600; color: var(--accent-red-hover); }
.events-cal-top { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.events-cal-top .event-eye { width: 14px; height: 14px; }
.events-cal-day.taps { border-color: var(--accent-red); background: rgba(192, 57, 43, 0.12); }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.event-links-edit { display: grid; gap: 8px; margin: 6px 0 8px; }
.event-link-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 6px; align-items: center; }
@media (max-width: 520px) { .event-link-row { grid-template-columns: minmax(0, 1fr) auto; } .event-link-row input[data-field="url"] { grid-column: 1; grid-row: 2; } }
.event-taps-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; cursor: pointer; }
.event-taps-check input { margin-top: 3px; }
@media (max-width: 520px) {
    .events-cal-top { justify-content: center; flex-direction: column; }
    .events-cal-day.taps::after { display: none; }
}
/* The event editor's boxes: ordinary left-aligned text (not the big spaced-out PIN look of .form-group input),
   and the date/time boxes may shrink to fit the card */
.event-form .form-group input, .event-form .form-group textarea { font-size: 16px; letter-spacing: normal; text-align: left; min-width: 0; max-width: 100%; }
.event-form .event-times { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.event-form input[type="datetime-local"] { width: 100%; padding-left: 12px; padding-right: 8px; }
.event-publish { border: 1px solid var(--border-color); border-radius: var(--radius); padding: 10px 12px 12px; margin: 4px 0 16px; display: grid; gap: 8px; }
.event-publish legend { padding: 0 6px; font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.event-publish label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.event-publish label input { margin-top: 3px; }
.event-form .event-publish-at { margin-left: 26px; width: calc(100% - 26px); max-width: 320px; font-size: 16px; letter-spacing: normal; text-align: left; }
.event-publish-at:disabled { opacity: 0.5; }

/* Videos are shown whole (black bars where the shape doesn't match the frame), never cropped: a landscape clip in
   the portrait slideshow / full-screen viewer would otherwise lose its sides. Photos keep filling the frame. */
.gallery-video, .media-lightbox-content video { object-fit: contain; background: #000; }

/* Directory Near You map: the "go to my location" target button (templates/directory.html) */
.map-locate-btn {
    width: 40px; height: 40px; padding: 8px; border-radius: 8px; border: 2px solid rgba(0,0,0,0.2);
    background: #fff; color: #333; cursor: pointer; display: grid; place-items: center;
}
.map-locate-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.map-locate-btn svg .dot { fill: #1a73e8; stroke: none; }
.map-locate-btn.busy svg { animation: map-locate-spin 1s linear infinite; }
@keyframes map-locate-spin { to { transform: rotate(360deg); } }
.upload-limits { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }

/* ⚙️ › 🦝 Raccoon is its own tab: the grid isn't boxed in (the panel scrolls), and on a big screen it uses the
   panel's whole width instead of one column card. */
#manage-modal [data-tab-panel="raccoon"] .raccoon-avatar-grid { max-height: none; overflow: visible; }
@media (min-width: 960px) {
    #manage-modal .manage-tab-panel.active[data-tab-panel="raccoon"] { column-width: auto; columns: auto; }
    #manage-modal [data-tab-panel="raccoon"] .raccoon-avatar-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* Profile links (up to 5, labelled): a bar at the bottom of the profile; edited in ⚙️ › Profile › Links */
.profile-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 8px; }
.profile-link {
    display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px;
    background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary);
    text-decoration: none; font-size: 14px; max-width: 100%; overflow-wrap: anywhere;
}
.profile-link:hover, .profile-link:focus-visible { border-color: var(--accent-red); }
.profile-links-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.profile-link-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px; }
.profile-link-row .input { margin: 0; }

/* Home / Help tile text: Markdown (app/routes/home_tiles.py render) */
.home-tile-body .home-md-h { margin: 14px 0 6px; line-height: 1.25; }
.home-tile-body h3.home-md-h { font-size: 18px; }
.home-tile-body h4.home-md-h { font-size: 16px; }
.home-tile-body h5.home-md-h { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.home-tile-body .home-md-h:first-child { margin-top: 0; }
.home-tile-body a { color: var(--accent-red-hover); }
.home-tile-body .home-quote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent-red); color: var(--text-secondary); }
.home-tile-body .home-hr { border: 0; border-top: 1px solid var(--border-color); margin: 14px 0; }
.home-tile-body code { background: var(--bg-secondary); border-radius: 4px; padding: 1px 5px; font-size: 0.92em; }
.home-tile-body .home-code { background: var(--bg-secondary); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.home-tile-body .home-code code { background: none; padding: 0; }

/* 🟢 Online (app/presence.py): quieter than 👀 Looking */
.around-chip.around-online { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); border-color: var(--border-color); }
.map-marker-thumb.map-marker-online { border-color: rgba(39, 174, 96, 0.55); }
/* on a directory photo: a dark, blurred backing and bright text, so it reads over any picture */
.around-chip-tile { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.around-chip.around-chip-tile.around-online { background: rgba(0, 0, 0, 0.6); color: #fff; border-color: rgba(255, 255, 255, 0.3); }

/* Admin tabs: Users / Online / Settings (templates/admin.html) */
.admin-tabs {
    display: flex; gap: 4px; max-width: 560px; margin: 0 auto 16px; padding: 4px;
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px;
}
.admin-tab {
    flex: 1; padding: 10px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text-secondary);
    font: inherit; font-weight: 600; cursor: pointer;
}
.admin-tab.active { background: var(--accent-red); color: #fff; }
.admin-tab:focus-visible { outline: 2px solid var(--accent-red-hover); outline-offset: 2px; }

/* /signin: back from Google with an email no account uses (signin.js) */
.signin-no-account { margin: 0 0 20px; padding: 16px; border: 2px solid var(--accent-red); border-radius: var(--radius);
    background: rgba(192, 57, 43, 0.12); }
.signin-no-account h2 { margin-top: 0; }
.signin-no-account .btn { margin-top: 10px; }
.tag-app-update { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--accent-red); border-radius: var(--radius); }

/* Profile, admins only: the hidden admin note (templates/profile_view.html setupAdminNote) */
.admin-note-box { text-align: center; margin: 0 0 8px; }
.admin-note-edit { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 6px; }
.admin-note-edit .input { flex: 1 1 200px; margin: 0; }
.write-tap-status { display: block; margin-top: 4px; }
.write-tap-status:empty { display: none; }

/* An admin's logged-out view (app.js enterLoggedOutView): always visible, one tap back */
.logged-out-view-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 9000;
    display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px; max-width: calc(100vw - 24px);
    background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--accent-red); box-shadow: var(--shadow); font-size: 14px; white-space: nowrap; }
.logged-out-view-pill button { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--accent-red); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; }
.logged-out-view-pill button:hover { background: var(--accent-red-hover); }

/* ── Challenges (templates/challenge*.html, static/js/challenges.js) ── */
.challenge-prize { display: flex; gap: 12px; align-items: center; margin: 12px 0; border: 1px solid #b8860b; }
.challenge-prize > span:first-child { font-size: 32px; line-height: 1; }
.challenge-me { margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.challenge-countdown { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.proof-form { display: flex; flex-direction: column; gap: 10px; }
.proof-form h2 { font-size: 18px; margin: 0; }
.proof-preview { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius); align-self: center; }
.challenge-drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 14px; border: 2px dashed var(--border-color); border-radius: var(--radius); background: var(--bg-card); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.challenge-drop:hover, .challenge-drop:focus-visible { border-color: var(--primary, #c0392b); outline: none; }
.challenge-drop.drag-over { border-color: var(--primary, #c0392b); border-style: solid; background: rgba(192, 57, 43, 0.12); }
.challenge-drop.is-disabled { opacity: .5; cursor: not-allowed; }
.challenge-drop-text { display: flex; flex-direction: column; gap: 2px; }
.challenge-drop-text small { color: var(--text-muted, #999); font-size: 13px; }
/* The challenge's photos: the profile gallery's frame, slides, arrows and dots (.gallery-*), but shown whole and unblurred */
.challenge-viewer { margin: 14px 0; aspect-ratio: 4 / 3; border: 1px solid var(--border-color); }
.challenge-viewer .gallery-slide a { display: block; width: 100%; height: 100%; }
.challenge-viewer .gallery-image { filter: none; transform: none; object-fit: contain; border-radius: 0; }
.challenge-max-proofs { max-width: 120px; }
.challenge-alert { z-index: 140; }
.push-ask { z-index: 130; }
.challenge-views h2 { font-size: 18px; margin: 0 0 8px; }
.challenge-views p.hint + p.hint { margin-top: 6px; }
.challenge-views-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.push-ask-icon { font-size: 40px; margin: 0 0 4px; }
.push-ask .btn + .btn { margin-top: 10px; }
.challenge-alert-icon { font-size: 40px; margin: 0 0 4px; }
.challenge-alert-list { margin: 14px 0; text-align: left; }
.challenge-alert-list .event-card { color: inherit; text-decoration: none; }
.challenge-alert-hint { margin-top: 10px; }
.challenge-edit-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-bottom: 8px; }
.challenge-edit-photos:empty { display: none; }
.challenge-edit-photo { position: relative; }
.challenge-edit-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-color); }
.challenge-edit-photo.is-new img { border-style: dashed; }
.challenge-edit-photo button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 16px; line-height: 28px; padding: 0; cursor: pointer; }
.challenge-edit-photo .challenge-cover-badge { position: absolute; left: 4px; bottom: 4px; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: rgba(0, 0, 0, 0.65); color: #fff; }
.challenge-gallery-wrap { margin: 20px 0; }
.challenge-gallery-wrap h2 { font-size: 20px; margin-bottom: 10px; }
.challenge-gallery-wrap h2 small { font-weight: 400; font-size: 14px; }
.challenge-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.challenge-proof { position: relative; margin: 0; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-color); }
.challenge-proof > a img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.challenge-proof figcaption { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; font-size: 14px; }
.challenge-caption { overflow-wrap: anywhere; }
.challenge-proof-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.challenge-winner { border: 2px solid #d4af37; box-shadow: 0 0 12px rgba(212, 175, 55, 0.35); }
.challenge-winner-badge { position: absolute; top: 8px; left: 8px; background: #d4af37; color: #1a1a1a; font-weight: 700; font-size: 13px;
    padding: 3px 9px; border-radius: 99px; }
.challenge-limit { display: flex; gap: 8px; }
.challenge-limit input { flex: 1; min-width: 0; }
.challenge-limit select { flex: 0 0 auto; width: auto; }
.challenge-invite { margin: 16px 0; }
.challenge-invite h2 { font-size: 18px; margin-bottom: 8px; }
.invite-pick { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.invite-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.invite-chips .event-person button { background: none; border: 0; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 0 2px; }
.invite-results { display: flex; flex-direction: column; gap: 4px; }
.invite-results button { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.invite-results img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.invite-results small { color: var(--text-secondary); margin-left: auto; }
.invite-log { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; font-size: 14px; }

/* Challenge proof: several photos queued at once, each with a caption; and the full-screen proof gallery */
.proof-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.proof-queue-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.proof-queue-item .input { font-size: 14px; padding: 6px 8px; }
.proof-queue-thumb { position: relative; }
.proof-queue-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-color); }
.proof-queue-thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 18px; line-height: 28px; padding: 0; cursor: pointer; }
.proof-form.is-busy .proof-queue, .proof-form.is-busy .challenge-drop { opacity: 0.6; pointer-events: none; }
.challenge-proof > a.proof-open { display: block; cursor: zoom-in; }
.proof-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, 0.92); display: flex; align-items: center; justify-content: center;
    padding: calc(56px + env(safe-area-inset-top, 0px)) 16px calc(72px + env(safe-area-inset-bottom, 0px)); }
.proof-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; }
.proof-lb-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 20px; cursor: pointer; }
.proof-lb-step { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: none; border-radius: 8px;
    background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 36px; line-height: 1; cursor: pointer; }
.proof-lb-prev { left: 8px; }
.proof-lb-next { right: 8px; }
.proof-lightbox.is-single .proof-lb-step { display: none; }
.proof-lb-info { position: absolute; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); margin: 0; color: #fff; text-align: center;
    display: flex; flex-direction: column; gap: 2px; font-size: 15px; overflow-wrap: anywhere; }
.proof-lb-info small { opacity: 0.7; font-size: 13px; }
body.proof-lb-open { overflow: hidden; }
@media (hover: none) { .proof-lb-step { background: rgba(255, 255, 255, 0.08); width: 40px; } }
/* ✏️ Edit your proof */
.proof-edit { position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.proof-edit-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; margin: auto; }
.proof-edit-box h2 { font-size: 18px; margin: 0; }
.proof-edit-pick img { display: block; max-width: 100%; max-height: 300px; object-fit: contain; border-radius: var(--radius); margin: 0 auto 8px; }
.proof-edit-pick.is-disabled { cursor: default; opacity: 1; border-style: solid; }
.proof-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* Challenge submissions: the member's own (top card), the count on a gallery card, the editor's removed / new tiles */
.challenge-me h2 { font-size: 18px; margin: 0 0 8px; }
.challenge-winner-tag { font-size: 13px; background: #d4af37; color: #1a1a1a; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.proof-mine-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.proof-mine-strip img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; border: 1px solid var(--border-color); }
.proof-mine-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.proof-mine-actions .btn { flex: 1 1 160px; }
.proof-copy-hint { margin-top: 6px; }
.challenge-count-badge { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 13px; font-weight: 600;
    padding: 3px 8px; border-radius: 99px; }
.proof-queue-item.is-gone img { opacity: 0.3; filter: grayscale(1); }
.proof-queue-item.is-gone .input { opacity: 0.4; pointer-events: none; text-decoration: line-through; }
.proof-queue-item.is-new img { border-style: dashed; border-color: var(--primary, #c0392b); }
.proof-edit-box .proof-queue { max-height: 50vh; overflow-y: auto; }
/* Challenge tags: who's in a submission */
.tag-pick { display: flex; flex-direction: column; gap: 8px; }
.tag-pick-label { font-weight: 600; font-size: 15px; }
.tag-pick-label small { font-weight: 400; }
.challenge-with { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.challenge-with a { color: inherit; text-decoration: underline; }
p.challenge-with { margin: 0 0 8px; }
.challenge-tagged { margin: 16px 0; }
.challenge-tagged p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.challenge-tagged p + p { margin-top: 8px; }
.copy-confirm-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
#copy-confirm p { margin: 0; }
/* Challenge submissions: ❤️ hearts and 🗳️ votes */
.challenge-react { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.react-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border-color);
    background: var(--bg-secondary); color: var(--text-primary, inherit); font-size: 13px; cursor: pointer; }
.react-btn:hover { border-color: var(--primary, #c0392b); }
.react-btn.is-on { border-color: var(--primary, #c0392b); background: rgba(192, 57, 43, 0.15); font-weight: 600; }
.react-btn:disabled { opacity: 0.6; cursor: wait; }
.react-count { font-size: 13px; color: var(--text-secondary); }
/* Challenge editor: drag the photos into order */
.challenge-edit-photo { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--radius); }
.challenge-edit-photo:focus-visible { outline: 2px solid var(--primary, #c0392b); outline-offset: 2px; }
.challenge-edit-photo.is-dragging { cursor: grabbing; z-index: 5; opacity: 0.85; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); transition: none; }
.challenge-edit-photos.is-sorting .challenge-edit-photo:not(.is-dragging) { transition: transform .12s; }
.challenge-edit-photo.is-target { outline: 2px dashed var(--primary, #c0392b); outline-offset: 2px; }
/* Challenge proof clips: videos and sound clips */
.proof-lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.proof-lb-stage img, .proof-lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; background: #000; }
.proof-lb-stage[data-kind="audio"] { padding: 0 56px; }
.wave-player { width: 100%; max-width: 640px; display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.08);
    border-radius: 16px; padding: 14px 16px; color: #fff; }
.wave-play { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--accent-red, #e74c3c); color: #fff;
    font-size: 22px; cursor: pointer; }
.wave-canvas { flex: 1 1 auto; min-width: 0; height: 64px; cursor: pointer; touch-action: none; }
.wave-canvas:focus-visible { outline: 2px solid var(--accent-red, #e74c3c); outline-offset: 2px; border-radius: 4px; }
.wave-time { flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.85; }
@media (max-width: 480px) { .wave-player { flex-wrap: wrap; gap: 8px 10px; padding: 12px; } .wave-play { width: 44px; height: 44px; font-size: 18px; }
    .wave-canvas { flex-basis: calc(100% - 54px); height: 56px; } .wave-time { width: 100%; text-align: right; } .proof-lb-stage[data-kind="audio"] { padding: 0 50px; } }
.proof-audio-cover { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1;
    background: linear-gradient(135deg, #3a1c71, #d76d77 60%, #ffaf7b); }
.proof-audio-cover .proof-wave { width: 86%; height: 46%; }
.proof-audio-play, .proof-video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px;
    border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px;
    pointer-events: none; }
.proof-clip-len { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 12px; font-weight: 600;
    padding: 2px 7px; border-radius: 99px; pointer-events: none; }
.challenge-proof > a.proof-open { position: relative; }
.proof-queue-thumb video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-color); background: #000; }
.proof-audio-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; aspect-ratio: 1;
    border-radius: var(--radius); border: 1px solid var(--border-color); background: linear-gradient(135deg, #3a1c71, #d76d77); color: #fff; }
.proof-audio-tile b { font-size: 30px; }
.proof-audio-tile small { font-size: 12px; padding: 0 6px; text-align: center; overflow-wrap: anywhere; }
.proof-queue-badge { position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.proof-queue-item.is-gone .proof-audio-tile, .proof-queue-item.is-gone video { opacity: 0.3; filter: grayscale(1); }
.proof-strip-item { position: relative; flex: 0 0 auto; }
.proof-strip-item b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 0 0 6px #000; }
.proof-strip-audio { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 8px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; background: linear-gradient(135deg, #3a1c71, #d76d77); color: #fff; font-size: 22px; }
.proof-strip-audio small { font-size: 11px; }
/* The challenge's own video / sound clip (its gallery at the top) */
.challenge-video { width: 100%; max-height: 70vh; background: #000; object-fit: contain; }
.challenge-audio { width: 100%; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 24px 56px; background: linear-gradient(135deg, #3a1c71, #d76d77 60%, #ffaf7b); box-sizing: border-box; }
.challenge-audio-label { color: #fff; font-weight: 700; font-size: 16px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.challenge-audio .wave-player { background: rgba(0, 0, 0, 0.35); }
@media (max-width: 480px) { .challenge-audio { padding: 20px 48px; } }
.challenge-edit-photo video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border-color); pointer-events: none; }
.challenge-edit-photo .proof-audio-tile { pointer-events: none; }
.challenge-edit-photo .proof-queue-badge { left: auto; right: 4px; bottom: 4px; }
/* Invite a Bud: a share link instead of an email */
#invite-link-btn { margin-top: 8px; }
.invite-link-out { margin-top: 12px; padding: 12px; border: 1px dashed var(--border-color); border-radius: var(--radius); background: var(--bg-secondary); }
.invite-link-out .hint { margin: 0 0 8px; }
.invite-link-url { margin: 0; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-primary, #000); color: var(--text-primary); font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.invite-link-actions .share-glyph { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; fill: currentColor; stroke: currentColor; stroke-width: 2; }
.invite-link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.invite-link-actions .btn { flex: 1 1 120px; }
.invite-list-row .invite-copy { margin-left: 6px; padding: 2px 8px; font-size: 12px; border-radius: 999px; border: 1px solid var(--border-color); background: transparent; color: var(--text-primary); cursor: pointer; }
.invite-banner .invite-banner-note { margin: 0 0 6px; color: var(--text-primary); font-style: italic; white-space: pre-line; }
.invite-mode { display: flex; gap: 6px; padding: 4px; margin: 10px 0 12px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-secondary); }
.invite-mode-btn { flex: 1; padding: 9px 6px; white-space: nowrap; font-size: 14px; border: none; border-radius: 999px; background: transparent; color: var(--text-secondary); font-family: inherit; font-weight: 600; cursor: pointer; }
.invite-mode-btn.active { background: var(--accent-red, #c0392b); color: #fff; }
/* Bottom nav: 🏆 Challenges' dot (one on now that you haven't opened) */
.bottom-nav .bn-icon { position: relative; display: inline-flex; }
.bottom-nav .bn-dot { position: absolute; top: -1px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-red, #e33); box-shadow: 0 0 0 2px var(--bg-secondary); }
/* 👥 People: the Directory and ⭐ My Buds, one toggle at the top of each (signed in only: the bottom nav's People) */
/* The Connections pills (templates/_connections_nav.html): for everyone; ⭐ My Buds only when signed in. They scroll
   sideways if a phone is too narrow for all of them. */
.people-toggle { display: flex; gap: 4px; padding: 4px; margin: 52px auto 14px; width: fit-content; max-width: 100%; border: 1px solid var(--border-color);
    border-radius: 999px; background: var(--bg-secondary); overflow-x: auto; scrollbar-width: none; }
.people-toggle::-webkit-scrollbar { display: none; }
html:not(.signed-in) .people-toggle .buds-link { display: none; }
.people-toggle.people-toggle-home { margin: 4px auto 18px; }   /* the home page: under the logo and tagline */
.people-toggle a { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; text-align: center; text-decoration: none; color: var(--text-secondary); font-weight: 600; font-size: 14px; white-space: nowrap; }
html.signed-in .people-toggle { gap: 2px; padding: 3px; }   /* four pills: a little tighter, so they fit a phone */
html.signed-in .people-toggle a { padding: 7px 9px; font-size: 13px; letter-spacing: -0.1px; }
@media (max-width: 420px) { html.signed-in .people-toggle .pill-icon { display: none; } }
.people-toggle a.on { background: var(--accent-red, #c0392b); color: #fff; }
/* 🛒 Gear on the owner's own profile (out of the bottom nav) */
.owner-gear-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-secondary); color: var(--text-primary); text-decoration: none; font-size: 14px; }
.owner-gear-link span { color: var(--text-secondary); }
/* 🛒 Buy Gear on your own profile (static/js/tap.js loadOwnerCards): a call-out, not a plain link */
.gear-callout { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); text-decoration: none !important;
    color: var(--text-primary) !important; border: 1px solid rgba(231, 76, 60, .55);
    background: radial-gradient(120% 140% at 0% 0%, rgba(192, 57, 43, .38), transparent 60%), linear-gradient(135deg, #2a1712, var(--bg-card));
    box-shadow: 0 6px 22px rgba(192, 57, 43, .18); transition: transform .15s, box-shadow .15s, border-color .15s; }
.gear-callout:hover, .gear-callout:focus-visible { transform: translateY(-1px); border-color: var(--accent-red-hover); box-shadow: 0 10px 28px rgba(192, 57, 43, .3); }
.gear-callout:focus-visible { outline: 2px solid var(--accent-red-hover); outline-offset: 2px; }
.gear-callout-pics { flex: none; display: flex; align-items: center; }
.gear-callout-pics img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 2px solid var(--bg-card); background: var(--bg-secondary); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.gear-callout-pics img + img { margin-left: -18px; }
.gear-callout-emoji { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: rgba(192, 57, 43, .25); border: 1px solid rgba(231, 76, 60, .45); }
.gear-callout-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gear-callout-text strong { font-size: 17px; letter-spacing: .01em; }
.gear-callout-text span { font-size: 13px; color: var(--text-secondary); }
.gear-callout-text .gear-callout-from { color: #f5b7a8; font-weight: 600; }
.gear-callout-text .gear-callout-from:empty { display: none; }
.gear-callout-go { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--accent-red); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
.gear-callout:hover .gear-callout-go { background: var(--accent-red-hover); }
@media (max-width: 380px) { .gear-callout { flex-wrap: wrap; } .gear-callout-go { margin-left: auto; } }
@media (prefers-reduced-motion: reduce) { .gear-callout { transition: none; } .gear-callout:hover { transform: none; } }
/* Share on a challenge's / an event's page */
.page-share-row { margin: 4px 0 10px; }
.page-share-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; }
.page-share-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 2; }

/* 👀 Missed Connections (templates/missed*.html, home.html's first tile; static/js/missed.js) */
.home-missed { border: 1px solid var(--accent-red); background: linear-gradient(160deg, rgba(192, 57, 43, 0.14), var(--bg-card) 60%); }
.home-missed-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.missed-page { max-width: 640px; margin: 0 auto; }
.missed-page > .btn-full { margin: 6px 0 16px; }
.missed-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; text-align: left; }
.missed-card { display: flex; flex-direction: column; gap: 3px; padding: 12px; background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-red); border-radius: var(--radius); color: var(--text-primary); text-decoration: none; overflow-wrap: anywhere; }
.missed-card:hover, .missed-card:focus-visible { border-color: var(--accent-red); color: var(--text-primary); }
.missed-card-title { font-size: 16px; }
.missed-card-meta, .missed-card-by { font-size: 13px; color: var(--text-secondary); }
.missed-card-excerpt { font-size: 14px; }
.missed-section { margin-top: 14px; text-align: left; }
.missed-section h2 small { color: var(--text-secondary); font-weight: 400; font-size: 0.7em; }
.missed-section h3 { font-size: 14px; color: var(--text-secondary); margin: 10px 0 0; }
.missed-status { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--border-color);
    color: var(--text-secondary); margin: 0 0 6px; }
.missed-status-pending { border-color: #b7950b; color: #f1c40f; }
.missed-status-declined { border-color: var(--accent-red); color: var(--accent-red-hover); }
.missed-post { text-align: left; }
.missed-post-title { font-size: 1.5em; margin: 4px 0; overflow-wrap: anywhere; }
.missed-post-body { margin: 12px 0; overflow-wrap: anywhere; }
.missed-post-body p { margin: 0 0 8px; }
.missed-form { margin-top: 14px; text-align: left; }
.missed-form textarea { width: 100%; resize: vertical; font: inherit; }
.missed-when { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.missed-done { margin-top: 14px; text-align: left; }
.missed-messages { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.missed-msg { align-self: flex-start; max-width: 85%; background: var(--bg-secondary); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.missed-msg-mine { align-self: flex-end; background: rgba(192, 57, 43, 0.35); border-radius: 14px 14px 4px 14px; }
.missed-msg-body p { margin: 0; overflow-wrap: anywhere; }
.missed-msg-ago { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.missed-send textarea { width: 100%; resize: vertical; font: inherit; }
.missed-thread { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; width: 100%; text-align: left; padding: 10px 12px; margin: 0 0 6px;
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-primary); cursor: pointer; font: inherit; }
.missed-thread.on { border-color: var(--accent-red); }
.missed-thread-unread strong { color: var(--accent-red-hover); }
.missed-thread-last { flex-basis: 100%; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.missed-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-red-hover); }
.missed-admin { margin-top: 14px; text-align: left; border-color: #b7950b; }
.missed-gate { margin-top: 14px; text-align: center; }

/* a missed connection's photos: a thumbnail on its card (top right), the gallery on its page, the form's tiles */
.missed-card.has-thumb { position: relative; padding-right: 96px; min-height: 96px; }
.missed-card-thumb { position: absolute; top: 12px; right: 12px; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg-card); }
.missed-gallery { margin: 12px 0; }
.missed-edit-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.missed-edit-photo { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; background: var(--bg-secondary); }
.missed-edit-photo img { width: 100%; height: 100%; object-fit: cover; }
.missed-edit-photo.uploading { display: grid; place-items: center; font-size: 12px; color: var(--text-secondary); }
.missed-edit-photo button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none;
    background: rgba(0, 0, 0, 0.65); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }

.missed-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.missed-confirm .input { width: 9em; letter-spacing: 3px; }
.missed-confirm .modal-error { flex-basis: 100%; }
.missed-signup { margin-top: 14px; text-align: left; border: 1px solid var(--accent-red); background: linear-gradient(160deg, rgba(192, 57, 43, 0.14), var(--bg-card) 70%); }
.missed-signup h2 { margin-bottom: 6px; }
.missed-signup p { margin-bottom: 12px; }

/* The Connections pages' shared logo header (templates/_connections_nav.html), sitting just above the pills */
.connections-brand-name { font-size: 28px; font-weight: 700; margin: 0; background: linear-gradient(135deg, var(--accent-red), #e67e22);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.connections-brand, .home-page > .logo-area { margin-bottom: 14px; }
.connections-page-title { font-size: 22px; margin: 4px 0 4px; }
.connections-page-sub { margin: 0 0 14px; }

/* Signed out: Sign In / Sign Up above the Connections pills (templates/_connections_nav.html signin_bar) */
.connections-signin { display: flex; gap: 8px; max-width: 420px; margin: 0 auto 12px; }
.connections-signin .btn { flex: 1; padding: 11px 12px; }

/* 📍 Places (templates/place*.html) and their markers on the directory's map */
.events-places-toggle { margin-top: 52px; }
.place-checkin-title { margin: 0; font-size: 18px; }
.place-checkin-title small { color: var(--text-secondary); font-weight: 400; font-size: 0.8em; }
.map-place-marker { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
#place-admin .toggle-label { display: flex; margin: 8px 0 0; }

/* a place's details: phone, hours (today in bold, open now or not), links as buttons; the editor's hours rows */
.place-phone { margin: 8px 0; }
.place-hours { margin: 12px 0; }
.place-hours h2 { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.place-open { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border-color); color: var(--text-secondary); }
.place-open.is-open { color: #5fd68f; border-color: rgba(39, 174, 96, 0.6); background: rgba(39, 174, 96, 0.12); }
.place-hours table { border-collapse: collapse; font-size: 14px; }
.place-hours th { text-align: left; font-weight: 400; color: var(--text-secondary); padding: 2px 16px 2px 0; }
.place-hours td { padding: 2px 0; }
.place-hours tr.today th, .place-hours tr.today td { color: var(--text-primary); font-weight: 700; }
.place-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.place-hours-edit { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.place-hours-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 6px;
    padding: 8px; border: 1px solid var(--border-color); border-radius: var(--radius); }
.place-hours-row select { grid-column: 1 / 4; }
.place-hours-row [data-hrm] { grid-column: 4; grid-row: 1; }
.place-hours-row input[type=time] { grid-row: 2; }
.place-hours-row > span { grid-row: 2; }
#place-form input[type=tel], #place-form input[type=time], #place-form .event-link-row input, #place-form .place-hours-row select {
    letter-spacing: normal; text-align: left; font-size: 16px; }

.loc-place-pick { margin: 6px 0 8px; width: 100%; }
#place-form .place-hours-row input[type=time] { padding: 10px 6px; font-size: 15px; min-width: 0; }

/* The directory map's 👥 People / 📍 Places checkboxes */
.map-layers { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.map-layers label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-color);
    border-radius: 999px; background: var(--bg-secondary); cursor: pointer; font-weight: 600; font-size: 14px; }
.map-layers label:has(input:checked) { border-color: var(--accent-red); background: rgba(192, 57, 43, 0.15); }
.map-layers input { accent-color: var(--accent-red); width: 16px; height: 16px; margin: 0; }

/* "Tap to reveal" over a blurred profile photo or video (templates/profile_view.html renderSlideMedia) */
.reveal-hint { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
    padding: 10px 18px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    color: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
.gallery-image.blurred + .reveal-hint { display: block; }

/* ☰ › Log Out: pick which accounts (templates/base.html #logout-modal) */
.logout-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; text-align: left; }
.logout-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius);
    background: var(--bg-secondary); cursor: pointer; }
.logout-row:has(input:checked) { border-color: var(--accent-red); }
.logout-row input { width: 18px; height: 18px; accent-color: var(--accent-red); flex: none; }

/* Admin > 💵 Expenses (static/js/expenses_admin.js) */
@media (max-width: 480px) { .admin-tab { padding: 9px 4px; font-size: 0.82rem; } }
.expenses { max-width: 720px; margin: 0 auto; }
.expenses-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.expenses-toolbar .input { flex: 1 1 140px; width: auto; margin: 0; }
.expenses-totals { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.92rem; }
.expenses-totals th, .expenses-totals td { padding: 6px 4px; border-bottom: 1px solid var(--border-color); text-align: right; }
.expenses-totals th:first-child, .expenses-totals td:first-child { text-align: left; }
.expenses-totals th { color: var(--text-secondary); font-weight: 600; }
.expenses-total { margin: 10px 0 0; text-align: right; }
.expenses-form-row { display: flex; flex-wrap: wrap; gap: 0 12px; }
.expenses-form-row .form-group { flex: 1 1 140px; }
.expense { position: relative; }
.expense-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.expense-date { color: var(--text-secondary); font-size: 0.88rem; display: flex; flex-direction: column; }
.expense-entered { font-size: 0.75rem; opacity: 0.85; }
.expense-amount { font-size: 1.15rem; }
.expense-amount-box { display: flex; flex-direction: column; align-items: flex-end; }
.expense-tax { color: var(--text-secondary); font-size: 0.78rem; }
.expense-top { display: flex; gap: 12px; align-items: flex-start; }
.expense-top-main { flex: 1 1 auto; min-width: 0; }
.expense-hero { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; display: block;
    background: var(--bg-tertiary, var(--bg-secondary)); border: 1px solid var(--border-color); }
.expense-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.expenses-search { margin: 10px 0 0; width: 100%; text-align: left; letter-spacing: normal; font-family: inherit; font-size: 1rem; }
.expenses-tagfilter { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.9rem; }
.expense-ptags, .expense-tags-edit { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.expense-ptag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-color); background: var(--bg-secondary);
    color: var(--text-primary); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.tap-window { text-align: left; max-width: 520px; width: calc(100% - 32px); max-height: 90vh; overflow-y: auto; }
.tap-window-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--text-secondary); font-size: 1.2rem; cursor: pointer; }
.tap-window h3 { margin: 0 0 6px; font-size: 1rem; }
.tap-window-section { padding: 12px 0; border-top: 1px solid var(--border-color); }
.tap-window .input { text-align: left; letter-spacing: normal; font-family: inherit; font-size: 1rem; margin: 0; }
.tw-charge { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tw-charge .expense-ptag { font-size: 0.95rem; padding: 6px 14px; }
.tw-charge .tw-other { width: 110px; padding: 6px 10px; }
.tw-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tw-row label { flex: 1 1 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.8rem; color: var(--text-secondary); }
.tw-note { width: 100%; margin-bottom: 6px !important; }
.tap-window-totals { font-weight: 600; margin: 0 0 6px; }
.tap-window-history { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.tap-window-history li { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.gear-admin-panel { text-align: left; }
.tw-delete-section { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.setup-admin-hint { text-align: center; margin: -4px 0 12px; }
.new-users-heading { margin: 16px 0 6px; font-size: 1rem; }
.new-user-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border-color); text-align: left; }
.new-user-name { display: flex; flex-direction: column; min-width: 0; }
.new-user-acts { display: flex; gap: 4px; }
.new-user-gear { margin: 6px 0; }
.gear-admin-panel h2 { margin-top: 0; }
.tw-ways { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tw-ways .expense-ptag { font-size: 0.95rem; padding: 6px 14px; }
.tw-pay { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 6px 0; }
.tw-qr { border-radius: 10px; background: #fff; max-width: 100%; height: auto; }
.tw-pay-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-mail { display: flex; flex-direction: column; gap: 6px; }
.tw-mail .tw-row { margin: 0; }
.tw-mail .tw-state { flex: 0 0 56px !important; }
.tw-mail .tw-zip { flex: 0 0 90px !important; }
.tw-item { width: 100%; margin-bottom: 8px !important; }
.admin-gear-link { border-style: dashed; }
.expense-quicktags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 8px; padding: 8px; border: 1px dashed var(--border-color); border-radius: 10px; }
.expense-quicktags .expense-quicktag-new { flex: 1 1 120px; width: auto; margin: 0; padding: 4px 10px; font-size: 0.85rem; text-align: left; letter-spacing: normal; font-family: inherit; }
.expense-ptag.on { background: var(--accent-red, #c0392b); border-color: transparent; color: #fff; }
.expense-ptag.on button { color: #fff; }
.expense-ptag-add { background: transparent; color: var(--text-secondary); border-style: dashed; }
.expense-ptag button { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 0 0 0 2px; font: inherit; }
.expense-title { font-weight: 700; font-size: 1.05rem; margin-top: 2px; overflow-wrap: anywhere; }
.expense-where { color: var(--text-secondary); font-size: 0.9rem; }
.expense-desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.expense-meta { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 6px; }
.expense-source { color: var(--text-primary); }
.expense .expense-edit { margin-top: 8px; }
.expenses-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.expense-file { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.expense-file a { position: relative; display: block; width: 76px; height: 76px; border-radius: 8px; overflow: hidden;
    background: var(--bg-tertiary, var(--bg-secondary)); border: 1px solid var(--border-color); color: inherit; text-decoration: none; }
.expense-file img { width: 100%; height: 100%; object-fit: cover; display: block; }
.expense-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; font-size: 1.6rem; padding: 4px; }
.expense-pdf small { font-size: 0.6rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-qty { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 4px; }
.expense-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 6px; font-size: 0.88rem; }
.expense-links a { overflow-wrap: anywhere; }
.expense-file-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 90px; margin-top: 3px; }
.expense-tag { font-size: 0.68rem; padding: 1px 6px; border-radius: 999px; background: var(--bg-secondary); color: var(--text-secondary); }
.expense-tag-invoice { background: var(--accent-red, #c0392b); color: #fff; }
.expenses-form-row-3 .form-group { flex: 1 1 90px; }
.expense-unit-calc { margin-top: 4px; font-size: 0.78rem; padding: 3px 8px; }
.expense-unit-calc.on { background: var(--accent-red, #c0392b); color: #fff; border-color: transparent; }
.expenses-calc-hint { margin: -6px 0 12px; font-size: 0.82rem; }
.expenses-pending { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.expense-att { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid var(--border-color); border-radius: 10px; }
.expense-att-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; display: block;
    background: var(--bg-tertiary, var(--bg-secondary)); color: inherit; text-decoration: none; }
.expense-att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.expense-att-thumb .expense-pdf { font-size: 1.3rem; }
.expense-att-body { flex: 1 1 auto; min-width: 0; }
.expense-att-name { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.expense-att .expense-file-del { margin-top: 0; flex: 0 0 auto; }
.expense-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.expense-chip { border: 1px solid var(--border-color); background: transparent; color: var(--text-secondary); border-radius: 999px;
    padding: 3px 9px; font: inherit; font-size: 0.78rem; cursor: pointer; }
.expense-chip.on { background: var(--accent-red, #c0392b); border-color: transparent; color: #fff; }
.expense-inv { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.expense-inv-row { display: flex; gap: 6px; align-items: center; }
.expense-inv-row .input { margin: 0; min-width: 0; }
.expense-inv-row .inv-part { flex: 2 1 0; }
.expense-inv-row .inv-qty, .expense-inv-row .inv-cost { flex: 1 1 0; }
.expense-inv-row { flex-wrap: wrap; }
.expense-inv-row .inv-loc { flex: 1 1 100%; }
.expense-links-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.expense-link-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-bottom: 8px; border-bottom: 1px dashed var(--border-color); }
.expense-link-row .input { margin: 0; min-width: 0; }
.expense-link-row .link-label { flex: 1 1 100%; }
.expense-link-row .link-url { flex: 1 1 0; }
.expense-fund-group { flex: 3 1 180px !important; }
.expense-card-group { flex: 1 1 90px !important; }
.expense-ai { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); font-size: 0.9rem; }
.expense-ai.busy { animation: expense-ai-pulse 1.6s ease-in-out infinite; }
@keyframes expense-ai-pulse { 50% { opacity: 0.55; } }
.expense-ai p { margin: 0 0 6px; }
.expense-ai ul { margin: 0 0 8px; padding-left: 18px; }
.expense-ai li { margin: 3px 0; }
.expense-ai-read { margin-top: 6px; }
.expense-inv-list { display: flex; flex-direction: column; font-size: 0.88rem; margin: 2px 0 6px; }

/* Admin > 📦 Inventory (static/js/inventory_admin.js) */
.inventory .input { text-align: left; letter-spacing: normal; font-family: inherit; font-size: 1rem; }
.inv-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.inv-totals div { display: flex; flex-direction: column; padding: 10px; border-radius: 10px; background: var(--bg-secondary); }
.inv-totals span { font-size: 0.8rem; color: var(--text-secondary); }
.inv-totals strong { font-size: 1.15rem; }
.inv-notice { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inv-notice p { margin: 0; flex: 1 1 100%; font-size: 0.9rem; }
.inv-inline { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.inv-inline .input { flex: 1 1 110px; width: auto; margin: 0; }
.inv-part { border: 1px solid var(--border-color); border-radius: 10px; margin-top: 8px; overflow: hidden; }
.inv-part-head { display: flex; width: 100%; gap: 10px; align-items: baseline; padding: 10px 12px; border: 0; background: transparent;
    color: inherit; font: inherit; text-align: left; cursor: pointer; }
.inv-part-name { flex: 1 1 auto; font-weight: 600; }
.inv-part-weight { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-secondary); }
.inv-inline .inv-weight { flex: 1 1 90px; }
.inv-inline .inv-unit { flex: 0 0 64px; }
.inv-lot-acts { white-space: nowrap; }
.inv-lot-acts .expense-file-del { padding: 2px 6px; }
.inv-count-hint { flex: 1 1 100%; margin: 0; }
.inv-lot-edit td { background: var(--bg-secondary); }
.inv-price-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 6px; font-size: 0.9rem; }
.inv-margin { color: var(--text-secondary); }
.inv-inline .inv-price { flex: 0 1 90px; }
.inv-price-label { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--text-secondary); gap: 2px; flex: 0 1 100px; }
.inv-price-label .inv-price, .inv-price-label .input { width: 100%; flex: none; }
.inv-location { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.inv-location-name { font-weight: 600; flex: 1 1 auto; }
.inv-location-acts { display: flex; gap: 2px; }
.inv-location .inv-loc-rename { flex: 1 1 100%; margin: 4px 0 0; }
.inv-at { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.inv-at .expense-tag { font-size: 0.8rem; padding: 2px 8px; }
.inv-inline .inv-exp-select { flex: 1 1 100%; }
.inv-inline .inv-loc-select { flex: 0 1 140px; }
.inv-moves { margin: 0; padding-left: 18px; font-size: 0.84rem; }
.tw-loc { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.tw-loc .input { flex: 1 1 auto; }
.sales .tags-toolbar { flex-wrap: wrap; }
.tw-qr, .tap-venmo-qr { cursor: zoom-in; }
.qr-fullscreen { position: fixed; inset: 0; z-index: 10000; background: #fff; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px); cursor: zoom-out; }
.qr-fullscreen img { width: min(92vw, 80vh); height: auto; max-height: 85vh; object-fit: contain; image-rendering: pixelated; }
.qr-fullscreen p { margin: 0; color: #555; font-size: 0.9rem; }
.coupon-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.coupon-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.coupon-form-row label { flex: 1 1 160px; }
.coupon-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.coupon-form .coupon-once { justify-content: flex-end; }
.coupon-form .coupon-once span { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.coupon-list { display: flex; flex-direction: column; gap: 10px; }
.coupon-row { border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: var(--radius, 10px); padding: 10px 12px; }
.coupon-row.coupon-off, .coupon-row.coupon-ended { opacity: .7; }
.coupon-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.coupon-code { font-family: ui-monospace, monospace; letter-spacing: 1px; }
.coupon-acts { flex-wrap: wrap; margin-top: 6px; }
.coupon-orders { overflow-x: auto; margin-top: 8px; }
.coupon-cancelled { text-decoration: line-through; opacity: .6; }
.tap-coupon-row { display: flex; gap: 8px; margin: 8px 0; }
.tap-coupon-row .input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; }
.tap-coupon-applied { font-weight: 600; margin: 8px 0; }
.inv-sales-totals { margin-bottom: 10px; }
.inv-sale-profile { padding: 2px 8px; margin-left: 4px; vertical-align: middle; }
.venmo-qr-box { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.venmo-qr-preview { width: 150px; height: auto; border-radius: 10px; background: #fff; }
.venmo-qr-box > div { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.venmo-qr-upload { cursor: pointer; }
.sales .tags-toolbar select { flex: 1 1 160px; min-width: 0; width: auto; }   /* 💰 Sales: the Tap Orders filter fits a phone */
.inv-ready { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 6px; font-size: 0.9rem; }
.inv-ready .expense-tag { font-size: 0.8rem; padding: 2px 8px; }
.inv-builds { margin-top: 6px; font-size: 0.84rem; }
.inv-builds ul { margin: 4px 0 0; padding-left: 18px; }
.inv-builds li { margin: 3px 0; }
.inv-recipe-weight { margin: 4px 0 0; }
.inv-part-count { color: var(--text-secondary); font-size: 0.9rem; white-space: nowrap; }
.inv-part-count.low { color: var(--accent-red, #c0392b); font-weight: 600; }
.inv-part-value { font-size: 0.9rem; white-space: nowrap; }
.inv-part-body { display: none; padding: 0 12px 12px; }
.inv-part.open .inv-part-body { display: block; }
.inv-part-body h4 { margin: 12px 0 4px; font-size: 0.92rem; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.inv-table th, .inv-table td { padding: 5px 4px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: top; }
.inv-table th { color: var(--text-secondary); font-weight: 600; }
.inv-table .inv-from { overflow-wrap: anywhere; }
.inv-table .expense-file-del { margin: 0; }
.inv-short td { background: rgba(192, 57, 43, 0.1); }
.inv-recipe { padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.inv-recipe:last-child { border-bottom: 0; }
.inv-recipe-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.inv-recipe-parts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.inv-recipe-parts .expense-tag { font-size: 0.8rem; padding: 2px 8px; }
.inv-recipe-form { margin-top: 8px; }
.inv-recipe-rows { display: flex; flex-direction: column; gap: 6px; }
.inv-sales-table td:not(:first-child), .inv-sales-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.expenses-form .expense-chip-new { width: 76px; padding: 3px 8px; border: 1px dashed var(--border-color); border-radius: 999px;
    background: transparent; color: var(--text-primary); font: inherit; font-size: 0.78rem; }
.expense-file-del { margin-top: 3px; border: 0; border-radius: 6px; padding: 2px 8px; background: var(--bg-secondary); color: var(--text-secondary); font: inherit; font-size: 0.78rem; cursor: pointer; }
.expense-file-del.armed { background: var(--accent-red); color: #fff; }
.expenses-form .input, .expenses-toolbar .input { text-align: left; letter-spacing: normal; font-family: inherit; font-size: 1rem; }
.expenses-form .hint { color: var(--text-secondary); }

/* The directory grid's 🆕 Newest / 📍 Nearest pills, and each tile's distance (templates/directory.html) */
.directory-sort { margin: 4px auto 10px; max-width: 320px; }
/* 🟢 Online / ⭐ Buds: show-only toggles under the sort pills */
.directory-filters { display: flex; justify-content: center; gap: 8px; margin: 0 auto 12px; }
.directory-filter { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-color); background: transparent;
    color: var(--text-secondary); font-weight: 600; font-size: 13px; cursor: pointer; }
.directory-filter.on { background: var(--accent-red, #c0392b); border-color: transparent; color: #fff; }
.directory-filter-empty { text-align: center; }
.directory-tile-dist { position: absolute; bottom: 30px; right: 6px; z-index: 1; font-size: 11px; font-weight: 600; padding: 2px 7px;
    border-radius: 999px; background: rgba(0, 0, 0, 0.65); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
