/* Hallmark · checked: 2026-11-06 · genre: modern-minimal (inferred) · scope: app
 * floor: 1 FAIL left (56, false positive: the navbar is display:none on phone job screens) · fixed: 9 (10a, 34, 39a, 48, 67) · structural: none printed
 * built: the project · redesign: polish · v2.0.0 */
/* =====================================================================
   Field Intelligence by SolWise: design tokens for the visit app
   Drop-in replacement for the :root block at the top of frontend/styles.css.
   Every existing token name is kept, so all current rules re-skin without
   any other change. New tokens are added at the bottom of each block.
   Source of truth: prototype "2026-10-22 Field Intelligence Prototype.html".
   ===================================================================== */

:root {
  /* ---- existing names, new values ---- */
  --bg: #f2f2f7; /* grouped page background */
  --surface: #ffffff; /* cards, rows, sheets */
  --surface-card: #f7f7fa; /* inner panels on a surface */
  --ink: #1c1c1e; /* primary text */
  --ink2: #6c6c70; /* secondary text: 5.2:1 on white, 4.7:1 on --bg */
  --line: #e0e0e5; /* hairline separators (use 0.5px) */
  --line2: #e3e3e8; /* control fills: segmented track, search, progress track */
  --primary: #1c1c1e;
  --accent: #a80e4c; /* SolWise crimson: buttons, links, selection, 7.4:1 on white */
  --accent2: #8a0b3e; /* pressed / hover of --accent */
  --accent-bg: #f6e7ed; /* tinted hover and selected background */
  --ok: #19703f; /* 5.4:1 on --okBg */
  --okBg: #e6f4ec;
  --okLine: #a9d9bf;
  --warn: #8a5a00; /* text on --warnBg, 5.6:1 */
  --warnBg: #fff4e1;
  --warnLine: #fdc474; /* SolWise gold */
  --bad: #c4281f; /* destructive actions, End visit */
  --badBg: #fdeceb;
  --badLine: #f3b4ae;
  --r: 12px; /* cards and grouped lists */
  --dock-h: 0px; /* unchanged, still set by syncDockHeight() */
  --font: "Poppins", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-display: "Poppins", -apple-system, system-ui, "Segoe UI", sans-serif;

  /* ---- new tokens ---- */
  --ink3: #8e8e93; /* disabled text only, never body copy */
  --gold: #fdc474;
  --bar: rgba(
    249,
    249,
    251,
    0.86
  ); /* top bar + bottom dock, with backdrop blur */
  --bar-line: rgba(60, 60, 67, 0.18);
  --shadow: 0 1px 2px rgba(28, 28, 30, 0.06);
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  --r-ctl: 9px; /* segmented control track */
  --r-pill: 999px; /* primary buttons */
  --tap: 44px; /* minimum tap target */
  --field-h: 58px; /* floating-label field row */
  --field-line: #bcbcc3; /* outline of input boxes (visible edge so they read as editable) */
  --t: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --on-accent: #ffffff; /* text on --accent and --bad fills */
  --scrim: rgba(0, 0, 0, 0.32); /* behind sheets, menus, alerts */
  --pop-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 0.5px var(--line);
  --seg-shadow: 0 3px 8px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.06);
  /* Camera and photo surfaces: always dark, in both appearances */
  --media: #121214;
  --media-black: #000000;
  --photo-bg: #2b2d33;
  --on-media: #ffffff;
  --on-media2: rgba(255, 255, 255, 0.7);
  /* Signature pad: ink on white in both themes */
  --sigpad-bg: #ffffff;
  --sigpad-hint: #6c6c70;
  --media-line: rgba(255, 255, 255, 0.5);
  --media-scrim: rgba(0, 0, 0, 0.62);
  --preview-scrim: rgba(0, 0, 0, 0.92);
  --photo-ok: #6ee7a8;
}

