/* Ajo Plus - mobile first. Everything below is for phones; the media queries
   at the end add what a bigger screen can afford. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e1e5ea;
  --text: #16202c;
  --text-dim: #5b6775;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #d6f2ee;
  --credit: #0f766e;
  --debit: #b4243c;
  --warn: #9a5b00;
  --warn-soft: #fdf2dc;
  --danger: #b4243c;
  --danger-soft: #fbe5e9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --bar-height: 60px;
  --topbar-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark applies when the device asks for it and the viewer has not chosen
   light, or when the viewer has chosen dark outright. The two selectors
   carry the same tokens; CSS has no way to share them. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419;
    --surface: #171d24;
    --surface-2: #1f262f;
    --border: #2a333d;
    --text: #e6edf3;
    --text-dim: #9aa7b4;
    --brand: #2dd4bf;
    --brand-dark: #14b8a6;
    --brand-soft: #0f3b36;
    --credit: #2dd4bf;
    --debit: #fb7185;
    --warn: #fbbf24;
    --warn-soft: #3a2f10;
    --danger: #fb7185;
    --danger-soft: #3b1620;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #171d24;
  --surface-2: #1f262f;
  --border: #2a333d;
  --text: #e6edf3;
  --text-dim: #9aa7b4;
  --brand: #2dd4bf;
  --brand-dark: #14b8a6;
  --brand-soft: #0f3b36;
  --credit: #2dd4bf;
  --debit: #fb7185;
  --warn: #fbbf24;
  --warn-soft: #3a2f10;
  --danger: #fb7185;
  --danger-soft: #3b1620;
  --shadow: none;
}

* { box-sizing: border-box; }

/* Any display rule of ours would otherwise outrank the UA [hidden] rule. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--bar-height) + env(safe-area-inset-bottom));
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .35em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }

.muted { color: var(--text-dim); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }

/* Shell ----------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem;
  padding-top: calc(.7rem + env(safe-area-inset-top));
  /* A known height, so what sits under it can be measured against it. */
  height: calc(var(--topbar-height) + env(safe-area-inset-top));
  background: var(--brand-dark);
  color: #fff;
}
.topbar a, .topbar button { color: #fff; }
.topbar__brand { font-weight: 680; letter-spacing: .01em; font-size: 1rem; }
.topbar__spacer { margin-left: auto; }
.topbar__user { font-size: .8rem; opacity: .85; }

.layout { display: block; }
.sidebar { display: none; }

.main { padding: 1rem; width: 100%; min-width: 0; }

.page-head { margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .15rem; }

/* Bottom bar (phones) --------------------------------------------------- */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .5rem .2rem; font-size: .66rem; color: var(--text-dim);
  text-decoration: none; min-height: var(--bar-height);
  justify-content: center;
}
.tabbar a.is-active { color: var(--brand); font-weight: 600; }
.tabbar svg { width: 21px; height: 21px; }

/* Cards and panels ------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}
.card__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.card__head h2 { margin: 0; }
.card__head .topbar__spacer { margin-left: auto; }

.grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem;
  display: block;
  color: inherit;
}
.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat__label { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 1.45rem; font-weight: 680; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat__caption { font-size: .76rem; color: var(--text-dim); margin-top: .15rem; }
.stat.is-alert { border-color: var(--warn); background: var(--warn-soft); }

.shortcuts { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shortcut {
  display: flex; flex-direction: column; gap: .3rem;
  padding: .85rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  color: inherit;
}
.shortcut:hover { text-decoration: none; border-color: var(--brand); }
.shortcut svg { width: 22px; height: 22px; color: var(--brand); }
.shortcut__label { font-weight: 620; font-size: .9rem; }
.shortcut__hint { font-size: .75rem; color: var(--text-dim); }

/* Forms ----------------------------------------------------------------- */

.form-row { margin-bottom: .9rem; }
.form-row > label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }
.field {
  width: 100%; padding: .6rem .7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 44px; /* a thumb target */
}
.field:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field--area { min-height: 90px; }
.field:disabled { background: var(--surface-2); color: var(--text-dim); cursor: not-allowed; }

