/*
 * Staff app design system. Loaded after app.css on the staff app only.
 * Plain CSS, no build step. Photo-led in the spirit of CompanyCam: light sidebar on desktop,
 * bottom tab bar with a camera button on phones, jobs shown as photo cards.
 */
:root {
  --ui-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --ui-bg: #F4F6F9;
  --ui-surface: #FFFFFF;
  --ui-sunken: #F7F9FB;
  --ui-ink: #17212B;
  --ui-ink-2: #3A4754;
  --ui-muted: #67747F;
  --ui-faint: #9AA5B0;
  --ui-line: #E1E6EC;
  --ui-line-2: #EDF0F4;
  --ui-side: #FFFFFF;
  --ui-side-2: var(--ui-accent-soft);
  --ui-side-ink: #3A4754;
  --ui-side-muted: #8592A0;
  --ui-accent: var(--brand, #38049C);
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 9%, #fff);
  --ui-r: 10px;
  --ui-r-sm: 8px;
  --ui-shadow: 0 1px 2px rgba(23, 33, 43, .06);
  --ui-shadow-lg: 0 10px 28px rgba(23, 33, 43, .16);
  --ui-side-w: 248px;
  --ui-tabs-h: 64px;

  --s-request: #6941C6; --s-request-bg: #F4F3FF;
  --s-scheduled: #175CD3; --s-scheduled-bg: #EFF8FF;
  --s-onsite: #B54708; --s-onsite-bg: #FFFAEB;
  --s-done: #067647; --s-done-bg: #ECFDF3;
  --s-cancel: #667085; --s-cancel-bg: #F2F4F7;
  --s-bad: #B42318; --s-bad-bg: #FEF3F2;
}

body.ui-body { background: var(--ui-bg); color: var(--ui-ink); font-family: var(--ui-font); font-size: 14px; line-height: 1.5; }
.ui-body button, .ui-body input, .ui-body select, .ui-body textarea { font-family: var(--ui-font); }
body.ui-body a { color: inherit; }
body.ui-body .toast { bottom: calc(var(--ui-tabs-h) + 24px + var(--safe-b)); border-radius: 10px; box-shadow: var(--ui-shadow-lg); font-size: 14px; }
@media (min-width: 960px) { body.ui-body .toast { bottom: 28px; } }

/* ---------- controls ---------- */
.ui-body input, .ui-body select, .ui-body textarea {
  border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); background: var(--ui-surface);
  padding: 8px 10px; font-size: 14px;
}
.ui-body input:focus, .ui-body select:focus, .ui-body textarea:focus {
  border-color: var(--ui-accent); box-shadow: 0 0 0 1px var(--ui-accent);
}
.ui-body label { font-size: 13px; font-weight: 600; color: var(--ui-ink-2); }
.ui-body label > input, .ui-body label > select, .ui-body label > textarea { margin-top: 6px; }
.ui-body .btn {
  min-height: 38px; padding: 7px 15px; border-radius: 8px; border: 1px solid #D3DAE2; background: var(--ui-surface);
  color: var(--ui-ink); font-weight: 600; font-size: 14px; box-shadow: none; transition: background .12s;
}
.ui-body .btn:hover { background: var(--ui-sunken); }
.ui-body .btn.primary { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.ui-body .btn.primary:hover { background: color-mix(in srgb, var(--ui-accent) 88%, #000); }
.ui-body .btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ui-ink-2); }
.ui-body .btn.ghost:hover { background: rgba(16, 24, 40, .05); }
.ui-body .btn.danger { color: var(--s-bad); }
.ui-body .btn.lg { min-height: 42px; padding: 8px 18px; }
.ui-body .btn svg { flex: none; }

/* ---------- status pills ---------- */
.pill-status {
  display: inline-block; padding: 1px 8px; border-radius: 4px; line-height: 18px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--s-cancel-bg); color: var(--s-cancel);
}
.pill-status.st-pending { background: var(--s-request-bg); color: var(--s-request); }
.pill-status.st-scheduled { background: var(--s-scheduled-bg); color: var(--s-scheduled); }
.pill-status.st-progress { background: #FEF0C7; color: #93370D; }
.pill-status.st-done { background: var(--s-done-bg); color: var(--s-done); }
.pill-status.st-fail { background: var(--s-bad-bg); color: var(--s-bad); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 3px; font-size: 12px; font-weight: 600; background: #F2F4F7; color: var(--ui-ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--s-cancel); }
.dot.st-pending { background: var(--s-request); }
.dot.st-scheduled { background: var(--s-scheduled); }
.dot.st-progress { background: #F79009; }
.dot.st-done { background: #17B26A; }

/* ---------- shell ---------- */
.ui-app { min-height: 100vh; min-height: 100dvh; }
.ui-side { display: none; }
.ui-main { min-width: 0; padding-bottom: calc(var(--ui-tabs-h) + 24px + var(--safe-b)); }
.ui-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: calc(6px + var(--safe-t)) 12px 6px; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--ui-line);
}
.ui-top-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-top-brand { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; background: #fff; border: 1px solid var(--ui-line); }
.ui-top .icon-btn { width: 40px; height: 40px; border-radius: 10px; color: var(--ui-ink-2); }
.ui-top .icon-btn:hover { background: rgba(16, 24, 40, .05); }
.ui-top .save-state { font-size: 12px; color: var(--ui-muted); white-space: nowrap; }
.ui-avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; }

.ui-page { width: 100%; padding: 16px 14px 28px; }
.ui-page.narrow { max-width: none; }
@media (min-width: 600px) { .ui-page { padding: 20px 20px 32px; } }
.ui-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ui-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.ui-head .sub { margin-top: 4px; color: var(--ui-muted); font-size: 14px; }
.ui-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.ui-support-banner {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 9px 16px; background: #FFFAEB;
  color: #93370D; border-bottom: 1px solid #FEDF89; font-size: 13px;
}
.ui-support-banner a { margin-left: auto; font-weight: 700; }

/* bottom tabs (phones) */
.ui-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end; height: calc(var(--ui-tabs-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--ui-line);
}
.ui-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--ui-tabs-h);
  color: var(--ui-faint); font-size: 11px; font-weight: 600; text-decoration: none; position: relative;
  border: 0; background: none; cursor: pointer; font-family: inherit;
}
.ui-tab svg { width: 22px; height: 22px; }
.ui-tab.on { color: var(--ui-accent); }
.ui-tab.on svg { stroke-width: 2.4; }
.ui-tab .ui-count { position: absolute; top: 8px; left: calc(50% + 6px); }
.ui-cam {
  justify-self: center; display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 16px;
  border-radius: 50%; border: 4px solid #fff; background: var(--ui-accent); color: #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(23, 33, 43, .22);
}
.ui-cam svg { width: 26px; height: 26px; }
.ui-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

