/* Shore Pass — design-parity styles
   Translated 1:1 from the prototype (Shore Pass Design/screens-home.jsx +
   app-styles.css). Tokens already live in app.css; this file adds the
   primitives that were missing and the home/port screen structure.

   Class prefix `dh-` = design home. Used by both the global home screen and
   the port-scoped home (same layout, one port's data). */

/* ──────────────── Missing design primitives ──────────────── */
.sp-mono { font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums; }

/* icon() called with an empty class emits <svg class=""> with no intrinsic size —
   give every icon inside a design container a sane default so none can balloon. */
.dh-screen svg:not([class]), .dh-screen svg[class=""] { width: 16px; height: 16px; flex: 0 0 auto; }
.sp-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.sp-section-bar {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--sp-font-display);
    text-transform: uppercase;
    color: var(--sp-red);
    font-weight: 600; font-size: 14px; letter-spacing: .06em;
}
.sp-section-bar__serial {
    margin-left: auto; font-family: var(--sp-font-mono);
    font-size: 10px; color: var(--sp-slate-2); letter-spacing: .1em;
}

.sp-authority {
    background: var(--sp-red); color: #fff;
    padding: 10px 14px;
    border-radius: var(--sp-r-md) var(--sp-r-md) 0 0;
    font-family: var(--sp-font-display);
    text-transform: uppercase; letter-spacing: .08em;
    font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
    position: relative;
}

.sp-datestamp {
    position: absolute; top: 12px; right: 12px;
    border: 2px solid #fff; color: #fff;
    background: rgba(211, 32, 39, .85);
    padding: 6px 10px; border-radius: 6px;
    font-family: var(--sp-font-display);
    text-transform: uppercase; letter-spacing: .1em;
    font-size: 10px; font-weight: 600;
    transform: rotate(-4deg); text-align: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.sp-datestamp__big { display: block; font-size: 14px; letter-spacing: .06em; }

.sp-ticket {
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-r-lg);
    position: relative; overflow: hidden;
}
.sp-ticket::before, .sp-ticket::after {
    content: ''; position: absolute;
    width: 16px; height: 16px;
    background: var(--sp-bg);
    border: 1px solid var(--sp-line);
    border-radius: 50%;
    top: 50%; transform: translateY(-50%);
}
.sp-ticket::before { left: -9px; }
.sp-ticket::after  { right: -9px; }

/* ──────────────── 1. HERO ──────────────── */
.dh-hero { display: flex; align-items: flex-start; gap: 16px; padding: 18px 16px 16px; }

