:root {
  color-scheme: light;
  --font-head: 'Poppins', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --font-body: 'Lato', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-2: #EEF4FF;
  --text: #0B1220;
  --muted: #64748B;
  --placeholder: #5B6B80;
  --line: #E1E8F2;
  --line-strong: #B9C8DD;
  --field-border: #64748B;
  --accent: #0D6EFD;
  --accent-ink: #145A9B;
  --accent-hover: #0B5ED7;
  --on-accent: #FFFFFF;
  --halo: #F59E0B;
  --focus-ring: #B45309;
  --on-halo: #0B1220;
  --focus-inner: #0B1220;
  --focus-gap: #FFFFFF;
  --sky: #02D5FF;
  --ok: #166534;
  --ok-bg: #E6F6EC;
  --warn-ink: #92560A;
  --warn-bg: #FFF3DC;
  --danger: #B42318;
  --halo-glow: rgba(245, 158, 11, 0.35);
  --danger-line: rgba(180, 35, 24, 0.45);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1222;
  --surface: #111B2F;
  --surface-2: #16233D;
  --text: #F1F5F9;
  --muted: #A3B0C4;
  --placeholder: #A3B0C4;
  --line: #22304A;
  --line-strong: #34466A;
  --field-border: #7C8DB0;
  --accent: #1F6FEB;
  --accent-ink: #7DB3FF;
  --accent-hover: #1A5FD0;
  --on-accent: #FFFFFF;
  --halo: #F59E0B;
  --focus-ring: #F59E0B;
  --on-halo: #0B1220;
  --focus-inner: transparent;
  --focus-gap: transparent;
  --ok: #6EE7A0;
  --ok-bg: #12352A;
  --warn-ink: #FCD38A;
  --warn-bg: #3A2A10;
  --danger: #FF8A80;
  --halo-glow: rgba(245, 158, 11, 0.35);
  --danger-line: rgba(255, 138, 128, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A1222;
    --surface: #111B2F;
    --surface-2: #16233D;
    --text: #F1F5F9;
    --muted: #A3B0C4;
    --placeholder: #A3B0C4;
    --line: #22304A;
    --line-strong: #34466A;
    --field-border: #7C8DB0;
    --accent: #1F6FEB;
    --accent-ink: #7DB3FF;
    --accent-hover: #1A5FD0;
    --on-accent: #FFFFFF;
    --halo: #F59E0B;
    --focus-ring: #F59E0B;
    --on-halo: #0B1220;
    --focus-inner: transparent;
    --focus-gap: transparent;
    --ok: #6EE7A0;
    --ok-bg: #12352A;
    --warn-ink: #FCD38A;
    --warn-bg: #3A2A10;
    --danger: #FF8A80;
    --halo-glow: rgba(245, 158, 11, 0.35);
    --danger-line: rgba(255, 138, 128, 0.45);
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  /* A word wider than the line (Dashboard in an h1 at 200% text on a 320 px screen) breaks inside itself, so it never pushes the page sideways. break-word, not anywhere: it leaves the narrowest width a flex item may shrink to (its longest word) as it was. */
  overflow-wrap: break-word;
}

a {
  color: var(--accent-ink);
}

/* The wordmark and the tagline: the two italic faces of ADR 0129. */
.logo {
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
}

.tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 700;
  color: var(--muted);
}

/* One focus ring on every page and in both schemes: an outline in --focus-ring, 3 px at a 3 px offset, with a soft glow of the brand's halo. --focus-ring is not --halo (issue #884): the
   halo is 2.06 to 1 on a light page, so light has a darker amber of the same family and dark keeps the halo's value. In light, three rings out from the element's edge: a 1 px
   white gap, a 2 px Midnight ring, then the outline at its 3 px offset touching the Midnight one. The gap keeps the Midnight ring off the element's own fill and border.
   In dark --focus-gap and --focus-inner are transparent and the outline stands alone. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--focus-gap), 0 0 0 3px var(--focus-inner), 0 0 12px 4px var(--halo-glow);
}

/* The same ring for an element a script focuses (a message or heading with tabindex="-1" that takes focus when there is something to say): the browser may not match
   :focus-visible for focus() after a pointer click, and the person still needs to see where they landed. */
[tabindex="-1"]:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--focus-gap), 0 0 0 3px var(--focus-inner), 0 0 12px 4px var(--halo-glow);
}

/* Buttons: pills of 44 px at least. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
}

.btn:not(:disabled):not([aria-disabled="true"]):hover {
  filter: brightness(0.92);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 0.875rem;
}

/* The large size: the one action of a page that the person has come to press (the Dashboard's "I'm Still Here"). */
.btn-lg {
  min-height: 56px;
  padding: 14px 40px;
  font-size: 1.15rem;
}

