:root {
  color-scheme: light;
  --blue: #0e4c92;
  --blue-dark: #0a3a70;
  --ink: #10243d;
  --green: #3cae4b;
  --green-dark: #2e9a3d;
  --body-text: #3c4350;
  --tint: #eef4fa;
  --white: #ffffff;
  --font-head: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --line: rgba(14, 76, 146, 0.12);
  --muted: #6b7280;
  --panel-muted: #f4f8fc;
  --shadow: 0 18px 50px rgba(14, 76, 146, 0.12);
}

* { box-sizing: border-box; }
/* Match native windowBackground so WebView / VRR composites do not flash white. */
html, body {
  background: var(--tint);
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--body-text);
  -webkit-font-smoothing: antialiased;
}
body:has(#app.active) {
  overflow: hidden;
  overscroll-behavior: none;
}

h1, h2, h3, .modal-title, .device-onboarding-title {
  font-family: var(--font-head);
  color: var(--ink);
}

.nav-brand {
  font-family: var(--font-head);
  font-weight: 700;
}
/* Promote a stable root layer — reduces flicker on Honor/Huawei dynamic refresh rate. */
#app, #loginPage {
  transform: translateZ(0);
  backface-visibility: hidden;
}
.page { display: none; }
.page.active { display: block; }
#app.page.active {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  /* fixed inset: bottom nav stays on-screen in Android WebView (100dvh often overflows). */
}
.container { max-width: 380px; margin: 60px auto; padding: 20px; background: #fff; border-radius: 8px; }
.app-logo { display: block; width: 96px; height: 96px; margin: 0 auto 16px; }
.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.capture-completion-display {
  min-height: 2.5rem;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #4b5563;
  font-size: 14px;
}
.checklist-container { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; }
.checklist-item { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.checklist-item input[type="checkbox"] { flex-shrink: 0; width: 18px; height: 18px; cursor: pointer; }
.checklist-item .checklist-label { flex: 1; font-size: 14px; user-select: none; }
.checklist-item .checklist-emoji { font-size: 16px; width: 1.2em; text-align: center; }
#taskItemChecklistWrap.is-readonly .checklist-item { cursor: default; pointer-events: none; }
.capture-fields-container,
.capture-page-panel .capture-fields-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}
.capture-fields-container .capture-field-row:last-child { margin-bottom: 0; }
.capture-dyn-image-grid.image-grid {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  margin: 10px 0 0;
  box-sizing: border-box;
}
.capture-field-row {
  flex: 1 1 100%;
  min-width: 0;
}
.capture-field-label--empty {
  display: none;
}
.capture-field-row.capture-field-inline {
  /* Mobile-first: allow two blocks in a row by default. */
  flex: 1 1 calc(50% - 6px);
  max-width: calc(50% - 6px);
}
.capture-field-row.capture-field-row--table {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
}
#taskItemCaptureFieldsWrap {
  min-width: 0;
}
.capture-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  scrollbar-width: auto;
  scrollbar-color: #9ca3af #e5e7eb;
  padding-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  box-sizing: border-box;
}
.capture-table-wrap--can-scroll {
  border-color: #d1d5db;
  background: linear-gradient(to right, #fff 0%, #fff 88%, rgba(229, 231, 235, 0.85) 100%);
  box-shadow: inset -10px 0 12px -10px rgba(17, 24, 39, 0.18);
}
.capture-table-wrap--can-scroll::after {
  content: 'Slide sideways for more columns';
  display: block;
  margin-top: 4px;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: #6b7280;
}
.capture-table-wrap::-webkit-scrollbar {
  height: 30px;
}
.capture-table-wrap::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 6px;
}
.capture-table-wrap::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 6px;
}
.capture-table-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}
.capture-table-grid.capture-table-grid--wide {
  width: max-content;
  min-width: max(100%, var(--capture-table-scroll-min, 18rem));
}
.capture-table-grid th {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
}
.capture-table-grid.capture-table-grid--fits-viewport {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.capture-table-grid--fits-viewport col.capture-table-col-actions {
  width: 1%;
}
.capture-table-grid {
  font-size: 0.75rem;
}
.capture-table-grid th,
.capture-table-grid td {
  padding: 4px 5px;
  vertical-align: top;
  border: 1px solid #e5e7eb;
}
.capture-table-grid th.capture-table-col--fixed,
.capture-table-grid td.capture-table-col--fixed {
  position: sticky;
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 6px -3px rgba(17, 24, 39, 0.22);
}
.capture-table-grid thead th.capture-table-col--fixed {
  z-index: 3;
}
.capture-table-wrap--has-fixed-cols.capture-table-wrap--can-scroll {
  background: linear-gradient(to right, #fff 0%, #fff 72%, rgba(229, 231, 235, 0.85) 100%);
}
.capture-table-grid th {
  font-size: 0.625rem;
  line-height: 1.2;
  font-weight: 600;
}
.capture-table-cell-inp {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  line-height: 1.25;
}
.capture-table-grid--wide .capture-table-cell-inp {
  min-width: var(--capture-table-cell-min, 3.5rem);
}
.capture-table-cell--locked {
  background: #f3f4f6;
}
.capture-table-add-btn {
  margin-top: 8px;
}
.capture-table-row-actions {
  white-space: nowrap;
}
.capture-table-row-remove {
  touch-action: manipulation;
  min-height: 36px;
  min-width: 0;
  width: 100%;
  padding: 4px 5px;
  font-size: 0.6875rem;
}
.capture-page-heading {
  flex: 1 1 100%;
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}
.capture-pages-wrap { min-height: 1px; }
.capture-page-panel .capture-fields-inner {
  margin-top: 0;
}
.capture-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}
.capture-page-nav .capture-page-indicator {
  font-size: 12px;
  color: #6b7280;
  flex: 1;
  text-align: center;
}
.capture-page-nav .btn {
  flex: 0 0 auto;
  min-width: 5rem;
}
.capture-page-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 0 10px;
  min-height: 52px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.capture-page-tab {
  flex: 0 0 auto;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
}
.capture-page-tab.active {
  background: var(--green);
  border-color: var(--green-dark);
  color: var(--white);
}
.capture-page-tab:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}
.capture-ms-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.capture-ms-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  margin: 0;
}
.capture-ms-opt input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
}
.image-slot .capture-dyn-preview,
.capture-dyn-img .capture-dyn-preview,
.capture-field-row--image .capture-dyn-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
}
.capture-dyn-img {
  min-width: 0;
  width: 100%;
}
.capture-dyn-image-grid > .capture-field-row--image {
  flex: none;
  max-width: none;
  width: auto;
  min-width: 0;
  margin: 0;
}
.capture-dyn-image-grid .slot-actions.capture-dyn-img-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
input, select, textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; }
label { display: block; margin-bottom: 6px; color: #444; font-size: 13px; }
.is-locked,
input:disabled,
textarea:disabled,
select:disabled {
  background: #f9fafb;
  color: #111827;
  opacity: 1;
}
.is-locked {
  cursor: not-allowed;
}
.btn { padding: 10px 14px; border: none; border-radius: 4px; cursor: pointer; }
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 600;
}
.btn-secondary {
  background: var(--blue);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 600;
}
.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-large { width: 100%; margin-top: 12px; }

