/* Classy Trams: design system shared by every page (spec .omc/plans/card-ui-redesign.md, sections 1, 5 and 6).
   Light only. Warm page, data and inputs on white, identity from the Voyages Classy Travel logo.
   Spacing comes from --s1..--s7 only. No shadows (focus ring excepted), no gradients, no italics, no all-caps. */

/* ---------- Fonts (committed WOFF2, SIL OFL; never fetched) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --ink: #1d2733;
  --classy: #0b4885;
  --classy-dark: #083766;
  --link: #1665a0;
  --sunset: #f39237;
  --muted: #4b5563;
  --page: #f6f3ec;
  --rail: #efe9de;
  --surface: #ffffff;
  --zebra: #fbf8f2;
  --sky: #e3edf7;
  --line: #d9d0c1;
  --field: #6b7280;

  --ok: #2f6347;
  --ok-tint: #eaf3ee;
  --todo: #8a5a00;
  --todo-tint: #fdf3e1;
  --bad: #a33d36;
  --bad-tint: #fbeceb;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --r: 4px;
  --r2: 6px;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --rail-width: 13rem;
  --control: 2.75rem;
}

/* ---------- Reset and base type ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 400;
  font-synthesis: none;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
h1 { font-size: 1.75rem; line-height: 2.25rem; font-weight: 700; }
h2 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
h3 { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; }
h4 { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
h2 { margin-top: var(--s6); margin-bottom: var(--s3); }
h3 { margin-top: var(--s5); margin-bottom: var(--s2); }
p, ul, ol, dl { margin-bottom: var(--s4); }
p:last-child, ul:last-child, ol:last-child, dl:last-child { margin-bottom: 0; }
ul, ol { padding-left: var(--s5); }
li + li { margin-top: var(--s1); }
strong, b, th { font-weight: 600; }
small { font-size: 1rem; }
abbr[title] { text-decoration: none; }
code, kbd, samp { font-family: var(--mono); font-weight: 500; font-size: 0.9375rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

/* ---------- Links and focus ---------- */
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--classy); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.main:focus:not(:focus-visible) { outline: none; }

/* ---------- Accessibility helpers ---------- */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute; left: var(--s4); top: var(--s4); z-index: 10;
  padding: var(--s2) var(--s4);
  background: var(--surface); color: var(--classy); font-weight: 600;
  border: 1px solid var(--link); border-radius: var(--r);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Shell: light rail + content, no top bar ---------- */
.shell { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0;
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto;
  padding: var(--s5) var(--s4) var(--s4);
}
/* The column carries the rail colour to the foot of the page, also in full-page captures. */
.rail-col { background: var(--rail); border-right: 1px solid var(--line); }
.rail__brand { display: block; width: 168px; margin-bottom: var(--s2); text-decoration: none; }
.rail__brand img { width: 168px; height: auto; }
.rail__product { margin-bottom: var(--s5); font-weight: 600; color: var(--ink); }
.rail__nav ul, .rail__sub { list-style: none; margin: 0; padding: 0; }
.rail__nav li + li { margin-top: 0; }
.rail__nav a {
  display: flex; align-items: center;
  min-height: var(--control);
  padding: var(--s2) var(--s3);
  border-left: 4px solid transparent;
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--ink); text-decoration: none;
}
.rail__nav a:hover { background: var(--surface); color: var(--classy); }
/* aria-current="page": the page itself (filled). aria-current="true": the section the page sits in (bar only). */
.rail__nav a[aria-current] { border-left-color: var(--classy); color: var(--classy); font-weight: 600; }
.rail__nav a[aria-current="page"] { background: var(--sky); }
.rail__sub { margin-bottom: var(--s2); }
.rail__sub a { padding-left: var(--s5); white-space: nowrap; }
.rail__foot { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--line); }
.rail__foot > * + * { margin-top: var(--s2); }
.rail__user { overflow-wrap: anywhere; }
.rail__foot form { margin: 0; }

