:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  color: #17212b;
  background: #eef2f3;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; min-width: 320px; }

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: .52; }

.eyebrow {
  margin: 0 0 6px;
  color: #5d6d7c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button, .secondary-button, .icon-text-button, .tiny-button, .danger-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 650;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.primary-button { padding: 0 18px; background: #176b45; color: #fff; }
.primary-button:hover:not(:disabled) { background: #105738; }
.danger-button { padding: 0 18px; background: #a13e30; color: #fff; }
.danger-button:hover:not(:disabled) { background: #843126; }
.secondary-button { padding: 0 16px; background: #fff; color: #9b3d24; border-color: #d7a293; }
.secondary-button:hover:not(:disabled) { background: #fff4f0; }
.icon-text-button { padding: 0 12px; background: #fff; color: #334155; border-color: #c9d2d9; }
.icon-text-button:hover:not(:disabled) { background: #f3f7f8; }
.tiny-button { min-height: 30px; padding: 0 9px; margin-right: 6px; background: #fff; color: #344352; border-color: #ccd4da; font-size: 12px; }
.tiny-button:hover:not(:disabled) { background: #f0f5f4; border-color: #93afa2; }
.tiny-button.danger { color: #9e3b2c; border-color: #dfb3ab; }
.tiny-button.danger:hover:not(:disabled) { background: #fff1ee; }

.status-line { min-height: 20px; margin: 12px 0 0; color: #52606d; font-size: 13px; }
.status-line.error, .error { color: #a23c2d; }

.public-page { min-height: 100vh; background: #e9eeef; }
.public-shell { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 72px; }
.public-heading { padding: 0 2px 28px; }
.public-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.public-heading h1 { margin: 0; color: #192734; font-size: 30px; line-height: 1.25; letter-spacing: 0; }
.public-heading > p:last-child { max-width: 510px; margin: 12px 0 0; color: #536270; line-height: 1.7; }
.public-route-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.public-route-link { display: inline-flex; min-height: 34px; align-items: center; padding: 0 10px; border: 1px solid #b5c7be; border-radius: 5px; color: #236341; background: #edf6f0; font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.public-route-link:hover { background: #e3f0e7; }

.redeem-surface, .session-surface, .usage-note, .destroy-result-surface {
  margin-top: 16px;
  border: 1px solid #cad3d6;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 40, 50, .05);
}
.redeem-surface { padding: 24px; }
.surface-heading, .session-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.surface-heading h2, .session-heading h2, .usage-note h2 { margin: 0; font-size: 18px; }
.surface-heading p { margin: 6px 0 0; color: #61707c; font-size: 13px; }
.mode-badge, .timer-badge, .local-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border: 1px solid #b5c7be; border-radius: 4px; background: #edf6f0; color: #236341; font-size: 12px; font-weight: 700; white-space: nowrap; }
.redeem-form { margin-top: 22px; }
.redeem-form label, .stack-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 650; }
.redeem-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 7px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid #bac5cb; border-radius: 5px; background: #fff; color: #1c2935; outline: none; }
textarea { min-height: 108px; padding: 10px 11px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #347b59; box-shadow: 0 0 0 3px rgba(52, 123, 89, .15); }
.redeem-row input { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0; }
.batch-form { display: grid; gap: 14px; margin-top: 20px; }
.batch-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 650; }
.batch-form .primary-button { justify-self: start; }
.batch-results { margin-top: 16px; border-top: 1px solid #d9e1e3; }
.batch-results .table-wrap { margin-top: 12px; }
.batch-results table { min-width: 620px; }
.batch-cdk, .batch-phone { font-family: ui-monospace, Consolas, monospace; }
.batch-success { color: #176b45; font-weight: 650; }
.batch-error { color: #a23c2d; }

.session-surface { padding: 24px; border-color: #aabdb5; }
.destroy-result-surface { padding: 24px; border-color: #bdc8cc; }
.danger-badge { color: #94382b; background: #fff1ee; border-color: #ddb1a8; }
.destroy-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0 0; border-top: 1px solid #d9e1e3; border-bottom: 1px solid #d9e1e3; }
.destroy-details > div { min-width: 0; padding: 16px 14px; border-right: 1px solid #d9e1e3; }
.destroy-details > div:first-child { padding-left: 0; }
.destroy-details > div:last-child { padding-right: 0; border-right: 0; }
.destroy-details dt, .destroy-receipt dt { color: #677580; font-size: 12px; }
.destroy-details dd, .destroy-receipt dd { margin: 6px 0 0; color: #263744; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.destroy-details dd:first-of-type, .destruction-id { font-family: ui-monospace, Consolas, monospace; }
.destroy-actions { display: flex; align-items: center; gap: 14px; padding-top: 20px; }
.destroy-actions p { margin: 0; color: #8a4538; font-size: 13px; }
.destroy-receipt { margin-top: 20px; padding: 18px; border: 1px solid #9db9aa; border-radius: 6px; background: #f3f8f5; }
.destroy-receipt > strong { display: block; color: #176b45; font-size: 20px; }
.destroy-receipt dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.destroy-receipt dl > div { min-width: 0; }
.destroy-receipt dd { color: #174f39; font-family: ui-monospace, Consolas, monospace; }
.timer-badge { background: #f7f1df; color: #7d5c1a; border-color: #dbc88e; font-variant-numeric: tabular-nums; }
.timer-badge.expired { color: #9d3b2b; background: #fff0ed; border-color: #dfb3aa; }
.number-block, .code-block { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid #d9e1e3; }
.number-block span, .code-block span { color: #65737e; font-size: 13px; }
.number-block strong, .code-block strong { overflow: hidden; font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.code-block strong { color: #63717b; }
.code-block strong.has-code { color: #b05127; }
.session-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 20px; }
.usage-note { padding: 20px 24px; color: #566470; }
.usage-note h2 { color: #293844; }
.usage-note p { margin: 9px 0 0; font-size: 13px; line-height: 1.7; }
.admin-page { min-height: 100vh; background: #eef2f3; }
.admin-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 13px max(24px, calc((100% - 1320px) / 2)); border-bottom: 1px solid #c7d0d4; background: #fff; }
.admin-brand h1 { margin: 0; color: #172734; font-size: 20px; letter-spacing: 0; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions a { color: #1d6244; font-size: 13px; font-weight: 650; text-decoration: none; }
.header-actions a:hover { text-decoration: underline; }
.admin-main { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 26px 0 44px; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 98px; padding: 16px; border: 1px solid #c9d3d6; border-radius: 6px; background: #fff; }
.metric span { display: block; color: #64727e; font-size: 13px; }
.metric strong { display: block; margin-top: 9px; color: #1c2d3a; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.admin-tabs { position: sticky; top: 0; z-index: 8; display: flex; margin-top: 16px; overflow-x: auto; border: 1px solid #c9d3d6; border-radius: 6px; background: #fff; box-shadow: 0 3px 10px rgba(24, 40, 50, .05); scrollbar-width: thin; }
.admin-tab-button { flex: 1 0 142px; min-height: 48px; padding: 0 16px; border: 0; border-right: 1px solid #dce3e5; border-bottom: 3px solid transparent; border-radius: 0; background: #fff; color: #50606c; font-weight: 650; white-space: nowrap; }
.admin-tab-button:last-child { border-right: 0; }
.admin-tab-button:hover { background: #f3f7f5; color: #245f43; }
.admin-tab-button.active { border-bottom-color: #176b45; background: #edf6f0; color: #175c3c; }
.admin-tab-button:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(52, 123, 89, .22); outline-offset: -3px; }
.admin-tab-panel { margin-top: 12px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 16px; margin-top: 0; }
.admin-column { display: grid; gap: 16px; min-width: 0; }
.admin-side { min-width: 0; }
.admin-section { overflow: hidden; border: 1px solid #c9d3d6; border-radius: 6px; background: #fff; }
.admin-section + .admin-section { margin-top: 16px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 17px 18px 13px; border-bottom: 1px solid #dce3e5; }
.section-header h2 { margin: 0; color: #20313e; font-size: 17px; }
.section-header .eyebrow { margin-bottom: 4px; }
.section-copy { margin: 0; padding: 12px 18px; color: #5e6c77; font-size: 13px; line-height: 1.65; }
.source-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.source-import { padding: 14px 18px 12px; border-bottom: 1px solid #dce3e5; background: #fafcfb; }
.source-import label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 650; }
.source-import textarea { min-height: 104px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.source-import-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.source-import-actions p { max-width: 760px; margin: 0; color: #5f6e78; font-size: 12px; line-height: 1.55; }
.source-import-actions .primary-button { flex: 0 0 auto; }
.source-import-status { margin-top: 9px; }
.selection-status { margin: 0; padding: 0 18px 12px; color: #52636e; font-size: 13px; font-variant-numeric: tabular-nums; }
.inline-alert { margin: 0 18px 12px; padding: 9px 10px; border: 1px solid #e2b7ae; border-radius: 4px; background: #fff4f1; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 590px; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e0e6e8; text-align: left; vertical-align: middle; font-size: 13px; }
th { color: #62727d; background: #f7f9f9; font-size: 12px; font-weight: 700; white-space: nowrap; }
td { color: #2f3d48; }
.checkbox-column { width: 54px; text-align: center; }
.source-select { width: 16px; min-height: 16px; margin: 0; accent-color: #176b45; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.empty-cell { padding: 25px; color: #71808b; text-align: center; }
.pagination-bar { display: grid; grid-template-columns: 78px minmax(150px, auto) 78px; justify-content: end; align-items: center; gap: 8px; min-height: 56px; padding: 9px 12px; border-top: 1px solid #dce3e5; background: #fafbfb; }
.pagination-top { border-top: 0; border-bottom: 1px solid #dce3e5; }
.pagination-button { width: 78px; min-height: 34px; padding: 0 8px; }
.pagination-status { color: #5d6d78; font-size: 12px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-action-status { margin: 0; padding: 10px 18px 0; }
.cdk-create .section-header { border-bottom: 0; }
.stack-form { display: grid; gap: 15px; padding: 0 18px 18px; }
.cdk-create .status-line { padding: 0 18px 18px; margin: 0; }
.cdk-value { font-family: ui-monospace, Consolas, monospace; color: #184f3a; font-weight: 650; }
.cdk-note-input { min-width: 150px; min-height: 34px; padding: 0 8px; font-size: 12px; }
.inventory-note { margin: -2px 0 0; padding: 10px; border: 1px solid #c7d9cf; border-radius: 5px; background: #f3f8f5; color: #486257; font-size: 13px; }
.inventory-note strong { color: #176b45; font-size: 18px; font-variant-numeric: tabular-nums; }
.admin-login-shell { width: min(440px, calc(100% - 32px)); }
.admin-login-heading { padding-bottom: 12px; }
.admin-login-heading p { margin: 10px 0 0; color: #596974; font-size: 13px; line-height: 1.6; }
.admin-login-form { display: grid; gap: 16px; }
.admin-login-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 650; }
.admin-login-form .primary-button { justify-self: start; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { order: -1; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .public-shell { width: min(100% - 24px, 680px); padding: 34px 0 44px; }
  .public-heading-row { align-items: flex-start; }
  .public-heading-row { flex-direction: column; }
  .public-route-links { justify-content: flex-start; }
  .public-heading h1 { font-size: 25px; }
  .redeem-surface, .session-surface { padding: 18px; }
  .redeem-row { grid-template-columns: 1fr; }
  .redeem-row .primary-button { width: 100%; }
  .batch-form .primary-button { width: 100%; }
  .number-block, .code-block { grid-template-columns: 1fr; gap: 8px; }
  .destroy-details { grid-template-columns: 1fr; }
  .destroy-details > div, .destroy-details > div:first-child, .destroy-details > div:last-child { padding: 13px 0; border-right: 0; border-bottom: 1px solid #d9e1e3; }
  .destroy-details > div:last-child { border-bottom: 0; }
  .destroy-actions { align-items: stretch; flex-direction: column; }
  .danger-button { width: 100%; }
  .destroy-receipt dl { grid-template-columns: 1fr; }
  .number-block strong, .code-block strong { font-size: 21px; }
  .number-block .icon-text-button, .code-block .icon-text-button { width: fit-content; }
  .admin-header { align-items: flex-start; flex-direction: column; padding: 16px 16px 14px; }
  .admin-main { width: min(100% - 24px, 1320px); padding-top: 14px; }
  .overview-grid { gap: 8px; }
  .metric { min-height: 82px; padding: 12px; }
  .metric strong { font-size: 24px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .source-header-actions { justify-content: flex-start; }
  .source-import-actions { align-items: stretch; flex-direction: column; }
  .source-import-actions .primary-button { width: 100%; }
  .admin-tab-button { flex-basis: 116px; min-height: 44px; padding: 0 10px; font-size: 13px; }
  .pagination-bar { grid-template-columns: 72px minmax(0, 1fr) 72px; justify-content: stretch; gap: 6px; padding: 8px; }
  .pagination-button { width: 72px; }
  .pagination-status { white-space: normal; }
}
