:root {
  color-scheme: light;
  --green: #228b22;
  --green-dark: #166534;
  --green-soft: #f0fdf4;
  --pink: #f28bbd;
  --ink: #1f2937;
  --muted: #718096;
  --line: rgba(34,139,34,.14);
  --soft-line: #dbeee2;
  --bg: #f8fff9;
  --danger: #b42318;
  --warning: #a85b10;
  font-family: "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* The public shell follows the original flower template: quiet green surface, pink title accent, and no extra hero copy. */
.public-site-shell { min-height: 100vh; background: radial-gradient(circle at 20% 32%, rgba(255,182,193,.08), transparent 24%), linear-gradient(135deg, #f0fdf4 0%, #fff 48%, #fff7fa 100%); }
.public-oss-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(34,139,34,.08); background: rgba(255,255,255,.86); box-shadow: 0 4px 16px rgba(34,139,34,.06); backdrop-filter: blur(12px); }
.public-oss-header-inner { width: min(1320px, calc(100vw - 96px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.public-oss-brand { display: inline-flex; align-items: center; gap: 14px; }
.public-oss-brand-copy strong { color: var(--green); font-size: 25px; font-weight: 900; line-height: 1; }
.public-brand-en { font-weight: 900; }
.public-flower-logo { position: relative; display: inline-block; flex: none; width: 34px; height: 34px; }
.public-flower-logo i { position: absolute; top: 7px; left: 7px; width: 20px; height: 20px; border-radius: 0 100% 0 100%; background: linear-gradient(135deg,#ffb6c1,#ffc0cb); }
.public-flower-logo i:nth-child(1) { transform: rotate(0); }.public-flower-logo i:nth-child(2) { transform: rotate(72deg); }.public-flower-logo i:nth-child(3) { transform: rotate(144deg); }.public-flower-logo i:nth-child(4) { transform: rotate(216deg); }.public-flower-logo i:nth-child(5) { transform: rotate(288deg); }
.public-flower-logo b { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: #ffe4b5; transform: translate(-50%,-50%); }
.public-oss-nav { display: flex; align-items: center; gap: 34px; }
.public-oss-nav-link { min-height: 38px; padding: 0; display: inline-flex; align-items: center; color: #374151; font-size: 16px; font-weight: 700; border-bottom: 3px solid transparent; transition: color 180ms ease, transform 180ms ease, border-color 180ms ease; }
.public-oss-nav-link:hover, .public-oss-nav-link[data-current="true"] { color: var(--green); border-bottom-color: var(--green); transform: translateY(-1px); }
.public-mobile-menu-button { display: none; width: 40px; height: 36px; padding: 8px; border: 1px solid var(--soft-line); border-radius: 8px; background: #fff; }
.public-mobile-menu-button span, .public-mobile-menu-button span::before, .public-mobile-menu-button span::after { display: block; height: 2px; background: var(--ink); content: ""; }.public-mobile-menu-button span::before { transform: translateY(-6px); }.public-mobile-menu-button span::after { transform: translateY(4px); }

.public-route-stage { position: relative; min-height: calc(100vh - 76px); }
.public-stage { min-height: calc(100vh - 76px); padding: 76px 20px 72px; }
.public-card { width: min(960px, 100%); margin: 0 auto; }
.public-card-header { display: grid; justify-items: center; padding: 0 24px 48px; }
.public-header-intro { text-align: center; }
.public-header-intro h1 { margin: 0; font-size: clamp(56px, 7vw, 92px); font-weight: 900; line-height: 1.05; letter-spacing: 0; }
.public-title-main { color: var(--ink); }.public-title-accent { color: var(--pink); }.public-header-intro p { margin: 24px 0 0; color: #526174; font-size: 20px; font-weight: 700; }
.wizard-steps { width: min(720px, 100%); margin-top: 52px; display: grid; grid-template-columns: repeat(4,1fr); position: relative; }
.wizard-steps::before { position: absolute; top: 29px; left: 12.5%; right: 12.5%; height: 3px; content: ""; background: #d8e9f1; }
.wizard-step { position: relative; z-index: 1; display: grid; justify-items: center; gap: 11px; color: #91a4bb; font-weight: 750; }
.wizard-step-dot { width: 58px; height: 58px; display: grid; place-items: center; border: 3px solid #d8e9f1; border-radius: 50%; color: #91a4bb; background: #fff; font-size: 24px; font-style: normal; }
.wizard-step[data-active="true"] { color: var(--green); }.wizard-step[data-active="true"] .wizard-step-dot { border-color: var(--green); color: #fff; background: var(--green); box-shadow: 0 0 0 9px rgba(34,139,34,.08); }.wizard-step[data-completed="true"] { color: var(--green); }.wizard-step[data-completed="true"] .wizard-step-dot { border-color: #90ee90; color: var(--green); background: rgba(144,238,144,.22); }
.public-card-body { width: min(760px,100%); margin: 0 auto; }.wizard-panel { padding: 30px; border: 1px solid var(--soft-line); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 20px 50px rgba(34,139,34,.08); animation: flower-section-in 360ms ease-out both; }
.public-field { display: block; }.public-field > span, .public-field-label { display: block; margin: 0 0 10px; color: var(--ink); font-size: 14px; font-weight: 850; }.public-input { width: 100%; min-height: 68px; padding: 0 22px; border: 1px solid #d8e9dc; border-radius: 17px; outline: none; color: var(--ink); background: #fff; box-shadow: 0 1px 0 rgba(34,139,34,.02); transition: border-color 180ms ease, box-shadow 180ms ease; }.public-input:focus { border-color: #90c995; box-shadow: 0 0 0 4px rgba(144,238,144,.18); }.public-input::placeholder { color: #aab4c2; }.public-input--token { min-height: 190px; padding: 16px 18px; resize: vertical; font: 13px/1.6 Consolas, monospace; }
.public-tip-box { margin-top: 24px; padding: 12px 16px; border: 1px solid rgba(255,166,80,.42); border-radius: 13px; color: var(--warning); background: #fff9f0; line-height: 1.5; font-size: 14px; font-weight: 700; }.public-tip-box p { margin: 0; }.public-tip-box strong { display: block; margin-bottom: 4px; }.public-tip-box--danger-soft { border-color: rgba(180,35,24,.2); color: var(--danger); background: #fff3f2; }.public-tip-box--warning { margin-top: 26px; }
.token-guide-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }.token-guide-heading { color: var(--ink); font-size: 20px; font-weight: 900; }.token-guide-heading--confirm { margin-bottom: 24px; }.token-guide-tutorial-button, .token-guide-action { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: var(--green); font-size: 13px; font-weight: 800; }.token-guide-tutorial-button { border: 1px solid var(--green); color: var(--green); background: #fff; }.token-guide { display: grid; gap: 18px; margin: 24px 0; }.token-guide-step { display: flex; align-items: flex-start; gap: 12px; }.token-guide-step--spaced { padding-top: 3px; }.token-guide-check { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 1px solid #b9dfc0; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 900; }.token-guide-step-content { display: grid; gap: 9px; }.token-guide-step-content strong { line-height: 1.5; }.token-guide-action { width: fit-content; }.public-field--token { margin-top: 26px; }.form-error { min-height: 20px; margin: 8px 0 -8px; color: var(--danger); font-size: 13px; font-weight: 700; }
.public-summary-list { margin: 0; border-top: 1px solid #edf3ed; }.public-summary-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid #edf3ed; }.public-summary-list dt { color: var(--muted); }.public-summary-list dd { max-width: 70%; margin: 0; text-align: right; overflow-wrap: anywhere; font-weight: 850; }
.public-card-footer { width: min(760px,100%); min-height: 60px; margin: 16px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }.public-card-query-shortcut, .public-primary-button, .public-ghost-button, .public-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; font-weight: 850; transition: transform 180ms ease, background 180ms ease, border-color 180ms ease; }.public-card-query-shortcut { border: 2px solid var(--green); color: var(--green); background: #fff; }.public-card-query-shortcut:hover, .public-ghost-button:hover { background: var(--green-soft); transform: translateY(-1px); }.public-footer-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }.public-primary-button { border: 1px solid var(--green); color: #fff; background: var(--green); box-shadow: 0 12px 24px rgba(34,139,34,.15); }.public-primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }.public-ghost-button { border: 1px solid var(--green); color: var(--green); background: #fff; }
.public-status-strip { width: min(660px,100%); margin: 22px auto 0; padding: 14px 18px; display: flex; align-items: center; gap: 14px; border: 1px solid #e7efe9; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(35,91,64,.04); }.public-status-strip i { width: 11px; height: 11px; flex: none; border-radius: 50%; background: #aeb9c1; box-shadow: 0 0 0 5px #f1f4f3; }.public-status-strip i.success { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }.public-status-strip i.active { background: #2a6f9d; box-shadow: 0 0 0 5px #eaf4fa; }.public-status-strip i.error { background: var(--danger); box-shadow: 0 0 0 5px #fff0f2; }.public-status-strip i.warning { background: var(--warning); box-shadow: 0 0 0 5px #fff7ed; }.public-status-strip strong, .public-status-strip span { display: block; }.public-status-strip span { margin-top: 3px; color: var(--muted); font-size: 13px; }.public-status-strip b { margin-left: auto; color: #718096; font: 700 11px Consolas, monospace; }
.wizard-panel--result { min-height: 460px; display: grid; place-items: center; }.public-result-card { width: min(560px,100%); min-height: 320px; padding: 40px 24px; display: grid; place-items: center; align-content: center; gap: 13px; border: 1px solid #e2efe5; border-radius: 18px; text-align: center; background: #fff; }.public-result-card strong { font-size: 27px; }.public-result-card p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.6; }.public-result-card > span { color: #8a98a4; font-size: 13px; }.public-result-card-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 40px; }.public-result-card--processing { background: linear-gradient(180deg,#fff,#fbfdff); }.public-result-card--processing .public-result-card-icon { color: #54a8c8; background: #eef9ff; }.public-processing-spinner { width: 43px; height: 43px; display: block; border: 3px solid #cfeef8; border-top-color: #4aaed8; border-radius: 50%; animation: spin .9s linear infinite; }.public-result-card--success .public-result-card-icon { background: var(--green); }.public-result-card--danger .public-result-card-icon { background: var(--danger); }.public-result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }.public-link { min-height: 40px; padding: 0 16px; border: 1px solid var(--green); color: var(--green); background: #fff; }.public-link:hover { color: #fff; background: var(--green); }.public-message { position: fixed; top: 22px; left: 50%; z-index: 50; display: none; transform: translateX(-50%); padding: 13px 18px; border: 1px solid rgba(34,139,34,.15); border-radius: 999px; color: var(--green); background: #f0fbf5; box-shadow: 0 18px 44px rgba(15,23,42,.12); font-weight: 800; }.public-message.is-visible { display: block; }

/* Old backstage workspace: same restrained flower palette, with the original five work areas kept as separate views. */
.admin-page { min-height: 100vh; background: #f8fff9; }.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }.login-panel { width: min(430px,100%); padding: 34px; border: 1px solid var(--soft-line); border-radius: 16px; background: #fff; box-shadow: 0 20px 50px rgba(34,139,34,.08); }.login-panel h1 { margin: 12px 0 8px; font-size: 30px; }.login-panel p { color: var(--muted); }.login-panel .eyebrow, .section-eyebrow { color: var(--green); font: 850 11px/1.2 Consolas, monospace; letter-spacing: .12em; }.input-label { display: block; margin: 20px 0 8px; font-weight: 800; }.login-panel input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #d8e9dc; border-radius: 10px; }.full-button { width: 100%; margin-top: 20px; }
.admin-shell { min-height: 100vh; }.backstage-topbar { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(34,139,34,.1); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }.backstage-topbar-inner { width: min(1360px,calc(100% - 64px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; gap: 30px; }.backstage-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 25px; white-space: nowrap; }.backstage-brand .public-flower-logo { transform: scale(.8); }.backstage-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }.backstage-nav-button, .backstage-refresh-button, .backstage-logout-button { min-height: 40px; flex: 0 0 auto; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; color: #53647b; background: transparent; font-weight: 800; white-space: nowrap; }.backstage-nav-button[data-active="true"] { border-color: #bfe4c7; color: var(--green); background: var(--green-soft); }.backstage-refresh-button { width: 42px; padding: 0; border-color: var(--soft-line); font-size: 20px; }.backstage-logout-button { color: var(--green); }
.backstage-main { width: min(1360px,calc(100% - 64px)); margin: 22px auto 60px; }.backstage-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }.backstage-stat-card { min-height: 114px; padding: 20px 22px; border: 1px solid var(--soft-line); border-radius: 12px; background: #fff; }.backstage-stat-card span { display: block; color: var(--muted); font-weight: 750; }.backstage-stat-card strong { display: block; margin-top: 8px; font-size: 32px; }.backstage-panel { margin-top: 20px; padding: 28px; border: 1px solid var(--soft-line); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(34,139,34,.04); }.backstage-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }.backstage-panel h1, .backstage-panel h2 { margin: 5px 0 8px; }.backstage-panel h1 { font-size: 27px; }.backstage-panel h2 { font-size: 19px; }.backstage-panel p { margin: 0; color: var(--muted); }.backstage-count { display: grid; place-items: center; min-width: 70px; padding: 8px; border: 1px solid #cfe6d5; border-radius: 10px; color: var(--green); }.backstage-count strong { font-size: 22px; }.backstage-toolbar, .backstage-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 24px 0 20px; padding: 14px; border: 1px solid #edf4ef; border-radius: 10px; background: #fbfefc; }.backstage-form label { display: grid; gap: 6px; color: #53647b; font-size: 12px; font-weight: 800; }.backstage-form label.grow { flex: 1 1 230px; }.backstage-form input, .backstage-form select, .backstage-toolbar input, .backstage-toolbar select { min-height: 42px; padding: 0 12px; border: 1px solid #cfe4d4; border-radius: 9px; background: #fff; }.backstage-toolbar input { margin-left: auto; }.backstage-primary-button, .backstage-green-action { min-height: 43px; padding: 0 18px; border: 1px solid var(--green); border-radius: 999px; color: #fff; background: var(--green); font-weight: 850; box-shadow: 0 9px 20px rgba(34,139,34,.14); }.backstage-plain-button { min-height: 40px; padding: 0 15px; border: 1px solid var(--green); border-radius: 999px; color: var(--green); background: #fff; font-weight: 800; }.backstage-table-scroll { overflow-x: auto; border: 1px solid var(--soft-line); border-radius: 10px; }.backstage-table { width: 100%; min-width: 950px; border-collapse: collapse; font-size: 13px; }.backstage-table th, .backstage-table td { padding: 13px 14px; border-bottom: 1px solid #edf3ee; text-align: left; white-space: nowrap; }.backstage-table th { color: #64748b; background: #fbfefc; }.backstage-table tbody tr:hover { background: #fcfffd; }.backstage-status-badge, .backstage-inline-stat { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid #dbeee2; border-radius: 999px; color: #64748b; background: #f5faf6; font-size: 12px; font-weight: 800; }.backstage-status-badge[data-status="completed"], .backstage-status-badge[data-status="unused"], .backstage-status-badge[data-status="active"] { border-color: #bfe4c7; color: var(--green); background: var(--green-soft); }.backstage-status-badge[data-status="failed"], .backstage-status-badge[data-status="disabled"] { color: var(--danger); background: #fff3f2; }.backstage-table-action { padding: 5px 8px; border: 0; color: var(--green); background: transparent; font-weight: 800; }.backstage-table-action.danger { color: var(--danger); }.backstage-empty-cell { height: 100px; color: var(--muted); text-align: center !important; }.backstage-log-details { max-width: 280px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }.backstage-payment-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid #edf3ee; }.backstage-payment-card strong { display: block; }.backstage-payment-card span { color: var(--muted); font-size: 13px; }.backstage-switch { display: inline-flex; align-items: center; gap: 9px; color: #53647b; font-weight: 800; }.backstage-switch input { width: 38px; height: 22px; accent-color: var(--green); }.backstage-note { margin: 16px 0; padding: 13px 16px; border: 1px solid rgba(255,166,80,.42); border-radius: 11px; color: var(--warning); background: #fff9f0; font-size: 13px; }.backstage-modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(17,24,39,.35); }.backstage-modal { width: min(620px,100%); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; border-radius: 14px; background: #fff; box-shadow: 0 24px 72px rgba(17,24,39,.22); }.backstage-modal h3 { margin-top: 0; }.backstage-modal input, .backstage-modal textarea, .backstage-modal select { width: 100%; min-height: 44px; margin: 6px 0 12px; padding: 10px 12px; border: 1px solid #cfe4d4; border-radius: 9px; }.backstage-modal textarea { min-height: 180px; resize: vertical; }.backstage-modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 16px; }.secret-dialog { width: min(600px,calc(100% - 30px)); padding: 24px; border: 1px solid var(--soft-line); border-radius: 14px; }.secret-dialog textarea { width: 100%; min-height: 220px; margin: 18px 0; padding: 12px; }
@keyframes flower-section-in { from { opacity: 0; transform: translateY(16px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } } @keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) { .public-oss-header-inner { width: min(100% - 32px,760px); }.public-stage { padding-top: 52px; }.backstage-topbar-inner, .backstage-main { width: calc(100% - 32px); }.backstage-stats-grid { gap: 10px; }.backstage-stat-card { padding: 16px; } }
@media (max-width: 700px) { .public-oss-header-inner { min-height: 64px; }.public-mobile-menu-button { display: block; }.public-oss-nav { display: none; position: absolute; top: 64px; left: 16px; right: 16px; padding: 8px 14px; flex-direction: column; align-items: stretch; gap: 0; border: 1px solid var(--soft-line); border-radius: 10px; background: #fff; box-shadow: 0 16px 40px rgba(34,139,34,.12); }.public-oss-nav[data-open="true"] { display: flex; }.public-oss-nav-link { min-height: 44px; border-bottom: 1px solid #edf3ee; }.public-stage { padding: 34px 10px 50px; }.public-card-header { padding: 0 0 32px; }.public-header-intro h1 { font-size: clamp(42px,12vw,64px); }.public-header-intro p { margin-top: 15px; font-size: 16px; }.wizard-steps { margin-top: 36px; }.wizard-step { gap: 7px; font-size: 12px; }.wizard-step-dot { width: 46px; height: 46px; font-size: 19px; }.wizard-steps::before { top: 23px; }.wizard-panel { padding: 22px 17px; border-radius: 14px; }.public-input { min-height: 60px; padding-inline: 16px; }.public-card-footer { align-items: stretch; }.public-card-query-shortcut, .public-primary-button, .public-ghost-button { min-height: 44px; padding-inline: 15px; font-size: 14px; }.public-status-strip b { display: none; }.backstage-topbar-inner { min-height: 66px; flex-wrap: wrap; gap: 10px; padding: 10px 0; }.backstage-brand { font-size: 20px; }.backstage-actions { width: 100%; overflow-x: auto; margin-left: 0; }.backstage-nav-button { flex: 0 0 auto; }.backstage-stats-grid { grid-template-columns: repeat(2,1fr); }.backstage-panel { padding: 20px 14px; }.backstage-panel-head { align-items: flex-start; }.backstage-toolbar input { width: 100%; margin-left: 0; }.backstage-form { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }.backstage-form label.grow, .backstage-form .backstage-primary-button { grid-column: 1 / -1; }.backstage-payment-card { grid-template-columns: 1fr; } }
@media (max-width: 430px) { .public-card-footer { flex-direction: column-reverse; }.public-footer-actions { width: 100%; margin: 0; }.public-footer-actions > * { flex: 1; }.public-card-query-shortcut { width: fit-content; }.public-summary-list div { display: block; }.public-summary-list dd { max-width: none; margin-top: 6px; text-align: left; }.backstage-form { grid-template-columns: 1fr; }.backstage-form label.grow, .backstage-form .backstage-primary-button { grid-column: auto; } }
/* Error toast tone used by admin actions. */
.public-message.is-error { border-color: rgba(180,35,24,.18); color: var(--danger); background: #fff3f2; }

.login-panel .input-label + input { margin-bottom: 4px; }
.backstage-task-table { min-width: 1260px; }
.backstage-task-main-row td { padding-block: 12px; vertical-align: middle; }
.backstage-task-table th:nth-child(5), .backstage-task-table td:nth-child(5) { min-width: 280px; max-width: 360px; white-space: normal; }
.backstage-task-current-state { color: #34445a; font-weight: 800; line-height: 1.45; }
.backstage-task-current-state[data-status="completed"] { color: var(--green); }
.backstage-task-current-state[data-status="failed"], .backstage-task-current-state[data-status="rejected_subscription"], .backstage-task-current-state[data-status="rejected_token_expired"], .backstage-task-current-state[data-status="cancelled"] { color: var(--danger); }
.backstage-task-actions { min-width: 224px; white-space: normal !important; }
.backstage-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.backstage-action-grid .backstage-table-action { width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid #dcece0; border-radius: 6px; background: #f8fcf9; text-align: center; }
.backstage-action-grid .backstage-table-action:hover { border-color: #bfe0c6; background: #eef8f0; }
.backstage-action-grid .backstage-copy-token--invalid,
.backstage-action-grid .backstage-copy-token--invalid:disabled { border-color: #efc8c5; color: #b04d4a; background: #fff1f0; opacity: 1; }
.backstage-action-grid .backstage-copy-token--invalid:hover:not(:disabled) { border-color: #dfa6a2; color: #943f3b; background: #ffe7e5; }
.backstage-copy-value { max-width: 270px; overflow-wrap: anywhere; white-space: normal !important; user-select: text; }
.backstage-copy-code { max-width: 320px; padding: 4px 6px; border: 0; border-radius: 5px; color: #24415f; background: transparent; font: inherit; text-align: left; overflow-wrap: anywhere; white-space: normal; cursor: copy; }
.backstage-copy-code:hover { color: var(--green); background: #eef8f0; }
.backstage-modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.backstage-modal-heading h3 { margin: 4px 0 6px; }
.backstage-modal-heading p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.backstage-modal-close { width: 36px; height: 36px; flex: none; border: 1px solid #dce8df; border-radius: 50%; color: #53647b; background: #fff; font-size: 24px; line-height: 1; }
.backstage-task-log-modal { width: min(760px,100%); overflow: hidden; }
.backstage-task-log-list { display: grid; gap: 0; max-height: min(68vh,680px); margin: 22px 0 0; padding: 0 8px 0 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.backstage-task-log-list li { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 14px; padding: 12px 4px; border-bottom: 1px solid #e7f0e9; }
.backstage-task-log-list time { color: #7b8998; font-size: 12px; }
.backstage-task-log-list li > div { display: grid; gap: 3px; min-width: 0; }
.backstage-task-log-list b { color: #65758a; font-size: 11px; font-weight: 800; }
.backstage-task-log-list strong { color: #27364a; font-size: 14px; }
.backstage-task-log-list span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.backstage-task-log-details { white-space: pre-wrap; }
.backstage-task-log-details.is-empty { color: #9aa6b2; font-style: italic; }
.backstage-task-log-list li[data-level="error"] { background: #fff7f6; }
.backstage-task-log-list li[data-level="error"] b, .backstage-task-log-list li[data-level="error"] strong { color: var(--danger); }
.backstage-task-log-list li[data-level="warning"] b { color: var(--warning); }
@media (max-width: 700px) { .backstage-task-log-list li { grid-template-columns: 1fr; gap: 5px; } }
.backstage-status-badge[data-status="awaiting_token"] { color: #2a6f9d; background: #eef9ff; }
.backstage-status-badge[data-status="cancelled"], .backstage-status-badge[data-status="rejected_token_expired"], .backstage-status-badge[data-status="rejected_subscription"] { color: var(--danger); background: #fff3f2; }
.backstage-smtp-form { align-items: end; }
.backstage-smtp-form > label { flex: 1 1 180px; }
.backstage-smtp-form > label.grow { flex-basis: 280px; }
.backstage-monitor-switches { align-items: center; }
.backstage-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-left: auto; }
.backstage-parse-status { min-height: 22px; margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.backstage-parse-status.success { color: var(--green); font-weight: 800; }
.backstage-worker-form { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.backstage-worker-form input { min-width: 240px; margin: 0; }

/* Public recharge flow: preserve the original layout while aligning later steps and live status. */
.public-route-stage[data-step]:not([data-step="1"]) .public-header-intro { display: none; }
.public-route-stage[data-step]:not([data-step="1"]) .public-stage:not(.public-stage--query) { padding-top: 38px; }
.public-route-stage[data-step]:not([data-step="1"]) .public-card-header { padding-bottom: 42px; }
.public-route-stage[data-step]:not([data-step="1"]) .wizard-steps { margin-top: 0; }
.public-field-title-row { display: flex !important; align-items: center; justify-content: space-between; gap: 18px; }
.public-availability { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; }
.public-availability i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #9aa6b2; box-shadow: 0 0 0 4px #eef2f3; }
.public-availability[data-state="online"] { color: var(--green); }
.public-availability[data-state="online"] i { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.public-availability[data-state="offline"] { color: var(--danger); }
.public-availability[data-state="offline"] i { background: var(--danger); box-shadow: 0 0 0 4px #fff0f2; }
.public-card-footer > .public-primary-button { margin-left: auto; }
.public-card-footer[data-step="4"] { display: none; }
.public-result-card { width: min(620px,100%); min-height: 400px; }
#result-message { min-height: 25px; color: #34445a; font-size: 16px; font-weight: 800; }
#result-message[data-level="warning"] { color: var(--warning); }
#result-message[data-level="error"] { color: var(--danger); }
.membership-dialog { width: min(430px,calc(100vw - 32px)); padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 22px 70px rgba(15,23,42,.2); }
.membership-dialog::backdrop { background: rgba(15,23,42,.38); }
.membership-dialog-body { padding: 30px 28px 26px; text-align: center; }
.membership-dialog-icon { width: 52px; height: 52px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--warning); font-size: 28px; font-weight: 900; }
.membership-dialog h2 { margin: 0 0 12px; font-size: 22px; }
.membership-dialog p { margin: 7px 0; color: var(--muted); line-height: 1.65; }
.membership-dialog .public-primary-button { width: 100%; margin-top: 20px; }
.public-result-timeline { width: min(520px,100%); margin: 8px 0 0; padding: 4px 0 4px 26px; list-style: none; text-align: left; }
.public-result-timeline li { position: relative; min-height: 38px; padding: 0 0 16px 18px; border-left: 2px solid #cfe6d5; color: #445266; }
.public-result-timeline li:last-child { min-height: 22px; padding-bottom: 0; border-left-color: transparent; }
.public-result-timeline li::before { position: absolute; top: 2px; left: -6px; width: 10px; height: 10px; content: ""; border: 2px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px #bfe4c7; }
.public-result-timeline li[data-level="error"] { color: var(--danger); border-left-color: #efb4ad; }
.public-result-timeline li[data-level="error"]::before { background: var(--danger); box-shadow: 0 0 0 1px #efb4ad; }
.public-result-timeline li[data-level="warning"]::before { background: var(--warning); }
.public-result-timeline strong, .public-result-timeline time { display: block; }
.public-result-timeline strong { font-size: 14px; line-height: 1.45; }
.public-result-timeline time { margin-top: 3px; color: #8a98a4; font-size: 11px; }

.public-stage--query { padding-top: 58px; }
.public-page-title--query { margin-bottom: 30px; text-align: center; }
.public-page-title--query h1 { margin: 0; color: var(--ink); font-size: 34px; }
.public-card--query { width: min(1120px,100%); }
.public-query-panel { padding: 34px; }
.public-query-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 14px; }
.public-query-input { height: 52px; min-height: 52px; max-height: 260px; display: block; padding: 12px 18px; resize: vertical; overflow-y: auto; line-height: 1.5; }
.public-query-form .public-primary-button { min-width: 138px; min-height: 52px; margin-bottom: 0; border-radius: 12px; }
.public-query-result { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e4efe6; }
.public-query-result-head { min-height: 42px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.public-query-result-head h2 { margin: 0; font-size: 20px; }
.public-query-result-actions { display: flex; align-items: center; gap: 10px; }
.public-query-filters { display: inline-flex; padding: 3px; border: 1px solid #dceadf; border-radius: 8px; background: #f7fbf8; }
.public-query-filters button, .public-query-copy { min-height: 34px; padding: 0 13px; border: 0; border-radius: 6px; color: #607086; background: transparent; font-size: 13px; font-weight: 800; }
.public-query-filters button[data-active="true"] { color: #fff; background: var(--green); box-shadow: 0 3px 10px rgba(34,139,34,.16); }
.public-query-copy { border: 1px solid #cfe4d4; color: var(--green); background: #fff; }
.public-query-copy:hover { background: var(--green-soft); }
.public-query-table-scroll { width: 100%; overflow-x: auto; padding-bottom: 7px; outline: none; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.public-query-table-scroll:focus-visible { box-shadow: 0 0 0 3px rgba(144,238,144,.2); }
.public-query-table { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; }
.public-query-table th, .public-query-table td { padding: 14px 16px; border-bottom: 1px solid #e6efe8; text-align: center; vertical-align: middle; }
.public-query-table th { color: #65758a; background: #f7fbf8; font-size: 12px; font-weight: 850; white-space: nowrap; }
.public-query-table th:first-child { width: 30%; }.public-query-table th:nth-child(2) { width: 14%; }.public-query-table th:nth-child(3) { width: 33%; }.public-query-table th:nth-child(4) { width: 23%; }
.public-query-table td { color: #334155; font-size: 14px; }
.public-query-table-code { font: 700 13px/1.4 Consolas, monospace; text-align: center; overflow-wrap: anywhere; }
.public-query-table-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 850; white-space: nowrap; }
.public-query-table-status::before { width: 8px; height: 8px; content: ""; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.public-query-table-status[data-status="used"] { color: var(--danger); }
.public-query-table-status[data-status="used"]::before { background: var(--danger); box-shadow: 0 0 0 4px #fff0f2; }
.public-query-empty { height: 100px; color: var(--muted) !important; text-align: center !important; }

.video-guide-dialog { width: min(1120px,calc(100vw - 40px)); max-width: none; max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 12px; overflow: visible; background: transparent; }
.video-guide-dialog::backdrop { background: rgba(17,24,39,.72); backdrop-filter: blur(5px); }
.video-guide-frame { position: relative; width: 100%; margin: auto; padding: 50px 16px 16px; border-radius: 12px; background: #101513; box-shadow: 0 28px 90px rgba(0,0,0,.38); }
.video-guide-frame[data-variant="mobile"] { width: min(430px,calc(100vw - 40px)); }
.video-guide-heading { position: absolute; top: 0; left: 0; right: 0; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 18px; color: #fff; }
.video-guide-heading h2 { margin: 0; font-size: 16px; }
.video-guide-heading button { width: 36px; height: 36px; padding: 0; border: 0; color: #fff; background: transparent; font-size: 28px; line-height: 1; }
.video-guide-frame video { width: 100%; aspect-ratio: 16 / 9; display: block; border-radius: 7px; background: #000; }
.video-guide-frame[data-variant="mobile"] video { aspect-ratio: 9 / 16; max-height: calc(100vh - 90px); object-fit: contain; }

@media (max-width: 700px) {
  .public-route-stage[data-step]:not([data-step="1"]) .public-stage:not(.public-stage--query) { padding-top: 24px; }
  .public-route-stage[data-step]:not([data-step="1"]) .public-card-header { padding-bottom: 30px; }
  .public-field-title-row { gap: 10px; }
  .public-availability { font-size: 12px; }
  .public-card-footer { flex-direction: row; align-items: center; }
  .public-card-footer > .public-primary-button { margin-left: auto; }
  .public-card-footer > button { flex: 0 1 auto; }
  .public-stage--query { padding-top: 34px; }
  .public-query-panel { padding: 22px 17px; }
  .public-query-form { grid-template-columns: 1fr; }
  .public-query-form .public-primary-button { width: 100%; min-height: 48px; margin-bottom: 0; border-radius: 999px; }
  .public-query-result-head { align-items: flex-start; flex-direction: column; }
  .public-query-result-actions { width: 100%; justify-content: space-between; overflow-x: auto; }
  .public-query-filters { flex: 0 0 auto; }
  .public-query-table { min-width: 730px; }
  .public-query-table th:first-child { width: 27%; }
  .public-query-table th:nth-child(2) { width: 15%; }
  .public-query-table th:nth-child(3) { width: 34%; }
  .public-query-table th:nth-child(4) { width: 24%; }
  .public-result-card { padding: 30px 17px; }
  .public-result-timeline { padding-left: 12px; }
  .video-guide-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .video-guide-frame { padding: 46px 8px 8px; }
  .video-guide-frame[data-variant="mobile"] { width: calc(100vw - 20px); }
}

/* Filter, pagination, and payment-card refinements. */
.backstage-payment-summary-shell { display: none; margin-bottom: 20px; }
.admin-shell[data-current-view="payment"] .backstage-payment-summary-shell { display: block; }
.backstage-haifu-summary > div { border-color: var(--soft-line); background: #fff; }
.backstage-payment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.backstage-payment-meta .backstage-payment-remaining { color: #b66b00; }
.backstage-payment-meta .backstage-payment-priority { color: var(--green); font-weight: 850; }
.backstage-payment-meta .backstage-payment-balance { color: #2f9e44; }
.backstage-payment-card--unusable { border-color: #e1e4e7; background: #f3f4f6; opacity: .72; }
.backstage-payment-card--unusable strong, .backstage-payment-card--unusable .backstage-payment-meta { color: #8a929a; }
.backstage-cdk-table th select { display: block; min-width: 74px; margin: 5px auto 0; padding: 3px 20px 3px 6px; border: 1px solid #d7e9dc; border-radius: 6px; color: #53647b; background: #fff; font-size: 11px; }
.backstage-queue-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-left: auto; }
.backstage-queue-head-actions select { min-height: 42px; padding: 0 28px 0 10px; border: 1px solid #cfe4d4; border-radius: 9px; color: #53647b; background: #fff; }
.backstage-queue-head-actions input { width: 230px; margin-left: 0; }
.backstage-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 14px; color: #64748b; font-size: 13px; }
.backstage-pagination button:disabled { color: #a8b3bd; border-color: #e5eaed; background: #f7f8f9; cursor: not-allowed; }
.backstage-table th, .backstage-table td { padding-block: 8px; }
.backstage-task-table .backstage-task-main-row td { padding-block: 8px; }
@media (max-width: 700px) {
  .backstage-queue-head-actions { width: 100%; justify-content: flex-start; margin: 10px 0 0; }
  .backstage-queue-head-actions input { flex: 1 1 160px; width: auto; }
  .backstage-cdk-table th select { max-width: 84px; }
}

.backstage-status-badge[data-status="completed"] { border-color: #f0b8b3; color: var(--danger); background: #fff3f2; }
.backstage-status-badge[data-status="unused"] { border-color: #bfe4c7; color: var(--green); background: var(--green-soft); }
.backstage-status-badge[data-status="retryable"] { border-color: #efd49b; color: #9a6200; background: #fff8df; }
.backstage-cdk-toolbar { flex-wrap: nowrap; align-items: center; overflow-x: auto; }
.backstage-cdk-toolbar h2, .backstage-cdk-toolbar .backstage-plain-button { flex: 0 0 auto; }
.backstage-cdk-toolbar #cdk-search { width: min(290px,32vw); min-width: 220px; }
.backstage-batch-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; min-height: 40px; padding: 3px 5px 3px 11px; border: 1px solid #d9e9dd; border-radius: 8px; background: #fff; }
.backstage-batch-actions[hidden] { display: none; }
.backstage-batch-actions strong { min-width: 38px; color: #53647b; font-size: 12px; }
.backstage-batch-actions button { min-height: 32px; padding: 0 9px; border: 0; border-radius: 6px; color: var(--green); background: transparent; font-weight: 800; }
.backstage-batch-actions button:hover { background: var(--green-soft); }
.backstage-batch-actions button.danger { color: var(--danger); }
.backstage-batch-actions button.danger:hover { background: #fff3f2; }
.backstage-select-cell { width: 44px; padding-right: 6px !important; text-align: center !important; }
.backstage-select-cell input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); cursor: pointer; }
.backstage-cdk-table tbody tr[data-selected="true"] { background: #f3faf5; }
.backstage-payment-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.backstage-payment-card .backstage-payment-failures { display: block; margin-top: 5px; color: var(--danger); font-weight: 850; }
.backstage-payment-total { display: grid; min-width: 142px; padding-right: 14px; text-align: right; }
.backstage-payment-total small { color: var(--muted); font-size: 11px; font-weight: 800; }
.backstage-payment-total strong { margin-top: 2px; color: var(--green); font-size: 24px; }
.backstage-auto-open-modal { width: min(560px,100%); }
.backstage-auto-open-modal > label { display: grid; gap: 6px; margin-top: 14px; color: #53647b; font-size: 12px; font-weight: 800; }
.backstage-auto-open-modal > label input { margin: 0; }
.backstage-auto-open-summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid #edf3ee; border-bottom: 1px solid #edf3ee; }
.backstage-auto-open-summary span { color: var(--muted); font-weight: 800; }
.backstage-auto-open-summary strong { color: var(--green); font-size: 24px; }

@media (max-width: 700px) {
  .backstage-cdk-toolbar { padding-bottom: 10px; }
  .backstage-cdk-toolbar #cdk-search { width: 240px; min-width: 240px; margin-left: auto; }
  .backstage-payment-head-actions { width: 100%; justify-content: flex-start; }
  .backstage-payment-total { margin-right: auto; padding-right: 0; text-align: left; }
  .backstage-worker-form { width: 100%; margin-left: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .backstage-worker-form input { width: 100%; min-width: 0; }
  .backstage-worker-form .backstage-primary-button { padding-inline: 14px; white-space: nowrap; }
}

@media (max-width: 430px) {
  .backstage-worker-form { grid-template-columns: 1fr; }
  .backstage-worker-form .backstage-primary-button { width: 100%; }
}

/* Back-office inventory and live-state alignment. */
.admin-shell[data-current-view="payment"] .backstage-stats-grid { display: none; }
.backstage-stat-card { min-height: 82px; padding: 14px 18px; }
.backstage-stat-card strong { margin-top: 4px; font-size: 27px; }
.backstage-stat-card strong[data-state="online"] { color: var(--green); }
.backstage-stat-card strong[data-state="offline"] { color: var(--danger); }
.backstage-haifu-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.backstage-haifu-summary > div { min-height: 82px; padding: 14px 18px; border: 1px solid var(--soft-line); border-radius: 12px; background: #fff; box-shadow: none; }
.backstage-haifu-summary small { display: block; color: var(--muted); font-weight: 800; }
.backstage-haifu-summary strong { display: block; margin-top: 6px; color: #263448; font-size: 25px; }
#payment-total-remaining { color: var(--green); font-weight: 900; }
.backstage-cdk-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-left: auto; }
.backstage-cdk-head-actions .backstage-count { flex: 0 0 auto; min-width: 64px; padding: 6px 10px; }
.backstage-cdk-head-actions input { width: 220px; min-height: 42px; padding: 0 12px; border: 1px solid #cfe4d4; border-radius: 9px; background: #fff; }
.backstage-cdk-head-actions .backstage-batch-actions { order: -1; }
.backstage-cdk-toolbar { display: none; }
.backstage-panel-head > input { width: min(280px, 100%); min-height: 42px; margin-left: auto; padding: 0 12px; border: 1px solid #cfe4d4; border-radius: 9px; }
.backstage-table th, .backstage-table td { text-align: center; vertical-align: middle; }
.backstage-cdk-table { min-width: 920px; table-layout: fixed; }
.backstage-cdk-table th:nth-child(1), .backstage-cdk-table td:nth-child(1) { width: 54px; }
.backstage-cdk-table th:nth-child(2), .backstage-cdk-table td:nth-child(2) { width: 27%; }
.backstage-cdk-table th:nth-child(3), .backstage-cdk-table td:nth-child(3) { width: 10%; }
.backstage-cdk-table th:nth-child(4), .backstage-cdk-table td:nth-child(4) { width: 13%; }
.backstage-cdk-table th:nth-child(5), .backstage-cdk-table td:nth-child(5) { width: 15%; }
.backstage-cdk-table th:nth-child(6), .backstage-cdk-table td:nth-child(6) { width: 15%; }
.backstage-cdk-table th:nth-child(7), .backstage-cdk-table td:nth-child(7) { width: 12%; }
.backstage-cdk-table td:nth-child(2), .backstage-cdk-table .backstage-copy-code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backstage-note-cell { white-space: nowrap !important; }
.backstage-note-tag { display: inline-block; max-width: 5em; overflow: hidden; padding: 4px 9px; border-radius: 999px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.backstage-note-tag[data-color="0"] { color: #2563eb; background: #eff6ff; }
.backstage-note-tag[data-color="1"] { color: #047857; background: #ecfdf5; }
.backstage-note-tag[data-color="2"] { color: #b45309; background: #fffbeb; }
.backstage-note-tag[data-color="3"] { color: #9333ea; background: #faf5ff; }
.backstage-note-tag[data-color="4"] { color: #be123c; background: #fff1f2; }
.backstage-note-tag[data-color="5"] { color: #0f766e; background: #f0fdfa; }
.backstage-task-table { min-width: 1100px; table-layout: fixed; }
.backstage-task-table th:nth-child(1), .backstage-task-table td:nth-child(1) { width: 19%; }
.backstage-task-table th:nth-child(2), .backstage-task-table td:nth-child(2) { width: 25%; }
.backstage-task-table th:nth-child(3), .backstage-task-table td:nth-child(3) { width: 12%; }
.backstage-task-table th:nth-child(4), .backstage-task-table td:nth-child(4) { width: 19%; }
.backstage-task-table th:nth-child(5), .backstage-task-table td:nth-child(5) { width: 12%; min-width: 0; max-width: none; white-space: nowrap; }
.backstage-task-table th:nth-child(6), .backstage-task-table td:nth-child(6) { width: 23%; }
.backstage-task-current-state { white-space: normal; }
.backstage-task-current-state > span { display: -webkit-box; max-height: 2.9em; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.45; text-align: center; }
.backstage-task-table th:nth-child(1), .backstage-task-table td:nth-child(1) { width: 18%; }
.backstage-task-table th:nth-child(2), .backstage-task-table td:nth-child(2) { width: 22%; }
.backstage-task-table th:nth-child(3), .backstage-task-table td:nth-child(3) { width: 12%; }
.backstage-task-table th:nth-child(4), .backstage-task-table td:nth-child(4) { width: 18%; }
.backstage-task-table th:nth-child(5), .backstage-task-table td:nth-child(5) { width: 12%; }
.backstage-task-table th:nth-child(6), .backstage-task-table td:nth-child(6) { width: 18%; }
.backstage-copy-value { max-width: none; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
.backstage-action-grid .backstage-table-action:disabled { color: #a8b3bd; border-color: #e5eaed; background: #f7f8f9; cursor: not-allowed; }
.backstage-form #cdk-note-new { margin-top: 0; }
@media (max-width: 700px) {
  .admin-view-panel[data-view-panel="cards"] .backstage-panel-head { display: block; }
  .admin-view-panel[data-view-panel="cards"] .backstage-panel-head h1 { white-space: nowrap; }
  .admin-view-panel[data-view-panel="cards"] .backstage-cdk-head-actions { margin-left: 0; }
  .backstage-haifu-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .backstage-haifu-summary > div { min-height: 72px; padding: 12px; }
  .backstage-haifu-summary strong { font-size: 20px; }
  .backstage-cdk-head-actions { width: 100%; justify-content: flex-start; margin-top: 10px; }
  .backstage-cdk-head-actions input { flex: 1 1 180px; width: auto; min-width: 150px; }
  .backstage-panel-head > input { width: 100%; margin: 8px 0 0; }
  .backstage-panel-head:has(> input) { display: block; }
}

/* Back-office header controls and compact filter menus. */
.backstage-title-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.backstage-title-tools h1 { margin: 5px 0 8px; }
.backstage-title-tools .backstage-plain-button { min-height: 34px; padding: 0 12px; font-size: 12px; }
.backstage-head-search { width: min(280px, 100%); min-height: 42px; margin-left: auto; padding: 0 13px; border: 1px solid #cfe4d4; border-radius: 11px; color: var(--ink); background: #fbfefc; box-shadow: 0 5px 14px rgba(34,139,34,.06); outline: none; }
.backstage-head-search:focus, .backstage-search-input:focus, .backstage-cdk-head-actions input:focus { border-color: #8fc89b; box-shadow: 0 0 0 3px rgba(34,139,34,.10); }
.backstage-filter-heading { display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.backstage-filter-heading select { display: inline-block !important; width: 21px; min-width: 21px !important; height: 21px; min-height: 21px; margin: 0 !important; padding: 0; border: 1px solid #b9d9c0; border-radius: 50%; color: transparent; background-color: #f3fbf5; background-image: linear-gradient(45deg, transparent 50%, #228b22 50%), linear-gradient(135deg, #228b22 50%, transparent 50%); background-position: calc(50% - 3px) 50%, calc(50% + 2px) 50%; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; appearance: none; cursor: pointer; }
.backstage-filter-heading select:focus-visible { outline: 2px solid rgba(34,139,34,.35); outline-offset: 2px; }
.backstage-queue-head-actions .backstage-filter-select, .backstage-queue-head-actions .backstage-search-input { min-height: 42px; border: 1px solid #cfe4d4; border-radius: 11px; color: #53647b; background-color: #fbfefc; box-shadow: 0 5px 14px rgba(34,139,34,.06); outline: none; }
.backstage-queue-head-actions .backstage-filter-select { min-width: 112px; padding: 0 31px 0 12px; background-image: linear-gradient(45deg, transparent 50%, #228b22 50%), linear-gradient(135deg, #228b22 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-repeat: no-repeat; background-size: 5px 5px, 5px 5px; appearance: none; }
.backstage-queue-head-actions .backstage-search-input { width: 230px; padding: 0 13px; }
.backstage-payment-card strong .backstage-payment-api-label { color: #53647b; font-size: .78em; font-weight: 700; opacity: .6; }
#payment-summary-shell { background: transparent; }
.admin-view-panel[data-view-panel="monitoring"] .backstage-monitor-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 12px 18px; margin: 18px 0 14px; padding: 0; border: 0; background: transparent; }
.admin-view-panel[data-view-panel="monitoring"] .backstage-monitor-switches .backstage-switch { min-height: 48px; padding: 0 14px; border: 1px solid #e1eee4; border-radius: 11px; background: #fbfefc; }
.admin-view-panel[data-view-panel="monitoring"] .backstage-smtp-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 14px; margin: 0 0 24px; padding: 18px; border: 1px solid #e1eee4; border-radius: 12px; background: #fbfefc; }
.admin-view-panel[data-view-panel="monitoring"] .backstage-smtp-form > label.grow { grid-column: span 2; flex: none; }
.admin-view-panel[data-view-panel="monitoring"] .backstage-smtp-form .backstage-form-actions { grid-column: 1 / -1; justify-content: flex-end; margin-left: 0; padding-top: 3px; }
.admin-view-panel[data-view-panel="monitoring"] .backstage-toolbar { margin-top: 20px; }
@media (max-width: 700px) {
  .admin-view-panel[data-view-panel="queue"] .backstage-panel-head { display: block; }
  .admin-view-panel[data-view-panel="queue"] .backstage-panel-head h1 { white-space: nowrap; }
  .backstage-title-tools { justify-content: space-between; }
  .backstage-head-search { width: 220px; }
  .admin-view-panel[data-view-panel="monitoring"] .backstage-monitor-switches { grid-template-columns: 1fr; }
  .admin-view-panel[data-view-panel="monitoring"] .backstage-smtp-form { grid-template-columns: 1fr 1fr; }
  .admin-view-panel[data-view-panel="monitoring"] .backstage-smtp-form > label.grow { grid-column: 1 / -1; }
  .admin-view-panel[data-view-panel="monitoring"] .backstage-smtp-form .backstage-form-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .backstage-queue-head-actions .backstage-search-input { flex: 1 1 160px; width: auto; }
}

/* Final visual overrides for payment cards and compact header arrows. */
.backstage-payment-card { grid-template-columns: 1fr auto; padding: 16px 0; border: 0; border-bottom: 1px solid #edf3ee; border-radius: 0; background: transparent; }
.backstage-payment-card--unusable { border: 1px solid #e1e4e7; border-radius: 10px; background: #f3f4f6; }
.backstage-filter-heading select { width: 21px !important; min-width: 21px !important; height: 21px; min-height: 21px; padding: 0 !important; color: transparent; font-size: 11px !important; }
.backstage-filter-heading select option { color: #53647b; background: #fff; font-size: 13px; }
.backstage-filter-heading { position: relative; padding-right: 24px; }
.backstage-filter-heading::after { position: absolute; top: 50%; right: 3px; width: 7px; height: 7px; border-right: 2px solid #228b22; border-bottom: 2px solid #228b22; content: ''; transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.backstage-filter-heading select { position: absolute; top: 50%; right: 0; z-index: 1; width: 21px !important; min-width: 21px !important; height: 21px; min-height: 21px; border: 0; opacity: 0; transform: translateY(-50%); appearance: auto; }
@media (max-width: 700px) {
  .backstage-payment-card { grid-template-columns: 1fr; }
}

/* Compact five-card overview with a live inspection activity tile. */
.backstage-stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.backstage-inspection-card { min-width: 0; }
.backstage-inspection-card strong { margin-top: 5px; color: #486174; font-size: 16px; line-height: 1.25; }
.backstage-inspection-card small { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.backstage-inspection-card[data-state="checking"] strong,
.backstage-inspection-card[data-state="cancelling"] strong { color: #246b8f; }
.backstage-inspection-card[data-state="success"] strong { color: var(--green); }
.backstage-inspection-card[data-state="error"] strong { color: var(--danger); }
@media (max-width: 1000px) {
  .backstage-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .backstage-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backstage-inspection-card { min-height: 92px; }
}