.error-message { color: #c62828; margin-top: 8px; }
.device-onboarding-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}
.device-onboarding-title {
  font-weight: 700;
  margin-bottom: 8px;
}
.device-onboarding-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.device-onboarding-label {
  font-size: 12px;
  color: #6b7280;
}
.device-onboarding-row code {
  display: block;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
}
.device-onboarding-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.device-id-codes-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 10px 0 8px;
}

.device-id-codes-row.hidden {
  display: none;
}

.device-id-barcode-block,
.device-id-qr-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.device-id-barcode-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.device-id-barcode-svg {
  display: block;
  height: 40px;
  max-width: none;
}

.device-id-qr-canvas {
  display: block;
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.login-intro {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.admin-password-login {
  margin-top: 8px;
}
.device-register-form {
  margin-top: 8px;
}
.device-register-form.device-register-locked input {
  background: #f3f4f6;
  color: #4b5563;
}
.device-register-form.device-register-locked .btn {
  opacity: 0.65;
  pointer-events: none;
}
.admin-password-login label,
.device-register-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.admin-login-intro {
  margin-bottom: 12px;
}
.admin-password-login .btn {
  width: 100%;
  margin-top: 4px;
}
.admin-forgot-password-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.admin-forgot-password-btn:hover {
  text-decoration: underline;
}
.admin-password-reset-overlay.hidden {
  display: none;
}
.admin-password-reset-intro {
  margin-bottom: 12px;
}
.admin-password-reset-modal .btn {
  width: 100%;
  margin-top: 8px;
}
.admin-password-reset-modal .btn-secondary {
  margin-top: 6px;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.device-register-pending {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  text-align: center;
}
.device-register-pending-title {
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #1e40af;
}
.device-register-pending-message {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #374151;
  line-height: 1.45;
}
.device-secret-qr-overlay {
  z-index: 180;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0)) 12px max(12px, env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
}
.device-secret-qr-modal {
  width: min(420px, 100%);
  max-height: min(560px, 92vh);
  border-radius: 18px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.device-secret-qr-body {
  align-items: stretch;
  gap: 12px;
}
.device-secret-qr-hint {
  margin: 0;
}
.device-secret-qr-reader {
  width: 100%;
  min-height: 260px;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
}
.device-secret-qr-cancel {
  width: 100%;
}
.device-secret-qr-alt-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.device-secret-qr-pick {
  width: 100%;
}
.device-secret-qr-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.device-secret-qr-file-sink {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 320px;
  height: 320px;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.navbar {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  color: rgba(255, 255, 255, 0.92);
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  /* Above #loading (45) so pow/sup can always open the drawer to leave simulated clock-in mode. */
  z-index: 50;
}
.navbar .nav-brand,
.navbar .nav-subtitle {
  color: rgba(255, 255, 255, 0.95);
}
.navbar .nav-user {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
}
.navbar .network-report-sync-sub {
  color: rgba(255, 255, 255, 0.95);
  font-size: 11px;
}
.navbar .menu-hamburger-btn {
  color: transparent;
  font-size: 0;
  border-color: rgba(255, 255, 255, 0.35);
}

.navbar .nav-actions .icon-btn {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.35);
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
}

.navbar .nav-actions .icon-btn:active {
  background: #f4f8fc;
}

.navbar .nav-actions .shutdown-nav-btn {
  color: #b91c1c;
  font-size: inherit;
  font-weight: inherit;
}

.navbar .nav-actions .shutdown-nav-btn:active {
  background: #fef2f2;
}

.menu-hamburger-lines {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
}
/* nav-title takes the full remaining width — page name is never squeezed */
.nav-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.nav-brand { font-weight: 700; font-size: 13px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-subtitle { font-size: 11px; color: #6b7280; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-subtitle.nav-subtitle--location {
  font-size: 11px;
  font-family: inherit;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* User name now lives inside nav-title as a third sub-line */
.nav-user { font-size: 10px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-actions { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-network-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  max-width: 132px;
}
.network-report-sync-sub {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  color: #1d4ed8;
  text-align: right;
  white-space: nowrap;
}
.network-report-sync-sub.hidden {
  display: none;
}
.network-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid #bbf7d0;
  background: #dcfce7;
  color: #166534;
}
.network-status-badge.is-offline {
  border-color: #ff0000;
  background: #ff1744;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.network-status-badge.is-backend-down {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
  min-width: 88px;
}
.network-status-badge.is-syncing {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
  min-width: 72px;
}
.network-status-badge.is-pending {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #6b7280;
  min-width: 52px;
  min-height: 22px;
}
/* Searchable alphabetical pickers */
.searchable-select-host {
  position: relative;
  width: 100%;
}

.searchable-select-trigger {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1f2937;
  padding: 10px 12px;
  padding-right: 2.25rem;
  font: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.searchable-picker-popup {
  position: fixed;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.searchable-picker-popup[hidden] {
  display: none !important;
}

.searchable-picker-popup-query {
  width: 100%;
}

.searchable-picker-popup-list {
  max-height: min(360px, 55vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.searchable-picker-open-btn {
  margin-bottom: 6px;
  width: 100%;
}

.searchable-select-host.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

.searchable-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

.searchable-select-input {
  width: 100%;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.searchable-select-list {
  position: absolute;
  z-index: 4000;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(280px, 45vh);
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
}

.searchable-select-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
  border: none;
}

.searchable-select-option:hover,
.searchable-select-option.is-active {
  background: #eff6ff;
}

.searchable-select-option.is-selected {
  font-weight: 600;
}

.searchable-select-hit {
  background: #1f2937;
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.searchable-select-option.is-active .searchable-select-hit,
.searchable-select-option:hover .searchable-select-hit {
  background: #fff;
  color: #1565c0;
}

.searchable-select-empty {
  padding: 10px;
  font-size: 0.9rem;
  color: #6b7280;
}

.searchable-listbox-filter-host {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.searchable-listbox-filter {
  width: 100%;
}

/* ── Custom store list (replaces native <select size> for cross-Android compatibility) ── */
.store-list {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.store-list-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: #1f2937;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(21, 101, 192, 0.08);
  outline: none;
}
.store-list-item:last-child { border-bottom: none; }
.store-list-item:active { background: #eff6ff; }
.store-list-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-list-item.is-lunch .store-list-name { color: var(--blue); font-weight: 600; }
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}
.shutdown-nav-btn { color: #b91c1c; padding: 0; }
.shutdown-nav-btn .shutdown-nav-icon { display: block; }
.shutdown-nav-btn:active { background: #fef2f2; }
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 55; }
.drawer-overlay.active { display: block; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); background: #fff; border-right: 1px solid #e5e7eb; transform: translateX(-102%); transition: transform 0.18s ease; z-index: 56; display: flex; flex-direction: column; }
.drawer.active { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  color: rgba(255, 255, 255, 0.92);
}
.drawer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.drawer-brand-logo {
  display: block;
  width: auto;
  max-width: min(180px, 72vw);
  max-height: 32px;
  height: auto;
  object-fit: contain;
}
.drawer-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.drawer-title-app {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--white);
}
.drawer-title-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.drawer-close-btn {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.drawer-close-btn:active {
  background: #f4f8fc;
}
.drawer-items { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; }
.drawer-item { width: 100%; text-align: left; padding: 12px 10px; border-radius: 10px; border: 1px solid #e5e7eb; background: #f9fafb; cursor: pointer; font-family: inherit; font-size: 15px; }
.drawer-item.active {
  background: rgba(14, 76, 146, 0.08);
  border-color: rgba(14, 76, 146, 0.22);
  color: var(--ink);
  font-weight: 600;
}
.tasks-please-refresh {
  color: #dc2626;
  font-weight: 700;
  white-space: nowrap;
}
.tasks-stale-hint {
  color: #dc2626;
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 10px;
}
.drawer-item-logout {
  margin-top: auto;
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}
.drawer-item-logout:hover { background: #fee2e2; }
.content-page {
  display: none;
  padding: 16px;
  padding-bottom: 16px;
  overflow: visible;
}
.content-page.active {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#app .navbar,
#app #globalSearchBar {
  flex-shrink: 0;
}
#app.has-bottom-nav .content-page.active {
  padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}
#app.has-bottom-nav #tasksPage.content-page.active.my-tasks-page-layout {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
#tasksPage.my-tasks-page-layout #tasksStaleHint,
#tasksPage.my-tasks-page-layout #myTasksPageSummary,
#tasksPage.my-tasks-page-layout #tasksEmpty {
  flex-shrink: 0;
}
#tasksPage.content-page.my-tasks-page-layout {
  padding-top: 3px;
}
#tasksPage.my-tasks-page-layout #tasksList.my-tasks-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.my-tasks-page-summary {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px 16px;
  margin-top: 1px;
  padding: 2px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
#tasksPage.my-tasks-page-layout .my-tasks-completion-group-header {
  box-sizing: border-box;
  margin: 12px 0 8px;
  min-height: 28px;
  padding: 2px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: none;
  justify-content: flex-start;
  align-items: center;
}
#tasksPage.my-tasks-page-layout .my-tasks-completion-group-header .group-header-label {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#tasksPage.my-tasks-page-layout .my-tasks-completion-group-header--completed {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
#tasksPage.my-tasks-page-layout .my-tasks-completion-group-header--incomplete {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}
.my-tasks-page-summary-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
  flex: 0 0 auto;
}
.my-tasks-page-summary-lines {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px 12px;
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 720px) {
  .my-tasks-page-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .my-tasks-page-summary-lines {
    flex-wrap: wrap;
    width: 100%;
    gap: 6px 10px;
  }
}
.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 2px;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(14, 76, 146, 0.08);
}
.app-bottom-nav.hidden {
  display: none;
}
.app-bottom-nav-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.app-bottom-nav-btn:hover {
  background: var(--panel-muted);
  color: var(--ink);
}
.app-bottom-nav-btn.is-active {
  background: rgba(14, 76, 146, 0.1);
  color: var(--blue);
}
.app-bottom-nav-icon {
  font-size: 16px;
  line-height: 1;
}
.app-bottom-nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-header h2, .page-header h3 { margin: 8px 0; }
.about-app-version-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 600;
}
.about-clear-sync-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 16px;
}
.about-clear-sync-actions .btn {
  width: auto;
  min-width: 160px;
}
.about-update-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
}
.about-update-actions.hidden {
  display: none;
}
.about-update-actions .btn {
  width: auto;
  min-width: 160px;
}
.page-title-spacer { flex: 1 1 auto; }
.header-actions { display: inline-flex; gap: 8px; align-items: center; }
.task-items-page-header {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.task-items-page-header h3 {
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 4px 0;
}
.task-items-page-header .header-actions {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}
.task-items-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}
.task-items-page-header .task-items-admin-toolbar {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  justify-content: flex-end;
}
.task-items-admin-toolbar.hidden { display: none; }
.task-items-admin-count { font-size: 13px; color: #1e40af; margin-right: 4px; }
.aged-restore-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1e3a8a;
  user-select: none;
}
.aged-restore-option input { width: 16px; height: 16px; margin: 0; }
.completed-admin-section { margin-top: 16px; padding-top: 8px; border-top: 1px solid #e5e7eb; }
.completed-admin-section.hidden { display: none; }
#resendReportsPage .completed-admin-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.completed-admin-hint { margin: 4px 0 12px; font-size: 13px; }
.resend-reports-group-header {
  margin-top: 16px;
  margin-bottom: 6px;
}
.resend-reports-group-header:first-child {
  margin-top: 4px;
}
.completed-sent-card { width: 100%; }
.completed-sent-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.completed-sent-label { font-size: 12px; font-weight: 600; color: #374151; }
.completed-sent-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 2.5em;
  line-height: 1.35;
  scroll-margin: 96px;
}
.task-item-row.task-item-row-focus {
  outline: 2px solid #1565c0;
  outline-offset: 2px;
  border-radius: 6px;
}

.task-item-row-actions,
.task-item-redo-actions,
.task-item-completed-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding: 0 2px 2px;
}
.task-item-delete-draft-btn {
  font-weight: 600;
}
.task-item-redo-btn {
  min-width: 5.5rem;
  font-weight: 600;
}
#completedTasksList .list-item,
#taskItemsList .list-item.task-item-capture-row {
  display: flex;
  flex-direction: column;
}
#taskItemsList .list-item.task-item-capture-row {
  cursor: pointer;
}
#taskItemsList .list-item.task-item-capture-row:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
#captureTasksList .list-item.task-item-capture-row,
#taskItemsList .list-item.task-item-capture-row {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  gap: 4px;
}
#captureTasksList .list-item.task-item-capture-row {
  cursor: pointer;
}
.task-item-capture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.task-item-capture-head-text {
  flex: 1 1 auto;
  min-width: 0;
}
.task-item-capture-head-text .list-item-title {
  font-size: 15px;
  line-height: 1.25;
}
.task-item-capture-head-text .list-item-subtitle {
  font-size: 12px;
  line-height: 1.3;
  margin-top: 2px;
  color: #64748b;
}
.task-item-capture-head-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  max-width: 48%;
}
#tasksList .task-item-capture-head-actions,
#tasksList .capture-task-inline-items .task-item-capture-head-actions {
  max-width: none;
}
#tasksList .task-item-capture-head-actions .btn,
#tasksList .capture-task-inline-items .task-item-capture-head-actions .btn {
  flex-shrink: 0;
}
.task-item-capture-head-actions .task-item-row-actions {
  margin-top: 0;
  padding: 0;
  gap: 6px;
  flex-wrap: wrap;
}
.task-item-capture-row .list-item-meta {
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
  color: #475569;
}

