/* ==========================================================================
   ELITE TRIP - shared public-page components.

   The vocabulary the browse, profile, booking, package, safety and help
   pages are written in (.pg-*, .bcard, .chip, .book-box, .f-field ...).
   Class names are the ones those templates and their scripts already use;
   the look is the Elite Trip design system (apple.com's language in the
   brand's espresso, gold and sand), every value a token from elite.css.

   About forty pages load this file, so nothing here is renamed or removed:
   each class keeps its job and only its look changes. Icons are the Elite
   line set (svg.et-i); the old <i> selectors stay beside them until every
   page has moved over. Cards never lift or zoom: a gold edge answers the
   pointer.
   ========================================================================== */

[hidden] { display: none !important; }

/* --- page frame -------------------------------------------------------------- */
.pg-wrap {
    width: 100%;
    max-width: calc(var(--w-page) + var(--pad) * 2);
    margin: 0 auto;
    padding: clamp(28px, 4vw, 48px) var(--pad) var(--sp-chapter);
}
.pg-wrap-narrow { max-width: calc(860px + var(--pad) * 2); }

/* The line above a headline: sentence case, bronze, semibold (Apple's eyebrow). */
.pg-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
    font-size: var(--t-lead); font-weight: 600; line-height: 1.2; letter-spacing: 0.011em;
    text-transform: none;
    color: var(--c-bronze);
}
.pg-kicker i, .pg-kicker .et-i { font-size: 0.95em; color: var(--c-gold); }
.pg-title {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.003em;
    color: var(--c-ink);
}
.pg-sub {
    max-width: 680px; margin-bottom: 28px;
    font-size: var(--t-lead); line-height: 1.38; letter-spacing: 0.011em;
    color: var(--c-muted);
}

.pg-card {
    background: var(--c-bg); border: 1px solid var(--c-line);
    border-radius: var(--r-md); padding: clamp(20px, 2.4vw, 28px);
    box-shadow: none;
}

/* --- buttons: pills, Apple's weight-400 words -------------------------------- */
.pg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 24px;
    border: 1px solid transparent; border-radius: var(--r-pill);
    font-family: var(--f-sans); font-weight: 400; font-size: var(--t-body); line-height: 1.18;
    letter-spacing: -0.022em;
    text-decoration: none; text-align: center; cursor: pointer;
    transition: background-color 200ms var(--ease), border-color 200ms var(--ease),
                color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.pg-btn:hover { text-decoration: none; }