.dh-pass {
    flex: 0 0 auto; width: 142px;
    border-radius: 12px; padding: 12px 10px;
    background: var(--sp-surface);
    border: 3px solid var(--sp-red);
    box-shadow: inset 0 0 0 3px var(--sp-surface), inset 0 0 0 4.5px var(--sp-red);
    text-align: center; color: var(--sp-red);
    font-family: var(--sp-font-display); text-transform: uppercase;
}
.dh-pass__my    { font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.dh-pass__name  { font-size: 26px; font-weight: 700; line-height: .9; margin: 4px 0 2px; letter-spacing: -.01em; }
.dh-pass__rule  {
    font-size: 8px; font-weight: 700; letter-spacing: .14em;
    border-top: 1.5px solid var(--sp-red); border-bottom: 1.5px solid var(--sp-red);
    padding: 2px 0; margin: 6px 0;
}
.dh-pass__grant { font-size: 10px; font-weight: 700; letter-spacing: .06em; line-height: 1.3; }
.dh-pass__check {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2.5px solid var(--sp-red);
    display: grid; place-items: center; margin: 8px auto 0;
}
.dh-pass__check svg { width: 14px; height: 14px; stroke-width: 2.8; }

.dh-intro { flex: 1; min-width: 0; padding-top: 6px; }
.dh-intro__eyebrow {
    font-family: var(--sp-font-display); font-size: 11px; font-weight: 700;
    color: var(--sp-slate); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 4px;
}
.dh-intro__hey {
    font-family: var(--sp-font-display); font-size: 26px; font-weight: 700;
    color: var(--sp-red); line-height: 1; margin: 0 0 6px;
}
.dh-intro__kicker {
    font-family: var(--sp-font-display); font-size: 19px; font-weight: 700;
    color: var(--sp-red); letter-spacing: .04em; margin: 0;
}
.dh-intro__title {
    font-family: var(--sp-font-display); font-size: 18px; font-weight: 600;
    color: var(--sp-ink); margin: 3px 0 0;
}
.dh-intro__body { font-size: 12.5px; color: var(--sp-slate); margin: 8px 0 0; line-height: 1.55; }
.dh-intro__portline { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dh-intro__flag { font-size: 18px; }
.dh-intro__portname { font-family: var(--sp-font-display); font-size: 16px; font-weight: 700; color: var(--sp-ink); }
.dh-intro__sub { font-size: 12px; color: var(--sp-slate); line-height: 1.45; margin: 0; }
.dh-intro__discover {
    font-family: var(--sp-font-display); font-size: 22px; font-weight: 700;
    color: var(--sp-red); line-height: 1.05; margin: 0 0 6px;
}

.dh-cta {
    margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 10px;
    background: var(--sp-red); border: none; color: #fff;
    font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.dh-cta:hover { background: var(--sp-red-deep); }
.dh-cta--ghost {
    padding: 7px 12px; border-radius: 9px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    color: var(--sp-slate); font-size: 12px;
}
.dh-cta--ghost:hover { background: var(--sp-bg-2); }
.dh-cta svg { width: 13px; height: 13px; }

/* ──────────────── 2. NAV ROW ──────────────── */
.dh-nav { display: flex; gap: 8px; padding: 0 16px 16px; }
.dh-nav__btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 10px 4px; border-radius: 10px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    color: var(--sp-ink); font-size: 12px; font-weight: 600;
    cursor: pointer; text-decoration: none;
}
.dh-nav__btn:hover { border-color: var(--sp-red); }
.dh-nav__btn--blue { color: var(--sp-blue); }
.dh-nav__btn svg { width: 14px; height: 14px; }

/* ──────────────── 3. SEARCH ──────────────── */
.dh-search {
    display: flex; align-items: center; gap: 12px;
    width: calc(100% - 32px); margin: 0 16px 16px;
    padding: 14px 16px; border-radius: 14px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    cursor: pointer; text-align: left; text-decoration: none;
}
.dh-search svg { width: 20px; height: 20px; color: var(--sp-slate); flex: 0 0 auto; }
.dh-search span { font-size: 15px; color: var(--sp-slate); font-weight: 500; }
.dh-search input {
    flex: 1; border: none; background: none; outline: none;
    font: 500 15px/1 var(--sp-font-body); color: var(--sp-ink); min-width: 0;
}
.dh-search input::placeholder { color: var(--sp-slate); }

/* ──────────────── 4. SPONSORED ──────────────── */
.dh-sponsor { margin: 0 16px 16px; }

/* One ad → a single full-width card (the design). Several → the same card in a
   scroll-snap track driven by the data-ad-* handlers in assets/js/app.js. */
.dh-sponsor__track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
.dh-sponsor__box {
    flex: 0 0 100%; scroll-snap-align: start;
    padding: 14px 16px; border-radius: 14px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    overflow: hidden; position: relative; display: block; text-decoration: none;
}
.dh-sponsor__flag {
    display: block; font-size: 9px; font-weight: 700; color: var(--sp-slate-2);
    letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px;
}
.dh-sponsor__row { display: flex; align-items: center; gap: 14px; }
.dh-sponsor__txt { flex: 1; min-width: 0; }
.dh-sponsor__brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.dh-sponsor__mark {
    width: 36px; height: 36px; border-radius: 8px; background: #1A3A6A;
    display: grid; place-items: center; overflow: hidden; flex: 0 0 auto;
}
.dh-sponsor__mark svg, .dh-sponsor__markico { width: 18px; height: 18px; color: #fff; }
.dh-sponsor__mark img { width: 100%; height: 100%; object-fit: cover; }
.dh-sponsor__dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dh-sponsor__dot {
    width: 7px; height: 7px; border-radius: 999px; padding: 0;
    background: var(--sp-line); border: none; cursor: pointer; transition: all 200ms ease;
}
.dh-sponsor__dot.is-on { width: 18px; background: var(--sp-red); }
.dh-sponsor__title { font-size: 13px; font-weight: 700; color: var(--sp-ink); line-height: 1.25; }
.dh-sponsor__meta { font-size: 11px; color: var(--sp-slate); margin-top: 4px; }

/* ──────────────── 5. COMMUNITY CARDS ──────────────── */
.dh-comm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 18px; }
.dh-comm__card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 16px 6px 14px; border-radius: 14px; gap: 8px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    cursor: pointer; text-decoration: none;
}
.dh-comm__card:hover { border-color: var(--sp-red); }
.dh-comm__orb {
    width: 50px; height: 50px; border-radius: 50%;
    display: grid; place-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
}
.dh-comm__orb svg { width: 23px; height: 23px; color: #fff; stroke-width: 1.6; }
.dh-comm__orb--cc     { background: radial-gradient(circle at 35% 30%, #5BC5DA 0%, #1A5B70 100%); }
.dh-comm__orb--sl     { background: radial-gradient(circle at 35% 30%, #4A9EE0 0%, #1A3A7A 100%); }
.dh-comm__orb--family { background: radial-gradient(circle at 35% 30%, #5CD47A 0%, #156A2A 100%); }
.dh-comm__label {
    font-family: var(--sp-font-display); font-size: 12px; font-weight: 700;
    color: var(--sp-ink); letter-spacing: .01em; white-space: pre-line; line-height: 1.2;
    text-transform: uppercase;   /* prototype: 'CREW CHANGE', 'SHORE LEAVE', 'FAMILY\nONBOARD' */
}
.dh-comm__sub { font-size: 10.5px; color: var(--sp-slate); line-height: 1.3; white-space: pre-line; }

/* ──────────────── 6/7. HORIZONTAL SHELVES ──────────────── */
.dh-shelf { margin-bottom: 18px; }
.dh-shelf__head { display: flex; align-items: center; padding: 0 16px 12px; }
.dh-shelf__dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--sp-red);
    box-shadow: 0 0 6px var(--sp-red); margin-right: 8px; flex: 0 0 auto;
}
/* The prototype writes these headings as literal caps ("LIVE FROM SEAFARERS").
   Uppercasing in CSS keeps the PHP readable and the rendering identical. */
.dh-shelf__title {
    font-family: var(--sp-font-display); font-size: 14px; font-weight: 700;
    color: var(--sp-ink); letter-spacing: .06em; flex: 1; margin: 0;
    text-transform: uppercase;
}
.dh-shelf__link {
    background: none; border: none; color: var(--sp-blue);
    font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.dh-rail { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px; }

.dh-photo { flex: 0 0 148px; cursor: pointer; border: none; padding: 0; background: none; text-decoration: none; display: block; }
.dh-photo__img { display: block; height: 132px; border-radius: 12px; overflow: hidden; background: var(--sp-line); }
.dh-photo__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dh-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dh-dots span {
    width: 7px; height: 7px; border-radius: 999px;
    background: var(--sp-line); transition: all 200ms ease; display: inline-block;
}
.dh-dots span.is-on { width: 18px; background: var(--sp-red); }

.dh-port { flex: 0 0 130px; cursor: pointer; text-align: center; border: none; background: none; padding: 0; text-decoration: none; display: block; }
.dh-port__img { display: block; height: 118px; border-radius: 12px; overflow: hidden; background: var(--sp-line); position: relative; }
.dh-port__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dh-port__fallback {
    width: 100%; height: 100%; display: grid; place-items: center;
    font-size: 34px; background: linear-gradient(135deg, var(--sp-red-soft), var(--sp-blue-soft));
}
.dh-port__name {
    display: block; font-size: 13.5px; font-weight: 700; color: var(--sp-ink); margin-top: 7px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dh-port__country {
    display: block; font-size: 11.5px; color: var(--sp-slate); margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ──────────────── 8. IMPORTANT UPDATES ──────────────── */
.dh-update {
    display: flex; align-items: center; gap: 14px;
    width: calc(100% - 32px); margin: 0 16px 16px;
    padding: 14px 16px; border-radius: 14px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    cursor: pointer; text-align: left; text-decoration: none;
}
.dh-update__orb {
    width: 46px; height: 46px; border-radius: 50%; background: var(--sp-blue);
    display: grid; place-items: center; flex: 0 0 auto;
}
.dh-update__orb svg { width: 22px; height: 22px; color: #fff; stroke-width: 1.8; }
.dh-update__body { flex: 1; min-width: 0; }
.dh-update__title { display: block; font-size: 12.5px; font-weight: 700; color: var(--sp-ink); }
.dh-update__sub { display: block; font-size: 11.5px; color: var(--sp-slate); margin-top: 3px; line-height: 1.35; }
.dh-update__aside { flex: 0 0 auto; text-align: right; }
.dh-update__date { display: block; font-size: 11px; font-weight: 700; color: var(--sp-blue); white-space: nowrap; margin-bottom: 3px; }
.dh-update__note { display: block; font-size: 11px; color: var(--sp-slate); max-width: 96px; line-height: 1.25; }
.dh-update__chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--sp-slate); }

/* ──────────────── Port-scoped extras ──────────────── */
.dh-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 18px; }
.dh-stat__cell {
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: 12px; padding: 12px 8px; text-align: center;
}
.dh-stat__n { font-family: var(--sp-font-display); font-size: 20px; font-weight: 700; color: var(--sp-ink); line-height: 1; }
.dh-stat__l { font-size: 10px; color: var(--sp-slate); margin-top: 4px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

/* Port clearance card — PortPassportCard */
.dh-pcard { margin: 0 16px 18px; border-radius: var(--sp-r-lg); overflow: hidden; background: var(--sp-surface); border: 1px solid var(--sp-line); box-shadow: var(--sp-shadow-1); }
.dh-pcard__bar {
    background: var(--sp-red); color: #fff; padding: 8px 14px;
    display: flex; align-items: center; gap: 8px;
}
.dh-pcard__bar svg { width: 14px; height: 14px; color: #fff; }
.dh-pcard__bar b {
    font-family: var(--sp-font-display); font-size: 12px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
}
.dh-pcard__serial { margin-left: auto; font-family: var(--sp-font-mono); font-size: 10px; opacity: .85; }
.dh-pcard__grid { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.dh-pcard__f--full { grid-column: 1 / -1; }
.dh-pcard__k {
    font-family: var(--sp-font-display); font-size: 9px; font-weight: 600;
    letter-spacing: .16em; color: var(--sp-slate-2); text-transform: uppercase;
}
.dh-pcard__v { font-size: 13px; color: var(--sp-ink); font-weight: 600; margin-top: 2px; }
.dh-pcard__actions { display: flex; gap: 8px; padding: 0 14px 14px; }

/* Empty state */
.dh-empty {
    margin: 0 16px 18px; padding: 22px 16px; text-align: center;
    background: var(--sp-surface); border: 1px dashed var(--sp-line);
    border-radius: 14px; color: var(--sp-slate); font-size: 12.5px;
}
.dh-empty b { display: block; color: var(--sp-ink); font-size: 13.5px; margin-bottom: 4px; }

/* ──────────────── Transport screen — screens-v2.jsx › TransportScreenV2 ────────────────
   Local-transport comparison rows: brand badge · name + tag · via · time/cost.
   The per-row brand colour arrives from the DB, so it is passed in as --dh-tr-color. */
.dh-trlist { display: flex; flex-direction: column; gap: 8px; }
.dh-tr {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 14px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
}
.dh-tr__badge {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
    background: var(--dh-tr-color, var(--sp-blue)); color: #fff;
    display: grid; place-items: center;
    font-family: var(--sp-font-display); font-size: 18px; font-weight: 700;
    letter-spacing: -.02em; line-height: 1;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.dh-tr__body { flex: 1; min-width: 0; }
.dh-tr__top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dh-tr__name { font-size: 13px; font-weight: 700; color: var(--sp-ink); }
.dh-tr__tag {
    font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    padding: 2px 5px; border-radius: 3px;
    background: var(--sp-line-2); color: var(--sp-slate);
}
.dh-tr__tag--green { background: var(--sp-green-soft); color: var(--sp-green); }
.dh-tr__tag--amber { background: var(--sp-amber-soft); color: var(--sp-amber); }
.dh-tr__tag--blue  { background: var(--sp-blue-soft);  color: var(--sp-blue); }
.dh-tr__via {
    display: flex; align-items: center; gap: 5px;
    margin-top: 3px; font-size: 11px; color: var(--sp-slate); line-height: 1.35;
}
.dh-tr__ico { width: 12px; height: 12px; flex: 0 0 auto; color: var(--dh-tr-color, var(--sp-slate)); }
.dh-tr__aside { flex: 0 0 auto; text-align: right; }
.dh-tr__time, .dh-tr__cost {
    display: block; white-space: nowrap;
    font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums;
}
.dh-tr__time { font-size: 13px; font-weight: 700; color: var(--sp-ink); }
.dh-tr__cost { font-size: 10px; color: var(--sp-slate); margin-top: 2px; }

/* ──────────────── eSIM screen — screens-home.jsx › ESimList ────────────────
   Ticket-stub cards: brand chip + dashed perforation + data allowance. */
.dh-esim-note {
    display: flex; align-items: flex-start; gap: 12px;
    margin: 0 16px 16px; padding: 14px 16px; border-radius: 14px;
    background: var(--sp-red-tint); border: 1px solid var(--sp-red-soft);
}
.dh-esim-note__ico { width: 20px; height: 20px; color: var(--sp-red); flex: 0 0 auto; }
.dh-esim-note b {
    display: block; font-family: var(--sp-font-display);
    font-size: 12px; font-weight: 700; color: var(--sp-red);
    letter-spacing: .06em; text-transform: uppercase;
}
.dh-esim-note p { margin: 4px 0 0; font-size: 12px; color: var(--sp-ink-2); line-height: 1.5; }

.dh-esim-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px; padding: 0 16px 18px;
}
.dh-esim {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px 16px; text-align: left; text-decoration: none;
}
a.dh-esim:hover { border-color: var(--sp-red); }
.dh-esim__top { display: flex; align-items: center; gap: 8px; }
.dh-esim__mark {
    width: 28px; height: 28px; border-radius: 6px; flex: 0 0 auto;
    display: grid; place-items: center; color: #fff;
    font-family: var(--sp-font-display); font-weight: 700; font-size: 14px;
}
.dh-esim__brand {
    flex: 1; min-width: 0; font-size: 13px; font-weight: 700;
    color: var(--sp-ink); line-height: 1.1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dh-esim__tag {
    flex: 0 0 auto; font-size: 8px; font-weight: 700; letter-spacing: .05em;
    padding: 2px 5px; border-radius: 4px; text-transform: uppercase;
    background: var(--sp-red-soft); color: var(--sp-red);
}
.dh-esim__plan { border-top: 1px dashed var(--sp-line); padding-top: 10px; }
.dh-esim__data {
    font-family: var(--sp-font-display); font-size: 22px; font-weight: 600;
    color: var(--sp-ink); line-height: 1;
}
.dh-esim__terms { font-size: 11px; color: var(--sp-slate); margin-top: 2px; }
.dh-esim__rate { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--sp-slate); }
.dh-esim__rate b { color: var(--sp-ink); font-weight: 700; }
.dh-esim__star { width: 12px; height: 12px; color: var(--sp-amber); flex: 0 0 auto; }

.dh-esim-picker { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 18px; }
.dh-esim-picker__chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 999px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    color: var(--sp-ink); font-size: 12.5px; font-weight: 700; text-decoration: none;
}
.dh-esim-picker__chip:hover { border-color: var(--sp-red); }
.dh-esim-picker__chip.is-on { border-color: var(--sp-red); color: var(--sp-red); }
.dh-esim-picker__chip span { font-weight: 500; color: var(--sp-slate); }

.dh-esim-foot { margin: 0 16px 22px; font-size: 11px; color: var(--sp-slate-2); text-align: center; line-height: 1.5; }

/* ──────────────── Currency & ATMs — widgets.jsx › CurrencyBoard + CurrencyNearby ────────────────
   Dark terminal board carrying the existing converter, then the nearby list.
   The board sits on the navy tokens, so its inner text is white-on-dark by design. */
.dh-board {
    margin: 0 16px 14px; border-radius: var(--sp-r-lg); overflow: hidden;
    background: linear-gradient(180deg, var(--sp-navy) 0%, var(--sp-navy-2) 100%);
    border: 1px solid var(--sp-navy-line);
}
.dh-board__head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-family: var(--sp-font-display); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .14em; color: #fff;
}
.dh-board__dot {
    width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
    background: var(--sp-green); box-shadow: 0 0 6px var(--sp-green);
}
.dh-board__clock {
    margin-left: auto; font-family: var(--sp-font-mono); font-weight: 400;
    font-size: 10px; letter-spacing: .06em; color: rgba(255, 255, 255, .55);
}
.dh-board__body { padding: 14px; }
.dh-board__pair {
    font-family: var(--sp-font-display); font-size: 13px; font-weight: 600;
    letter-spacing: .08em; color: rgba(255, 255, 255, .7);
}
.dh-board__rate {
    margin: 4px 0 14px; min-height: 30px; line-height: 1;
    font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: #fff;
}
.dh-board__note { margin: 10px 0 0; font-size: 11px; color: rgba(255, 255, 255, .5); }
.dh-board .sp-fx__swap { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: #fff; }
.dh-board .sp-fx__swap:hover { background: rgba(255, 255, 255, .14); }
.dh-board__foot {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: rgba(0, 0, 0, .25); text-decoration: none;
    font-family: var(--sp-font-display); font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7);
}
.dh-board__foot span { display: inline-flex; align-items: center; gap: 4px; }
.dh-board__fico { width: 13px; height: 13px; color: var(--sp-red); flex: 0 0 auto; }
.dh-board__sep { opacity: .5; }
.dh-board__chev { width: 14px; height: 14px; margin-left: auto; color: rgba(255, 255, 255, .5); flex: 0 0 auto; }

.dh-xnote {
    display: flex; align-items: center; gap: 6px;
    margin: 0 16px 10px; font-size: 11px; color: var(--sp-slate);
}
.dh-xnote__ico { width: 12px; height: 12px; color: var(--sp-slate); flex: 0 0 auto; }

.dh-xch {
    margin: 0 16px 18px; border-radius: var(--sp-r-lg); overflow: hidden;
    background: var(--sp-surface); border: 1px solid var(--sp-line); box-shadow: var(--sp-shadow-1);
}
/* CSS-only kind filter: the radios stay focusable but out of the layout. */
.dh-xch__radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dh-xch__tabs { display: flex; gap: 6px; padding: 10px 12px; }
.dh-xch__tab {
    padding: 6px 12px; border-radius: 999px; cursor: pointer;
    font-size: 11px; font-weight: 700; color: var(--sp-slate);
    background: var(--sp-bg-2); border: 1px solid var(--sp-line);
}
.dh-xch__tab span { opacity: .7; margin-left: 3px; }
#fxKindAll:checked  ~ .dh-xch__tabs [for="fxKindAll"],
#fxKindEx:checked   ~ .dh-xch__tabs [for="fxKindEx"],
#fxKindAtm:checked  ~ .dh-xch__tabs [for="fxKindAtm"] {
    background: var(--sp-red); border-color: var(--sp-red); color: #fff;
}
#fxKindAll:focus-visible  ~ .dh-xch__tabs [for="fxKindAll"],
#fxKindEx:focus-visible   ~ .dh-xch__tabs [for="fxKindEx"],
#fxKindAtm:focus-visible  ~ .dh-xch__tabs [for="fxKindAtm"] { outline: 2px solid var(--sp-red); outline-offset: 2px; }
#fxKindEx:checked  ~ .dh-xch__list .dh-xrow--atm,
#fxKindAtm:checked ~ .dh-xch__list .dh-xrow--ex { display: none; }

/* Every row carries the divider, so filtering can never strand a stray rule. */
.dh-xrow {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; text-decoration: none;
    border-top: 1px solid var(--sp-line-2);
}
.dh-xrow:hover { background: var(--sp-bg-2); }
/* No tab bar (single kind) → the list is the card's first child, so drop the leading rule. */
.dh-xch__list:first-child .dh-xrow:first-child { border-top: none; }
.dh-xrow__ico {
    width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--sp-red-soft); color: var(--sp-red);
}
.dh-xrow__ico--atm { background: var(--sp-blue-soft); color: var(--sp-blue); }
/* Specificity has to match the .dh-screen svg[class=""] fallback to beat it. */
.dh-screen .dh-xrow__ico svg { width: 20px; height: 20px; }
.dh-xrow__body { flex: 1; min-width: 0; }
.dh-xrow__top { display: flex; align-items: center; gap: 6px; }
.dh-xrow__name {
    flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--sp-ink); line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dh-xrow__pill {
    flex: 0 0 auto; font-size: 8px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; padding: 2px 5px; border-radius: 3px;
    background: var(--sp-amber-soft); color: var(--sp-amber);
}
.dh-xrow__meta {
    display: flex; align-items: center; gap: 6px; margin-top: 2px;
    font-size: 11px; color: var(--sp-slate);
}
.dh-xrow__meta > span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.dh-xrow__mico { width: 10px; height: 10px; color: var(--sp-slate); flex: 0 0 auto; }
.dh-xrow__sep { color: var(--sp-slate-2); }
.dh-xrow__km { font-weight: 600; color: var(--sp-ink-2); }
.dh-xrow__hours {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
    font-size: 10px; font-weight: 700; color: var(--sp-green);
}
.dh-xrow__hours span { width: 6px; height: 6px; border-radius: 50%; background: var(--sp-green); flex: 0 0 auto; }
.dh-xrow__hours.is-shut { color: var(--sp-red); }
.dh-xrow__hours.is-shut span { background: var(--sp-red); }
.dh-xrow__aside { flex: 0 0 auto; text-align: right; }
.dh-xrow__rate { display: block; font-size: 13px; font-weight: 700; color: var(--sp-ink); }
.dh-xrow__fee {
    display: block; font-family: var(--sp-font-display);
    font-size: 13px; font-weight: 600; color: var(--sp-ink);
}
.dh-xrow__fee.is-free { color: var(--sp-green); }
.dh-xrow__lbl {
    display: block; margin-top: 2px; font-size: 9px; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase; color: var(--sp-slate-2);
}
.dh-xrow__chev { width: 14px; height: 14px; color: var(--sp-slate-2); flex: 0 0 auto; }

/* Desktop: the prototype is a 412px phone; widen gracefully without changing the design language */
@media (min-width: 720px) {
    .dh-comm { grid-template-columns: repeat(3, 1fr); }
    .dh-photo { flex-basis: 190px; }
    .dh-photo__img { height: 160px; }
    .dh-port { flex-basis: 165px; }
    .dh-port__img { height: 140px; }
}

/* ════════════ CREW CHANGE DETAIL SCREENS ════════════
   Hotel Experience + Agent Review — screens-cc-hk.jsx › CCHotels / CCAgents. */

/* ──────────────── Detail header (HKHeader) ──────────────── */
.dh-dhead {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px 12px;
    background: var(--sp-surface); border-bottom: 1px solid var(--sp-line);
}
.dh-dhead__back {
    flex: 0 0 auto; width: 36px; height: 36px; margin-top: 4px;
    display: grid; place-items: center;
    background: var(--sp-bg); border: 1px solid var(--sp-line); border-radius: 10px;
    color: var(--sp-ink);
}
.dh-dhead__back:hover { border-color: var(--sp-red); }
.dh-dhead__backico { width: 18px; height: 18px; transform: rotate(180deg); }
.dh-dhead__body { flex: 1; min-width: 0; padding-top: 2px; }
.dh-dhead__kicker {
    margin: 0; font-family: var(--sp-font-display);
    font-size: 13px; font-weight: 700; letter-spacing: .06em; line-height: 1;
    color: var(--sp-ink);
}
.dh-dhead__kicker b { color: var(--sp-red); font-weight: 700; }
.dh-dhead__title {
    font-family: var(--sp-font-display); font-size: 24px; font-weight: 600;
    color: var(--sp-ink); line-height: 1.05; margin: 5px 0 0;
}
.dh-dhead__sub { margin: 5px 0 0; font-size: 12.5px; color: var(--sp-slate); line-height: 1.35; }
.dh-dhead__alt {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
    padding: 8px 11px; border-radius: 999px;
    background: var(--sp-red-soft); color: var(--sp-red);
    font-size: 11.5px; font-weight: 700;
}
.dh-dhead__altico { width: 14px; height: 14px; }

/* ──────────────── Shared list furniture ──────────────── */
.dh-seclabel {
    margin: 16px 16px 12px; font-family: var(--sp-font-display);
    font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--sp-ink);
}
.dh-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }

.dh-stars { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.dh-stars__s { width: 12px; height: 12px; color: var(--sp-amber); }
.dh-stars__s.is-off { color: var(--sp-line); }

.dh-rate { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.dh-rate__n { font-size: 12.5px; font-weight: 700; color: var(--sp-amber); }
.dh-rate__c { font-size: 11px; color: var(--sp-slate-2); }

.dh-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.dh-pill {
    padding: 4px 9px; border-radius: 999px;
    background: var(--sp-red-soft); color: var(--sp-red);
    font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}

.dh-note {
    margin: 0; padding: 10px 14px; border-top: 1px solid var(--sp-line-2);
    background: var(--sp-bg); font-size: 12.5px; color: var(--sp-slate); line-height: 1.45;
}

/* ──────────────── Hotel card ──────────────── */
.dh-hotel {
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: 14px; overflow: hidden; box-shadow: var(--sp-shadow-1);
}
.dh-hotel__top { display: flex; gap: 12px; padding: 12px 14px 10px; }
.dh-hotel__thumb {
    flex: 0 0 auto; width: 74px; height: 74px; border-radius: 10px; overflow: hidden;
    background: var(--sp-line-2); display: block;
}
.dh-hotel__thumb img { width: 100%; height: 100%; object-fit: cover; }
.dh-hotel__fallback {
    width: 100%; height: 100%; display: grid; place-items: center;
    background: var(--sp-red-soft);
}
.dh-hotel__fallico { width: 26px; height: 26px; color: var(--sp-red); }
.dh-hotel__body { flex: 1; min-width: 0; }
.dh-hotel__name {
    font-family: var(--sp-font-body); font-size: 14px; font-weight: 700;
    color: var(--sp-ink); line-height: 1.25; margin: 0;
}
.dh-hotel__where { margin: 3px 0 6px; font-size: 11.5px; color: var(--sp-slate); line-height: 1.35; }
.dh-hotel__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dh-hotel__price {
    margin-left: auto; font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums;
    font-size: 13px; font-weight: 700; color: var(--sp-ink); white-space: nowrap;
}
.dh-hotel__price small { font-size: 10px; font-weight: 500; color: var(--sp-slate-2); }

/* Four sub-scores as small labelled bars */
.dh-scores {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px;
    padding: 0 14px 12px;
}
.dh-score { display: flex; align-items: center; gap: 7px; }
.dh-score__k { flex: 0 0 46px; font-size: 10.5px; font-weight: 600; color: var(--sp-slate); }
.dh-score__bar {
    flex: 1; height: 5px; border-radius: 999px; background: var(--sp-line-2); overflow: hidden;
}
.dh-score__fill { display: block; height: 100%; border-radius: 999px; background: var(--sp-green); }
.dh-score__v {
    flex: 0 0 auto; font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums;
    font-size: 10.5px; font-weight: 700; color: var(--sp-ink-2);
}

.dh-perks { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.dh-perk {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 9px; border-radius: 8px;
    background: var(--sp-green-soft); color: var(--sp-green);
    font-size: 11px; font-weight: 700;
}
.dh-perk__ico { width: 13px; height: 13px; }

/* ──────────────── Agent card ──────────────── */
.dh-agent {
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    border-radius: 14px; overflow: hidden; box-shadow: var(--sp-shadow-1);
}
.dh-agent__top { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 10px; }
.dh-agent__av {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-red-soft); color: var(--sp-red);
    font-family: var(--sp-font-display); font-size: 14px; font-weight: 700;
}
.dh-agent__id { flex: 1; min-width: 0; }
.dh-agent__name {
    font-family: var(--sp-font-body); font-size: 14px; font-weight: 700;
    color: var(--sp-ink); line-height: 1.3; margin: 0;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.dh-agent__tag {
    padding: 2px 6px; border-radius: 4px;
    background: var(--sp-red); color: #fff;
    font-size: 9px; font-weight: 700; letter-spacing: .06em;
}
.dh-agent__meta {
    display: flex; align-items: center; gap: 5px; margin: 4px 0 0;
    font-size: 11.5px; color: var(--sp-slate);
}
.dh-agent__metak {
    font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--sp-slate-2);
}
.dh-agent__score { flex: 0 0 auto; text-align: right; }
.dh-agent__score b {
    display: block; font-family: var(--sp-font-display); font-size: 22px; font-weight: 700;
    color: var(--sp-amber); line-height: 1;
}
.dh-agent__score .dh-stars { margin-top: 4px; }
.dh-agent__score small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--sp-slate-2); }
.dh-agent__quote {
    margin: 0; padding: 10px 14px 0; border-top: 1px solid var(--sp-line-2);
    font-size: 12.5px; color: var(--sp-ink-2); line-height: 1.5;
}
.dh-agent__by { margin: 6px 0 0; padding: 0 14px 12px; font-size: 11px; font-weight: 700; color: var(--sp-slate-2); }
.dh-agent__quote:last-child { padding-bottom: 12px; }

/* ──────────────── Share CTA ──────────────── */
.dh-share {
    display: flex; align-items: center; gap: 14px;
    margin: 4px 16px 22px; padding: 14px 16px;
    background: var(--sp-surface); border: 1.5px dashed var(--sp-red); border-radius: 14px;
}
.dh-share:hover { background: var(--sp-red-tint); }
.dh-share__orb {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; background: var(--sp-red-soft); color: var(--sp-red);
}
.dh-share__orb svg { width: 19px; height: 19px; }
.dh-share__body { flex: 1; min-width: 0; }
.dh-share__title { display: block; font-size: 14px; font-weight: 700; color: var(--sp-ink); }
.dh-share__sub { display: block; margin-top: 2px; font-size: 12px; color: var(--sp-slate); }
.dh-share__chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--sp-slate-2); }

@media (min-width: 720px) {
    .dh-scores { grid-template-columns: repeat(4, 1fr); }
    .dh-score__k { flex-basis: 42px; }
}

/* ──────────────── Emergency numbers (screens-settings.jsx › EmergencyScreen) ──────────────── */
.dh-em__intro { padding: 0 16px 12px; font-size: 13px; color: var(--sp-slate); line-height: 1.45; margin: 14px 0 0; }
.dh-em__pills { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 14px; }
.dh-em__pill {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px; white-space: nowrap;
    background: var(--sp-surface); border: 1.5px solid var(--sp-line);
    color: var(--sp-slate); font-size: 13px; font-weight: 700; text-decoration: none;
}
.dh-em__pill.is-on { background: var(--sp-red-soft); border-color: var(--sp-red); color: var(--sp-red); }
.dh-em__pillflag { font-size: 16px; }

.dh-em__head { padding: 0 16px 14px; display: flex; align-items: center; gap: 12px; }
.dh-em__flag { font-size: 32px; }
.dh-em__country { font-family: var(--sp-font-display); font-size: 21px; font-weight: 700; color: var(--sp-ink); line-height: 1.1; }
.dh-em__code { font-size: 12px; color: var(--sp-slate); margin-top: 2px; }

.dh-em__list { margin: 0 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--sp-line); }
.dh-em__row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--sp-surface);
    border-top: 1px solid var(--sp-line-2);
}
.dh-em__row:first-child { border-top: none; }
.dh-em__ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.dh-em__icosvg { width: 18px; height: 18px; }
.dh-em__label { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--sp-ink); }
.dh-em__dial {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 10px; text-decoration: none; flex: 0 0 auto;
    font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .02em; white-space: nowrap;
}
.dh-em__dial span { color: #fff; }
.dh-em__dialico { width: 14px; height: 14px; color: #fff; }

.dh-em__note {
    margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px;
    background: var(--sp-red-soft); border: 1px solid var(--sp-red);
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 12.5px; color: var(--sp-red); line-height: 1.5;
}
.dh-em__noteico { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; color: var(--sp-red); }

/* ──────────────── "MAKE THIS MY PORT" — the one place a port gets chosen ──────────────── */
.dh-myport { margin-top: 8px; }
/* Sits directly under .dh-cta and reads as its sibling, so it matches it:
   same padding, same 10px radius, same type size. It used to be a 999px pill
   with 7px/13px padding, which made the two buttons look like they came from
   different screens. `--sp-font` was never defined — the declaration was
   invalid and the font came from inheritance by luck. */
.dh-myport__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--sp-line);
    background: var(--sp-surface);
    color: var(--sp-slate);
    font-family: var(--sp-font-body);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    /* The hero gives this column ~185px on a 375px phone. The label is kept
       short enough to fit; nowrap makes a regression obvious (it overflows)
       rather than silently reflowing into the two-line blob this replaced. */
    white-space: nowrap;
}
.dh-myport__btn.is-on {
    background: var(--sp-red-soft);
    border-color: var(--sp-red);
    color: var(--sp-red);
}
/* flex:0 0 auto — the button is inline-flex, so without it the icon is squashed
   to ~11px wide while staying 14px tall and the glyph distorts. */