/* The customer box: one field with its list hanging under it. */
.combo { position: relative; }
.combo__list {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 25;
  margin: 0; padding: .25rem; list-style: none;
  max-height: 16rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.combo__option, .combo__empty { padding: .55rem .6rem; border-radius: var(--radius-sm); }
.combo__option { cursor: pointer; }
.combo__option:hover, .combo__option.is-active { background: var(--surface-2); }
.combo__option[aria-selected="true"] { color: var(--brand); font-weight: 600; }
.combo__empty { color: var(--text-dim); }
.help { font-size: .76rem; color: var(--text-dim); margin-top: .25rem; }
.errorlist { list-style: none; margin: .3rem 0 0; padding: 0; color: var(--danger); font-size: .8rem; }

.form-grid { display: grid; gap: 0 .75rem; grid-template-columns: 1fr; }

.checkline { display: flex; align-items: flex-start; gap: .5rem; padding: .35rem 0; }
.checkline input { width: 18px; height: 18px; margin-top: .15rem; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1rem; min-height: 44px;
  font: inherit; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--brand); color: #fff; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); }
.btn--small { padding: .35rem .6rem; min-height: 34px; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* Filters --------------------------------------------------------------- */

/* Deliberately small: filters refine the page, they are not the page. */
.card:has(> .filters) { padding: .55rem .7rem; box-shadow: none; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: flex-end; }
.filters .form-row { margin: 0; flex: 1 1 8.5rem; max-width: 13rem; }
.filters .form-row:has(input[type="search"]) { flex: 2 1 14rem; max-width: 22rem; }
.filters .form-row:has(.checkline), .filters .form-row:has(> .btn) { flex: 0 0 auto; max-width: none; }
.filters .form-row > label {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-dim); margin-bottom: .2rem;
}
.filters .field { min-height: 32px; padding: .25rem .5rem; font-size: .82rem; }
.filters .btn { min-height: 32px; padding: .25rem .75rem; font-size: .82rem; width: auto; }
.filters .btn svg { width: 14px; height: 14px; }
.filters .checkline { font-size: .82rem; padding: .3rem 0; }

/* Tables ---------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data th, table.data td { padding: .55rem .5rem; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); font-weight: 650; white-space: nowrap; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tfoot td { font-weight: 680; border-top: 2px solid var(--border); border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

tr.branch-head td {
  background: var(--surface-2); font-weight: 650; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em;
}
tr.branch-total td { font-weight: 650; border-top: 1px solid var(--border); }
tr.branch-total td:first-child { color: var(--text-dim); }

.copy {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .4rem; font: inherit; color: inherit; cursor: pointer;
  background: transparent; border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.copy:hover { border-style: solid; border-color: var(--brand); }
.copy svg { opacity: .6; }
.copy--done { background: var(--brand-soft); border-color: var(--brand); }

.credit { color: var(--credit); }
.debit { color: var(--debit); }

/* A table that becomes a list of cards on a phone. */
@media (max-width: 640px) {
  table.stacked, table.stacked thead, table.stacked tbody, table.stacked tfoot,
  table.stacked tr, table.stacked td { display: block; width: 100%; }
  table.stacked thead { display: none; }
  table.stacked tr {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .6rem .75rem; margin-bottom: .6rem;
  }
  table.stacked td { border: none; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  table.stacked td::before {
    content: attr(data-label); font-size: .72rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-dim); font-weight: 650; flex: none;
  }
  table.stacked td.num { text-align: right; }
  table.stacked tfoot tr { background: var(--brand-soft); }
  /* An empty-state cell spans the row, so it has no label to sit beside. */
  table.stacked td.empty { display: block; text-align: center; }
  table.stacked td.empty::before { content: none; }
}

/* Chips, badges, messages ---------------------------------------------- */

.badge {
  display: inline-block; padding: .12rem .45rem; border-radius: 999px;
  font-size: .72rem; font-weight: 650; background: var(--surface-2); color: var(--text-dim);
}
.badge--ok { background: var(--brand-soft); color: var(--brand-dark); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }

.messages { list-style: none; margin: 0 0 1rem; padding: 0; }
.messages li {
  padding: .7rem .85rem; border-radius: var(--radius-sm); margin-bottom: .5rem;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
}
.messages li.error { border-left-color: var(--danger); background: var(--danger-soft); }
.messages li.warning { border-left-color: var(--warn); background: var(--warn-soft); }
.messages li.success { border-left-color: var(--brand); background: var(--brand-soft); }

.tabs { display: flex; gap: .25rem; overflow-x: auto; margin: 0 -1rem 1rem; padding: 0 1rem .25rem; }
.tabs a {
  padding: .45rem .75rem; border-radius: 999px; white-space: nowrap;
  font-size: .85rem; font-weight: 600; color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--border);
}
.tabs a.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabs a:hover { text-decoration: none; }

