/* Rider Cam app styles. Colours, font and radii come from theme.css (made from theme.json). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--c-ink);
  background: var(--c-surface);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; }
:where(svg[viewBox]) { width: 24px; height: 24px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700; text-decoration: none; line-height: 1.15; text-align: center;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--c-primary-strong); color: var(--c-on-primary); }
.btn-primary:active { background: var(--c-primary-pressed); }
.btn-primary:disabled { background: var(--c-primary-disabled); cursor: default; }
.btn-soft { background: var(--c-surface-alt); color: var(--c-ink-muted); }
.btn-soft:active { background: var(--c-divider); }
.btn-dark { background: var(--c-surface-dark); color: var(--c-on-dark); }
.btn-outline { background: var(--c-surface); color: var(--c-ink); border: 2px solid var(--c-ink); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-ink); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-icon { width: 48px; padding: 0; }
.link-strong { font-weight: 700; color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-brand { font-weight: 700; color: var(--c-primary-strong); text-decoration: none; }

/* ---------- Form fields ---------- */
.field { position: relative; display: block; }
.input, .select, .textarea {
  display: block; width: 100%; height: 54px; padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface); color: var(--c-ink); font-size: 16px;
}
.textarea { height: auto; min-height: 96px; padding: 12px; resize: vertical; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: var(--c-ink-subtle); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.field .pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent; color: var(--c-ink-muted);
  display: grid; place-items: center; border-radius: 6px;
}
.field .pw-toggle svg { width: 20px; height: 20px; }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--c-ink); margin: 0 0 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--c-ink); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--c-primary-strong); }
.form-error { color: var(--c-danger); font-size: 16px; line-height: 24px; margin: 0; }
.form-hint { font-size: 14px; line-height: 20px; color: var(--c-ink-muted); margin: 20px 0 0; }
.form-ok { color: var(--c-success); font-size: 15px; margin: 0; }

