:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: rgba(20, 32, 48, .11);
  --accent: #1475f6;
  --accent-strong: #075bd8;
  --accent-soft: #e8f1ff;
  --danger: #dc2626;
  --soft: rgba(255, 255, 255, .64);
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow-soft: 0 24px 80px rgba(22, 37, 61, .12);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(20, 117, 246, .18), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(125, 167, 255, .18), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 48%, #edf3fa 100%);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.public-shell { min-height: 100vh; padding: 22px; }
.admin-shell { min-height: 100vh; display: grid; place-items: start center; padding: 28px 18px; }
.public-hero, .public-workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
}
.public-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 34px;
  padding: 18px clamp(18px, 4vw, 46px) clamp(30px, 5vw, 58px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .48)),
    rgba(255, 255, 255, .62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}
.public-hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -42% auto;
  width: min(520px, 70vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .96), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(20, 117, 246, .22), rgba(20, 117, 246, 0) 62%);
  pointer-events: none;
}
.public-hero.compact { padding-bottom: clamp(28px, 5vw, 48px); }
.public-nav {
  position: relative;
  z-index: 1;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-lockup, .nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 760;
}
.brand-lockup { gap: 10px; color: #1b2738; }
.brand-orb {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #62a1ff);
  box-shadow: 0 12px 30px rgba(20, 117, 246, .28), inset 0 1px 0 rgba(255,255,255,.38);
  font-size: 13px;
}
.nav-link, .small-link {
  border: 1px solid rgba(20, 32, 48, .08);
  padding: 10px 15px;
  border-radius: 999px;
  color: #1e4f93;
  background: rgba(255, 255, 255, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  white-space: nowrap;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(22px, 6vw, 76px);
  align-items: end;
  padding-top: clamp(28px, 7vw, 74px);
}
.public-hero.compact .hero-grid { grid-template-columns: minmax(0, 760px); }
.hero-kicker {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}
h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1.08;
  font-weight: 720;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero-text {
  max-width: 620px;
  margin: 22px 0 0;
  color: #415064;
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.75;
  text-wrap: pretty;
}
.hero-status {
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius-md);
  padding: 18px;
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 50px rgba(28, 53, 82, .1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.hero-status div { display: flex; align-items: center; gap: 10px; }
.hero-status p { margin: 10px 0 0; font-size: 14px; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2fd166;
  box-shadow: 0 0 0 6px rgba(47, 209, 102, .16);
}
.public-workspace {
  display: grid;
  grid-template-columns: minmax(0, .98fr) minmax(360px, .82fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.public-workspace.single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.instruction-panel, .submit-panel, .admin-card, .admin-login {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgba(28, 53, 82, .09);
  padding: clamp(18px, 3vw, 26px);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}
.admin-card, .admin-login { width: min(100%, 1180px); min-width: 0; }
.public-card { width: min(100%, 980px); background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 80px rgba(31,54,78,.12); padding: 24px; }
.public-head, .admin-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.brand-mark { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), #4f46e5); font-weight: 800; margin-bottom: 12px; }
h2 { margin: 0 0 10px; }
p { color: var(--muted); line-height: 1.6; }
.section-title { margin-bottom: 18px; }
.section-title h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.035em; text-wrap: balance; }
.soft-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 780;
}

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 22px; }
.ios-stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step {
  position: relative;
  border: 1px solid rgba(20, 32, 48, .08);
  border-radius: 18px;
  padding: 14px 10px 14px 44px;
  background: rgba(255,255,255,.56);
  color: #667386;
  font-weight: 720;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.step::before {
  content: attr(data-step-dot);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
}
.step.active { border-color: rgba(20,117,246,.22); color: var(--accent-strong); background: rgba(232,241,255,.72); }

.guide-panel, .panel-box, .status-panel, .result-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--soft); padding: 18px; margin-bottom: 18px; }
.guide-list { display: grid; gap: 10px; }
.guide-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(20, 32, 48, .08);
  border-radius: 20px;
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.guide-row:first-of-type { border-top: 0; }
.guide-row strong { color: #182334; }
.guide-row p { margin: 5px 0 0; font-size: 14px; }
.guide-num { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }

.form-stack { display: grid; gap: 16px; }
label span, .email-grid label { font-weight: 700; color: #263952; }
label { display: grid; gap: 8px; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(20, 32, 48, .12);
  border-radius: 18px;
  padding: 14px 15px;
  font: inherit;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}
textarea { resize: vertical; font-family: Consolas, "Microsoft YaHei", monospace; }
input::placeholder, textarea::placeholder { color: #748197; }
input:focus, textarea:focus, select:focus { border-color: rgba(20,117,246,.62); box-shadow: 0 0 0 4px rgba(20,117,246,.13), inset 0 1px 0 rgba(255,255,255,.9); background: #fff; }
.btn {
  border: 1px solid rgba(20, 32, 48, .1);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,255,255,.78);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(28, 53, 82, .12); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .58; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, #2184ff, var(--accent)); border-color: rgba(20,117,246,.2); color: #fff; box-shadow: 0 14px 34px rgba(20,117,246,.24), inset 0 1px 0 rgba(255,255,255,.32); }
.btn.secondary { color: #17324c; }
.btn.danger { color: #b91c1c; border-color: rgba(220,38,38,.18); background: rgba(254,226,226,.7); }
.btn.wide { width: 100%; padding: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); margin: 0; }
.inline-hint { margin: 10px 0 14px; padding: 12px 14px; border-radius: 12px; background: #eef7f5; color: #245f55; line-height: 1.55; }
.routing-overflow-box {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid #dbe8f2;
  border-radius: 14px;
  background: #f8fbfd;
}
.routing-overflow-box > label:first-child {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.routing-overflow-box label span { display: grid; gap: 3px; }
.routing-overflow-box label small { color: #6f8091; font-weight: 500; line-height: 1.45; }
.routing-overflow-threshold {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #52677c;
  font-size: 13px;
}
.routing-overflow-threshold input { width: 74px; padding: 8px 10px; }
.query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-bottom: 18px; align-items: end; }
.query-field { display: grid; gap: 8px; }
.status-top { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.badge { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }
.badge.success { background: #dcfce7; color: #047857; }
.badge.manual { background: #fee2e2; color: #b91c1c; }
.progress-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 18px 0; }
.progress-list li { border: 1px solid rgba(20, 32, 48, .08); background: rgba(255,255,255,.66); border-radius: 16px; padding: 13px 14px; color: var(--muted); }
.progress-list li.done { color: #4f647d; background: rgba(255,255,255,.78); }
.progress-list li.active { border-color: rgba(20,117,246,.34); color: var(--accent-strong); font-weight: 800; background: var(--accent-soft); }
.progress-list li.error { border-color: rgba(220,38,38,.24); color: #b91c1c; background: rgba(254,226,226,.72); }
.manual-action-box {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(220, 38, 38, .16);
  border-radius: 16px;
  background: #fff;
}
.manual-action-box strong { color: #3a3030; }
.manual-action-box p { margin: 5px 0 0; font-size: 13px; }
.manual-action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.manual-action-buttons .btn { width: 100%; }
.manual-action-buttons .btn.danger { color: #b42318; background: #fff6f5; }
.invoice-box { border-top: 1px solid var(--line); padding-top: 16px; }
.invoice-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 32, 48, .08);
  margin: 12px 0 8px;
}
.invoice-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2b7f6d, #53b49f);
  transition: width .55s ease;
}
.invoice-percent { margin: 0 0 14px; font-size: 14px; }
.card-status-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.card-status-item {
  border: 1px solid rgba(20, 32, 48, .08);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
}
.card-status-item.unused {
  border-color: rgba(5, 150, 105, .22);
  background: rgba(236, 253, 245, .72);
}
.card-status-item.success {
  border-color: rgba(20, 117, 246, .22);
  background: rgba(232, 241, 255, .72);
}
.card-status-item.used {
  border-color: rgba(245, 158, 11, .24);
  background: rgba(255, 251, 235, .72);
}
.card-status-item.danger {
  border-color: rgba(220, 38, 38, .22);
  background: rgba(254, 226, 226, .72);
}
.card-status-main {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.card-status-main code {
  overflow-wrap: anywhere;
  word-break: break-all;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-weight: 800;
}
.card-status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}
.card-status-pill.unused { background: #dcfce7; color: #047857; }
.card-status-pill.success { background: #dbeafe; color: #1d4ed8; }
.card-status-pill.used { background: #fef3c7; color: #a16207; }
.card-status-pill.danger { background: #fee2e2; color: #b91c1c; }
.card-status-item p {
  margin: 8px 0 0;
  color: #415064;
}
.card-status-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.card-status-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
}
.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, .92);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .22);
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.admin-toast.success {
  background: rgba(4, 120, 87, .94);
}
.result-panel, .status-panel {
  margin-top: 18px;
  margin-bottom: 0;
  border-color: rgba(20,117,246,.18);
  background: rgba(232,241,255,.64);
}
.result-panel.error {
  border-color: rgba(220,38,38,.2);
  background: rgba(254,226,226,.72);
}
.result-panel.error h2,
.result-panel.error p { color: #991b1b; }
.result-panel.success {
  border-color: rgba(5,150,105,.2);
  background: rgba(236,253,245,.72);
}
.result-panel.success h2 { color: #047857; }

.admin-shell { place-items: start center; }
.admin-actions, .tabs, .toolbar, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 12px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 18px; font-weight: 800; cursor: pointer; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-grid div { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 18px; }
.stats-grid span { color: #4a5d77; font-weight: 700; }
.stats-grid strong { display: block; font-size: 34px; margin-top: 10px; }
.toolbar { margin-bottom: 14px; }
.toolbar input { flex: 1 1 360px; }
.toolbar select { width: 160px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid #e8eef5; vertical-align: top; }
th { color: #465977; font-size: 13px; background: #fbfdff; }
td { font-size: 14px; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-weight: 800; background: #edf5f2; color: #047857; }
.status-pill.pending { background: #fef3c7; color: #a16207; }
.status-pill.processing { background: #dbeafe; color: #1d4ed8; }
.status-pill.failed, .status-pill.session_expired, .status-pill.cancelled, .status-pill.destroyed { background: #fee2e2; color: #b91c1c; }

.manual-reason {
  display: inline-block;
  max-width: 260px;
  color: #b42318;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.cell-actions { display: grid; gap: 8px; }
.mini { padding: 7px 10px; font-size: 13px; }
.order-card-key-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 220px;
}
.order-card-key {
  display: inline-block;
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.45;
}
.order-card-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* 充值任务字段很多，详情允许横向滚动，但关键操作始终固定在右侧。 */
.orders-table {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
}
.orders-table table { min-width: 100%; table-layout: fixed; }
.orders-table th:nth-child(1) { width: 11%; }
.orders-table th:nth-child(2) { width: 14%; }
.orders-table th:nth-child(3) { width: 17%; }
.orders-table th:nth-child(4) { width: 15%; }
.orders-table th:nth-child(5) { width: 10%; }
.orders-table th:nth-child(6) { width: 18%; }
.orders-table th:nth-child(7) { width: 15%; }
.orders-table th:last-child,
.orders-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 168px;
  background: #fff;
  box-shadow: -10px 0 18px -18px rgba(15, 23, 42, .8);
}
.orders-table th:last-child {
  z-index: 3;
  background: #fbfdff;
}
.orders-table td[data-label="充值账号"] {
  min-width: 0;
  max-width: none;
  overflow-wrap: anywhere;
}
.orders-table td[data-label="处理原因"] { min-width: 0; }
.orders-table .manual-reason { max-width: none; }
.orders-table .order-card-key-wrap { min-width: 0; }
.orders-table .order-card-key { max-width: 100%; }
.orders-table .cell-actions .btn { width: 100%; margin: 0; }
.order-status-route,
.order-time-stack,
.order-result-stack { display: grid; gap: 6px; }
.order-status-route { min-width: 0; justify-items: start; }
.order-time-stack { min-width: 0; }
.order-time-stack span,
.order-result-stack span { display: grid; gap: 2px; }
.order-time-stack small,
.order-result-stack small { color: #7b8797; font-size: 11px; font-weight: 750; }
.order-result-stack { min-width: 0; }
.email-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; }
.email-grid label { display: grid; gap: 8px; }
.email-grid label:first-child, .email-grid label:nth-last-child(2), .email-grid .form-actions { grid-column: 1 / -1; }
.login-form { display: flex; gap: 10px; margin-top: 20px; }
.login-form input { max-width: 360px; }
.import-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.generate-form { grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) 120px 120px auto; }
.generated-box { margin-top: 14px; display: grid; gap: 10px; }
.generated-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.generated-box textarea { font-family: Consolas, "SFMono-Regular", monospace; }
.generated-field { display: grid; gap: 8px; }
.generated-field span { font-size: 13px; color: #465977; }
.generated-quick-list { display: grid; gap: 8px; }
.generated-quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  padding: 10px 12px;
}
.generated-quick-item code {
  overflow-wrap: anywhere;
  font-weight: 800;
}
.generated-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.card-stats-grid { margin-top: 4px; }
.cards-toolbar { align-items: end; }
#cardSelectionHint { margin: 6px 0 12px; }
#generatedCardsMeta { margin: 0; }
.card-key-link {
  display: inline-block;
  max-width: 360px;
  color: var(--accent-strong);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.card-key-link:hover { text-decoration: underline; }
.card-key-tools {
  display: grid;
  gap: 8px;
}
.card-key-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.card-key-actions .mini {
  padding: 6px 9px;
}
.inline-mini { margin-left: 8px; vertical-align: middle; }
.mobile-list-note { display: none; }

@media (max-width: 760px) {
  .public-shell { padding: 12px; }
  .public-hero { border-radius: 26px; padding: 14px 16px 28px; }
  .public-nav { min-height: 48px; }
  .hero-grid, .public-workspace { grid-template-columns: 1fr; gap: 12px; }
  .hero-grid { padding-top: 28px; }
  h1 { font-size: clamp(31px, 8.5vw, 40px); letter-spacing: -.04em; }
  .hero-text { font-size: 16px; margin-top: 16px; }
  .instruction-panel, .submit-panel, .admin-card, .admin-login { padding: 16px; border-radius: 24px; }
  .public-card { padding: 18px; border-radius: 18px; }
  .public-head, .guide-row, .query-row, .login-form, .import-form { grid-template-columns: 1fr; display: grid; }
  .ios-stepper, .stepper, .email-grid { grid-template-columns: 1fr; }
  .public-shell .btn, .admin-login .btn { width: 100%; }

  .admin-shell {
    display: block;
    width: 100%;
    padding: 10px;
    overflow-x: hidden;
  }
  .admin-card, .admin-login {
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 22px;
  }
  .admin-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    margin-bottom: 14px;
  }
  .admin-head h1 {
    font-size: 28px;
    line-height: 1.12;
  }
  .admin-head p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
  }
  .admin-head .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 6px;
  }
  .admin-head .btn {
    width: auto;
    padding: 8px 11px;
    font-size: 13px;
  }
  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(239, 244, 250, .9);
  }
  .tab {
    min-width: 0;
    padding: 9px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 13px;
    white-space: nowrap;
  }
  .tab.active {
    color: var(--accent-strong);
    background: #fff;
    box-shadow: 0 3px 12px rgba(25, 56, 92, .1);
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  .stats-grid div {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
  }
  .stats-grid span {
    display: block;
    font-size: 12px;
    line-height: 1.35;
  }
  .stats-grid strong {
    margin-top: 5px;
    font-size: 26px;
    line-height: 1.05;
  }
  .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  .toolbar input,
  .toolbar select {
    width: 100%;
    min-width: 0;
  }
  .toolbar > input:first-child {
    grid-column: 1 / -1;
  }
  .toolbar .btn {
    width: 100%;
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
    text-align: center;
  }
  .orders-table,
  .cards-table {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .orders-table table { min-width: 0; }
  .orders-table th:last-child,
  .orders-table td:last-child {
    position: static;
    min-width: 0;
    box-shadow: none;
  }
  .mobile-list-note {
    display: block;
    margin: -2px 2px 10px;
    color: #758399;
    font-size: 12px;
  }
  .admin-card table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .admin-card thead {
    display: none;
  }
  .admin-card tbody {
    display: grid;
    width: 100%;
    gap: 10px;
  }
  .admin-card tbody tr {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 54, 78, .055);
  }
  .admin-card tbody td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
    border-bottom: 1px solid #edf1f6;
    overflow-wrap: anywhere;
  }
  .admin-card tbody td:last-child {
    border-bottom: 0;
  }
  .admin-card tbody td::before {
    content: attr(data-label);
    color: #6b7a90;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.55;
  }
  .admin-card tbody td[data-label="产品"] {
    display: none;
  }
  .admin-card tbody td.mobile-empty {
    display: none;
  }
  .admin-card tbody td[data-label="状态"] {
    align-items: center;
    background: #fbfdff;
  }
  .admin-card tbody td[data-label="操作"],
  .admin-card tbody td[data-label="卡密操作"] {
    align-items: center;
  }
  .admin-card tbody td[data-label="选择"] {
    grid-template-columns: 78px auto;
    align-items: center;
  }
  .admin-card tbody td[data-label="选择"] input {
    width: 20px;
    height: 20px;
  }
  .admin-card tbody td[data-label="预览"],
  .admin-card tbody td[data-label="订单"] {
    display: none;
  }
  .order-card-key-wrap {
    min-width: 0;
  }
  .order-card-key,
  .card-key-link {
    max-width: 100%;
    font-size: 12px;
  }
  .manual-reason {
    max-width: none;
  }
  .cell-actions,
  .card-key-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .cell-actions .btn,
  .card-key-actions .btn,
  .admin-card tbody td .btn {
    width: auto;
    padding: 7px 9px;
  }
  .panel-box {
    padding: 14px;
    border-radius: 16px;
  }
  .panel-box h2 {
    font-size: 20px;
  }
  .panel-box > p {
    margin: 6px 0 14px;
    font-size: 13px;
  }
  .generate-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .generate-form #generateBatchId,
  .generate-form #generateTags,
  .generate-form .btn {
    grid-column: 1 / -1;
  }
  .generate-form .btn {
    width: 100%;
  }
  .generated-head {
    display: grid;
    align-items: start;
  }
  .generated-head .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .generated-head .btn {
    width: 100%;
  }
  .generated-quick-item {
    display: grid;
    align-items: start;
  }
  .generated-quick-actions {
    justify-content: flex-start;
  }
  .email-grid .form-actions {
    display: grid;
  }
  .email-grid .btn {
    width: 100%;
  }
}

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

/* Minimal customer-facing recharge skin */
.minimal-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
  background:
    radial-gradient(circle at 5% 5%, rgba(48, 120, 104, .12), transparent 24%),
    radial-gradient(circle at 94% 16%, rgba(218, 201, 177, .2), transparent 26%),
    #f5f0e8;
}

.minimal-card {
  width: min(700px, 100%);
  overflow: hidden;
  border: 1px solid #d6dde5;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(24, 38, 52, .12);
}

.minimal-head {
  display: grid;
  justify-items: center;
  padding: 52px clamp(24px, 7vw, 78px) 36px;
  text-align: center;
}

.minimal-logo {
  display: grid;
  place-items: center;
  width: 166px;
  height: 166px;
  margin-bottom: 18px;
  color: #2f7868;
  text-decoration: none;
}

.chatgpt-mark {
  display: block;
  width: 160px;
  height: 160px;
}

.chatgpt-mark.compact {
  width: 96px;
  height: 96px;
}

.minimal-head h1 {
  max-width: none;
  margin: 0;
  color: #1c1714;
  font-size: clamp(42px, 6.4vw, 60px);
  line-height: 1.04;
  font-weight: 840;
  letter-spacing: -.052em;
}

.minimal-subtitle {
  margin: 10px 0 0;
  color: #6f7e8f;
  font-size: 16px;
}

.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;
}

.queue-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 18px;
  padding: 7px 18px;
  border: 1px solid rgba(47, 120, 104, .24);
  border-radius: 999px;
  color: #12695d;
  background: #edf8f5;
  font-size: 14px;
}

.flow-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  width: min(540px, calc(100% - 64px));
  margin: 6px auto 30px;
}

.flow-stepper::before {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  top: 25px;
  height: 4px;
  border-radius: 999px;
  background: #dae4ec;
}

.flow-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #8a99ac;
  font-size: 14px;
  font-weight: 800;
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 4px solid #d9e3ec;
  border-radius: 50%;
  background: #fff;
  color: #8a99ac;
  font-size: 18px;
}

.flow-step.active {
  color: #12695d;
}

.flow-step.active span {
  border-color: #e1efeb;
  color: #fff;
  background: #2f7868;
  box-shadow: 0 0 0 7px rgba(47, 120, 104, .12);
}

.minimal-body {
  padding: 28px clamp(24px, 7vw, 78px) 34px;
  border-top: 1px solid #edf1f4;
  background: linear-gradient(180deg, #fbfcfd 0%, #fff 100%);
}

.minimal-form {
  display: grid;
  gap: 14px;
}

.minimal-field {
  display: grid;
  gap: 10px;
  padding: 24px;
  border: 1px solid #dce5ed;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(31, 45, 58, .06);
}

.minimal-field span {
  color: #171412;
  font-size: 15px;
  font-weight: 850;
}

.minimal-field input,
.minimal-field textarea {
  border-color: #d6e1ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}

.minimal-field textarea {
  min-height: 138px;
}

.minimal-field input:focus,
.minimal-field textarea:focus {
  border-color: rgba(47, 120, 104, .55);
  box-shadow: 0 0 0 4px rgba(47, 120, 104, .12);
}

.field-note {
  margin: -2px 24px 2px;
  padding: 13px 16px;
  border: 1px solid #eadfd2;
  border-radius: 16px;
  color: #5e4a34;
  background: #fbf7f1;
  font-size: 14px;
}

.guide-details {
  border: 1px solid #dce5ed;
  border-radius: 18px;
  background: #f8fbfa;
}

.guide-details summary {
  cursor: pointer;
  padding: 15px 18px;
  color: #12695d;
  font-weight: 850;
}

.guide-details p {
  margin: 0;
  padding: 0 18px 18px;
  color: #5c6876;
  font-size: 14px;
}

.guide-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 12px;
}

.minimal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px 0;
}

.minimal-actions .btn {
  min-width: 162px;
}

.minimal-actions .btn.primary,
.minimal-shell .btn.primary {
  border: 0;
  color: #fff;
  background: #2f7868;
  box-shadow: none;
}

.minimal-shell .btn.primary:hover {
  background: #266c5d;
  box-shadow: 0 14px 28px rgba(47, 120, 104, .22);
}

.minimal-shell .btn.secondary {
  color: #2f7868;
  background: #fff;
  border-color: #d5e2df;
}

.query-link {
  color: #12695d;
  font-weight: 850;
  text-decoration: none;
}

.query-link:hover {
  text-decoration: underline;
}

.minimal-shell .result-panel,
.minimal-shell .status-panel {
  margin-top: 18px;
  border-color: #dce5ed;
  border-radius: 20px;
  background: #fff;
}

.minimal-card-query {
  width: min(620px, 100%);
}

.minimal-card-query .minimal-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
}

.minimal-card-query .minimal-head h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 820;
}

.flow-step.done {
  color: #12695d;
}

.flow-step.done span {
  border-color: rgba(47, 120, 104, .25);
  color: #2f7868;
  background: #edf8f5;
}

.flow-stepper-compact {
  margin-top: -8px;
}

.safe-guide {
  padding: 20px;
  border: 1px solid #dce5ed;
  border-radius: 22px;
  background: #f8fbfa;
}

.safe-guide strong {
  display: block;
  color: #171412;
  font-weight: 850;
  margin-bottom: 8px;
}

.safe-guide p {
  margin: 0 0 16px;
  color: #5c6876;
  font-size: 14px;
}

@media (max-width: 720px) {
  .minimal-shell {
    padding: 12px;
    place-items: start center;
  }

  .minimal-card {
    border-radius: 26px;
  }

  .minimal-head {
    padding: 34px 20px 28px;
  }

  .minimal-logo {
    width: 128px;
    height: 128px;
  }

  .chatgpt-mark {
    width: 120px;
    height: 120px;
  }

  .minimal-head h1 {
    font-size: clamp(31px, 9vw, 39px);
    letter-spacing: -.05em;
  }

  .flow-stepper {
    width: calc(100% - 28px);
    margin-bottom: 22px;
  }

  .flow-stepper::before {
    left: 24px;
    right: 24px;
    top: 21px;
  }

  .flow-step {
    font-size: 12px;
  }

  .flow-step span {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .minimal-body {
    padding: 22px 16px 26px;
  }

  .minimal-field {
    padding: 18px;
  }

  .field-note {
    margin-left: 0;
    margin-right: 0;
  }

  .guide-actions {
    grid-template-columns: 1fr;
  }

  .minimal-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding-inline: 0;
  }

  .minimal-actions .btn {
    width: 100%;
  }

  .manual-action-buttons { grid-template-columns: 1fr; }
}

/* Session 帮助样式 */
.session-help {
  margin-top: 8px;
  padding: 16px 20px;
  border: 1px solid #dce5ed;
  border-radius: 18px;
  background: #f8fbff;
}

.session-help strong {
  display: block;
  margin-bottom: 12px;
  color: #1e4f93;
  font-size: 15px;
  font-weight: 700;
}

.session-help ol {
  margin: 0 0 14px;
  padding-left: 24px;
  color: #5c6876;
  font-size: 14px;
  line-height: 1.7;
}

.session-help ol li {
  margin-bottom: 6px;
}

.session-help code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(20, 117, 246, 0.08);
  color: #1475f6;
  font-family: Consolas, "SF Mono", Monaco, monospace;
  font-size: 13px;
}

.security-note {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
}

/* Token 获取指南样式 */
.token-guide {
  margin: 16px 24px;
  padding: 16px;
  border: 1px solid #dce5ed;
  border-radius: 16px;
  background: #f8fbff;
}

.guide-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.guide-step:not(:last-child) {
  border-bottom: 1px solid #eaf0f6;
}

.guide-step strong {
  color: #1e4f93;
  font-size: 15px;
  font-weight: 700;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
}

/* 卡密状态颜色标记 */
.status-pill.card-status-unused,
.card-status-unused {
  background: #10b981 !important;
  color: white !important;
}

.status-pill.card-status-used,
.card-status-used {
  background: #6b7280 !important;
  color: white !important;
}

.status-pill.card-status-destroyed,
.card-status-destroyed {
  background: #ef4444 !important;
  color: white !important;
}

/* 订单操作按钮样式 */
.cell-actions {
  white-space: nowrap;
}

.cell-actions .btn {
  margin: 2px;
}

.btn.primary.mini {
  background: #2563eb;
  color: white;
}

.btn.primary.mini:hover {
  background: #1d4ed8;
}

/* 标签样式 */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Operations admin: overview, capacity and inventory workflow */
.admin-operations {
  width: min(100%, 1580px);
  padding: clamp(22px, 3vw, 36px);
  background: #f8fafc;
}
.operations-head { align-items: center; margin-bottom: 18px; }
.operations-head h1,
.section-intro h2,
.section-heading h2 { margin: 0; letter-spacing: -.025em; }
.operations-head h1 { font-size: clamp(28px, 4vw, 40px); }
.operations-head p { margin: 6px 0 0; color: #64748b; }
.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #6b7b91;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
}
.admin-head-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn.quiet,
.text-button {
  border-color: transparent;
  color: #31516f;
  background: transparent;
  box-shadow: none;
}
.text-button { border: 0; padding: 7px 0; font-weight: 750; cursor: pointer; }
.text-button:hover, .btn.quiet:hover { color: #0f6f61; background: #edf5f2; }
.worker-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #dbe4ec;
  border-radius: 999px;
  color: #5f6f82;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}
.worker-state i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.worker-state.online { color: #166654; border-color: #c8e6dc; background: #edf8f4; }
.worker-state.online i { background: #18a574; box-shadow: 0 0 0 4px rgba(24,165,116,.12); }
.worker-state.offline { color: #a33d35; border-color: #f0d1ce; background: #fff5f4; }
.worker-state.offline i { background: #d6554a; }
.operations-tabs {
  position: sticky;
  top: 8px;
  z-index: 10;
  gap: 4px;
  margin: 0 -4px 24px;
  padding: 4px;
  border: 1px solid #dfe6ed;
  border-radius: 14px;
  background: rgba(248,250,252,.92);
  backdrop-filter: blur(16px);
}
.operations-tabs .tab { flex: 0 1 132px; border: 0; border-radius: 10px; color: #5d6d81; background: transparent; }
.operations-tabs .tab.active { color: #102a43; background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.08); }
.capacity-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid #cfe3dc;
  border-radius: 24px;
  color: #123f37;
  background: linear-gradient(135deg, #eef8f5 0%, #f9fbfa 70%);
}
.metric-label { color: #397166; font-size: 14px; font-weight: 760; }
.capacity-value { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; }
.capacity-value strong { font-size: clamp(50px, 8vw, 84px); line-height: .92; letter-spacing: -.06em; }
.capacity-value span { font-size: 18px; font-weight: 760; }
.capacity-hero p { margin: 14px 0 0; color: #5b746f; }
.capacity-status { display: grid; justify-items: end; gap: 10px; color: #6a7c78; }
.overview-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid #dfe6ed;
}
.overview-metrics article { padding: 24px 18px; border-right: 1px solid #dfe6ed; }
.overview-metrics article:last-child { border-right: 0; }
.overview-metrics span, .overview-metrics small { display: block; color: #6b7b8f; }
.overview-metrics strong { display: block; margin: 7px 0 5px; font-size: 30px; letter-spacing: -.03em; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; margin-top: 22px; }
.overview-section {
  padding: 22px;
  border: 1px solid #dfe6ed;
  border-radius: 20px;
  background: #fff;
}
.section-heading, .section-intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2, .section-intro h2 { font-size: 20px; }
.section-intro { margin-bottom: 18px; }
.section-intro p { margin: 0; color: #66768a; }
.tag-inventory-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tag-inventory-item,
.recent-issue-item {
  width: 100%;
  border: 1px solid #e2e8ef;
  color: #24384e;
  background: #fbfcfd;
  cursor: pointer;
  text-align: left;
}
.tag-inventory-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-radius: 14px; }
.tag-inventory-item:hover, .recent-issue-item:hover { border-color: #a9d1c6; background: #f3f9f7; }
.tag-inventory-item.active { border-color: #267768; background: #eaf5f1; box-shadow: inset 0 0 0 1px #267768; }
.tag-inventory-item.active strong { color: #155f52; }
.tag-inventory-all { grid-column: 1 / -1; }
.tag-inventory-item span, .tag-inventory-item b { display: grid; gap: 3px; }
.tag-inventory-item b { min-width: 62px; color: #156c5c; font-size: 20px; text-align: right; }
.tag-inventory-item small, .recent-issue-item small { color: #77869a; font-weight: 500; }
.inventory-list { display: grid; }
.inventory-list div { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #edf1f5; color: #5d6d81; }
.inventory-list div:last-child { border-bottom: 0; }
.inventory-list strong { color: #142b40; font-size: 22px; }
.recent-issues-section { margin-top: 18px; }
.recent-issue-list { display: grid; }
.recent-issue-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 2px; border: 0; border-bottom: 1px solid #edf1f5; border-radius: 0; background: transparent; }
.recent-issue-item:last-child { border-bottom: 0; }
.recent-issue-item > span:nth-child(2) { display: grid; gap: 3px; overflow: hidden; }
.recent-issue-item strong, .recent-issue-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-issue-item time { color: #8090a2; font-size: 12px; }
.empty-state { margin: 0; padding: 22px; border-radius: 14px; color: #718096; background: #f7f9fb; text-align: center; }
.empty-state.positive { color: #297260; background: #f0f8f5; }
.generation-panel { padding: 0; overflow: hidden; background: #fff; }
.generation-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; cursor: pointer; list-style: none; }
.generation-panel summary::-webkit-details-marker { display: none; }
.generation-panel summary span { display: grid; gap: 4px; }
.generation-panel summary small { color: #758599; font-weight: 500; }
.generation-panel summary b { color: #507087; font-size: 13px; }
.generation-panel[open] summary { border-bottom: 1px solid #e7edf2; }
.generation-panel[open] summary b { font-size: 0; }
.generation-panel[open] summary b::after { content: "收起"; font-size: 13px; }
.generation-content { padding: 20px; }
.cards-filter-panel { margin-bottom: 14px; padding: 16px; border: 1px solid #dfe6ed; border-radius: 18px; background: #fff; }
.primary-filters { margin-bottom: 14px; }
.facet-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: #5e7084; font-size: 13px; font-weight: 750; }
.facet-heading small { font-weight: 500; }
.tag-facet-bar, .bulk-tag-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-facet, .tag-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #dbe3eb;
  border-radius: 999px;
  color: #4f6277;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}
.tag-facet b { color: #7d8c9e; font-size: 11px; }
.tag-facet.active, .tag-choice.active { border-color: #378878; color: #fff; background: #267768; }
.tag-facet.active b { color: #d9f0ea; }
.tag-badge { border: 0; cursor: pointer; }
.tag-selection-summary {
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid #cfe3dc;
  border-radius: 13px;
  color: #37665e;
  background: #f4f9f7;
  font-size: 13px;
  font-weight: 650;
}
.tag-capacity-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dce5ec;
  border-radius: 16px;
  background: #f8fafb;
}
.tag-capacity-summary > div { display: grid; gap: 3px; min-width: 0; padding: 9px 10px; }
.tag-capacity-summary span, .tag-capacity-summary small { color: #718195; font-size: 12px; }
.tag-capacity-summary strong { overflow: hidden; color: #183149; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.tag-capacity-summary p { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 11px; color: #446476; background: #eef3f6; font-weight: 750; }
.tag-capacity-summary.warning p { color: #945a19; background: #fff4df; }
.tag-capacity-summary.available p { color: #286858; background: #eaf6f1; }
.tag-capacity-summary.balanced p { color: #216957; background: #e4f4ee; }
.tag-capacity-summary.loading { display: block; color: #607487; animation: admin-soft-pulse 1s ease-in-out infinite alternate; }
@keyframes admin-soft-pulse { from { opacity: .55; } to { opacity: 1; } }
.selection-bar {
  position: sticky;
  top: 72px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #bddbd3;
  border-radius: 16px;
  background: rgba(242,249,247,.96);
  box-shadow: 0 10px 28px rgba(31,83,70,.09);
  backdrop-filter: blur(14px);
}
.selection-bar #cardSelectionHint { min-width: 150px; margin: 0; color: #245f54; font-weight: 780; }
.selection-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-tag-editor { flex: 1 0 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding-top: 12px; border-top: 1px solid #cfe3dc; }
.bulk-tag-choices { grid-column: 1 / -1; }
.tag-choice small { opacity: .72; }

@media (max-width: 900px) {
  .overview-metrics { grid-template-columns: repeat(2, 1fr); }
  .overview-metrics article { border-bottom: 1px solid #dfe6ed; }
  .overview-metrics article:nth-child(2n) { border-right: 0; }
  .overview-metrics article:last-child { grid-column: 1 / -1; border-bottom: 0; border-right: 0; }
  .overview-grid { grid-template-columns: 1fr; }
  .selection-bar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
  .admin-operations { padding: 16px; }
  .operations-head { display: flex; align-items: flex-start; flex-direction: column; }
  .operations-head > div:first-child { width: 100%; }
  .admin-head-tools { width: 100%; justify-content: flex-start; }
  .operations-tabs { top: 4px; display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
  .operations-tabs .tab { width: auto; min-width: 0; padding: 10px 5px; font-size: 13px; }
  .capacity-hero { align-items: flex-start; flex-direction: column; gap: 18px; padding: 24px 20px; }
  .capacity-status { justify-items: start; }
  .capacity-value strong { font-size: 58px; }
  .overview-metrics article { padding: 18px 12px; }
  .overview-metrics strong { font-size: 25px; }
  .tag-inventory-list { grid-template-columns: 1fr; }
  .tag-capacity-summary { grid-template-columns: 1fr 1fr; }
  .tag-capacity-summary > div:first-child { grid-column: 1 / -1; }
  .overview-section { padding: 17px; }
  .section-heading, .section-intro { align-items: flex-start; flex-direction: column; gap: 8px; }
  .recent-issue-item { grid-template-columns: auto minmax(0, 1fr); }
  .recent-issue-item time { grid-column: 2; }
  .generate-form { grid-template-columns: 1fr 1fr; }
  .generate-form input:nth-child(-n+2), .generate-form button { grid-column: 1 / -1; }
  .cards-filter-panel { padding: 12px; }
  .tag-facet-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .tag-facet { flex: 0 0 auto; }
  .facet-heading small { display: none; }
  .selection-bar { top: 64px; }
  .selection-actions { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .selection-actions .btn { width: 100%; }
  .bulk-tag-editor { grid-template-columns: 1fr 1fr; width: 100%; }
  .bulk-tag-editor input, .bulk-tag-choices { grid-column: 1 / -1; }
}

/* iOS-inspired public recharge flow */
.minimal-shell {
  --ios-accent: #177866;
  --ios-accent-pressed: #106a59;
  min-height: 100vh;
  padding: 28px 16px;
  place-items: center;
  background: #f5f5f7;
}

.minimal-card {
  width: min(600px, 100%);
  border: 1px solid rgba(60, 60, 67, .14);
  border-radius: 32px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .09);
  animation: ios-card-in .38s cubic-bezier(.22, 1, .36, 1) both;
}

.public-shell-recharge .minimal-card { width: min(640px, 100%); }

@keyframes ios-card-in {
  from { opacity: 0; transform: translateY(10px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.minimal-head {
  padding: 34px 34px 24px;
}

.minimal-logo {
  width: 92px;
  height: 92px;
  margin-bottom: 12px;
}

.chatgpt-mark,
.chatgpt-mark.compact {
  width: 88px;
  height: 88px;
}

.minimal-card-query .minimal-logo {
  width: 76px;
  height: 76px;
  margin-bottom: 10px;
}

.minimal-card-query .chatgpt-mark.compact {
  width: 72px;
  height: 72px;
}

.minimal-head h1,
.minimal-card-query .minimal-head h1 {
  color: #1d1d1f;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 720;
  letter-spacing: -.035em;
}

.minimal-subtitle {
  max-width: 420px;
  margin: 8px 0 0;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.55;
  text-wrap: balance;
}

.queue-pill {
  min-height: 30px;
  margin-top: 14px;
  padding: 5px 13px;
  border: 0;
  border-radius: 999px;
  color: #287263;
  background: #edf6f3;
  font-size: 12px;
  font-weight: 600;
}

.flow-stepper {
  width: min(480px, calc(100% - 48px));
  margin: 4px auto 24px;
}

.flow-stepper::before {
  left: 26px;
  right: 26px;
  top: 17px;
  height: 2px;
  background: #e4e4e8;
}

.flow-step {
  gap: 7px;
  color: #98989d;
  font-size: 11px;
  font-weight: 600;
}

.flow-step span {
  width: 36px;
  height: 36px;
  border: 2px solid #e2e2e7;
  color: #8e8e93;
  font-size: 13px;
  font-weight: 650;
}

.flow-step.active,
.flow-step.done { color: var(--ios-accent); }

.flow-step.active span {
  border-color: var(--ios-accent);
  background: var(--ios-accent);
  box-shadow: 0 0 0 5px rgba(23, 120, 102, .1);
}

.flow-step.done span {
  border-color: #cde1dc;
  color: var(--ios-accent);
  background: #edf6f3;
}

.flow-stepper-compact { margin-top: 0; }

.minimal-body {
  padding: 22px 34px 30px;
  border-top: 1px solid rgba(60, 60, 67, .09);
  background: #fff;
}

.minimal-form { gap: 12px; }

.minimal-field {
  gap: 8px;
  padding: 15px;
  border: 0;
  border-radius: 16px;
  background: #f2f2f7;
  box-shadow: none;
}

.minimal-field span {
  padding: 0 2px;
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 650;
}

.minimal-field input,
.minimal-field textarea {
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid rgba(60, 60, 67, .16);
  border-radius: 12px;
  background: #fff;
  color: #1d1d1f;
  font-size: 15px;
}

.minimal-field textarea {
  min-height: 128px;
  line-height: 1.5;
}

.minimal-field input:focus,
.minimal-field textarea:focus {
  border-color: rgba(23, 120, 102, .68);
  box-shadow: 0 0 0 4px rgba(23, 120, 102, .1);
}

.field-note {
  margin: 0;
  padding: 11px 13px;
  border: 0;
  border-radius: 12px;
  color: #6e624f;
  background: #faf7f2;
  font-size: 12px;
}

.session-file-import {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(23, 120, 102, .28);
  border-radius: 14px;
  background: rgba(237, 246, 243, .72);
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.session-file-import.is-dragging {
  border-color: rgba(23, 120, 102, .8);
  background: rgba(222, 242, 236, .96);
  box-shadow: 0 0 0 4px rgba(23, 120, 102, .1);
  transform: translateY(-1px);
}

.session-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.session-file-button {
  min-height: 42px !important;
  padding: 9px 15px;
  cursor: pointer;
}

.session-file-input:focus-visible + .session-file-button {
  outline: 3px solid rgba(23, 120, 102, .2);
  outline-offset: 2px;
}

.session-file-status {
  margin: 0;
  color: #636366;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.session-file-status.success { color: #116b5a; }
.session-file-status.error { color: #b42318; }

body.account-confirm-open {
  overflow: hidden;
}

.account-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 27, 32, .42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.account-confirm-dialog {
  width: min(100%, 480px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 26px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 28px 80px rgba(18, 32, 38, .24);
  animation: account-confirm-enter .18s ease-out both;
}

.account-confirm-eyebrow {
  margin: 0 0 8px;
  color: var(--ios-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
}

.account-confirm-dialog h2 {
  margin: 0 0 20px;
  color: #17212b;
  font-size: 24px;
  letter-spacing: -.025em;
}

.account-confirm-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(23, 120, 102, .16);
  border-radius: 16px;
  background: #edf6f3;
}

.account-confirm-prompt {
  min-width: 0;
  margin: 0;
  color: #183b34;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.45;
  overflow-wrap: anywhere;
  user-select: text;
}

.account-confirm-copy {
  min-height: 40px !important;
  padding: 8px 14px;
  border-radius: 12px !important;
  white-space: nowrap;
}

.account-confirm-copy-state {
  min-height: 20px;
  margin: 7px 2px 0;
  color: #6e747b;
  font-size: 12px;
}

.account-confirm-copy-state.success { color: #116b5a; }
.account-confirm-copy-state.error { color: #b42318; }

.account-confirm-help {
  margin: 14px 2px 20px;
  color: #68727c;
  font-size: 13px;
  line-height: 1.6;
}

.account-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

.account-confirm-actions .btn {
  min-height: 48px;
  border-radius: 14px;
}

@keyframes account-confirm-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .account-confirm-dialog { animation: none; }
}

.minimal-actions {
  padding: 2px 0 0;
}

.minimal-actions.primary-actions {
  display: block;
  padding-top: 4px;
}

.minimal-actions .btn,
.minimal-actions .btn.primary,
.minimal-shell .btn {
  min-height: 48px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 650;
}

.minimal-actions .btn.primary,
.minimal-shell .btn.primary {
  background: var(--ios-accent);
  box-shadow: none;
}

.minimal-shell .btn.primary:hover {
  background: var(--ios-accent-pressed);
  box-shadow: 0 10px 24px rgba(23, 120, 102, .16);
}

.minimal-shell .btn.secondary {
  border-color: rgba(60, 60, 67, .14);
  color: var(--ios-accent);
  background: rgba(255, 255, 255, .9);
}

.utility-links {
  display: flex;
  justify-content: center;
  gap: 0;
  padding-top: 6px;
}

.utility-links a,
.back-link,
.query-link {
  color: var(--ios-accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.utility-links a {
  position: relative;
  padding: 7px 13px;
}

.utility-links a + a::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 1px;
  background: #e5e5ea;
}

.utility-links .danger-link { color: #b55656; }

.back-link {
  display: block;
  width: fit-content;
  margin: 2px auto 0;
  padding: 8px 12px;
}

.token-guide {
  margin: 0;
  padding: 0 15px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #f2f2f7;
}

.guide-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 68px;
  padding: 11px 0;
}

.guide-step:not(:last-child) { border-bottom-color: rgba(60, 60, 67, .1); }

.guide-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--ios-accent);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.guide-step strong {
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 650;
}

.guide-step small {
  display: block;
  margin-top: 3px;
  color: #7c7c80;
  font-size: 10px;
  line-height: 1.4;
}

.btn-small {
  min-height: 38px !important;
  padding: 8px 12px;
  border-radius: 11px !important;
  font-size: 11px !important;
}

.minimal-shell .result-panel,
.minimal-shell .status-panel {
  margin-top: 14px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: #f2f2f7;
}

.progress-list { gap: 7px; margin: 14px 0; }
.progress-list li { padding: 11px 12px; border: 0; border-radius: 12px; background: #fff; font-size: 13px; }
.progress-list li.active { color: var(--ios-accent); background: #eaf4f1; }
.invoice-progress { height: 7px; }
.badge { padding: 5px 9px; font-size: 12px; }

@media (max-width: 720px) {
  .minimal-shell { padding: 10px; }
  .minimal-card { border-radius: 26px; }
  .minimal-head { padding: 28px 20px 22px; }
  .minimal-logo { width: 76px; height: 76px; }
  .chatgpt-mark, .chatgpt-mark.compact { width: 72px; height: 72px; }
  .minimal-head h1, .minimal-card-query .minimal-head h1 { font-size: 29px; }
  .minimal-subtitle { font-size: 13px; }
  .flow-stepper { width: calc(100% - 24px); margin-bottom: 20px; }
  .flow-stepper::before { left: 20px; right: 20px; top: 15px; }
  .flow-step span { width: 32px; height: 32px; }
  .flow-step strong { max-width: 64px; text-align: center; line-height: 1.25; }
  .minimal-body { padding: 18px 14px 22px; }
  .minimal-field { padding: 13px; }
  .session-file-import { grid-template-columns: 1fr; }
  .session-file-button { width: 100%; }
  .guide-step { grid-template-columns: 30px minmax(0, 1fr); }
  .guide-step .btn { grid-column: 1 / -1; width: 100%; }
  .utility-links { flex-wrap: wrap; }
  .account-confirm-backdrop { padding: 14px; }
  .account-confirm-dialog { padding: 22px 18px; border-radius: 22px; }
  .account-confirm-copy-row { grid-template-columns: 1fr; }
  .account-confirm-copy { width: 100%; }
  .account-confirm-actions { grid-template-columns: 1fr; }
}

.tags-cell {
  max-width: 200px;
  white-space: normal;
}

#cardTagFilter {
  min-width: 150px;
}

/* Calm, continuous progress presentation */
.minimal-card-query .status-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(60, 60, 67, .08);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 16px 40px rgba(28, 28, 30, .06);
  animation: statusReveal .42s cubic-bezier(.22, 1, .36, 1) both;
}

.minimal-card-query .status-top h2 {
  margin: 3px 0 0;
  color: #1d1d1f;
  font-size: 22px;
  letter-spacing: -.02em;
}

.status-eyebrow {
  margin: 0;
  color: #8e8e93;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
}

.minimal-card-query .status-message {
  min-height: 40px;
  margin: 14px 0 16px;
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.55;
}

.minimal-card-query .status-message p { margin: 0; }

.proxy-replacement-results {
  display: grid;
  gap: 12px;
}

.proxy-replacement-item {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(60, 60, 67, .1);
  border-radius: 16px;
  background: #fff;
}

.proxy-replacement-item.is-success {
  border-color: rgba(23, 120, 102, .2);
  box-shadow: inset 3px 0 rgba(23, 120, 102, .7);
}

.proxy-replacement-item.is-error {
  border-color: rgba(201, 52, 47, .18);
  box-shadow: inset 3px 0 rgba(201, 52, 47, .65);
}

.proxy-replacement-row,
.proxy-replacement-link {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.proxy-replacement-row > span,
.proxy-replacement-link > span {
  color: #7c7c80;
  font-size: 11px;
  font-weight: 650;
}

.proxy-replacement-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1d1d1f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.proxy-replacement-link {
  grid-template-columns: 78px minmax(0, 1fr) auto;
}

.proxy-replacement-link a {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ios-accent);
  font-size: 12px;
  text-decoration: none;
}

.proxy-replacement-link .btn.mini {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
}

.proxy-replacement-error {
  margin: 0;
  padding-left: 88px;
  color: #c9342f;
  font-size: 12px;
  line-height: 1.5;
}

.proxy-replacement-copy-all {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.minimal-card-query .badge {
  min-width: 50px;
  justify-content: center;
  padding: 7px 10px;
  color: var(--ios-accent);
  background: #edf7f4;
  font-variant-numeric: tabular-nums;
  transition: color .35s ease, background .35s ease;
}

@media (max-width: 720px) {
  .proxy-replacement-row,
  .proxy-replacement-link {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .proxy-replacement-link .btn.mini { width: 100%; }
  .proxy-replacement-error { padding-left: 0; }
  .proxy-replacement-copy-all .btn { width: 100%; }
}

.order-progress,
.minimal-card-query .invoice-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e9ec;
}

.order-progress span,
.minimal-card-query .invoice-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ios-accent);
  transition: width 1.45s cubic-bezier(.22, 1, .36, 1), background .35s ease;
}

.minimal-card-query .progress-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 18px 0 2px;
}

.minimal-card-query .progress-list::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 9px;
  width: 1px;
  content: "";
  background: #dedee3;
}

.minimal-card-query .progress-list li {
  position: relative;
  min-height: 34px;
  padding: 8px 8px 8px 34px;
  color: #aeaeb2;
  background: transparent;
  font-size: 13px;
  transition: color .38s ease, transform .38s cubic-bezier(.22, 1, .36, 1), opacity .38s ease;
}

.minimal-card-query .progress-list li::before {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 3px;
  width: 13px;
  height: 13px;
  border: 2px solid #d1d1d6;
  border-radius: 50%;
  content: "";
  background: #fff;
  transition: border-color .35s ease, background .35s ease, box-shadow .35s ease, transform .35s ease;
}

.minimal-card-query .progress-list li.done {
  color: #6e6e73;
  background: transparent;
}

.minimal-card-query .progress-list li.done::before {
  border-color: var(--ios-accent);
  background: var(--ios-accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.minimal-card-query .progress-list li.active {
  color: #1d1d1f;
  background: transparent;
  font-weight: 650;
  transform: translateX(2px);
}

.minimal-card-query .progress-list li.active::before {
  border-color: var(--ios-accent);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(47, 127, 109, .12);
  animation: statusPulse 1.8s ease-in-out infinite;
}

.minimal-card-query .progress-list li.error { color: #c9342f; background: transparent; }
.minimal-card-query .progress-list li.error::before { border-color: #ff453a; background: #ff453a; }

.minimal-card-query .invoice-box {
  margin-top: 18px;
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background: #f5f5f7;
  animation: invoiceReveal .5s cubic-bezier(.22, 1, .36, 1) both;
}

.invoice-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.invoice-head h3 { margin: 3px 0 0; color: #1d1d1f; font-size: 16px; }
.invoice-head > strong { color: var(--ios-accent); font-size: 14px; font-variant-numeric: tabular-nums; }
.minimal-card-query .invoice-box > p { margin: 12px 0; color: #6e6e73; font-size: 12px; line-height: 1.55; }
.minimal-card-query .invoice-progress { margin: 12px 0 16px; }
.minimal-card-query .invoice-box .btn { width: 100%; }

.status-panel.is-success .badge { color: #18794e; background: #e8f6ee; }
.status-panel.is-success .order-progress span { background: #34c759; }
.status-panel.is-retrying .badge { color: #0a6b8f; background: #e8f5fb; }
.status-panel.is-retrying .order-progress span { background: #1787aa; }
.status-panel.is-error .badge { color: #c9342f; background: #fff0ef; }
.status-panel.is-error .order-progress span { background: #ff453a; }

@keyframes statusReveal {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes invoiceReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
  0%, 100% { transform: scale(.92); box-shadow: 0 0 0 4px rgba(47, 127, 109, .10); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(47, 127, 109, .04); }
}

@media (max-width: 720px) {
  .minimal-card-query .status-panel { padding: 18px; border-radius: 20px; }
  .minimal-card-query .status-top h2 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .order-progress span,
  .minimal-card-query .invoice-progress span,
  .minimal-card-query .progress-list li,
  .minimal-card-query .progress-list li::before { transition-duration: .01ms !important; }
  .minimal-card-query .progress-list li.active::before { animation: none; }
}

/* Admin authoritative card pool and formal dual-worker status. */
.worker-runtime-summary {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.worker-runtime-summary > div {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .72);
}
.worker-runtime-summary span { color: var(--muted); font-size: 11px; }
.worker-runtime-summary strong { font-size: 13px; }
.worker-runtime-summary strong.positive { color: #168052; }
.overview-worker-nodes {
  width: min(470px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.overview-worker-node {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .76);
}
.overview-worker-node > div { display: grid; gap: 2px; min-width: 0; }
.overview-worker-node strong,
.overview-worker-node small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-worker-node > span { font-size: 12px; font-weight: 800; }
.overview-worker-node > small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.overview-worker-node.ready { border-color: #b8dfd3; }
.overview-worker-node.ready > span { color: #168052; }
.overview-worker-node.warning { border-color: #ecd7a8; }
.overview-worker-node.warning > span { color: #9a6818; }
.overview-worker-node.offline { border-color: #efcbc7; }
.overview-worker-node.offline > span { color: #b54840; }

.payment-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 18px;
  margin-bottom: 20px;
}
.payment-card-entry-panel,
.payment-card-status-panel,
.payment-card-list-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 14px 38px rgba(37, 54, 82, .07);
}
.payment-card-list-section { padding: 20px; }
.payment-card-entry-tabs {
  display: inline-flex;
  gap: 5px;
  padding: 4px;
  margin: 4px 0 16px;
  border-radius: 14px;
  background: #eef3f9;
}
.payment-card-entry-tab {
  border: 0;
  border-radius: 11px;
  padding: 9px 15px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.payment-card-entry-tab.active {
  color: var(--accent-strong);
  background: #fff;
  box-shadow: 0 4px 14px rgba(39, 64, 98, .1);
}
.payment-card-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}
.payment-card-fields label,
.payment-card-smart label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.payment-card-fields label:nth-child(4) { grid-column: span 2; }
.payment-card-fields input,
.payment-card-smart textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
#addPaymentCard { margin-top: 15px; }
.payment-card-smart-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.payment-card-smart-preview > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #f4f7fb;
}
.payment-card-smart-preview span { color: var(--muted); font-size: 11px; }
.payment-card-smart-preview strong { font-size: 13px; }
.payment-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
}
.payment-card-stats > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 14px;
  background: #f4f7fb;
}
.payment-card-stats span { color: var(--muted); font-size: 12px; }
.payment-card-stats strong { font-size: 18px; }
.payment-card-command-state { margin-top: 12px; }
.payment-card-command-state p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
}
.payment-command-ok { color: #16744b; background: #eaf8f0; }
.payment-command-pending { color: #855b0b; background: #fff6dc; }
.payment-command-error { color: #b42318; background: #fff0ee; }
.payment-card-list-heading { align-items: flex-end; }
.payment-card-search {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: min(440px, 100%);
}
.payment-card-search input,
.payment-card-search select {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
.payment-card-search input:focus,
.payment-card-search select:focus {
  border-color: rgba(20, 117, 246, .55);
  outline: 3px solid rgba(20, 117, 246, .1);
}
.payment-card-search-summary {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.payment-card-list { display: grid; gap: 10px; }
.payment-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.payment-card-item.disabled { background: #fafafa; }
.payment-card-item.reserved { border-color: rgba(20, 117, 246, .35); }
.payment-card-main { min-width: 0; }
.payment-card-main > div { display: flex; align-items: center; gap: 9px; }
.payment-card-main > div > strong { font-size: 17px; letter-spacing: .04em; }
.payment-card-main p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.payment-card-disable-audit {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 7px 16px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff4f2;
}
.payment-card-disable-audit div { min-width: 0; }
.payment-card-disable-audit dt {
  color: #9b4439;
  font-size: 11px;
  font-weight: 800;
}
.payment-card-disable-audit dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.payment-card-pending { display: block; margin-top: 6px; color: #8a630e; }
.payment-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.inactive-payment-cards { margin-top: 14px; }
.inactive-payment-cards summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 900px) {
  .payment-card-layout { grid-template-columns: 1fr; }
  .routing-control-grid { grid-template-columns: 1fr; }
  .routing-status-hero { align-items: flex-start; flex-direction: column; }
  .routing-live-badges { justify-content: flex-start; max-width: none; }
}

@media (max-width: 680px) {
  .worker-runtime-summary { grid-template-columns: 1fr; }
  .overview-worker-nodes { grid-template-columns: 1fr; }
  .payment-card-fields { grid-template-columns: 1fr; }
  .payment-card-fields label:nth-child(4) { grid-column: auto; }
  .payment-card-smart-preview { grid-template-columns: 1fr; }
  .payment-card-list-heading { align-items: stretch; }
  .payment-card-search { justify-content: stretch; width: 100%; }
  .payment-card-search input,
  .payment-card-search select { width: 100%; }
  .payment-card-disable-audit { grid-template-columns: 1fr; }
  .payment-card-item { align-items: stretch; flex-direction: column; }
  .payment-card-actions { justify-content: flex-start; }
  .routing-mode-grid { grid-template-columns: 1fr; }
  .routing-overflow-box { grid-template-columns: 1fr; }
  .routing-status-hero { padding: 18px; }
  .routing-live-mode { align-items: flex-start; }
  .routing-status-icon { flex-basis: 44px; width: 44px; height: 44px; }
  .routing-live-mode h3 { font-size: 22px; }
  .routing-mode-card { min-height: 102px; }
  .routing-worker-card header { grid-template-columns: 38px minmax(0, 1fr); }
  .routing-worker-role { width: 38px; height: 38px; }
  .routing-worker-state { grid-column: 2; justify-self: start; }
}

/* Operational routing console and first-class card batches. */
.routing-status-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid #dfe7ee;
  border-radius: 22px;
  background: linear-gradient(135deg, #f7fafc 0%, #eef3f7 100%);
  box-shadow: 0 14px 34px rgba(26, 48, 70, .07);
}
.routing-status-hero.is-healthy {
  border-color: #b8dfd2;
  background: linear-gradient(135deg, #f4fbf8 0%, #e8f6f1 100%);
}
.routing-status-hero.has-warning {
  border-color: #f0c9bf;
  background: linear-gradient(135deg, #fff9f5 0%, #fff0eb 100%);
}
.routing-status-hero.is-paused {
  border-color: #d7dde4;
  background: linear-gradient(135deg, #f8f9fb 0%, #eef1f4 100%);
}
.routing-live-mode {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.routing-status-icon {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: #728196;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 9px 20px rgba(41, 61, 81, .16);
}
.routing-status-hero.is-healthy .routing-status-icon { background: #138269; }
.routing-status-hero.has-warning .routing-status-icon { background: #c3634f; }
.routing-status-label {
  display: block;
  margin-bottom: 4px;
  color: #6e7f90;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
}
.routing-live-mode h3 {
  margin: 0;
  color: #142c42;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
}
.routing-live-mode p {
  max-width: 720px;
  margin: 7px 0 0;
  color: #52677b;
  font-size: 13px;
  line-height: 1.55;
}
.routing-live-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 390px;
}
.routing-health-badge,
.routing-worker-health,
.routing-unsaved-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #dce3ea;
  border-radius: 999px;
  color: #657689;
  background: rgba(255, 255, 255, .8);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.routing-health-badge.success,
.routing-worker-health.success { border-color: #b8dfd2; color: #11705b; background: #e9f7f2; }
.routing-health-badge.danger,
.routing-worker-health.danger { border-color: #efc8bf; color: #ad4c3f; background: #fff0ed; }
.routing-health-badge.info { border-color: #bfd8ee; color: #27658f; background: #edf6fd; }
.routing-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .9fr);
  align-items: start;
  gap: 18px;
}
.routing-mode-panel,
.routing-worker-panel,
.routing-queue-panel { border-radius: 22px; }
.routing-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.routing-panel-heading h3 { margin: 2px 0 0; }
.routing-unsaved-note.changed {
  border-color: #f1d29a;
  color: #936314;
  background: #fff7e7;
}
.routing-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.routing-mode-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 116px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #dce4ec;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff 0%, #f9fbfc 100%);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.routing-mode-card:hover {
  transform: translateY(-1px);
  border-color: #9fb7cd;
  box-shadow: 0 10px 24px rgba(32, 55, 77, .08);
}
.routing-mode-card.selected {
  border-color: #197764;
  background: linear-gradient(145deg, #f2fbf8 0%, #e8f7f2 100%);
  box-shadow: inset 0 0 0 1px #197764, 0 11px 26px rgba(25, 119, 100, .12);
}
.routing-mode-card.current-mode::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  border-radius: 34px 0 0;
  background: #197764;
  content: "";
}
.routing-mode-card.current-mode::before {
  position: absolute;
  z-index: 1;
  right: 7px;
  bottom: 5px;
  color: #fff;
  content: "✓";
  font-size: 12px;
  font-weight: 900;
}
.routing-mode-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.routing-mode-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #31536e;
  background: #eaf0f5;
  font-size: 13px;
  font-weight: 900;
}
.routing-mode-card.selected .routing-mode-icon { color: #fff; background: #197764; }
.routing-mode-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.routing-mode-copy strong { color: #183148; font-size: 15px; }
.routing-mode-copy small { color: #66788b; font-size: 12px; line-height: 1.45; }
.routing-mode-copy em {
  color: #8b99a7;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}
.routing-mode-state {
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: #657689;
  background: #eef2f5;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.routing-mode-card.selected .routing-mode-state {
  color: #126e59;
  background: #d9f1e9;
}
.routing-mode-card.danger-mode.selected {
  border-color: #b85c50;
  background: linear-gradient(145deg, #fff8f6 0%, #ffefeb 100%);
  box-shadow: inset 0 0 0 1px #b85c50, 0 11px 26px rgba(184, 92, 80, .11);
}
.routing-mode-card.danger-mode.selected .routing-mode-icon,
.routing-mode-card.danger-mode.current-mode::after { background: #b85c50; }
.routing-selection-preview {
  margin: 13px 0;
  padding: 12px 14px;
  border-left: 3px solid #197764;
  border-radius: 4px 13px 13px 4px;
  color: #315b54;
  background: #f0f8f5;
  font-size: 12px;
  line-height: 1.55;
}
.routing-overflow-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 15px 16px;
  border: 1px solid #dfe7ee;
  border-radius: 17px;
  background: #f8fafc;
}
.routing-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.routing-switch-row > span:first-child { display: grid; gap: 4px; }
.routing-switch-row strong { color: #20384e; font-size: 13px; }
.routing-switch-row small { color: #718194; font-size: 11px; line-height: 1.45; }
.routing-switch { position: relative; flex: 0 0 44px; width: 44px; height: 24px; }
.routing-switch input { position: absolute; opacity: 0; }
.routing-switch > span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd4dd;
  cursor: pointer;
  transition: background .18s ease;
}
.routing-switch > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(32, 49, 67, .22);
  content: "";
  transition: transform .18s ease;
}
.routing-switch input:checked + span { background: #197764; }
.routing-switch input:checked + span::after { transform: translateX(20px); }
.routing-overflow-threshold {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5f7184;
  font-size: 11px;
  white-space: nowrap;
}
.routing-overflow-threshold input {
  width: 62px;
  height: 38px;
  padding: 7px;
  border-radius: 11px;
  text-align: center;
  font-weight: 850;
}
.routing-advanced {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #e1e7ed;
  border-radius: 14px;
  background: #f8fafc;
}
.routing-advanced summary {
  color: #53677c;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.routing-advanced label { display: block; margin-top: 11px; }
.routing-save-button {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  font-size: 14px;
  box-shadow: 0 9px 20px rgba(20, 117, 246, .16);
}
.routing-save-button:disabled {
  color: #6c7c8c;
  background: #e9eef2;
  box-shadow: none;
}
.routing-worker-list { display: grid; gap: 12px; }
.routing-worker-card {
  padding: 15px;
  border: 1px solid #dfe6ed;
  border-radius: 17px;
  background: #fff;
}
.routing-worker-card.is-healthy { border-color: #c8e3da; background: #fbfefd; }
.routing-worker-card.has-warning { border-color: #efc8bf; background: #fffafa; }
.routing-worker-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}
.routing-worker-role {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #28516e;
  background: #eaf2f8;
  font-size: 12px;
  font-weight: 900;
}
.routing-worker-card header div { min-width: 0; }
.routing-worker-card header strong { display: block; color: #1b3349; font-size: 14px; }
.routing-worker-card header code {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #718194;
  background: none;
  font-size: 10px;
}
.routing-worker-state {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.routing-worker-state.success { color: #11705b; background: #e6f5f0; }
.routing-worker-state.danger { color: #ad4c3f; background: #ffede9; }
.routing-worker-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}
.routing-worker-badges span {
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
}
.routing-worker-badges .ok { color: #176d59; background: #edf8f4; }
.routing-worker-badges .bad { color: #a34c40; background: #fff0ed; }
.routing-worker-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #edf1f4;
  color: #738395;
  font-size: 10px;
}
.routing-worker-card footer strong { color: #314b61; }
.routing-queue-panel { margin-top: 18px; }
.routing-queue-panel .payment-card-stats > div { position: relative; }
.routing-queue-panel .payment-card-stats small {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: #97a3af;
  font-size: 9px;
}
.card-generation-stats small {
  display: block;
  margin-top: 5px;
  color: #8593a3;
  font-size: 11px;
}
.generate-form {
  grid-template-columns: 110px minmax(220px, 1fr) minmax(220px, 1fr) auto;
}
.generate-form > label {
  display: grid;
  gap: 7px;
  color: #5c6e81;
  font-size: 12px;
  font-weight: 700;
}
.generation-advanced {
  grid-column: 1 / -1;
  padding: 9px 12px;
  border: 1px solid #e3e9ef;
  border-radius: 12px;
  background: #f8fafc;
}
.generation-advanced summary {
  color: #66788b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.generation-advanced label {
  display: grid;
  grid-template-columns: 120px minmax(120px, 240px);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.generation-state {
  grid-column: 1 / -1;
  margin: 0;
}
.generate-form input:disabled {
  color: #738397;
  background: #edf1f5;
}
.card-batch-panel { background: #fff; }
.card-batch-list {
  display: grid;
  gap: 6px;
  overflow: hidden;
  border: 1px solid #e1e7ed;
  border-radius: 14px;
  background: #fff;
}
.card-batch-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, .8fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f4;
  background: #fff;
}
.card-batch-item:last-child { border-bottom: 0; }
.card-batch-item:hover { background: #f8fbfd; }
.card-batch-item.selected { background: #edf7ff; box-shadow: inset 3px 0 #1475f6; }
.card-batch-main { display: grid; gap: 4px; min-width: 0; }
.card-batch-main strong { overflow: hidden; color: #183148; text-overflow: ellipsis; white-space: nowrap; }
.card-batch-main > span { color: #607286; font-size: 12px; }
.card-batch-main > small { color: #8290a0; font-size: 11px; }
.replacement-batch-note {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #b9ddff;
  border-radius: 999px;
  color: #17639a;
  background: #eef8ff;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-batch-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 7px;
}
.card-batch-counts b {
  display: grid;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 11px;
  color: #1d3c55;
  background: #eef3f7;
  text-align: center;
}
.card-batch-counts small { color: #738397; font-size: 10px; font-weight: 600; }
.active-batch-filter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #174f7b;
  background: #edf7ff;
}

@media (max-width: 900px) {
  .card-batch-item { grid-template-columns: 1fr; align-items: stretch; }
  .card-batch-actions { justify-self: start; }
}

@media (max-width: 680px) {
  .routing-mode-grid { grid-template-columns: 1fr; }
  .generate-form { grid-template-columns: 1fr; }
  .generate-form > label,
  .generate-form > button,
  .generation-advanced,
  .generation-state { grid-column: 1 / -1; }
  .generation-advanced label { grid-template-columns: 1fr; }
  .card-batch-counts { grid-template-columns: repeat(2, 1fr); }
}

/* Keep the routing console responsive after its component styles. */
@media (max-width: 900px) {
  .routing-control-grid { grid-template-columns: 1fr; }
  .routing-status-hero { align-items: flex-start; flex-direction: column; }
  .routing-live-badges { justify-content: flex-start; max-width: none; }
}

@media (max-width: 680px) {
  .routing-mode-grid { grid-template-columns: 1fr; }
  .routing-overflow-box { grid-template-columns: 1fr; }
  .routing-status-hero { padding: 18px; }
  .routing-live-mode { align-items: flex-start; }
  .routing-status-icon { flex-basis: 44px; width: 44px; height: 44px; }
  .routing-live-mode h3 { font-size: 22px; }
  .routing-mode-card { min-height: 102px; }
  .routing-worker-card header { grid-template-columns: 38px minmax(0, 1fr); }
  .routing-worker-role { width: 38px; height: 38px; }
  .routing-worker-state { grid-column: 2; justify-self: start; }
}
