:root {
  --paper: #ffffff;
  --wash: #eef5f6;
  --ink: #2c3334;
  --muted: #5c6b6e;
  --line: #d4e0e2;
  --pine: #006b78;
  --pine-hover: #005560;
  --amber: #c9892b;
  --rust: #b42318;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--wash);
  color: var(--ink);
  font-family: Lato, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

h1, h2, h3, .font-serif, .brand-name {
  font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 20px;
}
.mark-sm { width: 32px; height: 32px; font-size: 11px; }
.auth-hero .mark { background: rgba(255,255,255,0.15); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25); }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1rem; }
.brand-sub { font-size: 0.75rem; font-weight: 700; color: var(--pine); }
.auth-hero .brand-name,
.auth-hero .brand-sub { color: #fff; }
.auth-hero .brand-sub { opacity: 0.85; }

.nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.nav nav { display: flex; gap: 0.25rem; }
.nav-link {
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--pine); color: #fff; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.client-switch { margin: 0; }
.payroll-switch { display: flex; align-items: center; gap: 0.4rem; }
.client-switch select {
  width: auto;
  min-width: 13rem;
  max-width: 18rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}
.payroll-switch #payroll-year {
  min-width: 5.5rem;
  max-width: 6.5rem;
}

.app-section { margin-bottom: 2.5rem; }
.app-section > h2 { margin-bottom: 0.25rem; }
.app-section > .muted { margin: 0 0 1rem; }

