.reg-action,
.reg-download,
.reg-file-icon,
.reg-toolbar,
.reg-pair,
.reg-menu-heading,
.reg-popup-foot,
.reg-form-actions,
.reg-categories,
.reg-chips {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.reg-action .ui-icon,
.reg-toolbar .ui-icon,
.reg-file-icon .ui-icon {
  width: 17px;
  height: 17px;
  flex: none;
}
.reg-download {
  min-height: 39px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
}
.reg-toolbar {
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.reg-toolbar > select {
  width: auto;
  min-width: 132px;
}
.reg-toolbar > input {
  max-width: 320px;
}
.reg-search {
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  width: min(360px, 100%);
  gap: 6px;
}
.reg-search input {
  border: 0;
  min-height: 37px;
  background: transparent;
}
.reg-entry,
.reg-upsale-form,
.reg-catalogue,
.reg-upsale-history {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
}
.reg-entry {
  background: transparent;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 9px;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin-bottom: 12px;
}
.reg-entry > label {
  flex: 1 1 92px;
  min-width: 72px;
}
.reg-entry > label:has(input[type="date"]) {
  min-width: 130px;
}
.reg-entry > label:has(input[type="search"]),
.reg-entry > label:has(select[aria-label="Description"]) {
  flex-grow: 1.6;
  min-width: 136px;
}
.reg-entry > label.reg-file {
  flex: 0 0 auto;
  min-width: 44px;
}
.reg-entry > label:has(select[aria-label="Method"], select[aria-label="Receiving bank"]) {
  min-width: 8.75rem;
}
.reg-entry > label:has(select[aria-label="Paid from"]) { min-width: 10.75rem; }
.reg-entry > label:has(select[aria-label="Paying for"]) { min-width: 8.75rem; }
.reg-entry > label:has(select[aria-label="Currency"]) { flex: 0 1 5.5rem; }
.reg-entry .reg-count { flex-basis: 100%; margin: 0; }
.reg-entry .entry-edit-action { min-width: 0; overflow-wrap: anywhere; }
.reg-file { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.reg-file-icon {
  position: relative;
  min-width: 0;
  overflow: hidden;
  justify-content: center;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.reg-file-name { display: none; }
.reg-file-icon input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.reg-file-icon:focus-within {
  outline: 2px solid var(--green);
}
.reg-file.attached .reg-file-icon {
  background: var(--green-soft);
}
.reg-grid {
  min-width: 0;
}
.reg-chips:empty {
  display: none;
}
.reg-chips {
  flex-wrap: wrap;
  margin: 7px 0;
}
.reg-chip {
  min-height: 26px;
  padding: 3px 8px;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 450;
}
.reg-scroll {
  overflow: auto;
  max-height: 65vh;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.reg-scroll table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.reg-scroll thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}
.reg-scroll table:not(.stable-register) tr:nth-child(even) {
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
}
.reg-scroll td,
.reg-scroll th {
  white-space: nowrap;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}
.reg-scroll th {
  padding: 4px 12px;
  background: var(--surface);
}
.reg-scroll td select { width: auto; min-width: 8rem; }
.reg-head-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 100%;
  min-height: 33px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  background: transparent;
  color: var(--ink);
  gap: 6px;
  font-weight: 600;
}
#app .reg-scroll th .reg-head-button,
#app .reg-scroll th .reg-head-button:hover {
  background: transparent;
  color: inherit;
}
#app .reg-scroll th .reg-head-button > span { color: inherit; }
.reg-scroll thead .reg-head-button { text-decoration: none; }
.reg-head-button .ui-icon { width: 14px; height: 14px; flex: none; opacity: .65; stroke-width: 1.8; }
.reg-head-button[aria-expanded="true"] .ui-icon { transform: rotate(180deg); }
.reg-head-button.active .ui-icon { opacity: 1; stroke-width: 2.6; }
#app:is([data-page="expenses"], [data-page="income"]) .reg-scroll {
  border: 0;
  border-radius: 0;
}
.reg-head-button > span {
  color: var(--muted);
}
.reg-no-rows,
.reg-history-empty,
.reg-review-note,
.reg-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.reg-scroll .reg-no-rows {
  padding: 25px 14px;
}
.reg-count,
.reg-review-note {
  margin: 0.55rem 0 0.75rem;
}
.reg-grid .reg-count {
  margin-top: 12px;
}
.reg-in {
  color: var(--green);
}
.reg-out {
  color: var(--red);
}
.reg-column-popup {
  max-height: calc(100dvh - 16px);
  overflow: auto;
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 20;
  width: 220px;
  padding: 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 4px 16px #17261b1a;
}
.reg-column-popup > button {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  min-height: 30px;
  font-weight: 400;
}
.reg-value-list {
  max-height: 180px;
  overflow: auto;
  padding: 7px 0;
}
.reg-value-list label,
.reg-description-list label,
.reg-modifiers label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 2px;
  color: var(--ink);
  font-weight: 400;
  font-size: 13px;
}
.reg-value-list input,
.reg-description-list input,
.reg-modifiers input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--green);
}
.reg-drawer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  overflow-wrap: anywhere;
}
.reg-drawer-form button { max-width: 100%; }
.reg-drawer-form h3,
.reg-upsale-layout h3 {
  margin: 0;
  color: var(--ink);
}
.reg-pair > input {
  min-width: 0;
}
.reg-form-actions {
  justify-content: flex-end;
  margin-top: 12px;
}
.reg-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  column-gap: 12px;
  overflow-wrap: anywhere;
  gap: 0;
  margin: 0;
}
.reg-facts dt,
.reg-facts dd {
  padding: 11px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.reg-facts dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.reg-upsale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 27%);
  gap: 14px;
  align-items: start;
}
.reg-upsale-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.reg-upsale-form,
.reg-catalogue,
.reg-upsale-history {
  padding: 17px;
}
.reg-upsale-selection,
.reg-upsale-order {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.reg-upsale-selection > label {
  flex: 1 1 130px;
}
.reg-upsale-order > label {
  flex: 1 1 105px;
}
.reg-upsale-order > label:has(input[type="number"]) {
  flex: 0 1 85px;
}
.reg-upsale-form {
  display: grid;
  gap: 12px;
}
.reg-categories,
.reg-modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reg-categories button {
  min-height: 32px;
  font-weight: 480;
  padding: 5px 10px;
}
.reg-categories button.selected {
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: var(--green);
}
.reg-menu-heading {
  align-items: center;
  flex-wrap: wrap;
  min-height: 28px;
  cursor: pointer;
  list-style: none;
}
.reg-menu-heading::-webkit-details-marker { display: none; }
.reg-menu-heading .ui-icon { margin-inline-start: auto; }
.reg-catalogue[open] .reg-menu-heading .ui-icon { transform: rotate(180deg); }
.reg-menu-heading small {
  color: var(--muted);
  font-size: 11px;
}
.reg-catalogue > input {
  width: min(100%, 320px);
  margin-block: 8px 12px;
}
.reg-menu-columns {
  columns: 3 170px;
  column-gap: 16px;
}
.reg-menu-columns section {
  break-inside: avoid;
  margin-bottom: 16px;
}
.reg-menu-columns h4 {
  text-transform: capitalize;
  margin: 0 0 4px;
  padding: 5px 7px;
  font-size: 14px;
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
  border-radius: 4px;
}
.reg-menu-item {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  align-items: center;
  text-align: left;
  gap: 6px;
  min-height: 32px;
  padding: 4px 3px;
  font-size: 12px;
  font-weight: 450;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.reg-menu-item span:nth-child(2) {
  font-variant-numeric: tabular-nums;
}
.reg-entry-history {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
.reg-entry-history li {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.reg-entry-history p {
  margin: 5px 0;
}
.reg-entry-history small {
  color: var(--muted);
}
.reg-guest-link {
  color: var(--green);
  font-weight: 500;
  text-decoration: none;
}
.reg-review-note:empty,
.reg-upsale-form .error:empty,
.reg-entry + .error:empty {
  display: none;
}
@media (max-width: 850px) {
  .reg-upsale-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .reg-toolbar > select {
    min-width: 0;
  }

}

.reg-entry .reg-payee { position:relative; flex:1.6 1 136px; min-width:136px; }
.reg-payee-options { position:absolute; inset:100% 0 auto; z-index:8; min-width:100%; width:max-content; max-width:min(320px,82vw); max-height:210px; overflow:auto; margin-top:3px; padding:4px; background:var(--surface); border:1px solid var(--line); border-radius:8px; box-shadow:0 5px 18px #0002; }
.reg-payee-options [role=option],.reg-payee-options small { display:block; padding:8px; cursor:pointer; overflow-wrap:anywhere; }
.reg-payee-options [role=option]:hover,.reg-payee-options .highlighted {background:var(--green-soft);}
.reg-classification {
  display: flex; flex: 0 0 100%; gap: 8px 24px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
.reg-classification output { color: var(--ink); font-weight: 550; margin-left: 5px; }
.reg-classification .link-button { margin-left: auto; padding: 0; min-height: 0; font-size: 12px; }
.reg-payee-options .reg-unmapped { display: inline; margin-left: 8px; padding: 0; color: var(--muted); font-size: 11px; }
.reg-map-editor { display: grid; gap: 12px; }
.reg-map-editor > button { justify-self: start; }
.reg-map-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; }
.reg-map-fields select, .reg-map-editor select { width: 100%; min-width: 0; }
.reg-map-fields select:disabled { color: var(--ink); opacity: 1; background: var(--surface); }
.reg-linked-list:empty { display: none; }
.reg-linked-list table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.reg-linked-list th, .reg-linked-list td {
  padding: 7px 4px; font-size: 12px; text-align: left; white-space: normal;
  overflow-wrap: anywhere; border-bottom: 1px solid var(--line);
}
.reg-linked-list th:first-child { width: 39%; }
.reg-linked-list th:last-child { width: 28px; }
.reg-unlink { padding: 0; width: 26px; min-height: 28px; }
.reg-scroll tfoot { position: sticky; bottom: 0; }
.reg-scroll tfoot th, .reg-scroll tfoot td {
  border-top: 1px solid var(--line); border-bottom: 0;
  background: var(--surface); font-weight: 650; padding: 10px 12px;
}
.reg-date-range { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.25rem), 1fr)); gap: 8px; margin: 6px 0 10px; }
.reg-date-range input { min-width: 0; width: 100%; }
.reg-date-range .error { grid-column: 1/-1; margin: 0; }
.reg-date-range .error:empty { display: none; }
.reg-column-popup:has(.reg-date-range) { width: min(368px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); }

/* Match the date field's icon inset on Expenses entry fields and drawers. */
body:has(#app:is([data-page="expenses"],[data-page="income"],[data-page="up-sales"],[data-page="cashflow"],[data-page="pl"],[data-page="kpi"])) :is(select:not([multiple]), .reg-filter-select, input[list][aria-label="Payer"]) {
  appearance: none;
  padding-inline-end: 34px;
  background-image: linear-gradient(45deg, transparent 49%, currentColor 51%, currentColor 66%, transparent 68%),
    linear-gradient(-45deg, transparent 49%, currentColor 51%, currentColor 66%, transparent 68%);
  background-size: 5px 7px;
  background-position: right 17px center, right 12px center;
  background-repeat: no-repeat;
}
.reg-filter-select { min-width: 132px; text-align: start; font-weight: 400; }
@media (forced-colors: active) {
  body:has(#app[data-page="expenses"]) select:not([multiple]) { appearance: auto; }
}

input[list][aria-label="Payer"]::-webkit-calendar-picker-indicator { opacity:0; }
.reg-entry .reg-refund-choice:has(input[hidden]) {display:none;}
.reg-entry .reg-refund-choice input {width:auto;min-height:0;}

#guest-month-slot:empty { display: none; }
.register-period { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto; align-items: center; gap: 6px; max-width: 21rem; }
.register-period .reference-month { display: flex; min-width: 0; align-items: center; gap: 5px; padding: 0 2px 0 9px; }
.register-period .reference-month select { width: 100%; min-width: 0; font-size: 14px; }
.register-period button { padding-inline: 9px; }
.register-period button:disabled { opacity: .4; }

.reg-prepayment-terms:not([hidden]) { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.reg-prepayment-terms input[type="number"] { width: 8rem; }

#page-actions > select[aria-label="Register view"] { width: auto; }
.reg-tools-toggle { display: none; }
#expense-tools { display: contents; }
.reg-entry :is(input, select), .reg-upsale-form :is(input, select) { font-size: 13px; font-weight: 500; }
.reg-entry .reg-refund-choice:not(:has(input[hidden])) { display: flex; align-items: center; gap: 8px; min-height: 39px; }
.reg-entry label > :is(input, select), .reg-upsale-form label, .reg-drawer-form label { min-width: 0; }
.reg-entry > .reg-count:empty { display: none; }
.reg-entry-history { overflow-wrap: anywhere; }
.reg-entry-history li > small { display: block; }
.reg-entry-history li > button + button { margin-inline-start: 8px; }
.reg-entry-history li > div:not([hidden]) { display: flex; gap: 8px; margin-top: 6px; }
.reg-entry-history input { min-width: 0; }
.reg-menu-item:hover { background: var(--green-soft); }
.reg-chip { max-width: 100%; overflow-wrap: anywhere; }
.reg-scroll { overscroll-behavior-x: contain; }

@media (max-width: 1240px) {
  .reg-entry { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reg-entry > label, .reg-entry .reg-payee, .reg-entry > label:has(input[type]),
  .reg-entry > label:has(select[aria-label]), .reg-entry > label.reg-file { min-width: 0; }
  .reg-entry > :is(.reg-classification, .reg-count, .reg-prepayment-terms) { grid-column: 1 / -1; }
  .reg-entry > button[type="submit"] { grid-column-end: -1; }
}
@media (min-width: 641px) and (max-width: 760px) {
  .reg-entry { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  :is(#guest-month-slot, .register-period) { max-width: 100%; }
  #guest-month-slot:not(:empty), .register-period { width: 100%; }
  .register-period { gap: 5px; }
  .register-period button { min-height: 44px; min-width: 36px; }
  .register-period .reference-month { height: 44px; }
  #app:is([data-page="income"],[data-page="expenses"],[data-page="cashflow"],[data-page="up-sales"]) #page-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; margin: 8px 0 0;
  }
  #page-actions > :is(.reg-action,select[aria-label="Register view"]) { justify-content: center; max-width: 100%; }
  #page-actions .reg-download { font-size: 12px; gap: 4px; }
  #page-actions > select:only-child { grid-column: 1/-1; }
  #page-actions:has(.reg-tools-toggle) > button { padding-inline: 8px; }
  #app[data-page="expenses"] #page-actions:has(.reg-tools-toggle) { grid-template-columns: 1fr auto; }
  #app[data-page="expenses"] #page-actions:has(.reg-tools-toggle):has(select[aria-label="Register view"]) { grid-template-columns: minmax(0, 1fr) auto auto; }
  .reg-tools-toggle { display: block; }
  #expense-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; grid-column: 1/-1; grid-row: 2; }
  .reg-tools-toggle[aria-expanded="false"] + #expense-tools { display: none; }
  #expense-tools > :is(button, a) { min-height: 44px; justify-content: center; }

  #app #page-actions > select[aria-label="Register view"] { width: 100%; }
  #app[data-page="cashflow"] #page-actions:has(> :nth-child(3):last-child) > select { grid-column: 1/-1; }
  .reg-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
  .reg-entry > :is(.reg-prepayment-terms, .reg-classification) { gap: 8px 12px; }
  .reg-entry > .reg-file { grid-column-start: 1; }
  .reg-file-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reg-file-icon { padding-inline: 8px; }
  #page-actions > :is(button,a,select), .reg-entry > button[type="submit"], .reg-entry :is(select, input:not([type="checkbox"])),
  .reg-file-icon, .reg-head-button { min-height: 44px; }
  .reg-payee-options { inset-inline: auto 0; width: max-content; max-width: min(28rem, 200%); }
  .reg-entry input[type="date"] { padding-inline: 5px; }
  .reg-upsale-form, .reg-catalogue, .reg-upsale-history { min-width: 0; padding: 12px; }
  .reg-upsale-selection, .reg-upsale-order { display: grid; gap: 10px 8px; }
  .reg-upsale-selection { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.25rem), 1fr)); }
  .reg-upsale-selection label > :is(input,select) { min-width: 0; }
  .reg-upsale-selection > label:first-child, .reg-upsale-order > label:has(input[aria-label="Optional note"]) { grid-column: 1/-1; }
  .reg-upsale-order { grid-template-columns: minmax(0, 1fr) 5rem; }
  .reg-upsale-order button { grid-column: 1/-1; }
  .reg-categories { gap: 6px; }
  .reg-categories button { min-height: 40px; }
  .reg-menu-item { min-height: 44px; font-size: 14px; }
  .reg-upsale-form :is(input:not([type="checkbox"]),select,button[type="submit"]), .reg-menu-heading { min-height: 44px; }
  .reg-value-list label { min-height: 40px; overflow-wrap: anywhere; }
  .reg-value-list input { flex: none; }
  .reg-popup-foot > button { flex: 1; }
  .reg-scroll :is(th,td) { padding-inline: 9px; }
  .reg-map-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (pointer: coarse) {
  .reg-entry :is(input:not([type="file"]),select),
  .reg-upsale-layout :is(input,select), .reg-column-popup input:not([type="checkbox"]) {
    font-size: 16px;
  }
}

.reg-entry .income-payer { flex: 2 1 220px; }
.income-payer input { padding-inline-end: 48px; }
.income-payer input::-webkit-search-cancel-button { appearance: none; }
.income-payer :is(.payer-clear,.payer-toggle) {
  position:absolute; bottom:1px; right:3px; width:23px; height:calc(100% - 22px);
  min-height:0; border:0; padding:0; background:transparent; color:var(--muted);
  display:grid; place-items:center;
}
.income-payer .payer-clear { right:26px; font-size:17px; }
.income-payer .payer-toggle svg { width:15px; }
.income-payer:has(input:placeholder-shown) .payer-clear { display:none; }
.income-payer:has(input:placeholder-shown) input { padding-inline-end:26px; }
@media(max-width:640px) {
  .income-payer .reg-payee-options { inset-inline:0; width:100%; }
}
@media (max-width: 480px) {
  #app[data-page="income"] .reg-entry > :is(label:has(input[type="date"]), .income-payer) { grid-column: 1/-1; }
  .reg-entry > label:has(select[aria-label="Description"],select[aria-label="Paid from"],select[aria-label="Paying for"]) { grid-column: 1/-1; }
  .reg-entry:has(> label[hidden] select[aria-label="Receiving bank"]) > label:has(select[aria-label="Method"]) { grid-column: 1/-1; }
}
@media (max-width: 350px) {
  .reg-entry > label:has(select[aria-label="Method"],select[aria-label="Receiving bank"]) { grid-column: 1/-1; }
}

.reg-description-mapping, .reg-description-mapping .reg-map-fields, .reg-description-mapping .reg-map-fields > div {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 10px;
}
.reg-description-mapping[hidden] { display: none; }
.reg-description-mapping input[readonly] { max-width: 6rem; }
.reg-fx-amount { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.reg-fx-amount .report-info { flex: none; }

.atm-proof:not([hidden]) { display: grid; gap: 6px; justify-items: start; font-size: 13px; }
.atm-proof img { max-width: 100%; max-height: 240px; object-fit: contain; border-radius: 6px; }

/* Date text and the indicator share the available width inside each field. */
input[type="date"] {
  box-sizing: border-box;
  max-inline-size: 100%;
  min-inline-size: 0;
}
label:not(.guest-header-date) > input[type="date"] { inline-size: 100%; }
@media (pointer: coarse) {
  label:has(> input[type="date"]) { min-inline-size: 0; }
  input[type="date"] { min-height: 44px; }
  input[type="date"]::-webkit-date-and-time-value { text-align: start; }
}

.worktree-tabs {display:flex;gap:.25rem;flex-wrap:wrap;border-bottom:1px solid var(--line,#d6dbd7);padding-bottom:.6rem}
.worktree-tabs button {flex:1 0 auto}
.worktree-tabs button.active {background:var(--ink,#183c2c);color:white}
.worktree-choices {display:grid;max-height:min(49vh,29rem);overflow:auto;overscroll-behavior:contain}
.reg-drawer-form label.worktree-choice {display:flex;flex-direction:row;align-items:center;gap:.6rem;padding:.4rem 0;font-weight:400}
.reg-drawer-form .worktree-choice input {width:1rem;min-height:1rem;height:1rem;flex:none;margin:0}
.reg-drawer-form [role=tabpanel] {display:grid;gap:.8rem}
.reg-drawer-form [hidden] {display:none}

.reg-scroll .reg-amount-column { text-align: right; }
.reg-amount-column .reg-head-button { justify-content: flex-end; }
.reg-open-row { cursor: pointer; }
.reg-open-row:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.reg-scroll .reg-windowed tbody tr:not(.reg-spacer) > td { height: 48px; box-sizing: border-box; padding-block: 0; }
.reg-scroll .reg-spacer > td { padding: 0; border: 0; }

.worktree-fields {display:grid;gap:16px;min-inline-size:0;border:0;padding:0;margin:0}
.worktree-fields ~ .reg-form-actions > :first-child {margin-inline-end:auto}

.worktree-payee {position:relative}
.worktree-payee input {padding-inline-end:38px}
.worktree-payee .payer-toggle {width:36px;height:36px;bottom:1px}
.worktree-payee .reg-payee-options {inset-inline:0;width:100%;max-width:none}

.prepaid-month { display: flex; align-items: center; gap: .5rem; }
.prepaid-month > :is(input, select) { flex: 1; min-width: 0; }

.reg-scroll .stable-register { table-layout:fixed; }
.reg-scroll .stable-register tbody td { overflow:hidden; text-overflow:ellipsis; }
.reg-scroll .stable-register tbody .reg-plain { background:var(--surface); }
.reg-scroll .stable-register tbody .reg-stripe { background:color-mix(in srgb,var(--ink) 4%,var(--surface)); }
#app .stable-register { --register-hover:#d9ecff; }
.night-mode #app .stable-register { --register-hover:#29496b; }
#app .reg-scroll .stable-register tbody tr[aria-rowindex]:hover,
#app .reg-scroll .stable-register tbody tr[aria-rowindex]:hover > td { background-color:var(--register-hover); }
.reg-scroll .stable-register :is(td,th).reg-currency { padding-inline-start:40px; }
#app:is([data-page="income"],[data-page="expenses"]) .reg-entry { padding:12px; border:1px solid color-mix(in srgb,var(--green) 38%,var(--surface)); border-radius:10px; background:color-mix(in srgb,var(--green) 10%,var(--surface)); }

.reg-clear-filters {min-height:30px;padding:4px 10px;font-size:12px}
.reg-column-popup {width:min(220px,calc(100vw - 12px))}
.reg-column-popup > input[type=search] {width:100%;min-width:0}
