/* Happy Lemon Design System tokens (design/handoff/tokens). Brand font is VAG Rounded (licensed);
   Baloo 2 (display) and Nunito (body) are the handoff's approved substitutes. */
:root {
  --hl-yellow: #ffd500;
  --hl-yellow-600: #f0b400;
  --hl-yellow-300: #ffe566;
  --hl-yellow-100: #fff5c2;
  --hl-red: #ef3340;
  --hl-red-600: #d2242f;
  --hl-red-100: #fde3e5;
  --hl-brown: #73341d;
  --hl-brown-900: #5a2413;
  --hl-brown-500: #a9613b;
  --hl-brown-300: #d0a184;
  --hl-brown-100: #f0e2d8;
  --hl-cream: #fffdf5;
  --hl-cream-2: #fff8e1;
  --hl-gray-700: #5c5148;
  --hl-gray-500: #8a7d72;
  --hl-gray-300: #d9d0c7;
  --hl-gray-100: #f4efe8;
  --hl-success: #4f9d3f;
  --hl-success-100: #e3f1de;

  --font-display: "Baloo 2", "VAG Rounded Std", "Arial Rounded MT Bold", sans-serif;
  --font-body: "Nunito", "VAG Rounded Std", system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --outline-brand: 3px solid var(--hl-brown);
  --shadow-card: 0 2px 0 rgba(115, 52, 29, .14);
  --shadow-raised: 0 4px 0 rgba(115, 52, 29, .18);
  --shadow-pop: 0 8px 24px rgba(115, 52, 29, .16);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 120ms;
  --dur-med: 220ms;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hl-cream); color: var(--hl-gray-700); font: 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--hl-brown-500); }
a:hover { color: var(--hl-red); }
:focus-visible { outline: 3px solid var(--hl-red); outline-offset: 2px; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); color: var(--hl-brown); line-height: 1.1; font-weight: 800; }
h1 { font-size: 34px; margin: 8px 0 4px; }
h2 { font-size: 22px; margin: 28px 0 10px; }
h3 { font-size: 18px; margin: 0 0 4px; font-weight: 700; }
.muted { color: var(--hl-gray-500); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--hl-yellow); border-bottom: var(--outline-brand);
  display: flex; align-items: center; gap: 16px; padding: 10px 24px; min-height: 64px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar .brand img { height: 36px; width: auto; }
.topbar .app-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--hl-brown); border-left: 2px solid var(--hl-brown); padding-left: 10px; line-height: 1.2; }
.topbar nav { display: inline-flex; gap: 4px; padding: 4px; margin-left: auto; background: var(--hl-gray-100); border-radius: var(--radius-pill); }
.topbar nav a, .topbar nav button {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; padding: 9px 18px; border-radius: var(--radius-pill);
  color: var(--hl-gray-500); text-decoration: none; background: none; border: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.topbar nav a:hover, .topbar nav button:hover { color: var(--hl-brown); }
.topbar nav a[aria-current="page"] { background: var(--hl-yellow); border-color: var(--hl-brown); color: var(--hl-brown); }
.signout { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--hl-brown); background: none; border: 2px solid var(--hl-brown); border-radius: var(--radius-pill); padding: 6px 14px; cursor: pointer; }
.signout:hover { background: var(--hl-yellow-300); }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 120px; }
main.wide { max-width: 1240px; padding-left: 24px; padding-right: 24px; }

