/* Boat — design tokens. Components consume ONLY these variables (no ad-hoc values).
   See CLAUDE.md "UI rules". Phase 1: colour/border/radius/shadow/text/spacing unified. */
:root {
  /* spacing — 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* radius — one family */
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;

  /* borders — one hairline, one stronger */
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  /* elevation — one scale (subtle) */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);

  /* text — three levels, all WCAG AA on white */
  --text: #14181a;          /* primary   */
  --text-2: #4b5563;        /* secondary */
  --text-muted: #667085;    /* muted (AA) */
  --text-disabled: #98a2b3; /* decorative / disabled only */

  /* surfaces */
  --surface: #ffffff;
  --surface-2: #f7f9fa;     /* subtle panel */
  --field-bg: #f2f4f7;      /* input fill */

  /* accent (teal) */
  --accent: #0b7285;
  --accent-strong: #0a616f; /* hover/press */
  --accent-weak: #e7f3f5;   /* tint bg */

  /* semantic */
  --success: #2b8a3e; --success-weak: #d3f9d8;
  --warning: #f59f00; --warning-weak: #fff3bf; --warning-ink: #5c3d00;
  --error: #c92a2a;   --error-weak: #ffe3e3;

  /* type scale — one ladder, no in-between sizes */
  --fs-display: 30px; /* page titles, invoice title */
  --fs-2xl: 24px;     /* big stat numbers, calendar month, status banner */
  --fs-xl: 20px;      /* primary buttons, grand totals */
  --fs-lg: 18px;      /* section headers, sub-titles */
  --fs-md: 16px;      /* body (default) */
  --fs-sm: 14px;      /* secondary text, controls */
  --fs-xs: 13px;      /* tertiary meta */
  --fs-2xs: 12px;     /* fine print */
  --fs-eyebrow: 11px; /* uppercase eyebrow labels */

  /* line-height */
  --lh-tight: 1.15;   /* display / headings */
  --lh-snug: 1.3;     /* multi-line UI text */
  --lh-base: 1.5;     /* body */

  /* weight convention: 500 body · 600 medium · 700 strong · 800 heading/label · 900 hero */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  padding: var(--s5) var(--s4) calc(92px + env(safe-area-inset-bottom));
  max-width: 560px;
  background: var(--surface);
  color: var(--text);
  font: 16px/1.5 -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: var(--fs-display); font-weight: 800; letter-spacing: -0.02em; line-height: var(--lh-tight); margin: 0 0 var(--s4); }
h2 { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); margin: var(--s6) 0 var(--s2); }
p { margin: 0 0 var(--s2); }

.muted   { color: var(--text-muted); }
.accent  { color: var(--accent); }
.err     { color: var(--error); font-weight: 600; }
.warn    { color: var(--error); font-weight: 700; }
.offline { color: var(--text-muted); font-style: italic; }

/* ---- buttons: ONE system ----
   Base <button> = inline text action (link-like). Variants: .primary filled CTA · .ghost quiet · .danger. */