.completed-sent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.task-item-row-admin .completed-sent-card { flex: 1; min-width: 0; }
.task-item-row-admin {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
}
.task-item-row-admin .task-item-select {
  flex-shrink: 0;
  margin-top: 14px;
  width: 18px;
  height: 18px;
}
.task-item-row-admin .list-item-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.task-item-row-admin .list-item-meta {
  margin-top: 4px;
  min-width: 0;
}
.task-item-meta-oneline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Admin Review Reports: task picker + task items share a 6-row scroll grid (no partial rows). */
#capturePage.is-pow-sup-review {
  --admin-review-grid-rows: 6;
  --admin-review-grid-row-h: 40px;
  --admin-review-grid-h: calc(var(--admin-review-grid-row-h) * var(--admin-review-grid-rows));
}
#capturePage.is-pow-sup-review #captureTaskSelect {
  height: var(--admin-review-grid-h);
  max-height: var(--admin-review-grid-h);
  box-sizing: border-box;
  overflow-y: auto;
}
#capturePage.is-pow-sup-review .admin-review-items-scroll {
  margin-top: 12px;
  height: var(--admin-review-grid-h);
  max-height: var(--admin-review-grid-h);
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
#capturePage.is-pow-sup-review #taskItemsListScroll .list-container,
#capturePage.is-pow-sup-review #taskItemsList.admin-review-items-grid {
  min-height: 0;
  margin-top: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0;
  box-sizing: border-box;
}
#capturePage.is-pow-sup-review #taskItemsList .task-item-row-admin {
  height: var(--admin-review-grid-row-h);
  min-height: var(--admin-review-grid-row-h);
  max-height: var(--admin-review-grid-row-h);
  margin: 0;
  padding: 0 4px;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}