/* ---------- Brand ---------- */
.brand-row { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-row img { width: 38px; height: 38px; }
.brand-row .wordmark { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: var(--c-ink); }

/* =========================================================================
   Sign-in: one simple page (logo, email, password, forgot password, guest link)
   ========================================================================= */
.si-page {
  min-height: 100vh; min-height: 100dvh; padding: 56px 16px 40px;
  background: linear-gradient(var(--c-surface-dark) 0, var(--c-surface-dark) 280px, var(--c-surface-alt) 280px);
}
.si-brand { text-align: center; color: var(--c-on-dark); }
.si-brand img { width: 76px; height: 76px; display: block; margin: 0 auto 14px; border-radius: 18px; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.si-brand h1 { margin: 0; font-size: 30px; line-height: 34px; font-weight: 800; letter-spacing: -0.4px; }
.si-brand p { margin: 6px 0 0; font-size: 15px; font-weight: 700; color: var(--c-primary); }
.si-card {
  max-width: 420px; margin: 28px auto 0; background: var(--c-surface); border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 24px 20px; border-top: 5px solid var(--c-primary);
}
.si-card h2 { font-size: 20px; margin: 0 0 16px; color: var(--c-ink); }
.si-card .field-label { margin-top: 14px; }
.si-card .field-label:first-of-type { margin-top: 0; }
.si-card .input { height: 56px; font-size: 17px; }
.si-card .btn-primary { width: 100%; min-height: 56px; font-size: 17px; margin-top: 20px; }
.si-links { display: flex; justify-content: flex-end; margin-top: 10px; }
.si-links button, .si-back { border: 0; background: none; padding: 10px 0; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--c-primary-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.si-back { display: block; margin: 8px auto 0; }
.si-guest { max-width: 420px; margin: 16px auto 0; }
.si-guest .btn { width: 100%; min-height: 52px; background: var(--c-surface); }
.si-guest p { text-align: center; font-size: 13px; color: var(--c-ink-subtle); margin: 8px 0 0; }

/* Shared by the guest-link and collaborator pages */
.onb-center { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 64px 24px; position: relative; }
.onb-narrow { width: 100%; max-width: 436px; }
.logo-tile { display: block; width: 64px; height: 64px; margin: 0 auto 24px; }
.onb-title { font-size: 24px; line-height: 30px; font-weight: 700; text-align: center; margin: 0 0 40px; color: var(--c-ink); }
.alert { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r-md); font-size: 14px; line-height: 20px; color: var(--c-ink-muted); margin-top: 16px; }
.alert .alert-ico { flex: none; width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.alert .alert-ico svg { width: 20px; height: 20px; }
.alert-danger { background: var(--c-danger-soft); border: 1px solid #f3a29b; }
.alert-danger .alert-ico { background: var(--c-danger); }
.alert-info { background: var(--c-primary-soft); border: 1px solid #f6c3a3; }
.alert-info .alert-ico { background: var(--c-primary-strong); }
.alert-ok { background: #e9f7ee; border: 1px solid #9fd6b1; }
.alert-ok .alert-ico { background: var(--c-success); }
.muted-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 16px; font-size: 14px; font-weight: 700; color: var(--c-ink-muted); text-decoration: none; }

/* =========================================================================
   Signed-in app
   ========================================================================= */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--c-surface-alt); }
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--c-surface-dark); color: var(--c-on-dark);
  padding: env(safe-area-inset-top) 12px 0; border-bottom: 4px solid var(--c-primary);
}
.topbar-in { display: flex; align-items: center; gap: 8px; min-height: 60px; max-width: 1200px; margin: 0 auto; }
.topbar .brand-row .wordmark { color: #fff; font-size: 21px; }
.topbar .brand-row img { width: 34px; height: 34px; }
.topbar .spacer { flex: 1; }
.topbar .tb-btn { min-width: 48px; min-height: 48px; border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px; padding: 0 8px; }
.topbar .tb-btn svg { width: 24px; height: 24px; }
.topbar .tb-btn.active { background: rgba(255,255,255,.12); }
.topnav { display: none; gap: 4px; margin-left: 16px; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.12); color: #fff; border: 0; }
.sync-pill svg { width: 18px; height: 18px; }
.sync-pill.offline { background: var(--c-danger); }
.sync-pill.pending { background: var(--c-primary-strong); }
.page { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 16px 120px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { font-size: 26px; line-height: 1.15; margin: 0; flex: 1; min-width: 0; }
.card { background: var(--c-surface); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.muted { color: var(--c-ink-muted); }
.subtle { color: var(--c-ink-subtle); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.empty { text-align: center; padding: 48px 16px; color: var(--c-ink-muted); }
.empty svg { width: 48px; height: 48px; color: var(--c-primary); }
.empty h2 { color: var(--c-ink); font-size: 20px; margin: 8px 0 4px; }

/* Bottom tab bar (phones) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--c-surface-dark); display: flex; padding: 0 0 env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; color: #cfcfcf; text-decoration: none; font-size: 12px; font-weight: 700; }
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.active { color: var(--c-primary); }

/* Search + chips */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--c-ink-subtle); pointer-events: none; }
.search .input { padding-left: 46px; height: 56px; font-size: 17px; border-radius: 12px; border-width: 2px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--c-border); background: var(--c-surface); font-size: 14px; font-weight: 700; color: var(--c-ink); white-space: nowrap; }
.chip.on { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; }
.label-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--c-surface-alt); color: var(--c-ink); }
.label-pill .sw { width: 8px; height: 8px; border-radius: 50%; }
.tag-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 700; color: #fff; background: var(--c-ink); }
.loc-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-ink-muted); margin: 8px 2px 0; }
.loc-note svg { width: 16px; height: 16px; color: var(--c-primary-strong); }

