/* Beam's components: the risograph print carried into every screen. Colours, faces and radii come from the tokens in
   public/rer-theme.css. Cards are ink-outlined white sheets on an off-register pink plate; pink marks only the current
   nav link, progress, the "Completed" highlight and the icon discs. The run site links this file too. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--beam-paper); color: var(--beam-ink); font: 400 17px/1.55 var(--rer-font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a:where(:not(#rer-dev-badge *)) { color: var(--rer-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:where(:not(#rer-dev-badge *)):hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--rer-focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--rer-font-heading); color: var(--beam-ink); text-wrap: balance; }
h1 { font-size: 56px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin: 48px 0 32px; }
h2 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 18px; line-height: 1.4; font-weight: 600; margin: 20px 0 8px; }
p { margin: 0 0 12px; text-wrap: pretty; }
:where(ul, ol):where(:not(#rer-dev-badge *)) { margin: 0 0 12px; padding-left: 1.3em; }
.muted { color: var(--rer-muted); font-size: 15px; line-height: 1.45; }
mark.hl, .hl { color: inherit; background: linear-gradient(transparent 8%, var(--beam-pink-highlight) 8% 92%, transparent 92%); padding: 0 .25em; margin: 0 -.05em; border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Top bar: mark and wordmark, the business, the role's links, the person. */
.top { background: var(--rer-surface); border-bottom: 1px solid var(--beam-rule); }
.top-inner { max-width: 1440px; margin: 0 auto; min-height: 72px; padding: 0 40px; display: flex; align-items: center; gap: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--beam-ink); text-decoration: none; font-size: 22px; font-weight: 700; letter-spacing: -.01em; flex: none; }
.brand img { width: 28px; height: 28px; display: block; }
.business { flex: none; padding-left: 24px; border-left: 1px solid var(--beam-rule); color: var(--rer-muted); font-size: 16px; line-height: 28px; }
.nav { flex: 1; min-width: 0; margin-left: 24px; }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 0; padding: 0; }
.nav a { display: inline-block; padding: 8px 0; color: var(--beam-ink); text-decoration: none; font-size: 16px; font-weight: 450; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--beam-rule); }
.nav a[aria-current="page"] { color: var(--beam-pink-ink); font-weight: 600; border-bottom-color: var(--beam-pink); }
.who { flex: none; margin-left: auto; padding-left: 24px; border-left: 1px solid var(--beam-rule); line-height: 28px; font-size: 16px; }

/* The column. */
.column { max-width: 1440px; margin: 0 auto; padding: 0 40px 96px; }
.column > h1:first-child, .column > .flash + h1 { margin-top: 48px; }
.column > .flash:first-child { margin-top: 32px; }
.back { margin: 40px 0 0; }
.back a { display: inline-flex; align-items: center; gap: 8px; }
.back + h1, .back + .muted + h1 { margin-top: 8px; }
.back + .muted { margin: 16px 0 0; }
.lede { margin: -16px 0 32px; color: var(--rer-muted); max-width: 62ch; }
.subtitle { margin: -20px 0 28px; color: var(--rer-muted); font-size: 18px; }
.flash { max-width: 72ch; margin: 24px 0 0; padding: 12px 16px; border: 1.5px solid var(--beam-ink); border-left-width: 6px; border-radius: 8px; background: var(--rer-surface); }
.flash.error { border-color: #9b1c1c; color: #7a1414; background: #fdf3f3; }

/* The card and its pink plate. A card never tilts, never sits inside a transformed or filtered box, and its plate
   sits behind it at -1 inside the nearest stacking context (a band with a background makes itself one). */
.card { position: relative; margin: 0 0 24px; padding: 28px; background: var(--rer-surface); border: 1.5px solid var(--beam-ink); border-radius: 10px; overflow-wrap: break-word; }
.card::after { content: ''; position: absolute; inset: -1.5px; z-index: -1; border-radius: 10px; transform: translate(var(--beam-plate-x), var(--beam-plate-y)); background: var(--beam-grain) 0 0 / 180px, var(--beam-pink); pointer-events: none; }
.card > :last-child, .card-body > :last-child { margin-bottom: 0; }
.card-title { margin: 0 0 12px; }
.card.with-disc { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 24px; align-items: start; }
.disc { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--beam-pink); color: var(--beam-ink); }
.disc .icon { width: 24px; height: 24px; stroke-width: 2; }
.card-body { min-width: 0; padding-top: 4px; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin-bottom: 24px; }
.grid > .card { margin: 0; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; margin-bottom: 24px; }
.split > .card, .stack > .card { margin: 0; }
.stack { display: grid; gap: 24px; }
.narrow { max-width: 820px; }
.settings { max-width: 620px; }

