/* Comp Shop Utility — Marquee Brands */
:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-deep: #1c5cab;
  --accent-soft: #cde2fb;
  --navy: #101c33;
  --good: #0ca30c;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ------- chrome ------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-logo { height: 18px; width: auto; display: block; }
nav { display: flex; gap: 6px; }
.nav-link {
  color: #d7dce6; text-decoration: none; font-size: 14px;
  padding: 7px 12px; border-radius: 7px;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
/* Signed-in user's name in the top bar (B6): aligned with the nav links and
   visually separated from them instead of floating unstyled. */
nav { align-items: center; }
.nav-user {
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 7px 12px 7px 16px; margin-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}

.container { max-width: 880px; margin: 0 auto; padding: 36px 24px 80px; width: 100%; }
.container.wide { max-width: 1080px; }

/* ------- mobile chrome: hamburger nav (≤700px) ------- */
.nav-toggle { display: none; }
@media (max-width: 700px) {
  .topbar { position: relative; padding: 12px 14px; }
  .brand-logo { height: 13px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    background: none; border: 0; cursor: pointer; padding: 8px;
  }
  .nav-toggle .bar {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: #fff; transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  nav { display: none; }
  nav.open {
    display: flex; flex-direction: column; gap: 2px; align-items: stretch;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--navy); padding: 4px 10px 14px;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.3);
  }
  nav.open .nav-link { font-size: 15px; padding: 12px 10px; text-align: left; }
  nav.open .nav-user { text-align: left; }
  nav.open .nav-user {
    font-size: 13.5px; margin: 6px 0 0; padding: 12px 10px 2px;
    border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.18); opacity: 0.85;
  }
  .container { padding: 20px 14px 60px; }
  h1 { font-size: 22px; }
  .pv-header .iv-meta { font-size: 13.5px; }
  .pv-header .sub { font-size: 14px; }
}

/* Interview page fills the viewport height below the topbar; the chat list
   scrolls internally instead of the whole page scrolling. */
