/* Mystery Shopper. Platform pages use EDMA navy; tenant portals override the --brand/--accent variables. */
:root {
  --brand: #17163a; --brand-ink: #ffffff; --brand-deep: #100f2b; --brand-soft: #e8e8f0; --brand-line: #c5c5d8;
  --accent: #e4572e; --accent-ink: #ffffff; --accent-text: #b8401c;
  --paper: #f6f7fb; --card: #ffffff; --ink: #1a1a26; --muted: #5d5f73; --line: #dcdfea;
  --good: #1f8a4c; --bad: #c0392b; --warn: #b7791f;
  --head: "Inter", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 var(--body); }
h1, h2, h3, .head { font-family: var(--head); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--brand); }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(560px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* top bar */
.topbar { background: var(--brand); color: var(--brand-ink); }
.topbar .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.topbar a { color: inherit; text-decoration: none; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 1.15rem var(--head); letter-spacing: -.02em; }
.logo .tile { display: inline-flex; align-items: center; background: #fff; border-radius: 12px; padding: 5px 10px; box-shadow: 0 1px 3px rgb(0 0 0 / .18); }
.logo .tile img { max-height: 36px; max-width: 170px; display: block; mix-blend-mode: multiply; }  /* off-white logo backgrounds melt into the white tile */
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { padding: 8px 9px; border-radius: 8px; white-space: nowrap; font-size: .95rem; opacity: .9; }
.nav a:hover, .nav a[aria-current] { background: rgb(255 255 255 / .16); opacity: 1; }
.who { flex-shrink: 0; font-size: .9rem; white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.who button { background: none; border: 1px solid rgb(255 255 255 / .5); color: inherit; border-radius: 8px; padding: 5px 10px; font: inherit; cursor: pointer; }
main { padding: 28px 0 64px; min-height: 70vh; }
.pagehead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead h1 { font-size: 1.7rem; margin: 0; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 .95rem var(--head); padding: 10px 18px; border-radius: 9px; border: 2px solid var(--brand); background: var(--brand); color: var(--brand-ink); text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { background: var(--brand-deep); color: var(--brand-ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { filter: brightness(.92); color: var(--accent-ink); }
.btn.quiet { background: transparent; color: var(--brand); }
.btn.quiet:hover { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 5px 12px; min-height: 34px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 700; margin-bottom: 4px; }
input:not([type]), input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #b9bdd0; border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input[type=color] { width: 56px; height: 44px; padding: 2px; border: 1.5px solid #b9bdd0; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .875rem; color: var(--muted); margin-top: 3px; }
.field .err, .err { color: var(--bad); font-size: .9rem; font-weight: 700; margin-top: 4px; }
.has-err input, .has-err textarea, .has-err select { border-color: var(--bad); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 20px; height: 20px; }
.inline-form { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; }

/* surfaces */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; border-left: 5px solid var(--brand); background: var(--brand-soft); }
.flash.error { border-color: var(--bad); background: #fdecea; }
.flash.ok { border-color: var(--good); background: #e8f6ee; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font: 700 .85rem var(--head); color: var(--muted); background: #fafbfd; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: #eceef5; color: #3b3d52; }
.pill.ok { background: #dff3e7; color: #17653a; } .pill.warn { background: #fff1d6; color: #7a5200; } .pill.bad { background: #fbdcd8; color: #8f2217; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font: 800 1.9rem var(--head); }
.band { display: inline-block; padding: 3px 12px; border-radius: 6px; font: 700 .9rem var(--head); color: #fff; }
.bar { height: 8px; background: #e6e8f0; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; flex: none; }
.steps .done .dot { background: var(--good); border-color: var(--good); color: #fff; }

/* survey form */
.sec { margin-top: 28px; }
.sec > h2 { padding-bottom: 8px; border-bottom: 3px solid var(--brand); }
.q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.q-text { font-weight: 700; display: block; margin-bottom: 8px; }
.q-help { color: var(--muted); font-size: .9rem; margin: -4px 0 8px; }
.q .opt { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: 6px; }
.seg { display: inline-flex; border: 1.5px solid #b9bdd0; border-radius: 9px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg label { margin: 0; font-weight: 700; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 18px; min-height: 44px; min-width: 76px; text-align: center; cursor: pointer; border-right: 1.5px solid #b9bdd0; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); }
.seg .pos input:checked + span { background: var(--good); color: #fff; }
.seg .neg input:checked + span { background: var(--bad); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.scale { display: block; }
.scale .ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.scale .ends small:last-child { text-align: right; }
.scale .seg span { min-width: 44px; padding: 10px 0; }
.scale small { color: var(--muted); }
.choices { display: grid; gap: 6px; }
.choices label { font-weight: 400; display: flex; gap: 10px; align-items: center; min-height: 40px; }
.choices input { width: 20px; height: 20px; flex: none; }
.pct { display: flex; align-items: center; gap: 8px; max-width: 160px; }
.is-hidden { display: none !important; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 22px 0 14px; margin-top: 12px; }
.hp { position: absolute; left: -9999px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photos a { display: inline-block; cursor: zoom-in; }
.photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.result { display: grid; gap: 14px; }
.bigscore { font: 800 3rem var(--head); line-height: 1; }

/* builder */
.bsec { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); margin-bottom: 18px; }
.bsec > header { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--brand-soft); border-radius: var(--r) var(--r) 0 0; }
.bq { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.bq summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bq .qt { font-weight: 700; flex: 1 1 260px; }
.bq .tag { font-size: .8rem; color: var(--muted); }
.bq form { margin-top: 12px; }
.formgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.addq { padding: 14px 18px; }
.addq summary, .adds summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.qr-box { width: 220px; max-width: 100%; background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.qr-box img { width: 100%; display: block; }

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .topbar .wrap { flex-wrap: wrap; padding-block: 8px; gap: 6px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .seg span { padding: 10px 14px; min-width: 64px; }
}
@media print { .topbar, .no-print, .sticky-actions { display: none !important; } body { background: #fff; } }
@media (prefers-reduced-motion: no-preference) { .btn { transition: background .12s, filter .12s; } }

/* ---- system administrator dashboard ---- */
.sysbadge { display: inline-block; padding: 3px 12px; border-radius: 6px; background: #1d5fe0; color: #fff; font-weight: 600; font-size: .82rem; }
.sysbadge.sm { margin-left: 4px; font-size: .75rem; padding: 2px 9px; }
.sysbar { background: #0f1f3d; color: #fff; padding: 30px 0 34px; margin-bottom: 24px; }
.sysbar-in { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: flex-end; }
.sysbar h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin: 12px 0 4px; }
.sysbar p { margin: 0; color: #b9c6dd; }
.sysactions { display: flex; gap: 10px; flex-wrap: wrap; }
.sysbar .btn.quiet { background: transparent; border-color: rgb(255 255 255 / .4); color: #fff; }
.sysbar .btn.quiet:hover { background: rgb(255 255 255 / .12); }
.kpis { display: grid; gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 4px; }
.kpi small { color: var(--muted); font-weight: 500; }
.kpi b { font: 700 2rem/1.1 var(--head); letter-spacing: -.02em; color: #0f1f3d; }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi.hero { background: #1d5fe0; border-color: #1d5fe0; color: #fff; grid-column: span 2; }
.kpi.hero small, .kpi.hero span { color: #dbe7ff; } .kpi.hero b { color: #fff; font-size: 2.4rem; }
@media (max-width: 640px) { .kpi.hero { grid-column: auto; } }
.dash2 { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 28px; }
@media (min-width: 860px) { .dash2 { grid-template-columns: 3fr 2fr; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 12px; }
.attn, .mix { list-style: none; margin: 0; padding: 0; }
.attn li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.attn li:last-child a { border-bottom: 0; } .attn li a:hover b { color: #1d5fe0; }
.attn span { color: #8a5a00; font-size: .9rem; text-align: right; }
.mix li { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 10px; padding: 6px 0; }
.mix i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(#1d5fe0, #1d5fe0) 0 0 / var(--w) 100% no-repeat, #e6ebf3; }
.mix b { text-align: right; }
.clients-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.clients-head h2 { margin: 0; }
.clients-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.clients-tools input { width: 220px; min-height: 40px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 8px 14px; font: 500 .9rem var(--body); cursor: pointer; color: var(--muted); }
.seg button[aria-pressed=true] { background: #0f1f3d; color: #fff; }
.cgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin-bottom: 40px; }
.ccard { display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.ccard[hidden] { display: none; }
.ccard:hover, .ccard:focus-visible { border-color: #1d5fe0; box-shadow: 0 8px 24px -14px rgb(15 31 61 / .5); }
.clogo { width: 100%; height: 84px; border-radius: 10px; display: grid; place-items: center; background: #f1f4f9; border: 1px solid var(--line); overflow: hidden; padding: 10px; }
.clogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.clogo b { width: 54px; height: 54px; border-radius: 12px; background: var(--cb); color: #fff; display: grid; place-items: center; font: 700 1.5rem var(--head); }
.cname { font: 650 1.05rem var(--head); }
.cmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; font-size: .78rem; color: var(--muted); }
.cstats b { display: block; font: 700 1.1rem var(--head); color: #0f1f3d; }
.cgo { color: #1d5fe0; font-weight: 600; font-size: .92rem; }
.asadmin { background: #e8effc; border-bottom: 1px solid #c9d8f5; color: #0f1f3d; padding: 8px 0; font-size: .92rem; }
.asadmin a { margin-left: 8px; font-weight: 600; }
main:has(.sysbar) { padding-top: 0; }
.dash2 .panel { margin: 0; }
.kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(6, 1fr); } .kpi.hero { grid-column: span 2; } }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi.hero { grid-column: 1 / -1; } }
.enq { margin-bottom: 12px; } .enq.done { opacity: .6; }

/* client tiles: one size, logo always fits */
.kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.cgrid { grid-auto-rows: 1fr; }
.ccard { grid-template-rows: auto auto auto 1fr auto; align-content: start; }
.clogo { height: 110px; padding: 12px; background: #fff; display: flex; align-items: center; justify-content: center; }
.clogo img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.clogo b { flex: none; }
.cname { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; min-height: 2.5em; }
.cgo { align-self: end; }
.alpha { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.alpha button { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: 600 .85rem var(--body); color: #0f1f3d; cursor: pointer; }
.alpha button:hover:not(:disabled) { border-color: #1d5fe0; color: #1d5fe0; }
.alpha button[aria-pressed=true] { background: #1d5fe0; border-color: #1d5fe0; color: #fff; }
.alpha button:disabled { color: #b7c0cf; background: #f5f7fa; cursor: default; }
.more { text-align: center; margin: -20px 0 40px; }
.btn[hidden], .more [hidden] { display: none; }

/* ---- one footer for every page, always at the bottom ---- */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; min-height: 0; }
.site-foot { flex: none; background: #0f1f3d; color: #b9c6dd; margin-top: 0; font-size: .92rem; }
.sf-grid { display: grid; gap: 28px; padding: 36px 0 28px; }
@media (min-width: 760px) { .sf-grid { grid-template-columns: 2fr 1fr 1fr; } }
.sf-brand { display: flex; gap: 14px; align-items: flex-start; }
.sf-brand img { border-radius: 8px; background: #fff; flex: none; }
.sf-brand b { color: #fff; font: 650 1.05rem var(--head); }
.sf-brand p { margin: 2px 0 0; max-width: 24em; }
.sf-col { display: grid; gap: 6px; align-content: start; }
.sf-col h4 { margin: 0 0 4px; color: #fff; font: 600 .95rem var(--head); }
.sf-col a { color: #b9c6dd; text-decoration: none; }
.sf-col a:hover { color: #fff; text-decoration: underline; }
.sf-base { border-top: 1px solid rgb(255 255 255 / .12); padding: 14px 0; font-size: .85rem; color: #8fa0bd; }
main { min-height: 0; }
.site-foot { border-top: 1px solid rgb(255 255 255 / .1); }
.sf-copy { margin-top: 10px !important; font-size: .82rem; line-height: 1.5; color: #8fa0bd; max-width: none !important; }
.sf-copy .ver { display: inline-block; margin-top: 2px; opacity: .75; font-variant-numeric: tabular-nums; }
@media (max-width: 1320px) { .topbar .wrap { flex-wrap: wrap; padding-block: 8px; gap: 6px 12px; } .nav { order: 3; flex-basis: 100%; } }

/* three-dot row menu */
.rowmenu { position: relative; display: inline-block; }
.rowmenu > summary { list-style: none; cursor: pointer; min-width: 40px; text-align: center; font-size: 1.2rem; line-height: 1; }
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu-list { position: fixed; z-index: 60; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; text-align: left; }
.rowmenu-list a, .rowmenu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 7px; font: inherit; color: inherit; text-decoration: none; cursor: pointer; }
.rowmenu-list a:hover, .rowmenu-list button:hover { background: var(--brand-soft); }
.rowmenu-list .danger-item { color: var(--bad, #b3261e); border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; margin-top: 4px; padding-top: 10px; }
.pill.sg { background: var(--brand-soft); color: var(--ink, #1b1b2f); }
.rows-off td { opacity: .55; }
.rows-off td:last-child { opacity: 1; }

/* ---- report page ---- */
.rp { width: min(900px, 100% - 32px); margin: 0 auto; padding-bottom: 40px; }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0 14px; border-bottom: 3px solid var(--brand); }
.rp-head h1 { margin: 0; font-size: 1.6rem; }
.rp-head img { max-height: 54px; max-width: 160px; object-fit: contain; }
.rp h2.rp-h { font-size: 1.05rem; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--ink, #222); }
.rp-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; margin-top: 14px; }
.rp-scores .k { font-size: .82rem; color: var(--muted); }
.rp-scores .v { font: 700 1.35rem var(--head); }
.rp-total { grid-column: 1 / -1; display: flex; gap: 32px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.rp-legend { margin-top: 12px; display: grid; gap: 0; max-width: 260px; border: 1px solid #0003; }
.rp-legend span { padding: 2px 8px; font-size: .78rem; font-weight: 700; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; }
.rp-grid dt { font-size: .82rem; color: var(--muted); margin: 0; }
.rp-grid dd { margin: 0; font-weight: 600; }
.rp-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.rp-row .a { white-space: nowrap; font-weight: 600; text-align: right; }
.rp-row .a.pos { color: #1f7a45; } .rp-row .a.neg { color: #b4281f; } .rp-row .a.na { color: var(--muted); font-weight: 400; }
.rp-note { margin: 8px 0 2px; padding: 8px 12px; background: var(--soft, #f5f5f7); border-left: 3px solid var(--brand); border-radius: 4px; break-inside: avoid; }
.rp-note b { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.rp-sechead { display: flex; justify-content: space-between; align-items: baseline; }
.rp-sechead .sc { font: 700 1rem var(--head); }
@media (max-width: 560px) { .rp-scores, .rp-grid { grid-template-columns: 1fr; } }
@media print {
  .asadmin, footer, .site-footer, .no-print { display: none !important; }
  @page { size: A4; margin: 14mm; }
  .rp { width: 100%; font-size: 10.5pt; } .rp-row { padding: 4px 0; }
  .rp h2.rp-h { break-after: avoid; }
}

/* ---- system dashboard: a holding company with its businesses inside */
.cfam { margin: 0 0 26px; padding: 16px 16px 4px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.cfam[hidden] { display: none; }
.cfam-h { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.cfam-h > div { flex: 1; min-width: 200px; }
.cfam-h h3 { margin: 0; font-size: 1.15rem; }
.cfam-logo { width: 120px; height: 64px !important; flex: none; }
.cfam .cgrid { margin-bottom: 14px; }
.cfam-other { margin: 8px 0 12px; font-size: 1rem; color: var(--muted); }

/* ---- survey on a phone: big thumb-sized answers, no zooming, a progress count, safe areas ---- */
.sf-prog { font-size: .85rem; color: var(--muted); margin: 0 0 6px; text-align: center; }
.sf-prog b { color: var(--ink, #1c2330); }
.sf-prog i { display: block; height: 4px; border-radius: 99px; background: #e0e4ee; margin-top: 4px; overflow: hidden; }
.sf-prog i em { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
input[type=file]::file-selector-button { font: 600 .95rem var(--body, inherit); padding: 10px 16px; margin-right: 10px; border: 1.5px solid var(--brand); border-radius: 9px; background: #fff; color: var(--brand); cursor: pointer; }
@media (max-width: 560px) {
  input, select, textarea { font-size: 16px; }
  .seg { display: flex; width: 100%; }
  .seg label { flex: 1 1 0; min-width: 0; }
  .seg span { min-width: 0; padding: 14px 4px; min-height: 52px; font-size: 1rem; }
  .scale .seg { flex-wrap: nowrap; }
  .scale .seg span { padding: 14px 0; min-width: 0; }
  .sticky-actions { background: var(--paper); border-top: 1px solid var(--line); padding: 8px 0 max(10px, env(safe-area-inset-bottom)); margin-top: 16px; }
  .sticky-actions .btn { min-height: 52px; font-size: 1.05rem; }
  input[type=file] { width: 100%; padding: 10px 0; }
  input[type=file]::file-selector-button { min-height: 46px; }
  input[type=number], input[type=text], input[type=datetime-local], input[type=date], select { max-width: 100% !important; width: 100%; min-height: 48px; }
  textarea { min-height: 110px; }
}


/* ---- first sign-in: terms of use and privacy notice ---- */
.consent { max-width: 760px; margin: 0 auto; padding-bottom: 90px; }
.consent-head { margin: 8px 0 18px; }
.consent-head p { color: var(--muted); max-width: 60ch; margin: 6px 0 0; }
.consent-steps { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; font-size: .9rem; }
.consent-steps span { padding: 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.consent-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-top: 16px; }
.consent-card > h2 { font-size: 1.25rem; margin: 0 0 4px; }
.consent-card .lede { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.consent-scroll { position: relative; max-height: 300px; overflow: auto; padding: 4px 14px 4px 0; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; padding: 14px 16px; font-size: .96rem; }
.consent-scroll h3 { margin: 16px 0 4px; font-size: 1rem; color: var(--brand); }
.consent-scroll h3:first-child { margin-top: 0; }
.consent-scroll p { margin: 4px 0; }
.consent-scroll:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.consent-hint { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.pn-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.pn-list li { padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); border-left: 4px solid var(--accent); }
.pn-list b { display: block; color: var(--brand); margin-bottom: 2px; }
.pn-intro { margin: 0 0 8px; }
.share-grid { display: grid; gap: 10px; margin-top: 10px; }
.share-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.share-opt input { margin-top: 5px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.share-opt b { display: block; }
.share-opt small { color: var(--muted); font-size: .86rem; }
.share-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); }
.accept-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--brand-soft); cursor: pointer; font-weight: 600; }
.accept-row input { margin-top: 4px; width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.accept-row.bad { outline: 2px solid var(--bad); }
.consent-err { color: var(--bad); margin: 8px 0 0; font-weight: 600; }
.consent-bar { position: sticky; bottom: 0; background: rgba(246,247,251,.96); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 18px; backdrop-filter: blur(4px); }
.consent-bar .btn { width: 100%; justify-content: center; padding: 14px 20px; font-size: 1.05rem; }
.consent-bar p { margin: 8px 0 0; font-size: .82rem; color: var(--muted); text-align: center; }
@media (min-width: 640px) { .consent-bar .btn { width: auto; min-width: 280px; } .consent-bar p { text-align: left; } }
.tfor[hidden] { display: none; }

/* builder: one distinct card per question */
.qlist { padding: 14px 18px 0; display: grid; gap: 10px; }
.bsec .bq { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0; overflow: hidden; }
.bsec .bq > summary { list-style: none; padding: 12px 14px; align-items: center; }
.bsec .bq > summary::-webkit-details-marker { display: none; }
.bsec .bq > summary::before { content: "\25B8"; color: var(--muted); font-size: 1.05rem; width: 14px; transition: transform .12s; }
.bsec .bq[open] > summary::before { transform: rotate(90deg); }
.bsec .bq[open] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bsec .bq[open] > summary { background: var(--brand-soft); }
.bsec .bq > form, .bsec .bq > .row { margin: 0; padding: 14px; }
.bsec .bq > .row { padding-top: 0; }
.qn { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: var(--brand); color: #fff; font: 700 .85rem var(--head); }
.qn.plus { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); margin-right: 8px; }
.bsec .addq { margin: 14px 18px 18px; padding: 0; border: 1.5px dashed var(--line); border-radius: 12px; }
.bsec .addq[open] { border-style: solid; border-color: var(--brand); }
.bsec .addq > summary { padding: 12px 14px; display: flex; align-items: center; }
.bsec .addq > form { padding: 0 14px 14px; }
@media (prefers-reduced-motion: reduce) { .bsec .bq > summary::before { transition: none; } }
.qstat { margin-left: 12px; color: var(--muted); }
.qstat.saved { color: #1f7a45; font-weight: 600; }
.qstat.unsaved { color: #b45309; font-weight: 600; }
.bsec .bq.dirty { border-color: #f59e0b; }

/* survey preview: live score beside the form */
.pvwrap { width: min(1120px, 100% - 32px); }
.pv { display: grid; gap: 22px; align-items: start; }
@media (min-width: 960px) { .pv { grid-template-columns: minmax(0, 1fr) 340px; } .pvlive { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; } }
@media (max-width: 959px) { .pvlive { order: -1; } }
.pvlive .bigscore { font-size: 2.6rem; }
.pvrow { margin-top: 12px; }
.pvq { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.pvq b { white-space: nowrap; }
.pvq.off { color: var(--muted); }
.pvq.off b { font-weight: 400; }

/* ---- build 110: screen polish ---- */
.pick { border: 1px solid var(--line); border-radius: 10px; max-height: 230px; overflow: auto; padding: 4px 6px; background: #fff; }
.pick label { display: flex; gap: 10px; align-items: center; padding: 6px 8px; margin: 0; font-weight: 500; border-radius: 7px; cursor: pointer; }
.pick label:hover { background: var(--brand-soft); }
.pick label input { width: auto; flex: none; }
.pick label[hidden] { display: none !important; }

.sk { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 6px 0 22px; }
.sk .k { display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r); padding: 14px 16px; }
.sk .k span { color: var(--muted); font-size: .85rem; }
.sk .k b { font: 800 1.9rem/1.1 var(--head); }
.sk .k small { color: var(--muted); font-size: .8rem; }
.sk .k.bad { border-top-color: var(--bad); } .sk .k.bad b { color: var(--bad); }

/* tidy page intro */
.lede { color: var(--muted); max-width: 68ch; margin: -6px 0 18px; }
.empty { border: 1.5px dashed var(--line); border-radius: 12px; padding: 22px 18px; text-align: center; color: var(--muted); background: #fbfbfe; }
.empty b { display: block; color: var(--ink); font: 700 1.02rem var(--head); margin-bottom: 4px; }

/* dashboard */
.kpi { border-top: 4px solid var(--k, var(--line)); }
.att { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; }
.att .panel { border-left: 5px solid var(--k, var(--line)); margin: 0; }
@media (min-width: 1001px) { .dgrid { grid-template-columns: minmax(0, 1fr) !important; } }
.dgrid > div + div { margin-top: 4px; }
.stbl td:first-child a { white-space: nowrap; }
.att h3 { display: flex; align-items: center; gap: 8px; }
.att h3 .n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--k, var(--muted)); color: #fff; font: 700 .8rem var(--head); }
.stbl td:first-child { min-width: 190px; }
.sbar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.sbar i { display: block; width: 70px; height: 7px; border-radius: 99px; background: #e6ebf3; overflow: hidden; }
.sbar i s { display: block; height: 100%; border-radius: 99px; }
.rcard { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 11px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.rcard:hover { border-color: var(--brand); box-shadow: 0 6px 18px -12px rgb(0 0 0/.4); }
.rcard b { display: block; color: var(--brand); }
.rcard .small { display: block; }
.rcard .sc { text-align: right; white-space: nowrap; }

/* campaigns picker and assign panel */
.pgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pcard { display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); border-left: 6px solid #2e9e5b; border-radius: 12px; padding: 16px 18px; }
.pcard h3 { margin: 0; font-size: 1.08rem; }
.pcard .bar { height: 8px; border-radius: 99px; background: #e6ebf3; overflow: hidden; }
.pcard .bar i { display: block; height: 100%; background: #2e9e5b; }
#assign { border-top: 4px solid var(--accent); }
.step { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font: 700 1rem var(--head); }
.step:first-of-type { margin-top: 6px; }
.step i { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 99px; background: var(--brand); color: #fff; font: 700 .85rem var(--head); font-style: normal; flex: none; }
.asum { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); font-size: .92rem; }
.asum[hidden] { display: none; }

/* links page */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.jump a { padding: 7px 14px; border: 1px solid var(--line); background: #fff; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: .92rem; }
.jump a:hover { background: var(--brand-soft); }
.lsec { margin-bottom: 20px; padding: 0; overflow: hidden; }
.lsec > .lh { padding: 16px 22px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.lsec > .lh h2 { margin: 0 0 2px; }
.lsec > .lh p { margin: 0; color: var(--muted); font-size: .92rem; }
.lsec > .lbody { padding: 20px 22px; }
.rcpts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: start; }
.rcpt { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.rcpt > b { display: block; margin-bottom: 6px; }
.rcpt .pick { max-height: 190px; margin-top: 6px; }
.rcpt details > summary { cursor: pointer; padding: 4px 0; color: var(--brand); font-weight: 600; }
.lifepick { border: 0 !important; padding: 0 !important; margin: 0; min-width: 0; flex: 1 1 100%; }
.lifepick legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.lopts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.lopt { display: flex !important; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px !important; background: #fff; cursor: pointer; font-weight: 500; margin: 0; }
.lopt:has(input[type=radio]:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.lopt > input[type=radio] { width: auto; margin-top: 4px; flex: none; }
.lopt b { display: block; }
.lopt small { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; line-height: 1.35; }
.lopt .lamt { display: flex; gap: 6px; margin-top: 8px; }
.lopt .lamt input { width: 76px; } .lopt .lamt select { width: auto; }

/* survey pages */
.stat3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 4px 0 20px; }
.stat3 div { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r); padding: 12px 16px; display: grid; }
.stat3 b { font: 800 1.6rem/1.15 var(--head); } .stat3 span { color: var(--muted); font-size: .85rem; }
.osec { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.osec > header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--brand-soft); }
.osec > header b { flex: 1; font: 700 1.02rem var(--head); }
.osec ol { margin: 0; padding: 4px 16px 10px 44px; }
.osec li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.osec li:last-child { border-bottom: 0; }
.osec li small { display: block; color: var(--muted); }

/* edit survey */
.stickybar { position: sticky; top: 0; z-index: 25; background: var(--paper); padding: 12px 0; margin-bottom: 10px; border-bottom: 1px solid var(--line); align-items: center; }
.fold { padding: 0 !important; margin-bottom: 14px; overflow: hidden; }
.fold > summary { cursor: pointer; list-style: none; display: flex; gap: 12px; align-items: center; padding: 14px 20px; font: 700 1.05rem var(--head); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "\25B8"; color: var(--muted); transition: transform .12s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary .muted { font-weight: 400; font-size: .88rem; margin-left: auto; }
.fold > .fbody { padding: 0 20px 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.secnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.secnav a { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .92rem; }
.secnav a:hover { background: var(--brand-soft); }
.secnav a span { color: var(--muted); font-weight: 500; font-size: .84rem; }
.bmeta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.secno { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font: 800 1rem var(--head); }
.bmeta h2 { margin: 0; font-size: 1.15rem; }
.bmeta .share { margin-left: auto; text-align: right; font-size: .85rem; color: var(--muted); }
.bmeta .share i { display: block; width: 140px; height: 7px; border-radius: 99px; background: #d5d9e6; overflow: hidden; margin-top: 4px; }
.bmeta .share i s { display: block; height: 100%; background: var(--brand); }
.secedit { margin-top: 12px; }
.secedit > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .fold > summary::before { transition: none; } }

.dupwarn { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 8px; background: #fff4d6; color: #7a5200; font-size: .82rem; line-height: 1.35; border: 1px solid #f0d98a; }

/* photo viewer (lightbox.js) */
.lb { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: rgba(10, 14, 22, .88); }
.lb[hidden] { display: none; }
.lb-fig { margin: 0; max-width: min(92vw, 1400px); display: grid; justify-items: center; gap: 8px; }
.lb-fig img { max-width: 100%; max-height: 82vh; width: auto; height: auto; border-radius: 10px; background: #111; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lb-count { color: #e8ecf3; font-size: .9rem; min-height: 1.2em; }
.lb button { border: 0; cursor: pointer; font: inherit; color: #fff; background: rgba(255, 255, 255, .16); border-radius: 999px; }
.lb button:hover { background: rgba(255, 255, 255, .3); }
.lb button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-x { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; }
.lb-n { flex: none; width: 48px; height: 48px; font-size: 2rem; line-height: 1; }
.lb-n[hidden] { display: none; }
body.lb-open { overflow: hidden; }
@media (max-width: 600px) { .lb { padding: 12px; gap: 4px; } .lb-n { width: 38px; height: 38px; } }
@media print { .lb { display: none !important; } }

/* photo questions: take a photo or choose one (photo.js) */
.pq-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pq-btns .btn { flex: 1 1 160px; padding: 14px 16px; }
.pq-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pq-item { display: grid; gap: 4px; justify-items: start; }
.pq-item img { width: 110px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pq-rm { border: 0; background: none; color: var(--muted); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; padding: 2px 0; }

/* footer of the client's own survey pages */
.cfoot { flex: none; background: #fff; border-top: 3px solid var(--brand); color: var(--ink, #1c2330); font-size: .95rem; margin-top: 28px; }
.cf-grid { display: grid; gap: 16px; padding: 24px 0 12px; }
@media (min-width: 640px) { .cf-grid { grid-template-columns: 2fr 1fr; } }
.cf-id { display: grid; gap: 10px; justify-items: start; }
.cf-logo { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; max-width: 100%; }
.cf-logo img { display: block; width: auto; height: auto; max-height: 52px; max-width: 160px; }
.cf-id b { display: block; font: 650 1.1rem var(--head); }
.cf-addr { margin: 4px 0 0; white-space: pre-line; color: var(--muted); line-height: 1.5; max-width: 26em; }
.cf-contact { display: grid; gap: 4px; align-content: start; }
.cf-contact a { color: var(--brand); text-decoration: none; word-break: break-word; padding: 3px 0; }
.cf-contact a:hover { text-decoration: underline; }
.cf-note { color: var(--muted); font-size: .85rem; padding: 0 0 12px; line-height: 1.5; }
.cf-base { border-top: 1px solid var(--line); margin-top: 6px; padding: 14px 0 22px; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.cf-base .ver { display: block; opacity: .7; margin-top: 2px; }
@media print { .cfoot { display: none; } }
