/*
  Books
  The ledger pages share the workspace tokens. Money that arrived reads in aurora green,
  overdue money in red, and gold stays for what a person decides: confirming a bank match,
  finishing a reconciliation, the payday spark. Figures align right and keep proportional
  digits, as in the rest of the workspace.
*/

/* Inputs that sit inside tables and rows */
:is(.line-table, .rr-form, .rr-split, .apply-table, .budget-table, .apply-form, .recon-edit, .payment-head, .party-chooser, .send-form, .party-pick, .editor-totals, .quick-form, .dr15-form) :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background-color: var(--panel);
  padding: 6px 10px;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 450;
  transition: border-color .15s, box-shadow .15s
}

:is(.line-table, .rr-form, .rr-split, .apply-table, .budget-table, .apply-form, .recon-edit, .payment-head, .party-chooser, .send-form, .party-pick, .editor-totals, .quick-form, .dr15-form) :is(input, select, textarea):focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 24%, transparent)
}

:is(.line-table, .rr-form, .rr-split, .apply-table, .budget-table, .payment-head, .party-chooser, .party-pick, .editor-totals) select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b857c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px
}

.num input,
input.apply-input {
  text-align: right
}

.negative {
  color: var(--red)
}

button.text-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: .84rem;
  font-weight: 590
}

.text-link.danger {
  color: var(--red);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer
}

.editor-footer-space {
  flex: 1
}

.empty-state {
  padding: 36px 28px;
  display: grid;
  justify-items: start;
  gap: 10px
}

/* New menu */
.new-menu {
  position: relative
}

.new-menu>summary {
  list-style: none
}

.new-menu>summary::-webkit-details-marker {
  display: none
}

.new-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  display: grid;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: books-pop .16s var(--ease-out)
}

.new-menu-list a {
  padding: 8px 11px;
  border-radius: var(--r-sm);
  font-size: .86rem;
  font-weight: 520
}

.new-menu-list a:hover,
.new-menu-list a:focus-visible {
  background: var(--hover)
}

@keyframes books-pop {
  from { opacity: 0; transform: scale(.96) translateY(-2px) }
  to { opacity: 1; transform: none }
}

/* Money bar on Sales and Expenses */
.money-bar {
  margin: 0 0 18px;
  padding: 18px 22px 20px
}

.money-bar-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 24px;
  margin-bottom: 14px
}

.money-seg {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-radius: var(--r-sm)
}

.money-seg small {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  color: var(--secondary)
}

.money-seg small i,
.mini-bar-key i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  flex: none
}

.money-seg strong {
  font-size: 1.35rem;
  font-weight: 580;
  font-stretch: 106%;
  letter-spacing: -.03em
}

.money-seg span {
  font-size: .76rem;
  color: var(--sub)
}

.money-seg:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em
}

.seg-overdue {
  color: var(--red)
}

.seg-open {
  color: var(--secondary)
}

.seg-paid {
  color: var(--green)
}

.money-seg strong,
.money-seg span {
  color: var(--ink)
}

.money-seg span {
  color: var(--sub)
}

.money-bar-track,
.mini-bar {
  display: flex;
  gap: 3px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line-soft)
}

.money-bar-track i,
.mini-bar i {
  display: block;
  min-width: 4px;
  background: currentColor
}

.money-bar-track i.seg-open,
.mini-bar i.seg-open {
  background: color-mix(in oklch, var(--secondary) 55%, var(--line))
}

/* Document page */
.doc-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px
}

.doc-origin {
  font-size: .8rem;
  color: var(--sub)
}

.doc-void {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -10px 0 18px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--red-bg);
  color: var(--red);
  font-size: .86rem
}

.doc-void .icon {
  width: 16px;
  height: 16px
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start
}

.doc-side {
  display: grid;
  gap: 14px;
  position: sticky;
  top: calc(var(--top-h) + 16px)
}

.doc-layout:not(:has(.doc-side > *)) {
  grid-template-columns: minmax(0, 1fr)
}

.doc-layout:not(:has(.doc-side > *)) .doc-side {
  display: none
}

.side-panel {
  padding: 18px 20px
}

.side-panel>h2,
.side-panel>summary {
  margin-bottom: 10px
}

.side-panel .mini-row {
  padding-inline: 0
}

.side-note {
  font-size: .84rem;
  color: var(--secondary);
  margin: 10px 0
}

.side-panel > :is(p, .field) + .actions {
  margin-top: 12px
}

.side-tools {
  padding: 0 4px
}

.ledger-panel>summary,
.danger-zone>summary,
.recon-edit>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  font-weight: 600;
  font-size: .92rem;
  margin: 0
}

.ledger-panel>summary::-webkit-details-marker,
.danger-zone>summary::-webkit-details-marker,
.recon-edit>summary::-webkit-details-marker {
  display: none
}

.ledger-panel>summary .icon,
.danger-zone>summary .icon,
.recon-edit>summary .icon {
  width: 16px;
  height: 16px;
  color: var(--sub);
  transition: transform .2s var(--ease-out)
}

.ledger-panel[open]>summary .icon,
.danger-zone[open]>summary .icon,
.recon-edit[open]>summary .icon {
  transform: rotate(180deg)
}

.ledger-panel[open]>summary,
.danger-zone[open]>summary {
  margin-bottom: 12px
}

.ledger-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem
}

.ledger-mini :is(td, th) {
  padding: 7px 0;
  background: none
}

.ledger-mini :is(td, th):first-child {
  padding-left: 0
}

.ledger-mini :is(td, th):last-child {
  padding-right: 0
}

.ledger-mini tfoot :is(td, th) {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--secondary);
  font-weight: 560
}

.doc-steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0
}

.doc-steps li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  position: relative;
  padding: 0 0 14px
}

.doc-steps li:last-child {
  padding-bottom: 0
}

.doc-steps li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: -2px;
  width: 2px;
  background: var(--line)
}

.doc-steps li:last-child::before {
  display: none
}

.doc-steps li.done::before {
  background: color-mix(in oklch, var(--green) 45%, var(--line))
}

.doc-steps i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  margin-top: 1px
}

.doc-steps li.done i {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px var(--panel)
}

.doc-steps li.partial i {
  border-color: var(--gold-deep);
  background: linear-gradient(90deg, var(--gold-deep) 50%, var(--panel) 50%);
  box-shadow: inset 0 0 0 3px var(--panel)
}

.doc-steps span {
  display: grid;
  font-size: .88rem;
  font-weight: 580
}

.doc-steps small {
  font-weight: 450;
  font-size: .78rem;
  color: var(--sub)
}

.apply-form,
.send-form,
.void-form {
  display: grid;
  gap: 10px;
  margin-top: 6px
}

.apply-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  align-items: center;
  gap: 10px;
  font-size: .84rem
}

.share-link input {
  font-size: .78rem !important
}

.estimate-state {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  font-size: .82rem;
  color: var(--secondary)
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--hover);
  gap: 3px
}

.segmented button {
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  padding: 6px 8px;
  font-size: .8rem;
  font-weight: 560;
  color: var(--secondary);
  transition: background-color .15s, color .15s
}

.segmented button.on {
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow)
}

.danger-zone .muted {
  font-size: .78rem
}

.doc-summary {
  overflow: hidden
}

.doc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px 24px;
  padding: 20px 22px
}

.doc-facts div {
  min-width: 0
}

.doc-facts .wide {
  grid-column: 1 / -1
}

.doc-facts dt {
  font-size: .76rem;
  color: var(--sub)
}

