:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #111827;
  --muted: #667085;
  --line: #d9dee7;
  --ink: #202938;
  --green: #0f766e;
  --green-strong: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b91c1c;
  --ok: #15803d;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body.cashier-page,
body.admin-page {
  min-height: 100vh;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #eef1f5;
}

.phone-frame {
  position: relative;
  width: min(390px, 100vw);
  max-width: 100vw;
  height: min(844px, 100vh);
  overflow: hidden;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.15);
}

.admin-locked .topbar,
.admin-locked .admin-shell,
.admin-locked .bottom-tabbar {
  display: none !important;
}

.calculator-gate {
  position: absolute;
  inset: 0;
  z-index: 120;
  padding: 18px 18px 22px;
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto;
  gap: 18px;
  background: #000;
  color: #fff;
}

body:not(.admin-locked) .calculator-gate {
  display: none !important;
  pointer-events: none !important;
  z-index: -1;
}

.calc-display {
  align-self: end;
  min-height: 78px;
  overflow: hidden;
  text-align: right;
  white-space: nowrap;
  font-size: 72px;
  font-weight: 300;
  line-height: 1;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.calc-grid button {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #303030;
  color: #fff;
  font-size: 34px;
  font-weight: 500;
}

.calc-grid button:nth-child(-n + 3) {
  background: #666;
}

.calc-grid button.op {
  background: #ff9f0a;
  font-size: 42px;
}

.calc-grid .calc-back {
  font-size: 32px;
}

.cashier-page .topbar {
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  position: relative;
  background: #0d1118;
}

.cashier-page .brand {
  display: flex;
  gap: 10px;
}

.cashier-page .brand-mark {
  width: 40px;
  height: 40px;
}

.cashier-page .storefront-brand span {
  color: #f8fafc;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
}

.cashier-page .storefront-brand small {
  margin-top: 2px;
  color: #93a4bb;
  font-size: 11px;
}

.cashier-page .gp-mark {
  color: #08111f;
  background: linear-gradient(135deg, #f7d476, #23d3ad);
  border: 0;
  box-shadow: 0 10px 26px rgba(35, 211, 173, 0.22);
  font-size: 15px;
  font-weight: 950;
}

.cashier-page .cashier-shell {
  width: 100%;
  height: calc(100% - 58px);
  margin: 0;
  padding: 12px 12px 18px;
  overflow-y: auto;
  scrollbar-width: none;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: start;
}

.cashier-page .cashier-shell::-webkit-scrollbar {
  display: none;
}

.cashier-page .cashier-shell.pay-fullscreen {
  min-height: auto;
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.cashier-page .cashier-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.cashier-page .cashier-heading h1 {
  font-size: 28px;
}

.cashier-page .storefront-copy,
.cashier-page .product-panel > .panel-head {
  display: none;
}

.cashier-page #assistantStatus {
  display: none;
}

.cashier-page .panel {
  padding: 14px;
}

.cashier-page .product-panel {
  padding: 10px;
}

.cashier-page .product-grid {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cashier-page .product {
  min-height: auto;
  padding: 10px;
  gap: 8px;
}

.cashier-page .product h3 {
  font-size: 15px;
  line-height: 1.2;
}

.cashier-page .product p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.cashier-page .product-buy-row {
  display: grid;
  gap: 8px;
  align-items: start;
  justify-content: stretch;
}

.cashier-page .price {
  font-size: 22px;
  line-height: 1.05;
}

.cashier-page .product .primary {
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
}

.cashier-page .payment-methods {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cashier-page .payment-actions {
  justify-content: stretch;
}

.cashier-page .payment-actions .primary {
  width: 100%;
}

.cashier-page .pay-fullscreen .pay-dock {
  width: 100%;
}

.cashier-page .pay-fullscreen .pay-amount strong {
  font-size: 30px;
}

.cashier-page .pay-fullscreen .qr {
  max-width: none;
}

.cashier-page .pay-fullscreen .qr-stage {
  width: min(100%, 230px);
  max-width: 230px;
  margin-inline: auto;
  justify-self: center;
}

a {
  color: inherit;
}

.topbar {
  min-height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.phone-frame .nav {
  display: flex;
  margin-left: auto;
}

.phone-frame .nav a.active {
  display: none;
}

.phone-frame .nav a {
  min-height: 34px;
  padding: 0 13px;
}

.phone-frame .brand {
  display: none;
}

.cashier-page .phone-frame .storefront-brand {
  display: flex;
}

.nav a,
button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.nav a.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

button.primary:hover {
  background: var(--green-strong);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.cashier-shell,
.admin-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 26px auto 48px;
}

.cashier-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.cashier-shell.product-only {
  grid-template-columns: 1fr;
}

.cashier-shell.pay-fullscreen {
  min-height: calc(100vh - 118px);
  grid-template-columns: minmax(320px, 480px);
  justify-content: center;
  align-items: start;
}

.checkout-main,
.stack,
.admin-shell {
  display: grid;
  gap: 18px;
}

.cashier-heading,
.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.cashier-heading h1,
.admin-heading h1 {
  margin: 4px 0 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel,
.card,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2,
.section-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.panel-head p,
.muted {
  margin: 4px 0 0;
  color: var(--muted);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented button {
  min-height: 46px;
  font-weight: 700;
}

.segmented button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.card,
.product {
  padding: 16px;
}

.product {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.product-buy-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.product h3 {
  margin: 0;
  font-size: 18px;
}

.product p {
  margin: 8px 0 0;
  color: var(--muted);
}

.price {
  margin-bottom: 4px;
  font-size: 30px;
  font-weight: 900;
  color: var(--ink);
}

.pay-dock {
  position: sticky;
  top: 88px;
}

.pay-fullscreen .pay-dock {
  position: static;
  width: min(100%, 480px);
}

.pay-fullscreen .pay-amount strong {
  font-size: 46px;
}

.pay-fullscreen .qr {
  max-width: 360px;
  justify-self: center;
}

.pay-link-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px 0 4px;
}

.pay-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  text-decoration: none;
}

.payment-choice {
  display: grid;
  gap: 14px;
}

.payment-step {
  border-color: #b7c3d7;
}

.inline-pay-popover {
  margin-top: 2px;
  padding: 7px;
  display: grid;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.inline-pay-top {
  display: grid;
  gap: 2px;
}

.inline-pay-top strong {
  font-size: 12px;
}

.inline-pay-top span,
.quantity-line span,
.inline-pay-total span {
  color: var(--muted);
  font-size: 12px;
}

.quantity-line,
.inline-pay-total {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.quantity-stepper {
  display: inline-grid;
  grid-template-columns: 24px 26px 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quantity-stepper button {
  min-height: 26px;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-weight: 900;
}

.quantity-stepper strong {
  text-align: center;
  font-size: 12px;
}

.inline-pay-total {
  padding: 6px 7px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

.inline-pay-total strong {
  color: var(--amber);
  font-size: 16px;
  white-space: nowrap;
}

.payment-methods.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.payment-methods.compact.count-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.payment-methods.compact.count-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-methods.compact.count-7,
.payment-methods.compact.count-8 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payment-methods.compact button {
  min-width: 0;
  min-height: 58px;
  padding: 6px 2px;
  font-size: 10px;
  gap: 4px;
  white-space: normal;
  line-height: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.payment-methods.compact button > span:last-child {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-methods.compact .account-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  font-size: 11px;
}

.payment-methods.compact .account-logo.okx {
  font-size: 7px;
}

.payment-methods.compact .account-logo.tp {
  font-size: 7px;
}

.account-logo.custom {
  background: linear-gradient(135deg, #06b6d4, #f59e0b);
  font-size: 9px;
}

.inline-confirm {
  width: fit-content;
  min-height: 30px;
  padding: 0 11px;
}

.selected-product {
  min-height: 74px;
  padding: 14px;
  display: grid;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.selected-product span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.selected-product strong {
  font-size: 18px;
}

.payment-methods {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payment-methods button {
  justify-content: center;
  min-height: 50px;
}

.payment-actions {
  display: flex;
  justify-content: flex-end;
}

.paybox {
  display: grid;
  gap: 12px;
}

.pay-help-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-help-actions button {
  min-height: 44px;
  font-size: 13px;
}

.change-qr-button {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  gap: 1px;
  color: #2b1a02;
  background: linear-gradient(180deg, #ffe27a, #f5b84b);
  border: 1px solid #ffd36a;
  box-shadow: 0 0 0 1px rgba(255, 226, 122, 0.38), 0 0 18px rgba(245, 184, 75, 0.34), 0 10px 24px rgba(245, 184, 75, 0.22);
  line-height: 1.15;
}

.change-qr-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 28%, rgba(255, 255, 255, 0.78) 47%, rgba(255, 255, 255, 0.38) 56%, transparent 72% 100%);
  transform: translateX(-120%);
  animation: changeQrPulse 1.65s ease-in-out infinite;
}

@keyframes changeQrPulse {
  0%, 58% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.change-qr-button span {
  position: relative;
  z-index: 1;
  color: #6a3d00;
  font-size: 11px;
  font-weight: 900;
}

.change-qr-button strong {
  position: relative;
  z-index: 1;
  color: #1f1302;
  font-size: 17px;
  font-weight: 900;
}

.change-qr-hint {
  min-height: 44px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  color: #f5b84b;
  background: rgba(245, 184, 75, 0.12);
  border: 1px solid rgba(245, 184, 75, 0.28);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.cashier-page .pay-fullscreen .paybox {
  gap: 8px;
}

.cashier-page .pay-fullscreen .pay-amount {
  min-height: 58px;
  padding: 10px 12px;
}

.cashier-page .pay-fullscreen .qr-meta {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(66, 210, 125, 0.12);
  border: 1px solid rgba(66, 210, 125, 0.32);
  border-radius: 8px;
  color: #42d27d;
}

.cashier-page .pay-fullscreen .qr-meta strong {
  display: none;
}

.cashier-page .pay-fullscreen .qr-meta span {
  display: block;
  overflow: hidden;
  color: #42d27d;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cashier-page .pay-fullscreen .info-row {
  min-height: 44px;
  padding: 8px 10px;
}

.cashier-page .pay-fullscreen #payPanel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.cashier-page .pay-fullscreen .pay-amount,
.cashier-page .pay-fullscreen .pay-exact-warning,
.cashier-page .pay-fullscreen .qr,
.cashier-page .pay-fullscreen .qr-stage,
.cashier-page .pay-fullscreen .qr-meta,
.cashier-page .pay-fullscreen .usdt-address-box,
.cashier-page .pay-fullscreen #orderStatus,
.cashier-page .pay-fullscreen .pay-help-actions,
.cashier-page .pay-fullscreen .delivery-box {
  grid-column: 1 / -1;
}

.cashier-page .pay-fullscreen #changeQrBtn {
  min-height: 44px;
}

.pay-amount {
  min-height: 82px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}

.pay-amount span {
  color: var(--amber);
  font-weight: 700;
}

.pay-amount strong {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: 38px;
  line-height: 1.1;
}

.pay-countdown {
  min-width: 104px;
  padding-left: 10px;
  display: grid;
  justify-items: end;
  gap: 3px;
  border-left: 1px solid rgba(245, 184, 75, 0.36);
}

.pay-countdown span {
  text-align: right;
  font-size: 11px;
  line-height: 1.2;
}

.pay-countdown strong {
  margin-top: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.pay-status {
  display: none;
}

.pay-exact-warning {
  margin-top: -4px;
  padding: 11px 12px;
  color: #ff6b6b;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.42);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

.qr {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.qr-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.qr-stage .qr {
  position: absolute;
  inset: 0;
}

.qr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background: #07131f;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.qr-loading-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.qr-loading strong {
  display: none;
}

.qr-loading.error .qr-loading-art {
  opacity: 0.3;
}

.qr-loading.error strong {
  position: absolute;
  inset: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
}

.qr.preview {
  max-width: 260px;
  justify-self: start;
}

.qr-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.qr-meta strong {
  color: var(--text);
}

.usdt-address-box {
  padding: 10px;
  display: grid;
  gap: 7px;
  background: #101319;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.usdt-address-box span {
  color: var(--muted);
  font-size: 12px;
}

.usdt-address-box strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-all;
}

.usdt-address-box button {
  width: 100%;
  min-height: 38px;
  background: #f5b84b;
  border-color: #f5b84b;
  color: #211706;
  font-weight: 900;
}

.info-row,
.status {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #eef2f7;
  color: var(--ink);
}

.status.ok {
  background: #dcfce7;
  color: var(--ok);
}

.status.warn {
  background: #fff7ed;
  color: var(--amber);
}

.status.danger {
  background: #fee2e2;
  color: var(--red);
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 24px;
}

.empty-state.compact {
  min-height: 240px;
  width: 100%;
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.admin-heading {
  align-items: center;
}

.app-admin {
  gap: 18px;
}

.admin-tab {
  display: none;
  gap: 18px;
  min-height: 0;
}

.admin-tab.active {
  display: grid;
}

.admin-tab[data-tab-panel="messages"].active {
  height: 100%;
}

.backend-actions {
  min-width: min(460px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 96px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 32px;
  line-height: 1;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid.wide-left {
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.6fr);
}

.product-inventory-module {
  max-width: 980px;
}

.payment-qrcode-module {
  max-width: 860px;
}

.payment-account-list {
  display: grid;
  gap: 7px;
  height: 500px;
  overflow-y: auto;
  padding-right: 2px;
  align-content: start;
  scrollbar-width: none;
}

.payment-account-list::-webkit-scrollbar {
  display: none;
}

.account-filter-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.account-filter-fixed,
.account-filter-shell .add-filter-action {
  flex: 0 0 auto;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 14px;
  white-space: nowrap;
}

.account-filter {
  display: flex;
  grid-template-columns: none;
  grid-auto-rows: auto;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
  padding-bottom: 2px;
  scrollbar-width: none;
  min-width: 0;
}

.account-filter.dragging {
  cursor: grabbing;
}

.account-filter::-webkit-scrollbar {
  display: none;
}

.account-filter button {
  flex: 0 0 auto;
  width: auto;
  min-width: 68px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 11px;
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

.category-select-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: center;
}

.category-select-row select,
.category-composer input {
  min-height: 36px;
}

.payment-account {
  min-height: 96px;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.payment-account.active {
  border-color: rgba(21, 128, 61, 0.35);
}

.payment-account.disabled {
  opacity: 0.78;
}

.payment-account.abnormal {
  border-color: rgba(248, 113, 113, 0.72);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.18);
}

.payment-account-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-content: center;
}

.payment-account-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.payment-account-body {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.payment-account-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.payment-account-qr {
  width: 46px;
  height: 46px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
}

.payment-account-title {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  min-width: 0;
}

.account-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.account-logo.alipay {
  background: #1677ff;
}

.account-logo.wechat {
  background: #07c160;
}

.account-logo.okx {
  background: #111827;
  font-size: 9px;
}

.account-logo.tp {
  background: #1677ff;
  font-size: 9px;
}

.payment-account-title strong {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.account-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.payment-account .pill {
  min-height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 900;
}

.payment-account-title .account-monitor-pill {
  flex: 0 0 auto;
}

.payment-account-payee {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-account-owner {
  color: #f7d476;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-account-address {
  display: none;
}

.payment-account-abnormal {
  max-width: 260px;
  margin-top: 2px;
  color: #ff6b6b;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-account-received,
.payment-account-amounts {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.payment-account-amounts {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.payment-account-amounts strong {
  color: var(--text);
  font-size: 15px;
}

.payment-account-health {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.payment-account-health span {
  min-height: 22px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
}

.payment-account-health strong {
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}
.payment-account-limit {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 42px;
  gap: 4px;
  align-items: center;
}

.payment-account-limit span {
  color: var(--muted);
  font-size: 11px;
}

.payment-account-limit input {
  width: 100%;
  min-height: 24px;
  padding: 0 6px;
  color: var(--text);
  background: #111419;
  border: 1px solid #343b47;
  border-radius: 8px;
  font-size: 11px;
}

.payment-account-limit button {
  min-height: 24px;
  padding: 0 6px;
  font-size: 11px;
}

.payment-account p,
.payment-account small {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.payment-account-actions {
  display: grid;
  align-content: center;
  gap: 5px;
}

.payment-account-actions button {
  min-width: 46px;
  min-height: 26px;
  padding: 0 7px;
  font-size: 12px;
}

button.danger-action {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

button.success-action {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

button.delete-action {
  border-color: #fecaca;
  background: #fff;
  color: var(--red);
  font-weight: 800;
}

.inline-empty {
  grid-column: 1 / -1;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100vw;
  max-width: 100vw;
  padding: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.38);
}

.modal-card {
  width: min(356px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head button {
  min-height: 34px;
  padding: 0 10px;
}

.app-dialog-card {
  width: min(100%, 320px);
}

.cashier-page .compact-confirm-dialog {
  width: min(280px, calc(100vw - 36px));
  min-height: 0;
  max-height: none;
  padding: 14px;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.cashier-page .compact-confirm-dialog .app-dialog-message {
  margin: 0 0 11px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.cashier-page .compact-confirm-dialog .app-dialog-actions {
  gap: 7px;
}

.cashier-page .compact-confirm-dialog .app-dialog-actions button {
  min-height: 36px;
  padding: 0 8px;
  font-size: 13px;
}

.app-dialog-message {
  margin: 0 0 14px;
  color: var(--text);
  white-space: pre-line;
  line-height: 1.5;
}

.password-dialog-copy {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.password-dialog-input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  background: #111419;
  border: 1px solid #343b47;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.password-dialog-input:focus {
  border-color: var(--green);
}

.app-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.app-dialog-actions button {
  width: 100%;
  min-height: 40px;
}

.app-dialog-actions #appDialogOk {
  background: #f5b84b;
  border-color: #f5b84b;
  color: #211706;
}

.app-dialog-actions #appDialogCancel {
  background: #20242b;
  border-color: #343b47;
  color: var(--text);
}

.app-dialog-actions #appDialogCancel.hidden + #appDialogOk {
  grid-column: 1 / -1;
}

.qrcode-composer {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.qrcode-form,
.qrcode-preview-box {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qrcode-preview-box {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.qrcode-preview-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.qrcode-preview-head strong {
  color: var(--text);
}

.inventory-composer {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.inventory-import {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inventory-side {
  display: grid;
  gap: 12px;
}

.inventory-summary {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(70px, 1fr));
  gap: 8px;
}

.inventory-summary div {
  min-height: 70px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inventory-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-summary strong {
  font-size: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.quick-list {
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quick-list button {
  min-height: 32px;
  font-size: 13px;
}

.monitor-list {
  display: grid;
  gap: 8px;
}

.monitor-item {
  min-height: 56px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.monitor-item strong,
.monitor-item span {
  display: block;
}

.monitor-item strong {
  font-size: 15px;
}

.monitor-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.monitor-item em {
  min-width: 64px;
  min-height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.monitor-item.online {
  border-color: rgba(66, 210, 125, 0.55);
}

.monitor-item.online em {
  background: rgba(66, 210, 125, 0.14);
  color: var(--ok);
}

.monitor-item.offline {
  opacity: 0.72;
}

.monitor-item.offline em {
  background: rgba(239, 68, 68, 0.14);
  color: #ff8a8a;
}

.monitor-console,
.monitor-events-panel {
  align-content: start;
}

.monitor-topline {
  min-height: 54px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.monitor-topline strong,
.monitor-topline span {
  display: block;
}

.monitor-topline strong {
  font-size: 15px;
}

.monitor-topline span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.monitor-topline button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.monitor-native-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.monitor-native-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.monitor-native-actions button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
}

.monitor-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.monitor-filter-bar button {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #20242c;
  font-size: 12px;
  font-weight: 900;
}

.monitor-filter-bar button.active {
  color: #fff;
  border-color: rgba(47, 209, 153, 0.55);
  background: rgba(47, 209, 153, 0.16);
}

.monitor-card-list {
  display: grid;
  gap: 9px;
}

.monitor-card {
  padding: 10px;
  display: grid;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.monitor-card.online {
  border-color: rgba(66, 210, 125, 0.55);
}

.monitor-card.offline {
  opacity: 0.78;
}

.monitor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.monitor-card-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.monitor-card-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.monitor-card-head em {
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  color: #ff8a8a;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.monitor-card.online .monitor-card-head em {
  background: rgba(66, 210, 125, 0.14);
  color: var(--ok);
}

.monitor-account-name {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.monitor-account-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.monitor-stats span {
  min-height: 34px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 12px;
}

.monitor-stats strong {
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.monitor-pending-list {
  display: grid;
  gap: 6px;
}

.monitor-pending-row,
.monitor-empty-line {
  min-height: 30px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  font-size: 12px;
}

.monitor-pending-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.monitor-pending-row small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #dce3ed;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.monitor-pending-row strong {
  color: #f7d476;
  white-space: nowrap;
}

.monitor-order-pay {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.monitor-empty-line {
  display: flex;
  color: var(--muted);
}

.monitor-test-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 76px;
  gap: 6px;
}

.monitor-test-form select,
.monitor-test-form input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.monitor-test-form button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.monitor-event-list {
  display: grid;
  gap: 7px;
}

.monitor-event {
  min-height: 54px;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.monitor-event > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.monitor-event strong {
  font-size: 13px;
}

.monitor-event span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.monitor-event.matched {
  border-color: rgba(66, 210, 125, 0.5);
}

.monitor-event.unmatched,
.monitor-event.manual {
  border-color: rgba(245, 184, 75, 0.35);
}

.monitor-log-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: none;
}

.log-filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.log-filter-bar button {
  min-height: 30px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.log-filter-bar button.active {
  border-color: rgba(245, 184, 75, 0.55);
  background: rgba(245, 184, 75, 0.16);
  color: var(--gold);
}

.monitor-log-list::-webkit-scrollbar {
  display: none;
}

.monitor-log {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.monitor-log.success {
  border-color: rgba(66, 210, 125, 0.5);
}

.monitor-log.warn {
  border-color: rgba(245, 184, 75, 0.45);
}

.monitor-log.error,
.monitor-log.danger {
  border-color: rgba(239, 68, 68, 0.55);
}

.monitor-log strong {
  display: block;
  font-size: 13px;
}

.monitor-log span,
.monitor-log small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.bottom-tabbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 30;
  width: min(520px, calc(100vw - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bottom-tabbar button {
  min-height: 38px;
  border: 0;
  background: transparent;
  font-weight: 800;
  padding: 0 2px;
  font-size: 11px;
  position: relative;
}

.bottom-tabbar button.active {
  background: var(--ink);
  color: #fff;
}

.admin-page .topbar {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  position: relative;
  display: none;
}

.admin-page .admin-shell {
  width: 100%;
  height: calc(100% - 90px);
  margin: 0;
  padding: 12px;
  overflow-y: auto;
  gap: 14px;
  scrollbar-width: none;
}

.admin-page .admin-shell::-webkit-scrollbar {
  display: none;
}

.admin-page .admin-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.admin-page .admin-heading h1 {
  font-size: 30px;
}

.admin-page .backend-actions {
  width: 100%;
  grid-template-columns: 1fr;
}

.admin-page .metric-grid {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-page .metric {
  min-height: 82px;
  padding: 12px;
}

.admin-page .metric strong {
  font-size: 24px;
}

.admin-page .admin-grid.two,
.admin-page .admin-grid.wide-left,
.admin-page .qrcode-composer,
.admin-page .inventory-composer,
.admin-page .inventory-summary {
  grid-template-columns: 1fr;
}

.admin-page .panel {
  padding: 14px;
}

.admin-page .payment-qrcode-module,
.admin-page .product-inventory-module {
  max-width: none;
}

.admin-page .table-wrap table {
  min-width: 520px;
}

.admin-page .bottom-tabbar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  width: auto;
  transform: none;
}

.admin-page .backend-actions {
  display: none;
}

.admin-page .home-copy,
.admin-page .payment-copy,
.admin-page .products-copy {
  display: none;
}

.admin-page .payment-account-toolbar {
  display: flex;
  justify-content: flex-end;
}

.admin-page .payment-qrcode-module > .payment-account-toolbar {
  display: none;
}

.admin-page .product-toolbar {
  height: 38px;
  align-items: center;
}

.admin-page .payment-account-toolbar .primary {
  min-height: 34px;
  padding: 0 14px;
}

.account-filter .add-filter-action {
  background: var(--green);
  border-color: var(--green);
  color: #061311;
  font-weight: 900;
}

.admin-page .product-toolbar .primary {
  height: 34px;
}

.product-inventory-module > .panel-head,
.product-inventory-module > .inventory-composer {
  display: none;
}

.product-inventory-module {
  align-content: start;
}

.product-manage-list {
  display: grid;
  gap: 8px;
}

.product-manage-card {
  min-height: 108px;
  padding: 10px;
  display: grid;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-manage-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.product-manage-main strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.product-manage-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.product-price-tag {
  color: #f7d476;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.product-stock-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.product-stock-row span {
  min-height: 34px;
  padding: 6px 8px;
  display: grid;
  align-content: center;
  background: #20242b;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
}

.product-stock-row strong {
  color: var(--text);
  font-size: 15px;
}

.product-manage-actions {
  display: flex;
  justify-content: flex-end;
}

.product-manage-actions button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.secret-count {
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(18, 165, 148, 0.12);
  color: var(--ok);
  font-size: 12px;
  font-weight: 900;
}

.admin-page .inline-action {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.orders-table-wrap {
  max-height: 560px;
  overflow: auto;
  scrollbar-width: none;
}

.orders-table-wrap::-webkit-scrollbar {
  display: none;
}

.orders-table-wrap table {
  min-width: 860px;
}

.orders-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.orders-table-wrap .mono {
  white-space: nowrap;
}

.orders-table-wrap th,
.orders-table-wrap td {
  white-space: nowrap;
  vertical-align: middle;
}

.orders-table-wrap .order-channel,
.orders-table-wrap .order-payee {
  min-width: 84px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--surface);
}

.table-wrap.compact table {
  min-width: 520px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.pill.ok {
  background: #dcfce7;
  color: var(--ok);
}

.pill.warn {
  background: #fff7ed;
  color: var(--amber);
}

.pill.danger {
  background: #fee2e2;
  color: var(--red);
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
  word-break: break-all;
}

#cardSecret {
  white-space: pre-line;
}

.delivery-box {
  margin-top: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: rgba(66, 210, 125, 0.12);
  border: 1px solid rgba(66, 210, 125, 0.34);
  border-radius: 8px;
}

.delivery-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.delivery-box strong {
  display: block;
  margin-top: 3px;
  color: var(--ok);
  font-size: 20px;
}

.delivery-box pre {
  min-height: 52px;
  max-height: 120px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(66, 210, 125, 0.22);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.delivery-box button {
  width: 100%;
  min-height: 52px;
}

.icon-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.order-record-panel {
  padding: 10px;
}

.order-record-panel .panel-head {
  margin-bottom: 8px;
}

.order-record-panel h2 {
  font-size: 15px;
}

.order-record-list {
  display: grid;
  gap: 6px;
}

.order-record {
  min-height: 46px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
  background: #171a20;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-record strong,
.order-record span {
  display: block;
}

.order-record strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.order-record .mono {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  word-break: normal;
  overflow-x: auto;
  text-overflow: clip;
  max-width: 100%;
  scrollbar-width: none;
}

.order-record .mono::-webkit-scrollbar {
  display: none;
}

.order-record .mono + span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.order-reply {
  margin-top: 5px;
  padding: 6px;
  color: var(--ok);
  background: rgba(66, 210, 125, 0.12);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.35;
}

.order-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 46px;
  gap: 6px;
}

.order-search input,
.order-search button {
  min-height: 34px;
  font-size: 12px;
}

.order-search-result {
  padding: 10px;
  display: grid;
  gap: 5px;
  background: #171a20;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.order-record > div:last-child {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 4px;
  justify-content: start;
  justify-items: start;
  align-items: center;
}

.order-record button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
}

.order-record .pill {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.order-record-empty {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #171a20;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.message-list {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  padding-bottom: 4px;
  overflow: hidden;
  scrollbar-width: none;
}

.message-list::-webkit-scrollbar {
  display: none;
}

.message-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.message-tools input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-size: 13px;
}

.message-filter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.message-filter button {
  min-height: 32px;
  padding: 0 6px;
  font-size: 12px;
}

.message-card {
  min-height: 0;
  padding: 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  background: #141820;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chat-avatar-strip {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.chat-avatar-strip::-webkit-scrollbar {
  display: none;
}

.chat-avatar {
  position: relative;
  width: 76px;
  min-width: 76px;
  height: 72px;
  padding: 7px 5px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--text);
  background: #18202c;
  border: 1px solid #344154;
  border-radius: 8px;
}

.chat-avatar.active {
  color: #201504;
  background: linear-gradient(145deg, #ffe27a, #e3a623);
  border-color: #ffe27a;
  box-shadow: 0 8px 20px rgba(245, 184, 75, 0.24);
}

.chat-avatar span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.chat-avatar strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.chat-avatar em {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.message-conversation {
  min-height: 0;
  background: #141820;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.message-conversation.open {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-color: rgba(47, 209, 153, 0.5);
}

.chat-session-head {
  min-height: 64px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-session-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-session-head strong,
.chat-session-head small,
.chat-session-head span:not(.pill) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-head strong {
  font-size: 15px;
}

.chat-session-head span:not(.pill) {
  color: var(--muted);
  font-size: 11px;
}

.message-conversation .message-thread {
  min-height: 96px;
  max-height: none;
  padding: 8px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.message-conversation .message-reply-form {
  padding: 8px;
}

.message-action-row {
  padding: 7px 12px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.message-action-row button,
.message-deliver-btn {
  width: 100%;
  min-height: 34px;
}

.message-clear-btn:only-child {
  grid-column: 1 / -1;
}

.message-page {
  height: 100%;
  min-height: 0;
  display: grid;
  gap: 12px;
}

.message-page .panel {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  overflow: hidden;
}

.message-page .message-list {
  min-height: 0;
}

.admin-tab[data-tab-panel="messages"] .message-page .panel {
  padding-bottom: 4px;
}

.profile-panel {
  min-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  align-content: start;
}

.profile-panel #logoutBtn {
  width: 100%;
  order: 99;
  margin-top: auto;
}

.site-manager {
  gap: 10px;
}

.site-manager-list {
  display: grid;
  gap: 8px;
}

.site-manager-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.site-manager-item.active {
  border-color: #e2aa00;
  box-shadow: inset 3px 0 0 #f2b705;
}

.site-manager-head,
.site-manager-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-manager-head {
  justify-content: space-between;
  margin-bottom: 7px;
}

.site-current {
  padding: 2px 7px;
  border-radius: 999px;
  color: #6b4f00;
  background: #ffe08a;
  font-size: 11px;
  font-weight: 700;
}

.site-address {
  width: 100%;
  padding: 7px 8px;
  overflow: hidden;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-manager-actions {
  margin-top: 8px;
}

.site-manager-actions > * {
  min-width: 0;
  height: 34px;
  flex: 1;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-decoration: none;
}

/* Use the whole available viewport when the H5 page is opened on a phone. */
@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
  }

  body.cashier-page,
  body.admin-page {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    display: block;
    background: var(--bg);
  }

  .phone-frame {
    width: 100vw;
    max-width: none;
    min-height: 100dvh;
    height: 100dvh;
    border: 0;
    box-shadow: none;
  }
}

.voice-settings {
  gap: 10px;
}

.compact-head {
  margin-bottom: 0;
}

.voice-prompt-list {
  display: grid;
  gap: 8px;
}

.voice-prompt-row {
  min-height: 52px;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px 48px 52px 46px;
  gap: 6px;
  align-items: center;
  background: #141820;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.voice-prompt-row strong,
.voice-prompt-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-prompt-row strong {
  font-size: 13px;
}

.voice-prompt-row span {
  color: var(--muted);
  font-size: 11px;
}

.voice-prompt-row button,
.voice-upload,
.voice-switch {
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #343b47;
  border-radius: 8px;
  background: #20242b;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.voice-switch {
  cursor: pointer;
}

.voice-switch input,
.voice-upload input {
  display: none;
}

.voice-switch:has(input:checked) {
  background: var(--green);
  border-color: var(--green);
  color: #061311;
}

.voice-upload {
  cursor: pointer;
}

.message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.message-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.message-head span:not(.pill) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.message-thread {
  min-height: 0;
  max-height: 420px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}

.message-system-card {
  max-width: 96%;
  padding: 9px 11px;
  display: grid;
  gap: 3px;
  justify-self: start;
  color: #ffe88a;
  background: rgba(245, 184, 75, 0.14);
  border: 1px solid rgba(245, 184, 75, 0.32);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.message-system-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread::-webkit-scrollbar {
  display: none;
}

.message-bubble {
  width: fit-content;
  max-width: 82%;
  padding: 8px 10px;
  margin: 0;
  display: grid;
  gap: 3px;
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.message-bubble small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.message-bubble.user {
  justify-self: start;
  background: #20242c;
}

.message-bubble.admin {
  justify-self: end;
  color: #08221a;
  background: #2fd199;
  font-weight: 800;
}

.message-bubble .message-image {
  max-width: 160px;
  max-height: 130px;
  border-color: rgba(0, 0, 0, 0.18);
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.faq-list button {
  min-height: 32px;
  padding: 0 6px;
  font-size: 12px;
}

.message-image-preview,
.message-image {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  background: #0f1116;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message-image {
  max-width: min(78%, 210px);
  justify-self: start;
  cursor: zoom-in;
}

.customer-message-history {
  min-height: 260px;
  max-height: 360px;
  margin-bottom: 0;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  background: #101319;
  border: 1px solid #303641;
  border-radius: 8px;
  scrollbar-width: none;
}

.customer-chat-card {
  width: min(356px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.customer-message-form {
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.customer-chat-input {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px 62px;
  gap: 7px;
  align-items: center;
}

.customer-chat-input input[type="text"] {
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: #0f1218;
  border: 1px solid #303641;
  border-radius: 8px;
  outline: none;
}

.customer-chat-input button[type="submit"] {
  min-height: 40px;
}

.customer-system-card {
  justify-self: start;
  max-width: 100%;
}

.customer-message-history::-webkit-scrollbar {
  display: none;
}

.customer-message-row {
  width: fit-content;
  max-width: 84%;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.customer-message-row small {
  color: var(--muted);
  font-size: 10px;
}

.customer-message-row.user {
  justify-self: end;
  color: #061311;
  background: #f5b84b;
  font-weight: 800;
}

.customer-message-row.admin {
  justify-self: start;
  background: #20242c;
}

.customer-message-row img {
  max-width: 150px;
  max-height: 130px;
  object-fit: contain;
  border-radius: 8px;
}

.customer-message-empty {
  min-height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

body.cashier-page .modal-layer {
  padding: 0;
  place-items: stretch;
}

body.cashier-page .customer-chat-card {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

body.cashier-page .customer-chat-card,
body.cashier-page .customer-chat-card * {
  min-width: 0;
}

body.cashier-page .modal-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.cashier-page .customer-message-history {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
}

body.cashier-page .customer-system-card,
body.cashier-page .message-system-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

body.cashier-page .message-system-card span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.cashier-page .faq-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

body.cashier-page .faq-list button {
  min-width: 0;
  min-height: 30px;
  padding: 0 4px;
  white-space: nowrap;
  line-height: 1;
  font-size: clamp(10px, 2.7vw, 12px) !important;
}

body.cashier-page .customer-chat-input {
  grid-template-columns: 28px minmax(0, 1fr) 28px 46px;
  gap: 5px;
  overflow: hidden;
}

body.cashier-page .customer-chat-input input[type="text"] {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  font-size: 14px;
  border-radius: 7px;
}

body.cashier-page .customer-chat-input button {
  min-width: 0;
}

body.cashier-page .customer-chat-input .chat-icon-btn {
  width: 28px;
  min-height: 28px !important;
  height: 28px;
  font-size: 13px !important;
  border-radius: 50%;
}

body.cashier-page .customer-chat-input button[type="submit"] {
  width: 46px;
  min-height: 32px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 13px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 6, 12, 0.86);
}

.image-lightbox img {
  max-width: min(92vw, 420px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 8px;
  background: #0f1116;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  cursor: zoom-out;
}

.message-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-input-bar {
  position: relative;
  grid-template-columns: 40px minmax(0, 1fr) 40px 62px;
  align-items: center;
  padding: 8px 10px 10px;
  background: #0d1118;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.emoji-panel {
  position: absolute;
  left: 10px;
  bottom: 56px;
  z-index: 5;
  width: 210px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #151b26;
  border: 1px solid #313b50;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.emoji-panel button {
  min-height: 32px !important;
  padding: 0 6px !important;
  color: var(--text);
  background: #20283a;
  border: 1px solid #313b50;
  border-radius: 8px;
  font-size: 12px !important;
  font-weight: 900;
}

.chat-icon-btn {
  min-height: 38px !important;
  border-radius: 50%;
  padding: 0 !important;
  background: #20283a;
  border: 1px solid #313b50;
  color: var(--text);
  font-size: 18px !important;
}

.message-reply-form input,
.message-reply-form button {
  min-height: 34px;
  font-size: 12px;
}

.message-reply-form input {
  border-radius: 8px;
  background: #0f1218;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .cashier-shell,
  .admin-grid.two,
  .admin-grid.wide-left,
  .qrcode-composer,
  .inventory-composer {
    grid-template-columns: 1fr;
  }

  .cashier-shell.pay-fullscreen {
    grid-template-columns: minmax(0, 480px);
    justify-content: center;
  }

  .pay-dock {
    position: static;
  }
}

@media (max-width: 780px) {
  .topbar,
  .cashier-heading,
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 14px 16px;
  }

  .cashier-shell,
  .admin-shell {
    width: min(100% - 24px, 1240px);
    margin-top: 18px;
  }

  .segmented.four,
  .payment-methods,
  .product-grid,
  .metric-grid,
  .inventory-summary,
  .field-grid,
  .backend-actions {
    grid-template-columns: 1fr;
  }

  .pay-amount strong {
    font-size: 32px;
  }
}

.cashier-page .product-grid {
  grid-template-columns: 1fr 1fr;
}

/* Compact dark mobile theme */
:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #181b20;
  --surface-2: #20242b;
  --text: #f5f7fb;
  --muted: #9ba6b6;
  --line: #303641;
  --ink: #eef2f7;
  --green: #12a594;
  --green-strong: #0f8f80;
  --blue: #4f8cff;
  --amber: #f5b84b;
  --red: #ef4444;
  --ok: #42d27d;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

body,
body.cashier-page,
body.admin-page {
  background: #0b0c0f;
}

.phone-frame {
  background: var(--bg);
  border-color: #20242b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.topbar {
  background: rgba(16, 17, 20, 0.92);
  border-color: var(--line);
}

.admin-page .admin-tab > .admin-heading {
  display: none;
}

.admin-page .admin-shell,
.cashier-page .cashier-shell {
  padding: 10px;
  gap: 12px;
}

.cashier-page .cashier-shell {
  padding-bottom: 18px;
}

.panel,
.card,
.metric,
.product,
.payment-account,
.product-manage-card,
.selected-product,
.inventory-import,
.qrcode-form,
.qrcode-preview-box,
.inventory-summary div,
.empty-state {
  background: linear-gradient(180deg, #1b1f26 0%, #16191f 100%);
  border-color: var(--line);
  box-shadow: none;
}

.panel {
  padding: 12px;
}

.admin-page .panel {
  padding: 12px;
}

.metric-grid,
.admin-page .metric-grid,
.product-grid,
.cashier-page .product-grid {
  gap: 8px;
}

.metric {
  min-height: 74px;
  padding: 11px;
  border-left: 3px solid rgba(18, 165, 148, 0.9);
}

.metric span,
label,
.panel-head p,
.muted,
.product p,
.payment-account p,
.payment-account small,
.qr-meta,
.selected-product span,
.inline-pay-top span,
.quantity-line span,
.inline-pay-total span {
  color: var(--muted);
}

.metric strong,
.price,
.qr-meta strong,
.qrcode-preview-head strong {
  color: var(--text);
}

.cashier-page .product-panel {
  padding: 8px;
}

.cashier-page .product {
  min-height: 148px;
  padding: 10px;
  border-color: #343b47;
}

.cashier-page .product.has-inline-pay {
  grid-column: 1 / -1;
}

.cashier-page .product.has-inline-pay [data-buy] {
  display: none;
}

.inline-pay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inline-pay-actions button {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-size: 18px;
}

.cashier-page .product .inline-pay-actions button,
.cashier-page .product .inline-pay-actions .inline-confirm {
  width: 100%;
  min-height: 60px;
  padding: 0;
}

.inline-pay-actions .inline-confirm {
  background: #f5b84b;
  border-color: #f5b84b;
  color: #211706;
}

.inline-cancel {
  background: #20242b;
  border-color: #343b47;
  color: #dce3ed;
  font-weight: 900;
}

.cashier-page .product h3 {
  font-size: 14px;
}

.cashier-page .product p {
  font-size: 11px;
}

.cashier-page .price {
  color: #f7d476;
  font-size: 20px;
}

.nav a,
button {
  background: #20242b;
  border-color: #343b47;
  color: var(--text);
}

.nav a:hover,
button:hover {
  border-color: #4a5363;
}

button.primary,
.admin-page .inline-action {
  background: var(--green);
  border-color: var(--green);
  color: #061311;
  font-weight: 900;
}

button.primary:hover,
.admin-page .inline-action:hover {
  background: var(--green-strong);
  color: #ffffff;
}

.segmented {
  gap: 6px;
}

.segmented button,
.account-filter button {
  background: #171a20;
  border-color: #303641;
  color: #dce3ed;
}

.segmented button.active,
.bottom-tabbar button.active {
  background: #e7eef8;
  color: #111827;
  border-color: #e7eef8;
}

.account-filter-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.account-filter {
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
  scrollbar-width: none;
}

.account-filter::-webkit-scrollbar {
  display: none;
}

.account-filter button {
  flex: 0 0 auto;
  min-width: 68px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
}

.account-filter-fixed,
.account-filter-shell .add-filter-action {
  flex: 0 0 auto;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 14px;
  white-space: nowrap;
}

.payment-account-list {
  gap: 7px;
  height: calc(100vh - 160px);
  max-height: 620px;
  padding-right: 0;
}

.payment-account {
  min-height: 96px;
  padding: 6px 8px;
  background: #171a20;
  border-color: #313846;
}

.payment-account.active {
  border-color: rgba(18, 165, 148, 0.75);
}

.payment-account-qr,
.qr {
  background: #fff;
  border-color: #475161;
}

.account-logo.okx {
  background: #05070a;
}

.account-logo.tp {
  background: #1677ff;
}

button.danger-action {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

button.success-action {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

button.delete-action {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ff8a8a;
}

.bottom-tabbar {
  background: rgba(23, 26, 32, 0.96);
  border-color: #343b47;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

.bottom-tabbar button {
  color: #d9e1ed;
  border-radius: 8px;
}

.nav-badge {
  position: absolute;
  right: 3px;
  top: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #f8fafc;
  color: #111827;
  font-size: 10px;
  font-weight: 900;
}

.info-row,
.status {
  background: #20242b;
  color: var(--text);
}

.status.ok,
.pill.ok {
  background: rgba(66, 210, 125, 0.14);
  color: var(--ok);
}

.status.warn,
.pill.warn,
.inline-pay-total,
.pay-amount {
  background: rgba(245, 184, 75, 0.13);
  border-color: rgba(245, 184, 75, 0.32);
  color: #ffd98b;
}

.status.danger,
.pill.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ff8a8a;
}

.pay-amount span,
.pay-amount strong,
.inline-pay-total strong {
  color: #f7d476;
}

.pay-amount .pay-countdown strong {
  margin-top: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.inline-pay-popover {
  background: #111419;
  border-color: #333b48;
  box-shadow: none;
}

body.admin-page .phone-frame {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  border: 0;
  box-shadow: none;
}

body.cashier-page .phone-frame {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  border: 0;
  box-shadow: none;
}

body.cashier-page .cashier-shell {
  height: calc(100dvh - 58px);
}

body.cashier-page .cashier-shell.pay-fullscreen {
  height: 100dvh;
}

@supports (height: 100dvh) {
  body.cashier-page {
    width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  body.cashier-page .phone-frame {
    width: 100vw !important;
    min-width: 0;
    height: 100dvh !important;
    margin: 0;
  }

  body.cashier-page .topbar,
  body.cashier-page .cashier-shell {
    width: 100vw;
  }
}

body.admin-page .calculator-gate {
  padding: max(10px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom));
  grid-template-rows: minmax(96px, 1fr) auto;
}

body.admin-page .calc-grid {
  gap: clamp(8px, 2.4vw, 13px);
}

body.admin-page .calc-grid button {
  font-size: clamp(24px, 8vw, 34px);
}

body.admin-page .calc-grid button.op {
  font-size: clamp(30px, 9vw, 42px);
}

body.cashier-page.paying .topbar {
  display: none !important;
}

body.cashier-page.paying {
  overflow-y: auto;
}

body.cashier-page.paying .phone-frame {
  height: auto !important;
  min-height: 100dvh;
  overflow: visible;
}

body.cashier-page.paying .cashier-shell.pay-fullscreen {
  height: auto !important;
  min-height: 100dvh;
  padding: 8px 10px max(18px, env(safe-area-inset-bottom));
  overflow: visible;
}

body.cashier-page.paying .pay-dock {
  min-height: calc(100dvh - max(26px, env(safe-area-inset-bottom)));
  padding: 10px 10px 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  overflow: visible;
}

body.cashier-page.paying .pay-dock .panel-head {
  min-height: 0;
  margin: 0;
  align-items: center;
  gap: 8px;
}

body.cashier-page.paying #dockTitle {
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
}

body.cashier-page.paying #closePayDock {
  min-width: 52px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: 10px;
}

body.cashier-page.paying #dockSubtitle {
  display: none;
}

body.cashier-page.paying .paybox {
  min-height: 0;
  max-height: none;
  gap: 7px;
  align-content: start;
  overflow: visible;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

body.cashier-page.paying .pay-amount {
  min-height: 54px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

body.cashier-page.paying .pay-amount > div:first-child {
  min-width: 0;
}

body.cashier-page.paying .pay-amount span {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

body.cashier-page.paying .pay-amount strong {
  margin-top: 2px;
  font-size: 30px !important;
  line-height: 1;
  white-space: nowrap;
}

body.cashier-page.paying .pay-amount strong.long-amount {
  font-size: 27px !important;
}

body.cashier-page.paying .pay-countdown {
  min-width: 96px;
  padding-left: 0;
  gap: 2px;
  border-left: 0;
}

body.cashier-page.paying .pay-countdown span {
  font-size: 10px;
  line-height: 1.05;
  white-space: nowrap;
  color: #ff6b6b;
}

body.cashier-page.paying .pay-countdown strong {
  font-size: 18px !important;
  line-height: 1;
  color: #ff4d4f;
}

body.cashier-page.paying .pay-exact-warning {
  margin-top: 0;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.18;
  font-weight: 800;
}

body.cashier-page.paying .qr {
  width: min(100%, 236px);
  max-width: 236px !important;
  padding: 7px;
  justify-self: center;
}

body.cashier-page.paying #orderStatus {
  display: none !important;
}

body.cashier-page.paying .usdt-address-box {
  padding: 7px 8px;
  gap: 5px;
}

body.cashier-page.paying .usdt-address-box strong {
  font-size: 12px;
  line-height: 1.2;
}

body.cashier-page.paying .pay-help-actions {
  gap: 6px;
  margin-bottom: max(8px, env(safe-area-inset-bottom));
}

body.cashier-page.paying .pay-help-actions button {
  min-height: 52px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.15;
}

body.cashier-page.paying #changeQrBtn span {
  font-size: 10px;
  line-height: 1.05;
  white-space: nowrap;
}

body.cashier-page.paying #changeQrBtn strong {
  font-size: 14px;
  line-height: 1.05;
}

@media (max-height: 760px) {
  body.cashier-page.paying .pay-amount {
    min-height: 50px;
    padding: 7px 8px;
  }

  body.cashier-page.paying .pay-amount strong {
    font-size: 27px !important;
  }

  body.cashier-page.paying .pay-exact-warning {
    padding: 5px 7px;
    font-size: 11px;
  }

  body.cashier-page.paying .qr {
    width: min(100%, 210px);
    max-width: 210px !important;
  }

  body.cashier-page.paying .pay-help-actions button {
    min-height: 46px;
  }
}

body.admin-page .calc-display {
  min-height: 64px;
  font-size: clamp(42px, 16vw, 72px);
}

.quantity-stepper {
  background: #20242b;
  border-color: #343b47;
}

input,
select,
textarea {
  background: #111419;
  border-color: #343b47;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #737f90;
}

.modal-layer {
  background: rgba(0, 0, 0, 0.58);
}

.modal-card {
  background: #181b20;
  border-color: #343b47;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

.table-wrap {
  background: #12151a;
  border-color: #303641;
}

table {
  background: #15181e;
}

th {
  background: #20242b;
  color: #aeb8c8;
}

td {
  border-color: #303641;
}

.pill {
  background: #252a33;
  color: #e7eef8;
}

.account-filter .add-filter-action {
  background: var(--green);
  border-color: var(--green);
  color: #061311;
  font-size: 12px;
  font-weight: 900;
}

.payment-methods.compact button:disabled {
  opacity: 1;
  background: #2a2e35;
  border-color: #343a44;
  color: #6f7a89;
  cursor: not-allowed;
}

.payment-methods.compact button:disabled .account-logo {
  filter: grayscale(1);
  opacity: 0.55;
}

.inline-confirm:disabled {
  opacity: 1;
  background: #2a2e35;
  border-color: #343a44;
  color: #6f7a89;
}


.payment-account {
  min-height: 128px;
  overflow: visible;
}

.payment-account-main {
  align-content: start;
}

.payment-account-info {
  gap: 4px;
}

.payment-account-limit {
  margin-top: 1px;
}


.system-health-panel {
  gap: 10px;
}

.system-health-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.system-health-item {
  min-height: 62px;
  padding: 8px;
  display: grid;
  gap: 3px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.system-health-item span,
.system-health-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-health-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-health-item.ok {
  border-color: rgba(66, 210, 125, 0.35);
  background: rgba(66, 210, 125, 0.08);
}

.system-health-item.warn {
  border-color: rgba(245, 184, 75, 0.35);
  background: rgba(245, 184, 75, 0.08);
}

.system-health-item.danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
