/*
 * Fonts, served from this app (static/fonts, SIL Open Font License) rather
 * than a font CDN, so no page load tells a third party who is using Servanda.
 * Source Serif 4 for headings, IBM Plex Sans for everything else - the
 * founder's sample screen, 22 Sep 2026.
 */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-600-latin.woff2") format("woff2");
}

/*
 * Design tokens: the only place in the app a colour is written down. Every
 * other rule, and every inline style in a template, uses var(--...).
 *
 * Servanda Pact brand contract (founder, Oct 2026). Navy is the functional
 * colour; gold is a minor accent only (logo artwork, hairlines, the active
 * navigation underline, light gold on the navy-deep banner) - never a button,
 * link, focus ring, text on a light surface, or a large fill.
 *
 * --text-muted is the brand's grey (3.21:1 on white, under WCAG AA 4.5:1):
 * decorative only. Muted *text* uses --text-muted-accessible (6.07:1 on
 * white, >= 4.9:1 on every tint it sits on).
 */
:root {
  --brand-navy: #1E2A44;
  --brand-navy-deep: #141E33;
  --brand-navy-soft: #E9ECF2;
  --brand-gold: #C6A34F;
  --brand-gold-light: #D8BC7A;
  --surface: #FFFFFF;
  --surface-subtle: #F7F8FA;
  --surface-muted: #EDEFF3;
  --surface-sunken: #E4E7ED;
  --border: #E3E7EF;
  --border-strong: #BCC2CE;
  --text: #2B3448;
  --text-muted: #8A8FA3;
  --text-muted-accessible: #5C6275;
  --text-on-dark: #FFFFFF;
  --text-on-dark-muted: #C9CFDC;
  --on-dark-border: rgba(255, 255, 255, .7);
  --on-dark-fill: rgba(255, 255, 255, .08);
  --on-dark-track: rgba(255, 255, 255, .25);

  /* Functional roles. */
  --color-page: var(--surface-subtle);
  --color-surface: var(--surface);
  --color-surface-raised: var(--surface);
  --color-ink: var(--text);
  --color-muted: var(--text-muted-accessible);
  --color-subtle: var(--surface-muted);
  --color-border: var(--border);
  --color-border-strong: var(--border-strong);
  --color-primary: var(--brand-navy);
  --color-primary-hover: var(--brand-navy-deep);
  --color-primary-soft: var(--brand-navy-soft);
  --color-on-primary: var(--text-on-dark);
  --color-accent: var(--brand-navy);
  --color-accent-soft: var(--brand-navy-soft);
  --color-focus: var(--brand-navy);
  --color-focus-on-dark: var(--text-on-dark);
  --color-on-dark-muted: var(--text-on-dark-muted);

  /* Semantic status colours: text, tint, border, and the darker text used on
     small badges. */
  --color-success: #17613A;
  --color-success-soft: #E2F3E7;
  --color-success-border: #B9DFC8;
  --color-success-strong: #0F542C;
  --color-warning: #8A5A00;
  --color-warning-soft: #FFF4D8;
  --color-warning-border: #EDD48A;
  --color-warning-strong: #684200;
  --color-danger: #B42318;
  --color-danger-soft: #FDE7E5;
  --color-danger-border: #F2B8B5;
  --color-danger-strong: #8F1B13;
  --color-info: var(--brand-navy);
  --color-info-soft: var(--brand-navy-soft);
  --color-info-border: #C5CCDA;
  --color-info-strong: var(--brand-navy-deep);
  /* AI-drafted content keeps its own lavender, so it is never mistaken for
     a status. */
  --color-ai-soft: #F2EEFB;
  --color-ai-border: #CDC2E8;

  /* Inline SVG backgrounds carry their colour in the data URI, so they are
     tokens too (stroke = --text-muted-accessible / --text-on-dark). */
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235C6275' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%235C6275' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E");
  --pattern-waves-on-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='160' viewBox='0 0 800 160' fill='none' stroke='%23FFFFFF' stroke-opacity='.09' stroke-width='2'%3E%3Cpath d='M0 120C160 60 300 170 480 100S720 40 800 70'/%3E%3Cpath d='M0 140C180 80 320 180 500 118S730 62 800 92'/%3E%3Cpath d='M0 158C200 100 340 190 520 136S740 84 800 114'/%3E%3C/svg%3E");

  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --shadow-sm: 0 1px 3px rgba(20, 30, 51, .07);
  --shadow-md: 0 10px 30px rgba(20, 30, 51, .1);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --content-max: 1180px;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-page);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-page);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--color-ink);
  background: var(--color-page);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary-hover);
}

img,
svg {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  border-radius: 0 0 var(--radius-sm) 0;
  color: var(--color-on-primary);
  background: var(--color-primary);
}

.skip-link:focus {
  left: 0;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
}

.auth-shell {
  display: block;
}

.auth-shell .topbar {
  display: none;
}

.auth-shell .content-area {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--space-6) 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: var(--space-5);
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--color-ink);
  text-decoration: none;
}

/*
 * Servanda Pact lockup (founder's artwork, Oct 2026): the horizontal 440x128
 * pact mark + Servanda + "Agreements, kept." (img/servanda-pact-logo.svg).
 * Only the width is set, so the image keeps its aspect ratio; the full
 * sidebar width keeps the wordmark legible. The pact mark alone
 * (img/servanda-pact-mark.svg) is the favicon and the compact top-bar mark.
 */
.brand-logo {
  display: block;
  width: 13rem;
  max-width: 100%;
  height: auto;
}

/* Block-level, so the top bar is sized by the mark, not a text line box. */
.brand.compact {
  display: flex;
}

.brand-mark {
  display: block;
  width: 2.5rem;
  height: auto;
}