/* Dark appearance: follows the device setting unless the user picks light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-card: #2c2c2e;
    --ink: #f5f5f7;
    --ink2: #a1a1a6;
    --ink3: #6e6e73;
    --primary: #f5f5f7;
    --line: #38383a;
    --field-line: #636366;
    --line2: #2c2c2e;
    --accent: #ef6696;
    --accent2: #f27aa5;
    --accent-bg: rgba(239, 102, 150, 0.14);
    --ok: #30d158;
    --okBg: rgba(48, 209, 88, 0.14);
    --okLine: rgba(48, 209, 88, 0.4);
    --warn: #fdc474;
    --warnBg: rgba(253, 196, 116, 0.14);
    --warnLine: rgba(253, 196, 116, 0.4);
    --bad: #ff6961;
    --badBg: rgba(255, 105, 97, 0.14);
    --badLine: rgba(255, 105, 97, 0.4);
    --bar: rgba(22, 22, 24, 0.82);
    --bar-line: rgba(255, 255, 255, 0.12);
    --shadow: none;
    --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    --on-accent: #1c1c1e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-card: #2c2c2e;
  --ink: #f5f5f7;
  --ink2: #a1a1a6;
  --ink3: #6e6e73;
  --primary: #f5f5f7;
  --line: #38383a;
  --field-line: #636366;
  --line2: #2c2c2e;
  --accent: #ef6696;
  --accent2: #f27aa5;
  --accent-bg: rgba(239, 102, 150, 0.14);
  --ok: #30d158;
  --okBg: rgba(48, 209, 88, 0.14);
  --okLine: rgba(48, 209, 88, 0.4);
  --warn: #fdc474;
  --warnBg: rgba(253, 196, 116, 0.14);
  --warnLine: rgba(253, 196, 116, 0.4);
  --bad: #ff6961;
  --badBg: rgba(255, 105, 97, 0.14);
  --badLine: rgba(255, 105, 97, 0.4);
  --bar: rgba(22, 22, 24, 0.82);
  --bar-line: rgba(255, 255, 255, 0.12);
  --shadow: none;
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  --on-accent: #1c1c1e;
}

/* Browser surfaces that otherwise ship with defaults */
::selection {
  background: var(--accent-bg);
  color: var(--ink);
}
input,
textarea {
  caret-color: var(--accent);
}
input::placeholder,
textarea::placeholder {
  color: var(--ink2);
  opacity: 1;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body {
  font-size: 17px;
  line-height: 1.41;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================================================
   Field Intelligence core: the prototype's shared patterns.
   Bars, sections, grouped lists, rows, segmented control, fields,
   buttons, bottom bar, sheets, menus and the banner. Screen-specific
   rules follow further down.
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  font-family: var(--font);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  border-radius: 8px;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
}
[hidden] {
  display: none !important;
}
.hidden {
  display: none !important;
}
svg {
  flex: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

svg.ic {
  vertical-align: -2px;
}
.tone-accent {
  color: var(--accent);
}
.tone-ok {
  color: var(--ok);
}
.tone-warn {
  color: var(--warn);
}
.tone-bad {
  color: var(--bad);
}

/* ---------- Navigation bar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--bar-line);
  padding-top: env(safe-area-inset-top);
}
.navbar-in {
  max-width: 760px;
  margin: 0 auto;
  height: 56px;
  padding: 0 calc(12px + env(safe-area-inset-right)) 0
    calc(12px + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body.signed-out .navbar {
  display: none;
}
.bar-btn {
  min-width: var(--tap);
  height: var(--tap);
  padding: 0 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--accent);
  font-size: 17px;
  white-space: nowrap;
  transition: background var(--t);
}
.bar-btn svg {
  width: 22px;
  height: 22px;
}
@media (hover: hover) {
  .bar-btn:hover {
    background: var(--accent-bg);
  }
}
.bar-btn:active {
  opacity: 0.55;
}
.bar-btn.on,
.bar-btn[aria-expanded="true"] {
  background: var(--accent-bg);
}
.bar-btn[disabled] {
  color: var(--ink3);
  cursor: not-allowed;
  background: none;
}
.theme-btn .i-sun,
.theme-btn[data-mode="dark"] .i-moon {
  display: none;
}
.theme-btn[data-mode="dark"] .i-sun {
  display: block;
}
.bar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.user {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.user-name {
  font-size: 15px;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.user-role {
  font-size: 13px;
  color: var(--ink2);
  white-space: nowrap;
  margin-right: 4px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}

/* ---------- Page content ---------- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 4px calc(20px + env(safe-area-inset-right)) 140px
    calc(20px + env(safe-area-inset-left));
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px -8px 2px;
  gap: 8px;
  min-height: var(--tap);
}
.large-title {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.subtitle {
  font-size: 15px;
  color: var(--ink2);
  margin: 2px 0 20px;
}
.section {
  margin-top: 28px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--ink2);
  padding: 0 16px 7px;
}
.section-head > span:last-child {
  white-space: nowrap;
}
.section-foot,
.footnote {
  font-size: 13px;
  color: var(--ink2);
  padding: 7px 16px 0;
  line-height: 1.4;
}
.footnote {
  padding-top: 8px;
}
.group {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.group + .group {
  margin-top: 12px;
}
.link {
  color: var(--accent);
}
.empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 15px;
  color: var(--ink2);
}
.empty.error {
  color: var(--bad);
}

/* ---------- Segmented control ---------- */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  background: var(--line2);
  border-radius: var(--r-ctl);
  padding: 2px;
}
.segmented button {
  min-height: 36px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition:
    background var(--t),
    box-shadow var(--t);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  font-weight: 600;
  box-shadow: var(--seg-shadow);
}
.segmented button[aria-disabled="true"] {
  color: var(--ink3);
  cursor: not-allowed;
}
.count {
  font-size: 13px;
  color: var(--ink);
  font-weight: 400;
}

/* ---------- Rows ---------- */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 11px 16px;
  text-align: left;
  color: var(--ink);
  font-size: 17px;
  transition: background var(--t);
}
.row + .row::before,
.row.sep::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 0.5px;
  background: var(--line);
}
@media (hover: hover) {
  button.row:not([disabled]):hover {
    background: var(--accent-bg);
  }
}
button.row:not([disabled]):active {
  background: var(--line2);
}
button.row[disabled] {
  cursor: not-allowed;
  color: var(--ink3);
}
.row-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.row-title {
  display: block;
}
.row-sub {
  display: block;
  font-size: 15px;
  color: var(--ink2);
}
.row .check {
  color: var(--accent);
  visibility: hidden;
  width: 22px;
  height: 22px;
}
.row[aria-checked="true"] .check {
  visibility: visible;
}
.row.destructive[aria-checked="true"] .check {
  color: var(--bad);
}
.row .value {
  color: var(--ink2);
  text-align: right;
  overflow-wrap: anywhere;
}
.row .chev {
  color: var(--ink3);
  width: 18px;
  height: 18px;
}
.row .lead {
  width: 28px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
}
.row .lead svg {
  width: 18px;
  height: 18px;
}
.row .trail {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kv .row {
  min-height: 48px;
}
.row.ok .value,
.value.ok {
  color: var(--ok);
}
.row.warn .value,
.value.warn {
  color: var(--warn);
}
.row.bad .value,
.value.bad {
  color: var(--bad);
}

/* ---------- Question + progress ---------- */
.question {
  font-size: 22px;
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.012em;
  padding: 18px 16px 6px;
  overflow-wrap: anywhere;
}
.help {
  font-size: 15px;
  color: var(--ink2);
  padding: 0 16px 14px;
}
.progress {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: calc(100% - 32px);
  margin: 0 16px 14px;
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: var(--line2);
  overflow: hidden;
  color: var(--accent);
}
.progress::-webkit-progress-bar {
  background: var(--line2);
  border-radius: 2px;
}
.progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 2px;
}
.progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 2px;
}
.wiz-progress {
  width: 100%;
  margin: 0 0 14px;
}

/* ---------- Status labels: dot + text, never colour alone ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status.now {
  color: var(--accent);
}
.status.done {
  color: var(--ok);
}
.status.wait {
  color: var(--warn);
}
.status.bad {
  color: var(--bad);
}
.status.later {
  color: var(--ink2);
}
.status.later::before {
  background: none;
  border: 1.5px solid currentColor;
  width: 7px;
  height: 7px;
}

/* ---------- Text fields ---------- */
/* Every labelled input (renderTextInput) and every filter select/date is a
   .field row with a floating label: the label rests inside the row like a
   placeholder and floats above the value on focus or once there is a value.
   No JS - :focus-within, :placeholder-shown (the component always emits a
   non-empty placeholder) and :has() drive it. */
