/* Forefront Scheduler — clean, touch-first UI. Light + dark themes. */
:root {
  /* Forefront Window Cleaning: black and white like the logo; colour only for status (done, owed, overdue) */
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #efefed;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e3e3e0;
  --border-strong: #cfcfcb;
  --primary: #111111;
  --primary-600: #000000;
  --primary-soft: #e8e8e5;
  --on-primary: #ffffff;
  --brand-font: Futura, 'Avenir Next', Montserrat, 'Century Gothic', 'Arial Black', system-ui, sans-serif;
  --success: #059669;
  --success-soft: #d1fae5;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0c;
    --surface: #171717;
    --surface-2: #212121;
    --text: #f2f2f2;
    --muted: #a0a0a0;
    --border: #2b2b2b;
    --border-strong: #3d3d3d;
    --primary: #f2f2f2;
    --primary-600: #ffffff;
    --primary-soft: #2c2c2c;
    --on-primary: #111111;
    --success: #34d399;
    --success-soft: #06322a;
    --danger: #f87171;
    --danger-soft: #3b1414;
    --warn: #fbbf24;
    --warn-soft: #3a2a07;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 0.9em; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.left { text-align: left; }
.ok { color: var(--success); }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 4px 0 8px; }
.kbd { display: inline-block; border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 5px; }

/* ── Header ── */
.app-header {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.header-inner { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 16px; max-width: 980px; margin: 0 auto; }
#title { font-size: 22px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#back { margin-left: -8px; }

.btn-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--muted); position: relative; flex: none; text-decoration: none;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon:disabled { opacity: 0.3; pointer-events: none; }
.btn-icon.sm { width: 34px; height: 34px; }
.btn-icon.sm .ic { width: 17px; height: 17px; }
.sync-dot { position: absolute; right: 7px; bottom: 8px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg); background: var(--border-strong); }
.sync.st-ok .sync-dot { background: var(--success); }
.sync.st-syncing .sync-dot { background: var(--primary); animation: pulse 1s infinite; }
.sync.st-error .sync-dot, .sync.st-auth .sync-dot { background: var(--warn); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ── Layout / nav ── */
main { display: block; padding: 4px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; outline: none; }
.boot { padding: 60px; text-align: center; color: var(--muted); }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0 max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-right));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h); font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.tabbar a .ic { width: 23px; height: 23px; }
.tabbar a.active { color: var(--primary); }
.brand { display: none; }

/* phones/tablets: Settings lives in the header (gear) so the bottom bar has room for the other tabs */
@media (max-width: 899px) { .tabbar a[data-nav=settings] { display: none; } }
#settings-btn { color: var(--muted); }
#settings-btn.active { color: var(--primary); }
@media (min-width: 900px) {
  #settings-btn { display: none; }
  body { padding-left: 232px; }
  .tabbar {
    top: 0; right: auto; width: 232px; flex-direction: column; gap: 2px;
    border-top: 0; border-right: 1px solid var(--border); padding: 18px 12px;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 4px 10px 20px; }
  .tabbar a { flex: none; height: auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 15px; border-radius: 12px; color: var(--text); }
  .tabbar a .ic { width: 20px; height: 20px; color: var(--muted); }
  .tabbar a:hover { background: var(--surface-2); }
  .tabbar a.active { background: var(--primary-soft); color: var(--primary-600); }
  .tabbar a.active .ic { color: var(--primary); }
  main { padding-bottom: 120px; padding-left: 28px; padding-right: 28px; }
  .header-inner { padding: 0 28px; }
}

