/* ===========================================================================
   Components.

   Written mobile-first: the base rules describe the phone layout, and media
   queries add complexity for wider screens. The other direction — desktop
   first, then overriding it back down — means every mobile rule fights a
   desktop rule, and phones (the majority of this audience) pay for CSS they
   will never use.

   Your two prototypes are the same page at two widths, so they are one
   stylesheet here, not two.
   =========================================================================== */

/* ---- Utilities --------------------------------------------------------- */

/*
 * The hidden attribute, made to actually hide things.
 *
 * Browsers style [hidden] as display: none in the USER-AGENT stylesheet, which
 * loses to any author rule that sets display — including the innocuous
 * `.check { display: flex }` a few hundred lines below. The result is markup
 * that says hidden, JavaScript that sets hidden, dev tools that report hidden,
 * and an element sitting there in plain view.
 *
 * That is exactly what broke the area filter's search box: it correctly hid
 * eighty-three of eighty-four labels and not one of them went away.
 *
 * !important is the right tool here and one of the few places it is. The
 * attribute is not a style suggestion, it is a statement that the element is
 * not currently relevant — there is no case where something else should win.
 */
[hidden] {
    display: none !important;
}

.page-width {
    max-width: var(--page-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: var(--s-2);
    background: var(--c-brand);
    color: var(--c-brand-ink);
    padding: var(--s-2) var(--s-4);
    border-radius: var(--r-sm);
    z-index: 100;
}
.skip-link:focus { left: var(--s-4); }

/* ---- Buttons ----------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-5);
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--t-base);
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--c-brand); color: var(--c-brand-ink); }
.btn--primary:hover { background: var(--c-brand-hover); color: var(--c-brand-ink); }

.btn--secondary {
    background: var(--c-surface);
    color: var(--c-ink);
    border-color: var(--c-line);
}
.btn--secondary:hover { border-color: var(--c-line-strong); color: var(--c-ink); }

.btn--ghost { background: transparent; color: var(--c-ink-2); }
.btn--ghost:hover { color: var(--c-brand); }

/* ---- Header ------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 250, 248, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--c-line);
}

.site-header__inner {
    max-width: var(--page-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--s-6);
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--t-md);
    color: var(--c-brand);
    letter-spacing: -0.01em;
}
.wordmark:hover { text-decoration: none; color: var(--c-brand-hover); }

/* Hidden on phones; the prototype uses a bottom tab bar there, which arrives
   with the search screens. */
.site-nav { display: none; gap: var(--s-6); }
.site-nav a { color: var(--c-ink-2); font-size: var(--t-sm); }
.site-nav a:hover { color: var(--c-brand); text-decoration: none; }

/*
 * The right-hand side of the header.
 *
 * This was `margin-left: auto` on a plain block, so its children were inline
 * content that WRAPPED when the row ran out of width. On a phone that meant
 * three stacked rows — a 146px block inside a 64px header — spilling the
 * signed-in name out of the header and over whatever was below it. The bug
 * predates the badges (measured: the block is exactly as tall with them
 * removed); it was simply less obvious when the thing underneath was hero
 * whitespace rather than a notice.
 *
 * A flex row that refuses to wrap is the fix. What has to give instead is
 * stated explicitly below, rather than left to whatever happens to overflow.
 */
.site-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--s-1);
    flex-wrap: nowrap;
    min-width: 0;
}

/* The buttons keep their size; the NAME is the one allowed to shrink, because
   a truncated name is still recognisable and a truncated badge is a lie. */
.site-header__actions > .btn { flex: none; }

.site-header__actions > .btn:last-child {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
}

/* Tight buttons on a phone, where every pixel of the row is contested. */
@media (max-width: 767px) {
    .site-header__actions > .btn { padding-inline: var(--s-3); }
}

/* The word "Wishlist" hides on phones; the heart and its count carry the
   meaning on their own. "Requests" keeps its word because it has no icon to
   fall back on, and a bare number would say nothing. */
.site-header__label { display: none; }

@media (min-width: 768px) {
    .site-header__actions { gap: var(--s-2); }
    .site-header__label { display: inline; }
}

/* ---- Hero -------------------------------------------------------------- */

.hero {
    padding-block: var(--s-12) var(--s-10);
    text-align: center;
}

.hero__title {
    font-size: var(--t-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--s-4);
}
.hero__title span { display: block; color: var(--c-brand); }

.hero__sub {
    color: var(--c-ink-3);
    font-size: var(--t-sm);
    margin: 0 0 var(--s-8);
}

.hero__actions {
    display: grid;
    gap: var(--s-3);
    max-width: 360px;
    margin-inline: auto;
}

.hero__action-note {
    display: block;
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin-top: var(--s-1);
}

/* ---- Stats ------------------------------------------------------------- */

.stats {
    display: grid;
    /* Column count tracks the number of .stat children in the template. An
       empty leftover track shoves the figures off to one side, so keep the
       two in step whenever a stat is added or dropped. */
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-2);
    padding: var(--s-6) 0;
    border-block: 1px solid var(--c-line);
}

.stat { text-align: center; }

.stat__value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--t-xl);
    font-weight: 600;
    color: var(--c-ink);
    line-height: 1.1;
}

.stat__label {
    display: block;
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin-top: var(--s-1);
}

/* ---- Sections ---------------------------------------------------------- */

.section { padding-block: var(--s-12); }

.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}

.section__title { font-size: var(--t-lg); font-weight: 600; }

.section__link { font-size: var(--t-sm); white-space: nowrap; }

/* ---- Listing cards ----------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-4);
}

.listing-card {
    /* position: relative is what makes the stretched .listing-card__link::after
       resolve against the card rather than against the page. Without it the
       "link" covers the whole viewport and a click anywhere opens the last
       card that happened to render. */
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    /* No padding here any more — .listing-card__body owns it, so the cover
       photo can be full-bleed by simply being a block child instead of by
       negative margins that had to match a spacing token exactly. */
    padding: 0;
    /* Clips the photo's square corners to the card's rounded ones, so the
       image needs no border-radius of its own to keep in sync. */
    overflow: hidden;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.listing-card__body {
    padding: var(--s-5);
    /* Fills the leftover height so cards in a row end level even when one has
       an extra tag line. */
    flex: 1 1 auto;
}

/* The stretched link: the anchor is a normal inline element in the flow, and
   this pseudo-element is what is actually clickable across the whole card.
   z-index 1 keeps it under the heart, which sits at 2. */
.listing-card__link { color: inherit; text-decoration: none; }
.listing-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.listing-card__link:focus-visible::after {
    outline: 2px solid var(--c-brand);
    outline-offset: -3px;
    border-radius: var(--r-lg);
}
.listing-card:hover {
    text-decoration: none;
    color: inherit;
    border-color: var(--c-line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.listing-card__badge {
    display: inline-block;
    background: var(--c-brand-tint);
    color: var(--c-brand);
    border: 1px solid var(--c-brand-tint-hard);
    font-size: var(--t-xs);
    font-weight: 600;
    padding: 2px var(--s-2);
    border-radius: var(--r-pill);
    margin-bottom: var(--s-3);
}

.listing-card__rent {
    font-family: var(--font-display);
    font-size: var(--t-xl);
    font-weight: 600;
    color: var(--c-ink);
    line-height: 1.1;
}

.listing-card__rent small {
    font-family: var(--font-body);
    font-size: var(--t-xs);
    font-weight: 400;
    color: var(--c-ink-3);
}

.listing-card__total {
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin: var(--s-1) 0 var(--s-4);
}

.listing-card__where {
    font-family: var(--font-display);
    font-size: var(--t-base);
    font-weight: 500;
    color: var(--c-ink);
}

.listing-card__station {
    font-size: var(--t-sm);
    color: var(--c-ink-2);
    margin-top: 2px;
}

.listing-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-4);
    padding-top: var(--s-4);
    border-top: 1px solid var(--c-line);
}

.tag {
    font-size: var(--t-xs);
    color: var(--c-ink-2);
    background: var(--c-surface-2);
    border-radius: var(--r-pill);
    padding: 2px var(--s-3);
}

.listing-card__available {
    display: block;
    font-size: var(--t-xs);
    color: var(--c-gold-ink);
    background: var(--c-gold);
    border-radius: var(--r-pill);
    padding: 2px var(--s-3);
}

/* ---- Steps ------------------------------------------------------------- */

.steps { display: grid; gap: var(--s-6); counter-reset: step; }

.step { display: flex; gap: var(--s-4); align-items: flex-start; }

.step__num {
    counter-increment: step;
    flex: 0 0 auto;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    background: var(--c-brand);
    color: var(--c-brand-ink);
    font-family: var(--font-display);
    font-size: var(--t-sm);
    font-weight: 600;
}
.step__num::before { content: counter(step); }