.empty { padding: 2rem 1rem; text-align: center; color: var(--text-dim); }

.pagebar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  margin-bottom: .85rem;
}
.pagebar .crumbs { margin: 0; flex: 1 1 auto; min-width: 0; }
.pagebar__date {
  display: flex; align-items: center; gap: .4rem; margin-left: auto;
}
.pagebar__date label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-dim); white-space: nowrap;
}
.pagebar__date .field {
  width: auto; min-height: 36px; padding: .3rem .5rem; font-size: .85rem;
}

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem;
  font-size: .8rem; color: var(--text-dim);
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--brand); }
.crumbs > * + *::before { content: "/"; margin-right: .5rem; opacity: .45; }
.crumbs > :last-child { color: var(--text); font-weight: 600; }

.pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; font-size: .88rem; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.auth__card { width: 100%; max-width: 380px; }
.auth__logo { text-align: center; margin-bottom: 1.25rem; }
.auth__logo strong { font-size: 1.3rem; }

.print-only { display: none; }

/* Larger screens -------------------------------------------------------- */

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .layout {
    display: grid; grid-template-columns: 250px 1fr;
    min-height: calc(100dvh - var(--topbar-height));
  }
  .sidebar {
    display: block; background: var(--surface); border-right: 1px solid var(--border);
    padding: 1rem .75rem; position: sticky; align-self: start;
    top: var(--topbar-height);
    max-height: calc(100dvh - var(--topbar-height)); overflow-y: auto;
  }
  .sidebar h3 {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-dim); margin: 1rem .5rem .3rem;
  }
  .nav-section { margin-top: .4rem; }
  .nav-section > summary {
    display: flex; align-items: center; gap: .4rem; cursor: pointer;
    padding: .4rem .5rem; border-radius: var(--radius-sm);
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-dim);
    list-style: none; user-select: none;
  }
  .nav-section > summary::-webkit-details-marker { display: none; }
  .nav-section > summary:hover { background: var(--surface-2); color: var(--text); }
  .nav-section > summary svg {
    margin-left: auto; opacity: .6; transition: transform .15s ease;
  }
  .nav-section[open] > summary svg { transform: rotate(180deg); }
  .nav-section__items { padding-bottom: .2rem; }
  /* A collapsed section still shows it holds the page you are on. */
  .nav-section:not([open]) > summary:has(+ .nav-section__items .is-active) {
    color: var(--brand);
  }
  .sidebar a {
    display: flex; align-items: center; gap: .55rem;
    padding: .45rem .5rem; border-radius: var(--radius-sm);
    color: var(--text); font-size: .88rem;
  }
  .sidebar a:hover { background: var(--surface-2); text-decoration: none; }
  .sidebar a.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
  .sidebar svg { width: 17px; height: 17px; flex: none; opacity: .75; }
  .main { padding: 1.5rem 2rem; }
  /* A screen meant to be read without scrolling cannot spend 24px on air. */
  .main--tight { padding-top: 1rem; padding-bottom: .5rem; }
  .grid--2, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap { margin: 0; padding: 0; }
}