.field {
  display: block;
  position: relative;
  min-height: var(--field-h);
  margin: 0 16px 12px;
  padding: 0 12px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
}
.group > .field:first-child,
.group > .textarea:first-child {
  margin-top: 12px;
}
.field > label,
.select-field > span {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 7px;
  transform: translateY(11px);
  font-size: 17px;
  line-height: 1.2;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition:
    transform 0.15s ease,
    font-size 0.15s ease,
    color 0.15s ease;
}
/* A trailing button (password eye, copy) keeps the label clear of it */
.field:has(.input-wrap > :not(input)) > label {
  right: calc(12px + var(--tap));
}
.field .form-control {
  display: block;
  width: 100%;
  height: var(--field-h);
  padding: 22px 0 4px;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-size: 17px;
  outline: none;
}
.field .form-control:focus-visible {
  outline: none;
}
.field .form-control::placeholder {
  color: var(--ink2);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.field .form-control:focus::placeholder {
  opacity: 1;
}
/* Floated: focus, a value, browser autofill, or a control that always shows
   something (date, select). */
.field:focus-within > label,
.field:has(.form-control:not(:placeholder-shown)) > label,
.field:has(.form-control:-webkit-autofill) > label,
.field:has(.form-control:autofill) > label,
.field:has(.form-control[type="date"]) > label,
.select-field > span {
  transform: none;
  font-size: 12px;
}
.field:focus-within > label,
.select-field:focus-within > span {
  color: var(--accent);
}
.field .form-control:disabled {
  color: var(--ink2);
  -webkit-text-fill-color: var(--ink2);
}
.field:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.field:has(.form-control:disabled) {
  border-color: var(--line);
}
.input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}
.input-wrap .form-control {
  flex: 1;
  min-width: 0;
}
.input-wrap > :not(input) {
  flex: none;
}
@media (prefers-reduced-motion: reduce) {
  .field > label,
  .select-field > span,
  .field .form-control::placeholder {
    transition: none;
  }
}
.form-control--code,
.form-control--code-lg {
  letter-spacing: 0.04em;
  font-weight: 500;
}
.form-control--code::placeholder,
.form-control--code-lg::placeholder {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
/* A standalone input outside a grouped row */
.form-control {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 17px;
  outline: none;
}
.form-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.form-control:disabled {
  color: var(--ink2);
  cursor: not-allowed;
}
.password-toggle {
  width: var(--tap);
  height: var(--tap);
  margin-right: -10px;
  display: grid;
  place-items: center;
  color: var(--ink2);
  border-radius: 10px;
}
.password-toggle svg {
  width: 20px;
  height: 20px;
}
.password-toggle .icon-eye-off,
.password-toggle.is-visible .icon-eye {
  display: none;
}
.password-toggle.is-visible .icon-eye-off {
  display: block;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--tap);
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink2);
}
.search svg {
  width: 18px;
  height: 18px;
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 17px;
  color: var(--ink);
}
.search:focus-within {
  box-shadow: 0 0 0 2px var(--accent);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.textarea {
  width: calc(100% - 32px);
  min-height: 150px;
  margin: 0 16px 12px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: none;
  resize: vertical;
  padding: 12px;
  font-size: 17px;
  line-height: 1.45;
  outline: none;
  display: block;
}

/* ---------- Buttons ---------- */
.btn,
.primary {
  min-height: 50px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  line-height: 1.2;
  transition:
    background var(--t),
    transform var(--t),
    opacity var(--t);
}
.btn {
  width: 100%;
}
.btn svg {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .btn-primary:not([disabled]):hover,
  .primary:not([disabled]):hover {
    background: var(--accent2);
  }
}
.btn:not([disabled]):active,
.primary:not([disabled]):active {
  transform: scale(0.98);
}
.btn[disabled],
.primary[disabled] {
  background: var(--line2);
  color: var(--ink3);
  cursor: not-allowed;
  transform: none;
}
/* Secondary: tinted pill. Used for the second action in a bar. */
.btn-outline,
.secondary {
  background: var(--accent-bg);
  color: var(--accent);
}
@media (hover: hover) {
  .btn-outline:not([disabled]):hover,
  .secondary:not([disabled]):hover {
    background: var(--accent-bg);
    box-shadow: inset 0 0 0 1.5px var(--accent);
  }
}
.secondary {
  min-height: var(--tap);
  height: var(--tap);
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger,
.btn-destructive,
.primary.destructive {
  background: var(--bad);
  color: var(--on-accent);
}
@media (hover: hover) {
  .btn-danger:not([disabled]):hover,
  .btn-destructive:not([disabled]):hover {
    background: var(--bad);
    filter: brightness(0.92);
  }
}
.btn-ghost,
.btn-ghost-danger {
  background: none;
  color: var(--accent);
  min-height: var(--tap);
  font-weight: 500;
}
.btn-ghost-danger {
  color: var(--bad);
}
@media (hover: hover) {
  .btn-ghost:not([disabled]):hover,
  .btn-ghost-danger:not([disabled]):hover {
    background: var(--accent-bg);
  }
}
.btn-auto {
  width: auto;
}
.btn.is-loading {
  position: relative;
  color: transparent;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ink3);
  border-top-color: transparent;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line2);
  border-top-color: var(--accent);
  animation: btn-spin 0.9s linear infinite;
  flex: none;
}
svg.spin {
  animation: btn-spin 0.9s linear infinite;
}

