/* The back office, in the same hand as the counter.

   Django's admin is themed through its own CSS variables, so most of this is a palette
   rather than a fight with its stylesheet — which also means it keeps working when
   Django's markup changes under it. The warm paper, the single quiet accent and the
   generous line height are the front-of-house values, because the people using this
   screen are the same people, on the same day, in the same light. */

:root {
  --paper: #F6F3EE;
  --surface: #FDFCFA;
  --ink: #2A2521;
  --quiet: #7E756A;
  --rule: #E4DED4;
  --gold: #9A7B3F;
  --gold-soft: #F2EADC;
  --gold-deep: #7E6331;

  /* Django's own names, pointed at ours. */
  --primary: var(--gold-deep);
  --secondary: var(--gold);
  --accent: var(--gold);
  --primary-fg: #FFFDF8;

  --body-fg: var(--ink);
  --body-bg: var(--paper);
  --body-quiet-color: var(--quiet);
  --body-loud-color: var(--ink);

  --header-color: #F2EADC;
  --header-branding-color: #FFFDF8;
  --header-bg: #2A2521;
  --header-link-color: #F2EADC;

  --breadcrumbs-fg: var(--quiet);
  --breadcrumbs-link-fg: var(--gold-deep);
  --breadcrumbs-bg: var(--surface);

  --link-fg: var(--gold-deep);
  --link-hover-color: var(--ink);
  --link-selected-fg: var(--gold);

  --hairline-color: var(--rule);
  --border-color: var(--rule);

  --error-fg: #B3261E;
  --message-success-bg: #EAF3EA;
  --message-warning-bg: #FDF0D5;
  --message-error-bg: #FBE9E7;

  --darkened-bg: #F1ECE4;
  --selected-bg: var(--gold-soft);
  --selected-row: var(--gold-soft);

  --button-bg: var(--gold);
  --button-fg: #FFFDF8;
  --button-hover-bg: var(--gold-deep);
  --default-button-bg: var(--gold-deep);
  --default-button-hover-bg: var(--ink);
  --close-button-bg: var(--quiet);
  --close-button-hover-bg: var(--ink);
  --delete-button-bg: #B3261E;
  --delete-button-hover-bg: #8C1D17;

  --object-tools-fg: #FFFDF8;
  --object-tools-bg: var(--ink);
  --object-tools-hover-bg: var(--gold-deep);

  --font-family-primary: "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --surface: #201E1B;
    --ink: #EFEBE4;
    --quiet: #A79D91;
    --rule: #322E2A;
    --gold: #C9A860;
    --gold-soft: #2B251B;
    --gold-deep: #DCC183;

    --primary: var(--gold);
    --primary-fg: #171614;
    --header-bg: #100F0E;
    --header-branding-color: #EFEBE4;
    --breadcrumbs-bg: #1B1A18;
    --darkened-bg: #1B1A18;
    --button-fg: #171614;
    --object-tools-bg: var(--gold);
    --object-tools-fg: #171614;
    --message-success-bg: #1E2A1E;
    --message-warning-bg: #2A2318;
    --message-error-bg: #2A1A18;
  }
}

body {
  font-size: 15px;
  line-height: 1.7;                 /* room to read, for hours of it */
  -webkit-font-smoothing: antialiased;
}

/* --- The head of the page --------------------------------------------------------- */
#header {
  padding: 16px 32px;
  border-bottom: 0;
}
#branding h1 {
  font-weight: 500;
  letter-spacing: .04em;
  font-size: 1.05rem;
}
#branding h1 a:link, #branding h1 a:visited { color: var(--header-branding-color); }
.wordmark-quiet {
  display: block;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .6;
  font-weight: 400;
  margin-top: 2px;
}

div.breadcrumbs {
  padding: 14px 32px;
  border-bottom: 1px solid var(--rule);
  font-size: .82rem;
  letter-spacing: .04em;
}

#content { padding: 28px 32px 60px; }
#content-main { max-width: 1400px; }

/* --- Headings --------------------------------------------------------------------- */
#content h1 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: .01em;
  margin-bottom: 22px;
}
.module h2, .module caption, .inline-group h2 {
  background: transparent;
  color: var(--quiet);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 16px 20px 10px;
  border-bottom: 1px solid var(--rule);
}