.step__title {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--c-ink);
    font-size: var(--t-base);
}

.step__body { font-size: var(--t-sm); margin: 2px 0 0; }

/* ---- Trust ------------------------------------------------------------- */

.trust {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-xl);
    padding: var(--s-8) var(--s-5);
}

.trust__list { display: grid; gap: var(--s-5); margin-top: var(--s-6); }

.trust__item-title {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--c-ink);
    font-size: var(--t-sm);
}

.trust__item-body { font-size: var(--t-sm); margin: 2px 0 0; }

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
    border-top: 1px solid var(--c-line);
    margin-top: var(--s-16);
    padding-block: var(--s-8);
}

.site-footer__inner {
    max-width: var(--page-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
    text-align: center;
}

.site-footer__note { font-size: var(--t-xs); color: var(--c-ink-3); margin: 0; }

.site-footer__safety {
    font-size: var(--t-xs);
    color: var(--c-gold-ink);
    margin: var(--s-2) 0 0;
}

/* ===========================================================================
   Wider screens.

   768px is where a phone stops and a tablet starts. Everything above adds
   capability rather than undoing the mobile layout.
   =========================================================================== */

@media (min-width: 768px) {
    :root { --gutter: 32px; }

    .site-nav { display: flex; }

    .hero { padding-block: var(--s-20) var(--s-16); }
    .hero__title { font-size: var(--t-4xl); }
    .hero__sub { font-size: var(--t-base); }

    .hero__actions {
        display: flex;
        justify-content: center;
        gap: var(--s-4);
        max-width: none;
    }

    .stats { gap: var(--s-8); padding: var(--s-8) 0; }
    .stat__value { font-size: var(--t-2xl); }
    .stat__label { font-size: var(--t-sm); }

    .section { padding-block: var(--s-16); }
    .section__title { font-size: var(--t-xl); }

    .card-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-5); }

    .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-8); }

    .trust { padding: var(--s-12) var(--s-10); }
    .trust__list { grid-template-columns: repeat(2, 1fr); gap: var(--s-8); }
}

@media (min-width: 1024px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
    /* Three items, three columns. A fourth track squeezes the copy into the
       left three quarters and wraps it early. */
    .trust__list { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Auth screens ------------------------------------------------------ */

.auth {
    display: grid;
    place-items: start center;
    padding-block: var(--s-10) var(--s-16);
}

.auth__card {
    width: 100%;
    max-width: 420px;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-xl);
    padding: var(--s-8) var(--s-6);
}

.auth__title { font-size: var(--t-xl); margin-bottom: var(--s-2); }

.auth__sub { font-size: var(--t-sm); color: var(--c-ink-3); margin: 0 0 var(--s-6); }

.auth__error {
    background: var(--c-brand-tint);
    border: 1px solid var(--c-brand-tint-hard);
    color: var(--c-brand);
    font-size: var(--t-sm);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    margin: 0 0 var(--s-5);
}

.auth__notice {
    background: var(--c-gold);
    color: var(--c-gold-ink);
    font-size: var(--t-sm);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    margin: 0 0 var(--s-5);
}

.auth__form { display: grid; gap: var(--s-5); }

.auth__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--s-4);
}

.auth__fine {
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin: var(--s-6) 0 0;
    text-align: center;
}

.field { display: grid; gap: var(--s-2); }

.field__label {
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--c-ink);
    font-family: var(--font-display);
}

/* Sits UNDER the input, not above it: a hint that explains what will happen to
   a value is read after typing, and placing it above pushes the field itself
   further from its label. */
.field__hint {
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    line-height: 1.5;
}

/* Every text-like input is listed explicitly rather than using a bare
   `.field input`, so a future checkbox or radio inside a .field does not
   inherit full-width padding and a border. type="email" joined the list when
   sign-in moved to email — without it the login field rendered as an unstyled
   browser default next to styled ones. */
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea,
.field select {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    background: var(--c-surface);
    /* 16px minimum: iOS Safari zooms the whole page when a focused input has
       a smaller font, which is jarring and hard to undo. */
    font-size: 16px;
}

.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--c-brand); }

/* Inherit, because a textarea does not: left alone it renders in the
   browser's monospace default beside fields using the body face. Vertical
   resize only — horizontal dragging breaks the column it sits in. */
.field textarea { font-family: inherit; resize: vertical; }

.field__phone {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--c-surface);
}

.field__phone:focus-within { border-color: var(--c-brand); }

.field__prefix {
    display: grid;
    place-items: center;
    padding-inline: var(--s-4);
    background: var(--c-surface-2);
    border-right: 1px solid var(--c-line);
    color: var(--c-ink-2);
    font-size: 16px;
}

.field__phone input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
}

.field__otp {
    text-align: center;
    font-family: var(--font-display);
    font-size: 28px !important;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-indent: 0.4em;   /* recentres text that letter-spacing pushes right */
}

.btn--block { width: 100%; }

/* ---- Search ------------------------------------------------------------ */

.search { padding-block: var(--s-8) var(--s-12); }

.search__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
    margin-bottom: var(--s-6);
}

.search__title { font-size: var(--t-lg); font-weight: 600; }
.search__range { color: var(--c-ink-3); font-weight: 400; font-size: var(--t-sm); }

.search__sort select {
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    background: var(--c-surface);
    font-size: var(--t-sm);
}

.search__layout { display: grid; gap: var(--s-6); }

/* ---- Filter panel ------------------------------------------------------ */

.filters {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    align-self: start;
}

.filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--s-4);
}

.filters__title {
    font-size: var(--t-base);
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.filters__count {
    background: var(--c-brand);
    color: var(--c-brand-ink);
    font-size: var(--t-xs);
    font-family: var(--font-body);
    min-width: 20px;
    height: 20px;
    border-radius: var(--r-pill);
    display: grid;
    place-items: center;
    padding-inline: 6px;
}

.filters__clear { font-size: var(--t-xs); }

/*
 * Tightened.
 *
 * A fieldset legend carries space of its own on top of this padding, and the
 * two stacked left every filter sitting in a gap big enough to read as
 * something having failed to render between them.
 */
.filters__group {
    border: none;
    border-top: 1px solid var(--c-line);
    margin: 0;
    padding: var(--s-3) 0 0;
}
.filters__group:first-of-type { border-top: none; padding-top: 0; }

.filters__group legend {
    font-family: var(--font-display);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-ink);
    padding: 0;
    margin-bottom: var(--s-2);
}

/* "All of Chembur" against the sublocalities beneath it: ticking it selects
   every one of them, which makes it a different kind of choice, not the
   narrowest one in a list of its own children. */
.check__whole { color: var(--c-brand); font-weight: 600; }

/* Ninety-odd areas would otherwise push every other filter off the screen. */
.filters__scroll { max-height: 220px; overflow-y: auto; padding-right: var(--s-2); }

.check {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 5px 0;
    font-size: var(--t-sm);
    cursor: pointer;
}
.check input { accent-color: var(--c-brand); flex: 0 0 auto; }
.check small { color: var(--c-ink-3); font-size: var(--t-xs); margin-left: auto; }

.filters__range { display: flex; align-items: center; gap: var(--s-2); }
.filters__range input {
    width: 100%;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    font-size: 16px;
}
.filters__dash { color: var(--c-ink-3); }

.filters__group input[type="date"] {
    width: 100%;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    font-size: 16px;
}

.filters .btn--block { margin-top: var(--s-5); }

/* ---- Result states ----------------------------------------------------- */

.notice {
    border-radius: var(--r-lg);
    padding: var(--s-5);
    margin-bottom: var(--s-5);
}
.notice--widened { background: var(--c-gold); color: var(--c-gold-ink); }
.notice--relaxed { background: var(--c-brand-tint); color: var(--c-brand); }

/*
 * "You are about to do something you cannot undo."
 *
 * The bare .notice has no background of its own — the two modifiers above
 * carry it — so a warning written without one renders as plain text and reads
 * as a caption rather than a caution. Gold is this palette's warning tone; the
 * bar gives it an edge to catch, since colour alone is not something every
 * reader distinguishes.
 */
.notice--warning {
    background: var(--c-gold);
    color: var(--c-gold-ink);
    border-left: 4px solid var(--c-gold-strong);
}

.notice__title { font-family: var(--font-display); font-weight: 600; margin: 0 0 var(--s-1); }
.notice__body { font-size: var(--t-sm); margin: 0 0 var(--s-3); }

/* ---- "People are waiting on you" --------------------------------------- */

/*
 * The strip above the hero on the landing page.
 *
 * Mobile first, as everywhere else here: it stacks by default and becomes a
 * row at the width where a row fits. The CTA moves to the end of the row on
 * desktop and sits under the text on a phone, rather than being squeezed
 * beside it.
 */