.app-tiles {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.app-tile {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.3rem;
  color: inherit;
  text-decoration: none;
}
a.app-tile:hover {
  border-color: var(--pine);
  text-decoration: none;
}
.app-tile h2 { font-size: 1.5rem; }
.app-tile p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.app-tile .open {
  margin-top: 1rem;
  color: var(--pine);
  font-weight: 700;
  font-size: 0.9rem;
}
.app-tile.later {
  border-style: dashed;
  color: var(--muted);
}
.app-tile.later h2 { color: var(--ink); }

.primary-btn {
  display: inline-block;
  background: var(--pine);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}
a.primary-btn:hover {
  background: var(--pine-hover);
  color: #fff;
  text-decoration: none;
}
.xero-actions { margin: 1rem 0 0; }
.pill {
  display: inline-block;
  background: var(--pine);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.shell {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.page-head { margin-bottom: 1.75rem; }
.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stats div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 0.8rem;
}
.stats strong {
  display: block;
  font-family: "Open Sans", sans-serif;
  font-size: 1.6rem;
  color: var(--pine);
}
.stats span { color: var(--muted); font-size: 0.8rem; }

.filters {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.filters input[type="search"] { flex: 1; }

.count, .muted, .empty { color: var(--muted); }
.count { font-size: 0.85rem; margin: 0 0 0.75rem; }
.empty { padding: 2rem 0; }

input, select, button {
  font: inherit;
  color: var(--ink);
}
input, select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--pine);
}
button {
  background: var(--pine);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.9rem;
}
button:hover { background: var(--pine-hover); }
button.text {
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-weight: 400;
}
button.text:hover { color: var(--ink); background: transparent; }

.stack { display: grid; gap: 0.9rem; }
label { display: grid; gap: 0.3rem; font-size: 0.9rem; }

.auth { background: var(--wash); min-height: 100vh; }
.auth-hero { background: var(--pine); color: #fff; padding: 2rem 1.25rem; }
.auth-hero-inner { max-width: 28rem; margin: 0 auto; }
.auth-body {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.auth-body h1 { margin-bottom: 0.5rem; }
.auth-body button { width: 100%; padding: 0.7rem 1rem; }

.flash {
  background: #fdeceb;
  color: var(--rust);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin: 1rem 0 0;
}
.notice {
  background: #d7eef1;
  color: var(--pine);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin: 1rem 0 0;
}
.notice a { font-weight: 700; text-decoration: underline; }

.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
.log { width: 100%; border-collapse: collapse; }
.log th, .log td {
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.log th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.log tr:last-child td { border-bottom: 0; }
.log a { color: inherit; }
.log a:hover { color: var(--pine); }
.subject { font-weight: 700; }
.meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.when { white-space: nowrap; width: 11rem; }
.num { font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--wash);
  color: var(--muted);
}
.tag-document { background: #d7eef1; color: var(--pine); }
.tag-noise { background: var(--wash); color: var(--muted); }
.tag-query { background: #f8edd9; color: var(--amber); }
.tag-response { background: #e8eef2; color: var(--ink); }
.tag-error { background: #fdeceb; color: var(--rust); }
.tag-draft { background: #f8edd9; color: var(--amber); }
.tag-authorised, .tag-paid { background: #d7eef1; color: var(--pine); }

.corrections {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.corrections h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.corrections ul { margin: 0; padding-left: 1.1rem; color: var(--amber); }

.lines th.num, .lines td.num { text-align: right; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
}
.card + .pdf { margin-top: 0.85rem; }
.section-title { margin: 0 0 0.75rem; }
.card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.pdf-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}
.btn-link {
  font-weight: 700;
  font-size: 0.9rem;
}

dl { margin: 0; display: grid; gap: 0.45rem; }
dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; }
dt { color: var(--muted); font-size: 0.85rem; }
dd { margin: 0; }

.outcome { font-weight: 700; margin: 0 0 0.75rem; }
.outcome.ok { color: var(--pine); }
.bad { color: var(--rust); }

.lines {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.lines th, .lines td {
  text-align: left;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.team-card { margin-bottom: 1rem; }
.team-card h2 { margin-bottom: 0.35rem; }
.add-user {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 8rem auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
}
.add-user button { height: 2.65rem; }
.directory {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.directory li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.directory li:last-child { border-bottom: 0; }
.directory a.dir-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.directory a.dir-row:hover .subject { color: var(--pine); }
.directory a.dir-row .open {
  color: var(--pine);
  font-size: 0.9rem;
  white-space: nowrap;
}
.dir-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}
.ghost-btn {
  background: transparent;
  color: var(--pine);
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}
.ghost-btn:hover { background: var(--wash); color: var(--pine-hover); }
.pw-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.pw-form input {
  width: 9.5rem;
  padding: 0.35rem 0.55rem;
}

.settings-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  max-width: 36rem;
}
.settings-form button { justify-self: start; }
.settings-form textarea {
  width: 100%;
  min-height: 4.5rem;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line, #d8dde6);
  resize: vertical;
}
.cred-rows {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.3rem 1rem;
  margin: 0.75rem 0 0;
  align-items: baseline;
}
.cred-rows dt {
  color: var(--muted);
  font-size: 0.85rem;
}
.cred-rows dd { margin: 0; }
.cred-rows.nmbrs-creds { grid-template-columns: 10.5rem 1fr; }
.cred-redirect { margin-top: 0.75rem; }
.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
}
.inbox-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.inbox-card:last-child { border-bottom: 0; }
.inbox-connect {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.inbox-connect .ghost-btn,
a.ghost-btn {
  display: inline-block;
  text-decoration: none;
}
a.ghost-btn:hover { text-decoration: none; }
.inbox-xero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
  max-width: 36rem;
}
.inbox-xero button { height: 2.65rem; }

.learn-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.learn-jump a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  color: var(--ink);
}
.learn-jump a:hover { border-color: var(--pine); color: var(--pine); }
.learn-jump strong { color: var(--pine); font-weight: 700; }
.learn-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 0 0.35rem;
}
.learn-toolbar input[type="search"] { flex: 1; }
.learn-toolbar .count { margin: 0; white-space: nowrap; }
.learn-actions { margin: 0.85rem 0 0.25rem; }
.learn-actions button { min-width: 10.5rem; }
.cleanup-actions {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.learn-add {
  margin: 0.85rem 0 0.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.learn-add > summary,
.learn-fold > summary,
.mapping-item > summary {
  cursor: pointer;
  list-style: none;
}
.learn-add > summary::-webkit-details-marker,
.learn-fold > summary::-webkit-details-marker,
.mapping-item > summary::-webkit-details-marker { display: none; }
.learn-add > summary,
.learn-fold > summary {
  color: var(--pine);
  font-weight: 700;
}
.learn-fold > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.learn-fold-title {
  display: block;
  font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
}
.learn-fold .muted { margin-top: 0.6rem; }
.mapping-group > summary,
.mapping-item > summary {
  display: block;
  list-style: none;
}
.mapping-group > summary::-webkit-details-marker,
.mapping-item > summary::-webkit-details-marker,
.mapping-group > summary::marker,
.mapping-item > summary::marker {
  display: none;
  content: none;
}
.mapping-group {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
}
.mapping-group-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: var(--wash);
  cursor: pointer;
}
.mapping-group[open] .mapping-group-head {
  border-bottom: 1px solid var(--line);
}
.chevron {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid var(--pine);
  border-bottom: 2px solid var(--pine);
  transform: rotate(-45deg);
  flex: 0 0 auto;
}
.mapping-item .chevron {
  width: 0.38rem;
  height: 0.38rem;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
  border-color: var(--muted);
}
.mapping-group[open] .chevron,
.mapping-item[open] .chevron {
  transform: rotate(45deg);
}
.mapping-group-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--pine);
}
.acct-id {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.acct-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--pine);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.acct-count {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
.acct-name {
  color: var(--pine);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mapping-item {
  padding: 0 0.9rem;
  border-bottom: 1px solid var(--line);
}
.mapping-item:last-child { border-bottom: 0; }
.mapping-item-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0;
}
.mapping-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--ink);
}
.mapping-item-text > summary .subject,
.mapping-item-text > summary .mapping-name { white-space: normal; }
.mapping-item > summary .meta {
  font-size: 0.75rem;
  white-space: nowrap;
}
#mapping-list summary::-webkit-details-marker,
#mapping-list summary::marker {
  display: none;
  content: none;
}
.mapping-item[open] > summary { color: var(--pine); }
.mapping-item.is-off > summary { opacity: 0.55; }
.learning-add {
  display: grid;
  grid-template-columns: 1.4fr 6.5rem 1.1fr 7.5rem 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin: 0.85rem 0 0.25rem;
}
.learning-add button { height: 2.65rem; }
.learning-row {
  display: grid;
  grid-template-columns: 1.4fr 6.5rem 1.1fr 7.5rem;
  gap: 0.65rem 0.75rem;
  align-items: end;
  padding: 0 0 0.9rem;
}
.learning-notes { grid-column: 1 / -1; }
.learning-row .dir-actions { grid-column: 1 / -1; }
.learning-row input,
.learning-row select {
  width: 100%;
  min-width: 0;
}
.learning-rule-add {
  display: grid;
  gap: 0.75rem;
  margin: 0.85rem 0 0.25rem;
}
.learning-rule-add button { justify-self: start; }
.learning-rule {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  padding: 0 0 0.9rem;
}
.learning-rule textarea,
.learning-rule-add textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
}
.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.check input { width: auto; }

.month-wrap { margin-top: 0.75rem; }
.month-grid { font-size: 0.8rem; }
.month-grid th, .month-grid td {
  padding: 0.45rem 0.5rem;
  white-space: nowrap;
}
.month-grid .acct {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  min-width: 11rem;
  white-space: normal;
}
.month-grid thead .acct { z-index: 2; }
.month-grid .credit { color: var(--muted); }
.month-grid .total-row td { border-top: 1px solid var(--line); }
.dept-head {
  margin: 1.2rem 0 0.45rem;
  font-size: 1.05rem;
}
.view-toggle {
  display: flex;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
}
.view-toggle a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.view-toggle a.active { color: var(--pine); }
.loc-tabs {
  flex-wrap: wrap;
  row-gap: 0.35rem;
}
.loc-nav-groups {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.loc-nav-group .view-toggle { margin-top: 0.2rem; }
.loc-nav-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.loc-month { margin-top: 0.85rem; }
.inline-form { display: inline; }
.log.loc-table .num { text-align: right; white-space: nowrap; }
.log.loc-table tr.warn td { background: #fff6f0; }
.log.loc-table.emphasis-table tr.emphasis td {
  font-weight: 700;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
@media (max-width: 560px) {
  .log.loc-table thead { display: table-header-group; }
}
.map-toolbar {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0;
  max-width: 40rem;
}
.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
}
.map-table select { min-width: 12rem; max-width: 18rem; }
.map-table th { white-space: nowrap; }
.map-form { max-width: none; }
.map-form > label { display: grid; gap: 0.35rem; margin: 0 0 1rem; max-width: 28rem; }
.rec-table td.num, .rec-table th.num { text-align: right; }
.rec-diff { background: #f8edd9; }
.rec-diff-amt { color: var(--amber); }
.year-toolbar {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0 0;
  max-width: 10rem;
}
.year-toolbar select { min-width: 7rem; }
.rec-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: end;
  max-width: none;
  margin: 0 0 0.75rem;
}
.rec-toolbar label { min-width: 8rem; }
.rec-toolbar select { min-width: 8rem; width: auto; }
.rec-refresh-actions { margin: 0; }
.rec-refresh-actions .ghost-btn { height: 2.35rem; }
.rec-xero-note { margin: 0 0 0.85rem; }
.rec-months-lede { margin: 0 0 0.65rem; }
.rec-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(3.4rem, 1fr));
  gap: 0.35rem;
  overflow-x: auto;
}
.rec-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  color: var(--muted);
  text-decoration: none;
  min-width: 3.4rem;
}
.rec-month:hover {
  text-decoration: none;
  border-color: var(--pine);
  color: var(--ink);
}
.rec-month .rec-month-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.rec-month .amt {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.rec-month.ok {
  background: var(--wash);
  color: var(--muted);
}
.rec-month.ok .amt { font-weight: 600; }
.rec-month.diff {
  background: #f8edd9;
  border-color: #e6c98a;
  color: var(--ink);
}
.rec-month.diff .amt {
  color: var(--amber);
  font-weight: 700;
}
.rec-month.empty {
  background: var(--paper);
  opacity: 0.7;
}
.rec-month.active {
  box-shadow: 0 0 0 2px var(--pine);
  border-color: var(--pine);
}
.claims-table td { vertical-align: top; }
.claim-empty { background: #f8edd9; }
.claim-empty-note { color: var(--amber); font-weight: 600; }
.claim-uncoded td.claim-xero { box-shadow: inset 3px 0 0 var(--amber); }
.claim-xero-select { min-width: 14rem; max-width: 22rem; }
.claims-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 0.75rem;
}
.claims-coding-form .claims-selector-grid > label {
  max-width: none;
}
.claims-multi {
  width: 100%;
  min-height: 12rem;
  font: inherit;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}
.check-row input { width: auto; }
.bank-txn { margin-bottom: 1rem; }
.bank-txn-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.bank-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.bank-amt.out { color: var(--rust); }
.bank-amt.in { color: var(--pine); }
.bank-status { margin: 0.65rem 0 0; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.bank-work { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.bank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.bank-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.bank-upload input[type="file"] { max-width: 16rem; }
button.primary-btn.bank-push,
.bank-push {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.sniff-list { margin-top: 0.9rem; }
.sniff-list h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.sniff-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.sniff-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.sniff-list li:last-child { border-bottom: 0; }
.bank-loop-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.75rem;
  align-items: center;
  margin: 0 0 1rem;
}
.bank-loop-form { display: inline; }
.bank-proposal {
  background: #f8edd9;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.75rem;
}
.bank-proposal p { margin: 0 0 0.35rem; }
.bank-proposal p:last-child { margin-bottom: 0; }
.shell-wide { max-width: 90rem; }

.loc-summary-card { overflow: hidden; }
.loc-summary-wrap { overflow-x: auto; }
.loc-summary {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "IBM Plex Sans", Lato, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}
.loc-summary th,
.loc-summary td {
  padding: 0.42rem 0.3rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.loc-summary thead th {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  padding-bottom: 0.55rem;
  border-bottom: 1.5px solid #b8c8cb;
}
.loc-summary th.acct,
.loc-summary td.acct {
  text-align: left;
  width: 9.75rem;
  padding-left: 0.2rem;
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
  font-weight: 500;
  letter-spacing: 0;
}
.loc-summary thead th.acct {
  z-index: 2;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.loc-summary .num,
.loc-summary .money {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-weight: 400;
  white-space: nowrap;
}
.loc-summary .money.neg { color: var(--rust); font-weight: 600; }
.loc-summary .money.zero { color: #c5d2d4; }
.loc-summary tr.emphasis td {
  font-weight: 600;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: #f4f8f9;
}
.loc-summary tr.emphasis td.acct {
  background: #f4f8f9;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.loc-summary tr.emphasis + tr td { border-top: 0; }
.loc-summary td.pending-note {
  text-align: left;
  color: var(--muted);
  font-style: italic;
  font-size: 0.75rem;
  font-weight: 400;
}
.loc-summary tbody tr:last-child td { border-bottom: 0; }
.loc-summary th.num:last-child,
.loc-summary td.money:last-child {
  font-weight: 600;
  padding-right: 0.2rem;
}
.loc-summary tr.emphasis td.money:last-child { font-weight: 700; }

.chiro-subtabs { margin: 0.85rem 0 0; }
.director-pct-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 0.85rem 0 1rem;
}
.director-pct-form label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.director-pct-form input[type="number"] {
  width: 5.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "IBM Plex Sans", Lato, sans-serif;
  font-size: 0.95rem;
}
.loc-summary tr.warn td { background: #fff8f4; }
.loc-summary tr.warn td.acct { background: #fff8f4; }
.loc-summary .acct-main {
  display: block;
  font-weight: 500;
}
.loc-summary a.acct-main {
  color: inherit;
  text-decoration: none;
}
.loc-summary a.acct-main:hover,
.loc-summary td.money a:hover {
  text-decoration: underline;
}
.loc-summary td.money a {
  color: inherit;
  text-decoration: none;
}
.loc-summary tr.selected td {
  background: #f0f5f8;
}
.loc-summary tr.selected td.acct {
  background: #f0f5f8;
}
.loc-summary .acct-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  line-height: 1.25;
}
.loc-summary-detail td.money {
  vertical-align: top;
}
.loc-summary .money-amt { display: block; }
.loc-summary .mix-pct {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.loc-summary-detail th.acct,
.loc-summary-detail td.acct {
  width: 14rem;
  min-width: 11rem;
}

@media (max-width: 900px) {
  .loc-summary { font-size: 0.74rem; }
  .loc-summary th,
  .loc-summary td { padding: 0.35rem 0.18rem; }
  .loc-summary th.acct,
  .loc-summary td.acct { width: 7.5rem; }
  .loc-summary-detail th.acct,
  .loc-summary-detail td.acct { width: 9rem; }
}

.log.bank-statement th,
.log.bank-statement td {
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
}
.log.bank-statement .subject { font-size: 0.9rem; }
.cert-paste {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: 700;
}
.cert-paste textarea {
  width: 100%;
  min-height: 12rem;
  font: 0.8rem ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  resize: vertical;
}

@media (max-width: 800px) {
  .stats, .detail-grid, .app-tiles { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: column; }
  .add-user, .inbox-xero, .learning-add, .learning-row { grid-template-columns: 1fr; }
  .directory li { flex-direction: column; }
  .dir-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .stats, .app-tiles { grid-template-columns: 1fr; }
  .log .when, .log thead { display: none; }
  h1 { font-size: 1.75rem; }
}
