:root {
  --ink: #18231f;
  --muted: #67716d;
  --paper: #f7f6f1;
  --white: #fffefa;
  --line: #dfe2dc;
  --green: #174b3c;
  --green-2: #286b57;
  --mint: #d9eee5;
  --acid: #d8ef75;
  --coral: #ef775e;
  --shadow: 0 24px 70px rgba(27, 52, 43, .11);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.muted { color: var(--muted); line-height: 1.7; }
.small { font-size: 13px; }
.eyebrow { margin: 0 0 12px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .18em; }

.site-nav { height: 84px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: .04em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 12px 5px 12px 5px; font-family: serif; }
.nav-link, .ghost-button { border: 1px solid var(--line); background: rgba(255, 255, 255, .62); border-radius: 999px; padding: 10px 17px; font-size: 13px; font-weight: 700; cursor: pointer; }
.nav-link:hover, .ghost-button:hover { border-color: var(--green-2); }
.nav-caption { color: var(--muted); font-size: 13px; }

.hero { min-height: 640px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 60px; padding-block: 50px 80px; }
.hero h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(48px, 6vw, 78px); font-weight: 500; line-height: 1.09; letter-spacing: -.045em; }
.hero h1 span { color: var(--green-2); }
.hero-lead { max-width: 560px; margin: 28px 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.hero-actions { margin-bottom: 40px; }
.soft-button { display: inline-block; padding: 13px 18px; color: var(--green); background: var(--mint); border-radius: 9px; font-size: 13px; font-weight: 700; }
.trust-list { display: flex; gap: 25px; margin: 0; padding: 0; list-style: none; color: #4f5c57; font-size: 12px; font-weight: 700; }
.trust-list li { display: flex; align-items: center; gap: 7px; }
.trust-list span { color: var(--coral); font: 700 11px Georgia, serif; }
.hero-art { position: relative; min-height: 500px; }
.art-card { position: absolute; overflow: hidden; box-shadow: var(--shadow); }
.art-card-main { inset: 20px 25px 20px 60px; border: 10px solid var(--white); background: #94c8c0; border-radius: 160px 160px 34px 34px; transform: rotate(2deg); }
.art-card-main p { position: absolute; z-index: 5; top: 48px; left: 40px; margin: 0; color: var(--white); font: 700 35px/1.05 Georgia, serif; letter-spacing: -.04em; text-shadow: 0 3px 12px rgba(21, 50, 43, .16); }
.art-sky { position: absolute; inset: 0; background: linear-gradient(#75bab1, #d3e8c3 58%, #efcf8d); }
.art-sun { position: absolute; top: 90px; right: 55px; width: 108px; height: 108px; border-radius: 50%; background: #f7e88f; box-shadow: 0 0 70px #f9e791; }
.art-land { position: absolute; left: -10%; width: 120%; height: 48%; bottom: -14%; border-radius: 50% 50% 0 0; transform: rotate(-8deg); }
.art-land-back { bottom: -2%; background: #5d9871; }
.art-land-front { left: -20%; bottom: -22%; background: #1f5b49; transform: rotate(12deg); }
.art-card-small { width: 125px; height: 145px; left: 0; bottom: 12px; display: grid; place-items: center; color: var(--green); border: 7px solid var(--white); border-radius: 22px; background: var(--acid); transform: rotate(-9deg); }
.art-card-small span { font: italic 800 44px Georgia, serif; }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.orb-one { width: 120px; height: 120px; right: -18px; top: -2px; background: var(--acid); }
.orb-two { width: 50px; height: 50px; right: 10px; bottom: 70px; background: var(--coral); }
.spark { position: absolute; z-index: 10; color: var(--white); font-size: 30px; }
.spark-one { right: 18px; top: 115px; }
.spark-two { left: 35px; top: 100px; color: var(--coral); }

.steps-section { padding: 90px 0 110px; background: var(--green); color: var(--white); }
.steps-section .eyebrow { color: var(--acid); }
.steps-section h2 { margin: 0 0 45px; font: 500 44px Georgia, "Songti SC", serif; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-grid article { min-height: 210px; padding: 28px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px; background: rgba(255, 255, 255, .055); }
.step-grid b { color: var(--acid); font: italic 500 30px Georgia, serif; }
.step-grid h3 { margin: 27px 0 10px; }
.step-grid p { margin: 0; color: rgba(255, 255, 255, .68); font-size: 14px; line-height: 1.7; }
.site-footer { min-height: 110px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }

/* Shared forms and merchant console */
.admin-main { padding: 35px 0 90px; }
.panel { border: 1px solid rgba(23, 75, 60, .1); border-radius: var(--radius); background: var(--white); box-shadow: 0 18px 55px rgba(30, 52, 44, .055); }
.auth-card { width: min(460px, 100%); margin: 80px auto; padding: 42px; }
.auth-card h1, .dashboard-heading h1 { margin: 0; font: 500 40px Georgia, "Songti SC", serif; }
.stack-form { display: grid; gap: 17px; margin-top: 26px; }
.stack-form label, .settings-grid label { display: grid; gap: 8px; font-size: 12px; font-weight: 750; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
input, textarea, select { width: 100%; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: #fbfcf8; outline: none; transition: border .2s, box-shadow .2s; }
input, select { height: 47px; padding: 0 13px; }
textarea { padding: 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(40, 107, 87, .1); }
.primary-button, .copy-button { min-height: 48px; border: 0; border-radius: 11px; color: white; background: var(--green); font-weight: 800; cursor: pointer; }
.primary-button:hover, .copy-button:hover { background: var(--green-2); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 19px; margin: 0; color: #b84c3a; font-size: 12px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fixed-entitlement { min-height: 73px; display: grid; align-content: center; gap: 7px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #f3f7f3; font-size: 12px; }
.fixed-entitlement span { color: var(--muted); font-size: 11px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 30px; }
.dashboard-heading p { margin-bottom: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .65fr); gap: 20px; }
.create-panel, .workflow-panel, .orders-panel { padding: 28px; }
.panel-heading { display: flex; align-items: center; gap: 13px; }
.panel-heading.split { justify-content: space-between; }
.panel-heading h2, .workflow-panel h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--green); background: var(--mint); border-radius: 11px; font-size: 23px; }
.link-result { display: grid; gap: 12px; margin-top: 22px; padding: 18px; border: 1px solid #b8d7c9; border-radius: 14px; background: #edf8f2; }
.link-result > div { display: flex; justify-content: space-between; gap: 12px; }
.link-result span { color: var(--muted); font-size: 11px; }
.link-result textarea { min-height: 75px; font: 12px/1.5 ui-monospace, monospace; background: white; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions button { flex: 1 1 130px; }
.workflow-status { display: flex; gap: 12px; margin-top: 25px; padding: 15px; border-radius: 13px; background: #f2f7f3; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: #36a275; box-shadow: 0 0 0 5px rgba(54, 162, 117, .11); }
.workflow-status p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.divider { height: 1px; margin: 25px 0; background: var(--line); }
.workflow-panel h3 { margin: 0; font-size: 14px; }
.orders-panel { margin-top: 20px; }
.search-box { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.search-box input { width: 220px; height: 38px; }
.batch-counts { display: flex; flex-wrap: wrap; gap: 5px; min-width: 250px; }
.batch-counts span { padding: 4px 7px; border-radius: 7px; color: var(--muted); background: #f0f2ed; font-size: 10px; white-space: nowrap; }
.batch-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 190px; }
.batch-actions button, .batch-actions a { padding: 6px 8px; border: 0; border-radius: 7px; color: var(--green); background: var(--mint); cursor: pointer; font-size: 10px; font-weight: 750; }
.table-wrap { overflow-x: auto; }
table { width: 100%; margin-top: 20px; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 10px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
td { padding: 15px 10px; border-bottom: 1px solid #edf0eb; }
.order-label { display: grid; gap: 4px; min-width: 180px; }
.order-label small { color: var(--muted); }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.badge.ok { color: #176548; background: #e2f5eb; }
.badge.off { color: #8b4a3e; background: #f8e7e2; }
.badge.used { color: #685d33; background: #f6f0d8; }
.table-action { border: 0; color: #a54c3d; background: none; cursor: pointer; font-size: 12px; }
.empty-state { padding: 45px; text-align: center; color: var(--muted); }
.empty-state span { font-size: 35px; }

/* Customer studio */
.studio-page { min-height: 100vh; background: #efeee8; }
.studio-nav { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid rgba(23, 75, 60, .1); background: rgba(255, 254, 250, .92); backdrop-filter: blur(15px); }
.credit-badge { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 12px; font-weight: 750; }
.credit-badge .status-dot { margin: 0; }
.studio-shell { width: min(1500px, 100%); min-height: calc(100vh - 72px); margin: auto; display: grid; grid-template-columns: minmax(470px, 610px) minmax(0, 1fr); }
.creator-panel { padding: 46px clamp(28px, 4vw, 60px) 70px; border-right: 1px solid rgba(23, 75, 60, .1); background: var(--white); }
.creator-heading h1 { margin: 0; font: 500 clamp(33px, 3.4vw, 47px) Georgia, "Songti SC", serif; letter-spacing: -.035em; }
.creator-heading > p:last-child { margin: 12px 0 28px; color: var(--muted); font-size: 13px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; padding: 0; border: 0; }
.mode-tabs input, .quality-field input { position: absolute; opacity: 0; pointer-events: none; }
.mode-tabs span { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode-tabs small, .quality-field small { color: var(--muted); font-size: 11px; }
.mode-tabs input:checked + span { color: var(--green); border-color: var(--green); background: #edf7f1; box-shadow: inset 0 0 0 1px var(--green); }
.prompt-label, .section-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.prompt-label small, .section-label small { color: var(--muted); font-weight: 500; }
.prompt-box { position: relative; }
.prompt-box textarea { min-height: 150px; padding: 16px 42px 16px 16px; line-height: 1.7; }
.prompt-spark { position: absolute; top: 15px; right: 17px; color: var(--coral); }
.reference-section { margin-top: 22px; }
.dropzone { min-height: 118px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px dashed #9ab5aa; border-radius: 14px; color: var(--green); background: #f5faf7; cursor: pointer; }
.dropzone input { display: none; }
.dropzone small { color: var(--muted); font-size: 11px; }
.upload-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green-2); }
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.preview-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.quality-field { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0; padding: 0; border: 0; }
.quality-field legend { margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.quality-field span { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 12px; }
.quality-field input:checked + span { border-color: var(--green); background: #edf7f1; }
.generate-button { width: 100%; min-height: 60px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 9px; padding: 0 20px; border: 0; border-radius: 14px; color: white; background: var(--green); cursor: pointer; box-shadow: 0 12px 26px rgba(23, 75, 60, .2); }
.generate-button:hover { background: var(--green-2); transform: translateY(-1px); }
.generate-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.generate-button small { justify-self: end; color: rgba(255, 255, 255, .65); font-size: 10px; }
.centered { text-align: center; margin-top: 10px; }
.result-panel { padding: 46px clamp(26px, 4vw, 64px) 70px; }
.result-heading { display: flex; justify-content: space-between; align-items: center; }
.result-heading h2 { margin: 0; font: 500 31px Georgia, "Songti SC", serif; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; }
.result-empty { min-height: 490px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-canvas { width: min(310px, 80%); aspect-ratio: 1.15; display: grid; place-items: center; border: 1px dashed #bdc4be; border-radius: 150px 150px 26px 26px; background: linear-gradient(145deg, rgba(255,255,255,.7), rgba(220,232,224,.45)); }
.empty-canvas span { color: #9db0a7; font-size: 45px; }
.result-empty h3 { margin: 22px 0 6px; font-family: Georgia, "Songti SC", serif; }
.result-empty p { margin: 0; color: var(--muted); font-size: 12px; }
.active-job { margin-top: 30px; min-height: 430px; display: grid; place-items: center; align-content: center; padding: 30px; border: 1px solid rgba(23, 75, 60, .1); border-radius: 22px; background: rgba(255, 255, 255, .62); text-align: center; }
.loading-art { position: relative; width: 155px; height: 155px; }
.loading-art span { position: absolute; inset: 20px; border-radius: 45% 55% 60% 40%; background: var(--mint); animation: blob 4s ease-in-out infinite alternate; }
.loading-art span:nth-child(2) { inset: 34px 15px 18px 37px; background: var(--acid); animation-delay: -.8s; opacity: .8; }
.loading-art span:nth-child(3) { inset: 46px 38px 29px 20px; background: var(--coral); animation-delay: -1.4s; opacity: .7; }
.loading-art b { position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 32px; }
@keyframes blob { to { transform: rotate(35deg) scale(1.08); border-radius: 60% 40% 38% 62%; } }
.active-job h3 { margin: 15px 0 8px; font: 500 22px Georgia, "Songti SC", serif; }
.active-job p { margin: 0; color: var(--muted); font-size: 12px; }
.indeterminate { width: min(290px, 80%); height: 5px; margin-top: 25px; overflow: hidden; border-radius: 999px; background: #dfe7e1; }
.indeterminate i { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--green-2); animation: progress 1.5s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-110%); } to { transform: translateX(360%); } }
.history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.creation-card { overflow: hidden; border: 1px solid rgba(23, 75, 60, .1); border-radius: 17px; background: var(--white); box-shadow: 0 14px 35px rgba(30, 52, 44, .07); }
.creation-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #e4e7e1; }
.creation-meta { padding: 14px; }
.creation-meta p { display: -webkit-box; overflow: hidden; margin: 0 0 11px; color: #3e4a45; font-size: 12px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.creation-actions { display: flex; justify-content: space-between; align-items: center; }
.creation-actions span { color: var(--muted); font-size: 10px; }
.download-link { padding: 7px 10px; color: var(--green); border-radius: 8px; background: var(--mint); font-size: 11px; font-weight: 800; }
.failed-card { grid-column: 1 / -1; padding: 17px; border: 1px solid #efc7bd; border-radius: 13px; background: #fff4f0; }
.failed-card strong { color: #a54c3d; font-size: 12px; }
.failed-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 28px; padding: 11px 17px; color: white; border-radius: 999px; background: rgba(24, 35, 31, .93); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .25s; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 35px; }
  .hero-art { min-height: 460px; }
  .step-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .studio-shell { grid-template-columns: 1fr; }
  .creator-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-panel { min-height: 650px; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 28px, 1160px); }
  .site-nav { height: 70px; }
  .hero { gap: 20px; padding: 45px 0 70px; }
  .hero h1 { font-size: 45px; }
  .hero-lead { font-size: 15px; }
  .trust-list { align-items: flex-start; flex-direction: column; gap: 10px; }
  .hero-art { min-height: 370px; }
  .art-card-main { inset: 15px 10px 10px 35px; }
  .art-card-small { width: 90px; height: 110px; }
  .art-card-main p { left: 28px; font-size: 27px; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
  .auth-card { padding: 28px; margin: 35px auto; }
  .dashboard-heading { align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .create-panel, .workflow-panel, .orders-panel { padding: 20px; }
  .table-wrap { margin-inline: -20px; padding-inline: 20px; }
  .studio-nav { padding: 0 15px; }
  .studio-nav .brand > span:last-child { display: none; }
  .creator-panel, .result-panel { padding: 35px 18px 55px; }
  .mode-tabs, .settings-grid { grid-template-columns: 1fr; }
  .quality-field { gap: 5px; }
  .quality-field span { padding: 10px 8px; }
  .preview-grid { grid-template-columns: repeat(3, 1fr); }
  .history-grid { grid-template-columns: 1fr; }
  .generate-button { grid-template-columns: auto 1fr; }
  .generate-button small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