/* --- Panels ----------------------------------------------------------------------- */
.module, .inline-group, .dashboard #content-related .module {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(42, 37, 33, .04), 0 8px 24px rgba(42, 37, 33, .03);
  overflow: hidden;
  margin-bottom: 22px;
}

/* --- Tables ----------------------------------------------------------------------- */
#changelist table { border: 0; }
#changelist table thead th {
  background: transparent;
  border-bottom: 1px solid var(--rule);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--quiet);
  font-weight: 600;
  padding: 14px 12px;
}
#changelist table tbody td, #changelist table tbody th {
  padding: 13px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
#changelist table tbody tr:hover > * { background: var(--gold-soft); }
#changelist-filter { border-radius: 14px; }

/* Photographs in a list should look like photographs. */
#changelist table td img { border-radius: 8px; display: block; }

/* --- Forms ------------------------------------------------------------------------ */
.form-row { padding: 12px 20px; border-bottom: 1px solid var(--rule); }
.aligned label { font-size: .82rem; letter-spacing: .04em; color: var(--ink); font-weight: 700; }

/* The label, the box, and the help beside the box — never under it. The right of the
   screen was empty and the page was long; now a form is as tall as its boxes. */
.aligned .form-row:not(.form-multiline) > .flex-container {
  display: grid;
  grid-template-columns: 180px minmax(220px, 520px) minmax(160px, 1fr);
  gap: 4px 22px;
  align-items: center;
}
.aligned .form-row:not(.form-multiline) > .flex-container > label { grid-column: 1; margin: 0; padding: 0; width: auto; }
.aligned .form-row:not(.form-multiline) > .flex-container > .help { grid-column: 3; grid-row: 1; margin: 0; padding: 0; }
.aligned .form-row:not(.form-multiline) > .flex-container > :not(label):not(.help) { grid-column: 2; }
.aligned .form-row:not(.form-multiline) > .flex-container > .errorlist { grid-column: 2; grid-row: 2; }
.aligned .form-row:not(.form-multiline) > .flex-container.checkbox-row { grid-template-columns: 180px auto minmax(160px, 1fr); }
.aligned .form-row:not(.form-multiline) > .flex-container > .checkbox { grid-column: 2; }
.aligned .form-row:not(.form-multiline) > .flex-container > .checkbox label { font-weight: 700; color: var(--ink); }
.form-multiline .fieldBox { display: flex; flex-direction: column; gap: 4px; }
.form-multiline .fieldBox label { font-weight: 700; color: var(--ink); }
.form-multiline .fieldBox .help { order: 3; }
.aligned .form-row input[type=text], .aligned .form-row input[type=email], .aligned .form-row input[type=tel],
.aligned .form-row input[type=number], .aligned .form-row input[type=url], .aligned .form-row select, .aligned .form-row textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 767px) {
  .aligned .form-row:not(.form-multiline) > .flex-container { grid-template-columns: 1fr; }
  .aligned .form-row:not(.form-multiline) > .flex-container > .help { grid-column: 1; grid-row: auto; }
  .aligned .form-row:not(.form-multiline) > .flex-container > :not(label):not(.help) { grid-column: 1; }
}
.fieldset-heading + .description, .module .description { font-size: .84rem; color: var(--quiet); }
/* Office headers stand above their fields too. */
.module h2, .module caption, .inline-group h2, .fieldset-heading, details > summary .fieldset-heading {
  font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; text-transform: none; color: var(--ink);
}
.aligned label.required::after { content: ' *'; color: var(--gold); font-weight: 700; }
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=tel], input[type=date], textarea, select,
.vTextField {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 13px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
  min-height: 42px;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.help, .form-row .help { color: var(--quiet); font-size: .8rem; line-height: 1.5; }

/* --- Buttons ---------------------------------------------------------------------- */
.button, input[type=submit], input[type=button], .submit-row input, a.button {
  border-radius: 10px;
  padding: 11px 22px;
  font-size: .92rem;
  letter-spacing: .03em;
  border: 0;
  transition: background .12s;
}
.submit-row {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px 20px;
}
.object-tools a {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: .74rem;
  letter-spacing: .12em;
}

/* --- Messages --------------------------------------------------------------------- */
ul.messagelist li {
  border-radius: 10px;
  padding: 14px 18px 14px 44px;
  font-size: .92rem;
  line-height: 1.65;
  margin-bottom: 8px;
}

/* --- The front page --------------------------------------------------------------- */
.dashboard .module table th { font-weight: 400; }
.dashboard .module table td a { font-size: .82rem; }
#content-related .module h2 { padding-top: 16px; }

/* --- Login ------------------------------------------------------------------------ */
body.login #container {
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(42, 37, 33, .05), 0 12px 40px rgba(42, 37, 33, .06);
  overflow: hidden;
}
body.login #header { border-radius: 0; }
body.login .submit-row { border: 0; padding: 0; }
/* The eye on the password box. */
.peek { position: relative; }
.peek input { padding-right: 46px !important; width: 100%; box-sizing: border-box; }
.peek-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted, #9a948b); cursor: pointer;
}
.peek-eye:hover, .peek.is-showing .peek-eye { color: var(--accent, #d4b26a); }

/* The permissions, by section: boxes on the left, one section's screens on the right. */
.permission-boxes { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; width: 100%; }
.pb-sections { display: flex; flex-direction: column; gap: 8px; }
.pb-section {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left;
  padding: 10px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer;
}
.pb-section.is-open { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.pb-section .pb-count { font-size: .78rem; color: var(--quiet); font-style: normal; white-space: nowrap; }
.pb-advice { margin-top: 10px; font-size: .82rem; color: var(--quiet); display: flex; flex-direction: column; gap: 6px; }
.pb-advice strong { color: var(--ink); }
.pb-advice em { font-style: normal; }
.pb-use { align-self: flex-start; padding: 5px 12px; border: 1px solid var(--gold); border-radius: 999px; background: transparent; color: var(--gold-deep); font: inherit; font-size: .82rem; cursor: pointer; }
.pb-grid { width: 100%; border-collapse: collapse; }
.pb-grid th, .pb-grid td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: center; }
.pb-grid thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--quiet); }
.pb-grid thead th:first-child, .pb-grid tbody th { text-align: left; font-weight: 500; }
.pb-grid tbody th { width: 40%; }
.pb-grid input[type=checkbox] { margin: 0; }
.pb-grid td.pb-advised { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.pb-extra { text-align: left; font-size: .8rem; }
.pb-extra label { display: inline-block; margin-right: 10px; }
.pb-extra label.pb-advised { text-decoration: underline dotted var(--gold); }
.pb-summary { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); font-size: .88rem; }
.pb-summary p { margin: 0 0 4px; }
.pb-summary-head strong { color: var(--ink); }
.pb-summary-line strong { color: var(--gold-deep); }
.pb-summary-foot { color: var(--quiet); font-size: .8rem; margin-top: 6px; }
.pb-summary.is-off { opacity: .55; }
.field-user_permissions .flex-container { flex-wrap: wrap; }
.field-user_permissions .permission-boxes { flex: 1 1 100%; margin-top: 8px; }
@media (max-width: 900px) { .permission-boxes { grid-template-columns: 1fr; } }
.peek.is-showing .peek-slash { display: none; }