.main { min-width: 0; padding: var(--s5) var(--s6) var(--s7); }
.main > p, .main > section > p, .notice p { max-width: 75ch; }

/* ---------- Breadcrumb and page head ---------- */
.crumbs { margin-bottom: var(--s2); color: var(--muted); }
.pagehead {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--s5); align-items: end;
  margin-bottom: var(--s5);
}
.pagehead h1 { grid-column: 1; }
.pagehead__sub { grid-column: 1; margin: var(--s1) 0 0; color: var(--muted); }
.pagehead__actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: flex-end; }

/* ---------- Month header (section 2.3) ---------- */
.month {
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
}
.month .crumbs { margin-bottom: var(--s2); }
.month__title {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: var(--s4); align-items: baseline;
}
.month__title h1 { grid-column: 1; grid-row: 1; }
.month__period { grid-column: 2; grid-row: 1; margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.month__next { grid-column: 3; grid-row: 1; align-self: center; }
.month__status {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s3) var(--s5);
  margin-top: var(--s3);
}
/* The bar takes up to 16rem but gives way first, so the facts stay on its line. */
.month__status progress.meter { flex: 1 1 6rem; width: auto; max-width: 16rem; }
.month__status .fig-label { white-space: nowrap; }
.month__facts {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s3) var(--s5);
  margin: 0; padding: 0;
  list-style: none;
}
.month__facts li { display: flex; align-items: center; gap: var(--s2); margin: 0; }
.month > .notice { margin-top: var(--s4); }
.fig-label { color: var(--ink); font-variant-numeric: tabular-nums; }
.fig-label .fig { margin-right: var(--s1); }

progress.meter {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: var(--s3);
  border: 1px solid var(--link); border-radius: 2px;
  background: var(--surface); color: var(--sunset);
  overflow: hidden;
}
progress.meter::-webkit-progress-bar { background: var(--surface); }
progress.meter::-webkit-progress-value { background: var(--sunset); }
progress.meter::-moz-progress-bar { background: var(--sunset); }

/* ---------- Tabs (links, one current) ---------- */
.tabs-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--s2) var(--s5);
  margin: var(--s3) 0 var(--s4);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; flex-wrap: wrap; gap: 0 var(--s1); }
.tabs-row > form { margin-bottom: var(--s1); }
.tabs a {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: var(--control);
  padding: var(--s2) var(--s4);
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--link); font-weight: 600; text-decoration: none;
}
.tabs a:hover { color: var(--classy); border-bottom-color: var(--line); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--classy); }
.tabs__none { display: inline-flex; align-items: center; min-height: var(--control); padding: var(--s2) var(--s4); color: var(--muted); font-weight: 600; }
.tabs__count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.tabs a[aria-current] .tabs__count { color: var(--ink); }

