/* The tools dashboard, in the admin page's look (admin/public/assets/app.css):
   the client report's warm palette, a green accent, squarer corners. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --bg: #f3f0e9; --panel: #ffffff; --card-2: #f8f6f2; --ink: #1c202b; --ink-2: #454b5a; --muted: #585e6d; --line: #e6e1d7; --line-2: #cfc7b8;
  --accent: #0a6d52; --accent-ink: #ffffff; --accent-soft: #e2f0ea; --link: #1c58b5; --focus: #1c58b5;
  --ok: #18733a; --ok-soft: #e5f3e8; --warn: #8a5000; --warn-soft: #fbf0dc; --bad: #b0241c; --bad-soft: #fbe7e5;
  --info-soft: #f8f6f2; --served: #1b9472; --refused: #c7820f;
  --radius: 4px; --shadow: 0 1px 2px rgb(50 40 20 / 7%), 0 6px 18px -10px rgb(50 40 20 / 24%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171c; --panel: #1d2027; --card-2: #23262e; --ink: #ece8df; --ink-2: #c3bfb6; --muted: #a29e95; --line: #2e323b; --line-2: #3d424d;
    --accent: #5ccfa8; --accent-ink: #111318; --accent-soft: #173229; --link: #82b1ff; --focus: #82b1ff;
    --ok: #69d088; --ok-soft: #14281b; --warn: #f2c063; --warn-soft: #2c2412; --bad: #ff8b82; --bad-soft: #301a19;
    --info-soft: #23262e; --served: #2ea47f; --refused: #d99a34;
    --shadow: 0 0 0 1px rgb(255 255 255 / 7%), 0 16px 32px -18px rgb(0 0 0 / 90%); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171c; --panel: #1d2027; --card-2: #23262e; --ink: #ece8df; --ink-2: #c3bfb6; --muted: #a29e95; --line: #2e323b; --line-2: #3d424d;
  --accent: #5ccfa8; --accent-ink: #111318; --accent-soft: #173229; --link: #82b1ff; --focus: #82b1ff;
  --ok: #69d088; --ok-soft: #14281b; --warn: #f2c063; --warn-soft: #2c2412; --bad: #ff8b82; --bad-soft: #301a19;
  --info-soft: #23262e; --served: #2ea47f; --refused: #d99a34;
  --shadow: 0 0 0 1px rgb(255 255 255 / 7%), 0 16px 32px -18px rgb(0 0 0 / 90%); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
h1 { font-size: 24px; letter-spacing: -.015em; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 16px; margin: 0 0 .75rem; }
h3 { font-size: 15px; margin: 1rem 0 .4rem; }
p { margin: .4rem 0; }
code, .mono { font: 13px/1.45 var(--mono); }
.muted { color: var(--muted); } .small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

button, .button { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  padding: 7px 14px; min-height: 36px; border-radius: var(--radius); cursor: pointer; }
button:hover, .button:hover { background: var(--card-2); color: var(--ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.06); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--link); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; }
button.link:hover { background: none; color: var(--link); }
button:disabled { opacity: .55; cursor: default; filter: none; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 7px 10px; width: 100%; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), select { min-height: 38px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin: .6rem 0 .25rem; }

/* the mark: as the admin page's */
.mark { width: 22px; height: 22px; border-radius: 3px; background: var(--accent); display: inline-block; position: relative; flex: none; }
.mark::after { content: ""; position: absolute; inset: 6px; border: 2px solid var(--accent-ink); border-radius: 1px; }

/* sign-in */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; width: 100%; max-width: 420px; }
.login-card h1 { font-size: 21px; margin-top: 20px; }
.login-card form button { width: 100%; margin-top: .9rem; justify-content: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand small { color: var(--muted); font-weight: 500; }
.status { min-height: 1.5em; margin-top: .75rem; font-size: 13px; }
.status.ok { color: var(--ok); } .status.warn { color: var(--warn); }

/* app shell */
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .brand { margin: 0; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
.who form { margin: 0; }
.who button.link { font-weight: 600; text-decoration: none; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 7px 14px; color: var(--ink-2); min-height: 36px; }
.who button.link:hover { background: var(--card-2); color: var(--ink); }
/* the sidebar stays at the left; the page is centred in the window, or sits
   just after the sidebar when the window is too narrow for that. cqw is the
   layout's own width, so a scrollbar doesn't pull the centre off */
.layout { --side: 240px; --page: 1080px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 57px); container-type: inline-size; }
#sidebar { border-right: 1px solid var(--line); padding: 16px 12px; background: var(--panel); }
#sidebar a.key { display: block; padding: 8px 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; margin-bottom: 2px; }
#sidebar a.key:hover { background: var(--card-2); }
#sidebar a.key.active { background: var(--card-2); box-shadow: inset 3px 0 0 var(--accent); }
#sidebar a.key .name { font-weight: 600; display: flex; justify-content: space-between; gap: .5rem; }
#sidebar a.key .sub { color: var(--muted); font-size: 12.5px; }
#sidebar .section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .25rem 10px .5rem; }
#sidebar .new { width: 100%; margin-top: 12px; }
main#main { padding: 24px 28px 48px; max-width: var(--page); width: 100%; min-width: 0;
  margin-left: max(0px, calc((100cqw - var(--page)) / 2 - var(--side))); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px; }
.panel > h2:first-child { padding-bottom: 12px; margin: -2px -18px 14px; padding-left: 18px; padding-right: 18px; border-bottom: 1px solid var(--line); }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.chip { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--info-soft); color: var(--muted); border: 1px solid var(--line); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.dot { min-width: 1.4rem; text-align: center; font-size: 12px; font-weight: 600; border-radius: 3px; padding: 0 .4rem; background: var(--bad-soft); color: var(--bad); }

