/* One stylesheet for the whole product. Nothing is loaded from another site. */

@font-face {
  font-family: "DM Sans";
  src: url("/static/fonts/dm-sans-latin-var.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Serif Display";
  src: url("/static/fonts/dm-serif-display-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0B1B2B;
  --ink-glow: #17324A;
  --teal: #0FA394;
  --teal-hover: #13B5A4;
  --teal-deep: #0A6F65;
  --mist: #EEF4F6;
  --field: #F3F7F9;
  --slate: #5A6B7B;
  --white: #FFFFFF;
  --line: #D5E0E5;
  --danger: #9B2C2C;
  --danger-wash: #FBECEC;
  --ok-wash: #E3F4F1;
  --amber: #7A4B00;
  --amber-wash: #FBF0D9;
  --on-ink: #E4EBF0;
  --on-ink-soft: #C5D1DA;
  --on-ink-faint: #8FA3B3;

  --font-text: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.3rem;
  --step-2: 1.8rem;
  --step-3: 2.9rem;

  --radius: 11px;
  --radius-card: 14px;
  --control-height: 2.875rem;
  --shadow-card: 0 1px 2px rgba(11, 27, 43, 0.05), 0 10px 28px rgba(11, 27, 43, 0.07);
  --shadow-button: 0 1px 2px rgba(11, 27, 43, 0.12), 0 6px 16px rgba(15, 163, 148, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-text);
  font-size: 100%;
  line-height: 1.5;
  color: var(--ink);
  background: var(--mist);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
}

h1 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  max-width: 62ch;
}

a {
  color: var(--teal-deep);
  text-underline-offset: 0.15em;
}

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

.lede {
  margin-top: 0.375rem;
  color: var(--slate);
}

.hint {
  margin-top: 1.25rem;
  font-size: var(--step--1);
  color: var(--slate);
}

.stack > * + * {
  margin-top: 1.125rem;
}

/* ---- logo ---------------------------------------------------------------- */

.mark-ring {
  stroke: var(--ink);
}

.mark-bar {
  fill: var(--teal);
}

.mark-small {
  width: 2rem;
  height: 2rem;
}

.mark-large {
  width: 4rem;
  height: 4rem;
}

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

.wordmark {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lockup-large {
  gap: 0.875rem;
}

.lockup-large .wordmark {
  font-size: 2.6rem;
}

.lockup-reversed {
  color: var(--white);
}

.lockup-reversed .mark-ring {
  stroke: var(--white);
}

/* ---- buttons ------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 0 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--teal);
  color: var(--ink);
  box-shadow: var(--shadow-button);
}

.button-primary:hover {
  background: var(--teal-hover);
}

.button-secondary {
  background: var(--white);
  border-color: var(--teal-deep);
  color: var(--teal-deep);
  letter-spacing: normal;
}

.button-secondary:hover {
  background: var(--ok-wash);
}

.button-quiet {
  min-height: 2.375rem;
  padding: 0 0.875rem;
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  font-size: var(--step--1);
  letter-spacing: normal;
}

.button-quiet:hover {
  border-color: var(--slate);
}

.button-danger {
  background: var(--white);
  border-color: var(--danger);
  color: var(--danger);
  letter-spacing: normal;
}

.button-danger:hover {
  background: var(--danger-wash);
}

/* ---- fields and messages ------------------------------------------------- */

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: var(--step--1);
  font-weight: 600;
}

.field input {
  display: block;
  width: 100%;
  height: var(--control-height);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.field input::placeholder {
  color: var(--slate);
}

.field input:hover {
  border-color: var(--slate);
}

.field input:focus {
  background: var(--white);
}

.field .input-code {
  max-width: 11rem;
  font-size: var(--step-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
}

.notice {
  margin-top: 1.25rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: var(--step--1);
}

.notice-danger {
  border-color: #E9BDBD;
  background: var(--danger-wash);
  color: var(--danger);
}

.notice-warn {
  max-width: 38rem;
  border-color: var(--amber);
  background: var(--amber-wash);
}

.notice p + p,
.notice-warn p + p,
.notice-warn ul,
.notice-warn ul + p {
  margin-top: 0.5rem;
}

.earlier-details {
  max-width: 56rem;
  margin-top: 0.75rem;
  color: var(--slate);
}

.earlier-details summary {
  cursor: pointer;
}

.earlier-details ul {
  margin-top: 0.5rem;
}

.notice-ok {
  border-color: #B5DED7;
  background: var(--ok-wash);
  color: var(--teal-deep);
}

.status {
  display: inline-block;
  white-space: nowrap;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-waiting {
  background: var(--ok-wash);
  color: var(--teal-deep);
}

.status-active {
  background: var(--ink);
  color: var(--white);
}

.status-attention {
  background: var(--amber-wash);
  color: var(--amber);
}

.status-blocked {
  background: var(--danger-wash);
  color: var(--danger);
}

.status-done {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--slate);
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---- sign-in screens ----------------------------------------------------- */
/* Dark panel on the left says what this is; the form sits on the right. A
   large, faint ring fills the lower left, opening toward the form, with its
   teal bar resting near the line between the two halves. */

.auth {
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(0, 1fr);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2.5rem clamp(2rem, 4vw, 3.5rem);
  background: radial-gradient(120% 90% at 15% 0%, var(--ink-glow) 0%, var(--ink) 62%);
  color: var(--on-ink);
  overflow: hidden;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-brand h1 {
  margin-top: 2.75rem;
  font-size: var(--step-3);
  color: var(--white);
}

.auth-tagline {
  margin-top: 0.75rem;
  max-width: 34ch;
  font-size: 1.05rem;
  color: var(--on-ink-soft);
}

.auth-brand .eyebrow {
  margin-top: 2.5rem;
  color: var(--on-ink-faint);
}

.benefits {
  display: grid;
  gap: 0.5rem;
  max-width: 30rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.benefits li {
  position: relative;
  padding: 0.7rem 0.875rem 0.75rem 1.9rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.benefits li::before {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: 0.875rem;
  width: 0.4rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--teal);
}

.benefit-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
}

.benefit-text {
  display: block;
  margin-top: 0.125rem;
  font-size: var(--step--1);
  color: var(--on-ink-soft);
}

.auth-brand .mark-threshold {
  position: absolute;
  z-index: 0;
  right: -3rem;
  bottom: -9rem;
  width: 24rem;
  height: 24rem;
  pointer-events: none;
}

.mark-threshold .mark-ring {
  stroke: rgba(255, 255, 255, 0.045);
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, var(--white) 0%, var(--mist) 100%);
}

.auth-panel {
  width: 100%;
  max-width: 23rem;
}

.panel-title {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

.auth-panel .stack {
  margin-top: 1.75rem;
}

.auth-panel .button-primary {
  width: 100%;
}

.auth-foot {
  margin-top: 2.5rem;
  font-size: 0.8125rem;
  color: var(--slate);
  text-align: center;
}

.steps {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
}

.steps > li {
  padding-left: 0.375rem;
}

.steps > li + li {
  margin-top: 1.375rem;
}

.steps .stack {
  margin-top: 0.875rem;
}

.qr-frame {
  width: 11.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.qr {
  display: block;
  width: 100%;
  height: auto;
}

.secret {
  margin-top: 0.25rem;
  font-size: var(--step--1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

/* ---- signed-in shell ----------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 15.5rem 1fr;
  min-height: 100vh;
}

/* The side menu: the brand's ink, with the sections in named groups. */
.rail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 1.25rem 0.875rem 1rem;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-glow) 100%);
  color: var(--on-ink);
}

.rail-brand {
  padding: 0.25rem 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.rail-group {
  padding: 1.125rem 0.75rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-ink-faint);
}

.rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5625rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  color: var(--on-ink);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

a.rail-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.rail-item.is-current {
  border-left-color: var(--teal);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-weight: 600;
}

.rail-item.is-unbuilt {
  color: var(--on-ink-faint);
}

.rail-foot {
  margin-top: auto;
  font-size: var(--step--1);
  color: var(--on-ink-faint);
}

.tag {
  font-size: 0.75rem;
  color: var(--slate);
}

.rail .tag {
  color: var(--on-ink-faint);
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  padding: 0.625rem clamp(1.5rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.topbar-title {
  font-weight: 700;
  color: var(--ink);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.who {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.who-initial {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-right: 0.625rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: var(--step--1);
  font-weight: 700;
}

.role {
  margin-left: 0.5rem;
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--slate);
}

.content {
  padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem);
}

.card {
  max-width: 44rem;
  margin-top: 1.75rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.card h2 + p {
  margin-top: 0.5rem;
}

.card p {
  color: var(--slate);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem;
  margin: 0;
}

.facts dt {
  font-size: 0.8125rem;
  color: var(--slate);
}

.facts dd {
  margin: 0.125rem 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-head h1,
.content > h1 {
  font-size: 2.2rem;
}

.crumb {
  margin-bottom: 0.5rem;
  font-size: var(--step--1);
}

.search {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 44rem;
  margin-top: 1.5rem;
}

.search .field {
  flex: 1 1 16rem;
}

.search .field input {
  background: var(--white);
}

.search a {
  padding-bottom: 0.75rem;
  font-size: var(--step--1);
}

.search-hint {
  max-width: 44rem;
  margin-top: 0.5rem;
}

.records {
  width: 100%;
  max-width: 56rem;
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  border-spacing: 0;
  background: var(--white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.records th,
.records td {
  padding: 0.75rem 1.25rem;
  text-align: left;
}

/* Column headings: a band in the brand's ink across the top of the table. */
.records thead th {
  background: var(--ink);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-ink-soft);
}

/* A heading at the start of a row (the permissions table) reads as text. */
.records tbody th {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
}

.records tbody tr + tr td,
.records tbody tr + tr th {
  border-top: 1px solid var(--line);
}

.records tbody tr:hover {
  background: var(--field);
}

.records a {
  font-weight: 600;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.form-narrow {
  max-width: 26rem;
  margin-top: 1.5rem;
}

.form-narrow .field input {
  background: var(--white);
}

.optional {
  font-weight: 400;
  color: var(--slate);
}

.field.has-error input {
  border-color: var(--danger);
}

.field-error {
  margin-top: 0.375rem;
  font-size: var(--step--1);
  color: var(--danger);
}

.field select {
  display: block;
  width: 100%;
  height: var(--control-height);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.field.has-error select {
  border-color: var(--danger);
}

.day-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.day-name {
  min-width: 15rem;
  font-weight: 600;
  text-align: center;
}

.section-head {
  max-width: 56rem;
  margin-top: 2.5rem;
}

.section-head h2 {
  font-size: var(--step-2);
}

.card-lead {
  margin-top: 0;
}

.row-action {
  text-align: right;
}

.records td.row-action {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

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

/* ---- brand guide --------------------------------------------------------- */

.guide-main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 4rem;
}

.guide-main > h1 {
  font-size: var(--step-3);
}

.guide-section {
  margin-top: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.guide-section > h2 {
  font-size: var(--step-2);
}

.guide-section > p {
  margin-top: 0.5rem;
  color: var(--slate);
}

.logo-row {
  display: grid;
  grid-template-columns: 5fr 5fr 3fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.logo-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  min-height: 11rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.logo-tile-mist {
  background: var(--mist);
}

.logo-tile-white {
  background: var(--white);
}

.logo-tile-ink {
  border-color: var(--ink);
  background: radial-gradient(120% 90% at 15% 0%, var(--ink-glow) 0%, var(--ink) 62%);
}

.caption {
  font-size: 0.8125rem;
  color: var(--slate);
}

.logo-tile-ink .caption {
  color: var(--on-ink-soft);
}

.swatches {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.swatch {
  display: grid;
  grid-template-columns: 3.5rem 8rem 6rem 1fr 12rem;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.swatch:last-child {
  border-bottom: 0;
}

.swatch-chip {
  width: 3.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.swatch-ink {
  background: var(--ink);
}

.swatch-teal {
  background: var(--teal);
}

.swatch-teal-deep {
  background: var(--teal-deep);
}

.swatch-mist {
  background: var(--mist);
}

.swatch-slate {
  background: var(--slate);
}

.swatch-white {
  background: var(--white);
}

.swatch-name {
  font-weight: 700;
}

.swatch-hex,
.swatch-contrast {
  font-variant-numeric: tabular-nums;
}

.swatch-usage,
.swatch-contrast {
  font-size: var(--step--1);
  color: var(--slate);
}

.type-samples {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.type-row {
  display: grid;
  grid-template-columns: 15rem 1fr;
  align-items: baseline;
  gap: 1rem;
  max-width: none;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}

.type-row:last-child {
  border-bottom: 0;
}

.type-meta {
  font-size: var(--step--1);
  color: var(--slate);
}

.sample-display-large {
  font-family: var(--font-display);
  font-size: var(--step-3);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.sample-display {
  font-family: var(--font-display);
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

.sample-display-small {
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.sample-label {
  font-size: var(--step--1);
  font-weight: 600;
}

.sample-hint {
  font-size: var(--step--1);
  color: var(--slate);
}

.sample-data {
  font-size: var(--step-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.guide-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.guide-columns .notice:first-child {
  margin-top: 0;
}

.guide-main > .auth-foot {
  text-align: left;
}

/* ---- small screens ------------------------------------------------------- */

@media (max-width: 54rem) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 0;
    padding: 1.25rem 1.5rem;
  }

  .auth-brand h1,
  .auth-tagline,
  .auth-brand .eyebrow,
  .benefits,
  .auth-brand .mark-threshold {
    display: none;
  }

  .auth-main {
    justify-content: flex-start;
    min-height: 0;
    padding: 2.5rem 1.5rem;
  }

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

  .shell {
    min-height: 0;
  }

  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
  }

  .rail-brand {
    width: 100%;
    padding: 0.25rem 0.5rem 0.625rem;
    margin-bottom: 0.25rem;
  }

  .rail-item {
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 0.4375rem 0.625rem;
  }

  .rail-item.is-current {
    border-bottom-color: var(--teal);
  }

  .rail-group,
  .rail-item.is-unbuilt,
  .topbar-title,
  .role {
    display: none;
  }

  .topbar {
    justify-content: flex-end;
  }

  .rail-foot {
    margin-top: 0;
  }

  .logo-row,
  .guide-columns {
    grid-template-columns: 1fr;
  }

  .swatch {
    grid-template-columns: 3.5rem 1fr 6rem;
  }

  .swatch-usage,
  .swatch-contrast {
    grid-column: 2 / -1;
  }

  .type-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---- patient pages ------------------------------------------------------- */
/* What a patient sees from a visit link: one quiet column, usually on a phone. */

.patient {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--white) 0%, var(--mist) 100%);
}

.patient-head {
  padding: 1.5rem clamp(1.25rem, 5vw, 2.5rem);
}

.patient-main {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 6vh, 4rem) 1.25rem 2rem;
}

.patient-main h1 {
  font-size: 2.2rem;
}

.patient-main .lede {
  margin-top: 0.5rem;
}

.patient-main .lede + p,
.patient-main .notice,
.patient-main .stack {
  margin-top: 1.5rem;
}

.patient-main .button-primary {
  width: 100%;
}

.patient-main .hint {
  margin-top: 1.25rem;
}

.patient-foot {
  /* Paragraphs are capped at a reading width; this one spans the page so its
     centred text sits under the column above it. */
  max-width: none;
  padding: 0 1.25rem 2rem;
  font-size: 0.8125rem;
  color: var(--slate);
  text-align: center;
}

.facts-stacked {
  grid-template-columns: 1fr;
}

/* ---- the link staff copy ------------------------------------------------- */

.link-field {
  margin-top: 1.25rem;
}

.link-field input {
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.plain-list {
  margin: 1.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--slate);
}

.plain-list li + li {
  margin-top: 0.4rem;
}

.records td.row-action form {
  display: inline-block;
}

.records td.row-action form + form {
  margin-left: 0.25rem;
}

/* ---- admin area ----------------------------------------------------------- */

.status-ok {
  background: var(--ok-wash);
  color: var(--teal-deep);
}

.status-waiting {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--slate);
}

.status + .status {
  margin-left: 0.375rem;
}

/* The heading row lines up with the table beneath it, however wide the window. */
.page-head {
  max-width: 56rem;
}

.nowrap {
  white-space: nowrap;
}

.wrap-anywhere {
  overflow-wrap: anywhere;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  max-width: 56rem;
  margin-top: 1.75rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
}

a.tile:hover {
  border-color: var(--teal);
}

.tile.is-unbuilt {
  background: transparent;
  box-shadow: none;
}

.tile-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.tile-text {
  font-size: var(--step--1);
  color: var(--slate);
}

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

.card .stack,
.card .inline-form,
.card .action-list {
  margin-top: 1rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.inline-form .field {
  flex: 1 1 12rem;
  max-width: 16rem;
}

.action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.875rem 0;
}

.action + .action {
  border-top: 1px solid var(--line);
}

.action p {
  flex: 1 1 18rem;
}

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

/* ---- provider profile ------------------------------------------------------ */

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.plain-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

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

.list-entries li:first-child {
  padding-top: 0;
}

.list-entries li:last-child {
  border-bottom: 0;
}

.card > .list-entries + .inline-form {
  margin-top: 0.5rem;
}

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

.list-entry {
  flex: 1 1 14rem;
  overflow-wrap: anywhere;
}

.card .list-none {
  margin-top: 0.75rem;
}

.record-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
}

.record-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.record-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 1.25rem 0 1.5rem;
}

.record-filters .field {
  flex: 0 1 13rem;
  min-width: 9rem;
  margin: 0;
}

.record-filters select,
.record-filters input {
  width: 100%;
}

.record-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.form-section {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.form-section legend {
  float: left;
  width: 100%;
  padding: 0;
  font-weight: 600;
  font-size: var(--step-0, 1rem);
}

.form-section legend + * {
  clear: both;
}

.plain-fieldset:disabled input,
.plain-fieldset:disabled select {
  background: var(--mist);
  color: var(--ink);
  opacity: 1;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem 1.25rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.check input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.2rem;
  accent-color: var(--teal-deep);
}

.records-inset {
  max-width: none;
  margin-top: 1rem;
  box-shadow: none;
}

.card > .inline-form {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.card > .records-inset + .inline-form,
.card > p + .inline-form {
  margin-top: 1.25rem;
}

/* A table inside a card scrolls sideways on a narrow screen instead of
   pushing the whole page wider than the phone. */
.table-scroll {
  /* "relative" so that hidden labels inside the table (positioned absolutely)
     are clipped with it rather than widening the page. */
  position: relative;
  max-width: 100%;
  overflow-x: auto;
}

.card {
  min-width: 0;
}

/* The main column may shrink to the screen. Without this a wide table inside
   it sets a minimum width for the whole page. */
.content {
  min-width: 0;
}

/* ---- permissions table, and small spacing fixes ---------------------------- */

.permissions th[scope="row"] {
  font-weight: 400;
  text-align: left;
}

.yes-no {
  width: 7rem;
  text-align: center;
  white-space: nowrap;
}

.is-yes {
  color: var(--teal-deep);
  font-weight: 600;
}

.is-no {
  color: var(--slate);
}

.empty-note {
  margin-top: 1rem;
}

.card-note + .empty-note {
  margin-top: 0.75rem;
}

.row-note {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: var(--step--1);
  color: var(--slate);
}

/* ---- reports ------------------------------------------------------------- */

.period-nav .day-name {
  min-width: 17rem;
}

.report th.count,
.report td.numeric {
  width: 7rem;
  text-align: right;
  white-space: nowrap;
}

.report th[scope="row"] {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
}

.report tbody th[scope="row"] {
  border-bottom: 0;
}

.report tbody tr + tr th {
  border-top: 1px solid var(--line);
}

.report tfoot th,
.report tfoot td {
  border-top: 2px solid var(--line);
  border-bottom: 0;
  background: var(--field);
  font-weight: 600;
  color: var(--ink);
}

.facts-counts {
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.facts-counts dd {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 400;
}

.plain-list {
  max-width: 56rem;
}

/* ---- attendance ---------------------------------------------------------- */

.records td.attendance {
  white-space: nowrap;
}

/* One to a line: with the waiting room there can be three, and side by side
   they pushed the buttons off the page. */
.records td.attendance .status {
  display: flex;
  width: max-content;
}

.records td.attendance .start-visit {
  margin-top: var(--space-2, 0.5rem);
}

.records td.attendance .status + .status {
  margin-left: 0;
  margin-top: var(--space-1, 0.25rem);
}

/* The visit list carries an attendance column and up to three buttons, so it
   may be wider than other tables, and its short cells never wrap. */
.records.visits {
  max-width: 72rem;
}

.records.visits th,
.records.visits td {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  white-space: nowrap;
}

/* The buttons may wrap onto a second line; nothing else in a row does. */
/* Narrow enough that the buttons stack, so the whole table fits beside the
   menu at 1280 now that there is a Note column. */
.records.visits td.row-action {
  min-width: 9.5rem;
  white-space: normal;
}

.records.visits td.row-action .button {
  white-space: nowrap;
}

.records.visits td.row-action form {
  margin: 0.125rem 0 0.125rem 0.25rem;
}

/* ---- settings: patient forms --------------------------------------------- */

.field textarea {
  display: block;
  width: 100%;
  min-height: 5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.field textarea:hover {
  border-color: var(--slate);
}

.field.has-error textarea {
  border-color: var(--danger);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--field);
  cursor: default;
}

.form-narrow-field {
  max-width: 26rem;
}

.card h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
}

.question-card {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
}

.question-card .field input {
  background: var(--white);
}

.question-new {
  border-style: dashed;
}

.question-number {
  margin-bottom: 0.75rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--slate);
}

.question-grid .field-wide {
  grid-column: 1 / -1;
}

.question-tools {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.records.forms td.form-name {
  font-weight: 600;
  white-space: nowrap;
}

.records.forms td.row-action form {
  display: inline-block;
  margin: 0.125rem 0 0.125rem 0.25rem;
}

.options-box summary {
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 600;
}

.options-box[open] summary {
  margin-bottom: 0.5rem;
}

.form-preview {
  max-width: 44rem;
}

.form-words {
  white-space: pre-line;
}

.form-words + .form-words,
.form-question {
  margin-top: 1rem;
}

/* ---- the patient's forms ------------------------------------------------- */

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

.form-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 0;
}

.form-list li + li {
  border-top: 1px solid var(--line);
}

.form-list-name {
  font-weight: 600;
}

.patient-form .card {
  margin-top: 0;
}

.patient-main .crumb {
  margin-bottom: 0.5rem;
}

.answers dd {
  font-weight: 400;
}

.records.patient-forms td.row-action {
  text-align: right;
}

/* ---- visit notes ---------------------------------------------------------- */

.notice + .note-state {
  margin-top: 1rem;
}

.note-state {
  margin: 0 0 1rem;
  color: var(--slate);
}

.note-form .field textarea {
  min-height: 8rem;
}

.note-form .field + .field {
  margin-top: 1.25rem;
}

.note-read h2,
.note-read h3 {
  margin: 1.25rem 0 0.375rem;
  font-family: var(--font-text);
  font-size: var(--step-0);
  font-weight: 600;
}

.note-read h2:first-child,
.note-read h3:first-child {
  margin-top: 0;
}

/* A draft written by a machine, shown apart from the provider's own note. */
.ai-draft .note-read {
  margin: 1rem 0 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--line, #d0d5dd);
}

.ai-draft form {
  margin-bottom: 0.75rem;
}

.note-read .form-words {
  margin: 0;
}

.note-sign .button {
  margin-top: 1rem;
}

.note-addendum + .note-addendum {
  margin-top: 0.75rem;
}

.note-addendum .row-note {
  margin: 0.5rem 0 0;
}

/* ---- protocols and treatments ---------------------------------------------- */

/* The library page is wider than the rest: cards in a grid need the room.
   Everything on it shares one width, so nothing runs past anything else. */
.kb-head,
.kb-tiles,
.kb-find,
.kb-chips,
.kb-cards {
  max-width: 76rem;
}

.kb-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.kb-tile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.kb-tile-attention {
  border-top-color: var(--amber);
}

.kb-tile-label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--slate);
}

.kb-tile-number {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kb-tile-note {
  font-size: var(--step--1);
  color: var(--slate);
}

.kb-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.kb-tabs a,
.kb-chips a {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.kb-tabs a {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
}

.kb-tabs a[aria-current],
.kb-chips a[aria-current] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.kb-tabs a:hover,
.kb-chips a:hover {
  border-color: var(--teal);
}

.kb-find {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.kb-find .field,
.kb-find select,
.kb-find input {
  min-width: 0;
}

/* Narrow: the search box takes a row to itself. Wide: one row for everything. */
.kb-find .kb-search {
  grid-column: 1 / -1;
}

@media (min-width: 64rem) {
  .kb-find {
    grid-template-columns: minmax(14rem, 2.5fr) repeat(auto-fit, minmax(9.5rem, 1fr));
  }

  .kb-find .kb-search {
    grid-column: auto;
  }
}

.kb-find-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.kb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.kb-chips a {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: var(--step--1);
  text-transform: capitalize;
}

.kb-cards {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.kb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.kb-card:hover,
.kb-card:focus-within {
  border-color: var(--teal);
}

.kb-card.is-off {
  background: transparent;
  box-shadow: none;
}

.kb-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.kb-badge {
  padding: 0.1rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.kb-badge-approved {
  color: var(--teal-deep);
  background: var(--ok-wash);
}

.kb-badge-compounded {
  color: var(--ink-glow);
  background: var(--field);
}

.kb-badge-research {
  color: var(--amber);
  background: var(--amber-wash);
}

.kb-badge-supplement,
.kb-badge-other {
  color: var(--slate);
  background: var(--white);
}

.kb-evidence {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--slate);
}

.kb-card-name {
  font-family: var(--font-text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.kb-card-name a {
  color: var(--ink);
  text-decoration: none;
}

/* The whole card is the link, by way of the name. */
.kb-card-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
}

.kb-card-category {
  font-size: 0.75rem;
  color: var(--slate);
  text-transform: capitalize;
}

/* At most three lines on a card; the whole text is on the entry's page. */
.kb-card-uses {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--slate);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.kb-card-foot {
  margin-top: auto;
  padding-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.kb-card-foot .status {
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
}

.kb-card-foot .status + .status {
  margin-left: 0;
}


.kb-count {
  margin-top: 1rem;
}

/* One treatment or one protocol. */
.kb-entry {
  max-width: 76rem;
}

.kb-entry > .notice,
.kb-entry > .lede {
  max-width: 56rem;
}

.kb-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.kb-tag {
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
}

/* Reference text is read closely and there is a lot of it: one size
   smaller than the rest of the site, and closer set. */
.kb-entry {
  --kb-gap: 0.75rem;
}

/* Panels pack by height into as many columns as fit, so a long panel
   does not leave tall empty boxes beside it. */
.kb-panels {
  columns: 19rem;
  column-gap: var(--kb-gap);
  margin-top: 1.25rem;
}

.kb-panel,
.kb-block {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
  overflow-wrap: break-word;
  min-width: 0;
  font-size: var(--step--1);
  line-height: 1.45;
}

.kb-panel {
  break-inside: avoid;
  margin-bottom: var(--kb-gap);
}

.kb-block {
  margin-top: var(--kb-gap);
}

.kb-panels + .kb-block {
  margin-top: 0;
}

.kb-panel h2,
.kb-block h2 {
  margin-bottom: 0.35rem;
  font-family: var(--font-text);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--teal-deep);
}

.kb-panel p,
.kb-block p,
.kb-lines li {
  white-space: pre-wrap;
}

.kb-lines {
  margin: 0;
  padding-left: 1.1rem;
}

.kb-lines li + li {
  margin-top: 0.15rem;
}

.kb-folded {
  margin-top: 0.5rem;
}

.kb-folded summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-deep);
}

.kb-folded .kb-lines {
  margin-top: 0.35rem;
}

.kb-sub {
  margin: 0.6rem 0 0.15rem;
  font-family: var(--font-text);
  font-size: var(--step--1);
  font-weight: 600;
}

.kb-sub:first-of-type {
  margin-top: 0;
}

/* Tone is carried by the edge and the heading together with the title's
   own words ("Cautions", "Contraindications"), never by colour alone. */
.kb-tone-caution {
  border-left: 4px solid var(--amber);
  background: var(--amber-wash);
}

.kb-tone-caution h2 {
  color: var(--amber);
}

.kb-tone-danger {
  border-left: 4px solid var(--danger);
}

.kb-tone-danger h2 {
  color: var(--danger);
}

.kb-tone-info {
  border-left: 4px solid var(--teal);
}

/* Each label sits above its value: a dose can run to several lines and
   needs the panel's whole width. */
.kb-facts {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.kb-facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
}

.kb-source dt {
  font-size: var(--step--1);
  color: var(--slate);
}

.kb-facts dd,
.kb-source dd {
  margin: 0;
}

.kb-schedule {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.kb-schedule li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.4rem 0.75rem;
}

.kb-schedule li + li {
  border-top: 1px solid var(--line);
}

.kb-when {
  font-weight: 700;
  color: var(--teal-deep);
}

.kb-what {
  grid-column: 2;
}

@media (max-width: 34rem) {
  .kb-schedule li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .kb-what {
    grid-column: 1;
  }
}

.kb-source {
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.kb-source div {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.kb-unreviewed {
  background: var(--amber-wash);
  border-color: #E8CF9A;
  color: var(--amber);
}

.kb-refs {
  margin: 0;
  padding-left: 1.25rem;
}

.kb-refs li + li {
  margin-top: 0.5rem;
}

.kb-refs a {
  overflow-wrap: anywhere;
}

.kb-manage form {
  display: inline-block;
  margin: 0 0.5rem 0.5rem 0;
}

.field input[type="file"] {
  height: auto;
  padding: 0.625rem 0.75rem;
}

/* What an order offers to add to a chart: one tick per line. */
.order-offers {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.tick {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  overflow-wrap: anywhere;
}

.tick input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
}

.tick-off {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 2rem;
  color: var(--slate);
}


/* ---- the second look (batch 0062): tiles, pills and settings cards ------- */

.tile {
  border-bottom: 3px solid var(--teal);
}

.tile.is-unbuilt {
  border-bottom-color: var(--line);
}

h2 .tag,
h1 .tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  background: var(--ok-wash);
  color: var(--teal-deep);
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.card h2 + .facts {
  margin-top: 0.875rem;
}

.card details {
  margin-top: 1.125rem;
}

.card details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-deep);
}

.card details[open] > summary {
  margin-bottom: 0.875rem;
}

.card > .inline-form + .inline-form,
.card details + .inline-form {
  margin-top: 1.125rem;
}

/* Working hours beside the provider chooser on the booking form. */
.hours-list { margin-bottom: 1.25rem; }
.field-label { margin: 0 0 0.375rem; font-size: var(--step--1); font-weight: 600; }

/* ---- the video visit (batch 0080) ------------------------------------------------------- */

/* The patient's pages are a narrow column, right for reading and too small for a face. */
.patient-main.patient-main-wide {
  max-width: 64rem;
}

.patient-main-wide .video-controls .button-primary {
  width: auto;
}

/* The provider's visit screen: the video, and the note beside it. */
.visit-screen {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
  gap: var(--space-4, 1rem);
  align-items: start;
}

.visit-screen .video-visit {
  margin-top: 0;
}

.visit-screen-note textarea {
  width: 100%;
}

.note-status {
  margin: var(--space-2, 0.5rem) 0;
  font-weight: 600;
}

.note-status.is-wrong {
  color: var(--danger, #9b1c1c);
}

@media (max-width: 1100px) {
  .visit-screen {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Ending a visit: asked twice, without leaving the page or a pop-up. */
.end-visit {
  margin: var(--space-4, 1rem) 0;
}

.end-visit summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
}

.end-visit summary::-webkit-details-marker {
  display: none;
}

.end-visit form {
  margin-top: var(--space-3, 0.75rem);
  max-width: 40rem;
}

/* A button that cannot be pressed yet has to look it. */
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.video-visit {
  margin: var(--space-4, 1rem) 0;
}

.video-status {
  font-weight: 600;
  margin: 0 0 var(--space-3, 0.75rem);
  min-height: 3em;
}

.video-stage {
  position: relative;
  background: #101820;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  max-height: 70vh;
}

.video-them,
.video-them video {
  width: 100%;
  height: 100%;
}

.video-stage video {
  display: block;
  object-fit: cover;
  background: #101820;
}

.video-me {
  position: absolute;
  right: var(--space-3, 0.75rem);
  bottom: var(--space-3, 0.75rem);
  width: 26%;
  min-width: 96px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.video-me video {
  width: 100%;
  height: 100%;
  transform: scaleX(-1);   /* as in a mirror, which is how people expect to see themselves */
}

.video-label {
  position: absolute;
  left: var(--space-2, 0.5rem);
  bottom: var(--space-2, 0.5rem);
  margin: 0;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  background: rgba(16, 24, 32, 0.7);
  color: #fff;
  font-size: 0.85rem;
}

.video-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 0.5rem);
  margin: var(--space-3, 0.75rem) 0;
}

.video-controls [hidden] {
  display: none;
}

@media (max-width: 480px) {
  .video-stage {
    aspect-ratio: 3 / 4;
  }
}

/* Consult guides: four short lists side by side where there is room. */
.guide-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.guide-list h2 {
  margin-bottom: 0.625rem;
}

.guide-list ul {
  margin: 0;
  padding-left: 1.25rem;
}

.guide-list li + li {
  margin-top: 0.375rem;
}

.guide-switch {
  margin-top: 1.5rem;
}

/* The clinic's guides, then a provider's own: each part stands clear of the one above. */
.guides-part {
  margin-top: 2.25rem;
}

h2.guides-part {
  margin-bottom: 0.75rem;
}

/* A visit's checklist: each line is a tick box the size of a comfortable tap. */
.checklist-guide + .checklist-guide,
.checklist-add {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.checklist h3 {
  margin: 0 0 0.25rem;
}

.checklist h4 {
  margin: 1rem 0 0.375rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--slate);
}

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

.tick-list li + li {
  margin-top: 0.25rem;
}

/* A tick box is a one-button form: it must fill its line, not sit in a grid of hidden fields. */
form.tick {
  display: block;
}

.tick-text {
  flex: 1 1 auto;
  min-width: 0;
}

.tick-box {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

button.tick-box:hover {
  border-color: var(--line);
}

.tick-box.is-closed {
  cursor: default;
}

.tick-mark {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  border: 2px solid var(--slate);
  border-radius: 0.25rem;
}

.tick-box.is-ticked .tick-mark {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
  box-shadow: inset 0 0 0 2px var(--white);
}

.tick-box.is-ticked .tick-text {
  color: var(--slate);
}

.checklist-off {
  margin-top: 0.75rem;
}

.visit-screen-video .checklist {
  margin-top: 1.25rem;
}

/* At signing: the checklist lines that were not ticked. */
.not-covered {
  margin-bottom: 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--mist);
}

.not-covered ul {
  margin: 0.25rem 0 0.75rem;
  padding-left: 1.25rem;
}

.not-covered .row-note {
  margin: 0.5rem 0 0;
}

.not-covered-list {
  color: var(--slate);
}

.not-covered .check {
  margin: 0.75rem 0 0;
  padding-left: 0;
}

.not-covered .field-error {
  color: var(--danger);
  font-weight: 600;
}

/* The visit's chief complaint, at the top of its checklist: a short field and its button on one line. */
.complaint-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.complaint-form .field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

/* Tasks from a visit, on the note's page. */
.task-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.task {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.task:first-child {
  border-top: 0;
}

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

.task-title {
  margin: 0;
  font-weight: 600;
}

.task-done .task-title,
.task-cancelled .task-title {
  font-weight: 400;
  color: var(--slate);
}

.task-detail {
  margin: 0.25rem 0 0;
  white-space: pre-line;
}

.task-acts {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.task-add h3 {
  margin: 0 0 0.75rem;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(8.5rem, 1fr) minmax(9.5rem, 1fr);
  gap: 0.75rem;
}

@media (max-width: 700px) {
  .task,
  .task-acts {
    flex-direction: column;
  }

  .task-row {
    grid-template-columns: 1fr;
  }
}

.task-add .field {
  margin-bottom: 0.75rem;
}

.task-add .task-row .field {
  margin-bottom: 0.25rem;
}

.task-add > .hint {
  margin: 0.25rem 0 0.75rem;
}

.task-add {
  margin-top: 1rem;
}

/* The page of tasks: the task's own words get the room. */
.tasks-table th:first-child,
.tasks-table td:first-child {
  width: 30%;
  min-width: 13rem;
}

.tasks-table .task-detail {
  margin: 0.25rem 0 0;
  white-space: pre-line;
}

/* The public form where a provider asks to join. */
.join-form .field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.join-form fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}

.join-form legend {
  padding: 0;
  font-weight: 600;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr));
  gap: 0.375rem 0.5rem;
  margin-top: 0.5rem;
}

.state-grid .check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-weight: 400;
}

.state-grid .check input {
  flex: 0 0 auto;
  margin: 0;
}

/* A field no person is meant to see or reach. Kept off the screen rather
   than hidden outright, since some programs skip fields that are hidden. */
.not-for-people {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 520px) {
  .join-form .field-pair {
    grid-template-columns: 1fr;
  }
}

.signup-note {
  white-space: pre-line;
}

/* Passing a task to someone else, on the page of tasks: a short picker and its button, under "Mark done". */
.tasks-table .task-do {
  min-width: 10.5rem;
}

.tasks-table .task-do .button {
  white-space: nowrap;
}

.task-pass {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  margin-top: 0.625rem;
}

.task-pass .field {
  margin: 0;
  width: 100%;
}

.task-pass select {
  width: 100%;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  font-size: 0.875rem;
}

/* A server for trying the product: every page says so, on every layout.
   It stays at the top while the page scrolls, and spans the whole width
   where the page's body is a grid. */
.test-system {
  position: sticky;
  top: 0;
  z-index: 50;
  grid-column: 1 / -1;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.5rem 1rem;
  background: #7a4b00;
  color: #fff;
  font-size: 0.9375rem;
  text-align: center;
}