@media (min-width: 960px) {
  .ui-app { display: grid; grid-template-columns: var(--ui-side-w) minmax(0, 1fr); }
  .ui-side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--ui-side); color: var(--ui-side-ink); padding: 18px 14px; border-right: 1px solid var(--ui-line);
  }
  .ui-main { padding-bottom: 32px; }
  .ui-tabs { display: none; }
  .ui-top { min-height: 56px; padding: 8px 32px; background: var(--ui-bg); border-bottom-color: transparent; }
  .ui-top:not(.has-back) { display: none; }
  .ui-top-brand, .ui-top .ui-avatar-btn { display: none; }
  .ui-head .hide-desk { display: none; }
  .ui-top-title { font-size: 15px; font-weight: 600; color: var(--ui-muted); }
  .ui-page { padding: 28px 32px 48px; }
  .ui-top.has-back + .ui-page, .ui-top.has-back ~ .ui-page { padding-top: 4px; }
  .ui-head h1 { font-size: 26px; }
}
.ui-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; color: var(--ui-ink); }
.ui-brand img { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: contain; padding: 2px; border: 1px solid var(--ui-line); }
.ui-brand strong { display: block; font-size: 15px; line-height: 1.2; }
.ui-brand span { display: block; font-size: 12px; color: var(--ui-side-muted); }
.ui-side .ui-new { width: 100%; justify-content: center; margin-bottom: 18px; border: 0; }
.ui-nav { display: flex; flex-direction: column; gap: 2px; }
.ui-nav-label { margin: 12px 10px 8px; height: 1px; background: var(--ui-line); font-size: 0; }
.ui-nav a, .ui-nav button {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ui-side-ink);
  text-decoration: none; font-size: 14px; font-weight: 500; border: 0; background: none; width: 100%; text-align: left;
  cursor: pointer; font-family: inherit;
}
.ui-nav a svg, .ui-nav button svg { width: 18px; height: 18px; opacity: .85; }
.ui-nav a:hover, .ui-nav button:hover { background: #F1F4F7; color: var(--ui-ink); }
.ui-nav a.on { background: var(--ui-accent-soft); color: var(--ui-accent); font-weight: 600; }
.ui-nav a.on svg { opacity: 1; }
.ui-nav .ui-count { margin-left: auto; }
.ui-side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--ui-line); }
.ui-me { display: flex; align-items: center; gap: 10px; padding: 8px; }
.ui-me strong { display: block; color: var(--ui-ink); font-size: 13px; }
.ui-me > div { min-width: 0; }
.ui-me > div span { display: block; font-size: 12px; color: var(--ui-side-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

.av {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: #E0EAFF; color: #3538CD; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.av.sm { width: 26px; height: 26px; font-size: 10px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av-stack { display: inline-flex; }
.av-stack .av { border: 2px solid var(--ui-surface); margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }
.av, .av.c0, .av.c1, .av.c2, .av.c3, .av.c4, .av.c5 { background: #E3E8EE; color: #3A4754; }
.ui-side .av { background: var(--ui-accent-soft); color: var(--ui-accent); }

/* ---------- surfaces ---------- */
.box {
  background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r); box-shadow: var(--ui-shadow);
}
.box-pad { padding: 16px; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; }
.box-head h2 { font-size: 15px; font-weight: 700; }
.box-head a { font-size: 13px; font-weight: 600; color: var(--ui-accent); text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit; }
.box-body { padding: 14px 16px 16px; }
.ui-page > .box + .box { margin-top: 16px; }
#feed { display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--ui-ink); margin: 28px 0 12px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 420px) { .grid-2.collapse { grid-template-columns: 1fr; } }
.muted { color: var(--ui-muted); }
.hint { font-size: 13px; color: var(--ui-muted); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ui-muted); }
.empty-state > svg { width: 36px; height: 36px; color: var(--ui-faint); margin: 0 auto 10px; display: block; }
.empty-state p { max-width: 42ch; margin: 0 auto; }
.empty-state strong { display: block; color: var(--ui-ink); font-size: 15px; margin-bottom: 4px; }
.empty-state .btn { margin-top: 14px; }
.loading { display: grid; place-items: center; padding: 48px; }

/* segmented filters */
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px 14px; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 5px 11px; border-radius: 4px;
  border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-ink-2); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
}
.seg a { display: inline-flex; align-items: center; flex: none; padding: 5px 11px; border-radius: 4px; border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-ink-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.seg button[aria-selected="true"], .seg a[aria-current="page"] { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.seg button .n { font-size: 12px; color: var(--ui-faint); font-weight: 600; }
.seg button[aria-selected="true"] .n { color: rgba(255, 255, 255, .7); }

.searchbox { position: relative; flex: 1; min-width: 0; max-width: 520px; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ui-faint); pointer-events: none; }
.searchbox input { padding-left: 38px !important; margin: 0 !important; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- home ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 22px;
  background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: var(--ui-shadow); overflow: hidden;
}
.stats a { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; text-decoration: none; color: inherit; min-width: 0; }
.stats a + a { border-left: 1px solid var(--ui-line-2); }
.stats a:hover { background: var(--ui-sunken); }
.stats b { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.stats span { font-size: 12px; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats a.hot b { color: var(--ui-accent); }
@media (min-width: 700px) { .stats a { padding: 16px 20px; } .stats b { font-size: 28px; } .stats span { font-size: 13px; } }
.home-grid { display: grid; gap: 16px; }
@media (min-width: 1280px) { .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; } }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li + li { border-top: 1px solid var(--ui-line-2); }
.agenda-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; text-decoration: none; color: inherit; }
.agenda-row:hover { background: var(--ui-sunken); }
.agenda-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agenda-time small { display: block; font-size: 11px; font-weight: 600; color: var(--ui-muted); }
.agenda-main { min-width: 0; }
.agenda-main strong { display: flex; align-items: center; gap: 8px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-main p { font-size: 13px; color: var(--ui-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-side { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) { .agenda-side .av-stack { display: none; } }

.attention { list-style: none; margin: 0; padding: 0; }
.attention li { border-left: 3px solid var(--s-request); }
.attention li.warn { border-left-color: #F79009; }
.attention li.bad { border-left-color: var(--s-bad); }
.attention li + li { border-top: 1px solid var(--ui-line-2); }
.attention a { display: block; padding: 10px 14px; text-decoration: none; color: inherit; }
.attention a:hover { background: var(--ui-sunken); }
.attention strong { display: block; font-size: 14px; font-weight: 600; }
.attention p { font-size: 13px; color: var(--ui-muted); margin-top: 1px; }

.photo-mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-mosaic a { position: relative; display: block; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: #E5E7EB; }
.photo-mosaic img { width: 100%; height: 100%; object-fit: cover; }
.photo-mosaic span { position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- jobs list ---------- */
.jobs { display: flex; flex-direction: column; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; }
.jobs > .empty-state { background: var(--ui-surface); }
.job-item {
  display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px;
  text-decoration: none; color: inherit; border-top: 1px solid var(--ui-line-2);
}
.job-item:first-child { border-top: 0; }
.job-item:hover { background: var(--ui-sunken); }
.job-cover { position: relative; width: 60px; height: 60px; border-radius: 4px; overflow: hidden; background: #F2F4F7; display: grid; place-items: center; color: var(--ui-faint); }
.job-cover img { width: 100%; height: 100%; object-fit: cover; }
.job-cover b { position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 3px; background: rgba(11, 18, 32, .72); color: #fff; font-size: 11px; }
.job-cover svg { width: 24px; height: 24px; }
.job-text { min-width: 0; }
.job-line1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.job-line1 strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-no { font-size: 12px; color: var(--ui-faint); font-weight: 600; white-space: nowrap; }
.job-line2 { font-size: 13px; color: var(--ui-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-line3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 7px; font-size: 13px; color: var(--ui-ink-2); }
.job-line3 .when { display: inline-flex; align-items: center; gap: 5px; }
.job-line3 .when svg { width: 14px; height: 14px; color: var(--ui-faint); }
.job-meta { display: none; }
@media (min-width: 900px) {
  .job-item { grid-template-columns: 48px minmax(0, 1.5fr) minmax(0, 1fr) 140px 100px; padding: 8px 16px 8px 10px; }
  .job-cover { width: 48px; height: 48px; }
  .job-line3 { display: none; }
  .job-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; color: var(--ui-ink-2); }
  .job-meta small { color: var(--ui-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .job-meta.right { align-items: flex-end; }
}

/* ---------- job page ---------- */
.job-hero { margin-bottom: 16px; }
.crumb { display: none; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ui-muted); text-decoration: none; margin-bottom: 10px; }
.crumb svg { width: 16px; height: 16px; }
.job-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.job-title-row h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
@media (min-width: 960px) { .job-title-row h1 { font-size: 24px; } }
.job-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ui-muted); }
.job-subline { margin-top: 6px; color: var(--ui-muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.job-subline span { display: inline-flex; align-items: center; gap: 5px; }
.job-subline svg { width: 15px; height: 15px; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-row .btn { min-height: 38px; padding: 6px 13px; }
@media (max-width: 640px) {
  .quick-row { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .quick-row .btn { flex-direction: column; gap: 3px; font-size: 12px; min-height: 58px; }
}

.stage { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; }
.steps-ui { display: flex; align-items: center; gap: 4px 0; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; font-size: 13px; }
.steps-ui li { color: var(--ui-faint); font-weight: 500; }
.steps-ui li + li::before { content: '›'; margin: 0 8px; color: #C4C8CE; }
.steps-ui i { display: none; }
.steps-ui li.done { color: var(--ui-muted); }
.steps-ui li.done span::before { content: '✓ '; color: var(--s-done); }
.steps-ui li.now { color: var(--ui-ink); font-weight: 700; }
.steps-ui li.cancelled { color: var(--s-bad); font-weight: 700; }
.stage-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stage-actions .stage-note { font-size: 13px; color: var(--ui-muted); display: inline-flex; gap: 6px; align-items: center; }
.stage-actions .stage-note.ok { color: var(--s-done); }
.stage-actions .stage-note svg { width: 16px; height: 16px; }

.job-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.job-layout > * { min-width: 0; }
@media (min-width: 1080px) { .job-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .job-rail { position: sticky; top: 80px; } }
.job-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--ui-line); margin-bottom: 16px; position: sticky; top: 56px; z-index: 10; background: var(--ui-bg); }
@media (min-width: 960px) { .job-tabs { top: 64px; } }
.job-tabs::-webkit-scrollbar { display: none; }
.job-tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px 11px; border: 0; background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ui-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.job-tabs button[aria-selected="true"] { color: var(--ui-ink); border-bottom-color: var(--ui-accent); }
.job-tabs .n { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: #EAECF0; color: var(--ui-ink-2); }
.job-tabs .n:empty { display: none; }
.tab-panel[hidden] { display: none !important; }
@media (max-width: 1079px) { .job-layout:not([data-tab="overview"]) .job-rail { display: none; } }

.field-list { display: flex; flex-direction: column; gap: 12px; }

.time-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-top: 12px; border-radius: 10px; background: var(--ui-sunken); border: 1px solid var(--ui-line-2); font-size: 14px; }
.time-box span { display: inline-flex; align-items: center; gap: 6px; color: var(--ui-muted); }
.time-box svg { width: 16px; height: 16px; }
.time-box strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.crew-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.crew-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: 10px;
  font-size: 14px; font-weight: 550; color: var(--ui-ink); cursor: pointer;
}
.crew-row:has(input[type=checkbox]:checked) { border-color: color-mix(in srgb, var(--ui-accent) 45%, var(--ui-line)); background: var(--ui-accent-soft); }
.crew-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--ui-accent); flex: none; box-shadow: none; }
.crew-row .grow { flex: 1; min-width: 0; }
.crew-row em { font-style: normal; color: var(--ui-muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.crew-lead { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ui-muted); font-weight: 600; }
.crew-lead input { width: 16px; height: 16px; margin: 0; accent-color: var(--ui-accent); box-shadow: none; }

/* photos */
.drop {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px;
}
.drop label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 12px;
  border: 1px dashed #B9BEC5; border-radius: var(--ui-r); background: var(--ui-surface); cursor: pointer;
  color: var(--ui-ink-2); font-size: 14px; font-weight: 600; text-align: center;
}
.drop label:hover { border-color: var(--ui-accent); color: var(--ui-accent); }
.drop label svg { width: 26px; height: 26px; }
.drop label.primary-drop { background: var(--ui-accent-soft); border-color: color-mix(in srgb, var(--ui-accent) 40%, transparent); color: var(--ui-accent); }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ph { position: relative; margin: 0; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 4px; overflow: hidden; }
.ph > a { display: block; aspect-ratio: 4 / 3; background: #EAECF0; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph-video { aspect-ratio: 4 / 3; background: #111; }
.ph-video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; }
.ph textarea { border: 0 !important; border-top: 1px solid var(--ui-line-2) !important; border-radius: 0 !important; box-shadow: none !important; font-size: 13px !important; padding: 9px 10px !important; min-height: 0; resize: none; }
.ph .ph-del {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(11, 18, 32, .6); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.ph:hover .ph-del, .ph:focus-within .ph-del { opacity: 1; }
@media (hover: none) { .ph .ph-del { opacity: 1; } }
.ph .ph-del svg { width: 16px; height: 16px; }
.uploading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ui-muted); margin-bottom: 12px; }
.uploading:empty { display: none; }

/* checklist */
.ck-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 13px; color: var(--ui-muted); font-weight: 600; }
.ck-bar { flex: 1; height: 8px; border-radius: 999px; background: #EAECF0; overflow: hidden; }
.ck-bar i { display: block; height: 100%; background: #17B26A; border-radius: inherit; transition: width .25s; }
.ck-list { display: flex; flex-direction: column; }
.ck-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--ui-line-2); }
.ck-row:first-child { border-top: 0; }
.ck-row .ck-text { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; }
.ck-seg { display: inline-flex; border: 1px solid var(--ui-line); border-radius: 9px; overflow: hidden; flex: none; }
.ck-seg button { padding: 6px 11px; border: 0; background: var(--ui-surface); font: inherit; font-size: 12px; font-weight: 700; color: var(--ui-muted); cursor: pointer; }
.ck-seg button + button { border-left: 1px solid var(--ui-line); }
.ck-seg button.on.pass { background: #17B26A; color: #fff; }
.ck-seg button.on.fail { background: #F04438; color: #fff; }
.ck-seg button.on.na { background: #667085; color: #fff; }
.ck-row .icon-btn { width: 32px; height: 32px; color: var(--ui-faint); }
@media (max-width: 480px) { .ck-row { flex-wrap: wrap; } .ck-row .ck-text { flex-basis: calc(100% - 44px); } }
.add-line { display: flex; gap: 8px; margin-top: 12px; }
.add-line input, .add-line select { margin: 0 !important; }
.add-line .btn { flex: none; }

/* follow-ups */
.fu-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fu-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ui-sunken); border: 1px solid var(--ui-line-2); font-size: 14px; }
.fu-item .grow { flex: 1; min-width: 0; padding-top: 2px; }
.fu-item .icon-btn { width: 30px; height: 30px; color: var(--ui-faint); }
.prio { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; flex: none; margin-top: 1px; }
.prio-high { background: var(--s-bad-bg); color: var(--s-bad); }
.prio-medium { background: var(--s-onsite-bg); color: var(--s-onsite); }
.prio-low { background: #F2F4F7; color: #475467; }

/* sign-off */
.sig-canvas { width: 100%; height: 200px; border: 1.5px dashed #D0D5DD; border-radius: 12px; background: #fff; touch-action: none; display: block; margin: 10px 0 12px; }
.sig-done { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.sig-done img { max-width: 240px; max-height: 110px; border: 1px solid var(--ui-line); border-radius: 10px; background: #fff; }
.sig-done dl { display: grid; grid-template-columns: auto auto auto; gap: 4px 22px; margin: 0; font-size: 13px; }
.sig-done dt { color: var(--ui-muted); }
.sig-done dd { margin: 0; font-weight: 650; }

/* activity */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.timeline li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--ui-line-2); }
.timeline li:last-child::before { display: none; }
.timeline .t-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--s-done-bg); color: var(--s-done); }
.timeline .t-ico.bad { background: var(--s-bad-bg); color: var(--s-bad); }
.timeline .t-ico svg { width: 14px; height: 14px; }
.timeline strong { display: block; font-size: 14px; }
.timeline p { font-size: 13px; color: var(--ui-muted); margin-top: 1px; }

.danger-row { display: flex; justify-content: flex-end; margin-top: 18px; }

/* sticky phone dock with the next step */
.ui-dock {
  position: fixed; left: 0; right: 0; bottom: calc(var(--ui-tabs-h) + var(--safe-b)); z-index: 25; padding: 10px 14px;
  background: linear-gradient(to top, var(--ui-bg) 70%, rgba(244, 245, 247, 0));
}
.ui-dock .btn { width: 100%; min-height: 46px; font-size: 15px; border-radius: 6px; }
.ui-dock:empty { display: none; }
.has-dock .ui-page { padding-bottom: 96px; }
@media (min-width: 960px) { .ui-dock { display: none; } .has-dock .ui-page { padding-bottom: 40px; } }
@media (max-width: 959px) { .stage-actions .btn.primary.dock-dup { display: none; } }

/* ---------- schedule ---------- */
.sched-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sched-bar .range { font-size: 16px; font-weight: 700; margin-right: auto; }
.sched-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; }
@media (min-width: 960px) { .sched-scroll { margin: 0; padding: 0; } }
.sched-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; min-width: 1050px; }
@media (min-width: 1200px) { .sched-week { min-width: 0; } }
.sched-day { display: flex; flex-direction: column; gap: 6px; min-height: 180px; padding: 6px; border-radius: 4px; background: var(--ui-surface); border: 1px solid var(--ui-line); transition: border-color .15s, background .15s; }
.sched-day.is-today { border-color: color-mix(in srgb, var(--ui-accent) 50%, var(--ui-line)); }
.sched-day.is-selected { box-shadow: 0 0 0 2px var(--ui-accent); }
.sched-day.is-drop-target { background: var(--ui-accent-soft); border-color: var(--ui-accent); }
.sched-dayhead { display: flex; align-items: baseline; gap: 6px; padding: 4px 4px 6px; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; color: var(--ui-ink); }
.sched-dayhead span { font-size: 12px; font-weight: 700; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .04em; }
.sched-dayhead b { font-size: 18px; }
.sched-day.is-today .sched-dayhead b, .sched-day.is-today .sched-dayhead span { color: var(--ui-accent); }
.sched-dayhead em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ui-faint); font-weight: 600; }
.sched-chip {
  display: block; padding: 6px 8px; border-radius: 3px; text-decoration: none; color: var(--ui-ink); font-size: 13px; font-weight: 600;
  background: var(--s-scheduled-bg); border-left: 3px solid var(--s-scheduled); line-height: 1.3; cursor: pointer;
}
.sched-chip.st-progress { background: var(--s-onsite-bg); border-left-color: #F79009; }
.sched-chip.st-done { background: var(--s-done-bg); border-left-color: #17B26A; }
.sched-chip.st-pending { background: var(--s-request-bg); border-left-color: var(--s-request); }
.sched-chip time { display: block; font-size: 11px; color: var(--ui-muted); font-weight: 700; }
.sched-chip em { display: block; font-style: normal; font-size: 12px; color: var(--ui-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-chip[draggable="true"] { cursor: grab; }
.sched-chip.is-dragging { opacity: .45; }
.sched-chip.is-saving { opacity: .6; }
.sched-more { font-size: 12px; color: var(--ui-muted); padding: 2px 4px; }
.sched-sheet { margin-top: 18px; }
.sched-person h3 { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 14px 18px 8px; }
.sched-person h3 span { color: var(--ui-muted); font-weight: 500; font-size: 13px; }
.sched-stop { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--ui-line-2); }
.sched-stop .num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #F2F4F7; font-weight: 700; font-size: 13px; }
.sched-stop a.title { font-weight: 650; text-decoration: none; }
.sched-stop p { font-size: 13px; color: var(--ui-muted); }
.sched-stop .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sched-stop input[type=date] { padding: 6px 8px; font-size: 13px; width: auto; margin: 0; }
@media (max-width: 640px) { .sched-stop { grid-template-columns: 34px minmax(0, 1fr); } .sched-stop .acts { grid-column: 2; justify-content: flex-start; } }

/* ---------- lists (customers, team, reports, messages) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--ui-line-2); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; text-decoration: none; color: inherit; }
a.row:hover { background: var(--ui-sunken); }
.row .grow { flex: 1; min-width: 0; }
.row strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow > span { display: block; font-size: 13px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .row { flex-wrap: wrap; } .row .row-acts { width: 100%; justify-content: flex-start; padding-left: 44px; } }
.msg-body { font-size: 14px; margin-top: 6px; color: var(--ui-ink-2); white-space: pre-wrap; }
.msg-err { font-size: 13px; color: var(--s-bad); margin-top: 4px; }
.company-name { display: flex; gap: 8px; align-items: center; padding: 14px 18px 4px; }
.company-name input { font-weight: 700; font-size: 15px; margin: 0 !important; }

/* more menu (phones) */
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; text-decoration: none; color: var(--ui-ink);
  font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; text-align: left; cursor: pointer;
}
.menu-list li + li { border-top: 1px solid var(--ui-line-2); }
.menu-list svg { width: 20px; height: 20px; color: var(--ui-muted); }
.menu-list .chev { margin-left: auto; color: var(--ui-faint); }

/* ---------- bottom sheet ---------- */
.ui-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.ui-sheet[hidden] { display: none; }
.ui-sheet-scrim { position: absolute; inset: 0; background: rgba(11, 18, 32, .45); }
.ui-sheet-panel {
  position: relative; width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto; background: var(--ui-surface);
  border-radius: 10px 10px 0 0; padding: 8px 0 calc(16px + var(--safe-b)); box-shadow: var(--ui-shadow-lg);
  animation: sheet-up .2s ease-out;
}
@media (min-width: 640px) { .ui-sheet { align-items: center; } .ui-sheet-panel { border-radius: 8px; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ui-sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: #D0D5DD; margin: 4px auto 10px; }
.ui-sheet h2 { font-size: 17px; padding: 4px 18px 2px; }
.ui-sheet .hint { padding: 0 18px 10px; }
.ui-sheet .searchbox { margin: 0 18px 8px; max-width: none; }
@media (prefers-reduced-motion: reduce) { .ui-sheet-panel { animation: none; } }

/* new job form */
.form-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.form-card .field-list { gap: 14px; }
.check-line { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 500 !important; color: var(--ui-ink) !important; font-size: 14px !important; }
.check-line input { width: 18px; height: 18px; margin: 2px 0 0 !important; flex: none; accent-color: var(--ui-accent); box-shadow: none !important; }
.who-switch { display: inline-flex; padding: 3px; border-radius: 11px; background: #EAECF0; margin-bottom: 14px; }
.who-switch button { padding: 7px 14px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 650; color: var(--ui-ink-2); cursor: pointer; }
.who-switch button[aria-selected="true"] { background: var(--ui-surface); box-shadow: var(--ui-shadow); color: var(--ui-ink); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 640px) { .form-actions .btn { flex: 1; } }

/* ---------- public pages: request form ---------- */
.pub-body { background: var(--ui-bg); }
.pub-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px;
  background: var(--ui-surface); border-bottom: 1px solid var(--ui-line);
}
.pub-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ui-ink); font-weight: 700; font-size: 15px; min-width: 0; }
.pub-brand img { height: 34px; width: auto; max-width: 160px; object-fit: contain; }
.pub-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-brand-logo img { height: 38px; max-width: 220px; }
@media (max-width: 480px) { .pub-top .btn { font-size: 13px; padding: 5px 10px; } }
.pub-main { max-width: 680px; margin: 0 auto; padding: 28px 16px 40px; }
.pub-main h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.pub-lede { color: var(--ui-ink-2); margin: 6px 0 20px; font-size: 15px; }
.pub-lede a { color: var(--ui-accent); }
.pub-short { max-width: 180px; }
.pub-label { font-size: 13px; font-weight: 600; color: var(--ui-ink-2); }
.pub-attach { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pub-attach .btn { cursor: pointer; }
.pub-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.pub-previews:empty { display: none; }
.pub-previews figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #E5E7EB; border: 1px solid var(--ui-line); }
.pub-previews img { width: 100%; height: 100%; object-fit: cover; }
.pub-previews .is-video span { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 8px; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; background: #1F2328; color: #fff; }
.pub-previews .is-video small { color: #B8BEC6; font-weight: 500; margin-top: 2px; }
.pub-previews button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.pub-submit { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
@media (max-width: 480px) { .pub-submit .btn { width: 100%; } }
.pub-done h2 { font-size: 18px; margin-bottom: 6px; }
.pub-done p + p { margin-top: 8px; }
.pub-footer { max-width: 680px; margin: 0 auto; padding: 0 16px 32px; font-size: 13px; color: var(--ui-muted); }
.pub-footer a { color: inherit; }
.ui-body .err { color: var(--s-bad); font-size: 14px; }
.ui-body .err:empty { display: none; }

/* ---------- customer report (a document, so it prints to A4) ---------- */
.doc-body { background: #E9EBEE; }
.doc { max-width: 820px; margin: 24px auto; background: #fff; border: 1px solid var(--ui-line); padding: 40px 44px; }
@media (max-width: 720px) { .doc { margin: 0; border: 0; padding: 24px 18px; } }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--ui-ink); }
.doc-logo { max-height: 56px; max-width: 200px; object-fit: contain; }
.doc-from { text-align: right; font-size: 13px; color: var(--ui-ink-2); line-height: 1.5; }
.doc-from strong { display: block; color: var(--ui-ink); font-size: 14px; }
.doc-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 22px 0 6px; }
.doc-title h1 { font-size: 24px; font-weight: 700; }
.doc-title span { font-size: 14px; color: var(--ui-muted); font-variant-numeric: tabular-nums; }
.doc-intro { color: var(--ui-ink-2); margin-bottom: 8px; }
.doc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ui-line); margin: 18px 0 8px; }
.doc-facts > div { padding: 10px 12px; border-left: 1px solid var(--ui-line); font-size: 14px; }
.doc-facts > div:first-child { border-left: 0; }
.doc-facts dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-muted); margin-bottom: 3px; }
.doc-facts dd { margin: 0; }
.doc-facts dd span { display: block; color: var(--ui-ink-2); font-size: 13px; }
@media (max-width: 600px) { .doc-facts { grid-template-columns: 1fr; } .doc-facts > div { border-left: 0; border-top: 1px solid var(--ui-line); } .doc-facts > div:first-child { border-top: 0; } }
.doc-sec { margin-top: 24px; break-inside: avoid-page; }
.doc-sec h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-ink-2); padding-bottom: 6px; border-bottom: 1px solid var(--ui-line); margin-bottom: 10px; }
.doc-sec p { white-space: pre-wrap; }
.doc-checks { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-checks td { padding: 6px 0; border-bottom: 1px solid var(--ui-line-2); }
.doc-checks td:last-child { text-align: right; font-weight: 700; width: 70px; }
.doc-checks .r-pass { color: var(--s-done); }
.doc-checks .r-fail { color: var(--s-bad); }
.doc-checks .r-na { color: var(--ui-muted); }
.doc-flag { padding: 8px 10px; background: var(--s-bad-bg); color: var(--s-bad); font-size: 14px; margin-bottom: 10px; }
.doc-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 520px) { .doc-media { grid-template-columns: 1fr; } }
.doc-media figure { margin: 0; break-inside: avoid; }
.doc-media img, .doc-media video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #111; border: 1px solid var(--ui-line); display: block; }
.doc-media video { object-fit: contain; }
.doc-media figcaption { font-size: 13px; color: var(--ui-ink-2); margin-top: 5px; }
.doc-fu { list-style: none; margin: 0; padding: 0; }
.doc-fu li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--ui-line-2); font-size: 14px; }
.doc-fu b { flex: none; width: 70px; font-size: 12px; text-transform: uppercase; }
.doc-fu .prio-high b { color: var(--s-bad); }
.doc-fu .prio-medium b { color: var(--s-onsite); }
.doc-fu .prio-low b { color: var(--ui-muted); }
.doc-sign { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.doc-sign img { max-width: 260px; max-height: 110px; border-bottom: 1px solid var(--ui-ink); }
.doc-sign dl { display: grid; grid-template-columns: auto auto; gap: 3px 14px; margin: 0; font-size: 14px; }
.doc-sign dt { color: var(--ui-muted); }
.doc-sign dd { margin: 0; font-weight: 600; }
.doc-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--ui-line); font-size: 13px; color: var(--ui-ink-2); }
.doc-foot p + p { margin-top: 6px; }
.doc-terms { white-space: pre-wrap; color: var(--ui-muted); font-size: 12px; }
.doc-actions { max-width: 820px; margin: 0 auto 32px; display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px; }
.doc-missing { max-width: 520px; margin: 60px auto; padding: 32px; background: #fff; border: 1px solid var(--ui-line); text-align: center; }
.doc-missing img { max-height: 48px; margin: 0 auto 16px; }
@media print {
  @page { size: A4; margin: 14mm; }
  .doc-body { background: #fff; }
  .doc { margin: 0; border: 0; padding: 0; max-width: none; }
  .doc-actions { display: none; }
  .doc-media video { display: none; }
  .doc-media figure.is-video::after { content: 'Video – view online'; display: block; padding: 30px 10px; text-align: center; border: 1px solid var(--ui-line); font-size: 12px; color: var(--ui-muted); }
}

/* ---------- business settings ---------- */
.set-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  background: var(--ui-surface); border-bottom: 1px solid var(--ui-line);
}
.set-top strong { font-size: 15px; }
.set-top .hint { margin-left: auto; }
.set-wrap { padding: 20px 16px 120px; display: grid; gap: 20px; }
@media (min-width: 900px) { .set-wrap { padding: 28px 32px 120px; } }
@media (min-width: 1400px) {
  .set-fieldset { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .set-fieldset > #business, .set-fieldset > #services { grid-column: 1 / -1; }
}
@media (min-width: 900px) { .set-wrap { grid-template-columns: 190px minmax(0, 1fr); } }
.set-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.set-nav a { flex: none; padding: 6px 10px; border-radius: 4px; color: var(--ui-ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.set-nav a:hover { background: rgba(0, 0, 0, .05); }
@media (min-width: 900px) { .set-nav { flex-direction: column; position: sticky; top: 70px; align-self: start; } }
.set-main { min-width: 0; }
.set-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.set-sec { scroll-margin-top: 70px; }
.set-short { max-width: 160px; }
.set-label { font-size: 13px; font-weight: 600; color: var(--ui-ink-2); margin-bottom: 6px; }
.set-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.set-logo { display: flex; gap: 16px; align-items: center; }
.set-logo img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--ui-line); border-radius: 4px; background: #fff; flex: none; }
.set-colour { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.set-colour input[type=color] { width: 56px; height: 36px; padding: 2px; margin: 0 !important; cursor: pointer; }
.set-colour .btn { pointer-events: none; }
.set-notice { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.set-notice.ok { background: var(--s-done-bg); color: var(--s-done); border: 1px solid #ABEFC6; }
.set-notice.bad { background: var(--s-bad-bg); color: var(--s-bad); border: 1px solid #FECDCA; }
.set-save {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 10px 20px calc(10px + var(--safe-b)); background: var(--ui-surface); border-top: 1px solid var(--ui-line);
}
.ui-body code { font-size: 12px; padding: 0 4px; border-radius: 3px; background: #F2F4F7; border: 1px solid var(--ui-line-2); }
.set-body .workflow-card { border-radius: 4px; box-shadow: none; }

/* ---------- photo-led cards (CompanyCam style) ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pgrid > .empty-state, .pgrid > .box { grid-column: 1 / -1; }
.pgrid > .empty-state { background: var(--ui-surface); border: 1px dashed #CDD5DE; border-radius: 12px; padding: 48px 20px; }
@media (max-width: 560px) { .pgrid { grid-template-columns: 1fr; gap: 14px; } }
.pcard {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: var(--ui-shadow);
  transition: box-shadow .15s, transform .15s;
}
.pcard:hover { box-shadow: 0 6px 18px rgba(23, 33, 43, .1); transform: translateY(-1px); }
.pcover { position: relative; display: grid; gap: 2px; width: 100%; aspect-ratio: 16 / 10; background: #E3E8EE; overflow: hidden; }
.pcover img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.pcover.n2 { grid-template-columns: 1fr 1fr; }
.pcover.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pcover.n3 img:first-child { grid-row: span 2; }
.pcover.empty { place-items: center; color: var(--ui-faint); background: repeating-linear-gradient(135deg, #EEF1F5 0 12px, #E8ECF1 12px 24px); }
.pcover.empty span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.pcover.empty svg { width: 28px; height: 28px; }
.pcover .pcount { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; background: rgba(23, 33, 43, .72); color: #fff; font-size: 12px; font-weight: 600; }
.pcover .pcount svg { width: 14px; height: 14px; }
.pcover .pill-status { position: absolute; top: 10px; left: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pbody strong { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbody .paddr { font-size: 13px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--ui-ink-2); }
.pmeta .when { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmeta .when svg { width: 14px; height: 14px; color: var(--ui-faint); flex: none; }
.view-toggle { display: inline-flex; padding: 3px; border-radius: 9px; background: #E7EBF0; }
.view-toggle button { display: inline-grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--ui-muted); cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: #fff; color: var(--ui-ink); box-shadow: var(--ui-shadow); }
.view-toggle svg { width: 17px; height: 17px; }

/* photos grouped by day on a job */
.day-group + .day-group { margin-top: 22px; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.day-head h3 { font-size: 15px; font-weight: 700; }
.day-head span { font-size: 13px; color: var(--ui-muted); }
.ph { border-radius: 10px; }
.ph .ph-time { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(23, 33, 43, .66); color: #fff; font-size: 11px; font-weight: 600; pointer-events: none; }

/* wide forms: put form sections side by side when there is room */
.form-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
.form-cols > .box { margin: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ui-ink-2); margin-bottom: 8px; }
.input-short { max-width: 200px; }
.form-bar {
  position: sticky; bottom: calc(var(--ui-tabs-h) + var(--safe-b)); z-index: 15; display: flex; justify-content: flex-end; gap: 10px;
  margin: 16px -14px 0; padding: 12px 14px; background: rgba(244, 246, 249, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--ui-line);
}
.form-bar .btn { min-height: 44px; padding: 8px 20px; }
@media (max-width: 599px) { .form-bar .btn { flex: 1; } }
@media (min-width: 600px) { .form-bar { margin: 20px -20px 0; padding: 12px 20px; } }
@media (min-width: 960px) { .form-bar { bottom: 0; margin: 24px -32px 0; padding: 14px 32px; } }

/* settings: reordering by touch or mouse */
.set-body .sort-handle { touch-action: none; cursor: grab; min-width: 40px; min-height: 40px; }
.set-body .sort-handle:active { cursor: grabbing; }
.set-body .workflow-card.is-dragging, .set-body .checklist-row.is-dragging {
  opacity: .96; background: #fff; box-shadow: 0 12px 28px rgba(23, 33, 43, .22); border-color: var(--ui-accent); transform: scale(1.01);
}
.sort-placeholder { border: 2px dashed color-mix(in srgb, var(--ui-accent) 45%, #fff); border-radius: 10px; background: var(--ui-accent-soft); margin: 6px 0; box-sizing: border-box; }
.set-body.is-sorting, .set-body.is-sorting * { user-select: none; -webkit-user-select: none; }

/* ---------- field features ---------- */
/* upload tray: floats above the tab bar while files are waiting or sending */
.up-tray {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--ui-tabs-h) + 14px + var(--safe-b)); z-index: 35;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ui-ink); color: #fff; font: inherit; font-size: 13px; font-weight: 600; box-shadow: var(--ui-shadow-lg); max-width: calc(100vw - 32px);
}
.up-tray[hidden] { display: none; }
.up-tray svg { width: 16px; height: 16px; }
.up-tray.off { background: #475467; }
.up-tray.bad { background: #B42318; }
.up-tray .spinner { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
.has-dock .up-tray { bottom: calc(var(--ui-tabs-h) + 82px + var(--safe-b)); }
@media (min-width: 960px) { .up-tray, .has-dock .up-tray { bottom: 24px; left: auto; right: 24px; transform: none; } }

.tag-filter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tag-filter:empty { display: none; }
.tag-filter button { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--ui-line); background: var(--ui-surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ui-ink-2); cursor: pointer; }
.tag-filter button svg { width: 13px; height: 13px; }
.tag-filter button[aria-pressed="true"] { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
.ph-badges { position: absolute; right: 48px; top: 8px; display: flex; gap: 4px; pointer-events: none; }
.ph-badges b { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; background: rgba(23, 33, 43, .7); color: #fff; font-size: 11px; font-weight: 700; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-badges b svg { width: 12px; height: 12px; }
.ph-badges .ph-pair.before { background: #B54708; }
.ph-badges .ph-pair.after { background: #067647; }
.ph .ph-del { opacity: 1; }

.sheet-media { border-radius: 10px; overflow: hidden; background: #111; }
.sheet-media img, .sheet-media video { display: block; width: 100%; max-height: 46vh; object-fit: contain; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.steps-help { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.quick-row .btn.is-live { border-color: var(--s-done); color: var(--s-done); }

/* full-screen photo markup */
.ui-sheet.is-full { align-items: stretch; }
.ui-sheet.is-full .ui-sheet-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; padding: 0; background: #111; animation: none; }
.ui-sheet.is-full .ui-sheet-grab { display: none; }
.markup { display: flex; flex-direction: column; height: 100%; }
.markup-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); background: #1A1D21; flex-wrap: wrap; }
.markup-bar:first-child { padding-top: calc(10px + var(--safe-t)); }
.markup-bar .grow { flex: 1; }
.markup-tools { display: flex; gap: 4px; }
.markup-tools button { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: #D0D5DD; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.markup-tools button span { font-size: 10px; font-weight: 600; }
.markup-tools button svg { width: 18px; height: 18px; }
.markup-tools button[aria-pressed="true"] { background: #30363D; color: #fff; }
.markup-colours { display: flex; gap: 8px; margin-left: auto; }
.markup-colours button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #30363D; cursor: pointer; }
.markup-colours button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px #1A1D21, 0 0 0 4px #fff; }
.markup-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px; }
.markup-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; background: #000; }
.markup-bar .btn.ghost { color: #D0D5DD; }

/* dictation */
.dictate-wrap { position: relative; }
.dictate-wrap textarea { padding-right: 46px !important; }
.dictate-btn { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-muted); cursor: pointer; }
.dictate-btn svg { width: 16px; height: 16px; }
.dictate-btn.on { background: #E5484D; border-color: #E5484D; color: #fff; animation: dictate-pulse 1.2s ease-in-out infinite; }
@keyframes dictate-pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, .2); } }
label > .dictate-wrap { margin-top: 6px; }

/* side panels */
.timer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.timer-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.timer-list li { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--ui-line-2); }
.eq-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ui-line); border-radius: 10px; overflow: hidden; }
.eq-list li + li { border-top: 1px solid var(--ui-line-2); }
.eq-list button { display: block; width: 100%; padding: 9px 12px; border: 0; background: var(--ui-surface); text-align: left; font: inherit; cursor: pointer; }
.eq-list button:hover { background: var(--ui-sunken); }
.eq-list strong { display: block; font-size: 14px; }
.eq-list span { display: block; font-size: 12px; color: var(--ui-muted); }

/* customer page */
.cust-grid { display: grid; gap: 20px; }
@media (min-width: 1100px) { .cust-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: start; } }
.row-link { text-decoration: none; color: inherit; min-width: 0; }
.row-link:hover strong { text-decoration: underline; }
[data-company-hint].is-new { color: var(--ui-accent); font-weight: 600; }

/* map */
.map-wrap { position: relative; }
.map { height: calc(100vh - 260px); min-height: 360px; border-radius: 12px; border: 1px solid var(--ui-line); overflow: hidden; z-index: 0; }
@media (min-width: 960px) { .map { height: calc(100vh - 210px); } }
.map-note { margin-top: 8px; }
.leaflet-popup-content { font-family: var(--ui-font); font-size: 13px; line-height: 1.5; }
.leaflet-popup-content a { color: var(--ui-accent); font-weight: 600; }

/* timesheets */
.ts-table-wrap { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.ts-table th, .ts-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--ui-line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts-table th:first-child, .ts-table td:first-child { text-align: left; }
.ts-table th { font-size: 12px; color: var(--ui-muted); font-weight: 600; }

/* report: before and after side by side */
.doc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; break-inside: avoid; }
.doc-pair figure { position: relative; margin: 0; }
.doc-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--ui-line); display: block; }
.doc-pair-label { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 700; }
.doc-pair figcaption { font-size: 13px; color: var(--ui-ink-2); margin-top: 5px; }

/* live timeline page */
.tl-steps { list-style: none; margin: 0; padding: 0; }
.tl-steps li { position: relative; padding: 0 0 18px 30px; color: var(--ui-faint); }
.tl-steps li:last-child { padding-bottom: 0; }
.tl-steps li::before { content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ui-line); background: #fff; }
.tl-steps li::after { content: ''; position: absolute; left: 9px; top: 22px; bottom: 2px; width: 2px; background: var(--ui-line); }
.tl-steps li:last-child::after { display: none; }
.tl-steps li.done { color: var(--ui-ink-2); }
.tl-steps li.done::before { background: #17B26A; border-color: #17B26A; }
.tl-steps li.now { color: var(--ui-ink); font-weight: 700; }
.tl-steps li.now::before { border-color: var(--ui-accent); box-shadow: 0 0 0 4px var(--ui-accent-soft); }
.tl-steps small { display: block; font-weight: 500; color: var(--ui-muted); }
.tl-cap { padding: 8px 10px; font-size: 13px; }

@media print {
  .ui-side, .ui-tabs, .ui-top, .ui-dock, .no-print { display: none !important; }
  .ui-app { display: block; }
  body.ui-body { background: #fff; }
}

/* ---------- photos page: thumbnails and full-size viewer ---------- */
.photo-group .box-head h2 a { color: inherit; text-decoration: none; }
.photo-group .box-head h2 a:hover { color: var(--ui-accent); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
@media (min-width: 700px) { .thumb-grid { grid-template-columns: repeat(auto-fill, 120px); } }
.thumb {
  position: relative; display: block; aspect-ratio: 1; padding: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm);
  overflow: hidden; background: var(--ui-line-2); cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.thumb:hover img { transform: scale(1.04); }
.thumb:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.thumb-more { display: grid; place-content: center; text-align: center; text-decoration: none; color: var(--ui-ink); font-weight: 700; font-size: 18px; cursor: pointer; background: var(--ui-sunken); }
.thumb-more span { display: block; font-size: 12px; font-weight: 500; color: var(--ui-muted); }

.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: rgba(12, 16, 20, .94); color: #fff; }
.lightbox-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t, 0px)) 14px 10px; }
.lightbox-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lightbox-title strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-title span { font-size: 12px; color: rgba(255, 255, 255, .65); }
.lightbox-close, .lightbox-nav {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox-close svg, .lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-stage { position: relative; flex: 1; min-height: 0; }
.lightbox-stage img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 20px); max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; }
.lightbox-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 14px calc(14px + var(--safe-b, 0px)); }
.lightbox-count { font-size: 13px; color: rgba(255, 255, 255, .7); min-width: 54px; text-align: center; }
.lightbox .lightbox-open { min-height: 42px; }
.lightbox-nav[hidden] { display: none; }
.set-icon img { border-radius: 16px; object-fit: cover; }

/* ---------- on/off switch (customer portal access) ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ui-ink-2); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; width: 36px; height: 20px; flex: none; border-radius: 999px; background: #CBD3DC; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(23, 33, 43, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--ui-accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.row-acts .switch { margin-right: 4px; }
.row .row-acts { align-items: center; }

/* ---------- destructive action at the foot of a sheet ---------- */
.danger-zone { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px; border: 1px solid #FECDCA; border-radius: var(--ui-r); background: var(--s-bad-bg); }
.danger-zone > div { flex: 1; min-width: 0; }
.danger-zone strong { color: var(--s-bad); font-size: 14px; }
.danger-zone .hint { margin-top: 2px; }
.danger-zone .btn { flex: none; border-color: #FDA29B; }
@media (max-width: 480px) { .danger-zone { flex-direction: column; align-items: stretch; } }

/* ---------- app-wide search ---------- */
.ui-search-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 4px; padding: 8px 10px; border: 1px solid var(--ui-line);
  border-radius: var(--ui-r-sm); background: var(--ui-sunken); color: var(--ui-muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.ui-search-btn:hover { border-color: #C7CFD8; color: var(--ui-ink-2); }
.ui-search-btn svg { width: 16px; height: 16px; flex: none; }
.ui-search-btn span { flex: 1; }
.ui-search-btn kbd { font: inherit; font-size: 11px; padding: 1px 6px; border: 1px solid var(--ui-line); border-radius: 4px; background: #fff; color: var(--ui-muted); }
.ui-top-search { margin-left: auto; }
@media (min-width: 960px) { .ui-top-search { display: none !important; } }

.ui-search { position: fixed; inset: 0; z-index: 150; }
.ui-search-scrim { position: absolute; inset: 0; background: rgba(15, 20, 25, .4); }
.ui-search-panel {
  position: relative; display: flex; flex-direction: column; max-height: 100%; height: 100%;
  background: var(--ui-surface); box-shadow: var(--ui-shadow-lg);
}
@media (min-width: 700px) {
  .ui-search-panel { width: min(640px, calc(100% - 32px)); height: auto; max-height: min(620px, calc(100% - 20vh)); margin: 12vh auto 0; border-radius: 12px; overflow: hidden; }
}
.ui-search-field { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t, 0px)) 14px 10px; border-bottom: 1px solid var(--ui-line); }
.ui-search-field svg { width: 18px; height: 18px; color: var(--ui-muted); flex: none; }
.ui-search-field input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding: 8px 0 !important; font-size: 16px !important; background: transparent; outline: none; }
.ui-search-close { border: 0; background: none; color: var(--ui-accent); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 2px; }
.ui-search-results { overflow-y: auto; padding: 6px 0 12px; }
.ui-search-hint { padding: 18px 16px; color: var(--ui-muted); font-size: 14px; }
.ui-search-group { padding: 10px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.ui-search-results a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; text-decoration: none; color: var(--ui-ink); }
.ui-search-results a svg { width: 18px; height: 18px; flex: none; color: var(--ui-muted); }
.ui-search-results a span { display: flex; flex-direction: column; min-width: 0; }
.ui-search-results a strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-search-results a em { font-style: normal; font-size: 13px; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-search-results a:hover, .ui-search-results a.on { background: var(--ui-accent-soft); }

/* ---------- feedback sheet ---------- */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fb-kind span { display: inline-block; padding: 7px 12px; border: 1px solid var(--ui-line); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ui-ink-2); cursor: pointer; background: var(--ui-surface); }
.fb-kind input:checked + span { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.fb-kind input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 2px; }

/* ---------- storage usage (Business settings) ---------- */
.set-storage { padding: 12px 14px; border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); background: var(--ui-sunken); }
.set-storage-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.set-storage-head span { color: var(--ui-ink-2); }
.set-storage-bar { height: 8px; margin: 8px 0 6px; border-radius: 999px; background: #E3E8EE; overflow: hidden; }
.set-storage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ui-accent); }
.set-storage-bar.is-high span { background: #DC6803; }
.set-storage-bar.is-full span { background: var(--s-bad); }
.set-soon { padding: 10px 12px; border-radius: var(--ui-r-sm); background: var(--s-scheduled-bg); color: var(--s-scheduled); }
.set-soon strong { color: inherit; }

/* ---------- home-page notice (e.g. texting not available in this country yet) ---------- */
.ui-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--ui-r); border: 1px solid #B2DDFF; background: var(--s-scheduled-bg); color: #1849A9; font-size: 14px; }
.ui-banner > div:first-child { flex: 1; min-width: 240px; }
.ui-banner strong { color: inherit; }
.ui-banner.is-warn { border-color: #FEDF89; background: var(--s-onsite-bg); color: #93370D; }
.ui-banner-acts { display: flex; gap: 8px; align-items: center; }

/* ---------- getting-started checklist (Home) ---------- */
.setup-card { margin-bottom: 16px; }
.setup-steps { list-style: none; margin: 0; padding: 0 16px 8px; }
.setup-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--ui-line-2); }
.setup-steps li:first-child { border-top: 0; }
.setup-steps li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setup-steps strong { font-size: 14px; }
.setup-steps span { font-size: 13px; color: var(--ui-muted); }
.setup-steps em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--s-done); }
.setup-tick { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--ui-line); }
.setup-tick svg { width: 14px; height: 14px; }
.setup-steps li.is-done .setup-tick { background: var(--s-done); border-color: var(--s-done); color: #fff; }
.setup-steps li.is-done strong { color: var(--ui-muted); text-decoration: line-through; }
@media (max-width: 560px) { .setup-steps li { flex-wrap: wrap; } .setup-steps li .btn { margin-left: 36px; } }
