:root {
  color-scheme:light;
  font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
  color:#26343d;
  background:#f3f6fa;
  font-synthesis:none;
  text-rendering:optimizeLegibility;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  min-width:320px;
  font-size:14px;
  line-height:1.6;
}
a {
  color:#2868b2;
  text-decoration:none;
}
a:hover {
  color:#1d62be;
  text-decoration:underline;
  text-underline-offset:3px;
}
h1,h2,p {
  margin-top:0;
}
h1 {
  font-size:26px;
  line-height:1.35;
  margin-bottom:10px;
  color:#14272f;
  overflow-wrap:anywhere;
}
h2 {
  font-size:16px;
  margin-bottom:13px;
}
p {
  margin-bottom:12px;
}
small,.secondary {
  font-size:13px;
}
.muted,.secondary,.field-help {
  color:#687782;
}
.secondary {
  display:block;
  margin-top:4px;
  overflow-wrap:anywhere;
}
.identity,td,dd {
  font-variant-numeric:tabular-nums;
}
.site-header {
  padding:0;
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}
.site-header-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  max-width:1320px;
  padding:0 20px;
  min-height:72px;
  margin:0 auto;
}
.brand {
  color:#14272f;
  font-size:19px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
.account {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
  font-size:13px;
}
.account-identity {
  color:#687782;
  padding:0 8px;
}
.account form {
  margin:0;
}
.account .button {
  min-height:44px;
  padding:9px 13px;
  font-size:13px;
}
.console-frame,.page-shell {
  max-width:1320px;
  padding-left:20px;
  padding-right:20px;
  margin-left:auto;
  margin-right:auto;
}
.console-nav {
  display:flex;
  gap:2px;
  flex-wrap:wrap;
  margin:15px auto 0;
  padding:0;
  border-bottom:1px solid #dfe5ed;
}
.console-nav a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 13px;
  background:transparent;
  border:0;
  border-bottom:2px solid transparent;
  border-radius:0;
  text-decoration:none;
  font-size:14px;
  font-weight:500;
  color:#536474;
}
.console-nav a:hover {
  color:#1d62be;
  background:#f5f8fc;
}
.console-nav a:hover,.button:hover,.brand:hover {
  text-decoration:none;
}
.console-nav a[aria-current="page"] {
  color:#1d62be;
  background:transparent;
  border-bottom-color:#2675de;
  font-weight:600;
}
.console-context {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
  padding:9px 0;
  border-bottom:1px solid #e5eaf0;
  line-height:1.45;
}
.console-context-main {
  display:grid;
  gap:2px;
  min-width:0;
}
.console-context-customer-line {
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:4px 10px;
  min-width:0;
}
.console-context-label {
  color:#687782;
  font-size:12px;
  font-weight:500;
  white-space:nowrap;
}
.console-context-customer {
  color:#26343d;
  font-size:14px;
  font-weight:600;
  text-decoration:none;
  overflow-wrap:anywhere;
}
.console-context-customer:hover {
  color:#1d62be;
  text-decoration:underline;
  text-underline-offset:3px;
}
.console-context-customer:focus-visible,.console-context-switch:focus-visible {
  outline:3px solid #8ab5f0;
  outline-offset:3px;
}
.console-context-bot {
  min-width:0;
  color:#687782;
  font-size:13px;
  overflow-wrap:anywhere;
}
.console-context-switch {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:8px 12px;
  border:1px solid #dce5f0;
  border-radius:6px;
  color:#2868b2;
  font-size:13px;
  white-space:nowrap;
  text-decoration:none;
}
.console-context-switch:hover {
  background:#f1f6fc;
  color:#1d62be;
  text-decoration:none;
}
.page-shell {
  padding-top:22px;
  padding-bottom:40px;
}
.panel {
  min-width:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:20px;
  margin-bottom:16px;
  box-shadow:none;
}
.page-heading,.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.page-heading {
  margin-bottom:18px;
}
.page-heading p {
  margin-bottom:0;
}
.section-heading {
  margin-bottom:14px;
  flex-wrap:wrap;
}
.section-heading h2 {
  margin-bottom:0;
}
.section-heading .muted {
  font-size:13px;
}
.breadcrumbs {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 18px;
  font-size:13px;
  color:#687782;
}
.breadcrumbs a {
  text-decoration:none;
}
.finance-back {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  margin:-8px 0 10px;
  color:#536474;
  font-size:13px;
}
.finance-page>a[href*="/finance?"] {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  margin:-8px 0 10px;
  color:#536474;
  font-size:13px;
}
.finance-heading {
  margin-bottom:8px;
}
.finance-group-meta {
  margin-bottom:16px;
  color:#687782;
  font-size:13px;
}
.finance-filter {
  display:block;
  margin-top:16px;
}
.finance-filter-fields {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:start;
  gap:12px 16px;
}
.finance-filter-fields>div {
  display:grid;
  align-content:start;
  gap:6px;
  min-width:0;
}
.finance-filter-fields label {
  min-height:21px;
}
.finance-filter-fields .field-help {
  font-size:12px;
  line-height:1.4;
}
.finance-filter-actions {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #edf0f3;
}
.finance-filter-actions .button {
  min-height:44px;
}
.filter-action-divider {
  align-self:stretch;
  width:1px;
  margin:3px 4px;
  background:#dfe5eb;
}
.finance-filter-actions .button-quiet {
  border-color:transparent;
  background:transparent;
}
.finance-filter-actions .button-quiet:hover {
  border-color:#e5e7eb;
  background:#eff6ff;
}
.finance-export {
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:10px 18px;
  margin-bottom:14px;
}
.finance-export .browse-info {
  flex:1 1 280px;
  min-width:0;
}
.finance-export .browse-info summary {
  min-height:44px;
  padding:10px 0;
}
.finance-export .browse-info p:last-child {
  margin-bottom:0;
}
.ledger-empty-state {
  margin:14px 0 16px;
  padding:22px 14px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  color:#687782;
  text-align:center;
  background:#fff;
}
.filter-form {
  display:flex;
  align-items:end;
  flex-wrap:wrap;
  gap:12px;
}
.filter-form>div {
  flex:1 1 180px;
  min-width:0;
  max-width:310px;
  display:grid;
  gap:6px;
}
.filter-form.finance-filter>.finance-filter-fields {
  display:grid;
  width:100%;
  max-width:none;
  flex:none;
}
.filter-form.finance-filter>.finance-filter-actions {
  display:flex;
  width:100%;
  max-width:none;
  flex:none;
}
.finance-filter-fields label {
  display:flex;
  align-items:flex-end;
  min-height:42px;
}
label {
  font-size:13px;
  font-weight:600;
}
input,select,button,.button {
  font-family:inherit;
  font-size:14px;
}
input,select {
  width:100%;
  min-width:0;
  min-height:44px;
  border:1px solid #dce2e9;
  border-radius:11px;
  padding:12px;
  color:#303b43;
  background:#fff;
}
input::placeholder {
  color:#84909b;
}
input:disabled,select:disabled {
  color:#687782;
  background:#f1f5fa;
}
input:focus-visible,select:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible {
  outline:3px solid #8ab5f0;
  outline-offset:3px;
}
.button {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border:1px solid #e0e8f4;
  border-radius:8px;
  cursor:pointer;
  background:#fff;
  color:#2868b2;
  text-decoration:none;
  line-height:1.25;
  transition:background-color .15s,border-color .15s;
}
.button-primary {
  background:#2675de;
  border-color:#2675de;
  color:#fff;
  box-shadow:none;
}
.button-primary:hover {
  background:#1d62be;
  border-color:#1d62be;
  color:#fff;
}
.button-secondary:hover,.button-quiet:hover {
  background:#eff6ff;
}
.button-quiet {
  color:#5d6e7b;
  border-color:#e5e7eb;
}
.button:active {
  transform:translateY(1px);
}
.inline-form,.row-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.directory-panel {
  padding:20px 20px 0;
}
.group-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(150px,.5fr) auto;
  align-items:center;
  gap:24px;
  padding:21px 0;
  border-top:1px solid #e6e8ec;
}
.group-identity {
  min-width:0;
}
.group-name {
  display:block;
  font-size:16px;
  font-weight:600;
  text-decoration:none;
  overflow-wrap:anywhere;
}
.group-state .secondary {
  margin-top:8px;
}
.badge {
  display:inline-block;
  border-radius:6px;
  padding:3px 9px;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.badge-success {
  background:#eaf7f1;
  color:#216d51;
}
.badge-warning {
  background:#fff5e3;
  color:#885e15;
}
.badge-error {
  background:#fff0ee;
  color:#983c35;
}
.badge-muted {
  background:#f0f2f5;
  color:#616d78;
}
.group-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}
.group-heading p:last-child {
  margin-bottom:0;
}
.finance-groups {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  list-style:none;
  padding:0;
  margin:14px 0 0;
}
.finance-groups .panel {
  margin:0;
}
.finance-groups .inline-form {
  margin-top:20px;
}
.customer-directory {
  list-style:none;
  padding:0 20px;
  margin:16px 0 0;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
}
.customer-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(130px,180px) auto;
  align-items:center;
  gap:16px;
  min-width:0;
  padding:15px 0;
  border-bottom:1px solid #e6e8ec;
}
.customer-row:last-child {
  border-bottom:0;
}
.customer-identity {
  min-width:0;
}
.customer-identity>a {
  font-size:15px;
  font-weight:600;
  overflow-wrap:anywhere;
}
.customer-state {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.customer-error {
  grid-column:1 / -1;
  margin:0;
}
.customer-manage {
  min-width:112px;
}
.customer-create-panel {
  margin-top:24px;
}
.customer-create-form {
  max-width:820px;
  margin-top:16px;
}
.customer-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.customer-fields>div {
  display:grid;
  gap:6px;
  min-width:0;
}
.customer-create-form>.button {
  margin-top:16px;
}
.result-count {
  font-size:13px;
}
.bill-summary {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  gap:12px;
  margin:18px 0;
}
.bill-summary>div {
  border:1px solid #e2e9f5;
  border-radius:13px;
  padding:16px;
  background:linear-gradient(#edf2ff,#fff);
  min-width:0;
}
.bill-summary dt {
  font-size:13px;
  color:#5d6e7b;
}
.bill-summary dd {
  margin:8px 0 0;
  font-size:22px;
  font-weight:600;
  overflow-wrap:anywhere;
}
.table-scroll {
  width:100%;
  overflow-x:auto;
  border:1px solid #e5e7eb;
  border-radius:13px;
  background:#fff;
  margin-bottom:16px;
}
table {
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
th,td {
  padding:14px 12px;
  text-align:left;
  border-bottom:1px solid #e6e8ec;
  vertical-align:top;
  overflow-wrap:anywhere;
  min-width:100px;
}
th {
  background:#f7f8fa;
  color:#495760;
  font-size:13px;
  font-weight:600;
  white-space:nowrap;
}
tbody tr:last-child td {
  border-bottom:0;
}
tbody tr:hover {
  background:#fbfcff;
}
.pagination {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:12px;
  margin:20px 0;
}
.notice,[role="alert"] {
  padding:13px 16px;
  border:1px solid #dbe6f5;
  border-radius:11px;
  color:#2868b2;
  background:#eff6ff;
}
[role="alert"],.notice-error {
  color:#9b3832;
  background:#fff3f1;
  border-color:#f3d5d1;
}
.empty-state {
  padding:28px 12px;
  text-align:center;
  color:#687782;
}
.empty-state p {
  margin:8px 0 18px;
}
.stack-form {
  display:grid;
  max-width:760px;
  gap:10px;
}
.stack-form>.button {
  justify-self:start;
}
.settings-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:start;
  gap:16px;
}
.settings-grid>.panel {
  margin:0;
}
.message-panel {
  max-width:460px;
  margin:48px auto;
  padding:28px;
}
.message-panel h1 {
  font-size:24px;
}
.message-panel>p {
  color:#687782;
  font-size:14px;
}
.message-panel .stack-form {
  max-width:none;
  margin-top:24px;
  gap:12px;
}
.message-panel .stack-form label:not(:first-child) {
  margin-top:6px;
}
.message-panel .stack-form .button {
  margin-top:10px;
  justify-self:stretch;
}
.message-panel .back-link {
  display:inline-block;
  margin-top:20px;
  font-size:14px;
}
details summary {
  cursor:pointer;
  font-weight:600;
  padding:4px 0;
}
details[open] summary {
  margin-bottom:14px;
}
.ledger-panel {
  margin-top:18px;
}
.ledger-card {
  border-radius:13px;
}
.ledger-panel>.muted {
  font-size:13px;
}
.numeric {
  white-space:nowrap;
}
.note-cell {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
@media(max-width:760px) {
  .site-header {
    padding:0 16px;
  }
  .site-header-inner {
    min-height:0;
    padding:14px 0;
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }
  .brand {
    font-size:17px;
  }
  .account {
    width:100%;
    justify-content:flex-start;
    gap:8px;
  }
  .account-identity {
    margin-right:auto;
    padding-left:0;
  }
  .console-frame,.page-shell {
    padding-left:16px;
    padding-right:16px;
  }
  .console-nav {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    margin-top:10px;
    gap:0;
  }
  .console-nav a {
    justify-content:center;
    padding:7px 10px;
    font-size:13px;
    white-space:nowrap;
  }
  .console-context {
    gap:8px;
    padding:8px 0;
  }
  .console-context-main {
    flex:1 1 0;
  }
  .page-shell {
    padding-top:18px;
  }
  .panel {
    padding:16px;
    border-radius:12px;
  }
  .group-row {
    grid-template-columns:minmax(0,1fr);
    gap:12px;
    padding:18px 0;
  }
  .group-state {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
  }
  .group-state .secondary {
    margin:0;
  }
  .group-row .row-actions .button {
    flex:1;
  }
  .group-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:14px;
  }
  .finance-groups {
    grid-template-columns:minmax(0,1fr);
  }
  .customer-row {
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px 12px;
    padding:14px 0;
  }
  .customer-directory {
    padding:0 14px;
  }
  .customer-state {
    justify-self:end;
  }
  .customer-manage {
    grid-column:1 / -1;
    justify-self:start;
  }
  .customer-error {
    grid-column:1 / -1;
  }
  .customer-fields {
    grid-template-columns:minmax(0,1fr);
  }
  .settings-grid {
    grid-template-columns:minmax(0,1fr);
  }
  .filter-form>div {
    flex:1 1 100%;
    max-width:none;
  }
  .finance-filter-fields {
    grid-template-columns:minmax(0,1fr);
    gap:12px;
  }
  .finance-filter-fields label {
    display:block;
    min-height:0;
  }
  .finance-filter-actions {
    gap:8px;
  }
  .filter-form>.button {
    flex:1 1 auto;
  }
  .finance-filter-actions .button {
    flex:1 1 calc(50% - 8px);
  }
  .finance-filter-actions .button-primary {
    flex-basis:100%;
  }
  .finance-page>a[href*="/finance?"] {
    margin-top:-4px;
  }
  .filter-action-divider {
    display:none;
  }
  .finance-export {
    flex-direction:column;
    gap:4px;
  }
  .finance-export .browse-info {
    flex-basis:auto;
    width:100%;
  }
  .bill-summary {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .bill-summary dd {
    font-size:19px;
  }
  .message-panel {
    margin:24px auto;
    padding:22px;
  }
  h1 {
    font-size:24px;
  }
}
@media(max-width:360px) {
  .console-nav a {
    padding-left:4px;
    padding-right:4px;
    font-size:12px;
  }
  .bill-summary {
    grid-template-columns:minmax(0,1fr);
  }
}
@media(min-width:761px) and (max-width:900px) {
  .settings-grid {
    grid-template-columns:minmax(0,1fr);
  }
}
@media(prefers-reduced-motion:reduce) {
  .button {
    transition:none;
  }
}

/* Single-group handoff shows identities, not monetary KPI typography. */
.transfer-summary dd{font-size:16px;line-height:1.6;font-weight:600}
.transfer-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){.transfer-summary{grid-template-columns:minmax(0,1fr)}}