/* ---------- Bottom bar (the wizard dock) ---------- */
.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--bar-line);
  padding: 12px calc(20px + env(safe-area-inset-right))
    calc(22px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
}
.bottom-in {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bottom-note {
  font-size: 13px;
  color: var(--ink2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bottom-note svg {
  width: 16px;
  height: 16px;
}
.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}
.bottom-actions > .btn,
.dock-row > .btn {
  width: auto;
  min-width: 220px;
}
.dock-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Banner (showBanner) ---------- */
#toastContainer {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: min(440px, calc(100% - 32px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--pop-shadow);
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  animation: toast-in var(--t);
  transition:
    opacity var(--t),
    transform var(--t);
}
.toast.toast-hiding {
  opacity: 0;
  transform: translateY(-6px);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
.toast-icon {
  flex: none;
  display: grid;
  margin-top: 1px;
}
.toast-icon svg {
  width: 20px;
  height: 20px;
}
.toast-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.toast-close {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -4px -6px -4px 0;
  display: grid;
  place-items: center;
  color: var(--ink2);
  border-radius: 8px;
}
.toast-close svg {
  width: 16px;
  height: 16px;
}
.toast-success .toast-icon {
  color: var(--ok);
}
.toast-error .toast-icon {
  color: var(--bad);
}
.toast-warning .toast-icon {
  color: var(--warn);
}
.toast-info .toast-icon {
  color: var(--accent);
}

/* ---------- Phone width ---------- */
@media (max-width: 560px) {
  .navbar-in {
    padding: 0 calc(6px + env(safe-area-inset-right)) 0
      calc(6px + env(safe-area-inset-left));
  }
  .brand img {
    height: 28px;
  }
  .user-name,
  .user-role {
    display: none;
  }
  .container {
    padding: 0 calc(16px + env(safe-area-inset-right)) 130px
      calc(16px + env(safe-area-inset-left));
  }
  .large-title {
    font-size: 30px;
  }
  .bar-btn .label {
    display: none;
  }
  .bottom {
    padding: 10px calc(16px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
  }
  .bottom-note {
    display: none;
  }
  .bottom-actions {
    flex: 1;
    min-width: 0;
  }
  .bottom-actions > .btn,
  .dock-row > .btn,
  .bottom-actions > .primary {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 14px;
  }
  .dock-row {
    flex: 1;
  }
  .field .form-control {
    font-size: 16px;
  }
  .segmented button {
    font-size: 14px;
    gap: 4px;
    padding: 0 2px;
  }
  .lap-only {
    display: none !important;
  }
}
@media (min-width: 561px) {
  .phone-only {
    display: none !important;
  }
}

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}
.brand img {
  height: 36px;
  margin: -4px 0;
  display: block;
}
.logo-dark {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light {
    display: none !important;
  }
  :root:not([data-theme="light"]) .logo-dark {
    display: block !important;
  }
}
:root[data-theme="dark"] .logo-light {
  display: none !important;
}
:root[data-theme="dark"] .logo-dark {
  display: block !important;
}
.login-brand {
  justify-content: center;
}
.login-brand img {
  height: 52px;
  margin: 0 auto 6px;
}

/* ---------- Key/value groups: keep the key readable next to long values */
.group.kv .row > .row-text {
  flex: 0 1 auto;
  min-width: 38%;
}
/* A trailing button (View, Add photos) eats width too: on phones the label
   and the button share the first line and the value gets the full width
   below them. */
@media (max-width: 560px) {
  .group.kv .row:has(> .trail) {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 12px;
  }
  .group.kv .row:has(> .trail) > .row-text {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: none;
  }
  .group.kv .row:has(> .trail) > .trail {
    grid-column: 2;
    grid-row: 1;
  }
  .group.kv .row:has(> .trail) > .value {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    text-align: left;
  }
}
.group.kv .row > .value {
  flex: 1;
  min-width: 0;
}

/* ---------- Uploaded photos (renderUploadedPhotos, gallery) ---------- */
.photo-group + .photo-group {
  margin-top: 16px;
}
.photo-group-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
  margin-bottom: 8px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}
.photo-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  text-align: left;
  border-radius: 10px;
}
.photo-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
}
.photo-tile span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink2);
}
@media (hover: hover) {
  .photo-tile:hover img {
    opacity: 0.85;
  }
}

/* =====================================================================
   Field Intelligence screens
   ===================================================================== */

/* ---------- Sign in ---------- */
.signin {
  min-height: calc(100vh - 144px);
  min-height: calc(100dvh - 144px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.signin-in {
  width: 100%;
  max-width: 400px;
}
.signin h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-top: 24px;
}
.signin .lead {
  font-size: 15px;
  color: var(--ink2);
  text-align: center;
  margin: 4px 0 28px;
}
.signin .error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--bad);
  font-size: 15px;
  padding: 10px 16px 0;
}
.signin .error:empty {
  display: none;
}
.signin .error::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%279%27/%3E%3Cpath d=%27M12 8v5M12 16h.01%27/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%279%27/%3E%3Cpath d=%27M12 8v5M12 16h.01%27/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.signin-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Wizard shell (renderShell) ---------- */
.wiz {
  margin-top: 28px;
}
.wiz-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* The dock is fixed; reserve room only when it is taller than the page
   bottom padding already allows (a mic row plus buttons, for example). */
.wiz .scroll {
  padding-bottom: max(0px, calc(var(--dock-h, 0px) - 110px));
}
.readonly-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 15px;
}
.readonly-note svg {
  width: 18px;
  height: 18px;
}
.step-back {
  margin-left: -8px;
}

/* ---------- Jobs list chrome ---------- */
.filter-count {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
#jobsListTabs {
  margin-top: 14px;
}
.filter-panel {
  margin-top: 14px;
}
.jobs-filters {
  padding-top: 16px;
}
/* Filter selects and dates: same field row, label permanently floated */
.select-field select,
.select-field input[type="date"] {
  display: block;
  width: 100%;
  height: var(--field-h);
  padding: 22px 28px 4px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 17px;
  text-align: left;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.select-field input[type="date"] {
  padding-right: 0;
}
.select-field:has(select)::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink2);
  border-bottom: 2px solid var(--ink2);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-field select.active {
  font-weight: 600;
  color: var(--accent);
}
.select-field option {
  color: var(--ink);
  background: var(--surface);
}
.jobs-quick-filters {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.jobs-list {
  margin-top: 28px;
}

/* ---------- Job view chrome ---------- */
.job-bar {
  position: relative;
}
.bar-title {
  display: none;
}
.visit-tabs.is-hidden {
  display: none;
}
.pack-view {
  display: none;
  margin-top: 28px;
}
.dl-menu {
  position: relative;
}

/* ---------- Menus and sheets ---------- */
.menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border-radius: 13px;
  box-shadow: var(--pop-shadow);
  overflow: hidden;
}
.menu .row {
  min-height: 52px;
}
.sheet-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
}
.backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: 92%;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
  animation: sheet-up var(--t);
}
.sheet-layer:has(.sheet.center) {
  align-items: center;
}
.sheet.center {
  border-radius: 14px;
  max-height: 86%;
  animation: sheet-fade var(--t);
}
@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
@keyframes sheet-fade {
  from {
    transform: scale(0.98);
    opacity: 0;
  }
}
.grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--ink3);
  opacity: 0.5;
  margin: 6px auto 0;
  flex: none;
}
.sheet-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 4px 8px;
  min-height: 52px;
  flex: none;
}
.sheet-bar > :first-child {
  justify-self: start;
}
.sheet-bar h2 {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}
.sheet-bar .r {
  justify-self: end;
}
.sheet-bar .done {
  font-weight: 600;
}
.sheet-body {
  overflow-y: auto;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  flex: 1;
  min-height: 0;
}
.sheet-body > .section:first-child {
  margin-top: 8px;
}
.sheet-lead {
  padding-top: 0;
}
.sheet-cta {
  margin-top: 20px;
  text-align: center;
}
.sheet-foot {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--bar-line);
  background: var(--bar);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  flex: none;
}

