:root {
  --bg: #f4f1ea;
  --bg-elev: #fffdf8;
  --ink: #1c1916;
  --muted: #6b645c;
  --line: #e4ddd3;
  --accent: #2457d6;
  --accent-ink: #fff;
  --danger: #b42318;
  --ok: #17663a;
  --warn: #b45309;
  --test: #9a2a22;
  --prod: #17663a;
  --shadow: 0 1px 2px rgba(28, 25, 22, 0.06), 0 8px 24px rgba(28, 25, 22, 0.06);
  --radius: 12px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, #efe7d6 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.45;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.masthead.mode-test {
  background: #fbe4e1;
  border-bottom-color: #e3a39c;
}
.masthead.mode-test .badge.test {
  background: #fff;
  border-color: #e3a39c;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem 0.55rem;
}
.appbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.35rem 1.5rem 0.7rem;
  border-top: 1px solid var(--line);
}
.masthead.mode-test .appbar {
  border-top-color: #e3a39c;
}
.appbar a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}
.appbar a[aria-current="page"],
.nav a[aria-current="page"] { text-decoration: underline; }
.appbar-drop,
.nav-drop { position: relative; }
.appbar-menu,
.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% - 0.1rem);
  left: 0;
  z-index: 30;
  min-width: 14.5rem;
  padding: 0.55rem 0.75rem 0.7rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-menu { right: 0; left: auto; }
.appbar-drop:hover .appbar-menu,
.appbar-drop:focus-within .appbar-menu,
.nav-drop:hover .nav-menu,
.nav-drop:focus-within .nav-menu { display: block; }
.appbar-menu .menu-group { margin: 0.2rem 0 0.65rem; }
.appbar-menu .menu-group:last-child { margin-bottom: 0.15rem; }
.appbar-menu .menu-label,
.nav-soon em {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: normal;
}
.appbar-menu a,
.nav-menu a {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.22rem 0;
  text-decoration: none;
}
.appbar-menu a:hover,
.nav-menu a:hover { text-decoration: underline; }
.nav-soon {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.22rem 0;
}
.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}
.masthead.mode-test .section-tabs { border-top-color: #e3a39c; }
.section-tabs a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.45rem 0 0.4rem;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.section-tabs a:hover { color: var(--ink); text-decoration: none; }
.section-tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.hub-group { margin: 0 0 1.5rem; }
.hub-group > h2 {
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}
.hub-card {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.95rem 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
a.hub-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.hub-card.is-soon { color: var(--muted); }
.hub-card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
}
.hub-card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.35; }
.storebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 1.5rem 0.7rem;
  border-top: 1px solid var(--line);
}
.masthead.mode-test .storebar {
  border-top-color: #e3a39c;
}
.storebar-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.storebar label {
  margin: 0;
  white-space: nowrap;
  font-size: 0.85rem;
}
.storebar .combo {
  flex: 1;
  min-width: 12rem;
  max-width: 42rem;
}
.assist-pdf-drop {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 8.5rem;
  max-width: 11rem;
  padding: 0.35rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #faf7f1;
  cursor: pointer;
  line-height: 1.2;
}
.assist-pdf-drop:hover,
.assist-pdf-drop.dragover {
  border-color: var(--accent);
  background: #eef3ff;
}
.assist-pdf-label {
  font-size: 0.82rem;
  font-weight: 650;
}
.assist-pdf-hint {
  font-size: 0.72rem;
  color: var(--muted);
}
.storebar-add {
  flex-shrink: 0;
}
.storebar-add:empty { display: none; }
#add-record { white-space: nowrap; }
#add-record .add-record-plus { display: none; font-size: 1.25rem; line-height: 1; font-weight: 700; }
#add-record.compact .add-record-label { display: none; }
#add-record.compact .add-record-plus { display: inline; }
#add-record.compact {
  min-width: 2.5rem;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}