/* ---------- Filter links ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s4); padding: 0; list-style: none; }
.filters li { margin: 0; }
.filters a {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: var(--control);
  padding: var(--s2) var(--s3);
  border: 1px solid transparent; border-radius: var(--r);
  color: var(--link); text-decoration: none;
}
.filters a:hover { background: var(--surface); border-color: var(--line); color: var(--classy); }
.filters a[aria-current] { background: var(--sky); border-color: var(--classy); color: var(--classy); font-weight: 600; }
.filters__n { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- Figures and data type ---------- */
.fig { font-size: 1.5rem; line-height: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fig--amount { font-family: var(--mono); font-weight: 600; }
.num, .ref, .acct {
  font-family: var(--mono); font-weight: 500; font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.num { text-align: right; white-space: nowrap; }
.ref { overflow-wrap: anywhere; }
th.num, th .num { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.muted { color: var(--muted); }
.is-zero { color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 0.9375rem; }
.sub .num, .sub .ref, .sub .acct { font-size: 0.9375rem; }

/* ---------- Tables ---------- */
.t {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r2);
  font-variant-numeric: tabular-nums;
}
.t caption { margin-bottom: var(--s2); text-align: left; font-size: 1.0625rem; font-weight: 600; caption-side: top; }
.t th, .t td { padding: var(--s3); text-align: left; vertical-align: top; }
.t thead th {
  vertical-align: bottom;
  background: var(--surface);
  border-bottom: 2px solid var(--classy);
}
.t thead tr:first-child th:first-child { border-top-left-radius: var(--r2); }
.t thead tr:first-child th:last-child { border-top-right-radius: var(--r2); }
.t tbody > tr > * { border-bottom: 1px solid var(--line); }
.t tbody > tr:nth-child(even) > * { background: var(--zebra); }
.t tbody > tr:hover > * { background: var(--sky); }
.t tbody:last-child > tr:last-child > * { border-bottom: 0; }
.t tbody th { font-weight: 600; }
.t .num { text-align: right; }
.t tfoot > tr > * { background: var(--surface); font-weight: 600; }
.t tfoot > tr:first-child > * { border-top: 2px solid var(--ink); }
.t tfoot > tr:last-child > * { border-bottom: 3px double var(--ink); }
.t tfoot .num { font-weight: 600; }
.t--sticky thead th { position: sticky; top: 0; z-index: 1; }
.t--compact th, .t--compact td { padding: var(--s2); }
.t tr.is-error > * { background: var(--bad-tint); }
.t tr.is-error > :first-child { border-left: 4px solid var(--bad); padding-left: calc(var(--s3) - 4px); }
.t--compact tr.is-error > :first-child { padding-left: calc(var(--s2) - 4px); }
.t a { text-underline-offset: 0.15em; }
.t-scroll { overflow-x: auto; }

/* ---------- Tags: words + shape + colour ---------- */
.tag {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s2);
  border: 1px solid var(--field); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.5rem; font-weight: 600;
  vertical-align: baseline;
}
.tag--ok { border-color: var(--ok); background: var(--ok-tint); color: var(--ok); }
.tag--todo { border-color: var(--todo); background: var(--todo-tint); color: var(--todo); }
.tag--bad { border-color: var(--bad); background: var(--bad-tint); color: var(--bad); }
/* Markers: check = done, open circle = waiting on someone, filled square = wrong. Decorative, no text. */
.tag--ok::before, .tag--todo::before, .tag--bad::before,
.notice--ok > .notice__title::before, .notice--todo > .notice__title::before, .notice--bad > .notice__title::before {
  content: ""; flex: none; display: inline-block;
}
.tag--ok::before, .notice--ok > .notice__title::before {
  width: 0.375rem; height: 0.75rem; margin: 0 var(--s1) var(--s1) var(--s1);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.tag--todo::before, .notice--todo > .notice__title::before {
  width: 0.75rem; height: 0.75rem;
  border: 2px solid currentColor; border-radius: 50%;
}
.tag--bad::before, .notice--bad > .notice__title::before {
  width: 0.625rem; height: 0.625rem; margin: 0 1px;
  background: currentColor;
}
a > .tag { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover > .tag { text-decoration-thickness: 2px; }

/* ---------- Notices ---------- */
.notice {
  margin-bottom: var(--s5);
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--field);
  border-radius: var(--r2);
}
.notice--ok { border-color: var(--ok); }
.notice--todo { border-color: var(--todo); }
.notice--bad { border-color: var(--bad); }
.notice__title {
  display: flex; align-items: center; gap: var(--s2);
  margin: 0 0 var(--s2);
  font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600;
}
.notice__title:last-child { margin-bottom: 0; }
.notice--ok > .notice__title { color: var(--ok); }
.notice--todo > .notice__title { color: var(--todo); }
.notice--bad > .notice__title { color: var(--bad); }
.notice > :last-child { margin-bottom: 0; }
.notice ul { padding-left: var(--s5); }

/* ---------- Checklist (journal blockers) ---------- */
.checks { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; margin: 0; padding: 0; list-style: none; }
.checks__item {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid;
  column-gap: var(--s4); align-items: center;
  margin: 0; padding: var(--s3) 0;
  border-top: 1px solid var(--line);
}
.checks__item:first-child { border-top: 0; padding-top: 0; }
.checks__item:last-child { padding-bottom: 0; }
.checks__fix { justify-self: end; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.checks__fix form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }

/* ---------- Fact list ---------- */
.facts { margin: 0 0 var(--s4); }
.facts > div {
  display: grid; grid-template-columns: 12rem minmax(0, 1fr);
  column-gap: var(--s4);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}
.facts > div:first-child { padding-top: 0; }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; min-width: 0; }

/* ---------- Panels (forms and attention only) ---------- */
.panel {
  margin-bottom: var(--s5);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r2);
}
.panel__title { margin: 0 0 var(--s4); font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--control);
  margin: 0;
  padding: var(--s2) var(--s4);
  border: 1px solid var(--link); border-radius: var(--r);
  background: var(--surface); color: var(--link);
  font-family: var(--sans); font-size: 1rem; line-height: 1.5rem; font-weight: 600;
  text-align: center; text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--sky); color: var(--classy); border-color: var(--classy); }
