/* The SOQ Builder on the Staff Portal (templates/admin_soq.html), dressed as the website: its colours, fonts, buttons and
   fields over the builder's own CSS (soq.css), the bar in the site's maroon, and what static/soq/soq-site.js adds.
   The SOQ pages themselves (.dz-*, .lo-*) keep their own colours: they are the document, not the app.

   The builder names its colours --ws (the ground), --panel (cards, menus, fields), --ink, --mute, --line, --soft,
   --brand and --blue (links, focus). Each takes the site's value here, light and dark (the footer's Appearance switch,
   kept as kem-theme, set before the page draws). */
:root {
  --ws: #FBF7EF; --panel: #FFFFFF; --ink: #1B1714; --mute: #6B5F55; --line: #E2D7C3; --soft: #F3EBD9;
  --brand: #660000; --brand2: #4A0000; --tan: #EFE1BE; --blue: #660000; --hl: #F6EDD6;
  --ok: #2D6A43; --warn: #8A5A0B; --bad: #B3261E;
  --ui: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hd: var(--ui);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --line-strong: #C9BBA4; --control: #8C8076; --focus: #1B1714; --accent: #660000;
  --scrim: rgba(27, 23, 20, 0.45); --pop-shadow: 0 1px 2px rgba(27, 23, 20, 0.08), 0 12px 32px rgba(27, 23, 20, 0.16);
  --canvas: #E9E2D6; --ease-out: cubic-bezier(.23, 1, .32, 1); --bar-h: 60px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ws: #161210; --panel: #241D19; --ink: #F2EAE0; --mute: #A99B8E; --line: #3B322C; --soft: #1F1915;
  --brand: #660000; --brand2: #4A0000; --blue: #E89A8E; --hl: #3A2E22;
  --ok: #7CC495; --warn: #E0A951; --bad: #F08A80;
  --line-strong: #6E6054; --control: #8A7C70; --focus: #EFE1BE; --accent: #E89A8E;
  --scrim: rgba(0, 0, 0, 0.6); --pop-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.55);
  --canvas: #0E0B0A;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ the page */
@media screen {
  body { display: flex; flex-direction: column; }
  .app { flex: 1 1 auto; min-height: 0; height: auto; }
}
.app[hidden] { display: none; }
body { background: var(--ws); color: var(--ink); font: 15px/1.5 var(--ui); font-optical-sizing: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--tan) 80%, transparent); color: var(--ink); }
a { color: var(--accent); }
main { padding: 28px 32px 64px; }

/* headings: the site's serif for a page's title and its sections; everything else stays in the sans */
h1.ph, .home-hd h1, .soq-gate h1 { font: 600 2rem/1.1 var(--serif); letter-spacing: -0.012em; color: var(--ink); }
h1.ph { margin: 0 0 6px; }
h2.sh { font: 600 1.3rem/1.2 var(--serif); letter-spacing: -0.005em; }
h2.sh small { font: 400 13.5px var(--ui); }
p.lede { color: var(--mute); font-size: 16px; line-height: 1.55; }
.note { color: var(--mute); }

/* ------------------------------------------------------------------ the bar */
/* before the builder opens (signing in, or an account without SOQs) and the builder's own bar: one look */
.soqbar, header.top {
  display: flex; align-items: center; gap: 6px; flex: none; min-height: var(--bar-h);
  padding: 0 12px 0 16px; background: var(--brand); color: var(--tan);
  border: 0; box-shadow: none; position: relative; z-index: 5;
}
.soqbar[hidden] { display: none; }
.soqbar .top-sp, header.top .top-sp { flex: 1; }
.mark, header.top button.mark {
  display: inline-flex; align-items: center; gap: 12px; flex: none; min-height: 44px; padding: 4px 10px 4px 0;
  border: 0; background: none; color: var(--tan); text-decoration: none; cursor: pointer; border-radius: 6px;
}
.mark img, header.top button.mark img { display: block; width: 131px; height: 44px; }
.mark span { font: 600 1.15rem/1 var(--serif); letter-spacing: -0.005em; color: var(--tan); padding-left: 12px; border-left: 1px solid rgba(239, 225, 190, 0.4); white-space: nowrap; }
.mark:focus-visible, header.top :focus-visible, .soqbar :focus-visible { outline-color: var(--tan); }
.soqbar-link { color: var(--tan); font: 600 14.5px var(--ui); text-decoration: none; padding: 10px 12px; border-radius: 6px; }
.soqbar-link:hover { background: rgba(239, 225, 190, 0.12); }
.mark { transition: opacity .15s ease, transform .16s var(--ease-out); }
@media (hover: hover) { button.mark:hover { opacity: .88; } }
button.mark:active { transform: scale(.98); }