.brand {
  font-family: var(--font);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.nav a { color: var(--ink); font-size: 0.92rem; }
.meta { color: var(--muted); font-size: 0.85rem; display: flex; gap: 0.6rem; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge.prod { background: #e8f6ee; color: var(--prod); }
.badge.test { background: #fbe4e1; color: var(--test); }
.badge.pending { background: #fff4d6; color: #9a6700; }
.badge.info { background: #eaf0ff; color: var(--accent); }
.presence { position: relative; }
button.presence-count {
  margin: 0;
  font-family: inherit;
  line-height: inherit;
  appearance: none;
  cursor: help;
}
.presence.presence-many .presence-count { cursor: pointer; }
.presence.presence-many .presence-count:hover { filter: brightness(0.97); }
.presence-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 13rem;
  max-width: 20rem;
  padding: 0.55rem 0.7rem 0.65rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-transform: none;
  letter-spacing: 0;
  pointer-events: none;
}
.presence:not(.presence-many):hover .presence-popover,
.presence:not(.presence-many):focus-within .presence-popover { display: block; }
.presence-title {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.presence-people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.presence-people li {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.22rem 0;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.presence-email {
  font-size: 0.75rem;
  font-weight: 450;
  color: var(--muted);
}
.presence-empty { color: var(--muted); font-weight: 450; }
.presence-overlay-panel { width: min(22rem, 100%); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
main.list-page {
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 0 1rem 4rem; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
}
h1 { font-family: var(--font); font-size: 1.8rem; margin: 0 0 0.35rem; font-weight: 600; }
h2 { font-family: var(--font); font-size: 1.25rem; margin: 0 0 0.75rem; font-weight: 600; }
.lede { color: var(--muted); margin: 0 0 1.25rem; }

label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.85rem 0 0.3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
input.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}
td.money, th.money { text-align: right; font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background: #eef3ff;
  box-shadow: 0 0 0 4px rgba(36, 87, 214, 0.28);
}
.combo:focus-within {
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(36, 87, 214, 0.28);
}
.combo:focus-within input[type="text"] {
  border-color: var(--accent);
  background: #eef3ff;
  outline: none;
  box-shadow: none;
}
.storebar .combo:focus-within input {
  border-width: 2px;
}
.hint { color: var(--muted); font-size: 0.8rem; margin: 0.25rem 0 0; }
.readonly { background: #f6f3ee; color: var(--muted); }

.row-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 1.15rem; flex-wrap: wrap; }
[hidden] { display: none !important; }
button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--ink);
}
button.secondary.is-on, .btn.secondary.is-on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
button.danger, .btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
button:hover, .btn:hover { text-decoration: none; filter: brightness(1.05); }
button.linkish {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  font-weight: 600;
}

.flash {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.document-drop {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: #fff;
  text-align: center;
  color: var(--muted);
}
.document-drop.dragover {
  border-color: var(--accent);
  background: #eef3ff;
}
.document-drop p { margin: 0; }
.doc-patients { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; margin-top: 0.35rem; }
.doc-capture { margin-top: 0.35rem; }
.doc-capture .capture-field { margin-top: 0.35rem; }
.doc-capture .capture-field label { display: block; font-size: 0.85rem; }
.doc-file-name { font-size: 0.85rem; color: var(--muted); }
.flash.error { background: #fdecea; color: var(--danger); }
.flash.ok { background: #e8f6ee; color: var(--ok); }
.flash.info { background: #eaf0ff; color: #1d3f9a; }
.field-error {
  color: var(--danger);
  margin: 0.45rem 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.form-error-list {
  color: var(--danger);
  margin: 1rem 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.form-error-list p { margin: 0.15rem 0; }
.error-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}
.field-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}
.field-control > input,
.field-control > select,
.field-control > textarea,
.field-control > .combo {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
table.data td .field-control > input[type="text"],
table.data td .field-control > select {
  width: auto;
  min-width: 0;
}
input.field-has-error,
select.field-has-error,
textarea.field-has-error,
.combo.field-has-error input[type="text"] {
  border-color: var(--danger);
  background: #fdecea;
}
input.field-has-error:focus,
select.field-has-error:focus,
textarea.field-has-error:focus,
.combo.field-has-error:focus-within input[type="text"] {
  outline-color: var(--danger);
  border-color: var(--danger);
  background: #fdecea;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.22);
}
.combo.field-has-error:focus-within {
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.22);
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap.has-combo { overflow: visible; }
.table-wrap.list-scroll {
  overflow: auto;
  max-height: calc(100vh - 14.5rem);
  max-height: calc(100dvh - 14.5rem);
}
main.list-page .list-scroll {
  max-height: var(--list-max-height, calc(100dvh - 14.5rem));
}
.list-scroll table.data {
  border-collapse: separate;
  border-spacing: 0;
}
.list-scroll table.data thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 var(--line);
}
#receipts-count,
.list-count {
  margin: 0.35rem 0 0;
  min-height: 1.45em;
}
#receipts-sentinel td,
.list-sentinel td { padding: 0; border: none; height: 1px; }
tr.list-fresh {
  animation: list-fresh-fade 2.4s ease;
}
@keyframes list-fresh-fade {
  from { background: #eaf0ff; }
  to { background: transparent; }
}
.list-scroll .pm-head {
  position: sticky;
  top: 0;
  z-index: 3;
}
.list-scroll .pm-head .pm-cell { box-shadow: 0 1px 0 var(--line); }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 0;
}
.sort-btn:hover { filter: none; text-decoration: none; }
th.money .sort-btn { justify-content: flex-end; width: 100%; }
a.sort-btn { text-decoration: none; }
a.sort-btn:hover { text-decoration: none; }
.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.62;
  font-size: 0.55rem;
}
.sort-up, .sort-down { color: var(--muted); opacity: 0.35; }
.sort-btn:hover .sort-up,
.sort-btn:hover .sort-down { opacity: 0.7; }
th.sort-asc .sort-up,
th.sort-desc .sort-down {
  opacity: 1;
  color: var(--ink);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #fff;
}
table.data th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: #faf7f1;
  white-space: nowrap;
}
table.data td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fbf8f2; }

.checklist {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 36rem;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: none; }
.checklist label { margin: 0; font-weight: 500; cursor: pointer; }
.checklist input[type="checkbox"] { width: auto; margin: 0; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
body.form-locked .masthead {
  opacity: 0.72;
}
.toolbar > :first-child {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 7.05rem;
}
.toolbar h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toolbar .lede {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
  height: calc(1.4em * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.toolbar-tools {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: nowrap;
  margin-left: auto;
}
.toolbar-search label { margin-top: 0; }
.toolbar-search {
  position: relative;
  flex: 0 1 22rem;
  width: 22rem;
  min-width: min(16rem, 100%);
  max-width: 100%;
  order: 10;
}
.search-field { position: relative; isolation: isolate; }
.search-field input { padding-right: 2.15rem; position: relative; z-index: 0; }
.icon-btn.search-clear {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  line-height: 0;
  color: var(--muted);
}
.icon-btn.search-clear:hover { color: var(--ink); filter: none; }
.search-clear[hidden] { display: none !important; }
.toolbar-tools > :not(.toolbar-search) { order: 1; }
.toolbar-tools-wide {
  flex: 1 1 100%;
  margin-left: 0;
  min-width: 0;
}
.toolbar-tools-wide > .file-root {
  order: 0;
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0 auto 0 0;
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-all;
}
.file-root code {
  display: inline;
  background: #e7e0d4;
  border: 1px solid #b7aea2;
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  white-space: pre-wrap;
}
.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  white-space: nowrap;
  flex: 0 0 auto;
}
.toolbar-actions:empty,
.toolbar-actions:not(:has(:not([hidden]))) { display: none; }
button:disabled, .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
table.data th.select-col,
table.data td.select-col,
table.data th.view-col,
table.data td.view-col,
table.data th.edit-col,
table.data td.edit-col,
table.data th.recon-col,
table.data td.recon-col {
  width: 2.15rem;
  text-align: center;
  padding-right: 0.15rem;
}
table.data td.view-col { padding-left: 0.45rem; padding-right: 0; }
table.data td.edit-col { padding-left: 0; padding-right: 0.2rem; }
table.data td.recon-col { padding-left: 0; padding-right: 0.2rem; }
.icon-recon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  cursor: help;
}
.icon-recon-ok { color: var(--ok); }
.icon-recon-partial { color: var(--warn); }
.icon-recon-ban { color: var(--danger); }
.icon-btn,
.icon-recon { position: relative; }
.float-tip {
  position: fixed;
  z-index: 250;
  max-width: min(20rem, calc(100vw - 16px));
  width: max-content;
  background: #1c1916;
  color: #fffdf8;
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.float-tip[hidden] { display: none; }
table.data th.pair-col,
table.data td.pair-col {
  width: 3.5rem;
  white-space: nowrap;
}
.icon-btn.view-receipt,
.icon-btn.view-record,
.icon-btn.edit-record {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  line-height: 0;
}
a.icon-btn { text-decoration: none; }
a.icon-btn:hover { text-decoration: none; }
.icon-btn.view-receipt:hover,
.icon-btn.view-record:hover,
.icon-btn.edit-record:hover { color: var(--accent); }
.app-busy {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  align-items: center;
  justify-content: center;
  background: rgba(244, 241, 234, 0.62);
  cursor: progress;
}
html.is-busy,
html.is-busy body { cursor: progress; }
html.is-busy .app-busy { display: flex; }
.app-busy-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1.2rem;
  font-weight: 650;
}
.app-busy-spinner {
  width: 1.2rem;
  height: 1.2rem;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-busy-spin 0.7s linear infinite;
}
@keyframes app-busy-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .app-busy-spinner { animation: none; }
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1.25rem 2rem;
}
.overlay[hidden] { display: none; }
.overlay-nested { z-index: 95; }
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 22, 0.45);
}
.overlay-panel {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: calc(100vh - 6.5rem);
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.4rem 1.4rem;
}
.overlay-panel-wide { width: min(48rem, 100%); }
.overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}
.overlay-head h2 { margin: 0; }
.overlay-close { font-size: 1.45rem; color: var(--ink); }
.overlay-close:hover { color: var(--danger); }
.overlay-meta { color: var(--muted); margin: 0 0 1rem; }
.overlay-section { margin-top: 1rem; }
.overlay-section h3 {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}
.overlay-body .money { font-variant-numeric: tabular-nums; }
tr.line-capture-view td {
  background: #faf7f1;
  padding-top: 0.3rem;
  padding-bottom: 0.55rem;
  border-top: none;
  color: var(--ink);
  font-size: 0.88rem;
}
.overlay-capture {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
}
.overlay-capture-item { min-width: 6rem; }
.reconcile-status-open,
.reconcile-status-partial { color: var(--muted); }
.reconcile-status-matched,
.reconcile-status-reconciled,
.reconcile-status-immediate { color: var(--ok); font-weight: 650; }
.reconcile-status-no-bank-record { color: var(--muted); font-weight: 650; }
button.imported-match-btn {
  background: none;
  border: none;
  font: inherit;
  font-weight: 650;
  color: var(--ok);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
button.imported-match-btn:hover { color: var(--accent); }
.overlay-capture-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.overlay-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}
.choice-dialog {
  z-index: 120;
  align-items: center;
  padding: 1.25rem;
}
.choice-dialog .overlay-panel {
  width: min(26rem, 100%);
  max-height: none;
  overflow: visible;
}
.choice-dialog-msg {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.4;
}
.choice-dialog-caution {
  margin: -0.35rem 0 1.1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: #fdecea;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}
.choice-dialog-wide .overlay-panel {
  width: min(38rem, 100%);
}
.choice-dialog-detail {
  margin: -0.35rem 0 1.1rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: #f7f4ee;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  color: var(--ink);
}
.choice-dialog .overlay-actions {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
}
.choice-dialog .overlay-actions button {
  width: 100%;
  text-align: center;
}
.overlay-facts {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}
.overlay-facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  padding-top: 0.15rem;
}
.overlay-facts dd { margin: 0; }
.overlay-body form { margin: 0; }
.overlay-body .grid-3 { margin-top: 0.15rem; }
.item-name-btn {
  background: none;
  border: none;
  font: inherit;
  font-weight: 650;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}
.item-name-btn:hover { color: var(--accent); }
table.data td.item-name {
  font-weight: 650;
  min-width: 12rem;
}
table.clip-table td.item-name.clip { max-width: none; }
table.data td.item-summary {
  color: var(--muted);
  font-size: 0.9rem;
}
table.data tr.receipt-focus td { background: #eaf0ff; }

table.data.audit-detail { border-collapse: separate; border-spacing: 0; }
table.data.audit-detail tbody tr:hover { background: transparent; }
table.data.audit-detail tbody tr:hover td { filter: none; }
table.data.audit-detail .audit-section-head th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  padding-top: 0.85rem;
  border-bottom-color: rgba(28, 25, 22, 0.12);
}
table.data.audit-detail tr.audit-unchanged td {
  color: var(--muted);
  font-weight: 400;
}
table.data.audit-detail tr.audit-changed td {
  color: var(--ink);
  font-weight: 700;
}
table.data.audit-detail tr.audit-receipt td,
table.data.audit-detail tr.audit-receipt th,
table.data.audit-detail tr.audit-record td,
table.data.audit-detail tr.audit-record th {
  background: #e8eef8;
}
table.data.audit-detail tr.audit-receipt td:first-child,
table.data.audit-detail tr.audit-record td:first-child {
  box-shadow: inset 3px 0 0 #6b86c4;
}
table.data.audit-detail tr.audit-payment.audit-tone-0 td,
table.data.audit-detail tr.audit-payment.audit-tone-0 th {
  background: #e5f4ec;
}
table.data.audit-detail tr.audit-payment.audit-tone-0 td:first-child {
  box-shadow: inset 3px 0 0 #3d8f63;
}
table.data.audit-detail tr.audit-payment.audit-tone-1 td,
table.data.audit-detail tr.audit-payment.audit-tone-1 th {
  background: #d4eadc;
}
table.data.audit-detail tr.audit-payment.audit-tone-1 td:first-child {
  box-shadow: inset 3px 0 0 #2f6f4d;
}
table.data.audit-detail tr.audit-line.audit-tone-0 td,
table.data.audit-detail tr.audit-line.audit-tone-0 th {
  background: #f8eee0;
}
table.data.audit-detail tr.audit-line.audit-tone-0 td:first-child {
  box-shadow: inset 3px 0 0 #c48a3a;
}
table.data.audit-detail tr.audit-line.audit-tone-1 td,
table.data.audit-detail tr.audit-line.audit-tone-1 th {
  background: #f1e0c8;
}
table.data.audit-detail tr.audit-line.audit-tone-1 td:first-child {
  box-shadow: inset 3px 0 0 #a56b24;
}
table.data.audit-detail tr.audit-business td,
table.data.audit-detail tr.audit-business th {
  background: #f3eaf8;
}
table.data.audit-detail tr.audit-business td:first-child {
  box-shadow: inset 3px 0 0 #8a62b3;
}
table.data.audit-detail tr.audit-store td,
table.data.audit-detail tr.audit-store th {
  background: #e8f4f7;
}
table.data.audit-detail tr.audit-store td:first-child {
  box-shadow: inset 3px 0 0 #3d8fa3;
}
table.data.audit-detail tr.audit-model td,
table.data.audit-detail tr.audit-model th {
  background: #eef0f7;
}
table.data.audit-detail tr.audit-model td:first-child {
  box-shadow: inset 3px 0 0 #5d6a99;
}
table.data.audit-detail tr.audit-method td,
table.data.audit-detail tr.audit-method th {
  background: #e9f6ee;
}
table.data.audit-detail tr.audit-method td:first-child {
  box-shadow: inset 3px 0 0 #3d8f63;
}
table.data.audit-detail tr.audit-category td,
table.data.audit-detail tr.audit-category th {
  background: #f7efe6;
}
table.data.audit-detail tr.audit-category td:first-child {
  box-shadow: inset 3px 0 0 #c48a3a;
}
.stack { display: grid; gap: 1rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
.outbox { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; background: #1c1916; color: #f4f1ea; padding: 1rem; border-radius: 8px; overflow: auto; }
.footer-note { margin-top: 1.25rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
.empty { padding: 1.25rem; color: var(--muted); }
.inline-form { display: inline; }
.flag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 0.85rem 0 0.25rem;
}
.flag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  margin: 0;
}
.flag input { width: auto; margin: 0; }
.capture-mode {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 8.5rem;
  font-weight: 500;
  margin: 0;
}
.capture-mode span { font-size: 0.85rem; }
.capture-mode select {
  width: 100%;
  padding: 0.28rem 0.4rem;
  font-weight: 500;
}
.recur-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 16rem));
  align-items: end;
  margin-top: 0.65rem;
}
.recur-options { margin-top: 0.85rem; }
.weekday-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.35rem;
}
table.data input[type="checkbox"] { width: auto; margin: 0; }
table.data tr.inactive td { color: var(--muted); }
table.data td input[type="text"] {
  width: 100%;
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
details.match-rules {
  margin-bottom: 1rem;
}
details.match-rules > summary {
  cursor: pointer;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 600;
  list-style: none;
}
details.match-rules > summary::-webkit-details-marker { display: none; }
details.match-rules > summary::before {
  content: "▸ ";
  color: var(--muted);
  font-family: var(--ui);
  font-weight: 500;
}
details.match-rules[open] > summary::before { content: "▾ "; }
details.match-rules > summary .match-rules-ready {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 0.85rem;
}
details.match-rules h2 {
  font-size: 1.05rem;
  margin: 1.15rem 0 0.4rem;
}
.match-rules-flag {
  margin-top: 1.85rem;
}
.match-rules-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.55rem 0.9rem;
  margin: 0.55rem 0 0.7rem;
}
.match-rules-stats .n {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
}
.match-rules-stats .lbl {
  color: var(--muted);
  font-size: 0.78rem;
}
.match-rules-suggest {
  margin: 0.2rem 0 0.35rem;
  padding-left: 1.15rem;
}
.match-rules-suggest li { margin: 0.3rem 0; }
.match-alias-add .row-actions { margin-top: 0.7rem; }
.reconcile-match-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: sticky;
  top: 0;
  z-index: 4;
}
.reconcile-match-bar .hint { margin: 0; flex: 1 1 16rem; }
.reconcile-match-bar .reconcile-filter {
  flex: 1 1 14rem;
  min-width: 12rem;
  max-width: 22rem;
}
.reconcile-match-bar .reconcile-filter input { width: 100%; }
.reconcile-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.1rem;
  align-items: start;
}
.reconcile-pair .table-wrap { overflow: visible; }
html.is-row-dragging,
html.is-row-dragging body {
  cursor: grabbing;
  user-select: none !important;
  -webkit-user-select: none !important;
}
html.is-row-dragging * { cursor: grabbing !important; }
table.drag-ghost {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  opacity: 0.9;
  margin: 0;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}