.doc-facts dd {
  margin-top: 3px;
  font-size: .9rem;
  font-weight: 540;
  overflow-wrap: anywhere
}

.doc-facts .doc-amount {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.03em
}

.side-panel .doc-facts {
  padding: 0;
  grid-template-columns: 1fr
}

/* The document as paper */
.doc-paper {
  background: oklch(.997 .002 84);
  color: oklch(.255 .012 70);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4.5vw, 56px);
  min-width: 0;
  --paper-sub: oklch(.535 .011 72);
  --paper-line: oklch(.906 .008 80)
}

.doc-paper.voided {
  opacity: .62
}

.paper-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid oklch(.255 .012 70)
}

.paper-from {
  display: grid;
  gap: 3px;
  font-size: .82rem;
  color: var(--paper-sub)
}

.paper-from b {
  font-size: 1.02rem;
  color: oklch(.255 .012 70);
  font-weight: 640;
  letter-spacing: -.01em
}

.paper-title {
  text-align: right
}

.paper-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 620;
  font-stretch: 112%;
  letter-spacing: -.04em;
  line-height: 1
}

.paper-number {
  display: block;
  margin-top: 6px;
  font-size: .86rem;
  color: var(--paper-sub)
}

.paper-parties {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 22px 0
}

.paper-parties>div {
  display: grid;
  gap: 2px;
  font-size: .88rem
}

.paper-parties small,
.paper-pay small {
  font-size: .74rem;
  color: var(--paper-sub);
  margin-bottom: 2px
}

.paper-address {
  color: var(--paper-sub)
}

.paper-dates {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 18px;
  font-size: .86rem;
  align-content: start
}

.paper-dates div {
  display: contents
}

.paper-dates dt {
  color: var(--paper-sub);
  text-align: right
}

.paper-dates dd {
  font-weight: 560
}

.paper-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem
}

.paper-lines th {
  background: none;
  color: var(--paper-sub);
  font-size: .74rem;
  font-weight: 560;
  text-align: left;
  padding: 10px 0;
  border-top: 0;
  border-bottom: 1px solid var(--paper-line)
}

.paper-lines .num {
  text-align: right
}

.paper-lines td {
  padding: 13px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--paper-line)
}

.paper-lines :is(td, th):first-child {
  padding-left: 0
}

.paper-lines :is(td, th):last-child {
  padding-right: 0
}

.paper-lines :is(td, th)+:is(td, th) {
  padding-left: 18px
}

.paper-lines td span {
  display: block;
  color: var(--paper-sub);
  font-size: .82rem;
  margin-top: 2px;
  white-space: normal
}

.paper-lines td em {
  display: inline-block;
  margin-top: 4px;
  font-style: normal;
  font-size: .7rem;
  color: var(--paper-sub);
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  padding: 0 5px
}

.paper-lines tbody tr:hover {
  background: none
}

.paper-totals {
  margin: 18px 0 0 auto;
  width: min(320px, 100%);
  display: grid;
  gap: 8px;
  font-size: .88rem
}

.paper-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px
}

.paper-totals dt {
  color: var(--paper-sub)
}

.paper-totals .paper-total {
  padding-top: 10px;
  border-top: 1px solid var(--paper-line);
  font-weight: 640;
  font-size: 1rem
}

.paper-totals .paper-total dt,
.paper-totals .paper-due dt {
  color: inherit
}

.paper-totals .paper-due {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: oklch(.955 .03 85);
  font-weight: 650;
  font-size: 1.02rem
}

.paper-message {
  margin-top: 28px;
  font-size: .9rem;
  color: oklch(.43 .012 70);
  max-width: 62ch
}

.paper-pay {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--paper-line);
  display: grid;
  font-size: .86rem
}

/* Document editor */
.doc-editor {
  display: grid;
  gap: 16px
}

.editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(170px, .5fr);
  gap: 18px 24px;
  padding: 20px 22px
}

.editor-who,
.editor-when {
  display: grid;
  gap: 12px;
  align-content: start
}

.editor-when {
  grid-template-columns: repeat(2, minmax(0, 1fr))
}

.editor-who textarea {
  height: 78px !important
}

.party-pick {
  display: flex;
  gap: 8px
}

.party-pick select {
  flex: 1
}

.party-pick .small-btn {
  height: 36px
}

.editor-balance {
  text-align: right;
  display: grid;
  align-content: start;
  gap: 2px
}

.editor-balance small {
  font-size: .78rem;
  color: var(--secondary)
}

.editor-balance strong {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 600;
  font-stretch: 108%;
  letter-spacing: -.04em;
  line-height: 1.1;
  overflow-wrap: anywhere
}

.editor-lines {
  overflow: hidden
}

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

.line-table.line-table {
  white-space: normal
}

.line-table th {
  white-space: nowrap
}

.line-table td {
  padding: 8px 6px;
  vertical-align: top
}

.line-table td:first-child,
.line-table th:first-child {
  padding-left: 16px
}

.line-table td:last-child,
.line-table th:last-child {
  padding-right: 12px
}

.line-table tbody tr:hover {
  background: none
}

.line-table .col-n {
  width: 34px;
  color: var(--sub);
  font-size: .78rem;
  padding-top: 17px
}

.line-table tbody {
  counter-reset: line
}

.line-table tbody tr:not([hidden]) {
  counter-increment: line
}

.line-n::before {
  content: counter(line)
}

.line-table .col-target {
  width: 26%;
  min-width: 190px
}

.line-table .col-desc {
  min-width: 180px
}

.line-table .col-qty {
  width: 84px
}

.line-table .col-rate {
  width: 112px
}

.line-table .col-amount {
  width: 128px
}

.line-table .col-tax {
  width: 46px;
  text-align: center
}

.line-table .col-dept {
  width: 150px
}

.line-table .col-name {
  width: 170px
}

.line-table .col-x {
  width: 40px;
  padding-top: 10px
}

.line-table .col-x .icon-btn {
  width: 30px;
  height: 30px;
  opacity: .55
}

.line-table tr:hover .col-x .icon-btn,
.line-table .col-x .icon-btn:focus-visible {
  opacity: 1
}

.tax-check {
  display: inline-grid;
  place-items: center;
  height: 36px
}

.line-row.invalid td {
  background: color-mix(in oklch, var(--red-bg) 55%, transparent)
}

.line-table .errorlist {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: .74rem;
  color: var(--red)
}

.row-error {
  font-size: .74rem;
  color: var(--red)
}

.editor-lines-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line-soft)
}

.editor-totals {
  display: grid;
  gap: 8px;
  min-width: min(340px, 100%);
  font-size: .9rem
}

.editor-totals div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px
}

.editor-totals dt {
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap
}

.editor-totals .tax-row select {
  width: 190px;
  height: 32px;
  font-size: .8rem
}

.editor-totals .grand {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 650;
  font-size: 1.02rem
}

.editor-totals .grand dt {
  color: var(--ink)
}

.editor-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  padding: 20px 22px
}

.editor-notes textarea {
  height: 88px !important
}

.editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -2px;
  padding: 12px 2px 14px;
  background: linear-gradient(transparent, var(--bg) 22%);
  display: flex;
  gap: 8px
}

.quick-dialog {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-lg)
}

.quick-dialog::backdrop {
  background: oklch(.2 .01 70 / .32)
}

.quick-dialog[open] {
  animation: books-pop .18s var(--ease-out)
}

.quick-form {
  display: grid;
  gap: 14px;
  padding: 22px
}

