:root {
  --canvas: #f6f8f7;
  --surface: #ffffff;
  --text: #162321;
  --muted: #53635f;
  --primary: #0a665a;
  --primary-hover: #074e46;
  --line: #cdd9d5;
  --soft: #e8f1ee;
  --urgent: #8f2d24;
  --urgent-soft: #f8e9e6;
  --focus: #005fcc;
  --disabled-line: #aeb9b6;
  --disabled-surface: #e3e8e6;
  --gutter: clamp(1rem, 3vw, 3rem);
  --main-padding: clamp(1.25rem, 3vw, 2.75rem);
  --shadow: 0 0.75rem 2rem rgb(18 52 47 / 8%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
[tabindex]:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--surface);
  background: var(--text);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Both portals share one frame: header, test-environment banner, the view, and a
   footer kept at the foot of a short page. */
.portal:has(> .site-header) {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.shell {
  width: min(92rem, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.reading-width {
  max-width: 45rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  min-height: 5.5rem;
  padding-block: 1rem;
}

.identity {
  display: grid;
  flex: none;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 1.25rem;
}

.wordmark {
  color: var(--primary);
  font-size: clamp(1.5rem, 2.7vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.portal-label {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 650;
}

.navigation {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.25rem, 1.6vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.3rem 0.6rem;
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
}

.navigation a:hover {
  color: var(--primary-hover);
  background: var(--soft);
}

.navigation a[aria-current="page"] {
  border-bottom: 2px solid var(--primary);
  color: var(--primary-hover);
}

.signed-in {
  display: flex;
  min-width: 0;
  max-width: 26rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.signed-in form {
  margin: 0;
}

.environment-banner {
  border-bottom: 1px solid #b8d0c8;
  color: #103c35;
  background: #dcece7;
}

.banner-layout {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 1rem;
  padding-block: 0.4rem;
  font-size: 0.92rem;
}

.banner-layout strong {
  flex: none;
  letter-spacing: 0.035em;
}

.main-content {
  flex: 1;
  min-height: 0;
  padding-block: var(--main-padding);
}

.hero {
  margin-bottom: 0.75rem;
}

/* A page's heading with the link back to where the reader came from beside it. */
.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
  margin-bottom: 0.4rem;
}

.page-heading h1 {
  margin-bottom: 0;
}

.case-area {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.35rem, 2.5vw, 1.6rem);
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section-block h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

h3 {
  margin-bottom: 0.3rem;
  font-size: 1.12rem;
}

p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 42rem;
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.3rem);
}

.build-status {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface);
  font-weight: 650;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.button {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border: 0.125rem solid var(--primary);
  border-radius: 0.4rem;
  color: var(--surface);
  background: var(--primary);
  font: inherit;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}

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

.button:disabled {
  border-color: #81938e;
  color: var(--muted);
  background: var(--line);
  cursor: not-allowed;
}

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

.button--quiet {
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
}

.button--secondary:hover,
.button--quiet:hover {
  color: var(--surface);
}

.callout {
  margin-block: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 0.35rem solid var(--primary);
  border-radius: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.callout--urgent {
  border-color: #d5a19b;
  border-left-color: var(--urgent);
  background: var(--urgent-soft);
}

.callout--compact {
  margin-block: 1rem 0;
  box-shadow: none;
}

.callout--compact h2 {
  font-size: 1.2rem;
}

.callout p:last-child,
.steps p:last-child,
.section-block p:last-child,
.dashboard-card > p:last-child {
  margin-bottom: 0;
}

.section-block {
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
  scroll-margin-top: 2rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.85rem;
  min-width: 0;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--surface);
  background: var(--primary);
  font-weight: 800;
}

.site-footer {
  margin-top: 1rem;
  padding-block: 1rem;
  color: var(--surface);
  background: var(--primary);
  font-size: 0.9rem;
  text-align: center;
}

.text-link {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  font-weight: 700;
}

.error-page {
  min-height: 24rem;
}

.form-card,
.dashboard-card,
.attachment-card,
.review-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-card {
  display: grid;
  gap: 0.7rem;
  container-type: inline-size;
}

.form-card > .button {
  justify-self: start;
}

/* Within one login/registration flow the card may only grow from step to
   step (flow-card.js carries the height forward); the buttons keep their
   place at the foot of a grown card. */
.form-card--flow > .button-row {
  margin-top: auto;
}

.form-field {
  --field-row-gap: 0.3rem;
  display: grid;
  gap: var(--field-row-gap);
}

@container (min-width: 34rem) {
  .form-field {
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: var(--field-row-gap) 0.75rem;
    align-items: center;
  }

  .form-field:has(textarea) {
    align-items: start;
  }

  .form-field:has(textarea) label {
    padding-top: 0.35rem;
  }

  .form-field > .field-hint,
  .form-field > .field-error {
    grid-column: 2;
  }
}

.form-field label,
.check-field label {
  font-weight: 750;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #81938e;
  border-radius: 0.35rem;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

.form-field input:hover:not(:disabled) {
  border-color: var(--text);
}

.form-field textarea {
  resize: vertical;
}

.form-field input:disabled,
.form-field textarea:disabled {
  border-color: var(--disabled-line);
  color: var(--muted);
  background: var(--disabled-surface);
  cursor: not-allowed;
  opacity: 1;
}

.case-card {
  margin-top: 1rem;
}

.radio-question,
.upload-group {
  min-width: 0;
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-block: 0.5rem;
}

.upload-message {
  min-height: 1.6em;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-weight: 650;
}

.radio-question legend,
.upload-group legend {
  padding-inline: 0.25rem;
  font-weight: 750;
}

.radio-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.35rem;
}

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

.radio-options label {
  display: flex;
  min-height: 2.6rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #81938e;
  border-radius: 0.4rem;
  font-weight: 750;
  cursor: pointer;
}

.radio-options label:hover {
  border-color: var(--text);
  background: var(--soft);
}

.radio-options input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

/* "Ved ikke" stands apart from the specialties it is not one of. */
.area-separator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.area-separator::before,
.area-separator::after {
  flex: 1;
  border-top: 1px solid var(--line);
  content: "";
}

.radio-options--alternative label {
  border-style: dashed;
  background: var(--soft);
}

.radio-options--alternative .field-hint {
  margin: 0;
}

.upload-group {
  display: grid;
  gap: 0.55rem;
}

.upload-group input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px dashed #81938e;
  border-radius: 0.35rem;
  background: var(--canvas);
  font: inherit;
}

.file-label {
  font-weight: 700;
}

.check-field {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.35rem 0.6rem;
  align-items: start;
}

.check-field input:disabled + label {
  color: var(--muted);
  text-decoration: line-through;
}

.check-field input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.18rem;
}

.check-field .field-error {
  grid-column: 2;
}

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

.submission-gate {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.field-hint,
.form-alternative {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-error {
  margin: 0;
  color: #6f211b;
  font-size: 0.9rem;
  font-weight: 650;
}

.form-error,
.success-message {
  margin: 0;
  padding: 0.75rem;
  border-left: 0.3rem solid var(--urgent);
  color: #5c1e18;
  background: var(--urgent-soft);
  font-weight: 650;
}

.success-message {
  border-left-color: var(--primary);
  color: #103c35;
  background: var(--soft);
}

.dashboard-card h2 {
  font-size: 1.15rem;
}

.dashboard-card form {
  margin: 0;
}

.attachment-card,
.review-card {
  margin-block: 0.75rem;
}

/* Cards that follow one another keep the same space between them. */
:is(.form-card, .dashboard-card, .review-card, .attachment-card, .callout)
  + :is(.form-card, .dashboard-card, .review-card, .attachment-card) {
  margin-top: 0.75rem;
}

.attachment-card h2,
.review-card h2 {
  font-size: 1.15rem;
}

.review-card__patient {
  margin: 0.35rem 0 0;
}

/* A card heading followed on its row by a detail such as a time. Inline layout keeps the
   row the same on screen and in the PDF renderer. */
.review-card__heading {
  margin-bottom: 0.5rem;
}

.review-card__heading > h2 {
  display: inline;
}

.review-card__heading > span {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.case-list,
.notification-list {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.case-summary {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}

.case-summary__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.case-summary__header h3,
.case-summary__header p,
.notification-list p {
  margin: 0;
}

.case-summary__header form,
.case-summary__header .button {
  flex: none;
}

.notification-list li {
  padding: 0.85rem;
  border-left: 0.3rem solid var(--primary);
  background: var(--soft);
}

.attachment-list {
  display: grid;
  gap: 0;
  margin: 0.4rem 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.attachment-list:empty {
  display: none;
}

.attachment-list li {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.attachment-list li > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
}

.attachment-list strong {
  overflow-wrap: anywhere;
}

.attachment-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.attachment-list form {
  flex: none;
  margin: 0;
}

.review-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

.review-list > div {
  display: grid;
  gap: 0.1rem;
}

@media (min-width: 36rem) {
  .review-list > div {
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: 0.1rem 0.75rem;
  }
}

.review-list dt {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.review-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The patient's submitted information keeps each label above its content in every
   portal, column and printed copy. */
.review-list.review-list--stacked > div {
  grid-template-columns: minmax(0, 1fr);
}

.review-list__detail {
  color: var(--text);
  font-weight: 400;
}

/* A form that is needed only sometimes folds into its heading. */
.move-disclosure > summary {
  cursor: pointer;
}

.move-disclosure > summary > h2 {
  display: inline;
}

.move-disclosure[open] > summary {
  margin-bottom: 0.75rem;
}

/* Each part of the patient's own account starts after a space. */
.review-list.review-list--stacked > div + div {
  margin-top: 0.85rem;
}

.preserve-lines {
  white-space: pre-wrap;
}

/* A list of cases in either portal: each case is its own bordered row, 1rem apart.
   A list that opens a side column's view starts level with the column. */
.case-list {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.side-layout__view > h1 + * > .case-list:first-child {
  margin-top: 0;
}

.case-list article {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.case-list h2 {
  margin-top: 0;
}

/* A case's questions and replies, and a text field with its action, in both portals:
   the description and button on the left, the text on the right when there is room. */
.correspondence-list { list-style: none; padding: 0; display: grid; gap: 1.25rem; }
.correspondence-list > li { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }

.text-action { container-type: inline-size; }
.text-action__description > p { margin: 0.3rem 0 0; }
/* Narrow, the button stands apart below the text it sends. */
.text-action__fields > .button { margin-top: 0.45rem; }
@container (min-width: 34rem) {
  .text-action__fields {
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: stretch;
  }
  .text-action__description { grid-column: 1; grid-row: 1; }
  .text-action__fields > textarea { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
  .text-action__fields > .button { grid-column: 1; grid-row: 2; justify-self: start; align-self: end; margin-top: 0; }
}

/* One case as a compact row in either portal (ui.case_row): its symbol, its lines and
   its action. »turn« marks the reader's turn after the other party has acted;
   »waiting« marks a case that waits for the other party or is closed. Without a
   colour the reader's own work is in progress. */
.case-list article.case-row {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.9rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
}

.case-list article.case-row--turn {
  border-color: var(--primary);
  background: var(--soft);
}

.case-list article.case-row--waiting {
  border-color: var(--disabled-line);
  color: var(--muted);
  background: var(--disabled-surface);
}

.case-row__symbol {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--soft);
}

.case-row__symbol svg {
  width: 1.35rem;
  height: 1.35rem;
}

.case-row--turn .case-row__symbol {
  color: var(--surface);
  background: var(--primary);
}

.case-row--waiting .case-row__symbol {
  color: var(--muted);
  background: var(--surface);
}

.case-row__main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.case-row__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.6rem;
}

.case-row__heading h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.case-row__main p {
  margin: 0;
}

.case-row__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.case-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.case-row__actions form {
  margin: 0;
}

/* A page with a side column (_side.html): one card of items beside the view. Wide,
   the card stays in sight while the page scrolls and the marked item carries a bar
   on its left; narrow, the card is one row above the view. The portals' areas fold
   the card to its icons (data-menu-collapsed, set by area-menu.js), the draft lists
   its steps in it, and the public patient pages list the specialties. */
.side-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1.75rem;
}

.side-layout__view > :first-child {
  margin-top: 0;
}

.side-menu {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.35rem;
  width: 13rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.side-menu ul,
.side-menu ol {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-menu a,
.side-menu__item,
.side-menu__toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 0.45rem;
  color: var(--text);
  background: none;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}

.side-menu a,
.side-menu__toggle {
  cursor: pointer;
}

.side-menu a:hover,
.side-menu__toggle:hover {
  background: var(--soft);
}

.side-menu [aria-current] {
  color: var(--primary);
  background: var(--soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.side-menu__heading {
  margin: 0.45rem 0.6rem 0.15rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-menu svg {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
}

.side-menu__toggle {
  width: 100%;
  color: var(--muted);
  font-weight: 500;
}

/* A number of cases in the side menu or after a heading: plain, or highlighted while
   cases wait for the reader. */
.side-menu__count,
.side-menu__badge,
.heading-count {
  min-width: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.5rem;
  text-align: center;
}

.side-menu__count,
.side-menu__badge {
  margin-left: auto;
}

.heading-count {
  display: inline-block;
  margin-left: 0.4rem;
  vertical-align: 0.1em;
}

.side-menu__count,
.heading-count {
  color: var(--muted);
  background: var(--canvas);
}

.side-menu__badge,
.heading-count--waiting {
  color: #fff;
  background: var(--primary);
}

.side-layout[data-menu-collapsed] .side-menu {
  width: 3.65rem;
}

.side-layout[data-menu-collapsed] .side-menu__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.side-layout[data-menu-collapsed] .side-menu a,
.side-layout[data-menu-collapsed] .side-menu__toggle {
  position: relative;
  justify-content: center;
}

.side-layout[data-menu-collapsed] .side-menu__toggle svg {
  transform: rotate(180deg);
}

.side-layout[data-menu-collapsed] .side-menu__count,
.side-layout[data-menu-collapsed] .side-menu__badge {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1.15rem;
  padding: 0 0.25rem;
  font-size: 0.7rem;
  line-height: 1.15rem;
}

.side-layout__view > .success-message {
  margin-bottom: 0.9rem;
}

/* The draft's steps in the side column: numbered, the steps before the current one
   marked done. */
.wizard-progress__step {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.wizard-progress__step--current {
  font-weight: 700;
}

.wizard-progress__number {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.wizard-progress__step--current .wizard-progress__number {
  border-color: var(--primary);
  color: var(--surface);
  background: var(--primary);
}

.wizard-progress__step--done .wizard-progress__number {
  border-color: var(--primary);
  color: var(--primary);
}

/* A doctor's case page on a wide screen: the case material on the left, the work on
   the right, both read in document order. The wider work column keeps each text
   action's description and button beside its field. Narrow, they form one column. */
@media (min-width: 74rem) {
  .case-columns:has(> .case-columns__work > *) {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 0 1.5rem;
    align-items: start;
  }

  .case-columns:has(> .case-columns__work > *) .reading-width {
    max-width: none;
  }

  .case-columns__material > :first-child,
  .case-columns__work > :first-child {
    margin-top: 0.75rem;
  }

  .case-columns__material .classification-form input[type="text"] {
    flex-basis: 100%;
  }
}

@media (max-width: 46rem) {
  .header-layout,
  .banner-layout {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-layout {
    gap: 0.75rem;
    padding-block: 1rem;
  }

  .navigation {
    margin-left: -0.6rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .signed-in {
    width: 100%;
    max-width: none;
    align-items: center;
    justify-content: space-between;
    padding-left: 0;
    border-left: 0;
  }

  .signed-in > span {
    flex: 1;
    min-width: 0;
  }

  .banner-layout {
    min-height: 0;
    gap: 0.1rem;
    padding-block: 0.45rem;
    font-size: 0.85rem;
  }

  .steps,
  .radio-options,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .attachment-list li {
    align-items: flex-start;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .case-summary__header {
    flex-direction: column;
  }

  /* Narrow, a case row's action moves under its lines. */
  .case-list article.case-row {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }

  .case-row__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  /* Narrow, every side column is one row above its view and does not fold. The
     draft's seven steps wrap in their row; the other columns share it equally. */
  .side-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .side-menu,
  .side-layout[data-menu-collapsed] .side-menu {
    position: static;
    width: auto;
    padding: 0.3rem;
  }

  .side-menu__toggle {
    display: none;
  }

  .side-menu ul {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .side-menu a,
  .side-layout[data-menu-collapsed] .side-menu a {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.8rem;
    text-align: center;
  }

  .side-menu ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
  }

  .side-menu__item {
    min-height: 0;
    gap: 0.4rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.85rem;
  }

  .side-menu__heading {
    margin: 0.3rem 0.45rem 0;
  }

  .side-layout[data-menu-collapsed] .side-menu__label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .side-menu [aria-current] {
    box-shadow: inset 0 -3px 0 var(--primary);
  }

  /* The numbers stand on the icon's corner, as in the folded menu; the icon is
     centred in its item. */
  .side-menu__count,
  .side-menu__badge,
  .side-layout[data-menu-collapsed] .side-menu__count,
  .side-layout[data-menu-collapsed] .side-menu__badge {
    position: absolute;
    top: 0.1rem;
    right: auto;
    left: calc(50% + 0.3rem);
    min-width: 1.15rem;
    margin: 0;
    padding: 0 0.25rem;
    font-size: 0.7rem;
    line-height: 1.15rem;
  }

}

@media (max-width: 24rem) {
  .steps li {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

form.classification-form {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 0.5rem 0.9rem;
}

.classification-form fieldset,
.classification-form button {
  min-width: 0;
}

.classification-form fieldset {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 0.4rem 0.9rem;
}

.classification-form fieldset label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 750;
  cursor: pointer;
}

.classification-form input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #81938e;
  border-radius: 0.35rem;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

.classification-form input[type="text"]:hover {
  border-color: var(--text);
}

.classification-summary {
  flex: 1 1 100%;
  margin: 0;
}