button {
  font: inherit;
  border: 0;
  background: none;
  padding: var(--s3) 0;
  min-height: 48px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
/* filled primary call-to-action (full-width by default) */
button.primary {
  display: block; width: 100%;
  padding: var(--s3) var(--s5); min-height: 50px;
  border-radius: var(--r-md);
  background: var(--accent); color: #fff;
  text-align: center; font-size: var(--fs-lg); font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .05s ease;
}
button.primary:hover  { background: var(--accent-strong); }
button.primary:active { transform: translateY(1px); }
button.big     { font-size: var(--fs-xl); }
button.danger  { display: block; width: 100%; text-align: center; color: var(--error); padding: var(--s4) 0; }
button.ghost   { display: block; width: 100%; text-align: center; color: var(--text-muted); font-weight: 600; }

/* segmented / toggle chips — ONE geometry; a semantic colour per control (selected = filled) */
.type-btn, .svc-btn, .eng-btn, .pay-btn, .seadoo-btn {
  flex: 1; min-height: 48px; padding: var(--s2) var(--s3);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-weight: 800; font-size: var(--fs-md); text-align: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

/* inline SVG icons (icons.js) — inherit the current text colour, scale with font-size */
.ic { width: 1em; height: 1em; vertical-align: -0.13em; flex: none; }

/* ---- form fields ---- */
.field-label {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
input, textarea, select {
  display: block;
  font: inherit;
  color: inherit;
  width: 100%;
  border: 1px solid var(--border);
  outline: none;
  background: var(--field-bg);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  margin: var(--s2) 0 var(--s4);
}
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin: 0 10px 0 0;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
  transform: scale(1.4);
  transform-origin: left center;
}
.check { display: block; font-weight: 600; padding: var(--s3) 0 var(--s4); }
label.inline { display: inline-block; width: 47%; vertical-align: top; }
label.inline + label.inline { margin-left: 6%; }

/* ---- bottom nav (text labels only) ---- */
#nav, #bnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
#nav[hidden], #bnav[hidden] { display: none; }
#nav a, #bnav a {
  flex: 1;
  text-align: center;
  padding: 18px 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
}
#nav a.active, #bnav a.active { color: var(--accent); font-weight: 800; }

/* ---- login ---- */
.login { padding-top: 10vh; text-align: center; }
.login .brand { font-size: 46px; color: var(--accent); margin-bottom: var(--s1); }
.login .tagline { color: var(--text-muted); margin-bottom: var(--s7); }
.login .field-label { text-align: center; }
.pin-input { text-align: center; font-size: 32px; font-weight: 700; letter-spacing: 0.35em; }

/* ---- today work-list ---- */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.today-head h1 { margin: 0; }
.refreshbtn { flex: none; font-size: var(--fs-sm); font-weight: 800; color: var(--accent); padding: 10px 0; min-height: 44px; white-space: nowrap; }
.tj-row { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s2) 0; }
.tj-check { flex: none; font-size: 30px; line-height: 1; color: var(--text-muted); padding: 4px 6px 4px 0; min-height: 0; }
.tj-check.on { color: var(--success); }
.tj-body { flex: 1; min-width: 0; }
.tj-row.done .ag-name, .tj-row.done .ag-time, .tj-row.done .ag-svc { color: var(--text-muted); text-decoration: line-through; }
.addlink { display: inline-block; margin: 18px 0 6px; color: var(--accent); font-weight: 700; text-decoration: none; }