.quick-form .field input {
  height: 38px
}

/* Payments */
.party-chooser {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 18px 22px;
  margin-bottom: 16px
}

.party-chooser .field {
  min-width: min(320px, 100%)
}

.party-glance {
  display: grid;
  justify-items: end;
  gap: 1px
}

.party-glance small,
.party-glance span {
  font-size: .78rem;
  color: var(--sub)
}

.party-glance strong {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.03em
}

.payment-form {
  display: grid;
  gap: 16px
}

.payment-head {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px 18px;
  padding: 20px 22px
}

.payment-head .wide {
  grid-column: 1 / -1
}

.payment-head .amount-field input {
  font-size: 1.05rem !important;
  font-weight: 600 !important
}

.apply-table .col-check {
  width: 44px
}

.apply-table .apply-input {
  width: 130px;
  margin-left: auto
}

.apply-table td {
  vertical-align: middle
}

.apply-table .badge {
  margin-left: 8px
}

.apply-summary {
  display: grid;
  gap: 6px;
  justify-content: end;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: .9rem
}

.apply-summary div {
  display: flex;
  gap: 32px;
  justify-content: space-between
}

.apply-summary dt {
  color: var(--secondary)
}

.apply-summary dd {
  font-weight: 640;
  min-width: 110px;
  text-align: right
}

/* Books overview */
.books-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 20px;
  align-items: start
}

.cash-card {
  padding: 22px 24px 18px;
  display: grid;
  gap: 18px;
  overflow: hidden
}

.cash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px 28px
}

.cash-now h2 {
  font-size: .86rem;
  font-weight: 560;
  color: var(--secondary);
  letter-spacing: 0
}

.cash-figure {
  display: block;
  margin-top: 4px;
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -.05em;
  line-height: 1.04
}

.cash-note {
  margin-top: 8px;
  font-size: .84rem;
  color: var(--secondary);
  max-width: 54ch
}

.cash-note b {
  color: var(--ink);
  font-weight: 620
}

.payday-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px 13px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  max-width: 300px
}

.payday-callout .spark {
  position: static;
  width: 22px;
  height: 22px;
  color: var(--gold-deep);
  flex: none;
  margin-top: 2px;
  filter: drop-shadow(0 0 6px oklch(.8 .115 82 / .55))
}

.payday-callout div {
  display: grid;
  gap: 1px
}

.payday-callout small {
  font-size: .76rem;
  color: var(--gold-ink);
  font-weight: 560
}

.payday-callout b {
  font-size: 1.18rem;
  font-weight: 620;
  letter-spacing: -.02em
}

.payday-callout span {
  font-size: .8rem;
  color: var(--secondary)
}

.payday-callout.short {
  border-color: color-mix(in oklch, var(--red) 35%, transparent);
  background: var(--red-bg)
}

.payday-callout.short span {
  color: var(--red);
  font-weight: 560
}

.cash-chart {
  display: grid;
  gap: 8px;
  margin: 0
}

.cash-plot {
  position: relative;
  height: 210px;
  color: var(--ink)
}

.cash-plot>svg {
  width: 100%;
  height: 100%;
  overflow: visible
}

.cash-plot .grid {
  stroke: var(--line-soft);
  stroke-width: 1
}

.cash-plot .zero {
  stroke: var(--red);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: .6
}

.cash-plot .area {
  color: var(--secondary)
}

.cash-plot .line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round
}

.cash-plot .ahead {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 1.75;
  stroke-dasharray: 5 5;
  stroke-linejoin: round
}

.cash-plot .today {
  stroke: var(--line-strong);
  stroke-width: 1
}

/* the balance line may pass behind a label: a little of the card's own ground around the figures keeps them whole */
.grid-label {
  position: absolute;
  left: 0;
  transform: translateY(-120%);
  font-size: .68rem;
  color: var(--sub);
  text-shadow: -2px 0 var(--panel), 2px 0 var(--panel), 0 -2px var(--panel), 0 2px var(--panel), -1.5px -1.5px var(--panel), 1.5px -1.5px var(--panel), -1.5px 1.5px var(--panel), 1.5px 1.5px var(--panel), -1px 0 var(--panel), 1px 0 var(--panel), 0 -1px var(--panel), 0 1px var(--panel);
  pointer-events: none
}

.today-label {
  position: absolute;
  top: -2px;
  transform: translateX(6px);
  font-size: .7rem;
  font-weight: 580;
  color: var(--secondary);
  pointer-events: none
}

.payday-mark {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  color: var(--gold-deep);
  filter: drop-shadow(0 0 5px oklch(.8 .115 82 / .6));
  cursor: help
}

.payday-mark svg {
  width: 100%;
  height: 100%
}

.payday-mark.short {
  color: var(--red);
  filter: none
}

.cash-tip {
  position: absolute;
  top: 0;
  z-index: 3;
  pointer-events: none;
  display: grid;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: var(--onprimary);
  font-size: .74rem;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -110%)
}

.cash-tip b {
  font-size: .86rem;
  font-weight: 620
}

.cash-tip::after {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  bottom: -3px;
  width: 6px;
  height: 6px;
  background: inherit;
  transform: rotate(45deg)
}

.cash-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--ink);
  pointer-events: none
}

.cash-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: .72rem;
  color: var(--sub)
}

.axis-legend {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  justify-content: center
}

.axis-legend i {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--ink);
  margin-right: 5px;
  vertical-align: middle
}

.axis-legend i.dashed {
  border-top: 2px dashed var(--secondary)
}

.axis-legend i.spark-key {
  width: 8px;
  height: 8px;
  border: 0;
  background: var(--gold-deep);
  transform: rotate(45deg);
  border-radius: 1px
}

.cash-events {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px
}

.cash-events h3 {
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 6px
}

.cash-events ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2px 20px
}

.cash-events a {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .82rem
}

.ev-date {
  color: var(--sub);
  font-size: .76rem
}

.ev-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.ev-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--red);
  font-size: .72rem
}

.ev-invoice b {
  color: var(--green)
}

.ev-payroll .ev-date::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold-deep);
  transform: rotate(45deg);
  margin-right: 6px;
  vertical-align: 1px
}

.cash-events a:hover .ev-label {
  text-decoration: underline;
  text-underline-offset: .2em
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px
}

.books-tile {
  grid-column: span 2;
  padding: 18px 20px 20px;
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0
}

.books-tile.accounts-tile,
.books-tile.spend-tile {
  grid-column: span 3
}

.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px
}

.tile-head h2 {
  min-width: 0;
  font-size: .9rem
}

/* when the two do not fit, the title takes a second line and the link stays whole */
.tile-head .text-link {
  flex: none;
  white-space: nowrap
}

.tile-figure {
  font-size: 1.7rem;
  font-weight: 590;
  font-stretch: 108%;
  letter-spacing: -.04em;
  line-height: 1.15
}

.tile-note {
  font-size: .8rem;
  color: var(--sub);
  margin-bottom: 12px
}

.mini-bar {
  height: 8px
}

.mini-bar-key {
  list-style: none;
  padding: 0;
  margin-top: 12px;
  display: grid;
  gap: 4px
}

.mini-bar-key a {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: .8rem;
  color: var(--secondary);
  padding: 2px 0
}

.mini-bar-key b {
  color: var(--ink);
  font-weight: 580
}

.mini-bar-key a:hover b {
  text-decoration: underline;
  text-underline-offset: .2em
}

.pl-bars {
  display: grid;
  gap: 10px
}

.pl-bars div {
  display: grid;
  gap: 4px
}