.pg-btn:focus-visible { outline: none; box-shadow: var(--ring); }
/* The brand action: gold with dark words (8.9:1). Never white on gold. */
.pg-btn-primary { background: var(--c-gold); color: #fff; }
.pg-btn-primary:hover { background: var(--c-gold-hover); color: #fff; }
.pg-btn-outline { background: transparent; color: var(--c-ink); border-color: var(--c-ink); }
.pg-btn-outline:hover { background: var(--c-ink); color: var(--c-bg); }
.pg-btn-pink { background: var(--c-ink); color: var(--c-bg); }
.pg-btn-pink:hover { background: #000; color: var(--c-bg); }
.pg-btn-ghost { background: var(--c-bg-alt); color: var(--c-ink); }
.pg-btn-ghost:hover { background: var(--c-bg-alt-2); color: var(--c-ink); }
.pg-btn:disabled, .pg-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none !important; }
.pg-btn-sm { min-height: 40px; padding: 8px 18px; font-size: var(--t-small); }
.pg-btn-block { display: flex; width: 100%; }

/* --- Local Host cards (.bcard): a photograph and a few quiet lines ---------- */
.buddy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.buddy-grid.buddy-results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.bcard {
    position: relative;
    display: flex; flex-direction: column; min-width: 0;
    background: var(--c-bg); border-radius: var(--r-md);
    box-shadow: var(--sh-1);
    overflow: hidden;
    /* A gold edge answers the pointer; the card never lifts and the
       photograph inside never zooms (owner's rule). */
    transition: box-shadow 260ms var(--et-ease-glide, var(--ease));
}
.bcard:hover { box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.55), var(--sh-2); }
.bcard-photo { position: relative; aspect-ratio: 4 / 4.2; overflow: hidden; background: var(--c-bg-alt-2); }
.bcard-photo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 30%; }
.bcard-photo .no-photo { display: grid; place-items: center; height: 100%; background: var(--c-bg-alt); color: var(--c-line-2); font-size: 2.6rem; }
.bcard-verify {
    position: absolute; top: 14px; left: 14px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px 5px 10px; border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.86); color: var(--c-ink);
    -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    font-size: var(--t-micro); font-weight: 600; letter-spacing: -0.01em;
}
.bcard-verify i, .bcard-verify .et-i { color: var(--c-bronze); }
.bcard-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 20px 22px 22px; }
.bcard-name {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
    font-size: 1.3125rem; font-weight: 600; line-height: 1.19; letter-spacing: 0.011em; color: var(--c-ink);
}
.bcard-rating { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-small); font-weight: 600; letter-spacing: -0.01em; color: var(--c-ink); }
.bcard-rating i, .bcard-rating .et-i { color: var(--c-gold); }
.bcard-meta { display: flex; align-items: flex-start; gap: 8px; font-size: var(--t-small); line-height: 1.43; color: var(--c-muted); }
.bcard-meta i, .bcard-meta .et-i { flex: none; width: 14px; margin-top: 3px; color: var(--c-bronze); font-size: 0.78rem; text-align: center; }
.bcard-next { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-small); font-weight: 600; color: var(--c-success); }
.bcard-price { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--c-line); font-size: var(--t-body); font-weight: 600; color: var(--c-ink); }
.bcard-price small { font-weight: 400; color: var(--c-muted); }

@media (max-width: 1068px) {
    .buddy-grid.buddy-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .buddy-grid.buddy-results-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .buddy-results-grid .bcard-name { overflow-wrap: anywhere; }
    .buddy-results-grid .bcard-meta, .buddy-results-grid .bcard-next { overflow-wrap: anywhere; }
}

/* --- chips ------------------------------------------------------------------------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: var(--r-pill);
    background: var(--c-bg-alt); color: var(--c-ink-2);
    font-size: var(--t-micro); font-weight: 600; letter-spacing: 0;
}
.chip-warm { background: var(--c-warn-bg); color: var(--c-link); }
.chip-green { background: var(--c-success-bg); color: var(--c-success); }
/* A chip that is a control (a one-tap filter). */
.chip-select {
    min-height: 44px; padding: 9px 18px;
    border: 1px solid var(--c-line-2); background: var(--c-bg); color: var(--c-ink);
    font-size: var(--t-small); font-weight: 400; letter-spacing: -0.01em;
    cursor: pointer; user-select: none;
    transition: border-color 200ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease);
}
.chip-select:hover { border-color: var(--c-ink); }
.chip-select:focus-visible { outline: none; box-shadow: var(--ring); }
.chip-select.on, .chip-select[aria-pressed="true"] { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }

/* --- the profile ------------------------------------------------------------------ */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1020px) { .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .profile-col-book { grid-column: 1 / -1; } }
@media (max-width: 700px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }

.pf-photo-main { position: relative; aspect-ratio: 4 / 4.3; border-radius: var(--r-xl); overflow: hidden; background: var(--c-bg-alt); }
.pf-photo-main img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pf-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pf-thumbs img {
    width: 64px; height: 64px; object-fit: cover; cursor: pointer;
    border-radius: var(--r-sm); border: 2px solid transparent; opacity: 0.72;
    transition: opacity 200ms var(--ease), border-color 200ms var(--ease);
}
.pf-thumbs img:hover { opacity: 1; }
.pf-thumbs img.on { border-color: var(--c-ink); opacity: 1; }

