/* Standa portal design system v0.1
   Swiss-minimal, calm and professional. Phone-first. WCAG 2.2 AA.
   Contrast (checked): navy on white 17.9:1; muted text #475569 on white 7.6:1, on page bg 6.8:1;
   orange text #C2410C 5.2:1; brand orange #F26B1F (3.0:1) used only for bars, borders and focus,
   never for text. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fonts/poppins-700.woff2") format("woff2"); }

:root {
  /* Colour */
  --navy: #0f172a;
  --navy-2: #1e293b;
  --orange: #f26b1f;          /* brand: graphics, borders, focus only */
  --orange-text: #c2410c;     /* orange as text */
  --bg: #f2f3f6;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #cbd5e1;
  --border-strong: #64748b;
  --info-bg: #dbeafe;   --info-text: #1e3a8a;
  --ok-bg: #dcfce7;     --ok-text: #166534;
  --warn-bg: #fef3c7;   --warn-text: #92400e;
  --error: #b91c1c;     --error-bg: #fef2f2;
  --neutral-bg: #e2e8f0; --neutral-text: #334155;

  /* Type */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Poppins", var(--font-body);
  --fs-xs: 0.8125rem;  /* 13 */
  --fs-sm: 0.875rem;   /* 14 */
  --fs-base: 1rem;     /* 16 */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.75rem;   /* 28 */
  --fs-3xl: 2.125rem;  /* 34 */

  /* Space (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.05);
  --header-h: 64px;
  --t-fast: 150ms;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.6 var(--font-body);
}
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.25; margin: 0 0 var(--s3); }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-xl); font-weight: 600; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
p { margin: 0 0 var(--s4); }
a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--orange-text); }
strong { font-weight: 600; }
@media (min-width: 768px) { h1 { font-size: var(--fs-3xl); } }

/* Focus: always visible, never removed */
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 2px; }

/* Skip link */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: var(--s2) var(--s4); z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 1040px; margin: 0 auto; height: var(--header-h); padding: 0 var(--s4); display: flex; align-items: center; gap: var(--s4); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.logo svg { height: 26px; width: auto; }
.logo .portal-name { font-size: var(--fs-sm); color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 10px; font-weight: 500; }
.nav { margin-left: auto; display: flex; gap: var(--s1); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); color: var(--navy); }
.nav a:hover { background: var(--bg); color: var(--navy); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--orange); border-radius: 0; }
@media (max-width: 560px) { .logo .portal-name { display: none; } .nav a { padding: 0 var(--s2); } }

/* Layout */
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
main.narrow { max-width: 720px; }
@media (min-width: 768px) { main { padding-top: var(--s7); } }
.page-head { margin-bottom: var(--s5); }
.page-head .eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--orange-text); margin-bottom: var(--s2); }
.lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 60ch; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.stack > * + * { margin-top: var(--s4); }
.grid-2 { display: grid; gap: var(--s4); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s4); }
.card.accent { border-top: 4px solid var(--orange); }
@media (min-width: 768px) { .card { padding: var(--s6); } }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.card-head h2, .card-head h3 { margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5); border-radius: var(--radius-sm); border: 2px solid var(--navy); background: var(--navy); color: #fff; font: 600 var(--fs-base)/1 var(--font-body); text-decoration: none; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--navy); }
.btn.secondary:hover { background: var(--bg); }
.btn.link { background: none; border-color: transparent; color: var(--navy); text-decoration: underline; text-decoration-color: var(--orange); padding: 0 var(--s2); }
.btn svg { width: 18px; height: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s5); }
@media (max-width: 480px) { .actions .btn:not(.link) { width: 100%; } }

/* Status badge (text always present, colour is supportive only) */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.info { background: var(--info-bg); color: var(--info-text); }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.neutral { background: var(--neutral-bg); color: var(--neutral-text); }