.pl-bars dt {
  font-size: .78rem;
  color: var(--secondary)
}

.pl-bars dd {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  font-weight: 580
}

.pl-bars i,
.spend-bars i,
.budget-bars i,
.used-meter i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--line-soft);
  position: relative;
  overflow: hidden
}

.pl-bars i::after,
.spend-bars i::after,
.budget-bars i::after,
.used-meter i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: inherit;
  background: var(--green)
}

.pl-bars i.out::after {
  background: color-mix(in oklch, var(--secondary) 70%, var(--line))
}

.account-list {
  list-style: none;
  padding: 0;
  display: grid
}

.account-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft)
}

.account-list li:last-child a {
  border-bottom: 0
}

.acct-name {
  display: grid;
  min-width: 0
}

.acct-name b {
  font-size: .9rem;
  font-weight: 600
}

.acct-name small {
  font-size: .76rem;
  color: var(--sub)
}

.acct-balance {
  font-weight: 620;
  font-size: .95rem
}

.review-chip,
.ac-review {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  box-shadow: inset 0 0 0 1px var(--gold-line);
  white-space: nowrap
}

.spend-bars {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 9px;
  margin-top: 8px
}

.spend-bars li {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(60px, 1.3fr) auto;
  gap: 12px;
  align-items: center;
  font-size: .82rem
}

.spend-bars span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--secondary)
}

.spend-bars i::after {
  background: color-mix(in oklch, var(--ink) 62%, var(--panel))
}

.spend-bars b {
  font-weight: 580;
  min-width: 64px;
  text-align: right
}

/* Chart of accounts */
.filterbar.standalone {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 0 0 16px;
  border: 0
}

.filterbar.standalone .search-field {
  flex: 1 1 260px
}

.coa {
  display: grid;
  gap: 16px
}

.coa-group {
  overflow: hidden
}

.coa-group h2 {
  padding: 14px 22px 10px;
  font-size: .9rem
}

.coa-group table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem
}

.coa-group td {
  padding: 10px 16px
}

.coa-name {
  width: 38%
}

.coa-number {
  display: inline-block;
  min-width: 46px;
  color: var(--sub);
  font-weight: 500;
  font-size: .82rem
}

.coa-group tr.sub .coa-name {
  padding-left: 46px
}

.coa-group tr.inactive {
  opacity: .55
}

.coa-tag {
  margin-left: 8px;
  font-size: .68rem;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: 1px
}

.coa-desc {
  color: var(--sub);
  font-size: .8rem;
  white-space: normal
}

.coa-balance {
  font-weight: 600;
  white-space: nowrap
}

.coa-balance small {
  display: block;
  font-weight: 450;
  color: var(--sub);
  font-size: .7rem
}

.coa-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right
}

.coa-actions .small-btn+.small-btn {
  margin-left: 4px
}

/* Registers */
.register-metrics {
  margin-top: 0
}

.col-cleared {
  width: 32px;
  text-align: center
}

.cleared-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  color: var(--secondary);
  border: 1px solid var(--line-strong)
}

.cleared-mark.r {
  color: var(--panel);
  background: var(--green);
  border-color: var(--green)
}

.party-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start
}

.settings-side {
  display: grid;
  gap: 14px
}

.settings-side .muted {
  font-size: .82rem;
  margin-bottom: 8px
}

.mapping dd {
  font-size: .84rem
}

/* Banking */
.account-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  margin: 0 -2px 16px;
  scrollbar-width: thin
}

.account-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s
}

.account-card:hover {
  border-color: var(--line-strong)
}

.account-card.selected {
  border-color: var(--gold-line);
  box-shadow: 0 0 0 1px var(--gold-line), var(--shadow-md)
}

.ac-name {
  font-weight: 620;
  font-size: .92rem;
  display: flex;
  align-items: baseline;
  gap: 6px
}

.ac-name small {
  font-weight: 450;
  color: var(--sub);
  font-size: .76rem
}

.ac-figures {
  display: flex;
  gap: 18px
}

.ac-figures span {
  display: grid
}

.ac-figures small {
  font-size: .72rem;
  color: var(--sub)
}

.ac-figures b {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em
}

.ac-review {
  justify-self: start
}

.ac-review.done {
  background: var(--green-bg);
  color: var(--green);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.ac-review .icon {
  width: 12px;
  height: 12px
}

.review-panel {
  overflow: hidden
}

.review-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 16px 10px 12px;
  border-bottom: 1px solid var(--line-soft)
}

.review-tabs {
  display: flex;
  gap: 2px
}

.review-tabs a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .86rem;
  font-weight: 560;
  color: var(--secondary);
  display: inline-flex;
  gap: 7px;
  align-items: center
}

.review-tabs a span {
  font-size: .72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--secondary)
}

.review-tabs a[aria-current] {
  color: var(--ink);
  background: var(--hover)
}

.review-tabs a[aria-current] span {
  background: var(--panel);
  color: var(--ink)
}

.review-search {
  flex: 0 1 280px
}

.review-search .search-field {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding-left: 10px;
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s
}

.review-search .search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 24%, transparent)
}

.review-search .search-field input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  background: transparent;
  padding: 0 10px 0 4px;
  color: var(--ink);
  font-size: .86rem;
  outline: 0
}

.review-batch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2)
}

.batch-all {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .82rem;
  font-weight: 560
}

.batch-hint {
  font-size: .8rem;
  color: var(--sub)
}

.review-row {
  display: grid;
  grid-template-columns: 28px 52px minmax(160px, 1.1fr) 112px minmax(300px, 2fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .15s
}

.review-row:last-child {
  border-bottom: 0
}

.review-row:hover {
  background: color-mix(in oklch, var(--panel-2) 70%, var(--hover))
}

.review-row:not(:has(.rr-check)) {
  grid-template-columns: 52px minmax(160px, 1.1fr) 112px minmax(300px, 2fr)
}

.rr-check {
  padding-top: 3px
}

.rr-date {
  display: grid;
  font-size: .86rem;
  font-weight: 580
}

.rr-date small {
  font-size: .7rem;
  font-weight: 450;
  color: var(--sub)
}

.rr-desc {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: .86rem
}

.rr-desc b {
  font-weight: 560;
  overflow-wrap: anywhere
}

.rr-desc small {
  color: var(--sub);
  font-size: .74rem
}

.rr-amount {
  display: grid;
  text-align: right;
  font-size: .92rem
}

.rr-amount b {
  font-weight: 640
}

.rr-amount.in b {
  color: var(--green)
}

.rr-amount small {
  font-size: .72rem;
  color: var(--sub)
}

.rr-decide {
  display: grid;
  gap: 6px;
  min-width: 0
}

.rr-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px
}

.rr-categorize select {
  flex: 1 1 180px;
  width: auto
}

.rr-categorize .rr-party {
  flex: 1 1 140px
}

.rr-suggest {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .86rem
}

.rr-kind {
  display: inline-block;
  margin-right: 7px;
  font-size: .72rem;
  font-weight: 650;
  color: var(--secondary);
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--hover)
}

.btn.confirm {
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-color: var(--gold-line);
  font-weight: 620
}

.btn.confirm:hover {
  background: color-mix(in oklch, var(--gold-soft) 70%, var(--gold));
  color: var(--on-gold)
}

.rr-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px
}

.rr-tools .rr-more[open] {
  flex-basis: 100%;
  order: 2
}

.rr-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  color: var(--sub)
}

.rr-reason {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  color: var(--sub)
}

.conf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none
}