/* ── Cards / lists ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.list { padding: 4px 0; overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; text-align: left;
  border-bottom: 1px solid var(--border); min-height: 56px;
}
.list-row:last-child { border-bottom: 0; }
button.list-row:hover, .list-row button.grow:hover strong { color: var(--primary); }
.list-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex: none; }
.list-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.list-row .num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.tick { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.tick .ic { width: 17px; height: 17px; }
.tick.done { background: var(--success-soft); color: var(--success); }
.tick.skipped { background: var(--surface-2); color: var(--muted); }
.tick.pay { background: var(--primary-soft); color: var(--primary); }
.tick.exp { background: var(--warn-soft); color: var(--warn); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; background: var(--rc);
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); flex: none; display: inline-block; }
.dot.lg { width: 14px; height: 14px; }
.pad { padding: 14px; margin: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.chip .ic { width: 13px; height: 13px; }
.chip.strong { color: var(--text); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.round-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--surface-2); }
.round-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); text-decoration: none; white-space: nowrap; transition: transform 0.08s, background 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-600); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #04131f; } }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-link { color: var(--primary); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 4px; }
.btn-link .ic { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.btn-row.center { justify-content: center; }

.fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 58px; height: 58px; border-radius: 18px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.fab .ic { width: 26px; height: 26px; }
@media (prefers-color-scheme: dark) { .fab { color: #04131f; } }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

/* ── Schedule ── */
.week-nav { display: flex; align-items: center; gap: 4px; margin: 4px -8px 6px; }
.week-label { flex: 1; text-align: center; font-weight: 600; font-size: 14px; color: var(--muted); }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
}
.day .dow { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.day .dom { font-size: 18px; font-weight: 700; }
.day .cnt { font-size: 11px; font-weight: 700; color: var(--primary); min-height: 15px; }
.day .cnt i { font-style: normal; color: var(--muted); font-weight: 500; }
.day.is-today .dom { color: var(--primary); }
.day.sel { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day.sel .dow, .day.sel .cnt, .day.sel .cnt i, .day.sel.is-today .dom { color: rgba(255, 255, 255, 0.9); }
@media (prefers-color-scheme: dark) { .day.sel, .day.sel .dow, .day.sel .cnt, .day.sel .cnt i, .day.sel.is-today .dom { color: #04131f; } }

.summary { padding: 16px; margin-bottom: 18px; background: linear-gradient(135deg, var(--surface), var(--primary-soft)); }
.summary-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.summary .eyebrow { margin: 0 0 2px; }
.big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.big span { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.summary-vals { display: flex; gap: 18px; text-align: right; }
.summary-vals div { display: flex; flex-direction: column; }
.summary-vals span { font-size: 12px; }
.summary-vals strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: inherit; transition: width 0.4s; }

.group { margin-bottom: 20px; }
.group-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; }
.group-head h3 { font-size: 15px; font-weight: 700; }
.group-head .muted { font-size: 13px; flex: 1; }
/* Schedule plan (3.14.0): the day's worksheets, then what's due but not planned */
.plan-empty { padding: 14px 16px; margin-bottom: 20px; display: grid; gap: 6px; justify-items: start; }
.plan-empty p { margin: 0 0 4px; }
.plan-note { padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.plan-foot { margin: 2px 4px 0; }
.plan-divider { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 2px 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.plan-divider h2 { font-size: 16px; font-weight: 700; margin: 0; }
.day { position: relative; }
.day .unplanned-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn, #d97706); }
.ws-day { margin: 2px 0 4px; }

.job {
  display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; position: relative;
}
.job::before { content: ''; width: 5px; background: var(--rc); flex: none; }
.job-main { flex: 1; min-width: 0; text-align: left; padding: 12px 6px 12px 12px; }
.job-title { font-weight: 700; font-size: 16px; }
.job-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 7px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.job-actions { display: flex; align-items: center; gap: 4px; padding-right: 10px; }
.btn-done {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  background: var(--success-soft); color: var(--success); transition: transform 0.1s, background 0.15s;
}
.btn-done .ic { width: 26px; height: 26px; stroke-width: 2.6; }
.btn-done:hover { background: var(--success); color: #fff; }
.btn-done:active { transform: scale(0.92); }
.job.projected { opacity: 0.62; box-shadow: none; border-style: dashed; }

/* ── Search / chips / segmented ── */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; margin-bottom: 10px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; height: 46px; color: var(--text); min-width: 0; }
.chips-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.chips-row.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
.chips-row.scroll::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip-btn.sel { background: var(--text); border-color: var(--text); color: var(--bg); }
.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.segmented button { flex: 1; padding: 8px 0; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented button.sel { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ── Customer profile ── */
.profile { padding: 16px; margin-bottom: 12px; }
.profile-top { display: flex; gap: 14px; align-items: flex-start; }
.profile h2 { font-size: 20px; }
.profile p { margin: 2px 0 0; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-radius: 12px; background: var(--surface-2); color: var(--primary); text-decoration: none; font-size: 12px; font-weight: 600; }
.quick a.disabled { opacity: 0.35; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat strong { font-size: 17px; }
.stat.owed { background: var(--warn-soft); border-color: transparent; }
.stat.owed strong { color: var(--warn); }
.notes { padding: 14px 16px; margin-bottom: 18px; }
.notes h3 { font-size: 14px; display: flex; gap: 6px; align-items: center; color: var(--muted); margin-bottom: 6px; }
.notes .ic { width: 16px; height: 16px; }
.notes p { margin: 0; }
.portal-card { padding: 14px 16px; margin-bottom: 18px; }
.portal-card h3 { font-size: 14px; display: flex; gap: 6px; align-items: center; color: var(--muted); margin-bottom: 6px; }
.portal-card .ic { width: 16px; height: 16px; }
.portal-card p { margin: 0 0 8px; }
.portal-card .btn-row { margin: 8px 0 0; }
.portal-link { word-break: break-all; font-size: 13px; background: var(--primary-soft); border-radius: 8px; padding: 8px 10px; }

/* ── KPIs / reports ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border-strong); }
.kpi.accent-primary::before { background: var(--primary); }
.kpi.accent-ok::before { background: var(--success); }
.kpi.accent-warn::before { background: var(--warn); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.kpis.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .kpis.four { grid-template-columns: repeat(4, 1fr); } }
.chart { padding: 14px 16px 10px; margin-bottom: 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chart-head h3 { font-size: 15px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart svg { width: 100%; height: auto; display: block; }
.bar, i.bar { fill: var(--primary); background: var(--primary); }
.bar-f, i.bar-f { fill: var(--primary); opacity: 0.28; background: var(--primary); }
.axis { fill: var(--muted); font-size: 11px; }
.axis.cur { fill: var(--text); font-weight: 700; }
.grid { stroke: var(--border); }
.two-col { display: grid; gap: 12px; }
@media (min-width: 720px) { .two-col { grid-template-columns: repeat(3, 1fr); } }
.breakdown { padding: 14px 16px; }
.breakdown h3 { font-size: 15px; margin-bottom: 10px; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin-bottom: 10px; font-size: 13px; }
.bd-label { display: flex; align-items: center; gap: 7px; }
.bd-row strong { font-variant-numeric: tabular-nums; }
.bd-bar { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bd-bar span { display: block; height: 100%; border-radius: inherit; }

/* ── Settings ── */
.settings-card { padding: 16px; margin-bottom: 14px; }
.settings-card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.settings-card h3 .ic { color: var(--primary); }
.settings-card .list { border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; }
.settings-card details { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.settings-card summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
/* 3.17.0: Settings boxes fold up to a title + one-line summary */
.settings-card.fold { padding: 0; margin-bottom: 10px; scroll-margin-top: calc(72px + env(safe-area-inset-top)); }
.settings-card.fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-weight: 400; font-size: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.settings-card.fold > summary::-webkit-details-marker { display: none; }
.settings-card.fold > summary h3 { margin-bottom: 2px; }
.fold-head { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fold-sum { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 26px; }
.fold-chev { color: var(--muted); display: flex; transition: transform 0.15s; }
.settings-card.fold[open] > summary .fold-chev { transform: rotate(90deg); }
.settings-card.fold[open] > summary { border-bottom: 1px solid var(--border); }
.fold-body { padding: 14px 16px 16px; }
.sync-status { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.sync-status > div { display: flex; flex-direction: column; }
.sync-status .dot { width: 12px; height: 12px; background: var(--border-strong); }
.sync-status.st-ok .dot { background: var(--success); }
.sync-status.st-syncing .dot { background: var(--primary); animation: pulse 1s infinite; }
.sync-status.st-error .dot, .sync-status.st-auth .dot { background: var(--warn); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--rc); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.0); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rc); }
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
h3.sub { font-size: 14px; color: var(--muted); margin: 18px 0 8px; }

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 16px; font-weight: 400; outline: none; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label.check, .form label.check { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--text); margin: 8px 0; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.form-actions .btn.danger.ghost { margin-right: auto; }

/* ── Sheet (modal) ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  padding: 0 18px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 9px; background: var(--border-strong); margin: 8px auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head h2 { font-size: 19px; }
.sheet-body > p:first-child { margin-top: 0; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; transform: translateY(20px) scale(0.98); opacity: 0; transition: transform 0.2s, opacity 0.2s; padding-bottom: 20px; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-handle { visibility: hidden; height: 0; margin: 8px; }
}
.menu { display: flex; flex-direction: column; }
.menu > button, .menu > a { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 500; text-align: left; }
.menu > button:hover, .menu > a:hover { background: var(--surface-2); }
.menu .ic { color: var(--primary); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; width: 100%; }

/* ── Empty / toast ── */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty > .ic { width: 46px; height: 46px; color: var(--primary); background: var(--primary-soft); padding: 11px; border-radius: 16px; }
.empty h3 { color: var(--text); font-size: 18px; margin: 14px 0 6px; }
.empty p { margin: 0 auto 18px; max-width: 360px; }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: 0.2s;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: #111; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
}
@media (prefers-color-scheme: dark) { #toast { background: #e6edf7; color: #0b1220; } }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: #7dd3fc; font-weight: 700; }
@media (prefers-color-scheme: dark) { #toast button { color: var(--primary-soft); } }
@media (min-width: 900px) { #toast { bottom: 28px; margin-left: 116px; } }
#update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 60px); z-index: 300; /* just below the 56px header */
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 20px);
  background: var(--surface); color: var(--text); border: 1px solid var(--primary); border-radius: 14px;
  padding: 8px 8px 8px 14px; box-shadow: var(--shadow-lg); font-size: 14px; animation: upd-in 0.25s ease-out;
}
#update-bar > span { display: flex; align-items: center; gap: 8px; }
#update-bar > span .ic { width: 18px; height: 18px; color: var(--primary); flex: none; }
@keyframes upd-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translateX(-50%); } }
@media (min-width: 900px) { #update-bar { margin-left: 116px; } }
@media print { #update-bar { display: none !important; } }

/* ── Statement ── */
.statement { color: #0f172a; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; font-size: 13px; margin-bottom: 14px; }
.statement header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.statement h1 { font-size: 20px; margin-bottom: 4px; }
.statement h2 { font-size: 18px; color: #111; text-transform: uppercase; letter-spacing: 0.08em; }
.statement p { margin: 0; color: #475569; }
.st-meta { text-align: right; }
.st-meta .inv-no { white-space: nowrap; }
.st-to { margin-bottom: 16px; }
.statement table { width: 100%; border-collapse: collapse; }
.statement th { text-align: left; font-size: 11px; text-transform: uppercase; color: #64748b; border-bottom: 2px solid #e2e8f0; padding: 6px 4px; }
.statement td { border-bottom: 1px solid #f1f5f9; padding: 6px 4px; }
.statement .nw, .statement .r { white-space: nowrap; }
.statement .r { text-align: right; font-variant-numeric: tabular-nums; }
.st-total { display: flex; justify-content: flex-end; gap: 16px; align-items: baseline; margin: 14px 0; font-size: 15px; }
.st-total strong { font-size: 22px; }
.st-bank { margin: 12px 0 !important; padding: 10px; background: #f1f5f9; border-radius: 8px; }
.st-terms { font-size: 12px; }
.inv-no-field, .inv-ref-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.inv-no-field input, .inv-ref-field input { font-size: 16px; }
.inv-fields { gap: 10px; }
.inv-fields label { margin-bottom: 12px; min-width: 0; }

/* ── Expenses ── */
.segmented.small button { font-size: 13px; padding: 6px 0; }
.kpi.link { text-decoration: none; color: inherit; }
.kpi.link em { color: var(--primary); }
.thumb { width: 40px; height: 40px; border-radius: 10px; flex: none; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 11px; border: 1px solid var(--border); padding: 0; }
.thumb.lg { width: 76px; height: 76px; border-radius: 12px; cursor: zoom-in; }
.thumb.missing .ic { width: 18px; height: 18px; }
.thumb b { font-size: 12px; color: var(--danger); }
.exp-row { align-items: center; }
.exp-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.exp-tags .chip { font-size: 11px; padding: 1px 7px; }
.exp-tags .chip .ic { width: 12px; height: 12px; }
.exp-actions { align-items: center; flex-wrap: wrap; }
.exp-filter { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; margin-right: auto; }
.exp-filter select { min-height: 38px; padding: 4px 28px 4px 10px; font-size: 14px; }
.receipts { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rc-list { display: flex; flex-wrap: wrap; gap: 10px; }
.rc-list:empty { display: none; }
.rc-item { position: relative; }
.rc-del { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--surface); display: grid; place-items: center; border: 2px solid var(--surface); padding: 0; }
.rc-del .ic { width: 13px; height: 13px; }
.rc-add { align-self: flex-start; cursor: pointer; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
details.more { display: flex; flex-direction: column; gap: 10px; }
.rc-viewer { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 12px; }
.rc-viewer img { max-width: 100%; max-height: calc(100% - 70px); object-fit: contain; border-radius: 8px; background: #fff; }
.rc-viewer-bar { display: flex; gap: 10px; }
.exp-table { padding: 14px 16px; overflow-x: auto; }
.exp-table h3 { font-size: 15px; margin-bottom: 8px; }
.exp-table h4 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); }
.exp-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.exp-table th, .exp-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.exp-table td.muted { white-space: normal; font-size: 12px; }
.exp-table .r { text-align: right; }
.exp-table tfoot th { border-bottom: 0; border-top: 2px solid var(--border-strong); }
.exp-table .bars { width: 28%; min-width: 70px; }
.exp-table td.bars { display: table-cell; }
.exp-table .bars span { display: block; height: 5px; border-radius: 3px; margin: 2px 0; }
.exp-table .b-inc { background: var(--success); }
.exp-table .b-exp { background: var(--warn); }
@media (max-width: 480px) { .exp-table .bars { display: none; } }
/* printed expenses report */
.exp-report { font-size: 11px; color: #000; }
.exp-report h1 { font-size: 18px; margin: 0 0 2px; }
.exp-report h2 { font-size: 14px; margin: 16px 0 6px; }
.exp-report table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.exp-report th, .exp-report td { border: 1px solid #aaa; padding: 3px 5px; text-align: left; vertical-align: top; }
.exp-report thead th { background: #eee; }
.exp-report table.sum { width: auto; min-width: 50%; }
.exp-report .r { text-align: right; white-space: nowrap; }
.exp-report .nw { white-space: nowrap; }
.exp-report tr { break-inside: avoid; }
.exp-report .page-break { break-before: page; }
.exp-report .rc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.exp-report figure { margin: 0; break-inside: avoid; border: 1px solid #ccc; padding: 6px; }
.exp-report figure img { width: 100%; max-height: 120mm; object-fit: contain; }
.exp-report figcaption { font-size: 10px; margin-top: 4px; }
.exp-report .rc-missing { padding: 30px 8px; text-align: center; color: #666; background: #f5f5f5; }

/* ── Reorder stops ── */
.order-row { background: var(--surface); }
.order-row .drag-handle { display: grid; place-items: center; width: 32px; height: 40px; margin: -6px 0; color: var(--muted); cursor: grab; touch-action: none; flex: none; }
.order-row .drag-handle .ic { width: 20px; height: 20px; }
.order-row.dragging { box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.18)); position: relative; z-index: 2; border-radius: 12px; }
.order-row.dragging .drag-handle { cursor: grabbing; }
.order-row .grow { display: flex; flex-direction: column; min-width: 0; }
.order-row .grow .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Worksheet ── */
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.ws-bar input[type=date] { min-height: 40px; padding: 6px 10px; flex: 0 1 170px; }
.ws-bar select { min-height: 40px; padding: 6px 30px 6px 10px; flex: 1 1 140px; max-width: 240px; }
.ws-bar .btn.primary { margin-left: auto; }
.ws-bar #ws-sheet { flex: 1 1 100%; max-width: none; font-weight: 600; }
@media (min-width: 700px) { .ws-bar #ws-sheet { flex: 1 1 260px; max-width: 380px; } }
.ws-row .ws-remove { color: var(--muted); }
.ws-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ws-ico { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.ws-ico .ic { width: 15px; height: 15px; color: var(--primary); }
.ws-ico.hot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ws-ico.hot .ic { color: var(--on-primary); }
.ws-note { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; font-size: 13px; background: var(--warn-soft); color: var(--text); border-radius: 8px; padding: 5px 8px; }
.ws-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--warn); }
.ws-note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* ── Quotes ── */
.quote-row { align-items: center; }
.quote-row .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.quote-row .grow .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-no { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-600, var(--primary)); font-weight: 800; display: grid; place-items: center; font-size: 13px; flex: none; }
.kpi strong small { font-size: 13px; color: var(--muted); font-weight: 600; }
.q-lines-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
#q-lines { display: flex; flex-direction: column; gap: 8px; }
.q-line { display: grid; grid-template-columns: 1fr 84px 1fr 30px; gap: 6px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
@media (max-width: 480px) { .q-line .q-del { grid-row: 1; grid-column: 3; } }
.q-line input, .q-line select { min-height: 42px; font-size: 15px; padding: 6px 8px; }
.q-line select { padding-right: 24px; }
@media (max-width: 480px) { .q-line { grid-template-columns: 1fr 76px 30px; } .q-line .q-freq { grid-column: 1 / 3; } }
.q-quick { margin: 2px 0 0; }
.q-quick .chip-btn { font-size: 12px; padding: 5px 10px; }
.q-live { font-weight: 700; font-size: 15px; padding: 8px 12px; background: var(--primary-soft); border-radius: 10px; }
.q-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.q-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.q-actions.small-actions { border-top: 1px solid var(--border); padding-top: 10px; }
.btn.ok-btn { background: var(--success); border-color: var(--success); color: #fff; }
.q-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 12px 0; }
.q-totals div { display: flex; gap: 16px; align-items: baseline; }
.q-totals strong { font-size: 20px; }
.q-totals .muted { font-size: 12px; }
.q-book { margin: 0 0 6px 18px; padding: 0; }

.share-link { margin: 8px 0 10px; font-weight: 600; word-break: break-all; }
.ws-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; margin: -4px 0 10px; cursor: pointer; }
.ws-summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.ws-list { display: flex; flex-direction: column; gap: 8px; }
.ws-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.ws-row.is-done :is(.ws-stop, .ws-name, .job-meta, .ws-note), .ws-row.is-skipped :is(.ws-stop, .ws-name, .job-meta, .ws-note, .ws-quick) { opacity: 0.6; }
.ws-row.is-done .ws-name strong, .ws-row.is-skipped .ws-name strong { text-decoration: line-through; }
.ws-stop { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.ws-body { min-width: 0; }
.ws-name { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; max-width: 100%; }
.ws-name span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ws-row .job-meta { margin-top: 6px; }
.chip.ok { background: var(--success-soft); color: var(--success); }
.ws-row a.chip { text-decoration: none; color: inherit; }
.ws-actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 560px) {
  .ws-row { grid-template-columns: 34px 1fr; }
  .ws-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.worksheet-print { font-size: 11px; color: #000; }
.worksheet-print header h1 { font-size: 18px; margin: 0 0 2px; }
.worksheet-print header p { margin: 0 0 10px; }
.worksheet-print table { width: 100%; border-collapse: collapse; }
.worksheet-print th, .worksheet-print td { border: 1px solid #999; padding: 4px 5px; text-align: left; vertical-align: top; }
.worksheet-print thead th { background: #eee; }
.worksheet-print tr.grp th { background: #f6f6f6; font-size: 12px; }
.worksheet-print .r { text-align: right; white-space: nowrap; }
.worksheet-print .c { text-align: center; }
.worksheet-print .nw { white-space: nowrap; }
.worksheet-print .box { width: 34px; text-align: center; }
.worksheet-print .amt { width: 60px; }
.worksheet-print tr { break-inside: avoid; }
.ws-foot { margin-top: 8px; font-weight: 600; }

#print-area { display: none; }
@media print {
  body { padding: 0 !important; background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area .statement { border: 0; padding: 0; }
}

/* ── CSV import ── */
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.map-grid select { font-size: 14px; min-height: 40px; padding: 6px 30px 6px 10px; text-overflow: ellipsis; }
.map-grid select.mapped { border-color: var(--primary); background-color: var(--primary-soft); }
.imp-opts { margin: 14px 0 0; border-top: 1px solid var(--border); padding-top: 10px; }
.imp-opts summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.imp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.imp-summary div { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.imp-summary strong { font-size: 18px; }
.imp-summary span { font-size: 12px; color: var(--muted); }
.imp-warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
#imp-go:disabled { opacity: 0.5; pointer-events: none; }
@media (min-width: 700px) { .sheet:has(.map-grid) { max-width: 720px; } .map-grid { grid-template-columns: repeat(3, 1fr); } }

.imp-info { background: var(--primary-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.details { padding: 4px 16px; margin-bottom: 12px; }
.details > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.details > div:last-child { border-bottom: 0; }
.details span { color: var(--muted); font-size: 14px; }
.details a { font-weight: 600; text-decoration: none; }
.name-row { grid-template-columns: 1fr 96px; }

.notice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--warn-soft); color: var(--text); font-size: 14px; }
.notice > .ic:first-child { color: var(--warn); }
.notice > .ic:last-child { color: var(--muted); }
.notice span { flex: 1; }

.chip.svc { background: var(--primary-soft); color: var(--primary-600); }

/* ── Import ── */
.sheet.wide { max-width: 760px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--border-strong); border-radius: 16px; cursor: pointer; text-align: center; margin: 6px 0 12px; }
.drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.drop > .ic { width: 30px; height: 30px; color: var(--primary); }
.howto { border-top: 1px solid var(--border); padding-top: 10px; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.howto ol { padding-left: 20px; margin: 10px 0; display: grid; gap: 8px; font-size: 14px; }
.imp-head .chips-row { margin-bottom: 4px; }
.imp-head p { margin: 0 0 10px; word-break: break-all; }
.imp-alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 8px; background: var(--primary-soft); color: var(--text); }
.imp-alert.danger { background: var(--danger-soft); }
.imp-alert.danger strong:first-child { color: var(--danger); }
.imp-opts h4 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.imp-summary { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 6px; margin-top: 14px; }
.sheet .imp-summary div { padding: 8px 8px; }
.sheet .imp-summary strong { font-size: 17px; }
.sheet .imp-summary span { font-size: 11px; line-height: 1.2; }
.imp-summary .ok strong { color: var(--success); }
.imp-summary .info strong { color: var(--primary); }
.imp-summary .danger strong { color: var(--danger); }
.imp-summary .warn strong { color: var(--warn); }
.small-seg { overflow-x: auto; scrollbar-width: none; }
.small-seg button { flex: none; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.small-seg button span { opacity: .6; margin-left: 2px; }
.imp-rows { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.imp-row { border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; display: grid; gap: 2px; background: var(--surface); }
.imp-row.st-error { border-color: var(--danger); }
.imp-row-top { display: flex; gap: 8px; align-items: center; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--success-soft); color: var(--success); }
.pill.info { background: var(--primary-soft); color: var(--primary-600); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.imp-issues { margin: 4px 0 0; padding-left: 18px; font-size: 12px; display: grid; gap: 2px; }
.imp-issues .error { color: var(--danger); }
.imp-issues .warning { color: var(--warn); }
.imp-issues .kept { color: var(--muted); }
.sticky-actions { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--surface); padding: 12px 0 4px; margin-bottom: 0; border-top: 1px solid var(--border); }
.btn:disabled { opacity: .5; pointer-events: none; }
.imp-alert.warnbox { background: var(--warn-soft); }
.imp-step { background: var(--primary); color: var(--on-primary); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
@media (prefers-color-scheme: dark) { .imp-step { color: #04131f; } }

/* ── Jobs ── */
.jobs-tools { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.jobs-tools label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); flex: 1; min-width: 130px; }
.jobs-tools select { min-height: 40px; font-size: 14px; padding: 6px 30px 6px 10px; }
.jobs-tools .btn:first-of-type { margin-left: auto; }
.jtable { display: flex; flex-direction: column; gap: 8px; }
.jrow { position: relative; display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: 'chk cust price' 'chk job job' 'chk due round'; gap: 2px 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px 10px 6px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden; }
.jrow::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc); }
.jrow:hover { border-color: var(--border-strong); }
.jrow.sel { border-color: var(--primary); background: var(--primary-soft); }
.jrow > div { min-width: 0; display: flex; flex-direction: column; }
.jrow strong, .jrow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jrow span { font-size: 12px; color: var(--muted); }
.jrow .job-check { grid-area: chk; display: grid; place-items: center; align-self: stretch; cursor: pointer; }
.jrow .j-cust { grid-area: cust; }
.jrow .j-job { grid-area: job; flex-direction: row; gap: 6px; align-items: baseline; }
.jrow .j-job strong { font-weight: 500; font-size: 13px; }
.jrow .j-price { grid-area: price; text-align: right; align-items: flex-end; align-self: start; }
.jrow .j-due { grid-area: due; flex-direction: row; gap: 6px; align-items: baseline; }
.jrow .j-due strong { font-size: 13px; }
.jrow .j-round { grid-area: round; flex-direction: row; gap: 6px; align-items: center; justify-content: flex-end; }
.jrow .j-round .dot { width: 8px; height: 8px; }
.jrow .j-ref { display: none; }
.jrow.st-overdue .j-due strong, .jrow.st-overdue .j-due span { color: var(--danger); }
.jrow.st-paused, .jrow.st-inactive { opacity: .6; }
.jrow.jhead { display: none; }
@media (min-width: 900px) {
  .jtable { gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .jrow { grid-template-columns: 40px 112px minmax(180px, 2fr) minmax(130px, 1.2fr) 100px minmax(120px, 1fr) 90px; grid-template-areas: 'chk due cust job price round ref';
    border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; padding: 9px 14px 9px 8px; }
  .jrow .j-job, .jrow .j-due { flex-direction: column; align-items: flex-start; gap: 0; }
  .jrow .j-round { justify-content: flex-start; }
  .jrow .j-price { align-self: center; }
  .jrow .j-ref { display: flex; font-size: 12px; }
  .jrow.jhead { display: grid; cursor: default; background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .jrow.jhead::before { display: none; }
  .jrow:last-child { border-bottom: 0; }
}
.bulkbar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 15; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin-bottom: 10px;
  background: var(--text); color: var(--bg); border-radius: 14px; box-shadow: var(--shadow-lg); }
.bulkbar strong { margin-right: 6px; }
.bulkbar .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.bulkbar .btn .ic { width: 15px; height: 15px; }
.job-sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.job-sheet-head .grow { text-align: left; }
.hint { font-weight: 400; text-transform: none; }
.empty-job { width: 100%; padding: 16px; display: flex; gap: 10px; align-items: center; color: var(--primary); font-weight: 600; border-style: dashed; }
.jobs-kpis .kpi strong { font-size: 20px; }
@media (max-width: 420px) { .tabbar a { font-size: 10px; } .tabbar a .ic { width: 22px; height: 22px; } }
@media (max-width: 899px) {
  .jobs-kpis { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .jobs-kpis .kpi { padding: 9px 8px 9px 10px; }
  .jobs-kpis .kpi span { font-size: 10px; line-height: 1.2; }
  .jobs-kpis .kpi strong { font-size: 15px; }
  .jobs-kpis .kpi em { display: none; }
}

/* ── Cloud sync ── */
.sync.tone-ok .sync-dot { background: var(--success); }
.sync.tone-busy .sync-dot { background: var(--primary); animation: pulse 1s infinite; }
.sync.tone-wait .sync-dot { background: var(--warn); }
.sync.tone-bad .sync-dot { background: var(--danger); }
.sync-state { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); margin: 10px 0; }
.sync-state > .dot { width: 12px; height: 12px; margin-top: 4px; background: var(--border-strong); }
.sync-state .grow { gap: 2px; }
.sync-state.tone-ok .dot { background: var(--success); }
.sync-state.tone-busy .dot { background: var(--primary); animation: pulse 1s infinite; }
.sync-state.tone-wait .dot { background: var(--warn); }
.sync-state.tone-bad { background: var(--danger-soft); }
.sync-state.tone-bad .dot { background: var(--danger); }
.cloud-hero { padding: 28px 20px; text-align: center; margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cloud-hero h2 { font-size: 22px; }
.cloud-hero p { margin: 0; max-width: 440px; }
.cloud-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.cloud-ico .ic { width: 34px; height: 34px; }
.gbtn { background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 999px; min-height: 46px; padding: 0 20px; font-weight: 600; font-family: Roboto, system-ui, sans-serif; gap: 10px; }
.gbtn:hover { background: #f8fafd; }
.g-logo { width: 20px; height: 20px; flex: none; }
.btn.primary .g-logo { background: #fff; border-radius: 50%; padding: 2px; }
.cloud-account { padding: 16px; margin-bottom: 14px; }
.acct-row { display: flex; align-items: center; gap: 12px; }
.acct-row .grow { gap: 2px; }
.review-card { border-color: var(--danger); }
.cloud-privacy ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.list-row.conflict { align-items: flex-start; }
.list-row.conflict .grow { gap: 3px; }
.conflict-actions { display: flex; flex-direction: column; gap: 6px; }
.welcome-signin { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
details.card > summary { cursor: pointer; font-weight: 600; color: var(--muted); }

/* ── Forefront Window Cleaning brand (3.8.0) ──
   Black and white like the logo; the star-in-the-O mark (icons.js BRAND_PATH / icons/mark.svg) in the header,
   loading screen and empty states; the full logo (icons/logo.png, black ink on transparent) in the sidebar,
   welcome screen, Settings and printed documents. Headings use a heavy geometric face like the logo's. */
#title { font-family: var(--brand-font); font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; font-size: 21px; }
.sheet-head h2, .empty h3 { font-family: var(--brand-font); font-weight: 800; }
.hdr-mark { display: inline-flex; width: 28px; height: 28px; color: var(--text); flex: none; margin-right: 6px; }
.hdr-mark svg { width: 100%; height: 100%; display: block; }
#back:not([hidden]) ~ .hdr-mark { display: none; }
.brand-logo { display: block; height: auto; }
@media (min-width: 900px) {
  .hdr-mark { display: none; }
  .brand { flex-direction: column; align-items: flex-start; gap: 8px; padding: 6px 10px 22px; }
  .brand .brand-logo { width: 150px; }
  .brand span { font-family: var(--brand-font); font-weight: 800; font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
}
@media (prefers-color-scheme: dark) { .brand-logo, .empty-logo { filter: invert(1); } }
.boot { display: grid; justify-items: center; gap: 14px; }
.boot .brand-mark { width: 56px; height: 56px; color: var(--text); animation: ff-pulse 1.2s ease-in-out infinite; }
@keyframes ff-pulse { 50% { transform: scale(0.9); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .boot .brand-mark { animation: none; } }
.empty > .ic.brand-mark { background: none; padding: 0; width: 52px; height: 52px; color: var(--text); border-radius: 0; }
.empty-logo { width: min(240px, 72%); height: auto; display: block; margin: 0 auto 10px; }
.about-brand { text-align: center; padding: 14px 0 4px; }
.about-brand .brand-logo { width: 110px; margin: 0 auto 8px; }
/* printed documents (always on white paper) */
.doc-logo { display: block; width: 130px; height: auto; margin: 0 0 10px; }
.worksheet-print header .doc-logo, .exp-report header .doc-logo { width: 90px; float: right; margin: 0 0 6px 12px; }
.worksheet-print header::after, .exp-report header::after { content: ''; display: block; clear: both; }

/* ── Home screen (3.9.0) ──
   Phones: every section is a tile on Home, so the bottom bar only shows Home plus the section you're in
   (lit). The desktop side menu still lists everything. */
@media (max-width: 899px) {
  .tabbar a:not([data-nav=home]):not(.active) { display: none; }
  .tabbar a[data-nav=settings].active { display: flex; }
}
.home-hello { margin: 6px 2px 14px; display: grid; gap: 2px; }
.home-hello h2 { font-family: var(--brand-font); font-weight: 800; font-size: 24px; margin: 0; letter-spacing: -0.01em; }
.home-round { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.home-round-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.home-round-top strong { font-size: 17px; }
.home-round .progress { margin-bottom: 8px; }
.home-round-line { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.home-next { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.btn.block { width: 100%; justify-content: center; min-height: 48px; font-size: 16px; text-decoration: none; }
.home-attn-row { display: flex; gap: 8px; margin-bottom: 14px; }
.home-attn { flex: 1; min-width: 0; text-align: left; display: grid; gap: 1px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.home-attn strong { font-size: 18px; }
.home-attn span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-clear { display: flex; align-items: center; gap: 6px; margin: 0 2px 14px; }
.home-clear .ic { width: 16px; height: 16px; color: var(--success); }
.home-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
.home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; min-height: 92px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  text-decoration: none; font: inherit; text-align: left; cursor: pointer; }
.home-tile .ic { width: 22px; height: 22px; margin-bottom: 4px; }
.home-tile strong { font-size: 14px; }
.home-tile span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.home-tile:active, .home-attn:active { transform: scale(0.98); }
.home-week { text-align: center; margin: 16px 0 0; }/* "FOREFRONT SCHEDULER" on Home: scales with the phone's width so it never gets cut off */
#title.long { font-size: clamp(14px, 4vw, 21px); letter-spacing: 0; overflow: visible; text-overflow: clip; }.home-sheet { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; min-width: 0; }
.home-sheet .ic { width: 14px; height: 14px; flex: none; }
.home-sheet span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-sheet-change { margin-left: auto; color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; flex: none; }
/* Weather card on Home (3.9.0) */
.home-weather { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.hw-now { display: flex; align-items: center; gap: 10px; }
.hw-now .hw-big { width: 34px; height: 34px; flex: none; }
.hw-temp { display: grid; line-height: 1.15; }
.hw-temp strong { font-size: 24px; font-weight: 800; font-family: var(--brand-font); }
.hw-temp span { font-size: 13px; color: var(--muted); }
.hw-place { margin-left: auto; display: grid; justify-items: end; text-align: right; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.hw-place span { font-size: 12.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-place span:first-child { font-weight: 600; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.hw-place .muted { font-size: 11px; }
.hw-alerts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.hw-alerts li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.35; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.hw-alerts li .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.hw-alerts li.tone-frost { background: #e8f1fd; color: #12407a; }
.hw-alerts li.tone-rain { background: #eef0f4; color: #2c3a4f; }
.hw-alerts li.tone-wind { background: #fdf1e3; color: #7a4310; }
.hw-alerts li.tone-ok .ic { color: var(--success); }
@media (prefers-color-scheme: dark) {
  .hw-alerts li.tone-frost { background: #13294a; color: #cfe2ff; }
  .hw-alerts li.tone-rain { background: #1d232d; color: #d7deea; }
  .hw-alerts li.tone-wind { background: #3a2610; color: #ffdcb4; }
}
.hw-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); text-align: center; }
.hw-day { display: grid; justify-items: center; gap: 2px; font-size: 12px; }
.hw-day .ic { width: 20px; height: 20px; margin: 2px 0; }
.hw-dn { font-size: 11px; color: var(--muted); font-weight: 600; }
.hw-day:first-child .hw-dn { color: var(--text); }
.hw-min { color: var(--muted); }
.hw-day.frost .hw-min { color: #2f74d0; font-weight: 700; }
.hw-rain { font-size: 10.5px; color: #3b6fb6; min-height: 13px; }
@media (prefers-color-scheme: dark) { .hw-day.frost .hw-min { color: #8fbaff; } .hw-rain { color: #8fb3e8; } }
.hw-setup-text { display: flex; gap: 12px; align-items: flex-start; }
.hw-setup-text .ic { width: 30px; height: 30px; flex: none; }
.hw-setup-text div { display: grid; gap: 2px; }
.hw-setup .btn-row { margin: 12px 0 0; }
.hw-loading { display: flex; align-items: center; gap: 8px; margin: 0; }
.hw-loading .ic { width: 20px; height: 20px; }
/* Settings → weather alerts (3.10.0) */
.push-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.push-block h4 { margin: 0 0 6px; font-size: 14px; }
.push-block .check { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }.ok-text { color: var(--success); }
.hw-alerts-link { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 8px 0 0; border: 0; border-top: 1px solid var(--border);
  background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.hw-alerts-link .ic { width: 16px; height: 16px; }
/* Home 3.11.0: compact weather (tap to expand) and "Needs doing" */
.hw-now { width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hw-place { pointer-events: none; }
.hw-place span:first-child { text-decoration: none; }
.hw-chev { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .2s; }
.home-weather.open .hw-chev { transform: rotate(180deg); }
.home-weather .hw-alerts { margin-top: 10px; gap: 4px; }
.home-weather:not(.open) .hw-alerts li { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.hw-alerts li.tone-snow { background: #eef0f4; color: #2c3a4f; }
.hw-alerts li.tone-heat { background: #fdeceb; color: #8a1f17; }
@media (prefers-color-scheme: dark) { .hw-alerts li.tone-snow { background: #1d232d; color: #d7deea; } .hw-alerts li.tone-heat { background: #3d1613; color: #ffc9c3; } }
.hw-h { margin: 14px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hw-hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; text-align: center; }
.home-weather .hw-days { margin-top: 0; padding-top: 0; border-top: 0; }
.hw-day.hot .hw-max { color: #c0392b; }
@media (prefers-color-scheme: dark) { .hw-day.hot .hw-max { color: #ff8a7d; } }
.hw-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.hw-foot .btn-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.hw-foot .ic { width: 15px; height: 15px; }
.hw-foot .hw-alerts-link { width: auto; margin: 0; padding: 0; border: 0; }

.home-todo { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px 6px; margin-bottom: 14px; }
.home-todo h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; }
.nd-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 11.5px; display: inline-grid; place-items: center; }
.nd-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.home-todo h3 + .nd-row { border-top: 0; }
.nd-row > .ic:first-child { width: 20px; height: 20px; flex: none; color: var(--muted); }
.nd-row.tone-danger > .ic:first-child, .nd-row.tone-danger strong { color: var(--danger); }
.nd-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.nd-text strong { font-size: 14px; }
.nd-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-val { font-weight: 700; font-size: 14px; }
.nd-go { width: 16px; height: 16px; flex: none; color: var(--muted); }
.nd-more { width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.home-todo.is-clear { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 13px; color: var(--muted); }
.home-todo.is-clear .ic { width: 18px; height: 18px; color: var(--success); }
.push-sub { margin: 12px 0 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Needs doing: compact (title, count, one-line summary), tap to open the list (3.11.0) */
.home-todo { padding: 0; }
.nd-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'title chev' 'sum chev'; align-items: center; gap: 4px 10px; width: 100%; padding: 14px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.nd-title { grid-area: title; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.nd-summary { grid-area: sum; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nd-summary i { font-style: normal; margin: 0 6px; opacity: .6; }
.nd-summary .tone-danger { color: var(--danger); font-weight: 600; }
.nd-chev { grid-area: chev; width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.home-todo.open .nd-chev { transform: rotate(180deg); }
.nd-count.urgent { background: var(--danger); color: #fff; }
.nd-list { padding: 0 14px 4px; }
.nd-list .nd-row:first-child { border-top: 1px solid var(--border); }
/* Worksheet rows, cleaner (3.12.0): no stop number, price beside the name, icon-only shortcuts on the same
   line as Skip / Paid / Done */
.ws-row { display: block; padding: 12px 14px; }
.ws-top { display: flex; align-items: flex-start; gap: 12px; }
.ws-top .ws-name { flex: 1; min-width: 0; }
.ws-name strong { font-size: 15.5px; }
.ws-price { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.ws-row .job-meta { margin-top: 8px; gap: 6px; }
.ws-row .ws-note { margin-top: 8px; }
.ws-bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ws-bottom .ws-quick { display: flex; flex-wrap: nowrap; gap: 6px; margin: 0; }
.ws-bottom .ws-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ws-ico { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
.ws-ico .ic { width: 18px; height: 18px; color: var(--text); }
.ws-ico.hot .ic { color: var(--on-primary); }
.ws-bottom .btn.sm { min-height: 38px; padding: 0 12px; }
.ws-bottom .btn-done { width: 42px; height: 42px; }
.ws-row.is-done .ws-bottom, .ws-row.is-skipped .ws-bottom { border-top-style: dashed; }
.ws-row.is-done :is(.ws-top, .job-meta, .ws-note), .ws-row.is-skipped :is(.ws-top, .job-meta, .ws-note, .ws-quick) { opacity: 0.6; }
@media (max-width: 360px) { .ws-ico { width: 34px; height: 34px; } .ws-bottom .btn.sm { padding: 0 9px; } }/* fit a 375–390px phone: 4 icons + Skip + Paid + Done on one line */
.ws-bottom { gap: 6px; flex-wrap: wrap; }
.ws-bottom .ws-quick { gap: 4px; }
.ws-ico { width: 35px; height: 35px; }
.ws-ico .ic { width: 17px; height: 17px; }
.ws-bottom .ws-actions { gap: 5px; }
.ws-bottom .btn.sm { min-height: 36px; padding: 0 10px; }
.ws-bottom .btn.sm .ic { display: none; }
.ws-bottom .btn-done { width: 40px; height: 40px; flex: none; }
@media (max-width: 360px) { .ws-ico { width: 32px; height: 32px; } .ws-bottom .btn.sm { padding: 0 8px; } }@media (max-width: 380px) { .ws-row { padding: 12px; } .ws-ico { width: 32px; height: 32px; } .ws-ico .ic { width: 16px; height: 16px; } .ws-bottom .btn.sm { padding: 0 8px; font-size: 13px; } .ws-bottom .btn-done { width: 38px; height: 38px; } .ws-bottom, .ws-bottom .ws-actions { gap: 4px; } .ws-bottom .ws-quick { gap: 3px; } }
/* Licence lock screen (3.15.0) */
#licence-gate { position: fixed; inset: 0; z-index: 1000; background: var(--bg); overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: calc(env(safe-area-inset-top) + 40px) 18px calc(env(safe-area-inset-bottom) + 30px); }
body.licence-locked { overflow: hidden; }
.gate-card { width: 100%; max-width: 420px; display: grid; gap: 12px; text-align: center; }
.gate-card .gate-logo { width: 72px; height: 72px; margin: 0 auto 4px; object-fit: contain; }
.gate-card h1 { font-size: 22px; line-height: 1.25; margin: 0; }
.gate-card p { margin: 0; }
.gate-card .form { text-align: left; display: grid; gap: 10px; margin-top: 6px; }
.gate-card input[name=code] { font: 600 20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; text-transform: uppercase; text-align: center; }
.gate-err { color: var(--danger); font-size: 14px; margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.5px; }
/* search-to-pick a customer */
.cust-pick { display: flex; flex-direction: column; gap: 6px; }
.cust-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: 11px; }
.cust-chosen .grow, .cust-hit { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cust-results { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.cust-results:empty { display: none; }
.cust-hit { text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.cust-hit:active { background: var(--primary-soft); }
.cust-results p { margin: 4px 2px; }
/* message reminders: work-day toggles */
.remind-days { margin: 6px 0 10px; }
.chip-check { position: relative; display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; min-height: 38px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip-check input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }
.remind-hour { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }

/* 3.18.0: Worksheet line = shortcuts on the left, red Skip and green Done on the right; the Done sheet */
.btn-skip { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); transition: transform 0.1s; }
.btn-skip .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.btn-skip:active { transform: scale(0.92); }
.ws-bottom { flex-wrap: nowrap; }
.ws-bottom .ws-actions { gap: 8px; }
.done-form .done-price { display: flex; align-items: flex-end; gap: 10px; }
.done-form .done-price label { flex: 1; }
.done-form .done-price .chips-row { margin: 0 0 4px; flex-wrap: nowrap; }
.done-form .field-label { font-size: 14px; font-weight: 600; color: var(--muted); margin: 4px 0 -4px; }
.done-form .paid-pick { flex-wrap: nowrap; }
.done-form .paid-pick .chip-check { flex: 1; }
.done-form .paid-pick .chip-check span { width: 100%; }
.done-form .done-text { display: flex; align-items: center; gap: 8px; }
.done-form .done-text .ic { width: 18px; height: 18px; }
.done-form .done-go { width: 100%; min-height: 50px; font-size: 16px; background: var(--success); border-color: var(--success); color: #fff; }

/* 3.18.0: Money tab: compact totals, search, round chips, sort, Text-what-they-owe button beside Paid */
.money-kpis { grid-template-columns: repeat(3, 1fr); }
.money-kpis .kpi { padding: 10px 10px 10px 14px; }
.money-kpis .kpi strong { font-size: 17px; }
.money-kpis .kpi span, .money-kpis .kpi em { font-size: 11.5px; }
.money-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 8px; }
.money-count select { width: auto; min-height: 34px; padding: 4px 28px 4px 10px; font-size: 13.5px; border-radius: 10px; }
.owed-row { gap: 10px; }
.owed-row .dot { flex: none; }
.owed-row .grow { min-width: 0; display: flex; flex-direction: column; }
.owed-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.owed-text { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft, #fef3c7); color: var(--warn, #b45309); }
.owed-text .ic { width: 18px; height: 18px; }
/* the search boxes (Customers, Money): one rounded box, not a box inside a box */
.search input:not([type=checkbox]):not([type=radio]):not([type=file]) { border: 0; box-shadow: none; background: transparent; padding: 0; height: 46px; border-radius: 0; }
.owed-row .grow strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 3.19.0: your own logo (Settings → Business details) */
.logo-pick { display: flex; align-items: center; gap: 12px; }
.logo-preview { width: 140px; height: 70px; flex: none; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.doc-logo.custom { width: auto; max-width: 160px; max-height: 70px; }
.worksheet-print header .doc-logo.custom, .exp-report header .doc-logo.custom { max-width: 110px; max-height: 50px; }
.logo-btns .btn { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.logo-pick + .muted.small { margin-top: 2px; }

/* ── Customer requests (customer app, Stage 3) ── */
.req-row { width: 100%; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.req-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.req-row > .ic:last-child { width: 16px; height: 16px; color: var(--muted); flex: none; }
.tick.req-new { background: var(--danger-soft, #fee2e2); color: var(--danger, #dc2626); }
.portal-card .req-h { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.portal-card .req-list .list-row { padding-left: 0; padding-right: 0; }
.portal-card > .btn.ghost { margin-top: 8px; }
.req-thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.req-msg { border-radius: 10px; padding: 8px 10px; background: var(--surface-2, #f1f5f9); max-width: 92%; }
.req-msg.me { align-self: flex-end; background: var(--primary-soft, var(--surface-2)); }
.req-msg p { margin: 2px 0 0; }
.req-quote { white-space: normal; border-left: 3px solid var(--border-strong, #cbd5e1); padding-left: 8px; }
.req-actions { flex-wrap: wrap; }

/* 3.22.0: customer app messages (Stage 4) — conversations, what happened to each message, announcements */
.msg-sheet .msg-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px 0 8px; }
.msg-auto { border: 1px dashed var(--border-strong, #cfcfcb); border-radius: 12px; padding: 8px 12px; align-self: stretch; }
.msg-auto p { margin: 4px 0; }
.dl-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; background: var(--surface-2, #efefed); color: var(--muted); }
.dl .ic { width: 13px; height: 13px; }
.dl.good { background: var(--success-soft); color: var(--success); }
.dl.bad { background: var(--danger-soft, #fee2e2); color: var(--danger); }
.dl.wait { background: var(--warn-soft); color: var(--warn); }
.msg-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ann-pick { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px 10px; }
.ann-count { min-height: 1.4em; }
.ann-detail { display: block; }
.ann-detail .ann-text { display: block; white-space: pre-wrap; margin-top: 6px; color: var(--text); font-size: 14px; }
.auto-note { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin: 2px 0 0; }
.auto-note .ic { width: 16px; height: 16px; flex: none; }
.notify-opts label.check { display: flex; align-items: flex-start; margin: 12px 0 4px; }
.notify-opts label.check input { margin-top: 3px; flex: none; }
.ann-round span { white-space: nowrap; }
.ann-round select { flex: 1; min-width: 0; }
.test-sends { display: grid; gap: 10px; margin: 8px 0; }
.test-send { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.test-send .dl-row { justify-content: space-between; align-items: center; }
.ws-auto { align-self: center; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; border-radius: 999px; padding: 2px 7px; background: var(--success-soft); color: var(--success); }