.dh-myport__ico { width: 14px; height: 14px; flex: 0 0 auto; }

/* ──────────────── SHORE LEAVE — status, conditions, topic grid ────────────────
   The whole block is admin-gated: see partials/shore-leave.php. Styling lives
   here next to .dh-comm because the tiles reuse that card, only adding a
   subtitle line the design calls for. */
.dh-sl { padding-top: 4px; }


/* --- the one action left at a restricted port --- */
.dh-sl__only {
    display: flex; align-items: center; gap: 12px;
    margin: 0 16px 18px; padding: 14px; border-radius: 14px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    text-decoration: none; color: inherit;
}
.dh-sl__only:hover { border-color: var(--sp-red); }
.dh-sl__onlyorb {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    background: radial-gradient(circle at 35% 30%, #5BC5DA 0%, #1A5B70 100%);
}
.dh-sl__onlyorb svg { width: 21px; height: 21px; color: #fff; }
.dh-sl__onlytxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dh-sl__onlytxt b { font-size: 14px; color: var(--sp-ink); }
.dh-sl__onlytxt small { font-size: 11.5px; color: var(--sp-slate); }
.dh-sl__onlygo { flex: 0 0 auto; width: 18px; height: 18px; color: var(--sp-slate-2); }


/* --- Shore Leave screen header (port/shore-leave.php) ------------------------
 * Back · logo · DISCOVER <port> / Hello, <name> · alerts · avatar.
 * align-items:flex-start, so the two-line name block grows downward and the
 * round controls stay pinned to the top rather than drifting to the middle.
 */
.slp-head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px 12px;
    background: var(--sp-surface); border-bottom: 1px solid var(--sp-line);
}
.slp-head__back {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; margin-top: 4px;
    display: grid; place-items: center;
    background: var(--sp-bg); border: 1px solid var(--sp-line); color: var(--sp-ink);
}
.slp-head__back:hover { border-color: var(--sp-red); }
.slp-head__backico { width: 20px; height: 20px; }
.slp-head .sp-stamp { flex: 0 0 auto; }
.slp-head__txt { flex: 1; min-width: 0; padding-top: 2px; }
.slp-head__eyebrow {
    margin: 0; font-family: var(--sp-font-display); font-size: 12px; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; color: var(--sp-blue);
    /* One long city name must not push the bell and avatar off the row. */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slp-head__hello {
    margin: 4px 0 0; font-family: var(--sp-font-display); font-size: 24px; font-weight: 600;
    line-height: 1.05; color: var(--sp-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slp-head__bell {
    position: relative; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--sp-bg); border: 1px solid var(--sp-line); color: var(--sp-ink);
}
.slp-head__bell:hover { border-color: var(--sp-red); }
.slp-head__bellico { width: 19px; height: 19px; }
.slp-head__count {
    position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 999px; background: var(--sp-red); color: #fff;
    font-size: 10px; font-weight: 700; display: grid; place-items: center;
    border: 2px solid var(--sp-surface);
}
.slp-head__me {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-red); color: #fff;
    font-family: var(--sp-font-display); font-weight: 700; font-size: 15px;
}

/* --- Search ports, at the top of the content column -------------------------
 * Looks like the prototype's static bar but is a real form: the autocomplete
 * panel hangs off it, and submitting without picking a suggestion still lands
 * on /explore with the query.
 */
.slp-search {
    position: relative; margin: 14px 16px 0;
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; border-radius: 13px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
}
.slp-search:focus-within { border-color: var(--sp-blue); }
.slp-search__ico { flex: 0 0 auto; width: 19px; height: 19px; color: var(--sp-slate); }
.slp-search__input {
    flex: 1; min-width: 0; border: 0; background: none; padding: 0;
    font-family: var(--sp-font); font-size: 14.5px; color: var(--sp-ink);
}
.slp-search__input::placeholder { color: var(--sp-slate); }
.slp-search__input:focus { outline: none; }
/* Safari draws its own clear button on type=search; ours is the Escape key. */
.slp-search__input::-webkit-search-decoration,
.slp-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.slp-more { padding: 4px 16px 8px; }

/* --- Shore Leave topic grid (slg-) -------------------------------------------
   Taken from the prototype's computed styles, not approximated. It is a separate
   namespace from .dh-comm on purpose: the community cards use a dark gradient
   orb with a solid white glyph, this screen uses a soft blue disc with blue line
   art, and sharing a class would force one of the two to change. */
.slg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px 18px; }
.slg__tile {
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    padding: 16px 6px 13px; border-radius: 14px; text-align: center;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    text-decoration: none; cursor: pointer;
}
.slg__tile:hover { border-color: var(--sp-blue); }
.slg__orb {
    width: 50px; height: 50px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-blue-soft); color: var(--sp-blue);
}
.slg__ico { width: 23px; height: 23px; }
/* pre-line, so the "Terminal\nRules" break in the label is honoured exactly
   where the design puts it rather than wherever the column happens to wrap. */
