/* =====================================================================
   CIVIC THEME  —  Step 10: phone fixes (2026-11-22 device sweep)
   ---------------------------------------------------------------------
   Checked at 320–430px (iPhone SE … Pro Max, Galaxy, Pixel, Fold) and
   768px (iPad mini). Remove the <link> to revert.
   ===================================================================== */

/* Logged-out header: the location pin carried tappet.css's `margin: 1em`
   and its SVG's own size, which pushed it down onto the search pill on
   phones (where .nav-right is pinned to the top-right corner). Size and pad
   it like the signed-in profile icon (.nav-profile, step 2). */
.fixed-bar .location-icon {
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 7px;
    box-sizing: content-box;
    border-radius: 9px;
    transition: background .15s ease;
}
.fixed-bar .location-icon:hover { background: #f2f3f6; }
.fixed-bar .nav-right .fr {
    margin: 0;
    padding: 7px 4px 7px 6px;
    float: none;
}

/* Content starts just under the fixed header, whatever its height. The old
   fixed 120px / 170px assumed the signed-in tab row, leaving a big empty
   band for logged-out visitors. --bar-h is measured by tappet.js
   (trackBarHeight); the fallbacks cover the moment before it runs. */
.content {
    padding-top: calc(var(--bar-h, 120px) + 16px);
}

/* /ads/: grid items default to min-width:auto, so the file input's built-in
   minimum width stretched the form column past the card on 320–344px
   phones. */
.ad-form-grid > *,
.ad-dates > * { min-width: 0; }
.ad-form input[type="file"],
.ad-form input[type="date"] { max-width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 420px) {
    .ad-dates { grid-template-columns: 1fr; }  /* start / end dates stacked */
}

/* Floating footer button (step 9): a touch smaller and tighter to the
   corner on phones, so it covers less of the card it floats over. */
@media (max-width: 480px) {
    .fab-footer {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
    }
    .fab-footer-btn { width: 34px; height: 34px; }
    .fab-footer-btn svg { width: 18px; height: 18px; }
}

/* iOS Safari zooms the whole page when a field under 16px gets focus, and
   doesn't zoom back. Composer, Contact us, Sponsor, signup, profile edit and
   /ads/ fields were 13.6–15.2px. 16px on touch-size screens only.
   !important because signup.html and profile_page.html carry their own
   later <style> blocks (see AGENTS.md "Styling"). */
@media (max-width: 900px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]):not([type="range"]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Contact us / Sponsor on short screens (iPhone SE: 568px tall): the card
   scrolls inside itself (step 6 caps it at 89%), which hid Send below the
   fold with no hint. Keep the button row pinned to the card's bottom. */
@media (max-height: 760px) {
    .footer-modal .action-btns {
        position: sticky;
        bottom: 0;
        z-index: 1;
        background: #fff;
        box-shadow: 0 -8px 12px -10px rgba(30, 40, 60, .25);
    }
}

/* Profile activity list: an event row carries five action icons, which left
   the title a ~70px column on 320px phones. Below 420px the title takes the
   full width and the icons wrap onto their own line beneath it. */
@media (max-width: 420px) {
    .act-row { flex-wrap: wrap; row-gap: 8px; }
    .act-row-main { flex: 1 0 100%; }
}