/* Engagement status tracker */
.tracker { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); }
.tracker li { font-size: var(--fs-xs); color: var(--text-muted); text-align: left; }
.tracker li::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--neutral-bg); margin-bottom: 6px; }
.tracker li.done::before { background: var(--navy); }
.tracker li.current::before { background: var(--orange); }
.tracker li.current { color: var(--navy); font-weight: 600; }
@media (max-width: 560px) { .tracker li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .tracker li.current span { position: static; width: auto; height: auto; clip: auto; } .tracker { grid-template-columns: repeat(7, 1fr); } }

/* Next action panel */
.next { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s4); border-radius: var(--radius-sm); background: var(--bg); margin-top: var(--s4); }
.next svg { flex: none; width: 24px; height: 24px; color: var(--orange-text); margin-top: 2px; }
.next p { margin: 0; }

/* Forms */
.form-progress { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--s2); }
.progress-bar { height: 6px; background: var(--neutral-bg); border-radius: 3px; overflow: hidden; margin-bottom: var(--s5); }
.progress-bar span { display: block; height: 100%; background: var(--orange); }
.field { margin-bottom: var(--s5); }
.field label, .field legend, .field .label { display: block; font-weight: 600; margin-bottom: var(--s1); color: var(--navy); }
.field .hint { display: block; font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--s2); }
.field .optional { font-weight: 400; color: var(--text-muted); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: var(--s3); border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
  font: 400 var(--fs-base)/1.4 var(--font-body); color: var(--text); background: #fff;
}
input.w-short { max-width: 10rem; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--orange); outline-offset: 0; border-color: var(--navy); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--error); }
.field.has-error { border-left: 4px solid var(--error); padding-left: var(--s4); }
.error-msg { display: block; color: var(--error); font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s2); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s3); min-height: 44px; }
.choice input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.choice label { font-weight: 400; color: var(--text); margin: 0; }
.choice-inline { display: flex; flex-wrap: wrap; gap: var(--s5); }

/* Error summary */
.error-summary { border: 3px solid var(--error); background: var(--error-bg); border-radius: var(--radius-sm); padding: var(--s4) var(--s5); margin-bottom: var(--s5); }
.error-summary h2 { font-size: var(--fs-lg); color: var(--error); margin-bottom: var(--s2); }
.error-summary ul { margin: 0; padding-left: var(--s5); }
.error-summary a { color: var(--error); font-weight: 600; text-decoration-color: var(--error); }

/* Summary list (check answers, proposal facts) */
.summary { margin: 0; }
.summary .row { display: grid; gap: var(--s1); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.summary dt { font-weight: 600; color: var(--navy); }
.summary dd { margin: 0; }
.summary .change { font-size: var(--fs-sm); }
@media (min-width: 768px) { .summary .row { grid-template-columns: 14rem 1fr auto; gap: var(--s4); } }

/* Callouts */
.callout { border-left: 4px solid var(--navy); background: var(--surface); padding: var(--s4) var(--s5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout.info { border-color: var(--info-text); background: var(--info-bg); }
.callout.ok { border-color: var(--ok-text); background: var(--ok-bg); }
.callout p:last-child { margin: 0; }

/* Lists */
.check-list { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.check-list li { position: relative; padding-left: 32px; margin-bottom: var(--s3); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); }
.check-list li::after { content: ""; position: absolute; left: 7px; top: 8px; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }  /* tick drawn in CSS: the security policy blocks data: images */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 var(--s4) 48px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--navy); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-sm); }