header.top .btn { background: transparent; border-color: transparent; color: var(--tan); min-height: 40px; }
header.top .btn:hover { background: rgba(239, 225, 190, 0.12); border-color: transparent; }
header.top .menu > .btn[aria-expanded="true"] { background: rgba(239, 225, 190, 0.18); }
/* Library on home: a quiet outlined button; Export: the site's cream button */
header.top > .btn[data-act="toLibrary"] { border-color: rgba(239, 225, 190, 0.55); }
header.top > .btn[data-act="toLibrary"]:hover { border-color: var(--tan); }
header.top .btn.primary { background: var(--tan); border-color: var(--tan); color: var(--brand); }
header.top .btn.primary:hover { background: #F6ECD3; border-color: #F6ECD3; }
header.top .menu > .btn.primary[aria-expanded="true"] { background: #F6ECD3; }
header.top .top-back { color: var(--tan); opacity: .88; font-weight: 600; padding-inline: 10px; }
header.top .top-back:hover { opacity: 1; color: var(--tan); }
header.top .top-title { font: 600 1.15rem/1 var(--serif); color: #FBF7EF; padding-left: 4px; }
/* the SOQ's name, typed in the bar */
header.top .top-name {
  font: 600 1.1rem/1.2 var(--serif); color: #FBF7EF; background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 7px 10px; width: 100%; max-width: 360px; min-width: 0; text-overflow: ellipsis;
}
header.top .top-name:hover { border-color: rgba(239, 225, 190, 0.45); background: rgba(0, 0, 0, 0.12); }
header.top .top-name:focus { border-color: var(--tan); background: rgba(0, 0, 0, 0.2); outline: none; }
header.top .top-name:focus-visible { outline: 2px solid var(--tan); outline-offset: 1px; }
/* who else has this SOQ open */
header.top .sh-pres { color: var(--tan); background: rgba(239, 225, 190, 0.12); border: 1px solid rgba(239, 225, 190, 0.35); font: 600 13px var(--ui); padding: 4px 12px; margin-right: 4px; max-width: 280px; }
.hm-meta .sh-open { background: var(--hl); color: var(--ink); border-color: var(--line-strong); }
/* your name, with the Staff Portal and Sign Out under it */
header.top .top-user { margin-left: 4px; }
.app.view-build header.top > .top-staff { display: none; }
header.top .top-user > .btn { gap: 8px; max-width: 240px; font-weight: 500; }
.top-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-chev { width: 8px; height: 8px; flex: none; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .8; }
header.top .top-user .menu-pop { min-width: 230px; }

/* In an SOQ the bar has two rows: the bar itself (what this is, its name, Export and the menus) and, under it, the steps
   on a light band. One grid, so the builder's markup stays as it is. */
.app.view-build header.top {
  display: grid; padding: 0; column-gap: 4px; row-gap: 0; align-items: center;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto auto; grid-template-rows: var(--bar-h) auto;
}
.app.view-build header.top > * { grid-row: 1; }
.app.view-build header.top > .mark { grid-column: 1; margin-left: 16px; }
.app.view-build header.top > .top-back { grid-column: 2; }
.app.view-build header.top > .top-name { grid-column: 3; justify-self: stretch; }
.app.view-build header.top > .top-sp { display: none; }
.app.view-build header.top > .sh-pres { grid-column: 4; }
.app.view-build header.top > .top-m-export { grid-column: 5; margin-left: 6px; }
.app.view-build header.top > .top-m-more { grid-column: 6; }
.app.view-build header.top > .top-user { grid-column: 7; margin-right: 12px; }
.app.view-build header.top > .wz {
  grid-row: 2; grid-column: 1 / -1; margin: 0; padding: 6px 16px; min-height: 52px; gap: 2px;
  justify-content: safe center; overflow-x: auto; scrollbar-width: none;
  background: var(--panel); border-bottom: 1px solid var(--line); color: var(--ink);
}
.app.view-build header.top > .wz::-webkit-scrollbar { display: none; }

/* the steps */
.wz-s {
  min-height: 40px; padding: 6px 12px 6px 8px; border-radius: 999px; color: var(--mute); font: 500 14.5px var(--ui);
  transition: background-color .15s ease, color .15s ease, transform .16s var(--ease-out);
}
@media (hover: hover) { .wz-s:hover { background: var(--soft); color: var(--ink); } }
.wz-s:active { transform: scale(.97); }
.wz-n { width: 24px; height: 24px; border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--mute); font: 600 12.5px var(--ui); font-variant-numeric: tabular-nums; }
.wz-s.on { color: var(--ink); font-weight: 700; background: var(--soft); }
.wz-s.on .wz-n { background: var(--brand); border-color: var(--brand); color: var(--tan); }
.wz-s.done .wz-n { border-color: var(--control); color: var(--ink); }
.wz-ln { width: 18px; background: var(--line-strong); }
/* the steps have a row of their own, so each keeps its name down to a narrow window */
.wz-s:not(.on) .wz-t { display: inline; }
@media (max-width: 760px) { .wz-s:not(.on) .wz-t { display: none; } }

/* ------------------------------------------------------------------ buttons and fields, as on the site */
.btn {
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); color: var(--ink); font: 600 14.5px/1.2 var(--ui);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease-out);
}
.btn:hover { border-color: var(--control); background: color-mix(in srgb, var(--soft) 55%, var(--panel)); }
@media (hover: none) { .btn:hover { border-color: var(--line-strong); background: var(--panel); } .btn.primary:hover { background: var(--brand); border-color: var(--brand); } }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #FBF7EF; }
.btn.primary:hover { background: var(--brand2); border-color: var(--brand2); }
:root[data-theme="dark"] .btn.primary { box-shadow: inset 0 0 0 1px rgba(239, 225, 190, 0.55); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--soft); border-color: transparent; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13.5px; border-radius: 6px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; }
label.btn { cursor: pointer; }