.slg__label {
    font-family: var(--sp-font-display); font-size: 13px; font-weight: 600;
    color: var(--sp-ink); line-height: 1.15; white-space: pre-line;
}
.slg__sub { font-size: 10px; color: var(--sp-slate); line-height: 1.2; white-space: pre-line; }

/* The wide row the design closes the Shore Leave screen with. Same soft disc as
   the tiles, laid out horizontally. */
.slg-row {
    display: flex; align-items: center; gap: 12px;
    margin: 0 16px 18px; padding: 14px; border-radius: 14px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    text-decoration: none; color: inherit;
}
.slg-row:hover { border-color: var(--sp-blue); }
.slg-row__orb {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-blue-soft); color: var(--sp-blue);
}
.slg-row__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slg-row__txt b { font-family: var(--sp-font-display); font-size: 16px; color: var(--sp-ink); }
.slg-row__txt small { font-size: 12px; color: var(--sp-slate); }
.slg-row__go { flex: 0 0 auto; width: 18px; height: 18px; color: var(--sp-slate-2); }

/* ── Shore Leave: contribute prompt ─────────────────────────────────────────── */
.slcta {
    display: flex; align-items: center; gap: 14px;
    margin: 0 16px 14px; padding: 14px 16px; border-radius: 16px;
    background: var(--sp-surface); border: 1.5px dashed var(--sp-blue);
    text-decoration: none; color: inherit;
}
.slcta__orb {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-blue-soft); color: var(--sp-blue);
}
.slcta__ico { width: 21px; height: 21px; }
.slcta__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slcta__txt b { font-size: 15px; font-weight: 700; color: var(--sp-ink); }
.slcta__txt small { font-size: 11.5px; color: var(--sp-slate); line-height: 1.35; }
.slcta__btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
    padding: 10px 14px; border-radius: 11px;
    background: var(--sp-red); color: #fff; font-size: 13px; font-weight: 700;
}
.slcta__btnico { width: 13px; height: 13px; }

