@font-face {
  font-family: LocalInter;
  src: local("Inter");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #232239;
  --text: #29282f;
  --muted: #676674;
  --nav: #fbf9fa;
  --line: #e4e2e5;
  --soft: #f6f5f6;
  --accent: #cc4934;
  --focus: #4c40ac;
  --side-width: 15rem;
  font: 100%/1.5 LocalInter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: white; }
button, input, textarea, select { font: inherit; }
a { color: var(--focus); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-width);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.4rem 1rem .9rem;
  overflow-y: auto;
  background: var(--nav);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 .35rem 1rem;
  color: #aa3829;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.045em;
  text-decoration: none;
}
.brand::before {
  content: "";
  flex: 0 0 2.1rem;
  height: 2.1rem;
  border-radius: .55rem;
  background:
    linear-gradient(#fff, #fff) .59rem .51rem / .16rem 1.08rem no-repeat,
    linear-gradient(#fff, #fff) .93rem .59rem / .57rem .15rem no-repeat,
    linear-gradient(#fff, #fff) .93rem .94rem / .57rem .15rem no-repeat,
    linear-gradient(#fff, #fff) .93rem 1.29rem / .38rem .15rem no-repeat,
    #cb4c38;
}
.sidebar nav { display: grid; gap: .2rem; }
.sidebar nav a, .profile {
  color: var(--ink);
  font-size: .95rem;
  text-decoration: none;
}
.sidebar nav a {
  display: flex;
  position: relative;
  align-items: center;
  gap: .65rem;
  min-height: 2.65rem;
  padding: .5rem .85rem;
  border-radius: .4rem;
}
.sidebar nav a:hover { background: #f0edef; }
.sidebar nav a.active, .sidebar nav a[aria-current="page"] {
  background: #efeaec;
  color: #201d36;
  font-weight: 650;
}
.sidebar nav a.active::before, .sidebar nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: .55rem auto .55rem 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.profile { margin-top: auto; padding: .85rem .35rem 0; border-top: 1px solid var(--line); }

main {
  margin-left: var(--side-width);
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 3.5rem);
}
h1, h2, h3, p { margin: 0 0 .75rem; }
h1, h2, h3 { color: #232228; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 3vw, 2.45rem); font-weight: 540; letter-spacing: -.045em; }
h2 { font-size: 1.25rem; font-weight: 620; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; font-weight: 640; }
.page-head, .actions, .filters, .tabs { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.page-head { justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; }
.page-head h1 { margin-bottom: 0; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.actions form, .profile form, .filters form { margin: 0; }
.card, .stat, .login-card {
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: white;
  box-shadow: 0 2px 6px #29223e08;
}
.card { margin: 0 0 1.2rem; padding: 1.2rem; min-width: 0; }
.card > :last-child, .login-card > :last-child { margin-bottom: 0; }
.stats, .grid { display: grid; gap: 1rem; margin-bottom: 1.2rem; }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); align-items: start; }
.grid > *, .stats > * { min-width: 0; }
.grid > .card { margin: 0; }
.stat { padding: 1rem 1.2rem; }
.stat .label { color: var(--muted); font-size: .9rem; }
.stat strong {
  display: block;
  margin-top: .25rem;
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.3;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.btn, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.5rem;
  max-width: 100%;
  padding: .5rem .88rem;
  border: 1px solid #d9d7dc;
  border-radius: .48rem;
  color: var(--ink);
  background: white;
  font-size: .91rem;
  line-height: 1.35;
  font-weight: 570;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover, button:hover, input[type="submit"]:hover { background: var(--soft); }
.primary, button.primary, input.primary[type="submit"] { color: white; border-color: var(--ink); background: var(--ink); }
.primary:hover, button.primary:hover, input.primary[type="submit"]:hover { background: #3c3856; }
button:disabled, input:disabled { opacity: .58; cursor: default; }
.field { display: grid; gap: .35rem; min-width: 0; margin-bottom: .9rem; }
label, .label { font-size: .91rem; font-weight: 550; color: var(--ink); }
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), textarea, select {
  min-height: 2.55rem;
  max-width: 100%;
  padding: .5rem .7rem;
  border: 1px solid #c9c7d0;
  border-radius: .45rem;
  color: var(--ink);
  background-color: white;
  font-size: 1rem;
  line-height: 1.35;
}
.field > input:not([type="checkbox"]):not([type="radio"]), .field > select, .field > textarea { width: 100%; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #666270 50%), linear-gradient(135deg, #666270 50%, transparent 50%);
  background-position: calc(100% - 1.04rem) center, calc(100% - .81rem) center;
  background-size: .23rem .23rem;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); }
input[type="file"] { font-size: .9rem; }
textarea { resize: vertical; }
.filters { align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; }
.tabs { margin: 0 0 1rem; gap: .35rem; }
.tabs a, .tabs button { padding: .35rem .7rem; border: 0; border-radius: .4rem; text-decoration: none; color: var(--ink); font-size: .91rem; }
.tabs a:hover, .tabs button:hover { background: var(--soft); }
.tabs .active, .tabs [aria-current="page"] { background: #eae8ec; font-weight: 630; }

.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th, td { text-align: left; padding: .8rem .85rem; border-bottom: 1px solid #ebe9ec; vertical-align: middle; }
th { color: #484651; background: var(--soft); font-size: .875rem; font-weight: 620; }
tbody tr:hover { background: #faf9fb; }
tbody tr:last-child td { border-bottom: 0; }
table a { text-decoration: none; }
table a:hover { text-decoration: underline; }
.num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: .17rem .58rem;
  border-radius: 1rem;
  color: #514e5c;
  background: #efedf1;
  font-weight: 550;
  font-size: .875rem;
  white-space: nowrap;
}
.badge.good { color: #166047; background: #daf4e8; }
.badge.warn { color: #79500d; background: #fff0cc; }
.badge.bad { color: #922c37; background: #fce2e4; }
.notice { margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid #e4d9ba; border-radius: .55rem; color: #604d28; background: #fffaf0; }
.notice.good { background: #edf8f1; border-color: #c4e2cc; color: #205a40; }
.notice.bad { background: #fff2f2; border-color: #ebcbcd; color: #812c36; }
.muted, small { color: var(--muted); }
details { margin: .6rem 0; }
summary { cursor: pointer; padding: .45rem 0; color: var(--ink); font-weight: 570; }
details[open] > summary { margin-bottom: .4rem; }

.login { display: grid; min-height: 100vh; min-height: 100svh; place-items: center; margin: 0; padding: 1.5rem; background: #f8f6f7; }
.login main, main.login { margin-left: 0; }
.login-card { width: min(100%, 25rem); padding: clamp(1.25rem, 5vw, 2.25rem); }
.login-card .brand { margin-left: 0; }
.login-card h1 { margin-bottom: 1.3rem; font-size: 1.9rem; }
.login-card .primary { width: 100%; }

@media (max-width: 58rem) and (min-width: 44.01rem) {
  :root { --side-width: 12rem; }
  .sidebar { padding-inline: .65rem; }
}
@media (max-width: 44rem) {
  .sidebar { position: static; width: 100%; padding: .85rem 1rem .65rem; gap: .6rem; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; }
  .sidebar nav { display: flex; overflow-x: auto; padding: .28rem 0; }
  .sidebar nav a { flex: none; min-height: 2.45rem; padding: .4rem .7rem; }
  .sidebar .profile { margin-top: 0; padding: .25rem 0 0; border-top: 0; }
  main { margin-left: 0; padding: 1.2rem 1rem; }
  .page-head { gap: .75rem; }
  .stats, .grid { gap: .65rem; }
  .card, .stat { padding: .9rem; }
  th, td { padding: .65rem .55rem; }
}
@media print {
  .sidebar, .actions, .filters, .tabs, button, .btn { display: none !important; }
  main { margin: 0; padding: 0; }
  .card, .stat { box-shadow: none; }
  .table-scroll { overflow: visible; }
  th, td { padding: .3rem; }
  tr { break-inside: avoid; }
}
pre, code { overflow-wrap:anywhere; white-space:pre-wrap; }
hr { border:0; border-top:1px solid var(--line); margin:1.3rem 0; }
.card + .card, .grid + .card { margin-top:1rem; }
h2 { font-size:1.18rem; }
.upload-area { border:1px dashed #c8c4ca; background:#f8f6f6; border-radius:.6rem; position:relative; display:grid; justify-items:center; gap:.5rem; padding:1.5rem 1rem; margin:1rem 0 1.5rem; cursor:pointer; }
.upload-area input { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; }
.upload-area:focus-within { outline:2px solid var(--focus); }
.upload-area small { font-weight:400; }
.bank-memo {display:block;color:var(--muted);max-width:32rem;overflow-wrap:anywhere;font-size:.8rem}
.account-tabs {overflow-x:auto;flex-wrap:nowrap}
.account-tabs a {white-space:nowrap}
.row-menu {min-width:5.5rem;text-align:left}
.row-menu summary {font-weight:600;color:var(--focus);cursor:pointer}
.row-menu[open] {min-width:10.5rem}
.row-menu div {display:grid;gap:.2rem;padding:.4rem 0}
.row-menu form,.row-menu button,.row-menu a {margin:0}
.row-menu button,.row-menu a {display:block;text-align:left;background:none;color:var(--focus);border:0;box-shadow:none;padding:.25rem 0;font-size:.83rem;font-weight:500}
.nav-group {border:0;padding:0;margin:0}
.nav-group summary {margin:0;padding:.48rem .85rem;cursor:pointer;color:var(--ink);font-weight:600;border-radius:.4rem}
.nav-group summary:hover {background:var(--soft)}
.nav-group>div {margin-left:.65rem;border-left:1px solid var(--line);padding-left:.25rem}
@media(max-width:44rem) {.sidebar nav {align-items:flex-start}.nav-group{flex:none}.nav-group summary{white-space:nowrap}}
.sidebar nav a {min-height:2.05rem;padding:.33rem .85rem}
.paper {max-width:56rem;margin:1rem auto;padding:clamp(1rem,5vw,4rem)}
.letterhead {text-align:right;margin-bottom:2.5rem}
.paper footer {border-top:1px solid var(--line);margin-top:3rem;padding-top:1rem;font-size:.85rem}
.sale-line {background:var(--soft);border-radius:.4rem;margin-bottom:.7rem;padding:.8rem}
@media print {.no-print,.notice,.page-head,.sale-line button {display:none!important}.paper {border:0;margin:0;padding:0;width:100%}.paper .letterhead{margin-bottom:3rem}}

/* Shared application shell and work surfaces. */
:root {--side-width:248px;--ink:#19152d;--text:#302f37;--focus:#5447ba;--line:#e4e1e2;--soft:#f5f3f3}
.app-page {background:#fff;font-size:14px;line-height:1.48}
.app-page main {padding:0 24px 32px;min-width:0}
.icon-library {position:absolute;pointer-events:none}
.ui-icon {width:19px;height:19px;flex:none;vertical-align:middle}
.sidebar {padding:24px 20px 12px;gap:0;background:#fbf9f9}
.sidebar .brand {padding:0;margin:0 4px 24px;font-size:22px;color:#e45239;letter-spacing:-.055em}
.sidebar .brand::before {width:32px;height:32px;flex-basis:32px;background-color:#ee563e}
.nav-search,.sidebar .nav-main {color:#59576a;text-decoration:none}
.nav-search {display:flex;align-items:center;gap:12px;border-radius:7px;background:#f1eded;padding:9px 12px;margin-bottom:12px}
.nav-search kbd {margin-left:auto;color:#85808f;font:12px inherit}
.sidebar nav {display:block}
.sidebar .nav-main {gap:12px;min-height:40px;font-size:14px;font-weight:530;padding:8px 10px}
.sidebar .selected>.nav-main {color:#171329;font-weight:660}
.subnav {border-left:3px solid #e4dfe0;margin:0 0 3px 19px;padding-left:10px;animation:reveal-in .16s ease-out}
.sidebar .subnav a {min-height:33px;font-size:13px;padding:6px 9px}
.sidebar nav a.active::before {display:none}
.sidebar nav a.active {background:#eee9ea}
.nav-caption {display:block;font-size:10px;font-weight:630;text-transform:uppercase;letter-spacing:.11em;color:#98939c;margin:21px 8px 6px}
.mobile-nav {display:none}
.profile {margin-top:auto;display:flex;align-items:center;gap:8px;font-size:13px;padding:12px 2px 0;border:0}
.profile form {margin-left:auto}.profile button,.icon-btn,.reader-bar button,.reader-bar a {min-width:30px;min-height:30px;padding:4px;border:0;background:transparent;color:#656171;box-shadow:none}
.avatar {width:29px;height:29px;border-radius:50%;display:grid;place-items:center;color:white;background:#26213f}
.page-head {min-height:70px;padding:12px 0;margin:0 0 18px;gap:12px;border-bottom:1px solid var(--line)}
.page-head h1 {font-size:23px;font-weight:570;letter-spacing:-.035em;color:#201e22}
.app-page .btn,.app-page button {font-size:13px;line-height:20px;min-height:34px;border-radius:6px}
.app-page .primary {background:#302641;border-color:#302641;color:white}
.app-page .primary:hover {background:#46385a}
.app-page .card,.app-page .stat {border-radius:6px;box-shadow:none}
.app-page .card:has(> .table-scroll:first-child) {padding:0;border:0;border-radius:0}
.app-page .table-scroll {border:0;border-radius:0}
.app-page th {color:#615d68;background:#f8f7f7;font-size:12px;white-space:nowrap;font-weight:620}
.app-page th,.app-page td {padding:10px 12px;border-bottom:1px solid #eeeaea}
.app-page td {font-size:13px}.app-page tbody tr:has(a):hover {background:#faf9fc;cursor:pointer}
.sort-link {display:inline-flex;align-items:center;gap:5px;text-decoration:none;color:inherit}.sort-link .ui-icon{width:13px;height:13px;color:#98949e}
.app-page table .badge {font-size:11px;font-weight:600;border-radius:30px;padding:3px 8px}
.app-page .tabs {gap:3px;align-items:center;margin:0}
.app-page .tabs a {font-size:13px;text-decoration:none;border:0;border-radius:5px;padding:6px 10px;color:#66616c}
.app-page .tabs .active {color:#211d2c;background:#eee9eb}
.list-tools {display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:16px 0 12px}.list-tools .tabs{margin-right:auto}
.filter-toggle summary,.back-link,.picker-extra,.bank-title {display:inline-flex;align-items:center;gap:6px}
.filter-toggle {margin:0;border:0;padding:0}
.filter-toggle summary {cursor:pointer;list-style:none;border:1px solid var(--line);border-radius:6px;padding:6px 10px;font-size:13px;font-weight:560;background:white}
.filter-toggle summary::-webkit-details-marker {display:none}
.filter-toggle .filters {margin:0;padding:12px;border:1px solid var(--line);border-radius:6px;background:#fff;gap:10px}
.filter-toggle[open] summary {margin-bottom:6px;color:var(--focus)}
.upload-area {margin:4px 0 16px;border:1px dashed #cbc6cb;background:#fbfafa;min-height:94px;padding:13px;gap:3px}
.upload-area .ui-icon {color:#726b7a;width:23px;height:23px}
.upload-area strong {font-size:14px;font-weight:580}.upload-area small{color:var(--muted);font-size:12px}
.account-tabs{flex-wrap:wrap;overflow:visible}
.app-page [hidden] {display:none!important}
.row-menu{padding:0;border:0;min-width:0;margin:0}
.row-menu[open]{min-width:0}
.row-menu summary {display:inline-grid;place-items:center;list-style:none;font-size:0;width:30px;height:30px;border:0;border-radius:5px;color:var(--muted);cursor:pointer}
.row-menu summary::-webkit-details-marker{display:none}
.row-menu summary::before{content:"•••";font-size:14px;letter-spacing:1px}
.row-menu summary:hover,.reader-bar button:hover,.reader-bar a:hover,.icon-btn:hover {background:#eae6ea}
.action-popover:popover-open {display:grid;gap:2px;position:fixed;inset:auto;margin:0;padding:5px;min-width:185px;max-width:min(340px,92vw);border:1px solid #ddd8df;border-radius:8px;background:white;box-shadow:0 6px 24px #29203525;animation:reveal-in .13s ease-out}
.action-popover a,.app-page .action-popover button {width:100%;justify-content:start;display:flex;align-items:center;gap:7px;background:#fff;color:#403949;border:0;border-radius:4px;font-size:13px;font-weight:480;min-height:30px;padding:5px 9px;text-decoration:none}
.action-popover a:hover,.app-page .action-popover button:hover {background:#f2eff5}
.bank-title {color:inherit;font-weight:560;text-decoration:none}.bank-title .ui-icon {display:none}
.app-page .page-head .actions {gap:7px}
.page-document main {background:#f2f1f1;min-height:100vh;padding:0 20px 24px}
.page-document .page-head {margin:0 -20px 22px;padding:10px 22px;min-height:60px;background:#fff}
.receipt-nav {display:flex;align-items:center;gap:5px;margin-bottom:5px}
.spacer {flex:1}.back-link {color:#544e55;text-decoration:none;font-weight:590}
.receipt-workspace {display:grid;grid-template-columns:minmax(0,1fr) minmax(330px,min(37%,600px));align-items:start;gap:20px;padding:20px;background:white;border:1px solid #ebe8e9;box-shadow:0 1px 4px #2520250b}
.reader {min-width:0;border:1px solid #d9d6d8;background:white;overflow:hidden;position:sticky;top:10px}
.reader-bar {min-height:44px;display:flex;align-items:center;gap:3px;padding:5px 12px;background:#f0efef;color:#49464c;font-size:12px}
.reader-bar button,.reader-bar a,.dialog-title button,.icon-btn {display:inline-grid;place-items:center;text-decoration:none}
.reader-bar .ui-icon {width:17px;height:17px}
.reader-paper {height:max(430px,calc(100dvh - 195px));overflow:auto;background:white;text-align:center;padding:4px}
.reader-paper canvas,.reader-paper img {vertical-align:top;max-width:none;margin:4px auto;height:auto}
.reader-message,.reader-paper p {padding:20px;color:var(--muted)}
.reader:fullscreen,.reader-expanded {background:white;inset:0;z-index:20}.reader-expanded{position:fixed}.reader:fullscreen .reader-paper,.reader-expanded .reader-paper {height:calc(100dvh - 44px)}
.missing-preview {padding:32px;text-align:center;color:var(--muted)}.missing-preview form {max-width:340px;margin:auto}
.receipt-info {padding:14px 8px;min-width:0}.receipt-status{font-size:15px;font-weight:650}.receipt-paid{margin:10px 0}.receipt-paid a {color:#504c53}
.receipt-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 12px;margin:28px 0}
.receipt-fields dt {display:flex;align-items:center;gap:8px;font-size:13px;color:#635e68}
.receipt-fields dt .ui-icon {width:16px;height:16px}
.receipt-fields dd{margin:6px 0 0 24px;font-weight:590;overflow-wrap:anywhere}
.receipt-info h2 {font-size:11px;color:#79747c;text-transform:uppercase;letter-spacing:.06em;margin:25px 0 12px}
.receipt-line,.receipt-total{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.receipt-line span {font-size:12px;color:#716b75}.receipt-line strong{display:block;margin-top:4px;color:#34303a;font-size:13px}
.receipt-info details {border:0;margin:8px 0;padding:5px 0}.receipt-info summary{cursor:pointer;font-weight:550}
.receipt-total {font-weight:650;margin-bottom:15px}.receipt-info .table-scroll{overflow-x:auto}
#work-dialog {width:min(760px,calc(100vw - 32px));max-height:min(88dvh,920px);border:1px solid #ddd7df;border-radius:12px;padding:0;color:var(--ink);box-shadow:0 24px 90px #17102044;overscroll-behavior:contain}
#work-dialog[open] {animation:dialog-in .17s ease-out}#work-dialog::backdrop {background:#17142170;animation:fade-in .15s ease-out}
.dialog-title {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid var(--line)}
.dialog-title h2 {font-size:20px;margin:0}.dialog-title button {margin:0}
.match-summary {display:flex;justify-content:space-between;gap:16px;background:#f6f4f6;padding:14px 16px;border-radius:7px;margin:18px 22px}
.match-summary>div {display:grid;gap:3px}.match-summary>div:first-child {grid-template-columns:auto 1fr}.match-summary>div:first-child small {grid-column:2}.match-summary>div:last-child{text-align:right}
.match-summary small,.match-row small{color:#77717d}
.match-work h3,.match-work>.dialog-tabs,.picker-tools,.match-list,.replace-confirm,.picker-extra,.manual-payment{margin:12px 22px}
.match-work h3 {font-size:15px}.picker-tools{display:flex;align-items:end;gap:10px}.picker-tools .field{flex:1;margin:0}
.match-list {max-height:min(39dvh,430px);overflow-y:auto;overscroll-behavior:contain;border-block:1px solid var(--line)}
.match-row {padding:8px 4px;border-bottom:1px solid #eee}
.match-row>label:first-child {display:flex;align-items:center;gap:10px;cursor:pointer;color:inherit;font-size:13px}
.match-row>label:first-child>span {display:grid;gap:2px;flex:1;min-width:0;overflow-wrap:anywhere}
.match-row>label:first-child b {white-space:nowrap}
.match-row input[type=checkbox],.replace-confirm input {accent-color:var(--focus);width:16px;height:16px}
.match-row:has(:checked){background:#f6f4fb}.part-amount {display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:4px}
.part-amount input {width:110px}.empty-match,.loading {padding:16px;text-align:center;color:var(--muted)}
.dialog-footer {display:flex;align-items:center;gap:8px;padding:14px 22px;border-top:1px solid var(--line);background:white}
.dialog-footer output {margin-right:auto;font-weight:600;font-size:13px}
.manual-payment {font-size:13px;border:0}.manual-payment summary {cursor:pointer}.replace-confirm{display:flex;align-items:center;gap:8px}
.page-search .search-work,.page-assign .match-work {max-width:850px;margin:16px auto}
.search-work form {display:flex;gap:6px;padding:14px 20px;align-items:end}.search-work .field {flex:1;margin:0}
.search-results{max-height:55dvh;overflow:auto;padding:0 18px 15px}
.search-results h3 {font-size:12px;color:var(--muted);margin:12px 0 4px}
.search-hit {display:flex;gap:10px;align-items:center;padding:8px;color:#484151;text-decoration:none;border-radius:5px}.search-hit:hover{background:var(--soft)}
@keyframes dialog-in{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
@keyframes reveal-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@media(max-width:1050px){:root{--side-width:205px}.receipt-workspace{grid-template-columns:minmax(0,1fr) minmax(280px,39%);gap:12px;padding:12px}}
@media(max-width:760px){.app-page main,.page-document main{margin:0;padding:0 12px 20px}.sidebar{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;position:static;width:100%;padding:8px 12px;gap:8px}.sidebar .brand{margin:0 auto 0 0;font-size:18px}.mobile-nav{display:inline-flex}.sidebar .nav-body,.sidebar .profile{display:none}.sidebar.mobile-open .nav-body,.sidebar.mobile-open .profile{display:block;width:100%}.sidebar.mobile-open .profile{display:flex}.sidebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.nav-caption{grid-column:1/-1}.receipt-workspace{display:flex;flex-direction:column}.receipt-workspace>*{width:100%}.reader{position:static}.reader-paper{height:55dvh;min-height:260px}.page-document .page-head{margin:0 -12px 12px;padding:8px 12px}.dialog-footer{flex-wrap:wrap}.dialog-footer output{width:100%}.page-head h1{font-size:20px}.list-tools{gap:5px}.page-head{min-height:58px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important}}
@media print{.sidebar,#work-dialog,.picker-tools,.dialog-footer,.receipt-nav,.reader-bar,.list-tools{display:none!important}.app-page main{margin:0;padding:0}.receipt-workspace{display:block}.reader-paper{height:auto;overflow:visible}}
.editor-grid.with-preview{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:16px;align-items:start}
.editor-grid.with-preview .grid{grid-template-columns:repeat(auto-fit,minmax(min(12rem,100%),1fr))}
#upload-queue{padding:14px;border:1px solid var(--line);border-radius:6px}
@media(max-width:760px){.editor-grid.with-preview{display:flex;flex-direction:column}.editor-grid.with-preview>*{width:100%}}

@font-face {font-family:Inter;src:url('./?p=font') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
.app-page {font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
.monthly header,.chart-key,.chart-key span {display:flex;align-items:center;gap:12px}
.monthly header {justify-content:space-between;margin-bottom:14px;flex-wrap:wrap}
.monthly header h2 {margin:0}.chart-key {font-size:12px;color:var(--muted)}
.chart-key span {gap:5px}.chart-key span::before {content:"";width:9px;height:9px;border-radius:2px;background:#548a7b}
.chart-key span+span::before {background:#e98969}
.month-chart {display:grid;grid-template-columns:repeat(12,minmax(0,1fr));margin-bottom:16px}
.month-chart a {color:var(--muted);text-decoration:none;text-align:center;font-size:11px;border-radius:4px;padding:3px 0}
.month-chart a:hover,.month-chart a:focus-visible {background:#f5f2f2;color:var(--ink)}
.month-chart svg {width:100%;height:128px;display:block}.month-chart line {stroke:#dedadc;stroke-width:1}
.month-chart rect {fill:#548a7b}.month-chart rect+rect {fill:#e98969}
@media(max-width:500px){.month-chart a{font-size:9px}.monthly.card{padding:12px}}

.master-work {padding:20px 24px}.master-work .field{margin-block:10px}.master-work .dialog-footer {margin-top:20px}
.inline-search,.type-tabs {display:flex;gap:6px;align-items:end}.inline-search .field{margin:0}
.type-tabs {align-items:stretch;gap:0;margin:0 0 3px}.type-tabs button{border-radius:0}.type-tabs button:first-of-type{border-radius:5px 0 0 5px}
.type-tabs button:last-child{border-radius:0 5px 5px 0}.type-tabs button[aria-pressed=true]{background:#eae6eb;color:#332c38}
.save-toast {position:fixed;z-index:12;right:20px;bottom:18px;display:flex;align-items:center;gap:9px;background:#fff;border:1px solid #bdd5c3;box-shadow:0 5px 22px #28253022;border-radius:8px;padding:8px 10px 8px 14px;color:#265a3e;max-width:calc(100vw - 32px);animation:reveal-in .16s ease-out}
.save-toast button {border:0;min-height:26px;padding:3px;background:transparent;color:inherit}
.receipt-tags {border-block:1px solid var(--line);padding:8px 0}
@media(min-width:1051px){
  .page-document main:has(.receipt-workspace){height:100dvh;display:flex;flex-direction:column}
  .page-document .page-head,.receipt-nav{flex:none}
  .receipt-workspace{flex:1;min-height:0;grid-template-rows:minmax(0,1fr);overflow:hidden}
  .receipt-workspace>.reader{position:relative;top:0;height:100%;min-height:0;display:flex;flex-direction:column}
  .receipt-workspace>.reader .reader-paper{flex:1;min-height:0;height:auto}
  .receipt-workspace>.reader-bar{flex:none}
  .receipt-workspace>.receipt-info,.receipt-workspace>.generated-preview{height:100%;overflow:auto}
  .receipt-workspace>.missing-preview{height:auto}
}
@media print{.save-toast{display:none}}

.sheet-work {padding:20px 22px}.sheet-work .table-scroll{margin-top:16px}
#work-dialog:has(.sheet-work){margin:0 0 0 auto;max-height:100dvh;height:100dvh;width:min(740px,100vw);border-radius:10px 0 0 10px}

.app-page table:has(.row-menu) :is(th,td):last-child{position:sticky;right:0;background:#fff;box-shadow:-1px 0 #eae7ea;z-index:1;text-align:center}
.app-page table:has(.row-menu) th:last-child{background:#f8f7f7}
.app-page table:has(.row-menu) tr:hover td:last-child{background:#faf9fc}
.app-page .status-more,.app-page .status-more[open]{min-width:0;margin:0}.app-page .status-more>summary{display:flex;align-items:center;gap:3px;background:none;border:0;font-size:13px;color:#665f68;padding:6px}
.app-page .status-more>summary::after,.app-page .status-more>summary::before{content:none}.status-more .ui-icon{width:13px;height:13px}
