/* Island Hopper design system ("Postcard"). One file, no build step.
   Sections: tokens, reset, layout, nav, type, buttons, forms, cards,
   badges & pills, hopper, flash, spinner, sailings, checkout, jobs, utilities. */

/* ---------- tokens ---------- */
:root {
  --green: #1F4D3A; --green-ink: #163a2c; --green-soft: #E3EFE8;
  --orange: #F28C28; --orange-soft: #FBEBD9; --orange-ink: #B8641E;
  --ink: #22303A; --slate: #55636D; --slate-2: #7A8791;
  --sand: #F6F3EC; --sand-2: #EFEAE0; --line: #E5DFD3; --line-2: #C9C2B4;
  --white: #fff; --alert: #C4562A; --alert-soft: #FBE9E2; --ok: #2FA37A;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px; --r-lg: 18px; --r-xl: 22px;
  --shadow: 0 20px 50px rgba(0,0,0,.22);
  --wrap: 1080px; --nav-h: 64px; --tab-h: 62px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--sand); }
img, svg { max-width: 100%; display: block; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.5vw, 44px); } h2 { font-size: clamp(24px, 3.2vw, 30px); } h3 { font-size: 20px; } h4 { font-size: 18px; }
p { margin: 0 0 1em; max-width: 70ch; }
.muted { color: var(--slate); } .small { font-size: 13.5px; } .tiny { font-size: 12px; color: var(--slate); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.stack > * + * { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
main { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { main { padding-bottom: 48px; } }
.page-head { padding: 26px 0 8px; }
.band { background: var(--green); color: var(--white); padding: 22px 0 24px; }
.band h1, .band h2 { color: var(--white); }
.band a { color: var(--white); }
.article { max-width: 720px; padding-top: 22px; }

/* ---------- nav ---------- */
header { padding-top: env(safe-area-inset-top, 0px); }
.nav { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav.on-photo { position: absolute; top: 0; left: 0; right: 0; z-index: 5; color: var(--white); }
.nav.on-photo a { color: var(--white); }
.brand { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: -.01em; text-decoration: none; color: inherit; }
.brand em { font-style: italic; font-weight: 500; }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: 26px; font-weight: 500; font-size: 15px; }
.nav-links a { text-decoration: none; color: inherit; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.nav-links a.on { border-bottom-color: var(--orange); }
.nav-out { font-size: 14px; color: var(--slate); text-decoration: none; }
.nav-admin { position: relative; }
.nav-admin summary { list-style: none; cursor: pointer; }
.nav-admin summary::-webkit-details-marker { display: none; }
.nav-admin ul { position: absolute; right: 0; top: 30px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-width: 190px; list-style: none; margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 10; }
.nav-admin ul a { display: block; padding: 8px 12px; color: var(--ink); border: 0; }
@media (min-width: 900px) { .nav-links { display: flex; } }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); background: var(--white); border-top: 1px solid var(--line); display: flex; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--slate); text-decoration: none; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--green); font-weight: 600; }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--white); color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-ink); }
.btn-ghost { background: transparent; }
.btn-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--green); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 12px; }
.field > .label { display: block; font-size: 13px; font-weight: 500; color: var(--slate); margin-bottom: 5px; }
.input, .select, textarea.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
textarea.input { min-height: 140px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355636D' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
.input:invalid:not(:placeholder-shown) { border-color: var(--alert); }
.input[disabled], .select[disabled] { background: var(--sand-2); color: var(--slate-2); }
.field .help { font-size: 12.5px; color: var(--slate); margin-top: 4px; }
.field .err { font-size: 13px; color: var(--alert); margin-top: 4px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); margin-bottom: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--green); }
.check .label { font-size: 14px; line-height: 1.45; }
.form-errors { background: var(--alert-soft); border: 1px solid var(--alert); border-radius: var(--r); padding: 12px 14px; color: var(--alert); font-size: 14px; margin-bottom: 14px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }

/* ---------- cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.card + .card { margin-top: 8px; }
.card h3 { margin-bottom: 6px; }
.panel { background: var(--sand); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); }

/* ---------- badges & pills ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; line-height: 1.3; }
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-warn { background: var(--orange-soft); color: var(--orange-ink); }
.badge-muted { background: var(--sand-2); color: var(--slate); }
.badge-alert { background: var(--alert-soft); color: var(--alert); }
.pill { display: inline-block; background: rgba(255,255,255,.14); border-radius: 999px; padding: 8px 18px; font-size: 15px; font-weight: 500; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--slate); background: var(--sand-2); border: 0; cursor: pointer; }
.tabs button.on { background: var(--green); color: var(--white); }

/* ---------- hopper ---------- */
.hopper { display: flex; gap: 12px; align-items: center; margin: 18px 0; }
.hopper img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: center 20%; border: 2px solid var(--white); box-shadow: 0 2px 8px rgba(0,0,0,.2); flex: none; }
.hopper p { margin: 0; font-size: 14px; color: var(--slate); line-height: 1.4; background: var(--white); border-radius: 14px 14px 14px 4px; padding: 10px 14px; border: 1px solid var(--line); }
.hopper p a { color: var(--green); font-weight: 600; }
.band .hopper p { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: var(--white); }

/* ---------- flash ---------- */
.flash { background: var(--orange-soft); border: 1px solid var(--orange); color: var(--orange-ink); border-radius: var(--r); padding: 12px 14px; margin: 14px 0; font-size: 14.5px; }
.flash.alert { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }

/* ---------- spinner ---------- */
.loading { position: fixed; inset: 0; background: rgba(246,243,236,.92); z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.loading.show { display: flex; }
.loading .ring { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--orange); animation: ih-spin 1s linear infinite; }
.loading .ferry { width: 128px; height: 128px; background: url("/static/ferry_icon.png") center/contain no-repeat; animation: ih-sail 2.4s ease-in-out infinite alternate; }
.loading p { max-width: 44ch; color: var(--slate); }
@keyframes ih-spin { to { transform: rotate(360deg); } }
@keyframes ih-sail { from { transform: translateX(-40px); } to { transform: translateX(40px); } }