/* ── Shore Leave: port status card ──────────────────────────────────────────── */
.slcard {
    margin: 0 16px 16px; padding: 16px; border-radius: 16px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
}
.slcard__top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.slcard__code {
    flex: 0 0 auto; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 10px;
    background: var(--sp-red); color: #fff; display: grid; place-items: center;
    font-family: var(--sp-font-display); font-weight: 700; font-size: 16px;
}
.slcard__name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slcard__city { font-family: var(--sp-font-display); font-size: 18px; font-weight: 700; color: var(--sp-ink); line-height: 1; }
.slcard__kicker { font-family: var(--sp-font-display); font-size: 14px; font-weight: 600; color: var(--sp-red); margin-top: 2px; }
.slcard__terminal { font-size: 11px; color: var(--sp-slate); margin-top: 1px; }
.slcard__say { margin: 0 0 12px; font-size: 12px; line-height: 1.45; color: var(--sp-slate); }

/* Read-only status read-out. Deliberately not a button: the value is declared by
   an admin, and a tap that changed it would be the worst bug on this screen. */
.slseg {
    flex: 0 0 auto; display: inline-flex; align-items: center; overflow: hidden;
    border-radius: 999px; border: 1.5px solid var(--sp-line);
    font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.slseg__on, .slseg__off { padding: 5px 9px; background: var(--sp-line-2); color: var(--sp-slate-2); }
.slseg__on.is-yes  { background: var(--sp-green); color: #fff; }
.slseg__off.is-res { background: var(--sp-amber); color: #fff; }
.slseg__off.is-no  { background: var(--sp-red);   color: #fff; }

/* ── Shore Leave: countdown + conditions row ────────────────────────────────── */
.slcard__row { display: flex; gap: 16px; align-items: center; }
.sltimer { flex: 1; min-width: 0; }
.sltimer__head {
    display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
    font-family: var(--sp-font-display); font-size: 10px; font-weight: 700;
    color: var(--sp-red); letter-spacing: .08em;
}
.sltimer__ico { width: 13px; height: 13px; }
.sltimer__out { margin: 0; }
.sltimer__out .t-split {
    display: block; font-family: var(--sp-font-mono); font-size: 34px; font-weight: 700;
    color: var(--sp-red); letter-spacing: .03em; line-height: 1;
}
.sltimer__out .t-split i { opacity: .4; font-style: normal; margin: 0 6px; }
.sltimer__out .t-units { display: flex; gap: 20px; margin-top: 4px; }
.sltimer__out .t-units em {
    font-family: var(--sp-font-display); font-size: 9px; font-weight: 700; font-style: normal;
    color: var(--sp-slate); letter-spacing: .1em;
}
.sltimer__out .t-by { display: block; margin-top: 8px; font-size: 11px; color: var(--sp-slate); }
.sltimer__out.is-due .t-split { color: var(--sp-amber); }
.sltimer__set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Capped rather than fluid: unset, this row is the whole card, and a
   full-width native datetime control swamped the panel it sits in. */
.sltimer__input {
    flex: 0 1 auto; width: 100%; max-width: 168px; min-width: 0; padding: 7px 9px; border-radius: 8px;
    border: 1px solid var(--sp-line); background: var(--sp-bg-2);
    font: 500 12px var(--sp-font-body); color: var(--sp-ink);
}
.sltimer__btn {
    flex: 0 0 auto; padding: 6px 10px; border-radius: 6px;
    background: var(--sp-blue-soft); border: 1px solid var(--sp-line);
    color: var(--sp-blue); font-size: 10px; font-weight: 700;
}
.sltimer__clear {
    margin-top: 6px; background: none; border: 0; padding: 0;
    color: var(--sp-blue); font-size: 11px; font-weight: 700;
}
/* app.js adds is-timing once a target is set — the picker gives way to the
   countdown rather than sitting under it. */
.sltimer.is-timing .sltimer__set { display: none; }
/* Compact mode (app.js adds .is-compact where showPicker() exists): the field
   sits invisibly behind the Set button, so the design shows one control while
   the picker still has a rendered element to anchor to. */
.sltimer.is-compact .sltimer__set { position: relative; }
.sltimer.is-compact .sltimer__input {
    position: absolute; left: 0; top: 0; width: 100%; height: 100%;
    opacity: 0; border: 0; padding: 0; pointer-events: none;
}

.slwx { flex: 0 0 88px; text-align: right; text-decoration: none; color: inherit; }
.slwx__sky   { display: block; font-size: 34px; line-height: 1; }
.slwx__temp  { display: block; font-family: var(--sp-font-mono); font-size: 26px; font-weight: 700; color: var(--sp-ink); line-height: 1.1; }
.slwx__desc  { display: block; font-size: 11px; color: var(--sp-slate); margin-top: 2px; }
.slwx__feels { display: block; font-size: 11px; color: var(--sp-slate); margin-top: 4px; }
.slwx__feels strong { color: var(--sp-ink); }
.slwx__go {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 5px;
    color: var(--sp-blue); font-size: 11px; font-weight: 700;
}
.slwx__goico { width: 12px; height: 12px; }

/* ── Shore Leave: seafarer experiences ──────────────────────────────────────
   Card metrics copied from the prototype: 210px fixed width, 16px radius, 42px
   avatar, 9px topic label, 12.5px body. */
.slex__head { display: flex; align-items: center; padding: 0 16px 12px; }
.slex__title {
    flex: 1; font-family: var(--sp-font-display); font-size: 14px; font-weight: 700;
    color: var(--sp-ink); letter-spacing: .04em; text-transform: uppercase;
}
.slex__all { display: inline-flex; align-items: center; gap: 4px; color: var(--sp-blue); font-size: 13px; font-weight: 700; }
.slex__allico { width: 13px; height: 13px; }

/* Eleven topics do not fit 375px, and the scrollbar is hidden, so without a
   cue the row looks like it ends at "Food". The mask fades the right edge to
   say there is more; it is painted on the padding box, so it stays put while
   the chips scroll under it. */
.slex__chips {
    display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 12px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
}
.slex__chip {
    flex: 0 0 auto; padding: 7px 13px; border-radius: 999px; white-space: nowrap;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    color: var(--sp-slate); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.slex__chip.is-on { background: var(--sp-blue-soft); border-color: var(--sp-blue); color: var(--sp-blue); }
/* Topics this port has nothing under yet: still tappable — they say what is
   missing and lead to the review form — but muted so the ones with content
   read first. .is-on wins over this, so a chosen empty chip still looks chosen. */
.slex__chip.is-bare:not(.is-on) { color: var(--sp-slate-2); }
.slex__empty a { color: var(--sp-blue); font-weight: 600; }

.slex__rail { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 18px; scroll-snap-type: x mandatory; }
.slex__card {
    flex: 0 0 210px; scroll-snap-align: start;
    padding: 14px; border-radius: 16px;
    background: var(--sp-surface); border: 1px solid var(--sp-line);
}
.slex__who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
/* Initials rather than a portrait — the schema has no avatar, and a stock photo
   would put a stranger's face on a real seafarer's words. */
.slex__ava {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--sp-blue-soft); color: var(--sp-blue);
    font-family: var(--sp-font-display); font-size: 17px; font-weight: 700;
}
.slex__id { flex: 1; min-width: 0; }
.slex__topic {
    display: block; font-size: 9px; font-weight: 700; color: var(--sp-blue);
    letter-spacing: .05em; margin-bottom: 2px; text-transform: uppercase;
}
.slex__line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.slex__name {
    font-size: 13px; font-weight: 700; color: var(--sp-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slex__rate { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--sp-amber); }
.slex__rank {
    display: block; font-size: 11px; color: var(--sp-slate); margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slex__body { margin: 0; font-size: 12.5px; color: var(--sp-ink-2); line-height: 1.45; }
.slex__meta { display: flex; align-items: center; gap: 4px; margin: 8px 0 0; font-size: 11px; color: var(--sp-slate); }
.slex__metaico { width: 11px; height: 11px; color: var(--sp-red); }
/* Lives inside the flex rail, so it needs to be told to take the width rather
   than shrink to a column of single words. */
.slex__empty { flex: 1 1 auto; min-width: 0; margin: 0; padding: 18px 2px; font-size: 12.5px; color: var(--sp-slate); }

/* --- "Find it on Google Maps" action, on the shore-leave topic screens -------
 * A plain outbound link (Maps URLs — no key, no quota), so it is styled as an
 * action row rather than a map: nothing here is a live map, and a card that
 * looked like one would promise an embed the app does not have.
 */
.sl2-maps {
    display: flex; align-items: center; gap: 12px;
    margin: 0 16px 14px; padding: 13px 14px;
    border-radius: var(--sp-r-lg);
    background: var(--sp-surface); border: 1px solid var(--sp-line);
    color: inherit; text-decoration: none;
}
.sl2-maps:hover { border-color: var(--sp-blue); }
.sl2-maps__orb {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--sp-blue-soft); color: var(--sp-blue);
}
.sl2-maps__ico { width: 19px; height: 19px; }
.sl2-maps__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sl2-maps__txt b { font-family: var(--sp-font-display); font-size: 14px; color: var(--sp-ink); }
.sl2-maps__txt small { font-size: 11.5px; color: var(--sp-slate); line-height: 1.35; }
.sl2-maps__go { flex: 0 0 auto; width: 16px; height: 16px; color: var(--sp-slate-2); }

/* --- In-app map sheet (partials/map-sheet.php) -------------------------------
 * A bottom sheet, not a centred dialog: the app is a phone-shaped column and
 * the trigger is always in the lower half of the screen, so rising from the
 * bottom keeps the map under the thumb that opened it.
 */
.msheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; }
.msheet[hidden] { display: none; }
.msheet__scrim { position: absolute; inset: 0; background: rgba(11, 22, 41, .55); }
.msheet__panel {
    position: relative; width: 100%; max-height: 88vh;
    display: flex; flex-direction: column;
    background: var(--sp-surface);
    border-radius: var(--sp-r-lg) var(--sp-r-lg) 0 0;
    box-shadow: 0 -12px 40px rgba(11, 22, 41, .28);
    animation: msheet-up .22s ease-out;
}
.msheet__panel:focus { outline: none; }
@keyframes msheet-up { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
/* Users who ask for less motion get the sheet without the slide. */
@media (prefers-reduced-motion: reduce) { .msheet__panel { animation: none; } }

.msheet__head {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 16px 14px 12px; border-bottom: 1px solid var(--sp-line);
}
.msheet__grip {
    position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 999px; background: var(--sp-line-2);
}
.msheet__title {
    flex: 1; min-width: 0; margin: 0;
    font-family: var(--sp-font-display); font-size: 16px; font-weight: 700; color: var(--sp-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msheet__x {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; cursor: pointer;
    background: var(--sp-bg); border: 1px solid var(--sp-line); color: var(--sp-ink);
}
.msheet__x:hover { border-color: var(--sp-red); }
.msheet__xico { width: 17px; height: 17px; }

.msheet__body { flex: 1; min-height: 0; background: var(--sp-bg); }
.msheet__map { display: block; width: 100%; height: 62vh; border: 0; }
.msheet__map[hidden] { display: none; }

/* No API key: the sheet still opens, and says what it can actually do. */
.msheet__off { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 26px; text-align: center; }
.msheet__off[hidden] { display: none; }
.msheet__offorb {
    width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
    background: var(--sp-blue-soft); color: var(--sp-blue);
}
.msheet__offico { width: 25px; height: 25px; }
.msheet__offtxt { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--sp-slate); max-width: 30ch; }

.msheet__go {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 15px 16px; padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    background: var(--sp-red); color: #fff; text-decoration: none;
    font-family: var(--sp-font-display); font-size: 14.5px; font-weight: 700;
}
.msheet__goico { width: 16px; height: 16px; }

/* Hold the page still while the sheet is up, or scrolling the map scrolls the
   list behind it. Both elements: <html> is the scroller in this layout, and
   locking body alone measurably does not stop it. */
html.is-sheet, body.is-sheet { overflow: hidden; }