#capturePage.is-pow-sup-review #taskItemsList .task-item-row-admin:last-child {
  border-bottom: none;
}
#capturePage.is-pow-sup-review #taskItemsList .task-item-row-admin .task-item-select {
  margin-top: 0;
  align-self: center;
}
#capturePage.is-pow-sup-review #taskItemsList .task-item-row-admin .list-item-btn {
  margin-bottom: 0;
  padding: 4px 8px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
#capturePage.is-pow-sup-review #taskItemsList .task-item-row-admin .list-item-meta {
  display: none;
}
#capturePage.is-pow-sup-review #taskItemsList .list-item-title,
#capturePage.is-pow-sup-review #taskItemsList .list-item-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
  line-height: 1.25;
}
#capturePage.is-pow-sup-review #taskItemsList .list-item-subtitle {
  font-size: 12px;
}
#capturePage.is-pow-sup-review .admin-review-items-empty-in-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--admin-review-grid-h);
  min-height: var(--admin-review-grid-h);
  box-sizing: border-box;
  padding: 16px;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}
#capturePage.is-pow-sup-review #taskItemsEmpty {
  display: none !important;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
}
.btn-danger:disabled { opacity: 0.55; }
.inline-controls { display: inline-flex; gap: 8px; align-items: center; }
.inline-label { margin: 0; display: inline; font-size: 12px; color: #444; white-space: nowrap; }
.select-small { width: auto; padding: 6px 10px; font-size: 12px; }
.list-container { margin-top: 12px; overflow: visible; min-height: 200px; }
.list-item { background: #fff; padding: 12px; border-radius: 12px; margin-bottom: 10px; border: 1px solid #e5e7eb; box-shadow: 0 1px 1px rgba(0,0,0,0.03); }
.list-item-title { font-weight: bold; }
.list-item-subtitle { color: #666; font-size: 13px; margin-top: 2px; }
.list-item-subtitle .week-visit-meta { color: #666; }
.list-item-subtitle .week-visit-address { margin-top: 4px; line-height: 1.35; }
.list-item-subtitle a.week-visit-maps-link {
  color: #1a73e8;
  text-decoration: underline;
  word-break: break-word;
}
.list-item-notes { color: #374151; font-size: 13px; margin-top: 8px; white-space: pre-wrap; }
.my-tasks-site-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-draft-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.my-tasks-site-row,
.capture-site-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.my-tasks-site-label-block {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.my-tasks-site-row-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.my-tasks-site-label,
.capture-site-picker-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #334155;
}
.my-tasks-site-row-head .my-tasks-site-label {
  flex: 1 1 auto;
}
.my-tasks-site-peer-complete {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}
.my-tasks-site-shared-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  margin-right: 4px;
}
.capture-site-picker {
  margin-top: 10px;
}
.capture-site-picker.hidden { display: none; }
.capture-site-picker-heading {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.capture-site-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#capturePage:not(.is-pow-sup-review) #captureTaskSelectGroup .capture-site-picker {
  max-width: 100%;
}
#capturePage:not(.is-pow-sup-review) .capture-task-select-admin-only,
#capturePage:not(.is-pow-sup-review) .capture-task-select-admin-label,
#capturePage:not(.is-pow-sup-review) .searchable-listbox-popup-host {
  display: none !important;
}
#capturePage.is-pow-sup-review .capture-tasks-list,
#capturePage.is-pow-sup-review #captureTasksEmpty {
  display: none !important;
}
#captureTasksList .list-item.is-active-capture-task {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #eff6ff;
}
#captureTaskSelectGroup .capture-tasks-list {
  margin-top: 0;
}
.capture-task-block {
  margin-bottom: 12px;
}
.capture-task-block.is-task-card-collapsed .field-task-card-body,
#tasksList .list-item.is-task-card-collapsed .field-task-card-body {
  display: none !important;
}
#tasksList .list-item .field-task-card-head,
#captureTasksList .list-item .field-task-card-head {
  position: relative;
  padding-right: 28px;
}
#tasksList .list-item .field-task-card-head {
  padding-right: 36px;
}
.field-task-card-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.field-task-card-head-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.field-task-card-head-stats {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 6px 12px;
}
.field-task-card-progress-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
}
.field-task-card-progress-label {
  font-weight: 500;
}
.field-task-card-count-bubble {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}
.field-task-card-count-bubble--done {
  background: #dcfce7;
  color: #166534;
}
.field-task-card-count-bubble--todo {
  background: #dbeafe;
  color: #1e40af;
}
.field-task-card-count-bubble--overdue {
  background: #fee2e2;
  color: #b91c1c;
}
#tasksList .list-item.is-my-tasks-task-complete .list-item-title,
#tasksList .list-item.is-my-tasks-task-complete .list-item-title span {
  color: #15803d;
  text-decoration: line-through;
  text-decoration-color: rgba(21, 128, 61, 0.55);
}
#tasksList .list-item.is-ad-hoc-report-task .list-item-title,
#tasksList .list-item.is-ad-hoc-report-task .list-item-title span {
  color: inherit;
  font-weight: bold;
  text-decoration: none;
}
#tasksList .list-item.is-ad-hoc-report-task .list-item-title::before {
  content: '(AD-HOC) ';
  font-weight: bold;
}
#tasksList .list-item.is-ad-hoc-report-task.overdue .list-item-title {
  flex-wrap: wrap;
}
#tasksList .field-task-card-head-main .list-item-title {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}
#tasksList .list-item.is-my-tasks-task-complete.is-task-card-collapsed .list-item-subtitle,
#tasksList .list-item.is-my-tasks-task-complete.is-task-card-collapsed .field-task-card-head-main .list-item-subtitle {
  display: none;
}
.field-task-card-head-main {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
#tasksList .field-task-card-head-main .list-item-subtitle,
#captureTasksList .field-task-card-head-main .list-item-subtitle {
  display: block;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-top: 6px;
}
#tasksList .list-item.list-item-clickable:has(.field-task-card-head),
#captureTasksList .list-item.list-item-clickable:has(.field-task-card-head) {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.12);
}
/* Open: top-right of card head when collapsed (saves vertical space vs footer row). */
#tasksList .field-task-card-open-slot {
  display: none;
  margin: 0;
}
#tasksList .capture-task-block.is-task-card-collapsed .field-task-card-open-slot,
#tasksList .list-item.is-task-card-collapsed .field-task-card-open-slot {
  display: block;
  position: absolute;
  top: 6px;
  right: 34px;
  z-index: 2;
}
#tasksList .capture-task-block.is-task-card-collapsed .field-task-card-head,
#tasksList .list-item.is-task-card-collapsed .field-task-card-head {
  padding-right: 96px;
}
#tasksList .field-task-card-open {
  display: inline-flex;
  min-height: 32px;
  min-width: 58px;
  padding: 4px 10px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
