:root {
  --ink: #17221d;
  --ink-soft: #5d6b64;
  --forest: #173d30;
  --forest-2: #20513f;
  --mint: #d8f7e4;
  --lime: #b6ef63;
  --cream: #f4f1e9;
  --paper: #fffefb;
  --line: #d9dfda;
  --coral: #ff795b;
  --shadow: 0 18px 48px rgba(24, 44, 35, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 3%, rgba(182, 239, 99, 0.16), transparent 26rem),
    linear-gradient(180deg, #fbfaf6 0%, #f2f4ef 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }

.topbar {
  min-height: 76px;
  padding: 14px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: white;
  background: var(--forest);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: var(--lime); background: rgba(255,255,255,.08); }
.brand-mark svg { width: 31px; height: 31px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: -.01em; }
.brand small { color: #c6d5ce; font-size: .78rem; margin-top: 1px; }

.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; color: #e8f4ed; background: rgba(255,255,255,.08); font-size: .78rem; white-space: nowrap; }
.status span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(182,239,99,.13); }

main { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 58px; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 12px; color: #46755f; font-size: .75rem; font-weight: 800; letter-spacing: .16em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(2.05rem, 4.3vw, 4.25rem); line-height: 1.01; letter-spacing: -.055em; }
.lede { max-width: 700px; margin: 18px 0 0; color: var(--ink-soft); font-size: clamp(1rem, 1.5vw, 1.18rem); }

.quality-card { min-width: 310px; display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid #d7e8dd; border-radius: 18px; background: rgba(255,255,255,.65); box-shadow: 0 12px 30px rgba(26,60,45,.05); }
.quality-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; color: var(--forest); background: var(--mint); border-radius: 50%; font-weight: 900; }
.quality-card strong, .quality-card span { display: block; }
.quality-card strong { font-size: .87rem; }
.quality-card div span { margin-top: 2px; color: var(--ink-soft); font-size: .72rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 22px; align-items: start; }
.panel { padding: clamp(22px, 3vw, 36px); border: 1px solid rgba(23,61,48,.1); border-radius: 28px; background: rgba(255,254,251,.94); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.step-number { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: white; background: var(--forest); font-weight: 850; }
.result-step { color: var(--forest); background: var(--mint); }
.panel-heading p, .panel-heading h2 { margin: 0; }
.panel-heading p { color: #718078; font-size: .68rem; font-weight: 850; letter-spacing: .15em; }
.panel-heading h2 { margin-top: 2px; font-size: 1.25rem; letter-spacing: -.02em; }

.field-label, legend { display: block; margin-bottom: 10px; color: #2e3d36; font-size: .84rem; font-weight: 800; }
.theme-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
input[type="text"] { width: 100%; min-height: 54px; padding: 0 16px; color: var(--ink); background: #fff; border: 1px solid #cfd8d2; border-radius: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
input[type="text"]:focus { border-color: var(--forest-2); box-shadow: 0 0 0 4px rgba(32,81,63,.1); }
input[type="text"]::placeholder { color: #9aa59f; }
.inspiration { min-width: 72px; padding: 0 14px; border: 0; border-radius: 15px; color: var(--forest); background: var(--mint); font-weight: 800; cursor: pointer; }
.inspiration:hover { background: #c9f2d9; }
.field-help { margin: 7px 0 25px; color: #89958f; font-size: .74rem; }

fieldset { padding: 0; margin: 0 0 24px; border: 0; }
.choice-grid { display: grid; gap: 8px; }
.motif-grid { grid-template-columns: repeat(3, 1fr); }
.style-grid { grid-template-columns: repeat(5, 1fr); }
.color-grid { grid-template-columns: repeat(5, 1fr); }
.choice-grid label { min-width: 0; cursor: pointer; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid label > span { height: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 10px 11px; text-align: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: #5a6861; font-size: .76rem; font-weight: 750; transition: border-color .18s, background .18s, color .18s, transform .18s; }
.motif-grid label > span { min-height: 69px; flex-direction: column; }
.choice-grid b { display: block; color: inherit; font-size: .78rem; }
.choice-grid small { display: block; margin-top: 2px; color: #89958f; font-size: .64rem; font-weight: 500; }
.choice-grid input:checked + span { color: var(--forest); border-color: #7fae96; background: #e8f8ee; box-shadow: inset 0 0 0 1px #7fae96; }
.choice-grid input:checked + span small { color: #537363; }
.choice-grid label:hover > span { transform: translateY(-1px); border-color: #9bb3a6; }
.choice-grid input:focus-visible + span { outline: 3px solid rgba(32,81,63,.2); outline-offset: 2px; }

.primary-button { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 5px; padding: 0 22px; color: white; background: var(--forest); border: 0; border-radius: 16px; box-shadow: 0 13px 26px rgba(23,61,48,.2); font-weight: 850; cursor: pointer; transition: transform .18s, background .18s, box-shadow .18s; }
.primary-button svg { width: 22px; height: 22px; color: var(--lime); }
.primary-button:hover { background: #20513f; transform: translateY(-1px); box-shadow: 0 16px 30px rgba(23,61,48,.24); }
.primary-button:active { transform: translateY(0); }
.form-message { min-height: 18px; margin: 9px 0 -12px; color: #a33b26; font-size: .76rem; text-align: center; }

.result { position: sticky; top: 20px; min-height: 600px; }
.empty-state { min-height: 460px; display: grid; place-content: center; justify-items: center; padding: 40px; text-align: center; }
.empty-illustration { position: relative; width: 136px; height: 136px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 42px; color: var(--forest); background: linear-gradient(145deg, #edf9f2, #d9f3e4); transform: rotate(-3deg); }
.empty-illustration svg { width: 70px; height: 70px; }
.empty-illustration span { position: absolute; width: 10px; height: 10px; border-radius: 3px; background: var(--coral); }
.empty-illustration span:nth-child(1) { top: 14px; right: 22px; transform: rotate(22deg); }
.empty-illustration span:nth-child(2) { bottom: 22px; left: 14px; background: var(--lime); transform: rotate(45deg); }
.empty-illustration span:nth-child(3) { top: 44px; left: 7px; width: 7px; height: 7px; background: #f0c94d; }
.empty-state h3 { margin: 0; font-size: 1.1rem; }
.empty-state p { max-width: 340px; margin: 7px 0 0; color: var(--ink-soft); font-size: .84rem; }

.generated { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result-block { padding: 19px; border: 1px solid var(--line); border-radius: 18px; background: #fbfcfa; }
.result-block + .result-block { margin-top: 14px; }
.result-label { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; font-size: .76rem; font-weight: 850; }
.language { color: #829087; font-size: .65rem; font-weight: 600; }
.prompt-output { max-height: 246px; margin: 0; overflow: auto; color: #34433c; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.62; white-space: pre-wrap; }
.copy-button { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 9px 12px; color: var(--forest); background: white; border: 1px solid #cfd8d2; border-radius: 11px; font-size: .72rem; font-weight: 800; cursor: pointer; }
.copy-button:hover { border-color: #7fae96; background: #f4fbf7; }
.copy-button svg { width: 16px; height: 16px; }
.tag-count { color: #47705d; font-size: .67rem; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 7px 10px; color: #285440; background: #e2f6e9; border-radius: 999px; font-size: .69rem; font-weight: 750; }
.safety-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 13px 15px; color: #6c5630; background: #fff7df; border: 1px solid #f0ddb1; border-radius: 14px; font-size: .7rem; }
.safety-note strong { white-space: nowrap; }
.safety-note span { color: #7c6845; }

.image-lab { margin-top: 22px; }
.image-lab .panel-heading { margin-bottom: 22px; }
.image-step { color: #2b2517; background: #f4cf69; }
.feature-state { margin-left: auto; padding: 7px 10px; color: #6c5420; background: #fff4cf; border: 1px solid #eed78d; border-radius: 999px; font-size: .7rem; font-weight: 850; }
.image-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr); gap: 22px; }
.image-preview { min-height: 330px; display: grid; place-content: center; justify-items: center; padding: 34px; text-align: center; color: #678075; background: radial-gradient(circle at 50% 35%, #f0fbf5, #e4eee8); border: 1px dashed #a8c1b5; border-radius: 22px; }
.preview-mark { width: 90px; height: 90px; display: grid; place-items: center; margin-bottom: 16px; color: var(--forest); background: rgba(255,255,255,.75); border-radius: 26px; box-shadow: 0 14px 30px rgba(27,62,47,.08); }
.preview-mark svg { width: 48px; height: 48px; }
.image-preview strong { color: var(--ink); font-size: 1rem; }
.image-preview span { max-width: 310px; margin-top: 5px; font-size: .78rem; }
.generated-image { display: block; width: 100%; max-height: 560px; object-fit: contain; border-radius: 16px; }
.download-button { display: inline-flex; align-items: center; justify-content: center; margin-top: 16px; padding: 11px 16px; color: #fff; background: var(--forest); border-radius: 12px; font-size: .82rem; font-weight: 800; text-decoration: none; }
.image-preview[aria-busy="true"] { opacity: .72; }
.image-button:disabled { cursor: wait; opacity: .65; }
.generation-warning { padding: .8rem 1rem; border: 1px solid #e9ca77; border-radius: 12px; background: #fff7dc; color: #644d0d; font-size: .78rem; line-height: 1.5; }
.admin-panel[hidden] { display: none; }
[hidden] { display: none !important; }
.admin-form { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.admin-form label { display: grid; gap: 6px; font-size: .78rem; font-weight: 750; }
.admin-form input, .admin-form select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.admin-form button { min-height: 44px; }
.admin-form p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 740px) { .admin-form { grid-template-columns: 1fr; } }
.image-controls { display: flex; flex-direction: column; justify-content: center; padding: 8px 6px; }
.control-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.control-label, .generator-settings label > span { display: block; margin-bottom: 5px; color: #718078; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.control-head strong { display: block; font-size: .86rem; }
.text-button { flex: 0 0 auto; color: var(--forest); background: transparent; border: 0; font-size: .72rem; font-weight: 850; cursor: pointer; }
.image-history { margin-top: 1.5rem; }
.history-list { display: grid; gap: .7rem; margin-top: 1rem; }
.history-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1rem; border: 1px solid #dce5de; border-radius: 14px; }
.history-item div { min-width: 0; }
.history-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 48rem; }
.history-item small { color: #61736a; }
.history-item a { flex: 0 0 auto; }
@media (max-width: 640px) { .history-item { align-items: flex-start; flex-direction: column; } }
.generator-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.generator-settings label { min-width: 0; }
.generator-settings select { width: 100%; min-height: 48px; padding: 0 40px 0 13px; color: var(--ink); background: #fff; border: 1px solid #cfd8d2; border-radius: 13px; }
.generator-settings .check-row { grid-column: 1 / -1; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 13px; background: #f7faf8; border: 1px solid var(--line); border-radius: 13px; }
.generator-settings .check-row input { width: 18px; height: 18px; accent-color: var(--forest); }
.generator-settings .check-row span { margin: 0; color: var(--ink); font-size: .76rem; letter-spacing: 0; text-transform: none; }
.image-button { margin-top: 0; }
.cost-note { margin: 10px 0 0; color: #7a8881; font-size: .7rem; text-align: center; }

.account-panel { margin-top: 22px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 34px; align-items: center; padding: clamp(24px, 4vw, 42px); color: white; background: var(--forest); border-radius: 28px; box-shadow: var(--shadow); }
.account-panel h2 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.2rem); letter-spacing: -.035em; }
.account-panel p:not(.eyebrow) { max-width: 520px; margin: 10px 0 0; color: #c9d8d1; font-size: .86rem; }
.account-panel .eyebrow { color: var(--lime); }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 16px; color: var(--ink); background: #f7fbf8; border: 1px solid rgba(255,255,255,.2); border-radius: 17px; overflow: hidden; }
.plan-card.featured { background: linear-gradient(145deg, #f8ffd9, #dcf6e6); border-color: rgba(182,239,99,.65); }
.plan-card > span { color: #567065; font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.plan-card strong { margin-top: 3px; font-size: 1.45rem; line-height: 1.2; letter-spacing: -.03em; }
.plan-card strong small { color: #6e7b74; font-size: .65rem; font-weight: 650; letter-spacing: 0; }
.plan-card b { margin-top: 10px; color: var(--forest); font-size: .82rem; }
.plan-card > small { margin-top: 6px; color: #4f6258; font-size: .8rem; line-height: 1.45; }
.account-panel .plan-disclaimer { max-width: none; margin-top: 18px; font-size: .85rem; line-height: 1.55; }
.account-statuses { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.account-statuses > div { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; padding: 13px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 15px; }
.state-dot { grid-row: 1 / span 2; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; }
.state-dot.ready { background: var(--lime); box-shadow: 0 0 0 4px rgba(182,239,99,.12); }
.state-dot.waiting { background: #f4cf69; box-shadow: 0 0 0 4px rgba(244,207,105,.1); }
.account-statuses strong { font-size: .78rem; }
.account-statuses small { color: #b9cbc2; font-size: .67rem; }

.activation-dialog { width: min(520px, calc(100% - 30px)); padding: 30px; color: var(--ink); background: var(--paper); border: 0; border-radius: 24px; box-shadow: 0 28px 90px rgba(0,0,0,.3); }
.activation-dialog::backdrop { background: rgba(10,24,18,.65); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; color: #53635b; background: #edf2ef; border: 0; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; background: var(--mint); border-radius: 16px; font-size: 1.35rem; }
.activation-dialog h2 { margin: 18px 0 8px; font-size: 1.45rem; }
.activation-dialog p, .activation-dialog li { color: var(--ink-soft); font-size: .82rem; }
.activation-dialog ul { padding-left: 20px; }
.activation-dialog li + li { margin-top: 5px; }
.dialog-confirm { margin-top: 18px; }

footer { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 72px); color: #aebdb6; background: #12251d; font-size: .72rem; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 11px 15px; color: white; background: var(--forest); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.2); font-size: .76rem; font-weight: 750; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1040px) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .quality-card { width: fit-content; }
  .workspace { grid-template-columns: 1fr; }
  .result { position: static; min-height: auto; }
  .empty-state { min-height: 340px; }
  .account-panel { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { min-height: 68px; padding: 11px 18px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand small { display: none; }
  .status { font-size: 0; padding: 9px; }
  main { width: min(100% - 24px, 1280px); padding: 32px 0 38px; }
  .intro { gap: 22px; margin-bottom: 23px; }
  h1 { font-size: clamp(2.08rem, 11.2vw, 3.1rem); }
  .quality-card { min-width: 0; width: 100%; }
  .workspace { gap: 14px; }
  .panel { padding: 20px 16px; border-radius: 22px; }
  .panel-heading { margin-bottom: 23px; }
  .motif-grid { grid-template-columns: repeat(2, 1fr); }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .color-grid { grid-template-columns: repeat(2, 1fr); }
  .color-grid label:last-child { grid-column: span 2; }
  .theme-row { grid-template-columns: 1fr 64px; }
  .safety-note { display: block; }
  .safety-note strong { display: block; margin-bottom: 3px; }
  .image-grid { grid-template-columns: 1fr; }
  .image-preview { min-height: 260px; }
  .generator-settings { grid-template-columns: 1fr; }
  .generator-settings .check-row { grid-column: auto; }
  .account-statuses { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  footer { display: block; text-align: center; }
  footer span { display: block; }
  footer span + span { margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* Customer sign-in */
.member-page { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 1.5rem; background: #10231b; color: #e9f2eb; font: 16px/1.5 system-ui, sans-serif; }
.member-card { width: min(100%, 28rem); padding: clamp(1.5rem, 5vw, 2.5rem); border-radius: 1.5rem; background: #1d3429; border: 1px solid #42614c; box-shadow: 0 20px 60px #07120c66; }
.member-card h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: .5rem 0 1rem; line-height: 1.1; }
.member-card p { color: #cbd9ce; }
.member-eyebrow { letter-spacing: .14em; font-size: .85rem; font-weight: 700; color: #b5db9b; }
.member-card form { display: grid; gap: .65rem; margin-top: 1.5rem; }
.member-card label { font-weight: 650; margin-top: .4rem; }
.member-card input { padding: .8rem 1rem; font: inherit; border: 1px solid #74917a; border-radius: .7rem; background: #f5faf4; color: #10231b; }
.member-card button { margin-top: .75rem; padding: .9rem 1.2rem; border: 0; border-radius: .7rem; background: #b5db9b; color: #122a1b; font: inherit; font-weight: 750; cursor: pointer; }
.member-card button:disabled { opacity: .65; cursor: wait; }
.member-card a { color: #d7f3ba; }
.member-help { margin-bottom: 0; font-size: .9rem; }
.logout-button { border: 1px solid #719180; border-radius: .6rem; color: inherit; background: transparent; padding: .55rem .8rem; cursor: pointer; font: inherit; }
