/* Receipt workspace: shared tokens, desktop shell and responsive components. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Inter, sans-serif;
  font-size: 16px;
  color: #233b35;
  background: #f3f6f4;
  font-synthesis: none;
  --ink: #233b35;
  --muted: #6a7e75;
  --green: #16745c;
  --green-dark: #105c49;
  --line: #dfe8e2;
  --surface: #fff;
  --radius: 14px;
  --sidebar: 224px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; }
body, button, input, select, textarea { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid #d6e1da;
  border-radius: 9px;
  background: #fff;
  color: #345348;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button:hover { background: #f0f6f2; border-color: #a9c8b8; }
button.primary { color: #fff; background: var(--green); border-color: var(--green); }
button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #5bad8b;
  outline-offset: 3px;
}
input, select, textarea {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #d4e0d8;
  border-radius: 9px;
  color: #2d473c;
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #86988d; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #5aab87; }
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
  vertical-align: middle;
}
input[type="date"], input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
textarea { min-height: 100px; resize: vertical; }
a { color: var(--green); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.25; letter-spacing: -.6px; color: #1c3b2d; }
h2 { color: #244b38; }
p { margin: 7px 0; color: var(--muted); line-height: 1.7; }
small { line-height: 1.6; }
#app, #content, main, section, .panel, .tablewrap { min-width: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Desktop shell. Navigation remains scrollable on a short screen. */
aside, .app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 31px 18px 20px;
  background: #15372c;
  color: #b9d0c3;
}
.brand { padding: 0 14px; margin-bottom: 7px; color: #fff; font-size: 26px; font-weight: 750; letter-spacing: .4px; }
.brand span { color: #8dd5ad; }
.subbrand { padding: 0 14px; margin-bottom: 33px; color: #8bab98; font-size: 10px; letter-spacing: 1.8px; }
.app-sidebar nav, aside nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
nav button {
  width: 100%;
  min-height: 46px;
  margin: 0 0 5px;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #bfd1c5;
  text-align: left;
  font-size: 14px;
}
nav button:hover { color: #fff; background: #204b3b; border-color: transparent; }
nav button.active { color: #fff; background: #2b5741; border-color: #3a6950; font-weight: 650; box-shadow: inset 3px 0 #91cfa5; }
.sidefoot { margin-top: auto; flex: 0 0 auto; padding: 24px 14px 3px; color: #95b49f; font-size: 12px; }
.sidefoot p { margin: 6px 0 0; color: #98cfac; font-size: 11px; }
main, .app-main {
  width: calc(100% - var(--sidebar));
  max-width: 1920px;
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 0 clamp(20px, 2vw, 32px) 32px;
}
.workspace-header, main > header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: #7b8e80;
  font-size: 12px;
}
.workspace-header strong, main > header strong { color: #385441; font-weight: 600; }
.mobile-topbar, .nav-backdrop { display: none; }
.selectall-label { display: none; }
.heading, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 30px 0 24px; }
.heading > div:first-child { min-width: 0; }
.heading p { max-width: 800px; margin-bottom: 0; font-size: 13px; }
.eyebrow { margin-bottom: 10px; color: #55845e; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.actions, .page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions { flex-shrink: 0; }

/* Overview numbers and shared panels. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  min-width: 0;
  padding: 21px 22px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #617b69;
  font-size: 13px;
  box-shadow: 0 3px 12px #24472e04;
}
.stat:first-child { border-top: 3px solid #458655; padding-top: 19px; }
.stat b { display: block; margin: 13px 0 7px; color: #25472e; font-size: clamp(22px, 2vw, 30px); font-weight: 700; line-height: 1.35; letter-spacing: -.7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat b small { display: inline; margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.stat > small { color: #84938a; font-size: 11px; }
.stat p { margin-top: 10px; font-size: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: 0 3px 14px #28463303; }
.tabs { display: flex; gap: 26px; padding: 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; overscroll-behavior-x: contain; }
.tabs button { flex: 0 0 auto; min-height: 54px; padding: 16px 0 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #7d8d82; font-size: 13px; }
.tabs button:hover { color: var(--green); }
.tabs .active { color: var(--green); border-bottom-color: var(--green); font-weight: 650; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; padding: 20px 22px; }
.filters > * { min-width: 0; max-width: 100%; }
.filters input[type="search"] { flex: 1 1 290px; min-width: 200px; }
.filters select { max-width: 300px; }
.filters label { color: #687e6d; font-size: 12px; }
.filters > span { color: #7d8b80; font-size: 12px; }
.filters + .filters { padding-top: 0; }
.tablewrap { width: 100%; overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #bdcdc2 #f1f5f2; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 14px 17px; border-block: 1px solid #e9efe9; background: #f6f9f5; color: #7a8e7c; font-size: 11px; font-weight: 550; line-height: 1.6; }
td { padding: 18px 17px; border-bottom: 1px solid #edf1eb; color: #38513e; font-size: 12px; line-height: 1.65; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcf9; }
td small { display: block; margin-top: 5px; color: #8a9b8c; font-size: 11px; }
td b { color: #294a34; font-weight: 650; }
td .actions { flex-wrap: nowrap; gap: 5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.15px; }
.wrap-cell { min-width: 150px; max-width: 350px; white-space: normal; overflow-wrap: anywhere; }
.badge { display: inline-block; max-width: 100%; padding: 4px 8px; border-radius: 6px; background: #eaf4e9; color: #4a8053; font-size: 11px; font-weight: 550; line-height: 1.5; vertical-align: middle; white-space: normal; }
.badge.wait { background: #fcf4df; color: #a37c2b; }
.badge.muted { background: #eff3f0; color: #87978b; }
.badge.red { background: #fbecec; color: #ac5c63; }
.link { min-height: 32px; padding: 5px 6px; border: 0; background: transparent; color: #3e8059; font-size: 12px; font-weight: 550; }
.link:hover { background: #edf5eb; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--line); color: #859489; font-size: 11px; }
.footer .actions { flex-wrap: wrap; }
.notice { margin-top: 22px; padding: 14px 18px; border: 1px solid #dce8dd; border-radius: 10px; background: #eaf2e9; color: #729077; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.empty { padding: 58px 20px; color: #8c9b8d; text-align: center; line-height: 1.8; }
.helptext { color: #758b7a; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.unrecorded-help { padding: 0 22px; }

/* Authentication, forms and detail dialogs. */
.login { width: min(420px, calc(100% - 32px)); margin: 12vh auto; padding: 38px 34px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 50px #204f3110; }
.login h1 { font-size: 24px; }
.login input { width: 100%; margin: 21px 0 14px; }
.login button { width: 100%; }
.login #hint { margin-top: 16px; font-size: 12px; }
dialog { width: 540px; max-width: calc(100vw - 40px); max-height: min(90vh, 900px); max-height: min(90dvh, 900px); padding: 28px; overflow: auto; overscroll-behavior: contain; border: 1px solid #d3e1d6; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 22px 80px #0f302b33; }
dialog::backdrop { background: #102c2366; backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 18px; font-size: 21px; line-height: 1.4; }
dialog > p { margin: 10px 0 18px; font-size: 13px; }
dialog form { margin-top: 20px; }
.formgrid { display: grid; min-width: 0; gap: 17px; }
.formgrid label { display: grid; min-width: 0; gap: 7px; color: #647f6b; font-size: 12px; }
.formgrid label > input, .formgrid label > select, .formgrid label > textarea { width: 100%; }
.formgrid .check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.8; }
.formgrid .check input { width: 18px; margin-top: 3px; }
.dialogactions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 25px; padding-top: 18px; border-top: 1px solid #e9efea; }
.detail { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 13px 16px; margin: 22px 0; font-size: 13px; line-height: 1.7; }
.detail dt { color: #7d9384; }
.detail dd { min-width: 0; margin: 0; color: #3a5945; overflow-wrap: anywhere; }
pre { max-width: 100%; margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: #5a7464; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; line-height: 1.7; }
#toast { position: fixed; z-index: 100; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; display: none; max-width: calc(100vw - 32px); padding: 13px 22px; transform: translateX(-50%); border-radius: 10px; background: #183e2c; box-shadow: 0 8px 26px #122b2926; color: #fff; text-align: center; font-size: 13px; overflow-wrap: anywhere; }
.danger { color: #ae4e57; }
.danger-button { color: #fff; background: #a94751; border-color: #a94751; }
.danger-button:hover { background: #963d48; border-color: #963d48; }
.void-warning { margin-bottom: 20px; padding: 16px; border: 1px solid #efd8db; border-radius: 10px; background: #fff7f7; }
.void-warning b { overflow-wrap: anywhere; }
.void-warning p { font-size: 12px; }
.void-stats { margin-top: 20px; }
.void-stats .stat:first-child { border-top-color: #b95f69; }
#voiderror, #restoreerror, #assignerror, #settingerror, #tgerror, #simformerror,
#enrollmenterror, #restoreclaimserror, #customergrouperror, #collectorLoginError { color: #ad4652; overflow-wrap: anywhere; }

/* Owner / principal / assistant relationship cards. */
.owner-groups { display: grid; gap: 22px; margin-top: 18px; }
.owner-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.owner-heading h2 { margin: 0 0 6px; font-size: 20px; }
.owner-heading p { font-size: 12px; }
.owner-relations { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 42px; padding: 25px; }
.principal-branch { position: relative; min-width: 0; align-self: start; }
.principal-branch::after { position: absolute; top: 45px; left: 100%; width: 22px; border-top: 2px solid #b4cbb7; content: ""; }
.assistant-branch { position: relative; min-width: 0; padding-left: 22px; border-left: 2px solid #b4cbb7; }
.assistant-branch::before { position: absolute; top: 45px; left: -22px; width: 22px; border-top: 2px solid #b4cbb7; content: ""; }
.relationship-label { margin: 0 0 12px; color: #75917b; font-size: 12px; }
.relation-account { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 9px; padding: 19px; border: 1px solid #dce9db; border-radius: 11px; background: #f8fbf6; }
.relation-account + .relation-account { margin-top: 12px; }
.relation-account.inactive { border-color: #e3e8e2; background: #f7f9f6; color: #87948a; }
.relation-account strong, .relation-account .mono { max-width: 100%; overflow-wrap: anywhere; }
.relation-account small { color: #819684; font-size: 11px; }
.relation-account .actions { margin-top: 4px; flex-wrap: wrap; }
.empty-account { border-style: dashed; background: #fafcf8; }
.empty-assistants { padding: 20px 0; }
.owner-settings { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-top: 1px solid var(--line); background: #f7faf5; }
.owner-settings p { font-size: 12px; }
.owner-settings .actions { justify-content: flex-end; }
.owner-meta { padding: 13px 22px; border-top: 1px solid #edf1eb; color: #849187; font-size: 12px; overflow-wrap: anywhere; }
.archived-accounts { padding: 0 25px 22px; }
.archived-accounts summary { margin-bottom: 12px; color: #788b7c; cursor: pointer; }
.tg-groups { display: grid; gap: 20px; margin-top: 18px; }
.tg-group-heading { align-items: center; justify-content: space-between; }
.tg-group-heading h2 { margin: 0 0 6px; font-size: 18px; }

/* Customer groups, enrollment and 17:00 business-day bookkeeping. */
.enrollment-panel { margin: 18px 0 22px; }
.enrollment-panel > h2, .customer-admin-panel > h2, .customer-group-panel > h2 { margin: 21px 22px 8px; font-size: 18px; }
.enrollment-panel > .helptext, .customer-admin-panel > .helptext, .customer-group-panel > .helptext { margin: 12px 22px 19px; }
.enrollment-panel td:last-child { max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.claim-recovery { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 22px; }
.claim-recovery h2 { margin: 0 0 8px; font-size: 17px; }
.claim-recovery p { font-size: 12px; }
.claim-recovery button { flex-shrink: 0; }
.customer-admin-panel, .customer-group-panel { margin: 20px 0; }
.super-admins { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 22px; }
.super-admins .badge { padding: 10px 12px; font-size: 12px; }
.customer-group-panel td:last-child { min-width: 160px; max-width: 320px; white-space: normal; }
.group-book-entry, .group-book-period, .group-book-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px; }
.group-book-entry h2, .group-book-period h2, .group-book-detail-heading h2 { margin: 4px 0 6px; font-size: 18px; }
.group-book-filters .filters { align-items: flex-end; }
.group-book-filters label { display: grid; gap: 7px; color: #718b77; font-size: 12px; }
.group-book-filters > .helptext { margin: 0 22px 19px; }
.group-book-period { margin: 20px 0; background: #fbfcf8; }
.group-book-period p { font-size: 12px; }
.group-book-stats { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.group-book-details { margin-top: 22px; }
.group-book-detail-heading { border-bottom: 1px solid var(--line); }
#gbresult .tablewrap td small { margin-top: 7px; }

/* Summary, collector, simulator and audit history. */
#sfresh { margin: 18px 0; font-size: 12px; }
#srange { color: #7b9080; font-size: 12px; }
#sdates label { display: grid; gap: 7px; color: #718578; font-size: 12px; }
#sdates input { margin-left: 0; }
#collectorReview { margin-top: 18px; max-width: 100%; }
#content > .panel > .filters > div { min-width: 0; max-width: 100%; }
#content > .panel > .filters > div > h2 { margin-top: 0; font-size: 19px; }
#content > .panel > .filters > div > p { font-size: 13px; }
.sim-controls, .sim-fixtures { margin-top: 18px; }
.sim-controls .filters { margin: 0; }
.sim-controls select { max-width: 100%; }
#simbody h2 { margin: 0; font-size: 18px; }
.sim-fixtures p { max-width: 850px; }
.cleanup-details details { margin: 10px 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.cleanup-details summary { cursor: pointer; font-weight: 600; }
.cleanup-record { padding: 14px 5px; border-bottom: 1px solid #e5ece4; overflow-wrap: anywhere; }
.cleanup-record:last-child { border-bottom: 0; }
.cleanup-record dl { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; margin: 10px 0; }
.cleanup-record dt { color: #809383; }
.cleanup-record dd { margin: 0; }
.cleanup-record ul, .cleanup-details li { color: #a37a40; line-height: 1.8; padding-left: 18px; }
.cleanup-focused { outline: 2px solid var(--green); border-radius: 7px; background: #f0f8ee; }
.cleanup-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }

@media (min-width: 1800px) {
  main, .app-main { margin-right: auto; }
}

@media (min-width: 768px) {
  .stats[data-long-amounts="true"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats[data-long-amounts="true"] .stat b { font-size: clamp(20px, 2vw, 28px); letter-spacing: -.4px; overflow-wrap: normal; word-break: normal; }
  table[data-responsive="cards"] th { white-space: normal; }
  table[data-responsive="cards"] td { max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
  table[data-responsive="cards"] td[data-label*="订单"],
  table[data-responsive="cards"] td[data-label*="交易号"] { min-width: 180px; max-width: 260px; }
  table[data-responsive="cards"] td[data-label*="负责人"],
  table[data-responsive="cards"] td[data-label*="客户"] { max-width: 220px; }
  table[data-responsive="cards"] td[data-cell="select"],
  table[data-responsive="cards"] td[data-cell="actions"] { white-space: nowrap; overflow-wrap: normal; }
  table[data-responsive="cards"] td[data-cell="actions"] { min-width: 150px; }
  /* The nine-column receipt list has deliberate column widths, so a long
     upstream identifier cannot dictate the width of the complete table. */
  table[data-responsive="cards"]:has(th[data-cell="select"]) { table-layout: fixed; min-width: 1324px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(1) { width: 44px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(2) { width: 220px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(3) { width: 220px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(4) { width: 170px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(5) { width: 150px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(6) { width: 100px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(7) { width: 160px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(8) { width: 100px; }
  table[data-responsive="cards"]:has(th[data-cell="select"]) th:nth-child(9) { width: 160px; }
}

@media (min-width: 1024px) and (max-width: 1099px) {
  :root { --sidebar: 200px; }
  aside, .app-sidebar { padding-inline: 14px; }
  main, .app-main { padding-inline: 22px; }
  .heading { align-items: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet drawer. The same layout also provides a compact shell for phones. */
@media (max-width: 1023px) {
  .mobile-topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: calc(65px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 22px 10px;
    border-bottom: 1px solid #dde7df;
    background: #fbfdfb;
    box-shadow: 0 2px 8px #25412e04;
  }
  .mobile-brand { flex: 0 0 auto; color: #204b33; font-size: 19px; font-weight: 750; text-decoration: none; }
  .mobile-brand span { color: #63956b; }
  .mobile-page-title { min-width: 0; margin-left: auto; overflow: hidden; color: #77907d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-toggle, #navtoggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 56px; min-height: 44px; padding: 9px 12px; font-size: 13px; }
  aside, .app-sidebar {
    z-index: 35;
    inset: calc(65px + env(safe-area-inset-top)) auto 0 0;
    width: min(280px, calc(100vw - 48px));
    padding: 24px 18px max(20px, env(safe-area-inset-bottom));
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .2s ease, visibility .2s ease;
    box-shadow: 12px 0 34px #13302520;
  }
  .app-sidebar .brand { font-size: 23px; }
  .subbrand { margin-bottom: 23px; }
  .sidefoot { padding-top: 20px; }
  #app[data-nav-open="true"] .app-sidebar { transform: translateX(0); visibility: visible; }
  .nav-backdrop {
    position: fixed;
    z-index: 32;
    inset: calc(65px + env(safe-area-inset-top)) 0 0;
    width: 100%;
    height: calc(100dvh - 65px - env(safe-area-inset-top));
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #12332666;
  }
  #app[data-nav-open="true"] .nav-backdrop { display: block; }
  .nav-backdrop:hover { background: #12332666; }
  main, .app-main { width: 100%; max-width: none; min-height: calc(100vh - 65px); margin-left: 0; padding: 0 22px 32px; }
  .workspace-header, main > header { min-height: 54px; }
  .heading { margin: 25px 0 21px; align-items: flex-start; }
  h1 { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-heading, .owner-settings { align-items: flex-start; flex-wrap: wrap; }
  .owner-settings .actions { justify-content: flex-start; }
}

/* Mobile: financial rows become labeled cards rather than a miniature table. */
@media (max-width: 767px) {
  :root { font-size: 14px; --radius: 12px; }
  button { min-height: 44px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 20px; }
  .mobile-topbar { gap: 10px; padding-inline: 15px; }
  .mobile-brand { font-size: 18px; }
  .mobile-page-title { max-width: 42%; font-size: 11px; }
  main, .app-main { padding: 0 14px calc(25px + env(safe-area-inset-bottom)); }
  .workspace-header, main > header { min-height: 48px; gap: 10px; font-size: 11px; }
  .workspace-header > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-header > span:last-child { flex-shrink: 0; }
  .workspace-header .link { padding-inline: 2px; font-size: 11px; }
  .heading, .page-heading { flex-direction: column; gap: 15px; margin: 22px 0 20px; }
  h1 { margin-bottom: 7px; font-size: 24px; letter-spacing: -.4px; }
  .eyebrow { margin-bottom: 8px; font-size: 9px; letter-spacing: 1.4px; }
  .heading p { font-size: 12px; line-height: 1.75; }
  .page-actions { width: 100%; }
  .page-actions button { flex: 1 1 120px; font-size: 13px; }
  .stats { gap: 10px; margin-bottom: 18px; }
  .stat { padding: 16px 13px 14px; font-size: 11px; border-radius: 11px; }
  .stat:first-child { padding-top: 14px; }
  .stat b { margin: 11px 0 5px; font-size: clamp(20px, 5.5vw, 26px); letter-spacing: -.7px; }
  .stat > small { font-size: 10px; }
  .stat p { margin-top: 8px; font-size: 11px; }
  .group-book-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats[data-long-amounts="true"] { grid-template-columns: minmax(0, 1fr); }
  .stats[data-long-amounts="true"] .stat b { font-size: clamp(18px, 4.6vw, 23px); letter-spacing: -.4px; overflow-wrap: normal; }
  .tabs { gap: 24px; padding: 0 15px; }
  .tabs button { min-height: 50px; padding-top: 14px; padding-bottom: 12px; font-size: 12px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; padding: 16px; }
  .filters input[type="search"] { min-width: 0; grid-column: 1 / -1; }
  .filters > input, .filters > select, .filters > button, .filters > label { width: 100%; }
  .filters > select { max-width: none; }
  .filters > label { display: grid; gap: 7px; }
  .filters > label input, .filters > label select { width: 100%; margin-left: 0; }
  .filters > div, .filters > strong, .filters > span, .filters > p { grid-column: 1 / -1; }
  .filters > span { font-size: 11px; }
  .filters > span:empty { display: none; }
  .filters > button { font-size: 13px; }
  #sdates { grid-template-columns: minmax(0, 1fr); }
  .unrecorded-help { padding-inline: 16px; font-size: 11px; }
  .footer { align-items: flex-start; gap: 8px; padding: 13px 16px; font-size: 11px; }
  .footer > span { max-width: 100%; overflow-wrap: anywhere; }
  .footer .actions { width: 100%; }
  .footer .actions button { flex: 1; }
  .notice { padding: 13px 15px; margin-top: 17px; font-size: 11px; }
  .tablewrap:has(table[data-responsive="cards"]) { padding: 10px; background: #f4f7f2; overflow: visible; }
  table[data-responsive="cards"] { display: block; width: 100%; white-space: normal; }
  table[data-responsive="cards"] thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  table[data-responsive="cards"] thead.table-selectall { position: static; display: block; width: auto; height: auto; margin: 0; padding: 0 2px 10px; overflow: visible; clip: auto; white-space: normal; }
  table[data-responsive="cards"] thead.table-selectall tr { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; }
  table[data-responsive="cards"] thead.table-selectall th { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  table[data-responsive="cards"] thead.table-selectall th[data-cell="select"],
  table[data-responsive="cards"] thead.table-selectall th.table-selectall {
    display: flex;
    position: static;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 8px 10px;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
    background: transparent;
    color: #65826d;
    font-size: 12px;
  }
  table[data-responsive="cards"] thead.table-selectall .sr-only { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
  table[data-responsive="cards"] thead.table-selectall .selectall-label { display: inline; }
  table[data-responsive="cards"] tbody { display: grid; width: 100%; gap: 10px; }
  table[data-responsive="cards"] tbody tr { display: block; width: 100%; padding: 9px 14px; border: 1px solid #dfe8dc; border-radius: 10px; background: #fff; box-shadow: 0 2px 5px #2c4c2e03; }
  table[data-responsive="cards"] td { position: relative; display: block; width: 100%; min-width: 0; max-width: none; min-height: 38px; padding: 9px 0 9px 96px; border-bottom: 1px solid #f0f3ed; color: #2f4c37; font-size: 12px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
  table[data-responsive="cards"] td::before { position: absolute; top: 10px; left: 0; width: 82px; color: #829784; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-size: 11px; font-weight: 400; letter-spacing: 0; content: attr(data-label); }
  table[data-responsive="cards"] td:last-child { border-bottom: 0; }
  table[data-responsive="cards"] td small { margin-top: 4px; font-size: 10px; color: #8b9b8c; }
  table[data-responsive="cards"] td[data-label*="金额"], table[data-responsive="cards"] td[data-label*="收款 / 来源"] { font-weight: 600; color: #2c5838; }
  table[data-responsive="cards"] td[data-label*="订单"] { padding-block: 11px; font-size: 12px; font-weight: 600; }
  table[data-responsive="cards"] td[data-label*="订单"] small { font-weight: 400; }
  table[data-responsive="cards"] td[data-cell="select"] { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; padding: 4px 0 8px; }
  table[data-responsive="cards"] td[data-cell="select"]::before { position: static; width: auto; margin-right: auto; font-size: 11px; content: "选择账单"; }
  table[data-responsive="cards"] td[data-cell="actions"] { padding: 8px 0 3px; }
  table[data-responsive="cards"] td[data-cell="actions"]::before, table[data-responsive="cards"] td[data-cell="empty"]::before { display: none; }
  table[data-responsive="cards"] td[data-cell="actions"] .actions { justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
  table[data-responsive="cards"] td[data-cell="actions"] .link { min-height: 44px; padding: 9px 10px; }
  table[data-responsive="cards"] td[data-cell="empty"] { padding: 22px 6px; text-align: center; color: #88988b; }
  table[data-responsive="cards"] tbody tr:hover td { background: transparent; }
  .owner-heading, .owner-settings { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
  .owner-heading h2 { font-size: 19px; }
  .owner-heading .actions button { flex: 1 1 130px; font-size: 12px; }
  .owner-relations { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 18px; }
  .principal-branch::after { top: 100%; left: 18px; width: 0; height: 22px; border-top: 0; border-left: 2px solid #b4cbb7; }
  .assistant-branch { margin-left: 18px; padding-left: 16px; }
  .assistant-branch::before { display: none; }
  .relation-account { padding: 15px; gap: 8px; }
  .relation-account .actions { width: 100%; gap: 3px; }
  .relation-account .actions .link { min-height: 44px; padding-inline: 6px; }
  .owner-settings .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .owner-settings .actions button { min-width: 0; padding-inline: 8px; font-size: 12px; }
  .owner-settings .actions button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .owner-meta { padding: 13px 18px; font-size: 11px; }
  .archived-accounts { padding-inline: 18px; }
  .claim-recovery { flex-direction: column; align-items: stretch; gap: 12px; padding: 18px; }
  .claim-recovery h2 { font-size: 16px; }
  .claim-recovery button { width: 100%; }
  .enrollment-panel > h2, .customer-admin-panel > h2, .customer-group-panel > h2 { margin: 18px 16px 8px; font-size: 17px; }
  .enrollment-panel > .helptext, .customer-admin-panel > .helptext, .customer-group-panel > .helptext { margin: 10px 16px 17px; font-size: 11px; }
  .super-admins { gap: 8px; margin: 14px 16px; }
  .super-admins .badge { width: 100%; padding: 10px 12px; font-size: 12px; }
  .group-book-entry, .group-book-period, .group-book-detail-heading { flex-direction: column; align-items: stretch; gap: 11px; padding: 17px 16px; }
  .group-book-entry h2, .group-book-period h2, .group-book-detail-heading h2 { font-size: 17px; }
  .group-book-entry button { width: 100%; }
  .group-book-filters > .helptext { margin-inline: 16px; font-size: 11px; }
  .group-book-filters .filters { grid-template-columns: minmax(0, 1fr); }
  .group-book-filters label, .group-book-filters input { width: 100%; }
  .group-book-period .actions { width: 100%; }
  .group-book-period .actions button { flex: 1; }
  .group-book-detail-heading .actions { width: 100%; }
  .login { margin-top: 9vh; padding: 30px 24px; border-radius: 15px; }
  .login h1 { font-size: 22px; }
  dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 22px 19px max(22px, env(safe-area-inset-bottom)); border-radius: 14px; scroll-padding-bottom: 24px; }
  dialog h2 { font-size: 20px; }
  dialog > p, dialog form > p { font-size: 12px; }
  .formgrid { gap: 16px; }
  .formgrid label { font-size: 12px; }
  .formgrid .check { font-size: 12px; }
  .formgrid .check input { width: 20px; }
  .dialogactions { position: sticky; z-index: 1; bottom: -22px; margin-top: 22px; padding: 15px 0 3px; background: #fff; }
  .dialogactions button { flex: 1 1 110px; min-width: 0; padding-inline: 10px; font-size: 13px; }
  .detail { grid-template-columns: 95px minmax(0, 1fr); gap: 12px 10px; font-size: 12px; }
  .cleanup-record dl { grid-template-columns: 88px minmax(0, 1fr); font-size: 12px; }
  #toast { bottom: max(20px, env(safe-area-inset-bottom)); padding: 12px 17px; font-size: 12px; }
  #content > .panel > .filters > div > button { width: 100%; margin: 5px 0; font-size: 13px; }
}

@media (max-width: 374px) {
  main, .app-main { padding-inline: 10px; }
  .mobile-topbar { padding-inline: 10px; gap: 8px; }
  .mobile-page-title { max-width: 38%; }
  .stat { padding-inline: 11px; }
  .stat b { font-size: 20px; }
  .filters { padding: 13px; gap: 8px; }
  .tabs { padding-inline: 13px; gap: 20px; }
  table[data-responsive="cards"] tbody tr { padding-inline: 11px; }
  table[data-responsive="cards"] td { padding-left: 86px; }
  table[data-responsive="cards"] td::before { width: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Robot management keeps credentials and switching actions separate from the ledger. */
.bot-manager { display: grid; gap: 18px; }
.bm-preserved { display: flex; align-items: flex-start; gap: 14px; padding: 18px 21px; border: 1px solid #d8e8dd; border-radius: 12px; background: #edf6ef; color: #315c41; }
.bm-preserved-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 9px; background: #dcecdf; font-size: 22px; }
.bm-preserved b { font-size: 14px; }
.bm-preserved p { margin: 5px 0 0; font-size: 12px; line-height: 1.8; }
.bm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.bm-toolbar p { margin: 0; color: #758b7a; font-size: 12px; line-height: 1.7; }
.bm-toolbar button { flex-shrink: 0; }
.bm-overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.bm-panel { padding: 24px; }
.bm-panel h2 { margin: 0 0 14px; font-size: 19px; overflow-wrap: anywhere; }
.bm-panel h3 { margin: 20px 0 12px; font-size: 14px; }
.bm-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.bm-section-heading > div { min-width: 0; }
.bm-section-heading h2, .bm-section-heading h3 { margin: 4px 0 16px; }
.bm-section-heading .badge { flex-shrink: 0; max-width: 50%; }
.bm-kicker { color: #819586; font-size: 11px; letter-spacing: .05em; }
.bm-facts { display: grid; gap: 13px; margin: 16px 0; }
.bm-facts > div { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 12px; font-size: 12px; line-height: 1.7; }
.bm-facts dt { color: #87988b; }
.bm-facts dd { margin: 0; color: #36503e; overflow-wrap: anywhere; }
.bm-panel .helptext { margin: 12px 0; }
#bm-candidate-input { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e7ede8; }
#bm-candidate-input[hidden] { display: none; }
.bm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.bm-empty { display: flex; align-items: flex-start; gap: 18px; }
.bm-empty > span { color: #8ca792; font-size: 28px; }
.bm-empty h3 { margin: 0 0 7px; font-size: 15px; }
.bm-empty p { margin: 0; color: #758b7a; font-size: 12px; line-height: 1.8; }
.bm-groups, .bm-history-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bm-groups > li, .bm-history-list > li { min-width: 0; padding: 15px 17px; border: 1px solid #e4ebe5; border-radius: 9px; }
.bm-group-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bm-group-title b, .bm-history-list b { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.bm-group-title .badge { flex-shrink: 0; }
.bm-id { margin: 8px 0 0; color: #849789; font-size: 11px; overflow-wrap: anywhere; }
.bm-issues { margin: 10px 0 0; padding-left: 17px; color: #a37c2b; font-size: 12px; line-height: 1.8; }
.bm-job > p { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.bm-error { margin: 0; color: #ad515b; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.bm-error:empty { display: none; }
.bm-switch-identities { display: grid; gap: 8px; margin: 20px 0; padding: 17px 19px; border: 1px solid #dfe9e2; border-radius: 10px; background: #f6f9f6; }
.bm-switch-identities p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.bm-switch-identities small { display: block; margin-top: 5px; color: #829488; font-size: 11px; }
.bm-switch-identities > span { color: #94ac99; }
@media (max-width: 1099px) {
 .bm-overview { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 767px) {
 .bot-manager { gap: 14px; }
 .bm-panel { padding: 19px 16px; }
 .bm-panel h2 { font-size: 17px; }
 .bm-preserved { gap: 10px; padding: 16px; }
 .bm-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
 .bm-toolbar button, #bm-open-candidate { width: 100%; }
 .bm-overview { gap: 14px; }
 .bm-facts > div { grid-template-columns: 90px minmax(0,1fr); gap: 8px; }
 .bm-actions button { flex: 1 1 110px; min-width: 0; }
 .bm-groups > li, .bm-history-list > li { padding: 13px 12px; }
 .bm-empty { gap: 12px; }
 .bm-section-heading { gap: 8px; }
 .bm-section-heading .badge { max-width: 44%; }
}

/* Readable financial typography. Supporting copy stays secondary without
   turning into miniature text, especially on mobile receipt cards. */
nav button { font-size: 15px; }
.heading, .page-heading { margin: 24px 0 18px; }
.heading p, .helptext, .notice, .filters label, .filters > span { font-size: 14px; }
.workspace-header, main > header { font-size: 14px; }
.stat { padding: 18px; font-size: 15px; }
.stat:first-child { padding-top: 16px; }
.stat > small, .stat b small { font-size: 13px; }
.stat b { margin: 9px 0 5px; }
.stat p { font-size: 14px; }
.tabs button { font-size: 15px; }
th { font-size: 13px; }
td { padding: 15px; font-size: 15px; }
td small, .badge, .link, .footer { font-size: 13px; }
.link { min-height: 40px; }
.formgrid label, .detail, dialog > p, dialog form > p { font-size: 15px; }
.owner-heading p, .owner-settings p, .owner-meta, .relationship-label { font-size: 14px; }
.relation-account small { font-size: 13px; }
.owner-relations { gap: 30px; padding: 20px; }
.owner-heading, .owner-settings { padding: 18px 20px; }
.bm-panel { padding: 20px; }
.bm-preserved p, .bm-toolbar p, .bm-facts > div, .bm-empty p,
.bm-job > p, .bm-error, .bm-issues { font-size: 14px; }
.bm-kicker, .bm-id, .bm-switch-identities small { font-size: 13px; }
.bm-group-title b, .bm-history-list b { font-size: 15px; }

/* Confirmed receipt reports: clear scope, settlement window and currency. */
.claimed-reports { display: grid; gap: 18px; min-width: 0; }
.cr-filters { padding: 20px; }
.cr-scope-fields { display: grid; grid-template-columns: minmax(190px,1fr) 24px minmax(190px,1fr); align-items: end; gap: 12px; max-width: 850px; }
.cr-scope-fields label, .cr-date-fields label { display: grid; min-width: 0; gap: 6px; color: #4d6c5b; font-size: 14px; font-weight: 550; }
.cr-scope-fields select { width: 100%; max-width: 100%; font-size: 16px; }
.cr-scope-fields select:disabled { color: #809185; background: #f3f6f3; }
.cr-scope-arrow { display: grid; align-items: center; min-height: 44px; color: #8aa491; text-align: center; }
.cr-period-controls { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cr-mode { display: inline-flex; min-width: 0; gap: 3px; margin: 0; padding: 4px; border: 1px solid #dce6df; border-radius: 10px; background: #f3f6f4; }
.cr-mode label { position: relative; display: flex; cursor: pointer; }
.cr-mode input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.cr-mode span { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; color: #647c6c; font-size: 15px; white-space: nowrap; }
.cr-mode input:checked + span { border-color: #dce7df; background: #fff; color: var(--green-dark); box-shadow: 0 2px 5px #21492f0b; font-weight: 650; }
.cr-mode input:focus-visible + span { outline: 3px solid #5bad8b; outline-offset: 2px; }
.cr-date-fields { display: flex; align-items: end; min-width: 0; gap: 10px; }
.cr-date-fields input { width: 100%; min-width: 150px; font-size: 16px; }
.cr-date-separator { display: grid; align-items: center; min-height: 44px; color: var(--muted); font-size: 14px; }
.cr-filter-actions { display: flex; gap: 8px; margin-left: auto; }
.cr-rule { margin: 14px 0 0; color: #698171; font-size: 14px; line-height: 1.7; }
.cr-error { margin: 10px 0 0; color: #aa4652; font-size: 15px; }
.cr-error:empty { display: none; }
#cr-result { display: grid; gap: 18px; min-width: 0; }
.cr-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 3px 0; }
.cr-report-heading h2 { margin: 3px 0 7px; font-size: 23px; }
.cr-report-heading p { margin: 0; font-size: 14px; }
.cr-report-heading > .badge { flex-shrink: 0; padding: 8px 12px; font-size: 14px; }
.cr-scope-label { color: #4f7a5e; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.cr-currency { display: grid; grid-template-columns: minmax(220px,.9fr) minmax(0,1.6fr); }
.cr-total { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-right: 1px solid var(--line); background: #edf5ef; color: #447151; font-size: 14px; }
.cr-total strong { margin: 2px 0; color: #20563c; font-size: clamp(25px,2.5vw,36px); line-height: 1.35; letter-spacing: -.6px; overflow-wrap: anywhere; }
.cr-payment-methods { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: center; padding: 22px; }
.cr-payment-methods > div { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.cr-payment-methods > div > span { color: #607e69; font-size: 14px; }
.cr-payment-methods b { color: #2d5139; font-size: clamp(17px,1.7vw,23px); font-weight: 650; overflow-wrap: anywhere; }
.cr-payment-methods small { color: #7b9081; font-size: 13px; }
.cr-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; }
.cr-section-heading h2 { margin: 0; font-size: 19px; }
.cr-section-heading h2 span { margin-left: 6px; color: #7c9082; font-size: 14px; font-weight: 500; }
.cr-section-heading p { margin: 5px 0 0; font-size: 14px; }
.cr-money-line { display: block; color: #31583f; font-size: 15px; font-weight: 600; white-space: nowrap; }
.cr-money-line + .cr-money-line { margin-top: 4px; }
.cr-zero { color: #8ca194; }
.cr-breakdown th, .cr-breakdown td { padding-inline: 18px; }
.cr-breakdown td:first-child { min-width: 130px; }
.cr-breakdown .cr-drill { white-space: nowrap; }
.cr-empty { padding: 32px 22px; text-align: center; color: #698374; }
.cr-empty > span { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: #edf5ee; color: #82a58a; font-size: 27px; }
.cr-empty h3 { margin: 10px 0 7px; color: #375e44; font-size: 18px; }
.cr-empty p { margin: 7px 0 15px; font-size: 15px; }
.cr-empty.cr-failed { border-color: #ecdadd; background: #fffafb; }
.cr-warning { padding: 15px 18px; border: 1px solid #e9dcba; border-radius: 10px; background: #fff9ed; color: #8d6b2f; font-size: 15px; }
.cr-warning p { margin: 5px 0 0; color: #937a4e; font-size: 14px; }
.cr-footnote { margin: 0; color: #738a7b; font-size: 13px; line-height: 1.8; }
.cr-loading { padding: 28px 22px; }
.cr-loading b { display: block; margin-top: 16px; font-size: 16px; }
.cr-loading p { font-size: 14px; }
.cr-loading-bar { display: block; width: 120px; height: 8px; border-radius: 5px; background: #dcebe0; }

@media (min-width: 768px) and (max-width: 1150px) {
 .cr-currency { grid-template-columns: minmax(200px,.9fr) minmax(0,1.4fr); }
 .cr-payment-methods { gap: 12px; padding: 18px; }
 .cr-payment-methods b { font-size: 18px; }
}
@media (max-width: 767px) {
 :root { font-size: 16px; }
 main, .app-main { padding-inline: 12px; }
 .mobile-topbar { min-height: calc(60px + env(safe-area-inset-top)); padding-inline: 12px; }
 aside, .app-sidebar { top: calc(60px + env(safe-area-inset-top)); }
 .mobile-page-title { max-width: 42%; font-size: 14px; }
 .mobile-nav-toggle, #navtoggle { font-size: 15px; }
 .workspace-header, main > header { min-height: 40px; font-size: 13px; }
 .workspace-header .link { min-height: 40px; font-size: 13px; }
 .heading, .page-heading { gap: 12px; margin: 15px 0 16px; }
 .heading .eyebrow { display: none; }
 h1 { font-size: 25px; }
 .heading p { font-size: 14px; line-height: 1.65; }
 .page-actions button, .filters > button { font-size: 15px; }
 .stats { gap: 8px; }
 .stat { padding: 14px 12px; font-size: 14px; }
 .stat:first-child { padding-top: 12px; }
 .stat b { margin: 8px 0 5px; font-size: clamp(22px,5.6vw,28px); }
 .stat > small, .stat b small { font-size: 12px; }
 .stat p { font-size: 13px; }
 .tabs { padding-inline: 14px; gap: 23px; }
 .tabs button { min-height: 50px; font-size: 15px; }
 .filters { gap: 9px; padding: 14px; }
 .filters label, .filters > span { font-size: 14px; }
 .footer { padding: 12px 14px; font-size: 13px; }
 .notice, .helptext, .unrecorded-help { font-size: 13px; }
 .notice { padding: 12px 14px; }
 .badge, .link { font-size: 13px; }
 table[data-responsive="cards"] tbody tr { padding: 5px 12px; }
 table[data-responsive="cards"] td { min-height: 38px; padding: 9px 0 9px 96px; font-size: 15px; line-height: 1.6; }
 table[data-responsive="cards"] td::before { top: 11px; width: 84px; color: #6f8976; font-size: 13px; }
 table[data-responsive="cards"] td small { font-size: 13px; line-height: 1.65; }
 table[data-responsive="cards"] td[data-label*="订单"] { padding-block: 10px; font-size: 15px; }
 table[data-responsive="cards"] td[data-cell="select"]::before { font-size: 13px; }
 table[data-responsive="cards"] td[data-cell="actions"] .link { font-size: 14px; }
 .owner-heading, .owner-settings { padding: 15px; gap: 12px; }
 .owner-heading h2 { font-size: 21px; }
 .owner-heading p, .owner-settings p, .owner-meta, .relationship-label { font-size: 14px; }
 .owner-heading .actions button, .owner-settings .actions button { font-size: 14px; }
 .owner-relations { gap: 18px; padding: 15px; }
 .principal-branch::after { height: 18px; }
 .relation-account { padding: 14px; font-size: 16px; }
 .relation-account small { font-size: 13px; }
 .formgrid label, .formgrid .check, .detail, dialog > p, dialog form > p { font-size: 15px; }
 .dialogactions button { font-size: 15px; }
 dialog { padding-inline: 17px; }
 #toast { font-size: 15px; }
 .group-book-entry h2, .group-book-period h2, .group-book-detail-heading h2 { font-size: 20px; }
 .group-book-filters > .helptext, .enrollment-panel > .helptext,
 .customer-admin-panel > .helptext, .customer-group-panel > .helptext { font-size: 14px; }
 .super-admins .badge { font-size: 14px; }
 .bm-panel { padding: 16px 14px; }
 .bm-panel h2 { font-size: 20px; }
 .bm-preserved p, .bm-toolbar p, .bm-facts > div, .bm-empty p,
 .bm-job > p, .bm-error, .bm-issues { font-size: 14px; }
 .bm-facts > div { grid-template-columns: 92px minmax(0,1fr); }
 .claimed-reports, #cr-result { gap: 14px; }
 .cr-filters { padding: 14px; }
 .cr-scope-fields { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
 .cr-scope-fields label { font-size: 14px; }
 .cr-scope-arrow { display: none; }
 .cr-period-controls { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 14px; padding-top: 14px; }
 .cr-mode { display: flex; gap: 2px; width: 100%; }
 .cr-mode label { flex: 1; }
 .cr-mode span { width: 100%; min-height: 42px; padding-inline: 5px; font-size: 14px; }
 .cr-date-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
 #cr-day-field { grid-template-columns: minmax(0,1fr); }
 .cr-date-fields input { min-width: 0; }
 .cr-date-separator { display: none; }
 .cr-filter-actions { width: 100%; margin-left: 0; }
 .cr-filter-actions button { flex: 1; min-height: 44px; font-size: 15px; }
 .cr-rule { margin-top: 12px; font-size: 13px; line-height: 1.7; }
 .cr-report-heading { align-items: flex-start; gap: 10px; padding-inline: 2px; }
 .cr-report-heading h2 { margin-top: 5px; font-size: 21px; }
 .cr-report-heading p { font-size: 14px; line-height: 1.65; }
 .cr-report-heading > .badge { padding: 5px 8px; font-size: 13px; white-space: nowrap; }
 .cr-scope-label { font-size: 15px; }
 .cr-currency { grid-template-columns: minmax(0,1fr); }
 .cr-total { gap: 4px; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); font-size: 14px; }
 .cr-total strong { font-size: clamp(27px,7.5vw,34px); }
 .cr-payment-methods { gap: 12px; padding: 16px; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
 .cr-payment-methods > div { gap: 5px; }
 .cr-payment-methods > div:last-child { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 7px 12px; padding-top: 12px; border-top: 1px solid #e8eee9; }
 .cr-payment-methods > div > span { font-size: 14px; }
 .cr-payment-methods b { font-size: 21px; }
 .cr-payment-methods > div:last-child b { font-size: 17px; }
 .cr-payment-methods small { font-size: 13px; }
 .cr-section-heading { padding: 15px 14px; }
 .cr-section-heading h2 { font-size: 19px; }
 .cr-section-heading p { font-size: 13px; }
 .cr-money-line { font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
 .cr-breakdown td:first-child { min-width: 0; }
 .cr-warning { padding: 13px 14px; font-size: 14px; }
 .cr-warning p, .cr-footnote { font-size: 13px; }
 .cr-empty { padding: 26px 16px; }
 .cr-loading { padding: 22px 16px; }
}
