/* A stay: the create form's three ways to say when, and how cards show it. */
.stay-block [hidden] {
    display: none !important;
}

/* The answer, as the post will say it, with Edit. */
.stay-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    background: #fafafa;
    color: #555;
    font-size: 14.5px;
    line-height: 1.4;
}

.stay-summary strong {
    color: #222;
    font-weight: 600;
}

.stay-block:not(.is-answered) .stay-summary {
    margin-top: 12px;
}

.stay-block.listing-autofill-filled .stay-summary {
    border: 1.5px solid #8ab4f8;
    background: #f7fbff;
}

.stay-change {
    flex: none;
    margin: 0;
    padding: 2px 0;
    border: 0;
    background: none;
    color: #135cbc;
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.stay-change:hover {
    text-decoration: underline;
}

.stay-reading,
.stay-note {
    margin: 6px 0 0;
    color: #555;
    font-size: 13.5px;
}

.stay-reading:empty,
.stay-note:empty {
    display: none;
}

/* The three ways, shaped like the Amenities pills (_amenities_section.html). */
.stay-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    margin-top: 4px;
}

.stay-mode {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.stay-mode[data-active="true"],
.stay-mode:has(> .stay-mode__open[aria-pressed="true"]) {
    border-color: #003660;
    box-shadow: inset 0 0 0 1px #003660;
}

.stay-mode__open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    background: transparent;
    color: #333;
    font: inherit;
    font-size: 14px;
    line-height: 1.3;
    cursor: pointer;
}

.stay-mode__open:hover {
    background: #f3f3f3;
}

.stay-mode__open:focus-visible {
    outline: 2px solid #003660;
    outline-offset: -2px;
}

.stay-mode__icon {
    color: #003660;
    font-size: 18px;
    line-height: 1;
}

.stay-modes.has-error .stay-mode,
.stay-panel.has-error .stay-term-groups .stay-mode,
[data-stay-ways].has-error .stay-mode {
    border-color: #b00020;
}

.stay-modes .field-error-message {
    flex-basis: 100%;
    margin: 2px 0 0;
}

.stay-panel {
    margin: 12px 0 4px;
}

.stay-ask {
    margin: 12px 0 4px;
}

.stay-ask__question {
    margin: 0 0 8px;
    color: #222;
    font-size: 15.5px;
    line-height: 1.4;
}

.stay-term-dates,
.stay-term-dates label {
    display: flex;
    align-items: center;
    gap: 8px 12px;
}

.stay-term-dates {
    flex-wrap: wrap;
}

.stay-term-done {
    flex: none;
}

.stay-term-dates label {
    min-width: 0;
    white-space: nowrap;
}

.stay-term-dates select {
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid #c9c9c9;
    border-radius: 7px;
    background-color: #fff;
    color: #222;
    font: inherit;
    font-size: 16px;
}

.stay-term-problem {
    color: #b00020;
}

.stay-term-editor.has-error .stay-term-problem {
    display: none;
}

@media (max-width: 560px) {
    .stay-term-dash {
        display: none;
    }

    .stay-term-dates label {
        flex: 1 1 115px;
        display: grid;
        gap: 4px;
    }

    .stay-term-dates select {
        width: 100%;
    }
}

/* For a school term: a search box over the list of terms. */
.stay-term-groups {
    margin-bottom: 8px;
}

.stay-search {
    position: relative;
}

.stay-search__icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    pointer-events: none;
}

.stay-search__input,
.stay-typed__input,
.stay-move select {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 8px 10px;
    border: 1.5px solid #c9c9c9;
    border-radius: 7px;
    background-color: #fff;
    color: #222;
    font: inherit;
    font-size: 16px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.stay-search__input {
    padding-left: 34px;
}

.stay-search__input:focus,
.stay-typed__input:focus,
.stay-move select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    outline: none;
}

.stay-search__list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 290px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 0;
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    outline: none;
}

.stay-search__group {
    padding: 8px 12px 4px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.stay-search__option {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 4px;
    padding: 9px 12px;
    color: #222;
    font-size: 15px;
    line-height: 1.35;
    cursor: pointer;
}

.stay-search__option:hover,
.stay-search__option[aria-selected="true"] {
    background: #eef4ff;
}

.stay-search__option.is-current {
    font-weight: 600;
}

.stay-search__months {
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

.stay-search__empty {
    padding: 10px 12px;
    color: #666;
    font-size: 14px;
}

/* Choose a move-in, then a last month or a minimum duration. */
.stay-move {
    display: grid;
    gap: 14px;
    max-width: 420px;
}

.stay-move__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.stay-move__choices .stay-ask__question {
    margin: 0;
}

.stay-move__length .stay-move__field {
    margin-top: 10px;
}

.stay-move__label {
    color: #444;
    font-size: 14px;
    line-height: 1.4;
}

.stay-move select {
    cursor: pointer;
}

/* or type it */
.stay-typed {
    display: flex;
    gap: 8px;
}

.stay-typed__input {
    flex: 1 1 auto;
    min-width: 0;
}

.stay-typed__read {
    flex: none;
}

.stay-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.stay-chip {
    min-height: 44px;
    margin: 0;
    padding: 8px 16px;
    border: 1.5px solid #c9c9c9;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.stay-chip:hover {
    border-color: #1a73e8;
    background: #f5f9ff;
}

.stay-chip.is-current,
.stay-chip[aria-pressed="true"] {
    border-color: #003660;
    background: #f2f6fb;
}

.stay-chip:focus-visible,
.stay-change:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

:is(.stay-ask, .stay-panel, .stay-move__field).has-error :is(select, .stay-chip, input) {
    border-color: #b00020;
}

:is(.stay-ask, .stay-panel) .field-error-message {
    flex-basis: 100%;
    margin: 8px 0 0;
}

.stay-move__field .field-error-message {
    margin: 0;
}

/* "min." sits inside the line, with the months it qualifies, but reads as a note. */
.stay-summary .stay-min {
    font-weight: 400;
}

.stay-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: #1a73e8;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .stay-move__field {
        flex-basis: 100%;
        max-width: none;
    }

    .stay-typed__read {
        padding: 8px 14px;
    }
}

/* Cards: the Availability line stays on one line and ends in an ellipsis when it doesn't fit, at every
   width, never wrapping into the line below. In list rows it keeps their width, which leaves room for the
   time, distance and category on the right. */
:is(.listing-details, .gal-details) :is(.job_p, .job_p_list).card-availability {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A gallery card has nothing beside its lines, so the line may take the card's whole width. */
.gallery-view .gal-details :is(.job_p, .job_p_list).card-availability {
    max-width: 100%;
}

/* Every other line on a housing card (the ones with an Availability line) behaves the same way:
   one line, cut with an ellipsis only at the card's edge. The old `.timeframe` caps
   (280px / 225px / 160px) cut "Room types: Double ($1,231), Single ($3,4…" halfway across. */
:is(.listing-details, .gal-details):has(.card-availability) :is(.job_p, .job_p_list) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-view .gal-details:has(.card-availability) :is(.job_p, .job_p_list) {
    max-width: 100%;
}

/* Lease prices: the per-person price is the headline, like the one price on sublease and roommates
   cards; the total sits above it, smaller and grey but still easy to scan. */
.buy-now-price > .lease-price--total {
    color: #444;
    font-size: max(14px, 0.76em);
    -webkit-text-stroke: 0.35px currentColor;
}

.stay-min {
    color: #6b7280;
}

.stay-min__read {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