#tasksList .capture-task-block:not(.is-task-card-collapsed) .field-task-card-head::after,
#captureTasksList .capture-task-block:not(.is-task-card-collapsed) .field-task-card-head::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 12px;
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
}
#tasksList .capture-task-block.is-task-card-collapsed .field-task-card-head::after,
#captureTasksList .capture-task-block.is-task-card-collapsed .field-task-card-head::after {
  content: '▸';
  position: absolute;
  right: 10px;
  top: 12px;
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
}
@media (max-width: 720px) {
  #tasksList .capture-task-block.is-task-card-collapsed .field-task-card-head,
  #tasksList .list-item.is-task-card-collapsed .field-task-card-head {
    padding-right: 102px;
    padding-top: 4px;
  }
  #tasksList .capture-task-block.is-task-card-collapsed .field-task-card-open-slot,
  #tasksList .list-item.is-task-card-collapsed .field-task-card-open-slot {
    top: 8px;
    right: 30px;
  }
  #tasksList .field-task-card-head-top {
    gap: 6px;
  }
  #tasksList .field-task-card-head-stats {
    gap: 4px 10px;
  }
  #tasksList .field-task-card-head-main .list-item-subtitle {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 4px;
  }
}
.field-task-card-body {
  margin-top: 8px;
}
.capture-task-inline-items {
  margin: 8px 0 0 0;
  padding-left: 8px;
  border-left: 3px solid #e2e8f0;
}
#tasksList .field-task-card-body {
  margin-top: 10px;
}
.capture-task-inline-items .task-item-row {
  margin-top: 8px;
}
#tasksList .list-item.task-item-capture-row,
#captureTasksList .list-item.task-item-capture-row {
  margin-top: 0;
}
#capturePage:not(.is-pow-sup-review) .task-items-page-header,
#capturePage:not(.is-pow-sup-review) #taskItemsList,
#capturePage:not(.is-pow-sup-review) #taskItemsEmpty {
  display: none !important;
}
.task-item-site-fixed {
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  line-height: 1.35;
}
.task-item-site-fixed.hidden { display: none; }
#taskItemCustomer.hidden { display: none; }
.time-history-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.time-history-row {
  display: grid;
  grid-template-columns: minmax(88px, 1.2fr) minmax(72px, 0.9fr) minmax(72px, 0.9fr) 40px 44px 52px 56px minmax(100px, 1.3fr);
  gap: 8px;
  align-items: start;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 1px rgba(0,0,0,0.03);
}
.time-history-head {
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  box-shadow: none;
}
.time-history-cell {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}
.time-history-readonly {
  color: #111827;
}
.time-history-row.is-open .time-history-readonly:last-of-type {
  color: #2563eb;
  font-weight: 600;
}
.time-history-notes-cell {
  grid-column: auto;
}
.time-entry-notes-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.time-entry-notes-label { font-size: 12px; font-weight: 600; color: #6b7280; }
.time-entry-notes-input {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  resize: vertical;
  background: #fff;
}
.time-entry-notes-input.is-readonly {
  background: #f3f4f6;
  color: #4b5563;
  cursor: not-allowed;
}
.time-entry-notes-input:focus {
  outline: none;
  border-color: #2563eb;
}
.time-entry-notes-input.is-readonly:focus {
  border-color: #d1d5db;
}
.time-entry-notes-input.is-saving {
  opacity: 0.75;
}
@media (max-width: 720px) {
  .time-history-row {
    grid-template-columns: 1fr 1fr;
  }
  .time-history-head {
    display: none;
  }
  .time-history-row.is-closed,
  .time-history-row.is-open {
    grid-template-areas:
      "site site"
      "start end"
      "tasks duration"
      "done missed"
      "notes notes";
  }
  .time-history-row .time-history-cell:nth-child(1) { grid-area: site; font-weight: 700; }
  .time-history-row .time-history-cell:nth-child(2) { grid-area: start; }
  .time-history-row .time-history-cell:nth-child(3) { grid-area: end; }
  .time-history-row .time-history-cell:nth-child(4) { grid-area: tasks; }
  .time-history-row .time-history-cell:nth-child(5) { grid-area: done; }
  .time-history-row .time-history-cell:nth-child(6) { grid-area: missed; }
  .time-history-row .time-history-cell:nth-child(7) { grid-area: duration; }
  .time-history-notes-cell { grid-area: notes; }
  .time-history-row .time-history-cell:nth-child(2)::before { content: 'Start: '; color: #6b7280; font-weight: 600; }
  .time-history-row .time-history-cell:nth-child(3)::before { content: 'End: '; color: #6b7280; font-weight: 600; }
  .time-history-row .time-history-cell:nth-child(4)::before { content: 'Tasks: '; color: #6b7280; font-weight: 600; }
  .time-history-row .time-history-cell:nth-child(5)::before { content: 'Done: '; color: #6b7280; font-weight: 600; }
  .time-history-row .time-history-cell:nth-child(6)::before { content: 'Missed: '; color: #6b7280; font-weight: 600; }
  .time-history-row .time-history-cell:nth-child(7)::before { content: 'Duration: '; color: #6b7280; font-weight: 600; }
}
.list-item-meta { color: #374151; font-size: 13px; margin-top: 8px; white-space: pre-wrap; }
.client-doc-item .client-doc-open { margin-top: 10px; display: inline-block; }
.client-docs-client-list { max-height: 240px; overflow-y: auto; }
.store-list-item.client-docs-client-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.client-docs-client-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 4px;
  background: #fff;
}
.client-docs-files-header { margin-bottom: 0; }
.client-docs-files-header h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
}
.client-docs-selected-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 4px;
  background: #fff;
}
.store-list-item.client-docs-client-item.is-selected { background: #eff6ff; }
.store-list-item.client-docs-client-item.is-selected .store-list-name { color: #1d4ed8; font-weight: 600; }
.client-docs-client-count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.store-list-item.is-selected .client-docs-client-count { background: #dbeafe; color: #1d4ed8; }
.client-docs-files-section { margin-top: 16px; }
.list-item-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.list-item-btn { width: 100%; text-align: left; cursor: pointer; }
.list-item-clickable { cursor: pointer; }
.list-item-clickable:hover { border-color: #c7d2fe; }
.list-item-btn:hover { border-color: #c7d2fe; }
.list-item-btn:active { transform: translateY(1px); }
.empty-state { display: none; color: #777; margin-top: 12px; }
.empty-state.active { display: block; }
#clockPage > #clockInError.error-message {
  margin-top: 0;
  margin-bottom: 8px;
}
#clockPage > #clockInError.error-message:empty {
  display: none;
}
.active-entry { margin: 10px 0; padding: 10px; background: #e8f5e9; border: 1px solid #c8e6c9; border-radius: 6px; }
.loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(242, 244, 247, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.loading.active { display: flex; }
.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(320px, 90vw);
  text-align: center;
}
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--blue);
  border-radius: 50%;
  /* Transform-only spin; opacity pulse removed — LTPO / dynamic Hz thrashing on Honor. */
  animation: dax-loading-spin 0.85s linear infinite;
  will-change: transform;
}
.loading-message {
  font-size: 16px;
  line-height: 1.4;
  color: #374151;
}
@keyframes dax-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation: none; }
}
.toast-container { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 56000; pointer-events: none; }
.toast-container .toast { pointer-events: auto; }
.toast { background: #323232; color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; max-width: 280px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #2e7d32; }
.toast.error { background: #c62828; }
.toast.warning { background: #e65100; color: #fff; }
.toast.info { background: var(--blue); color: #fff; }

/* Push / task messages — above capture editor and app pages (body-level overlay). */
.push-message-overlay {
  z-index: 55000;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0)) 12px max(12px, env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
}
.push-message-overlay.active { display: flex; }
.push-message-modal {
  border-radius: 18px;
  width: min(480px, 96vw);
  max-height: min(560px, 88vh);
}
.push-message-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  font-size: 15px;
}
.push-message-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.push-message-actions .btn { flex: 1 1 auto; min-width: 6rem; }

/* Global search bar */
.global-search {
  position: sticky;
  top: 52px; /* below compact navbar */
  z-index: 19;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.global-search-row {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.global-search-row .icon-btn {
  color: var(--ink);
  flex-shrink: 0;
}
.global-search-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  font-size: 14px;
}
.global-search-admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.global-search-admin-bar:not(:has(.admin-date-filter:not(.hidden), .admin-filter-selects:not(.hidden), .admin-field-context-bar:not(.hidden), .admin-team-filter-bubbles:not(.hidden), .tasks-stale-hint:not(.hidden))) {
  display: none;
}
.global-search-admin-bar.has-visible-admin-filters {
  display: flex !important;
}
.admin-filter-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 2px;
}
.admin-filter-selects.hidden { display: none; }
.admin-filter-field-only.hidden { display: none !important; }
.admin-filter-store-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  flex: 0 1 auto;
  min-width: 0;
}
.admin-filter-select-label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin-bottom: 0;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  min-width: 0;
  flex: 0 1 auto;
}
.admin-filter-select-caption {
  display: block;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: 1.2;
  white-space: nowrap;
}
.admin-filter-select {
  min-width: 7.25rem;
  max-width: 11rem;
  width: 11rem;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}
.admin-filter-store-select {
  min-width: 8.5rem;
  max-width: 13rem;
  width: 11rem;
}
.admin-field-context-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 100%;
  font-size: 11px;
}
.admin-field-context-bar.hidden { display: none; }
.admin-field-context-summary {
  flex: 1 1 12rem;
  min-width: 0;
}
.admin-field-context-apply {
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  max-width: 11rem;
  font-size: 10px;
  line-height: 1.25;
  padding-bottom: 2px;
}
.admin-field-context-apply-text {
  display: inline-block;
  min-width: 0;
}
.drawer-pow-sup-mode {
  padding: 10px 14px 6px;
  border-top: 1px solid #e2e8f0;
}
.drawer-pow-sup-mode.hidden { display: none; }
.drawer-pow-sup-mode-label {
  display: block;
  font-size: 11px;
  margin-bottom: 6px;
}
.drawer-pow-sup-mode-toggle {
  display: flex;
  gap: 6px;
}
.drawer-pow-sup-mode-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.drawer-pow-sup-mode-btn.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}
.global-search-btn { flex-shrink: 0; }
.global-search-clear.hidden { display: none; }
.admin-date-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  flex: 0 1 auto;
}
.admin-date-filter.hidden { display: none; }
.admin-date-filter-action {
  appearance: none;
  margin: 0;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.admin-date-filter-action:hover {
  background: #e2e8f0;
}
.admin-date-filter-action.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}
.admin-date-range-inputs {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.admin-date-range-inputs.hidden { display: none; }
.admin-date-range-inputs input[type="date"] {
  width: 8.6rem;
  min-width: 0;
  padding: 3px 4px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.admin-team-filter-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 72px;
  overflow: auto;
  padding: 1px 0;
}
.global-search-admin-bar .tasks-stale-hint {
  flex: 1 1 100%;
  margin: 0;
}
.admin-team-filter-bubbles.hidden { display: none; }
.admin-team-filter-actions {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-right: 1px;
}
.admin-team-filter-action {
  appearance: none;
  margin: 0;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.admin-team-filter-action:hover {
  background: #e2e8f0;
}
.admin-team-filter-bubble {
  appearance: none;
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid #94a3b8;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.admin-team-filter-bubble:hover {
  border-color: #64748b;
  color: #334155;
}
.admin-team-filter-bubble.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}
.admin-team-filter-bubble.is-selected:hover {
  border-color: #1d4ed8;
  background: #bfdbfe;
}
.admin-team-filter-bubble.is-muted {
  cursor: default;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
}

/* Overdue tasks */
.list-item.overdue { border-color: #fecaca; }
.list-item.overdue .list-item-title { color: #b91c1c; display: flex; align-items: center; gap: 8px; }
.overdue-icon { width: 16px; height: 16px; color: #dc2626; flex: 0 0 auto; }

.hint { color: #6b7280; margin-top: 10px; font-size: 13px; }
.tile-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.tile { text-align: left; padding: 14px 14px; border-radius: 14px; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; }
.tile-title { font-weight: 700; font-size: 16px; }
.tile-sub { color: #6b7280; font-size: 13px; margin-top: 4px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; margin-top: 12px; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 12px; }
.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.image-slot { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; background: #f9fafb; }
.image-slot-title { font-size: 12px; color: #6b7280; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.image-slot img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; background: #fff; border: 1px solid #e5e7eb; }
.image-slot .slot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-slot button:disabled { opacity: 0.55; cursor: not-allowed; }
.capture-dyn-img-actions .capture-dyn-img-clear,
.image-slot .slot-clear-btn { color: #7f1d1d; }
.task-image-strip {
  padding: 6px 2px 10px;
  margin: 2px 0 8px;
}
.task-image-strip.image-grid {
  margin-top: 2px;
}
.task-image-thumb {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
}
.task-image-strip.image-grid .task-image-thumb {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
}
.task-image-thumb img,
img.task-image-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
}
.task-image-strip.image-grid .task-image-thumb img {
  border: none;
  border-radius: 10px;
}
.task-image-thumb:active { transform: translateY(1px); }
.image-slot img.capture-image-preview-openable,
.capture-dyn-preview.capture-image-preview-openable {
  cursor: zoom-in;
}
.image-slot img.capture-image-preview-openable:focus-visible,
.capture-dyn-preview.capture-image-preview-openable:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.hidden { display: none !important; }

.client-upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
  font-size: 14px;
  line-height: 1.35;
}

.client-upgrade-overlay {
  z-index: 12000;
}

.client-upgrade-overlay.active {
  display: flex;
}

/* Group headers – prevent clipping of task-filter-summary / group-header-label */
.group-header {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: visible;
}

.group-header-label,
.task-filter-summary {
  min-width: 0;
  overflow: visible;
  flex: 1 1 auto;
  word-break: break-word;
}

.group-header-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  background: #111827;
  color: #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.week-group-header {
  color: #111827;
}

.week-group-header .group-header-badge {
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

/* Modal editor for capture */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}
.modal-overlay.active { display: flex; }
/* Above #loading (45), drawer (40), navbar (20); body-level so WebView hit-testing matches viewport */
.modal-overlay.capture-edit-overlay {
  z-index: 200;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  touch-action: auto;
}
.modal-overlay.confirm-suppressed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
/* Peer “site already captured” prompt must sit above capture editor */
.modal-overlay.peer-capture-at-site-modal.confirm-suppressed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.modal-overlay.peer-capture-at-site-modal {
  z-index: 210;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}
.modal-overlay.capture-edit-overlay .modal {
  pointer-events: auto;
  touch-action: auto;
  max-height: min(92vh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  min-height: 0;
}
html.is-android-native .modal-overlay.capture-edit-overlay .modal {
  max-height: min(92vh, calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
}
.modal-overlay.capture-edit-overlay .modal > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
}
/* One scrollport on the form — nested .capture-editor-scroll flex (2d3f16b) traps APK WebView touches. */
.modal-overlay.capture-edit-overlay #taskItemForm.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 12px;
}
.modal-overlay.capture-edit-overlay #taskItemForm .capture-editor-scroll,
.modal-overlay.capture-edit-overlay #taskItemForm .capture-editor-scroll.modal-body-scroll {
  overflow: visible;
  flex: none;
  min-height: auto;
  max-height: none;
  touch-action: auto;
  container-type: inline-size;
  container-name: capture-editor;
}
#reminderOverlay .modal-body {
  container-type: inline-size;
  container-name: capture-editor;
}
/* Image grids: 2 across by default; widen only when the modal panel is wide (not viewport). */
.modal-overlay.capture-edit-overlay .image-grid,
.modal-overlay.capture-edit-overlay .capture-dyn-image-grid.image-grid,
.modal-overlay.capture-edit-overlay .task-image-strip.image-grid,
#reminderOverlay .task-image-strip.image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@container capture-editor (min-width: 520px) {
  html.field-user-desktop .modal-overlay.capture-edit-overlay .image-grid,
  html.field-user-desktop .modal-overlay.capture-edit-overlay .capture-dyn-image-grid.image-grid,
  html.field-user-desktop .modal-overlay.capture-edit-overlay .task-image-strip.image-grid,
  html.field-user-desktop #reminderOverlay .task-image-strip.image-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@container capture-editor (min-width: 680px) {
  html:not(.field-user-desktop) .modal-overlay.capture-edit-overlay .image-grid,
  html:not(.field-user-desktop) .modal-overlay.capture-edit-overlay .capture-dyn-image-grid.image-grid,
  html:not(.field-user-desktop) .modal-overlay.capture-edit-overlay .task-image-strip.image-grid,
  html:not(.field-user-desktop) #reminderOverlay .task-image-strip.image-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@container capture-editor (min-width: 640px) {
  @media (hover: none) and (pointer: coarse) {
    .modal-overlay.capture-edit-overlay .image-grid,
    .modal-overlay.capture-edit-overlay .capture-dyn-image-grid.image-grid,
    .modal-overlay.capture-edit-overlay .task-image-strip.image-grid,
    #reminderOverlay .task-image-strip.image-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
}
.modal-overlay.capture-edit-overlay #taskItemForm .sticky-actions {
  flex-shrink: 0;
  position: static;
  margin: 0;
}
/* Instructions grow with content; outer scroll only (setTaskInstructionsText caps rows). */
.modal-overlay.capture-edit-overlay #taskItemDescription {
  resize: none;
  overflow: hidden;
  min-height: 3.5rem;
  field-sizing: content;
}
@media (hover: none) and (pointer: coarse) {
  .modal-overlay.capture-edit-overlay #taskItemDescription {
    field-sizing: normal;
  }
}
html.is-android-native .modal-overlay.capture-edit-overlay #taskItemDescription {
  field-sizing: normal;
}
.modal-overlay.capture-edit-overlay #taskItemCaptureFieldsWrap,
.modal-overlay.capture-edit-overlay .capture-fields-container,
.modal-overlay.capture-edit-overlay .capture-table-wrap,
.modal-overlay.capture-edit-overlay .capture-table-grid {
  touch-action: pan-x pan-y;
}
.modal-overlay.capture-edit-overlay .capture-page-tabs {
  overflow-x: hidden;
  flex-wrap: wrap;
}
/* Background lists must not scroll behind the sheet (My Tasks, admin review, etc.). */
body.capture-edit-sheet-open #app .content-page.active,
body.capture-edit-sheet-open #app #tasksList.my-tasks-list-scroll,
body.capture-edit-sheet-open #app #taskItemsListScroll .list-container,
body.capture-edit-sheet-open #app #taskItemsList.admin-review-items-grid,
body.capture-edit-sheet-open #app #captureTaskSelect,
body:has(.capture-edit-overlay.active) #app .content-page.active,
body:has(.capture-edit-overlay.active) #app #tasksList.my-tasks-list-scroll,
body:has(.capture-edit-overlay.active) #app #taskItemsListScroll .list-container,
body:has(.capture-edit-overlay.active) #app #taskItemsList.admin-review-items-grid,
body:has(.capture-edit-overlay.active) #app #captureTaskSelect {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.modal {
  width: min(1100px, 100vw);
  max-width: 100%;
  max-height: 92vh;
  background: #fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid #e5e7eb;
  /* Clip long instructions / URLs so the sheet cannot grow past the viewport */
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.modal-title { font-weight: 800; }
.modal-body {
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-height: calc(92vh - 120px);
}
.modal-body-scroll {
  overflow-x: hidden;
  overflow-y: visible;
  max-height: none;
  flex: 0 0 auto;
  min-height: 0;
  min-width: 0;
}

/* Long task instructions, URLs, and tokens must wrap inside the modal (flex default min-width:auto otherwise expands past 100vw) */
.modal-body .form-group {
  min-width: 0;
}
#taskItemDescription,
#taskItemNotes,
#taskItemRecipients,
#taskItemMailCC {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.capture-delivery-section .capture-delivery-cc-label {
  display: block;
  margin-top: 10px;
}
.capture-delivery-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 2.5em;
  line-height: 1.35;
}
.capture-delivery-hint {
  margin: 8px 0 10px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
}
#taskItemSupplier {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.checklist-item .checklist-label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.capture-fields-container input,
.capture-fields-container textarea {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  /* Above capture modal (z-index 60) and loading overlay */
  z-index: 50000;
  padding: 12px;
}
.lightbox-overlay.active { display: flex; }
.lightbox {
  width: min(980px, 100vw);
  max-height: 92vh;
  background: #0b1020;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.lightbox img {
  width: 100%;
  height: auto;
  max-height: 92vh;
  object-fit: contain;
  display: block;
  background: #0b1020;
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
}

.client-doc-viewer {
  width: min(980px, 100vw);
  height: min(860px, 92vh);
  display: flex;
  flex-direction: column;
  background: #111827;
}
.client-doc-viewer-title {
  padding: 14px 56px 10px 14px;
  color: #f9fafb;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex: 0 0 auto;
}
.client-doc-viewer-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.client-doc-viewer-fallback {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #e5e7eb;
}
.client-doc-viewer-download { text-decoration: none; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid #e5e7eb;
  padding: 10px;
  margin: 14px -12px -12px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.sticky-actions .btn { flex: 1; }

@media (min-width: 520px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .modal-overlay { align-items: center; }
  .modal { border-radius: 18px; max-height: 86vh; width: min(1100px, 96vw); }
  .modal-body { max-height: calc(86vh - 140px); }
}

