/* 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: #F5F0E8;
  --surface: #FBF8F3;
  --ink: #1C1915;
  --quiet: #6B6257;
  --rule: #E3DACB;
  --gold-soft: #EFE6D3;           /* a soft ground, and nothing else: gold is never a fill, a chip, a button or a link */
  --wine: #7A1F2B;
  --wine-deep: #5E1520;

  /* The paper theme whatever the browser prefers and whatever Django's own switch says. */
  color-scheme: light;

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

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

  --header-color: var(--ink);
  --header-branding-color: var(--ink);
  --header-bg: var(--surface);
  --header-link-color: var(--wine-deep);

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

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

  --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(--wine);
  --button-fg: #FFFDF8;
  --button-hover-bg: var(--wine-deep);
  --default-button-bg: var(--wine-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(--wine-deep);

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

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


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-family: 'Cormorant Garamond', Georgia, serif;   /* the house's head: the title in Cormorant, as the Masters' (the brief, §2) */
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
  margin-bottom: 18px;
}
.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(--wine); 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(--wine);
  outline-offset: 1px;
  border-color: var(--wine);
}
.help, .form-row .help { color: var(--quiet); font-size: .8rem; line-height: 1.5; }

/* --- Buttons ---------------------------------------------------------------------- */
/* The acts as pills (Shiv, 23 Oct 2026, from the Office survey; the brief, §2): outlined burgundy, 44px, filled for the one
   act — Save, the Go of a page — and quiet for the rare thing. */
