@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  font-optical-sizing: auto;
}
@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/courier-prime-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/courier-prime-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2ebdd;
  --paper-2: #e9dfcd;
  --paper-3: #f7f1e5;
  --ink: #1b1a17;
  --ink-soft: #3d3830;
  --muted: #6b6151;
  --rule: #cfc2ad;
  --rule-strong: #a99a80;
  --violet: #5b2a56;
  --violet-deep: #2b1228;
  --red: #b5342b;
  --green: #2f6b4f;
  --mustard: #a87c1c;
  --blue: #2b4c7e;
  --focus: #2b4c7e;
  --shadow: 0 18px 44px -28px rgba(43, 18, 40, 0.45);
  --card-shadow: 0 1px 2px rgba(27, 26, 23, 0.04), 0 8px 22px -18px rgba(27, 26, 23, 0.5);
  --violet-wash: #f0e7ee;
  --green-wash: #e6efe9;
  --red-wash: #f7e7e5;
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 12px;
  --bar: 61px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
::selection { background: var(--violet); color: var(--paper-3); }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-deep); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  background: var(--paper-3);
  padding: 8px 12px;
  border: 1px solid var(--violet);
}
.skip:focus { left: 12px; }

/* ---------------------------------------------------------------- shell */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  min-height: var(--bar);
  padding: 0 20px 0 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--violet); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.16em;
}
.brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-header .brand-sub { display: none; }

/* Business switcher: context, not navigation. One dropdown instead of a row
   of tabs that overflows once an owner runs three businesses. */
.biz-switch { position: relative; flex: none; }
.biz-switch > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  max-width: 340px;
}
.biz-switch > summary::-webkit-details-marker { display: none; }
.biz-switch > summary:hover { border-color: var(--rule-strong); }
.biz-switch[open] > summary { border-color: var(--violet); background: #fff; }
.biz-switch > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.biz-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--violet);
  color: #fff;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  flex: none;
  overflow: hidden;
}
.biz-avatar.is-logo { object-fit: contain; background: #fff; border: 1px solid var(--rule); padding: 2px; }
.biz-avatar.is-small { width: 28px; height: 28px; font-size: 13px; }
.biz-avatar.is-logo.is-small { padding: 1px; }
.biz-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.biz-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.biz-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biz-chevron { width: 16px; height: 16px; color: var(--muted); flex: none; }
.biz-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 48px -22px rgba(27, 26, 23, 0.45);
  padding: 8px;
  z-index: 40;
}
.biz-menu-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px 8px;
}
.biz-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.biz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.biz-option:hover { background: var(--paper); text-decoration: none; }
.biz-option[aria-current="true"] { background: var(--violet-wash); }
.biz-option-text { display: flex; flex-direction: column; min-width: 0; }
.biz-option-name { font-size: 14px; font-weight: 600; }
.biz-option-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.biz-new {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 10px 8px 6px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  font-weight: 600;
  color: var(--violet);
}

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.header-actions > form { display: inline-flex; margin: 0; }
.lang-switch {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
}
.lang-switch a {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.lang-switch a:hover { text-decoration: none; color: var(--violet); background: #fff; }
.lang-switch a.is-on { background: var(--violet); color: #fff; }

.shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--bar)); }