.conf-high .conf-dot {
  background: var(--green)
}

.conf-medium .conf-dot {
  background: var(--gold-deep)
}

.rr-more>summary {
  font-size: .76rem;
  color: var(--secondary);
  font-weight: 560;
  cursor: pointer;
  width: fit-content
}

.rr-more-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--line-soft)
}

.rr-more-body .text-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: .78rem;
  color: var(--secondary)
}

.rr-split {
  display: grid;
  gap: 8px
}

.rr-split-title {
  font-size: .78rem;
  font-weight: 600
}

.rr-split-line {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 110px;
  gap: 8px
}

.rr-split-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--secondary)
}

.rr-split-foot select {
  width: auto;
  flex: 1 1 140px
}

.rr-split-foot [data-split-left].done {
  color: var(--green);
  font-weight: 600
}

.rr-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap
}

.review-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 36px 22px;
  color: var(--secondary)
}

.review-empty .icon {
  color: var(--green)
}

.review-more {
  padding: 12px 22px;
  font-size: .8rem;
  color: var(--sub);
  border-top: 1px solid var(--line-soft)
}

/* Reconcile */
.recon {
  display: grid;
  gap: 16px
}

.recon .page-head {
  margin-bottom: 10px
}

.recon-meter {
  position: sticky;
  top: calc(var(--top-h) + 8px);
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 16px 22px;
  box-shadow: var(--shadow-md)
}

.rm-figure {
  display: grid;
  gap: 1px
}

.rm-figure small {
  font-size: .76rem;
  color: var(--secondary)
}

.rm-figure b {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.03em
}

.rm-parts {
  font-size: .72rem;
  color: var(--sub)
}

.rm-op {
  font-size: 1.3rem;
  color: var(--sub)
}

.rm-difference {
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: var(--red-bg);
  transition: background-color .3s var(--ease-out)
}

.rm-difference b {
  color: var(--red);
  transition: color .3s var(--ease-out)
}

.rm-difference.balanced {
  background: var(--green-bg)
}

.rm-difference.balanced b {
  color: var(--green)
}

.rm-finish {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 6px
}

.rm-accept {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .76rem;
  color: var(--secondary)
}

.recon-edit {
  padding: 14px 22px
}

.recon-edit[open] .form-grid {
  margin: 12px 0
}

.recon-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start
}

.recon-col {
  overflow: hidden
}

.recon-col .panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft)
}

.recon-list {
  list-style: none;
  padding: 0;
  max-height: 62vh;
  overflow-y: auto
}

.recon-list label {
  display: grid;
  grid-template-columns: 20px 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .84rem;
  cursor: pointer
}

.recon-list label:hover {
  background: var(--hover)
}

.recon-list label:has(input:checked) {
  background: color-mix(in oklch, var(--green-bg) 60%, transparent)
}

.rl-date {
  color: var(--sub);
  font-size: .78rem
}

.rl-desc {
  display: grid;
  min-width: 0
}

.rl-desc small {
  color: var(--sub);
  font-size: .74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.recon-list li.muted {
  padding: 18px
}

.recon-summary {
  display: grid;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto 26px;
  font-size: .9rem
}

.recon-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px
}

.recon-summary dt {
  color: var(--secondary)
}

.recon-summary .total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 650
}

.recon-row .small-btn {
  margin-left: auto
}

/* Financial statements */
.report-group {
  margin-bottom: 28px
}

.report-group>h2 {
  font-size: .95rem;
  margin: 0 0 12px 2px
}

.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  padding: 0 0 16px;
  border: 0
}

.report-controls>label.check {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: var(--secondary);
  padding-bottom: 9px
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-basis: 100%
}

.preset-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: .78rem;
  font-weight: 560;
  color: var(--secondary)
}

.preset-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink)
}

.preset-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--onprimary)
}

.statement-sheet {
  padding: clamp(22px, 3.4vw, 44px) clamp(14px, 3vw, 40px) clamp(24px, 3vw, 40px)
}

.statement-title {
  text-align: center;
  margin-bottom: 26px;
  display: grid;
  gap: 4px
}

.statement-title small {
  font-size: .8rem;
  color: var(--secondary);
  font-weight: 560
}

.statement-title h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 620;
  font-stretch: 110%;
  letter-spacing: -.035em
}

.statement-title p {
  font-size: .86rem;
  color: var(--secondary)
}

.statement-sheet>h2 {
  font-size: .95rem;
  margin: 24px 0 10px
}

table.statement {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: .88rem;
  white-space: nowrap
}

table.statement.wide {
  max-width: none
}

.statement :is(th, td) {
  padding: 7px 12px;
  border-bottom: 0;
  background: none
}

.statement thead th {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  font-size: .74rem;
  color: var(--sub)
}

.statement tbody tr:hover {
  background: color-mix(in oklch, var(--panel-2) 80%, var(--hover))
}

.statement tbody th {
  font-weight: 450;
  color: var(--ink);
  font-size: .88rem;
  text-align: left
}

.statement .st-section th {
  padding-top: 18px;
  font-weight: 640;
  color: var(--ink)
}

.statement .st-major th {
  font-size: .96rem;
  padding-top: 22px
}

.statement .st-row.depth-0 th {
  padding-left: 26px
}

.statement .st-row.depth-1 th {
  padding-left: 46px
}

.statement .st-row.st-hint th {
  color: var(--sub);
  font-size: .8rem
}

.statement .st-subtotal :is(th, td) {
  font-weight: 600;
  padding-left: 26px
}

.statement .st-subtotal td {
  border-top: 1px solid var(--line)
}

.statement .st-total :is(th, td) {
  font-weight: 640;
  border-top: 1px solid var(--line-strong)
}

.statement .st-net :is(th, td) {
  font-weight: 700;
  font-size: .96rem;
  padding-top: 12px
}

.statement .st-net td {
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink)
}

.statement .num {
  min-width: 112px
}

.statement td.zero {
  color: var(--sub)
}

.statement .st-row .record-link {
  font-weight: 450
}

.statement.list :is(th, td) {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 12px
}

.statement.list td.strong {
  font-weight: 640
}

.statement.ledger td.memo {
  color: var(--sub);
  white-space: normal;
  max-width: 260px
}

.statement tfoot .st-net td {
  border-bottom: 3px double var(--ink)
}

.statement-note {
  text-align: center;
  font-size: .78rem;
  color: var(--sub);
  margin-top: 16px
}

/* A statement on a phone: an account's name gives way so that the figures stay whole. With several
   columns of figures the names stand still, kept narrow, and the figures pass beside them. */
@media (max-width: 640px) {
  .statement tbody th {
    min-width: 152px;
    white-space: normal
  }

  .statement .num {
    min-width: 84px
  }

  /* a title that spans its row stays in view while the figures pass beside the names */
  .statement th[colspan] > :is(.st-stay, .record-link) {
    position: sticky;
    left: 12px;
    display: inline-block
  }
}

.used-meter {
  display: inline-grid;
  grid-template-columns: 70px auto;
  gap: 8px;
  align-items: center
}

.used-meter.over i::after,
.budget-bars li.over i::after {
  background: var(--red)
}

/* Budgets */
.budget-progress {
  margin-bottom: 16px
}

.budget-bars {
  list-style: none;
  padding: 0 22px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px 28px
}

.budget-bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  font-size: .82rem
}

.budget-bars li i {
  grid-column: 1 / -1;
  grid-row: 2
}

.budget-bars li:not(.income) i::after {
  background: color-mix(in oklch, var(--ink) 55%, var(--panel))
}