.trust-list { display: flex; flex-direction: column; gap: 16px; }
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item .t-ico {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 36px; height: 36px; padding-top: 2px; border-radius: 999px;
    background: var(--c-espresso); color: #fff; font-size: 1rem;
}
.trust-item .t-ico.muted { background: var(--c-bg-alt-2); color: var(--c-muted); }
.trust-item h3, .trust-item h5 { margin-bottom: 2px; font-size: var(--t-body); font-weight: 600; letter-spacing: -0.022em; color: var(--c-ink); }
.trust-item p { font-size: var(--t-small); line-height: 1.43; color: var(--c-muted); }

.review-card { margin-top: 12px; padding: 18px 20px; border-radius: var(--r-sm); background: var(--c-bg-alt); }
.review-card .stars { color: var(--c-link); font-size: var(--t-micro); font-weight: 600; }
.review-card p { margin: 6px 0; font-size: var(--t-body); line-height: 1.47; color: var(--c-ink); }
.review-card small { color: var(--c-muted); }

/* --- the booking box ------------------------------------------------------------ */
.book-box { position: sticky; top: calc(var(--nav-h) + 16px); }
.book-box .field { margin-bottom: 18px; }
.book-box label { display: block; margin-bottom: 8px; font-size: var(--t-small); font-weight: 600; letter-spacing: -0.01em; color: var(--c-ink); }
.book-box select, .book-box input,
.f-field input, .f-field select, .f-field textarea {
    display: block; width: 100%; min-width: 0; min-height: 50px; padding: 12px 16px;
    border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
    background-color: var(--c-bg); color: var(--c-ink);
    font-family: var(--f-sans); font-size: var(--t-body); line-height: 1.3;
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.book-box select:hover, .book-box input:hover,
.f-field input:hover, .f-field select:hover, .f-field textarea:hover { border-color: var(--c-faint); }
.book-box select:focus, .book-box input:focus,
.f-field input:focus, .f-field select:focus, .f-field textarea:focus { outline: none; border-color: var(--c-bronze); box-shadow: var(--ring); }
.book-box select, .f-field select {
    -webkit-appearance: none; appearance: none; padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%231d1a17' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 17px center; background-size: 12px 8px;
}
.book-box input[type="checkbox"] { display: inline-block; width: 20px; min-height: 0; height: 20px; padding: 0; }

/* Start times: a grid of quiet pills. Ink when chosen, warm gold when the
   Local Host usually works then; the words, not the colour, carry the advice. */
.slot-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
    max-height: 164px; overflow-y: auto; padding: 2px; overscroll-behavior: contain;
}
.slot {
    display: block; width: 100%; min-height: 44px; padding: 10px 4px;
    border: 1px solid var(--c-line-2); border-radius: var(--r-pill);
    background: var(--c-bg); color: var(--c-ink); text-align: center;
    font-family: var(--f-sans); font-size: var(--t-small); font-weight: 400;
    font-variant-numeric: tabular-nums; cursor: pointer;
    transition: border-color 200ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease);
}
.slot:hover { border-color: var(--c-ink); }
.slot:focus-visible { outline: none; box-shadow: var(--ring); }
.slot.usual { border-color: var(--c-gold); background: var(--c-warn-bg); }
.slot.on, .slot.usual.on { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }
.slot-empty { grid-column: 1 / -1; padding: 10px; text-align: center; font-size: var(--t-small); color: var(--c-muted); }
.slot-advice { margin-top: 10px; font-size: var(--t-micro); line-height: 1.5; color: var(--c-muted); }

.price-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: var(--t-small); color: var(--c-muted); }
.price-row.total {
    margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--c-line);
    font-size: 1.3125rem; font-weight: 600; letter-spacing: 0.011em; color: var(--c-ink);
}
.protect-note { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--c-bg-alt); font-size: var(--t-small); line-height: 1.43; color: var(--c-ink-2); }
.protect-note b { color: var(--c-ink); }
.protect-note b i, .protect-note b .et-i { color: var(--c-bronze); }