/* ---- calendar ---- */
.stats { display: flex; flex-wrap: wrap; gap: 18px 20px; margin: 0 0 var(--s5); }
.stat { font-size: var(--fs-eyebrow); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.stat b { display: block; font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--text); text-transform: none; }
.stat .ok-num { color: var(--success); }
.stat .warn-num { color: var(--error); }
.cal-head { display: flex; align-items: center; }
.cal-head .month { flex: 1; margin: 0; font-size: var(--fs-2xl); }
.navbtn { font-size: 32px; line-height: 1; padding: 4px 18px; font-weight: 700; }
.todaybtn { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; padding: var(--s3) 0; min-height: 44px; }
.dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.day { padding: 8px 0 2px; min-height: 52px; text-align: center; color: var(--text); font-weight: 500; }
.day .num { display: block; font-size: var(--fs-md); }
.day .marks { display: block; height: 16px; font-size: var(--fs-sm); line-height: 16px; color: var(--accent); font-weight: 800; letter-spacing: 1px; }
.day .marks .dot { font-size: var(--fs-sm); }
.day.dim { color: var(--text-disabled); }
.day.dim .marks { color: #a8ccd3; }
.day.blocked { background: var(--error); color: #fff; border-radius: 0; }
.day.blocked .num { color: #fff; font-weight: 800; }
.day.blocked .marks { position: relative; top: -3px; }
.day.blocked .marks .away { color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.day.blocked.sel { outline: 3px solid #7a0e0e; outline-offset: -3px; }
.day.blocked.sel .num { color: #fff; }
.day.blocked.today .num { color: #fff; }
.blocked-note { color: var(--error); font-weight: 700; margin: var(--s2) 0; }
.day.today .num { color: var(--accent); font-weight: 800; }
.day.sel .num {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* ---- day agenda ---- */
.ag-head { font-size: var(--fs-lg); font-weight: 800; text-transform: none; letter-spacing: 0; color: var(--text); margin-top: var(--s5); }
.ag-row { display: block; padding: 2px 0 0; }
.ag-main { display: block; width: 100%; padding: var(--s3) 0 6px; color: inherit; font-weight: 500; }
.ag-line { display: block; }
.ag-dots { margin-right: 8px; white-space: nowrap; }
.ag-dots .dot { font-size: var(--fs-md); }
.ag-paidtag { margin-left: 10px; font-size: var(--fs-eyebrow); font-weight: 800; letter-spacing: 0.08em; color: var(--success); }
.ag-actions { display: flex; flex-wrap: wrap; gap: var(--s5); padding: 0 0 var(--s3); }
.tick { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 700; padding: var(--s2) 0; min-height: 40px; }
.tick.on { color: var(--success); }
.dot { font-weight: 900; }
.ag-contact { display: flex; align-items: baseline; gap: var(--s4); margin-top: 4px; }
.ag-phone { flex: 1; font-size: var(--fs-sm); color: var(--accent); font-weight: 700; text-decoration: none; }
.ag-sms { flex: none; font-size: var(--fs-2xs); font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; padding: 6px 0 6px 6px; }
.ag-addr-row { display: flex; align-items: baseline; gap: var(--s3); margin-top: 4px; }
.ag-addr { flex: 1; font-size: var(--fs-sm); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
/* the job address in an easy-to-spot green card */
.ag-addr-card { display: flex; align-items: center; gap: var(--s2); margin: 6px 0 var(--s2); padding: var(--s3); background: var(--success-weak); border: 1px solid #8ce99a; border-radius: var(--r-md); }
.ag-addr-card .ag-addr { flex: 1; font-size: var(--fs-md); font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.ag-addr-card .addr-copy { flex: none; font-size: var(--fs-2xs); font-weight: 800; color: var(--success); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px; min-height: 0; }
.addr-copy { flex: none; font-size: var(--fs-2xs); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 0 6px 6px; min-height: 0; }
.ag-time { font-weight: 800; margin-right: var(--s3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-svc { color: var(--text-muted); margin-left: 10px; }
.ag-price { margin-left: 10px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-flag { margin-left: 10px; font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 800; }
.ag-row.pending .ag-name, .ag-row.pending .ag-svc { font-style: italic; color: var(--accent); }
.ag-row.done .ag-name, .ag-row.done .ag-time, .ag-row.done .ag-svc { color: var(--text-muted); }
.ag-count { margin-left: 10px; font-size: var(--fs-2xs); font-weight: 700; color: var(--text-muted); }
/* grouped person card: boats listed underneath the customer */
.ag-group { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px var(--s3) 4px; margin: var(--s3) 0; background: var(--surface); box-shadow: var(--shadow-sm); }
.ag-group.pending { border-color: #a5d8e6; background: #f4fbfd; }
.ag-boats { margin: 4px 0 4px; }
.ag-boat { border-top: 1px solid var(--border); padding: var(--s2) 0 2px; }
.ag-boat:first-child { border-top: 0; }
.ag-boat-line { display: block; }
.ag-boat-line .ag-svc { margin-left: 0; color: var(--text); }
.ag-boat.done .ag-boat-line { color: var(--text-muted); text-decoration: line-through; }
.ag-boat .ag-actions { gap: var(--s5); padding: 4px 0 var(--s2); }
.tj-group { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px var(--s3) var(--s2); margin: var(--s3) 0; background: var(--surface); box-shadow: var(--shadow-sm); }
.tj-boats { margin-top: 4px; }
.tj-boat { display: flex; align-items: center; gap: var(--s2); border-top: 1px solid var(--border); padding: 6px 0; }
.tj-boat:first-child { border-top: 0; }
.tj-boat-line { flex: 1; min-width: 0; }
.tj-boat-line .ag-svc { margin-left: 0; }
.tj-boat.done .tj-boat-line { color: var(--text-muted); text-decoration: line-through; }
.ok { color: var(--accent); font-size: var(--fs-md); font-weight: 700; padding: var(--s2) 0; min-height: 40px; }
.no { color: var(--error); font-size: var(--fs-md); font-weight: 700; padding: var(--s2) 0; min-height: 40px; }
.edit-link { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 700; padding: var(--s2) 0; min-height: 40px; white-space: nowrap; }
.hl { border-radius: 3px; padding: 0.05em 0.2em; color: var(--text); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s3) 2px 4px; font-size: var(--fs-xs); }
.legend .hl { font-weight: 700; }

/* ---- inbox ---- */
.job-head { display: flex; gap: var(--s3); width: 100%; padding: var(--s3) 0; align-items: flex-start; color: inherit; font-weight: 500; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: var(--r-md); background: var(--field-bg); flex: none; }
.job-info { flex: 1; display: block; min-width: 0; }
.job-status { display: block; font-size: var(--fs-eyebrow); font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); }
.job-status.working { color: var(--accent); font-style: italic; }
.job-status.bad { color: var(--error); }
.job-summary { display: block; font-size: var(--fs-md); overflow-wrap: anywhere; }
.job-when { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.job-detail { padding: 0 0 var(--s4) 74px; }
.kv { margin: 0 0 var(--s2); }
.kv .k {
  display: inline-block;
  min-width: 96px;
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.row-actions { display: flex; gap: 26px; }

/* ---- inbox: text-only job (no thumbnail) ---- */
.text-thumb { display: flex; align-items: center; justify-content: center; font-size: 26px; }

/* ---- share / paste ---- */
.share-preview { display: block; max-width: 100%; max-height: 44vh; margin: 6px auto var(--s4); border-radius: var(--r-lg); }
.paste-text { min-height: 150px; }
.paste-img { margin: 0 0 6px; }

/* ---- public booking page: selectable day grid ---- */
.bday {
  display: block;
  padding: 7px 0 3px;
  min-height: 48px;
  text-align: center;
  border-radius: var(--r-md);
  color: var(--text);
  font-weight: 600;
}
.bday .num { display: block; font-size: var(--fs-md); }
.bday .bmark { display: block; height: 15px; font-size: 10px; font-weight: 800; line-height: 15px; letter-spacing: 0.02em; }
.bday.open { background: var(--accent-weak); color: var(--accent); }           /* available — tappable */
.bday.open .num { color: var(--accent); font-weight: 800; }
.bday.near { background: var(--success-weak); color: var(--success); }         /* we're already in the area */
.bday.near .num { color: var(--success); }
.bday.near .bmark { color: var(--success); }
.bday.full { background: var(--error-weak); color: var(--error); }
.bday.full .num { color: var(--error); font-weight: 800; }
.bday.full .bmark { color: var(--error); font-weight: 800; }
.bday.blocked { background: #f8eaea; color: #d0a3a3; }
.bday.past, .bday.dim { background: none; color: var(--text-disabled); }
.bday[disabled] { cursor: default; }
.bday.today .num { text-decoration: underline; text-underline-offset: 4px; }
.bday.sel { outline: 3px solid var(--accent); outline-offset: -3px; }

/* booking legend swatches */
.legend .lg { font-size: var(--fs-xs); font-weight: 700; padding: 2px var(--s2); border-radius: 5px; }
.lg-open { background: var(--accent-weak); color: var(--accent); }
.lg-near { background: var(--success-weak); color: var(--success); }
.lg-full { background: var(--error-weak); color: var(--error); }

.bk-title { font-size: var(--fs-xl); margin: 2px 0 4px; }
.pick-day { font-size: var(--fs-sm); font-weight: 800; color: var(--accent); margin: var(--s2) 0 6px; }
.svc-toggle { display: block; width: 100%; text-align: left; background: var(--accent-weak); border: 0; border-radius: var(--r-md); padding: var(--s3) var(--s4); font-weight: 800; font-size: var(--fs-sm); color: var(--accent); min-height: 0; }
.svc-panel-wrap { margin: var(--s3) 0 6px; }
.svc-panel-wrap .svc-panel { margin: 4px 0 0; }

/* customer calendar: services + pricing panel */
.svc-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); margin: var(--s2) 0 var(--s4); }
.svc-panel-head { font-size: var(--fs-sm); font-weight: 800; margin-bottom: var(--s2); }
.svc-line { display: flex; gap: var(--s2); align-items: baseline; margin: var(--s2) 0; font-size: var(--fs-sm); }
.svc-chip { flex: none; font-weight: 800; padding: 4px 10px; border-radius: var(--r-sm); color: #fff; font-size: var(--fs-xs); }
.svc-chip.wrap { background: #1c7ed6; }
.svc-chip.winter { background: #e64980; }
.svc-tax { font-size: var(--fs-2xs); color: var(--text-muted); margin-top: var(--s2); }

/* day dots on the customer calendar */
.bdots { color: var(--accent); letter-spacing: 1px; }
.bnear { color: var(--success); font-weight: 800; margin-right: 2px; }

/* ---- customer booking builder (add boats) ---- */
.bk-list { margin: var(--s3) 0 var(--s3); }
/* each added boat is its own card */
.bk-item { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); margin-bottom: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.bk-item-desc { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.bk-item-price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-item-x { flex: none; min-height: 0; padding: 4px var(--s2); color: var(--error); font-weight: 800; }
.bk-item-edit { flex: none; min-height: 0; padding: 4px var(--s2); color: var(--accent); font-weight: 800; background: none; border: 0; cursor: pointer; }
/* multi-photo upload review: one row per photo with a category picker */
.up-list { margin: var(--s3) 0 var(--s4); }
.up-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--s3); background: var(--surface); }
.up-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.up-kind { flex: 1; min-height: 44px; margin: 0; padding: var(--s2) 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font: inherit; background: var(--surface); }
.up-x { flex: none; min-height: 0; padding: 6px 10px; color: var(--error); font-weight: 800; background: none; border: 0; cursor: pointer; }
.seadoo-btn { display: block; width: 100%; margin: 4px 0 var(--s3); border-color: #1c7ed6; color: #1c7ed6; }
.seadoo-btn.on { background: #1c7ed6; color: #fff; }
#offlineBar { background: #495057; color: #fff; text-align: center; font-size: var(--fs-xs); font-weight: 700; padding: var(--s2) var(--s3); }
#offlineBar.syncing { background: var(--accent); }
.bk-item-price .bk-item-priceinput { width: 74px; padding: 5px 6px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font: inherit; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; margin: 0; }
.bk-draft { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s4); margin: 6px 0 var(--s4); }
.bk-draft-head { font-weight: 900; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: var(--s3); }
.bk-draft-price { font-size: var(--fs-sm); margin: var(--s3) 0; }
/* the "ADD A BOAT" card — a clear, separated block that holds the boat + address + notes */
.bk-draft.addcard { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: var(--s4); margin: var(--s4) 0; box-shadow: var(--shadow-md); }
.bk-sep { border: 0; border-top: 1px solid var(--border); margin: var(--s4) 0 6px; }
/* booking-details card (owner + where kept + notes) at the top */
.bk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); margin: var(--s3) 0; box-shadow: var(--shadow-sm); }
.bk-card-head { font-weight: 900; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: var(--s3); }
/* hairline outline on the fields (consistent with the rest) */
.bk-card input:not([type=checkbox]), .bk-card textarea,
.bk-draft input, .bk-draft textarea,
.bk-item-priceinput { border: 1px solid var(--border-strong); background: var(--surface); }
.pay-row { display: flex; gap: var(--s2); margin: var(--s3) 0 6px; }
.pay-btn.on { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.del-link { color: var(--error) !important; }
.bk-owner { margin: 4px 0 var(--s3); }
.bk-owner .check { padding: 4px 0 2px; }
.bk-item-owner { font-weight: 800; color: var(--accent); }

/* customer "My bookings" cards with a big bold status banner */
.mine-card { border: 1px solid var(--border); border-radius: var(--r-lg); margin: var(--s3) 0; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.mine-status { font-size: var(--fs-2xl); font-weight: 900; text-align: center; padding: var(--s3); letter-spacing: .3px; }
.mine-status.wait { background: var(--warning-weak); color: var(--warning-ink); }
.mine-status.ok { background: var(--success); color: #fff; }
.mine-status.move { background: var(--error); color: #fff; }
.mine-status.info { background: var(--warning); color: #fff; }
.mine-body { padding: var(--s3) var(--s4) var(--s4); }
.mine-day { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.mine-svc { margin-top: 4px; color: var(--text-2); }
.mine-hint { margin: var(--s2) 0 0; color: var(--error); font-weight: 600; font-size: var(--fs-sm); }
.paid-badge { display: inline-block; background: var(--success); color: #fff; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .05em; padding: 2px var(--s2); border-radius: var(--r-sm); vertical-align: middle; }
/* big diagonal PAID stamp over the invoice (also captured into the PDF) */
.invoice { position: relative; color: var(--text); }
.inv-paid-stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-22deg); font-size: 84px; font-weight: 900; letter-spacing: 6px; color: rgba(43,138,62,0.28); border: 8px solid rgba(43,138,62,0.28); border-radius: var(--r-lg); padding: 6px 30px; pointer-events: none; z-index: 5; }
.mine-actions { display: flex; gap: var(--s2); margin-top: var(--s3); }
.mine-actions button { flex: 1; }
/* in the My-Bookings action row, quiet buttons read as outlined secondaries beside the filled primary */
.mine-actions button:not(.primary) { min-height: 50px; border: 1px solid var(--border-strong); border-radius: var(--r-md); text-align: center; color: var(--text-2); font-weight: 700; }

/* People (customers) directory + detail */
.cust-list { margin: 6px 0 var(--s4); }
.cust-row { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.cust-main { flex: 1; display: flex; flex-direction: column; }
.cust-name { font-weight: 800; font-size: var(--fs-md); color: var(--text); }
.cust-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.cust-count { flex: none; min-width: 26px; height: 26px; padding: 0 var(--s2); border-radius: var(--r-pill); background: var(--accent-weak); color: var(--accent); font-weight: 800; font-size: var(--fs-sm); display: flex; align-items: center; justify-content: center; }
.cust-info p { margin: 4px 0; }
.cust-bk { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.cust-bk-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.type-row { display: flex; gap: var(--s2); margin: 6px 0; }
.type-btn { border-color: #e8590c; color: #e8590c; }
.type-btn.on { background: #e8590c; color: #fff; border-color: #e8590c; }
.svc-row { display: flex; gap: var(--s2); margin: 6px 0; }
.svc-btn.wrap { color: #1c7ed6; border-color: #1c7ed6; }
.svc-btn.wrap.on { background: #1c7ed6; color: #fff; }
.svc-btn.winter { color: #e64980; border-color: #e64980; }
.svc-btn.winter.on { background: #e64980; color: #fff; }
.svc-help { display: flex; flex-wrap: wrap; gap: 6px var(--s4); margin: 4px 2px var(--s2); }
.svc-help a { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); text-decoration: none; }
.svc-info { background: var(--accent-weak); border-radius: var(--r-md); padding: var(--s3); margin: 4px 0 var(--s3); font-size: var(--fs-sm); line-height: 1.5; color: var(--text); }
.eng-row { display: flex; gap: var(--s2); margin: 6px 0; }
.eng-btn { border-color: var(--success); color: var(--success); }
.eng-btn.on { border-color: var(--success); color: #fff; background: var(--success); }
.bk-photo { display: block; max-width: 100%; max-height: 38vh; border-radius: var(--r-md); margin: var(--s2) 0; }
.bk-totals { margin: var(--s4) 0; }
.bk-totals > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: var(--fs-md); }
.bk-totals .bk-grand { font-size: var(--fs-xl); font-weight: 800; border-top: 2px solid var(--text); margin-top: 6px; padding-top: var(--s2); }
.req { color: var(--error); font-weight: 800; }

/* calendar 'near you' search row */
.pc-row { display: flex; gap: var(--s2); align-items: stretch; margin: 6px 0 0; }
.pc-row input { flex: 1; margin: 0; }
.pc-search-btn { flex: none; min-height: 48px; padding: 0 20px; border-radius: var(--r-md); background: var(--accent); color: #fff; font-weight: 800; }

/* address auto-complete suggestions */
.ac-list { margin: -12px 0 var(--s3); }
.ac-item { display: block; width: 100%; text-align: left; padding: var(--s3) var(--s4); background: var(--surface-2); border: 0; border-bottom: 1px solid var(--border); font: inherit; font-size: var(--fs-sm); color: var(--text); min-height: 0; }
.ac-item:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
.ac-item:last-child { border-bottom: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
.ac-empty { padding: var(--s3) var(--s4); background: var(--surface-2); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--text-muted); }
.ac-ok { color: var(--success); font-weight: 700; font-size: var(--fs-xs); margin: -6px 0 var(--s3); }

/* the "Request booking" button: greys out until ready, then lights up */
.book-btn {
  display: block; width: 100%; margin: var(--s2) 0 4px;
  border: 0; border-radius: var(--r-lg); padding: 18px;
  font: inherit; font-size: var(--fs-xl); font-weight: 800; text-align: center;
  background: #e9ecef; color: var(--text-disabled); cursor: default;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.book-btn.ready {
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* ---- operator: booking link + pair a phone (settings) ---- */
.linkbox {
  display: block;
  background: var(--field-bg);
  border-radius: var(--r-md);
  padding: var(--s4);
  margin: 6px 0 var(--s3);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.paircode { font-size: 30px; font-weight: 800; letter-spacing: 0.18em; color: var(--text); margin: 6px 0; }

/* move-to-another-date UI (boats + bookings) */
.detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); }
.move-btn { flex: none; color: var(--accent); font-weight: 800; font-size: var(--fs-sm); padding: var(--s2) 0; min-height: 40px; }
.move-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin: 6px 0 var(--s3); }
.ag-photo { display: block; width: 130px; height: 98px; object-fit: cover; border-radius: var(--r-sm); margin: 6px 0; background: var(--field-bg); cursor: pointer; }
.marina-edit { margin: 0 0 var(--s4); }

/* ---- boats: marina days + boat cards ---- */
.boat-tabs { display: flex; gap: var(--s2); margin: var(--s4) 0 6px; }
.boat-tab { flex: 1; min-height: 48px; border-radius: var(--r-md); background: var(--field-bg); color: var(--text-muted); font-weight: 800; text-align: center; }
.boat-tab.on { background: var(--accent); color: #fff; }
.site-row-wrap { display: flex; align-items: center; gap: var(--s2); }
.site-row-wrap .site-row { flex: 1; }
.site-paid-btn { flex: none; min-height: 40px; padding: var(--s2) var(--s4); border-radius: var(--r-sm); background: var(--field-bg); color: var(--success); font-weight: 800; }
.site-paid-btn.on { background: var(--success-weak); color: var(--success); }
.site-actions { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.site-step-back { background: none; border: 0; color: var(--text-muted); font-size: var(--fs-2xs); font-weight: 600; padding: 2px; cursor: pointer; }
.inv-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.inv-logo { max-height: 84px; max-width: 45%; object-fit: contain; }
.site-row { display: block; padding: var(--s3) 0; text-decoration: none; color: inherit; }
.site-row .site-loc { display: block; font-size: var(--fs-lg); font-weight: 800; color: var(--text); }
.site-row .site-meta { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* inbox: tabs badge, customer-request photo, day map */
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: var(--r-pill); background: #e8590c; color: #fff; font-size: var(--fs-2xs); font-weight: 800; line-height: 18px; text-align: center; vertical-align: middle; }
.req-photo { display: block; max-width: 100%; border-radius: var(--r-md); margin: var(--s3) 0 4px; }
.map-bar { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.map-bar input[type="date"] { flex: 1; min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; margin: 0; }
.day-map { height: 340px; width: 100%; border-radius: var(--r-lg); overflow: hidden; background: var(--field-bg); }
.leaflet-container { font: inherit; }
#mapList { margin-top: var(--s3); }
.map-row { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) 2px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.map-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.map-dot.ok { background: var(--success); }
.map-dot.pend { background: #e8590c; }
.map-name { font-weight: 700; color: var(--text); }
.map-addr { flex: 1; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-km { flex: none; font-weight: 800; color: var(--accent); }
.map-summary { font-weight: 800; color: var(--accent); margin: var(--s2) 0 2px; }
.map-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: var(--fs-2xs); }
.map-num.ok { background: var(--success); }
.map-num.pend { background: #e8590c; }
.route-pin div { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: var(--fs-xs); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.route-pin.done div { background: var(--success); }
.route-pin.pend div { background: #e8590c; }
.route-pin.base div { background: var(--accent); font-size: var(--fs-sm); }

.boat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s3); margin: var(--s4) 0 var(--s5); }
.boat-card { display: block; text-decoration: none; color: inherit; position: relative; }
.boat-cover {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--r-lg); background: var(--field-bg);
}
.boat-cover.noimg { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.boat-card .boat-name { display: block; font-size: var(--fs-sm); font-weight: 800; margin: 6px 2px 0; overflow-wrap: anywhere; }
.boat-card .boat-sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin: 0 2px; font-variant-numeric: tabular-nums; }

.boat-hero { display: block; width: 100%; max-height: 46vh; object-fit: cover; border-radius: var(--r-lg); background: var(--field-bg); margin: 4px 0 var(--s4); }
.boat-hero.noimg { display: flex; align-items: center; justify-content: center; font-size: 72px; height: 30vh; }

.capture-row { display: flex; flex-wrap: wrap; gap: var(--s2) 10px; margin: 4px 0 var(--s2); }
.capture-row button {
  min-height: 44px; padding: 10px var(--s3); border-radius: var(--r-md); background: var(--accent-weak);
  color: var(--accent); font-weight: 800; font-size: var(--fs-sm); text-align: center;
}

.photo-tile .photo-del {
  position: absolute; top: 4px; right: 4px; min-height: 0; padding: 4px var(--s2);
  background: rgba(20,24,26,.6); color: #fff; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 800;
}
.reading { font-size: var(--fs-2xs); font-weight: 700; color: var(--accent); text-transform: none; letter-spacing: 0; }
.reading.warn { color: var(--error); }
.read-val { font-size: var(--fs-xs); font-weight: 700; color: var(--success); }

/* ---- invoice ---- */
.inv-title { font-size: var(--fs-display); font-weight: 800; text-align: right; margin: 0 0 var(--s3); }
.inv-parties { display: flex; justify-content: space-between; gap: 20px; margin-bottom: var(--s4); font-size: var(--fs-sm); line-height: 1.5; }
.inv-parties .inv-strong { font-weight: 800; }
.inv-to { text-align: right; }
.inv-tolabel { margin-top: var(--s2); font-weight: 700; }
.inv-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: var(--s2) 0 var(--s3); }
.inv-table th { text-align: left; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 2px solid var(--text); padding: 6px var(--s2); }
.inv-table td { padding: 6px var(--s2); border-bottom: 1px solid var(--border); }
.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-totals { margin: var(--s4) 0 6px; font-size: var(--fs-sm); }
.inv-totals > div { display: flex; justify-content: flex-end; gap: var(--s5); padding: 4px var(--s2); }
.inv-totals b { min-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.inv-due { font-size: var(--fs-lg); font-weight: 800; border-top: 2px solid var(--text); margin-top: 4px; padding-top: var(--s2) !important; }
.inv-actions { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s4); }

@media print {
  #nav, #bnav, .noprint, #offlineBar { display: none !important; }
  body { padding: 0; max-width: none; }
  .invoice { padding: var(--s2); }
}

/* the hidden photo inputs (and anything else with [hidden]) must never show, whatever input styles say */
[hidden] { display: none !important; }

/* customer boat: last job + photos grouped by year */
.last-job { font-size: var(--fs-md, 17px); margin: var(--s3) 0 var(--s4); line-height: 1.4; }
.photo-year { font-size: var(--fs-sm); font-weight: 800; letter-spacing: .06em; color: var(--text-muted); margin: var(--s4) 0 0; }
.photo-year + .boat-grid { margin-top: var(--s2); }

/* public page: a returning customer's saved boats */
.rb-list { display: flex; flex-direction: column; gap: var(--s3); margin: var(--s2) 0 var(--s5); }
.rb { display: flex; align-items: center; gap: var(--s3); }
.rb-img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.rb-img.noimg, .bk-item-img.noimg { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.rb-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); min-width: 0; overflow-wrap: anywhere; }
.rb-text b:first-child { font-size: var(--fs-md); }
.bk-item-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.bk-item-last { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }