:root {
  --ink: #312b27;
  --muted: #746b64;
  --line: #e3d6c8;
  --paper: #fffdf8;
  --page: #f5eee3;
  --red: #a9362d;
  --red-dark: #81251f;
  --gold: #bd7b2e;
  --green: #326b57;
  --soft: #f8f1e7;
  --shadow: 0 16px 42px rgba(74, 48, 30, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.9), transparent 34%),
    linear-gradient(180deg, #fbf7f0, var(--page));
}

body.is-redeem .topbar {
  display: none;
}

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

.topbar {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 16px clamp(18px, 4vw, 54px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.header-link {
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 800;
}

.header-link:hover {
  color: var(--green);
}

.product-button {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  color: #fff;
  background: #c9562e;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.product-button:hover {
  background: #a9362d;
}

.product-button::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: -5px 6px 0 -4px currentColor;
}

.access-badge {
  min-height: 34px;
  display: none;
  align-items: center;
  padding: 0 12px;
  color: var(--green);
  background: #edf7f2;
  border: 1px solid #c9e1d6;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.redeem-gate {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 26px 18px 58px;
}

.redeem-card {
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 46px);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 72px rgba(74, 48, 30, 0.15);
}

.redeem-brand {
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
}

.redeem-card h2 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 5vw, 40px);
}

.redeem-card > p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.redeem-form {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.redeem-row,
.redeem-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.redeem-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.redeem-input-row input,
.redeem-row input {
  text-transform: uppercase;
  letter-spacing: .05em;
}

.redeem-message {
  min-height: 20px;
  margin: 0;
  color: #9d3029;
  font-size: 13px;
  font-weight: 800;
}

.redeem-message.success { color: var(--green); }

.redeem-perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.redeem-perks span {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: #edf7f2;
  border: 1px solid #c9e1d6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(26px, 3vw, 40px); }
h1 small,
.redeem-card h2 small {
  margin-left: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}
h2 { margin-bottom: 0; font-size: 18px; }
.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 48px) 48px;
}

.progress-rail {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 18px 14px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.progress-head {
  grid-column: 1 / -1;
  margin: 0 -18px 4px;
  padding: 12px 18px;
  color: var(--ink);
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  font-size: 18px;
  font-weight: 900;
}

.progress-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(49,43,39,.45);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.progress-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #8f7b68;
  background: #f4e5d5;
  border-radius: 50%;
}