.budget-bars b {
  font-weight: 560;
  color: var(--secondary)
}

.budget-form {
  overflow: hidden
}

.budget-table th[scope="row"] {
  background: none;
  color: var(--ink);
  font-weight: 560;
  font-size: .84rem;
  min-width: 240px;
  white-space: nowrap
}

.budget-table td {
  padding: 6px 4px
}

.budget-table td input {
  width: 84px;
  height: 32px;
  text-align: right;
  font-size: .82rem
}

.budget-table .budget-section th {
  background: var(--panel-2);
  color: var(--secondary);
  font-weight: 600
}

.copy-across {
  margin-left: 10px;
  font-size: .72rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s
}

.budget-table tr:hover .copy-across,
.copy-across:focus-visible {
  opacity: 1
}

.budget-form .form-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft)
}

/* The customer link */
.public-doc {
  min-height: 100vh;
  background: var(--bg);
  padding: clamp(16px, 4vw, 48px) 16px 48px;
  display: grid;
  justify-content: center;
  align-content: start;
  gap: 16px
}

.public-doc .doc-paper {
  width: min(860px, calc(100vw - 32px))
}

.public-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: min(860px, calc(100vw - 32px))
}

.public-from {
  font-weight: 640
}

.public-due {
  margin-left: auto;
  font-size: .9rem;
  color: var(--secondary)
}

.public-due b {
  color: var(--ink)
}

.public-foot {
  font-size: .8rem;
  color: var(--sub);
  text-align: center
}

/* Smaller screens */
@media (max-width: 1180px) {
  .editor-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)
  }

  .editor-balance {
    grid-column: 1 / -1;
    text-align: left;
    order: -1
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .books-tile,
  .books-tile.accounts-tile,
  .books-tile.spend-tile {
    grid-column: span 1
  }

  .review-row,
  .review-row:not(:has(.rr-check)) {
    grid-template-columns: 28px 52px minmax(0, 1fr) 104px
  }

  .review-row:not(:has(.rr-check)) {
    grid-template-columns: 52px minmax(0, 1fr) 104px
  }

  .rr-decide {
    grid-column: 2 / -1
  }

  .review-row:not(:has(.rr-check)) .rr-decide {
    grid-column: 1 / -1
  }
}

@media (max-width: 980px) {
  .doc-layout,
  .books-top,
  .party-layout,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr)
  }

  .doc-side {
    position: static
  }
}

@media (max-width: 720px) {
  .cash-axis {
    flex-wrap: wrap
  }

  .cash-axis>span:not(.axis-legend) {
    white-space: nowrap
  }

  .axis-legend {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start
  }

  .editor-head,
  .editor-when,
  .editor-notes,
  .recon-columns {
    grid-template-columns: minmax(0, 1fr)
  }

  .books-grid {
    grid-template-columns: minmax(0, 1fr)
  }

  .money-bar-figures {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px
  }

  .paper-head {
    flex-direction: column
  }

  .paper-title {
    text-align: left
  }

  .editor-lines-foot {
    flex-direction: column
  }

  .editor-totals {
    width: 100%
  }

  .rm-finish {
    margin-left: 0;
    justify-items: start
  }

  .rr-split-line {
    grid-template-columns: minmax(0, 1fr) 96px
  }

  .rr-split-line input[name$="memo"] {
    display: none
  }

  .review-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 10px
  }

  .review-row:not(:has(.rr-check)) {
    grid-template-columns: minmax(0, 1fr) auto
  }

  .rr-date {
    display: none
  }

  .rr-decide {
    grid-column: 1 / -1
  }

  .review-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%
  }

  .review-tabs a {
    white-space: nowrap
  }

  .review-search {
    flex-basis: 100%
  }

  .review-batch {
    flex-wrap: wrap
  }

  .review-batch .batch-hint,
  .review-batch .editor-footer-space {
    display: none
  }

  .review-batch .btn {
    flex: 1 1 auto
  }
}

@media (hover: none) {
  .copy-across {
    opacity: 1
  }
}

@media (prefers-reduced-motion: reduce) {
  .new-menu-list,
  .quick-dialog[open] {
    animation: none
  }
}

/* Printing a document or a statement */
@media print {
  .rail,
  .topbar,
  .tabbar,
  .back,
  .page-head .actions,
  .doc-side,
  .filterbar,
  .report-controls,
  .public-bar,
  .public-foot,
  .messages,
  .caelion-assistant,
  .assistant-dock {
    display: none !important
  }

  .doc-layout {
    display: block
  }

  .doc-paper,
  .statement-sheet {
    border: 0;
    box-shadow: none;
    padding: 0
  }

  .page-head {
    display: none
  }

  .statement :is(th, td) {
    padding: 4px 8px
  }
}

/* Payroll inspector (on the payroll page) */
.inspector {
  margin: 0 0 18px;
  padding: 18px 22px 16px
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  gap: 14px
}

.inspector-mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-soft)
}

.inspector-head h2 {
  font-size: .98rem
}

.inspector-head p {
  margin-top: 2px;
  font-size: .84rem;
  color: var(--secondary)
}

.inspector-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0 48px;
  display: grid
}

.inspector-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft)
}

.inspector-list i {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--line-strong)
}

.inspector-list .lvl-warn i {
  background: var(--gold-deep)
}

.inspector-list div {
  display: grid;
  gap: 2px;
  min-width: 0
}

.inspector-list b {
  font-size: .88rem;
  font-weight: 600
}

.inspector-list span {
  font-size: .8rem;
  color: var(--secondary)
}

@media (max-width: 640px) {
  .inspector-list {
    margin-left: 0
  }
}


/* Progress invoicing, unbilled charges, and printable voucher checks */
.progress-form {
  margin-top: 12px;
  display: grid;
  gap: 10px
}

.unbilled-panel {
  margin-bottom: 18px
}

.check-sheet-shell {
  max-width: calc(8.5in + 42px);
  margin: 0 auto;
  padding: 24px 20px 48px;
  overflow-x: auto
}

.check-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px
}

.voucher-check {
  inline-size: 8.5in;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden
}

/* The face of a voucher check (templates/books/_check_face.html): 8.5 by 3.5 inches, each field
   placed in inches from the paper's edge, the same on screen as on paper. What pre-printed stock
   already carries shows faintly and stays off the paper. */
.check-face {
  position: relative;
  inline-size: 8.5in;
  block-size: 3.5in;
  overflow: hidden;
  border-bottom: 2px dashed var(--line-strong);
  color: var(--ink);
  font-size: 10pt;
  line-height: 1.2
}

.face-print {
  position: absolute;
  inset: 0;
  transform: translate(var(--shift-x, 0in), var(--shift-y, 0in))
}

.check-face .cf {
  position: absolute;
  margin: 0;
  white-space: nowrap
}

.is-preprinted .stock-only {
  opacity: .38
}

.check-face .cf-payer {
  left: .35in;
  top: .28in;
  width: 3.3in;
  white-space: normal
}

.cf-payer b {
  display: block;
  font-size: 11pt
}

.cf-payer span {
  display: block;
  font-size: 8.5pt;
  color: var(--secondary)
}

.check-face .cf-bank {
  left: 3.9in;
  top: .28in;
  width: 2.2in;
  text-align: center;
  white-space: normal;
  font-size: 8.5pt
}

.cf-bank :is(b, span) {
  display: block
}

.cf-bank b {
  font-size: 9.5pt
}