/* Camera */
.cam-view {
  height: 300px;
  border-radius: 12px;
  background: var(--media);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--on-media2);
  font-size: 15px;
}
.cam-view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cam-view .frame {
  position: absolute;
  inset: 22px 40px;
  border: 2px solid var(--media-line);
  border-radius: 10px;
  pointer-events: none;
}
.cam-uploading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 15px;
}
.shutter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 8px 4px;
}
.shutter-row > :first-child {
  justify-self: start;
}
.shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  display: grid;
  place-items: center;
}
.shutter span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--t);
}
.shutter:active span {
  transform: scale(0.92);
}
.shutter[disabled] span {
  background: var(--ink3);
}
.shutter-spacer {
  width: 96px;
}

/* Release codes */
.codes-sheet {
  width: min(560px, 100%);
}

@media (max-width: 560px) {
  body.in-job .job-bar {
    position: sticky;
    top: 0;
    z-index: 6;
    margin: 0 calc(-16px - env(safe-area-inset-right)) 0
      calc(-16px - env(safe-area-inset-left));
    padding: 4px 6px;
    height: 52px;
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--bar-line);
  }
  .bar-title {
    display: block;
    font-size: 17px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
  }
  .job-bar + .large-title {
    margin-top: 14px;
  }
  .sheet {
    max-height: calc(100% - env(safe-area-inset-top) - 10px);
  }
  .sheet.center {
    border-radius: 14px 14px 0 0;
    max-height: 92%;
    animation: sheet-up var(--t);
  }
  .sheet-layer:has(.sheet.center) {
    align-items: flex-end;
  }
  .sheet.camera {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    background: var(--media-black);
    color: var(--on-media);
    padding-top: env(safe-area-inset-top);
  }
  .sheet.camera .sheet-bar .bar-btn,
  .sheet.camera .shutter-row .bar-btn {
    color: var(--on-media);
  }
  .sheet.camera .sheet-bar h2 {
    color: var(--on-media);
  }
  .sheet.camera .sheet-body {
    display: flex;
    flex-direction: column;
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .sheet.camera .cam-view {
    flex: 1;
    height: auto;
    border-radius: 0;
  }
  .sheet.camera .shutter {
    border-color: var(--on-media);
  }
  .sheet.camera .shutter-row {
    padding: 20px 20px 12px;
  }
  .menu {
    width: min(300px, calc(100dvw - 32px));
  }
}

/* ---------- Alert (confirmModal) ---------- */
.alert-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--scrim);
}
.alert {
  width: min(300px, 100%);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
  text-align: center;
  animation: sheet-fade var(--t);
}
.alert-text {
  padding: 20px 16px 16px;
}
.alert-icon {
  color: var(--bad);
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
}
.alert-icon svg {
  width: 28px;
  height: 28px;
}
.alert h2 {
  font-size: 17px;
  font-weight: 600;
}
.alert p {
  font-size: 13px;
  color: var(--ink2);
  margin-top: 4px;
  line-height: 1.4;
}
.alert-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 0.5px solid var(--line);
}
.alert-btn {
  min-height: var(--tap);
  font-size: 17px;
  color: var(--accent);
}
.alert-btn + .alert-btn {
  border-left: 0.5px solid var(--line);
}
.alert-btn.default {
  font-weight: 600;
}
.alert-btn.destructive {
  color: var(--bad);
  font-weight: 600;
}
@media (hover: hover) {
  .alert-btn:hover {
    background: var(--accent-bg);
  }
}

/* ---------- Sheet content ---------- */
.muted {
  color: var(--ink2);
}
.qa-row {
  align-items: flex-start;
}
.qa-answer {
  white-space: pre-wrap;
  margin-top: 2px;
}
.check-row {
  align-items: flex-start;
}
.check-row .lead {
  margin-top: 2px;
}
.check-row.ok .lead {
  color: var(--ok);
}
.check-row.bad .lead {
  color: var(--bad);
}
.check-row.bad .row-sub {
  color: var(--bad);
}
.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding-top: 4px;
}
.gallery-empty {
  grid-column: 1 / -1;
}
.photo-preview {
  position: fixed;
  inset: 0;
  z-index: 10002;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px
    calc(16px + env(safe-area-inset-bottom));
  background: var(--preview-scrim);
  color: var(--on-media);
}
.photo-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin-bottom: 10px;
  font-size: 15px;
}
.photo-preview-bar .bar-btn {
  color: var(--on-media);
  font-weight: 600;
}
.photo-preview img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 10px;
  object-fit: contain;
}

/* ---------- "3 of 5" counts with a status icon ---------- */
.count-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  white-space: nowrap;
}
.count-status svg {
  width: 14px;
  height: 14px;
  flex: none;
}
/* In a key/value row a long status ("16 of 18 passed, overridden") wraps
   instead of running off the card. */
.group.kv .value .count-status {
  white-space: normal;
  text-align: right;
}
.count-status.ok {
  color: var(--ok);
}
.count-status.warn {
  color: var(--warn);
}
.photo-groups {
  padding: 14px 16px;
}

.secondary svg {
  width: 18px;
  height: 18px;
}

/* ---------- Jobs list ---------- */
.jobs-list > .section:first-child {
  margin-top: 0;
}
.day-head {
  font-size: 13px;
  color: var(--ink2);
  padding: 0 16px 7px;
  display: flex;
  justify-content: space-between;
}
.row.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  align-items: center;
}
.job .store {
  font-weight: 600;
}
.job .meta {
  display: flex;
  gap: 4px 14px;
  align-items: center;
  margin-top: 2px;
  flex-wrap: wrap;
}
.job .when {
  font-size: 15px;
  color: var(--ink2);
}
.job .wo {
  display: block;
  font-size: 13px;
  color: var(--ink2);
}
.job .right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prio {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink2);
}
.prio.p1 {
  color: var(--bad);
}
@media (max-width: 560px) {
  .job .right .prio {
    display: none;
  }
}