@media (min-width: 1200px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A zero page margin stops the browser printing its own date, title and
   URL; the gutter moves onto the body instead. */
@page {
  size: A4;
  margin: 0;
}

@media print {
  /* Paper is light whatever the screen was, so the tokens are reset here.
     Without this, printing in dark mode puts near-white text on white. */
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #fff;
    --border: #bbb;
    --text: #000;
    --text-dim: #444;
    --brand: #000;
    --brand-dark: #000;
    --brand-soft: #fff;
    --credit: #0a5c55;
    --debit: #8c1b2f;
    --warn: #5c4300;
    --warn-soft: #fff;
    --danger: #8c1b2f;
    --danger-soft: #fff;
    --shadow: none;
  }
  .topbar, .sidebar, .tabbar, .filters, .actions, .no-print, .tabs,
  .crumbs { display: none !important; }
  body { background: #fff; color: #000; padding: 1cm 0.6cm; }
  .main { padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; padding: 0; }
  .print-only { display: block; }
  table.data { font-size: 10pt; }
  /* Keep a branch section and its subtotal on one page where it fits. */
  table.data tbody.branch-group { break-inside: avoid; }
  thead { display: table-header-group; }

  .report-letterhead { text-align: center; margin-bottom: .6cm; }
  .report-letterhead h2 { font-size: 16pt; margin: 0; }
  .report-letterhead h3 { font-size: 13pt; margin: .35cm 0 .1cm; }
  .report-letterhead p { margin: .05cm 0; font-size: 9pt; }
  .report-letterhead__strap { font-style: italic; }
  table.data th, table.data td { border-bottom: 1px solid #ccc; }
}

/* Theme toggle --------------------------------------------------------- */

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; flex: none;
  background: transparent; color: inherit; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--radius-sm);
}
.theme-toggle:hover { background: rgba(255, 255, 255, .12); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle [data-icon] { display: none; }

/* No stored choice means the device decides, so show the "auto" face. */
:root:not([data-theme]) .theme-toggle [data-icon="auto"],
:root[data-theme="light"] .theme-toggle [data-icon="light"],
:root[data-theme="dark"] .theme-toggle [data-icon="dark"] { display: inline-flex; }

/* On the sign-in pages the button sits on the page, not the bar. */
.auth .theme-toggle {
  position: absolute; top: calc(1rem + env(safe-area-inset-top)); right: 1rem;
  border-color: var(--border); color: var(--text-dim);
}
.auth .theme-toggle:hover { background: var(--surface-2); }
.auth { position: relative; }

/* Record contribution screen ------------------------------------------- */

.record-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.record-side { display: block; }

.confirm-month > label { color: var(--warn); }
.confirm-month__row { display: grid; gap: .5rem; grid-template-columns: 1fr auto; }
.confirm-month__row .field { margin: 0; }

/* Days in, amount out, side by side - the teller reads the amount while
   their hand is still on the number. */
/* Label, the amount it comes to, then the number of days - the order the
   old screen used, so the eye lands in the same places. */
.daybox {
  display: grid; grid-template-columns: auto 1fr 5.5rem; gap: .5rem;
  align-items: center; margin-bottom: .6rem;
}
.daybox label {
  font-size: .85rem; font-weight: 650; min-width: 4.5rem;
  padding: .6rem .7rem; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff;
}
.daybox .field { margin: 0; }
.daybox__amount {
  padding: .6rem .7rem; text-align: right;
  font-weight: 650; font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.effect {
  padding: .7rem .85rem; margin-top: .5rem; border-radius: var(--radius-sm);
  background: var(--brand-soft); font-size: .9rem;
}
.effect--warn { background: var(--warn-soft); color: var(--warn); }

.balance-card__total {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-top: .6rem; padding: .6rem .75rem;
  background: var(--brand-soft); border-radius: var(--radius-sm);
}
.balance-card__total strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* The whole screen is meant to be read at once, so everything on it is
   packed tighter than a card elsewhere in the app. */
.record-layout .card { padding: .75rem; margin-bottom: .5rem; }
.record-layout .card__head { margin-bottom: .5rem; }
.record-layout .card__head h2 { font-size: 1rem; }
.record-layout .form-row { margin-bottom: .6rem; }
.record-layout .form-row:last-child { margin-bottom: 0; }
.record-layout .actions { margin-top: .6rem; }
.record-layout .card:last-child { margin-bottom: 0; }
.record-side .card { padding: .7rem .75rem; }
.record-side .card__head { margin-bottom: .4rem; }
.record-side .kv { font-size: .82rem; gap: .15rem 1rem; line-height: 1.35; }
.record-side table.data { line-height: 1.35; }
.record-side table.data td { padding: .28rem .5rem; }
.record-side .balance-card__total { margin-top: .45rem; padding: .5rem .75rem; }
.page-head--tight { margin-bottom: .6rem; }
#check-status:empty { display: none; }
#check-btn { white-space: nowrap; }

@media (min-width: 900px) {
  /* The panel sits beside the form and follows it down a long page. */
  .record-layout { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); align-items: start; }
  .record-side { position: sticky; top: calc(var(--topbar-height) + .75rem); }
  /* Who and which month read as one line across the top. */
  /* The month column takes what it needs; the card gets the rest. */
  .record-who { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr) auto; }
  .record-who > #check-status { grid-column: 1 / -1; }
}