/* Job list */
.job-list { display: grid; gap: 10px; margin-top: 12px; }
.job-card { display: flex; gap: 12px; padding: 12px; text-decoration: none; color: inherit; min-height: 96px; align-items: center; }
.job-card:active { background: var(--c-primary-soft); }
.job-thumb { flex: none; width: 76px; height: 76px; border-radius: 10px; background: var(--c-surface-alt) center/cover no-repeat; display: grid; place-items: center; color: var(--c-ink-subtle); }
.job-thumb svg { width: 30px; height: 30px; }
.job-card h3 { margin: 0; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card .addr { font-size: 14px; color: var(--c-ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--c-ink-subtle); }
.job-card .dist { flex: none; text-align: right; font-weight: 800; font-size: 15px; color: var(--c-ink); }
.job-card .dist small { display: block; font-weight: 600; font-size: 11px; color: var(--c-ink-subtle); }
.fab { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 25; min-height: 56px; border-radius: 999px; padding: 0 22px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }

/* Job page */
.job-head { padding: 16px; }
.job-head h1 { font-size: 24px; line-height: 1.15; margin: 0; }
.job-head .addr { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--c-ink-muted); font-size: 15px; text-decoration: none; }
.job-head .addr svg { width: 18px; height: 18px; color: var(--c-primary-strong); flex: none; }
.big-cam {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 26;
  min-height: 72px; border-radius: 18px; font-size: 20px; font-weight: 800; gap: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,.3); max-width: 560px; margin: 0 auto;
}
.big-cam svg { width: 32px; height: 32px; }
.seg { display: flex; gap: 4px; background: var(--c-surface); border-radius: 12px; padding: 4px; margin: 12px 0; overflow-x: auto; }
.seg button { flex: 1 1 0; min-width: 0; min-height: 48px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--c-ink-muted); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 420px) { .seg button { font-size: 15px; } }
.seg button.on { background: var(--c-ink); color: #fff; }
.day-h { font-size: 15px; font-weight: 800; margin: 18px 2px 8px; color: var(--c-ink); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; aspect-ratio: 1; background: #222 center/cover no-repeat; border: 0; padding: 0; border-radius: 6px; overflow: hidden; color: #fff; text-align: left; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; background: linear-gradient(transparent, rgba(0,0,0,.82)); font-size: 11px; line-height: 13px; font-weight: 700; }
.tile .cap span { display: block; font-weight: 500; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .badge { position: absolute; top: 5px; left: 5px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.7); font-size: 11px; font-weight: 700; }
.tile .badge svg { width: 13px; height: 13px; }
.tile .badge.wait { background: var(--c-primary-strong); }
.tile .sel { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); display: grid; place-items: center; }
.tile .sel svg { width: 18px; height: 18px; opacity: 0; }
.tile.selected { outline: 4px solid var(--c-primary); outline-offset: -4px; }
.tile.selected .sel { background: var(--c-primary); border-color: var(--c-primary); }
.tile.selected .sel svg { opacity: 1; }
.select-bar { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 27; background: var(--c-ink); color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-bottom: 1px solid var(--c-divider); text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row svg.lead { width: 26px; height: 26px; color: var(--c-primary-strong); flex: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--c-ink-subtle); font-weight: 600; }
.kv dd { margin: 0; color: var(--c-ink); }
.section { padding: 16px; }
.section h2 { font-size: 18px; margin: 0 0 12px; }
.map-frame { width: 100%; height: 220px; border: 0; border-radius: 12px; background: var(--c-surface-alt); display: block; }

/* Comments */
.comments { display: grid; gap: 10px; }
.cmt { padding: 10px 12px; border-radius: 12px; background: var(--c-surface-alt); }
.cmt .who { font-weight: 800; font-size: 14px; }
.cmt .when { font-size: 12px; color: var(--c-ink-subtle); }
.cmt .body { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.cmt .acts { display: flex; gap: 14px; margin-top: 4px; }
.cmt .acts button { border: 0; background: transparent; padding: 6px 0; min-height: 32px; font-size: 13px; font-weight: 700; color: var(--c-primary-strong); }
.cmt .acts button.del { color: var(--c-ink-subtle); }
.replies { margin-left: 14px; padding-left: 12px; border-left: 3px solid var(--c-divider); display: grid; gap: 8px; margin-top: 8px; }
.compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.compose .textarea { min-height: 52px; height: 52px; }

/* Viewer */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; }
.viewer-top { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; background: #000; }
.viewer-top .title { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; }
.viewer-top .title b { display: block; font-size: 15px; }
.viewer-top button, .viewer-top a { min-width: 48px; min-height: 48px; border: 0; background: transparent; color: #fff; display: grid; place-items: center; border-radius: 10px; }
.viewer-top svg { width: 26px; height: 26px; }
.viewer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.viewer-media { position: relative; background: #000; display: flex; align-items: center; justify-content: center; min-height: 45vh; max-height: 72vh; }
.viewer-media img, .viewer-media video { width: 100%; height: 72vh; object-fit: contain; display: block; }
.stamp-overlay { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 10px 6px 12px; background: rgba(0,0,0,.66); border-left: 4px solid var(--c-primary); font-size: 12px; line-height: 16px; font-weight: 700; color: #fff; pointer-events: none; }
.viewer-info { background: var(--c-surface); color: var(--c-ink); border-radius: 18px 18px 0 0; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.ts-block { display: flex; gap: 12px; align-items: flex-start; }
.ts-block svg { width: 24px; height: 24px; color: var(--c-primary-strong); flex: none; margin-top: 2px; }
.ts-block b { font-size: 17px; }
.toggle-row { display: flex; gap: 8px; margin: 10px 0 0; }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fff4e5; color: #7a3d00; font-size: 13px; margin-top: 10px; }
.warn svg { width: 18px; height: 18px; flex: none; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }

/* Camera */
.cam { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column; overscroll-behavior: none; touch-action: manipulation; }
.cam-top { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; position: relative; z-index: 2; }
.cam-top .job { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; line-height: 18px; }
.cam-top .job span { display: block; font-weight: 500; font-size: 12px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-btn { min-width: 52px; min-height: 52px; border: 0; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 15px; padding: 0 12px; }
.cam-btn svg { width: 26px; height: 26px; }
.cam-done { background: var(--c-primary-strong); padding: 0 18px; }
.cam-view { flex: 1; position: relative; overflow: hidden; background: #111; }
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-view .stamp-overlay { bottom: 12px; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s; }
.cam-flash.go { opacity: .85; transition: none; }
.cam-rec { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--c-danger); padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 15px; }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 14px; }
.cam-msg p { max-width: 340px; margin: 0; font-size: 16px; line-height: 1.45; }
.cam-bottom { padding: 14px 16px calc(env(safe-area-inset-bottom) + 16px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; background: #000; }
.cam-modes { display: flex; justify-content: center; gap: 6px; grid-column: 1 / -1; }
.cam-modes button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: #bbb; font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.cam-modes button.on { background: rgba(255,255,255,.16); color: var(--c-primary); }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: var(--c-primary); display: grid; place-items: center; padding: 0; }
.shutter:active { transform: scale(.94); }
.shutter.video { background: var(--c-danger); }
.shutter.recording { background: #fff; }
.shutter.recording::after { content: ""; width: 30px; height: 30px; border-radius: 6px; background: var(--c-danger); }
.cam-last { justify-self: start; position: relative; width: 56px; height: 56px; border-radius: 10px; border: 2px solid #fff; background: #333 center/cover no-repeat; padding: 0; }
.cam-last .count { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--c-primary); color: #000; font-size: 13px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.cam-side { justify-self: end; }

/* Modal / sheet */
.sheet-back { position: fixed; inset: 0; z-index: 80; background: var(--c-overlay); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--c-surface); border-radius: 18px 18px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.sheet h2 .grow { flex: 1; }
.sheet .x { width: 44px; height: 44px; border: 0; background: var(--c-surface-alt); border-radius: 50%; display: grid; place-items: center; }
.sheet .x svg { width: 18px; height: 18px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
.toast-wrap { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 72px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; background: var(--c-ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; box-shadow: 0 8px 20px rgba(0,0,0,.25); max-width: 520px; border-left: 5px solid var(--c-primary); }
.toast.err { border-left-color: var(--c-danger); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--c-divider); border-top-color: var(--c-primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.table { width: 100%; border-collapse: collapse; }
.role-select { height: 44px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--c-border); background: #fff; font-size: 15px; }

@media (min-width: 769px) {
  .tabbar { display: none; }
  .topnav { display: flex; }
  .page { padding: 24px 24px 120px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
  .job-list { grid-template-columns: repeat(2, 1fr); }
  .fab { bottom: 24px; right: 24px; }
  .big-cam { bottom: 20px; }
  .select-bar { bottom: 0; }
  .sheet-back { align-items: center; }
  .sheet { border-radius: 18px; }
  .viewer-body { display: flex; overflow: hidden; }
  .viewer-media { flex: 1; max-height: none; min-height: 0; }
  .viewer-media img, .viewer-media video { height: calc(100vh - 70px); }
  .viewer-info { width: 400px; flex: none; border-radius: 0; overflow-y: auto; }
}
@media (min-width: 1100px) { .job-list { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Install-the-app card */
.install-card { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; margin-bottom: 12px; border-left: 5px solid var(--c-primary); }
.install-card .install-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--c-primary-soft); color: var(--c-primary-strong); display: grid; place-items: center; flex: none; }

/* Report builder */
.rb-section { margin-top: 12px; }
.rb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; min-height: 60px; }
@media (min-width: 560px) { .rb-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .rb-grid { grid-template-columns: repeat(5, 1fr); } }
.rb-tile { background: var(--c-surface-alt); border-radius: 10px; overflow: hidden; cursor: grab; border: 2px solid transparent; }
.rb-tile.dragging { opacity: .4; }
.rb-tile.drop-before { border-left-color: var(--c-primary); border-left-width: 6px; }
.rb-img { position: relative; aspect-ratio: 4 / 3; background: #222 center/cover no-repeat; }
.rb-num { position: absolute; top: 6px; left: 6px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--c-primary); color: #000; font-weight: 800; font-size: 13px; display: grid; place-items: center; padding: 0 6px; }
.rb-cap { padding: 6px 8px 0; font-size: 12px; line-height: 15px; }
.rb-cap b, .rb-cap span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-cap span { color: var(--c-ink-muted); }
.rb-tools { display: flex; justify-content: space-between; padding: 2px 4px 4px; }
.rb-tools button { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 8px; color: var(--c-ink); display: grid; place-items: center; }
.rb-tools button:active { background: var(--c-divider); }
.rb-tools svg { width: 20px; height: 20px; }
.rb-add { min-height: 120px; border: 2px dashed var(--c-border); border-radius: 10px; background: var(--c-surface); font-weight: 700; color: var(--c-ink-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.rb-layouts { display: flex; gap: 8px; flex-wrap: wrap; }
.rb-layout { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; min-height: 76px; padding: 8px; border: 2px solid var(--c-border); border-radius: 10px; background: var(--c-surface); font-weight: 800; }
.rb-layout.on { border-color: var(--c-primary-strong); background: var(--c-primary-soft); }
.rb-mini { width: 30px; height: 38px; border: 2px solid var(--c-ink); border-radius: 3px; padding: 2px; display: grid; gap: 2px; }
.rb-mini i { background: var(--c-primary); border-radius: 1px; }
.rb-mini.l1 { grid-template: 1fr / 1fr; } .rb-mini.l2 { grid-template: repeat(2, 1fr) / 1fr; } .rb-mini.l3 { grid-template: repeat(3, 1fr) / 1fr; }
.rb-mini.l4 { grid-template: repeat(2, 1fr) / repeat(2, 1fr); } .rb-mini.l6 { grid-template: repeat(3, 1fr) / repeat(2, 1fr); }
.rb-bar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 20; margin: 16px -16px 0; padding: 10px 16px; background: var(--c-surface); border-top: 1px solid var(--c-divider); display: flex; align-items: center; gap: 8px; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
@media (min-width: 769px) { .rb-bar { bottom: 0; margin: 16px 0 0; border-radius: 12px; } }
.rb-add, .rb-tile, .rb-section .input { scroll-margin-bottom: 140px; }
.page input, .page button, .page label, .page a { scroll-margin-bottom: 150px; }

/* ---- Rider Cam brand: logo font (Futura where the device has it, Jost elsewhere) ---- */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/jost-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/jost-latin-800-normal.woff2") format("woff2"); }
.brand-row .wordmark, .si-brand h1, .page-head h1, .job-head h1, .si-card h2, .section h2, .sheet h2, .empty h2, .onb-title, .day-h {
  font-family: var(--font-display); font-weight: 700;
}
.brand-row .wordmark, .si-brand h1 { text-transform: uppercase; letter-spacing: 0.02em; }
.brand-row img, .logo-tile, .si-brand img { object-fit: contain; background: #fff; border-radius: 22%; padding: 3px; box-sizing: border-box; border: 0; }
.si-brand img { width: 92px; height: 92px; padding: 6px; }

/* ---- Companies: the strip that says which company you are in, and the switcher ---- */
.co-bar { background: var(--c-surface); border-bottom: 1px solid var(--c-divider); }
.co-bar button { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 1200px; margin: 0 auto; min-height: 52px; padding: 6px 16px; border: 0; background: transparent; font: inherit; color: var(--c-ink); text-align: left; cursor: pointer; }
.co-bar img, .co-row img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.co-bar .co-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-bar .co-switch { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 14px; color: var(--c-primary-strong); }
.co-bar .co-switch svg { width: 18px; height: 18px; }
.co-row { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.co-row img { width: 44px; height: 44px; }
.co-row[aria-pressed="true"] { background: var(--c-primary-soft); }
.co-row svg { width: 22px; height: 22px; flex: none; }
.co-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--c-surface-alt); color: var(--c-ink-muted); font-size: 12px; font-weight: 700; }