body.iv-mode { height: 100vh; height: 100dvh; overflow: hidden; }
.container.iv-page {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  padding-top: 20px; padding-bottom: 14px;
}

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.3px; }
h2 { font-size: 17px; margin: 30px 0 10px; }
.sub { color: var(--ink-2); margin: 0 0 26px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

/* ------- forms ------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 5px; }
input[type=text], input[type=password], input[type=email],
input[type=date], input[type=month], textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--hairline); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,
input[type=date]:focus, input[type=month]:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
/* Date pickers: keep the browser's calendar affordance compact and aligned. */
input[type=date], input[type=month] { -webkit-appearance: none; appearance: none; min-height: 44px; }
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 650; font-size: 15px;
  padding: 12px 22px; border-radius: 8px; margin-top: 22px;
  text-decoration: none;
}
.btn:hover { background: var(--accent-deep); }
.btn.secondary { background: transparent; color: var(--accent-deep); border: 1px solid var(--hairline); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ------- login (standalone page, no app chrome) ------- */
body.login-page {
  align-items: center; justify-content: center;
  background: var(--navy);
  background: radial-gradient(circle at 50% 0%, #16264a 0%, var(--navy) 65%);
}
.login-shell { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 32px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.login-brand { display: flex; align-items: center; gap: 10px; }
/* B6: white Marquee wordmark above the card, on the navy background. */
.login-logo { display: block; margin: 0 auto 20px; height: 20px; width: auto; }
.login-title { font-weight: 650; font-size: 18px; letter-spacing: 0.2px; color: var(--ink); }
.login-card .sub { margin: 8px 0 20px; }
.login-error { color: #d03b3b; font-size: 13.5px; margin-top: 10px; }
.login-card .btn { width: 100%; text-align: center; }

.mode-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 18px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex-shrink: 0; }
.dot.off { background: var(--muted); }
.dot.warn { background: #fab219; }

.ai-warn {
  display: none; align-items: flex-start; gap: 8px;
  background: #fdf3dc; border: 1px solid #f0d9a0; color: #6b5410;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.ai-warn.show { display: flex; }

/* ------- interview ------- */
.iv-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 16px; flex-wrap: wrap;
  flex: 0 0 auto;
}
.iv-meta { font-size: 14px; color: var(--ink-2); }
.iv-meta strong { color: var(--ink); }

/* Completeness meter replaces the old topic-coverage pills / countdown timer.
   Kept deliberately compact (fixed narrow width, single-line reasoning) so it
   never eats into the full-height chat layout below. */
.completeness-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.completeness-meter { width: 230px; }
.cm-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.cm-value { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cm-flourish { font-size: 11.5px; font-weight: 700; color: #b8860b; letter-spacing: 0.2px; }
.cm-track {
  position: relative; height: 8px; border-radius: 999px;
  background: var(--hairline); overflow: visible;
}
.cm-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px;
  width: 0%; background: #8b9db3;
  transition: width 0.4s ease, background-color 0.4s ease;
}
.cm-fill.zone-start { background: #8b9db3; }
.cm-fill.zone-building { background: #e0a83a; }
.cm-fill.zone-ready { background: #34a853; }
.cm-fill.zone-exceptional { background: linear-gradient(90deg, #1f8b3b, #c9a227); }
.cm-notch {
  position: absolute; left: 66.667%; top: -3px; bottom: -3px;  /* 100 on the 0-150 scale */
  width: 2px; background: var(--ink); opacity: 0.5; border-radius: 1px;
}
.cm-reasoning {
  font-size: 11.5px; color: var(--muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px;
}

/* Submit button: muted below the 80% ready mark, primary/green at or above it. */
#submit-btn { margin-top: 0; transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
#submit-btn.ready { background: var(--good); color: #fff; border-color: var(--good); }
#submit-btn.ready:hover { background: #0a8a0a; }

.chat {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 4px 2px 12px;
}
.bubble { max-width: 84%; padding: 13px 16px; border-radius: 14px; }
.bubble.q {
  align-self: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.bubble.a {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble.a.skipped {
  background: transparent; color: var(--muted); font-style: italic;
  border: 1px dashed var(--border); padding: 8px 14px; font-size: 13px;
}

/* Version footer: hidden during the interview so the chat gets full height. */
.v-footer { text-align: center; color: #b3b1aa; font-size: 11.5px; margin-top: 40px; }
body.iv-mode .v-footer { display: none; }
.bubble .area-tag {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--accent-deep); margin-bottom: 4px;
}
.bubble.system {
  align-self: center; background: transparent; color: var(--muted);
  font-size: 13px; font-style: italic; border: 0; padding: 4px 10px; max-width: 100%;
  text-align: center;
}

/* Typing indicator shown while a question is being generated. */
.bubble.q.typing { display: flex; align-items: center; padding: 15px 18px; }
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typing-bounce 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.answer-box { margin-top: 14px; flex: 0 0 auto; }
.answer-box textarea { min-height: 84px; resize: vertical; }
.answer-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.answer-actions .btn { margin-top: 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin-left: auto; }

.overlay {
  position: fixed; inset: 0; background: rgba(16, 28, 51, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.overlay.show { display: flex; }
.overlay .panel {
  background: #fff; border-radius: 14px; padding: 36px 44px; text-align: center;
  max-width: 420px;
}
.spinner {
  width: 34px; height: 34px; margin: 0 auto 16px;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------- report ------- */
/* B18: prominent banner on a report generated by the no-AI template
   fallback — distinct from the small "Template report" label in rpt-meta,
   which QA found easy to miss on a report full of raw, unedited answers. */
.tpl-fallback-banner {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fdf3dc; border: 1px solid #f0d9a0; color: #6b5410;
  border-radius: 8px; padding: 12px 16px; margin: 0 0 22px;
  font-size: 13.5px; font-weight: 600; line-height: 1.4;
}
.report-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.report {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 44px 50px;
}
.report .rpt-head { border-bottom: 3px solid var(--navy); padding-bottom: 16px; margin-bottom: 24px; }
.report .rpt-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 4px;
}
.report h1 { font-size: 24px; margin: 0; }
.report .rpt-meta { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.report h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent-deep); margin: 26px 0 8px;
  border-bottom: 1px solid var(--hairline); padding-bottom: 5px;
}
.report p, .report li { font-size: 14.5px; }
.report ul { margin: 6px 0; padding-left: 20px; }

.wl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wl h3 { font-size: 13.5px; margin: 8px 0 6px; }
.wl.win h3 { color: var(--good); }
.wl.lose h3 { color: #d03b3b; }
.wl ul { list-style: none; padding: 0; margin: 0; }
.wl li { padding: 7px 0; border-bottom: 1px dashed var(--hairline); }
.wl li strong { display: block; }
.wl li span { color: var(--ink-2); font-size: 13.5px; }

.opp {
  border: 1px solid var(--hairline); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 14px 16px; margin: 10px 0;
  page-break-inside: avoid;
}
.opp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.opp-title { font-weight: 700; font-size: 14.5px; }
.opp p { margin: 6px 0 4px; }
.opp .brands { font-size: 13px; color: var(--ink-2); }
.score { white-space: nowrap; font-size: 13px; letter-spacing: 2px; color: var(--accent); }
.scope-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 2px 8px; border-radius: 999px; margin-left: 8px;
  vertical-align: 2px;
}
.scope-tag.marquee { background: var(--accent-soft); color: var(--accent-deep); }
.scope-tag.market { background: #eceae4; color: var(--ink-2); }
.score .off { color: var(--hairline); }
blockquote {
  margin: 8px 0; padding: 8px 16px; border-left: 3px solid var(--accent-soft);
  color: var(--ink-2); font-style: italic; font-size: 14px;
}

@media print {
  .topbar, .report-actions, nav { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: none; }
  .report { border: 0; padding: 10px 6px; }
}

/* ------- dashboard ------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } .wl-grid { grid-template-columns: 1fr; } }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.tile .t-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.tile .t-value { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; }
.tile .t-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

.viz-root { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.viz-title { font-size: 14px; font-weight: 650; margin: 0 0 14px; }
.barlist { display: flex; flex-direction: column; gap: 10px; }
.barrow { display: grid; grid-template-columns: 150px 1fr 46px; align-items: center; gap: 12px; font-size: 13.5px; }
.barrow .b-label { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bartrack { position: relative; height: 18px; }
.barfill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent); border-radius: 0 4px 4px 0; min-width: 3px;
}
.barrow .b-val { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.barrow:hover .barfill { background: var(--accent-deep); }

/* B16: at small widths, wrap a `table.data` in a `.table-scroll` div so the
   table scrolls horizontally inside its own container instead of forcing
   the whole page to scroll sideways. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table.data { min-width: 100%; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--hairline);
  background: var(--page);
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data a { color: var(--accent-deep); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.group-badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 2px 7px; border-radius: 999px; margin-left: 6px;
  background: var(--accent-soft); color: var(--accent-deep); vertical-align: 1px;
}
.photo-count-link { color: var(--muted); }
.photo-count-link:hover { color: var(--accent-deep); }

/* ------- team photos QR modal (interview page) ------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 28, 51, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-panel {
  background: #fff; border-radius: 14px; padding: 30px 32px; max-width: 360px; width: 100%;
  position: relative; text-align: center;
}
.modal-close {
  position: absolute; top: 10px; right: 14px; border: 0; background: none;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px;
}
.modal-panel h3 { margin: 0 0 6px; font-size: 17px; }
.modal-panel .sub { margin: 0 0 6px; font-size: 13.5px; }
#qr-holder { display: flex; justify-content: center; align-items: center; margin: 16px 0; min-height: 176px; }
.photo-link-row { display: flex; gap: 8px; margin-top: 4px; }
.photo-link-row input {
  flex: 1; padding: 9px 10px; border: 1px solid var(--hairline); border-radius: 8px;
  font-size: 12.5px; background: var(--page); color: var(--ink-2);
}
.photo-link-row .btn { margin-top: 0; padding: 9px 14px; font-size: 13px; white-space: nowrap; }
#photo-link-open { display: block; width: 100%; text-align: center; margin-top: 14px; box-sizing: border-box; }

/* ------- team photos upload page (mobile-first) ------- */
body.photo-mode .container { max-width: 640px; }
.pv-header { margin-bottom: 18px; }
.pv-header .sub { margin: 6px 0 0; }
.drop-zone {
  border: 2px dashed var(--hairline); border-radius: var(--radius);
  padding: 34px 18px; text-align: center; color: var(--ink-2); font-weight: 600;
  background: var(--surface); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
}
.drop-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input[type=file] { display: none; }

.upload-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; }
.upload-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.upload-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--hairline); }
.upload-progress-track { flex: 1; height: 6px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.2s ease; }
.upload-item.error .upload-progress-fill { background: #d03b3b; }
.upload-item .u-status { font-size: 11.5px; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.upload-item.error .u-status { color: #d03b3b; }
/* Upload (not analysis) failures can be retried by tapping the row — see
   failItem()/the row click handler in photos.html, shop_photos.html, and
   upload.html. A visible badge (not just the title="" tooltip, which touch
   screens can't hover) is what actually cues phone users to tap. */
.upload-item.retryable { cursor: pointer; }
.upload-item .u-retry-hint { display: none; font-size: 11px; font-weight: 600; color: #d03b3b; flex-shrink: 0; white-space: nowrap; }
.upload-item.retryable .u-retry-hint { display: inline; }

.photo-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; margin-top: 12px;
}
.photo-card-wrap { display: flex; flex-direction: column; gap: 5px; }
.photo-card { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--hairline); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-chip {
  position: absolute; bottom: 5px; left: 5px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 7px; border-radius: 999px;
  color: #fff; background: var(--muted);
}
.photo-chip.pending, .photo-chip.analyzing { background: #e0a83a; }
.photo-chip.analyzed { background: var(--good); }
.photo-chip.failed { background: #d03b3b; }
.pc-caption { font-size: 11.5px; color: var(--ink-2); margin: 0; line-height: 1.35; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Admin-only delete affordances (library cards, report rows). */
.lib-delete-form { margin-top: 6px; }
.lib-delete-btn, .row-delete-btn {
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 12px; color: #b02a2a; padding: 2px 0; text-decoration: underline;
}
.lib-delete-btn:hover, .row-delete-btn:hover { color: #7d1d1d; }

/* B7: admin tabs. */
.admin-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--hairline);
  margin: 4px 0 26px;
}
.admin-tab-btn {
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab-btn:hover { color: var(--ink); }
.admin-tab-btn.active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.admin-tab > h2:first-child { margin-top: 6px; }

/* B4: date-range inputs in the photo library filter bar. */
.lib-date-range { display: inline-flex; align-items: center; gap: 6px; }
.lib-date-range label { font-size: 13px; color: var(--ink-2); margin: 0; }
.lib-date-range input[type="date"] { width: auto; }
/* B16: at small widths the From/To pair no longer fits on one line — let it
   wrap instead of overflowing the page. */
@media (max-width: 480px) {
  .lib-date-range { flex-wrap: wrap; row-gap: 8px; }
}

/* B1: past (closed-out) comp shops on the home page. */
.past-shops-h2 { margin-top: 44px; }
.past-shops { display: flex; flex-direction: column; gap: 10px; }
.past-shop-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; text-decoration: none; color: inherit; padding: 14px 20px;
}
.past-shop-card:hover { border-color: var(--accent); }
.past-shop-link { color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* B10: note under a retailer input when the typed name isn't on the
   admin-approved list yet. */
.retailer-new-note {
  font-size: 12.5px; color: #b05c00; margin-top: 4px;
}

/* ------- shared brand/area chip ------- */
.chip {
  display: inline-block; font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep); text-decoration: none;
  border: 0; font-weight: 600; cursor: pointer;
}
a.chip:hover { background: var(--accent); color: #fff; }
.chip.removable { background: var(--hairline); color: var(--ink-2); }
.chip.removable:hover { background: #d03b3b; color: #fff; }
.chip.clear-all { background: transparent; border: 1px solid var(--hairline); color: var(--muted); }
.chip.clear-all:hover { background: var(--page); color: var(--ink); }

/* ------- report: photo gallery ------- */
.photo-summary { color: var(--ink-2); font-size: 13.5px; margin: 0 0 20px; }
.photo-section { margin-top: 28px; }
.photo-section .pg-heading {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent-deep); margin: 0 0 8px;
}
.photo-section .photo-summary { margin: 0 0 16px; }
.pg-group { margin: 0 0 20px; }
.pg-group h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent-deep); margin: 0 0 8px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.pg-card { display: flex; flex-direction: column; gap: 5px; }
.pg-thumb { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--hairline); }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-caption { font-size: 12px; color: var(--ink-2); margin: 0; line-height: 1.35; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ------- cross-visit photo library ------- */
.lib-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.lib-filters select {
  padding: 9px 12px; border: 1px solid var(--hairline); border-radius: 8px;
  font: inherit; font-size: 13.5px; background: #fff; color: var(--ink); min-width: 160px;
}
.lib-filters .btn { margin-top: 0; padding: 9px 16px; font-size: 13.5px; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.lib-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.lib-thumb { display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 1; background: var(--hairline); }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-caption { font-size: 13px; margin: 0; line-height: 1.35; }
.lib-meta { font-size: 11.5px; color: var(--muted); margin: 0; }
.lib-chips-row { display: flex; flex-wrap: wrap; gap: 4px; }
.lib-report-link { font-size: 12.5px; color: var(--accent-deep); text-decoration: none; margin-top: 2px; }
.lib-report-link:hover { text-decoration: underline; }

@media print {
  .no-print { display: none !important; }
}

/* ------- admin nav badge ------- */
.nav-link.admin-link { background: rgba(255,255,255,0.14); font-weight: 700; }

/* ------- home page: comp shop cards ------- */
.shop-cards { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; }
.shop-card { padding: 20px 22px; }
.shop-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shop-card-retailer { font-size: 17px; font-weight: 700; }
.shop-card-meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.shop-progress-chip {
  font-size: 12px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.shop-member-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.member-chip {
  font-size: 12px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--hairline);
  color: var(--ink-2); background: var(--surface);
}
.member-chip.status-submitted { background: #e6f6e6; border-color: #bfe6bf; color: #1c6b1c; }
.member-chip.status-in_progress { background: #fdf3dc; border-color: #f0d9a0; color: #6b5410; }
.member-chip.status-not_started { color: var(--muted); }
.shop-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.shop-card-actions .btn { margin-top: 0; }

.adhoc-link { margin: 20px 0 8px; }
.adhoc-link a { color: var(--muted); font-size: 13.5px; }
.adhoc-section { display: none; margin-top: 10px; }
.adhoc-section.show { display: block; }
h1.adhoc-h1 { font-size: 20px; }

/* ------- shop group page ------- */
.shop-head { border-bottom: 3px solid var(--navy); padding-bottom: 16px; margin-bottom: 24px; }
.shop-head .rpt-kicker { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 4px; }
.shop-head h1 { font-size: 24px; margin: 0; }
.shop-head .rpt-meta { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }

.member-status-table { width: 100%; border-collapse: collapse; margin: 14px 0 26px; }
.member-status-table td { padding: 10px 4px; border-bottom: 1px solid var(--hairline); font-size: 14px; vertical-align: middle; }
.member-status-table .ms-name { font-weight: 600; }
.status-pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.3px; }
.status-pill.submitted { background: #e6f6e6; color: #1c6b1c; }
.status-pill.in_progress { background: #fdf3dc; color: #6b5410; }
.status-pill.not_started { background: var(--hairline); color: var(--muted); }

.shop-report-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin: 18px 0; }
.shop-report-box .based-on { font-size: 13px; color: var(--ink-2); margin: 6px 0 14px; }
.shop-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.shop-actions .btn { margin-top: 0; }

/* ------- admin ------- */
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.admin-form-grid > div { grid-column: span 1; }
@media (max-width: 640px) { .admin-form-grid { grid-template-columns: 1fr; } }
textarea#members-text, textarea#add-members-text { min-height: 100px; font-family: ui-monospace, monospace; font-size: 13px; }
.user-checklist { max-height: 220px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px; margin-top: 6px; background: #fff; }
.user-checklist label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13.5px; color: var(--ink); margin: 6px 0; text-transform: none; }
.member-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--hairline); font-size: 14px; }
.member-row .remove-member { color: #d03b3b; font-size: 12.5px; cursor: pointer; background: none; border: 0; padding: 0; }
.status-toggle { display: inline-flex; gap: 8px; align-items: center; margin-left: 12px; }

/* ------- photo library header (Add photos button) ------- */
.lib-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lib-head .btn.secondary { margin-top: 4px; white-space: nowrap; }

/* ------- general image-library upload page (/upload) ------- */
.upload-meta-form {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px;
  margin-bottom: 18px;
}
.upload-meta-form label { margin: 0 0 5px; }
.upload-meta-form .hint { margin-left: 0; font-weight: 400; text-transform: none; }
@media (max-width: 640px) { .upload-meta-form { grid-template-columns: 1fr; } }
.ai-warn.retailer-warn { background: #fdecec; border-color: #f0b8b8; color: #9c2a2a; }

/* ------- shared image lightbox (static/lightbox.js) ------- */
body.lb-open { overflow: hidden; }
.lb-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(11, 11, 11, 0.92);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 34px 20px;
}
.lb-overlay.show { display: flex; }
.lb-stage { max-width: 90vw; max-height: 68vh; display: flex; align-items: center; justify-content: center; }
.lb-img { max-width: 90vw; max-height: 68vh; object-fit: contain; border-radius: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); display: block; }
.lb-info { max-width: 90vw; width: 560px; text-align: center; margin-top: 16px; color: #fff; }
.lb-caption { font-size: 14.5px; margin: 0 0 4px; }
.lb-meta { font-size: 12.5px; color: #c9c8c2; margin: 0 0 10px; }
.lb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 10px; }
.lb-chips span.chip { cursor: default; }
.lb-chips a.chip:hover { background: var(--accent); color: #fff; }
.lb-original { color: #cde2fb; font-size: 12.5px; text-decoration: none; }
.lb-original:hover { text-decoration: underline; }
.lb-close {
  position: absolute; top: 18px; right: 22px; border: 0; background: rgba(255, 255, 255, 0.12);
  color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.22); }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  border: 0; background: rgba(255, 255, 255, 0.12); color: #fff;
  width: 46px; height: 46px; border-radius: 50%; font-size: 24px; line-height: 1;
  cursor: pointer;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
@media (max-width: 640px) {
  .lb-nav { width: 40px; height: 40px; font-size: 20px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}