.back-to-library {
  color: var(--header-link-color);
  text-decoration: none;
  font-size: .8rem;
  letter-spacing: .06em;
  opacity: .8;
}
.back-to-library:hover { opacity: 1; text-decoration: underline; }

/* --- The map, folded ---------------------------------------------------------------- */
/* One heading per section, in the sidebar and on the front page both. The screens under
   it appear on a click or a hover; the section you are in starts open. As few words on
   the screen as the job allows. */
.module.folding table { width: 100%; }
.module.folding caption { padding: 0; border-bottom: 0; background: var(--surface); text-align: left; }
.module.folding caption .fold {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; padding: 14px 44px 14px 20px; border: 0; background: transparent; cursor: pointer;
  color: var(--ink); font: inherit; font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; position: relative;
}
.module.folding caption .fold::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px;
  margin-top: -6px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg); transition: transform .15s;
}
.module.folded caption .fold::after { transform: rotate(-45deg); margin-top: -2px; }
.section-hint {
  font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--quiet);
  font-size: .82rem;
}
.module.folded tbody { display: none; }
.module.folding:not(.folded) caption { border-bottom: 1px solid var(--rule); }
.module.folding tbody th, .module.folding tbody td { padding: 9px 20px; font-size: .9rem; border-bottom: 0; }
.module.folding tbody th { font-weight: 400; }
.module.folding tbody td { width: 1%; white-space: nowrap; }
.module.folding .addlink { font-size: 0; }          /* the word "Add" goes; the + stays */
.module.folding .addlink::before { font-size: 1rem; }
.module.folding tr.current-model th a { color: var(--gold-deep); font-weight: 600; }