.button--primary { background: var(--classy); border-color: var(--classy); color: var(--surface); }
.button--primary:hover { background: var(--classy-dark); border-color: var(--classy-dark); color: var(--surface); }
.button--small { min-height: 2.25rem; padding: var(--s1) var(--s3); }
.button:disabled, .button[aria-disabled="true"] {
  background: var(--page); border-color: var(--line); color: var(--muted); cursor: not-allowed;
}
.linkish {
  display: inline; margin: 0; padding: 0;
  border: 0; background: none;
  color: var(--link); font: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em;
  cursor: pointer;
}
.linkish:hover { color: var(--classy); text-decoration-thickness: 2px; }

/* ---------- Forms ---------- */
.form { margin: 0 0 var(--s5); }
.form > :last-child { margin-bottom: 0; }
.field { margin: 0 0 var(--s4); }
.field > label, .field > fieldset > legend {
  display: block; margin-bottom: var(--s1);
  font-weight: 600;
}
input, select, textarea, button { font: inherit; color: inherit; }
/* :where() keeps this base rule at zero specificity so component rules (.t, .bar, input.acct) override it. */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="submit"]), select, textarea) {
  display: block; width: 100%; max-width: 32rem;
  min-height: var(--control);
  margin: 0;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--field); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.5rem;
}
textarea { min-height: 6rem; resize: vertical; }
:where(select) { padding-right: var(--s6); }
input[type="file"] {
  display: block; max-width: 32rem; min-height: var(--control);
  padding: var(--s2) 0; font-family: var(--sans);
}
input[type="file"]::file-selector-button {
  min-height: var(--control); margin-right: var(--s3); padding: var(--s2) var(--s4);
  border: 1px solid var(--link); border-radius: var(--r);
  background: var(--surface); color: var(--link); font: inherit; font-weight: 600; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  width: 1.25rem; height: 1.25rem; margin: 0;
  accent-color: var(--classy); flex: none;
}
input[inputmode="decimal"], input[inputmode="numeric"], input.num, input.acct, input.ref {
  font-family: var(--mono); font-weight: 500; font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
input.acct { max-width: 10rem; }
/* Controls inside rows, bars and checklists take their content's width, not the column's. */
.t input:not([type="checkbox"]):not([type="radio"]), .t select { width: 100%; min-width: 0; }
.bar input:not([type="checkbox"]):not([type="radio"]), .bar select,
.checks__fix input:not([type="checkbox"]):not([type="radio"]), .checks__fix select { display: inline-block; width: auto; min-width: 8rem; }
.bar input.acct, .checks__fix input.acct { width: 8rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[readonly] { background: var(--page); }
.field__help { margin: var(--s1) 0 0; color: var(--muted); }
.field__error { margin: var(--s1) 0 0; color: var(--bad); font-weight: 600; }
.field--error input:not([type="checkbox"]):not([type="radio"]), .field--error select, .field--error textarea,
[aria-invalid="true"] {
  border-color: var(--bad); border-width: 2px;
  padding-left: calc(var(--s3) - 1px);
}
.field--check { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s3); min-height: var(--control); }
.field--check > label { margin: 0; font-weight: 400; }
.field--check > .field__help, .field--check > .field__error { flex-basis: 100%; margin-left: calc(1.25rem + var(--s3)); }
fieldset { min-width: 0; padding: 0; border: 0; }
.field--choices ul { list-style: none; padding: 0; margin: 0; }
.field--choices li label { display: flex; align-items: center; gap: var(--s3); min-height: var(--control); font-weight: 400; }
.form--inline, .field--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s4); }
.form--inline .field, .form--inline .form__actions { margin: 0; }
.field--inline { margin-bottom: var(--s4); }
.field--inline > label { margin: 0 0 var(--s3); }
.form--inline input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .form--inline select { width: auto; min-width: 12rem; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.form--inline .form__actions { margin-top: 0; }

/* ---------- Sticky action bar ---------- */
.bar {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  margin-top: var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border-top: 2px solid var(--classy);
}

/* ---------- Disclosure ---------- */
details.more { margin: 0 0 var(--s4); border-top: 1px solid var(--line); }
details.more > summary {
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--control);
  padding: var(--s2) 0;
  color: var(--link); font-weight: 600;
  list-style: none; cursor: pointer;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: ""; flex: none;
  width: 0.5rem; height: 0.5rem; margin: 0 var(--s1);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > summary:hover { color: var(--classy); }
details.more > :not(summary) { margin-top: var(--s2); }
details.more[open] { padding-bottom: var(--s4); }

/* ---------- Narrow windows (the rail stacks above the content) ---------- */
@media (max-width: 60rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; }
  .rail-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: var(--s5) var(--s4) var(--s7); }
  .pagehead, .month__title { grid-template-columns: minmax(0, 1fr); }
  .month__period { grid-column: 1; grid-row: auto; }
  .pagehead__actions, .month__next { grid-column: 1; grid-row: auto; justify-content: flex-start; justify-self: start; margin-top: var(--s3); }
  .facts > div { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Print (journal and line pages; generated PDFs are separate) ---------- */
.print-only { display: none; }
@media print {
  @page { size: letter landscape; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10pt; line-height: 1.35; }
  .shell { display: block; }
  .rail-col, .rail, .tabs-row, .crumbs, .bar, .month__status, .month__next, form, .skip,
  details:not([open]), .noprint, .filters { display: none !important; }
  .print-only { display: revert; }
  .main { padding: 0; }
  .month, .panel, .notice { padding: 0; border: 0; background: #fff; }
  h1 { font-size: 14pt; line-height: 1.3; }
  h2 { font-size: 12pt; line-height: 1.3; margin-top: 12pt; }
  a, a:visited { color: #000; text-decoration: none; }
  .t { font-size: 9pt; border: 0; border-radius: 0; }
  .t th, .t td { padding: 3pt 4pt; background: #fff !important; color: #000; }
  .t .num, .t .ref, .t .acct { font-size: 9pt; }
  .t thead { display: table-header-group; }
  .t thead th { border-bottom: 1.5pt solid #000; position: static; }
  .t tbody > tr > * { border-bottom: 0.5pt solid #999; }
  .t tfoot > tr:first-child > * { border-top: 1.5pt solid #000; }
  .t tfoot > tr:last-child > * { border-bottom: 3px double #000; }
  tr { break-inside: avoid; }
  .tag, .notice__title { color: #000; background: #fff; border-color: #000; }
}