.brand-auth {
  display: flex;
  width: fit-content;
  margin: 0 auto var(--space-2);
}

.brand-auth .brand-logo {
  width: 16rem;
}

.primary-nav {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-8);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.nav-link.active {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brand-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* NAV-GROUPS: Work and Organisation groups, and Settings' own pages under it. */
.nav-group,
.nav-sublist {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav .nav-heading {
  margin-top: var(--space-5);
}

.nav-link.open {
  color: var(--color-primary);
}

.nav-sublist {
  margin: var(--space-1) 0 var(--space-2) var(--space-4);
  padding-left: var(--space-2);
  border-left: 2px solid var(--color-border);
}

.nav-sublink {
  display: block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-muted);
  font-size: .9rem;
  text-decoration: none;
}

.nav-sublink:hover,
.nav-sublink.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.nav-sublink.active {
  font-weight: 600;
}

.settings-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-list a {
  font-weight: 600;
}

.settings-list .field-help {
  margin: var(--space-1) 0 0;
}

.mobile-nav-panel .nav-heading {
  margin: var(--space-3) 0 0;
}

.nav-heading {
  margin: 0 0 var(--space-1) var(--space-3);
  color: var(--color-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--color-page);
}

.mobile-brand,
.mobile-nav {
  display: none;
}

/* P4-UX-R01: the open menu said "Menu" with no way to tell it was open. */
.mobile-nav .menu-label-open,
.mobile-nav[open] .menu-label-closed {
  display: none;
}

.mobile-nav[open] .menu-label-open {
  display: inline;
}

.account-menu {
  position: relative;
}

.account-menu > summary,
.mobile-nav > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  list-style: none;
  box-shadow: var(--shadow-sm);
}

.account-menu > summary::-webkit-details-marker,
.mobile-nav > summary::-webkit-details-marker {
  display: none;
}

.account-avatar {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-weight: 800;
}

.account-label span {
  display: block;
  line-height: 1.15;
}

.account-role {
  color: var(--color-muted);
  font-size: .78rem;
}

.account-panel,
.mobile-nav-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  display: grid;
  min-width: 220px;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-md);
}

.account-panel a,
.mobile-nav-panel a,
.link-button {
  color: var(--color-primary);
  font: inherit;
  text-align: left;
}

.account-org {
  margin: 0;
  color: var(--color-muted);
  font-size: .9rem;
}

.logout-form {
  margin: 0;
}

.link-button {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: var(--color-primary-hover);
  background: transparent;
}

.messages {
  width: min(100% - 2rem, var(--content-max));
  margin: var(--space-4) auto 0;
}

.content-area {
  width: min(100% - 2rem, var(--content-max));
  margin: 0 auto;
  padding: var(--space-8) 0 3rem;
}

.content-narrow {
  max-width: 760px;
}

/* SUPPORT-CHANNEL */
.app-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: .9rem;
}

.support-line {
  margin: var(--space-4) 0;
}

/* USER-GUIDE */
.guide-terms dt {
  margin-top: var(--space-3);
  font-weight: 650;
}

.guide-terms dd {
  margin: var(--space-1) 0 0;
}

.guide-steps li {
  margin-bottom: var(--space-3);
}

/* ERROR-PAGES: 400/403/404 inside the normal layout. */
.error-page {
  padding-top: var(--space-6);
}

.error-page h1 {
  margin-top: var(--space-1);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.page-kicker {
  margin: 0 0 var(--space-1);
  color: var(--color-accent);
  font-size: .82rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

.page-subtitle {
  max-width: 760px;
  margin: var(--space-2) 0 0;
  color: var(--color-muted);
}

.section {
  margin-top: var(--space-8);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-4);
}

.metric-card,
.empty-state,
.panel,
.form-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  padding: var(--space-4);
}

.metric-label {
  margin: 0;
  color: var(--color-muted);
  font-size: .86rem;
  font-weight: 650;
}

.metric-value {
  margin: var(--space-2) 0 0;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.metric-note {
  margin: var(--space-2) 0 0;
  color: var(--color-muted);
  font-size: .85rem;
}

.panel,
.form-section {
  padding: var(--space-5);
}

.panel + .panel,
.form-section + .form-section {
  margin-top: var(--space-4);
}

.empty-state {
  padding: var(--space-8);
  text-align: center;
}

.empty-state p {
  max-width: 560px;
  margin: var(--space-2) auto var(--space-5);
  color: var(--color-muted);
}

.button,
button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  color: var(--color-on-primary);
  background: var(--color-primary-hover);
}

.button.secondary,
button.secondary {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-surface);
}

.button.secondary:hover,
button.secondary:hover {
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
}

.button.quiet,
button.quiet {
  color: var(--color-primary);
  background: transparent;
}

.button.quiet:hover,
button.quiet:hover {
  color: var(--color-primary-hover);
  background: var(--color-primary-soft);
}

.button.danger-quiet,
button.danger-quiet {
  color: var(--color-danger);
  background: transparent;
}

.button.danger-quiet:hover,
button.danger-quiet:hover {
  color: var(--color-danger-strong);
  background: var(--color-danger-soft);
}

.button.danger,
button.danger {
  color: var(--color-on-primary);
  background: var(--color-danger);
}

.button.danger:hover,
button.danger:hover {
  background: var(--color-danger-strong);
}

button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* A one-button <form style="display:inline"> (e.g. dashboard.html's
   Archive/Restore) sits alongside plain <a class="button"> actions in the
   same .action-group. The form element itself isn't meant to be a visible
   box — display:contents removes it from the layout so its button
   participates directly as a flex item, instead of forcing a line wrap
   the surrounding <a> actions don't need. */
.action-group form {
  display: contents;
}

