/* M14 (PP-D281 to PP-D290): Additive Implants brand. Poppins is served from /fonts (SIL OFL, fonts/OFL.txt)
   because the CSP allows only this site. Website teal #2EAF9D and cyan #54CCE4 are for fills and lines only;
   text and buttons use #1A7064, which passes AA on white and #F3F5F8. Corners are 4 px. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/poppins-700.woff2") format("woff2"); }

:root {
  --fg: #14181C;
  --muted: #3E4852;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --line: #D5DBE1;
  --rule: #E1E6EA;
  --link: #1A7064;
  --link-hover: #12544A;
  --btn-bg: #1A7064;
  --btn-fg: #FFFFFF;
  --bar: #14181C;
  --bar-fg: #E6EAEE;
  --focus: #1A7064;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #E9EDF0; --muted: #B4BEC7; --bg: #0F1316; --surface: #1A2026; --line: #33404A; --rule: #2A333B;
    --link: #6FD3C3; --link-hover: #9EE3D8; --btn-bg: #6FD3C3; --btn-fg: #0F1316; --bar: #050505; --focus: #6FD3C3;
  }
}
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
}
h1, h2, h3 { font-weight: 600; line-height: 1.25; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Headings and panels that receive focus after a view change or an action are not controls. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus, section[tabindex="-1"]:focus, p[tabindex="-1"]:focus { outline: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 20; background: var(--surface); color: var(--fg); padding: 4px 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar (W01, W02): near-black with the white logo; the active view is underlined in cyan. */
body > header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem;
  padding: 0.5rem 1.5rem; background: var(--bar); color: var(--bar-fg);
}
body > header :focus-visible { outline-color: #54CCE4; }
body > header a { color: var(--bar-fg); }
.brand { font-weight: 600; margin: 0; color: #FFFFFF; }
.logo { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 44px; text-decoration: none; }
.logo img { display: block; width: 195px; height: 14px; }
.logo span { color: #9EE3EF; font-weight: 400; }
#views ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.1rem; }
#views a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.15rem; text-decoration: none; font-weight: 500; color: var(--bar-fg); }
#views a[aria-current="page"] { color: #FFFFFF; box-shadow: inset 0 -3px 0 #54CCE4; }
.badge { margin-left: 0.3rem; background: #54CCE4; color: #14181C; font-size: 0.75rem; font-weight: 700; border-radius: 9px; padding: 0 0.45rem; }
.acct { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.acct a { display: inline-flex; align-items: center; min-height: 44px; }

/* Breadcrumbs and page body. */
#crumbs ol { box-sizing: border-box; list-style: none; margin: 0 auto; padding: 0.75rem 1.5rem 0; max-width: 72rem; display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); }
#crumbs li + li::before { content: "/"; margin-right: 0.4rem; }
main { max-width: 72rem; margin: 0 auto; padding: 0.5rem 1.5rem 3rem; box-sizing: border-box; }
main > section, main > form, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 1rem 0;
}
main > section section { border-top: 1px solid var(--rule); margin-top: 1.25rem; padding-top: 0.5rem; }
.offview { display: none !important; }
#who { color: var(--muted); font-size: 0.9rem; }
footer { box-sizing: border-box; max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem 2rem; color: var(--muted); font-size: 0.9rem; }

/* Signed-out entry (PP-D292 wireframe): black band with a teal stripe, sign-in card. */
.band { background: #14181C; color: #FFFFFF; margin: 0 -1.5rem 1rem; padding: 2rem 1.5rem; box-shadow: inset 0 -6px 0 #2EAF9D; }
.band h1 { margin: 0 0 0.5rem; font-size: 2.2rem; font-weight: 700; }
.band p { margin: 0; color: #E6EAEE; max-width: 40rem; }
#signed-out-actions { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; max-width: 32rem; }

/* Buttons (W08, WCAG 2.5.8): 44 px targets, gaps between neighbours. */
button { font: inherit; min-height: 44px; min-width: 44px; padding: 0.4rem 1rem; cursor: pointer; border-radius: var(--radius);
  background: var(--surface); color: var(--link); border: 1.5px solid var(--link); font-weight: 600; }
button.primary, form button[type=submit] { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
body > header button { background: transparent; color: #FFFFFF; border-color: #9AA6B2; }
body > header button.primary { background: #FFFFFF; color: #14181C; border-color: #FFFFFF; }
td > button + button, td > button + input, td > input + button, li > button + button { margin-left: 0.5rem; }
td > button { margin-block: 0.15rem; }
#signed-out-actions button { margin-right: 0.5rem; }

/* Forms. */
form label { display: block; margin-top: 0.75rem; font-weight: 600; }
form input, form select, form textarea { display: block; width: 100%; max-width: 30rem; min-height: 44px; padding: 0.4rem 0.6rem; font: inherit;
  box-sizing: border-box; border: 1px solid #6B7680; border-radius: var(--radius); background: var(--surface); color: var(--fg); }
form textarea { min-height: 6rem; }
/* M16 S19: a checkbox or radio sits next to its label, not stretched across the page. */
form input[type=checkbox], form input[type=radio], .keep input[type=checkbox] { display: inline-block; width: 20px; min-height: 20px; height: 20px; max-width: none; margin: 0 0.5rem 0 0; vertical-align: middle; }
form input[type=checkbox] + label, form input[type=radio] + label, .keep label { display: inline; font-weight: 400; }
.keep { margin-top: 1rem; }
#keep-hint { color: var(--muted); font-size: 0.85rem; }
form button { margin-top: 1rem; }
#reg-error:empty { display: none; }
#reg-error { color: #b00020; }
@media (prefers-color-scheme: dark) { #reg-error { color: #ff8a80; } }

/* Tables (W17): scroll sideways in their own box on narrow screens. */
table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; font-size: 0.92rem; }
caption { text-align: left; font-weight: 600; padding-bottom: 0.4rem; }
th { text-align: left; background: #2B3238; color: #FFFFFF; font-weight: 600; padding: 0.5rem 0.6rem; }
/* R28: row headings in a table body read as text, not as the dark column header; brand colour for ticks. */
tbody th { background: transparent; color: var(--fg); }
input[type=checkbox], input[type=radio] { accent-color: var(--btn-bg); }
td { border-bottom: 1px solid var(--rule); padding: 0.5rem 0.6rem; vertical-align: middle; }
@media (max-width: 600px) { main table { display: block; overflow-x: auto; } }

/* J18 View as banner: persistent and unmistakable while a session is live. */
.banner { border: 3px solid #5B2E91; border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0; }
#view-as-error:empty, #invite-error:empty, #inv-error:empty, #terms-error:empty { display: none; }

/* M06 forms: the bot trap stays out of sight and out of the tab order; help text sits under its label. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.help { margin: 0.2em 0; font-size: 0.95em; color: var(--muted); }
fieldset { margin: 1em 0; border: 1px solid var(--line); border-radius: var(--radius); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1em; min-height: 3em; background: var(--surface); }
/* PP-D398: flashcards with a picture, a numbered marker and a color sample. Long text wraps on a phone. */
.flashcard { margin: 0.75em 0; overflow-wrap: anywhere; }
.flashcard > p { margin: 0.4em 0; }
.card-media { width: fit-content; max-width: 100%; margin-bottom: 0.5em; background: #fff; }
.card-frame { position: relative; }
.card-media img { display: block; max-width: 100%; height: auto; max-height: 55vh; }
/* PP-D403: a hollow ring leaves the spot visible; the number sits outside it. */
.card-spot { position: absolute; transform: translate(-50%, -50%); box-sizing: border-box; width: 1.2em; height: 1.2em; border: 2px solid #5B2E91; border-radius: 50%; outline: 2px solid #fff; }
.card-spot span { position: absolute; left: 100%; bottom: 100%; padding: 0 0.3em; line-height: 1.35; border-radius: 3px; background: #5B2E91; color: #fff; font-weight: 700; font-size: 0.8em; }
.card-spot.flip-x span { left: auto; right: 100%; }
.card-spot.flip-y span { bottom: auto; top: 100%; }
.card-media.zoomed { width: auto; overflow: auto; max-height: 70vh; }
.card-media.zoomed img { width: 100%; max-width: none; max-height: none; }
#tr-card-zoom { display: block; margin: 0 0 0.5em; }
#tr-card-group { min-height: 44px; max-width: 100%; font: inherit; }
@media (max-width: 600px) {
  #training { padding: 1rem 0.75rem; }
  .flashcard { padding: 0.5em; }
}
/* PP-D403: assessment answers, one to a row; the whole row is the target. */
#tr-questions fieldset { min-width: 0; }
form label.quiz-option { display: flex; align-items: center; gap: 0.6rem; box-sizing: border-box; min-height: 44px; margin: 0; padding: 0.35rem 0.25rem; font-weight: 400; cursor: pointer; }
form label.quiz-option input[type=radio] { flex: 0 0 auto; margin: 0; }
.quiz-option span { min-width: 0; overflow-wrap: anywhere; }
.quiz-option + .quiz-option { border-top: 1px solid var(--rule); }
/* PP-D403: the reps table stacks on a phone, so Expires is never cut off. */
@media (max-width: 600px) {
  #tr-team-reps, #tr-team-reps tbody, #tr-team-reps tr, #tr-team-reps td { display: block; }
  #tr-team-reps caption { display: block; }
  #tr-team-reps thead { position: absolute; left: -9999px; }
  #tr-team-reps tr { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; }
  #tr-team-reps td { border: 0; padding: 0.15rem 0; }
  #tr-team-reps td:first-child { font-weight: 600; }
  #tr-team-reps td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8rem; }
  #tr-team-reps td[data-label]:empty { display: none; }
}
.card-swatch { display: block; width: 3em; height: 3em; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.5em; }
.card-source { font-size: 0.85em; color: var(--muted); }
#tr-module-list ul { margin: 0.4em 0; }
#tr-modules summary { padding: 0.7rem 0; cursor: pointer; }
/* WP-D40, W15: a data area past its schedule plus grace. Dark amber text keeps 4.5:1 contrast on white. */
/* R04 / PP-D300: a payment hold is a warning (amber), not the purple View As style. */
.hold-note { border: 1px solid #7A4B00; border-left: 4px solid #B86E00; background: #FFF1D6; color: #4D2F00; border-radius: var(--radius); padding: 0.6rem 1rem; margin: 1rem 0; font-weight: 600; }
@media (prefers-color-scheme: dark) { .hold-note { background: transparent; color: #ffb15e; border-color: #ffb15e; } }
.delayed { color: #7A4B00; background: #FFF1D6; font-weight: 600; border-radius: var(--radius); padding: 0.2rem 0.5rem; }
@media (prefers-color-scheme: dark) { .delayed { color: #ffb15e; background: transparent; } }  /* M16 M16: 9.9:1 on dark */
/* J02 Roles and access: inputs sit inside table cells; wide grids scroll sideways on their own. */
table input[type=text], table input:not([type]) { width: 100%; min-width: 9rem; box-sizing: border-box; }
table input[type=checkbox] { display: inline; width: auto; }
#matrix-section table { display: block; overflow-x: auto; }
/* PP-D219: form errors are hard to miss: red bold summary, a message under each field, red border. */
.form-error:empty, .field-error:empty { display: none; }
.form-error { color: #b00020; font-weight: 700; border-left: 4px solid #b00020; padding-left: 0.5rem; }
.field-error { color: #b00020; font-weight: 600; margin: 0.2em 0 0; }
[aria-invalid="true"] { border: 2px solid #b00020; }
@media (prefers-color-scheme: dark) {
  .form-error, .field-error { color: #ff8a80; }
  .form-error { border-left-color: #ff8a80; }
  [aria-invalid="true"] { border-color: #ff8a80; }
}
main nav li a { display: inline-flex; align-items: center; min-height: 44px; }
main > section[id] { scroll-margin-top: 6rem; }

/* Forms (W09, W10). */
.forms-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); gap: 0.5rem 1.5rem; }
.forms-groups h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 1rem 0 0.25rem; }
.forms-groups ul { list-style: none; margin: 0; padding: 0; }
.forms-groups li { padding: 0.35rem 0; }
.forms-groups li button { width: 100%; text-align: left; }
.forms-groups li p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.85rem; }
.phi { display: flex; gap: 0.6rem; align-items: flex-start; border: 2px solid var(--fg); background: #FFF8EA; color: #14181C; border-radius: var(--radius); padding: 0.6rem 0.8rem; margin: 0.75rem 0; font-size: 0.92rem; }
.phi svg { flex: 0 0 auto; margin-top: 0.15rem; }
.done-box { border: 2px solid var(--link); border-radius: var(--radius); padding: 0.25rem 1.25rem 0.75rem; margin: 1rem 0; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; padding: 0; margin: 0.75rem 0; }
.steps li { border-top: 6px solid var(--line); padding-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.steps li.done { border-color: var(--link); }
.steps li.on { border-color: var(--fg); color: var(--fg); font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Home (W03, W04) and Help. */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; }
/* R02 / PP-D300: two columns on desktop, one on phones. */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); gap: 0 1.5rem; align-items: start; }
.home-main > section:first-child { margin-top: 0.5rem; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0.25rem 1rem 0.75rem; margin: 0.5rem 0 1rem; }
.side-card h3 { margin-top: 0.6rem; }
.home-side .quick { grid-template-columns: 1fr; }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.quick a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--link); border-radius: var(--radius); font-weight: 600; text-decoration: none; }
@media (max-width: 600px) {
  body > header { padding: 0.5rem 1rem; }
  main { padding: 0.5rem 1rem 3rem; }
  .band { margin: 0 -1rem 1rem; }
}
.attn { border: 2px solid var(--fg); border-radius: var(--radius); padding: 0.25rem 1.25rem 1rem; margin: 1rem 0; }
.attn-list { list-style: none; padding: 0; margin: 0; }
.attn-list li { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.attn-list li:last-child { border-bottom: 0; }
.attn-list .what { flex: 1 1 26rem; }
.attn-list .what p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }
.req { display: inline-block; margin-right: 0.5rem; padding: 0 0.4rem; border: 1px solid var(--fg); border-radius: var(--radius); font-size: 0.75rem; font-weight: 700; }
.go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: var(--radius); background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; text-decoration: none; }
.go:hover { color: var(--btn-fg); }
.stage { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #CDEFEA; color: #0E4D45; }
.stage.waiting { background: #FFF1D6; color: #7A4B00; }
.stage.done { background: #1A7064; color: #FFFFFF; }
.seg { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.seg button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
#center-cat { display: block; min-height: 44px; max-width: 20rem; font: inherit; padding: 0.3rem 0.5rem; border: 1px solid #6B7680; border-radius: var(--radius); background: var(--surface); color: var(--fg); }
label[for="center-cat"] { display: block; margin-top: 0.75rem; font-weight: 600; }

/* Library (W05, W06, W07). */
.lib-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); grid-template-areas: "filters main"; gap: 1rem 1.5rem; align-items: start; }
/* R16: an open document replaces the filters and list; they keep their state for Back. */
.lib-layout.with-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "panel"; }
.lib-layout.with-panel > .lib-filters, .lib-layout.with-panel > .lib-main { display: none; }
.lib-filters { min-width: 0; grid-area: filters; }
.lib-main { grid-area: main; overflow-x: auto; }
.lib-panel { grid-area: panel; }
.lib-filters fieldset { margin: 0 0 1rem; padding: 0.5rem 0.75rem; }
.lib-filters legend { font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.lib-filters label { display: flex; align-items: center; gap: 0.5rem; min-height: 36px; font-size: 0.9rem; }
.lib-filters input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.lib-filters .n { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.lib-main { min-width: 0; }
.lib-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 1rem 1rem; margin: 0 !important; }
.lib-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.75rem; font-size: 0.9rem; }
.lib-panel dt { color: var(--muted); }
.lib-panel dd { margin: 0; font-weight: 600; }
#lib-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; }
#lib-search label { flex: 1 1 100%; }
#lib-search input { flex: 1 1 18rem; }
#lib-search button { margin-top: 0; }
.tag { display: inline-block; margin: 0.1rem 0.3rem 0.1rem 0; padding: 0 0.4rem; border-radius: var(--radius); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tag.new { background: #14181C; color: #FFFFFF; }
.tag.revised { background: #FFF1D6; color: #7A4B00; border: 1px solid #7A4B00; }
.tag.changed { border: 1px solid var(--fg); }
tr.locked td { color: var(--muted); }
button.linkish { border: 0; background: none; padding: 0; min-height: 24px; min-width: 0; color: var(--link); text-decoration: underline; font-weight: 600; text-align: left; }
@media (max-width: 600px) {
  #lib-items, #lib-items tbody, #lib-items tr, #lib-items td { display: block; }
  #lib-items thead { position: absolute; left: -9999px; }
  #lib-items tr { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; }
  #lib-items td { border: 0; padding: 0.15rem 0; }
  #lib-items td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8rem; }
  #lib-items td[data-label]:empty { display: none; }
}
@media (max-width: 900px) {
  .lib-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "filters" "main"; }
  .lib-layout.with-panel { grid-template-areas: "panel"; }
}

/* Header search (W18). */
#site-search { position: relative; margin-left: auto; }
/* R01 / PP-D300: a magnifier opens the box under it, so the bar stays on one row at laptop widths. */
.icon-btn { min-width: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
body > header .icon-btn { border-color: transparent; }
body > header .icon-btn[aria-expanded="true"] { border-color: #9AA6B2; }
.site-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 24rem; max-width: 90vw; background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); padding: 0.6rem 0.75rem; box-sizing: border-box; }
#site-q { min-height: 44px; width: 100%; box-sizing: border-box; padding: 0.4rem 0.6rem; font: inherit; font-size: 0.9rem;
  border: 1px solid #6B7680; border-radius: var(--radius); background: var(--surface); color: var(--fg); }
.site-results { margin-top: 0.4rem; }
.site-results h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0.5rem 0 0.25rem; }
.site-results ul { list-style: none; margin: 0; padding: 0; }
.site-results a { display: flex; align-items: center; min-height: 40px; color: var(--link); text-decoration: none; }
.site-results a:hover { text-decoration: underline; }
body > header .site-results a { color: var(--link); }
body.in-portal .acct { margin-left: 0; }
/* W11, W17: status chips carry an icon and words, never colour alone. */
.status { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.status.bad { background: #2B3238; color: #FFFFFF; }
.status.warn { background: #FFF1D6; color: #7A4B00; }
.status.ok { background: #1A7064; color: #FFFFFF; }

/* W16 registration: role cards that say how each role is verified. */
.role-cards label { display: flex !important; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.6rem 0.75rem; margin: 0.4rem 0 0 !important; font-weight: 400 !important; max-width: 30rem; }
.role-cards label span { display: block; color: var(--muted); font-size: 0.85rem; }
.role-cards input[type=radio] { margin-top: 0.2rem; }
#reg-steps { max-width: 40rem; }

/* W08 phone: a bottom bar of at most 5 labelled destinations; the rest sit under More. */
.phone-only { display: none; }
.more-list { list-style: none; padding: 0; }
.more-list a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--rule); font-weight: 600; text-decoration: none; }
@media (max-width: 600px) {
  body.in-portal { padding-bottom: 72px; }
  body.in-portal #views { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar); border-top: 1px solid #33404A; }
  body.in-portal #views ul { justify-content: space-around; gap: 0; }
  body.in-portal #views li.desk-only { display: none; }
  body.in-portal #views li.phone-only { display: block; }
  body.in-portal #views a { min-height: 56px; padding: 0 0.4rem; font-size: 0.85rem; }
}

/* Staff console (W13, W14, W17). */
.console { display: flex; flex-wrap: wrap; align-items: stretch; }
body.in-console .console > main { flex: 999 1 40rem; min-width: 0; max-width: none; margin: 0; }
.side { flex: 1 1 14rem; max-width: 16rem; background: var(--surface); border-right: 1px solid var(--line); padding: 1rem 0.75rem; box-sizing: border-box; }
.side .g { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1rem 0.5rem 0.25rem; }
/* R30 (Preston 2026-10-31): clearer division between sections. Menu groups get a rule above them; Staff Home
   shows Work Waiting and Waiting Longest as two separate panels. */
.side .g { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.9rem; }
.side .g:first-of-type { border-top: 0; }
#staff-home > h3 { margin: 1.25rem 0 0.5rem; }
h3.divided { border-top: 2px solid var(--line); margin-top: 1.75rem; padding-top: 1.25rem; }
.side a { display: flex; align-items: center; min-height: 44px; padding: 0 0.6rem; border-radius: var(--radius); color: var(--fg); text-decoration: none; }
.side a[aria-current="page"] { background: var(--bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--link); }
body.in-console h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: 0.75rem; }
.tile { display: flex; flex-direction: column; gap: 0.2rem; min-height: 44px; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); text-decoration: none; }
.tile.hot { border: 2px solid var(--fg); }
.tile .k { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tile .big { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
th button.sort { background: none; border: 0; color: #FFFFFF; padding: 0; min-height: 32px; min-width: 0; font-weight: 600; text-align: left; }
th[aria-sort="ascending"] button.sort::after { content: " 91"; }
th[aria-sort="descending"] button.sort::after { content: " 93"; }
.view-as-bar { position: sticky; top: 0; z-index: 40; margin: 0 !important; background: #5B2E91; color: #FFFFFF; border: 0 !important; border-radius: 0 !important; }
.view-as-bar a, .view-as-bar button { color: #FFFFFF; border-color: #FFFFFF; background: transparent; }
@media (max-width: 700px) { .side { max-width: none; border-right: 0; border-bottom: 1px solid var(--line); } }

/* W07 tray board: numbered positions as a grid, one column on a phone. */
.tray-box { border: 2px solid var(--fg); border-radius: var(--radius); padding: 0.25rem 1.25rem 1rem; margin: 1rem 0; }
.tray-board { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 0.5rem; }
.tray-board li { display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 0.6rem; background: var(--surface); }
.tray-board .pos { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 0.3rem;
  border-radius: 1rem; background: #14181C; color: #FFFFFF; font-weight: 700; font-size: 0.9rem; box-sizing: border-box; }
.tray-board strong { display: block; font-size: 0.92rem; }

/* W14: column chooser and side panels in the staff console. */
details.cols { margin: 0.75rem 0 0.25rem; }
details.cols summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem; border: 1.5px solid var(--link); border-radius: var(--radius); color: var(--link); font-weight: 600; cursor: pointer; }
details.cols label { display: flex; align-items: center; gap: 0.4rem; min-height: 36px; font-weight: 400; }
details.cols[open] { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0.75rem 0.5rem; background: var(--surface); max-width: 22rem; }
table.hide-c2 tr > :nth-child(2) { display: none; }
table.hide-c3 tr > :nth-child(3) { display: none; }
table.hide-c4 tr > :nth-child(4) { display: none; }
table.hide-c5 tr > :nth-child(5) { display: none; }
table.hide-c6 tr > :nth-child(6) { display: none; }
table.hide-c7 tr > :nth-child(7) { display: none; }
table.hide-c8 tr > :nth-child(8) { display: none; }
table.hide-c9 tr > :nth-child(9) { display: none; }
table.hide-c10 tr > :nth-child(10) { display: none; }
table.hide-c11 tr > :nth-child(11) { display: none; }
table.hide-c12 tr > :nth-child(12) { display: none; }
.drawer:not([hidden]) { position: fixed; top: 0; right: 0; bottom: 0; z-index: 35; width: min(34rem, 100%); overflow-y: auto; margin: 0 !important;
  background: var(--surface); border: 0 !important; border-left: 1px solid var(--line) !important; border-radius: 0 !important;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18); padding: 1rem 1.25rem 2rem !important; box-sizing: border-box; }

/* Profile menu (PP-D298). */
.usermenu { position: relative; }
.avatar-btn { border: 0 !important; background: transparent !important; padding: 0 !important; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: #54CCE4; color: #14181C; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px #FFFFFF; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 17rem; max-width: 90vw; background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); padding: 0.75rem 1rem 1rem; }
.um-name { margin: 0; font-weight: 600; }
.um-sub { margin: 0.15rem 0 0.5rem; color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
.user-menu ul { list-style: none; margin: 0 0 0.5rem; padding: 0.25rem 0 0; border-top: 1px solid var(--rule); }
body > header .user-menu a { display: flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; text-decoration: none; }
body > header .user-menu a:hover { text-decoration: underline; }
body > header .user-menu button { width: 100%; background: var(--surface); color: var(--link); border-color: var(--link); }

/* R09 / PP-D300: filters sit in one row above a table and wrap on narrow screens. */
form.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin: 0.5rem 0 0.75rem; }
form.filter-row .fld { flex: 0 1 14rem; min-width: 9rem; }
form.filter-row label { margin-top: 0; font-size: 0.85rem; }
form.filter-row .fld-actions { display: flex; gap: 0.5rem; }
form.filter-row button { margin-top: 0; }
#users-count { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.25rem; }
tr[hidden] { display: none !important; }
#user-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; margin: 0.5rem 0 1rem; }
#user-actions fieldset { flex-basis: 100%; }

/* R03 / PP-D300: the certificate card on Training. */
.cert-card { border: 1px solid var(--line); border-left: 4px solid #1A7064; border-radius: var(--radius); background: var(--surface); padding: 0.25rem 1.25rem 1rem; margin: 1rem 0; max-width: 44rem; }
.cert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.cert-actions button { margin: 0; }
details.rate summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); font-weight: 600; cursor: pointer; }
.acct-box { max-width: 36rem; }
/* R15: Library pages */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 0.75em; margin: 0.75em 0; }
.pager label { margin: 0 0 0 auto; font-weight: 400; }
.pager select { width: auto; }
.pager button:disabled { opacity: 0.5; cursor: default; }
.lib-preview iframe { display: block; width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.lib-preview img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
/* R10: numbered getting-access steps and a short FAQ. */
.steps { counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step) ". "; font-weight: 600; }
.faq { max-width: 40rem; margin: 1.5rem 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 0.25rem 0; }
.faq summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--link); }
.faq p { margin: 0.25rem 0 0.75rem; }
/* R19, R20, R24: type-ahead lists. */
.lookup { position: relative; max-width: 36rem; }
.lookup-list { position: absolute; z-index: 20; left: 0; right: 0; margin: 2px 0 0; padding: 0.25rem 0; list-style: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); max-height: 18rem; overflow-y: auto; }
.lookup-opt { padding: 0.45rem 0.75rem; cursor: pointer; min-height: 44px; box-sizing: border-box; }
.lookup-opt[aria-selected="true"], .lookup-opt:hover { background: var(--bg); box-shadow: inset 3px 0 0 var(--link); }
.lookup-detail { display: block; font-size: 0.85rem; color: var(--muted); }
.lookup-add { color: var(--link); font-weight: 600; border-top: 1px solid var(--rule); }
.lookup-none { padding: 0.45rem 0.75rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.4rem 0; }
.chips li { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.3rem 0.15rem 0.7rem; background: var(--surface); }
.chips button { min-height: 32px; min-width: 32px; padding: 0 0.4rem; border: 0; background: none; color: var(--muted); }
.steps li.refused { border-color: #B07A10; color: var(--fg); }  /* D01: Not Approved step, amber not red */
.access-change { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.5rem; }
.access-change form { max-width: 28rem; }
.notice-warn { background: #FFF4D6; color: #5C4400; border-radius: var(--radius); padding: 0.5rem 0.75rem; }
#imp-feeds { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
#imp-feeds .side-card button { margin: 0 0.4rem 0.4rem 0; }
tr.row-error td { background: #FFF4D6; color: #5C4400; }