.waiting {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    flex-wrap: wrap;

    margin-top: var(--s-6);
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-lg);

    background: var(--c-brand-tint);
    border: 1px solid var(--c-brand-tint-hard);
    color: var(--c-ink);
    text-decoration: none;
}

.waiting:hover { border-color: var(--c-brand); }

/*
 * The requester's side: "somebody answered you".
 *
 * Gold rather than the brand tint, so the two strips are distinguishable at a
 * glance when a person has both — which happens to anyone leaving one flat
 * while asking about another, and that is a large share of this audience.
 */
.waiting--good {
    background: var(--c-gold);
    border-color: var(--c-gold-strong);
}
.waiting--good:hover { border-color: var(--c-gold-ink); }
.waiting--good .waiting__dot { background: var(--c-gold-ink); }
.waiting--good .waiting__body { color: var(--c-gold-ink); }
.waiting--good .waiting__cta { color: var(--c-gold-ink); }

/* Focus is drawn on the strip itself because the strip IS the link — a focus
   ring on some inner span would point at the wrong thing for a keyboard. */
.waiting:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* Deliberately not animated. A pulsing dot in the corner of every visit is
   pressure, and this is somebody's home, not a growth funnel. */
.waiting__dot {
    flex: none;
    width: 9px;
    height: 9px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--c-brand);
}

.waiting__text {
    display: grid;
    gap: 2px;
    /* Lets the text shrink so a long line wraps instead of pushing the CTA
       off the edge — a flex item will not go below its content width without
       this. */
    min-width: 0;
    flex: 1 1 260px;
}

.waiting__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--t-base);
}

.waiting__body {
    font-size: var(--t-sm);
    color: var(--c-ink-2);
}

.waiting__cta {
    flex: none;
    align-self: center;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-brand);
    white-space: nowrap;
}

.empty {
    text-align: center;
    padding: var(--s-16) var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
}
.empty__title { font-family: var(--font-display); font-size: var(--t-lg); color: var(--c-ink); margin: 0 0 var(--s-2); }
.empty__body { font-size: var(--t-sm); margin: 0 0 var(--s-5); }

.results__more { display: grid; place-items: center; margin-top: var(--s-8); }

.results__privacy {
    text-align: center;
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin-top: var(--s-8);
}

@media (min-width: 900px) {
    .search__layout { grid-template-columns: 280px 1fr; gap: var(--s-8); }
    .search__title { font-size: var(--t-xl); }

    /*
     * Filters beside results, pinned while a long list scrolls past.
     *
     * THE BUG THIS FIXES. `position: sticky` alone was not enough, and the way
     * it failed is worth understanding because it looks like the opposite of a
     * CSS problem.
     *
     * A sticky element pins when its top reaches the offset and releases when
     * its CONTAINING BLOCK runs out. Here that block is the grid row, whose
     * height is the results column — three and a half thousand pixels of
     * listings. So the panel pinned at 80px and stayed at exactly 80px for the
     * entire length of the results, then finally scrolled away at the very
     * bottom of the page. "The filters don't scroll until the listings reach
     * the end" is a precise description of correct sticky behaviour applied to
     * the wrong-sized box.
     *
     * And because the panel was 1766px tall in a 900px viewport, its lower
     * half — rent, move-in, configuration, must-have and the second Show
     * results — sat below the fold with no way to reach it. A pinned element
     * cannot be scrolled by scrolling the page; that is what pinning means.
     *
     * The fix is to stop it being taller than the space it is pinned into, and
     * give it a scrollbar of its own.
     */
    .filters {
        position: sticky;
        top: calc(var(--header-h) + var(--s-4));

        /* The header, plus an equal gap above and below the panel. */
        max-height: calc(100vh - var(--header-h) - var(--s-8));

        /* A column so the head can stay put while the rest scrolls. */
        display: flex;
        flex-direction: column;
    }

    .filters > form {
        display: flex;
        flex-direction: column;
        /* Without min-height: 0 a flex item refuses to shrink below its
           content size, so the form stays 1766px tall inside a max-height
           parent and overflows it — the scrollbar appears on nothing. This
           one declaration is the difference between the rule working and
           appearing not to. */
        min-height: 0;
    }

    /*
     * Everything below the heading scrolls; the heading, and the Show results
     * button in it, do not. That button is now always reachable however far
     * down the filters you are, which is the other half of the same problem.
     */
    .filters__body {
        overflow-y: auto;
        min-height: 0;
        /* Room for the scrollbar so it does not sit on top of the checkboxes. */
        padding-right: var(--s-2);
        margin-right: calc(var(--s-2) * -1);
    }
}

/* Area search box inside the filter panel. Hidden until the script reveals it. */
.filters__search { margin-bottom: var(--s-3); }

.filters__search input {
    width: 100%;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    font-size: 16px;
}

.filters__hint {
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin: var(--s-2) 0 0;
    min-height: 1em;   /* reserve the line so the list does not jump */
}

/* ---- Listing detail ---------------------------------------------------- */

.detail { padding-block: var(--s-6) var(--s-12); }
.detail__back { font-size: var(--t-sm); display: inline-block; margin-bottom: var(--s-5); }
.detail__layout { display: grid; gap: var(--s-8); }

.detail__badges { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.detail__posted { font-size: var(--t-xs); color: var(--c-ink-3); }
.detail__title { font-size: var(--t-xl); margin-bottom: var(--s-2); }
.detail__subtitle { font-size: var(--t-sm); color: var(--c-ink-2); margin: 0; }

/* The line that replaced the map: quieter than the subtitle above it, because
   it answers a question rather than describing the room. */
.detail__privacy {
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    margin: var(--s-2) 0 0;
}

.detail__section { padding-top: var(--s-8); margin-top: var(--s-8); border-top: 1px solid var(--c-line); }
.detail__heading { font-size: var(--t-lg); margin-bottom: var(--s-2); }
.detail__lede { font-size: var(--t-sm); color: var(--c-ink-3); margin: 0 0 var(--s-5); }
.detail__attribution { font-size: var(--t-xs); color: var(--c-ink-3); margin-top: var(--s-4); }
.detail__report { margin-top: var(--s-10); font-size: var(--t-xs); text-align: center; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-4);
    margin-top: var(--s-6);
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
}
.stat-grid__label { display: block; font-size: var(--t-xs); color: var(--c-ink-3); }
.stat-grid__value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    color: var(--c-ink);
    margin-top: 2px;
}
.stat-grid__note { display: block; font-size: var(--t-xs); color: var(--c-ink-3); }

.terms { margin: 0; }
.terms__row {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--c-line);
}
.terms__row:last-child { border-bottom: none; }
.terms__label { font-size: var(--t-sm); color: var(--c-ink); font-weight: 500; margin: 0; }
.terms__label small { display: block; font-weight: 400; color: var(--c-ink-3); font-size: var(--t-xs); }
.terms__value {
    font-family: var(--font-display);
    font-size: var(--t-sm);
    color: var(--c-ink);
    margin: 0;
    text-align: right;
}

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.chip {
    font-size: var(--t-xs);
    background: var(--c-surface-2);
    color: var(--c-ink-2);
    padding: 4px var(--s-3);
    border-radius: var(--r-pill);
}
.chip--perk { background: var(--c-gold); color: var(--c-gold-ink); }

/* .detail__map is gone with the approximate-location map. Removed rather than
   kept "just in case": dead CSS is how a stylesheet reaches 83KB, and the
   markup it styled is in version control if the map ever returns. */

.cost-card, .leaver-card, .safety-card {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    margin-bottom: var(--s-4);
}

.cost-card__rent { font-family: var(--font-display); font-size: var(--t-xl); font-weight: 600; color: var(--c-ink); }
.cost-card__rent small { font-family: var(--font-body); font-size: var(--t-xs); font-weight: 400; color: var(--c-ink-3); }
.cost-card__heading { font-size: var(--t-sm); margin: var(--s-5) 0 var(--s-3); }
.cost-card__lines { margin: 0 0 var(--s-5); }
.cost-card__note { font-size: var(--t-xs); color: var(--c-ink-3); text-align: center; margin: var(--s-3) 0 0; }

.cost-line { display: flex; justify-content: space-between; padding: var(--s-2) 0; font-size: var(--t-sm); }
.cost-line dt, .cost-line dd { margin: 0; }
.cost-line dd { font-family: var(--font-display); color: var(--c-ink); }
.cost-line--total { border-top: 1px solid var(--c-line); margin-top: var(--s-2); padding-top: var(--s-3); font-weight: 600; }
.cost-line--free { color: var(--c-brand) !important; }