.card { background: #fff; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-lg); padding: 18px; }
.card.outline { border: var(--outline-brand); box-shadow: var(--shadow-card); }
.card.brand { background: var(--hl-yellow); border: var(--outline-brand); }
.card.cream { background: var(--hl-cream-2); border: 0; }
.card + .card { margin-top: 12px; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 22px;
  border-radius: var(--radius-pill); border: 3px solid var(--hl-brown); background: transparent; color: var(--hl-brown);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1; cursor: pointer; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-bounce), background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.btn:hover { background: var(--hl-brown-100); color: var(--hl-brown); }
.btn:active:not(:disabled) { transform: scale(.97); box-shadow: none; }
.btn.lemon { background: var(--hl-yellow); box-shadow: var(--shadow-raised); }
.btn.lemon:hover { background: var(--hl-yellow-300); }
.btn.primary { background: var(--hl-brown); color: #fff; box-shadow: var(--shadow-raised); }
.btn.primary:hover { background: var(--hl-brown-900); color: #fff; }
.btn.danger { background: var(--hl-red); border-color: var(--hl-red-600); color: #fff; }
.btn.danger:hover { background: var(--hl-red-600); }
.btn.ghost { border-color: transparent; }
.btn.small { min-height: 36px; padding: 8px 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; padding: 14px 28px; font-size: 20px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

label.field { display: block; }
label.field > span, .field-label { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--hl-brown); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: 44px; padding: 11px 14px; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-md); background: #fff; color: var(--hl-gray-700);
}
input:focus, select:focus, textarea:focus { border-color: var(--hl-brown); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--hl-red); outline-offset: 1px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2373341d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
textarea { min-height: 76px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* Radio (DS): brown ring, red dot */
.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-md); cursor: pointer; background: #fff; }
.choice input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 3px solid var(--hl-brown); border-radius: 50%; background: #fff; display: grid; place-items: center;
}
.choice input[type="radio"]::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--hl-red); transform: scale(0); transition: transform var(--dur-fast) var(--ease-bounce); }
.choice input[type="radio"]:checked::after { transform: scale(1); }
.choice label:has(input:checked) { border-color: var(--hl-brown); background: var(--hl-yellow-100); }

/* ---------- audit flow ---------- */
.audit-head { position: sticky; top: 67px; z-index: 15; background: var(--hl-cream); padding: 10px 0 8px; margin: -20px 0 10px; border-bottom: 2px solid var(--hl-gray-300); }
.audit-head strong { font-family: var(--font-display); color: var(--hl-brown); font-size: 18px; }
.score-pill { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--hl-yellow); color: var(--hl-brown); border: 2px solid var(--hl-brown); border-radius: var(--radius-pill); padding: 3px 12px; font-size: 14px; }
.steps { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step-chip {
  flex: none; display: flex; align-items: center; gap: 6px; border: 2px solid var(--hl-gray-300); background: #fff; border-radius: var(--radius-pill);
  padding: 6px 14px; font-size: 14px; font-weight: 700; color: var(--hl-gray-700); cursor: pointer; white-space: nowrap;
}
.step-chip:hover { background: var(--hl-gray-100); }
.step-chip[aria-current="step"] { background: var(--hl-yellow); border-color: var(--hl-brown); color: var(--hl-brown); }
.step-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hl-gray-300); }
.step-chip.done .dot { background: var(--hl-success); }
.step-chip.issue .dot { background: var(--hl-red); }