.btn-secondary,
.btn-outline {
  background: transparent;
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}

.btn-secondary:not(:disabled):not([aria-disabled="true"]):hover,
.btn-outline:not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--surface-2);
  filter: none;
}

.btn-quiet {
  background: transparent;
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-quiet:not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--surface-2);
  filter: none;
}

.btn-danger {
  background: transparent;
  border-color: var(--danger-line);
  color: var(--danger);
}

.btn-danger:not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--surface-2);
  filter: none;
}

/* Disabled: 45% opacity. Opacity fades the element's own outline and glow too, and an aria-disabled button stays focusable, so it is not applied while the button has focus: the ring stays at full strength, and a focused one is drawn with a dashed ring and the surface-2 fill instead (on a .btn-secondary or .btn-outline in light, the fill, label colour and dashed ring each change under 3 to 1 and the solid Midnight ring stays the indicator, so the dashed shape is the signal; a .btn-quiet also gains an accent-ink edge it does not otherwise have). A natively disabled button cannot take focus. */
.btn:disabled {
  opacity: 0.45;
}

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

.btn[aria-disabled="true"]:not(:focus-visible) {
  opacity: 0.45;
}

.btn[aria-disabled="true"]:focus-visible {
  outline-style: dashed;
  background: var(--surface-2);
  border-color: var(--accent-ink);
  color: var(--text);
}

/* Fields: a 1.5 px outline, a 14 px radius and 44 px at least, the label above and the hint below. */
.form-group > label,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.field,
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--field-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
}

.form-group textarea {
  min-height: 96px;
  resize: vertical;
}

/* A disabled field (issue #751): the muted --surface-2 fill, a dashed edge and a not-allowed cursor say it cannot be changed. The value stays --text, 16.96 to 1 on that fill in light and 14.28 to 1 in dark (1.4.3 asks 4.5), so the browser's own fade is set back: opacity for the iOS and Android defaults, -webkit-text-fill-color for Safari. The edge keeps --field-border. */
.field:disabled,
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea):disabled {
  border-style: dashed;
  background: var(--surface-2);
  color: var(--text);
  opacity: 1;
  -webkit-text-fill-color: var(--text);
  cursor: not-allowed;
}

/* The placeholder (issue #773): --placeholder, 4.5 to 1 or more on --surface (the field's fill) and on --surface-2 (a disabled field's) in both schemes; the browser's own grey (#757575) is 3.73 to 1 on the dark fill. Opacity 1 because Firefox fades the placeholder, which would lower the measured ratio. In forced colours the system sets the colour and GrayText is the fallback. */
.field::placeholder,
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea)::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

/* The placeholder of a disabled field (issue #770): ::placeholder inherits the field's -webkit-text-fill-color, which would draw it in full --text, as if it were a typed value. currentcolor takes the placeholder's own colour, --placeholder above, the same as an enabled field's, so it still reads as a placeholder and is 4.5 to 1 on --surface-2. */
.field:disabled::placeholder,
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea):disabled::placeholder {
  -webkit-text-fill-color: currentcolor;
}

.field-hint,
.field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* An error: a 3 px outline in the danger colour and a bold message tied to the field with aria-describedby. */
.field[aria-invalid="true"],
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea)[aria-invalid="true"] {
  border-color: var(--danger);
  outline: 3px solid var(--danger);
  outline-offset: 0;
}

/* A field with an error still shows the focus outline when it has focus. The outline is --focus-ring; in light it is close in colour to the --danger error outline (1.31 to 1), so the 3 px offset and the white gap and Midnight inner rings, not the colour, tell focus from the error. */
.field[aria-invalid="true"]:focus-visible,
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea)[aria-invalid="true"]:focus-visible {
  outline-color: var(--focus-ring);
  outline-offset: 3px;
}

.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.field-error:empty {
  display: none;
}

@media (forced-colors: active) {
  .field::placeholder,
.form-group :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"])), select, textarea)::placeholder {
    color: GrayText;
  }
}

/* Radios and checkboxes: 20 px, in the accent. */
input[type="radio"],
input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

/* A range: a slider with its label and its value above it (a .form-group holds the .range-head, the .range and the hint). The label is a real <label>, the value is an <output> the script keeps
   (aria-live="off" on it, so a drag does not read out every step) and the script also sets aria-valuetext. The track is outlined in --field-border (3 to 1 on every surface, as a field is) and the thumb is
   --accent on it (3 to 1 on --surface-2, the track), 26 px across and 44 px of height to press, so it is a target of 24 px or more. The focus ring is the sheet's (:focus-visible). */
.range-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.range-head .field-label {
  margin-bottom: 0;
}

.range-value {
  color: var(--accent-ink);
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  white-space: nowrap;
}