.leaver-card__head { display: flex; align-items: center; gap: var(--s-3); }
.leaver-card__initial {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: var(--r-pill);
    background: var(--c-brand-tint);
    color: var(--c-brand);
    font-family: var(--font-display);
    font-weight: 600;
}
.leaver-card__name { font-family: var(--font-display); font-weight: 600; color: var(--c-ink); }
.leaver-card__since { font-size: var(--t-xs); color: var(--c-ink-3); }
.leaver-card__badges { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: var(--s-2); }
.leaver-card__badges li {
    font-size: var(--t-xs);
    color: var(--c-gold-ink);
    background: var(--c-gold);
    padding: 3px var(--s-3);
    border-radius: var(--r-pill);
    justify-self: start;
}

.safety-card { background: var(--c-brand-tint); border-color: var(--c-brand-tint-hard); }
.safety-card__heading { font-size: var(--t-sm); color: var(--c-brand); margin-bottom: var(--s-3); }
.safety-card ul { margin: 0; padding-left: var(--s-5); font-size: var(--t-xs); color: var(--c-ink-2); }
.safety-card li { margin-bottom: var(--s-2); }

@media (min-width: 900px) {
    .detail__layout { grid-template-columns: 1fr 340px; gap: var(--s-10); align-items: start; }
    /*
     * Same guard as the search filter panel, for the same reason.
     *
     * This one LOOKS fine on a 900px-tall screen — the cost card, the leaver
     * card and the safety card come to 788px, which fits with 32px to spare.
     * On a 700px laptop it is 168px too tall, and because it is pinned that
     * 168px cannot be scrolled to: the safety advice about not paying a
     * deposit before visiting is simply not reachable, on the page whose whole
     * job is to be careful.
     *
     * max-height costs nothing when the content already fits. It only becomes
     * a scrollbar on the screens where the alternative was a silently
     * truncated sidebar.
     */
    .detail__aside {
        position: sticky;
        top: calc(var(--header-h) + var(--s-4));
        max-height: calc(100vh - var(--header-h) - var(--s-8));
        overflow-y: auto;
    }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .detail__title { font-size: var(--t-2xl); }
}

/* ---- Wizard ------------------------------------------------------------ */

.wizard { max-width: 640px; padding-block: var(--s-8) var(--s-16); }

.wizard__progress {
    height: 3px;
    background: var(--c-line);
    border-radius: var(--r-pill);
    overflow: hidden;
    margin-bottom: var(--s-4);
}
.wizard__bar { display: block; height: 100%; background: var(--c-brand); transition: width .25s ease; }

.wizard__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--s-5);
}
.wizard__step { font-size: var(--t-xs); color: var(--c-ink-3); }
/*
 * Reads as an action, because it is one.
 *
 * This was --t-xs and body weight, matching the "Step 1 of 2" caption it sits
 * beside — correct when it said "Save and exit", which is an escape hatch and
 * should be quiet. It now says "Publish listing", and the style never followed
 * the words: the most consequential link on the screen was rendered as a
 * caption, distinguishable from the text next to it only by colour.
 *
 * Semibold and a size up, and no further. It is still SECONDARY to the
 * Continue button at the foot of the form, which is the path most people
 * should take; giving this button chrome would set the two competing.
 */
/*
 * A button, not a link.
 *
 * Semibold text was an improvement on caption-sized, and still read as part
 * of the row it sits in. The one control that finishes the job should look
 * like something you press.
 */
.wizard__exit {
    display: inline-block;
    padding: var(--s-2) var(--s-4);
    border: 1px solid var(--c-brand);
    border-radius: var(--r-pill);
    font-size: var(--t-sm);
    font-weight: 600;
    text-decoration: none;
}
.wizard__exit:hover {
    background: var(--c-brand);
    color: var(--c-brand-ink);
    text-decoration: none;
}

.wizard__title { font-size: var(--t-xl); margin-bottom: var(--s-2); }
.wizard__lede { font-size: var(--t-sm); color: var(--c-ink-3); margin: 0 0 var(--s-8); }

.wizard__form { display: grid; gap: var(--s-6); }

.wizard__group {
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    background: var(--c-surface);
    padding: var(--s-5);
    margin: 0;
    display: grid;
    gap: var(--s-4);
}
.wizard__group legend {
    font-family: var(--font-display);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-ink);
    padding: 0 var(--s-2);
}

.wizard__hint { font-size: var(--t-xs); color: var(--c-ink-3); margin: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }

.wizard__form select,
.wizard__form textarea,
.wizard__form input[type="text"],
.wizard__form input[type="number"],
.wizard__form input[type="date"] {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    background: var(--c-surface);
    font-size: 16px;
}
.wizard__form textarea { resize: vertical; font-family: inherit; }

.field__money {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--c-surface);
}
.field__money:focus-within { border-color: var(--c-brand); }
.field__money input { border: none !important; border-radius: 0 !important; flex: 1; }
.field__money .field__prefix {
    display: grid;
    place-items: center;
    padding-inline: var(--s-4);
    background: var(--c-surface-2);
    border-right: 1px solid var(--c-line);
    color: var(--c-ink-2);
}

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-1) var(--s-3); }

.wizard__map {
    height: 300px;
    border-radius: var(--r-md);
    border: 1px solid var(--c-line-strong);
    overflow: hidden;
    background: var(--c-surface-2);
}

.wizard__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-4);
    margin-top: var(--s-4);
}

.wizard__missing { margin: var(--s-2) 0; padding-left: var(--s-5); font-size: var(--t-sm); }

.wizard__preview { display: grid; gap: var(--s-5); margin-bottom: var(--s-8); }

.preview-card, .preview-block {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

.preview-absent { margin: var(--s-3) 0 0; padding-left: var(--s-5); font-size: var(--t-sm); color: var(--c-ink-2); }
.preview-absent li { margin-bottom: var(--s-2); }

button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Photos ------------------------------------------------------------ */

/* The media block IS the card's width — no calc, nothing to keep in sync with
   the body padding. It is the containing block for the badge and the heart,
   which are positioned over the photo. */
.listing-card__media {
    position: relative;
    background: var(--c-surface-2);
}

.listing-card__photo {
    display: block;          /* kills the inline-image baseline gap below it */
    width: 100%;
    /* aspect-ratio rather than a fixed height: the card reserves the right
       space before the image loads, so nothing shifts when it arrives. A
       fixed 170px did that too, but broke the 3:2 photos on a wide card. */
    aspect-ratio: 3 / 2;
    height: auto;
    object-fit: cover;
    background: var(--c-surface-2);
}

.listing-card__photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    background: repeating-linear-gradient(
            45deg, var(--c-surface-2), var(--c-surface-2) 12px,
            var(--c-surface) 12px, var(--c-surface) 24px);
}

/* The badge moves onto the photo now that there is one. */
.listing-card__media .listing-card__badge {
    position: absolute;
    top: var(--s-3);
    left: var(--s-3);
    z-index: 2;
    background: var(--c-surface);
    box-shadow: var(--shadow-sm);
}

/* ---- The heart --------------------------------------------------------- */

.listing-card__save {
    position: absolute;
    top: var(--s-3);
    right: var(--s-3);
    /* Above the stretched link, or the click would open the listing instead
       of saving it. */
    z-index: 2;
    margin: 0;
    line-height: 0;
}

.listing-card__save-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--c-line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.listing-card__save-btn:hover { transform: scale(1.08); border-color: var(--c-brand); }
.listing-card__save-btn:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.listing-card__save-btn svg {
    width: 20px;
    height: 20px;
    /* Outline by default, filled when saved. Two states in one path, so the
       markup does not need two icons that could drift apart. */
    fill: none;
    stroke: var(--c-ink-2);
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.listing-card__save-btn--on { background: var(--c-brand-tint); border-color: var(--c-brand); }
.listing-card__save-btn--on svg { fill: var(--c-brand); stroke: var(--c-brand); }

/* Available to screen readers, invisible on screen. Used for the heart's
   label: an icon-only button with no accessible name is announced as
   "button", which tells a screen-reader user nothing. */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.photo-upload { display: grid; gap: var(--s-4); }
.photo-upload input[type="file"] { font-size: var(--t-sm); }

.photo-count {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--t-sm);
    margin: var(--s-6) 0 var(--s-3);
}
.photo-count__need { color: var(--c-brand); font-size: var(--t-xs); }
.photo-count__ok { color: var(--c-gold-ink); font-size: var(--t-xs); }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--s-3);
}

.photo-tile {
    margin: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.photo-tile img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photo-tile figcaption { padding: var(--s-2); }

.photo-tile__cover {
    display: inline-block;
    font-size: var(--t-xs);
    background: var(--c-brand);
    color: var(--c-brand-ink);
    padding: 1px var(--s-2);
    border-radius: var(--r-pill);
    margin-bottom: var(--s-1);
}

.photo-tile__actions { display: flex; gap: var(--s-1); flex-wrap: wrap; }
.photo-tile__actions .btn { padding: 2px var(--s-2); font-size: var(--t-xs); }

.photo-grid--preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--r-md);
}

