:root {
  /* Option B (approved 10/2026): QuickBooks-style dense tables, green accent, blue links. */
  --ink: #393a3d;
  --muted: #6b6c72;
  --paper: #eceef2;
  --card: #ffffff;
  --line: #dcdfe4;
  --line-strong: #babec5;
  --accent: #2ca01c;
  --accent-dark: #108000;
  --accent-soft: #e8f5e6;
  --accent-ink: #ffffff;
  --link: #0077c5;
  --zebra: #eff1f4;
  --th: #eceef1;
  --header: #ffffff;
  --header-ink: #393a3d;
  --danger: #d52b1e;
  --danger-bg: #fdecea;
  --focus: #0077c5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 4px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: var(--ink); }

button { cursor: pointer; }

a { color: var(--accent); font-weight: 600; }

img { display: block; }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--card);
  color: var(--ink);
  padding: 0.35rem 0.6rem;
}

.skip:focus { top: 0.5rem; }

.tg-app-header {
  background: #161616;
  border-bottom: 1px solid #3d3d3d;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tg-app-header .brand h1 { color: #e8e8e8; }

.tg-app-header .brand p { color: #9a9a9a; }

.top {
  background: var(--header);
  color: var(--header-ink);
  padding: 0.7rem 1.15rem 0.55rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand img { width: 36px; height: 36px; }

.brand h1 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 650;
}

.brand p { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.8125rem; }

.top-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.profile { position: relative; }

.profile > button,
.menu button,
.nav a,
.primary,
.secondary,
.danger {
  border-radius: 0.4rem;
}

.profile > button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 0.28rem 0.65rem;
  min-height: 1.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.menu {
  position: absolute;
  right: 0;
  top: 2.15rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 10.5rem;
  padding: 0.25rem;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(28, 25, 20, 0.08);
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 0.4rem 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.menu button:hover, .menu button:focus { background: var(--accent-soft); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  margin-top: 0.65rem;
}

.controls label { color: var(--muted); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.01em; }

.controls select, .controls input, .field input, .field select, .field textarea,
.stack input, .stack select, .stack textarea {
  display: block;
  margin-top: 0.2rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 0.4rem;
  padding: 0.35rem 0.55rem;
  min-height: 2.05rem;
  font-size: 0.875rem;
}

.nav {
  display: flex;
  gap: 0.2rem;
  overflow-x: auto;
  align-items: center;
  padding: 0.45rem 0 0.1rem;
}

.nav:has(.tab-editor) {
  display: block;
  overflow: visible;
}

.nav a {
  flex: 0 0 auto;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
  padding: 0.32rem 0.62rem;
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: 999px;
}

.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px #c9ddd0;
}

main { padding: 1.1rem 1.15rem 2rem; max-width: 76rem; margin: 0 auto; }

.banner {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #efcfc8;
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.ok {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #c9ddd0;
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 0.7rem;
}

.page-head .muted { margin: 0; font-size: 0.8125rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 0.75rem;
}

.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.card h2, .panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel > h2:first-child { margin-bottom: 0.2rem; }

.muted { color: var(--muted); }

.money, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.money { font-weight: 600; }

.stat {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.22rem 0;
  font-size: 0.875rem;
}

.primary, .secondary, .danger {
  border: 1px solid transparent;
  padding: 0.28rem 0.7rem;
  font-weight: 600;
  font-size: 0.8125rem;
  min-height: 1.85rem;
  line-height: 1.2;
}

.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }

.danger { background: var(--danger); color: #fff7f4; border-color: var(--danger); }

.quiet, .nav-edit {
  background: none;
  border: 0;
  padding: 0.15rem 0.1rem;
  min-height: 0;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.tg-app-header .tag {
  color: #9a9a9a;
  font-size: 12px;
  display: block;
  margin-top: 4px;
  font-family: "Oswald", system-ui, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-meta .tag { margin-top: 0; }

.header-meta .version-check { display: contents; }

/* Build hash: small, beside the version. */
.header-meta .commit {
  font-family: "Oswald", system-ui, sans-serif;
  font-size: 10px;
  color: #6f6f6f;
  letter-spacing: .04em;
  margin-left: -8px;
}

.header-meta .commit[hidden],
#new-build[hidden] { display: none; }

#new-build,
#check-updates,
#update-status,
#update-action {
  font-family: "Oswald", system-ui, sans-serif;
  font-size: 12px;
  color: #9a9a9a;
  letter-spacing: .08em;
  text-transform: none;
}

#update-status {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#update-status[hidden],
#update-action[hidden] { display: none; }

#new-build,
#check-updates,
#update-action {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  min-height: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

#check-updates:hover,
#update-action:hover { background: transparent; color: #c8c8c8; }

#sign-out-btn {
  background: #3a3a3a;
  border: 1px solid #3d3d3d;
  color: #e8e8e8;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: normal;
  min-height: 0;
}

#sign-out-btn:hover { background: #484848; color: #e8e8e8; }

.nav-edit { margin-left: 0.35rem; flex: 0 0 auto; }

.toolbar, .fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.field { min-width: 9rem; }

.field.grow { flex: 1 1 14rem; }

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 0.42rem 0.45rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink);
}

th {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.num { text-align: right; }

.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

.login {
  max-width: 24rem;
  margin: 10vh auto;
  padding: 0 1rem 2rem;
}

.login header {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 1rem;
}

.login h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; color: var(--ink); }

.stack { display: grid; gap: 0.65rem; }

.stack label { font-weight: 600; font-size: 0.875rem; color: var(--ink); }

.hint { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }

.invoice-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.invoice-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.55rem 0 0.75rem; }

