:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #67707d;
  --line: #dde3ea;
  --panel: #ffffff;
  --soft: #f5f7f2;
  --green: #1f7a5b;
  --green-dark: #155742;
  --coral: #e4543f;
  --gold: #c89022;
  --blue: #4269b2;
  --shadow: 0 12px 34px rgba(31, 42, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f8f5;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.admin-body {
  background: #f7f8f5;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow,
.metric-card span,
.price-card span {
  color: var(--muted);
  font-size: 12px;
}

.quota-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  padding: 14px;
  margin-bottom: 20px;
}

.model-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  margin-bottom: 16px;
}

.support-panel {
  display: grid;
  gap: 9px;
  border: 1px solid #e4e8eb;
  border-radius: 8px;
  background: #fff8ed;
  padding: 12px;
  margin-bottom: 16px;
}

.support-panel strong {
  color: #3b332b;
  font-size: 13px;
  line-height: 1.45;
}

.model-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--green-dark);
}

.quota-panel strong {
  display: block;
  margin-top: 3px;
}

.template-list {
  display: grid;
  gap: 8px;
}

.history-panel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.template-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 11px 12px;
  text-align: left;
  color: var(--ink);
}

.template-item strong,
.template-item small {
  display: block;
}

.template-item small {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.template-item.active {
  border-color: rgba(31, 122, 91, 0.22);
  background: #f1f7f3;
}

.workspace {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar h1,
.panel-heading h2,
.modal-heading h2 {
  margin: 4px 0 0;
}

.topbar h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  max-width: 860px;
}

.topbar-subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  color: #4b5562;
  font-size: 16px;
  line-height: 1.6;
}

.promise-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.promise-row span {
  border: 1px solid rgba(31, 122, 91, 0.2);
  border-radius: 999px;
  background: #edf6f0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 750;
  padding: 7px 11px;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(400px, 1.1fr);
  gap: 22px;
  align-items: start;
}

.builder-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.builder-panel {
  display: grid;
  gap: 15px;
  padding: 24px;
}

.panel-heading,
.modal-heading,
.result-header,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  flex: 0 0 auto;
  align-self: flex-start;
  border: 1px solid rgba(66, 105, 178, 0.26);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--blue);
  font-size: 12px;
  background: #eef3ff;
}

.selected-template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e4e8eb;
  border-radius: 8px;
  background: #f8faf7;
  padding: 11px 12px;
}

.selected-template span {
  color: var(--muted);
  font-size: 13px;
}

.selected-template strong {
  color: var(--green-dark);
}

label {
  display: grid;
  gap: 7px;
  color: #30343a;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d6dde2;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
}

textarea {
  resize: vertical;
  min-height: 150px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.13);
}

.brief-field {
  font-size: 18px;
}

.brief-field textarea {
  font-size: 16px;
  line-height: 1.65;
}

.risk-note {
  border: 1px solid rgba(201, 154, 53, 0.34);
  border-radius: 8px;
  background: #fff8e7;
  color: #72531b;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
}

.choice-group {
  display: grid;
  gap: 10px;
}

.choice-group > span {
  color: #30343a;
  font-weight: 750;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  min-height: 36px;
  border: 1px solid #d6dde2;
  border-radius: 999px;
  background: #fff;
  color: #39414c;
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
}

.choice-chip.active {
  border-color: rgba(31, 122, 91, 0.32);
  background: #edf6f0;
  color: var(--green-dark);
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
}

.primary-button {
  background: var(--green);
  color: #fff;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 750;
}

.primary-button:hover {
  background: var(--green-dark);
}

.primary-button.compact {
  min-width: 108px;
}

.secondary-button,
.ghost-button {
  background: #eef2ee;
  color: #2f5f4c;
  padding: 0 14px;
  font-weight: 700;
}

.full-width {
  width: 100%;
}

.text-button {
  min-height: 30px;
  color: var(--green);
  background: transparent;
  font-weight: 700;
}