/* ---- Requests ---------------------------------------------------------- */

.request-summary {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    margin: var(--s-6) 0;
}
.request-summary__rent { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; color: var(--c-ink); }
.request-summary__rent small { font-family: var(--font-body); font-size: var(--t-xs); font-weight: 400; color: var(--c-ink-3); }
.request-summary__where { font-size: var(--t-sm); color: var(--c-ink-2); margin-top: var(--s-1); }
.request-summary__leaver { font-size: var(--t-xs); color: var(--c-ink-3); margin-top: var(--s-1); }

.request-list { display: grid; gap: var(--s-4); }

.request-row {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

.request-row__head { display: flex; align-items: center; gap: var(--s-3); }
.request-row__name { font-family: var(--font-display); font-weight: 600; color: var(--c-ink); }
.request-row__meta { font-size: var(--t-xs); color: var(--c-ink-3); }

.request-row__status {
    margin-left: auto;
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    background: var(--c-surface-2);
    padding: 2px var(--s-3);
    border-radius: var(--r-pill);
    white-space: nowrap;
}

.request-row__note {
    margin: var(--s-4) 0 0;
    padding: var(--s-3) var(--s-4);
    background: var(--c-surface-2);
    border-radius: var(--r-md);
    font-size: var(--t-sm);
    color: var(--c-ink-2);
    white-space: pre-wrap;
}

.request-row__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); }

/* The connected state: gold, matching the prototype's connect animation. */
.connected {
    margin-top: var(--s-4);
    padding: var(--s-4);
    background: var(--c-gold);
    border-radius: var(--r-md);
    display: grid;
    gap: var(--s-3);
}
.connected__title { font-family: var(--font-display); font-weight: 600; color: var(--c-gold-ink); margin: 0; font-size: var(--t-sm); }
.connected__party, .connected__address { display: grid; gap: 2px; }
.connected__role { font-size: var(--t-xs); color: var(--c-gold-ink); opacity: .8; }
.connected__name { font-family: var(--font-display); font-weight: 600; color: var(--c-ink); }
.connected__phone { font-family: var(--font-display); font-size: var(--t-md); color: var(--c-gold-ink); }
.connected__address { font-size: var(--t-sm); color: var(--c-ink-2); }
.connected .btn--primary { justify-self: start; }

/* ---- Dashboard --------------------------------------------------------- */

.dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }

.dash-tile {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5) var(--s-4);
    text-align: center;
    color: inherit;
    transition: border-color .15s ease;
}
.dash-tile:hover { text-decoration: none; color: inherit; border-color: var(--c-line-strong); }
.dash-tile__value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--t-xl);
    font-weight: 600;
    color: var(--c-ink);
}
.dash-tile__label { display: block; font-size: var(--t-xs); color: var(--c-ink-3); margin-top: 2px; }

.listing-panels { display: grid; gap: var(--s-4); }

.listing-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}

.listing-panel__head { margin-bottom: var(--s-3); }

.listing-panel__status {
    font-size: var(--t-xs);
    background: var(--c-surface-2);
    color: var(--c-ink-2);
    padding: 2px var(--s-3);
    border-radius: var(--r-pill);
}
.listing-panel__status--live { background: var(--c-gold); color: var(--c-gold-ink); }

.listing-panel__expiry { font-size: var(--t-xs); color: var(--c-ink-3); margin-left: var(--s-1); }
.listing-panel__expiry--soon { color: var(--c-brand); font-weight: 600; }

.listing-panel__title {
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 600;
    color: var(--c-ink);
    margin: 0 0 var(--s-3);
}

.listing-panel__stats { display: flex; gap: var(--s-5); font-size: var(--t-sm); color: var(--c-ink-3); }
.listing-panel__stats strong { color: var(--c-ink); font-family: var(--font-display); }

.listing-panel__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-4); }

.profile-card {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: var(--s-5);
}
.profile-card__bar {
    height: 6px;
    background: var(--c-line);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.profile-card__bar span { display: block; height: 100%; background: var(--c-brand); }
.profile-card__pct { font-size: var(--t-sm); color: var(--c-ink-2); margin: var(--s-3) 0 0; }
.profile-card__todo { margin: var(--s-3) 0 0; padding-left: var(--s-5); font-size: var(--t-sm); color: var(--c-ink-2); }
.profile-card__todo li { margin-bottom: var(--s-2); }
.profile-card__done { font-size: var(--t-sm); color: var(--c-gold-ink); margin: var(--s-3) 0 0; }

@media (min-width: 768px) {
    .dash-tiles { max-width: 560px; }
}

.detail__save { margin-top: var(--s-8); display: flex; justify-content: center; }

/* ---- Moderation -------------------------------------------------------- */

.reason { align-items: flex-start; padding: var(--s-2) 0; }
.reason small { display: block; color: var(--c-ink-3); font-size: var(--t-xs); margin-top: 2px; }
.reason strong { font-family: var(--font-display); font-weight: 600; color: var(--c-ink); font-size: var(--t-sm); }

.request-row__status--danger { background: var(--c-brand-tint); color: var(--c-brand); font-weight: 600; }

/* ---- Wishlist button in the header ------------------------------------- */

.site-header__wishlist {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}
.site-header__wishlist svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.site-header__requests {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}
.site-header__requests svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/*
 * The header badges.
 *
 * These had no styling at all until now — the wishlist count rendered as a
 * bare digit sitting next to the word, which reads as a typo rather than a
 * count. A pill is what makes a number next to a label say "this many".
 *
 * min-width plus centred text so "1" and "12" are the same shape and the nav
 * does not shift as the number crosses ten.
 */
.site-header__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-ink-2);
    font-size: var(--t-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/*
 * Pending requests are people waiting on an answer, so this one is filled
 * rather than quiet. The difference is the point: a wishlist count is
 * information you may ignore, and an unanswered request is not.
 */
.site-header__count--waiting {
    background: var(--c-brand);
    color: var(--c-brand-ink);
}

/* ---- Photo gallery on the listing page --------------------------------- */

.gallery {
    display: grid;
    gap: var(--s-2);
    margin-bottom: var(--s-6);
}

.gallery__main {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--c-surface-2);
}
.gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Every frame is stacked in the same grid cell and revealed by :target, so
   the gallery works with CSS alone. JavaScript upgrades it to arrow keys and
   a counter, but a broken script must not leave the page with one photo. */
.gallery__frame {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease;
}
.gallery__frame--on { opacity: 1; visibility: visible; }

.gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--c-ink);
    z-index: 2;
}
.gallery__nav--prev { left: var(--s-3); }
.gallery__nav--next { right: var(--s-3); }
.gallery__nav:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.gallery__count {
    position: absolute;
    right: var(--s-3);
    bottom: var(--s-3);
    z-index: 2;
    background: rgba(27, 25, 23, .72);
    color: #fff;
    font-size: var(--t-xs);
    padding: 2px var(--s-2);
    border-radius: var(--r-pill);
}

.gallery__strip {
    display: flex;
    gap: var(--s-2);
    overflow-x: auto;
    padding-bottom: var(--s-1);
}
.gallery__thumb {
    flex: 0 0 auto;
    width: 88px;
    aspect-ratio: 3 / 2;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--c-surface-2);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb--on { border-color: var(--c-brand); }
.gallery__thumb:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.gallery--empty {
    display: grid;
    place-items: center;
    aspect-ratio: 3 / 2;
    border-radius: var(--r-lg);
    color: var(--c-ink-3);
    font-size: var(--t-sm);
    background: repeating-linear-gradient(
            45deg, var(--c-surface-2), var(--c-surface-2) 14px,
            var(--c-surface) 14px, var(--c-surface) 28px);
}

/* ---- Toasts ------------------------------------------------------------ */

.toasts {
    /* fixed, so the message follows the viewport. The bug this replaces was
       an inline banner at the top of a long page: you pressed a button three
       screens down and the refusal appeared somewhere you were not looking. */
    position: fixed;
    top: var(--s-4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: grid;
    gap: var(--s-2);
    width: min(520px, calc(100vw - var(--s-8)));
    /* The container spans the width but must not swallow clicks on the page
       behind it; each toast turns pointer events back on for itself. */
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-line);
    background: var(--c-surface);
    box-shadow: 0 8px 24px rgba(27, 25, 23, .16);
    animation: toast-in .2s ease-out;
    transition: opacity .2s ease, transform .2s ease;
}

.toast--leaving { opacity: 0; transform: translateY(-8px); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Anyone who has asked their system to reduce motion gets the toast without
   the slide. It still appears; it just does not move. */
@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
    .toast--leaving { transform: none; }
}

.toast__icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: var(--t-xs);
    font-weight: 700;
    line-height: 1;
}