.progress-step.active { color: var(--green); }
.progress-step.active span { color: #fff; background: var(--green); }

.progress-step.active::after {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #fff;
  background: var(--gold);
  border-radius: 50%;
  font-size: 12px;
}

.progress-line { height: 2px; background: #ead8c4; }

.workflow {
  display: grid;
  grid-template-columns: 1fr 1.05fr .95fr;
  gap: 16px;
}

.panel, .list-panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.panel { padding: 0 18px 18px; }

.panel.is-disabled .panel-title h2,
.panel.is-disabled .export-note,
.panel.is-disabled .export-note strong {
  color: rgba(49,43,39,.42);
}

.panel.is-disabled .panel-title span { background: #98a2b3; }

.panel.is-disabled .field-grid,
.panel.is-disabled #generateAll,
.panel.is-disabled #exportWord {
  pointer-events: none;
  opacity: .48;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 -18px 14px;
  padding: 12px 18px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
}

.panel-title span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.panel-guide {
  margin: -4px 0 14px;
  padding: 10px 12px;
  color: var(--green);
  background: #eef8f2;
  border: 1px solid #c8e4d2;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.panel.is-disabled .panel-guide {
  color: rgba(49,43,39,.48);
  background: #f7f2ea;
  border-color: #e5dac9;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 0 0 14px 2px;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.tabs button, .ghost, .link-button, .regen {
  min-height: 36px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tabs button.active {
  color: var(--green);
  background: #fffdfa;
  border-color: var(--line);
  border-bottom-color: #fffdfa;
}

.mode-tabs button {
  position: relative;
  border-color: transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
}

.mode-tabs button.active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
}

.mini-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.mini-tabs button {
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
}

.mini-tabs button.active {
  color: var(--green);
  background: transparent;
  border-bottom-color: var(--green);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: #4f4842;
  font-size: 13px;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9cec1;
  border-radius: 8px;
  padding: 10px 11px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(189,123,46,.12);
}

textarea { resize: vertical; line-height: 1.65; }

.upload-zone {
  min-height: 88px;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1.5px dashed #bfa88d;
  background: #fffaf2;
  cursor: pointer;
}

.upload-zone span, .hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.import-subpanel,
.quick-panel {
  min-height: 286px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.import-step {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.import-step.upload-step {
  grid-template-columns: 1fr;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.import-step-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.import-step-copy span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-weight: 800;
}

.import-step-copy strong { color: var(--red); }

.download-template {
  min-height: 38px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #9ebfad;
}

.safe-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.quick-panel {
  display: grid;
  align-content: start;
  border-top: 1px solid var(--line);
  border-radius: 8px;
}

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-grid label:first-child { grid-column: 1 / -1; }

.check-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input { width: auto; }

.roster-summary {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: var(--green);
  background: #edf7f2;
  border: 1px solid #c9e1d6;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.export-note {
  margin: 4px 0 14px;
  padding: 11px 12px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.export-note strong {
  margin: 0 3px;
  color: var(--red);
  font-size: 18px;
}

button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
}

.primary { color: #fff; background: var(--red); }
.primary:hover { background: var(--red-dark); }
#exportWord.is-loading {
  cursor: wait;
  opacity: .92;
}

.button-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin .8s linear infinite;
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

.secondary { color: #fff; background: var(--green); }
.official-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #7b4c23;
  background: #fff2ce;
  border: 1px solid #e0b86b;
  border-radius: 999px;
  box-shadow: 0 16px 36px rgba(189, 123, 46, .18);
  font-size: 14px;
  font-weight: 900;
}
.official-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(189, 123, 46, .25);
}
.official-button span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 22px;
  padding: 0 7px;
  color: #fff;
  background: #92561a;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.full { width: 100%; }
.ghost { padding-inline: 18px; }
.link-button { min-height: 32px; color: var(--red); border: 0; background: transparent; }
.danger { color: #9d3029; background: #fff3f1; border: 1px solid #efc7c2; }
button:disabled { opacity: .45; cursor: not-allowed; }
.hidden { display: none !important; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.template-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 7px;
  background: var(--soft);
  cursor: pointer;
}

.template-card.selected { border-color: var(--red); }
.template-card:hover,
.template-card:focus-visible {
  border-color: var(--gold);
  outline: none;
}
.template-card.is-locked {
  cursor: pointer;
}
.template-card.is-locked > img {
  filter: grayscale(.2) saturate(.75);
  opacity: .58;
}
.template-card.is-locked::after {
  content: "点击解锁";
  position: absolute;
  inset: 4px 4px 25px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(49,43,39,.36);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 900;
}
.template-card input { position: absolute; opacity: 0; }
.template-card img { width: 100%; aspect-ratio: 1.42; object-fit: cover; border-radius: 5px; }
.template-card strong {
  display: block;
  padding-top: 3px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.template-preview {
  position: fixed;
  top: 120px;
  right: 24px;
  z-index: 50;
  width: min(560px, 42vw);
  padding: 10px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  pointer-events: none;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(49,43,39,.2);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(42,31,24,.3);
}

.template-preview.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.template-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1.42;
  object-fit: contain;
  background: #f4eee5;
  border-radius: 7px;
}

.template-preview strong {
  display: block;
  padding: 8px 2px 1px;
  text-align: center;
  color: var(--ink);
  font-size: 14px;
}

.list-panel { margin-top: 18px; overflow: hidden; }

.site-footer {
  padding: 20px 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.footer-actions,
.footer-access {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.footer-link {
  color: var(--red);
}

.footer-access span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.list-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-head .size-note {
  color: #c62828;
  font-size: 14px;
  font-weight: 900;
}
.list-actions { display: flex; align-items: center; gap: 10px; }
.status { color: var(--green); font-size: 13px; font-weight: 800; }
.table-wrap { overflow-x: auto; }

table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #eee5dc; vertical-align: top; text-align: left; }
th { color: #5c5148; background: #fffdf9; font-size: 13px; }
th:nth-child(1) { width: 58px; }
th:nth-child(2) { width: 150px; }
th:nth-child(3) { width: 240px; }
th:nth-child(5) { width: 120px; }
.index-cell { text-align: center; font-weight: 800; color: var(--muted); }
.row-actions { display: grid; gap: 8px; }
.regen { min-height: 34px; color: var(--green); }
.delete { min-height: 34px; }
.empty-row td { padding: 44px; text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 11px 18px;
  color: #fff;
  background: rgba(45,39,35,.92);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 29, 25, .45);
}

.upgrade-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: 24px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(42,31,24,.32);
}

.upgrade-dialog h2 {
  margin-bottom: 16px;
  font-size: 25px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.benefit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.benefit-grid span {
  padding: 10px 12px;
  color: var(--green);
  background: #edf7f2;
  border: 1px solid #c9e1d6;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

/* Commercial shell refinements */
.redeem-perks,
.benefit-grid {
  display: none;
}

.redeem-card {
  border-radius: 8px;
}

.panel,
.list-panel {
  border-radius: 8px;
}

.panel-title {
  border-radius: 8px 8px 0 0;
}

.tabs {
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px;
  background: #eee6da;
  border: 1px solid #d8d0c1;
  border-radius: 8px;
}

.mode-tabs button {
  border-radius: 7px;
}

.mode-tabs button.active::after {
  content: none;
}

.import-subpanel,
.quick-panel {
  min-height: 302px;
  border-color: #d8d0c1;
}

.template-grid {
  overflow: visible;
}

.template-card {
  display: grid;
  gap: 5px;
  overflow: visible;
  padding: 5px;
  border: 1px solid #e6dfd3;
  border-radius: 8px;
  background: transparent;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.template-card.selected {
  border-color: var(--red);
  background: #fff8f3;
  box-shadow: 0 0 0 2px rgba(169,54,45,.22), 0 10px 24px rgba(169,54,45,.12);
  transform: translateY(-1px);
}

.template-card.selected::before {
  content: "已选";
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 5;
  padding: 4px 8px;
  color: #fff;
  background: var(--red);
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(169,54,45,.22);
}

.template-card input {
  pointer-events: none;
}

.template-card > img {
  aspect-ratio: 10 / 6.2;
  background: #f3efe6;
  border: 1px solid #eadfce;
  border-radius: 6px;
}

.template-zoom {
  display: none;
}

.template-card:hover .template-zoom {
  display: none;
}

.template-zoom img {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 6.2;
  object-fit: contain;
  background: #f4eee5;
  border-radius: 6px;
  filter: none;
  opacity: 1;
}

#templatePreview {
  display: grid;
  gap: 8px;
  margin: 2px 0 14px;
  padding: 10px;
  background: #fffaf2;
  border: 1px solid #eadfce;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

#templatePreview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #f4eee5;
  border-radius: 6px;
}

#templatePreview strong {
  text-align: center;
  color: var(--ink);
  font-size: 14px;
}

.upgrade-dialog {
  width: min(520px, 100%);
  padding: 24px 22px 20px;
  border-radius: 8px;
  background: #fffdf8;
}

.upgrade-dialog h2 {
  margin-bottom: 12px;
  font-size: 20px;
}

.upgrade-price {
  margin-bottom: 16px;
  color: #536273;
  font-size: 16px;
  line-height: 1.6;
}

.upgrade-dialog .redeem-form {
  margin-top: 0;
}

.upgrade-dialog #modalRedeemCode {
  min-height: 46px;
  border-radius: 8px;
}

.upgrade-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.upgrade-actions .ghost {
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 29, 25, .38);
}

.modal-box {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(42,31,24,.24);
}

.confirm-box {
  border: 1px solid var(--line);
}

.confirm-box h2 {
  font-size: 20px;
}

.confirm-box .modal-actions {
  margin-top: 22px;
}

.confirm-box .ghost {
  min-width: 86px;
  color: #475467;
  background: #fff;
  border: 1px solid var(--line);
}

.confirm-box .primary {
  min-width: 92px;
}

.usage-guide-box {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
}

.modal-box h2 {
  margin-bottom: 10px;
  color: var(--ink);
}

.modal-box p {
  margin: 0;
  color: #536273;
  line-height: 1.7;
}

.guide-steps {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.guide-step {
  padding: 12px;
  background: #fffaf2;
  border: 1px solid #eadfce;
  border-radius: 8px;
}

.guide-step p {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.guide-step p strong {
  color: var(--red);
}

.guide-step img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e8ddcd;
  border-radius: 8px;
}

.modal-image {
  display: block;
  width: min(320px, 100%);
  max-height: 420px;
  object-fit: contain;
  margin: 16px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.export-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 24, 31, .56);
  backdrop-filter: blur(3px);
}

.export-progress-box {
  width: min(420px, 100%);
  padding: 30px 26px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 24, 31, .28);
  text-align: center;
}

.export-progress-box h2 {
  margin: 14px 0 8px;
  font-size: 22px;
}

.export-progress-box p {
  min-height: 24px;
  margin: 0;
  color: #475467;
}

.export-progress-box small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.export-spinner {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 4px solid #f2ded5;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: button-spin .8s linear infinite;
}

.export-progress-track {
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e7de;
}

.export-progress-track span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #d58b70);
  transition: width .2s ease;
}

.export-progress-track span.is-indeterminate {
  width: 35%;
  animation: export-progress-slide 1.2s ease-in-out infinite;
}

@keyframes export-progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

body.is-exporting {
  overflow: hidden;
}

@media (max-width: 980px) {
  .workflow { grid-template-columns: 1fr; }
  .topbar, .list-head { align-items: flex-start; }
  .template-preview { display: none; }
}

@media (max-width: 640px) {
  .topbar, .list-head { flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .redeem-row,
  .redeem-input-row,
  .redeem-perks { grid-template-columns: 1fr; }
  .redeem-actions { flex-direction: column; }
  .benefit-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid label:first-child, .check-row { grid-column: auto; }
  .template-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .template-preview { display: none; }
  .progress-rail { grid-template-columns: 1fr; }
  .progress-line { display: none; }
}