.checkline { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--ink); }
.checkline select { margin-left: 0.35rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem; }
legend { font-weight: 650; color: var(--ink); padding: 0 0.3rem; }

.flag {
  display: inline-block;
  background: #3a2208;
  color: #fff4d2;
  font-weight: 650;
  border-radius: 0.35rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
}

.diff-ok { color: var(--accent); font-weight: 650; }

.diff-bad { color: var(--danger); font-weight: 650; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Arrange mode (Rj 10/02/2026): boxes are locked by default. Arrange shows a
   small grip in each box's top corner; only the grip starts a drag. */
.drag-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: #a69e90;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  flex: 0 0 auto;
}

.drag-grip svg { display: block; fill: currentColor; }
.drag-grip:hover { color: var(--muted); background: rgba(28, 25, 20, 0.06); }
.drag-grip:active,
.is-dragging .drag-grip { cursor: grabbing; color: var(--accent); }

[data-company-card] { position: relative; }
[data-company-card] > .drag-grip { position: absolute; top: 8px; right: 8px; }
.grid.is-arranging [data-company-card] { outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.grid.is-arranging [data-company-card] h2 { padding-right: 22px; }
.nav-tab > .drag-grip { width: 14px; margin-right: 2px; }
[data-tab-row] { display: flex; align-items: center; gap: 0.35rem; }

.arrange-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
}