#nav-sidebar .module { margin-bottom: 8px; }
#nav-sidebar .module.folding caption .fold { padding: 12px 36px 12px 14px; font-size: .72rem; }
#nav-sidebar .module.folding tbody th, #nav-sidebar .module.folding tbody td { padding: 7px 14px; font-size: .88rem; }
#nav-filter { border-radius: 999px; margin: 10px 12px 12px; width: calc(100% - 24px); }

/* The front page: the whole width, two panes. */
.dashboard #content { width: auto; max-width: none; }
.dashboard #content-main { display: block; }

/* --- The head of the page, with fewer words ------------------------------------------ */
#user-tools {
  display: flex; align-items: center; gap: 16px;
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
}
#user-tools strong { text-transform: none; letter-spacing: 0; font-size: .92rem; font-weight: 500; }
#user-tools a, #logout-form button { border-bottom: 0; }

/* --- Filters, folded ------------------------------------------------------------------ */
/* A heading that opens on a click or a hover, and starts open only when a filter is in
   use. When it is folded the list has the whole width. */
#changelist-filter.folding h2 { padding: 0; margin: 0; }
#changelist-filter.folding h2 .fold {
  width: 100%; text-align: left; padding: 14px 40px 14px 20px; border: 0;
  background: transparent; cursor: pointer; color: var(--ink); font: inherit;
  font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  position: relative; white-space: nowrap;
}
#changelist-filter.folding h2 .fold::after {
  content: ''; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px;
  margin-top: -6px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg);
}
#changelist-filter.folded h2 .fold::after { transform: rotate(-45deg); margin-top: -2px; }
#changelist-filter.folded .filter-body { display: none; }
/* Folded, the panel is its heading and the list has the width. A hover drops the
   filters over the list; a click on the heading pins them open beside it. */
#changelist-filter.folded { flex: 0 0 auto; position: relative; }
#changelist .changelist-form-container:has(#changelist-filter.folded) > div { max-width: 100%; }
#changelist-filter .filter-body h3 { padding: 0 20px; font-size: .82rem; }

/* --- Forms: the rarely needed parts folded -------------------------------------------- */
/* Django draws a collapsible section as <details>. The summary reads as a heading with
   a chevron; a click opens it. Not on hover — a form should not move under a hand. */
fieldset.module.collapse details > summary, .inline-group details > summary {
  list-style: none; cursor: pointer; position: relative; border: 0; padding: 0;
}
fieldset.collapse details > summary::-webkit-details-marker,
.inline-group details > summary::-webkit-details-marker { display: none; }
fieldset.collapse details > summary::after, .inline-group details > summary::after {
  content: ''; position: absolute; right: 20px; top: 22px; width: 7px; height: 7px;
  border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(-45deg);
}
fieldset.collapse details[open] > summary::after, .inline-group details[open] > summary::after {
  transform: rotate(45deg);
}
fieldset.collapse details > summary h2 { display: block; }
fieldset.collapse details > summary .fieldset-heading { padding-right: 40px; }