/* ---------- Shared screen patterns (used by every stage) ---------- */
/* Progress bar at the top of a group with no question above it */
.group-progress {
  padding-top: 14px;
}
.group-progress .progress {
  margin-bottom: 4px;
}
/* Notice: a grouped-list block with an icon and text. Tone by icon+text. */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  font-size: 15px;
}
.notice > svg,
.notice .notice-icon svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: none;
}
.notice-title {
  display: block;
  font-weight: 600;
  font-size: 17px;
}
.notice-body {
  display: block;
  color: var(--ink2);
  margin-top: 2px;
}
.notice-body ul {
  list-style: none;
  margin-top: 4px;
  display: grid;
  gap: 2px;
}
.notice.ok > svg,
.notice.ok .notice-title {
  color: var(--ok);
}
.notice.warn > svg,
.notice.warn .notice-title {
  color: var(--warn);
}
.notice.bad > svg,
.notice.bad .notice-title {
  color: var(--bad);
}
.notice.info > svg,
.notice.info .notice-title {
  color: var(--accent);
}
.section > .notice + .group,
.notice + .notice {
  margin-top: 12px;
}
/* Legacy .callout markup renders as a notice too */
.callout {
  display: block;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 0;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.callout .ct {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 2px;
}
.callout .cb {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.45;
}
.callout.c-ok .ct {
  color: var(--ok);
}
.callout.c-warn .ct {
  color: var(--warn);
}
.callout.c-bad .ct {
  color: var(--bad);
}
.callout.c-info .ct {
  color: var(--accent);
}

/* Result block (visit sent / approved / ended) */
.result {
  padding: 28px 16px 24px;
  text-align: center;
}
.result-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: var(--okBg);
  color: var(--ok);
}
.result-icon svg {
  width: 28px;
  height: 28px;
}
.result.bad .result-icon {
  background: var(--badBg);
  color: var(--bad);
}
.result.warn .result-icon {
  background: var(--warnBg);
  color: var(--warn);
}
.result h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.result p {
  font-size: 15px;
  color: var(--ink2);
  margin-top: 4px;
}
.code-value {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--okBg);
  color: var(--ok);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* Trailing actions inside a row */
.row .trail .secondary,
.row-action {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 15px;
}
.row .trail .secondary {
  position: relative;
}
/* 36px visual, 44px tap target */
.row .trail .secondary::after,
.row-action::after {
  content: "";
  position: absolute;
  inset: -4px;
}
.row .tag {
  font-size: 13px;
  color: var(--ink2);
}
.row .value.link,
.row .edit-link,
.contact-link {
  color: var(--accent);
}
.contact-link {
  text-decoration: underline;
}
.row.focus {
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--accent-bg);
}

/* Photo tiles, 4:3 */
.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 2px 16px 16px;
}
.photo {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  color: var(--accent);
  background: var(--bg);
  transition: background var(--t);
  text-align: center;
  padding: 0 8px;
}
@media (hover: hover) {
  button.photo:not(.taken):hover {
    background: var(--accent-bg);
  }
}
.photo svg {
  width: 22px;
  height: 22px;
}
.photo.taken {
  background: var(--photo-bg);
  color: var(--on-media);
}
.photo.taken img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo .tag,
.photo .side {
  position: absolute;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--media-scrim);
  color: var(--on-media);
  max-width: calc(100% - 20px);
}
.photo .tag {
  bottom: 10px;
}
.photo .side {
  top: 10px;
}
.photo .tag svg {
  width: 14px;
  height: 14px;
  color: var(--photo-ok);
}
.photo .remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--media-scrim);
  color: var(--on-media);
}
.photo .remove svg {
  width: 16px;
  height: 16px;
}
.photo-actions {
  display: flex;
  gap: 12px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

/* Dictation row under a text answer */
.mic {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  flex: none;
}
.mic svg {
  width: 20px;
  height: 20px;
}
.mic.rec {
  background: var(--bad);
}
.mic[disabled] {
  background: var(--line2);
  color: var(--ink3);
}
.dictate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 0.5px solid var(--line);
  font-size: 13px;
  color: var(--ink2);
}
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.textarea:disabled {
  color: var(--ink2);
  border-color: var(--line);
}

/* Inline action row inside a group (e.g. end code + Verify) */
.group-actions {
  display: flex;
  gap: 12px;
  padding: 4px 16px 16px;
  flex-wrap: wrap;
}
.group-actions .btn {
  width: auto;
}

/* Signature pad: always light "paper" - the ink is fixed dark (wizard.js) and
   is saved as a transparent PNG that prints on white in the job PDF, so it
   must stay readable in dark mode too. */
.sigpad {
  position: relative;
  height: 180px;
  margin: 0 16px 16px;
  border-radius: 10px;
  background: var(--sigpad-bg);
  overflow: hidden;
}
.sigpad canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.sigpad .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--sigpad-hint);
  font-size: 15px;
  pointer-events: none;
}

/* Packs */
.ai-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink2);
  padding: 8px 16px 0;
}
.ai-note svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  margin-top: 2px;
}
.brief {
  padding: 14px 16px;
  font-size: 17px;
  line-height: 1.5;
}
.steps {
  list-style: none;
  counter-reset: s;
}
.steps li {
  counter-increment: s;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  position: relative;
}
.steps li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 52px;
  right: 0;
  height: 0.5px;
  background: var(--line);
}
.steps li::after {
  content: counter(s);
  order: -1;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.steps .why {
  display: block;
  font-size: 15px;
  color: var(--ink2);
}
.carry {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.carry .col {
  padding: 12px 16px;
}
.carry .col + .col {
  border-left: 0.5px solid var(--line);
}
.carry h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.carry ul {
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 15px;
}
.carry .opt {
  color: var(--ink2);
}
.badge-gen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink2);
}
@media (max-width: 560px) {
  .photos {
    grid-template-columns: 1fr;
  }
  .carry {
    grid-template-columns: 1fr;
  }
  .carry .col + .col {
    border-left: 0;
    border-top: 0.5px solid var(--line);
  }
}

/* ---------- Survey screens (screens/survey.js) ---------- */

/* Section-list photo rows keep the legacy .prow class (surveyActions.js
   scrolls to `.prow[data-item]`); undo the old card styling on the row. */
.row.prow {
  border: 0;
  border-radius: 0;
  background: none;
  margin: 0;
  padding: 11px 16px;
  gap: 12px;
}
.row.prow.focus {
  background: var(--accent-bg);
}

/* Inert radio rows (sv-blocked shows the chosen answer, not a live choice) */
.row[aria-disabled="true"] {
  cursor: default;
}

/* Row icons inside a .row-sub line up with the text */
.row-sub svg {
  vertical-align: -2px;
  margin-right: 2px;
}
.row-sub .count-status + .count-status {
  margin-left: 10px;
}

/* A group that follows a notice directly (sv-recap complete state) */
.group.after-notice {
  margin-top: 12px;
}

/* Empty photo tile: optional note under the label */
.photo .photo-note {
  font-size: 13px;
  color: var(--ink2);
}

/* Single floor-plan tile: one column, image not cropped, tap opens it */
.photos.photos-one {
  grid-template-columns: 1fr;
  padding-top: 4px;
}
.photo.plan img {
  object-fit: contain;
}
.photo .photo-open {
  position: absolute;
  inset: 0;
  display: block;
}