/* findings */
.finding { display: grid; grid-template-columns: 4px 1fr auto; gap: .9rem; align-items: start; padding: .8rem 0; border-top: 1px solid var(--line); }
.finding:first-of-type { border-top: 0; }
.finding .bar { align-self: stretch; border-radius: 2px; background: var(--muted); }
.finding.error .bar { background: var(--bad); } .finding.warning .bar { background: var(--warn); } .finding.info .bar { background: var(--line); }
.finding .t { font-weight: 600; } .finding .d { color: var(--muted); margin: .2rem 0 0; }
.allgood { display: flex; gap: .6rem; align-items: center; color: var(--ok); }

/* key + snippets */
.keybox { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.keybox code { background: var(--info-soft); padding: .35rem .55rem; border-radius: var(--radius); word-break: break-all; }
pre.snippet { background: var(--info-soft); padding: .7rem .8rem; border-radius: var(--radius); overflow-x: auto; margin: .35rem 0 0; white-space: pre-wrap; word-break: break-all; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > input { flex: 1; min-width: 8rem; }
.row > select { width: auto; flex: 0 0 auto; }

/* setup helpers */
.checks-list .check { justify-content: flex-start; gap: .6rem; }
.checks-list .ci { width: 1.4rem; height: 1.4rem; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; flex: none; }
.check.ok .ci { background: var(--ok-soft); color: var(--ok); } .check.bad .ci { background: var(--bad-soft); color: var(--bad); }
.check.idle .ci { background: var(--info-soft); color: var(--muted); }
.checks-list b { min-width: 7.5rem; }
.builder { margin-top: 1rem; }
details.builder { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; }
details.builder summary { cursor: pointer; font-weight: 600; color: var(--accent); }
input[type=color] { width: 3rem; height: 2.2rem; padding: .15rem; }
.row > input[type=color] { flex: 0 0 3rem; min-width: 0; }
.builder label > input[type=checkbox] { width: auto; margin-right: .35rem; vertical-align: -2px; }
a.button { display: inline-block; text-decoration: none; text-align: center; }
.field-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .25rem .75rem; margin-bottom: .5rem; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.field-row label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-weight: 400; }
.field-row input { width: auto; }

/* forms */
.form-card { border-top: 1px solid var(--line); padding: .9rem 0 .4rem; }
.form-card:first-of-type { border-top: 0; }
.form-card h3 { margin-top: 0; }
.form-card textarea { margin-top: .4rem; resize: vertical; }
.admin-bits { margin-top: .75rem; padding: .7rem .8rem; border-radius: var(--radius); background: var(--info-soft); }

/* short links */
.link-row { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.link-row:first-child { border-top: 0; }
.link-qr { width: 96px; height: 96px; background: #fff; border-radius: var(--radius); padding: 4px; }
.link-main { display: grid; gap: .35rem; min-width: 0; }
.link-main code { word-break: break-all; }
.row.small { flex-wrap: wrap; gap: .9rem; font-size: 13px; }
button.link.danger { color: var(--bad); }

/* lists */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--line); }
ul.plain li:first-child { border-top: 0; }
.err { color: var(--bad); font-size: 13.5px; min-height: 1.2em; margin: .3rem 0 0; }

/* usage chart */
.stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: .75rem; }
.stat b { display: block; font-size: 1.4rem; } .stat span { color: var(--muted); font-size: 13px; }
svg.chart { width: 100%; height: 140px; display: block; }
svg.chart .s { fill: var(--served); } svg.chart .r { fill: var(--refused); } svg.chart .axis { stroke: var(--line); }
svg.chart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 1rem; font-size: 13px; color: var(--muted); margin-top: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.legend .ls { background: var(--served); } .legend .lr { background: var(--refused); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: .45rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-top: 0; }
td.num, th.num { text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checks { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.checks label { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; margin: 0; }
.checks input { width: auto; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }

#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: .55rem 1rem; border-radius: var(--radius); opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  #sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  main#main { padding: 1rem 16px 2rem; margin-left: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .finding { grid-template-columns: 4px 1fr; } .finding .fix { grid-column: 2; }
  .who span { display: none; }
  .link-row { grid-template-columns: 72px 1fr; } .link-qr { width: 72px; height: 72px; }
  form.row, div.row { flex-wrap: wrap; }
  .row > input, .row > select { min-width: 0; }
}

.held { border-top: 1px solid var(--line, #e5e5e5); padding: .6rem 0; word-break: break-word; }
.held .actions { margin-top: .4rem; }

.hours { display: flex; flex-direction: column; gap: .35rem; margin: .5rem 0 1rem; }
.hours-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.hours-row > b { flex: 0 0 7rem; font-weight: 500; }
.hours-row input[type=time], .row > input[type=time], .row > input[type=date] { flex: 0 0 9rem; width: 9rem; min-width: 0; }
.hours-row label, .row > label { display: flex; gap: .35rem; align-items: center; margin: 0; font-weight: normal; flex: 0 0 auto; }
.panel label > input[type=checkbox] { width: auto; flex: 0 0 auto; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
details.held summary { cursor: pointer; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .hours-row > b { flex-basis: 100%; }
  .grid3 { grid-template-columns: 1fr; }
}

.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin: -.25rem 0 1.25rem; scrollbar-width: thin; }
.tabs .tab { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs .tab:hover, .tabs .tab:focus-visible { color: var(--ink); outline: none; }
.tabs .tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .badge { font-size: .75rem; padding: .05rem .45rem; border-radius: 3px; background: var(--accent-soft); color: var(--ink); }
.checks-list .tool-link { color: inherit; text-decoration: none; }
.checks-list .tool-link:hover b, .checks-list .tool-link:focus-visible b { text-decoration: underline; }

.scroll { overflow-x: auto; max-width: 100%; }

.topbar { gap: 1rem; }
.keypick { display: flex; align-items: center; gap: .5rem; margin: 0 auto 0 1.25rem; min-width: 0; font-size: 14px; color: var(--muted); }
.keypick select { min-width: 12rem; max-width: 22rem; font-weight: 600; color: var(--ink); }
#sidebar a.page { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; margin-bottom: 2px; font-weight: 500; }
#sidebar a.page:hover { background: var(--card-2); }
#sidebar a.page:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
#sidebar a.page.active { background: var(--card-2); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
#sidebar .badge { font-size: .75rem; padding: .05rem .45rem; border-radius: 3px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.head .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 760px) {
  .keypick { margin: 0; order: 3; flex-basis: 100%; }
  .keypick select { flex: 1; max-width: none; min-width: 0; }
  .topbar { flex-wrap: wrap; }
  #sidebar { display: flex; gap: .25rem; overflow-x: auto; padding: .5rem 16px; }
  #sidebar a.page { white-space: nowrap; margin: 0; }
  #sidebar .new { width: auto; margin: 0; white-space: nowrap; }
}

[hidden] { display: none !important; }

.preset-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .75rem; }
.preset-fields > div:has(textarea) { grid-column: 1 / -1; }
@media (max-width: 640px) { .preset-fields { grid-template-columns: minmax(0, 1fr); } }

label.inline { display: inline-flex; gap: .35rem; align-items: center; margin: 0; font-weight: normal; }
.logo-list { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.logo-item { display: inline-flex; align-items: flex-start; }
.logo-pick { padding: .25rem; min-height: 50px; min-width: 50px; display: inline-grid; place-items: center;
  background: repeating-conic-gradient(var(--info-soft) 0 25%, var(--panel) 0 50%) 50% / 12px 12px; }
.logo-pick.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.logo-pick img { display: block; object-fit: contain; }
input[type=range] { flex: 1; min-width: 8rem; }

.set-card .set-head { display: flex; gap: 1rem; align-items: center; }
.set-card .set-head img { width: 110px; height: auto; flex: 0 0 auto; }
.sheet-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.sheet-bar h1 { flex: 1; font-size: 1.3rem; margin: 0; }
.sheet { display: grid; gap: 8mm; background: #fff; padding: 6mm; border-radius: var(--radius); }
.sheet.per-1 { grid-template-columns: 1fr; } .sheet.per-4 { grid-template-columns: repeat(2, 1fr); }
.sheet.per-6 { grid-template-columns: repeat(2, 1fr); } .sheet.per-12 { grid-template-columns: repeat(3, 1fr); }
.sheet-cell { display: grid; place-items: center; break-inside: avoid; page-break-inside: avoid; padding: 4mm; border: 1px dashed #ccc; }
.sheet-cell img { width: 100%; height: auto; }
/* sized so a page holds them on Letter or A4 (framed codes are ~1.2× taller than wide) */
.sheet.per-1 .sheet-cell img { max-width: 160mm; } .sheet.per-4 .sheet-cell img { max-width: 85mm; }
.sheet.per-6 .sheet-cell img { max-width: 58mm; } .sheet.per-12 .sheet-cell img { max-width: 42mm; }
@media print {
  @page { margin: 10mm; }
  .topbar, #sidebar, .no-print, #toast { display: none !important; }
  body, .layout, main#main { background: #fff !important; padding: 0 !important; margin: 0 !important; display: block !important; max-width: none !important; }
  .sheet { padding: 0; gap: 6mm; border-radius: 0; }
  .sheet-cell { border-color: #ddd; }
}

/* ---- QR code studio: steps on the left, a sticky preview on the right */
.qr-intro { margin: -4px 0 16px; max-width: 72ch; }
.qr-studio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "kind pane" "details pane" "look pane"; gap: 16px; align-items: start; }
.qr-step-kind { grid-area: kind; } .qr-step-details { grid-area: details; } .qr-step-look { grid-area: look; }
.qr-step, .qr-pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.qr-step-n { width: 22px; height: 22px; border-radius: 3px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.qr-pane { grid-area: pane; position: sticky; top: 16px; display: grid; gap: 12px; }

/* 1: what scanning does */
.qr-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
button.qr-kind { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; min-height: 78px;
  background: var(--panel); color: var(--ink-2); font-size: 13px; text-align: center; line-height: 1.25; }
button.qr-kind svg { color: var(--muted); }
button.qr-kind:hover { background: var(--card-2); }
button.qr-kind[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--ink); }
button.qr-kind[aria-checked="true"] svg { color: var(--accent); }

/* 2: details */
.qr-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.qr-fields > .wide, .qr-field.wide { grid-column: 1 / -1; }
.qr-fields > .qr-field > label:first-child { margin-top: .6rem; }
label.qr-check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); margin: .9rem 0 .25rem; }
label.qr-check input { width: auto; }
.qr-note { margin: 12px 0 0; }
.qr-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.qr-tag label.qr-check { margin: 0; }
.qr-tag input:not([type=checkbox]) { width: 12rem; flex: none; }

/* 3: look */
.qr-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.qr-choice button { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); padding: 6px 12px; }
.qr-choice button[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--ink); }
.qr-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
button.swatch { width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--sw); }
button.swatch:hover { background: var(--sw); filter: brightness(1.08); }
button.swatch[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
input.swatch-custom { width: 44px; height: 32px; min-height: 0; padding: 2px; cursor: pointer; }
.qr-inline { margin-top: 8px; }
.qr-quick { display: flex; flex-wrap: wrap; gap: 8px; }
button.qr-quick-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 6px 5px; font-size: 12px; background: var(--panel); }
button.qr-quick-btn img { display: block; width: 56px; height: auto; background: #fff; border-radius: 3px; }
button.qr-quick-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }
/* the tab row's line and the open tab's underline are drawn inside the row
   (inset shadows), so nothing pokes out and the row never scrolls vertically */