.item { background: #fff; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-lg); padding: 16px; scroll-margin-top: 170px; transition: border-color var(--dur-med) var(--ease-out); }
.item + .item { margin-top: 12px; }
.item.is-pass { border-color: #b7d8ad; }
.item.is-fail { border-color: var(--hl-red); background: #fffafa; }
.item.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 5px var(--hl-yellow); } to { box-shadow: none; } }
.item-top { display: flex; gap: 10px; align-items: flex-start; }
.item-id { flex: none; font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--hl-brown); background: var(--hl-gray-100); border-radius: var(--radius-sm); padding: 2px 8px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.item-text { flex: 1; font-weight: 600; color: var(--hl-gray-700); }
.item-pts { flex: none; font-size: 12px; color: var(--hl-gray-500); margin-top: 3px; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-size: 13px; font-weight: 700; border-radius: var(--radius-pill); border: 2px solid; padding: 1px 10px; margin-top: 8px; line-height: 1.5; }
.tag.proof { background: var(--hl-yellow-100); border-color: var(--hl-yellow-600); color: var(--hl-brown); }
.tag.need { background: var(--hl-red-100); border-color: var(--hl-red); color: var(--hl-red-600); }

.scores { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.score-btn {
  flex: 1; min-width: 72px; min-height: 52px; border-radius: var(--radius-md); border: 2px solid var(--hl-gray-300); background: #fff; cursor: pointer;
  font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--hl-gray-700);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  transition: transform var(--dur-fast) var(--ease-bounce), background var(--dur-fast) ease;
}
.score-btn:hover { background: var(--hl-gray-100); }
.score-btn:active { transform: scale(.96); }
.score-btn small { font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--hl-gray-500); }
.score-btn[aria-pressed="true"].pass { background: var(--hl-success); border-color: #3d7e30; color: #fff; }
.score-btn[aria-pressed="true"].fail { background: var(--hl-red); border-color: var(--hl-red-600); color: #fff; }
.score-btn[aria-pressed="true"].mid { background: var(--hl-yellow); border-color: var(--hl-brown); color: var(--hl-brown); }
.score-btn[aria-pressed="true"] small { color: inherit; opacity: .85; }

.parts { margin-top: 12px; display: grid; gap: 8px; }
.part { display: flex; align-items: center; gap: 8px; }
.part > span { flex: 1; font-size: 14px; font-weight: 700; }
.part .score-btn { flex: none; min-width: 70px; min-height: 42px; font-size: 15px; }

.evidence { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.thumb { position: relative; width: 66px; height: 66px; border-radius: var(--radius-md); overflow: hidden; background: var(--hl-gray-100); border: 2px solid var(--hl-brown); padding: 0; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .state { position: absolute; right: 3px; bottom: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: var(--hl-yellow-600); }
.thumb .state.done { background: var(--hl-success); }
.thumb .state.error { background: var(--hl-red); }
.cam-btn {
  width: 66px; height: 66px; border-radius: var(--radius-md); border: 2px dashed var(--hl-brown-300); background: var(--hl-cream-2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--hl-brown); gap: 2px;
}
.cam-btn:hover { background: var(--hl-yellow-100); }
.cam-btn.required { border: 2px solid var(--hl-red); color: var(--hl-red-600); background: var(--hl-red-100); }
.cam-btn svg { width: 22px; height: 22px; }
.note-toggle { font-family: var(--font-display); font-size: 14px; font-weight: 700; background: none; border: 0; color: var(--hl-brown-500); cursor: pointer; padding: 6px 4px; }
.note-toggle:hover { color: var(--hl-red); }
.note { margin-top: 10px; }
.note textarea { min-height: 62px; }

.section-intro { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; flex-wrap: wrap; }
.section-intro h1 { margin: 0; }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 253, 245, .97); backdrop-filter: blur(6px);
  border-top: 2px solid var(--hl-gray-300); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bottombar .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.bottombar .btn { flex: 1; }
.upload-status { font-size: 12px; color: var(--hl-gray-500); text-align: center; margin-top: 4px; }

.sig-wrap { position: relative; border: 2px dashed var(--hl-brown-300); border-radius: var(--radius-md); background: #fff; touch-action: none; }
.sig-wrap canvas { width: 100%; height: 180px; display: block; }
.sig-wrap .hint { position: absolute; inset: auto 0 10px; text-align: center; font-size: 13px; color: var(--hl-gray-500); pointer-events: none; }
.sig-img { background: #fff; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-md); }

/* check-in, timer, staff lists */
.checkin { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.checkin-line { font-weight: 700; font-size: 14px; border-radius: var(--radius-md); padding: 8px 12px; border: 2px solid var(--hl-gray-300); background: var(--hl-gray-100); }
.checkin-line.ok { background: var(--hl-success-100); border-color: var(--hl-success); color: #36702a; }
.checkin-line.warn { background: var(--hl-yellow-100); border-color: var(--hl-yellow-600); color: var(--hl-brown); }
.checkin-line.bad { background: var(--hl-red-100); border-color: var(--hl-red); color: var(--hl-red-600); }
.checkin-line.muted { color: var(--hl-gray-500); font-weight: 600; }
.checkin-report { display: flex; gap: 14px; align-items: flex-start; }
.score-btn.na { flex: 0 1 auto; min-width: 96px; }
.score-btn[aria-pressed="true"].na { background: var(--hl-gray-700); border-color: var(--hl-gray-700); color: #fff; }
.item.is-na { border-color: var(--hl-gray-300); background: var(--hl-gray-100); }
.timer-card { border-color: var(--hl-yellow-600); }
.timer-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.timer-row input { flex: 1; min-width: 0; }
.timer-time { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--hl-brown); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.timer-time.running { color: var(--hl-red); }
.timer-row .btn { flex: none; min-width: 72px; }
.timer-row .btn.ghost { min-width: 0; padding: 8px 10px; }
.timing-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 2px solid var(--hl-gray-100); }
.timing-line:first-child { border-top: 0; }
.timing-line strong { font-family: var(--font-display); color: var(--hl-brown); font-variant-numeric: tabular-nums; }
.staff-role + .staff-role { margin-top: 14px; }
.staff-name { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.staff-name .btn.ghost { padding: 8px 10px; }
.status-NA { background: var(--hl-gray-100); border-color: var(--hl-gray-300); color: var(--hl-gray-700); }

.problem-list { list-style: none; margin: 0; padding: 0; }
.problem-list li { border-top: 2px solid var(--hl-gray-100); }
.problem-list button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 0; cursor: pointer; display: flex; gap: 10px; color: var(--hl-gray-700); }
.problem-list button:hover { color: var(--hl-brown); }
.problem-list .what { color: var(--hl-red-600); font-size: 13px; font-weight: 700; }

/* ---------- scores, grades, badges ---------- */
.grade { display: inline-grid; place-items: center; min-width: 32px; height: 28px; padding: 0 10px; border-radius: var(--radius-pill); border: 2px solid; font-family: var(--font-display); font-weight: 800; font-size: 14px; line-height: 1; }
.grade-A { background: var(--hl-success); border-color: #3d7e30; color: #fff; }
.grade-B { background: var(--hl-yellow); border-color: var(--hl-brown); color: var(--hl-brown); }
.grade-C { background: var(--hl-yellow-100); border-color: var(--hl-yellow-600); color: var(--hl-brown); }
.grade-D { background: var(--hl-brown-100); border-color: var(--hl-brown-300); color: var(--hl-brown); }
.grade-Below { background: var(--hl-red); border-color: var(--hl-red-600); color: #fff; }
.big-score { display: flex; align-items: center; gap: 16px; }
.big-score .num { font-family: var(--font-display); font-size: 52px; font-weight: 800; line-height: 1; color: var(--hl-brown); font-variant-numeric: tabular-nums; }
.big-score .num .of { font-size: 22px; color: var(--hl-gray-500); font-weight: 700; }
.big-score .grade { font-size: 24px; height: 46px; min-width: 56px; border-width: 3px; }
.bars { display: grid; gap: 10px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 64px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.bar { height: 12px; background: var(--hl-gray-100); border-radius: var(--radius-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--hl-brown); border-radius: var(--radius-pill); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--hl-gray-700); }

.status { display: inline-block; font-family: var(--font-display); font-size: 13px; font-weight: 700; padding: 1px 10px; border-radius: var(--radius-pill); border: 2px solid; line-height: 1.5; white-space: nowrap; }
.status-Open, .status-Fail { background: var(--hl-red-100); border-color: var(--hl-red); color: var(--hl-red-600); }
.status-In { background: var(--hl-yellow-100); border-color: var(--hl-yellow-600); color: var(--hl-brown); }
.status-Resolved, .status-Pass { background: var(--hl-success-100); border-color: var(--hl-success); color: #36702a; }

/* ---------- admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 14px 0; }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: #fff; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi.brand { background: var(--hl-yellow); border: var(--outline-brand); }
.kpi .label { font-family: var(--font-display); font-size: 14px; color: var(--hl-brown); font-weight: 700; }
.kpi .value { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--hl-brown); line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .sub { font-size: 12px; color: var(--hl-gray-500); }
.kpi.brand .sub { color: var(--hl-brown); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 10px 0 14px; }
.filters label.field { min-width: 150px; flex: 1; }
.filters label.field > span { font-size: 13px; }
.filters select, .filters input { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }

.table-wrap { background: #fff; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-lg); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 2px solid var(--hl-gray-100); vertical-align: middle; white-space: nowrap; }
th { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--hl-brown); background: var(--hl-cream-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td strong { font-family: var(--font-display); color: var(--hl-brown); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--hl-yellow-100); }
tr:last-child td { border-bottom: 0; }
.stale { color: var(--hl-red-600); font-weight: 700; }
.table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: inherit; }
.table-wrap tbody td:first-child { background: #fff; }
.table-wrap thead th:first-child { z-index: 2; background: var(--hl-cream-2); }
tbody tr.clickable:hover td:first-child { background: var(--hl-yellow-100); }
.kpi .sub a, .finding .row a { display: inline-block; padding: 6px 0; }
td.wrap-name { white-space: normal; min-width: 120px; max-width: 200px; }
table.dense th, table.dense td { padding: 10px 10px; }
.name-input { min-height: 36px !important; padding: 6px 10px !important; min-width: 300px; }
.role-select { min-height: 36px !important; padding: 6px 38px 6px 12px !important; width: auto !important; background-position: right 10px center !important; }
td.wrap-email { white-space: normal; word-break: break-all; min-width: 160px; }
.team-table td.num { white-space: nowrap; }
@media (max-width: 900px) { .name-input { min-width: 170px; } }
td.low { color: var(--hl-red-600); font-weight: 700; }
.store-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.store-chip { font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: var(--radius-pill); background: var(--hl-gray-100); border: 2px solid var(--hl-gray-300); color: var(--hl-gray-700); }

.finding { display: grid; grid-template-columns: 100px 1fr; gap: 16px; }
.finding .ph { width: 100px; height: 100px; border-radius: var(--radius-md); overflow: hidden; background: var(--hl-cream-2); display: grid; place-items: center; color: var(--hl-gray-500); font-size: 12px; text-align: center; border: 2px solid var(--hl-gray-300); padding: 0; cursor: pointer; }
.finding .ph img { width: 100%; height: 100%; object-fit: cover; }
.finding .ph:disabled { cursor: default; }
@media (max-width: 520px) { .finding { grid-template-columns: 72px 1fr; } .finding .ph { width: 72px; height: 72px; } }

.report-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; padding: 12px 0; border-top: 2px solid var(--hl-gray-100); }
.report-item:first-child { border-top: 0; }
.report-item > .item-id, .report-item > .status, .report-item > .num { align-self: start; justify-self: start; }
.report-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.report-photos button { width: 86px; height: 86px; border-radius: var(--radius-md); overflow: hidden; border: 2px solid var(--hl-brown); padding: 0; cursor: pointer; background: var(--hl-gray-100); }
.report-photos img { width: 100%; height: 100%; object-fit: cover; }
details.sec { background: #fff; border: 2px solid var(--hl-gray-300); border-radius: var(--radius-lg); padding: 0 18px; }
details.sec + details.sec { margin-top: 10px; }
details.sec summary { cursor: pointer; padding: 14px 0; font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--hl-brown); display: flex; gap: 10px; align-items: center; list-style: none; }
details.sec summary::-webkit-details-marker { display: none; }
details.sec summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 3px solid var(--hl-brown); border-bottom: 3px solid var(--hl-brown); transform: rotate(45deg); transition: transform var(--dur-med) var(--ease-out); }
details.sec[open] summary::after { transform: rotate(-135deg); }
details.sec[open] { padding-bottom: 8px; }

/* Tag (filter chip) */
.tabs { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.tabs button { border: 2px solid var(--hl-gray-300); background: #fff; color: var(--hl-gray-700); border-radius: var(--radius-pill); padding: 7px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.tabs button:hover { background: var(--hl-gray-100); }
.tabs button[aria-pressed="true"] { background: var(--hl-yellow); border-color: var(--hl-brown); color: var(--hl-brown); }

/* ---------- dialog, toast, lightbox ---------- */
.dialog-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(115, 52, 29, .45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade var(--dur-med) var(--ease-out); }
.dialog { background: #fff; border-radius: var(--radius-lg); border: var(--outline-brand); box-shadow: var(--shadow-pop); padding: 26px; max-width: 440px; width: 100%; animation: pop var(--dur-med) var(--ease-bounce); }
.dialog h2 { margin: 0 0 8px; font-size: 26px; }
.dialog .body { font-size: 16px; line-height: 1.55; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(40, 18, 10, .9); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 86vh; max-width: 100%; border-radius: var(--radius-md); border: 3px solid var(--hl-yellow); }
.lightbox .close { position: absolute; top: 14px; right: 14px; background: var(--hl-yellow); }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 200; background: var(--hl-yellow); color: var(--hl-brown);
  border: var(--outline-brand); padding: 11px 20px; border-radius: var(--radius-pill); font-family: var(--font-display); font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow-pop); max-width: calc(100% - 32px);
}
.toast.error { background: var(--hl-red); border-color: var(--hl-red-600); color: #fff; }
.empty { text-align: center; padding: 32px 16px; color: var(--hl-gray-500); }
.alert { border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px; font-weight: 600; border: 2px solid; }
.alert.error { background: var(--hl-red-100); border-color: var(--hl-red); color: var(--hl-red-600); }
.alert.warn { background: var(--hl-yellow-100); border-color: var(--hl-yellow-600); color: var(--hl-brown); }
.alert.ok { background: var(--hl-success-100); border-color: var(--hl-success); color: #36702a; }
.spinner { width: 26px; height: 26px; border: 4px solid var(--hl-gray-100); border-top-color: var(--hl-brown); border-radius: 50%; animation: spin .8s linear infinite; margin: 28px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sign-in ---------- */
body.signin { background: var(--hl-yellow); }
body.signin .topbar { display: none; }
.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card { max-width: 400px; width: 100%; text-align: center; background: #fff; border: var(--outline-brand); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 28px 24px; }
.signin-card .logo { height: 44px; width: auto; margin: 0 auto 14px; }
.signin-card h1 { font-size: 26px; margin: 4px 0 6px; }
#gsi-button { display: flex; justify-content: center; margin: 20px 0 8px; min-height: 44px; }

.done-card { text-align: center; margin-top: 24px; }
.done-card .mascot { width: 150px; margin: 0 auto 12px; border-radius: var(--radius-md); }

@media (max-width: 1100px) { .hide-md { display: none; } }

@media (max-width: 640px) {
  h1 { font-size: 28px; }
  .topbar { position: static; flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; min-height: 0; }
  .topbar .brand img { height: 30px; }
  .signout { order: 1; margin-left: auto; padding: 5px 12px; font-size: 13px; }
  .topbar nav { order: 2; margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a, .topbar nav button { padding: 8px 14px; font-size: 14px; flex: 1; text-align: center; }
  .audit-head { top: 0; }
  main.wide { padding-left: 16px; padding-right: 16px; }
  .bar-row { grid-template-columns: 96px 1fr 56px; }
  .hide-sm { display: none; }
  table.dense th, table.dense td { padding: 9px 8px; }
  .nowrap-sm { display: block; }
  .timer-row { flex-wrap: wrap; padding-bottom: 10px; border-bottom: 2px solid var(--hl-gray-100); }
  .timer-row input { flex: 1 1 100%; }
  .timer-row .timer-time { flex: 1; text-align: left; }
  .checkin-report { flex-direction: column; }
}

@media print {
  .topbar, .bottombar, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card, details.sec, .table-wrap { break-inside: avoid; }
  .report-photos button { width: 110px; height: 110px; }
}
.loc-cell { display: flex; gap: 8px; align-items: center; }
.loc-cell input { min-width: 200px; min-height: 36px; padding: 6px 10px; }
.radius-input { width: 90px !important; min-height: 36px !important; padding: 6px 8px !important; text-align: right; }
.store-table td.num { white-space: nowrap; }
.store-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; max-height: 50vh; overflow-y: auto; padding: 4px 2px; }
.store-picks label { display: flex; gap: 8px; align-items: center; font-weight: 600; min-height: 36px; }
.store-picks input { width: 20px; height: 20px; accent-color: var(--hl-brown); }
.stores-btn { margin-left: 6px; }
/* store page, findings review, trend */
.fix-card + .fix-card { margin-top: 12px; }
.fix-form summary { list-style: none; display: inline-flex; margin-top: 10px; }
.fix-form summary::-webkit-details-marker { display: none; }
.fix-form[open] summary { display: none; }
.fix-block { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--hl-success-100); border: 2px solid var(--hl-success); }
.finding.is-overdue { border-color: var(--hl-red); }
.status-Staff { background: var(--hl-brown-100); border-color: var(--hl-brown-300); color: var(--hl-brown); }
.status-Awaiting { background: var(--hl-yellow-100); border-color: var(--hl-yellow-600); color: var(--hl-brown); }
.due-field { display: flex; flex-direction: column; gap: 2px; }
.due-field input { min-height: 36px; padding: 6px 8px; width: 150px; }
.kpi.alert-kpi { border-color: var(--hl-red); }
.kpi.alert-kpi .value { color: var(--hl-red-600); }
a.store-chip { text-decoration: none; }
a.store-chip:hover { background: var(--hl-yellow-100); border-color: var(--hl-brown); }
.trend-chart { width: 100%; height: auto; display: block; }
.trend-chart text { font: 11px var(--font-body); fill: var(--hl-gray-500); }
.trend-chart .grid { stroke: var(--hl-gray-100); stroke-width: 1; }
.trend-chart .grid-a { stroke: var(--hl-success); stroke-dasharray: 4 4; }
.trend-chart .grid-c { stroke: var(--hl-yellow-600); stroke-dasharray: 4 4; }
.trend-chart .line { fill: none; stroke: var(--hl-brown); stroke-width: 3; stroke-linejoin: round; }
.trend-chart .dot { stroke: var(--hl-brown); stroke-width: 2.5; fill: #fff; cursor: pointer; }
.trend-chart .dot-A { fill: var(--hl-success); }
.trend-chart .dot-B { fill: var(--hl-yellow); }
.trend-chart .dot-C { fill: var(--hl-yellow-100); }
.trend-chart .dot-D { fill: var(--hl-brown-100); }
.trend-chart .dot-Below { fill: var(--hl-red); }
.emails-input { min-height: 36px !important; padding: 6px 10px !important; min-width: 220px; }
.qr-print { text-align: center; margin-top: 14px; }
.qr-print .qr { display: inline-block; padding: 10px; background: #fff; border: 3px solid var(--hl-brown); border-radius: var(--radius-md); margin: 8px 0; }
.qr-print .qr img, .qr-print .qr canvas { display: block; }
.qr-name { font-family: var(--font-display); font-weight: 800; color: var(--hl-brown); font-size: 18px; }
.btn.danger-text { color: var(--hl-red-600); }

.status-Repeat { background: var(--hl-red); border-color: var(--hl-red-600); color: #fff; }
.assign-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 2px solid var(--hl-gray-100); }
.assign-row:first-child { border-top: 0; padding-top: 0; }