.toast__text { margin: 0; font-size: var(--t-sm); color: var(--c-ink); }

.toast__close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 2px;
    color: var(--c-ink-3);
}
.toast__close:hover { color: var(--c-ink); }
.toast__close:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.toast--error { border-color: var(--c-brand-tint-hard); background: var(--c-brand-tint); }
.toast--error .toast__icon { background: var(--c-brand); color: #fff; }

.toast--notice { border-color: var(--c-line-strong); }
.toast--notice .toast__icon { background: var(--c-gold); color: var(--c-gold-ink); }

/* A checkbox that qualifies the control above it rather than being one of a
   list — the "later move-ins" tick under the date. */
.check--inline { margin-top: var(--s-2); }

.profile-card__action { margin: var(--s-4) 0 0; }

.wizard__step--editing { color: var(--c-gold-ink); font-weight: 600; }

/* A card being removed from the wishlist, on its way out. Matches the 200ms
   in shortlist.js — if the two drift, the card vanishes mid-fade. */
.listing-card--leaving {
    opacity: 0;
    transform: scale(.97);
    transition: opacity .2s ease, transform .2s ease;
}

/* ---- Filter panel: the two "Show results" buttons ---------------------- */

.filters__head-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    /* The heading can wrap on a narrow panel; the actions must not be pushed
       off the edge with it. */
    flex: 0 0 auto;
}

/* A compact primary, for the header. The full-width one at the foot of the
   panel keeps the standard size — it is the end of a task, and a bigger
   target is right there. */
.btn--sm {
    padding: 6px var(--s-3);
    font-size: var(--t-xs);
}

/* A sublocality reads as belonging to the row above it rather than as a peer
   of the localities around it. */
.check[data-sub="true"] span { padding-left: var(--s-2); }

/* ---- Admin tables ------------------------------------------------------ */

/*
 * Operator screens, not product surface. Dense on purpose: the job here is
 * scanning many rows, which the card layouts used elsewhere are bad at.
 */

.admin-search {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    align-items: center;
    margin-bottom: var(--s-5);
}
.admin-search input[type="search"] {
    flex: 1 1 260px;
    min-width: 0;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    font: inherit;
}

/*
 * The wrapper scrolls, not the page. A seven-column table does not fit a
 * phone, and without this the whole layout grows a horizontal scrollbar and
 * the header drifts off the side.
 */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    background: var(--c-surface);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-sm);
    white-space: nowrap;
}
.admin-table th,
.admin-table td {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    border-bottom: 1px solid var(--c-line);
}
.admin-table th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--c-surface-2); }

/* Secondary detail — dates, masked numbers, owner addresses. */
.admin-dim { color: var(--c-ink-3); }

.admin-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--r-sm);
    background: var(--c-brand-tint);
    color: var(--c-brand);
    font-size: var(--t-xs);
    font-weight: 600;
}

.admin-pager {
    display: flex;
    gap: var(--s-3);
    justify-content: space-between;
    margin-top: var(--s-5);
}

/* Row actions sit side by side. Without this "View" and "Take down" render
   as one run-on word, and the destructive one is the easier to hit. */
.admin-table td a + a { margin-left: var(--s-4); }

/* ---- Wizard: photos and drafts ----------------------------------------- */

/* The bar on an unfinished listing's dashboard card. Tighter than the one in
   the wizard header, which sits under a title rather than inside a card. */
.draft-progress { margin: var(--s-3) 0 var(--s-2); max-width: 260px; }

.photo-upload__busy {
    margin: var(--s-3) 0 0;
    font-size: var(--t-sm);
    color: var(--c-ink-3);
}

/*
 * Previews of files that have not been uploaded yet.
 *
 * Deliberately NOT identical to the uploaded grid. These are in flight, and
 * showing them the same way would claim the upload had finished — so they are
 * dimmed, and they carry none of the cover/remove controls, which mean nothing
 * until the server has the file.
 */
.photo-grid--pending { opacity: .55; }
.photo-tile--pending { position: relative; }
.photo-tile--pending img { filter: grayscale(.25); }

/* The missing-items list on the preview: every line is a link to its fix. */
.wizard__missing a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.wizard__missing a:hover { color: var(--c-brand); }

/* ---- Wizard: choices as buttons ---------------------------------------- */

/*
 * A radio group that looks like a row of buttons.
 *
 * These replaced native <select>s. A select on a phone opens a scroll wheel:
 * two taps, and the options hidden until you commit to looking. With three or
 * four choices there is nothing to hide, and showing them all makes the
 * question answerable at a glance.
 *
 * Still radios underneath, which is the point. Keyboard arrows, screen reader
 * grouping, "pick exactly one" semantics and no-JavaScript submission all come
 * from the input; the styling only changes what it looks like.
 */
.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.choice {
    position: relative;
    display: inline-flex;
}

/*
 * The input is hidden from sight but NOT from the accessibility tree, which is
 * why this is clip-and-shrink rather than display:none. A display:none radio
 * is not focusable, so the whole group becomes unreachable by keyboard — the
 * exact thing using real radios was meant to preserve.
 */
.choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}

.choice span {
    display: inline-block;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-pill);
    background: var(--c-surface);
    font-size: var(--t-sm);
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.choice span:hover { border-color: var(--c-brand); }

.choice input:checked + span {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: var(--c-brand-ink);
}

/* Focus has to be visible on the SPAN, since the input it belongs to is not
   on screen. Without this a keyboard user moves through the group blind. */
.choice input:focus-visible + span {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* ---- Field labelling --------------------------------------------------- */

.field__optional,
.field__private {
    display: inline-block;
    margin-left: var(--s-2);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    font-size: var(--t-xs);
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0;
}
.field__optional { background: var(--c-surface-2); color: var(--c-ink-3); }

/* Gold, not grey: "private" is a promise being made, not a detail. */
.field__private { background: var(--c-gold); color: var(--c-gold-ink); }

/* ---- Area search ------------------------------------------------------- */

/* The input's own positioned box. The results list anchors to THIS, not to
   the .field around it - .field is display:grid, and an absolutely positioned
   child of a grid container with no `top` lands at the top of the container,
   covering the input. */
.area-picker { position: relative; display: block; }

.area-picker__input {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    background: var(--c-surface);
    font-size: 16px;   /* below this, iOS Safari zooms the page on focus */
}
.area-picker__input:focus { border-color: var(--c-brand); outline: none; }

.area-picker__results {
    position: absolute;
    z-index: 20;
    /* Below the input, said explicitly. Left to its static position it was
       placed at the top of the grid container it used to live in, i.e. over
       the box being typed into. */
    top: 100%;
    left: 0;
    right: 0;
    margin: var(--s-1) 0 0;
    padding: var(--s-1);
    list-style: none;
    background: var(--c-surface);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
}

.area-picker__result {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s-3);
    width: 100%;
    padding: var(--s-3) var(--s-3);
    border: none;
    border-radius: var(--r-sm);
    background: none;
    font: inherit;
    font-size: var(--t-sm);
    text-align: left;
    cursor: pointer;
}
.area-picker__result:hover { background: var(--c-brand-tint); color: var(--c-brand); }

.area-picker__group { font-size: var(--t-xs); color: var(--c-ink-3); }

.area-picker__chosen {
    margin: var(--s-2) 0 0;
    font-size: var(--t-sm);
    color: var(--c-brand);
    font-weight: 500;
}

/* "All of Chembur" against the sublocalities under it. A different kind of
   answer, not another sibling — it covers every one of them. */
.area-picker__result--all {
    font-weight: 600;
    border-bottom: 1px solid var(--c-line);
    border-radius: 0;
}
.area-picker__whole {
    font-size: var(--t-xs);
    color: var(--c-brand);
    background: var(--c-brand-tint);
    padding: 1px 6px;
    border-radius: var(--r-sm);
}

/* A caption under each photo in the wizard grid. */
.photo-tile__label { display: flex; gap: var(--s-2); align-items: center; margin: var(--s-2) 0; }
.photo-tile__label input {
    flex: 1 1 auto;
    min-width: 0;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-sm);
    font: inherit;
    font-size: var(--t-sm);
}
.photo-tile__label input:focus { border-color: var(--c-brand); outline: none; }

/* On the public listing, under the image in the gallery strip. */
.gallery__caption {
    font-size: var(--t-sm);
    color: var(--c-ink-2);
    margin: var(--s-2) 0 0;
}

/* A gender restriction on a card. Tinted rather than neutral because it is the
   one tag that can rule a room out entirely — everything else beside it is a
   description, this is a condition. Only rendered when there IS one. */
.tag--who { background: var(--c-brand-tint); color: var(--c-brand); }

/* ---- Legal pages ------------------------------------------------------- */

