/* Reference wallet: desktop table, mobile ledger cards and compact monochrome shell. */
body.reference-wallet-route { --rw-bg:#fdfdfd;--rw-surface:#fff;--rw-text:#090909;--rw-muted:#737373;--rw-line:#e5e5e5;--rw-soft:#f5f5f5;background:var(--rw-bg);color:var(--rw-text); }
body.reference-wallet-route.rw-dark { --rw-bg:#121212;--rw-surface:#191919;--rw-text:#fafafa;--rw-muted:#aaa;--rw-line:#383838;--rw-soft:#252525; }
.reference-wallet-route .mobile-view-container,.reference-wallet-route #main-content {background:var(--rw-bg);}
.reference-wallet-route #main-content {padding:16px 24px 40px;}
.reference-wallet {width:100%;max-width:none;margin:0;color:var(--rw-text);font-size:14px;font-variant-numeric:tabular-nums;}
.reference-wallet button,.reference-wallet select,.rw-recharge-dialog button,.rw-recharge-dialog input {font:inherit;}
.reference-wallet svg,.rw-nav-tools svg,.rw-recharge-dialog svg,.rw-search-dialog svg {width:16px;height:16px;flex-shrink:0;vertical-align:middle;}
.rw-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 18px;}
.rw-heading h2 {margin:0;font-size:30px;line-height:36px;letter-spacing:-1px;font-weight:700;}
.rw-heading p {margin:2px 0 0;color:var(--rw-muted);line-height:22px;}
.rw-primary {display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:36px;padding:8px 14px;background:#000;color:#fff;border:1px solid #000;border-radius:6px;cursor:pointer;box-shadow:0 1px 2px #0002;font-weight:500;}
.rw-primary:hover {background:#262626;}
.rw-primary:active {transform:translateY(1px);}
.rw-balance {position:relative;padding:24px;border:1px solid var(--rw-line);border-radius:12px;background:var(--rw-surface);box-shadow:0 1px 2px #0003;margin-bottom:24px;}
.rw-balance-label {color:var(--rw-muted);font-size:14px;line-height:20px;}
#rw-balance {display:block;font-size:36px;line-height:44px;letter-spacing:-1px;font-weight:700;margin:4px 0 16px;}
.rw-wallet-badge {position:absolute;top:24px;right:24px;display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:2px 8px;border:1px solid var(--rw-line);border-radius:5px;}
.rw-wallet-badge svg {width:12px;height:12px;}
.rw-totals {display:flex;gap:40px;margin:0 0 18px;}
.rw-totals>div {display:flex;align-items:baseline;gap:12px;}
.rw-totals span {color:var(--rw-muted);font-size:12px;}
.rw-totals b {font-size:16px;font-weight:600;}
.rw-balance>p {margin:0;color:var(--rw-muted);font-size:12px;line-height:18px;}
.rw-toolbar {display:flex;align-items:center;justify-content:space-between;margin:0 4px 20px;}
.rw-toolbar details {position:relative;}
.rw-toolbar summary {display:flex;align-items:center;gap:7px;list-style:none;border:1px solid var(--rw-line);border-radius:6px;padding:6px 10px;cursor:pointer;background:var(--rw-bg);font-weight:500;box-shadow:0 1px 2px #0001;}
.rw-toolbar summary::-webkit-details-marker {display:none;}
.rw-filter summary {border-style:dashed;}
.rw-menu {position:absolute;top:calc(100% + 6px);left:0;min-width:140px;z-index:20;padding:5px;background:var(--rw-surface);border:1px solid var(--rw-line);border-radius:7px;box-shadow:0 5px 20px #0002;}
.rw-columns .rw-menu {left:auto;right:0;}
.rw-menu button,.rw-menu label {display:block;width:100%;padding:7px 9px;text-align:left;border:0;background:transparent;color:var(--rw-text);border-radius:4px;cursor:pointer;white-space:nowrap;}
.rw-menu button:hover,.rw-menu label:hover {background:var(--rw-soft);}
.rw-table-wrap {overflow:auto;border:1px solid var(--rw-line);border-radius:8px;}
.rw-table {border-collapse:collapse;width:100%;table-layout:auto;font-size:14px;white-space:nowrap;color:var(--rw-muted);}
.rw-table th {height:40px;padding:8px 10px;text-align:left;background:var(--rw-soft);font-weight:500;color:var(--rw-text);}
.rw-table td {padding:8px 10px;border-top:1px solid var(--rw-line);height:40px;}
.rw-table td:nth-child(5) {max-width:520px;overflow:hidden;text-overflow:ellipsis;}
.rw-table .is-hidden,.rw-mobile-record .is-hidden {display:none!important;}
.rw-table td:nth-child(6) svg {width:13px;height:13px;margin-right:6px;}
.rw-table strong {font-weight:600;color:var(--rw-text);}
.rw-tag {display:inline-block;padding:2px 7px;line-height:20px;background:#ededed;color:#111;border-radius:5px;font-size:12px;font-weight:500;white-space:nowrap;}
.rw-tag-income {background:#000;color:#fff;}
.rw-income,.rw-table strong.rw-income {color:#00c853;}
.rw-pagination {display:flex;align-items:center;gap:28px;margin:20px 4px 0;font-size:14px;}
#rw-count {color:var(--rw-muted);margin-right:auto;}
.rw-page-size {display:flex;align-items:center;gap:9px;}
.rw-page-size select {padding:7px 10px;border:1px solid var(--rw-line);border-radius:6px;color:var(--rw-text);background:var(--rw-bg);}
#rw-page {font-size:13px;font-weight:500;white-space:nowrap;}
.rw-page-buttons {display:flex;gap:4px;}
.rw-page-buttons button {width:32px;height:32px;border:1px solid var(--rw-line);border-radius:6px;background:var(--rw-bg);color:var(--rw-text);font-size:22px;cursor:pointer;}
.rw-page-buttons button:disabled {opacity:.35;cursor:default;}
.rw-empty,.rw-loading {padding:40px;text-align:center;color:var(--rw-muted);border:1px solid var(--rw-line);border-radius:8px;}
.rw-mobile-records {display:none;}
.rw-recharge-dialog,.rw-search-dialog {width:min(440px,calc(100% - 32px));padding:24px;border:1px solid #e5e5e5;border-radius:12px;background:#fff;color:#111;box-shadow:0 16px 60px #0003;max-height:calc(100dvh - 48px);overflow:auto;}
.rw-recharge-dialog::backdrop,.rw-search-dialog::backdrop {background:#0006;}
.rw-recharge-dialog h2 {font-size:22px;margin:0 0 8px;}
.rw-recharge-dialog p {font-size:13px;color:#737373;margin:0 0 20px;}
.rw-dialog-close,.rw-search-dialog form button {position:absolute;right:12px;top:12px;padding:6px;border:0;background:transparent;cursor:pointer;}
.rw-amounts {display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
.rw-amounts button {padding:12px 0;border:1px solid #e5e5e5;background:#fff;border-radius:6px;cursor:pointer;}
.rw-amounts button.selected {background:#000;border-color:#000;color:#fff;}
.rw-amount-input {display:flex;align-items:center;gap:8px;border:1px solid #ddd;border-radius:6px;padding:12px;margin:16px 0;}
.rw-amount-input input {width:100%;min-width:0;border:0;outline:none;background:transparent;font-size:18px;}
.rw-recharge-dialog .rw-error {margin:0 0 12px;color:#b91c1c;}
.rw-recharge-dialog .rw-error:empty {display:none;}
.rw-pay {width:100%;}
.reference-wallet :focus-visible,.rw-recharge-dialog :focus-visible,.rw-nav-tools :focus-visible {outline:2px solid #777;outline-offset:3px;}
.rw-nav-tools {margin-left:auto;display:flex;align-items:center;gap:8px;}
.rw-nav-tools button {display:flex;align-items:center;justify-content:center;gap:12px;height:36px;background:transparent;border:0;border-radius:6px;padding:8px;color:var(--rw-text);cursor:pointer;}
.rw-nav-tools button:hover {background:var(--rw-soft);}
.rw-nav-tools .rw-search {width:256px;border:1px solid var(--rw-line);justify-content:flex-start;color:var(--rw-muted);box-shadow:0 1px 2px #0001;}
.rw-search kbd {margin-left:auto;border:1px solid var(--rw-line);border-radius:4px;padding:2px 5px;font:12px Arial;background:var(--rw-soft);}
.rw-nav-tools .rw-theme-toggle {background:var(--rw-line);}
.rw-theme-select {display:flex;align-items:center;gap:8px;border:1px solid var(--rw-line);border-radius:6px;padding:0 10px;height:36px;box-shadow:0 1px 2px #0001;}
.rw-theme-select select {border:0;background:transparent;color:var(--rw-text);font:14px Arial;width:110px;}
.rw-theme-select>span:last-child {font-size:12px;color:var(--rw-muted);}
.rw-crumb-home {color:var(--rw-muted);text-decoration:none;display:flex;gap:20px;align-items:center;}
.rw-crumb-home:after {content:'/';color:var(--rw-muted);}
body:not(.reference-wallet-route) .rw-crumb-home,body:not(.reference-wallet-route) .rw-nav-tools {display:none;}
.rw-search-dialog input {width:calc(100% - 24px);padding:10px;border:1px solid #ddd;border-radius:6px;margin:12px 0;}
.rw-search-dialog nav {display:grid;gap:4px;}
.rw-search-dialog nav a {padding:8px;text-decoration:none;color:#111;}
.rw-search-dialog nav a[hidden] {display:none;}
.rw-search-dialog nav a i,.rw-search-dialog nav a svg {margin-right:10px;width:16px;height:16px;}
@media(min-width:769px){
}
@media(max-width:1100px){.rw-nav-tools .rw-search {width:180px;}.rw-theme-select {display:none;}}
@media(max-width:768px){
.reference-wallet-route #main-content {padding:8px 16px 32px;margin:0;}
.reference-wallet-route .ios-header {display:none!important;}
.rw-crumb-home {display:none;}
.rw-nav-tools {gap:4px;}
.rw-nav-tools .rw-search {width:32px;border:0;box-shadow:none;padding:7px;}
.rw-search span,.rw-search kbd,.rw-theme-select {display:none;}
.rw-heading {flex-direction:column;gap:12px;margin-bottom:16px;}
.rw-heading h2 {font-size:28px;line-height:34px;}
.rw-heading p {font-size:14px;margin-top:0;}
.rw-balance {padding:24px;margin-bottom:24px;}
.rw-wallet-badge {top:24px;right:24px;}
.rw-totals {gap:24px;margin:0 0 20px;}
.rw-totals>div {display:flex;flex-direction:column;gap:3px;}
.rw-totals b {font-size:15px;}
.rw-toolbar {margin-bottom:20px;}
.rw-columns {display:block;}
.rw-table-wrap {display:none;}
.rw-mobile-records {display:grid;gap:8px;}
.rw-mobile-record {display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--rw-line);border-radius:7px;min-width:0;}
.rw-mobile-copy {min-width:0;flex:1;}
.rw-mobile-copy>div {display:flex;align-items:center;gap:8px;}
.rw-mobile-copy time {color:var(--rw-muted);font-size:12px;white-space:nowrap;}
.rw-mobile-copy p {font-size:12px;color:var(--rw-muted);margin:4px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rw-mobile-method {display:flex;align-items:center;gap:4px;margin-top:4px;color:var(--rw-muted);font-size:11px;}
.rw-mobile-method svg {width:12px;height:12px;}
.rw-mobile-money {display:flex;flex-direction:column;align-items:flex-end;gap:3px;white-space:nowrap;font-size:13px;}
.rw-mobile-money span {font-size:12px;color:var(--rw-muted);}
.rw-tag {font-size:11px;padding:1px 7px;line-height:18px;}
.rw-pagination {gap:8px;font-size:12px;margin-top:24px;}
.rw-page-size,#rw-first,#rw-last {display:none;}
#rw-page {font-size:12px;}
.rw-page-buttons button {width:30px;height:30px;}
}
@media(prefers-reduced-motion:reduce){.reference-wallet-route * {transition:none!important;}}

/* Dialog centering must be explicit: the site's reset clears native dialog margins. */
dialog.rw-recharge-dialog { position:fixed; inset:0; margin:auto; height:fit-content; width:min(440px,calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); box-sizing:border-box; transform:none; }
/* Shared sidebar graphics retain dimensions on every route. */
.desktop-nav a > svg { width:16px; height:16px; flex:0 0 16px; }
.desktop-brand-mark > svg { width:24px; height:24px; }

.reference-wallet { font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif; }

/* Keep the page surface continuous through the shared top navigation. */
body.continuous-page-surface { --page-surface:#f4f5f7; }
body.reference-wallet-route { --page-surface:var(--rw-bg); }
body.cashier-route { --page-surface:#fff; }
body.continuous-page-surface .mobile-view-container,
body.continuous-page-surface .dashboard-page-nav,
body.continuous-page-surface #main-content { background:var(--page-surface)!important; }
.rw-amount-input input::placeholder { color:#858585; opacity:1; font-size:15px; font-weight:400; }
.rw-pay:disabled { opacity:.45; cursor:not-allowed; }
.wallet-cashier-header { display:flex; justify-content:center; }
body.cashier-route .wallet-cashier-page { margin-top:0; border:0; border-radius:0; box-shadow:none; }
.wallet-cashier-footer #wallet-cashier-cancel { margin-top:10px; background:transparent; color:#737373; }
.wallet-payment-dialog .wallet-payment-hint { color:#dc2626; font-weight:600; line-height:1.6; }
.wallet-alipay-open { margin-top:16px; padding:10px 24px; border:0; border-radius:6px; background:#1677ff; color:#fff; cursor:pointer; }

/* Animated certificate distribution; scoped to the homepage status card. */
.dashboard-status-panel .ds-chart { gap:14px; padding:4px 0 0; }
.ds-visual { position:relative; width:220px; max-width:100%; aspect-ratio:1; }
.ds-svg { width:100%; height:100%; overflow:visible; }
.ds-guide { fill:none; stroke:#e9edf5; stroke-width:1; stroke-dasharray:2 7; }
.ds-track,.ds-ring { fill:none; stroke-width:17; }
.ds-track { stroke:#edf1f7; }
.ds-ring { stroke-linecap:butt; transition:opacity .2s,stroke-width .2s,filter .2s; }
.ds-ring.ds-normal { stroke:#3568f5; }
.ds-ring.ds-revoked { stroke:#dc4545; }
.ds-ring.is-active { stroke-width:22; filter:drop-shadow(0 3px 5px rgba(25,45,90,.15)); }
.ds-ring.is-muted { opacity:.22; }
.ds-center { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:center; pointer-events:none; gap:6px; }
.ds-caption { color:#737b89; font-size:11px; }
.ds-number { color:#171d2b; font-size:34px; line-height:1.15; letter-spacing:-1.2px; font-weight:750; font-variant-numeric:tabular-nums; }
.ds-detail { color:#737b89; font-size:10px; font-variant-numeric:tabular-nums; }
.ds-legend { display:grid; gap:5px; width:100%; }
.ds-item { display:grid; grid-template-columns:1fr auto 52px; align-items:center; gap:10px; width:100%; padding:9px 12px; border:1px solid transparent; border-radius:8px; background:transparent; cursor:pointer; text-align:left; transition:background .2s,border-color .2s; font:inherit; }
.ds-item:hover,.ds-item.is-active { background:#f6f8fc; border-color:#e8edf7; }
.ds-label { display:flex; align-items:center; gap:8px; color:#667085; font-size:12px; }
.ds-label i { width:7px; height:7px; border-radius:2px; background:#3568f5; }
.ds-revoked .ds-label i { background:#dc4545; }
.ds-item strong { color:#202838; font-size:14px; font-variant-numeric:tabular-nums; }
.ds-percent { text-align:right; color:#8a92a0; font-size:11px; font-variant-numeric:tabular-nums; }
.ds-item:focus-visible { outline:2px solid #3568f5; outline-offset:2px; }
@media(prefers-reduced-motion:reduce){ .ds-ring,.ds-item { transition:none; } }

.ds-visual,.ds-item { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.ds-ring,.ds-item { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.ds-ring { cursor:pointer; }

/* Mobile keeps the column picker available while ledger rows remain card-based. */
@media (max-width:680px){
  .rw-toolbar{display:flex;align-items:center;gap:8px;}
  .rw-filter{margin-right:auto;}
  .rw-columns summary{padding:6px 8px;font-size:13px;}
}

/* Modal close controls should be a plain X without the browser focus square. */
body.minimal-template :is(
  .rw-dialog-close, .rw-search-dialog form button, .wallet-payment-close,
  .cs-close, .mr-dialog-head [data-close], .mr-document-close,
  .md-modal .device-analyze-close, .add-device-close, .install-modal-close,
  .password-close, .dp-dialog header button, .invitation-activity-close
){
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:none!important;
  appearance:none;
}