.arrange-toggle:hover { color: var(--ink); border-color: var(--line); }
.arrange-toggle.is-on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.page-head-actions { display: inline-flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.nav .arrange-toggle { margin-left: 0.25rem; }

/* Header text links (Ideas, Suggest an idea): 12px Oswald #9a9a9a like Check for updates. */
.header-link {
  font-family: "Oswald", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #9a9a9a;
  letter-spacing: .08em;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.header-link:hover { color: #d0d0d0; }

/* Ideas inbox */
table.ideas td { vertical-align: top; }
table.ideas .idea-text { white-space: pre-wrap; max-width: 480px; }
table.ideas .small { font-size: 0.75rem; }
table.ideas .nowrap { white-space: nowrap; }
.idea-chip {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  margin: 0 3px 3px 0;
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
}

.idea-chip.on.new { background: #e7eef9; border-color: #8aa6d6; color: #23447a; }
.idea-chip.on.planned { background: #fbf1dc; border-color: #d7b46a; color: #6b4b0d; }
.idea-chip.on.done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.idea-chip.on.dismissed { background: #eee9e1; border-color: var(--line-strong); color: var(--muted); }
table.error-reports tr[data-report] { cursor: pointer; }
table.error-reports tr.is-open { background: #e7eef9; }
.report-detail { margin-top: 1rem; }
.report-detail pre {
  background: #f4f6f8;
  color: #1c2430;
  border: 1px solid #dcdfe4;
  padding: 8px 10px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg-btn { background: transparent; border: 0; border-right: 1px solid var(--line); padding: 2px 9px; font-size: 0.75rem; color: var(--muted); cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}


.is-dragging {
  position: fixed;
  z-index: 40;
  margin: 0;
  pointer-events: none;
  box-shadow: 0 14px 32px rgba(28, 25, 20, 0.16);
  cursor: grabbing;
}

.card.is-dragging,
article.is-dragging {
  background: var(--card);
}

.nav-tab.is-dragging {
  background: var(--card);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(28, 25, 20, 0.14);
}

[data-tab-row].is-dragging {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.35rem 0.55rem;
  list-style: none;
}

.drop-placeholder {
  border: 1px dashed #b7c9be;
  border-radius: var(--radius);
  background: rgba(30, 77, 56, 0.06);
  box-sizing: border-box;
}

.nav .drop-placeholder {
  flex: 0 0 auto;
  align-self: stretch;
  border-radius: 999px;
}

body.is-reordering,
body.is-reordering * { cursor: grabbing !important; }

.tab-editor {
  flex: 1 1 100%;
  color: var(--ink);
  padding-top: 0.25rem;
}

.tab-editor p,
.tab-editor label,
.tab-editor li,
.tab-editor .hint { color: var(--ink); }

.tab-editor input,
.tab-editor select {
  color: var(--ink);
  background: #fff;
}

.tab-editor ul {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0.7rem;
  display: grid;
  gap: 0.25rem;
  max-width: 28rem;
}

.tab-editor li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
}

.tab-editor li:hover { background: rgba(30, 77, 56, 0.04); }

.people { display: grid; gap: 0.7rem; }

.person {
  display: flex;
  gap: 0.85rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #d7e4f5;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.person h3 { margin: 0; color: var(--ink); font-size: 1rem; }

.person .email,
.signin,
.grant-detail,
.status { margin: 0.15rem 0; color: var(--ink); font-size: 0.875rem; }

.pills { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.35rem 0; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-weight: 650;
  font-size: 0.75rem;
}

.pill.on { background: var(--accent); color: var(--accent-ink); }

.pill.off { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }

.switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
  cursor: default;
}

.switch input { cursor: pointer; }

.tab-editor .switch,
.tab-editor .switch span { color: var(--ink); }

.person-form {
  display: grid;
  gap: 0.7rem;
  max-width: 42rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem;
  box-shadow: var(--shadow);
}

.person-form input,
.person-form select,
.bill-line input,
.bill-line select,
.pay-bill input,
.pay-bill select {
  color: var(--ink);
  background: #fff;
}

.bill-line {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.pay-bill { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

@media (max-width: 720px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0 0 0.65rem;
    padding: 0.3rem 0.6rem 0.5rem;
  }
  table.cards td {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    border: 0;
    padding: 0.26rem 0;
  }
  table.cards td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
  }
  .num { text-align: right; }
  .bill-line { grid-template-columns: 1fr; }
  .subnav { gap: 0.65rem; }
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: baseline;
  margin: 0 0 0.85rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}

.subnav a { font-size: 0.875rem; text-decoration: none; }

.subnav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.2rem;
}

.flip-card h2 { font-size: 0.95rem; }

.flip-card .status {
  display: inline-block;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.flip-facts { margin-bottom: 0.8rem; }

.flip-facts h3, .sheet-diff h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.flip-photo {
  width: min(100%, 28rem);
  max-height: 16rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.sheet-diff {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin: 0.8rem 0;
}

.notes { white-space: pre-wrap; }

/* Reconcile: register entries for the period, and the quiet discard control. */
.register-head { margin: 1rem 0 0.25rem; font-size: 0.875rem; font-weight: 650; }
.discard-row { margin: 0.75rem 0 0; font-size: 0.8125rem; }
.discard-row [hidden] { display: none; }

/* Card rules on Import: quiet rows, drag with a hand cursor to reorder. */
.card-rules h3 { margin: 0 0 0.25rem; font-size: 0.9375rem; }
.card-rule-list { list-style: none; margin: 0.5rem 0; padding: 0; }
.card-rule {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.card-rule.is-dragging { background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; list-style: none; }
.card-rule-card { font-weight: 650; min-width: 3.5rem; }
.card-rule-actions { margin-left: auto; }
.card-rule-actions button { cursor: pointer; }
.card-rule-form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end; font-size: 0.8125rem; }
.card-rule-form label { display: flex; flex-direction: column; gap: 0.15rem; }
.card-rule-form input:not([type="checkbox"]), .card-rule-form select { min-height: 0; padding: 0.25rem 0.4rem; font-size: 0.8125rem; }
.card-rule-form .card-rule-check { flex-direction: row; align-items: center; gap: 0.3rem; }

/* Register entry editor: quiet Void control with an inline confirm. */
.void-row { margin: 0.75rem 0 0; font-size: 0.8125rem; }
.void-row [hidden] { display: none; }

/* Receipts on entries (Rj 10/02/2026): a quiet icon, never a chunky button. */
.name-with-receipt { display: inline-flex; align-items: center; gap: 0.35rem; }
.receipt-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: 0;
  padding: 0.1rem;
  min-height: 0;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0.25rem;
  line-height: 1;
}
.receipt-icon:hover, .receipt-icon:focus-visible { color: var(--accent); background: var(--accent-soft); }
.receipt-count { font-size: 0.6875rem; font-weight: 600; }
.receipt-list { list-style: none; margin: 0.25rem 0 0.75rem; padding: 0; display: grid; gap: 0.2rem; }
.receipt-list li { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8125rem; }
.receipt-label { text-decoration: none; color: var(--ink); font-weight: 500; }
.receipt-label:hover { text-decoration: underline; }
.receipt-detach { color: var(--muted); font-weight: 500; }
.receipt-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 25, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.receipt-sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(28, 25, 20, 0.28);
  width: min(920px, 100%);
  height: min(88vh, 1100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.receipt-title { display: flex; flex-direction: column; min-width: 0; font-size: 0.875rem; }
.receipt-title strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-title .muted { font-size: 0.75rem; }
.receipt-links { display: flex; align-items: center; gap: 0.9rem; font-size: 0.8125rem; white-space: nowrap; }
.receipt-links a { color: var(--accent); text-underline-offset: 0.16em; }
.receipt-pager { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.75rem; }
.receipt-nav, .receipt-close {
  background: none;
  border: 0;
  min-height: 0;
  padding: 0 0.3rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.receipt-close { font-size: 1.4rem; }
.receipt-nav:hover, .receipt-close:hover { color: var(--ink); }
.receipt-nav:disabled { opacity: 0.3; cursor: default; }
.receipt-body {
  flex: 1;
  min-height: 0;
  background: #ece7dd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.receipt-image { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.receipt-frame { border: 0; width: 100%; flex: 1; background: #fff; }
.receipt-note { font-size: 0.75rem; margin: 0.35rem 0; }
.receipt-review { margin: 0.25rem 0 0.75rem; font-size: 0.8125rem; }
.receipt-review summary { cursor: pointer; color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .receipt-viewer { padding: 0; }
  .receipt-sheet { height: 100%; border-radius: 0; }
  .receipt-head { flex-wrap: wrap; }
}


/* ===== Option B theme · 0.38.0 ===== */
body { font: 13px/1.38 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif; background: #eceef2; color: #393a3d; }
a { color: #0077c5; font-weight: 500; }
main { max-width: none; padding: 10px 16px 28px; }
.top { padding: 0; background: #fff; border-bottom: 1px solid #dcdee2; position: sticky; top: 0; z-index: 15; }
.menubar { display: flex; align-items: stretch; height: 36px; padding: 0 12px; position: relative; }
.menubar .menus { display: flex; align-items: stretch; }
.menubar .mi { position: relative; display: flex; align-items: center; }
.menubar .mi > a, .menubar .mi-btn { display: flex; align-items: center; gap: 3px; height: 100%; padding: 0 12px; color: #393a3d; font-size: 13px; font-weight: 400; text-decoration: none; border: 0; border-bottom: 2px solid transparent; background: none; border-radius: 0; cursor: pointer; }
.menubar .mi > a:hover, .menubar .mi-btn:hover { background: #f4f5f8; }
.menubar .mi.on > a, .menubar .mi.on > .mi-btn { border-bottom-color: #2ca01c; font-weight: 600; color: #000; }
.menubar .mi.open > .mi-btn { background: #eceef1; }
.menubar .mi-btn .ic { color: #6b6c72; }
.menubar .mi > .drag-grip { width: 14px; margin-right: -6px; }
.menubar.is-arranging .mi { outline: 1px dashed #babec5; outline-offset: -4px; }
.dropdown { position: absolute; top: 35px; left: 0; min-width: 280px; background: #fff; border: 1px solid #babec5; border-radius: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 4px 0; z-index: 30; }
.dropdown[hidden] { display: none; }
.di { display: flex; align-items: center; gap: 10px; padding: 5px 14px; min-height: 30px; color: #393a3d; text-decoration: none; font-weight: 400; }
.di:hover, .di:focus-visible { background: #f4f5f8; }
.di .ic { color: #6b6c72; flex: none; }
.di b { display: block; font-weight: 400; font-size: 13px; color: #000; }
.di small { display: block; font-size: 11px; color: #6b6c72; }
.di.hl { background: #e8f5e6; box-shadow: inset 3px 0 0 #2ca01c; }
.di.sep { border-top: 1px solid #dcdee2; margin-top: 3px; }
.mright { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.co-pick { display: inline-flex; align-items: center; gap: 5px; color: #6b6c72; }
.co-pick select { height: 26px; border: 1px solid #babec5; border-radius: 3px; background: #fff; font-size: 12.5px; padding: 0 6px; max-width: 260px; }
.tlink, button.tlink { color: #0077c5; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; padding: 0; font-family: inherit; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; min-height: 0; }
.arrange-toggle { font-size: 12px; padding: 1px 6px; }
.ic { flex: none; vertical-align: middle; }

/* Quiet, small buttons (no chunky buttons). */
.primary, .secondary, .danger, .btn { min-height: 0; height: 26px; padding: 0 10px; border-radius: 3px; font: 600 12px "Segoe UI", system-ui, sans-serif; display: inline-flex; align-items: center; gap: 5px; box-shadow: none; }
.primary { background: #2ca01c; border: 1px solid #2ca01c; color: #fff; }
.primary:hover { background: #108000; border-color: #108000; }
.secondary, .btn { background: #fff; border: 1px solid #8d9096; color: #393a3d; }
.danger { background: #fff; color: #d52b1e; border: 1px solid #d52b1e; }
.quiet { background: none; border: 0; color: #0077c5; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; padding: 0; min-height: 0; }
input, select, textarea { font-size: 13px; }
.stack input, .stack select, .stack textarea, .field input, .field select, .toolbar input, .toolbar select { min-height: 0; height: 28px; padding: 0 7px; border: 1px solid #babec5; border-radius: 3px; background: #fff; }
.stack textarea { height: auto; padding: 5px 7px; }

/* Panels and cards. */
.card, .panel, .w { background: #fff; border: 1px solid #dcdee2; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.panel { padding: 12px 14px; }
.card h2, .panel h2 { font-size: 15px; font-weight: 600; color: #000; letter-spacing: 0; }
.page-head h2 { font-size: 18px; font-weight: 600; color: #000; }
.grid { gap: 12px; }
.card { padding: 10px 12px; }
.card .money, .stat .money { color: #000; }
.banner { background: #fdecea; border: 1px solid #f3b9b3; color: #8a1c12; border-radius: 3px; padding: 6px 10px; }
.ok { background: #e8f5e6; border: 1px solid #b9dfb2; color: #0b6b00; border-radius: 3px; padding: 6px 10px; }
.pill.on { background: #2ca01c; color: #fff; }
.pill.off { background: #fff; color: #393a3d; border: 1px solid #babec5; }

/* Dense QuickBooks tables. */
table { border-collapse: collapse; width: 100%; }
th { background: #eceef1; color: #393a3d; font: 700 11px "Segoe UI", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .02em; height: 28px; padding: 0 8px; text-align: left; border-bottom: 1px solid #d4d7dc; white-space: nowrap; }
td { padding: 4px 8px; border-bottom: 1px solid #dcdfe4; font-size: 13px; }
tbody tr:nth-child(even) td { background: #eff1f4; }
tbody tr:hover td { background: #eef7fd; }
th.num, td.num { text-align: right; }
table.d td { height: 28px; padding: 0 8px; white-space: nowrap; }
table.d tfoot td { font-weight: 700; border-top: 1px solid #8d9096; background: #fff; }
.cut { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.nowrap { white-space: nowrap; }
.pad { padding: 10px 12px; }
.small { font-size: 11.5px; }
.R { color: #108000; font-weight: 700; text-align: center; }
.Rp { color: #8a5a00; font-weight: 700; text-align: center; }
.ib { background: none; border: 0; padding: 2px; color: #6b6c72; cursor: pointer; min-height: 0; }
.ib:hover { color: #0077c5; }

/* Register. */
.reg { padding: 0; overflow: visible; }
.rhead { display: flex; align-items: center; gap: 12px; padding: 10px 12px 8px; flex-wrap: wrap; border-bottom: 1px solid #dcdee2; }
.rhead .rtitle { font-size: 18px; font-weight: 600; color: #000; margin: 0; }
.use-reg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #6b6c72; }
.use-reg select, .rpick { height: 26px; border: 1px solid #babec5; border-radius: 3px; background: #fff; font-size: 13px; padding: 0 6px; }
.eb { display: flex; gap: 22px; margin-left: auto; text-align: right; }
.eb1, .eb2 { display: flex; flex-direction: column; font-size: 11px; color: #6b6c72; }
.eb1 b, .eb2 b { font-size: 16px; color: #000; font-weight: 600; }
.fbar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; flex-wrap: wrap; border-bottom: 1px solid #dcdee2; background: #fafbfc; }
.fbar input, .fbar select { height: 26px; border: 1px solid #babec5; border-radius: 3px; padding: 0 6px; background: #fff; }
.tbox { overflow-x: auto; }
.pg { display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 12px; color: #6b6c72; }
.new-wrap { position: relative; display: inline-flex; }
.btn-new { height: 26px; padding: 0 10px; border: 1px solid #2ca01c; border-radius: 3px; background: #fff; color: #108000; font: 600 12px "Segoe UI", system-ui, sans-serif; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.btn-new:hover { background: #e8f5e6; }
.newdd { position: absolute; top: 29px; right: 0; width: 300px; background: #fff; border: 1px solid #babec5; border-radius: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 4px 0; z-index: 30; text-align: left; }
.newdd[hidden] { display: none; }
.newdd .h, .sheet .h { font: 700 10.5px "Segoe UI", system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; color: #6b6c72; padding: 6px 12px 3px; background: #f4f5f8; }
.ni { display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 12px; font-size: 13px; color: #000; background: none; border: 0; text-align: left; cursor: pointer; min-height: 0; }
.ni:hover, .ni.on { background: #e8f5e6; box-shadow: inset 3px 0 0 #2ca01c; }
.ni .ic { color: #108000; }
.ni small { margin-left: auto; color: #6b6c72; font-size: 11px; }
.nt { border-top: 1px solid #dcdee2; margin-top: 4px; padding: 6px 12px 4px; font-size: 11.5px; color: #393a3d; line-height: 1.45; }
.entry-form { margin: 10px 0; border-left: 3px solid #2ca01c; }
.entry-form .fields { gap: 8px; }

/* Reconcile approval. */
.stack > button.primary, .stack > button.secondary, .stack > button.danger { justify-self: start; width: auto; }
.rec-status { margin: 4px 0 8px; padding: 6px 10px; border-radius: 3px; font-size: 12.5px; }
.rec-status.prepared { background: #fff4dc; border: 1px solid #f1d9a6; color: #6b4b0d; }
.rec-status.locked { background: #e8f5e6; border: 1px solid #b9dfb2; color: #0b6b00; }
.rec-status.open { background: #f4f5f8; border: 1px solid #dcdee2; }
.approve-row { margin: 10px 0 0; font-size: 12.5px; }
.approve-row [hidden] { display: none; }
.approve-row input { height: 24px; border: 1px solid #babec5; border-radius: 3px; padding: 0 6px; width: 12rem; }

/* Charts. */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.w .wh { display: flex; align-items: center; gap: 6px; padding: 8px 12px 4px; }
.w .wh b { font-size: 13px; color: #000; }
.w .wh .m { margin-left: auto; font-size: 11.5px; color: #6b6c72; }
.w svg { display: block; margin: 6px 10px 8px; max-width: calc(100% - 20px); height: auto; }
.lg { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #393a3d; margin-left: 8px; }
.lg i { width: 9px; height: 9px; display: inline-block; }
.cats { padding: 4px 12px 10px; }
.cat { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 84px; gap: 8px; align-items: center; height: 22px; font-size: 12px; }
.cat i { height: 9px; background: #eceef1; border-radius: 2px; display: block; overflow: hidden; }
.cat i b { display: block; height: 100%; background: #c9a54c; }

/* Phone bottom bar and sheets. */
.bottombar { display: none; }
.sheet-dim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow-y: auto; background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.18); padding: 6px 0 calc(18px + env(safe-area-inset-bottom)); z-index: 61; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: #c4c7cc; margin: 2px auto 6px; }
.sheet .ni { height: 42px; font-size: 14px; border-top: 1px solid #dcdfe4; padding: 0 14px; }
.sheet .nt { padding: 8px 14px 0; font-size: 12px; }
.sheet-cancel { display: flex; margin: 10px 14px 0; width: calc(100% - 28px); height: 34px; border: 1px solid #babec5; border-radius: 4px; align-items: center; justify-content: center; background: #fff; color: #393a3d; font-size: 13px; }
.pm-g { font: 700 11px -apple-system, system-ui, sans-serif; letter-spacing: .03em; text-transform: uppercase; color: #6b6c72; padding: 10px 14px 4px; background: #f4f5f8; }
.pm-i { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border-top: 1px solid #dcdfe4; font-size: 14px; color: #000; text-decoration: none; font-weight: 400; }
.pm-i .ic { color: #6b6c72; }
.pm-i small { margin-left: auto; font-size: 11px; color: #6b6c72; }
.pm-i.hl { background: #e8f5e6; }

@media (max-width: 640px) {
  body { font-size: 13.5px; }
  main { padding: 8px 8px calc(70px + env(safe-area-inset-bottom)); }
  .menubar { height: auto; padding: 4px 8px; }
  .menubar .menus, .menubar .mright .tlink, .menubar .arrange-toggle { display: none; }
  .menubar .mright { margin-left: 0; width: 100%; }
  .co-pick { flex: 1; }
  .co-pick select { max-width: none; width: 100%; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid #dcdee2; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bb-i { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; color: #6b6c72; text-decoration: none; background: none; border: 0; padding: 3px 0; min-height: 0; font-weight: 500; }
  .bb-i.on { color: #108000; }
  .bb-new { color: #108000; }
  .rhead { padding: 8px; gap: 6px; display: block; }
  .rhead .rtitle, .rpick { min-width: 0; max-width: 100%; }
  .rpick { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
  .use-reg { display: flex; width: 100%; min-width: 0; }
  .use-reg select { flex: 1; min-width: 0; width: 100%; }
  .rpick .co-name { display: none; }
  .eb { margin-top: 6px; }
  .tbox { max-width: 100vw; }
  .rhead .rtitle h2 { font-size: 17px; margin: 0; }
  .eb { margin-left: 0; width: 100%; justify-content: space-between; text-align: left; }
  /* 0.38.3: the picker row shared the desktop's fixed 26px box, so "Go to Reconcile" spilled onto the balances. */
  .rpick { height: auto; border: 0; border-radius: 0; background: none; padding: 0; align-items: center; }
  .use-reg select { height: 34px; font-size: 15px; }
  .rpick .tlink { min-height: 24px; }
  .eb { position: relative; clear: both; margin-top: 8px; padding-top: 6px; border-top: 1px solid #eef0f2; }
  .fbar .f-date { display: grid; grid-template-columns: 40px 1fr; align-items: center; width: 100%; }
  .new-wrap .newdd { display: none; }
  table.d td, table.d th { padding: 0 5px; }
  table.d .hide-phone { display: none; }
  .cut { max-width: 140px; }
  .charts { grid-template-columns: 1fr; }
}

@media print {
  .tg-app-header, .top, .bottombar, .sheet, .sheet-dim, .fbar, .new-wrap, .pg, .arrange-toggle, .drag-grip, .receipt-icon, .actions { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .panel, .card, .w { border: 0; box-shadow: none; }
  tbody tr:nth-child(even) td { background: #f4f4f4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Date picker · 0.38.2 (Rj 10/03/2026): calendar icon in every date field ===== */
.dp-wrap { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; }
.field .dp-wrap, .stack .dp-wrap, .controls .dp-wrap { display: block; margin-top: 0.2rem; }
.field .dp-wrap > input, .stack .dp-wrap > input, .controls .dp-wrap > input { margin-top: 0; width: 100%; }
.dp-wrap > input { padding-right: 28px !important; }
.dp-btn { position: absolute; right: 1px; top: 50%; transform: translateY(-50%); width: 26px; height: 24px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 2px; background: transparent; color: #6b6c72; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dp-btn:hover { color: #0077c5; background: #eef4fa; }
.dp-btn:focus-visible { outline: 2px solid #0077c5; outline-offset: -2px; }
.dp-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.dp-pop { position: absolute; z-index: 90; width: 252px; background: #fff; border: 1px solid #babec5; border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); padding: 8px; font: 12.5px/1.3 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif; color: #393a3d; }
.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.dp-head select { height: 26px; min-height: 0; border: 1px solid #dcdfe4; border-radius: 3px; padding: 0 4px; background: #fff; font-size: 12.5px; flex: 1; }
.dp-nav { width: 26px; height: 26px; min-height: 0; padding: 0; border: 1px solid #dcdfe4; border-radius: 3px; background: #fff; color: #393a3d; font-size: 16px; line-height: 1; }
.dp-nav:hover { background: #eef4fa; border-color: #0077c5; color: #0077c5; }
.dp-dow, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; }
.dp-dow span { font-size: 11px; color: #6b6c72; font-weight: 600; padding: 2px 0; }
.dp-day { height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; color: #393a3d; font-size: 12.5px; }
.dp-day:hover { background: #e8f5e6; }
.dp-day.dp-out { color: #b4b6bb; }
.dp-day.dp-today { box-shadow: inset 0 0 0 1px #2ca01c; font-weight: 600; }
.dp-day.dp-on { background: #2ca01c; color: #fff; font-weight: 600; }
.dp-foot { display: flex; gap: 12px; justify-content: flex-start; border-top: 1px solid #eceef1; margin-top: 6px; padding-top: 6px; }
.dp-link { border: 0; background: none; padding: 0; min-height: 0; color: #0077c5; font-weight: 500; font-size: 12.5px; }
.dp-link.dp-close { margin-left: auto; color: #6b6c72; }
.dp-pop.dp-sheet { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 10px 10px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.2); font-size: 15px; z-index: 120; }
.dp-sheet .dp-head select { height: 36px; font-size: 15px; }
.dp-sheet .dp-nav { width: 40px; height: 36px; font-size: 20px; }
.dp-sheet .dp-day { height: 42px; font-size: 15px; }
.dp-sheet .dp-dow span { font-size: 12px; }
.dp-sheet .dp-link { font-size: 15px; padding: 6px 0; }
@media (max-width: 640px) {
  .dp-btn { width: 34px; height: 30px; right: 0; }
  .dp-wrap > input { padding-right: 36px !important; }
}
@media print { .dp-btn, .dp-pop { display: none !important; } }

/* ===== Record detail sheet · QuickReport · A/R · invoice status · 0.38.2 ===== */
[data-rec-type] { cursor: pointer; }
tr[data-rec-type]:hover > td, p.stat[data-rec-type]:hover { background: #eef4fa; }
[data-rec-type]:focus-visible { outline: 2px solid #0077c5; outline-offset: -2px; }
.rec-link { text-decoration: underline dotted; }
.rec-viewer { position: fixed; inset: 0; z-index: 70; background: rgba(28, 25, 20, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1.25rem; }
.rec-viewer.rec-qr { z-index: 66; }
.rec-sheet { background: #fff; border: 1px solid #dcdfe4; border-radius: 4px; box-shadow: 0 18px 48px rgba(28, 25, 20, 0.28); width: min(820px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 8px 12px; border-bottom: 1px solid #dcdfe4; background: #fafbfc; }
.rec-title { display: flex; flex-direction: column; min-width: 0; }
.rec-title strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-title .muted { font-size: 12px; }
.rec-links { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.rec-close { background: none; border: 0; min-height: 0; padding: 0 4px; color: #6b6c72; font-size: 22px; line-height: 1; cursor: pointer; }
.rec-close:hover { color: #393a3d; }
.rec-body { padding: 10px 12px 14px; overflow: auto; }
.rec-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 16px; margin: 0 0 8px; }
.rec-fact dt, .rec-memo dt { font-size: 11px; color: #6b6c72; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.rec-fact dd, .rec-memo dd { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.rec-memo { margin: 6px 0 8px; }
.rec-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b6c72; margin: 12px 0 4px; font-weight: 600; }
.rec-lines { width: 100%; }
.rec-lines select, .rec-lines input { width: 100%; height: 26px; border: 1px solid #babec5; border-radius: 3px; padding: 0 6px; background: #fff; }
.rec-receipts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rec-thumb { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #dcdfe4; background: #fff; border-radius: 4px; padding: 4px 8px 4px 4px; min-height: 0; color: #393a3d; font-size: 12.5px; }
.rec-thumb:hover { border-color: #0077c5; }
.rec-thumb-img { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: #f3f4f6; border-radius: 3px; overflow: hidden; color: #6b6c72; }
.rec-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.rec-audit { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.rec-audit li { padding: 2px 0; border-bottom: 1px dotted #eceef1; }
.rec-ro { background: #f6f7f9; border: 1px solid #dcdfe4; border-radius: 3px; padding: 5px 8px; font-size: 12.5px; color: #393a3d; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.rec-foot { border-top: 1px solid #dcdfe4; padding: 8px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fafbfc; }
.rec-qr .fbar { border-bottom: 1px solid #dcdfe4; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 6px; border-radius: 8px; white-space: nowrap; }
.b-paid { background: #e8f5e6; color: #108000; }
.b-open { background: #eef1f5; color: #4a4b50; }
.b-part { background: #fff4d6; color: #8a5a00; }
.b-over { background: #fdecea; color: #b3261e; }
.b-lock { background: #e7eefb; color: #1d4f9c; }
.b-prep { background: #fff4d6; color: #8a5a00; }
.th-sort { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.th-sort.on { color: #0077c5; }
th.num .th-sort { text-align: right; }
.inv-filters .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.pager { margin-left: 12px; }
.ar-cust { cursor: pointer; }
.ar-cust:hover > td { background: #eef4fa; }
.ar-cust .caret { color: #6b6c72; display: inline-block; width: 12px; }
.ar-drill > td { background: #fafbfc; padding: 6px 10px 10px 24px !important; }
tr.tot > td { font-weight: 600; border-top: 1px solid #babec5; }
@media (max-width: 640px) {
  .rec-viewer { padding: 0; align-items: stretch; }
  .rec-sheet { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .rec-head { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .rec-close { font-size: 28px; padding: 0 6px; }
  .rec-facts { grid-template-columns: 1fr 1fr; }
  .rec-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .rec-foot .btn { min-height: 40px; }
  .rec-lines thead { display: none; }
  .rec-lines tr { display: block; border-bottom: 1px solid #eceef1; padding: 4px 0; }
  .rec-lines td { display: flex; justify-content: space-between; gap: 8px; border: 0 !important; padding: 2px 0 !important; }
  .rec-lines td::before { content: attr(data-label); color: #6b6c72; font-size: 11.5px; }
  .ar-table th:nth-child(2), .ar-table td:nth-child(2) { display: none; }
}

/* Inactive accounts (0.38.3) */
tr.is-inactive td { color: #6b6c72; }
.toggle-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.toggle-inline input { width: 16px; height: 16px; margin: 0; }
.acct-status .btn.small { min-height: 0; padding: 2px 8px; font-size: 12px; }

/* Books start (Company settings) and Add account: one compact inline row, no chunky buttons. */
.books-start, .add-account { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 4px 0 12px; }
.books-start .field input { width: 120px; }
.add-account .field input { width: 220px; }
.add-account .checkline { align-self: center; }
.add-account-error { flex-basis: 100%; color: #8a1c1c; }

/* Banking ▸ Pay stubs (Rj 10/04/2026): compact Option B review cards. */
.ps-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.ps-upload input[type="file"] { font-size: 12.5px; }
.ps-card { margin-top: 10px; }
.ps-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.ps-head .muted { font-size: 12px; }
.ps-grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 14px; align-items: start; }
.ps-amounts td:first-child { white-space: normal; }
.ps-amt { width: 96px; height: 24px; text-align: right; border: 1px solid #babec5; border-radius: 3px; padding: 0 6px; font-size: 12.5px; background: #fff; }
.ps-amt.ps-missing { border-color: #d52b1e; background: #fdf3f2; }
.ps-side p { margin: 0 0 6px; }
.ps-notes { margin: 0 0 6px; padding-left: 16px; }
.ps-unread { color: #8a1c12; }
.ps-ok { color: #0b6b00; display: inline-flex; align-items: center; gap: 4px; }
.ps-bad { color: #d52b1e; }
.ps-scroll { overflow-x: auto; margin-top: 8px; }
.ps-lines { min-width: 560px; }
.ps-lines .cut { max-width: 380px; }
.ps-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .ps-grid { grid-template-columns: 1fr; } }
@media print { .ps-upload, .ps-actions button { display: none; } }

/* Company ▸ Closed periods (Rj 10/05/2026): quiet Change link for Rj's admin login, inline edit, change history. */
.closed-act { text-align: right; white-space: nowrap; width: 1%; }
.closed-edit-row > td { background: #f6f7f9; }
.closed-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; padding: 2px 0; }
.closed-edit .field input[name="closedThrough"] { width: 120px; }
.closed-edit .field.grow { flex: 1 1 220px; }
.closed-edit .field.grow input { width: 100%; min-width: 180px; }
.closed-edit [data-role="closed-confirm"] { flex-basis: 100%; color: #3b3d42; }
.closed-log-head { margin: 16px 0 6px; font-size: 13px; }
table.d.small td, table.d.small th { font-size: 12px; }
.notice { background: #eef6ee; border: 1px solid #cfe3cf; color: #1f4d1f; border-radius: 3px; padding: 5px 9px; margin: 6px 0 10px; }