/*
 * Narrower than the rest of the site, on purpose. A line of text is readable
 * up to roughly 75 characters and this page is nothing but lines of text, so
 * the full page width would make it genuinely harder to read the one document
 * people skim when they are already unsure about handing over a phone number.
 */
.legal { max-width: 68ch; }

.legal__updated { font-size: var(--t-sm); color: var(--c-ink-3); margin: 0 0 var(--s-5); }
.legal__lede { font-size: var(--t-md); color: var(--c-ink-2); margin: 0 0 var(--s-6); }

.legal h2 {
    font-family: var(--font-display);
    font-size: var(--t-lg);
    margin: var(--s-8) 0 var(--s-3);
}
.legal h3 {
    font-family: var(--font-display);
    font-size: var(--t-base);
    margin: var(--s-5) 0 var(--s-2);
    color: var(--c-ink-2);
}
.legal p { margin: 0 0 var(--s-4); line-height: 1.65; }
.legal ul { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
.legal li { margin-bottom: var(--s-2); line-height: 1.6; }

.legal code {
    background: var(--c-surface-2);
    padding: 1px 5px;
    border-radius: var(--r-sm);
    font-size: var(--t-sm);
}

.legal__contact {
    padding: var(--s-4);
    background: var(--c-surface-2);
    border-radius: var(--r-md);
    line-height: 1.7;
}

.site-footer__links { margin: var(--s-3) 0 0; font-size: var(--t-sm); }

/* Breathing room around the divider so the two links do not read as one. */
.site-footer__sep { color: var(--c-ink-3); margin-inline: var(--s-2); }

/*
 * An icon inside a button.
 *
 * .btn is already inline-flex with a gap, so the icon only needs sizing and
 * the stroke treatment the rest of the site's icons use — outline, no fill,
 * inheriting the button's colour so it works on primary, secondary and ghost
 * without a variant each.
 *
 * em rather than px: the icon then tracks the button's font size, so it stays
 * in proportion on a smaller button instead of needing a second rule.
 */
.btn svg {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* ---- Card photos: collage, then one at a time -------------------------- */

/*
 * Every frame is in the markup; exactly one carries --on. The script moves
 * that class and nothing else, so with no JavaScript the first frame shows
 * and the rest stay hidden — a collage with no arrows, which is still a card.
 */
.listing-card__frames { position: relative; }

.listing-card__frame { display: none; }
.listing-card__frame--on { display: block; }

/*
 * The collage holds the same 3:2 box as a single photo, so a card does not
 * change height when you step off it. Grid rather than flex: the large cell
 * spans both rows, which flex cannot express without fixed heights.
 *
 * NOTE THE SELECTOR. `display: grid` is on the --on compound, not on
 * .listing-card__collage alone, and that is the whole fix for a real bug: a
 * bare `.listing-card__collage { display: grid }` sits LATER in this file than
 * `.listing-card__frame { display: none }` at the same specificity, so it won
 * the cascade and the collage never hid. Stepping to the first photo then
 * showed that photo UNDERNEATH the collage — two frames stacked, the card
 * twice as tall, and the page shoved down the screen.
 *
 * Everything else below is layout and applies either way; only the display
 * switch is gated.
 */
.listing-card__collage {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 3 / 2;
    background: var(--c-surface-2);
}
.listing-card__collage.listing-card__frame--on { display: grid; }
.listing-card__collage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 0;   /* without this the images refuse to shrink in a grid row */
}
.listing-card__collage img:first-child { grid-row: span 2; }

/* Two photos: side by side, both full height, rather than one tall and one
   short with a hole under it. */
.listing-card__collage--2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.listing-card__collage--2 img:first-child { grid-row: auto; }

.listing-card__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--c-ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;

    /*
     * Always visible, not revealed on hover.
     *
     * They were hover-only, which is what Airbnb does — and Airbnb's users
     * already know the pattern is there to find. Here the person who BUILT
     * the site looked at a card twice and reported the next button missing,
     * which settles it: a control nobody can find is a control that is not
     * there.
     *
     * Hover still strengthens them, so they recede until wanted without ever
     * being invisible. The shadow is what keeps them legible against a photo
     * that happens to be white.
     */
    opacity: .75;
    transition: opacity .15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.listing-card__nav--prev { left: var(--s-2); }
.listing-card__nav--next { right: var(--s-2); }

/* Full strength when wanted, rather than appearing from nothing. */
.listing-card:hover .listing-card__nav,
.listing-card__nav:hover,
.listing-card__nav:focus-visible { opacity: 1; }

.listing-card__dots {
    position: absolute;
    bottom: var(--s-2);
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 5px;
}
.listing-card__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
}
.listing-card__dot--on { background: #fff; }

/* Touch has no hover, so the arrows would never appear. Shown always, and
   smaller, since a thumb targets them directly. */
@media (hover: none) {
    .listing-card__nav { opacity: 1; width: 26px; height: 26px; font-size: 16px; }
}

/* ---- Area filter: localities with their sublocalities ------------------ */

/*
 * The indent is the whole point. Flat, a West sublocality sat between the two
 * Andheri parents with its parent printed on the right as the only clue; the
 * hierarchy was in the data and nowhere on the screen.
 */
.area-group { margin-bottom: var(--s-2); }

.area-group__parent { font-weight: 600; }

.area-group__child {
    padding-left: var(--s-5);
    font-size: var(--t-sm);
    color: var(--c-ink-2);
}

/* A hairline down the children, so the group reads as one block rather than a
   list that happens to be indented. */
.area-group__child { border-left: 1px solid var(--c-line); margin-left: var(--s-2); }

/* A request whose room has gone. Gold rather than red: the room being taken is
   usually the system working, not a failure. */
.request-row__status--gone {
    background: var(--c-gold);
    color: var(--c-gold-ink);
    font-weight: 600;
}

/* ---- Picked areas, as chips -------------------------------------------- */

.area-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin: var(--s-3) 0;
}

.area-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 4px 10px;
    border: 1px solid var(--c-brand);
    border-radius: var(--r-pill);
    background: var(--c-brand-tint);
    color: var(--c-brand);
    font: inherit;
    font-size: var(--t-xs);
    font-weight: 600;
    cursor: pointer;
}
.area-chip:hover { background: var(--c-brand); color: var(--c-brand-ink); }
.area-chip__x { font-size: 14px; line-height: 1; }

/* ---- Filters on a phone: a drawer, not a wall -------------------------- */

/*
 * The panel came first in the source, so a phone showed a screen and a half
 * of checkboxes before the first room. Somebody arriving from a WhatsApp link
 * to LOOK AT FLATS had to scroll past ninety areas to see one.
 *
 * Desktop is untouched: there the panel sits beside the results with room to
 * spare, and always-visible is the right answer.
 */
.filters__open,
.filters__close { display: none; }

@media (max-width: 767px) {
    .filters__open {
        display: inline-flex;
        align-items: center;
        gap: var(--s-2);
        padding: var(--s-3) var(--s-5);
        margin-bottom: var(--s-4);
        border: 1px solid var(--c-line-strong);
        border-radius: var(--r-pill);
        background: var(--c-surface);
        font-family: var(--font-display);
        font-weight: 500;
        font-size: var(--t-sm);
        cursor: pointer;
    }

    /*
     * Fixed, full height, off to the left until opened. Transform rather than
     * display:none so it slides, and so a screen reader is not surprised by
     * content appearing from nowhere.
     */
    .filters {
        position: fixed;
        inset: 0;
        z-index: 60;
        margin: 0;
        border: none;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .2s ease;
        visibility: hidden;
    }
    .filters--open { transform: none; visibility: visible; }

    .filters__close {
        display: inline-block;
        border: none;
        background: none;
        font-size: 26px;
        line-height: 1;
        color: var(--c-ink-2);
        cursor: pointer;
        padding: 0 var(--s-2);
    }

    /* The panel is the whole screen, so its own "Show results" is the way
       out — it submits AND the page reloads with the drawer shut. */
    .filters__head {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--c-surface);
        padding-bottom: var(--s-3);
    }

    /* Nothing behind it should scroll while it is open. */
    body.filters-open { overflow: hidden; }
}

/* The leaver's own words, under the photos. Serif and a touch larger: it is
   the one passage of prose on a page otherwise made of labels and numbers. */
.detail__description {
    font-size: var(--t-md);
    line-height: 1.65;
    color: var(--c-ink-2);
    margin: var(--s-5) 0 0;
    max-width: 62ch;
}

/* Photo tiles line up regardless of what each one carries.
   Only the cover has a "Cover" badge and only the others have "Make cover",
   so without a column layout and a pushed-down action row the captions sat at
   three different heights across one grid. */
.photo-tile figcaption {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    height: 100%;
}
.photo-tile__actions { margin-top: auto; }
.photo-tile { display: flex; flex-direction: column; }

