:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5d6877;
  --border: #d8dee6;
  --brand: #1f4e79;
  --brand-hover: #173d60;
  --brand-soft: #e8f0f8;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #1d7a4c;
  --ok-soft: #e5f4ec;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
form.inline { display: inline; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1.25rem; color: #fff;
  background: linear-gradient(100deg, #173d60 0%, #1f4e79 55%, #2a5f93 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 8px rgba(16, 24, 40, .12);
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.brand-logo { width: 4.2rem; height: 4.2rem; display: block; }
.brand-logo.large { width: 3.75rem; height: 3.75rem; }
/* Tall, narrow, lighter lettering for the "Phineas" name.
   Bahnschrift ships with Windows 10/11; the others are condensed fonts on Android, iPhone and Mac. */
.wordmark {
  font-family: "Bahnschrift", "Bahnschrift Condensed", "Roboto Condensed", "Helvetica Neue", "Arial Narrow", sans-serif-condensed, system-ui, sans-serif;
  font-stretch: 75%;           /* condensed (narrower letters) */
  font-weight: 400;            /* thinner strokes */
  font-size: 1.55rem; letter-spacing: 0; line-height: 1;
}
.brand { gap: .9rem; }
/* The version sits just under the name without taking up layout space,
   so the logo mark, the name and the icons all share one centre line. */
.brand-text { position: relative; display: inline-block; }
.app-version { font-size: .7rem; font-weight: 500; letter-spacing: .06em; color: rgba(255, 255, 255, .7); line-height: 1; white-space: nowrap; }
.brand-text .app-version { position: absolute; left: .1em; top: calc(100% + .15rem); }
.auth-brand .app-version { color: var(--muted); margin: .45rem 0 0; font-size: .75rem; }
.brand .wordmark { font-size: 3rem; }
.brand .wordmark::after { content: ""; display: inline-block; width: .32em; height: .32em; margin-left: .12em; border-radius: 50%; background: #3ddc97; vertical-align: baseline; }
/* Top bar name: every 10 seconds each letter gently tips round and settles back, in turn
   from P to s (a soft ripple), first about 3 seconds after the page opens. As each letter
   turns it catches the light (a brief white-and-blue glow), so a shimmer runs along the name. */
/* .on-light (the sign-in page: blue letters on a light card) shines lighter blue instead of white. */
.spin-letters {
  --spin-start: 3s;
  --shine: #f2fbff;
  --shine-glow: 0 0 4px rgba(255, 255, 255, .95), 0 0 12px rgba(140, 210, 255, .85), 0 0 22px rgba(61, 220, 151, .35);
  --shine-fade: 0 0 3px rgba(255, 255, 255, .35);
}
.spin-letters.on-light {
  --spin-start: 1.5s;
  --shine: #1e90ff;
  --shine-glow: 0 0 4px rgba(30, 144, 255, .9), 0 0 12px rgba(30, 144, 255, .75), 0 0 26px rgba(30, 144, 255, .5), 0 0 40px rgba(61, 220, 151, .55);
  --shine-fade: 0 0 6px rgba(30, 144, 255, .45), 0 0 18px rgba(61, 220, 151, .3);
}
/* Each letter's resting colour is --letter-color, so "FST" keeps its own colour through the shimmer. */
.brand .wordmark { --letter-color: #fff; }
h1.wordmark { --letter-color: var(--brand); }
.spin-letters > span { display: inline-block; color: var(--letter-color); animation: letter-spin 10s ease-in-out infinite; animation-delay: calc(var(--spin-start) + var(--i) * .12s); }
@keyframes letter-spin {
  0%        { transform: perspective(400px) rotateY(0deg);   color: var(--letter-color); text-shadow: none; }
  5%        { transform: perspective(400px) rotateY(40deg);  color: var(--shine); text-shadow: var(--shine-glow); }
  10%       { transform: perspective(400px) rotateY(-12deg); color: var(--letter-color); text-shadow: var(--shine-fade); }
  14%, 100% { transform: perspective(400px) rotateY(0deg);   color: var(--letter-color); text-shadow: none; }
}
/* "PhineasFST": the FST is italic and in Phineas mint green (a deeper green on the light sign-in page). */
.wordmark .fst { --letter-color: #3ddc97; font-style: italic; }
.wordmark .fst-first { margin-left: -.02em; }
h1.wordmark .fst { --letter-color: #17a06b; }
@media (prefers-reduced-motion: reduce) { .spin-letters > span { animation: none; } }
h1.wordmark { font-size: 2rem; color: var(--brand); }
h1.wordmark::after { content: ""; display: inline-block; width: .26em; height: .26em; margin-left: .1em; border-radius: 50%; background: #2fbf8f; }
.topbar nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.topbar nav a, .navlink {
  color: #fff; text-decoration: none; padding: .4rem .65rem; border-radius: 6px; font: inherit; font-size: .95rem;
  background: none; border: 0; cursor: pointer;
}
.topbar nav a:hover, .navlink:hover { background: rgba(255, 255, 255, .14); }
.brand-group { display: flex; align-items: center; gap: .6rem; }
.nav-icon { display: inline-grid; place-items: center; padding: .35rem .5rem; border-radius: 8px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
.nav-icon:hover { background: rgba(255, 255, 255, .22); }
.nav-icon.active { background: rgba(255, 255, 255, .28); border-color: rgba(255, 255, 255, .55); }
.nav-icon { position: relative; }
.icon-badge { position: absolute; top: -.45rem; right: -.45rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px;
  display: grid; place-items: center; background: #fff; color: var(--brand); font-size: .68rem; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 2px #1f4e79; }
.brand-group .nav-icon + .nav-icon { margin-left: -.25rem; }
.nav-icon:focus-visible { outline: 3px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.nav-icon svg { width: 1.4rem; height: 1.4rem; display: block; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem 1rem; border-radius: var(--radius); border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  min-height: 2.6rem; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); }
.btn.secondary { background: var(--surface); color: var(--brand); border-color: var(--border); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #f0c5c0; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: .3rem .6rem; min-height: 2rem; font-size: .875rem; }
.btn.block { width: 100%; margin-top: 1rem; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: .25rem; text-decoration: underline; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .7rem; min-height: 2.6rem;
}
textarea { resize: vertical; min-height: 4.5rem; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(31, 78, 121, .3); outline-offset: 1px; border-color: var(--brand);
}
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.req { color: var(--danger); }

.stack label { margin-top: .9rem; }

/* ---------- flash messages ---------- */
.flash {
  padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe3cf;
}
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: #f3c7c2; }

/* ---------- sign in ---------- */
body.auth { min-height: 100vh; background: linear-gradient(160deg, #e9f0f7 0%, #f6f8fb 60%); }
body.auth main { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem 1rem; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px;
  padding: 2rem 1.75rem; box-shadow: 0 10px 30px rgba(16, 24, 40, .08), var(--shadow);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .8rem; margin-bottom: 1.5rem; }
.auth-brand p { margin: .35rem 0 0; }
.auth-brand .brand-logo.large { width: 4.5rem; height: 4.5rem; }
.auth-brand h1.wordmark { font-size: 2.7rem; }
.auth-brand h1:not(.wordmark) { font-size: 1.5rem; }
.auth-card > .muted { margin: 1.25rem 0 0; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
/* ---------- weekly planner ---------- */
.planner-head { align-items: center; }
.week-range { margin: .3rem 0 0; }
.planner-nav { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.planner-nav .btn[aria-current] { background: var(--brand-soft); }
.planner-nav .jump input { width: auto; min-height: 2.6rem; }
.planner-note { margin: -.5rem 0 1rem; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 15rem; min-width: 0; }
.day.weekend { background: #fafbfc; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31, 78, 121, .18), var(--shadow); }
.day-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .4rem; padding: .55rem 2.3rem .55rem .65rem; border-bottom: 1px solid var(--border); position: relative; }
.day.today .day-head { background: var(--brand-soft); border-radius: var(--radius) var(--radius) 0 0; }
.day-name { font-weight: 700; }
.day-name .short { display: none; }
.day-date { color: var(--muted); font-size: .85rem; }
.today-pill { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--brand); padding: .05rem .4rem; border-radius: 999px; }
.day-add { position: absolute; top: .4rem; right: .45rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 6px; text-decoration: none; font-weight: 700; color: var(--brand); border: 1px dashed transparent; }
.day-add:hover, .day-add:focus-visible { border-color: var(--brand); background: #fff; }
.day-body { padding: .45rem; display: grid; gap: .4rem; align-content: start; flex: 1; }
.day-empty { color: #a3adb9; font-size: .8rem; margin: .25rem .2rem; }
.entry { display: grid; gap: .1rem; padding: .4rem .5rem .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--c) 9%, #fff); border-left: 4px solid var(--c); min-width: 0; }
.entry:hover { background: color-mix(in srgb, var(--c) 16%, #fff); }
.entry-time { font-size: .72rem; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .03em; }
.entry-title { font-weight: 600; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.entry-meta { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.entry-meta.people::before { content: "Who: "; font-weight: 600; }
/* Check in / check out (planner.js): times on calendar entries, and the buttons */
.entry-att { display: flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 700; color: #1e7a45; overflow-wrap: anywhere; }
.entry-att.on { color: #b45309; }
.checkin-dot { flex: 0 0 auto; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #1e7a45; }
.checkin-dot.on { background: #e07b00; box-shadow: 0 0 0 0 rgba(224, 123, 0, .6); animation: checkin-pulse 1.6s ease-out infinite; }
@keyframes checkin-pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 123, 0, .55); } 100% { box-shadow: 0 0 0 7px rgba(224, 123, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .checkin-dot.on { animation: none; } }
.checkin { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .75rem; }
.checkin-form { margin: 0; }
.checkin-btn { background: #1e7a45; border-color: #1e7a45; color: #fff; font-weight: 700; min-width: 8rem; }
.checkin-btn:hover { background: #17633d; }
.checkout-btn { background: #c2410c; border-color: #c2410c; color: #fff; font-weight: 700; min-width: 8rem; }
.checkout-btn:hover { background: #9a3412; }
.checkin-on, .checkin-done { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; }
.checkin-on { color: #9a3412; }
.checkin-done { color: #1e7a45; }
.attendance-card h2 { margin-bottom: .2rem; }
.attendance-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .45rem; }
.attendance-list li { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; padding-top: .45rem; border-top: 1px solid #eef1f5; }
.attendance-entry { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
/* Admins: correct a check-in's times (forgotten check out) */
.att-fix { flex-basis: 100%; margin: -.1rem 0 .1rem 1rem; }
.att-fix summary { display: inline; font-size: .85rem; list-style: none; }
.att-fix summary::-webkit-details-marker { display: none; }
.att-fix-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .45rem; padding: .6rem .7rem; background: #f6f9fc; border: 1px solid var(--border); border-radius: 8px; }
.att-fix-form label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-weight: 600; font-size: .9rem; }
.att-fix-form input[type="time"] { width: auto; min-height: 0; padding: .3rem .45rem; }
.att-fix-form .err { flex-basis: 100%; margin: 0; }
/* Admin home page: check-ins never checked out */
.forgotten { border-left: 4px solid #e07b00; }
.forgotten .activity-icon { background: #e07b00; }
/* Admin home page: today's check-ins and check-outs (partials/site-activity.ejs) */
.site-activity { max-width: 760px; }
.activity-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.activity-head h2 { margin: 0; }
.activity-now { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 700; color: #9a3412; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; }
.activity-item { display: flex; align-items: flex-start; gap: .7rem; padding: .55rem 0; border-top: 1px solid #eef1f5; }
.activity-item:first-child { border-top: 0; }
.activity-icon { flex: 0 0 auto; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; font-weight: 800; color: #fff; background: #1e7a45; }
.activity-item.out .activity-icon { background: #c2410c; }
.activity-text { display: grid; gap: .1rem; min-width: 0; overflow-wrap: anywhere; }
.activity-text a { text-decoration: none; }
.activity-spent { display: inline-block; padding: 0 .45rem; border-radius: 999px; background: #e3f4ea; color: #1e7a45; font-size: .85rem; font-weight: 700; }
.att-spent { color: #1e7a45; }
.activity-text a:hover { text-decoration: underline; }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface); margin-bottom: .6rem; box-shadow: var(--shadow); }
.view-switch a { padding: .3rem .95rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--muted); }
.view-switch a:hover { color: var(--brand); }
.view-switch a[aria-current] { background: var(--brand); color: #fff; }
.day-link { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .4rem; color: inherit; text-decoration: none; }
.day-link:hover .day-name { color: var(--brand); text-decoration: underline; }

/* day view timeline */
.dayview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.allday-strip { display: flex; gap: .75rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); background: #fafbfc; }
.allday-label, .hour-line span { flex: 0 0 3.6rem; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.allday-label { padding-top: .45rem; }
.allday-items { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .4rem; min-width: 0; }
.timeline { position: relative; margin: .75rem .75rem 1rem; }
.hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid #edf0f4; display: flex; }
.hour-line span { transform: translateY(-.55rem); background: var(--surface); padding-right: .4rem; text-transform: none; font-variant-numeric: tabular-nums; }
.slots { position: absolute; top: 0; bottom: 0; left: 4.2rem; right: 0; }
.entry.slot { position: absolute; overflow: hidden; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); align-content: start; }
.entry.slot.short { grid-auto-flow: column; justify-content: start; gap: .5rem; align-items: center; padding-top: .2rem; padding-bottom: .2rem; }
.entry.slot.short .entry-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-empty { position: absolute; top: 1rem; left: .5rem; font-size: .95rem; }
.now-line { position: absolute; left: -.4rem; right: 0; height: 0; border-top: 2px solid #e5484d; z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -.3rem; top: -.4rem; width: .7rem; height: .7rem; border-radius: 50%; background: #e5484d; }
@media (max-width: 520px) {
  .allday-strip { flex-direction: column; gap: .4rem; }
  .allday-label { padding-top: 0; }
  .hour-line span { flex-basis: 2.8rem; }
  .slots { left: 3.2rem; }
  .timeline { margin: .75rem .5rem 1rem; }
}

/* "!" = sheet to be submitted for this appointment */
.entry { position: relative; }
.req-flag {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: #e07b00; color: #fff; font-weight: 900; font-size: .85rem; line-height: 1; font-style: normal;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(16, 24, 40, .25);
}
.entry .req-flag { position: absolute; top: .3rem; right: .3rem; }
.entry.has-flag { padding-right: 1.9rem; }
.req-flag.inline { width: 1.05rem; height: 1.05rem; font-size: .72rem; box-shadow: none; margin-right: .1rem; vertical-align: -.15em; }
.req-flag.big { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; font-size: 1.1rem; box-shadow: none; }
.status-banner.sheet-due { border-color: #f3c58a; background: #fff7ec; border-left: 5px solid #e07b00; align-items: center; flex-wrap: wrap; }
.status-banner.sheet-due > div { flex: 1 1 16rem; }
.status-banner.sheet-due .banner-title { color: #8a4b00; }
.sheet-due-action { margin-left: auto; }
.sheet-req-field .checkbox { font-weight: 600; }
.sheet-req-field .hint { margin: .2rem 0 0 1.6rem; }
.legend .req-flag.inline { margin-right: .35rem; }

/* top-banner counter of planner sheets still due */
.due-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; text-decoration: none;
  color: #fff; background: rgba(224, 123, 0, .28); border: 1px solid rgba(255, 190, 110, .7); font-size: .9rem; white-space: nowrap; }
.due-pill:hover { background: rgba(224, 123, 0, .42); }
.due-pill:focus-visible { outline: 3px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.due-pill .req-flag { width: 1.3rem; height: 1.3rem; box-shadow: none; }
.due-pill strong { font-size: 1rem; }
/* Compact version so it fits beside the icon group. */
.topbar .due-pill { font-size: .78rem; gap: .3rem; padding: .18rem .55rem .18rem .22rem; }
.topbar .due-pill .req-flag { width: 1.05rem; height: 1.05rem; font-size: .7rem; }
.topbar .due-pill strong { font-size: .88rem; }
.due-pill.none { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }
.due-pill.none .req-flag { background: rgba(255, 255, 255, .35); }
/* Super users: quotes marked "Ready For Invoice" on the shared quote dashboard (opens the Quote log, filtered). */
.invoice-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .3rem .18rem .6rem; border-radius: 999px; text-decoration: none;
  color: #fff; background: rgba(46, 160, 90, .35); border: 1px solid rgba(140, 230, 170, .8); font-size: .72rem; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.invoice-pill:hover { background: rgba(46, 160, 90, .55); }
.invoice-pill:focus-visible { outline: 3px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.invoice-pill strong { display: grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem; border-radius: 999px; background: #fff; color: #1e7a45; font-size: .82rem; letter-spacing: 0; }
@media (max-width: 420px) { .invoice-pill { font-size: .64rem; padding-left: .45rem; } }
/* First page after signing in: the logo glides in from the left, the name follows, then the icons fade in. */
@keyframes logo-in {
  0%   { transform: translateX(-140%) rotate(-25deg) scale(.7); opacity: 0; }
  60%  { transform: translateX(8%) rotate(4deg) scale(1.04); opacity: 1; }
  80%  { transform: translateX(-2%) rotate(-1deg) scale(1); }
  100% { transform: none; opacity: 1; }
}
@keyframes wordmark-in {
  0%   { transform: translateX(-60px); opacity: 0; clip-path: inset(0 100% 0 0); }
  100% { transform: none; opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes icons-in {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.topbar.animate-logo { overflow: hidden; }
.topbar.animate-logo .brand-logo { animation: logo-in .95s cubic-bezier(.2, .8, .25, 1) both; }
.topbar.animate-logo .wordmark { display: inline-block; animation: wordmark-in .7s cubic-bezier(.2, .8, .25, 1) .35s both; }
.topbar.animate-logo .brand-group .nav-icon { animation: icons-in .4s ease-out both; }
/* (the logo link is the 1st link in the group, so the icons are 2nd–6th) */
.topbar.animate-logo .brand-group .nav-icon:nth-of-type(2) { animation-delay: .85s; }
.topbar.animate-logo .brand-group .nav-icon:nth-of-type(3) { animation-delay: .93s; }
.topbar.animate-logo .brand-group .nav-icon:nth-of-type(4) { animation-delay: 1.01s; }
.topbar.animate-logo .brand-group .nav-icon:nth-of-type(5) { animation-delay: 1.09s; }
.topbar.animate-logo .brand-group .nav-icon:nth-of-type(6) { animation-delay: 1.17s; }
.topbar.animate-logo .brand-group .nav-icon:nth-of-type(7) { animation-delay: 1.25s; }
.topbar.animate-logo .topbar-right { animation: icons-in .5s ease-out 1.1s both; }
/* Sheets due > 0: the counter vibrates for 5 seconds on every page (10 × 0.5s). */
@keyframes due-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  10% { transform: translateX(-2px) rotate(-2deg); }
  20% { transform: translateX(2px) rotate(2deg); }
  30% { transform: translateX(-2px) rotate(-1.5deg); }
  40% { transform: translateX(2px) rotate(1.5deg); }
  50% { transform: translateX(-1.5px) rotate(-1deg); }
  60% { transform: translateX(1.5px) rotate(1deg); }
  70% { transform: translateX(-1px) rotate(-.5deg); }
  80% { transform: translateX(1px) rotate(.5deg); }
  90% { transform: translateX(0) rotate(0); }
}
/* …and at the same time grows and shrinks (a separate "scale" property, so it combines with the shake). */
@keyframes due-grow {
  0%, 100% { scale: 1; }
  50% { scale: 1.3; }
}
.due-pill.shake {
  transform-origin: right center; /* grow towards the page, not off the edge */
  animation: due-shake .5s linear 10, due-grow 1s ease-in-out 5;
}
.due-pill.shake .req-flag { animation: due-flag-pulse 1s ease-in-out 5; }
@keyframes due-flag-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* After sign-in, wait for the logo animation before shaking. */
.topbar.animate-logo .due-pill.shake, .topbar.animate-logo .due-pill.shake .req-flag { animation-delay: 1.6s; }
@media (prefers-reduced-motion: reduce) {
  .due-pill.shake, .due-pill.shake .req-flag { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar.animate-logo .brand-logo, .topbar.animate-logo .wordmark,
  .topbar.animate-logo .brand-group .nav-icon, .topbar.animate-logo .topbar-right { animation: none; }
}

/* Wide screens: logo … menu … counter at the far right. */
.topbar nav { margin-left: auto; }
.topbar-right { order: 3; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.user-name { color: rgba(255, 255, 255, .85); text-decoration: none; font-size: .78rem; font-weight: 500; padding: 0 .3rem; max-width: 6.8rem; text-align: right; line-height: 1.25; overflow-wrap: anywhere; }
.topbar { column-gap: .75rem; }
.user-name:hover { color: #fff; text-decoration: underline; }
.signout-form { margin: 0; }
.signout-btn { cursor: pointer; font: inherit; padding: .2rem .35rem; }
.signout-btn svg { width: 1.15rem; height: 1.15rem; }
/* Narrower screens: logo and counter share the first row (counter far right), menu wraps underneath. */
@media (max-width: 1000px) {
  .brand-group { gap: .4rem; }
  .brand-group .nav-icon { padding: .3rem .42rem; }
  .topbar-right { order: 2; margin-left: auto; }
  .topbar nav { order: 3; flex-basis: 100%; margin-left: -.65rem; }
}
@media (max-width: 420px) { .due-pill .due-word { display: none; } }
/* Phones: keep the big logo, but small enough that the top row still fits on one line. */
@media (max-width: 520px) {
  .brand-logo { width: 3rem; height: 3rem; }
  .brand { gap: .55rem; }
  .brand .wordmark { font-size: 1.75rem; }
  .brand-group { gap: .45rem; }
  .nav-icon, .brand-group .nav-icon { padding: .3rem .35rem; }
}
.topbar .wordmark { white-space: nowrap; } /* never split "PhineasFST" (or its dot) across two lines */
@media (max-width: 420px) {
  .topbar { padding-left: .75rem; padding-right: .75rem; gap: .5rem; }
  .brand-logo { width: 2.6rem; height: 2.6rem; }
  .brand { gap: .4rem; }
  .brand .wordmark { font-size: 1.45rem; }
  .brand-group { gap: .3rem; }
  .nav-icon, .brand-group .nav-icon { padding: .25rem; }
  .nav-icon svg { width: 1.2rem; height: 1.2rem; }
  .due-pill { padding: .25rem .5rem .25rem .3rem; gap: .3rem; }
}
/* Administrators have seven icons: on narrow screens shrink the logo and icons a little so the
   logo and all the icons still fit on one line. */
@media (max-width: 680px) {
  .brand-group:has(> a:nth-of-type(8)) { gap: .25rem; }
  .brand-group:has(> a:nth-of-type(8)) .brand { gap: .4rem; }
  .brand-group:has(> a:nth-of-type(8)) .brand-logo { width: 2.3rem; height: 2.3rem; }
  .brand-group:has(> a:nth-of-type(8)) .brand .wordmark { font-size: 1.25rem; }
  .brand-group:has(> a:nth-of-type(8)) .nav-icon { padding: .25rem; }
  .brand-group:has(> a:nth-of-type(8)) .nav-icon svg { width: 1.1rem; height: 1.1rem; }
}
/* Nine admin icons (Breakdowns added, Nov 2026): the smaller logo and icons start sooner. */
@media (max-width: 800px) {
  .brand-group:has(> a:nth-of-type(10)) { gap: .25rem; }
  .brand-group:has(> a:nth-of-type(10)) .brand { gap: .4rem; }
  .brand-group:has(> a:nth-of-type(10)) .brand-logo { width: 2.3rem; height: 2.3rem; }
  .brand-group:has(> a:nth-of-type(10)) .brand .wordmark { font-size: 1.25rem; }
  .brand-group:has(> a:nth-of-type(10)) .nav-icon { padding: .25rem; }
  .brand-group:has(> a:nth-of-type(10)) .nav-icon svg { width: 1.1rem; height: 1.1rem; }
}
/* Eight admin icons (Quotations added, Nov 2026): a little tighter again on phones. */
@media (max-width: 480px) {
  .brand-group:has(> a:nth-of-type(9)) { gap: .15rem; }
  .brand-group:has(> a:nth-of-type(9)) .nav-icon { padding: .2rem; }
}
@media (max-width: 400px) {
  .brand-group:has(> a:nth-of-type(9)) .brand-logo { width: 2.1rem; height: 2.1rem; }
  .brand-group:has(> a:nth-of-type(9)) .nav-icon svg { width: 1rem; height: 1rem; }
}
/* Ten icons for super users (Quote log added, Nov 2026): tighter still on phones. Must come
   after the rules above so it wins. */
@media (max-width: 480px) {
  .brand-group:has(> a:nth-of-type(11)) { gap: .1rem; }
  .brand-group:has(> a:nth-of-type(11)) .nav-icon { padding: .18rem; }
}
@media (max-width: 400px) {
  .brand-group:has(> a:nth-of-type(11)) .brand { gap: .3rem; }
  .brand-group:has(> a:nth-of-type(11)) .brand-logo { width: 2rem; height: 2rem; }
  .brand-group:has(> a:nth-of-type(11)) .brand .wordmark { font-size: 1.15rem; }
  .brand-group:has(> a:nth-of-type(11)) .nav-icon svg { width: .95rem; height: .95rem; }
}

.due-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; max-width: 760px; }
.due-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c); padding: .7rem 2.2rem .75rem .9rem; box-shadow: var(--shadow); }
.due-item:hover { background: color-mix(in srgb, var(--c) 6%, #fff); }
.due-item .req-flag { top: .65rem; right: .65rem; }
.due-item .entry-title { font-size: 1rem; }
.planner-search { margin-bottom: 1rem; }
.when-pill { display: inline-block; margin-left: .3rem; padding: 0 .45rem; border-radius: 999px; font-size: .66rem; letter-spacing: .04em; color: #fff; background: #8a95a3; }
.when-pill.when-today { background: var(--brand); }
.when-pill.when-upcoming { background: var(--ok); }
.result-notes { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.due-heading { font-size: 1rem; margin: 1.2rem 0 .6rem; color: var(--muted); }
.due-heading.late { color: var(--danger); }
.overdue { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; letter-spacing: .04em; }

.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: .75rem; height: .75rem; border-radius: 3px; display: inline-block; }
.planner-form { max-width: 760px; }
.planner-form .checkbox { margin: 0; }
.event-card { max-width: 640px; border-top: 5px solid var(--c); }
.cat-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); padding: .2rem .6rem; border-radius: 999px; margin-bottom: .9rem; }
.cat-pill i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); }
.event-card .details dd { font-weight: 500; }
.event-card .notes { white-space: pre-wrap; }

@media (max-width: 1000px) {
  .week { grid-template-columns: 1fr; gap: .45rem; }
  .day { min-height: 0; flex-direction: row; }
  .day-head { flex: 0 0 7.5rem; min-width: 0; flex-direction: column; align-items: flex-start; padding-right: .65rem; border-bottom: 0; border-right: 1px solid var(--border); }
  .day.today .day-head { border-radius: var(--radius) 0 0 var(--radius); }
  .day-add { position: static; margin-top: .3rem; border-color: var(--border); }
  .day-body { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
}
@media (max-width: 520px) {
  .day-head { flex-basis: 5.2rem; }
  .day-name .long { display: none; }
  .day-name .short { display: inline; }
  .day-body { grid-template-columns: 1fr; }
  .planner-nav { width: 100%; }
  .planner-nav .btn { flex: 1 1 auto; padding-inline: .6rem; }
  .planner-nav .jump, .planner-nav .jump input { width: 100%; }
}

/* ---------- photos ---------- */
.photo-send { max-width: 640px; display: grid; gap: 1rem; }
.camera-buttons { display: grid; justify-items: center; gap: .7rem; }
.camera-big {
  margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  padding: 1.6rem 1rem; border-radius: 14px; cursor: pointer; color: #fff; font-size: 1.15rem; font-weight: 700;
  background: linear-gradient(135deg, #2a64a0, #1f4e79 60%, #163a5b); box-shadow: 0 6px 16px rgba(31, 78, 121, .25);
}
.camera-big svg { width: 2.6rem; height: 2.6rem; }
.camera-big:has(input:focus-visible) { outline: 3px solid rgba(31, 78, 121, .45); outline-offset: 3px; }
.camera-big:has(input:disabled), .gallery-btn:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.gallery-btn { margin: 0; cursor: pointer; }
.gallery-btn:has(input:focus-visible) { outline: 3px solid rgba(31, 78, 121, .3); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .6rem; }
.thumbs:empty { display: none; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eef1f5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-remove { position: absolute; top: .3rem; right: .3rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 0; background: rgba(16, 24, 40, .7); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .9rem; }
.photo-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.photo-card:hover { border-color: var(--brand); }
.photo-card.is-new { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31, 78, 121, .15), var(--shadow); }
.photo-thumb { position: relative; aspect-ratio: 4 / 3; background: #eef1f5; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-count { position: absolute; right: .5rem; bottom: .5rem; background: rgba(16, 24, 40, .72); color: #fff; font-weight: 700; font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; }
.new-pill { position: absolute; left: .5rem; top: .5rem; background: var(--brand); color: #fff; font-weight: 800; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 999px; }
.dir-pill { position: absolute; right: .5rem; top: .5rem; background: var(--ok); color: #fff; font-weight: 800; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 999px; }
.send-to select { font-weight: 600; }
.send-to-fixed { margin: 0; padding: .6rem .8rem; background: var(--brand-soft); border-radius: var(--radius); }
.photo-info { display: grid; gap: .15rem; padding: .65rem .8rem .8rem; }
.photo-note { font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-detail { max-width: 900px; }
.photo-about { margin: 0 0 .6rem; font-weight: 600; }
.photo-msg { margin: 0 0 1rem; border-left-color: var(--brand); background: #f3f8fd; }
.photo-full { display: grid; gap: .8rem; }
.photo-full img { width: 100%; max-height: 80vh; object-fit: contain; background: #f3f5f8; border-radius: var(--radius); display: block; }

/* confirmation box */
.confirm-dialog {
  border: 0; border-radius: 14px; padding: 1.4rem 1.4rem 1.1rem; width: min(26rem, calc(100vw - 2rem));
  box-shadow: 0 24px 60px rgba(16, 24, 40, .28); color: var(--text);
}
.confirm-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.confirm-msg { margin: 0 0 1.2rem; font-size: 1.02rem; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: #8f1c13; }

/* Planner "Who" drop-down: tick one or more users */
.who-menu { position: relative; }
.who-menu summary {
  list-style: none; user-select: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .7rem; min-height: 2.6rem;
}
.who-menu summary::-webkit-details-marker { display: none; }
.who-menu summary:focus-visible { outline: 3px solid rgba(31, 78, 121, .3); outline-offset: 1px; border-color: var(--brand); }
.who-menu [data-who-text] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-menu [data-who-text].who-none { color: var(--muted); }
.who-menu .caret { flex: 0 0 auto; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s; }
.who-menu[open] .caret { transform: rotate(180deg); }
.who-list {
  position: absolute; left: 0; right: 0; top: calc(100% + .3rem); z-index: 20; max-height: 16rem; overflow-y: auto; padding: .35rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
}
.who-list .checkbox { margin: 0; padding: .45rem .5rem; border-radius: 6px; cursor: pointer; white-space: normal; }
.who-list .checkbox:hover { background: var(--brand-soft); }
.who-list input { width: auto; min-height: 0; }

/* New sheet drop-down */
.new-menu { position: relative; }
.new-menu summary { list-style: none; user-select: none; }
.new-menu summary::-webkit-details-marker { display: none; }
.new-menu .caret { display: inline-block; width: 0; height: 0; margin-left: .25rem; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s; }
.new-menu[open] .caret { transform: rotate(180deg); }
.new-menu .menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; min-width: 22rem; margin: 0; padding: .35rem;
  list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
}
.new-menu .menu a { display: flex; align-items: center; gap: .65rem; padding: .65rem .75rem; border-radius: 7px; color: var(--text); text-decoration: none; font-weight: 500; }
.new-menu .menu a:hover, .new-menu .menu a:focus-visible { background: var(--brand-soft); color: var(--brand); outline: none; }
.new-menu .menu .tag { width: .7rem; height: .7rem; padding: 0; border-radius: 50%; flex: 0 0 auto; }
.tag-job.tag:empty { background: var(--brand); }
.tag-cylinder.tag:empty { background: #c0632a; }
.tag-inspection.tag:empty { background: var(--ok); }
.tag-incident.tag:empty { background: #d29a1e; }
.sheet-head { flex-wrap: nowrap; align-items: flex-start; }
.sheet-title { min-width: 0; }
.sheet-head.logo-left { justify-content: flex-start; align-items: center; gap: 1.25rem; }
.sheet-head.logo-left .company-logo { order: -1; }
.sheet-head.logo-left .sheet-title { border-left: 2px solid var(--border); padding-left: 1.25rem; }
/* Result badge at the top right of a sheet's header, e.g. leak test PASS (green) / FAIL (red) */
.head-badge { margin-left: auto; align-self: center; flex: 0 0 auto; display: grid; justify-items: center; gap: .15rem;
  padding: .45rem 1.1rem .55rem; border: 3px solid currentColor; border-radius: 12px; background: #fff; }
.head-badge[hidden] { display: none; }
.head-badge-label { font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.head-badge-value { font-size: 2rem; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.head-badge.tone-ok { color: #1a7f45; background: #e8f6ee; }
.head-badge.tone-bad { color: #c0261b; background: #fdecea; }
/* Rubber-stamp style (e.g. ATTENTION REQUIRED): double border, wraps onto two lines */
.head-badge.stamp { border: 5px double currentColor; border-radius: 8px; padding: .4rem .9rem; }
.head-badge.stamp .head-badge-value { font-size: 1.35rem; letter-spacing: .1em; text-align: center; max-width: 8.5em; line-height: 1.15; }
@media (max-width: 520px) {
  /* On phones the badge becomes a strip on its own line under the title, so the title keeps its room. */
  .sheet-head:has(.head-badge:not([hidden])) { flex-wrap: wrap; }
  .sheet-head:has(.head-badge:not([hidden])) .sheet-title { flex: 1 1 0; }
  .head-badge { order: 3; margin-left: 0; flex: 1 0 100%; display: flex; align-items: baseline; justify-content: center; gap: .6rem; padding: .3rem .8rem; }
  .head-badge-value { font-size: 1.4rem; }
  .head-badge.stamp .head-badge-value { max-width: none; font-size: 1.15rem; }
}
.company-logo { flex: 0 0 auto; height: 144px; width: auto; mix-blend-mode: multiply; /* hides the logo's white background */ }
.back { display: inline-block; margin-bottom: .4rem; text-decoration: none; font-size: .9rem; }
.ref { font-weight: 500; color: var(--muted); font-size: 1.1rem; margin-left: .35rem; white-space: nowrap; }
.meta { margin: .35rem 0 0; font-size: .875rem; }

/* ---------- search ---------- */
.search {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  background: var(--surface); padding: .75rem; border-radius: var(--radius); box-shadow: var(--shadow);
}
.search input { flex: 1 1 280px; }
.search select { flex: 0 1 220px; width: auto; }
.search .clear { padding: 0 .4rem; }
.count { margin: .9rem 0 .6rem; font-size: .9rem; }

/* ---------- tables ---------- */
table.sheets { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sheets th, .sheets td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.sheets th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; }
.sheets tbody tr:last-child td { border-bottom: 0; }
.sheets tbody tr:hover { background: #f8fbfe; }
.sheets td a { text-decoration: none; }
.sheets td a:hover { text-decoration: underline; }
.ref-link { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.tag { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #eef1f5; color: var(--muted); }
.tag-job { background: var(--brand-soft); color: var(--brand); }
.tag-inspection { background: var(--ok-soft); color: var(--ok); }
.tag-incident { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-off { background: #eef1f5; color: var(--muted); }
tr.inactive td { color: var(--muted); }

.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; }
.empty p { margin: 0 0 .5rem; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 520px; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; }

/* ---------- sheet form ---------- */
.sheet-form { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem 1.5rem 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.grid .full, .grid .section { grid-column: 1 / -1; }
.section { margin: 1.25rem 0 0; padding-bottom: .4rem; border-bottom: 2px solid var(--brand-soft); color: var(--brand); font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); background: #fffafa; }
.err { color: var(--danger); font-size: .85rem; margin: .3rem 0 0; }
.actions { display: flex; gap: .6rem; margin-top: 1.5rem; flex-wrap: wrap; }
.danger-zone { margin-top: 1rem; text-align: right; }
.print-space-top, .print-text { display: none; }
.print-frame, .print-frame > tbody, .print-frame > tbody > tr, .print-frame > tbody > tr > td { display: block; padding: 0; border: 0; }
.ref-field { max-width: 26rem; padding-top: 1.1rem; }
.ref-field input { font-weight: 600; letter-spacing: .02em; }
.ref-field .hint { margin: .3rem 0 0; }
.sheet-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .9rem;
  margin-top: 1.5rem; padding-top: .9rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem; text-align: center;
}
.sheet-footer strong { color: var(--text); }
.powered-by { display: flex; justify-content: center; align-items: center; gap: .4rem; margin-top: .8rem; color: var(--muted); font-size: .78rem; letter-spacing: .02em; }
.powered-by img { width: 1.25rem; height: 1.25rem; }
.powered-by .wordmark { font-size: .95rem; color: var(--brand); }
.powered-by .wordmark .fst { color: #17a06b; font-style: italic; }
.powered-by .wordmark::after { content: ""; display: inline-block; width: .3em; height: .3em; margin-left: .1em; border-radius: 50%; background: #2fbf8f; }

/* checklist */
fieldset.checklist { border: 0; padding: 0; margin: 0; }
.check-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, .9fr); gap: .5rem 1rem; align-items: center;
  padding: .6rem 0; border-bottom: 1px solid #eef1f5;
}
.check-item { font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg label { margin: 0; font-weight: 600; font-size: .85rem; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: .45rem .8rem; border-right: 1px solid var(--border); color: var(--muted); user-select: none; }
.seg label:last-child span { border-right: 0; }
.seg input:focus-visible + span { outline: 3px solid rgba(31, 78, 121, .3); outline-offset: -3px; }
.seg-pass input:checked + span { background: var(--ok); color: #fff; }
.seg-fail input:checked + span { background: var(--danger); color: #fff; }
.seg-na input:checked + span { background: #6b7280; color: #fff; }
.check-note { min-height: 2.3rem; padding: .4rem .6rem; }

.tag-cylinder { background: #f7e7dc; color: #8f4318; }
.tag-works { background: #ece6f6; color: #5b3a8f; }
.tag-works.tag:empty { background: #6e4aa8; }
.tag-tank { background: #dff3f7; color: #0e6a7e; }
.tag-tank.tag:empty { background: #1691ad; }
.tag-eml { background: #fff3d6; color: #8a5a00; }
.tag-eml.tag:empty { background: #e0a100; }
.tag-ahu { background: #e3f1e8; color: #1f6b3a; }
.tag-ahu.tag:empty { background: #2e8b57; }
.tag-ac { background: #e4effc; color: #1d5fa8; }
.tag-ac.tag:empty { background: #3b82d6; }
.tag-descale { background: #e6f4f4; color: #136f6f; }
.tag-descale.tag:empty { background: #1a9a9a; }
.tag-tmv { background: #fdeee6; color: #a3471a; }
.tag-tmv.tag:empty { background: #d9622b; }
.tag-booster { background: #e8eaf8; color: #3940a0; }
.tag-booster.tag:empty { background: #4f5bd5; }
.tag-assets { background: #f1ebe2; color: #7a5520; }
.tag-assets.tag:empty { background: #a8742c; }
.tag-fcu { background: #e3f4f4; color: #1d6b6b; }
.tag-fcu.tag:empty { background: #2a9d9d; }
.tag-pat { background: #fbe6f0; color: #9c2a62; }
.tag-pat.tag:empty { background: #c23a7e; }
.tag-pressurisation { background: #eef3dc; color: #55701a; }
.tag-pressurisation.tag:empty { background: #7a9a2a; }
.tag-breakglass { background: #dcf5e3; color: #11713a; }
.tag-breakglass.tag:empty { background: #16a34a; }
.tag-callpoint { background: #fde2e2; color: #a61b1b; }
.tag-callpoint.tag:empty { background: #d32f2f; }
.tag-flushing { background: #e0f2fe; color: #075985; }
.tag-flushing.tag:empty { background: #0284c7; }
.tag-sentinel { background: #fae8ff; color: #86198f; }
.tag-sentinel.tag:empty { background: #a21caf; }
.tag-tmvtemp { background: #ffedd5; color: #9a3412; }
.tag-tmvtemp.tag:empty { background: #c2410c; }
.tag-heatertemp { background: #e2e8f0; color: #334155; }
.tag-heatertemp.tag:empty { background: #475569; }
.tag-plantroom { background: #dbeafe; color: #1e3a8a; }
.tag-plantroom.tag:empty { background: #1e40af; }
.tag-bellows { background: #ede9fe; color: #5b21b6; }
.tag-bellows.tag:empty { background: #7c3aed; }
.tag-pipework { background: #ecfccb; color: #3f6212; }
.tag-pipework.tag:empty { background: #65a30d; }
.tag-valves { background: #ffe4e6; color: #9f1239; }
.tag-valves.tag:empty { background: #e11d48; }
.tag-extinguisher { background: #fecaca; color: #7f1d1d; }
.tag-extinguisher.tag:empty { background: #991b1b; }
.tag-aov { background: #cffafe; color: #164e63; }
.tag-aov.tag:empty { background: #155e75; }

/* send-to-admin workflow */
.status-draft { background: #eef1f5; color: var(--muted); }
.status-submitted { background: var(--brand-soft); color: var(--brand); }
.status-returned { background: var(--warn-soft); color: var(--warn); }
.status-reviewed { background: var(--ok-soft); color: var(--ok); }
.badge { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: #fff; color: var(--brand); font-size: .75rem; font-weight: 800; margin-left: .2rem; }
.badge.warn { background: #ffd27a; color: #5a3b00; }
.status-banner { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid var(--border); background: var(--surface); }
.status-banner p { margin: 0; }
.status-banner.submitted { border-color: #bcd2e8; background: #f3f8fd; }
.status-banner.returned { border-color: #f0d69a; background: #fffaf0; }
.status-banner.reviewed { border-color: #bfe3cf; background: #f4fbf7; }
.status-banner .tag { flex: 0 0 auto; margin-top: .1rem; }
.admin-note { margin: .5rem 0 0; padding: .5rem .8rem; border-left: 3px solid currentColor; background: rgba(255, 255, 255, .7); white-space: pre-wrap; color: var(--text); }
/* returned to user: action required */
.ar-icon { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #d29a1e; color: #fff; font-weight: 900; font-size: 1.1rem; }
.action-required { background: #fffaf0; border: 1px solid #f0d69a; border-left: 5px solid #d29a1e; border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.ar-head { display: flex; gap: .75rem; align-items: flex-start; }
.ar-head h2 { margin: 0 0 .15rem; color: #7a4f00; }
.ar-head p { margin: 0; }
.ar-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .6rem; }
.ar-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border: 1px solid #f0e2bf; border-radius: var(--radius); padding: .75rem .9rem; }
.ar-info { min-width: 0; }
.ar-title { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.ar-list .admin-note { margin: .45rem 0 .3rem; border-left-color: #d29a1e; background: #fffaf0; }
.ar-list p { margin: 0; }
.status-banner .banner-title { font-weight: 700; margin-bottom: .2rem; }
.status-banner.returned.mine { border-left: 5px solid #d29a1e; }
.status-banner.returned.mine .banner-title { color: #7a4f00; font-size: 1.05rem; }
.status-banner .note-label { margin-top: .6rem; font-weight: 600; font-size: .9rem; }
.status-banner.returned .admin-note { border-left-color: #d29a1e; }
.nav-action { background: rgba(255, 210, 122, .18); }
@media (max-width: 760px) {
  .ar-list li { flex-direction: column; align-items: stretch; }
}
.btn.send { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.send:hover { background: #17633d; }
fieldset.lock { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.lock[disabled] input, fieldset.lock[disabled] select, fieldset.lock[disabled] textarea { background: #f8fafc; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
fieldset.lock[disabled] .photo-pick, fieldset.lock[disabled] [data-sig-clear], fieldset.lock[disabled] [data-photo-remove], fieldset.lock[disabled] .sig-foot { display: none; }
fieldset.lock[disabled] .sig canvas { cursor: default; border-bottom: 0; }
.review-panel { margin-top: 1.25rem; border-top: 4px solid var(--brand); }
.review-panel .actions { margin-top: .9rem; }

/* radio buttons */
fieldset.radio-field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.radio-field legend { padding: 0; }
.radios { display: flex; gap: 1.25rem; align-items: center; min-height: 2.6rem; }
.radios label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0; cursor: pointer; }
.radios input { width: 1.15rem; height: 1.15rem; min-height: 0; margin: 0; accent-color: var(--brand); }
/* tick all that apply (type: 'checkboxes'); only the ticked answers print (.ticks-print) */
.ticks-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.ticks { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; min-height: 2.6rem; }
.ticks label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; margin: 0; cursor: pointer; }
.ticks input { width: 1.15rem; height: 1.15rem; min-height: 0; margin: 0; accent-color: var(--brand); }
.ticks-print { display: none; }

/* tasklist: done tick + date done */
fieldset.tasklist { border: 0; padding: 0; margin: 0; min-width: 0; }
.task-head, .task-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) 10.5rem; gap: .75rem; align-items: start; }
.task-head { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f3f5f8; padding: .45rem .5rem; border-radius: 6px; }
.task-row { padding: .8rem .5rem; border-bottom: 1px solid #eef1f5; }
.task-done { width: 1.35rem; height: 1.35rem; min-height: 0; margin: .1rem 0 0 .2rem; accent-color: var(--ok); cursor: pointer; }
.task-body { margin: 0; cursor: pointer; font-weight: 400; }
.task-title { font-weight: 700; }
.task-desc { display: block; color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.spec { display: inline-block; font-size: .75rem; font-weight: 700; color: #8f4318; background: #fbf1ea; border: 1px solid #e9b796; border-radius: 4px; padding: .05rem .4rem; margin-left: .35rem; white-space: nowrap; }
.task-date { min-height: 2.3rem; padding: .35rem .5rem; }

/* photos */
.photo { border: 1px solid var(--border); border-radius: var(--radius); background: #fafbfc; display: grid; justify-items: center; gap: .4rem; padding: .6rem; min-height: 9rem; align-content: center; }
.photo img { max-width: 100%; max-height: 22rem; border-radius: 6px; display: block; }
.photo img[hidden] { display: none; }
.photo-pick { margin: 0; }
.photo-pick span { display: inline-flex; align-items: center; padding: .5rem .9rem; border-radius: var(--radius); border: 1px dashed var(--brand); color: var(--brand); font-weight: 600; cursor: pointer; background: #fff; }
.photo-pick:hover span { background: var(--brand-soft); }
.photo-pick.is-disabled span { opacity: .45; cursor: not-allowed; }

/* readings grid on a sheet: fixed rows (readings) and columns (e.g. CMP 1–4) */
.grid-field { min-width: 0; } /* let the readings grid scroll sideways on phones instead of stretching the page */
.grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid-table { width: 100%; min-width: 28rem; border-collapse: collapse; }
.grid-table th, .grid-table td { border-bottom: 1px solid #eef1f5; padding: .25rem .3rem; text-align: left; }
.grid-table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; border-bottom-color: var(--border); }
.grid-table thead th:first-child { text-transform: none; letter-spacing: 0; color: var(--text); font-size: .9rem; }
.grid-table tbody th { font-weight: 500; font-size: .9rem; width: 38%; }
/* reading names stay in view while the CMP / FAN columns scroll sideways on a phone */
.grid-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 #eef1f5; }
.grid-table thead th:first-child { background: #f8fafc; }
.grid-table input { min-height: 2.1rem; padding: .3rem .5rem; }

/* table on a sheet that the user adds rows to (e.g. emergency light fittings) */
fieldset.rows-field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .6rem; }
.cell-print { display: none; }
.rows-summary { margin: 0; font-weight: 600; color: var(--muted); }
.rows-hint { margin: 0; }
.rows-summary.has-fail { color: var(--danger); }
.rows-table { width: 100%; border-collapse: collapse; }
.rows-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; padding: .45rem .4rem; border-bottom: 1px solid var(--border); }
.rows-table td { padding: .3rem .25rem; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.rows-table input, .rows-table select { min-height: 2.2rem; padding: .35rem .5rem; }
.rows-table th { width: var(--sw, auto); } /* column widths come from the sheet definition */
.rows-table tr.row-fail td { background: var(--danger-soft); }
.rows-remove-cell { width: 2.4rem; text-align: center; }
.rows-remove-cell .thumb-remove { position: static; background: #eef1f5; color: var(--muted); }
.rows-remove-cell .thumb-remove:hover { background: var(--danger-soft); color: var(--danger); }
fieldset.lock[disabled] .rows-add, fieldset.lock[disabled] .rows-remove-cell { display: none; }
/* automatic serial numbers (e.g. QFM-00001) and a photo per row (asset register) */
.serial-cell { display: grid; gap: .15rem; }
.rows-table .serial-input { background: #f3f5f8; font-weight: 700; color: var(--brand); border-style: dashed; cursor: default; }
.rows-table .serial-input:placeholder-shown { font-weight: 400; font-style: italic; }
.sticker-link { font-size: .8rem; font-weight: 600; }
.row-photo { display: grid; justify-items: start; gap: .25rem; }
.row-photo img { width: 5.6rem; height: 4.2rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; background: #fafbfc; }
.row-photo img[hidden] { display: none; }
.row-photo .photo-pick span { padding: .3rem .6rem; font-size: .85rem; }
.row-photo .linkbtn { font-size: .8rem; }
fieldset.lock[disabled] .row-photo .photo-pick, fieldset.lock[disabled] [data-row-photo-remove] { display: none; }
.rows-table .calc-input { background: #f3f5f8; font-weight: 700; color: var(--brand); border-style: dashed; cursor: default; }
.rows-table .calc-input:placeholder-shown { font-weight: 400; font-style: italic; }
/* Tables with too many columns for a screen (e.g. fan coil units): on screen every row is a card of
   small labelled boxes; on paper it is still a table row. */
@media screen {
  .rows-cards .rows-table, .rows-cards .rows-table tbody, .rows-cards .rows-table td { display: block; width: auto; }
  .rows-cards .rows-table thead { display: none; }
  .rows-cards .rows-table tr.rows-row { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .55rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem 3rem .75rem .75rem; margin-bottom: .7rem; background: #fff; }
  /* label above its box; boxes line up along the bottom when a label wraps onto two lines */
  .rows-cards .rows-table td { border: 0; padding: 0; display: grid; grid-template-columns: none; gap: .2rem; align-content: end; background: none; }
  .rows-cards .rows-table td::before { content: attr(data-label); font-size: .78rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
  .rows-cards .rows-table td.cell-wide { grid-column: span 2; }
  .rows-cards .rows-table td.card-row { grid-column-start: 1; } /* starts a new line on the card */
  .rows-cards .rows-table td.col-notes { grid-column: span 5; }
  .rows-cards .rows-table td.col-id input { font-weight: 700; }
  .rows-cards .rows-table td.rows-remove-cell { position: absolute; top: .5rem; right: .5rem; display: block; width: auto; padding: 0; }
  .rows-cards .rows-table td.rows-remove-cell::before { content: none; }
  .rows-cards .rows-table tr.row-fail td { background: none; }
  .rows-cards .rows-table tr.row-fail { background: var(--danger-soft); border-color: #f0c5c0; }
  .rows-cards .rows-table tr.row-fail td.tally-col select { border-color: var(--danger); color: var(--danger); font-weight: 700; }
}
@media screen and (max-width: 900px) {
  .rows-cards .rows-table tr.rows-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rows-cards .rows-table td.col-notes { grid-column: span 2; }
}
@media screen and (max-width: 520px) {
  .rows-cards .rows-table tr.rows-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-right: .75rem; padding-top: 3.6rem; }
  .rows-cards .rows-table td.card-row-phone { grid-column-start: 1; }
  .rows-cards .rows-table td.col-notes { grid-column: 1 / -1; }
  .rows-cards .rows-table td.col-id { position: absolute; top: .55rem; left: .75rem; width: 8rem; display: block; padding: 0; }
  .rows-cards .rows-table td.col-id::before { content: none; }
  .rows-cards .rows-table td.cell-wide { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rows-table td.col-serial { padding-right: 2.6rem; }
  .row-photo img { width: 100%; max-width: 16rem; height: auto; aspect-ratio: 4 / 3; }
  /* On phones each row becomes a small card with labelled boxes. */
  .rows-table, .rows-table tbody, .rows-table tr, .rows-table td { display: block; width: auto; }
  .rows-table thead { display: none; }
  .rows-table tr.rows-row { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .6rem; margin-bottom: .6rem; background: #fff; }
  .rows-table td { border: 0; padding: .2rem 0; display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .5rem; align-items: center; }
  .rows-table td::before { content: attr(data-label); font-size: .8rem; font-weight: 600; color: var(--muted); }
  .rows-table td.col-id, .rows-table td.col-duration, .rows-table td.col-result { width: auto; }
  .rows-table td.rows-remove-cell { position: absolute; top: .4rem; right: .4rem; display: block; width: auto; padding: 0; }
  .rows-table td.rows-remove-cell::before { content: none; }
  .rows-table tr.row-fail td { background: none; }
  .rows-table tr.row-fail { background: var(--danger-soft); border-color: #f0c5c0; }
  .rows-table td.col-id { padding-right: 2.6rem; }
}

/* photo gallery on a sheet (any number of photos, each with a note) */
fieldset.gallery-field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: .8rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: .8rem; }
.gallery:empty { display: none; }
.gallery-item { position: relative; margin: 0; display: grid; gap: .4rem; padding: .4rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fafbfc; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; background: #eef1f5; }
.gallery-add { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
fieldset.lock[disabled] .gallery-add, fieldset.lock[disabled] [data-gallery-remove] { display: none; }
fieldset.lock[disabled] .gallery-note:placeholder-shown { display: none; }
.photo-pick input:focus-visible + span { outline: 3px solid rgba(31, 78, 121, .3); outline-offset: 1px; }

/* signature */
.sig { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; max-width: 560px; }
.sig canvas { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; border-bottom: 1px dashed var(--border); }
.sig-foot { display: flex; justify-content: space-between; align-items: center; padding: .3rem .6rem; }

/* admin */
.user-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto; gap: .75rem; align-items: end; }
.mail-status { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mail-status h2 { margin-bottom: .35rem; }
.mail-status p { margin: 0; }
.mail-status .tag { margin-right: .35rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
code { background: #eef1f5; padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }
form.email-edit { display: inline-flex; gap: .3rem; align-items: center; }
.email-edit input { width: 12rem; min-height: 2rem; padding: .3rem .5rem; font-size: .875rem; }
.inline-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-row input { flex: 1 1 14rem; }
.checkbox { display: flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0 0 .7rem; white-space: nowrap; }
.checkbox input { width: auto; min-height: 0; }
.user-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.user-actions form.reset { display: inline-flex; gap: .3rem; }
.user-actions .reset input { width: 9.5rem; min-height: 2rem; padding: .3rem .5rem; font-size: .875rem; }
.user-actions form.role-edit { display: inline-flex; gap: .3rem; }
.user-actions .role-edit select { width: auto; min-height: 2rem; padding: .25rem .5rem; font-size: .875rem; }
/* Users page: which icons (pages) each person may use (auth.ICONS) */
.user-form .icon-ticks { grid-column: 1 / -1; order: 1; }
.user-form > .btn { order: 2; justify-self: start; }
.icon-ticks { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem .7rem; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .35rem .9rem; }
.icon-ticks legend { font-weight: 600; padding: 0 .3rem; }
.icon-tick { display: flex; align-items: center; gap: .45rem; font-weight: 500; font-size: .9rem; cursor: pointer; }
.icon-tick input { width: auto; min-height: 0; margin: 0; }
.icon-edit { flex-basis: 100%; }
.icon-edit summary { list-style: none; display: inline-flex; cursor: pointer; }
.icon-edit summary::-webkit-details-marker { display: none; }
.icon-edit[open] summary { margin-bottom: .4rem; }
.icon-edit form.icon-ticks { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); background: var(--surface); }
.icon-edit form.icon-ticks .btn { justify-self: start; }
.role-user { background: #eef1f5; color: var(--muted); }
.role-admin { background: var(--brand-soft); color: var(--brand); }
.role-super { background: #ece6f6; color: #5b3a8f; }
.role-client { background: #fff3d6; color: #8a5a00; }

/* clients and their sites */
.client-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.section-title { margin: 1.5rem 0 .6rem; color: var(--brand); font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.page-head + .section-title { margin-top: 0; }
.site-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: .7rem; }
.site-card { display: flex; gap: .8rem; align-items: flex-start; height: 100%; box-sizing: border-box; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.site-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.folder-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: #fff3d6; color: #a06a00; }
.folder-icon svg { width: 1.45rem; height: 1.45rem; }
.site-info { flex: 1 1 auto; min-width: 0; display: grid; gap: .15rem; }
.site-address { white-space: pre-line; font-size: .9rem; margin: 0; }
.site-count { flex: 0 0 auto; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.site-count strong { color: var(--brand); font-size: 1rem; }
.site-notes { white-space: pre-line; }
.site-edit summary { cursor: pointer; list-style: revert; }
.site-edit summary h2 { display: inline; margin: 0; }
.site-edit[open] summary { margin-bottom: 1rem; }
.client-site { margin-top: 1rem; padding: .8rem 1rem; background: #f6f9fc; border: 1px solid var(--border); border-radius: var(--radius); }
.client-pick-hint { grid-column: 1 / -1; margin: -.4rem 0 0; }

/* maintenance schedules: 52-week PPM plan, coloured like the owner's Macro planner spreadsheet */
.ppm-icon { background: #e4effc; color: #1d5fa8; }
.wide-page main { max-width: 1800px; } /* the 52-week grid uses the full screen width */
.ppm-counts { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-top: .25rem; font-size: .85rem; }
.ppm-week { background: var(--brand-soft); color: var(--brand); }
.plain-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.ppm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .8rem; }
.ppm-now { margin: 0; font-weight: 600; }
.ppm-now-week { display: inline-block; background: #1f4e79; color: #fff; border-radius: 6px; padding: .1rem .5rem; margin-right: .2rem; }
.ppm-start-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ppm-start-form label { margin: 0; font-size: .875rem; font-weight: 600; color: var(--muted); }
.ppm-start-form input { width: auto; min-height: 2rem; padding: .25rem .4rem; font-size: .875rem; }
.ppm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid #9aa5b1; border-radius: 6px; box-shadow: var(--shadow); }
.ppm-grid { border-collapse: collapse; font-size: .78rem; min-width: 100%; }
.ppm-grid th, .ppm-grid td { border: 1px solid #c9d0d8; padding: 0; text-align: center; }
.ppm-grid thead th { background: #1f4e79; color: #fff; font-weight: 700; height: 1.6rem; }
.ppm-grid .ppm-months th { background: #2c6497; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.ppm-grid .ppm-wk { min-width: 1.55rem; font-size: .72rem; }
.ppm-grid td { width: 1.55rem; min-width: 1.55rem; height: 1.9rem; font-weight: 800; }
.ppm-grid .ppm-item { position: sticky; left: 0; z-index: 1; text-align: left; background: #fff; min-width: 17rem; max-width: 22rem; padding: .3rem .5rem; font-weight: 600; box-shadow: 1px 0 0 #9aa5b1; }
.ppm-grid thead .ppm-item { background: #1f4e79; z-index: 2; }
.ppm-grid tbody tr:nth-child(even) .ppm-item { background: #f6f8fa; }
.ppm-num { display: inline-block; min-width: 1.3rem; color: var(--muted); font-weight: 700; }
.ppm-desc { display: inline; text-transform: uppercase; font-size: .78rem; }
.ppm-desc a { color: var(--text); }
.ppm-sub { display: block; margin-left: 1.3rem; text-transform: none; font-weight: 400; font-size: .72rem; white-space: normal; }
.ppm-subcon { color: #c00000; font-weight: 600; }
/* frequency colours from the spreadsheet: A yellow, 6 cyan, 3 purple, M green, W grey; sub-contractor red */
.due.f-A { background: #ffff00; color: #000; }
.due.f-6 { background: #80ffff; color: #000; }
.due.f-3 { background: #9600ff; color: #fff; }
.due.f-M { background: #00ff00; color: #000; }
.due.f-W { background: #c8c8c8; color: #000; }
.due.sub { background: #ff0000; color: #fff; }
.ppm-grid .now { box-shadow: inset 2px 0 0 #1f4e79, inset -2px 0 0 #1f4e79; }
.ppm-grid td.now:not(.due) { background: #e7f0f9; }
.ppm-grid thead th.now { background: #f0b400; color: #1b2430; }
.ppm-scroll-hint { margin: .4rem 0 0; }
@media (max-width: 760px) {
  .ppm-grid .ppm-item { min-width: 9.5rem; max-width: 9.5rem; padding: .25rem .35rem; }
  .ppm-desc { font-size: .7rem; }
  .ppm-num { min-width: 1rem; }
  .ppm-sub { margin-left: 0; font-size: .66rem; }
}
.ppm-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin: .9rem 0 1.25rem; font-size: .85rem; color: var(--muted); }
.ppm-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.ppm-legend b { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border: 1px solid #c9d0d8; font-size: .75rem; }
.ppm-legend .now-key { background: #e7f0f9; border: 2px solid #1f4e79; }
/* Printed maintenance schedule: A4 landscape (the @page rule is in maintenance-site.ejs). */
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .ppm-head, .ppm-scroll-hint { display: none !important; }
  .ppm-print-head { display: flex; align-items: center; gap: 6mm; margin: 0 0 3mm; padding-bottom: 2mm; border-bottom: 1px solid #999; }
  .ppm-print-head img { height: 18mm; width: auto; mix-blend-mode: multiply; }
  .ppm-print-title h1 { font-size: 13pt; margin: 0 0 1mm; color: #1f4e79; }
  .ppm-print-title table { border-collapse: collapse; font-size: 8pt; }
  .ppm-print-title th { text-align: left; color: #555; font-weight: 600; padding: 0 2mm 0 0; }
  .ppm-print-title td { padding: 0 8mm 0 0; }
  .ppm-scroll { overflow: visible; border: 0; box-shadow: none; }
  .ppm-grid { width: 100%; table-layout: fixed; font-size: 6.5pt; }
  .ppm-grid .ppm-item { position: static; width: 52mm; min-width: 0; max-width: none; padding: .6mm 1mm; box-shadow: none; }
  .ppm-grid td, .ppm-grid .ppm-wk { min-width: 0; width: auto; height: 4.6mm; font-size: 6pt; }
  .ppm-grid thead th { height: 4mm; }
  .ppm-desc, .ppm-desc a { font-size: 6.5pt; text-decoration: none; }
  .ppm-sub { font-size: 5.5pt; margin-left: 0; }
  .ppm-grid tr { break-inside: avoid; }
  .due, .ppm-grid thead th, .ppm-legend b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ppm-legend { font-size: 7pt; margin: 2mm 0 0; color: #333; }
  .ppm-legend b { width: 4mm; height: 4mm; font-size: 6pt; }
}
/* "Sub-contractor PPM" planner colour (planner.js CATEGORIES.ppm) */
.cat-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: #c2185b; vertical-align: -.05em; margin-right: .15rem; }
.qfmtd-planner { margin-top: 1.25rem; padding: .8rem 1rem; border: 1px solid #f1c4d6; border-left: 5px solid #c2185b; border-radius: var(--radius); background: #fdf3f7; }
.qfmtd-planner .checkbox { margin: 0; white-space: normal; font-weight: 600; }
.qfmtd-planner .checkbox input { width: 1.2rem; height: 1.2rem; }
.qfmtd-planner .hint { margin: .35rem 0 0 1.6rem; }
.ppm-planner-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .6rem 0 0; }
/* Site subscription and site folder files */
.sub-off { background: var(--danger-soft); color: var(--danger); }
h1 .tag { vertical-align: middle; font-size: .8rem; }
.sub-card h2 { margin-top: 0; }
.sub-card.off { border-left: 5px solid var(--danger); }
.sub-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin: .5rem 0; }
.sub-form label { margin: 0; font-weight: 600; }
.sub-form input { width: auto; }
.file-folder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; margin-bottom: 1.25rem; max-width: 760px; }
.file-folder-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.file-folder > p { margin: 0; }
.file-row { display: flex; align-items: center; gap: .8rem; padding: .55rem .6rem; border: 1px solid #eef1f5; border-radius: 8px; color: var(--text); text-decoration: none; }
.file-row:hover { background: var(--brand-soft); border-color: var(--brand); }
.file-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.6rem; height: 2.2rem; border-radius: 6px; background: #1d6f42; color: #fff; font-size: .65rem; font-weight: 800; letter-spacing: .04em; }
.file-info { flex: 1 1 auto; min-width: 0; display: grid; gap: .1rem; overflow-wrap: anywhere; }
/* Folders admins add to a site, inside each other (site_folders; partials/folder-list.ejs, site-folder.ejs) */
.site-folders { display: grid; gap: .45rem; }
.folder-row .folder-icon { width: 2.2rem; height: 2.2rem; }
.folder-open { flex: 0 0 auto; font-size: 1.6rem; line-height: 1; color: var(--muted, #6b7785); }
.add-folder { margin-top: .35rem; }
.add-folder label { font-weight: 600; }
.add-folder-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.add-folder-row input { flex: 1 1 12rem; min-width: 0; width: auto; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .4rem; margin-bottom: .4rem; font-size: .9rem; overflow-wrap: anywhere; }
.crumbs a { text-decoration: none; }
.crumbs > span[aria-hidden] { color: var(--muted, #6b7785); }
.crumbs [aria-current] { font-weight: 600; }
.folder-tools { max-width: 760px; }
/* "Search This Site" box on a site page and its results (partials/site-search-box.ejs, site-search.ejs) */
.site-search { max-width: 760px; margin: 0 0 1.25rem; padding: .8rem 1rem .9rem; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.site-search-title { display: block; margin: 0 0 .45rem; font-size: 1.05rem; font-weight: 800; color: var(--brand); }
.site-search input { flex: 1 1 auto; min-width: 0; padding-left: 2.4rem; }
.site-search .btn { flex: 0 0 auto; }
.find-meta a.tag { text-decoration: none; }
/* "Client can view" (partials/client-badge.ejs, file-sheet.ejs) */
.tag-client-view { display: inline-flex; align-items: center; gap: .3rem; background: #e3f5e8; color: #1b6b34; border: 1px solid #8fd0a3; font-weight: 700; white-space: nowrap; }
.tag-client-view svg { width: 1em; height: 1em; flex: 0 0 auto; }
.tag-staff-only { background: #eef1f5; color: var(--muted); white-space: nowrap; }
.client-cell { white-space: normal; }
.client-shared { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; }
.client-shared-by { color: #1b6b34; font-size: .8rem; font-weight: 600; }
.client-toggle { margin: .35rem 0 0; }
.sheets td.client-cell > form, .sheets td.client-cell > .client-shared { grid-column: 2; justify-self: start; }
.file-sheet > .btn { order: 1; }
.file-sheet > .new-folder { order: 2; }
.client-view-tick { order: 3; flex: 1 1 100%; display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .88rem; font-weight: 600; cursor: pointer; }
.client-view-tick input { width: auto; margin: 0; }
.share-history { margin: .4rem 0 0; font-size: .82rem; }
.share-history summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.share-history ul { list-style: none; margin: .3rem 0 0; padding: 0 0 0 .6rem; border-left: 3px solid var(--border); display: grid; gap: .2rem; }
.share-history li.sh-on strong { color: #1b6b34; }
.share-history li.sh-off strong { color: #8a4b00; }
.sheets td.client-cell > .share-history { grid-column: 2; }
.client-view-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: .4rem 0 0; }
/* Filing reviewed sheets in a site's folders: "Requires Filing" until filed (partials/file-sheet.ejs) */
.tag-unfiled { background: #fff1d6; color: #8a4b00; border: 1px solid #f0b54a; font-weight: 700; white-space: nowrap; }
.filing-note { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: -.2rem 0 .8rem; font-size: .9rem; }
.file-sheet { display: flex; gap: .35rem; margin-top: .35rem; }
.file-sheet { flex-wrap: wrap; }
.file-sheet .btn { flex: 0 0 auto; }
.new-folder { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .35rem; }
.new-folder[hidden] { display: none; }
.new-folder input { flex: 1 1 10rem; min-width: 0; width: auto; padding: .3rem .45rem; font-size: .85rem; }
.file-sheet .new-folder select { flex: 1 1 10rem; max-width: none; }
.new-folder .err { flex-basis: 100%; margin: 0; }
.file-sheet select { flex: 1 1 auto; min-width: 0; max-width: 14rem; width: auto; padding: .3rem .4rem; font-size: .85rem; }
.filing-cell .file-sheet:first-child { margin-top: 0; }.folder-title { display: flex; align-items: center; gap: .6rem; overflow-wrap: anywhere; }/* QFMTD quote drop zone and check page */
.qfmtd-drop { display: block; margin: 0 0 1.25rem; padding: 1rem 1.1rem; border: 2px dashed #9fb6cc; border-radius: var(--radius); background: #f6f9fc; transition: background .15s, border-color .15s; }
.qfmtd-drop.over { background: var(--brand-soft); border-color: var(--brand); }
.qfmtd-drop.busy { opacity: .7; cursor: progress; }
.qfmtd-drop.bad { border-color: var(--danger); }
.qfmtd-drop-inner { display: flex; align-items: center; gap: .9rem; }
.qfmtd-drop-inner p { margin: .2rem 0 0; }
.qfmtd-drop-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px; background: #e4effc; color: #1d5fa8; }
.qfmtd-drop-icon svg { width: 1.5rem; height: 1.5rem; }
.qfmtd-drop .err { margin: .6rem 0 0; }
.link-like { display: inline; margin: 0; font-weight: 600; color: var(--brand); text-decoration: underline; cursor: pointer; }
/* Quotations and Breakdowns (jobFiles.js, admins only). The drop box reuses the QFMTD drop look. */
.file-icon.kind-pdf { background: #b3261e; }
.file-icon.kind-docx, .file-icon.kind-doc { background: #2b579a; }
.file-kind { display: inline-block; padding: 0 .3rem; margin-right: .2rem; border-radius: 4px; color: #fff; background: #2b579a; font-size: .62rem; font-weight: 800; letter-spacing: .04em; line-height: 1.5; vertical-align: 1px; }
.file-kind.kind-pdf { background: #b3261e; }
.job-files-list td:last-child { white-space: nowrap; }
.job-replace-hint { margin-top: .55rem !important; }
.tag-breakdown { background: #fde7e7; color: #a32020; } /* breakdown rows in a site folder */
/* Let's Find It! (admins' master search, search.js) */
.find-it { margin: 0 0 1.25rem; padding: 1rem 1.1rem 1.1rem; border-radius: var(--radius); background: linear-gradient(135deg, #1f4e79, #2f6aa3); color: #fff; box-shadow: var(--shadow); }
.find-it-title { display: block; margin: 0 0 .55rem; font-size: 1.35rem; font-weight: 800; letter-spacing: .01em; color: #fff; }
.find-it-row { display: flex; gap: .5rem; align-items: center; position: relative; }
.find-it-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 1.2rem; height: 1.2rem; color: var(--muted); pointer-events: none; }
.find-it-icon svg { width: 100%; height: 100%; display: block; }
.find-it input { flex: 1 1 auto; min-width: 0; padding-left: 2.4rem; font-size: 1.05rem; border-color: transparent; }
.find-it .btn { flex: 0 0 auto; background: #fff; color: #1f4e79; border-color: #fff; font-weight: 700; }
.find-it .btn:hover { background: #e4effc; }
.find-it-hint { margin: .5rem 0 0; color: rgba(255, 255, 255, .8) !important; }
.find-group { margin-bottom: 1.4rem; }
.find-count { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.4rem; padding: 0 .4rem; margin-left: .3rem; border-radius: 999px; background: #e4effc; color: #1d5fa8; font-size: .75rem; vertical-align: 2px; }
.find-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.find-row { display: grid; grid-template-columns: minmax(8rem, 11rem) 1fr auto; gap: .25rem 1rem; align-items: center; padding: .65rem .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
a.find-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.find-ref { font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; overflow-wrap: anywhere; }
.find-main { min-width: 0; overflow-wrap: anywhere; }
.find-meta { text-align: right; }
.find-dot { flex: 0 0 auto; width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); }
.find-flag { color: #b45309; }
.find-ready { color: #1e7a45; letter-spacing: .03em; }
@media (max-width: 700px) {
  .find-row { grid-template-columns: 1fr; }
  .find-meta { text-align: left; }
  .find-it .btn { padding-left: .8rem; padding-right: .8rem; }
}
/* Dashboards (super users): the shared Excel quote and breakdown dashboards */
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; max-width: 11rem; overflow-wrap: anywhere; }
.dash-table .money, .dash-table td:first-child { white-space: nowrap; } /* values typed as text (e.g. "£705 / £910") may wrap */
.dash-table .dash-desc { min-width: 12rem; }
.dash-table .dash-po { max-width: 12rem; overflow-wrap: anywhere; } /* client PO: a number, or sometimes a note */
@media (max-width: 1000px) {
  .dash-table .dash-desc { min-width: 7rem; } .dash-table .dash-po { max-width: 7.5rem; }
  .dash-table th, .dash-table td { padding-left: .45rem; padding-right: .45rem; font-size: .88rem; }
}
@media (max-width: 760px) { .dash-table .num { text-align: left; } .dash-table .dash-desc { min-width: 0; } }
/* Status drop-down on a dashboard (looks like the planner's "Who" drop-down) */
.status-filter { display: flex; align-items: center; gap: .6rem; margin: .8rem 0 0; max-width: 30rem; }
.status-filter > .label { flex: 0 0 auto; margin: 0; }
.status-filter .status-menu { flex: 1 1 auto; min-width: 0; }
.status-filter.busy { opacity: .6; }
.status-menu summary { gap: .6rem; }
.status-menu [data-status-text] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-shown { flex: 0 0 auto; }
.status-list { max-height: 22rem; }
.status-list .checkbox { display: flex; align-items: center; gap: .5rem; }
.status-name { flex: 1 1 auto; }
.status-count { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: #eef1f5; color: var(--muted); font-size: .75rem; font-weight: 600; }
.who-list .status-search { width: 100%; /* beats ".who-list input { width: auto }" */ margin: .15rem 0 .35rem; padding: .45rem .6rem; min-height: 0; font-size: .9rem; }
.status-list .checkbox[hidden], .status-nomatch[hidden] { display: none; }
.status-nomatch { margin: .3rem .5rem; }
.status-quick { display: flex; gap: 1rem; padding: .3rem .5rem .45rem; border-bottom: 1px solid #eef1f5; margin-bottom: .25rem; font-size: .85rem; }
.status-quick .link-like { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; }
.status-apply { position: sticky; bottom: -.35rem; margin: .3rem -.35rem -.35rem; padding: .45rem .5rem; background: var(--surface); border-top: 1px solid #eef1f5; text-align: right; }
.dash-cards { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: .8rem; max-width: 860px; }
.dash-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.dash-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.dash-card-icon { flex: 0 0 auto; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 12px; background: #e4effc; color: #1d5fa8; }
.dash-card-icon svg { width: 1.8rem; height: 1.8rem; }
.dash-card-text { display: grid; gap: .25rem; min-width: 0; }
.dash-card-text strong { font-size: 1.1rem; }
.dash-ready { justify-self: start; display: inline-flex; align-items: center; gap: .4rem; padding: .12rem .25rem .12rem .55rem; border-radius: 999px; background: #e3f4ea; color: #1e7a45; font-size: .7rem; font-weight: 800; letter-spacing: .05em; }
.dash-ready strong { display: grid; place-items: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .25rem; border-radius: 999px; background: #1e7a45; color: #fff; font-size: .75rem !important; letter-spacing: 0; }
/* Check page: what Phineas read, and the client-and-site choices */
.read-result { display: flex; align-items: flex-start; gap: .8rem; border-left: 4px solid var(--brand); }
.read-result.found { border-left-color: #2e7d4f; }
.read-result.none { border-left-color: var(--warn, #b26a00); }
.read-result p { margin: .2rem 0 0; }
.read-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: #e4effc; color: #1d5fa8; }
.read-result.found .read-icon { background: #e3f4ea; color: #2e7d4f; }
.read-result.none .read-icon { background: #fdf0dc; color: #b26a00; }
.read-icon svg { width: 1.4rem; height: 1.4rem; }
.choice-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.choice { display: flex; align-items: flex-start; gap: .7rem; margin: 0; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 400; }
.choice:hover { border-color: var(--brand); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input { flex: 0 0 auto; width: auto; margin: .2rem 0 0; }
.choice-text { display: grid; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.choice-why { color: #2e7d4f; font-weight: 600; }
.choice-panel { margin: -.2rem 0 .3rem; padding: .8rem .9rem; border: 1px dashed var(--border); border-radius: 10px; }
.choice-panel[hidden], [data-new-client-only][hidden] { display: none; }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.qfmtd-items-scroll { overflow-x: auto; }
.qfmtd-items { width: 100%; border-collapse: collapse; }
.qfmtd-items th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; padding: .45rem .4rem; border-bottom: 1px solid var(--border); }
.qfmtd-items td { padding: .35rem .3rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.qfmtd-items td:first-child { text-align: center; padding-top: .7rem; }
.qfmtd-items input[type=checkbox] { width: 1.2rem; height: 1.2rem; min-height: 0; }
.qfmtd-items input, .qfmtd-items select { min-height: 2.2rem; padding: .3rem .45rem; }
.qfmtd-items [data-subcon-row] { margin-top: .3rem; }
.qfmtd-items .qfmtd-week { width: 5rem; }
.qfmtd-items tr.has-error td { background: #fffafa; }
.qfmtd-items td > .muted { display: block; margin-top: .2rem; }
@media (max-width: 760px) {
  .qfmtd-items, .qfmtd-items tbody, .qfmtd-items tr, .qfmtd-items td { display: block; width: auto; }
  .qfmtd-items thead { display: none; }
  .qfmtd-items tr { border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem .6rem; margin-bottom: .6rem; }
  .qfmtd-items td { border: 0; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem; align-items: center; text-align: left !important; padding: .25rem 0 !important; }
  .qfmtd-items td::before { content: attr(data-label); font-size: .8rem; font-weight: 600; color: var(--muted); }
  .qfmtd-items td > * { grid-column: 2; }
  .qfmtd-items input[type=checkbox] { justify-self: start; }
}

/* My day: today's tasks */
.task-cards { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .8rem; max-width: 760px; }
.task-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 5px solid var(--c); padding: .9rem 1rem; }
.task-when { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; }
.task-when .cat-pill { margin: 0; }
.sheet-flag { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; color: #b42318; }
.task-title { margin: .45rem 0 .5rem; font-size: 1.15rem; }
.task-title a { color: var(--text); text-decoration: none; }
.task-title a:hover { color: var(--brand); text-decoration: underline; }
.task-details { margin-bottom: .2rem; }
.task-details dd { font-weight: 500; }
.task-details .notes { white-space: pre-wrap; }
.task-where { margin: 0; }
.task-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.task-actions .new-menu .menu { left: 0; right: auto; }
.owed .task-card { padding: .7rem 1rem; }
.owed .task-title { font-size: 1rem; margin: .3rem 0 .2rem; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  main { padding: 1rem 1rem 3rem; }
  .topbar { padding: .5rem 1rem; }
  .grid { grid-template-columns: 1fr; }
  .sheet-form { padding: .25rem 1rem 1rem; }
  .company-logo { height: 96px; }
  .sheet-head h1 { font-size: 1.35rem; }
  .check-row { grid-template-columns: 1fr; }
  .task-head { display: none; }
  .task-row { grid-template-columns: 2rem minmax(0, 1fr); }
  .task-date { grid-column: 2; }
  .seg { width: 100%; }
  .seg label { flex: 1; text-align: center; }
  .user-form, .client-form { grid-template-columns: 1fr; }
  .page-head .new-menu { width: 100%; }
  .new-menu summary.btn { width: 100%; }
  .new-menu .menu { left: 0; right: 0; min-width: 0; }
  .task-actions > * { flex: 1 1 auto; }
  .task-actions .new-menu summary.btn { width: 100%; }
  .task-actions .new-menu .menu { right: 0; min-width: min(22rem, calc(100vw - 4rem)); }
  .search select { flex: 1 1 100%; }
  .search .btn { flex: 1; }

  table.sheets, .sheets tbody, .sheets tr, .sheets td { display: block; width: 100%; }
  .sheets thead { display: none; }
  .sheets tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .sheets tbody tr:last-child { border-bottom: 0; }
  .sheets td { border: 0; padding: .2rem .9rem; display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; }
  .sheets td > .tag { justify-self: start; }
  .sheets td.user-actions > form, .sheets td.user-actions > span { grid-column: 2; justify-self: start; } /* one action per line */
  .sheets td.filing-cell { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .sheets td.filing-cell > .file-sheet { grid-column: 2; margin-top: 0; min-width: 0; } /* "File in" box under Requires Filing */
  .sheets td.filing-cell .file-sheet > select { max-width: none; flex: 1 1 0; width: auto; }
  .sheets td.filing-cell .new-folder > * { flex-basis: 100%; }
  .sheets td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; padding-top: .1rem; }
}

/* ---------- printing a sheet ---------- */
@media print {
  /* The footer (address + "Powered by Phineas") is drawn in the bottom page margin on every page
     by an @page @bottom-center rule in views/sheet.ejs. Unlike a position: fixed footer, page
     margin boxes also print when sending to a printer driver such as Adobe PDF. */
  @page { margin: 10mm 14mm 24mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .no-print, .flash, .status-banner { display: none !important; }
  main { padding: 0; max-width: none; }
  .company-logo { height: 30mm; }
  .sheet-head { position: fixed; left: 0; right: 0; top: 0; height: 34mm; margin: 0; align-items: center; background: #fff; border-bottom: 1px solid #999; }
  .sheet-head .meta { font-size: 8pt; }
  .head-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 1.5mm 5mm 2mm; }
  .head-badge-label { font-size: 8pt; }
  .head-badge-value { font-size: 22pt; }
  .head-badge.stamp { padding: 1.5mm 3.5mm; }
  .head-badge.stamp .head-badge-value { font-size: 13pt; }
  /* The header is pinned to the top of every page; the table header group repeats on every
     page too, keeping the sheet's content clear of it. */
  .print-frame { display: table; width: 100%; border-collapse: collapse; }
  .print-frame > tbody { display: table-row-group; }
  .print-frame > tbody > tr { display: table-row; }
  .print-frame > tbody > tr > td { display: table-cell; }
  .print-space-top { display: table-header-group; }
  .print-space-top td { padding: 0; }
  .print-space-top div { height: 38mm; }
  /* Text boxes print as plain text that can run across pages. */
  textarea { display: none; }
  .print-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; border-bottom: 1px solid #999; padding: .15rem 0;
                min-height: calc(var(--rows, 4) * 1.5em); }
  .ref-field .hint, .field > .hint { display: none; }
  .ref-field { padding-top: 12mm; } /* extra space under the header on page 1 only */
  .sheet-foot { display: none; } /* printed in the page margin instead, see @page above */
  .sheet-form { box-shadow: none; padding: 0; }
  /* One column on paper, laid out as plain blocks: page breaks inside a grid don't honour
     "keep this heading with what follows", which stranded headings at the foot of a page. */
  .grid { display: block; }
  .grid > * + * { margin-top: .5rem; }
  input, select, textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: .15rem 0; min-height: 0; -webkit-appearance: none; appearance: none; }
  textarea { resize: none; overflow: visible; }
  .section { break-after: avoid; color: #000; border-color: #999; }
  .section.print-new-page { break-before: page; }
  .field > label, .field > .label { break-after: avoid; } /* keep a field's label with its text */
  .check-row { break-inside: avoid; }
  .seg span { padding: .2rem .5rem; }
  .seg-pass input:checked + span, .seg-fail input:checked + span, .seg-na input:checked + span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Checklists on paper: one line per check showing just the chosen result; the note underneath only if there is one. */
  .check-row { grid-template-columns: minmax(0, 1fr) auto; gap: .5mm 4mm; padding: 1.2mm 0; border-color: #ddd; }
  .check-row .seg { width: auto; border: 0; overflow: visible; }
  .check-row .seg label { flex: none; }
  .check-row .seg label:not(:has(input:checked)) { display: none; }
  .check-row .seg span { border: 0; border-radius: 999px; padding: .05rem .7rem; font-size: 9pt; }
  .check-row:not(:has(input:checked)) .seg::after { content: "–"; color: #999; }
  .check-row .check-note { grid-column: 1 / -1; border: 0; padding: 0; min-height: 0; font-size: 9.5pt; color: #333; }
  .check-row .check-note:placeholder-shown { display: none; }
  /* Row tables (e.g. light fittings) print as a real table; the header row repeats on each page.
     Their box is a plain block on paper: a grid running over several pages was measured short, so
     the next heading printed on top of the table's last row. */
  fieldset.rows-field { display: block; }
  fieldset.rows-field > * + * { margin-top: 2mm; }
  .rows-table { display: table; width: 100%; table-layout: fixed; font-size: var(--pf, 9pt); }
  .rows-table thead { display: table-header-group; }
  .rows-table tbody { display: table-row-group; }
  .rows-table tr, .rows-table tr.rows-row { display: table-row; position: static; border: 0; padding: 0; margin: 0; background: none; break-inside: avoid; }
  .rows-table th, .rows-table td { display: table-cell; width: auto; }
  .rows-table td { padding: .8mm 1mm; border-bottom: 1px solid #ddd; vertical-align: top; overflow-wrap: anywhere; }
  .rows-table td::before { content: none; }
  .rows-table th { background: none; color: #000; font-size: 7pt; text-transform: none; letter-spacing: 0; padding: 1mm; border-bottom: 1px solid #999; vertical-align: bottom; overflow-wrap: anywhere; }
  .rows-table th { width: var(--pw, auto); } /* printed column widths come from the sheet definition */
  .rows-table td.col-id { padding-right: 1mm; }
  /* Print the plain-text copy of each cell (it wraps) instead of the typing box. */
  .rows-table td > input, .rows-table td > select, .grid-table td > input { display: none; }
  .rows-table .cell-print, .grid-table .cell-print { display: inline; }
  /* Asset register: serial numbers in bold, each asset's photo as a thumbnail in its row. */
  .rows-table .serial-cell > input { display: none; }
  .rows-table .serial-cell .cell-print { font-weight: 700; }
  .rows-table td.col-serial { padding-right: 1mm; }
  .row-photo img { width: 100%; height: auto; max-height: 32mm; object-fit: contain; border: 0; border-radius: 0; background: none; }
  /* Readings grids on paper */
  .grid-scroll { overflow: visible; }
  .grid-table { min-width: 0; font-size: 8.5pt; table-layout: fixed; }
  .grid-table th, .grid-table td { padding: .6mm 1.5mm; border-bottom: 1px solid #ddd; }
  .grid-table thead th { background: none; color: #000; font-size: 7.5pt; border-bottom: 1px solid #999; }
  .grid-table thead th:first-child { font-size: 8.5pt; font-weight: 700; width: 58mm; }
  .grid-table tbody th { width: 58mm; font-size: 8.5pt; }
  .grid-table tr { break-inside: avoid; }
  .grid-table th:first-child { position: static; box-shadow: none; background: none; }
  .rows-table tr.row-fail td { background: #fdecea; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rows-table tr.row-fail .tally-col { color: #b42318; font-weight: 700; }
  .rows-summary { color: #000; }
  /* Sheet types with printCompact: short answers print as "Label   answer" on one line. */
  .print-compact .grid > .field:not(.full):has(> input:not([type=hidden]), > select) {
    display: grid; grid-template-columns: 72mm minmax(0, 1fr); align-items: baseline; gap: 3mm;
    margin-top: 0; padding: .7mm 0; border-bottom: 1px solid #ddd; font-size: 10pt; line-height: 1.35;
  }
  .print-compact .grid > .field:not(.full) > label { margin: 0; }
  .ticks-field .ticks { display: none; }
  .ticks-field .ticks-print { display: block; border-bottom: 1px solid #999; padding: .15rem 0; min-height: 1.5em; }
  .print-compact .grid > .ticks-field {
    display: grid; grid-template-columns: 72mm minmax(0, 1fr); align-items: baseline; gap: 3mm;
    margin-top: 0; padding: .7mm 0; border-bottom: 1px solid #ddd; font-size: 10pt; line-height: 1.35;
  }
  .ticks-label { break-after: avoid; }
  .print-compact .grid > .ticks-field > .ticks-label { margin: 0; }
  .print-compact .grid > .ticks-field .ticks-print { border: 0; padding: 0; min-height: 0; }
  .print-compact .grid > .field:not(.full) > input, .print-compact .grid > .field:not(.full) > select { border: 0; padding: 0; min-height: 0; font-size: 10pt; line-height: 1.35; }
  .sig, .task-row, .photo { break-inside: avoid; }
  .photo { border: 0; background: none; min-height: 0; }
  .photo:not(:has(img:not([hidden]))) { display: none; }
  /* Photos print one per row, 132mm wide and up to 127mm tall (half as big again as the
     earlier two-per-row layout). */
  .gallery { grid-template-columns: 1fr; gap: 6mm; }
  .gallery-item { break-inside: avoid; border: 0; background: none; padding: 0; width: 132mm; max-width: 100%; }
  .gallery-item img { aspect-ratio: auto; max-height: 127mm; object-fit: contain; object-position: left top; }
  .gallery-note { border: 0; padding: 0; font-size: 9.5pt; }
  .gallery-note:placeholder-shown { display: none; }
  .gallery-field:not(:has(.gallery-item)),
  .grid:not(:has(.gallery-item)) .photos-heading { display: none; }
}

/* ---------- asset stickers (views/stickers.ejs) ----------
   A4 sheets of 63.5 x 38.1 mm labels, Avery L7160 layout: 3 across x 7 down, 15.15 mm top margin,
   7.25 mm side margin, 66.04 mm across and 38.1 mm down from one label to the next. The page prints
   with no margins (@page in the view), so these measurements are measured from the paper's edge. */
.stickers-bar { margin-bottom: 1.25rem; }
.stickers-bar h1 { margin-bottom: .2rem; }
.stickers-bar p { margin: .3rem 0; }
.stickers-form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .8rem 0; }
.stickers-form label { margin: 0; font-weight: 600; }
.stickers-form select { width: auto; min-width: 9rem; }
.label-sheets { display: grid; gap: 1.5rem; justify-content: center; }
.label-sheet { position: relative; width: 210mm; height: 297mm; background: #fff; box-shadow: 0 2px 12px rgba(15, 30, 50, .18); overflow: hidden; }
@media (max-width: 860px) { .label-sheet { zoom: .44; } }
/* Scoped to .label-sheet: a bare .label rule also caught the field headings on sheets and the planner
   (e.g. the Job sheet's "Customer signature"), which use class="label". */
.label-sheet .label {
  position: absolute; box-sizing: border-box; width: 63.5mm; height: 38.1mm;
  left: calc(7.25mm + var(--col) * 66.04mm); top: calc(15.15mm + var(--row) * 38.1mm);
  padding: 2.6mm 2.4mm 2.4mm 3mm; border-radius: 2.5mm; outline: 1px dashed #c9d3df;
  display: grid; grid-template-columns: minmax(0, 1fr) 21mm; grid-template-rows: 1fr auto; column-gap: 1.6mm;
  font-family: "Segoe UI", Arial, sans-serif; color: #111; overflow: hidden;
}
.label-sheet .label-empty { outline-color: #e6ebf1; background: repeating-linear-gradient(135deg, #fff 0 3mm, #f6f8fb 3mm 6mm); }
.label-logos { display: flex; align-items: flex-start; min-width: 0; }
.label-quinta { height: 18mm; width: auto; display: block; }
/* right-hand side: QR code with "PhineasFST" (text only) under it */
.label-side { grid-column: 2; grid-row: 1 / 3; align-self: center; display: grid; justify-items: center; gap: .8mm; }
.label-side .wordmark { font-size: 7pt; font-weight: 700; color: #1f4e79; letter-spacing: .01em; white-space: nowrap; line-height: 1; }
.label-side .wordmark .fst { color: #17a06b; font-style: italic; }
.label-serial { grid-column: 1; align-self: end; line-height: 1.05; min-width: 0; }
.label-caption { display: block; font-size: 5.5pt; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #555; margin-bottom: .5mm; }
.label-serial strong { display: block; font-size: 13.5pt; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
/* the asset's description under the serial, up to two lines */
.label-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
              margin-top: .6mm; font-size: 6.5pt; font-weight: 600; line-height: 1.2; color: #333; }
.label-sheet .label .qr { width: 21mm; height: 21mm; display: block; }
@media print {
  .stickers-page .label-sheets { display: block; }
  .label-sheet { box-shadow: none; zoom: 1; break-after: page; }
  .label-sheet:last-child { break-after: auto; }
  .label-sheet .label { outline: 0; }
  .label-sheet .label-empty { background: none; }
  .label-side .wordmark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Organisations (owner's decisions, Nov 2026) ---------- */
/* An organisation's own uploaded logo can be any shape: keep it inside the space QuintaFM's
   (square) logo has. QuintaFM's default logo isn't affected (no .custom-logo). */
.company-logo.custom-logo { max-width: 260px; object-fit: contain; }
.company-logo-text { display: flex; align-items: center; max-width: 16rem; font-size: 1.5rem; font-weight: 800; color: var(--brand, #1f4e79); line-height: 1.15; text-align: right; }
.sheet-head.logo-left .company-logo-text { text-align: left; }
.label-quinta.custom-logo { max-width: 100%; height: auto; max-height: 18mm; object-fit: contain; }
.label-org-name { font-size: 9pt; font-weight: 800; color: #1f4e79; line-height: 1.1; }
.ppm-print-org { font-size: 14pt; color: #1f4e79; }
@media print {
  .company-logo.custom-logo { max-width: 65mm; }
  .company-logo-text { font-size: 16pt; max-width: 70mm; }
  .ppm-print-head img.custom-logo { max-width: 60mm; object-fit: contain; }
}
/* The developer's organisation drop-down in the top bar. */
.org-switch { margin: 0; }
.org-switch select { max-width: 9.5rem; font: inherit; font-size: .78rem; padding: .15rem .3rem; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; }
.org-switch select option { color: #1b2430; background: #fff; }
@media (max-width: 520px) { .org-switch select { max-width: 6.2rem; font-size: .7rem; } }
/* Organisations page */
.org-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); gap: .7rem; }
.org-card { display: flex; gap: .9rem; align-items: center; height: 100%; box-sizing: border-box; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.org-card.current { border-color: var(--brand, #1f4e79); }
.org-card-logo { flex: 0 0 4.5rem; height: 4.5rem; display: grid; place-items: center; }
.org-card-logo img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.org-card-info { display: flex; flex-wrap: wrap; gap: .25rem .45rem; align-items: center; min-width: 0; }
.org-card-info strong { flex-basis: 100%; }
.org-card-info .small { flex-basis: 100%; }
.org-logo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .3rem; }
.org-logo-preview { height: 72px; max-width: 220px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 4px; }

/* ---------- two-step sign-in (twostep.js; login-code.ejs, two-step.ejs) ---------- */
.auth-card .two-step-title { font-size: 1.2rem; margin: 0 0 .4rem; text-align: center; }
.auth-card > p.muted:first-of-type { margin-top: 0; }
.otp-input { font-size: 1.35rem; letter-spacing: .25em; font-variant-numeric: tabular-nums; }
.otp-input::placeholder { letter-spacing: .05em; font-size: 1rem; }
.inline-row .otp-input { flex: 1 1 10rem; max-width: 14rem; }
.check-line { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-top: 1rem; }
.check-line input { width: auto; min-height: 0; margin: 0; }
.stack .check-line { margin-top: 1rem; }
.hint-under { margin: .2rem 0 1rem 1.6rem; }
.backup-code { margin-top: 1rem; }
.backup-code summary, .typed-key summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .92rem; }
.backup-code p { margin: .4rem 0 0; }
.two-step-done { margin-top: 0; }
.two-step-done .tag { margin-right: .35rem; }
.two-step-steps { margin: 0; padding-left: 1.4rem; }
.two-step-steps > li { margin-bottom: 1.4rem; }
.two-step-steps > li:last-child { margin-bottom: 0; }
.two-step-steps h2 { font-size: 1.05rem; margin: 0 0 .3rem; }
.two-step-steps p { margin: 0 0 .6rem; }
.two-step-qr { width: 200px; max-width: 70vw; margin: .4rem 0 .8rem; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.two-step-qr svg { display: block; width: 100%; height: auto; }
.setup-key { font-size: 1.05rem; letter-spacing: .06em; word-break: break-all; background: #eef1f5; padding: .3rem .5rem; border-radius: 6px; }
.backup-list { columns: 2; column-gap: 2rem; padding-left: 1.6rem; margin: 1rem 0; }
.backup-list li { margin-bottom: .45rem; }
.backup-list code { font-size: 1.1rem; letter-spacing: .05em; }
.two-step-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.two-step-on { display: inline-flex; align-items: center; gap: .4rem; }
.two-step-on form { margin: 0; }
@media (max-width: 420px) { .backup-list { columns: 1; } }