.cf-number {
  right: .35in;
  top: .26in;
  font-size: 12pt;
  font-weight: 620
}

.cf-fraction {
  right: .35in;
  top: .5in;
  font-size: 7.5pt
}

.cf-label {
  font-size: 6.5pt;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--secondary)
}

.cf-date-label {
  left: 6.05in;
  top: .8in
}

.cf-date {
  left: 6.55in;
  top: .75in;
  font-size: 11pt
}

.check-face .cf-payee-label {
  left: .35in;
  top: 1.06in;
  width: .72in;
  white-space: normal;
  line-height: 1.15
}

.cf-payee {
  left: 1.15in;
  top: 1.1in;
  width: 5.05in;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11pt;
  font-weight: 600
}

.cf-rule {
  height: 0;
  border-top: 1px solid currentColor
}

.cf-payee-rule {
  left: 1.1in;
  top: 1.33in;
  width: 5.15in
}

.cf-dollar {
  left: 6.4in;
  top: 1.1in;
  font-size: 11pt
}

.cf-box {
  left: 6.55in;
  top: 1.03in;
  width: 1.6in;
  height: .32in;
  border: 1px solid currentColor;
  border-radius: 2px
}

.cf-amount {
  left: 6.6in;
  top: 1.1in;
  width: 1.48in;
  text-align: right;
  font-size: 11pt;
  font-weight: 620;
  font-variant-numeric: tabular-nums
}

.cf-words {
  left: .35in;
  top: 1.5in;
  width: 6.55in;
  overflow: hidden;
  font-size: 10pt
}

.cf-words-rule {
  left: .35in;
  top: 1.7in;
  width: 6.6in
}

.cf-dollars-label {
  left: 7.05in;
  top: 1.58in
}

.check-face .cf-address {
  left: 1in;
  top: 1.86in;
  width: 3.3in;
  white-space: normal;
  font-size: 10pt;
  line-height: 1.25
}

.cf-address b {
  font-weight: 560
}

.cf-memo-label {
  left: .35in;
  top: 2.56in
}

.cf-memo {
  left: .8in;
  top: 2.5in;
  width: 3.4in;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9.5pt
}

.cf-memo-rule {
  left: .75in;
  top: 2.68in;
  width: 3.5in
}

.cf-sig-rule {
  left: 5in;
  top: 2.6in;
  width: 3.15in
}

.cf-sig-label {
  left: 5in;
  top: 2.65in;
  width: 3.15in;
  text-align: center
}

/* the bottom 5/8 inch belongs to the MICR line, and nothing else prints there */
.check-face .cf-band {
  left: 0;
  right: 0;
  bottom: 0;
  height: .625in;
  display: grid;
  place-items: center;
  padding: 0 .5in;
  white-space: normal;
  text-align: center;
  font-size: 8pt;
  color: var(--secondary);
  border-top: 1px dotted var(--line)
}

.check-face .cf-band-missing {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 8%, transparent)
}

.cf-micr {
  position: absolute;
  inset: 0;
  width: 8.5in;
  height: 3.5in;
  overflow: visible;
  pointer-events: none
}

.cf-micr text {
  font-family: "Caelion MICR", monospace;
  fill: currentColor
}

.check-label {
  font-size: .78rem;
  color: var(--secondary)
}

.check-stub {
  padding: 20px 32px 24px;
  border-bottom: 2px dashed var(--line-strong)
}

.check-stub:last-child {
  border-bottom: 0
}

.stub-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .84rem;
  color: var(--secondary);
  margin-bottom: 12px
}

.stub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem
}

.stub-table :is(th, td) {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left
}

.stub-table .num {
  text-align: right
}

.stub-table tfoot :is(th, td) {
  border-top: 1px solid var(--line-strong);
  border-bottom: 0
}

@media print {
  .no-print {
    display: none !important
  }
  .check-sheet-shell {
    padding: 0;
    margin: 0;
    max-width: none;
    overflow: visible
  }
  /* one sheet of letter stock: the check, then its stubs, 3.75 inches each */
  .voucher-check {
    inline-size: 8.5in;
    block-size: 11in;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    background: none;
    break-after: page;
    break-inside: avoid
  }
  .voucher-check:last-child {
    break-after: auto
  }
  .check-face {
    border-bottom: 0;
    color: #000
  }
  .check-face :is(.cf-payer span, .cf-label) {
    color: #000
  }
  .is-preprinted .stock-only {
    display: none
  }
  .check-stub {
    box-sizing: border-box;
    block-size: 3.75in;
    overflow: hidden;
    padding: .4in .5in .3in;
    border-bottom: 0;
    color: #000
  }
  /* on paper the stub reads in black, whatever the screen's theme */
  .check-stub :is(.stub-head, .stub-head *, th, td) {
    color: #000
  }
  .check-stub .stub-table :is(th, td) {
    border-color: #999
  }
}

/* ---------- Goals (books/goals.html, the strip on Performance) ---------- */

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-bottom: 20px
}

.goal-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 20px 16px
}

.goal-card > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px
}

.goal-card h2 {
  font-size: 1rem
}

.goal-card > header p {
  margin-top: 2px;
  font-size: .78rem;
  color: var(--secondary)
}

.goal-figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px
}

.goal-figure a {
  font-size: 1.6rem;
  font-weight: 640;
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
  font-variant-numeric: tabular-nums
}

.goal-figure a:hover {
  text-decoration: underline;
  text-underline-offset: 4px
}

.goal-figure span {
  font-size: .8rem;
  color: var(--sub);
  font-variant-numeric: tabular-nums
}

/* the bar is what is done; the tick is where the period stands */
.goal-meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line-soft)
}

.goal-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: inherit;
  background: var(--green)
}

.is-behind .goal-fill,
.is-missed .goal-fill {
  background: var(--gold-deep)
}

.goal-pace {
  position: absolute;
  inset-block: -4px;
  width: 2px;
  margin-inline-start: -1px;
  border-radius: 1px;
  background: var(--ink)
}

.goal-note {
  font-size: .8rem;
  color: var(--secondary)
}

.goal-history {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none
}

.goal-history li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line)
}

.goal-history li.met {
  background: var(--green);
  box-shadow: none
}

.goal-history li.missed {
  background: var(--gold-deep);
  box-shadow: none
}

.goal-card > footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .78rem;
  color: var(--sub)
}

.goal-edit[open] {
  flex-basis: 100%
}

.goal-edit form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px
}

.goal-edit label {
  display: grid;
  gap: 4px;
  font-size: .78rem
}

.goal-edit input {
  width: 9rem
}

.goal-strip {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 18px 22px
}

.goal-strip ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 14px 24px;
  margin: 0;
  padding: 0;
  list-style: none
}

.goal-strip li {
  display: grid;
  gap: 6px;
  font-size: .8rem
}

.goal-strip li > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--secondary)
}

.goal-strip li b {
  color: var(--ink);
  font-weight: 600
}

.goal-strip + .pf-grid {
  margin-top: 20px
}

/* ---------- Budget by task (books/project.html) ---------- */

.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem
}

.task-table :is(th, td) {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top
}

.task-table thead th {
  font-size: .76rem;
  font-weight: 600;
  color: var(--secondary)
}

.task-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums
}

.task-table .sub {
  display: block;
  margin-top: 2px;
  font-size: .74rem;
  font-weight: 400;
  color: var(--sub);
  white-space: normal
}

.task-table td.negative {
  color: var(--red)
}

.task-table tfoot :is(th, td) {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-weight: 600
}

.task-table tr.is-done th b {
  color: var(--secondary)
}