/* --- forms ----------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.f-field label { display: block; margin-bottom: 8px; font-size: var(--t-small); font-weight: 600; letter-spacing: -0.01em; color: var(--c-ink); }
.f-field textarea { min-height: 110px; resize: vertical; }

/* --- steps and notices ----------------------------------------------------------- */
.step-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 28px 0; }
.step-cell { padding: 22px 18px; border-radius: var(--r-md); background: var(--c-bg-alt); text-align: center; }
.step-cell .n { display: inline-grid; place-items: center; width: 34px; height: 34px; padding-top: 3px; border-radius: 999px; background: var(--c-ink); color: #fff; font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.step-cell .t { margin-top: 10px; font-size: var(--t-small); font-weight: 600; color: var(--c-ink); }

.notice { margin: 18px 0; padding: 14px 18px; border-radius: var(--r-sm); font-size: var(--t-small); line-height: 1.5; border: 0; }
.notice-green { background: var(--c-success-bg); color: #155a38; }
.notice-blue { background: var(--c-bg-alt); color: var(--c-ink); }
.notice-warn { background: var(--c-warn-bg); color: #5c4417; }

/* --- package cards --------------------------------------------------------------- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.pkg-card {
    display: flex; flex-direction: column; gap: 12px; padding: clamp(24px, 2.6vw, 32px);
    background: var(--c-bg); border-radius: var(--r-md); box-shadow: var(--sh-1);
    transition: box-shadow 260ms var(--et-ease-glide, var(--ease));
}
.pkg-card:hover { box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.55), var(--sh-2); }
.pkg-card .p-ico { display: grid; place-items: center; width: 48px; height: 48px; padding-top: 3px; border-radius: 999px; background: var(--c-espresso); color: #fff; font-size: 1.3rem; }
.pkg-card h3 { font-size: 1.5rem; color: var(--c-ink); }
.pkg-card p { flex: 1; font-size: var(--t-body); color: var(--c-muted); }

/* --- chat ---------------------------------------------------------------------- */
.chat-box { display: flex; flex-direction: column; gap: 9px; max-height: 340px; overflow-y: auto; padding: 6px 2px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: var(--t-small); line-height: 1.45; }
.msg.me { align-self: flex-end; background: var(--c-ink); color: var(--c-bg); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--c-bg-alt); color: var(--c-ink); border-bottom-left-radius: 6px; }
.msg small { display: block; margin-top: 3px; font-size: var(--t-micro); opacity: 0.75; }

/* --- misc ---------------------------------------------------------------------- */
.stat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.toast-inline { display: none; margin-top: 12px; padding: 12px 16px; border-radius: var(--r-sm); font-size: var(--t-small); font-weight: 600; }
.toast-inline.ok { display: block; background: var(--c-success-bg); color: #155a38; }
.toast-inline.err { display: block; background: var(--c-danger-bg); color: #8f1a12; }
.sect-h { margin: 32px 0 14px; font-size: 1.5rem; font-weight: 600; color: var(--c-ink); }

/* --- page cover photo ---------------------------------------------------------
   The wide banner at the top of the information pages. Every image in
   cover photograph is pre-cropped to 1600x700 (the -wide cuts in static/images/photos), so this only picks a
   height and keeps the crop centred. Above the fold, so never lazy. */
.hb-cover {
    display: block; width: 100%; height: clamp(180px, 28vw, 360px);
    margin: 0 0 28px; object-fit: cover;
    border-radius: var(--r-xl); background: var(--c-bg-alt);
}

/* --- safety: what we can actually help with -------------------------------------
   A plain list on purpose: the page above it has just told somebody to call
   an ambulance; this is the calm part. */
.safe-help { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.safe-help li { position: relative; padding-left: 30px; font-size: var(--t-body); line-height: 1.5; color: var(--c-ink); }
.safe-help li::before {
    content: ""; position: absolute; left: 2px; top: 4px;
    width: 16px; height: 16px;
    background: var(--c-gold);
    -webkit-mask: var(--et-i-check) center / contain no-repeat;
    mask: var(--et-i-check) center / contain no-repeat;
}

/* Shared with marketplace.css: the positioning line, quiet by design. */
.scope-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: var(--t-micro); line-height: 1.5; color: var(--c-muted); }
.scope-note i, .scope-note .et-i { flex: none; margin-top: 2px; opacity: 0.75; }