/* "Remove floor" row */
.row.row-destructive {
  color: var(--bad);
  min-height: var(--tap);
}
.row.row-destructive svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* "Add floor" under the floor groups */
.add-floor {
  margin-top: 16px;
  padding: 0 16px;
}

/* Icon + text inside a kv value (lift booked, over estimate, incomplete) */
.row .value > svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Stacked notices at the top of cb-review (gaps callout + variance) */
.cb-notices > * + * {
  margin-top: 12px;
}

/* Notice following a group inside the same section (cb-runs over estimate) */
.cb-notice-gap {
  margin-top: 12px;
}

/* AP run photo tiles sit right under the "mounted and tested" row */
.cb-photos {
  padding-top: 4px;
}
.photo[disabled] {
  cursor: not-allowed;
  color: var(--ink3);
}

/* AP photo tiles stay two-up on phones so a single slot isn't a full-width
   block (overrides the 1-column .photos phone rule). */
@media (max-width: 560px) {
  .photos.cb-photos {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Cutover screens (screens/cutover.js) ---------- */

/* Notices stacked directly with groups at the top of a screen */
.wiz .scroll > .notice + .group,
.wiz .scroll > .notice + .section,
.wiz .scroll > .group + .notice {
  margin-top: 12px;
}

/* Checklist rows (multi-select): leading circle, filled check when done */
.row.ct-check .lead {
  color: var(--ink3);
}
.row.ct-check[aria-checked="true"] .lead {
  color: var(--accent);
}
.row.ct-check .lead svg {
  width: 22px;
  height: 22px;
}
/* Cabling AP-run toggle: "Mark done" prompt, green once done */
.row.ap-run .ap-state {
  color: var(--accent);
  font-weight: 600;
}
.row.ap-run[aria-checked="true"] .lead,
.row.ap-run[aria-checked="true"] .ap-state {
  color: var(--ok);
}
.row.ct-check.destructive[aria-checked="true"] .lead,
.row.ct-check.bad .lead,
.row.ct-check.bad .row-sub {
  color: var(--bad);
}

/* Install-guide section number */
.ct-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
button.row[disabled] .ct-num {
  background: var(--line2);
  color: var(--ink3);
}

/* Photo tile: second line names the slot */
.photo .photo-label {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.3;
}
.photo[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.ct-field-error,
.ct-field-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--ink2);
}
.ct-field-error {
  color: var(--bad);
}

/* Multi-slot grids (serial labels, pack-up) keep two columns on phones */
@media (max-width: 560px) {
  .photos.ct-photos {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .photos.ct-photos .photo {
    font-size: 13px;
  }
}
.photos.ct-photos .photo .side {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Pack sheets (packView.js) ---------- */
/* #packViewContainer keeps .pack-view; JS toggles its display. The sheet
   layer inside it is always shown while the container is. */
.pack-view {
  margin-top: 0;
}
.pack-view > .sheet-layer {
  display: flex;
}
.sheet.tall {
  height: 92%;
}
.sheet:focus {
  outline: none;
}
.brief + .brief-list {
  margin-top: -6px;
}
.brief-list {
  list-style: disc;
  padding: 12px 16px 14px 36px;
  display: grid;
  gap: 6px;
  font-size: 15px;
  line-height: 1.45;
}
.brief.muted {
  color: var(--ink2);
  font-size: 15px;
}
.carry.single {
  grid-template-columns: 1fr;
}
.carry h4 {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink2);
  margin: 8px 0 2px;
}
.carry h3 + h4 {
  margin-top: 0;
}
.carry-none {
  font-size: 15px;
  color: var(--ink2);
}
.pack-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.pack-actions .secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pack-actions .secondary svg {
  width: 16px;
  height: 16px;
}
.section > .notice + .pack-actions {
  margin-top: 12px;
}
.section-foot + .pack-error {
  margin-top: 12px;
}
.pack-ref {
  margin-top: 12px;
}
.sheet-foot > .btn {
  width: 100%;
}

/* ---------- Phone job bar + action sheet (jobActions.js) ---------- */
@media (max-width: 560px) {
  .job-bar .bar-group.lap {
    display: none;
  }
}
.actions-layer {
  align-items: flex-end;
}
.actionsheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  width: min(640px, calc(100% - 16px));
  margin-bottom: calc(8px + env(safe-area-inset-bottom));
  animation: sheet-up var(--t);
}
.actionsheet .as-group {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}
.actionsheet .as-title {
  font-size: 13px;
  color: var(--ink2);
  text-align: center;
  padding: 14px 16px 12px;
}
.actionsheet .as-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 57px;
  font-size: 19px;
  color: var(--accent);
}
.actionsheet .as-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.5px;
  background: var(--line);
}
.actionsheet .as-group > .as-btn:first-child::before {
  display: none;
}
.actionsheet .as-btn:active {
  background: var(--line2);
}
.actionsheet .cancel {
  font-weight: 600;
}
.actionsheet:focus {
  outline: none;
}

/* ---------- PM: release codes sheet (pmActions.js) ---------- */
/* An ancestor (legacy modal styles) centres text; the prototype reads
   left-aligned. .sheet-cta keeps its own centring. */
.codes-sheet .sheet-body {
  text-align: left;
}
.codes-sheet .section:first-of-type {
  margin-top: 16px;
}
.input-wrap .copy-btn {
  margin-right: -8px;
}
.copy-btn.copied {
  color: var(--ok);
}

