/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: #D8D9E0;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, textarea { font-family: var(--font); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── App shell ──────────────────────────────────────────────── */
#app {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  height: 100vh;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

/* ─── Screens ────────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  overflow: hidden;
  background: var(--surface);
}
.screen.active {
  display: flex;
  animation: screenIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 32px;
}

/* ─── App header (navy bar) ──────────────────────────────────── */
.app-header {
  background: linear-gradient(180deg, #1E2368 0%, var(--navy) 100%);
  color: white;
  padding: 14px 20px 18px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(15,17,40,0.18);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-back {
  color: white;
  font-size: 22px;
  padding: 2px 6px 2px 0;
  opacity: 0.85;
  line-height: 1;
  flex-shrink: 0;
}
.header-back:hover { opacity: 1; }
.header-titles { flex: 1; min-width: 0; }
.header-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.header-subtitle {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 2px;
}
.header-action {
  color: white;
  font-size: 20px;
  opacity: 0.75;
  padding: 4px;
  flex-shrink: 0;
}
.header-action:hover { opacity: 1; }

/* ─── Score banner (dark navy strip below header) ───────────── */
.score-banner {
  background: linear-gradient(135deg, #111436 0%, #181C52 100%);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.score-banner-label { font-size: 13px; font-weight: 600; }
.score-banner-sub   { font-size: 11px; opacity: 0.6; margin-top: 2px; }
.score-banner-value {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -1px;
}

/* ─── Progress bar (thin, below header on questions) ────────── */
.question-progress-bar {
  height: 5px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
  background: #21275F;
}
.question-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #18B854, var(--green));
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 1px 0 6px rgba(21,163,72,0.5);
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-inner);
  overflow: hidden;
}

/* Staggered card entrance */
.home-body .card,
.home-body .stat-grid,
.home-body .section-label,
.home-body .mb-16 {
  position: relative;
  z-index: 1;
}
.home-body .card,
.home-body .stat-grid {
  animation: riseIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.home-body .stat-grid            { animation-delay: 40ms; }
.home-body .card:nth-of-type(1)  { animation-delay: 80ms; }
.home-body .card:nth-of-type(2)  { animation-delay: 130ms; }
.home-body .card:nth-of-type(3)  { animation-delay: 175ms; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-pad { padding: 16px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  border: none;
  line-height: 1;
}
.btn-primary {
  background: linear-gradient(180deg, #232B7A 0%, var(--navy) 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(28,32,87,0.30), 0 1px 2px rgba(28,32,87,0.20);
  letter-spacing: 0.1px;
}
.btn-primary { will-change: transform; }
.btn-primary:active {
  background: var(--navy-hover);
  transform: scale(0.985);
  box-shadow: 0 1px 3px rgba(28,32,87,0.25);
}
.btn-primary:focus-visible {
  outline: 3px solid rgba(28,32,87,0.4);
  outline-offset: 2px;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:active { background: var(--navy-light); transform: scale(0.99); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
}
.btn-ghost:active { background: var(--navy-light); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}

/* ─── Answer buttons (Yes / No / N/A) ───────────────────────── */
.answer-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}
.answer-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 8px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 160ms cubic-bezier(0.2, 0, 0.2, 1);
  font-family: var(--font);
  color: var(--text-secondary);
  letter-spacing: 0.1px;
  box-shadow: 0 1px 3px rgba(15,17,30,0.06);
}
.answer-btn .ans-icon {
  font-size: 15px;
  line-height: 1;
  font-style: normal;
}

.answer-btn.yes { border-color: #6EE09A; color: #0F7A30; background: #F2FCF6; }
.answer-btn.no  { border-color: #F9A3A3; color: #A01212; background: #FEF5F5; }
.answer-btn.na  { border-color: #D1D5DB; color: #6B7280; background: #F9FAFB; }

.answer-btn.yes:hover:not(.selected) { background: #E6FAF0; border-color: #3ECF70; }
.answer-btn.no:hover:not(.selected)  { background: #FEF0F0; border-color: #F47272; }
.answer-btn.na:hover:not(.selected)  { background: #F3F4F6; border-color: #9CA3AF; }

.answer-btn.yes.selected {
  background: linear-gradient(145deg, #1DD65F 0%, #0FA83C 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(15,168,60,0.38), 0 1px 4px rgba(15,168,60,0.18);
}
.answer-btn.no.selected {
  background: linear-gradient(145deg, #F54040 0%, #CC1212 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(204,18,18,0.38), 0 1px 4px rgba(204,18,18,0.18);
}
.answer-btn.na.selected {
  background: linear-gradient(145deg, #6B7280 0%, #4B5563 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 12px rgba(75,85,99,0.30);
}

.answer-btn { will-change: transform; }
.answer-btn:active { transform: scale(0.955); box-shadow: none; }

/* ─── Score circle ───────────────────────────────────────────── */
.score-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.sc-100  { background: var(--green-bg);  color: var(--green-text); }
.sc-high { background: var(--amber-bg);  color: var(--amber); }
.sc-mid  { background: var(--orange-bg); color: var(--orange); }
.sc-low  { background: var(--red-bg);    color: var(--red); }
.sc-none { background: var(--grey-bg);   color: var(--grey); }

/* ─── Category progress bar ──────────────────────────────────── */
.cat-progress {
  height: 5px;
  background: var(--grey-bg);
  border-radius: var(--radius-full);
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid var(--border-inner);
}
.cat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}
.fill-100  { background: var(--green); }
.fill-high { background: var(--amber); }
.fill-mid  { background: var(--orange); }
.fill-low  { background: var(--red); }
.fill-none { background: var(--grey-bg); }

/* ─── Site avatar ────────────────────────────────────────────── */
.site-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.badge-open   { background: #FEF3C7; color: #92400E; }
.badge-closed { background: var(--green-bg); color: var(--green-text); }
.badge-info   { background: #EEF2FF; color: var(--navy); }
.badge-green  { background: var(--green-bg); color: var(--green-text); }
.badge-amber  { background: var(--amber-bg); color: var(--amber-text); }
.badge-red    { background: var(--red-bg);   color: var(--red); }

/* ─── Form fields ─────────────────────────────────────────────── */
.field-group { margin-bottom: 16px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-label .required { color: var(--red); }
.field-label .hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-hint); }
.field-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-primary);
  background: #FAFBFF;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-ring);
  background: white;
}
.field-input::placeholder { color: var(--text-hint); }

textarea.field-input {
  resize: none;
  min-height: 90px;
  line-height: 1.5;
}

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .field-input { padding-right: 48px; }
.input-icon-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey);
  font-size: 18px;
}

/* ─── Divider ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 0; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 20px 0 10px;
}

/* ─── Bottom nav ─────────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  background: white;
  border-top: 1px solid var(--border);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 20;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  color: var(--grey);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-transform: uppercase;
  position: relative;
  transition: color var(--transition);
}
.nav-item .nav-icon { font-size: 22px; line-height: 1; }
.nav-item .nav-initials {
  font-size: 11px;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grey-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.nav-item.active .nav-initials { background: var(--navy-light); color: var(--navy); }
.nav-item.active { color: var(--navy); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 3px;
  background: var(--navy);
  border-radius: 0 0 3px 3px;
}

/* ─── Action list item ───────────────────────────────────────── */
.action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  background: white;
  transition: background var(--transition);
}
.action-item:active { background: var(--grey-bg); }
.action-item + .action-item { border-top: 1px solid var(--border); }
.action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.action-icon.navy { background: var(--navy-light); }
.action-icon.amber { background: var(--amber-bg); }
.action-icon.green { background: var(--green-bg); }
.action-text { flex: 1; }
.action-title { font-weight: 600; font-size: 14px; }
.action-sub   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.action-arrow { color: var(--text-hint); font-size: 18px; }

/* ─── Alert/notice banner ────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}
.alert-amber {
  background: var(--amber-bg);
  color: var(--amber-text);
  border-left: 3px solid var(--amber);
}
.alert-green {
  background: var(--green-bg);
  color: var(--green-text);
  border-left: 3px solid var(--green);
}
.alert-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 700; margin-bottom: 2px; }

/* ─── Stat cards (Home) ──────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-inner);
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.5px;
}
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ─── Detail table (Audit start) ─────────────────────────────── */
.detail-table { width: 100%; }
.detail-row {
  display: flex;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-key   { flex: 0 0 120px; font-size: 13px; color: var(--text-secondary); }
.detail-value { flex: 1; font-size: 14px; font-weight: 600; text-align: right; }
.detail-value.green { color: var(--green); }

/* ─── Photo thumbnails ───────────────────────────────────────── */
.photo-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.photo-thumb {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-thumb .remove-photo {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.add-photo-btn {
  width: 100px;
  height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-hint);
  font-size: 11px;
  font-weight: 600;
  background: white;
  transition: all var(--transition);
}
.add-photo-btn .cam-icon { display: block; }
.add-photo-btn:active { border-color: var(--navy); color: var(--navy); background: var(--navy-light); }

/* ─── Signature canvas ───────────────────────────────────────── */
.signature-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: white;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.signature-area.has-signature { border-style: solid; border-color: var(--navy); }
.signature-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.signature-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-hint);
  pointer-events: none;
}
.signature-placeholder .sig-icon { display: block; color: var(--text-hint); }
.signature-placeholder p { font-size: 13px; font-weight: 500; }
.signature-placeholder small { font-size: 11px; }
.signature-area.has-signature .signature-placeholder { display: none; }

/* ─── Recipient row ───────────────────────────────────────────── */
.recipient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.recipient-row:last-child { border-bottom: none; }
.recipient-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grey-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.recipient-name  { font-size: 14px; font-weight: 600; }
.recipient-role  { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.recipient-warn  { font-size: 11px; color: var(--amber); margin-top: 2px; display: flex; align-items: center; gap: 4px; }

/* ─── Failed items list ───────────────────────────────────────── */
.failed-list { list-style: none; }
.failed-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.failed-list li:last-child { border-bottom: none; }
.failed-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.failed-list li:hover { color: var(--red); }

/* ─── Confirmation success ───────────────────────────────────── */
@keyframes checkPop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.18) rotate(5deg); opacity: 1; }
  80%  { transform: scale(0.93) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.confirm-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--green);
  animation: checkPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* ─── Category row score status ──────────────────────────────── */
.cat-row-pass    { border-left-color: var(--green);  background: #F6FFF9; }
.cat-row-fail    { border-left-color: var(--red);    background: #FFF8F8; }
.cat-row-partial { border-left-color: var(--amber); }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.empty-state-icon { font-size: 44px; margin-bottom: 12px; line-height: 1; opacity: 0.4; }
.empty-state-msg  { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-state-sub  { font-size: 13px; color: var(--text-hint); margin-top: 4px; }

/* ─── Navigation prev/next bar ───────────────────────────────── */
.q-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: white;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.q-nav-btn {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: none;
  transition: background var(--transition);
}
.q-nav-btn:hover  { background: var(--navy-light); }
.q-nav-btn:disabled { color: var(--grey); cursor: default; }
.q-nav-btn:disabled:hover { background: none; }
.q-nav-counter { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ─── Category row ───────────────────────────────────────────── */
.cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), padding-left var(--transition);
  border-left: 3px solid transparent;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:active { background: #F4F5FD; border-left-color: var(--navy); padding-left: 13px; }
.cat-info { flex: 1; min-width: 0; }
.cat-name  { font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.cat-count { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.cat-arrow { color: var(--text-hint); font-size: 18px; }

/* ─── Search bar ─────────────────────────────────────────────── */
.search-wrap {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--grey-bg);
  border-radius: var(--radius-full);
  padding: 10px 16px;
}
.search-icon { color: var(--text-hint); flex-shrink: 0; display: block; }
.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}
.search-input::placeholder { color: var(--text-hint); }

/* ─── Site row ───────────────────────────────────────────────── */
.site-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), padding-left var(--transition);
  border-left: 3px solid transparent;
}
.site-row:last-child { border-bottom: none; }
.site-row:active { background: #F4F5FD; border-left-color: var(--navy); padding-left: 13px; }
.site-row.open-audit { background: #FFFCF0; border-left-color: var(--amber); }
.site-row.open-audit:active { background: #FEF3C7; }
.site-info { flex: 1; min-width: 0; }
.site-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.site-meta { font-size: 12px; color: var(--text-secondary); }
.site-meta.open { color: var(--amber-text); }
.site-right { display: flex; align-items: center; gap: 8px; }
.site-arrow { color: var(--text-hint); font-size: 18px; }

/* ─── Region heading ─────────────────────────────────────────── */
.region-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 16px 6px;
  background: var(--surface);
}

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Utility ────────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.text-hint { color: var(--text-hint); }
.text-secondary { color: var(--text-secondary); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-amber { color: var(--amber); }
.font-bold  { font-weight: 700; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.hidden { display: none !important; }

/* ─── Responsive: tablet (600px+) ───────────────────────────── */
@media (min-width: 600px) {
  body { font-size: 16px; }

  .app-header { padding: 18px 28px 22px; }
  .header-title    { font-size: 19px; }
  .header-subtitle { font-size: 13px; }

  .screen-body { padding: 20px 28px 40px; }

  .btn { padding: 18px 24px; font-size: 16px; border-radius: 14px; }

  .answer-btn { padding: 18px 12px; font-size: 15px; gap: 8px; }
  .answer-btn .ans-icon { font-size: 16px; }

  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-value { font-size: 30px; }

  .score-circle { width: 54px; height: 54px; font-size: 12px; }

  .site-avatar  { width: 50px; height: 50px; font-size: 14px; }
  .site-name    { font-size: 15px; }

  .cat-name  { font-size: 15px; }
  .cat-count { font-size: 13px; }

  .field-input { padding: 16px 18px; font-size: 16px; }
  textarea.field-input { min-height: 110px; }

  .score-banner-value { font-size: 38px; }
  .score-banner-label { font-size: 14px; }

  .action-title { font-size: 15px; }
  .action-sub   { font-size: 13px; }

  .bottom-nav { padding: 10px 0 14px; }
  .nav-item   { font-size: 11px; }
  .nav-item .nav-icon { font-size: 24px; }

  .q-nav-btn     { font-size: 15px; padding: 10px 16px; }
  .q-nav-counter { font-size: 14px; }

  .add-photo-btn { width: 112px; height: 112px; font-size: 12px; }
  .add-photo-btn .cam-icon { font-size: 28px; }
  .photo-thumb   { width: 112px; height: 112px; }

  .signature-area { min-height: 200px; }
}

/* ─── Tablet (600–899px) ──────────────────────────────────────── */
@media (min-width: 600px) and (max-width: 899px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .home-body { padding: 20px 28px; }
  .screen-body { padding: 20px 28px; }
  .action-item { padding: 16px 24px; }
  .site-row    { padding: 16px 24px; }
  .cat-row     { padding: 16px 24px; }
  .search-wrap { padding: 12px 24px; }
  .login-form-sheet { padding: 36px 40px 48px; }
  .btn { font-size: 16px; padding: 17px 24px; }
  .question-text { font-size: 17px; }
  .answer-btn { padding: 18px 14px; }
  .div-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
}

/* ─── Desktop / large tablet (900px+) ────────────────────────── */
@media (min-width: 900px) {
  body { background: var(--surface); }

  #app {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    height: 100vh;
    overflow: hidden;
  }

  .screen { height: 100svh; max-height: 100svh; }

  /* Content areas get comfortable padding on wide screens */
  .home-body    { padding: 24px 48px; max-width: 900px; margin: 0 auto; width: 100%; }
  .screen-body  { padding: 24px 48px; max-width: 900px; margin: 0 auto; width: 100%; }
  .search-wrap  { padding: 14px 48px; }
  .region-heading { padding: 12px 48px 8px; }

  /* Grids use more columns */
  .stat-grid    { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stat-card    { padding: 22px; }
  .stat-value   { font-size: 36px; }

  /* Lists use more horizontal space */
  .site-row    { padding: 18px 48px; }
  .cat-row     { padding: 18px 48px; }
  .action-item { padding: 18px 48px; }

  /* Division screen — 3 across on desktop */
  .div-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    padding: 0 32px 20px;
  }

  /* Audit question screens */
  .q-nav-bar          { padding: 14px 48px; }
  .categories-footer  { padding: 20px 48px; }
  .review-footer      { padding: 20px 48px; }
  .signoff-footer     { padding: 20px 48px; }
  .question-text      { font-size: 20px; }
  .answer-group       { gap: 16px; max-width: 700px; margin: 0 auto; }
  .answer-btn         { padding: 22px 18px; font-size: 16px; }

  /* Login */
  .login-form-sheet { padding: 48px 60px 64px; max-width: 520px; margin: 0 auto; }

  /* Score / confirmation */
  .score-banner       { padding: 20px 48px; }
  .score-banner-value { font-size: 48px; }

  /* Nav bar gets centred on wide screens */
  .bottom-nav { padding: 10px 0 16px; }

  /* Home greeting */
  .home-greeting { font-size: 24px; }

  .btn { font-size: 16px; padding: 18px 32px; }
}

/* ─── Small phones — ensure no side overflow ─────────────────── */
@media (max-width: 374px) {
  body { background: var(--surface); }
  #app { box-shadow: none; }
  .stat-value { font-size: 22px; }
  .home-greeting { font-size: 18px; }
  .action-title { font-size: 14px; }
  .div-card-label { font-size: 13px; }
}