/* Dashboard's search/status/archived/sort row had no layout rules of its
   own, so it fell back to the default `label { display: block }` +
   `select { width: 100% }` — every field stacked on its own full-width
   row instead of sitting in a compact line. Scoped to .filter-bar rather
   than changed globally, since most forms in the app (start-assessment,
   evidence, risk) are deliberately full-width single-column already. */
/* Doc 19 §17: the status tabs above the assessment list. */
.list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.list-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-bottom: 3px solid transparent;
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 650;
}

.list-tab:hover {
  color: var(--color-ink);
}

.list-tab.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}

.list-tab-count {
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--color-subtle);
  color: var(--color-muted);
  font-size: .82rem;
}

.list-tab.active .list-tab-count {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: 0;
  font-size: .86rem;
  font-weight: 700;
}

.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 9rem;
}

.filter-bar input[type="search"] {
  min-width: 15rem;
}

.filter-bar button {
  flex-shrink: 0;
}

/* Wraps the dashboard search input so its suggestion dropdown can be
   positioned relative to it without affecting the .filter-bar flex layout
   around it — the wrapper takes on the input's place in the flex row and
   otherwise has no visual presence of its own. */
.autocomplete {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 16rem;
  overflow-y: auto;
}

.autocomplete-suggestions[hidden] {
  display: none;
}

/* One option per row, carrying its own role and selected state: a listbox
   option must not wrap another interactive control, and
   aria-activedescendant has to point at a real option (P4-A11Y-01). */
.autocomplete-suggestions li {
  padding: var(--space-2) var(--space-3);
  color: var(--color-ink);
  cursor: pointer;
}

/* Pointer hover and the keyboard's active option share one highlight, so
   both routes look the same. */
.autocomplete-suggestions li:hover,
.autocomplete-suggestions li[aria-selected="true"] {
  background: var(--color-primary-soft);
}

form {
  margin: 0;
}

label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 700;
}

input[type="text"],
input[type="search"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-ink);
  background: var(--color-surface);
  font: inherit;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

/* P2-UI-15: browser-default file pickers and tiny checkboxes sat beside
   fully styled fields. The controls stay native — only their frame and the
   file button are brought into the design. */
input[type="file"] {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font: inherit;
}

input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: var(--color-primary-soft);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--color-primary);
}

input[type="checkbox"].align-start {
  margin-top: .2rem;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--color-muted);
  background: var(--color-subtle);
}

.password-field {
  position: relative;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 4rem;
}

.password-toggle {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  min-height: 0;
  padding: var(--space-1) var(--space-2);
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--color-primary-hover);
  background: transparent;
}

.field,
.field-group {
  margin-top: var(--space-4);
}

.field:first-child,
.field-group:first-child {
  margin-top: 0;
}

.field-help,
.helptext {
  margin: var(--space-1) 0 0;
  color: var(--color-muted);
  font-size: .9rem;
}

/* P2-UI-14: Save sat directly against the preceding field on the risk and
   retention forms, unlike the other redesigned forms. */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-5);
}

.save-secondary-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: .9rem;
}

.regime-guidance {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  color: var(--color-muted);
  font-size: .92rem;
}

.regime-guidance p {
  margin: 0;
}

.regime-guidance strong {
  color: var(--color-ink);
}

.field-error,
.errorlist {
  color: var(--color-danger);
}

.errorlist {
  padding-left: var(--space-5);
}

.required {
  color: var(--color-danger);
}

details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

details summary {
  cursor: pointer;
  font-weight: 750;
}

.disclosure-block {
  padding: var(--space-4);
}

.disclosure-block summary {
  margin: calc(var(--space-4) * -1);
  padding: var(--space-4);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.row-title {
  font-weight: 800;
}

.row-meta {
  display: block;
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: .9rem;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 1.5rem;
  padding: .15rem .55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  background: var(--color-subtle);
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.1;
}

.badge-success,
.tag-success,
.met .tag {
  color: var(--color-success-strong);
  border-color: var(--color-success-border);
  background: var(--color-success-soft);
}

.badge-warning,
.tag-warn,
.tag-warning {
  color: var(--color-warning-strong);
  border-color: var(--color-warning-border);
  background: var(--color-warning-soft);
}

.badge-danger,
.tag-danger {
  color: var(--color-danger-strong);
  border-color: var(--color-danger-border);
  background: var(--color-danger-soft);
}

.badge-info,
.provider-badge {
  color: var(--color-info);
  border-color: var(--color-info-border);
  background: var(--color-info-soft);
}

.badge-muted {
  color: var(--color-muted);
  background: var(--color-subtle);
}

.progress {
  overflow: hidden;
  width: 100%;
  height: .55rem;
  border-radius: 999px;
  background: var(--color-subtle);
}

.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent);
}

.progress-native {
  width: 100%;
  height: .65rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--color-subtle);
}

.progress-native::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--color-subtle);
}

.progress-native::-webkit-progress-value {
  border-radius: 999px;
  background: var(--color-accent);
}

.progress-native::-moz-progress-bar {
  border-radius: 999px;
  background: var(--color-accent);
}