.qr-tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--line); margin: 0 0 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
button.qr-tab { border: 0; border-radius: 0; background: none; padding: 8px 12px; white-space: nowrap; color: var(--ink-2); flex: none; }
button.qr-tab:hover { background: var(--card-2); }
button.qr-tab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* step headers (the Look's has the Quick styles button), and the quick styles panel */
.qr-step-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.qr-step-head > h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0; }
button.qr-quick-toggle { margin-left: auto; min-height: 32px; padding: 5px 12px; }
button.qr-quick-toggle::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
button.qr-quick-toggle[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
button.qr-quick-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.qr-quick-panel { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 14px; margin: 0 0 16px; }
p.qr-quick-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 8px; }
.qr-saved { position: relative; display: inline-flex; }
button.qr-saved-x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; font-size: 14px; line-height: 1;
  background: var(--panel); color: var(--muted); display: grid; place-items: center; }
button.qr-saved-x:hover { color: var(--bad); border-color: var(--bad); background: var(--panel); }
.qr-saved button.qr-quick-btn span { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
form.qr-save { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
form.qr-save input { flex: 1 1 200px; width: auto; }
.qr-lookpanel { padding-top: 2px; }
.qr-lookpanel > p.muted { margin-top: .75rem; }
.qr-look-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* the preview pane */
.qr-stage { display: grid; place-items: center; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--card-2) 0 25%, var(--panel) 0 50%) 50% / 14px 14px; }
.qr-img { display: block; width: 100%; max-width: 260px; height: auto; }
ul.qr-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
ul.qr-checks li { display: flex; gap: 8px; align-items: flex-start; }
.qr-check-mark { width: 18px; height: 18px; border-radius: 3px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; margin-top: 1px; }
.qr-check-ok .qr-check-mark { background: var(--ok-soft); color: var(--ok); }
.qr-check-warn .qr-check-mark { background: var(--warn-soft); color: var(--warn); }
.qr-check-bad .qr-check-mark { background: var(--bad-soft); color: var(--bad); }
.qr-check-bad { color: var(--bad); }
.qr-dls { display: grid; gap: 8px; }
a.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
a.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
a.button.primary:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.06); }
a.button.is-disabled { opacity: .5; cursor: not-allowed; }
.qr-png { display: flex; gap: 6px; }
.qr-png > a { flex: 1; }
.qr-png > select { width: auto; flex: none; }
.qr-pane > p { margin: 0; }
details.qr-embed { border-top: 1px solid var(--line); padding-top: 10px; }
details.qr-embed > summary { cursor: pointer; font-weight: 600; color: var(--link); }
details.qr-embed[open] > summary { margin-bottom: 8px; }
details.qr-embed .row { margin-bottom: 8px; }
details.qr-embed button.primary { width: 100%; margin-top: 8px; }