/* Rows inside cards. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--beam-rule); }
.row { display: flex; align-items: center; gap: 16px 32px; padding: 14px 0; }
.rows > li:first-child > .row, .rows > li.row:first-child { padding-top: 4px; }
.rows > li:last-child > .row, .rows > li.row:last-child { padding-bottom: 0; }
.row-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.row-title { font-size: 18px; line-height: 1.4; font-weight: 600; }
.row-meta { color: var(--rer-muted); font-size: 15px; line-height: 1.45; }
.row-meta a { color: inherit; }
.row-link, .row-title a { color: var(--beam-ink); text-decoration: none; }
.row-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-link:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.row-link .chevron { flex: none; color: var(--beam-ink); }
.row .progress { flex: none; }
ol.numbered { list-style: none; counter-reset: item; padding: 0; }
ol.numbered > li { counter-increment: item; }
ol.numbered .row::before { content: counter(item) '.'; flex: none; width: 1.6em; margin-right: -16px; font-size: 18px; font-weight: 450; }

progress.progress { -webkit-appearance: none; appearance: none; display: block; width: 260px; height: 6px; border: 0; border-radius: 3px; background: var(--beam-track); color: var(--beam-pink); overflow: hidden; }
progress.progress::-webkit-progress-bar { background: var(--beam-track); border-radius: 3px; }
progress.progress::-webkit-progress-value { background: var(--beam-pink); border-radius: 3px; }
progress.progress::-moz-progress-bar { background: var(--beam-pink); border-radius: 3px; }

/* Tags and statuses. */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 6px; background: var(--beam-grey); color: var(--beam-ink); font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tag.done::before { content: '✓'; font-weight: 700; }
.status { display: inline-block; padding: 3px 12px; border-radius: 6px; font-size: 14px; font-weight: 600; line-height: 1.45; white-space: nowrap; border: 1px solid transparent; }
.status-completed { background: linear-gradient(transparent 4%, var(--beam-pink-highlight) 4% 96%, transparent 96%); color: var(--beam-ink); }
.status-open, .status-cancelled, .status-replaced { background: var(--beam-grey); color: var(--beam-ink); }
.status-overdue { background: #fde8e8; color: #9b1c1c; border-color: #e8a9a9; }
.status-expiring { background: #fdf1d8; color: #6b4300; }

/* Buttons: an ink pill on a small pink plate; secondary is a white pill. */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin: 16px 0 0; padding: 0 24px; border: 1.5px solid var(--beam-ink); border-radius: 999px; background: var(--beam-ink); color: #fff; font: 600 16px/1.2 var(--rer-font-body); text-align: center; text-decoration: none; cursor: pointer; box-shadow: 3px 4px 0 var(--beam-pink); }
button:hover, .button:hover { background: #2c3242; text-decoration: none; }
button:active, .button:active { transform: translate(1px, 1px); box-shadow: 2px 3px 0 var(--beam-pink); }
button.secondary, .button.secondary { background: var(--rer-surface); color: var(--beam-ink); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { background: var(--beam-grey); }
.actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: flex-end; }
.actions button { margin-top: 0; }

/* Forms. */
form { margin: 0; }
label { display: block; margin: 16px 0 6px; font-size: 15px; font-weight: 600; }
form > label:first-of-type, fieldset > legend + label { margin-top: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 0; font-size: 16px; font-weight: 400; }
label.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--beam-ink); }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=file], select, textarea { display: block; width: 100%; max-width: 40rem; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--beam-ink); border-radius: 8px; background: var(--rer-surface); color: var(--beam-ink); font: 400 16px/1.4 var(--rer-font-body); }
input[type=file] { padding: 10px; }
select { -webkit-appearance: none; appearance: none; padding-right: 44px; background: var(--rer-surface) url('/brand/select.svg') right 14px center / 18px no-repeat; }
textarea { min-height: 8rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--beam-pink); box-shadow: 0 0 0 1px var(--beam-pink); }
.hint { margin: -2px 0 6px; }
.hint-after { margin: 6px 0 0; }
fieldset { margin: 16px 0 0; padding: 12px 16px 14px; border: 1px solid var(--beam-rule); border-radius: 8px; min-width: 0; }
legend { padding: 0 6px; font-size: 15px; font-weight: 600; }
/* Scoped to the page column so Base's dev bar (a details element of its own) keeps its own look. */
.column details { border-top: 1px solid var(--beam-rule); padding: 12px 0; }
.column details:last-of-type { border-bottom: 1px solid var(--beam-rule); }
.column details + details { border-top: 0; }
.column summary { cursor: pointer; font-weight: 600; }
.column details[open] > summary { margin-bottom: 8px; }
.form-row { display: grid; grid-template-columns: minmax(12rem, 1.4fr) minmax(10rem, 1fr) minmax(8rem, .8fr) minmax(9rem, .9fr) minmax(8rem, .8fr) minmax(11rem, 1.1fr); gap: 0 20px; align-items: start; }
.form-row > * { min-width: 0; }
form .form-row + label { margin-top: 16px; }
.row-text > form { margin-top: 8px; }
.form-row label, .form-row fieldset legend { margin-top: 0; }
.form-row fieldset { margin: 0; padding: 0; border: 0; }
.form-row fieldset legend { padding: 0; margin-bottom: 6px; }
.form-row fieldset label.check { margin-top: 4px; }
.form-row-form { display: flex; flex-direction: column; }
.form-row-form > button { align-self: flex-end; min-width: 152px; }
.form-row-form textarea, .form-row-form input[type=file] { max-width: none; }

