/* First Light — one small stylesheet for the public pages and the captain's admin. */
:root { --ink: #0F1E2C; --navy: #14283A; --teal: #1F6F8B; --teal-soft: #E6F1F5; --sand: #F6F4EF; --grey-bg: #F4F5F7; --line: #E5E7EB; --field: #D5D9DE; --muted: #626B76; --mid: #4A5562; --faint: #8A929B; --red: #C8372D; --green: #1E7A4D; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: 'IBM Plex Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2 { margin: 0; letter-spacing: -0.015em; font-weight: 600; }
button { font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.req { color: var(--red); }

/* ---------- landing ---------- */
body.landing { background: var(--sand); color: var(--navy); }
.stage { position: relative; width: 100%; height: 100vh; min-height: 640px; overflow: hidden; }
.hero, picture.hero img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.brand { position: absolute; top: 40px; right: 48px; display: flex; flex-direction: column; align-items: flex-end; gap: 20px; }
.wordmark { margin: 0; font-family: 'Pinyon Script', cursive; font-weight: 400; font-size: clamp(72px, 5.6vw, 84px); line-height: 1.05; color: var(--navy); }
.login { width: 260px; display: flex; flex-direction: column; gap: 2px; }
.login label { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }
.login-row { display: flex; align-items: center; border-bottom: 1px solid var(--navy); }
.login-row:focus-within { border-bottom-width: 2px; }
.login-input { flex: 1; min-width: 0; height: 44px; background: transparent; border: 0; color: var(--navy); font: inherit; font-size: 15px; padding: 0; }
.login-input::placeholder { color: #43505E; }
.login-input:focus { outline: none; }
.login-row button { width: 44px; height: 44px; margin-right: -10px; background: transparent; border: 0; color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.login-error { margin: 6px 0 0; font-size: 13px; color: var(--red); }
.shake { animation: shake 0.4s; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@media (max-width: 1200px) {
  .stage { display: flex; flex-direction: column; height: auto; min-height: 100vh; }
  .brand { position: static; order: 0; align-items: center; padding: 32px 24px 28px; }
  .wordmark { font-size: 64px; }
  picture.hero { position: static; order: 1; flex: 1; min-height: 420px; display: flex; }
  picture.hero img { position: static; flex: 1; width: 100%; height: auto; min-height: 420px; object-position: 32% 50%; }
  .login { width: 100%; max-width: 300px; }
}

/* ---------- phone-width public pages (join, joined, unsubscribe, privacy) ---------- */
body.public { background: var(--sand); }
.phone { max-width: 430px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; background: var(--sand); }
.phone-wordmark { padding: 22px 24px 14px; text-align: center; font-family: 'Pinyon Script', cursive; font-size: 44px; line-height: 1; }
.phone-photo { width: 100%; height: 200px; object-fit: cover; object-position: 40% 50%; display: block; }
.phone main { flex: 1; padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.phone main.centered { padding: 36px 28px 28px; align-items: center; text-align: center; }
.phone h1 { font-size: 25px; line-height: 1.2; }
.lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mid); }
.lead strong { color: var(--ink); font-weight: 600; }
.fine { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.fine.push { margin-top: auto; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: #E3F3EA; color: var(--green); display: flex; align-items: center; justify-content: center; }
.join-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.hp { position: absolute; left: -9999px; top: -9999px; }
.form-error { margin: 0; font-size: 13px; color: var(--red); }
.f { height: 42px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); padding: 0 12px; font: inherit; font-size: 15px; width: 100%; }
.phone .f { height: 48px; border-radius: 12px; padding: 0 14px; font-size: 16px; }
.f:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
textarea.f { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.btn { height: 42px; padding: 0 18px; border-radius: 10px; border: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn-p { background: var(--teal); color: #fff; }
.btn-p:hover { background: #185B72; color: #fff; }
.btn-p:disabled { background: #9FBECB; cursor: not-allowed; }
.btn-s { background: #fff; color: var(--ink); border: 1px solid var(--field); font-weight: 500; }
.btn-s:hover { background: #F6F8FA; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; border-radius: 12px; font-size: 16px; }

/* ---------- admin ---------- */
body.admin { background: var(--grey-bg); }
.topbar { height: 64px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; }
.topbar-wordmark { font-family: 'Pinyon Script', cursive; font-size: 30px; line-height: 1; }
.topbar nav { display: flex; gap: 4px; margin-left: 12px; }
.topbar nav a { height: 36px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; font-size: 14px; color: var(--mid); font-weight: 500; }
.topbar nav a[aria-current="page"] { background: var(--teal-soft); color: var(--ink); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mid); }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--teal); cursor: pointer; }
.linkish:hover { color: var(--ink); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; }
.stack-2 { display: flex; flex-direction: column; gap: 2px; }
.stack-3 { display: flex; flex-direction: column; gap: 3px; }
.stack-4 { display: flex; flex-direction: column; gap: 4px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.stack-18 { display: flex; flex-direction: column; gap: 18px; }
.wrap h1 { font-size: 22px; }
.wrap h2 { font-size: 16px; }
.between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.flash { margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.flash.ok { background: #E3F3EA; color: var(--green); }
.flash.bad { background: #FBEAE8; color: var(--red); }

.invite { display: flex; flex-direction: column; gap: 14px; }
.invite-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.invite-link { flex: 1 1 360px; min-width: 0; height: 44px; border-radius: 10px; background: var(--grey-bg); border: 1px solid var(--line); padding: 0 14px; display: flex; align-items: center; gap: 10px; color: var(--mid); }
.invite-link input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; text-overflow: ellipsis; }
.copied { font-size: 13px; color: var(--green); display: flex; align-items: center; gap: 5px; }
.columns { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.list { flex: 2 1 400px; min-width: 0; padding: 16px 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 6px; }
.search { height: 34px; width: 200px; border-radius: 17px; background: #F1F3F5; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--faint); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; outline: none; color: var(--ink); }
.row { border-radius: 10px; padding: 8px; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.row:hover { background: #F6F8FA; }
.avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: #EEF1F4; color: var(--mid); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.person-name { font-size: 14px; font-weight: 500; }
.person-email { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.joined { font-size: 12px; color: var(--faint); white-space: nowrap; }
.x { width: 30px; height: 30px; border: 0; border-radius: 15px; background: transparent; color: var(--faint); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.x:hover { background: #FBEAE8; color: var(--red); }
.pad { padding: 8px; margin: 0; }
.next { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.next-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); flex-wrap: wrap; }
.next-title { font-size: 18px; font-weight: 600; }
.pill { height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.pill-amber { background: #FFF4E5; color: #8A5A12; }
.pill-green { background: #E3F3EA; color: var(--green); }
.sailed { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.sailed-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.sailed-head .h { font-size: 16px; font-weight: 600; }
.sailed-head .muted { font-size: 13px; }
.globe { width: 100%; max-width: 520px; aspect-ratio: 1; align-self: center; cursor: grab; touch-action: none; }
.globe:active { cursor: grabbing; }
.globe svg { width: 100%; height: 100%; display: block; }
.voyage-row { padding: 10px 8px; }
.num { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: #FBEAE8; color: var(--red); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* voyage form */
.voyage-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.voyage-main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.voyage-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .topbar { padding: 0 16px; gap: 10px; } .wrap { padding: 16px; } .voyage-aside { position: static; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 13px; font-weight: 500; color: var(--mid); }
.route-info { font-size: 14px; color: var(--mid); padding-top: 10px; }
.place { position: relative; }
.place-menu { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--field); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 30, 44, 0.12); overflow: hidden; }
.place-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.place-menu button:hover, .place-menu button:focus { background: var(--teal-soft); outline: none; }
.place-menu .none { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { height: 34px; padding: 0 6px 0 12px; border-radius: 17px; background: #F1F3F5; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.chip.fixed { padding-right: 12px; }
.chip-x { width: 22px; height: 22px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.chip-x:hover { background: #E2E5E9; color: var(--ink); }
.chip-input { height: 34px; width: 210px; border: 1px dashed #C4CAD1; border-radius: 17px; padding: 0 14px; font: inherit; font-size: 14px; background: #fff; }
.chip-input:focus { outline: none; border-color: var(--teal); }
.plans { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.plans img { width: 150px; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.subject { font-size: 14px; font-weight: 500; line-height: 1.4; }
.preview-link { font-size: 14px; font-weight: 500; }
.aside-notes { padding: 0 4px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.still { color: var(--red); }
.btn.busy { opacity: 0.6; pointer-events: none; }

.confirm { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #FFF4E5; color: #5A3C0A; font-size: 14px; line-height: 1.4; }
.confirm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.x.armed { width: auto; padding: 0 10px; border-radius: 15px; background: #FBEAE8; color: var(--red); font-size: 12px; font-weight: 600; }