/* ===========================================================================
   Landing pages — /flats-in-<area>, /flats-near-<station>-station, /guides/*

   These are the pages people arrive on from a search engine, so they are read
   by somebody who has never seen the site before. The layout is accordingly
   plainer than the search page: a heading, some writing, the rooms, and the
   links out. No filter panel, because a filter panel is a tool for somebody
   who already knows what they want.
   =========================================================================== */

.page-head { padding-block: var(--s-8) var(--s-4); }

.page-head__title {
    font-size: var(--t-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-head__lede {
    color: var(--c-ink-2);
    font-size: var(--t-base);
    margin: var(--s-3) 0 0;
    max-width: 62ch;
}

/*
 * Author-written prose.
 *
 * max-width in ch rather than px: the comfortable line length for reading is a
 * number of CHARACTERS, around 60-75, and a px width only approximates that
 * until somebody changes the font size. This is the one block on the site
 * where somebody reads several hundred words in a row.
 */
.prose {
    max-width: 68ch;
    padding-block: var(--s-6);
}

.prose__title {
    font-size: var(--t-lg);
    margin-bottom: var(--s-4);
}

.prose__body { color: var(--c-ink-2); }

/* Descendant selectors, because this subtree is generated from Markdown and
   its elements cannot carry classes. The only place in this stylesheet where
   that is true, and the reason is worth keeping in mind before adding more. */
.prose__body > :first-child { margin-top: 0; }
.prose__body > :last-child { margin-bottom: 0; }
.prose__body p { margin: 0 0 var(--s-4); }
.prose__body h2 { font-size: var(--t-md); margin: var(--s-8) 0 var(--s-3); }
.prose__body h3 { font-size: var(--t-base); margin: var(--s-6) 0 var(--s-2); }
.prose__body ul { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
.prose__body li { margin-bottom: var(--s-2); }
.prose__body a { text-decoration: underline; }

/* ---- The links out ----------------------------------------------------- */

.link-grid {
    display: grid;
    gap: var(--s-6);
    padding: var(--s-6);
    background: var(--c-surface-2);
    border-radius: var(--r-lg);
}

.link-grid__title {
    font-size: var(--t-sm);
    color: var(--c-ink-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: var(--s-3);
}

.link-grid__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--s-2);
    font-size: var(--t-sm);
}

@media (min-width: 768px) {
    .page-head { padding-block: var(--s-12) var(--s-6); }
    .page-head__title { font-size: var(--t-3xl); }
    .page-head__lede { font-size: var(--t-md); }
    .link-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-10); padding: var(--s-8); }
    .link-grid__list { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Guides ------------------------------------------------------------- */

.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }

.guide-list__link {
    display: block;
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    color: inherit;
}
.guide-list__link:hover { border-color: var(--c-line-strong); text-decoration: none; }

.guide-list__title { font-size: var(--t-md); margin-bottom: var(--s-2); }
.guide-list__summary { font-size: var(--t-sm); margin: 0 0 var(--s-2); }
.guide-list__date { font-size: var(--t-xs); color: var(--c-ink-3); }

/* The article itself shares .prose__body with the area intros, so a change to
   how Markdown renders lands in both places at once. Only the header above it
   is specific to a guide. */
.article { max-width: 68ch; padding-block: var(--s-4) var(--s-10); }
.article__head { margin-bottom: var(--s-8); }
.article__title { font-size: var(--t-2xl); letter-spacing: -0.02em; }
.article__meta { font-size: var(--t-xs); color: var(--c-ink-3); margin: var(--s-3) 0 0; }
.article__summary {
    font-size: var(--t-md);
    color: var(--c-ink-2);
    margin: var(--s-4) 0 0;
}

.crumbs {
    display: flex;
    gap: var(--s-2);
    font-size: var(--t-xs);
    color: var(--c-ink-3);
    padding-top: var(--s-6);
}
.crumbs a { color: var(--c-ink-3); }
.crumbs a:hover { color: var(--c-brand); }

/* ---- Admin forms -------------------------------------------------------- */

.stack { display: grid; gap: var(--s-5); max-width: 68ch; }

.form-actions { display: flex; gap: var(--s-3); align-items: center; }

.form-error {
    background: var(--c-brand-tint);
    border: 1px solid var(--c-brand-tint-hard);
    color: var(--c-ink);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
    font-size: var(--t-sm);
    margin: 0 0 var(--s-5);
}

/* ===========================================================================
   Search results — one room per row, with the photo big enough to decide on.

   The landing page keeps its three-across grid: its job is to show the site
   has rooms at all. This page is where somebody picks which room to OPEN, and
   that is decided on the photo. A 250px thumbnail three to a row is the wrong
   shape when the page has width to spare and nothing competing for it.

   THE BOX IS FIXED BY RATIO, NOT BY THE IMAGE. The first attempt gave the
   media `height: 100%` and let it stretch to the row. With a short body and a
   wide window there was nothing to stretch AGAINST, so the image's intrinsic
   size took over: an 870px-tall smear of collage beside an empty column. The
   media now owns an explicit aspect-ratio and a max-width, so the card's
   height is a function of the layout and not of whatever got uploaded.

   Styled from the container rather than by passing a modifier into the card
   fragment: it is shared by four pages and has no parameter for this, and a
   second fragment would drift inside a fortnight.
   =========================================================================== */

.results__list {
    display: grid;
    gap: var(--s-5);
}

/*
 * 4:3 on both layouts, which is the shape a room photo is usually taken in and
 * noticeably taller than the 3:2 the grid cards use.
 *
 * On the container, so everything inside simply fills it — the frames, the
 * single photos and the collage all stop having opinions about their own
 * height, and the explicit width/height attributes on the <img> (which
 * describe the grid's 3:2 box) cannot fight it.
 */
.results__list .listing-card__media {
    aspect-ratio: 4 / 3;
}

.results__list .listing-card__frames,
.results__list .listing-card__frame,
.results__list .listing-card__collage,
.results__list .listing-card__photo,
.results__list .listing-card__frame > img {
    height: 100%;
    /* The children must NOT also carry a ratio, or the browser satisfies theirs
       and letterboxes inside the box the container already fixed. */
    aspect-ratio: auto;
}

.results__list .listing-card__photo,
.results__list .listing-card__frame > img {
    width: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {
    /*
     * Photo left, everything else right. The card is already
     * `display: flex; flex-direction: column`, so this turns the same two
     * children into a row with no markup change.
     */
    .results__list .listing-card { flex-direction: row; }

    .results__list .listing-card__media {
        /* Half the row. Worth stating what that buys, because the first
           version used 42% and the photo came out 337px wide — against roughly
           255px for a card in the three-across grid, which is not a change
           anybody would notice.

           At 50% of the ~800px results column the photo is around 400px wide:
           1.6x the grid card on each edge, two and a half times the area. That
           is the difference between a thumbnail and something you can judge a
           room from.

           A percentage so it grows with the window, a max-width so it stops.
           Without the cap, a wide monitor showing one result gave the photo
           700px of width and the card half a metre of height. */
        flex: none;
        width: 50%;
        max-width: 460px;
        /* Stretch is what would hand the height back to the image. The ratio
           above sets it instead; if the body happens to be taller, the photo
           sits at its own height rather than distorting to match. */
        align-self: flex-start;
    }

    /* The body gets the room the wider layout frees up: the rent can be large
       enough to compare at a glance, which is the other thing being scanned. */
    .results__list .listing-card__body {
        padding: var(--s-6);
        display: flex;
        flex-direction: column;
        gap: var(--s-2);
    }

    .results__list .listing-card__rent { font-size: var(--t-2xl); }
    .results__list .listing-card__where { font-size: var(--t-md); }

    /* The tags sit with the text rather than pinned to the bottom of the row.
       `margin-top: auto` lined them up neatly across cards and left a
       hand-sized hole in the middle of each one, which reads as missing
       content rather than as breathing room. */
    .results__list .listing-card__tags { margin-top: var(--s-1); }
}

/*
 * The description, which only the wide results layout has room for.
 *
 * Hidden everywhere else — the landing page's three-across grid has 250px
 * columns, and a paragraph in one pushes the rest of the page down. The card
 * fragment is shared by four pages, so the decision belongs here rather than
 * as a branch in the markup.
 */
.listing-card__blurb { display: none; }

@media (min-width: 768px) {
    .results__list .listing-card__blurb {
        /* -webkit-box is still the only line clamp with real support. The
           prefixes are not legacy cruft; they are the spelling that works. */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;

        font-size: var(--t-sm);
        color: var(--c-ink-2);
        margin: var(--s-1) 0 0;

        /* Three lines of ~60 characters. Past that the eye stops scanning and
           starts reading, which is the wrong mode for a results page. */
        max-width: 56ch;
    }
}