.text-button.small {
  min-height: 26px;
  padding: 0;
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.history-item {
  border: 1px solid #e4e8eb;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
  text-align: left;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.icon-button {
  width: 36px;
  background: #f2f4f6;
  font-size: 24px;
  line-height: 1;
}

.preview-panel {
  padding: 18px;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-heading h2 {
  margin: 4px 0 0;
}

.preview-heading > span {
  border-radius: 999px;
  background: #f2ede3;
  color: #72531b;
  font-size: 12px;
  font-weight: 750;
  padding: 6px 10px;
}

.phone-preview {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  border: 1px solid #e0e5e8;
  border-radius: 18px;
  background: #fbfcfb;
  padding: 14px;
}

.cover-card {
  display: grid;
  min-height: 230px;
  align-content: end;
  gap: 10px;
  border-radius: 8px;
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(32, 33, 36, 0.08), rgba(32, 33, 36, 0.52)),
    linear-gradient(135deg, #2f6f59, #d95847 58%, #c99a35);
}

.cover-card.style-editorial {
  background:
    linear-gradient(150deg, rgba(25, 30, 35, 0.08), rgba(25, 30, 35, 0.56)),
    linear-gradient(135deg, #2f6f59, #d95847 58%, #c99a35);
}

.cover-card.style-beauty {
  color: #2f2b28;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.68)),
    linear-gradient(135deg, #e7d8cf, #c9a99b 52%, #8f9f8d);
}

.cover-card.style-beauty span {
  background: rgba(255, 255, 255, 0.52);
}

.cover-card.style-tattoo {
  color: #2d2a27;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.62)),
    linear-gradient(135deg, #efe7dc, #c7b6a3 54%, #8d8f7b);
}

.cover-card.style-tattoo span {
  background: rgba(255, 255, 255, 0.5);
}

.cover-card.style-local {
  background:
    linear-gradient(150deg, rgba(20, 22, 24, 0.06), rgba(20, 22, 24, 0.58)),
    linear-gradient(135deg, #315d74, #c77b46 52%, #d8b257);
}

.cover-card span {
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 9px;
  font-size: 12px;
}

.cover-card strong {
  font-size: 30px;
  line-height: 1.13;
  overflow-wrap: anywhere;
}

.cover-card small {
  font-size: 14px;
  opacity: 0.9;
}

.export-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.premium-action {
  grid-column: 1 / -1;
  background: #1f2933;
  color: #fff;
}

.visual-action {
  background: #1f7a5b;
}

.image-style-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 8px;
  background: #f8fbf7;
  padding: 14px;
}

.image-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-route-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.case-route-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.case-route-card span {
  color: var(--muted);
  font-size: 12px;
}

.case-route-card strong {
  color: var(--green-dark);
  font-size: 14px;
  line-height: 1.35;
  text-align: right;
}

.case-route-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.reference-choice {
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.reference-choice small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.reference-source-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(31, 122, 91, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.reference-source-card > * {
  min-width: 0;
}

.reference-source-card .reference-choice {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.reference-library-panel,
.reference-upload-area,
.reference-consent-row {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  background: #f4f7f2;
}

.reference-library-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.reference-library-heading {
  align-items: start;
  display: grid;
  gap: 3px;
}

.reference-library-heading strong {
  color: var(--green-dark);
  font-size: 14px;
}

.reference-library-heading small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.reference-asset-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reference-asset {
  appearance: none;
  border: 1px solid rgba(31, 122, 91, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 7px;
  text-align: left;
}

.reference-asset:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(31, 122, 91, 0.32);
}

.reference-asset.active {
  border-color: rgba(31, 122, 91, 0.45);
  box-shadow: inset 0 0 0 1px rgba(31, 122, 91, 0.16);
}

.reference-asset-mark {
  align-items: center;
  background: rgba(31, 122, 91, 0.08);
  border: 1px solid rgba(31, 122, 91, 0.16);
  border-radius: 999px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  justify-self: start;
  min-width: 46px;
  padding: 0 10px;
}

.reference-asset strong {
  color: var(--green-dark);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.reference-asset small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reference-library-note {
  background: rgba(244, 239, 231, 0.72);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 12px;
}

.reference-upload-area {
  align-items: center;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px 12px;
}

.reference-upload-button {
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.reference-upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.reference-upload-area small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.reference-consent-row {
  align-items: start;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.45;
  padding: 9px 12px;
}

.reference-consent-row input {
  margin-top: 2px;
  accent-color: var(--green);
}

.reference-consent-row span {
  min-width: 0;
  overflow-wrap: break-word;
  white-space: normal;
}

.compact-choice {
  gap: 7px;
}

.compact-choice > span {
  color: var(--muted);
  font-size: 12px;
}

.compact-row {
  gap: 6px;
}

.compact-row .choice-chip {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.result-block {
  margin-top: 14px;
  border: 1px solid #e4e8eb;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.result-header {
  font-weight: 800;
}

.result-header strong {
  color: var(--green-dark);
  font-size: 13px;
}

.quality-block {
  background: #f8faf7;
}

.premium-block {
  border-color: rgba(31, 122, 91, 0.22);
  background: #fbf8ef;
}

.image-suite-block {
  border-color: rgba(31, 122, 91, 0.24);
  background: #fffdf8;
}

.image-suite-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.suite-card {
  overflow: hidden;
  border: 1px solid #e8e1d6;
  border-radius: 8px;
  background: #fff;
}

.suite-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #f4efe7;
}

.suite-card div {
  display: grid;
  gap: 3px;
  padding: 9px;
}

.suite-card b {
  color: #202124;
  font-size: 13px;
  line-height: 1.35;
}

.suite-card span,
.suite-note,
.suite-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.suite-note {
  margin: 10px 0 0;
}

.suite-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  border: 1px dashed #d8d0c4;
  border-radius: 8px;
  background: #faf7ef;
  padding: 14px;
}

.suite-empty strong {
  color: var(--green-dark);
}

.premium-block .result-header span::after {
  content: "付费";
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  background: #1f2933;
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  vertical-align: 1px;
}

.quality-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.quality-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  color: #3f4650;
  line-height: 1.45;
}

.quality-list b {
  flex: 0 0 auto;
  color: var(--green-dark);
  font-size: 12px;
}

.quality-list li.missing b {
  color: #9a5d1b;
}

ol {
  margin: 10px 0 0;
  padding-left: 22px;
}

li + li {
  margin-top: 7px;
}

.hook-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.hook-list li {
  border-radius: 8px;
  background: #f7f8f5;
  padding: 9px 10px;
}

.conversion-list li {
  background: #fff;
  border: 1px solid #eadfce;
}

#bodyCopy {
  margin: 10px 0 0;
  color: #3f4650;
  line-height: 1.75;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span {
  border-radius: 999px;
  background: #f2ede3;
  color: #72531b;
  padding: 6px 10px;
  font-size: 12px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 26px;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.5;
}

.launch-info {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 18px;
  padding: 20px;
}

.launch-info-heading {
  max-width: 880px;
}

.launch-info-heading h2 {
  font-size: 28px;
  margin: 6px 0 8px;
}

.launch-info-heading p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.launch-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.launch-card {
  border: 1px solid #e5ebe7;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 16px;
}

.launch-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}

.launch-card strong {
  color: var(--ink);
  display: block;
  font-size: 19px;
  margin-bottom: 8px;
}

.launch-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.launch-pay-row {
  align-items: center;
  border: 1px solid rgba(31, 122, 91, 0.2);
  border-radius: 8px;
  background: #f5fbf7;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 14px;
}

.launch-pay-row strong,
.launch-pay-row span {
  display: block;
}

.launch-pay-row strong {
  color: var(--green-dark);
  font-size: 16px;
  margin-bottom: 4px;
}

.launch-pay-row span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.legal-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
  line-height: 1.7;
  padding: 4px 2px 12px;
}

.legal-copy,
.legal-links {
  display: flex;
  gap: 12px;
}

.legal-copy {
  align-items: center;
  flex-wrap: wrap;
}

.legal-links {
  flex: 0 0 auto;
}

.legal-footer a {
  color: var(--text);
  text-decoration: none;
}

.legal-footer a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  border-radius: 8px;
  background: #202124;
  color: #fff;
  padding: 10px 14px;
  transition: 0.22s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.paywall {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.paywall::backdrop,
.feedback-modal::backdrop {
  background: rgba(18, 24, 33, 0.36);
}

.feedback-modal {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.feedback-note {
  border-radius: 8px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.price-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  text-align: left;
}

.price-card strong {
  font-size: 24px;
}

.price-card small {
  color: var(--muted);
  line-height: 1.5;
}

.price-card.highlighted {
  border-color: rgba(31, 122, 91, 0.42);
  background: #edf6f0;
}

.payment-notice {
  border: 1px solid rgba(31, 122, 91, 0.18);
  border-radius: 8px;
  background: #f6fbf7;
  color: var(--muted);
  display: grid;
  gap: 5px;
  line-height: 1.55;
  margin-top: 12px;
  padding: 12px 14px;
}

.payment-notice strong {
  color: var(--green-dark);
}

.redeem-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid #e4e8eb;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
}

.redeem-form.redeem-success {
  border-color: rgba(31, 122, 91, 0.32);
  background: #f2faf5;
}

.redeem-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.redeem-heading strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 4px;
}

.redeem-heading b {
  border-radius: 999px;
  background: #eef3ef;
  color: var(--green-dark);
  flex: 0 0 auto;
  font-size: 12px;
  padding: 6px 9px;
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
}

.redeem-form span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.redeem-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-shell {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px;
}

.admin-header,
.admin-panel,
.admin-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-header h1 {
  margin: 4px 0 8px;
}

.admin-header p:last-child {
  color: var(--muted);
  margin: 0;
}

.admin-metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-login {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr minmax(280px, 420px);
  padding: 22px;
}

.admin-login h2 {
  margin: 0 0 8px;
}

.admin-login p {
  color: var(--muted);
  margin: 0;
}

.admin-login form {
  display: grid;
  gap: 10px;
}

.admin-login input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
}

#adminLoginMessage {
  grid-column: 1 / -1;
}

[hidden] {
  display: none !important;
}

.admin-metrics article {
  padding: 18px;
}

.admin-metrics span,
.admin-row span,
.admin-row small,
.admin-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.admin-metrics strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.admin-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.admin-panel {
  padding: 18px;
}

.admin-panel:last-child {
  grid-column: 1 / -1;
}

.image-review-panel {
  grid-column: 1 / -1;
}

.admin-panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-panel h2 {
  margin: 0;
}

.admin-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 6px;
}

.admin-form input,
.admin-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 0 12px;
}

.admin-form-wide {
  grid-column: span 2;
}

.admin-form .primary-action {
  align-self: end;
  min-height: 42px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row,
.admin-empty {
  border-radius: 8px;
  background: #f8faf7;
  padding: 12px;
}

.redeem-code-row {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.redeem-code-row button {
  border: 1px solid #d8e5dc;
  border-radius: 8px;
  background: #eef6f1;
  color: var(--green-dark);
  font: inherit;
  font-weight: 800;
  min-height: 36px;
  padding: 0 12px;
}

.image-suite-review-row {
  border: 1px solid #e1e8e3;
  background: #fbfcfb;
}

.image-suite-review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.image-suite-review-links a {
  border: 1px solid #cfe0d5;
  border-radius: 8px;
  background: #eef6f1;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
  text-decoration: none;
}

.image-suite-review-links a:hover {
  background: #e2f0e9;
}

.image-suite-review-state {
  border-radius: 8px;
  background: #f3f5ef;
  color: #53625b;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
  padding: 8px 10px;
}

.image-suite-recommendation {
  border-left: 3px solid #1f7f5c;
  border-radius: 6px;
  background: #f0f7f3;
  color: #245843;
  display: block;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
  margin-top: 10px;
  padding: 9px 10px;
}

.image-suite-review-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, auto)) minmax(180px, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.image-suite-review-actions button,
.image-suite-review-actions input {
  border: 1px solid #d8e5dc;
  border-radius: 8px;
  font: inherit;
  min-height: 38px;
}

.image-suite-review-actions button {
  background: #eef6f1;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
}

.image-suite-review-actions button:hover {
  background: #e0efe7;
}

.image-suite-review-actions input {
  background: #fff;
  color: var(--ink);
  min-width: 0;
  padding: 0 10px;
}

.admin-row strong,
.admin-row span,
.admin-row small {
  display: block;
}

.admin-row span,
.admin-row small {
  margin-top: 5px;
}

.benefit-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.benefit-list div {
  border: 1px solid #e4e8eb;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.benefit-list strong,
.benefit-list span {
  display: block;
}

.benefit-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .template-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .builder-layout {
    grid-template-columns: 1fr;
  }

  .launch-info-grid {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    max-width: none;
  }
}

@media (max-width: 640px) {
  body {
    background: #fff;
  }

  .workspace,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    display: grid;
    gap: 12px;
  }

  .brand {
    margin-bottom: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .quota-panel,
  .model-panel,
  .support-panel {
    margin-bottom: 0;
    padding: 11px 12px;
  }

  .history-panel {
    display: none;
  }

  .template-list {
    display: flex;
    gap: 10px;
    margin: 0 -14px;
    overflow-x: auto;
    padding: 0 14px 4px;
    scroll-snap-type: x mandatory;
  }

  .template-item {
    flex: 0 0 188px;
    min-height: 92px;
    scroll-snap-align: start;
  }

  .template-item small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .topbar,
  .actions,
  .panel-heading,
  .modal-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .topbar h1 {
    font-size: 30px;
    line-height: 1.12;
  }

  .topbar-subtitle {
    font-size: 14px;
    line-height: 1.55;
  }

  .promise-row {
    gap: 6px;
  }

  .promise-row span {
    padding: 6px 9px;
    font-size: 12px;
  }

  .split-fields,
  .bottom-grid,
  .pricing-grid,
  .launch-info-grid,
  .benefit-list,
  .admin-login,
  .admin-metrics,
  .admin-grid,
  .admin-form,
  .history-list,
  .image-style-grid,
  .export-row {
    grid-template-columns: 1fr;
  }

  .admin-form-wide {
    grid-column: auto;
  }

  .launch-info {
    margin-top: 14px;
    padding: 16px;
  }

  .launch-info-heading h2 {
    font-size: 22px;
  }

  .launch-pay-row {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-notice {
    font-size: 13px;
  }

  .image-suite-review-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .image-suite-review-actions input {
    grid-column: 1 / -1;
  }

  .redeem-row {
    grid-template-columns: 1fr;
  }

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

  .builder-panel,
  .preview-panel,
  .metric-card {
    box-shadow: none;
  }

  .builder-panel {
    gap: 13px;
    padding: 18px;
  }

  .preview-panel {
    padding: 14px;
  }

  .selected-template {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  textarea {
    min-height: 132px;
  }

  .brief-field {
    font-size: 16px;
  }

  .brief-field textarea {
    font-size: 15px;
  }

  .choice-row {
    flex-wrap: nowrap;
    margin: 0 -18px;
    overflow-x: auto;
    padding: 0 18px 2px;
  }

  .choice-chip {
    flex: 0 0 auto;
  }

  .image-style-panel .choice-row {
    flex-wrap: wrap;
    margin: 0;
    overflow-x: visible;
    padding: 0;
  }

  .reference-asset-grid {
    grid-template-columns: 1fr;
  }

  .reference-upload-area {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .phone-preview {
    border-radius: 18px;
    padding: 10px;
  }

  .cover-card {
    min-height: 190px;
  }

  .cover-card strong {
    font-size: 24px;
  }

  .result-block {
    padding: 12px;
  }

  .quality-list li {
    display: grid;
    gap: 6px;
  }

  .quality-list b {
    justify-self: start;
  }

  .legal-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .toast {
    width: calc(100vw - 28px);
    text-align: center;
  }
}