/* Table (owner screens, prices) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--navy); background: var(--bg); }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 600; color: var(--navy); }

/* Messages */
.thread { list-style: none; padding: 0; margin: 0; }
.msg { max-width: 85%; margin-bottom: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.msg.mine { margin-left: auto; background: var(--navy); color: #fff; border-color: var(--navy); }
.msg .meta { display: block; font-size: var(--fs-xs); margin-bottom: var(--s1); opacity: 0.85; }

/* Document page (contract text) */
.doc { max-width: 68ch; }
.doc h2 { margin-top: var(--s6); }
.doc ol { padding-left: var(--s5); }
.doc li { margin-bottom: var(--s2); }
.doc-meta { display: flex; flex-wrap: wrap; gap: var(--s3); font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--s5); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .inner { max-width: 1040px; margin: 0 auto; padding: var(--s5) var(--s4); font-size: var(--fs-sm); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; }
.site-footer a { color: var(--text-muted); }

/* Visually hidden */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .actions { display: none; } body { background: #fff; } .card { box-shadow: none; border: 0; } }

/* Phone: stack the next-action panel; tables become one card per row */
.btn { white-space: nowrap; }
@media (max-width: 480px) {
  .next { flex-direction: column; gap: var(--s2); }
  .next .btn { width: 100%; }
}
@media (max-width: 600px) {
  table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: var(--s2) 0; }
  table.responsive td { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--s3); border: 0; padding: var(--s1) 0; text-align: left; }
  table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--navy); }
  table.responsive td.num { text-align: left; }
}


/* Service cards: equal height, aligned; status badge beside the title */
.grid-2 > .card { margin-top: 0; }
.services .service { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); box-shadow: none; }
.services .service p { margin: 0; }
.services .service > .btn, .services .service-actions { margin-top: auto; }
.service-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); width: 100%; }
.service-head h3 { margin: 0; }
.service-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.ref { white-space: nowrap; }