label.f { font-size: 13.5px; font-weight: 500; color: var(--mute); gap: 5px; }
label.f input, label.f textarea, label.f select, .inp {
  border: 1px solid var(--control); background: var(--ws); color: var(--ink); border-radius: 6px;
  padding: 8px 11px; font: 15px/1.4 var(--ui); min-height: 40px;
}
label.f textarea { min-height: 72px; }
label.f input:focus-visible, label.f textarea:focus-visible, label.f select:focus-visible, .inp:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: 1; }
.chk input { accent-color: var(--brand); }
:root[data-theme="dark"] .chk input { accent-color: var(--accent); }
.seg { border: 1px solid var(--control); border-radius: 6px; }
.seg button { font: 600 14px var(--ui); padding: 8px 14px; background: var(--panel); color: var(--mute); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--brand); color: #FBF7EF; }
.tag { border-radius: 999px; padding: 1px 8px; background: var(--soft); border-color: var(--line); color: var(--mute); }
.tag.sug { background: var(--hl); border-color: var(--line-strong); }

/* ------------------------------------------------------------------ surfaces */
.panel, .list, .ai { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.panel { padding: 18px 20px; margin-bottom: 16px; }
.drop { border: 2px dashed var(--line-strong); border-radius: 10px; background: color-mix(in srgb, var(--soft) 60%, var(--ws)); }
.drop b { font: 600 1.25rem var(--serif); }
.drop.hot { border-color: var(--brand); background: var(--hl); }
/* callouts and warnings: a tint and a full edge, not a stripe down one side */
.warnbox { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 8px; background: var(--hl); }
.sty-rec-bar, .cl-bar, .ck-sug, .fmt-card, .tour { border: 1px solid var(--line-strong); background: var(--hl); }
.std-note { border-left: 0; padding: 8px 12px; background: var(--soft); border-radius: 6px; }
table.t th { color: var(--mute); font-weight: 600; }
table.t td, table.t th { border-bottom-color: var(--line); }
.li { border-top-color: var(--line); }
.prog { background: var(--soft); }
.prog i { background: var(--brand); }
:root[data-theme="dark"] .prog i { background: var(--accent); }
.lb-unl, .lb-cmp { background: var(--soft); }
:root[data-theme="dark"] .xp-card { background: #3A1814; border-color: #6E2C24; }
:root[data-theme="dark"] .xp-card .ins-h, :root[data-theme="dark"] .xp-fl, :root[data-theme="dark"] .xp-r-over .xp-t { color: #F6C9C1; }
.addbtn { border-color: var(--line); background: var(--panel); border-radius: 8px; transition: border-color .15s ease, background-color .15s ease; }
/* maroon as text: the accent instead, which is maroon in light and a light rose in dark */
.addbtn span, .hm-plus, .ai-dots, .dz-phadd, .ab-card.live .ab-txt::after, .part-n, .tour-k, .sty-rec, .sty2-in { color: var(--accent); }
.addbtn:hover { border-color: var(--accent); background: var(--hl); }

/* the step's buttons along the bottom */
.stepnav { background: color-mix(in srgb, var(--ws) 90%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top-color: var(--line); }
@media (prefers-reduced-transparency: reduce) { .stepnav { background: var(--ws); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* the Library's list of what's in it */
nav.rail { background: var(--panel); border-right-color: var(--line); }
.step { border-radius: 8px; transition: background-color .15s ease; }
.step .t { font: 600 15px/1.25 var(--ui); }
.step .n { font: 600 12.5px var(--ui); border-color: var(--line-strong); }
.step:hover { background: var(--soft); }
.step.on { background: var(--hl); }
.step.on .n { background: var(--brand); border-color: var(--brand); color: var(--tan); }
.step.done .n { border-color: var(--control); color: var(--ink); }

/* ------------------------------------------------------------------ menus, dialogs, the busy box and messages */
.menu-pop {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--pop-shadow);
  padding: 6px; transform-origin: top right; animation: soq-pop .16s var(--ease-out);
}
.menu-pop button { padding: 9px 10px; border-radius: 6px; font: 500 14.5px var(--ui); color: var(--ink); min-height: 40px; }
.menu-pop button small { font-size: 12.5px; color: var(--mute); }
.menu-pop button small::first-letter { text-transform: uppercase; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--soft); outline: none; }
.menu-pop hr { border-top-color: var(--line); }
.menu-pop .dot { background: var(--line-strong); }
.menu-pop .dot.ok { background: var(--ok); }
@keyframes soq-pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.modal { background: var(--scrim); }
.modal:not([hidden]) > .modal-box { animation: soq-rise .2s var(--ease-out); }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: var(--pop-shadow); }
@keyframes soq-rise { from { opacity: 0; transform: scale(.98) translateY(6px); } }
.busy { background: color-mix(in srgb, var(--scrim) 70%, transparent); }
.busy > div { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop-shadow); padding: 18px 22px; animation: soq-rise .2s var(--ease-out); }
#busyMsg { font-weight: 600; }
.toast {
  background: var(--ink); color: var(--ws); border-radius: 8px; padding: 11px 18px; font: 500 14.5px/1.35 var(--ui);
  box-shadow: var(--pop-shadow); max-width: min(560px, calc(100vw - 32px)); animation: soq-toast .22s var(--ease-out);
}
@keyframes soq-toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------------------------ home */
main.home-main { padding: 36px clamp(16px, 4vw, 40px) 72px; }
.home-hd h1 { margin: 0 0 6px; }
.hm-grid { gap: 32px 24px; }
.hm-page { border-radius: 4px; box-shadow: 0 1px 2px rgba(27, 23, 20, 0.12), 0 8px 20px rgba(27, 23, 20, 0.08); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.hm-open:hover .hm-page, .hm-new:hover .hm-page { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .hm-open:hover .hm-page, .hm-new:hover .hm-page { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(27, 23, 20, 0.12), 0 16px 32px rgba(27, 23, 20, 0.14); }
}
.hm-open:active .hm-page, .hm-new:active .hm-page { transform: scale(.98); }
.hm-open:focus-visible .hm-page, .hm-new:focus-visible .hm-page { outline: 3px solid var(--focus); outline-offset: 3px; }
.hm-new .hm-page { border: 2px dashed var(--line-strong); background: transparent; }
.hm-new:hover .hm-page { background: color-mix(in srgb, var(--tan) 30%, transparent); }
.hm-meta b { font: 600 15.5px/1.3 var(--ui); }
/* the small print on the cover miniatures and the page tools: 11px or more */
.hm-kick { font-size: 11px; letter-spacing: .04em; }
.hm-cl { font-size: 12px; }
.edb-lab, .dz-phb span { font-size: 11.5px; }
.hm-more > .btn { background: rgba(251, 247, 239, 0.92); color: #1B1714; min-height: 32px; }
.hm-past summary, .hm-subs > summary, .wz-more > summary { font: 600 1.1rem var(--serif); }
.hm-loading { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 15.5px; margin: 8px 0; }
.hm-fail { max-width: 640px; }
/* the title, with Import an SOQ File beside it */
.home-hd { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: end; margin-bottom: 28px; }
.home-hd > h1, .home-hd > .lede { grid-column: 1; }
.home-hd > .lede { margin: 0; }
.home-hd > .lb-home-acts { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
@media (max-width: 640px) { .home-hd { grid-template-columns: 1fr; } .home-hd > .lb-home-acts { grid-column: 1; grid-row: auto; margin-top: 16px; } }

/* ------------------------------------------------------------------ the pages: a warm canvas, the tools on it */
.viewer { background: var(--canvas); }
.pf { box-shadow: 0 1px 3px rgba(27, 23, 20, 0.18), 0 8px 24px rgba(27, 23, 20, 0.14); }
.pf .pn { color: var(--mute); font-variant-numeric: tabular-nums; }
.vbar { flex-wrap: wrap; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(27, 23, 20, 0.04); }
.vbar .btn { background: var(--panel); border-color: var(--line-strong); color: var(--ink); min-height: 34px; padding: 5px 10px; font-size: 13.5px; }
.vbar .btn:hover { border-color: var(--control); }
.vbar .vsep { background: var(--line); }
.vbar .vlab, .vbar .vzoom, .vbar .vcount { color: var(--mute); }
body.dz-fs .vbar .vlab, body.dz-fs .vbar .vzoom, body.dz-fs .vbar .vcount { color: #D1C5B6; }
.vbar .fs-pg { color: var(--ink); font-family: var(--ui); }
.vbar .fs-seg { border-color: var(--line-strong); }
.vbar .fs-seg button { background: var(--panel); color: var(--ink); font-family: var(--ui); }
.vbar .fs-seg button + button { border-left-color: var(--line-strong); }
.dz-strip, .side { background: var(--panel); border-color: var(--line); }
.ins-tabs { background: var(--panel); border-bottom-color: var(--line); }
.ins-tabs button { font: 600 14.5px var(--ui); }
.ins-tabs button.on { border-bottom-color: var(--brand); }
:root[data-theme="dark"] .ins-tabs button.on { border-bottom-color: var(--accent); }
.ins-crumb b, .ins-h, .ins-doc summary { font-family: var(--ui); }
.ins-crumb b { font: 600 1.25rem var(--serif); }
/* the floating text tools: the site's ink */
.dz-tb { background: #1B1714; font-family: var(--ui); }
.dz-tb > button:hover { background: #3B322C; }
.dz-tb .tb-sz { color: #D1C5B6; }
.dz-tb .tb-sep { background: #4A403A; }
.dz-tb .tb-pop { border-top-color: #3B322C; }
.dz-tb .tb-pop .sw { box-shadow: inset 0 0 0 2px #1B1714; }
.dz-tb .tb-txt { background: #2B2420; }
/* full screen: the pages on a dark ground, the tools dark too */
body.dz-fs .viewer { background: #1B1714; }
body.dz-fs .vbar { background: rgba(27, 23, 20, 0.92); border-bottom-color: #3B322C; }
body.dz-fs .vbar .btn, body.dz-fs .vbar .fs-seg button { background: #2B2420; border-color: #4A403A; color: #EFE1BE; }
body.dz-fs .vbar .fs-seg { border-color: #4A403A; }
body.dz-fs .vbar .fs-pg { color: #EFE1BE; }
body.dz-fs .pf .pn { color: #A99B8E; }

/* ------------------------------------------------------------------ signing in, or no SOQs on the account */
.soq-checking { margin: 48px auto; text-align: center; color: var(--mute); }
.soq-gate { max-width: 560px; margin: 56px auto; padding: 24px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.soq-gate[hidden] { display: none; }
.soq-gate h1 { margin: 0 0 10px; }
.soq-gate .btn { text-decoration: none; }

/* ------------------------------------------------------------------ what soq-site.js adds to the Library */
.soq-bring .row { gap: 12px; align-items: center; margin-top: 8px; }
.soq-match details { margin-top: 8px; }
.soq-match summary { cursor: pointer; font-weight: 600; }
.soq-match summary small { font-weight: 400; color: var(--mute); margin-left: 4px; }
.soq-match b { display: block; margin-top: 8px; }
.soq-names { max-height: 220px; overflow: auto; columns: 2; column-gap: 24px; }
/* the record editors: from the website, and the way back to its text */
.soq-from { margin: 6px 0 0; }
.soq-lab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.soq-back { padding: 1px 8px; font-size: 12px; }
h2 .soq-back { margin-left: 8px; vertical-align: middle; }

/* ------------------------------------------------------------------ smaller screens */
/* in an SOQ, ‹ All SOQs says where the sign goes */
.app.view-build header.top > .mark span { display: none; }
@media (max-width: 1000px) {
  .app.view-build header.top > .sh-pres { display: none; }
}
@media (max-width: 900px) {
  main, main.wz-main { padding: 20px 16px 56px; }
  /* the pages: the canvas takes the window, the panel sits under it (the page strip isn't needed: tap a page) */
  .pv > .dz-strip { display: none; }
  .pv > .viewer { flex: 1 1 auto; min-height: 0; }
  .pv > .side { flex: 0 0 auto; max-height: 42%; overflow: auto; border-top: 1px solid var(--line); }
  header.top > .mark span, .soqbar .mark span { display: none; }
  .top-who { max-width: 120px; }
  .app.view-build header.top > .top-back { padding-inline: 6px; }
}
@media (max-width: 640px) {
  .mark img, header.top button.mark img { width: 96px; height: 32px; }
  header.top > .top-staff { display: none; }
  /* in an SOQ: the sign, Export and the menus; then ‹ All SOQs and the name; then the steps */
  .app.view-build header.top { grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-rows: 56px auto auto; }
  .app.view-build header.top > .mark { grid-column: 1; margin-left: 12px; }
  .app.view-build header.top > .top-m-export { grid-column: 3; }
  .app.view-build header.top > .top-m-more { grid-column: 4; }
  .app.view-build header.top > .top-user { grid-column: 5; margin-right: 8px; }
  .app.view-build header.top > .top-back { grid-row: 2; grid-column: 1; margin: 0 0 8px 6px; }
  .app.view-build header.top > .top-name { grid-row: 2; grid-column: 2 / -1; margin: 0 12px 8px 0; max-width: none; }
  .app.view-build header.top > .wz { grid-row: 3; justify-content: flex-start; padding-inline: 8px; }
  header.top, .soqbar { padding-left: 12px; padding-right: 8px; }
  .top-who { display: none; }
  header.top .top-name { width: 100%; }
  .app.view-build header.top > .sh-pres { display: none; }
  h1.ph, .home-hd h1 { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-pop, .modal:not([hidden]) > .modal-box, .busy > div, .toast { animation: none; }
  .btn:active:not(:disabled), .wz-s:active, .hm-open:active .hm-page, .hm-new:active .hm-page { transform: none; }
}
body.dz-fs .soqbar { display: none; }
@media print { .soqbar, .soq-checking, .soq-gate { display: none !important; } }