/* ---------- PM: sign-off review (pmReview.js) ---------- */
.pm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.notice + .pm-toolbar {
  margin-top: 20px;
}
.pm-tabs {
  flex: 1;
  min-width: 260px;
}
.pm-refresh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.pm-refresh .bar-btn {
  margin-right: -8px;
  font-size: 15px;
}
.pm-refresh .bar-btn svg {
  width: 18px;
  height: 18px;
}
.seg-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warn);
}
.seg-flag svg {
  width: 14px;
  height: 14px;
}
/* Review rows: long values wrap under a readable key. */
.pm-kv .row-text {
  flex: 1 1 45%;
}
.pm-kv .value {
  flex: 1 1 55%;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
}
.pm-kv .value svg {
  flex: none;
  margin-top: 3px;
}
.pm-kv .row .trail {
  margin-left: 4px;
}
.notice-actions {
  display: flex;
  margin-top: 12px;
}
.notice-actions .btn {
  width: auto;
}
@media (max-width: 560px) {
  .pm-tabs {
    flex-basis: 100%;
    min-width: 0;
  }
  .pm-kv .row {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .pm-kv .row-text {
    flex-basis: 100%;
    font-size: 15px;
    color: var(--ink2);
  }
  .pm-kv .value {
    flex: 1;
    justify-content: flex-start;
    text-align: left;
    color: var(--ink);
  }
}

/* Phone job screens: one compact top bar (back, title, More), no navbar */
@media (max-width: 560px) {
  body.in-job .navbar {
    display: none;
  }
  body.in-job .job-bar {
    padding-top: calc(4px + env(safe-area-inset-top));
    height: calc(52px + env(safe-area-inset-top));
  }
  /* Two dock actions stack, full width, primary nearest the thumb */
  .bottom-in:has(.dock-row) {
    align-items: flex-end;
  }
  .dock-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .dock-row > .btn {
    flex: none;
    width: 100%;
    min-height: 46px;
  }
}

/* ---------- 44px hit areas for controls drawn smaller (Apple sizes) ---------- */
.segmented button,
.photo .remove,
.toast-close {
  position: relative;
}
.segmented button::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}
.photo .remove::after {
  content: "";
  position: absolute;
  inset: -4px;
}
.toast-close::after {
  content: "";
  position: absolute;
  inset: -8px;
}

/* ---------- Admin area (companies, users, settings), import, assign ---------- */
.accent-text {
  color: var(--accent);
  font-weight: 500;
}
.bad-text {
  color: var(--bad);
}
.warn-text {
  color: var(--warn);
}
.you {
  font-size: 13px;
  color: var(--ink2);
  font-weight: 400;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  white-space: nowrap;
}
.link-btn {
  color: var(--accent);
  text-decoration: underline;
  font: inherit;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: none;
}
.group > .check-row + .check-row,
.group > .field + .check-row,
.group > .check-row + .field {
  border-top: 0.5px solid var(--line);
}
.form-actions {
  margin: 20px 0 8px;
}
.pw-form .group {
  margin-top: 16px;
}
.as-btn.danger {
  color: var(--bad);
}
.file-row {
  cursor: pointer;
}
.admin-sheet .sheet-body .section-head {
  margin-top: 16px;
}
.admin-sheet .row.file-row:hover {
  background: var(--accent-bg);
}

/* Who has each job, on the jobs list (PM / admin / engineer) */
.assignees {
  display: block;
  font-size: 13px;
  color: var(--ink2);
  margin-top: 2px;
}
.assignees.none {
  color: var(--warn);
}
.assign-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  cursor: pointer;
  white-space: nowrap;
}
.assign-chip:hover,
.assign-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Inline form errors (js/utils/formErrors.js) ---------- */
.field.has-error {
  border-color: var(--bad);
  margin-bottom: 4px;
}
.field.has-error:focus-within {
  outline-color: var(--bad);
}
.field.has-error > label,
.field.has-error > span {
  color: var(--bad);
}
/* Text flows inline (so a link such as "Resend" can follow it); the icon is
   absolutely positioned in the left padding. */
.field-error,
.form-error {
  position: relative;
  display: block;
  color: var(--bad);
  font-size: 13px;
  line-height: 1.35;
}
.field-error {
  margin: 0 16px 10px;
  padding: 0 4px 0 25px;
}
.form-error {
  margin: 12px 4px 0;
  padding-left: 21px;
  font-size: 14px;
}
.field-error .link-btn,
.form-error .link-btn {
  color: var(--accent);
  font-size: inherit;
}
.field-error::before,
.form-error::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%279%27/%3E%3Cpath d=%27M12 8v5M12 16h.01%27/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%279%27/%3E%3Cpath d=%27M12 8v5M12 16h.01%27/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* ---------- Public company sign-up (js/registerView.js) ---------- */
.signin-alt {
  margin-top: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--ink2);
}
.signin-alt .link-btn {
  font-weight: 500;
}
/* Honeypot field: off-screen for people, still in the DOM for bots */
.hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.turnstile-holder {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.field-error::before {
  left: 4px;
}
.signin-in .field-error {
  margin-left: 4px;
  margin-right: 4px;
}

/* ---------- Section tabs (Tenant Admin: Jobs / Team / Settings) ----------
   Same buttons (js/chrome.js) in two places: a strip under the navbar on
   laptops, a bottom tab bar on phones (<= 560px, the app's phone breakpoint).
   Shown only with body.has-tabs; never on sign-in or inside a job. */
.tabstrip,
.tabbar {
  display: none;
}
body.signed-out .tabstrip,
body.signed-out .tabbar,
body.in-job .tabstrip,
body.in-job .tabbar {
  display: none !important;
}
.tab-item {
  color: var(--ink2);
  font-size: 15px;
  white-space: nowrap;
  transition: color var(--t);
}
.tab-item.on {
  color: var(--accent);
  font-weight: 500;
}

/* Laptop: strip under the navbar, aligned with the page column */
@media (min-width: 561px) {
  body.has-tabs .tabstrip {
    display: flex;
    position: sticky;
    top: calc(56px + env(safe-area-inset-top));
    z-index: 29;
    gap: 28px;
    padding: 0 max(20px, calc((100% - 760px) / 2 + 20px));
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--bar-line);
  }
  .tabstrip .tab-item {
    height: 44px;
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    margin-bottom: -0.5px;
  }
  .tabstrip .tab-item.on {
    border-bottom-color: var(--accent);
  }
  .tabstrip .tab-item {
    gap: 7px;
  }
  .tabstrip .tab-item svg {
    width: 18px;
    height: 18px;
  }
  .tabstrip .tab-item:hover:not(.on) {
    color: var(--ink);
  }
}

/* Phone: bottom tab bar, thumb reach, safe-area aware */
@media (max-width: 560px) {
  body.has-tabs .tabbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom)
      env(safe-area-inset-left);
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--bar-line);
  }
  .tabbar .tab-item {
    min-height: 56px;
    padding: 6px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
  }
  .tabbar .tab-item svg {
    width: 24px;
    height: 24px;
  }
  .tabbar .tab-item:active {
    opacity: 0.55;
  }
  /* keep the last rows of a page clear of the bar */
  body.has-tabs .container {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* Action button on the right of a section header (e.g. "Add user"): a 44px
   tap target that does not make the header taller. */
.section-head:has(.head-btn) {
  align-items: center;
  margin-bottom: 12px;
}
.head-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: var(--tap);
  margin: -12px -6px -12px 0;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.head-btn svg {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .head-btn:hover {
    background: var(--accent-bg);
  }
}
.head-btn:active {
  opacity: 0.55;
}