.task-table tr.is-other th b {
  font-weight: 560;
  color: var(--secondary)
}

.task-bar {
  display: block;
  position: relative;
  width: 100%;
  max-width: 120px;
  height: 4px;
  margin: 6px 0 0 auto;
  border-radius: 999px;
  background: var(--hover);
  overflow: hidden
}

.task-bar i {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: inherit;
  background: var(--green)
}

.task-bar.cost i {
  background: var(--secondary)
}

.task-bar.over i {
  background: var(--gold-deep)
}

.task-actions {
  text-align: right;
  white-space: nowrap
}

.task-new {
  margin-top: 14px
}

.task-new > summary {
  list-style: none;
  width: max-content
}

.task-new > summary::-webkit-details-marker {
  display: none
}

.task-new[open] > summary {
  margin-bottom: 14px
}

.task-form .form-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr))
}

.task-panel {
  padding: 0 22px 18px
}

.task-panel > .panel-head {
  padding-inline: 0
}

.task-note {
  margin-top: 10px;
  font-size: .82rem
}

/* Florida use tax on a bill, expense or check: owed to the state, below the vendor's total */
.editor-totals-stack {
  display: grid;
  gap: 8px;
  min-width: min(340px, 100%);
  justify-items: end
}

.editor-totals-stack .editor-totals {
  width: 100%
}

.editor-totals .use-tax-row {
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft)
}

.use-tax-note {
  margin: 0;
  max-width: 340px;
  color: var(--secondary);
  font-size: .78rem;
  line-height: 1.45;
  text-align: right
}

@media (max-width: 720px) {
  .editor-totals-stack {
    width: 100%;
    justify-items: stretch
  }

  .use-tax-note {
    max-width: none;
    text-align: left
  }
}

/* Form DR-15: the amounts the company enters sit in the return's own cells */
.dr15-form .dr15-due td.num {
  width: 11rem
}

.dr15-form .dr15-due td.num input {
  max-width: 10rem;
  height: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums
}

.dr15-due th label {
  cursor: pointer
}

.dr15-due .dr15-left {
  color: var(--amber)
}

.dr15-due .errorlist {
  margin: 4px 0 0;
  color: var(--red);
  font-size: .78rem
}

.dr15-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 20px;
  padding: 14px 0 6px
}

.dr15-save .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
  font-size: .86rem
}

.dr15-filing .inline-form {
  padding: 0 22px 20px
}

.dr15-filing .inline-form input {
  width: 13rem
}

.dr15-lines td.zero {
  color: var(--secondary)
}

@media (max-width: 640px) {
  .dr15-form .dr15-due td.num {
    width: 8.5rem
  }

  .dr15-save {
    justify-content: flex-start
  }
}

/* ---------- Pay by bank file, positive pay, check printing (operations/bank_pay.py) ---------- */

.vendor-file-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 560
}

.vendor-file-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 16px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line-soft)
}

.vendor-file-foot label {
  display: grid;
  gap: 6px;
  font-size: .82rem;
  color: var(--secondary)
}

.vendor-file-foot .sub {
  flex: 1 1 260px;
  margin: 0;
  font-size: .8rem;
  color: var(--secondary)
}

.vendor-file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: start
}

.vendor-file-decide > summary {
  list-style: none;
  cursor: pointer
}

.vendor-file-decide > summary::-webkit-details-marker {
  display: none
}

.vendor-file-decide[open] .inline-form {
  margin-top: 8px;
  justify-content: flex-end
}

.pp-layout {
  display: grid;
  gap: 16px;
  padding: 0 22px 20px
}

.pp-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 14px
}

.pp-columns label,
.pp-format > label:not(.check-label) {
  display: grid;
  gap: 6px;
  font-size: .82rem;
  color: var(--secondary)
}

.pp-format {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 18px
}

.check-setup {
  display: grid;
  gap: 18px
}

.check-setup .panel-head p {
  max-width: 72ch
}

.check-font-on-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: .86rem;
  color: var(--green)
}

.check-accounts {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft)
}

.check-accounts h3 {
  margin: 0 0 8px;
  font-size: .9rem
}

.check-accounts li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px
}

.field-check .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--ink)
}

/* Other currencies (operations/currency.py): the rate beside the currency, the dollars a document carries */
.fx-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0;
}
.fx-line span {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}
.fx-home {
  display: block;
  margin-top: 2px;
  color: var(--secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.fx-forms .filterbar + .filterbar {
  border-top: 1px solid var(--line-soft);
}
.fx-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
}
.fx-footer .hint {
  flex: 1 1 320px;
  color: var(--secondary);
  font-size: 13px;
}

/* Stock by location, lot and serial number (operations/stock.py) */
.line-stock {
  display: grid;
  gap: 6px;
  margin-top: 6px
}

.line-stock[hidden],
.line-stock [hidden] {
  display: none
}

.line-stock-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--secondary)
}

.line-stock-field > span {
  white-space: nowrap
}

.line-stock-field .icon {
  flex: none;
  color: var(--sub)
}

.line-stock-field :is(select, textarea, input) {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%
}

.line-stock-field textarea,
.transfer-table textarea {
  height: auto;
  min-height: 36px;
  resize: vertical;
  field-sizing: content;
  max-height: 140px
}

.transfer-table textarea {
  width: 100%;
  min-width: 150px
}

/* many columns (a bill's billable ones) scroll sideways instead of crushing the numbers */
.line-table .col-qty input {
  min-width: 72px
}

.line-table .col-rate input {
  min-width: 84px
}

.line-table .col-amount input {
  min-width: 96px
}

.line-table .col-dept :is(input, select) {
  min-width: 110px
}

.paper-lines td span.paper-stock {
  font-variant-numeric: tabular-nums
}

.paper-lines td span.paper-stock small {
  font-size: .72rem
}

.stock-places .bin-row td:first-child {
  padding-left: 34px
}

.stock-places .bin-name::before {
  content: "↳ ";
  color: var(--sub)
}

.stock-places .is-off :is(b, .bin-name, td) {
  color: var(--sub)
}

.stock-places .badge {
  margin-left: 6px
}

.stock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px
}

.inline-edit > summary {
  list-style: none;
  cursor: pointer
}

.inline-edit > summary::-webkit-details-marker {
  display: none
}

.inline-edit[open] {
  flex-basis: 100%
}

.inline-edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2)
}

.inline-edit-form label {
  display: grid;
  gap: 4px;
  font-size: .78rem;
  color: var(--secondary)
}

.transfer-table .col-target select {
  min-width: 200px
}

.transfer-table .col-lots {
  width: 28%
}

.lot-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px
}

.lot-columns > .panel {
  margin: 0
}

.lot-places {
  list-style: none;
  margin: 0;
  padding: 4px 18px 14px
}

.lot-places li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft)
}

.lot-places li:last-child {
  border-bottom: 0
}

.lot-places b {
  font-variant-numeric: tabular-nums
}

.adjust-place {
  margin-bottom: 12px
}

.line-table .lot-row td {
  padding-top: 2px;
  border-top: 0
}

.lot-tag {
  display: block;
  margin-top: 2px;
  padding-left: 14px;
  font-size: .82rem;
  color: var(--secondary)
}

.lot-tag.lot-found {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px
}

.lot-tag.lot-found label {
  display: grid;
  gap: 3px;
  font-size: .74rem
}

.lot-details label.grow {
  flex: 1 1 280px
}

.lot-details {
  padding: 14px 22px 20px
}
