/* ─── Atlantic Onboarding — bespoke journey ─────────────────────────── */

/* Hide the phone frame and let onboarding go full-bleed */
body.onboarding-mode .phone,
body.onboarding-mode .phone-screen { max-width:none; box-shadow:none; border-radius:0; height:100vh; }
body.onboarding-full .appbar,
body.onboarding-full .tabbar { display:none !important; }
body.onboarding-full .content { padding:0 !important; overflow-y:auto; }

.ob-progress {
  display:flex; gap:8px; margin: var(--space-6) 0 var(--space-4);
}
.ob-dot {
  width:10px; height:10px; border-radius:50%;
  background:rgba(255,255,255,.35); transition: all .3s;
}
.ob-dot.active { background:var(--color-accent, #b8873d); width:26px; border-radius:8px; }

/* ─── Hero (welcome-1) ─── */
.ob-hero {
  position:relative; min-height:100vh; width:100%;
  background-size:cover; background-position:center;
  color:#fff;
  display:flex; align-items:flex-end;
  padding: var(--space-6);
}
.ob-hero::before {
  content:''; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.85) 100%);
}
.ob-hero-inner {
  position:relative; z-index:1; max-width: 760px;
  padding: var(--space-6) 0;
}
.ob-hero .ob-lead { color:rgba(255,255,255,.9); }
.ob-hero .ob-attribution { color:rgba(255,255,255,.7); font-size:12px; margin-top: var(--space-4); }
.ob-hero .ob-attribution a { color: #d9a866; text-decoration:none; border-bottom: 1px solid rgba(217,168,102,.5); }

/* ─── Page containers ─── */
.ob-page {
  min-height:100vh;
  background: var(--color-bg);
  color: var(--color-text, #0b1f2a);
  padding: var(--space-6) var(--space-5);
}
.ob-page-inner {
  max-width: 900px; margin: 0 auto;
  padding: var(--space-4) 0 var(--space-8);
}
.ob-back-row { margin-bottom: var(--space-3); }

.ob-eyebrow {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-accent, #b8873d);
  margin-bottom: var(--space-2);
}
.ob-h1 {
  font-family: var(--font-display, 'Barlow Condensed');
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 500; line-height: 1.05; letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
}
.ob-hero .ob-h1 { color:#fff; }
.ob-lead {
  font-size: 17px; line-height: 1.55;
  margin: 0 0 var(--space-3);
  max-width: 65ch;
}
.ob-lead-sm { font-size: 14px; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.ob-note {
  background: rgba(184,135,61,0.09);
  border-left: 3px solid var(--color-accent, #b8873d);
  padding: var(--space-3) var(--space-4);
  border-radius: 4px; margin: var(--space-4) 0;
  font-size: 14px;
}
.ob-list { padding-left: 1.25em; }
.ob-list li { margin-bottom: var(--space-2); line-height: 1.55; }
.ob-figure { width:100%; height:auto; border-radius: 8px; margin: var(--space-3) 0 var(--space-5); }

/* ─── Pillars ─── */
.ob-pillars {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5); margin: var(--space-5) 0 var(--space-6);
}
.ob-pillar {
  background: var(--color-surface); border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(11,31,42,.06);
}
.ob-pillar img { width:100%; aspect-ratio: 1/1; object-fit: cover; display:block; }
.ob-pillar h3 {
  font-family: var(--font-display); font-size: 22px; font-weight: 500;
  margin: var(--space-4) var(--space-4) var(--space-2);
}
.ob-pillar p {
  padding: 0 var(--space-4) var(--space-4);
  font-size: 14px; line-height: 1.55; color: var(--color-text-muted);
}

/* ─── Crew ─── */
.ob-crewgrid {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4); margin: var(--space-4) 0 var(--space-6);
}
.ob-crewcard {
  background: var(--color-surface); border-radius: 8px;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
}
.ob-crewrole {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--color-accent);
  margin-bottom: var(--space-1);
}
.ob-crewname {
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  margin-bottom: var(--space-2);
}
.ob-crewnote { font-size: 13px; line-height: 1.5; color: var(--color-text-muted); }

/* ─── Actions ─── */
.ob-actions {
  display:flex; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.btn-lg { padding: 14px 24px; font-size: 15px; }
/* Next / continue buttons: a solid, unmissable button. brand.css draws
   .btn-primary as plain text (no fill), which vanished on the dark welcome
   photo (Fosse, 9 Oct 2026). The arrow comes from brand.css ::after. */
.ob-actions .btn-primary {
  background: #0b1f2a; color: #fff; border: none;
  padding: 15px 28px; min-height: 52px; border-radius: 999px;
  justify-content: center; font-size: 1rem; letter-spacing: .12em;
  box-shadow: 0 4px 14px rgba(11,31,42,.25);
}
.ob-actions .btn-primary:hover { background: #1c4055; color: #fff; letter-spacing: .12em; }
.ob-hero .ob-actions .btn-primary { background: #d9a866; color: #0b1f2a; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.ob-hero .ob-actions .btn-primary:hover { background: #e6bb80; color: #0b1f2a; }
.ob-actions .btn-primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.ob-hero .ob-actions { border-top-color: rgba(255,255,255,.35); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ─── Checklist ─── */
.ob-progress-bar {
  position:relative; height: 32px; background: var(--color-surface-offset);
  border-radius: 16px; overflow: hidden; margin: var(--space-4) 0 var(--space-5);
}
.ob-progress-fill {
  position:absolute; inset: 0; width: var(--pct, 0%);
  background: linear-gradient(90deg, #0b1f2a 0%, #1c4055 100%);
  transition: width .5s ease;
}
.ob-progress-label {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size: 12px; letter-spacing: 0.08em; color: #fff; z-index:1;
  font-family: var(--font-display); font-weight:500;
}
.ob-steps { display:flex; flex-direction:column; gap: var(--space-2); }
.ob-stepcard {
  display:grid; grid-template-columns: 36px 1fr 24px;
  align-items:center; gap: var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; padding: var(--space-3) var(--space-4);
  text-align:left; cursor:pointer;
  transition: all .18s ease;
  font: inherit; color: inherit;
}
.ob-stepcard:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.ob-stepcheck {
  width:32px; height:32px; border-radius:50%;
  background: var(--color-surface-offset); color: var(--color-text-faint);
  display:flex; align-items:center; justify-content:center;
  font-weight:600; font-size: 16px;
}
.ob-stepcard.done .ob-stepcheck { background: var(--color-accent); color: #fff; }
.ob-steplabel { font-family: var(--font-display); font-size: 17px; font-weight:500; }
.ob-stephint { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.ob-steparrow { color: var(--color-text-faint); font-size: 18px; }

/* ─── Forms ─── */
.ob-formgroup { margin-bottom: var(--space-6); }
.ob-formgroup h3 {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.ob-formgroup h4 {
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-text-muted);
  margin: var(--space-4) 0 var(--space-2);
}
.ob-hint { font-size: 13px; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.ob-grid2 {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.ob-field {
  display:flex; flex-direction:column; gap: 4px;
}
.ob-field-wide { grid-column: 1 / -1; }
.ob-field > span {
  font-size: 12px; font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
.ob-field input, .ob-field textarea, .ob-field select {
  font: inherit; font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .15s;
}
.ob-field input:focus, .ob-field textarea:focus, .ob-field select:focus {
  outline: none; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(184,135,61,0.15);
}
.ob-check-field {
  display:flex; align-items:flex-start; gap: 10px;
  padding: 10px 0; grid-column: 1 / -1;
  font-size: 14px; line-height: 1.4;
}
.ob-check-field input[type="checkbox"] { margin-top: 3px; }

/* ─── Documents ─── */
.ob-doclist {
  display:flex; flex-direction:column; gap: var(--space-2);
  margin: var(--space-4) 0;
}
.ob-docrow {
  display:grid; grid-template-columns: 1fr auto;
  align-items:center; gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px; padding: var(--space-3) var(--space-4);
}
.ob-doclabel { min-width: 0; }
.ob-docname {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ob-docname-text { flex: 0 1 auto; }
.ob-docmeta {
  display:flex; gap: var(--space-2); flex-wrap:wrap;
  font-size: 12px; color: var(--color-text-muted);
  margin-top: 2px;
}
.ob-docfile {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px; color: var(--color-text-faint);
  max-width: 200px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;
}
.ob-docactions { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; }
/* Take photo | Upload file. Two real triggers instead of one capture-forced
   input, so the crew can pick an existing photo or a PDF instead of being
   dropped straight into the camera. Collapses to one button on desktop, where
   capture="environment" would open the same file picker anyway. */
.ob-docpick { display: grid; grid-auto-flow: column; gap: 8px; align-items: center; }
.ob-docstatus {
  font-size: 11px; padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em; font-weight: 600;
}
.s-confirmed { background: rgba(46,125,50,0.13); color: #2e7d32; }
.s-awaiting-confirm { background: rgba(184,135,61,0.16); color: #8f651c; }
.s-missing { background: rgba(198,40,40,0.11); color: #c62828; }
.s-optional { background: var(--color-surface-offset); color: var(--color-text-faint); }

/* Confirm modal */
.ob-sheet-card { max-width: 480px; }
.ob-confirm .sheet-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 500;
  margin-bottom: var(--space-3);
}
.ob-confirm .ob-field { margin-bottom: var(--space-3); }
.sheet-actions { display:flex; gap: 10px; justify-content:flex-end; margin-top: var(--space-4); }

/* ─── Acknowledgements ─── */
.ob-acks {
  display:flex; flex-direction:column; gap: var(--space-2);
  margin: var(--space-4) 0;
}
.ob-ack {
  display:flex; gap: 12px; align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px; line-height: 1.5;
  cursor: pointer;
  transition: border-color .15s;
}
.ob-ack:hover { border-color: var(--color-accent); }
.ob-ack input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

/* ─── Review summary ─── */
.ob-summary {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3); margin: var(--space-4) 0;
}
.ob-sumcard {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px; padding: var(--space-4);
  font-size: 13px; line-height: 1.55;
}
.ob-sumcard-wide { grid-column: 1 / -1; }
.ob-sumcard h3 {
  font-family: var(--font-display); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}
.ob-doclist-sum {
  list-style: none; padding: 0; margin: 0;
  display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px;
}
.ob-doclist-sum li {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
}
.ob-doclist-sum li.ok   { background: rgba(46,125,50,0.09); color: #2e7d32; }
.ob-doclist-sum li.miss { background: rgba(198,40,40,0.09); color: #c62828; }
.ob-doclist-sum li.skip { background: var(--color-surface-offset); color: var(--color-text-faint); }

.ob-signature {
  margin-top: var(--space-5); padding: var(--space-5);
  background: var(--color-surface-offset); border-radius: 10px;
  display:flex; flex-direction:column; gap: var(--space-3);
}

/* ─── Submitted screen ─── */
.ob-submitted { text-align:center; padding-top: 15vh; }
.ob-check-big {
  display:inline-flex; align-items:center; justify-content:center;
  width:96px; height:96px; border-radius:50%;
  background: var(--color-accent); color:#fff;
  font-size: 48px; margin-bottom: var(--space-4);
}

/* Reset admin captain modal overlay may be transparent by default; ensure onboarding sheet is visible */
#ob-sheet-overlay.modal-overlay { display: none; }
#ob-sheet-overlay.modal-overlay.active { display: flex; }

/* ─── Captain joiners panel ─── */
.cap-joiners { margin: var(--space-4) 0; }
.cap-joiners-empty {
  padding: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; margin: var(--space-4) 0;
}
/* Same light-card language as the "Onboard crew exports" bar directly
   above this panel (see .crew-exports in app.css) — was previously a dark
   navy hero gradient with glass buttons, which read as a mismatched,
   out-of-place block against the rest of CrewTune's neutral surfaces. */
.cap-joiners-head {
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
  border-radius: 10px 10px 0 0;
}
.cap-joiners-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  color: var(--color-text);
}
.cap-joiners-sub { font-size: 12px; color: var(--color-text-muted); margin-top:2px; }
.cap-joiners-exports { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
/* Reuse the house .btn-inline pill (brass outline) instead of the old
   dark-glass buttons, matching the export row right above this panel.
   Sized to sit inline in the header rather than the full-width stacked
   look .btn-inline has in .crew-exports. */
.cap-joiners-exports .btn-inline {
  width: auto; padding: 8px 12px; font-size: 11px;
}
.cap-joiners-h4 {
  font-family: var(--font-display); font-size: 12px; font-weight:500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4) var(--space-2);
  margin: 0;
}
.cap-joiners-list {
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}
.cap-joiners-list:last-child { border-bottom: 1px solid var(--color-border); border-radius: 0 0 10px 10px; }
.cap-joiner {
  display:grid; grid-template-columns: 28px 1fr auto;
  gap: var(--space-3); align-items:center;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.cap-joiner-check { display:flex; }
.cap-joiner-name { font-family: var(--font-display); font-size: 15px; font-weight: 500; }
.cap-joiner-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.cap-joiner-prog { display:flex; align-items:center; gap:8px; margin-top:6px; }
.cap-joiner-progbar {
  flex: 1; height: 4px; max-width: 200px;
  background: var(--color-surface-offset); border-radius: 2px; overflow:hidden;
}
.cap-joiner-progfill { height: 100%; background: var(--color-accent); transition: width .3s; }
.cap-joiner-progtxt { font-size: 11px; color: var(--color-text-faint); }
.cap-joiner-side { display:flex; align-items:center; gap: 8px; flex-wrap: wrap; }
/* Row actions reuse the same .btn-inline house pill as the header exports,
   sized down to sit compactly next to the status chip. */
.cap-joiner-side .btn-inline { width: auto; padding: 5px 10px; font-size: 10px; }
.chip {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.04em;
}
/* Token-based (not hardcoded rgba) so these track the theme like every
   other chip variant in the app (.chip-accent / .chip-warning / etc). */
.chip-neutral   { background: var(--color-surface-offset); color: var(--color-text-muted); }
.chip-progress  { background: var(--color-brass-soft); color: #8f651c; }
.chip-review    { background: var(--color-primary-soft); color: var(--color-primary); }
.chip-approved  { background: var(--color-success-soft); color: var(--color-success); }

#cap-joiner-modal.modal-overlay { display: none; }
#cap-joiner-modal.modal-overlay.active { display: flex; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .ob-page { padding: var(--space-4) var(--space-3); }
  .ob-h1 { font-size: 32px; }
  .ob-hero { padding: var(--space-4); }
  .ob-pillars, .ob-crewgrid, .ob-summary, .ob-grid2 { grid-template-columns: 1fr; }
  .ob-docrow { grid-template-columns: 1fr; padding: var(--space-3); gap: var(--space-2); }
  .ob-docactions {
    justify-content: stretch; gap: 8px;
    display: grid; grid-template-columns: 1fr auto;
  }
  .ob-docactions .ob-doc-upload-btn { grid-column: 1 / -1; text-align: center; padding: 10px 14px; }
  .ob-docactions .ob-docpick { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  /* The two picker buttons are grid items of .ob-docpick, not of
     .ob-docactions, so the 1 / -1 span above must not reach them — it would
     stack them instead of sitting them side by side. */
  .ob-docpick .ob-doc-upload-btn { grid-column: auto; width: 100%; }
  .ob-docactions .btn-link { grid-column: 1 / -1; text-align: left; padding-left: 0; }
  .ob-docname { font-size: 14px; }
  .ob-actions { flex-direction: column-reverse; }
  .ob-actions .btn { width: 100%; }
}

/* Receipts step */
.ob-tools-heading {
  margin: var(--space-6) 0 var(--space-3) 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.ob-receipt-upload {
  background: var(--color-surface-offset);
  border-radius: 12px;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.ob-hint { font-size: 13px; color: var(--color-text-muted); }
.ob-receipt-month { margin-bottom: var(--space-5); }
.ob-receipt-month h3 { margin: 0 0 var(--space-2) 0; font-size: 16px; }
.ob-receipt-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.ob-receipt-tbl th, .ob-receipt-tbl td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--color-border-subtle);
}
.chip-operations { background: rgba(30,90,140,0.14); color: #1e5a8c; }
.chip-apa        { background: rgba(184,135,61,0.14); color: #8f651c; }
.chip-private    { background: rgba(120,60,120,0.14); color: #7a3a7a; }

/* v1.9.7+ — Upload/Skip button states, document preview, cross-browser file input */

/* Hidden file input — absolute positioning keeps it clickable on iOS Safari,
   in-app browsers, and old Android WebView where `display:none` / `hidden` breaks
   programmatic .click(). Off-screen is safer than visually hidden. */
.ob-file-input {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.ob-doc-upload-btn { position: relative; cursor: pointer; }
.ob-doc-upload-btn.is-skipped {
  background: rgba(184, 135, 61, 0.10);
  color: #8f651c;
  border-color: rgba(184, 135, 61, 0.35);
}
.ob-doc-upload-btn.btn-primary { /* uploaded state */
  background: rgba(46, 125, 50, 0.14);
  color: #1f5c22;
  border-color: rgba(46, 125, 50, 0.35);
}
.ob-doc-upload-btn.btn-primary:hover {
  background: rgba(46, 125, 50, 0.22);
}

.ob-preview {
  display: block;
  margin: var(--space-4) 0 var(--space-5) 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border-subtle);
  text-decoration: none;
  color: var(--color-text);
}
.ob-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  background: #f6f4ef;
}
.ob-preview-hint {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}
.ob-preview-pdf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.ob-preview-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(198, 40, 40, 0.12);
  color: #b83232;
}
.ob-preview-file {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ─── Skip to dashboard ───────────────────────────────────────────────
   Persistent escape hatch appended to every onboarding step by
   OB.render(). Sits below the step content, deliberately quiet so it
   never competes with the step's own primary action. */
.ob-skipbar {
  display:flex; justify-content:center;
  padding: var(--space-5) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom));
}
.ob-skiplink {
  background:none; border:none; cursor:pointer;
  font: inherit; font-size: 13px; letter-spacing:.02em;
  color: rgba(255,255,255,.62);
  text-decoration: underline; text-underline-offset: 3px;
  padding: 10px 14px; min-height: 44px;
}
.ob-skiplink:hover, .ob-skiplink:focus-visible { color: #fff; }