/* Tables (report, record): rule lines, tabular figures; at 390 every row becomes a small stacked card. */
.table-card { padding: 0; }
.table-title { padding: 24px 28px 8px; margin: 0; }
.table-empty { padding: 0 28px 24px; }
.column td details, .column td details:last-of-type { border: 0; padding: 0; }
td details[open] { min-width: 14rem; }
td form button { margin-top: 10px; min-height: 40px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-feature-settings: "tnum"; }
th { padding: 14px 16px; text-align: left; vertical-align: bottom; color: var(--rer-muted); font-size: 14px; font-weight: 600; background: #fafafa; border-bottom: 1px solid var(--beam-rule); }
td { padding: 16px; height: 56px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--beam-rule); }
tbody tr:last-child td { border-bottom: 0; }
th:first-child { border-top-left-radius: 9px; }
th:last-child { border-top-right-radius: 9px; }
table.report td { font-size: 15px; }
table.report th, table.report td { overflow-wrap: normal; }
td.nowrap, .nowrap { white-space: nowrap; }
.card .table-wrap table th { background: transparent; }
.table-card table th { background: #fafafa; }
.summary { margin: 0 0 16px; font-size: 18px; }
.foot-note { margin-top: 16px; }

/* Reports filters. */
.filters { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; }
.filters > div { flex: 0 1 12.5rem; }
.filters select { max-width: none; }
.filters label { margin-top: 0; }
.filters fieldset.radios { flex: 0 1 auto; margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.filters fieldset.radios legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; }
.filters fieldset.radios label.check { margin: 0; min-height: 44px; align-items: center; }
.filters fieldset.radios label.check input { margin: 0; }
.filter-actions { margin-left: auto; display: flex; flex-wrap: nowrap; gap: 12px 28px; align-items: center; }
.filter-actions button { margin-top: 0; }
.filter-actions a { white-space: nowrap; }

/* Course overview, lesson, certificate. */
.lesson-card { max-width: 820px; }
.lesson-body { font-size: 18px; line-height: 1.6; }
.lesson-body p { max-width: 64ch; }
.lesson-body > p:first-child:has(> mark) { font-size: 22px; font-weight: 600; line-height: 1.45; }
.lesson-body ol, .lesson-body ul { list-style: none; padding: 0; counter-reset: step; }
.lesson-body li { position: relative; padding-left: 40px; margin: 10px 0; counter-increment: step; }
.lesson-body li::before { content: counter(step); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--beam-pink-highlight); font-size: 14px; font-weight: 700; }
.lesson-body ul li::before { content: ''; width: 10px; height: 10px; top: 9px; left: 8px; background: var(--beam-pink); }
.lesson-label { margin: 0 0 8px; }
.source-line { margin: 20px 0 0; }
.certificate { max-width: 680px; margin: 40px auto 0; text-align: center; padding: 40px 48px 36px; }
.certificate .lockup { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.certificate .lockup img { width: 28px; height: 28px; }
.certificate hr { border: 0; border-top: 1px solid var(--beam-rule); margin: 20px auto; max-width: 420px; }
.certificate h1 { margin: 8px 0 4px; font-size: 48px; }
.certificate h2 { margin: 4px 0; font-size: 32px; }
.certificate p { margin: 4px 0; }
.certificate .issuer { font-weight: 600; margin-top: 16px; }
.certificate .disclaimer { margin: 16px auto 0; max-width: 46ch; font-size: 14px; }
.print-note { text-align: center; margin-top: 28px; }

/* Empty states: a riso drawing in front of a grained pink disc, centred under the text (at the card's right at 390). */
.card.empty { display: block; }
.card.empty .disc { margin-bottom: 16px; }
.card.empty .card-body { padding-top: 0; display: grid; }
.empty-art { position: relative; display: block; justify-self: center; width: 192px; height: 132px; margin: 24px 0 0; color: var(--beam-ink); }
.empty-art::before { content: ''; position: absolute; left: 66px; top: -12px; width: 112px; height: 112px; border-radius: 50%; background: var(--beam-grain) 0 0 / 180px, var(--beam-pink-highlight); }
.empty-art svg { position: relative; display: block; width: 100%; height: 100%; }

/* Agent work, practice and questions keep their accepted layouts in these tokens. */
.tabs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 28px; }
.tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--beam-ink); border-radius: 999px; background: var(--rer-surface); color: var(--beam-ink); text-decoration: none; font-weight: 500; }
.tabs a[aria-current="page"] { background: var(--beam-ink); color: #fff; font-weight: 600; }
.proposal { display: grid; gap: 16px 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .proposal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); } .proposal-why { border-left: 1px solid var(--beam-rule); padding-left: 32px; } }
.proposal h2 { margin: 10px 0 4px; }
.proposal h3 { font-size: 15px; margin: 0 0 6px; }
.proposal ul { margin: 0 0 14px; padding-left: 1.2em; }
.proposal .tag { background: var(--beam-pink-highlight); }
table.preview { font-size: 15px; }
table.preview td { height: auto; padding: 10px 12px; }
table.preview th { padding: 10px 12px; background: transparent; }
.decision textarea { min-height: 3.5rem; max-width: none; }
.banner { margin: -12px 0 28px; padding: 12px 16px; border-radius: 8px; background: var(--beam-pink-highlight); font-weight: 500; }
form button.choice { display: flex; justify-content: flex-start; width: 100%; min-height: 56px; margin: 12px 0 0; padding: 12px 20px; border-radius: 10px; text-align: left; background: var(--rer-surface); color: var(--beam-ink); box-shadow: none; font-weight: 600; line-height: 1.4; }
form button.choice:hover { background: var(--beam-grey); }
.feedback { border-left-width: 6px; }
.practice-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.practice-foot button { margin-top: 0; }
.narrow textarea { max-width: none; min-height: 5rem; }

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  .form-row > :first-child { grid-column: 1 / -1; }
  .top-inner { flex-wrap: wrap; padding-top: 12px; padding-bottom: 4px; }
  .nav { order: 3; flex-basis: 100%; margin: 4px 0 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 36px; margin: 32px 0 24px; }
  h2 { font-size: 20px; line-height: 1.3; }
  .row-title { font-size: 16px; }
  .muted, .row-meta { font-size: 14px; }
  .top-inner { padding: 14px 20px 4px; gap: 0 14px; }
  .brand { font-size: 20px; }
  .business { padding-left: 14px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
  .who { font-size: 15px; padding-left: 14px; border-left: 0; }
  .nav ul { gap: 0 18px; }
  .nav a { font-size: 15px; padding: 5px 0 4px; }
  .column { padding: 0 20px 72px; }
  .column > h1:first-child, .column > .flash + h1 { margin-top: 32px; }
  .back { margin-top: 24px; }
  .card { padding: 20px; margin-bottom: 16px; }
  .grid, .split, .stack { gap: 16px; margin-bottom: 16px; }
  .card.with-disc { grid-template-columns: 40px minmax(0, 1fr); gap: 0 16px; }
  .empty-art { justify-self: end; margin-top: 8px; }
  /* The heading stays beside the disc; the card's content runs under both at the full card width. */
  .card.with-disc:not(.empty) > .card-body { display: contents; }
  .card.with-disc:not(.empty) > .card-body > .card-title { align-self: center; margin: 0; }
  .card.with-disc:not(.empty) > .card-body > :not(.card-title) { grid-column: 1 / -1; }
  .card.with-disc:not(.empty) > .card-body > .card-title + * { margin-top: 16px; }
  .disc { width: 40px; height: 40px; }
  .row { flex-wrap: wrap; gap: 10px; }
  .row .progress, progress.progress { width: 100%; }
  /* A linked row with progress: its text and bar stack on the left, the chevron sits beside both. */
  .row-link { flex-wrap: nowrap; }
  .row-link:has(> .progress) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
  .row-link:has(> .progress) > .progress { grid-column: 1; }
  .row-link:has(> .progress) > .chevron { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  button, .button { width: 100%; }
  .actions button, .filter-actions button, .practice-foot button { width: auto; flex: 1 1 auto; }
  .filters { display: grid; gap: 16px; }
  .filters fieldset.radios { display: grid; gap: 0; }
  .lesson-body { font-size: 17px; }
  .lesson-body > p:first-child:has(> mark) { font-size: 19px; }
  .certificate { padding: 28px 20px; }
  .certificate h1 { font-size: 36px; }
  .certificate h2 { font-size: 24px; }
  .summary { font-size: 16px; }
  .table-title { padding: 20px 20px 4px; }
  .table-empty { padding: 0 20px 20px; }
  .filter-actions { margin-left: 0; }
  .subtitle { font-size: 16px; margin-top: -6px; }
  /* A table becomes one stacked card per row: the first cell bold, then label: value lines. */
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; }
  table.stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stacked tr { padding: 14px 20px; border-bottom: 1px solid var(--beam-rule); }
  table.stacked tbody tr:last-child { border-bottom: 0; }
  table.stacked td { height: auto; padding: 2px 0; border: 0; font-size: 15px; white-space: normal; }
  table.stacked td:first-child { font-size: 16px; font-weight: 600; padding-bottom: 4px; }
  table.stacked td[data-label]:not(:first-child)::before { content: attr(data-label) ': '; color: var(--rer-muted); }
  table.stacked td[data-label].cell-status::before, table.stacked td[data-label].cell-plain::before { content: none; }
  table.stacked td[data-empty] { display: none; }
  table.stacked td.cell-status { padding: 6px 0; }
}

@media print {
  .top, .no-print, .flash { display: none; }
  body { background: #fff; }
  .card::after { display: none; }
  .certificate { margin-top: 0; }
}