/* --- People, as people ------------------------------------------------------------- */
/* A name and an icon each. Everything else on hover, or on the click that opens them. */
.people {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; padding: 6px 0 20px;
}
.person {
  position: relative; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 16px; padding: 18px 14px 14px; text-align: center;
  box-shadow: 0 1px 2px rgba(42, 37, 33, .04), 0 8px 24px rgba(42, 37, 33, .03);
  transition: transform .12s, box-shadow .12s;
}
.person:hover, .person:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(42, 37, 33, .08), 0 18px 40px rgba(42, 37, 33, .08);
}
.person-gone { opacity: .45; }
.person-pick { position: absolute; top: 10px; left: 10px; }
.person-pick input { width: 16px; height: 16px; accent-color: var(--gold); }
.person-face { display: block; text-decoration: none; color: inherit; }
.person-initials {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 10px;
  border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep);
  font-size: 1.25rem; font-weight: 600; letter-spacing: .04em;
}
.person-name { display: block; font-weight: 600; font-size: .98rem; line-height: 1.3; }
.person-level {
  display: inline-block; margin-top: 6px; padding: 1px 9px; border-radius: 999px;
  background: var(--gold); color: var(--primary-fg); font-size: .7rem; letter-spacing: .08em;
}
.person-more {
  max-height: 0; overflow: hidden; opacity: 0; margin-top: 0;
  transition: max-height .2s ease, opacity .15s ease, margin-top .2s ease;
  font-size: .8rem; color: var(--quiet); line-height: 1.5;
}
.person:hover .person-more, .person:focus-within .person-more, .person.open .person-more {
  max-height: 260px; opacity: 1; margin-top: 10px;
}
.person-more p { margin: 0 0 2px; }
.person-may { color: var(--ink); }
.person-needs { color: #b26500; }
.people-none { color: var(--quiet); padding: 20px; }
@media (prefers-color-scheme: dark) {
  .person-initials { background: var(--gold-soft); color: var(--gold); }
}

/* --- Records as cards, coloured by what needs doing ------------------------------- */
/* Green: nothing. Amber: for today. Red: now — someone is waiting. The reason is on the
   card, on a hover or a tap. Same shape as the people cards; any list can use it. */
.columns { display: block; }
.column-head { margin: 0; padding: 0; }
.column-head .fold {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 18px;
  border: 0; background: transparent; cursor: pointer; color: var(--ink); font: inherit;
  font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; text-align: left;
}
.column-count {
  margin-left: auto; min-width: 26px; padding: 1px 8px; border-radius: 999px; text-align: center;
  background: var(--gold-soft); color: var(--gold-deep); font-size: .74rem; letter-spacing: 0;
}
.column.folded .cards { display: none; }
.column:not(.folded) .column-head { border-bottom: 1px solid var(--rule); }
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; padding: 14px;
}
.cards-few { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cards-few .card { padding: 24px 20px 18px; }
.cards-few .card-initials, .cards-few .card-image { width: 64px; height: 64px; }
.cards-few .card-name { font-size: 1.15rem; }
.cards-some { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.cards-many { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card-image { display: block; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; margin-bottom: 10px; }
.card-line em { font-style: normal; color: var(--quiet); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin-right: 4px; }
.card-more p em { font-style: normal; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin-right: 4px; }
.card {
  position: relative; background: var(--paper); border: 1px solid var(--rule);
  border-left: 5px solid var(--rule); border-radius: 16px; padding: 18px 16px 14px;
  box-shadow: 0 1px 2px rgba(42, 37, 33, .04), 0 8px 24px rgba(42, 37, 33, .03);
  transition: transform .12s, box-shadow .12s;
}
.card:hover, .card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(42, 37, 33, .08), 0 18px 40px rgba(42, 37, 33, .08);
}
.card-fine { border-left-color: #4E8A5A; }
.card-today { border-left-color: #D48A1E; }
.card-now { border-left-color: #B3261E; background: color-mix(in srgb, #B3261E 5%, var(--surface)); }
.card-pick { position: absolute; top: 10px; right: 10px; }
.card-pick input { width: 16px; height: 16px; accent-color: var(--gold); }
.card-face { display: block; text-decoration: none; color: inherit; }
.card-initials {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px;
  border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep);
  font-size: 1.05rem; font-weight: 600;
}
.card-name { display: block; font-weight: 600; font-size: 1rem; line-height: 1.3; }
.card-line { display: block; color: var(--quiet); font-size: .8rem; margin-top: 2px; }
.card-more {
  max-height: 0; overflow: hidden; opacity: 0; margin-top: 0;
  transition: max-height .2s ease, opacity .15s ease, margin-top .2s ease;
  font-size: .8rem; color: var(--quiet); line-height: 1.5;
}
.card:hover .card-more, .card:focus-within .card-more, .card.open .card-more {
  max-height: 260px; opacity: 1; margin-top: 10px;
}
.card-more p { margin: 0 0 2px; }
.card-reason { color: var(--ink); font-weight: 600; }
.card-now .card-reason { color: #B3261E; }
.card-today .card-reason { color: #b26500; }
.cards-none { color: var(--quiet); padding: 20px; }

/* --- Two panes: headings on the left, the chosen one's boxes on the right ------------ */
/* A click, never a hover. The choice is remembered per page. */
.two-pane { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 16px; align-items: start; }
.pane-nav { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 16px; }
.pane-tab {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name count" "hint count";
  gap: 2px 12px; align-items: center; width: 100%; padding: 14px 16px; text-align: left;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--surface);
  color: var(--ink); font: inherit; cursor: pointer; transition: border-color .12s, background .12s;
}
.pane-tab:hover { border-color: var(--ink); }
.pane-tab.is-selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pane-tab-name { grid-area: name; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.pane-tab-hint { grid-area: hint; font-size: .8rem; color: var(--quiet); }
.pane-tab.is-selected .pane-tab-hint { color: var(--paper); opacity: .7; }
.pane-tab-count {
  grid-area: count; min-width: 28px; padding: 2px 9px; border-radius: 999px; text-align: center;
  background: var(--gold-soft); color: var(--gold-deep); font-size: .76rem; font-weight: 600;
}
.pane-tab.is-selected .pane-tab-count { background: var(--gold); color: var(--primary-fg); }
.pane-body { min-width: 0; }
.pane { border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); overflow: hidden; }
.pane-title {
  margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.pane-title .column-count { margin-left: 0; }
.columns:not(.two-pane) .pane, .columns:not(.two-pane) .pane-body { width: 100%; }
@media (max-width: 800px) {
  .two-pane { grid-template-columns: 1fr; }
  .pane-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .pane-tab { width: auto; }
}

/* The front page's screens: big buttons in the chosen section. */
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.screen {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 76px;
  padding: 18px 20px; border: 1px solid var(--ink); border-radius: 14px; color: var(--ink);
  text-decoration: none; font-size: .86rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  transition: background .12s, color .12s;
}
.screen:hover { background: var(--ink); color: var(--paper); }
.screen-add { font-weight: 400; font-size: 1.3rem; color: var(--gold); line-height: 1; }
.screen:hover .screen-add { color: var(--gold); }

/* Boxes read like labels, not like a database: the name plain, the facts small and bold,
   the field names smaller still. No underlines inside a box. */
.card-face, .card-face:link, .card-face:visited { text-decoration: none; }
.card-name, .card-name:link { text-decoration: none; }
.card-line { font-size: .78rem; line-height: 1.45; }
.card-line strong { font-weight: 600; color: var(--ink); }
.card-line em { font-size: .64rem; }
.card-more { font-size: .76rem; }
.card-more p em { font-size: .62rem; }

/* --- Back, on every screen -------------------------------------------------------- */
#branding { display: flex; align-items: center; gap: 16px; }
.nav-back {
  display: inline-block; padding: 7px 14px; border: 1px solid rgba(255, 253, 248, .35); border-radius: 999px;
  color: var(--header-link-color); text-decoration: none; font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; white-space: nowrap; opacity: .85;
}
.nav-back:hover { opacity: 1; border-color: var(--header-branding-color); color: var(--header-branding-color); }

/* --- The head of a list: the name in the middle, the tools to the right ------------- */
.titles-and-tools { display: flex; align-items: center; justify-content: center; position: relative; }
.titles-and-tools .titles { text-align: center; }
.titles-and-tools .object-tools { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin: 0; }
#changelist .actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
#changelist .actions label { margin: 0; }

/* --- One line: the search box with its button, and the actions to the right ------ */
#changelist .changelist-form-container > div { position: relative; }
#toolbar { border: 0; background: transparent; padding: 10px 0 6px; margin: 0; }
#toolbar .search-row { display: flex; align-items: center; gap: 8px; }
#toolbar #searchbar { width: min(420px, 60%); min-height: 44px; margin: 0; }
#toolbar .search-go {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 10px; background: var(--gold); color: var(--primary-fg); cursor: pointer;
}
#toolbar .search-go svg { width: 24px; height: 24px; }     /* three-quarters of the box's 44px, less the rounding */
#toolbar .search-go:hover { background: var(--gold-deep); }
#toolbar .search-count { margin-left: 6px; }
#changelist .actions {
  position: absolute; right: 0; top: 10px; margin: 0; padding: 0; background: transparent;
  min-height: 44px; display: flex; align-items: center; gap: 8px;
}
#changelist .actions label { font-size: 0; }               /* the word "Action:" goes; the choice stays */
#changelist .actions label select { font-size: .9rem; min-height: 44px; }
#changelist .actions .button { min-height: 40px; }
#changelist .actions .action-counter { font-size: .8rem; color: var(--quiet); }
#changelist-form { margin-top: 6px; }
.who-home { text-decoration: none; color: inherit; }

