/* myve DMS. Base styles are carried over from myve CC Tracker (same tokens, header, menus, tables,
   panels, popups, login card and palette), trimmed to the rules this app uses. App-specific
   rules are at the end. */
/* Bricolage Grotesque, SIL Open Font License 1.1 (latin subset). */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("bricolage-grotesque.woff2") format("woff2");
}
:root {
  color-scheme: dark;
  --bg: #101114;
  --bg-2: #171a20;
  --bg-3: #21262e;
  --line: rgba(244, 240, 230, 0.1);
  --text: #f4f0e6;
  --muted: #a39e93;
  --faint: #6f6a62;
  --brass: #e4b56a;
  --brass-2: #f3d7a4;
  --brass-fill: #e4b56a;
  --brass-dim: rgba(228, 181, 106, 0.14);
  --red: #ffb0a4;
  --red-dim: rgba(255, 90, 72, 0.18);
  --green: #b7ebcf;
  --green-dim: rgba(120, 190, 150, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --top: rgba(16, 17, 20, 0.78);
  --sheet: rgba(23, 26, 32, 0.92);
  --input: #0e1014;
  --wash: rgba(255, 255, 255, 0.05);
  --wash-soft: rgba(255, 255, 255, 0.025);
  --wash-row: rgba(255, 255, 255, 0.03);
  --stripe: rgba(255, 255, 255, 0.04);
  --stripe-hover: rgba(255, 255, 255, 0.075);
  --danger-line: rgba(255, 176, 164, 0.4);
  --danger-line-soft: rgba(255, 176, 164, 0.25);
  --danger-ring: rgba(255, 176, 164, 0.45);
  --glow: rgba(228, 181, 106, 0.09);
  --selection: rgba(228, 181, 106, 0.35);
  --on-brass: #23190c;
  --radius: 18px;
  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --serif: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
}
html.light {
  color-scheme: light;
  --bg: #f4efe4;
  --bg-2: #fffaf3;
  --bg-3: #efe4d2;
  --line: rgba(62, 44, 18, 0.14);
  --text: #2c241c;
  --muted: #6e5b45;
  --faint: #7a6752;
  --brass: #8a5612;
  --brass-2: #6e4510;
  --brass-dim: rgba(138, 86, 18, 0.14);
  --red: #a33b32;
  --red-dim: rgba(163, 59, 50, 0.12);
  --green: #1d6b43;
  --green-dim: rgba(29, 107, 67, 0.14);
  --shadow: 0 18px 40px rgba(72, 48, 12, 0.08);
  --top: rgba(244, 239, 228, 0.9);
  --sheet: rgba(255, 250, 243, 0.96);
  --input: #fffdf8;
  --wash: rgba(62, 44, 18, 0.06);
  --wash-soft: rgba(62, 44, 18, 0.035);
  --wash-row: rgba(62, 44, 18, 0.05);
  --stripe: rgba(62, 44, 18, 0.045);
  --stripe-hover: rgba(62, 44, 18, 0.08);
  --danger-line: rgba(163, 59, 50, 0.35);
  --danger-line-soft: rgba(163, 59, 50, 0.2);
  --danger-ring: rgba(163, 59, 50, 0.4);
  --glow: rgba(138, 86, 18, 0.12);
  --selection: rgba(138, 86, 18, 0.22);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  background:
    radial-gradient(900px 420px at 8% -10%, var(--glow), transparent 55%),
    var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
::selection { background: var(--selection); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
/* The app's logo (logo.png, as icons/icon-192.png). */
.mark {
  width: 30px;
  height: 30px;
  display: inline-block;
  background: url("icons/icon-192.png") center / contain no-repeat;
}
.save-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.save-btn:hover { color: var(--text); background: var(--wash); }
.save-btn[data-state="pending"], .save-btn[data-state="saving"], .save-btn[data-state="offline"] { color: var(--brass); }
.save-btn[data-state="done"] { color: var(--green); }
.save-btn[data-state="error"] { color: var(--red); }
.save-btn[data-state="saving"] svg { animation: save-spin 0.9s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }
.nav-menu { position: relative; }
.nav-menu > summary {
  list-style: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::marker { content: ""; }
.nav-menu > summary:hover, .nav-menu[open] > summary { color: var(--text); background: var(--wash); }
.shell-status a.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
}
.shell-status a.nav-icon:hover { color: var(--text); background: var(--wash); }
.nav-icon .nav-dot {
  position: absolute;
  top: 7px;
  right: 7px;
}
.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brass);
  flex: 0 0 auto;
}
.nav-drop {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 6;
  width: min(18rem, calc(100vw - 28px));
  padding-top: 8px;
}
.nav-menu[open] > .nav-drop, .nav-menu:hover > .nav-drop { display: block; }
.nav-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: min(70vh, 28rem);
  overflow: auto;
}
.shell-status .nav-panel a, .shell-status .nav-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: inherit;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.shell-status .nav-panel a.on {
  color: var(--text);
  background: var(--brass-dim);
}
.shell-status .nav-panel a:hover, .shell-status .nav-panel button:hover { background: var(--wash); color: var(--brass-2); }
.nav-panel a svg, .nav-panel button svg, .nav-label svg { flex: 0 0 auto; }
.nav-panel form { margin: 0; }
.nav-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 2px;
  color: var(--text);
}
.shell-status .nav-panel a.nav-sub, .shell-status .nav-panel button.nav-sub { padding-left: 40px; }
.shell-status .nav-panel button.on { color: var(--text); background: var(--brass-dim); }
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); margin: 0 0 18px; }
.heading-with-info { display: flex; align-items: center; gap: 10px; }
.heading-with-info h1 { margin: 0; }
.info { cursor: help; }
.info-mark {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.85rem;
  line-height: 1;
}
.info .tip-bubble { white-space: normal; width: min(18rem, 70vw); font-style: normal; }
h2 { font-size: 1.45rem; margin: 0; }
.kicker {
  margin: 0 0 6px;
  color: var(--brass);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kicker a { text-decoration: none; }
.summary, .help, .empty { color: var(--muted); }
.summary { margin-top: -6px; }
.help { margin: 8px 0 0; font-size: 0.92rem; }
.page-head, .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.head-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.more { position: relative; flex: 0 0 auto; }
.more > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::marker { content: ""; }
.more > summary:hover, .more[open] > summary { color: var(--text); background: var(--wash); }
.dots {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}
.more-menu {
  position: absolute;
  z-index: 3;
  right: 0;
  top: calc(100% + 8px);
  min-width: 11rem;
  margin: 0;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.more-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.more-menu a:hover { background: var(--wash); color: var(--brass-2); }
.more-menu a.danger { color: var(--red); }
.more-menu a.danger:hover { color: var(--red); background: var(--red-dim); }
.more-menu form { display: flex; flex-direction: column; gap: 8px; padding: 6px; }
.more-menu input { width: 12rem; }
.more-menu button {
  align-self: stretch;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  padding: 8px 12px;
  box-shadow: none;
}
.more-menu button:hover { background: var(--wash); color: var(--brass-2); }
.more-menu form.theme-toggle, .more-menu form.menu-action { margin: 0; padding: 0; gap: 0; }
.more-menu form.menu-action button { font-weight: inherit; font-size: inherit; }
.theme-toggle .when-light { display: none; }
html.light .theme-toggle .when-dark { display: none; }
html.light .theme-toggle .when-light { display: inline; }
.confirm-pop { position: relative; }
.confirm-pop:not([open]) > form { display: none; }
.confirm-pop > summary {
  list-style: none;
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--red);
  cursor: pointer;
}
.confirm-pop > summary::-webkit-details-marker { display: none; }
.confirm-pop > summary::marker { content: ""; }
.confirm-pop > summary:hover, .confirm-pop[open] > summary { color: var(--red); background: var(--red-dim); }
.confirm-pop[open] > form {
  position: absolute;
  z-index: 6;
  right: 0;
  top: calc(100% + 6px);
  width: min(16rem, calc(100vw - 36px));
  margin: 0;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.confirm-pop[open] > form p { margin: 0; color: var(--muted); }
.confirm-pop button.danger, .icon-pop button.danger {
  border: 1px solid var(--danger-line);
  border-radius: 999px;
  background: transparent;
  color: var(--red);
  box-shadow: none;
  text-align: center;
  width: auto;
}
.merge-confirm { position: relative; display: inline-block; }
.merge-confirm > summary {
  list-style: none;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brass-fill);
  color: var(--on-brass);
  border: 1px solid transparent;
  cursor: pointer;
}
.merge-confirm > summary::-webkit-details-marker { display: none; }
.merge-confirm > summary::marker { content: ""; }
.merge-confirm:not([open]) > .confirm-body { display: none; }
.merge-confirm[open] > .confirm-body {
  position: absolute;
  z-index: 6;
  left: 0;
  bottom: calc(100% + 6px);
  width: min(16rem, calc(100vw - 36px));
  margin: 0;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.merge-confirm .confirm-body p { margin: 0; color: var(--muted); }
a.icon-add[hidden] { display: none !important; }
a.icon-add, button.icon-add, summary.icon-add {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
a.icon-add:hover, a.icon-add:focus-visible, button.icon-add:hover, button.icon-add:focus-visible, summary.icon-add:hover, summary.icon-add:focus-visible { background: var(--wash); color: var(--text); }
summary.icon-add::-webkit-details-marker { display: none; }
summary.icon-add::marker { content: ""; }
.button, button {
  font: inherit;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}
.button, button {
  background: var(--brass-fill);
  color: var(--on-brass);
  border-color: transparent;
}
.button.danger, button.quiet {
  background: transparent;
  color: var(--red);
  border-color: var(--danger-line);
}
button.quiet { color: var(--muted); border-color: var(--line); padding: 8px 10px; }
.text-link { color: var(--brass-2); }
.sheet-wrap, .panel {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sheet-wrap { overflow-x: auto; }
.sheet-wrap.pops { overflow: visible; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
td a { text-decoration: none; }
td a:hover { color: var(--brass-2); }
tr:last-child td, tr:last-child th { border-bottom: 0; }
tbody tr:nth-child(even):not(.group) { background: var(--stripe); }
tbody tr:hover:not(.group) { background: var(--stripe-hover); }
.num, td.num { text-align: right; }
.sheet th.center, .sheet td.center { text-align: center; }
.warn { color: var(--red); }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--brass-2); }
.tip { position: relative; }
.tip-bubble {
  display: none;
  position: absolute;
  z-index: 4;
  left: 0;
  top: calc(100% + 6px);
  white-space: nowrap;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.tip.end .tip-bubble { left: auto; right: 0; }
.tip:hover .tip-bubble, .tip:focus-within .tip-bubble { display: block; }
.tip-bubble.warn { color: var(--red); }
.alert {
  background: var(--red-dim);
  color: var(--red);
  box-shadow: inset 0 0 0 1px var(--danger-line-soft);
}
.emphasis { font-size: 1.25rem; }
.group th {
  background: var(--wash-row);
  color: var(--brass-2);
  letter-spacing: 0.12em;
}
.hint {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--wash);
  color: var(--muted);
}
.status.open { background: var(--green-dim); color: var(--green); }
.status.pending { background: var(--brass-dim); color: var(--brass-2); }
.status.closed { color: var(--faint); }
.status.denied { background: var(--red-dim); color: var(--red); }
.panel { padding: 8px 18px 18px; margin-top: 8px; }
fieldset { border: 0; padding: 8px 0 0; margin: 0; }
legend {
  padding: 0;
  color: var(--brass-2);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 12px;
}
.span-2 { grid-column: 1 / -1; }
label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 0.86rem; }
input, select, output {
  width: 100%;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
}
input[type="date"] { min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; min-height: 2.9rem; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
output { color: var(--brass-2); }
.actions { margin-top: 16px; justify-content: flex-start; }
.choice {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}
.choice input { width: auto; accent-color: var(--brass); }
.banner {
  background: var(--brass-dim);
  color: var(--brass-2);
  border-radius: 12px;
  padding: 10px 12px;
}
.banner.error { background: var(--red-dim); color: var(--red); }
.field-split {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--faint);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.field-split::before, .field-split::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.icon-pop { position: relative; flex: 0 0 auto; }
.icon-pop:not([open]) > form { display: none; }
.icon-button {
  list-style: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  /* Also used on <button>, which brings its own padding. */
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-button::-webkit-details-marker { display: none; }
.icon-button::marker { content: ""; }
.icon-button:hover, .icon-pop[open] > .icon-button { color: var(--text); background: var(--wash); }
.icon-pop > summary.name-button {
  list-style: none;
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: inherit;
}
.icon-pop > summary.name-button::-webkit-details-marker { display: none; }
.icon-pop > summary.name-button::marker { content: ""; }
.icon-pop[open] > summary.name-button { color: inherit; background: transparent; }
.icon-pop[open] > form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: min(16rem, calc(100vw - 36px));
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.icon-pop[open] > form p { margin: 0; color: var(--muted); }
/* Not enough room below: popups.ts opens it above its button. */
details[open] > form.is-above, details[open] > .pop.is-above { top: auto; bottom: calc(100% + 6px); }
.icon-pop > summary.text-button {
  list-style: none;
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--red);
  font: inherit;
  cursor: pointer;
}
.icon-pop > summary.text-button::-webkit-details-marker { display: none; }
.icon-pop > summary.text-button::marker { content: ""; }
.actions-cell { text-align: right; width: 1%; }
.actions-cell .icon-pop { display: inline-block; margin-left: 0; }
.actions-cell { white-space: nowrap; }
.row-icons { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.row-icons > form { margin: 0; }
.sheet td .icon-pop { margin-left: auto; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 800px) {
  .fields { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .top { padding-inline: 14px; }
  main { width: min(1120px, calc(100% - 20px)); }
  .page-head { align-items: flex-start; }
  .nav-drop { width: min(18rem, calc(100vw - 28px)); }
  .heading-with-info { position: relative; }
  .heading-with-info .info.tip { position: static; }
  .heading-with-info .info .tip-bubble {
    left: 0;
    right: auto;
    width: min(18rem, calc(100vw - 36px));
  }
}
.logout { margin: 0; }
.auth-panel { max-width: 460px; }
.icon-pop[open] > .pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: min(18rem, calc(100vw - 36px));
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.icon-pop:not([open]) > .pop { display: none; }
.icon-pop[open] > .pop p { margin: 0; }
.sheet th .info { margin-left: 6px; text-transform: none; letter-spacing: 0; vertical-align: middle; }
.sheet th .tip-bubble { text-transform: none; letter-spacing: 0; font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
/* Colour palette: bottom left of every page */
.palette-dock { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 7; }
.palette-dock .palette-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); color: var(--brass); box-shadow: var(--shadow); cursor: pointer; }
.palette-dock .palette-btn:hover, .palette-dock .palette-btn[aria-expanded="true"] { color: var(--brass-2); border-color: var(--brass); }
.palette-panel { position: absolute; left: 0; bottom: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.palette-panel[hidden] { display: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches .swatch { width: 34px; height: 34px; min-height: 0; padding: 0; border: 2px solid var(--line); border-radius: 50%; cursor: pointer; }
.swatches .swatch:hover { transform: scale(1.08); }
.swatches .swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatches .swatch-default { background: linear-gradient(135deg, #e4b56a 50%, #171a20 50%); }
/* ---------- login (matches Fintracker) ---------- */
main.login { width: auto; min-height: 100vh; display: grid; place-items: center; padding: 16px; margin: 0; }
.login-card {
  width: min(360px, 100%);
  padding: 28px 24px 16px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card .brand { justify-content: center; margin-bottom: 6px; color: var(--brass-2); }
.login-card .brand h1 { margin: 0; font-size: 1.6rem; }
.login-card .mark { flex: none; }
.login-card input { padding: 0 12px; min-height: 36px; }
.login-card input::placeholder { color: var(--muted); opacity: 0.8; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.form-error { color: var(--red); margin: 0; min-height: 1.2em; font-size: 0.9rem; }
.wide { width: 100%; }
.login-card .button, .login-card button.wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
}
.login-card .button.outline { background: transparent; color: var(--text); border-color: var(--line); }
.login-card .button.outline:hover { background: var(--wash); }
.login-card .text-link.center { align-self: center; text-underline-offset: 3px; }
.or { text-align: center; color: var(--muted); font-size: 0.85rem; }
.login-foot { display: flex; justify-content: center; }
.login-foot form { margin: 0; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--wash); }
/* Back: beside the ⋮ action button, as in Fintracker. */
a.icon-add.back-btn { color: var(--muted); }
a.icon-add.back-btn:hover, a.icon-add.back-btn:focus-visible { color: var(--text); }
/* Region filter, as in Fintracker: funnel beside +, words then three-state tick boxes. */
.filter-menu > summary.filter-btn { color: var(--muted); }
.filter-menu > summary.filter-btn.on { color: var(--brass); background: var(--brass-dim); }
.filter-pop { display: flex; flex-direction: column; gap: 2px; width: 260px; max-width: calc(100vw - 32px); max-height: min(70vh, 32rem); overflow-y: auto; }
.more-menu.filter-pop .filter-input { width: 100%; margin-bottom: 4px; padding: 0 12px; min-height: 36px; }
.filter-pop hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.filter-label { margin: 2px 12px; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
/* Form sections (Card, Dates, Fees and limit…): even spacing and a rule between them. */
.panel:has(> fieldset) { padding: 20px 20px 22px; }
.panel > fieldset { padding: 0; min-width: 0; }
/* A floated legend sits on its own line instead of on the fieldset's top border. */
.panel > fieldset > legend { float: left; width: 100%; margin-bottom: 14px; }
.panel > fieldset > legend + * { clear: both; }
.panel > fieldset > .fields { margin-top: 0; }
.panel > fieldset + fieldset { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
button.quiet-link { background: transparent; color: var(--text); border-color: var(--line); }
.merge-confirm > summary.danger-summary { background: transparent; color: var(--red); border-color: var(--danger-line); }
/* Notifications: unread rows in bold, acknowledge icons on the right */
tr.unread td { font-weight: 650; }
.actions-cell form { display: inline-block; margin: 0; }
.head-links form { margin: 0; }

/* ---------- myve DMS ---------- */
.app-root { display: contents; }
button:disabled, .button[aria-disabled="true"] { opacity: 0.5; cursor: default; }
textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
}
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brass); }
input[type="file"] { padding: 8px 12px; color: var(--muted); cursor: pointer; }
/* The browser's own "Choose files" button, in the app's look. */
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--wash); }
button.plain { background: transparent; color: var(--text); border-color: var(--line); }
button.plain:hover { background: var(--wash); }
.sections { display: flex; flex-direction: column; gap: 28px; margin-top: 28px; }
.sections > section > h2 { margin: 0 0 10px; }
.notices { display: grid; gap: 8px; margin: 0 0 18px; }
.notices .banner { margin: 0; }
.banner.ok { background: var(--green-dim); color: var(--green); }

/* Overview: the state and the one big action. */
.hero { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 34px 18px 30px; }
.hero .state-line { margin: 0; font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 600; letter-spacing: -0.02em; }
.hero .count { margin: 0; color: var(--muted); font-size: 1.05rem; }
.hero.is-warning .state-line { color: var(--brass-2); }
.hero.is-grace .state-line, .hero.is-fired .state-line { color: var(--red); }
.hero.is-armed .state-line { color: var(--green); }
button.checkin { min-width: min(20rem, 100%); padding: 18px 44px; font-size: 1.25rem; font-weight: 650; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.hero-actions .icon-pop[open] > .pop { left: 50%; right: auto; transform: translateX(-50%); text-align: left; }
.text-pop > summary { list-style: none; display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); cursor: pointer; }
.text-pop > summary::-webkit-details-marker { display: none; }
.text-pop > summary::marker { content: ""; }
.text-pop > summary:hover, .text-pop[open] > summary { background: var(--wash); }
.text-pop > summary.danger { color: var(--red); border-color: var(--danger-line); }

/* Secrets a person must write down: shown once. */
.secret {
  margin: 0;
  padding: 14px;
  background: var(--input);
  border: 1px solid var(--brass);
  border-radius: 12px;
  color: var(--brass-2);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.7;
  overflow-wrap: anywhere;
  user-select: all;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks label { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 32px; color: var(--text); font-size: 1rem; cursor: pointer; }
.progress { height: 6px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--done, 0%); background: var(--brass); transition: width 0.2s; }
.message { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.foot { margin-top: 44px; color: var(--faint); font-size: 0.82rem; text-align: center; }
.foot a { color: inherit; }
.login-foot { align-items: center; gap: 4px; }
.login-foot .text-link { color: var(--faint); font-size: 0.82rem; text-decoration: none; padding: 0 8px; }
.login-foot .text-link:hover { color: var(--muted); }
.login-card.wide-card { width: min(520px, 100%); }
.login-card p { margin: 0; color: var(--muted); }
.login-card textarea { min-height: 5rem; }

/* "Update ready": pinned to the bottom until the owner reloads. */
.update-bar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 8;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* ---------- found in the browser pass ---------- */

/* Buttons in a row wrap on a narrow screen instead of running off it. */
.actions { flex-wrap: wrap; gap: 10px 12px; }
.actions button, .actions .button, .text-pop > summary, .icon-pop > summary.text-button { white-space: nowrap; }

/* Blocks that follow each other keep one distance. */
.print-area + *, .sheet-wrap + .panel, .panel + .panel, .panel + .sheet-wrap, .sheet-wrap + .sheet-wrap, .banner + .print-area { margin-top: 16px; }

/* A key and value table: the value sits next to its key, not at the far side. */
.sheet th[scope="row"] { width: 17rem; }

/* On a phone a table keeps the columns that matter and lets long text wrap. */
@media (max-width: 640px) {
  .sheet .wide-only { display: none; }
  .sheet td { overflow-wrap: anywhere; }
  /* Short words (an event's name) wrap between words only. */
  .sheet td.words { overflow-wrap: break-word; }
  .sheet th[scope="row"] { width: 45%; }
}

/* A popup opens towards the side that has room (popups.ts sets the class). */
.icon-pop[open] > .pop.from-left, .icon-pop[open] > form.from-left { left: 0; right: auto; }
/* A popup inside a table's action cell took over the cell's "no wrapping, to the right": a
   longer question ran out of its box. */
.icon-pop[open] > .pop, .icon-pop[open] > form { white-space: normal; text-align: left; }
.hero-actions .icon-pop[open] > .pop.from-left { left: 50%; }

/* In a centred card (the emergency page) a confirm is the card's full-width button, and its
   question opens in place instead of hanging over the card's edge. */
.login-card .text-pop { width: 100%; }
.login-card .text-pop > summary { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; }
.login-card .icon-pop[open] > .pop { position: static; width: auto; margin-top: 8px; box-shadow: none; }

/* In a stack the gap already spaces the buttons: no extra margin above them (password prompt). */
.stack > .actions { margin-top: 0; }

/* A bubble may be told to open leftwards on itself or on its holder. */
.tip-bubble.end { left: auto; right: 0; }

/* The (i): plain text inside it wherever it sits, and at the end of a field's label line. */
.info { font-family: var(--sans); font-size: 0.86rem; font-weight: 500; letter-spacing: 0; text-transform: none; line-height: 1.45; }
.info .tip-bubble { color: var(--text); }
h2 > .info, legend > .info { margin-left: 8px; vertical-align: middle; }
label > span:has(> .info) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
label > span > .info .tip-bubble { left: auto; right: 0; }
label .info-mark, legend .info-mark { width: 1.15rem; height: 1.15rem; font-size: 0.74rem; }
.login-card .summary { margin: 0; text-align: center; }

/* The password prompt before a change. */
dialog.ask {
  width: min(22rem, calc(100vw - 32px));
  padding: 18px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
dialog.ask::backdrop { background: rgb(0 0 0 / 0.45); }
dialog.ask p { margin: 0; }
dialog.ask input { padding: 0 12px; min-height: 36px; }

/* The recipient's card: shown once, printed on its own page. */
.print-card { display: grid; gap: 10px; padding: 20px; border: 1px dashed var(--brass); border-radius: var(--radius); }
.print-card h3 { margin: 0; font-family: var(--serif); font-size: 1.2rem; }
.print-card p { margin: 0; }
@media print {
  body { background: #fff; color: #000; padding: 0; }
  body:has(.print-card) .shell-menu, body:has(.print-card) .shell-status, body:has(.print-card) .shell-bar, body:has(.print-card) .palette-dock, body:has(.print-card) .update-bar,
  body:has(.print-card) .foot, body:has(.print-card) main > *:not(.print-area) { display: none !important; }
  .print-card { border: 1px solid #000; color: #000; box-shadow: none; }
  .print-card .secret { color: #000; border-color: #000; background: #fff; }
  .print-card .no-print { display: none; }
}
@media (prefers-reduced-motion: reduce) { .progress > span { transition: none; } }

/* ---------------------------------------------------------------------------
   Shell, the same in every myve app: the menu button (top left) opens the side
   menu; status icons sit at the top right. On phones the side menu is a bar at
   the bottom, with a gear for the theme, settings, and signing out.
   Each app maps the --shell-* colours to its own tokens.
   --------------------------------------------------------------------------- */
:root {
  --shell-nav-w: 264px;
  --shell-bar-h: 62px;
  --shell-tap: 44px;
  --shell-top: 64px;
  /* Where page titles start: the 1120px page column, centred. */
  --shell-page-left: max(16px, calc((100% - 1120px) / 2));
  /* Room that fixed buttons at the bottom keep free (the phone bar). */
  --shell-under: 0px;
}
body.has-shell {
  padding-top: calc(var(--shell-top) + env(safe-area-inset-top));
}
.shell-menu,
.shell-status {
  position: fixed;
  z-index: 40;
  top: calc(10px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  min-height: var(--shell-tap);
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  background: var(--shell-float);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shell-pill-shadow, 0 6px 20px rgba(0, 0, 0, 0.16));
}
.shell-menu {
  z-index: 47;
  left: calc(10px + env(safe-area-inset-left));
  justify-content: center;
  width: var(--shell-tap);
  padding: 0;
  color: var(--shell-text);
  cursor: pointer;
}
.shell-menu:hover {
  background: var(--shell-panel);
}
.shell-status {
  right: calc(10px + env(safe-area-inset-right));
  gap: 2px;
  padding: 0 4px;
}
.shell-status:empty {
  display: none;
}
.shell-scrim {
  position: fixed;
  z-index: 44;
  inset: 0;
  background: var(--shell-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.shell-nav {
  position: fixed;
  z-index: 45;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, var(--shell-nav-w));
  display: flex;
  flex-direction: column;
  padding: calc(var(--shell-top) + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  background: var(--shell-panel);
  border-right: 1px solid var(--shell-line);
  box-shadow: var(--shell-shadow);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 0.2s ease, visibility 0s linear 0.2s;
}
.shell-open .shell-nav {
  transform: none;
  visibility: visible;
  transition: transform 0.2s ease;
}
.shell-open .shell-scrim {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}
/* The site's name: plain text that leads home, in line with the page titles
   (right of the menu button when the page starts further left), top left on
   phones. It scrolls away with the page. */
.shell-title {
  position: absolute;
  z-index: 40;
  top: calc(10px + env(safe-area-inset-top));
  left: max(calc(10px + var(--shell-tap) + 12px + env(safe-area-inset-left)), var(--shell-page-left));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--shell-tap);
  max-width: calc(50% - 90px);
  color: var(--shell-text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.shell-title:hover {
  color: var(--shell-accent);
}
.shell-title img,
.shell-title .mark {
  flex: none;
  width: 24px;
  height: 24px;
}
.shell-title span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shell-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.shell-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--shell-text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  justify-content: flex-start;
  box-shadow: none;
  cursor: pointer;
}
.shell-item svg {
  flex: none;
  color: var(--shell-muted);
}
.shell-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-item:hover {
  background: var(--shell-wash);
}
.shell-item.on {
  background: var(--shell-accent-dim);
  color: var(--shell-accent);
}
.shell-item.on svg {
  color: inherit;
}
.shell-item:focus-visible,
.shell-bar-item:focus-visible,
.shell-title:focus-visible,
.shell-menu:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: -2px;
}
.shell-sub {
  min-height: 36px;
  padding-left: 40px;
  font-size: 0.92rem;
}
.shell-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 2px;
  color: var(--shell-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.shell-label svg {
  flex: none;
}
.shell-sep {
  flex: none;
  height: 1px;
  margin: 8px 10px;
  background: var(--shell-line);
}
.shell-foot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--shell-line);
}
.shell-foot form,
.shell-pop form {
  margin: 0;
}
.shell-pop {
  position: absolute;
  z-index: 46;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  background: var(--shell-panel);
  box-shadow: var(--shell-shadow);
}
.shell-pop[hidden] {
  display: none;
}
/* Theme labels: the toggle names the theme it switches to. */
.shell-when-light {
  display: none;
}
.shell-bar {
  display: none;
}

@media (max-width: 700px) {
  :root {
    --shell-under: calc(var(--shell-bar-h) + env(safe-area-inset-bottom));
  }
  body.has-shell {
    padding-top: calc(60px + env(safe-area-inset-top));
    padding-bottom: calc(var(--shell-bar-h) + env(safe-area-inset-bottom));
  }
  /* The bar holds the menu; only the wiki keeps the menu button, for its drawers. */
  .shell-menu:not(.shell-keep),
  .shell-nav:not(.shell-keep),
  .shell-scrim:not(.shell-keep) {
    display: none;
  }
  .shell-title {
    left: calc(10px + env(safe-area-inset-left));
    max-width: calc(100vw - 170px);
  }
  .shell-bar {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    height: calc(var(--shell-bar-h) + env(safe-area-inset-bottom));
    padding: 4px env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--shell-panel);
    border-top: 1px solid var(--shell-line);
  }
  .shell-bar-item {
    flex: 1 1 0;
    min-width: 0;
    height: 54px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    margin: 0;
    padding: 0 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--shell-muted);
    font: inherit;
    font-size: 0.68rem;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    -webkit-touch-callout: none;
    user-select: none;
  }
  .shell-bar-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .shell-bar-item.on,
  .shell-bar-item[aria-expanded='true'] {
    color: var(--shell-accent);
  }
  .shell-bar .shell-pop {
    left: auto;
    right: 8px;
    bottom: calc(100% + 8px);
    width: min(240px, calc(100vw - 16px));
  }
  .shell-bar-gear {
    position: static;
  }
}

@keyframes shell-fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shell-nav,
  .shell-scrim {
    transition: none;
  }
}

/* Shell colours, from this app's tokens. */
:root {
  --shell-panel: var(--bg-2);
  --shell-float: var(--top);
  --shell-line: var(--line);
  --shell-text: var(--text);
  --shell-muted: var(--muted);
  --shell-accent: var(--brass);
  --shell-accent-dim: var(--brass-dim);
  --shell-wash: var(--wash);
  --shell-shadow: var(--shadow);
  --shell-backdrop: rgba(0, 0, 0, 0.45);
}
html.light {
  --shell-backdrop: rgba(44, 36, 28, 0.28);
  --shell-pill-shadow: 0 6px 20px rgba(72, 48, 12, 0.08);
}
/* Buttons fixed at the bottom stay above the phone bar. */
.palette-dock,
.update-bar { bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--shell-under)); }
@media (max-width: 700px) {
  .palette-dock,
  .update-bar { bottom: calc(var(--shell-under) + 12px); }
}