/* Live portal additions */
.wait { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: var(--s3) var(--s5); border-radius: 999px; font-size: var(--fs-sm); box-shadow: var(--shadow); z-index: 50; }
.wait[hidden] { display: none; }
.loading { color: var(--text-muted); }
.problem { border-left: 4px solid var(--error); background: var(--error-bg); padding: var(--s4) var(--s5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.actions.tight { margin-top: var(--s3); }
.card-foot { margin: var(--s4) 0 0; }
.section-title { margin: var(--s6) 0 var(--s3); }
@media (max-width: 600px) {
  table.responsive, table.responsive tbody { display: block; width: 100%; }
  table.responsive td { grid-template-columns: 7.5rem minmax(0, 1fr); }
  table.responsive td > * { min-width: 0; overflow-wrap: anywhere; }
  table.responsive .badge { white-space: normal; }
}
.doc .sub { padding-left: var(--s5); }
.doc .doc-meta { display: block; }
details summary { cursor: pointer; font-weight: 600; color: var(--navy); min-height: 44px; display: flex; align-items: center; }
#notice .callout { margin-bottom: var(--s5); }
/* Input tables (onboarding): staff list, teams, managers, complaint numbers */
.input-table input, .input-table select { width: 100%; min-width: 7rem; min-height: 40px; }
.input-table th[scope="row"] { white-space: nowrap; }
.paste { margin-top: var(--s3); }
.paste textarea { width: 100%; margin-top: var(--s2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.parts { list-style: none; padding: 0; margin: 0; }
.parts li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }

/* Admin: deletes and cancellation */
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.danger:hover { background: var(--error); color: #fff; filter: brightness(0.9); }
.callout.warn { border-color: var(--error); background: var(--error-bg); }
.danger-zone { border: 2px solid var(--error); }
.member-actions { display: inline-flex; flex-wrap: wrap; gap: var(--s2); margin-left: var(--s2); }
.member-actions .btn.link { min-height: 32px; font-size: var(--fs-sm, 14px); }
.danger-zone .actions { margin-bottom: var(--s5); }
.danger-zone h3 { margin-top: var(--s5); }
.member-actions select { min-height: 36px; padding: 0 var(--s2); }

/* Admin: search, lists, view as client */
.header-search input { min-height: 36px; width: 12rem; padding: 0 var(--s3); border: 1px solid var(--border, #cbd5e1); border-radius: var(--radius-sm); font: inherit; }
.nav a { white-space: nowrap; }
.nav a.sign-out { color: var(--text-muted); }
/* Client header on phones: the menu (Home, Messages, Account, Sign out) takes its own row under the logo */
@media (max-width: 480px) {
  body:not(.admin) .site-header .inner { flex-wrap: wrap; height: auto; padding-block: var(--s2); row-gap: 0; }
  body:not(.admin) .nav { margin-left: calc(-1 * var(--s2)); flex-basis: calc(100% + var(--s2)); }
}
/* Admin layout: slim top bar (logo, search, sign out) and a grouped menu on the left. Below 960px the menu folds
   behind a Menu button and opens as a panel under the top bar. */
body.admin .site-header .inner { max-width: none; }
body.admin .header-search { flex: 1; max-width: 32rem; margin-left: var(--s5); }
body.admin .header-search input { width: 100%; }
.header-links { margin-left: auto; display: flex; }
.header-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); font-weight: 500; font-size: var(--fs-sm); color: var(--navy); text-decoration: none; white-space: nowrap; border-radius: var(--radius-sm); }
.header-link:hover { background: var(--bg); }
.menu-button { display: none; }
.admin-shell { flex: 1; display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); }
.side-nav { background: var(--surface); border-right: 1px solid var(--border); padding: var(--s5) var(--s3); }
.side-inner { position: sticky; top: calc(var(--header-h) + var(--s5)); }
.side-group + .side-group { margin-top: var(--s5); }
.side-heading { margin: 0 0 var(--s1); padding: 0 var(--s3); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); color: var(--navy); white-space: nowrap; }
.side-nav a:hover { background: var(--bg); }
.side-nav a[aria-current] { background: var(--bg); box-shadow: inset 3px 0 0 var(--orange); }
body.admin main { max-width: 1180px; margin: 0; padding-left: var(--s6); padding-right: var(--s6); }
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--navy); font: inherit; font-weight: 500; font-size: var(--fs-sm); cursor: pointer; }
  .menu-button[aria-expanded="true"] { background: var(--bg); }
  .side-nav { display: none; position: fixed; top: var(--header-h); left: 0; bottom: 0; width: min(17rem, 85vw); z-index: 20; overflow-y: auto; box-shadow: var(--shadow); }
  .side-nav.open { display: block; }
  .side-inner { position: static; }
  body.admin main { padding-left: var(--s4); padding-right: var(--s4); }
  body.admin .header-search { margin-left: 0; }
}
@media (max-width: 560px) {
  body.admin .site-header .inner { flex-wrap: wrap; height: auto; padding-block: var(--s2); row-gap: var(--s2); }
  body.admin .header-search { order: 3; flex-basis: 100%; max-width: none; }
}
.filters { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end; }
.filters .field { margin: 0; }
.filters .grow { flex: 1 1 16rem; }
.filters .actions { margin: 0; }
.pager { display: flex; gap: var(--s4); align-items: center; justify-content: center; margin-top: var(--s4); }
th a { color: inherit; text-decoration: none; }
th a:hover { text-decoration: underline; }
.viewas-banner { position: sticky; top: 0; z-index: 50; background: #fef3c7; color: #78350f; border-bottom: 2px solid #b45309; padding: var(--s2) var(--s4); text-align: center; font-weight: 600; }
.viewas-banner a { color: #78350f; margin-left: var(--s2); }

/* Client account: colleagues */
.members { list-style: none; padding: 0; margin: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.member-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.member-controls { display: flex; align-items: center; gap: var(--s4); flex: none; }
.member-controls .choice { margin: 0; min-height: 0; align-items: center; }
.member-controls .choice input { margin: 0; }
.member-controls .choice label { white-space: nowrap; font-size: var(--fs-sm); }
h3.sub { margin-top: var(--s5); }
.sub-section { margin-top: var(--s6, 32px); padding-top: var(--s5); border-top: 1px solid var(--border); }
@media (max-width: 560px) { .members li { flex-direction: column; align-items: flex-start; } }
.inline-input { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
#found { margin-bottom: var(--s4); }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s4); }
.figures > div { display: flex; flex-direction: column; gap: 2px; }
.figure { font-size: 1.5rem; font-weight: 700; color: var(--navy); }
.nowrap { white-space: nowrap; }
.announcement { background: var(--info-bg); color: var(--info-text); border-left: 4px solid var(--info-text); padding: var(--s3) var(--s4); margin-bottom: var(--s5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-weight: 500; }
/* Activity details: one fact per line, label first */
.fact { display: block; }
.fact + .fact { margin-top: 2px; }
/* Team: actions stacked (role, then links), never cut off */
.team-actions { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); }
.team-actions select { min-height: 36px; min-width: 8.5rem; padding: 0 var(--s2); }
.team-actions .btn.link { padding: 0; min-height: 28px; }
/* Activity: the 'What' column is wide enough for an email address; very long ones still wrap rather than overflow */
@media (min-width: 601px) { td[data-label="What"] { min-width: 15rem; } }
.who { overflow-wrap: break-word; }
/* Release 3: generated documents in the admin area */
.doc-list { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.doc-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.comment-list { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.comment-list > li { padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.comment-list p { margin: 0 0 var(--s2); }
.note-text { margin: 0 0 var(--s2); padding: var(--s3); background: var(--bg); border-left: 4px solid var(--orange); overflow-wrap: anywhere; }
.doc-view { max-width: none; overflow-x: auto; }
.doc-view table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); margin-bottom: var(--s5); }
.doc-view th, .doc-view td { border: 1px solid var(--border); padding: var(--s1) var(--s2); text-align: left; vertical-align: top; }
.doc-view th { background: var(--bg); }
.doc-view .note { border-left: 4px solid var(--orange); background: var(--bg); padding: var(--s3) var(--s4); }
.doc-view table.form td { height: 2.2em; }
.doc-view table.form th { width: 40%; }
.doc-view h3.new-page { margin-top: var(--s7); }

/* Manager briefing video (ERA-3.8): a branded stage, controls and captions */
.player { margin: 0 0 var(--s5); }
.stage { background: var(--navy); color: #fff; border-radius: 8px 8px 0 0; border-bottom: 4px solid var(--orange); padding: var(--s5) var(--s5) var(--s4);
  min-height: 340px; display: flex; flex-direction: column; justify-content: center; }
.stage .scene-eyebrow { margin: 0 0 var(--s2); color: #fdba74; font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.stage .scene-title { margin: 0 0 var(--s4); color: #fff; font-family: var(--font-head); font-size: 1.75rem; line-height: 1.25; }
.stage .scene-points { margin: 0; padding-left: 1.2em; }
.stage .scene-points li { margin: 0 0 var(--s2); line-height: 1.45; }
.stage .scene-points li::marker { color: var(--orange); }
.stage .scene-table { width: 100%; border-collapse: collapse; margin-top: var(--s2); }
.stage .scene-table th, .stage .scene-table td { border-bottom: 1px solid #334155; padding: var(--s2) var(--s3) var(--s2) 0; text-align: left; vertical-align: top; color: #fff; background: none; }
.stage .scene-table th { width: 32%; color: #fdba74; font-weight: 600; white-space: nowrap; }
.stage .scene-answer { margin-top: var(--s4); padding: var(--s3) var(--s4); background: #1e293b; border-left: 4px solid var(--orange); border-radius: 4px; }
.stage .scene-answer-head { margin: 0 0 var(--s2); font-weight: 700; }
.stage .scene-answer ul { margin: 0; padding-left: 1.2em; }
.player-progress { height: 6px; background: var(--border); }
.player-progress span { display: block; height: 100%; width: 0; background: var(--orange); transition: width 0.3s; }
.player-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) 0; }
.captions-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s2); }
.captions { margin: 0; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; line-height: 1.55; }
@media (max-width: 560px) {
  .stage { padding: var(--s4); min-height: 300px; }
  .stage .scene-title { font-size: 1.35rem; }
  .stage .scene-table th { white-space: normal; }
  .captions-toggle { margin-left: 0; }
}

/* Standa website header + 'Standa for Business' portal bar (client pages and start page; v0.25, 26 Oct 2026).
   Same links, type and colours as standa.co.uk; the navy bar is the business identity used on the website's business pages. */
.brand-header { background: #fff; border-bottom: 1px solid #e5e7eb; }
.brand-header .inner { max-width: 1200px; margin: 0 auto; min-height: 72px; padding: 0 var(--s5); display: flex; align-items: center; gap: var(--s5); position: relative; }
.brand-header .logo svg { height: 28px; }
.site-links { margin-left: auto; display: flex; gap: var(--s1); }
.site-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); font: 600 12px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--navy); text-decoration: none; }
.site-links a:hover { color: var(--orange-text); }
.site-links a.here { box-shadow: inset 0 -2px 0 var(--orange); }
.site-menu-button { display: none; margin-left: auto; min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--navy); font: 600 var(--fs-sm)/1 var(--font-body); cursor: pointer; }
.portal-bar { position: sticky; top: 0; z-index: 10; background: #0f172a; color: #fff; border-bottom: 1px solid #1e293b; }
.portal-bar .inner { max-width: 1200px; margin: 0 auto; min-height: 56px; padding: 0 var(--s5); display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.portal-title { font: 600 var(--fs-base)/1.2 var(--font-head); color: #fff; text-decoration: none; }
.portal-title span { font: 400 var(--fs-sm)/1 var(--font-body); color: #cdd6e4; margin-left: var(--s2); padding-left: var(--s2); border-left: 1px solid #394359; }
.portal-title:hover { color: #fff; }
.portal-bar .nav a { color: #e3e9f3; }
.portal-bar .nav a:hover { background: #1e293b; color: #fff; }
.portal-bar .nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--orange); }
html:has(.portal-bar) { scroll-padding-top: 72px; }
@media (max-width: 900px) {
  .site-menu-button { display: inline-flex; align-items: center; }
  .site-links { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 20; flex-direction: column; gap: 0; padding: var(--s2) var(--s4) var(--s4); background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: var(--shadow); }
  .site-links.open { display: flex; }
  .site-links a { min-height: 48px; font-size: 13px; }
}
@media (max-width: 560px) {
  .brand-header .inner, .portal-bar .inner { padding: 0 var(--s4); }
  .portal-bar .inner { padding-top: var(--s2); padding-bottom: var(--s1); gap: 0 var(--s4); }
  .portal-title span { display: none; }
  .portal-bar .nav { margin-left: 0; width: 100%; justify-content: space-between; }
  .portal-bar .nav a { padding: 0 var(--s2); }
}

/* Client pages: the website's action colour (orange, navy text 6.4:1) and its navy footer */
body:not(.admin) .btn:not(.secondary):not(.link) { background: var(--orange); border-color: var(--orange); color: var(--navy); }
body:not(.admin) .btn:not(.secondary):not(.link):hover { background: #d85a12; border-color: #d85a12; color: var(--navy); }
body:not(.admin) .site-footer { background: #0a1120; border-top: 0; }
body:not(.admin) .site-footer .inner { max-width: 1200px; color: #cdd6e4; padding: var(--s6) var(--s5); }
body:not(.admin) .site-footer a { color: #fff; }

/* Start page */
body.start main { max-width: none; padding: 0; }
.start-hero { background: #0a1120; color: #fff; padding: var(--s8) var(--s5); }
.start-hero .inner, .start-steps .inner { max-width: 1200px; margin: 0 auto; }
.start-hero .eyebrow { display: flex; align-items: center; gap: 12px; font: 600 12px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: #e3e9f3; margin-bottom: var(--s5); }
.start-hero .eyebrow::before { content: ""; width: 30px; height: 2px; background: var(--orange); }
.start-hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.5rem); line-height: 1.1; margin-bottom: var(--s4); }
.start-hero .lead { color: #cdd6e4; max-width: 40em; }
.start-card { background: #0f172a; border: 1px solid #394359; border-radius: 12px; padding: var(--s6); max-width: 560px; margin-top: var(--s6); }
.start-card h2 { color: #fff; }
.start-card p { color: #dbe2ee; }
.start-card .small { color: #b9c3d4; }
.start-card .btn { margin-top: var(--s2); }
.start-hero .callout { max-width: 560px; margin-top: var(--s5); }
.start-steps { background: #fff; padding: var(--s8) var(--s5); }
.start-steps ol { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); counter-reset: st; }
.start-steps li { counter-increment: st; }
.start-steps li::before { content: counter(st); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 600; margin-bottom: var(--s4); }
.start-steps li strong { display: block; font: 600 var(--fs-lg)/1.3 var(--font-head); color: var(--navy); margin-bottom: var(--s2); }
.start-steps li span { color: var(--text-muted); }
.start-note { border-left: 4px solid var(--navy); padding: var(--s5) var(--s6); margin-top: var(--s7); max-width: 54em; background: var(--bg); }
@media (max-width: 760px) {
  .start-hero { padding: var(--s7) var(--s4); }
  .start-card { padding: var(--s5); }
  .start-card .btn { width: 100%; }
  .start-steps { padding: var(--s7) var(--s4); }
  .start-steps ol { grid-template-columns: 1fr; }
  .start-note { padding: var(--s4) var(--s5); }
}

/* Searchable user manuals: scoped to help pages. */
main.manual { max-width: 960px; width: 100%; min-width: 0; }
.manual .manual-search label { display: block; font-weight: 600; margin-bottom: var(--s2); }
.manual-search .inline-input input { flex: 1 1 16rem; min-width: 0; width: 100%; }
.manual-search .inline-input button { flex: 0 1 auto; }
.manual-contents ul { columns: 2; column-gap: var(--s6); padding-left: var(--s5); }
.manual-contents li { break-inside: avoid; margin-bottom: var(--s2); }
.manual-contents a { display: inline-block; padding-block: var(--s2); }
.manual-section { overflow-wrap: anywhere; }
.manual-section li + li { margin-top: var(--s3); }
.manual-section h3 { margin-top: var(--s5); }
.manual-heading { color: var(--navy); text-decoration: none; }
.manual-heading:hover { text-decoration: underline; }
.manual-back { margin: var(--s5) 0 0; font-size: var(--fs-sm); }
.manual-back a { display: inline-block; padding-block: var(--s2); }
.manual mark { background: #fef08a; color: var(--navy); border-radius: 2px; }
.manual-page { --header-h: 120px; }
html:has(.manual-page) { scroll-padding-top: 152px; }
.manual-page .manual-admin-bar .inner { height: auto; min-height: 64px; padding-block: var(--s2); }
.manual-admin-bar .header-search { min-width: 0; }
.manual-admin-bar .header-search input { background: #fff; }
.manual-admin-bar .nav { flex-wrap: wrap; }
.manual-page.admin .site-footer { background: #0a1120; }
.manual-page.admin .site-footer .inner { color: #cdd6e4; }
.manual-page.admin .site-footer a { color: #fff; }
@media (max-width: 760px) { .manual-contents ul { columns: 1; } }
@media (max-width: 560px) {
  .manual-admin-bar .portal-title { flex: 1 1 auto; }
  .manual-admin-bar .header-search { flex-basis: 100%; }
  .manual-page.admin .manual-admin-bar .nav { order: 4; }
  html:has(.manual-page.admin) { scroll-padding-top: 220px; }
}
@media print {
  .manual-page .brand-header, .manual-page .portal-bar, .manual-page .side-nav,
  .manual-page .manual-search, .manual-page .manual-back { display: none; }
  .manual-page .admin-shell { display: block; }
}
