:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-soft: #eef3ed;
  --ink: #17211c;
  --muted: #66736c;
  --line: #dbe2dc;
  --accent: #127d64;
  --accent-strong: #0d5d4b;
  --warm: #e7aa31;
  --danger: #b64236;
  --shadow: 0 18px 48px rgba(23, 33, 28, 0.12);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(18, 125, 100, 0.08), transparent 36%),
    linear-gradient(300deg, rgba(231, 170, 49, 0.1), transparent 32%),
    var(--bg);
}

body.preview-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1440px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 20px 24px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.06;
}

h2 {
  font-size: 26px;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.point-rule-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(18, 125, 100, 0.18);
  border-radius: 9px;
  color: #356254;
  background: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}

.batch-summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.control-panel,
.result-panel {
  border: 1px solid rgba(219, 226, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.control-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 14px;
}

form {
  display: grid;
  gap: 11px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.count-label {
  display: grid;
  gap: 5px;
  color: var(--ink);
}

.count-label strong {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(231, 170, 49, 0.34);
  border-radius: 8px;
  color: #7b5100;
  background: rgba(231, 170, 49, 0.14);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

textarea,
select,
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

textarea {
  min-height: 116px;
  max-height: 180px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
  border-color: rgba(18, 125, 100, 0.55);
  box-shadow: 0 0 0 4px rgba(18, 125, 100, 0.12);
}

.custom-ratio-field[hidden] {
  display: none;
}

.layout-lock {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 243, 237, 0.7);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.layout-lock input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.layout-lock-box {
  position: relative;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid rgba(18, 125, 100, 0.45);
  border-radius: 6px;
  background: var(--surface);
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.layout-lock-box::after {
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 12px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: rotate(40deg) scale(0.75);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.layout-lock-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.layout-lock-copy strong {
  font-size: 14px;
  line-height: 1.3;
}

.layout-lock-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.layout-lock:has(input:checked) {
  border-color: rgba(18, 125, 100, 0.58);
  background: rgba(18, 125, 100, 0.09);
  box-shadow: inset 0 0 0 1px rgba(18, 125, 100, 0.12);
}

.layout-lock:has(input:checked) .layout-lock-box {
  border-color: var(--accent);
  background: var(--accent);
}

.layout-lock:has(input:checked) .layout-lock-box::after {
  opacity: 1;
  transform: rotate(40deg) scale(1);
}

.layout-lock:has(input:focus-visible) {
  box-shadow: 0 0 0 4px rgba(18, 125, 100, 0.12);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.aspect-grid {
  grid-template-columns: minmax(0, 1fr);
}

.number-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.number-row span {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}

output {
  color: var(--accent-strong);
  font-weight: 900;
  text-align: right;
}

.upload-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px dashed rgba(18, 125, 100, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 125, 100, 0.06), rgba(255, 255, 255, 0.82)),
    var(--surface-soft);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.upload-zone.dragging {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(18, 125, 100, 0.12);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.upload-zone span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.knowledge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.knowledge-type {
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(18, 125, 100, 0.1);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.knowledge-name {
  overflow: hidden;
  max-width: 210px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-item button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.08);
  color: var(--ink);
  cursor: pointer;
}

.reference-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.reference-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.reference-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  color: var(--surface);
  background: rgba(23, 33, 28, 0.74);
}

.primary-button,
.secondary-button,
.ghost-button,
.result-action {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(18, 125, 100, 0.22);
}

#generateButton {
  position: sticky;
  bottom: 0;
  z-index: 2;
  min-height: 48px;
  margin-top: 2px;
  box-shadow:
    0 -8px 18px rgba(255, 255, 255, 0.92),
    0 14px 30px rgba(18, 125, 100, 0.26);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.result-action:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  transform: none;
  opacity: 0.72;
}

.secondary-button {
  border: 1px solid rgba(18, 125, 100, 0.34);
  color: var(--accent-strong);
  background: rgba(18, 125, 100, 0.08);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.ghost-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.generator-app {
  width: min(1880px, calc(100% - 20px));
  min-height: calc(100svh - 20px);
  margin: 10px auto;
  padding: 28px;
  border: 1px solid rgba(216, 226, 219, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 249, 0.92)),
    #fff;
  box-shadow:
    0 24px 70px rgba(23, 33, 28, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.generator-app .topbar {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  min-height: 72px;
  padding-bottom: 20px;
}

.generator-app .point-rule-tip {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-height: 42px;
  padding: 9px 16px;
  border-color: #dce8df;
  color: #496158;
  background: linear-gradient(180deg, #ffffff, #f4f8f5);
  justify-content: flex-start;
  white-space: normal;
  box-shadow:
    0 10px 24px rgba(13, 93, 75, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(18, 125, 100, 0.2);
  border-radius: 11px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.92) 0 8%, transparent 9%),
    linear-gradient(135deg, #6ebc8f, #0d5d4b);
  box-shadow:
    0 10px 22px rgba(13, 93, 75, 0.2),
    inset 0 0 0 5px rgba(255, 255, 255, 0.16);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: rgba(255, 255, 255, 0.92);
}

.brand-mark::before {
  left: 12px;
  top: 11px;
  width: 20px;
  height: 18px;
  border-radius: 9px 9px 3px 3px;
  clip-path: polygon(0 0, 45% 22%, 50% 100%, 55% 22%, 100% 0, 100% 74%, 50% 100%, 0 74%);
}

.brand-mark::after {
  left: 20px;
  top: 10px;
  width: 3px;
  height: 23px;
  border-radius: 999px;
  opacity: 0.78;
}

.brand-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0;
}

.generator-app h1 {
  color: #17593f;
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.generator-app .topbar-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: max-content;
  max-width: 100%;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.generator-app .user-badge,
.generator-app .ghost-button {
  min-height: 48px;
  border-radius: 9px;
  font-size: 17px;
  letter-spacing: 0;
}

.generator-app .user-badge {
  flex: 0 1 320px;
  min-width: 0;
  max-width: min(360px, 100%);
  padding: 0 16px;
  border-color: #dce3de;
  color: #5f6863;
  background: linear-gradient(180deg, #fbfbfa, #f1f3f1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generator-app .ghost-button {
  min-width: 98px;
  padding: 0 18px;
  border-color: #dfe5e0;
  color: #26312b;
  background: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  box-shadow:
    0 8px 18px rgba(23, 33, 28, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.generator-app #authButton,
.generator-app #downloadAllButton {
  border-color: transparent;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    linear-gradient(135deg, #17684e, #0c4f3b);
  box-shadow:
    0 12px 24px rgba(13, 93, 75, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.generator-app #redeemButton {
  border-color: rgba(226, 181, 66, 0.78);
  color: #4b3710;
  background: #fffdf7;
}

.generator-app .topbar-actions a.ghost-button {
  border-color: transparent;
  color: #3b2a09;
  background: linear-gradient(135deg, #ffde83, #e9b734);
  box-shadow: 0 12px 22px rgba(231, 170, 49, 0.22);
}

.generator-app #clearButton,
.generator-app #downloadAllButton {
  gap: 8px;
}

.generator-app #clearButton::before {
  content: "⌫";
  color: #69736d;
  font-size: 16px;
  line-height: 1;
}

.generator-app #downloadAllButton::before {
  content: "↓";
  font-size: 20px;
  line-height: 1;
}

.generator-app .workspace-layout {
  grid-template-columns: minmax(360px, 29%) minmax(0, 1fr);
  gap: 24px;
}

.generator-app .control-panel,
.generator-app .result-panel {
  border: 1px solid rgba(219, 228, 222, 0.92);
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 248, 0.9)),
    #fff;
  box-shadow:
    0 18px 42px rgba(23, 33, 28, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.generator-app .control-panel {
  top: 18px;
  padding: 20px;
}

.generator-app .panel-title {
  position: relative;
  margin: 0 0 16px;
  padding-left: 18px;
  color: #19342a;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.generator-app .panel-title::before {
  position: absolute;
  left: 0;
  top: 2px;
  width: 5px;
  height: 28px;
  border-radius: 999px;
  background: #73c99b;
  content: "";
}

.generator-app form {
  gap: 13px;
}

.generator-app .field {
  gap: 8px;
}

.generator-app .field > span,
.generator-app .count-label {
  color: #1f2f28;
  font-size: 17px;
  font-weight: 900;
}

.generator-app .count-label strong {
  padding: 0;
  border: 0;
  color: #6a756e;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}

.generator-app textarea,
.generator-app select,
.generator-app input[type="text"],
.generator-app input[type="password"],
.generator-app input[type="number"] {
  border: 2px solid #bdd9ce;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 251, 0.98)),
    #fff;
  box-shadow:
    0 9px 22px rgba(13, 93, 75, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.generator-app textarea {
  min-height: 120px;
  max-height: 148px;
  padding: 14px;
  font-size: 16px;
}

.generator-app textarea:hover,
.generator-app select:hover,
.generator-app input[type="text"]:hover,
.generator-app input[type="password"]:hover,
.generator-app input[type="number"]:hover {
  border-color: #8fc3ae;
  background: #fff;
  box-shadow:
    0 12px 26px rgba(13, 93, 75, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.generator-app select,
.generator-app input[type="text"],
.generator-app input[type="password"],
.generator-app input[type="number"] {
  min-height: 46px;
  padding: 0 16px;
  font-size: 16px;
}

.generator-app textarea:focus,
.generator-app select:focus,
.generator-app input[type="text"]:focus,
.generator-app input[type="password"]:focus,
.generator-app input[type="number"]:focus {
  border-color: #167150;
  box-shadow:
    0 0 0 4px rgba(18, 125, 100, 0.14),
    0 14px 30px rgba(13, 93, 75, 0.12);
}

.generator-app .number-row {
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 0;
}

.generator-app .number-row input[type="number"] {
  border-right-color: transparent;
  border-radius: 10px 0 0 10px;
}

.generator-app .number-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 2px solid #bdd9ce;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: #17684e;
  background: linear-gradient(180deg, #f2faf6, #e7f4ee);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 9px 22px rgba(13, 93, 75, 0.07);
}

.generator-app select {
  font-weight: 800;
}

.generator-app .layout-lock {
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: center;
  min-height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
}

.generator-app .layout-lock-box {
  grid-column: 2;
  grid-row: 1;
  width: 58px;
  height: 32px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #dbe5de;
  box-shadow:
    inset 0 2px 5px rgba(23, 33, 28, 0.12),
    0 6px 12px rgba(23, 33, 28, 0.06);
}

.generator-app .layout-lock-box::before {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(23, 33, 28, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.generator-app .layout-lock-box::after {
  display: none;
}

.generator-app .layout-lock-copy {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
}

.generator-app .layout-lock-copy strong {
  color: #1f2f28;
  font-size: 17px;
}

.generator-app .layout-lock-copy small {
  display: none;
}

.generator-app .layout-lock:has(input:checked) {
  background: transparent;
  box-shadow: none;
}

.generator-app .layout-lock:has(input:checked) .layout-lock-box {
  background: linear-gradient(135deg, #1a704f, #0c4f3b);
}

.generator-app .layout-lock:has(input:checked) .layout-lock-box::before {
  transform: translateX(26px);
}

.generator-app .upload-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.generator-app .upload-label {
  color: #1f2f28;
  font-size: 15px;
  font-weight: 900;
}

.generator-app .upload-zone {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  min-height: 54px;
  border: 2px dashed #9ccfbc;
  border-style: dashed;
  border-radius: 10px;
  color: #8d9690;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 250, 246, 0.96)),
    #fff;
  box-shadow:
    0 9px 22px rgba(13, 93, 75, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
}

.generator-app .upload-zone:hover {
  border-color: #167150;
  background: #fff;
  box-shadow:
    0 13px 28px rgba(13, 93, 75, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.generator-app .upload-zone:focus-within {
  border-color: #167150;
  box-shadow:
    0 0 0 4px rgba(18, 125, 100, 0.14),
    0 13px 28px rgba(13, 93, 75, 0.12);
}

.generator-app .upload-zone::before {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #1a704f;
  border-radius: 999px;
  color: #1a704f;
  content: "↑";
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.generator-app .upload-zone::after {
  display: none;
}

.generator-app .upload-zone span {
  margin: 0;
  color: #6c7971;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.generator-app #generateButton {
  min-height: 58px;
  margin-top: 0;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent),
    linear-gradient(135deg, #17684e, #0b4938);
  font-size: 22px;
  box-shadow:
    0 -10px 20px rgba(255, 255, 255, 0.86),
    0 16px 32px rgba(13, 93, 75, 0.25);
}

.generator-app .result-panel {
  min-height: calc(100svh - 146px);
  padding: 34px 36px 28px;
}

.generator-app .workspace-head {
  align-items: flex-start;
  padding: 0;
  border: 0;
}

.generator-app .workspace-head .eyebrow {
  margin: 0;
  color: #17593f;
  font-size: 27px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: none;
}

.generator-app .batch-summary {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #66736c;
  background: rgba(245, 247, 246, 0.92);
  box-shadow: inset 0 1px 1px rgba(23, 33, 28, 0.04);
}

.generator-app .batch-summary::before {
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 2px solid #aeb8b2;
  border-radius: 999px;
  content: "";
}

.generator-app .result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 28px;
}

.generator-app .sample-tile,
.generator-app .result-card {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 18px;
  min-height: 0;
  padding: 22px 22px 24px;
  border-color: #dfe8e2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 15px 36px rgba(23, 33, 28, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.generator-app .sample-sheet {
  width: min(100%, 320px);
  aspect-ratio: 3 / 4.72;
  gap: 18px;
  padding: 26px;
  border-color: rgba(111, 165, 131, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 247, 0.96)),
    #fffdf7;
  box-shadow:
    0 16px 32px rgba(23, 33, 28, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  transform: none;
}

.generator-app .sample-sheet::before {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 58px;
  height: 1px;
  background: rgba(111, 165, 131, 0.35);
  content: "";
}

.generator-app .sample-sheet::after {
  right: 20px;
  bottom: 20px;
  width: 62px;
  height: 62px;
  opacity: 0.82;
}

.generator-app .sample-sheet span {
  width: fit-content;
  min-width: 92px;
  padding: 7px 16px;
  border-radius: 999px;
  color: #fff;
  background: #76b48c;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.generator-app .sample-sheet strong {
  margin-top: 16px;
  color: #17211c;
  font-size: 27px;
  text-align: center;
}

.generator-app .sample-sheet i,
.generator-app .sample-sheet b,
.generator-app .sample-sheet em {
  height: 12px;
  border-radius: 999px;
}

.generator-app .sample-sheet i:nth-of-type(1),
.generator-app .sample-sheet b:nth-of-type(1),
.generator-app .sample-sheet em:nth-of-type(1) {
  margin-top: 8px;
  width: 78%;
}

.generator-app .sample-sheet i:nth-of-type(2),
.generator-app .sample-sheet b:nth-of-type(2),
.generator-app .sample-sheet em:nth-of-type(2) {
  width: 92%;
}

.generator-app .sample-sheet i:nth-of-type(3),
.generator-app .sample-sheet b:nth-of-type(3),
.generator-app .sample-sheet em:nth-of-type(3) {
  width: 64%;
}

.generator-app .sample-sheet.math {
  border-color: rgba(90, 139, 205, 0.42);
}

.generator-app .sample-sheet.math span {
  background: #7da6dc;
}

.generator-app .sample-sheet.math::after {
  background:
    radial-gradient(circle at 50% 50%, transparent 32%, rgba(125, 166, 220, 0.22) 34%),
    linear-gradient(90deg, transparent 48%, rgba(125, 166, 220, 0.22) 50%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(125, 166, 220, 0.22) 50%, transparent 52%);
}

.generator-app .sample-sheet.science span {
  background: #81ad7a;
}

.generator-app .sample-sheet.science::after {
  background:
    radial-gradient(circle at 50% 50%, transparent 32%, rgba(129, 173, 122, 0.22) 34%),
    linear-gradient(90deg, transparent 48%, rgba(129, 173, 122, 0.22) 50%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(129, 173, 122, 0.22) 50%, transparent 52%);
}

.generator-app .sample-caption {
  margin: 0;
  color: #6b756e;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.generator-app .result-media {
  width: 100%;
  border-radius: 12px 12px 0 0;
  background: #f8fbf7;
}

.generator-app .result-meta {
  width: 100%;
  padding: 14px;
}

.admin-app {
  max-width: 1180px;
}

.admin-layout {
  display: grid;
  gap: 16px;
}

.admin-status,
.admin-token-panel,
.admin-section {
  border: 1px solid rgba(219, 226, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.admin-status {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-token-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.admin-token-panel[hidden] {
  display: none;
}

.admin-section {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-section-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.resolution-select {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.resolution-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.config-source-line {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  max-width: 220px;
  padding: 0 12px;
  border: 1px solid rgba(18, 125, 100, 0.24);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(18, 125, 100, 0.08);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-list {
  display: grid;
  gap: 12px;
}

.provider-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.provider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provider-head strong {
  font-size: 15px;
}

.provider-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr);
  gap: 12px;
}

.provider-keys textarea {
  min-height: 96px;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}

.admin-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-subsection {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-subsection h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 16px;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-metric {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(18, 125, 100, 0.18);
  border-radius: 8px;
  background: rgba(18, 125, 100, 0.07);
}

.admin-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-metric strong {
  font-size: 24px;
  line-height: 1;
}

.admin-table {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.admin-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 640px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 243, 237, 0.45);
  font-size: 12px;
}

.admin-row.header {
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.code-output {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  color: var(--accent-strong);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
}

.result-panel {
  min-height: calc(100svh - 124px);
  padding: 22px;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  padding-top: 18px;
}

.sample-tile,
.result-card,
.error-card,
.fallback-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sample-tile {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 20px;
}

.sample-sheet {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(100%, 210px);
  aspect-ratio: 3 / 4.2;
  padding: 20px;
  border: 1px solid rgba(23, 33, 28, 0.14);
  border-radius: 6px;
  background: #fffdf7;
  box-shadow: 0 16px 30px rgba(23, 33, 28, 0.12);
  transform: rotate(-1deg);
}

.sample-sheet span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sample-sheet strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.sample-sheet i,
.sample-sheet b,
.sample-sheet em {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.sample-sheet i {
  background: rgba(18, 125, 100, 0.2);
}

.sample-sheet b {
  background: rgba(231, 170, 49, 0.34);
}

.sample-sheet em {
  background: rgba(60, 105, 156, 0.18);
}

.sample-sheet::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 50% 50%, transparent 32%, rgba(18, 125, 100, 0.22) 34%),
    linear-gradient(90deg, transparent 48%, rgba(18, 125, 100, 0.22) 50%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(18, 125, 100, 0.22) 50%, transparent 52%);
}

.sample-sheet.math {
  transform: rotate(1.2deg);
}

.sample-sheet.science {
  transform: rotate(-0.4deg);
}

.result-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.result-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #eef3ed;
}

.result-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fdfefa;
}

.result-media img.is-waiting-for-final {
  opacity: 0;
}

.result-status-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 6px;
  color: #315042;
  background: rgba(253, 254, 250, 0.92);
  border: 1px solid rgba(18, 125, 100, 0.18);
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 6px 18px rgba(37, 63, 51, 0.12);
}

.result-preview-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.result-preview-button:focus-visible {
  outline: 3px solid rgba(18, 125, 100, 0.38);
  outline-offset: -3px;
}

.result-preview-button img {
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.result-preview-button:hover img {
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.015);
}

.result-meta {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.result-meta strong {
  font-size: 14px;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-action {
  min-height: 36px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
}

.result-action:disabled {
  cursor: wait;
  color: var(--muted);
  background: var(--surface-soft);
  opacity: 0.72;
}

.rule-panel {
  display: grid;
  gap: 12px;
  max-width: 100%;
  max-height: min(520px, 58svh);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(18, 125, 100, 0.24);
  border-radius: 8px;
  background: rgba(238, 243, 237, 0.78);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rule-panel[hidden] {
  display: none;
}

.rule-panel.stale {
  border-color: rgba(231, 170, 49, 0.42);
  background: rgba(231, 170, 49, 0.11);
}

.rule-panel strong {
  font-size: 14px;
  line-height: 1.35;
}

.rule-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 100%;
}

.rule-section {
  display: grid;
  gap: 6px;
}

.rule-section h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.3;
}

.rule-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-list li {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.rule-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.error-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 220px;
  padding: 16px;
  color: var(--danger);
  background: rgba(182, 66, 54, 0.07);
}

.error-card p {
  margin: 0;
  color: #7a3a32;
  line-height: 1.5;
}

.error-card.retryable {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.error-card.retryable:hover,
.error-card.retryable:focus-visible {
  border-color: rgba(182, 66, 54, 0.42);
  box-shadow: 0 12px 30px rgba(182, 66, 54, 0.13);
  transform: translateY(-1px);
  outline: none;
}

.error-card .result-action {
  width: fit-content;
  min-width: 132px;
  padding: 0 14px;
  border-color: rgba(182, 66, 54, 0.3);
  color: var(--danger);
  background: #fff8f6;
}

.fallback-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 220px;
  padding: 16px;
  color: #7b5100;
  background: rgba(231, 170, 49, 0.12);
}

.fallback-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.skeleton {
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent),
    var(--surface-soft);
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite linear;
}

.dialog-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
}

.dialog-modal.open {
  display: block;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 16, 0.58);
}

.dialog-shell {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 16px;
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.compact-dialog {
  width: min(420px, calc(100vw - 28px));
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-body {
  display: grid;
  gap: 14px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.point-confirm-modal {
  z-index: 60;
}

.point-confirm-backdrop {
  background:
    radial-gradient(circle at 50% 34%, rgba(18, 125, 100, 0.28), transparent 32%),
    rgba(14, 18, 16, 0.68);
}

.point-confirm-shell {
  width: min(520px, calc(100vw - 28px));
  gap: 18px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(18, 125, 100, 0.34);
  background: #fffefa;
}

.point-confirm-head {
  display: grid;
  gap: 6px;
  padding: 22px 24px 16px;
  background:
    linear-gradient(135deg, rgba(18, 125, 100, 0.16), rgba(231, 170, 49, 0.18)),
    #f9fbf4;
}

.point-confirm-head h2 {
  font-size: 30px;
}

.point-confirm-body {
  display: grid;
  gap: 16px;
  padding: 0 24px;
}

.point-confirm-number {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(18, 125, 100, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(18, 125, 100, 0.09), rgba(231, 170, 49, 0.12)),
    var(--surface);
}

.point-confirm-number span,
.point-confirm-number em {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
}

.point-confirm-number strong {
  color: var(--accent-strong);
  font-size: 72px;
  line-height: 0.84;
}

.point-confirm-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.point-confirm-facts span {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(238, 243, 237, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.point-confirm-facts strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.point-confirm-note {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--warm);
  border-radius: 8px;
  color: #6f5a25;
  background: rgba(231, 170, 49, 0.12);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.point-confirm-warning {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(183, 99, 28, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 170, 49, 0.18), rgba(255, 255, 255, 0.78)),
    #fff8e7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

.point-confirm-warning[hidden],
.point-count-editor[hidden],
.point-confirm-actions [hidden] {
  display: none !important;
}

.point-confirm-warning strong {
  color: #7b3d0c;
  font-size: 16px;
  line-height: 1.45;
}

.point-confirm-warning p {
  margin: 0;
  color: #73572a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.point-confirm-warning-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.point-count-editor {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(18, 125, 100, 0.28);
  border-radius: 8px;
  background: rgba(238, 248, 244, 0.76);
}

.point-count-editor span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.point-count-editor input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(18, 125, 100, 0.36);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: var(--surface);
  font-size: 22px;
  font-weight: 900;
}

.point-count-editor input:focus {
  outline: 3px solid rgba(18, 125, 100, 0.18);
  border-color: var(--accent-strong);
}

.point-count-editor small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.point-confirm-actions {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  padding: 0 24px 24px;
}

.point-confirm-actions .primary-button,
.point-confirm-actions .secondary-button {
  min-height: 48px;
}

.point-confirm-actions .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.preview-modal.open {
  display: block;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 18, 16, 0.82);
}

.preview-shell {
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(246, 247, 242, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.preview-toolbar strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-actions output {
  min-width: 54px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.preview-tool {
  min-width: 38px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 900;
}

.preview-tool.text {
  min-width: 58px;
}

.preview-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 0;
  cursor: grab;
  touch-action: none;
  background:
    linear-gradient(45deg, rgba(23, 33, 28, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 33, 28, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(23, 33, 28, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(23, 33, 28, 0.04) 75%),
    #f5f7f2;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.preview-stage.dragging {
  cursor: grabbing;
}

.preview-stage img {
  max-width: min(96%, 1400px);
  max-height: 92%;
  object-fit: contain;
  user-select: none;
  transform-origin: center center;
  transition: transform 80ms ease-out;
  will-change: transform;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 980px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
    max-height: none;
  }

  .result-panel {
    min-height: auto;
  }
}

@media (max-width: 1500px) {
  .generator-app {
    width: min(1420px, calc(100% - 20px));
    padding: 26px;
  }

  .generator-app .topbar {
    gap: 16px;
  }

  .generator-app .point-rule-tip {
    min-height: 44px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand-mark::before {
    left: 11px;
    top: 10px;
    width: 18px;
    height: 17px;
  }

  .brand-mark::after {
    left: 19px;
    top: 9px;
    height: 22px;
  }

  .brand-copy {
    gap: 0;
  }

  .generator-app h1 {
    font-size: 23px;
  }

  .generator-app .topbar-actions {
    gap: 8px;
  }

  .generator-app .user-badge,
  .generator-app .ghost-button {
    min-height: 46px;
    padding-inline: 14px;
    font-size: 15px;
  }

  .generator-app .ghost-button {
    min-width: 0;
  }

  .generator-app .workspace-layout {
    grid-template-columns: minmax(360px, 28%) minmax(0, 1fr);
  }
}

@media (max-width: 1380px) {
  .generator-app .topbar {
    grid-template-columns: 1fr;
  }

  .generator-app .topbar-actions {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .generator-app .point-rule-tip {
    grid-row: 3;
  }

  .generator-app .user-badge {
    flex: 1 1 260px;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 14px;
  }

  .topbar,
  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .generator-app .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 16px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .generator-app .topbar-actions {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    flex-wrap: wrap;
  }

  .generator-app .point-rule-tip {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    justify-content: flex-start;
    min-height: 40px;
    white-space: normal;
  }

  .generator-app .ghost-button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding-inline: 10px;
  }

  .generator-app .user-badge,
  .user-badge {
    flex: 1 1 100%;
    max-width: 100%;
    padding-block: 8px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .upload-pair {
    grid-template-columns: 1fr;
  }

  #generateButton {
    position: static;
  }

  .admin-token-panel,
  .provider-grid,
  .admin-grid-two,
  .admin-metric-grid {
    grid-template-columns: 1fr;
  }

  .admin-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-section-actions {
    justify-content: flex-start;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .preview-shell {
    inset: 8px;
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-actions {
    justify-content: flex-start;
  }

  .dialog-head,
  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dialog-head {
    flex-direction: column;
  }

  .point-confirm-number {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .point-confirm-number strong {
    font-size: 58px;
  }

  .point-confirm-facts {
    grid-template-columns: 1fr;
  }

  .point-confirm-warning-actions {
    grid-template-columns: 1fr;
  }
}