.reconcile-pair h2 {
  min-height: 1.7em;
  margin: 0 0 0.4rem;
}
.reconcile-count {
  font-family: var(--ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
table.reconcile-grid {
  table-layout: fixed;
  width: 100%;
}
table.reconcile-grid col.date { width: 6.6rem; }
table.reconcile-grid col.method,
table.reconcile-grid col.account { width: 7.5rem; }
table.reconcile-grid col.money { width: 7.25rem; }
table.reconcile-grid col.actions { width: 4.6rem; }
.reconcile-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  white-space: nowrap;
}
.reconcile-actions .icon-btn {
  width: 1.85rem;
  height: 1.85rem;
}
.reconcile-pending-grid tr.pending-ignore td { color: var(--muted); }
table.reconcile-grid td.date,
table.reconcile-grid th.date,
table.reconcile-pending-grid td.date,
table.reconcile-pending-grid th.date {
  white-space: nowrap;
}
table.reconcile-grid tbody td { height: 2.4rem; }
table.reconcile-grid tbody tr[data-id] {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
table.reconcile-grid tbody tr.dragging { opacity: 0.45; }
table.reconcile-grid tbody tr.amount-match td { background: #e5f4ec; }
table.reconcile-grid tbody tr.drop-ok td {
  background: #c8ead6;
  box-shadow: inset 0 0 0 2px var(--ok);
}
table.reconcile-grid tbody tr.picked td { background: #e8eefc; }
table.reconcile-grid tbody tr.picked.amount-match td { background: #e8eefc; }
table.reconcile-grid tbody tr.pad { cursor: default; }
table.reconcile-grid tbody tr.pad td { background: #f7f4ee; }
table.reconcile-grid tbody tr.pad:hover td { background: #f7f4ee; }
.reconcile-pending {
  margin-top: 1.25rem;
  padding-top: 0.35rem;
}
.reconcile-pending-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.reconcile-pending-bar h2 { margin: 0; }
.reconcile-pending-grid td.pair-mark,
.reconcile-pending-grid th.pair-mark {
  width: 2rem;
  text-align: center;
  color: var(--muted);
}
.reconcile-pending-grid .unmatch-pending {
  white-space: nowrap;
}
table.reconcile-grid td.vendor,
table.reconcile-grid td.method {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.reconcile-grid td.money { white-space: nowrap; }
@media (max-width: 720px) {
  .reconcile-pair { grid-template-columns: 1fr; }
}
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem 1rem; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.totals-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  padding: 0.85rem 1rem;
  background: #faf7f1;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 1rem 0;
}
.totals-bar .figure { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals-bar .figure.off { color: var(--danger); }
.totals-bar .figure.ok { color: var(--ok); }
.compact-table input, .compact-table select {
  padding: 0.35rem 0.45rem;
}
tr.prescription-ended td { color: var(--muted); }
tr.prescription-split td {
  padding: 0;
  height: 0;
  line-height: 0;
  border-top: 3px solid var(--ink);
  background: var(--ink);
}
.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  font-size: 1.1rem;
  cursor: pointer;
}
.icon-btn:hover { color: var(--danger); }
.nav a.active { font-weight: 700; text-decoration: underline; }

.store-date-row,
.desc-date-row {
  display: grid;
  grid-template-columns: 1fr 11.5rem;
  gap: 1rem;
  align-items: end;
}
.store-date-row #store-search,
.store-date-row #receipt_date,
.desc-date-row #description,
.desc-date-row #receipt_date {
  height: 2.55rem;
  box-sizing: border-box;
}
.store-field { margin-bottom: 0.35rem; }
.combo { position: relative; }
.combo .pay-method-search { width: 100%; }
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 16rem;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 30;
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
}
.combo-list li {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.combo-list li:hover,
.combo-list li.active { background: #faf7f1; }
.combo-list li.muted { color: var(--muted); cursor: default; }
.inline-label { margin: 0; font-weight: 600; }
table.money-grid .money-col {
  width: 8.25rem;
  box-sizing: border-box;
}
table.money-grid .date-col { width: 11.5rem; }
table.money-grid .row-action-col { width: 2.2rem; }
table.money-grid tfoot td { background: #faf7f1; font-weight: 600; }
td.flag-cell { text-align: center; }
td.flag-cell input { width: auto; margin: 0; }
tr.line-extra td,
tr.pay-extra td {
  background: #faf7f1;
  padding-top: 0.4rem;
  padding-bottom: 0.55rem;
  border-top: none;
}
.line-capture {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: flex-end;
}
.line-capture .capture-field {
  flex: 0 0 auto;
  min-width: 0;
}
.line-capture .capture-kind-text {
  flex: 1 1 12rem;
  min-width: 12rem;
}
.line-capture .capture-kind-date { width: 10.5rem; }
.line-capture .capture-kind-money { width: 7.5rem; }
.line-capture .capture-kind-integer,
.line-capture .capture-kind-decimal,
.line-capture .capture-miles,
.line-capture .capture-gas,
.line-capture .capture-elec { width: 6.25rem; }
.line-capture .capture-kind-boolean { width: auto; }
.line-capture .capture-kind-catalog,
.line-capture .capture-kind-list,
.line-capture .capture-patient,
.line-capture .auto-field {
  width: var(--picker-width, 11rem);
  max-width: 24rem;
}
.line-capture label {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
}
.line-capture input[type="text"],
.line-capture select {
  min-width: 0;
  width: 100%;
  padding: 0.35rem 0.45rem;
}
.line-capture .capture-kind-boolean input { width: auto; }
.line-capture .line-custom-fields { display: contents; }
.pay-reconcile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
}
.pay-reconcile[hidden] { display: none; }
.pay-reconcile-status { color: var(--ok); font-weight: 650; }
.pay-reconcile-detail { color: var(--muted); }
.pay-reconcile .unmatch-pay { margin-left: auto; }
.amount-stack { display: flex; flex-direction: column; align-items: stretch; gap: 0.25rem; }
input.mismatch,
input.mismatch:focus {
  border-color: #c48a3a;
  background: #fff8ee;
}
.line-confirm {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: #9a6700;
  margin: 0;
  white-space: nowrap;
}
.line-confirm input { width: auto; margin: 0; }
table.money-grid .money-col input.money {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}
table.money-grid .money-col input.money-display {
  background: transparent;
  border-color: transparent;
  font-weight: 700;
  pointer-events: none;
}
.hint .figure { font-weight: 700; }
.hint .figure.off { color: var(--danger); }
.hint .figure.ok { color: var(--ok); }

table.clip-table td.clip {
  position: relative;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.clip-table td.clip.money { max-width: 8rem; }

.report-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.75rem;
}
.report-range label { margin: 0; font-size: 0.82rem; }
.report-range input[type="date"],
.report-range input[type="number"],
.report-range select {
  min-width: 7.5rem;
}
table.report-tree {
  table-layout: fixed;
  width: 100%;
}
.report-tree col.report-name-col { width: auto; }
.report-tree col.report-year-col { width: 9.25rem; }
.report-tree .report-name {
  position: sticky;
  left: 0;
  background: var(--bg-elev);
  z-index: 1;
  white-space: nowrap;
}
.report-tree thead .report-name,
.report-tree tfoot .report-name { z-index: 2; }
.report-tree thead th.money {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink);
}
.report-tree th.money,
.report-tree td.money {
  text-align: right;
  white-space: nowrap;
  padding-left: 0.5rem;
  padding-right: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.report-tree th.money a,
.report-tree td.money a {
  display: block;
  text-align: right;
}
.report-label {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.2rem;
}
.report-toggle,
.report-toggle-spacer {
  flex: 0 0 1.35rem;
  width: 1.35rem;
  height: 1.2rem;
}
.report-check,
.report-check-spacer {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.report-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.report-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.report-tree tr.report-cat th {
  font-weight: 650;
}
.report-tree td.is-zero,
.report-tree th.is-zero { color: var(--muted); }
.report-tree tfoot th,
.report-tree tfoot td {
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.auto-report-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.1rem;
  margin: 0 0 1rem;
  align-items: start;
}
.auto-report-fuel {
  display: grid;
  gap: 0.9rem;
}
.auto-report-panel {
  padding: 1rem 1.15rem;
}
.auto-report-panel h2 {
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}
.auto-report-facts {
  display: grid;
  grid-template-columns: minmax(9rem, 13.5rem) 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.auto-report-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}
.auto-report-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
table.auto-report-table th,
table.auto-report-table td {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.auto-report-table th.money,
table.auto-report-table td.money {
  text-align: right;
}
@media (max-width: 860px) {
  .auto-report-top { grid-template-columns: 1fr; }
}
.tax-report-section { margin: 0 0 1.5rem; }
.tax-report-section > h2 {
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem;
}
.tax-report-section .table-wrap { overflow: auto; }
th.report-check-col,
td.report-check-col {
  width: 2.1rem;
  text-align: center;
  vertical-align: middle;
}
td.report-check-col .report-check,
th.report-check-col .report-check {
  display: inline-flex;
  justify-content: center;
}

@media print {
  .masthead,
  .storebar,
  .app-busy,
  .report-range,
  .toolbar-tools,
  .toolbar-end { display: none !important; }
  body { background: #fff; }
  .toolbar { margin: 0 0 0.75rem; }
  .toolbar > :first-child { min-height: 0; }
  .table-wrap.list-scroll { overflow: visible; height: auto; max-height: none; }
}