.range {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  box-sizing: border-box;
  height: 12px;
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  background: var(--surface-2);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  margin-top: -7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

.range::-moz-range-track {
  box-sizing: border-box;
  height: 12px;
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  background: var(--surface-2);
}

.range::-moz-range-thumb {
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}
/* end of the range */

/* Messages: a surface card with a 5 px edge in the status colour and an icon slot. An error has role="alert", any other role="status". */
.alert {
  --alert-edge: var(--accent-ink);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--alert-edge);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* A live region with nothing in it takes no room, as .field-error does. */
.alert:empty {
  display: none;
}

.alert-icon {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--alert-edge);
  font-size: 1.25rem;
  line-height: 24px;
  text-align: center;
}

.alert-title {
  display: block;
  color: var(--alert-edge);
  font-weight: 700;
}

.alert-info {
  --alert-edge: var(--accent-ink);
}

.alert-ok {
  --alert-edge: var(--ok);
  background: var(--ok-bg);
}

.alert-warn,
.alert-warning {
  --alert-edge: var(--warn-ink);
  background: var(--warn-bg);
}

.alert-error,
.alert-danger {
  --alert-edge: var(--danger);
}

.alert a {
  color: inherit;
  text-decoration: underline;
}

/* The question asked before saving an email or phone that another recipient, or the owner, already has (issue #436): a callout on --warn-bg with --text on it (4.5 to 1 or more in both schemes), and two buttons under it.
   It is in three forms, the Recipients page's, the package page's new-recipient dialog (issue #481, slice D6d) and the Message Packages page's wizard (issue #537), so it is the sheet's. */
.shared-warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-ink);
  color: var(--text);
  padding: 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-top: 15px;
}

/* The buttons in the box have an --accent-ink edge. The primary one is an --accent fill with a transparent edge, and on --warn-bg that fill is 4.1 to 1 in light but 2.98 to 1 in dark (#1F6FEB on #3A2A10), under the 3 to 1 of WCAG 1.4.11 (issue #554). --accent-ink on --warn-bg is 6.4 to 1 in both schemes; the secondary button already has this edge. The fill, the label (4.5 to 1 or more) and the tokens are unchanged. */
.shared-warning .btn {
  border-color: var(--accent-ink);
}

.shared-warning p {
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.shared-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* A toast: a dark pill, the same in both schemes, with a line so it shows on a dark page. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  max-width: min(92vw, 520px);
  padding: 12px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0B1220;
  color: #F9FAFB;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast[hidden] {
  display: none;
}

/* The ring: a count of days drawn as an SVG circle (the Dashboard's countdown). The page gives the .ring box one name with role="img" and aria-label and hides the drawing and the figures from a
   screen reader. The arc is the track's circle with a stroke-dasharray the script sets in hundredths (pathLength="100"), so 80 100 is four fifths. It starts at the top. The colour is the box's: accent-ink,
   or warn-ink or danger when the page says the count is over. Those three are 3 to 1 or more against --surface (the arc on the card), and accent-ink is also 3 to 1 on the --line-strong track. The size is
   in rem, so it grows with the text, and never wider than what holds it. */
.ring {
  position: relative;
  flex: none;
  width: 10rem;
  max-width: 100%;
  aspect-ratio: 1;
  color: var(--accent-ink);
}

.ring-warn {
  color: var(--warn-ink);
}

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

.ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 10;
}

.ring-arc {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
}

.ring-centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text);
}