@media (max-width: 980px) {
  .qr-studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kind" "details" "pane" "look"; }
  .qr-pane { position: static; }
  .qr-img { max-width: 220px; }
}
@media (max-width: 560px) {
  .qr-fields { grid-template-columns: minmax(0, 1fr); }
  .qr-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  button.qr-kind { min-height: 70px; padding: 10px 4px; font-size: 12px; }
}
.qr-logo-row { margin-top: 10px; }
.qr-logo-row input[type=range] { flex: 1 1 160px; min-width: 0; accent-color: var(--accent); }
.qr-logo-size { white-space: nowrap; }
.qr-pane > p.err:empty { display: none; }

/* the choice drawings: the look's own colours on its background (set as CSS
   variables by the studio), so each option previews itself at no cost */
svg.qr-mini { flex: none; display: block; }
.qr-mini .mini-bg { fill: var(--qr-bg, #ffffff); stroke: var(--line-2); stroke-width: 1; }
.qr-mini .mini-code { fill: var(--qr-code, #000000); }
.qr-mini .mini-code-line { fill: none; stroke: var(--qr-code, #000000); }
.qr-mini .mini-eye { fill: var(--qr-eye, var(--qr-code, #000000)); }
.qr-mini .mini-eye-ring { fill: none; stroke: var(--qr-eye, var(--qr-code, #000000)); }
.qr-mini .mini-frame { fill: var(--qr-frame, var(--qr-code, #000000)); }
.qr-mini .mini-frame-line { fill: none; stroke: var(--qr-frame, var(--qr-code, #000000)); }

/* the scan test line: waiting, then the result (ok / bad from the checks above) */
.qr-check-wait .qr-check-mark { background: var(--card-2); color: var(--muted); }
.qr-check-wait { color: var(--muted); }
li.qr-scan.qr-check-ok { font-weight: 600; }

/* a panel heading with an action on the right ("New short link", "New QR code") */
.panel > .panel-head:first-child { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 18px 12px; margin: -2px -18px 14px; border-bottom: 1px solid var(--line); }
.panel-head > h2 { margin: 0; }
.panel-head > :last-child { margin-left: auto; }
h3.first-h { margin-top: 1.2rem; }
.link-create .row > input { min-width: 6rem; }
.link-set-make { margin-top: 18px; }

/* modals: a dialog over the page, its heading staying put while it scrolls */
dialog.modal { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0; background: var(--panel); color: var(--ink);
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; box-shadow: 0 24px 60px -20px rgb(0 0 0 / 45%); }
dialog.modal.wide { width: min(1240px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgb(20 18 14 / 45%); }
.modal-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.modal-head > h2 { margin: 0; font-size: 18px; }
button.modal-x { margin-left: auto; width: 36px; height: 36px; min-height: 0; padding: 0; font-size: 22px; line-height: 1; }
.modal-body { padding: 16px 18px 20px; }
html:has(dialog.modal[open]) { overflow: hidden; }
.link-main .row.small > label { min-width: 0; max-width: 100%; }

/* the QR page: the key's saved codes as cards; the studio opens in a modal */
.qr-first > h2.first-h { margin: 0 0 14px; font-size: 18px; }
.qr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qr-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
button.qr-card-img { flex: none; width: 104px; height: 104px; padding: 3px; min-height: 0; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); }
button.qr-card-img img { width: 96px; height: 96px; image-rendering: pixelated; }
.qr-card-locked { font-size: 12px; line-height: 1.3; color: var(--muted); text-align: center; }
.qr-card-body { min-width: 0; flex: 1; }
.qr-card-body h3 { margin: 0 0 2px; font-size: 15px; overflow-wrap: anywhere; }
.qr-card-body p { margin: 0 0 4px; }
.qr-card-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.qr-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.qr-card-actions > .button, .qr-card-actions > button:not(.link) { padding: 4px 10px; min-height: 0; font-size: 13px; }

/* saving from the studio, and making a short link from a typed address */
.qr-store { border-top: 1px solid var(--line); padding-top: 12px; }
.qr-store > label { margin-top: 0; }
.qr-store .row { flex-wrap: nowrap; }
.qr-store .row > input { flex: 1; min-width: 0; }
.qr-store .checks { margin-top: 8px; }
.qr-store .err:empty { display: none; }
button.qr-mklink-btn { margin-top: 6px; padding-left: 0; }
.qr-mklink { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.qr-mklink p { margin: 0 0 6px; }
.qr-mklink .row > input { flex: 1; min-width: 6rem; }
.qr-mklink .err:empty { display: none; }
/* in a modal the preview sticks below the modal's own heading */
.modal .qr-pane { top: 72px; }
/* in a modal, tabbed boxes keep the height of their tallest tab, so switching
   tabs doesn't make the modal jump: the panels share one grid cell and the
   others are hidden without leaving the layout */
.modal .qr-look-stack { display: grid; }
.modal .qr-look-stack > .qr-lookpanel { grid-area: 1 / 1; min-width: 0; }
.modal .qr-look-stack > .qr-lookpanel[hidden] { display: block !important; visibility: hidden; }   /* over the global [hidden] rule */

/* the form designer: full width; steps as cards; the preview opens in a modal */
.tf-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.tf-edit-head > label { margin: 0; }
.tf-steps { display: grid; gap: 12px; margin-top: 6px; }
.tf-stepcard { display: grid; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px; background: var(--card-2); }
.tf-stepcard.single { border: 0; padding: 0; background: none; }
.tf-stephead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.tf-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--panel); display: grid; gap: 6px; }
.tf-row-main { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 8px; align-items: center; }
.tf-row-main > input, .tf-row-main > select { min-width: 0; }
.tf-row-sub { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tf-req-box { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.tf-row-tools { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tf-row-tools button { padding: 2px 6px; min-height: 0; }
.tf-row-tools select { width: auto; padding: 2px 6px; min-height: 0; font-size: 12px; }
.tf-row > input { font-size: 13px; }
.tf-cond { display: grid; gap: 6px; justify-items: start; }
.tf-cond-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tf-cond-line select { width: auto; max-width: 100%; min-height: 0; padding: 4px 8px; font-size: 13px; }
.tf-cond-vals { display: flex; gap: 4px 14px; flex-wrap: wrap; padding-left: 4px; }
.tf-cond-vals label { display: flex; gap: 4px; align-items: center; margin: 0; font-weight: 400; }
.tf-add { margin-top: 2px; }
.tf-add select { width: auto; }
button.tf-addstep { justify-self: start; }
.tf-more { margin-top: 12px; }
.tf-full { margin-top: 10px; }
.modal .tf-preview { padding: 4px 2px 8px; }
@media (max-width: 700px) {
  .tf-row-main { grid-template-columns: minmax(0, 1fr); }
  .tf-stephead { grid-template-columns: minmax(0, 1fr); }
}
.tf-row-flags { display: flex; gap: 14px; flex-wrap: wrap; }
/* a designed form's drop-off funnel */
.tf-funnel { display: grid; gap: 6px; margin: 14px 0 6px; }
.tf-funnel > label { margin: 0 0 2px; }
.tf-funnel-row { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) 3rem 3.5rem; gap: 10px; align-items: center; font-size: 13px; }
.tf-funnel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-funnel-track { height: 10px; border-radius: 5px; background: var(--card-2); overflow: hidden; }
.tf-funnel-bar { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; }
.tf-funnel-row > b { text-align: right; }
.tf-funnel-empty { margin: 12px 0 0; }
@media (max-width: 600px) { .tf-funnel-row { grid-template-columns: minmax(0, 1fr) 3rem; } .tf-funnel-track, .tf-funnel-row > span:last-child { display: none; } }
.tf-how { width: auto; margin-bottom: 8px; }

/* survey results: a bar per answer; recommend scores coloured by group */
.sv-bars { display: grid; gap: 5px; margin: 10px 0 4px; }
.sv-row { display: grid; grid-template-columns: minmax(2.5rem, 14rem) minmax(0, 1fr) 6rem; gap: 10px; align-items: center; font-size: 13px; }
.sv-scale .sv-row { grid-template-columns: 2.5rem minmax(0, 1fr) 6rem; }
.sv-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-track { height: 12px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.sv-bar { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.sv-bar.sv-pro { background: var(--ok); }
.sv-bar.sv-pas { background: var(--warn); }
.sv-bar.sv-det { background: var(--bad); }
.sv-big { margin: 6px 0; }
.sv-big b { font-size: 28px; }
.sv-answers { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.sv-answers li { white-space: pre-wrap; overflow-wrap: anywhere; }

/* the Forms page: a card per form; each opens in the studio (a modal) with
   numbered steps on the left and a sticky live preview and Save on the right */
.tf-card { align-items: stretch; }
button.tf-card-icon { flex: none; width: 72px; min-height: 72px; padding: 0; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-color: transparent; }
button.tf-card-icon:hover { background: var(--accent-soft); filter: brightness(.97); }
.tf-card-title { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-studio { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "q pane" "look pane" "who pane" "site pane" "admin pane"; }
.tf-s-q { grid-area: q; } .tf-s-look { grid-area: look; } .tf-s-who { grid-area: who; } .tf-s-site { grid-area: site; } .tf-s-admin { grid-area: admin; }
.tf-studio > .qr-step > label:first-of-type, .tf-studio .qr-lookpanel > label:first-child { margin-top: 0; }
.tf-pane { gap: 10px; max-height: calc(100vh - 140px); overflow: auto; }
.tf-pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tf-live { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.tf-live > p { margin: 0; }
button.tf-save { width: 100%; }
.tf-dirty:empty, .tf-pane > p.err:empty { display: none; }
.tf-pane .tf-funnel { margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.tf-pane .tf-funnel-row { grid-template-columns: minmax(0, 1fr) 6rem 2.5rem 3rem; }
.tf-pane .tf-funnel-empty { padding-top: 10px; border-top: 1px solid var(--line); }
.tf-gate { padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.tf-gate p { margin: 0 0 10px; max-width: 60ch; }
.tf-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-kinds small { font-size: 12px; }
form.tf-new > label:first-child { margin-top: 0; }
.tf-spam > h3 { margin-top: 18px; }
@media (max-width: 980px) {
  .tf-studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "q" "pane" "look" "who" "site" "admin"; }
  .tf-pane { max-height: none; }
}
@media (max-width: 560px) { .tf-kinds { grid-template-columns: minmax(0, 1fr); } }

/* Notice & hours: the notice bar and opening hours as studio steps, with a
   sticky preview of what the site shows now */
.ni-studio { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "notice pane" "hours pane" "site pane"; }
.ni-s-notice { grid-area: notice; } .ni-s-hours { grid-area: hours; } .ni-s-site { grid-area: site; }
.ni-studio > .qr-step > .checks:first-of-type { margin-top: 0; }
.ni-pane { gap: 10px; }
.ni-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-2); flex: none; }
.ni-site { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.ni-bar { position: relative; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; padding: 8px 30px 8px 12px; font: 13px/1.4 system-ui, sans-serif; text-align: center; }
.ni-bar.ni-off { opacity: .45; }
.ni-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.ni-page { display: grid; gap: 6px; padding: 12px; }
.ni-page span { height: 7px; border-radius: 4px; background: #e9e6df; }
.ni-page span:nth-child(2) { width: 80%; } .ni-page span:nth-child(3) { width: 55%; }
.ni-state { margin: 0; }
p.ni-open { margin: 6px 0 0; font-weight: 600; }
.ni-is-open { color: var(--ok); } .ni-is-closed { color: var(--ink-2); }
table.ni-hours { width: 100%; font-size: 13px; border-collapse: collapse; }
table.ni-hours th { text-align: left; font-weight: 500; padding: 3px 8px 3px 0; color: var(--ink-2); }
table.ni-hours td { text-align: right; padding: 3px 0; }
table.ni-hours tr.ni-today th, table.ni-hours tr.ni-today td { font-weight: 700; color: var(--ink); }
ul.ni-special { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 980px) {
  .ni-studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "notice" "pane" "hours" "site"; }
}
.ni-s-hours .row { flex-wrap: wrap; }
.ni-s-hours .row > input:not([type]), .ni-s-hours .row > input[aria-label="Note"] { flex: 1 1 10rem; min-width: 0; width: auto; }
table.ni-hours th, table.ni-hours td { border: 0; border-bottom: 1px solid var(--line); }
table.ni-hours tr:last-child th, table.ni-hours tr:last-child td { border-bottom: 0; }

/* Short links, like the QR page: cards; a link, a new link and a set each
   open in a small studio (two steps, the code beside them) */
.ln-studio { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "dest pane" "use pane"; }
.ln-s-dest { grid-area: dest; } .ln-s-use { grid-area: use; }
.ln-studio > .qr-step > label:first-of-type { margin-top: 0; }
.ln-pane { gap: 10px; }
.ln-pane .qr-img { max-width: 220px; }
.ln-pane button.link.danger { justify-self: start; padding-left: 0; }
p.ln-addr { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.ln-name { flex-wrap: nowrap; }
.ln-name > input { flex: 1; min-width: 4rem; }
.ln-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ln-kinds small { font-size: 12px; }
.ln-lines { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
form.ln-line { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
form.ln-line > .err { grid-column: 1 / -1; margin: 0; }
form.ln-line > .err:empty { display: none; }
.link-card .qr-card-img img { image-rendering: auto; }
@media (max-width: 980px) {
  .ln-studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "dest" "pane" "use"; }
}
@media (max-width: 560px) {
  form.ln-line { grid-template-columns: minmax(0, 1fr) auto; }
  form.ln-line > input { grid-column: 1 / -1; }
}

/* the overview: a tile per tool (status, what to do, its page), then health
   and the key side by side */
.ov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ov-tile { display: grid; align-content: start; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: inherit; text-decoration: none; min-width: 0; }
a.ov-tile:hover, a.ov-tile:focus-visible { border-color: var(--line-2); background: var(--card-2); }
.ov-tile.bad { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.ov-tile-head { display: flex; align-items: center; gap: 10px; }
.ov-tile-head > b { flex: 1; min-width: 0; }
.ov-icon { width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; background: var(--info-soft); color: var(--muted); flex: none; }
.ov-tile.ok .ov-icon { background: var(--ok-soft); color: var(--ok); }
.ov-tile.bad .ov-icon { background: var(--bad-soft); color: var(--bad); }
.ov-chip { white-space: nowrap; }
p.ov-text { margin: 0; font-size: 14px; color: var(--ink-2); }
p.ov-more { margin: 0; }
.ov-open { font-size: 13px; font-weight: 600; color: var(--link); margin-top: 2px; }
.ov-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 16px; align-items: start; }
@media (max-width: 560px) { .ov-two { grid-template-columns: minmax(0, 1fr); } }

/* the list pages (subscribers, inbox, survey results): an intro, a toolbar,
   then cards where they fit */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.toolbar > input[type=search] { flex: 1 1 16rem; width: auto; min-width: 0; }
.toolbar > select { width: auto; }
.toolbar > .toolbar-end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panel > .stats { margin-bottom: 14px; }
.msg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.msg-card { display: grid; gap: 8px; align-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.msg-card.spam { border-style: dashed; }
button.msg-open { display: grid; gap: 4px; text-align: left; padding: 0; border: 0; background: none; color: inherit; min-height: 0; font: inherit; cursor: pointer; }
button.msg-open:hover .msg-head b { text-decoration: underline; }
.msg-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-said { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.msg-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-tags:empty { display: none; }
dl.msg-fields { display: grid; grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr); gap: 6px 14px; margin: 8px 0 12px; }
dl.msg-fields dt { font-weight: 600; color: var(--ink-2); }
dl.msg-fields dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { dl.msg-fields { grid-template-columns: minmax(0, 1fr); } dl.msg-fields dd { margin-bottom: 6px; } }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; align-items: start; }
.sv-grid > .form-card { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sv-grid > .form-card > h3 { margin-top: 0; }
@media (max-width: 600px) { .sv-grid { grid-template-columns: minmax(0, 1fr); } }

/* all keys (admin): the table, tools as switches, the bar for the ticked keys */
table.keys-table td, table.keys-table th { vertical-align: middle; }
table.keys-table .pick { width: 2rem; }
table.keys-table .pick input { width: auto; margin: 0; }
table.keys-table tr.picked td { background: var(--accent-soft); }
.tool-sws { display: flex; gap: 4px; flex-wrap: wrap; }
button.tool-sw { min-height: 0; padding: 2px 8px; font-size: 12px; border-radius: 999px; background: var(--panel); color: var(--muted); }
button.tool-sw[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
button.tool-sw[aria-pressed="false"] { text-decoration: line-through; opacity: .75; }
.bulk-bar { position: sticky; top: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; margin: 0 0 10px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.bulk-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bulk-group select { width: auto; }
.bulk-bar button.link { margin-left: auto; }

/* Share previews: the page, the cards as each platform draws them, the checks beside */
.sp-studio { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "page pane" "cards pane" "fix pane"; }
.sp-s-page { grid-area: page; } .sp-s-cards { grid-area: cards; } .sp-s-fix { grid-area: fix; }
.sp-url { flex-wrap: nowrap; } .sp-url > input { flex: 1; min-width: 0; }
.sp-sites { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 8px; }
.sp-pane { gap: 10px; }
.sp-verdict { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius); }
.sp-verdict.ok { background: var(--ok-soft); color: var(--ok); } .sp-verdict.warn { background: var(--warn-soft); color: var(--warn); } .sp-verdict.bad { background: var(--bad-soft); color: var(--bad); }
table.sp-tags th { white-space: nowrap; vertical-align: top; padding-right: 8px; }
table.sp-tags td { overflow-wrap: anywhere; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
figure.sp-fig { margin: 0; min-width: 0; }
figure.sp-fig > figcaption { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
/* each card in roughly its platform's own colours, whatever the dashboard's theme */
.sp { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; color: #1c1e21; background: #fff; border: 1px solid #dadde1; }
.sp-img { aspect-ratio: 1.91 / 1; background: #e4e6eb; overflow: hidden; }
.sp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-img.sq { aspect-ratio: 1; width: 96px; flex: none; }
.sp-noimg { background: #e4e6eb; }
.sp-body { display: grid; gap: 2px; padding: 10px 12px; min-width: 0; }
.sp-title { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-desc { font-size: 13px; color: #606770; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-dom { font-size: 12px; color: #606770; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-fb { background: #f0f2f5; } .sp-fb .sp-desc { -webkit-line-clamp: 1; }
.sp-li { border-radius: 8px; } .sp-li .sp-title { font-size: 14px; }
.sp-x { position: relative; border-radius: 16px; border-color: #cfd9de; }
.sp-xdom { position: absolute; left: 10px; bottom: 10px; background: rgb(0 0 0 / 70%); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.sp-from { display: block; font-size: 12px; color: #536471; margin-top: 4px; }
.sp-xs { display: flex; border-radius: 16px; } .sp-xs .sp-img.sq { border-right: 1px solid #cfd9de; }
.sp-im { border-radius: 18px; background: #e9e9eb; border: 0; } .sp-im .sp-img { border-radius: 0; }
.sp-wa { background: #d9fdd3; border: 0; border-radius: 8px; padding: 4px; } .sp-wa .sp-img { border-radius: 6px; } .sp-wa .sp-body { padding: 6px 6px 4px; }
.sp-wa-row { display: flex; gap: 4px; } .sp-wa-row .sp-img.sq { width: 72px; border-radius: 6px; }
.sp-sl { display: grid; gap: 3px; border: 0; border-left: 4px solid #dddddd; padding: 2px 0 2px 12px; background: transparent; color: var(--ink); }
.sp-sl .sp-site { font-size: 14px; } .sp-sl .sp-link { color: #1264a3; font-weight: 700; font-size: 15px; } .sp-sl .sp-desc { color: var(--ink-2); -webkit-line-clamp: 3; }
.sp-sl .sp-img { max-width: 360px; border-radius: 8px; margin-top: 6px; }
@media (max-width: 980px) { .sp-studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "page" "pane" "cards" "fix"; } }

/* a web page's code: "Can this change later?" and the short link it makes */
.qr-shortrow { grid-column: 1 / -1; margin: 0; }
.qr-mkname { flex-wrap: nowrap; }
.qr-mkname > input { flex: 1; min-width: 4rem; }
/* a saved code made from a short link: where it goes, changed on the card */
.qr-card-short p { margin: 0 0 4px; }
form.qr-card-edit { flex-wrap: nowrap; gap: 6px; margin: 4px 0; }
form.qr-card-edit > input { flex: 1; min-width: 0; padding: 4px 8px; min-height: 0; font-size: 13px; }
form.qr-card-edit > button { padding: 4px 10px; min-height: 0; font-size: 13px; }
/* short links: the address large, which QR code uses it */
p.ln-big { font-size: 16px; color: var(--ink); margin: 0; }
p.ln-used { margin: 0 0 4px; color: var(--ink-2); }
.link-card h3 { font-family: var(--mono, ui-monospace, monospace); font-size: 14px; }

/* quick styles: a popover under their button, over the look's settings */
.qr-quick-wrap { position: relative; margin-left: auto; }
.qr-quick-wrap > button.qr-quick-toggle { margin-left: 0; }
.qr-quick-wrap > .qr-quick-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 6; margin: 0;
  width: min(560px, calc(100vw - 48px)); max-height: min(70vh, 520px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 18px 44px -14px rgb(0 0 0 / 40%); }

/* the form studio, one step at a time: the step bar, the step, Back / Next */
.tf-wiz { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "main pane"; }
.tf-wiz-main { grid-area: main; display: grid; gap: 12px; align-content: start; min-width: 0; }
ol.tf-wiz-bar { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ol.tf-wiz-bar button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; min-height: 0; border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: 14px; }
ol.tf-wiz-bar button .qr-step-n { background: var(--card-2); color: var(--muted); }
ol.tf-wiz-bar button.done .qr-step-n { background: var(--accent-soft); color: var(--accent); }
ol.tf-wiz-bar button[aria-current="step"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); font-weight: 600; }
ol.tf-wiz-bar button[aria-current="step"] .qr-step-n { background: var(--accent); color: var(--accent-ink); }
.tf-wiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 980px) { .tf-wiz { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "pane"; } }

/* questions: one line each, opening to edit */
.tf-stepcard.single { gap: 6px; }
.tf-row { padding: 0; gap: 0; overflow: hidden; }
.tf-q-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; }
button.tf-q-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 6px; min-height: 0; text-align: left; color: var(--ink); font-weight: 500; }
button.tf-q-toggle:hover { background: var(--card-2); }
.tf-q-type { flex: none; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--card-2); border-radius: 3px; padding: 2px 6px; }
.tf-q-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-badge { flex: none; font-size: 11px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; }
.tf-badge-if { border-color: var(--accent); color: var(--accent); }
.tf-row.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tf-row.open > .tf-q-head { border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.tf-q-body { display: grid; gap: 8px; padding: 10px 12px 12px; }
.tf-q-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.tf-q-move { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.tf-q-move select { width: auto; padding: 2px 6px; min-height: 0; font-size: 12px; }
/* adding a question: a menu of types */
.tf-add { margin-top: 4px; }
button.tf-add-btn { border-style: dashed; background: transparent; width: 100%; justify-content: center; color: var(--ink-2); }
button.tf-add-btn[aria-expanded="true"] { border-style: solid; border-color: var(--accent); color: var(--ink); }
.tf-add-menu { margin-top: 6px; padding: 4px 12px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
p.tf-add-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
.tf-add-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-add-opts button { padding: 4px 10px; min-height: 0; font-size: 13px; background: var(--panel); }
/* the steps sit in the main column (their old named areas don't apply here) */
.tf-wiz-main > .qr-step { grid-area: auto; }

/* questions: drag by the dots on the left; Required straight from the row */
button.tf-grip { flex: none; display: grid; place-items: center; width: 26px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--muted); cursor: grab; }
button.tf-grip:hover, button.tf-grip:focus-visible { color: var(--ink); background: var(--card-2); }
button.tf-grip:active { cursor: grabbing; }
button.tf-grip svg circle { fill: currentColor; stroke: none; }
button.tf-req-pill { flex: none; min-height: 0; padding: 2px 9px; font-size: 11px; font-weight: 600; border-radius: 999px; background: var(--panel); color: var(--muted); border: 1px dashed var(--line-2); }
button.tf-req-pill[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
button.tf-req-pill:disabled { opacity: .7; cursor: default; }
.tf-row.dragging { opacity: .45; }
.tf-row.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.tf-row.drop-after { box-shadow: 0 3px 0 var(--accent); }

/* Google reviews: the listing, the reviews and the site; the rating beside */
.rv-studio { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "listing pane" "list pane" "site pane"; }
.rv-s-listing { grid-area: listing; } .rv-s-list { grid-area: list; } .rv-s-site { grid-area: site; }
.rv-studio > .qr-step > label:first-of-type { margin-top: 0; }
.rv-pane { gap: 8px; }
.rv-pane p { margin: 0; }
p.rv-big { display: flex; align-items: baseline; gap: 6px; }
p.rv-big b { font-size: 30px; }
.rv-stars { color: #e3a008; letter-spacing: 1px; }
.rv-list { display: grid; gap: 10px; max-height: 70vh; overflow: auto; }
.rv-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel); display: grid; gap: 6px; }
.rv-card.off { background: var(--card-2); }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-head .chip { margin-left: auto; }
p.rv-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
p.rv-reply { margin: 0; padding-left: 10px; border-left: 3px solid var(--line-2); color: var(--ink-2); font-size: 14px; }
@media (max-width: 980px) { .rv-studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "listing" "pane" "list" "site"; } }
h4.rv-h { margin: 4px 0 6px; font-size: 14px; }
h4.rv-h ~ h4.rv-h { margin-top: 16px; }
ol.rv-steps { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
ol.rv-steps .button { padding: 4px 10px; min-height: 0; font-size: 13px; }
/* Google reviews with several businesses: cards that each open a studio */
.rv-place h3 button.rv-open { padding: 0; min-height: 0; font: inherit; font-weight: 600; text-align: left; }
.rv-place p.mono { overflow-wrap: anywhere; }
.rv-nav { justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.rv-nav > p.qr-intro { margin: 0; flex: 1; min-width: 220px; }
form.rv-new > label:first-of-type { margin-top: 0; }
/* numbered sets on the QR page: the second button beside "New QR code", the hint or panel under a first code */
.panel-head .qr-new { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.qr-first + .panel, .qr-first + p.qr-sets-hint { margin-top: 20px; }
p.ln-sets-note { margin: 12px 0 0; }