/* Sidebar: icons carry the recognition, labels carry the meaning. */
.sidebar {
  position: sticky;
  top: var(--bar);
  flex: none;
  width: 250px;
  height: calc(100vh - var(--bar));
  padding: 16px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  overflow-y: auto;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 600;
}
.nav-item:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--violet); color: #fff; }
.nav-item[aria-current="page"]:hover { background: var(--violet); }
.nav-icon { width: 20px; height: 20px; flex: none; }
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}
.nav-item[aria-current="page"] .nav-count { background: #fff; color: var(--violet); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Mobile tab bar. Replaced by the sidebar from 1080px up. */
.tabbar { display: none; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-3);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn:hover { text-decoration: none; border-color: var(--violet); color: var(--violet); background: var(--paper); }
.btn-primary {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.btn-primary:hover { background: var(--violet-deep); border-color: var(--violet-deep); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--violet); }
.btn-ghost:hover { border-color: var(--rule); background: var(--paper-3); color: var(--violet-deep); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn-icon { width: 16px; height: 16px; flex: none; }
.btn-sm .btn-icon { width: 14px; height: 14px; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn-google {
  width: 100%;
  height: 40px;
  background: #fff;
  border-color: var(--rule-strong);
  color: var(--ink);
  font-size: 13px;
}
.btn-google:hover { background: #fffdf8; border-color: var(--violet); color: var(--ink); }
.google-mark { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------------ page */

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 32px 44px;
  flex: 1;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.page-sub { color: var(--muted); margin-top: 6px; max-width: 62ch; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.banner {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--green-wash);
  padding: 11px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}
.banner-error { border-left-color: var(--red); background: var(--red-wash); color: var(--red); }

.page-foot {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 32px 30px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 11.5px;
}
.foot-account { color: inherit; font-weight: 600; }
.foot-account:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ home */

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.home-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.home-head .btn { margin-top: 6px; }

.quick-actions { margin-bottom: 26px; }
.quick-actions .section-label { margin-bottom: 10px; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 18px 18px 18px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  color: var(--ink);
  box-shadow: var(--card-shadow);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.action-card:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: var(--violet);
  transform: translateY(-1px);
}
.action-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.action-glyph {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--violet-wash);
  color: var(--violet);
}
.action-glyph svg { width: 22px; height: 22px; }
.action-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.action-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.action-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0 6px 1px;
  margin-right: 5px;
  vertical-align: 1px;
}
.action-body { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.action-arrow { width: 18px; height: 18px; color: var(--muted); margin-left: auto; flex: none; }
.action-card.is-primary {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.action-card.is-primary .action-glyph { background: #ffffff1f; color: #fff; }
.action-card.is-primary .action-body { color: #e6d5e2; }
.action-card.is-primary .action-arrow { color: #fff; }
.action-card.is-primary:hover { background: var(--violet-deep); border-color: var(--violet-deep); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.stat-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-money {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-card.is-overdue { border-color: #e2b7b2; background: var(--red-wash); }
.stat-card.is-overdue .stat-money { color: var(--red); }
.stat-note { font-size: 12px; color: var(--muted); }

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

.panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.panel-head h2 { font-family: var(--serif); font-size: 18px; }
.toolbar-note { color: var(--muted); font-size: 12px; }
.toolbar-link { font-size: 12px; font-weight: 600; }
.panel-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 22px 16px;
  color: var(--muted);
  font-size: 13px;
}
.panel-empty.is-stacked { flex-direction: column; text-align: center; gap: 8px; }
.panel-empty-glyph { width: 18px; height: 18px; flex: none; color: var(--green); }
.panel-empty.is-stacked .panel-empty-glyph { width: 26px; height: 26px; }

.setup-panel { margin-bottom: 20px; }
.checklist { list-style: none; margin: 0; padding: 4px 0; }
.check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.check:last-child { border-bottom: 0; }
.check-mark {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.check.done .check-mark { background: var(--green); border-color: var(--green); }
.check-glyph { width: 12px; height: 12px; color: #fff; stroke-width: 2.6; }
.check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-title { font-weight: 600; color: var(--ink); font-size: 14px; }
.check.done .check-title { color: var(--muted); }
.check-body { color: var(--muted); font-size: 12px; }
.check-cta { font-size: 12px; font-weight: 600; white-space: nowrap; align-self: center; }
.panel-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--violet-wash);
  font-size: 13px;
  font-weight: 600;
  color: var(--violet);
}
.panel-cta:hover { text-decoration: none; color: var(--violet-deep); }

/* Queue: the short list of documents that need the owner today. */
.queue { list-style: none; margin: 0; padding: 0; }
.queue-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 26px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.queue-row:last-child { border-bottom: 0; }
.queue-icon { display: grid; place-items: center; color: var(--muted); }
.queue-icon svg { width: 18px; height: 18px; }
.queue-row.is-late .queue-icon { color: var(--red); }
.queue-row.is-soon .queue-icon { color: var(--amber, #9a6b12); }
.queue-row.is-task .queue-icon { color: var(--violet); }
.queue-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.queue-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.queue-title:hover { text-decoration: none; color: var(--violet); }
.queue-sub { font-size: 12px; color: var(--muted); }
.queue-row.is-late .queue-sub { color: var(--red); font-weight: 600; }
.queue-amount {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.queue-cta { display: grid; place-items: center; color: var(--muted); }
.queue-cta svg { width: 16px; height: 16px; }
.queue-cta:hover { color: var(--violet); }

.recent { list-style: none; margin: 0; padding: 0; }
.recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.recent li:last-child .recent-row { border-bottom: 0; }
.recent-row:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.recent-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-title { font-size: 14px; font-weight: 600; }
.recent-sub { font-size: 12px; color: var(--muted); }
.recent-side { display: flex; align-items: center; gap: 10px; flex: none; }
.recent-amount { font-family: var(--mono); font-size: 12.5px; }

/* Filter chips: one list, several slices. Links, so they work without JS. */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.chip:hover { border-color: var(--violet); color: var(--violet); text-decoration: none; }
.chip[aria-current="page"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.chip[aria-current="page"] .chip-count { color: #e6d5e2; }

.empty {

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 40px 24px;
}
.empty h3 { font-family: var(--serif); font-size: 20px; }
.empty p { color: var(--muted); max-width: 46ch; }
.empty .btn { margin-top: 6px; }
.empty-inline { padding: 30px 20px; background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.empty-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px dashed var(--rule-strong);
  position: relative;
  margin-bottom: 2px;
}
.empty-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--rule-strong);
  transform: translate(-50%, -50%);
}
.empty-seal, .seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--rule-strong);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex: none;
  background: transparent;
}
.seal { width: 54px; height: 54px; border-color: var(--violet); color: var(--violet); }
.seal-inner, .big-seal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 50%;
  border: 1px dashed currentColor;
  line-height: 1;
}
.seal-top, .big-seal-top {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.seal b { font-family: var(--serif); font-size: 13px; }
.seal-bottom { font-family: var(--mono); font-size: 6px; letter-spacing: 0.08em; }

.registry-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 11px;
}
.registry-mark {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  flex: none;
}

/* ------------------------------------------------------------------ rail */

.rail { display: flex; flex-direction: column; gap: 18px; }

.facts { margin: 0; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 9px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-size: 13px; font-weight: 600; text-align: right; }

/* ----------------------------------------------------------------- forms */

.sheet-form { max-width: 780px; }
.form-section {
  border-top: 1px solid var(--rule);
  padding: 18px 0 22px;
}
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.section-head h2 { font-family: var(--serif); font-size: 17px; }
.section-note { color: var(--muted); font-size: 11px; margin: -4px 0 12px; max-width: 62ch; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
.form-grid + .form-grid { margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .check-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.req { color: var(--red); margin-left: 2px; }
.opt {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: #fdfaf3;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field input[readonly] {
  background: var(--paper-2);
  border-color: var(--rule);
  color: var(--ink-soft);
  cursor: default;
}
.field input[readonly]:focus { outline-color: var(--rule-strong); border-color: var(--rule-strong); }
.hint { color: var(--muted); font-size: 11px; }
.field-error { color: var(--red); font-size: 11px; font-weight: 600; }

.check-field {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.check-field input { width: 15px; height: 15px; accent-color: var(--violet); }
.check-field .hint { grid-column: 2; }

.submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

/* Add-record action. The trigger sits opposite the page title like the Tagihan
   buttons do, and its form drops in as a layer, so the action never costs a
   full row above the table it belongs to. */
.add-pop { position: relative; }
.add-pop > summary { list-style: none; cursor: pointer; }
.add-pop > summary::-webkit-details-marker { display: none; }
.add-pop[open] > summary { background: var(--violet-deep); border-color: var(--violet-deep); }
.add-pop-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(560px, calc(100vw - 32px));
  max-height: min(74vh, 640px);
  overflow-y: auto;
  text-align: left;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 54px -26px rgba(43, 18, 40, 0.55);
}
.add-pop-title {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.card-form { padding: 16px 14px 14px; }

/* ---------------------------------------------------------------- tables */

.listing { border-top: 1px solid var(--rule); padding-top: 16px; }
.listing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
}
.listing-head h2 { font-family: var(--serif); font-size: 18px; }
.listing-head h2.section-label { font-family: var(--sans); font-size: 11px; letter-spacing: 0.12em; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  font-size: 13.5px;
}
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .right { text-align: right; }
.table .right > form { display: inline; }
/* Row actions read as buttons, not loose text: solid surface, visible edge. */
.table .btn,
.cell-actions .btn {
  background: #fffdf8;
  border-color: var(--rule);
  color: var(--ink-soft);
}
.table .btn:hover,
.cell-actions .btn:hover {
  background: var(--violet-wash);
  border-color: var(--violet);
  color: var(--violet-deep);
}
.table .btn.danger,
.cell-actions .btn.danger { color: var(--red); }
.table .btn.danger:hover,
.cell-actions .btn.danger:hover {
  background: var(--red-wash);
  border-color: var(--red);
  color: var(--red);
}
.cell-title { display: block; font-weight: 600; }
.cell-sub, .cell-note { display: block; color: var(--muted); font-size: 11px; }
.cell-note { max-width: 28ch; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
/* The UA gives <form> a bottom margin, which made the flex line taller than
   the buttons and stretched the sibling <a> to an uneven height. */
.cell-actions form { display: flex; margin: 0; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag-icon {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  margin-right: 5px;
  color: var(--violet);
}
.is-muted { color: var(--muted); }
.money { display: block; }
.money-sub { display: block; color: var(--muted); font-size: 11px; }
/* Money and counts are always Source Serif 4 (Engraved Figure Rule); the
   mono face is reserved for document numbers and registry serials. */
.money, .money-sub, .money-cell, .totals dd, .line-amount { font-family: var(--serif); }
.totals dd, .line-amount { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- login */

.login-body { min-height: 100vh; display: flex; flex-direction: column; }
.login-top {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 24px 80px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.login-card .seal { margin-bottom: 2px; }
.login-card h1 {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.login-copy { color: var(--ink-soft); font-size: 13px; }
.login-card .banner { width: 100%; margin: 0; }
.login-card .btn-google { margin-top: 6px; }
.login-note { color: var(--muted); font-size: 11px; margin-top: 4px; }
.login-dev {
  width: 100%;
  border-top: 1px dashed var(--rule);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-dev .muted { font-size: 11px; }

/* -------------------------------------------------------------- documents */

.page-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 6px;
}
.page-head h1.mono { font-family: var(--mono); font-size: 24px; letter-spacing: 0; }
.head-actions, .toolbar-actions, .row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* A <form> wrapping a lone button carries a UA bottom margin and a text strut,
   which knocks the button out of line with its sibling <a>s. Scope to direct
   children so add-popover forms nested inside an action bar stay block-level. */
.head-actions > form,
.row-actions > form,
.toolbar-actions > form {
  display: flex;
  margin: 0;
}
.logo-controls > form { margin: 0; }
.btn-block { display: flex; width: 100%; text-align: center; margin-top: 10px; }
/* Panel body gives buttons and notes the same 16px gutter as the panel head
   instead of letting them bleed to the panel edge. */
.panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.panel-body form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.panel-body .btn-block { margin-top: 0; }
.panel-body .hint { padding: 0; }
.seal-panel .panel-body { padding-top: 0; }
.text-link { font-size: 12px; font-weight: 600; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.project-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border: 1px solid var(--rule);
  background: #fdfaf3;
  padding: 3px;
  align-self: center;
}

.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill.is-sealed { border-color: var(--violet); color: var(--violet); }
.status-pill.is-draft { border-color: var(--rule-strong); color: var(--muted); }
.status-pill.is-void { border-color: var(--red); color: var(--red); }

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}
.doc-sheet {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
}
.doc-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.doc-sheet-number {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.doc-sheet-meta {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.doc-sheet-meta > div, .verify-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.doc-lines td { vertical-align: top; }
.doc-lines td.num { font-family: var(--serif); font-size: 13.5px; }
.doc-totals {
  margin: 14px 0 0 auto;
  max-width: 320px;
  padding: 0;
}
.doc-notes { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 12px; }
.doc-notes p { margin-top: 4px; color: var(--ink-soft); }

.totals { margin-top: 0; margin-bottom: 0; padding: 0; }
.totals > div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0;
}
.totals dt { color: var(--muted); font-size: 12px; }
.totals dd { margin: 0; font-size: 12px; font-weight: 600; text-align: right; }
.totals .is-total {
  border-top: 1px solid var(--rule);
  margin-top: 4px;
  padding-top: 8px;
}
.totals .is-total dt { font-size: 13px; font-weight: 700; color: var(--ink); }
.totals .is-total dd { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.totals-preview {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.totals-preview .totals { min-width: 280px; }

.line-editor { border: 1px solid var(--rule); border-radius: var(--radius); background: #fdfaf3; overflow: hidden; }
.line-head, .line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 120px 110px 30px;
  gap: 8px;
  align-items: start;
  padding: 6px 10px;
}
.line-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-top: 8px;
  padding-bottom: 8px;
}
.line-row { border-bottom: 1px solid var(--rule); }
.line-row:last-child { border-bottom: 0; }
.line-row .field { gap: 0; }
.line-row input { min-height: 30px; padding: 5px 7px; font-size: 12px; }
.line-row .num { text-align: right; }
.line-amount {
  font-size: 12px;
  text-align: right;
  padding-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-remove {
  color: var(--muted);
  padding: 0;
  width: 26px;
  height: 26px;
  justify-content: center;
}
.line-remove:hover { color: var(--red); border-color: var(--red) !important; }

.line-tools {
  display: flex;
  align-items: flex-end;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.line-tools .field { flex: 0 1 300px; min-width: 0; }
.line-tools select { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.line-tools .hint {
  flex: 1 1 200px;
  margin-bottom: 6px;
  max-width: 44ch;
}
.line-tools-empty { margin-bottom: 10px; }
/* `Tambah Baris` is the one action in this section, so it sits clear of the
   table and carries violet ink instead of the neutral secondary style. */
.line-add {
  margin-top: 12px;
  padding: 0 13px;
  background: var(--violet-wash);
  border-color: var(--violet);
  color: var(--violet);
}
.line-add:hover {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}

.panel-note { padding: 12px 16px; color: var(--muted); font-size: 12px; }
.seal-panel .facts { padding-top: 0; }
.facts dd.hash, .hash {
  font-size: 10px;
  letter-spacing: -0.01em;
  word-break: break-all;
  text-align: left;
}
.facts dd.hash { max-width: 200px; }

.version-list { list-style: none; margin: 0; padding: 4px 14px 12px; }
.version-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 12px;
}
.version-list li:last-child { border-bottom: 0; }
.version-list li > div { display: flex; gap: 8px; align-items: baseline; }
.version-date { color: var(--muted); font-size: 11px; }
.version-links { display: flex; gap: 8px; align-items: baseline; }
.version-links .tag { margin-left: 0; }

.copy-panel { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.wa-copy {
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 8px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: #fdfaf3;
  color: var(--ink);
  resize: vertical;
}

.logo-section { max-width: 780px; }
.logo-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.logo-frame {
  width: 190px;
  min-height: 110px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: #fdfaf3;
  display: grid;
  place-items: center;
  padding: 12px;
}
.logo-preview { max-width: 100%; max-height: 86px; object-fit: contain; }
.logo-placeholder { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.logo-controls { display: flex; flex-direction: column; gap: 10px; flex: 1 1 260px; }
.logo-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.logo-form .field { flex: 1 1 180px; }
.logo-form input[type="file"] { font-size: 11px; padding: 5px; background: #fdfaf3; }
.upload-status { flex: 1 1 100%; }
.upload-status:empty { display: none; }
.logo-controls .btn { align-self: flex-start; }

/* ------------------------------------------------------------ verify page */

.verify-body { min-height: 100vh; display: flex; flex-direction: column; }
.verify-top {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--violet);
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.verify-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.verify-main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.banner-note { border-left-color: var(--violet); }
.verify-sheet {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  box-shadow: var(--shadow);
  padding: 26px 28px 22px;
}
.verify-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.verify-issuer { display: flex; gap: 16px; align-items: flex-start; }
.verify-logo { max-width: 120px; max-height: 54px; object-fit: contain; }
.verify-issuer h1 {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 2px 0 4px;
}
.verify-number { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.verify-number-value { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.verify-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.verify-sheet .doc-lines { margin-top: 8px; }
.verify-sheet .doc-lines th:first-child, .verify-sheet .doc-lines td:first-child { padding-left: 0; }
.verify-sheet .doc-totals { margin-top: 16px; }
.verify-evidence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.evidence-main, .evidence-side, .verify-payment {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  padding: 18px 20px;
}
.evidence-main h2, .verify-payment h2, .version-panel h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin-bottom: 8px;
}
.evidence-main .facts { padding: 0; }
.evidence-main .facts > div { flex-direction: column; gap: 2px; }
.evidence-main .facts dd { text-align: left; }
.evidence-main .facts dd.hash { max-width: none; }
.evidence-main .row-actions { margin-top: 16px; }
.evidence-side { display: flex; flex-direction: column; gap: 18px; }
.qr-frame { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.qr { width: 132px; height: 132px; border: 1px solid var(--rule); padding: 6px; background: #fff; }
.verify-url { font-size: 10px; color: var(--muted); word-break: break-all; }
.version-panel { border-top: 1px solid var(--rule); padding-top: 14px; }
.version-panel .version-list { padding: 0; }
.verify-payment p { max-width: 66ch; }
.verify-foot {
  max-width: 1080px;
  width: 100%;
  margin: auto auto 0;
  padding: 14px 24px 30px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}



/* ------------------------------------------------------------ responsive */

/* ------------------------------------------- money loop: payments + payout */

.status-pill.is-paid { border-color: var(--green); color: var(--green); }
.status-pill.is-partial { border-color: var(--mustard); color: var(--mustard); }
.status-pill.is-overdue { border-color: var(--red); color: var(--red); }
.status-pill.is-unpaid { border-color: var(--rule-strong); color: var(--muted); }
.is-late { color: var(--red); font-weight: 600; }

.payment-panel .facts dd.money { font-size: 15px; }
.payment-actions { display: flex; flex-direction: column; gap: 8px; }
.payment-actions > form { margin: 0; }
.pay-details { border-top: 1px dashed var(--rule); padding-top: 8px; }
.pay-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--violet);
}
.pay-details > summary::-webkit-details-marker { display: none; }
.pay-details[open] > summary { margin-bottom: 10px; }
.pay-form { display: grid; gap: 10px; }
.pay-form .btn { justify-self: start; }
.pay-form input[type="file"] { font-size: 11px; padding: 5px; background: #fdfaf3; }
.payment-list { list-style: none; margin: 0; padding: 0 16px 12px; }
.payment-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--rule);
}
.payment-list li:last-child { border-bottom: 0; }
.payment-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.payment-amount { font-size: 14px; font-weight: 600; }
.payment-meta { color: var(--muted); font-size: 11px; }
.payment-note { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.payment-side { display: flex; align-items: center; gap: 8px; flex: none; }
.payment-side form { margin: 0; display: flex; }
.panel-note.is-paid { color: var(--green); font-weight: 600; }

.payment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.payment-head h2 { margin: 0; }
.verify-payment .facts { padding: 0 0 12px; }
.verify-payment .facts dd { font-family: var(--serif); }
.pay-instructions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
.pay-block { flex: 1 1 220px; min-width: 0; }
.pay-block h3,
.pay-history h3 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.bank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bank-list li { display: flex; flex-direction: column; gap: 1px; }
.bank-name { font-size: 12px; font-weight: 700; }
.bank-number { font-size: 14px; }
.bank-holder { font-size: 11px; color: var(--muted); }
.qris-image { width: 168px; max-width: 100%; border: 1px solid var(--rule); background: #fff; padding: 6px; }
.pay-actions { flex-basis: 100%; margin-top: 4px; }
.pay-history { border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 12px; }
.pay-history .payment-list { padding: 0; }
.paid-note {
  color: var(--green);
  font-weight: 600;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  margin: 0;
}

.payment-section { max-width: 780px; }
.bank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.bank-slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.bank-slot legend {
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.payment-section .submit-row { margin-top: 14px; }

@media (max-width: 900px) {
  .bank-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .shell { display: block; min-height: 0; }
  .sidebar { display: none; }

  /* Phones and tablets get a bottom tab bar: every destination stays one
     thumb-reach away instead of living in a collapsed menu. */
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    justify-content: space-around;
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--paper-3);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -8px 22px -18px rgba(27, 26, 23, 0.55);
  }
  .tab {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 50px;
    padding: 5px 2px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
  }
  .tab:hover { text-decoration: none; color: var(--violet); }
  .tab[aria-current="page"] { color: var(--violet); background: var(--violet-wash); }
  .tab-icon { width: 21px; height: 21px; }
  .tab-label { line-height: 1.1; }
  .tab-count {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    min-width: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
  }

  .page { padding-bottom: 100px; }
  .page-foot { padding-bottom: 96px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .action-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 28px; }
  .home-head h1 { font-size: 28px; }

  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail .panel { flex: 1 1 300px; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-layout .rail { flex-direction: row; flex-wrap: wrap; }
  .doc-layout .rail .panel { flex: 1 1 280px; }
  .verify-evidence { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .header-inner { gap: 8px; padding: 0 12px; }
  .app-header .brand-text { display: none; }
  .brand-mark { width: 26px; height: 26px; }
  .biz-switch { flex: 1 1 auto; min-width: 0; }
  .biz-switch > summary { height: 42px; gap: 8px; padding: 0 8px 0 5px; max-width: none; }
  .biz-avatar { width: 28px; height: 28px; font-size: 13px; }
  .biz-label { display: none; }
  .biz-name { max-width: 30vw; font-size: 13.5px; }
  .biz-menu { min-width: 260px; }
  .header-actions { gap: 6px; }
  .lang-switch a { padding: 5px 7px; font-size: 11px; }
  .header-actions .btn-sm { padding: 0 7px; }

  .page { padding: 20px 16px 40px; }
  .page-foot { padding: 14px 16px 96px; flex-wrap: wrap; }
  /* When the title and its actions stop sharing a line, keep the actions on
     the right so the add-form layer still opens inside the viewport. */
  .page-head .head-actions { margin-left: auto; }
  .home-head { margin-bottom: 20px; }
  .home-head .btn { display: none; }
  .action-card { min-height: 84px; padding: 14px; gap: 12px; }
  .action-glyph { width: 40px; height: 40px; }
  .action-title { font-size: 15px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .stat-card { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .stat-label { flex: 1 1 auto; }
  .stat-money { font-size: 22px; }
  .stat-note { flex: 1 1 100%; }
  .queue-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .queue-cta { display: none; }
  .queue-amount { font-size: 12px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 24px; }
  .home-head h1 { font-size: 25px; }
  .rail { flex-direction: column; }
  .rail .panel { flex: none; width: 100%; }
  .doc-layout .rail { flex-direction: column; }
  .doc-sheet { padding: 16px 14px; }
  .doc-sheet-head { flex-direction: column; }
  .doc-sheet-meta { gap: 14px; }
  .line-head { display: none; }
  .line-row {
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 6px;
    padding: 10px;
  }
  /* The column header is gone on phones, so each cell names itself. */
  .line-row .field label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .line-row .field { grid-column: 1; }
  .line-row .field:nth-child(2), .line-row .field:nth-child(3) { grid-column: 1; }
  .line-row .line-amount { grid-column: 1; text-align: left; padding-top: 0; }
  .line-row .line-remove { grid-column: 2; grid-row: 1; }
  .verify-head { flex-direction: column; }
  .verify-number { text-align: left; align-items: flex-start; }
  .verify-sheet { padding: 18px 16px; }
  .verify-top { padding: 14px 16px; flex-wrap: wrap; }
  .verify-main { padding: 4px 16px 36px; }
  .verify-foot { padding: 14px 16px 28px; flex-wrap: wrap; }

  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; width: auto; }
  .table thead { display: none; }
  .table tr {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--paper-3);
    margin-bottom: 10px;
  }
  .table td {
    display: grid;
    grid-template-columns: minmax(84px, 32%) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--rule);
    text-align: left;
  }
  .table tr td:last-child { border-bottom: 0; }
  .table td:first-child { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .table .num, .table .right { text-align: left; }
  .table .money, .table .money-sub { display: inline; }
  .table .money-sub { margin-left: 6px; }
  .table .btn { justify-self: start; }
  .cell-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