.alert,
.warning {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.alert-success {
  border-color: var(--color-success-border);
  color: var(--color-success);
  background: var(--color-success-soft);
}

.alert-warning,
.warning {
  border-color: var(--color-warning-border);
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

/*
 * A standing note that is always true — not a problem to fix. Kept visually
 * distinct from .warning so that a permanent disclaimer cannot be mistaken for
 * an alert, and so real warnings keep their signal (user-reported 2026-09-17:
 * the AI remediation disclaimer read as an error because it shared .warning's
 * amber treatment).
 */
.advisory {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-muted);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  color: var(--color-muted);
}

.alert-error {
  border-color: var(--color-danger-border);
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.readonly-field,
.attribution,
.check-answers-status {
  color: var(--color-muted);
}

.score {
  font-size: 2.5rem;
  font-weight: 800;
}

.score-small {
  margin-right: var(--space-2);
  font-size: 1.3rem;
  font-weight: 800;
}

.score-untrusted {
  color: var(--color-danger);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}

.requirement {
  margin-bottom: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.requirement.gap {
  border-left-color: var(--color-danger);
}

.requirement.gap.poam {
  border-left-color: var(--color-warning);
}

.requirement.met {
  border-left-color: var(--color-success);
}

.family {
  margin-bottom: var(--space-8);
}

.family h3 {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.step-pill {
  display: inline-flex;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-3);
  border-radius: 999px;
  color: var(--color-ink);
  background: var(--color-subtle);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 750;
}

.step-pill.current {
  color: var(--color-on-primary);
  background: var(--color-primary);
}

.step-pill.complete {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.step-pill.current.complete {
  color: var(--color-on-primary);
  background: var(--color-success);
}

.step-pill.blocking {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.step-pill.current.blocking {
  color: var(--color-on-primary);
  background: var(--color-danger);
}

.step-pill.review-pill {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.step-pill.disabled,
.step-footer .disabled {
  color: var(--color-muted);
  background: var(--color-subtle);
  cursor: not-allowed;
}

.step-heading {
  margin-bottom: var(--space-2);
  color: var(--color-muted);
  font-weight: 750;
}

.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-8) 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.step-footer a {
  color: var(--color-primary);
  font-weight: 750;
  text-decoration: none;
}

.family-summary,
.issue-list {
  padding: 0;
  list-style: none;
}

.family-summary li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.evidence-hint,
.ai-suggestion,
.ai-summary,
.guidance-popover {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
}

.ai-suggestion,
.ai-summary {
  border-color: var(--color-ai-border);
  background: var(--color-ai-soft);
}

.info-btn {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-1);
  padding: 0;
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  color: var(--color-primary);
  background: var(--color-surface);
  font-size: .8rem;
  font-weight: 800;
  vertical-align: middle;
}

.info-btn:hover {
  color: var(--color-on-primary);
  background: var(--color-primary);
}

.issue {
  margin-bottom: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  background: var(--color-warning-soft);
}

.issue-blocking {
  border-left-color: var(--color-danger);
  background: var(--color-danger-soft);
}

.issue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.issue-chip {
  display: inline-flex;
  padding: .15rem .55rem;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  color: var(--color-warning);
  background: var(--color-surface);
  font-size: .85rem;
  font-weight: 750;
  text-decoration: none;
}

.issue-chip:hover {
  color: var(--color-on-primary);
  background: var(--color-warning);
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--space-6);
}

.auth-card {
  width: min(100%, 420px);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.auth-help {
  margin: var(--space-3) 0 0;
  color: var(--color-muted);
}

.muted {
  color: var(--color-muted);
}

.nowrap {
  white-space: nowrap;
}

/*
 * P3-R08: in table mode the invitation URL fragmented into a dozen short
 * lines and made the row enormous. One line, ending in an ellipsis, with
 * Copy carrying the full value; stacked into a card there is room to show
 * all of it.
 */
.invite-link-cell code {
  display: block;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .invite-link-cell code {
    max-width: none;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

code {
  overflow-wrap: anywhere;
  color: var(--color-primary);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .topbar {
    justify-content: space-between;
  }

  .mobile-brand,
  .mobile-nav {
    display: block;
  }

  .mobile-nav {
    position: relative;
  }

  .mobile-nav-panel {
    right: auto;
    left: 0;
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - var(--space-8));
  }

  /* The account menu is anchored to the right edge; same ceiling, so a long
     organisation name cannot widen the document either. */
  .account-panel {
    min-width: 0;
    max-width: calc(100vw - var(--space-8));
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  /* QA-2026-09-05-01/02 — a min-width table inside overflow-x:auto left
     primary actions (dashboard) and several columns (requirements list)
     off-screen at a 390px phone width, discoverable only by an unlabeled
     horizontal scroll a pilot user has no reason to try. Opt-in
     (.responsive-cards, not every .data-table — team.html's simple
     3-column table already fits and wasn't part of this finding) rather
     than a blanket rule, so it doesn't reflow tables nobody asked to
     change. Each <tr> becomes a stacked card; data-label on a <td> shows
     that column's heading inline via ::before, since the real <thead> is
     hidden — everything the desktop table shows stays visible, just
     stacked instead of scrolled.  */
  .responsive-cards {
    overflow-x: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .responsive-cards .data-table {
    min-width: 0;
  }

  .responsive-cards .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .responsive-cards .data-table,
  .responsive-cards .data-table tbody,
  .responsive-cards .data-table tr,
  .responsive-cards .data-table td {
    display: block;
    width: 100%;
  }

  .responsive-cards .data-table tr {
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .responsive-cards .data-table tr:last-child {
    margin-bottom: 0;
  }

  .responsive-cards .data-table td {
    padding: var(--space-1) 0;
    border-bottom: 0;
  }

  .responsive-cards .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  /* QA-2026-09-05-02's acceptance criteria calls for touch-friendly
     requirement links specifically; the identifier/title link opening
     each card (requirement_list.html's FCI-01 link, dashboard.html's
     row-title) measured only 18px tall before this — comfortably under
     WCAG 2.5.8's 24px AA minimum. inline-flex + min-height gives a full
     44px tap target (the 2.5.5 AAA guideline) without changing the text
     itself or its position in the layout. */
  .responsive-cards .data-table td:first-child a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .responsive-cards .data-table td.card-actions {
    margin-top: var(--space-2);
  }

  .responsive-cards .data-table td.card-actions .action-group {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  /*
   * P3-R06: the assessments table has six columns, and at 768px every row
   * wrapped over several lines into a long dense list. It opts into the card
   * layout at the tablet width as well, through .cards-at-tablet.
   *
   * Deliberately only this table: the risk register and the responsibility
   * matrix are covered by tests asserting they stay tables at 768px
   * (QA-2026-09-07-01 and the matrix viewport tests), which is a decision
   * this defect does not overturn. These rules mirror the <=680px block
   * above; keep the two in step.
   */
  .cards-at-tablet {
    overflow-x: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .cards-at-tablet .data-table {
    min-width: 0;
  }

  .cards-at-tablet .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .cards-at-tablet .data-table,
  .cards-at-tablet .data-table tbody,
  .cards-at-tablet .data-table tr,
  .cards-at-tablet .data-table td {
    display: block;
    width: 100%;
  }

  .cards-at-tablet .data-table tr {
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  .cards-at-tablet .data-table tr:last-child {
    margin-bottom: 0;
  }

  .cards-at-tablet .data-table td {
    padding: var(--space-1) 0;
    border-bottom: 0;
  }

  .cards-at-tablet .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  /* QA-2026-09-05-02's acceptance criteria calls for touch-friendly
     requirement links specifically; the identifier/title link opening
     each card (requirement_list.html's FCI-01 link, dashboard.html's
     row-title) measured only 18px tall before this — comfortably under
     WCAG 2.5.8's 24px AA minimum. inline-flex + min-height gives a full
     44px tap target (the 2.5.5 AAA guideline) without changing the text
     itself or its position in the layout. */
  .cards-at-tablet .data-table td:first-child a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .cards-at-tablet .data-table td.card-actions {
    margin-top: var(--space-2);
  }

  .cards-at-tablet .data-table td.card-actions .action-group {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  /*
   * P3-R04: mobile browsers zoom the page when a focused control's text is
   * under 16px, which moved the whole layout mid-task. P3-R05: several
   * controls were 24-34px tall, below a comfortable touch target.
   */
  input[type="text"],
  input[type="search"],
  input[type="url"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  input[type="file"],
  select,
  textarea {
    font-size: 16px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }

  .mobile-nav-panel a,
  .account-panel a,
  .account-panel .link-button {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .info-btn {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    font-size: 1rem;
  }

  .save-secondary-actions {
    font-size: 1rem;
  }

  .save-secondary-actions .link-button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .password-toggle {
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
  }

  .question-map > summary,
  .objectives-section > summary,
  .evidence-section > summary,
  .question-group > summary,
  details.deadline-panel > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  .content-area {
    width: min(100% - 1rem, var(--content-max));
    padding-top: var(--space-6);
  }

  .page-header,
  .section-header {
    display: block;
  }

  .page-header .action-group,
  .section-header .action-group {
    margin-top: var(--space-4);
  }

  h1 {
    font-size: 1.55rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .form-section,
  .empty-state {
    padding: var(--space-4);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar input,
  .filter-bar select,
  .filter-bar input[type="search"] {
    width: 100%;
    min-width: 0;
  }

  .filter-bar button {
    width: 100%;
  }

  .account-label {
    display: none;
  }

  .data-table {
    min-width: 640px;
  }

  .step-footer {
    align-items: stretch;
    flex-direction: column;
  }

}


/* Blocking reasons rendered at the question itself (user-reported
   2026-09-17). The review page already listed them, but a refusal to complete
   was only legible after leaving the question that caused it. */
.question-issues {
  margin: var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-warning);
  border-radius: 4px;
  background: var(--color-warning-soft);
  font-size: .9rem;
}

.question-issues.blocking {
  border-left-color: var(--color-danger);
  background: var(--color-danger-soft);
}

.question-issues ul {
  margin: .25rem 0 0;
  padding-left: 1.1rem;
}


/*
 * The AI status panel (P2-UI-02 / P4-UX-01). One panel, four facts: the
 * provider, this assessment's authorisation, whether content would leave the
 * organisation, and what is outstanding. Colour follows the state, but every
 * fact is also stated in words.
 */
.ai-status {
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-muted);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.ai-status-heading {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
}

.ai-status-unavailable {
  border-left-color: var(--color-muted);
  background: var(--surface-subtle);
}

.ai-status-unauthorised {
  border-left-color: var(--color-warning);
  background: var(--color-warning-soft);
}

.ai-status-authorised {
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.ai-status-facts {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.ai-status-facts > div {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: var(--space-3);
}

.ai-status-facts dt {
  color: var(--color-muted);
  font-weight: 650;
}

.ai-status-facts dd {
  margin: 0;
}

.ai-status-action {
  margin-top: var(--space-4);
}

@media (max-width: 680px) {
  .ai-status-facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/*
 * Remediation deadlines: the badge on a question and the dashboard list.
 *
 * Colour is never the only signal — every badge also says in words how long
 * is left ("Overdue by 3 days", "Due in 7 days"), so the state survives being
 * printed in black and white or read by someone who cannot separate red from
 * amber.
 */
.remediation-badge {
  display: inline-block;
  margin: var(--space-2) 0 0;
  padding: .1rem var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-subtle);
  color: var(--color-muted);
  font-size: .8rem;
  font-weight: 650;
}

.remediation-badge.due_soon {
  border-color: var(--color-info-border);
  background: var(--color-info-soft);
  color: var(--color-info);
}

.remediation-badge.due_today,
.remediation-badge.overdue {
  border-color: var(--color-danger-border);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

/* SESSION-TIMEOUT: the idle warning stays in view while the page scrolls. */
.session-warning {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
}

.session-warning[hidden] {
  display: none;
}

.session-warning p,
.session-warning form {
  margin: 0;
}

.target-date-hint {
  margin: var(--space-1) 0 0;
  font-size: .85rem;
}

/*
 * Dashboard pagination (Phase 10 P8-A04). Touch-sized targets: the links
 * reuse .button, and the row wraps on a narrow screen rather than
 * overflowing.
 */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
}

.pagination-top {
  display: none;
  margin: 0 0 var(--space-3);
}

@media (max-width: 900px) {
  .pagination-top {
    display: flex;
  }
}

.pagination-status {
  margin: 0;
  color: var(--color-muted);
}

.pagination-links {
  display: flex;
  gap: var(--space-2);
}

.pagination-links .button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/*
 * Shared Responsibility Matrix (Phase 10 P8-A06). Requirement text can hold
 * long unbroken tokens (URLs, identifiers); let them wrap anywhere rather
 * than set a minimum width for the whole page. Spacing between the
 * per-family tables, formerly an inline margin.
 */
.responsibility-matrix-table td {
  overflow-wrap: anywhere;
}

/* P4-UX-03: requirement text may break anywhere, but a status word rendered
   as "Implemente" / "d" reads as corrupted. */
.responsibility-matrix-table td.matrix-status,
.responsibility-matrix-table td.matrix-responsibility {
  min-width: 7.5rem;
  overflow-wrap: normal;
  word-break: keep-all;
}

.responsive-cards + h3 {
  margin-top: var(--space-6);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/*
 * Home page (Doc 19 §17; layout from the founder's sample screen,
 * 22 Sep 2026).
 */
.home-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.home-date {
  margin: 0 0 var(--space-1);
  color: var(--color-muted);
  font-size: .9rem;
}

.home-header h1 {
  font-size: 2.1rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.home-search input {
  width: 15rem;
  min-height: 44px;
  padding: 0 var(--space-4) 0 2.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface) var(--icon-search) no-repeat .85rem center;
  font: inherit;
}

.home-actions .button {
  min-height: 44px;
}

/* The navy banner with faint waves, as drawn on the sample screen: the one
   existing dark surface, so navy-deep. */
/* AI-ONBOARDING: Home's first-run checklist. */
.first-run-checklist {
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

.first-run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.first-run-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.first-run-steps {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.first-run-step.is-done {
  color: var(--color-muted);
}

.sample-review {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

.upload-file-list ul {
  margin: var(--space-2) 0 0;
  padding-left: 1.25rem;
}

.upload-file-list li {
  overflow-wrap: anywhere;
}

.upload-file-list p {
  margin: var(--space-1) 0 0;
}

.upload-file-error {
  margin: var(--space-2) 0 0;
  color: var(--color-danger);
}

.sample-review-note {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-border);
  color: var(--color-muted);
}

.step-ai-help {
  margin: 0 0 var(--space-2);
  font-size: .85rem;
}

.resume-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-8);
  margin-bottom: var(--space-6);
  padding: var(--space-6) var(--space-8);
  border-radius: 14px;
  color: var(--color-on-primary);
  background:
    var(--pattern-waves-on-dark) right bottom / 70% auto no-repeat,
    linear-gradient(115deg, var(--brand-navy-deep) 0%, var(--brand-navy-deep) 60%, var(--brand-navy) 100%);
}

/* The page's navy focus ring would vanish on the banner. */
.resume-banner :focus-visible {
  outline-color: var(--color-focus-on-dark);
}

.resume-text {
  flex: 1 1 18rem;
}

.resume-kicker {
  margin: 0 0 var(--space-1);
  color: var(--color-on-dark-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.resume-banner h2 {
  font-size: 1.45rem;
}

.resume-meta {
  margin: var(--space-1) 0 0;
  color: var(--color-on-dark-muted);
  font-size: .9rem;
}

.resume-progress {
  flex: 0 1 14rem;
}

.resume-progress p {
  margin: var(--space-2) 0 0;
  color: var(--color-on-dark-muted);
  font-size: .85rem;
}

.button.resume-button {
  min-height: 44px;
  padding: 0 var(--space-6);
  border: 1px solid var(--on-dark-border);
  color: var(--color-on-primary);
  background: var(--on-dark-fill);
}

.button.resume-button:hover {
  color: var(--color-primary);
  background: var(--color-surface);
}

/* Progress bars: a filled track, navy while in progress, green when done. */
.bar {
  overflow: hidden;
  width: 100%;
  height: .45rem;
  border-radius: 999px;
  background: var(--color-subtle);
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
}

.bar-on-dark {
  background: var(--on-dark-track);
}

.bar-on-dark > span {
  background: var(--brand-gold-light);
}

.bar-complete > span {
  background: var(--color-success);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.progress-cell .bar {
  width: 6.5rem;
  flex-shrink: 0;
}

.progress-count {
  color: var(--color-muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.home-card {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.home-card-label,
.home-card-note {
  margin: 0;
  color: var(--color-muted);
  font-size: .9rem;
}

.home-card-value {
  margin: var(--space-2) 0 0;
  font-size: 2rem;
  line-height: 1.1;
}

.home-card-note {
  margin-top: var(--space-1);
  font-size: .8rem;
}

.home-card-alert {
  border-color: var(--color-danger-border);
  background: var(--color-danger-soft);
}

.home-card-alert .home-card-label,
.home-card-alert .home-card-value {
  color: var(--color-danger-strong);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.home-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.home-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.home-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.home-panel-header-stacked {
  display: block;
}

.home-panel-header-stacked p {
  margin: var(--space-1) 0 0;
  font-size: .9rem;
}

.home-panel-header a,
.home-panel-link {
  font-weight: 600;
  text-decoration: none;
}

/* The table sits flush inside its panel, header band full width. */
.home-table-wrap {
  width: calc(100% + var(--space-6) * 2);
  margin: 0 calc(var(--space-6) * -1);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.home-table {
  min-width: 0;
}

.home-table th:first-child,
.home-table td:first-child {
  padding-left: var(--space-6);
}

.home-table th:last-child,
.home-table td:last-child {
  padding-right: var(--space-6);
}

.home-table td {
  vertical-align: middle;
}

.home-table .row-title {
  color: var(--color-ink);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.home-table .row-title:hover {
  text-decoration: underline;
}

.home-table .row-meta {
  margin-top: 2px;
  font-size: .85rem;
}

.home-more,
.home-empty-note {
  margin: 0;
  font-size: .9rem;
}

.home-empty p {
  margin: 0 0 var(--space-4);
  color: var(--color-muted);
}

.status-pill {
  display: inline-block;
  padding: .15rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-in_progress {
  color: var(--color-info);
  background: var(--color-info-soft);
}

.status-draft {
  color: var(--color-ink);
  background: var(--color-subtle);
}

.status-completed {
  color: var(--color-success);
  background: var(--color-success-soft);
}

/* COMP-04 */
.status-awaiting_approval {
  color: var(--color-info);
  background: var(--color-info-soft);
}

.status-returned {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.follow-up-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.follow-up-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.follow-up-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.follow-up-title {
  overflow-wrap: anywhere;
  color: var(--color-ink);
  font-weight: 600;
  text-decoration: none;
}

.follow-up-title:hover {
  text-decoration: underline;
}

.follow-up-line .remediation-badge {
  flex-shrink: 0;
  margin: 0;
}

.follow-up-item .row-meta {
  font-size: .85rem;
}

/* Remediation page: due-window tabs and one expandable line per question. */
.window-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.window-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-ink);
  background: var(--color-surface);
  text-decoration: none;
  font-weight: 500;
}

.window-tab.active {
  border-color: var(--color-primary);
  color: var(--color-on-primary);
  background: var(--color-primary);
}

.question-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.question-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.question-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: 44px;
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  list-style: none;
}

.question-group > summary::-webkit-details-marker {
  display: none;
}

.question-group > summary::before {
  content: "\25B8";
  color: var(--color-muted);
  transition: transform .15s ease;
}

.question-group[open] > summary::before {
  transform: rotate(90deg);
}

.question-group-text {
  margin: 0 var(--space-5) var(--space-3);
  color: var(--color-ink);
}

.question-group-title {
  flex: 1 1 16rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.question-group-meta {
  display: inline-flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  color: var(--color-muted);
  font-size: .9rem;
}

.question-group-meta .remediation-badge,
.question-group td .remediation-badge {
  margin: 0 0 0 var(--space-2);
}

.question-group .table-wrap {
  margin: 0 var(--space-4) var(--space-4);
}

@media (max-width: 980px) {
  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .home-cards {
    gap: var(--space-3);
  }

  .home-card {
    padding: var(--space-3) var(--space-4);
  }

  .home-card-value {
    font-size: 1.6rem;
  }

  .home-search,
  .home-search input,
  .home-actions .button {
    width: 100%;
  }

  .home-actions {
    width: 100%;
  }

  .resume-banner,
  .home-panel {
    padding: var(--space-5);
  }

  .home-table-wrap {
    width: 100%;
    margin: 0;
  }

  .home-table th:first-child,
  .home-table td:first-child,
  .home-table th:last-child,
  .home-table td:last-child {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/*
 * Question page (founder's sample screen, 22 Sep 2026): the question as the
 * heading, progress in cards, the requirement as one card with grey
 * disclosure bars.
 */
.step-header {
  margin-bottom: var(--space-4);
}

.step-context {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  margin: 0 0 var(--space-2);
  color: var(--color-muted);
  font-size: .9rem;
}

.step-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

h1.step-heading {
  margin: 0;
  color: var(--color-ink);
  font-size: 2rem;
  font-weight: 600;
}

.step-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.step-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.step-stat-score {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step-stat-label {
  color: var(--color-muted);
  font-size: .85rem;
  font-weight: 600;
}

.step-score {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1;
}

.step-score.negative {
  color: var(--color-danger-strong);
}

.step-score-max {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.step-stat-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.step-notice {
  padding: var(--space-2) var(--space-4);
  font-size: .9rem;
}

.question-map {
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-sm);
}

.question-map > summary {
  padding: var(--space-1) 0;
}

.question-map .remediation-badge {
  margin: 0 0 0 var(--space-2);
  font-weight: 600;
}

.question-map .step-nav {
  margin: var(--space-3) 0 var(--space-2);
}

/* The requirement card. */
.requirement {
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.requirement.gap,
.requirement.gap.poam,
.requirement.met {
  border-left-color: var(--color-border);
}

/* The question whose answer was refused. Formerly an inline style, so it
   must outrank every state rule above, including .requirement.gap.poam. */
.requirement.met.requirement-error,
.requirement.gap.requirement-error,
.requirement.gap.poam.requirement-error {
  border-color: var(--color-danger);
  border-width: 2px;
}

.question-text {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
}

/* A round "?" everywhere: the generic button rule's 2.5rem minimum height
   stretched it into an oval. */
.info-btn {
  min-width: 1.5rem;
  min-height: 1.5rem;
}

.objectives-section,
.evidence-section {
  margin-bottom: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.objectives-section > summary,
.evidence-section > summary {
  padding: var(--space-2) var(--space-3);
  color: var(--color-ink);
  font-weight: 600;
}

.objectives-section[open],
.evidence-section[open] {
  background: var(--surface-subtle);
}

.objectives-section[open] > summary,
.evidence-section[open] > summary {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface-sunken);
}

.objectives-section > ul,
.evidence-section > ul,
.evidence-section > p,
.evidence-section > .guidance-popover,
.evidence-section > .evidence-form {
  margin: var(--space-3);
}

/*
 * Evidence now follows the answer fields, so it needs the same breathing
 * room above it that the save buttons have below it; without this the grey
 * bar sits flush against the control above and reads as part of it.
 */
.requirement > .evidence-section {
  margin-top: var(--space-4);
}

.evidence-guidance-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: .9rem;
}

.requirement .response-form {
  margin-top: var(--space-4);
}

.requirement .response-form label {
  margin-top: var(--space-3);
  font-weight: 600;
}

.requirement .response-form > label:first-of-type {
  margin-top: 0;
}

/* A quieter chevron on every drop-down. */
.requirement select {
  appearance: none;
  padding-right: 2.5rem;
  background: var(--color-surface) var(--icon-chevron) no-repeat right .9rem center;
}

/*
 * The date box with a calendar button at its left, as on the sample screen.
 *
 * The input spans the whole box and the button sits inside its left padding,
 * so the browser's own (invisible) calendar control can be laid exactly over
 * that button without being clipped by the input's edge: clicking the icon
 * then opens the native calendar with no script at all (founder report,
 * 22 Sep 2026 - the icon was drawn but did nothing). The button underneath
 * carries the label and the keyboard route, and browsers with no such
 * control (Firefox) fall back to it through app.js.
 */
.date-field {
  position: relative;
  display: block;
}

.date-field:focus-within {
  border-radius: var(--radius-md);
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.date-field input[type="date"] {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-left: 3.25rem;
  background: transparent;
}

.date-field input[type="date"]:focus-visible {
  outline: none;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 2.75rem;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-picker-button,
.date-picker-button:hover {
  position: absolute;
  z-index: 0;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 2.75rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--color-ink);
  background: var(--color-subtle);
}

.date-picker-button:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

/*
 * The save buttons sit outside the answer form now — Evidence goes between
 * the two, and a form cannot be nested inside another — so they are matched
 * by their own wrapper rather than as descendants of .response-form.
 */
.requirement .save-actions button[value="continue"] {
  min-height: 44px;
  margin-top: var(--space-4);
  padding: 0 var(--space-5);
  background: linear-gradient(180deg, var(--brand-navy), var(--brand-navy-deep));
}

.requirement .save-secondary-actions .link-button {
  font-size: 1rem;
  text-decoration: none;
}

@media (max-width: 980px) {
  .step-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  h1.step-heading {
    font-size: 1.5rem;
  }

  .step-stats {
    gap: var(--space-3);
  }

  .step-stat {
    padding: var(--space-3);
    font-size: .9rem;
  }

  .requirement {
    padding: var(--space-4);
  }
}

/*
 * Notifications (owner decision, 3 Oct 2026): the unread count beside the
 * navigation link and the Menu button, and the list itself. Unread is said
 * in words as well as shown by the border, never by colour alone.
 */
.nav-count {
  display: inline-flex;
  min-width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-2);
  padding: 0 .4rem;
  border-radius: 999px;
  color: var(--color-on-primary);
  background: var(--color-danger);
  font-size: .75rem;
  font-weight: 750;
  line-height: 1;
}

.notification-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification-item {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow-wrap: anywhere;
}

.notification-item.notification-unread {
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.notification-meta {
  margin: 0 0 var(--space-1);
  color: var(--color-muted);
  font-size: .85rem;
}

.notification-state {
  font-weight: 750;
  color: var(--color-ink);
}

.notification-title {
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.notification-body {
  margin: var(--space-1) 0 var(--space-3);
}

.notification-open,
.notification-mark-all {
  margin: 0;
}

@media (max-width: 680px) {
  .notification-item {
    padding: var(--space-3) var(--space-4);
  }

  .notification-open .button,
  .notification-mark-all .button {
    width: 100%;
    min-height: 2.75rem;
  }
}

/* OWNER-SELECTOR */
.select-search {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin-bottom: var(--space-2);
}

/* DASHBOARD-SAVED-FILTERS */
.saved-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.saved-view .form-inline { display: inline; }

/* BULK-ASSESSMENT-ACTIONS */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* COMP-15 */
.crosswalk-note { display: block; margin-top: var(--space-1); font-size: .85rem; color: var(--color-muted); }
/* ADMIN-AUDIT-LOG */
/* QA-DEF-06 (Hermes round 1): an actor name is up to 301 characters and a
   subject or summary can carry a long identifier with no space to break at;
   on a phone such a token ran past its card and widened the page again.
   Scoped to the activity trail: its cells may break anywhere. */
.activity-trail .data-table td { overflow-wrap: anywhere; }

.audit-entries { list-style: none; padding: 0; margin: 0; }
.audit-entry { border-bottom: 1px solid var(--color-border); padding: var(--space-2) 0; }
.audit-values { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; background: var(--color-subtle); padding: var(--space-2); }


/* SPRS-SUMMARY: a page meant to be printed or copied from. In print, only the
   content: no navigation, no account menu, no footer, no buttons. */
@media print {
  .app-sidebar, .topbar, .app-footer, .session-warning, .skip-link, .no-print { display: none !important; }
  .app-shell, .app-main, .content-area { display: block; margin: 0; padding: 0; }
  a[href]::after { content: none; }
}
.sprs-fields dt { font-weight: 600; margin-top: 1rem; }
.sprs-fields dd { margin: .25rem 0 0; }
.sprs-fields dd .sprs-value { font-size: 1.35rem; font-weight: 600; }
.sprs-fields dd .field-help { display: block; margin-top: .25rem; }