/* ---------- hero (home) ---------- */
.hero { position: relative; min-height: 560px; overflow: hidden; }
.hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,25,45,.35), rgba(20,25,45,0) 35%, rgba(20,25,45,.55) 100%); }
@media (max-width: 899px) {
  .hero::after { background: linear-gradient(180deg, rgba(20,25,45,.55), rgba(20,25,45,.42) 55%, rgba(20,25,45,.6) 100%); }
}
.hero .wrap { position: relative; z-index: 2; padding-top: calc(var(--nav-h) + 28px + env(safe-area-inset-top, 0px)); display: grid; gap: 22px; }
.hero-copy { color: var(--white); text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.hero-copy h1 { color: var(--white); margin-bottom: 12px; }
.hero-copy h1 i { font-style: italic; }
.hero-copy p { font-size: 16px; }
.sheet { background: var(--sand); border-radius: var(--r-xl) var(--r-xl) 0 0; margin: 0 -18px; padding: 18px 18px 24px; box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
.sheet h2 { font-size: 22px; margin-bottom: 14px; }
@media (min-width: 900px) {
  .hero { min-height: 640px; }
  .hero .wrap { grid-template-columns: 1fr 440px; align-items: start; padding-top: calc(var(--nav-h) + 60px + env(safe-area-inset-top, 0px)); }
  .hero-copy { max-width: 520px; padding-top: 30px; }
  .hero-copy p { font-size: 17px; }
  .sheet { margin: 0; border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 22px; }
}
.summary-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; cursor: pointer; }
.summary-row .ic { width: 32px; height: 32px; border-radius: 50%; background: #E9EEF2; display: grid; place-items: center; flex: none; }
.summary-row .k { font-size: 11px; color: var(--slate); } .summary-row .v { font-size: 15px; font-weight: 500; }
.summary-row .chev { margin-left: auto; color: var(--slate); }
.travelling { display: none; margin-top: 10px; padding: 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.travelling.open { display: block; }
.steps { display: grid; gap: 12px; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps .card b { display: block; margin-bottom: 4px; } .steps .card span { font-size: 13.5px; color: var(--slate); }
.below { display: grid; gap: 34px; padding: 34px 0 20px; }
@media (min-width: 900px) { .below { grid-template-columns: 1.1fr .9fr; gap: 48px; } }
.hol .h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--sand-2); font-size: 14.5px; }
.hol .h:last-child { border-bottom: 0; } .hol .h small { display: block; color: var(--slate); font-size: 12.5px; }

/* ---------- sailings ---------- */
.datebar { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.datebar .arr { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: var(--white); display: grid; place-items: center; cursor: pointer; }
.datebar .arr[disabled] { opacity: .35; cursor: not-allowed; }
.datebar .wk { font-size: 13px; opacity: .75; }
.cols { display: grid; gap: 22px; padding: 22px 0 0; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 380px; align-items: start; } }
.sailing { display: grid; grid-template-columns: 88px 1fr 44px; gap: 10px 12px; align-items: center; padding: 12px 14px; }
@media (min-width: 640px) { .sailing { grid-template-columns: 110px 1fr 140px 44px; padding: 14px 18px; } }
.sailing .t { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: -.01em; }
.sailing .t small { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--slate); margin-left: 3px; }
.sailing .m { font-size: 12.5px; color: var(--slate); } .sailing .m b { display: block; font-size: 14px; font-weight: 500; color: var(--ink); }
.sailing .m .full { color: var(--alert); } .sailing .m .ok { color: var(--green); }
.sailing .fare { font-size: 12.5px; color: var(--slate); grid-column: 2; }
@media (min-width: 640px) { .sailing .fare { grid-column: auto; } }
.sailing .fare b { display: block; font-size: 15px; color: var(--ink); font-weight: 500; }
.sailing.past { opacity: .45; }
.sailing.open-now { border-color: #B9D6C5; }
.rank { width: 44px; height: 44px; border-radius: 50%; border: 1.5px dashed var(--line-2); background: var(--white); display: grid; place-items: center; font-weight: 600; color: var(--line-2); font-size: 16px; cursor: pointer; grid-row: 1 / span 2; grid-column: 3; justify-self: end; }
@media (min-width: 640px) { .rank { grid-row: auto; grid-column: auto; } }
.rank.on { background: var(--orange); border: 0; color: var(--white); }
.rank[disabled] { cursor: not-allowed; }
.side { position: sticky; top: 16px; }
.picks .pk { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--sand-2); font-size: 14.5px; }
.picks .pk .rank { width: 28px; height: 28px; font-size: 13px; grid-row: auto; grid-column: auto; cursor: default; }
.picks .pk small { margin-left: auto; color: var(--slate); font-size: 12.5px; }
.picks .empty { font-size: 14px; color: var(--slate); padding: 6px 0 10px; }
.slider { width: 100%; accent-color: var(--orange); margin: 8px 0 4px; }
.stickyfoot { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(246,243,236,0), var(--sand) 35%); padding: 14px 18px 12px; z-index: 15; }
.stickyfoot .s { font-size: 12.5px; color: var(--slate); text-align: center; margin-bottom: 8px; }
@media (min-width: 900px) { .stickyfoot { display: none; } }
.help-note { font-size: 14px; color: var(--slate); margin: 0 0 12px; }
.confirm { background: var(--orange-soft); border: 1px solid var(--orange); border-radius: var(--r); padding: 14px; margin: 12px 0; }
.confirm .row { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- checkout ---------- */
.checkout { max-width: 640px; padding-top: 26px; }
.checkout[hidden] { display: none; }
.section { margin-bottom: 26px; }
.section h3 { margin-bottom: 10px; }
.fee { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--sand-2); }
.fee .strike { text-decoration: line-through; color: var(--slate-2); font-weight: 400; }
.devlinks { font-size: 12px; margin: 8px 0 12px; }
/* BC Ferries booking-mode panel (ids and state classes preserved from the previous build) */
.bc-panel { border: 1.5px solid #b7d5ee; background: #eaf3fb; border-radius: var(--r); padding: 14px; color: var(--ink); }
.bc-panel.bc-required { border: 2px solid #f0c489; background: #fdf3e7; }
.bc-panel-head { display: flex; align-items: center; gap: 10px; }
.bc-panel-icon { width: 34px; height: 34px; border-radius: 9px; background: #0a5b9e; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.bc-panel.bc-required .bc-panel-icon { background: #b45309; }
.bc-panel-titles { flex: 1 1 auto; min-width: 0; }
.bc-panel-title { font-size: 15px; font-weight: 700; }
.bc-panel-sub { font-size: 12.5px; color: var(--slate); }
.bc-pill { font-size: 11px; font-weight: 700; color: #fff; background: #0a5b9e; padding: 3px 9px; border-radius: 999px; flex: none; white-space: nowrap; }
.bc-panel.bc-required .bc-pill { background: #b45309; }
.bc-banner { margin-top: 10px; font-size: 12.5px; background: #fdf3e7; border: 1px solid #f0c489; border-radius: 9px; padding: 8px 10px; color: #5a3410; }
.bc-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bc-choice { display: flex; gap: 9px; align-items: flex-start; background: #fff; border: 1px solid #d3dbe3; border-radius: 10px; padding: 10px 12px; cursor: pointer; margin: 0; font-weight: normal; }
.bc-choice input { margin-top: 2px; flex: none; }
.bc-choice.bc-sel { border-color: #0a5b9e; box-shadow: 0 0 0 1.5px #0a5b9e; }
.bc-panel.bc-required .bc-choice.bc-sel { border-color: #b45309; box-shadow: 0 0 0 1.5px #b45309; }
.bc-choice-title { display: block; font-size: 14px; font-weight: 600; }
.bc-choice-desc { display: block; font-size: 12.5px; color: var(--slate); margin-top: 1px; }
.bc-choice.bc-hidden, .bc-choices.bc-hidden { display: none; }
.bc-trust { margin-top: 10px; font-size: 12.5px; color: var(--slate); }
.bc-why { margin-top: 6px; font-size: 12.5px; }
.bc-why > summary { display: inline-block; cursor: pointer; color: #0a5b9e; font-weight: 700; list-style: none; }
.bc-why > summary::-webkit-details-marker { display: none; }
.bc-why > summary::before { content: "\25B8  "; } .bc-why[open] > summary::before { content: "\25BE  "; }
.bc-panel.bc-required .bc-why > summary { color: #b45309; }
.bc-why-body { margin-top: 6px; color: var(--slate); line-height: 1.5; }
.bc-fields { margin-top: 10px; }
.bc-note { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--ok); background: rgba(47,163,122,.08); font-size: 12.5px; }

/* ---------- jobs ---------- */
.job { display: grid; gap: 12px; }
@media (min-width: 900px) { .job { grid-template-columns: 1.4fr 1fr 1fr auto; align-items: center; gap: 22px; } }
.job .rt { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: -.01em; line-height: 1.15; }
.job .rt small { display: block; font-family: var(--sans); font-size: 13px; color: var(--slate); margin-top: 4px; }
.job .picks-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.job .picks-chips span { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); font-weight: 500; }
.job .st { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--green); }
.job .st i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(47,163,122,.18); }
.job .st.bk { color: var(--orange-ink); } .job .st.bk i { background: var(--orange); box-shadow: 0 0 0 4px rgba(242,140,40,.2); }
.job .st.dn { color: var(--slate); } .job .st.dn i { background: var(--line-2); box-shadow: none; }
.job .kv { font-size: 13px; color: var(--slate); line-height: 1.5; } .job .kv b { color: var(--ink); font-weight: 500; }
.job .act { display: flex; gap: 8px; flex-wrap: wrap; }
.job details { grid-column: 1 / -1; font-size: 13px; color: var(--slate); }
.job details summary { cursor: pointer; color: var(--green); font-weight: 600; }
.job details .kv { margin-top: 8px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }

/* ---------- misc ---------- */
.lock { width: 72px; height: 72px; margin: 0 auto 18px; color: var(--green); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.center { text-align: center; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details > div { padding-top: 8px; color: var(--slate); }
.faq details > div a { color: var(--green); }
.version { font-size: 12px; color: var(--slate); text-align: right; padding: 20px 0; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