.ring-number {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

/* A word in the middle (Due, Off, Released) is smaller than a number of days, so it fits the circle. */
.ring-word {
  font-size: 1.25rem;
}

.ring-unit {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 700;
}

.ring-unit[hidden] {
  display: none;
}

/* The arc eases to a new length when the page changes it, for a person who has not asked for less motion. It runs once and does not repeat. */
@media (prefers-reduced-motion: no-preference) {
  .ring-arc {
    transition: stroke-dasharray 0.6s ease;
  }
}
/* end of the ring */

/* The timeline: an ordered list of steps with a line through them (the Dashboard's "What happens next"). A step is a .timeline-step with a .timeline-when (the date), a .timeline-title and a
   .timeline-text. A step that happens only when the person does not answer is .timeline-step-only: its line and its marker are dashed and in --warn-ink, and it carries a .timeline-badge in words, so the
   difference is never colour alone. --warn-ink is 3 to 1 or more on --surface (the line and the marker), and on --warn-bg 4.5 to 1 (the badge). The first step is the one the person is at now
   (.timeline-step-now), its marker filled. A phone gets one column down the left; from 56rem the steps run across, as many to a row as fit, and wrap to the next row. No motion. */
.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline[hidden] {
  display: none;
}

.timeline-step {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0 0 22px 28px;
  border-left: 3px solid var(--accent-ink);
  overflow-wrap: anywhere;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 2px;
  left: -11px;
  box-sizing: border-box;
  width: 19px;
  height: 19px;
  border: 3px solid var(--accent-ink);
  border-radius: 50%;
  background: var(--surface);
}

.timeline-step-now::before {
  background: var(--accent-ink);
}

.timeline-step-only {
  border-left-style: dashed;
  border-left-color: var(--warn-ink);
}

.timeline-step-only::before {
  border-style: dashed;
  border-color: var(--warn-ink);
  background: var(--warn-bg);
}

.timeline-when {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.timeline-title {
  display: block;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.3;
}

.timeline-text {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.timeline-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border: 1px dashed var(--warn-ink);
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

@media (min-width: 56rem) {
  .timeline {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 28px 0;
  }

  .timeline-step {
    padding: 22px 16px 0 0;
    border-left: 0;
    border-top: 3px solid var(--accent-ink);
  }

  .timeline-step:last-child {
    padding-bottom: 0;
  }

  .timeline-step::before {
    top: -11px;
    left: 0;
  }

  .timeline-step-only {
    border-top-style: dashed;
    border-top-color: var(--warn-ink);
  }
}
/* end of the timeline */

/* The envelope list (the Message Packages page, issue #478): one .envelope row for each package, in a .envelopes list. A row is a .postmark (the state, in words), a .envelope-head (the title and a .chip, then the lines that
   say who it is for, when it goes out and what has happened), the .envelope-actions and, once a package is released, an .envelope-recipients list: one .envelope-recipient for each person, with an .envelope-steps list of
   three .envelope-step (Sent, Opened, Acknowledged), each with the time or "Not yet" (or "None in the last 12 months" for an old Opened step, ADR 0167). The state is never colour alone: the postmark and the chip say it in words, a done step has its time, and a not-sent or failed
   postmark has a dashed edge. The pairs: ok on ok-bg (the ready postmark, the done chip), warn-ink on warn-bg (the draft postmark), accent-ink on surface-2 (the delivered postmark, the sent chip) and on surface (the scheduled
   postmark), muted on surface (the not-sent postmark and the lines), danger on surface (the failed postmark), text on surface-2 (the waiting chip); each is 4.5 to 1 or more in both schemes, and its edge, which is the text colour,
   3 to 1 or more on --surface (site-contrast.test.ts). The postmark and the row are sized in rem, so they grow with the text and with a zoom, and the row has one column on a narrow screen: at 200% on a 320 px screen
   nothing overlaps. A circle turned 12 degrees is the same circle, so the turn takes no more room. */
.envelopes {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.envelope {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
}

.postmark {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  padding: 4px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  hyphens: auto;
  transform: rotate(-12deg);
}

.postmark-ready {
  background: var(--ok-bg);
  color: var(--ok);
}

.postmark-draft {
  border-style: dashed;
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.postmark-sent {
  background: var(--surface-2);
  color: var(--accent-ink);
}

.postmark-scheduled {
  border-style: dashed;
  background: var(--surface);
  color: var(--accent-ink);
}

.postmark-notsent {
  border-style: dashed;
  background: var(--surface);
  color: var(--muted);
}

.postmark-failed {
  border-style: dashed;
  background: var(--surface);
  color: var(--danger);
}

.envelope-head {
  grid-column: 2;
  min-width: 0;
}

.envelope-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.envelope-title {
  min-width: 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.envelope-meta,
.envelope-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.envelope-detail {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.envelope-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A chip: a pill with a dot and a few words (the delivered package's summary). */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.chip::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.chip-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.chip-sent {
  background: var(--surface-2);
  color: var(--accent-ink);
}

.chip-wait {
  background: var(--surface-2);
  color: var(--text);
}

.envelope-recipients {
  grid-column: 2;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.envelope-recipient {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 3fr);
  gap: 6px 12px;
  align-items: start;
  font-size: 0.9rem;
}

.envelope-recipient-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.envelope-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A step: a ring that is filled when it is done, then its name and, below, the time or "Not yet" (or "None in the last 12 months", ADR 0167). The ring is --field-border (3 to 1 on every surface) and the done fill is --ok. */
.envelope-step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 0 8px;
  color: var(--muted);
  line-height: 1.35;
}

.envelope-step::before {
  content: "";
  grid-row: span 2;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--field-border);
  border-radius: 50%;
}

.envelope-step-name {
  overflow-wrap: anywhere;
}

.envelope-step-when {
  grid-column: 2;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.envelope-step-done {
  color: var(--text);
  font-weight: 700;
}

.envelope-step-done::before {
  border-color: var(--ok);
  background: var(--ok);
}

.envelope-step-done .envelope-step-when {
  color: var(--muted);
  font-weight: 400;
}

.envelope-step-failed .envelope-step-when {
  color: var(--danger);
  font-weight: 700;
}

.envelope-key {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* A phone: the actions, the people and the key take the whole row, and each person's name takes a line with the three steps under it. At 24rem or less (a 320 px screen at 200% is 10rem wide) the postmark sits above the text. */
@media (max-width: 720px) {
  .envelope {
    gap: 12px 14px;
    padding: 16px;
  }

  .envelope-actions,
  .envelope-recipients,
  .envelope-key {
    grid-column: 1 / -1;
  }

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

@media (max-width: 24rem) {
  .envelope {
    grid-template-columns: minmax(0, 1fr);
  }

  .envelope-head {
    grid-column: 1;
  }
}
/* end of the envelopes */

/* The More menu (the Message Packages rows, issue #479): a <details class="more"> with a .more-toggle summary and a .more-menu panel of .more-item buttons (one is .more-item-danger). It is a disclosure and not an ARIA menu, so
   the items are plain buttons in tab order. The panel hangs below the summary on a wide screen and is in the flow, on a line of its own, below 60rem (a unit that grows with the text size and the zoom), so at 320 px or at
   200% it cannot leave the screen; no ancestor clips it. The pairs: accent-ink on surface (the toggle, which is a .btn-secondary, and on surface-2 while it is open or under the pointer), text on surface and on surface-2 (an item, and under the pointer),
   danger on surface and on surface-2 (the delete item), each 4.5 to 1 or more in both schemes. The panel's edge is --field-border, 3 to 1 or more on --surface, so it is seen on a row of the same fill. The focus
   ring is the sheet's (:focus-visible). (site-contrast.test.ts) */
.more {
  position: relative;
}

/* The summary is a small secondary button: it carries the classes btn btn-sm btn-secondary and gets its size, pill, edge, colour and hover from the sheet's button parts. Only what a summary needs beyond a button is here. */
.more-toggle {
  list-style: none;
}

.more-toggle::-webkit-details-marker {
  display: none;
}

.more-toggle::after {
  content: "\25BE";
  content: "\25BE" / "";
}

.more[open] > .more-toggle {
  background: var(--surface-2);
}

.more-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 12rem;
  max-width: calc(100vw - 2rem);
  padding: 6px;
  border: 1px solid var(--field-border);
  border-radius: 16px;
  background: var(--surface);
}

.more-item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.more-item:not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--surface-2);
}

/* Disabled: dimmed like a .btn (see the note above .btn:disabled). Opacity fades the element's own outline too, and an aria-disabled item stays focusable, so it is not applied while the item has focus: the ring stays at full strength and a focused one is drawn dashed on the surface-2 fill, as a .btn is. A natively disabled item cannot take focus. */
.more-item:disabled {
  opacity: 0.45;
}

.more-item:disabled,
.more-item[aria-disabled="true"] {
  cursor: not-allowed;
}

.more-item[aria-disabled="true"]:not(:focus-visible) {
  opacity: 0.45;
}

.more-item[aria-disabled="true"]:focus-visible {
  outline-style: dashed;
  background: var(--surface-2);
}

.more-item-danger {
  color: var(--danger);
}

/* Below 60rem the open More takes a line of the actions and its panel sits under the toggle in the flow, so it is never wider than its row and never off the screen. */
@media (max-width: 60rem) {
  .more[open] {
    flex: 1 1 100%;
  }

  .more-menu {
    position: static;
    min-width: 0;
    max-width: none;
    margin-top: 6px;
  }
}
/* end of the more menu */

/* The package page's contents (issue #481, slice D6a): a .item-list of .item-row, one for each item: a .item-handle (the drag handle, drawn for the eye and hidden from assistive technology), a 36 px .item-icon (an <img alt="">), the
   .item-info (the .item-title and one .item-detail line) and the .item-actions (Edit, and a More menu, which is the sheet's .more). Under the list, the .add-row of Add buttons (the sheet's .btn .btn-secondary), and the .item-order-msg line
   that says what happened to the order or to a delete. A row has four columns from 40rem and two below it (the handle goes, and the buttons take a line of their own), and every column may shrink (minmax(0, ...)), so a long title
   wraps and nothing is wider than the screen at 320 px or at 200% zoom. A row is a container with a --line edge and no 3 to 1 pair of its own; a row being dragged or dropped on has an --accent-ink edge, 3 to 1 or more on --surface.
   The pairs: text on surface (a row and its title), muted on surface (the handle, the detail and the order line), each 4.5 to 1 or more in both schemes. Nothing here clips: no overflow, so the open More menu is whole.
   (site-contrast.test.ts) */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}

.item-row {
  display: grid;
  grid-template-columns: 20px 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
}

.item-row.dragging {
  opacity: 0.55;
  border-color: var(--accent-ink);
}

.item-row.drop-target {
  border-color: var(--accent-ink);
}

.item-handle {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
  cursor: grab;
  user-select: none;
}

.item-icon {
  width: 36px;
  height: 36px;
}

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

.item-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-detail {
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.item-order-msg {
  min-height: 1.2em;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.add-row .btn::before {
  content: "+ ";
  content: "+ " / "";
}

@media (max-width: 40rem) {
  .item-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .item-handle {
    display: none;
  }

  .item-actions {
    grid-column: 1 / -1;
  }
}
/* end of the items */

/* The package page's recipient chips (issue #481, slice D6c; ADR 0063): the checklist, drawn as chips. The page's container has the class pick-chips and holds one label.checklist-row for each recipient: a native checkbox, the
   name, and the address in a .checklist-address span, which goes on a smaller second line (issue #436). The clone dialog's checklist has no such class, so it is not a part of this. The checkbox is the box of the chip
   (appearance: none, drawn here at 20 px), so it stays a real checkbox: focusable, in the tab order, ticked by the chip being pressed. A ticked box is filled with --accent and holds a check mark (a real character, so the state is not
   a colour alone, and it stays in forced colours), and the ticked chip has a --surface-2 fill and an --accent-ink edge. The focus ring is the sheet's focus ring on the whole chip (:has(:focus-visible)); where :has() is not understood the
   box keeps its own ring. A chip whose box is disabled (the cap of 25, or the plan's lock) is dimmed like a disabled button. Chips wrap, and each may shrink (min-width: 0, minmax(0, 1fr), long words break), so nothing is wider than
   the screen at 320 px or at 200% zoom. There is no motion. The pairs: --text on --surface and on --surface-2 (the chip and the address), 4.5 to 1 or more in both schemes, and the edges and the box, 3 to 1 or more (site-contrast.test.ts) */
.pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.pick-chips .checklist-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border: 1.5px solid var(--field-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.pick-chips .checklist-row:has(input:checked) {
  background: var(--surface-2);
  border-color: var(--accent-ink);
}

.pick-chips .checklist-row:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.pick-chips .checklist-row:has(:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--focus-gap), 0 0 0 3px var(--focus-inner), 0 0 12px 4px var(--halo-glow);
}

.pick-chips input[type="checkbox"] {
  appearance: none;
  display: grid;
  place-items: center;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: calc((1.5rem - 20px) / 2);
  width: 20px;
  height: 20px;
  border: 2px solid var(--field-border);
  border-radius: 6px;
  background: var(--surface);
  cursor: inherit;
}

.pick-chips input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.pick-chips input[type="checkbox"]:checked::before {
  content: "\2713" / "";
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

@supports selector(:has(*)) {
  .pick-chips input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: none;
  }
}

@supports not selector(:has(*)) {
  .pick-chips input[type="checkbox"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
}

.pick-chips .checklist-address {
  grid-column: 2;
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

/* The "+ New recipient" button (issue #481, slice D6d), after the chips: a chip's height, radius and --field-border edge, but dashed, so it is not mistaken for a recipient, with --text on --surface (--surface-2 when hovered),
   4.5 to 1 or more in both schemes, and its words in the text. It is a real button, so its ring is the sheet's (:focus-visible), and a disabled one (a sent package, or the plan's lock) is dimmed like a disabled button. */
.pick-chips-add {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 8px 16px;
  border: 1.5px dashed var(--field-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.pick-chips-add:hover:not(:disabled) {
  background: var(--surface-2);
}

.pick-chips-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (forced-colors: active) {
  .pick-chips .checklist-row:has(input:checked) {
    border-color: Highlight;
  }

  .pick-chips input[type="checkbox"]:checked {
    background: Highlight;
    border-color: Highlight;
  }

  .pick-chips input[type="checkbox"]:checked::before {
    color: HighlightText;
  }
}
/* end of the chips */

/* The package page's shell (the package page, issue #480, slice D5b): the header bar (.edit-bar: the .crumb breadcrumb and the h1 on one side, the .save-status line and the Mark ready button, a .btn, on the other) and the two
   columns (.edit-split) of panels (.panel): the form in the first, the preview in the second. One column below 60rem (a unit that grows with the text size and the zoom), so at 320 px or at 200% nothing is wider than the screen:
   the columns are minmax(0, ...) and every child may shrink. The pairs: muted on the page (the breadcrumb and its slashes), accent-ink on the page (the link), text on the page (the current page, the title and a status that is
   under way or unsaved), ok and danger on the page (Saved, Not saved: a state is always said in words as well), and text on surface (a panel and its heading), each 4.5 to 1 or more in both schemes. A panel's edge is --line:
   it is a container and not a control, so it has no 3 to 1 pair to meet. The side column is sticky from 60rem wide when the screen is also 41rem high or more, so that the live preview in it (PREVIEW_PANE_CSS; its frame is never under 18rem
   high and the panel's heading, picker, words and button and the header need 23rem more) stays in view whole as the page scrolls; its top is 5rem, under the sticky header (4.3rem tall at 1280px wide) with a gap. The header is sticky in the same query (SHELL_CSS, from STICKY_WHERE), so the two always agree. On a shorter screen, or below 60rem, the column scrolls
   with the page, and so does the header. (package-live-preview.test.ts) */
.edit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
}

.edit-bar-title {
  min-width: 0;
}

.edit-bar h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.7rem;
  overflow-wrap: anywhere;
}

.edit-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.crumb li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crumb li + li::before {
  content: "/";
  content: "/" / "";
  margin-right: 8px;
}

.crumb a {
  display: inline-block;
  padding-block: 2px;
}

.crumb [aria-current="page"] {
  color: var(--text);
}

/* The save status is one polite live region that is always there: only its words change, so a screen reader says each. It takes no room while it is empty (a new package that has not been saved). */
.save-status {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.save-status[data-state="saved"] {
  color: var(--ok);
}

.save-status[data-state="failed"] {
  color: var(--danger);
}

.edit-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 40px;
}

.edit-split-main,
.edit-split-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

@media (min-width: 60rem) {
  .edit-split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

@media (min-width: 60rem) and (min-height: 41rem) {
  .edit-split-side {
    position: sticky;
    top: 5rem;
  }
}

@media (max-width: 30rem) {
  .panel {
    padding: 16px;
  }
}
/* end of the edit shell */

/* The package page's "Ready to deliver?" list (issue #482, slice D7b): a section.ready on --surface-2 with an h3 and a ul of li rows. A row is .ready-done or .ready-todo and holds a .ready-text (the state in a .ready-state, read by a screen reader and
   not drawn, then the words). The glyph is drawn by ::before: a check mark in --ok for a done row and an open circle in --warn-ink for a to-do, 3 to 1 or more on --surface-2; it is never the only signal, because the state is in words, and it is
   given an empty alternative text where the browser takes one, so it is not read twice. The words are --text (muted text is not allowed on --surface-2). A row wraps, and its text may shrink (min-width: 0), so nothing is wider than the screen at
   320 px or at 200% zoom. The status line (#pkg-status-line, a p) is the last row's words, drawn in line with its state. For a sent package the section is .ready-sent: no box, no heading, and the one row (.ready-plain) has no glyph, so "Status: Sent." reads as plain text. (site-contrast.test.ts) */
.ready {
  margin: 0 0 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
}

.ready[hidden],
.ready li[hidden] {
  display: none;
}

.ready.ready-sent {
  margin: 0;
  padding: 0;
  background: none;
}

.ready-sent ul {
  font-size: inherit;
}

.ready li.ready-plain::before {
  content: none;
}

.ready h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.ready ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.ready li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.ready li::before {
  flex: none;
  width: 1.1em;
  font-weight: 800;
  text-align: center;
}

.ready li.ready-done::before {
  content: "\2713";
  content: "\2713" / "";
  color: var(--ok);
}

.ready li.ready-todo::before {
  content: "\25CB";
  content: "\25CB" / "";
  color: var(--warn-ink);
}

.ready-text {
  position: relative;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ready-text p {
  display: inline;
  margin: 0;
}

.ready-state {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* end of the ready list */

/* The package page's live preview (issue #482, slice D7c): the .panel#pkg-live-preview in the side column holds a picker, a status line and an iframe (.pkg-live-frame) that is drawn at the size of a phone: at most 360px wide, in a bezel, 640px high or
   the screen's height less 23rem (the panel's own heading, picker, words and button, and the header above it, at the default text size), whichever is smaller, and never under 18rem. Its ground is white in both schemes, as the email and the recipient's page are shown in the dialog
   (a frame is what a recipient sees, not part of this page's theme), so no text of this page is set on it. The side column is sticky from 60rem wide and 41rem high (EDIT_CSS sets it: the panel alone is as tall as its content and has nowhere to travel, so the column sticks). Its top is 5rem,
   under the header (.app-header, 4.3rem tall at 1280px wide) with a gap, which is sticky in the same query. Below 60rem the panel follows the form in the page's order and scrolls with it, and so does the header. */
.pkg-live-frame {
  display: block;
  width: 100%;
  max-width: 360px;
  height: min(640px, calc(100vh - 23rem));
  min-height: 18rem;
  margin: 12px auto;
  border: 8px solid #0b1220;
  border-radius: 28px;
  background: #fff;
}

.pkg-live-frame[hidden] {
  display: none;
}
/* end of the live preview */

/* The package page's delivery-timing choice as a segmented control (issue #482, slice D7d): the radios of the Delivery fieldset, drawn as pills that sit together in one .seg-row before the detail blocks (the row wraps by width), with what a choice opens under the row. Each pill is a label.seg that holds a native
   radio and its words, so the radios stay in the tab order and move with the arrow keys as they did. The radio is the dot of the pill (appearance: none, drawn here at 1.25rem: 20 px at default text, and larger with the text so the mark fits): a chosen one is filled with --accent and holds a check mark (a real character, so the
   choice is not shown by a colour alone, and the mark stays in forced colours), and the chosen pill has a --surface-2 fill and an --accent-ink edge. The focus ring is the sheet's focus ring on the whole pill (:has(:focus-visible)); where :has() is not understood the
   radio keeps its own ring. A pill whose radio is disabled (the plan's lock, or a locked panel) is dimmed like a disabled button. Pills wrap onto a second row where they do not fit, and each may shrink (min-width: 0, long words break), so nothing is wider than the
   screen at 320 px or at 200% zoom. There is no motion. The pairs are the chips': --text on --surface and on --surface-2, 4.5 to 1 or more, and the edges and the dot, 3 to 1 or more (site-contrast.test.ts) */
.seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.seg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 16px 6px 12px;
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.seg:has(input:checked) {
  background: var(--surface-2);
  border-color: var(--accent-ink);
}

.seg:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.seg:has(:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--focus-gap), 0 0 0 3px var(--focus-inner), 0 0 12px 4px var(--halo-glow);
}

.seg input[type="radio"] {
  appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  margin: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--field-border);
  border-radius: 50%;
  background: var(--surface);
  cursor: inherit;
}

.seg input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.seg input[type="radio"]:checked::before {
  content: "\2713" / "";
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

@supports selector(:has(*)) {
  .seg input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: none;
  }
}

@supports not selector(:has(*)) {
  .seg input[type="radio"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
}

/* What a choice opens (its select, or its date and time) sits under the row of pills, in line with the fieldset's own edge. */
.timing-seg .timing-detail {
  margin-left: 0;
}

/* The fieldset may shrink below the min-content of its date and month fields (a fieldset is min-width: min-content by default) and those fields shrink with it, so at 320 px with 200% text they stay on the screen. */
.timing-seg {
  min-width: 0;
}

.timing-seg input,
.timing-seg select {
  box-sizing: border-box;
  max-width: 100%;
}
/* end of the segmented control */

/* The header of the signed-in and public pages. It is sticky only where it fits (the media query below, #827): its links wrap under the logo on a narrow screen (269px tall at 375px wide, 373px at 320px, 360px at 375px with 200% text), and a header that stays on screen
   then takes a third to a half of a phone and hides what a control is scrolled to (WCAG 1.4.10, 2.4.11). Below that query it is part of the page and scrolls away with it. */
.app-header {
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* Sticky in the query that makes the package page's side column sticky (STICKY_WHERE, EDIT_CSS): 60rem wide, where the header is one line, and 41rem high. A sticky header covers what is under it, so a control that Tab (or a jump to a place on the page) scrolls into view must stop
   below it, not under it (WCAG 2.4.11 Focus Not Obscured, #823): scroll-padding-top is the header's height and a gap of 0.75rem for the focus ring (a 3px outline at a 3px offset, and its glow). Where the header is not sticky there is nothing to clear, so the padding is inside the query too.
   The height is not one number: the header is 69px at 960px wide and up, and wraps below that, and at a large text size, so the theme script (theme-client.ts) writes the real height to --app-header-h and keeps it current as the header changes size. 4.3rem is the one-line height,
   for the moment before the script has run and where it does not run. Only a page with the header gets the padding. */
@media (min-width: 60rem) and (min-height: 41rem) {
  .app-header {
    position: sticky;
    top: 0;
  }

  html:has(.app-header) {
    scroll-padding-top: calc(var(--app-header-h, 4.3rem) + 0.75rem);
  }
}

/* The links take the room beside the logo, up to all of them on one line. Their flex-basis is their narrowest word (min-content), so the header wraps only when even that does not fit beside the logo (200% text on a 320 px screen): the links then go under the logo and wrap there, instead of pushing the page sideways. */
.app-header .nav-links {
  display: flex;
  flex: 1 1 min-content;
  flex-wrap: wrap;
  align-items: center;
  max-width: max-content;
  gap: 6px;
}

.app-header .nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.app-header .nav-links a:hover {
  background: var(--surface-2);
}

.app-header .nav-links a.active {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

/* The footer of every page: the not-a-will line and the links. */
.site-footer {
  padding: 24px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer a {
  color: var(--accent-ink);
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 8px;
}

/* The ABN is one inline block: a narrow screen moves the whole number down, and it wraps inside only when it is wider than the line (200% text on a 320 px screen), so it never pushes the page sideways. */
.abn {
  display: inline-block;
  white-space: normal;
}