.button, input[type=submit], input[type=button], .submit-row input, a.button, #content button[type=submit] {
  border-radius: 999px;
  padding: 0 20px;
  min-height: 44px;
  font: 600 .86rem var(--font-family-primary);
  letter-spacing: .02em;
  border: 1px solid var(--wine);
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.button:hover, input[type=submit]:hover, input[type=button]:hover, .submit-row input:hover, a.button:hover, #content button[type=submit]:hover {
  background: var(--wine-on, #FFF4F2); color: var(--wine-deep);
}
.button.default, input[type=submit].default, .submit-row input.default, .button.is-go, #content button.is-go {
  background: var(--wine); color: #FFFDF8; border-color: var(--wine);
}
.button.default:hover, input[type=submit].default:hover, .submit-row input.default:hover, .button.is-go:hover, #content button.is-go:hover {
  background: var(--wine-deep); color: #FFFDF8;
}
.button[disabled], input[type=submit][disabled], #content button[disabled] { opacity: .45; cursor: not-allowed; }
.submit-row a.deletelink, .submit-row a.closelink {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: transparent;
  color: var(--quiet); border: 1px solid transparent; font-weight: 600; font-size: .86rem;
}
.submit-row a.deletelink:hover { color: var(--red, #B3261E); border-color: currentColor; background: transparent; }
.submit-row {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px 20px;
}
.object-tools a, .object-tools a:link, .object-tools a:visited {
  border-radius: 999px;
  padding: 0 16px;
  min-height: 40px;
  display: inline-flex; align-items: center;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
  background: transparent;
  color: var(--wine);
  border: 1px solid var(--wine);
}
.object-tools a:hover, .object-tools a:focus { background: var(--wine-on, #FFF4F2); color: var(--wine-deep); }
.object-tools a.addlink, .object-tools a.addlink:link, .object-tools a.addlink:visited {           /* adding is the list's one act */
  background: var(--wine); color: #FFFDF8; padding-right: 16px; }
.object-tools a.addlink:hover { background: var(--wine-deep); color: #FFFDF8; }
.object-tools a.historylink { border-color: transparent; color: var(--quiet); }   /* history is the rare thing */
.object-tools a.deletelink { border-color: transparent; color: var(--quiet); }    /* and deleting rarer still: it asks for the day's code */
.object-tools a.deletelink:hover { color: var(--red, #B3261E); background: transparent; }
.object-tools a.addlink::after, .object-tools a.addlink::before { filter: brightness(10); }

/* --- 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;
}
/* The sign-in card is narrow: the bar keeps Back and the wordmark alone, on one line. */
body.login .topbar { padding: 0 16px; }
body.login .topbar-nav, body.login .topbar-right { display: none; }
body.login .wordmark-main { font-size: 1.05rem; white-space: nowrap; }
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(--wine); box-shadow: inset 3px 0 0 var(--wine); }
.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(--wine); border-radius: 999px; background: transparent; color: var(--wine-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(--wine) 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(--wine); }
.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(--wine-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(--wine); border-bottom: 1.5px solid var(--wine);
  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(--wine-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; }

/* --- 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(--wine); border-bottom: 1.5px solid var(--wine);
  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(--wine); border-bottom: 1.5px solid var(--wine);
  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(--wine); }
.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(--wine-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(--wine); 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; }

/* --- 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(--wine-deep); font-size: .74rem; letter-spacing: 0;
}
.column.folded .cards { display: none; }
/* Three layers inside a column: the department, then each team with who leads it. */
.layer-group { padding: 4px 14px 10px; }
.layer-group + .layer-group { border-top: 1px solid var(--rule); }
.layer-title { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.layer-title .column-count { margin-left: 0; }
.layer-group .cards { padding: 10px 0 4px; }
.layer-team { margin: 4px 0 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--gold-soft); }
.layer-team-title { margin: 10px 0 0; font-size: .8rem; font-weight: 600; color: var(--ink); }
.layer-lead { font-weight: 400; color: var(--quiet); font-size: .76rem; margin-left: 8px; }
.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(--wine); }
.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(--wine-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; }

/* --- The Office's search: find a box by name, whichever section it sits in ------------ */
.office-search { position: relative; margin: 0 0 16px; }
.office-search input[type="search"] {
  width: 100%; box-sizing: border-box; padding: 14px 48px 14px 18px; border: 1px solid var(--ink); border-radius: 14px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem;
}
.office-search input[type="search"]:focus { outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.office-search-key {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 6px; font-size: .72rem; color: var(--quiet); pointer-events: none;
}
.pane-found { margin-bottom: 16px; }
.pane-found-count { font-size: .8rem; font-weight: 400; color: var(--quiet); letter-spacing: 0; text-transform: none; margin-left: 10px; }
.screen-where { font-size: .66rem; font-weight: 600; color: var(--quiet); letter-spacing: .1em; }
.screen:hover .screen-where { color: var(--paper); opacity: .75; }

/* --- 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(--wine-deep); font-size: .76rem; font-weight: 600;
}
.pane-tab.is-selected .pane-tab-count { background: var(--wine); 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-audit { justify-content: space-between; }
.screen-audit .screen-count { font-weight: 600; color: var(--wine); }
.screen-audit.is-good .screen-count { color: #2E7D4F; }
.screen-add { font-weight: 400; font-size: 1.3rem; color: var(--wine); line-height: 1; }
.screen:hover .screen-add { color: var(--wine); }

/* 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; }

/* --- The top bar is the house's: designs/topbar.css, the same include as every Office page --- */

/* --- The head of a list: the name on the left, the tools beside it ------------------ */
/* Laid out side by side, never one over the other: the tools sat absolutely on a centred title and covered it as soon as
   they grew (Tag groups' "Fold a label into another", 23 Oct 2026). */
.titles-and-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.titles-and-tools .titles { text-align: left; }
.titles-and-tools .object-tools { position: static; transform: none; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.titles-and-tools .object-tools li { margin: 0; }
/* The actions on ticked rows, as pills: Django's dropdown and Run stay in the form for a browser without the script. */
#changelist .actions.as-pills label, #changelist .actions.as-pills button[name=index] { display: none; }
#changelist .act-pills { display: flex; flex-wrap: wrap; gap: 8px; }
#changelist .actions .act-pills .button {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--wine); background: transparent; color: var(--wine);
  box-shadow: none; font-weight: 600;
}
#changelist .actions .act-pills .button[disabled] { border-color: var(--rule); color: var(--quiet); opacity: 1; }
#changelist .actions .act-pills .button:not([disabled]):hover { background: var(--wine-on, #FFF4F2); }
#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(--wine); 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(--wine-deep); }
#toolbar .search-count { margin-left: 6px; }
#changelist .actions {
  position: static; margin: 8px 0 0; padding: 0; background: transparent;
  min-height: 44px; display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; 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); }
/* The actions go under the search box, at every width, so that neither can cover the other. Pinned to the search line on
   a wide screen they lay over it as soon as the action list grew long (the Stock Vault's, 8 Oct 2026): the dropdown sat on
   the search box and its button, and "5 results" and "0 of 5 selected" were drawn on top of each other. The list is capped
   so a long action name never widens the row. */
#changelist .actions label select { max-width: 340px; }
#toolbar .search-row { flex-wrap: wrap; }
#toolbar #searchbar { min-width: 0; }
#changelist-form { margin-top: 6px; }


/* --- People by level: the lines on the employee form ------------------------------ */
.people-by-level { max-height: 380px; overflow-y: auto; padding: 4px 12px 8px; border: 1px solid var(--border-color, #d8d2c8); border-radius: 10px; background: var(--body-bg, #fff); color: var(--body-fg, var(--ink)); width: min(48em, 100%); }
.people-by-level .pbl-note { margin: 8px 0; font-size: .82rem; color: var(--body-quiet-color, var(--quiet)); }
.pbl-group h4 { margin: 10px 0 4px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--body-quiet-color, var(--quiet)); }
.pbl-group h4 span { font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.pbl-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; }
.pbl-person { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: baseline; padding: 3px 0; font-size: .86rem; cursor: pointer; color: var(--body-fg, var(--ink)); }
.pbl-person .pbl-name { font-weight: 600; }
.pbl-person .pbl-what { grid-column: 2; font-size: .72rem; font-weight: 400; color: var(--body-quiet-color, var(--quiet)); }
.pbl-person input { margin: 0; }
.form-row .people-by-level + .help, .form-row .help.people-help { margin-top: 4px; }

/* Django's admin carries a dark mode of its own (dark_mode.css, and its theme switch). The
   house is paper: the switch's states read the paper tokens too. */
html[data-theme="dark"], html[data-theme="auto"] {
  color-scheme: light;
  --primary: var(--wine-deep); --secondary: var(--wine); --accent: var(--wine); --primary-fg: #FFFDF8;
  --body-fg: var(--ink); --body-bg: var(--paper); --body-quiet-color: var(--quiet); --body-loud-color: var(--ink);
  --header-color: var(--ink); --header-branding-color: var(--ink); --header-bg: var(--surface); --header-link-color: var(--wine-deep);
  --breadcrumbs-fg: var(--quiet); --breadcrumbs-link-fg: var(--wine-deep); --breadcrumbs-bg: var(--surface);
  --link-fg: var(--wine-deep); --link-hover-color: var(--wine); --link-selected-fg: var(--wine);
  --hairline-color: var(--rule); --border-color: var(--rule); --darkened-bg: var(--surface); --selected-bg: var(--gold-soft); --selected-row: var(--gold-soft);
  --button-fg: #FFFDF8; --button-bg: var(--wine-deep); --button-hover-bg: var(--wine); --default-button-bg: var(--ink); --default-button-hover-bg: var(--wine-deep);
  --close-button-bg: var(--quiet); --close-button-hover-bg: var(--ink); --delete-button-bg: #B3261E; --delete-button-hover-bg: #8E1E18;
  --object-tools-fg: #FFFDF8; --object-tools-bg: var(--wine-deep); --object-tools-hover-bg: var(--wine);
  --message-success-bg: #EAF3EA; --message-warning-bg: #FDF0D5; --message-error-bg: #FBE9E7;
}
