@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Noto+Sans+SC:wght@400;450;500;550;600;650;700&display=swap');

:root {
  --paper: #f6f6f2;
  --surface: #fff;
  --ink: #242922;
  --muted: #858980;
  --soft: #a8aca2;
  --line: #e7e8e1;
  --lime: #d7f788;
  --lime-dark: #b9e560;
  --dark: #252d24;
  --error: #bf4e3d;
  --radius: 16px;
  font-family: 'DM Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button { border: 0; }
button:disabled { opacity: .55; cursor: not-allowed; }
button, a { touch-action: manipulation; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #8ca452; outline-offset: 4px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #b7cb8a; outline-offset: 2px; }
.site-header { height: 88px; padding: 0 4.5vw; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; display: flex; gap: 3px; align-items: center; justify-content: center; transform: skew(-12deg); }
.brand-mark span { display: block; background: var(--ink); width: 6px; height: 24px; border-radius: 2px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 10px; }
.brand-name { font-size: 25px; font-weight: 650; letter-spacing: -1.3px; }
.brand-dot { color: #7b9650; }
.brand-divider { height: 18px; width: 1px; background: #d4d7ce; margin: 0 4px; }
.brand-subtitle { font-size: 11px; font-weight: 500; letter-spacing: 2px; color: #797f73; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.privacy-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.tiny-dot { display: inline-block; width: 5px; height: 5px; background: #91a774; border-radius: 50%; flex-shrink: 0; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 0; background: none; font-size: 13px; }
.text-button svg { width: 18px; height: 18px; }
.history-count { font-size: 10px; min-width: 19px; height: 18px; display: grid; place-items: center; background: #e9ebe3; border-radius: 5px; }
.avatar-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: #e7eadf; border: 1px solid #dce0d1; border-radius: 50%; }
.avatar-button svg { width: 17px; height: 17px; }
.key-dot { position: absolute; width: 8px; height: 8px; right: 0; bottom: 1px; border-radius: 50%; background: #aaa; border: 2px solid var(--paper); }
.key-dot.connected { background: #6e9b3e; }
.workspace { max-width: 1440px; margin: 0 auto; padding: 48px 5vw 64px; display: grid; grid-template-columns: minmax(360px, .88fr) minmax(400px, 1.12fr); gap: clamp(42px, 6.5vw, 100px); align-items: start; }
.composer-column { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 2px; font-weight: 550; color: #7c8374; }
.eyebrow > span { width: 16px; height: 1px; background: #8e9b7e; }
.intro h1 { margin: 15px 0 11px; font-weight: 500; font-size: clamp(30px, 2.65vw, 40px); line-height: 1.3; letter-spacing: -1.4px; }
.intro h1 em { font-style: normal; color: #737e65; }
.intro p { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .6px; }
.model-switch { margin-top: 30px; padding: 4px; display: flex; gap: 4px; border: 1px solid var(--line); background: #eceee6; border-radius: 14px; }
.model-option { min-width: 0; flex: 1; display: flex; align-items: center; text-align: left; padding: 12px 14px; gap: 10px; background: transparent; border-radius: 10px; transition: background .2s, box-shadow .2s; }
.model-option.selected { background: #fff; box-shadow: 0 2px 5px #27322007, 0 0 0 1px #e2e6d9; }
.model-symbol { width: 32px; height: 32px; display: grid; place-items: center; font-size: 17px; font-weight: 500; border-radius: 9px; flex-shrink: 0; }
.qwen-symbol { background: #e9e4f6; color: #79579e; font-family: Georgia, serif; font-style: italic; }
.flux-symbol { background: #e0e9e9; color: #4c7575; }
.model-label { display: flex; flex-direction: column; gap: 1px; }
.model-label strong { font-size: 14px; font-weight: 600; letter-spacing: .1px; }
.model-label small { font-size: 10px; color: var(--muted); letter-spacing: .5px; }
.model-check { margin-left: auto; color: #718251; display: none; }
.model-check svg { width: 15px; height: 15px; stroke-width: 2; }
.selected .model-check { display: block; }
.model-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 3px 0; font-size: 10px; color: var(--muted); }
.model-tag { border-radius: 4px; padding: 3px 6px; color: #758561; background: #e9eedf; font-size: 9px; }
.mode-row { display: flex; align-items: center; gap: 16px; margin: 30px 0 21px; }
.mode-switch { display: flex; gap: 21px; }
.mode-switch button { position: relative; background: transparent; padding: 4px 0 10px; color: #929789; font-size: 14px; font-weight: 500; }
.mode-switch button.selected { color: var(--ink); }
.mode-switch button.selected::after { content: ''; position: absolute; height: 2px; width: 19px; left: calc(50% - 9px); bottom: 0; border-radius: 2px; background: #7d9064; }
.mode-hint { padding-left: 16px; border-left: 1px solid #dbdfd2; font-size: 11px; color: #a0a497; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-heading label, .section-heading h2 { font-size: 12px; font-weight: 550; margin: 0; }
.section-heading h2 span { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 7px; }
.char-count { color: #a0a497; font-size: 10px; font-variant-numeric: tabular-nums; }
.prompt-field { border: 1px solid #dcdfd4; border-radius: 13px; background: #fdfefb; transition: border-color .2s, box-shadow .2s; overflow: hidden; }
.prompt-field:focus-within { border-color: #a5b78c; box-shadow: 0 0 0 3px #dbe7c633; }
.prompt-field textarea { width: 100%; min-height: 136px; padding: 16px 17px 4px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); line-height: 1.9; font-size: 13px; display: block; }
.prompt-field textarea::placeholder { color: #a2a79c; }
.prompt-inspire { display: flex; align-items: center; gap: 5px; background: none; color: #8b947f; font-size: 10px; padding: 9px 15px 13px; margin-left: auto; }
.prompt-inspire svg { width: 14px; height: 14px; }
.negative-block { margin-top: 17px; display: flex; align-items: center; gap: 16px; }
.negative-block label { font-size: 11px; color: #656e5c; flex-shrink: 0; }
.negative-block label span { color: #a0a799; font-size: 9px; margin-left: 3px; }
.negative-block input { background: transparent; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 8px 2px; font-size: 11px; min-width: 0; border-radius: 0; }
.negative-block input::placeholder { color: #a4aa9e; }
.reference-section { margin: 0 0 22px; }
.small-button { display: inline-flex; align-items: center; gap: 4px; background: transparent; padding: 4px; color: #7c8e65; font-size: 11px; }
.small-button svg { width: 14px; height: 14px; }
.reference-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.reference-add { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px dashed #cbd2bd; border-radius: 10px; color: #7c896a; cursor: pointer; background: #fafbf6; }
.reference-add svg { width: 19px; height: 19px; margin-bottom: 5px; }
.reference-add span { font-size: 10px; }
.reference-add small { font-size: 7px; margin-top: 4px; color: #a5ab9a; }
.reference-item { position: relative; aspect-ratio: 1; border: 1px solid #dce2d3; border-radius: 10px; overflow: hidden; background: #e8ece1; }
.reference-item img { width: 100%; height: 100%; object-fit: cover; }
.reference-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #20291cd9; color: white; }
.reference-remove svg { width: 12px; height: 12px; }
.reference-item .reference-type { position: absolute; bottom: 0; left: 0; right: 0; font-size: 8px; padding: 4px; background: #20291cb8; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-note { color: var(--muted); font-size: 10px; line-height: 1.7; margin: 8px 0 0; }
.settings-panel { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings-panel > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 55px; cursor: pointer; font-size: 12px; }
.settings-panel > summary::-webkit-details-marker { display: none; }
.settings-panel > summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.settings-panel summary svg { width: 16px; height: 16px; color: #8d9583; }
.settings-summary { font-size: 10px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.settings-panel .chevron { transition: transform .2s; width: 13px; height: 13px; }
.settings-panel[open] .chevron { transform: rotate(180deg); }
.settings-content { padding: 4px 0 22px; }
.parameter-group { margin-bottom: 23px; }
.parameter-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; margin-bottom: 11px; }
.dimension-toggle { display: flex; gap: 4px; align-items: center; background: transparent; font-size: 10px; color: #8a947e; padding: 0; min-height: 24px; }
.dimension-toggle svg { width: 12px; height: 12px; }
.dimension-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.size-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.size-preset { padding: 8px 10px; background: #fdfefb; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 6px; font-size: 10px; color: #7c8471; min-height: 38px; }
.size-preset .ratio-icon { display: block; border: 1px solid #a6af9b; border-radius: 2px; width: 12px; height: 12px; }
.size-preset.selected { background: #edf4df; color: #586c3f; border-color: #c7d7ad; }
.size-preset.selected .ratio-icon { border-color: #7a9458; background: #b7d08c; }
.dimension-note { font-size: 9px; color: #a0a698; margin: 9px 0 0; }
.custom-size { display: flex; align-items: end; gap: 12px; margin-top: 13px; }
.custom-size label { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.custom-size label span { color: var(--muted); font-size: 10px; }
.custom-size input { width: 100%; border: 1px solid #dce1d2; border-radius: 7px; padding: 8px 10px; background: #fff; font-size: 12px; }
.dimension-x { padding-bottom: 9px; color: #9aa28f; }
.slider-group { margin: 0 0 22px; }
.parameter-label output { min-width: 34px; padding: 3px 6px; background: #e9eddf; color: #64774b; text-align: center; border-radius: 5px; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.range { --fill: 78%; -webkit-appearance: none; appearance: none; width: 100%; height: 4px; display: block; background: linear-gradient(to right, #8fa271 var(--fill), #e2e6da var(--fill)); border-radius: 4px; margin: 16px 0 10px; cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; height: 15px; width: 15px; border-radius: 50%; background: #fdfefb; border: 3px solid #829967; box-shadow: 0 1px 4px #3c502933; }
.range::-moz-range-thumb { height: 10px; width: 10px; border-radius: 50%; background: #fdfefb; border: 3px solid #829967; box-shadow: 0 1px 4px #3c502933; }
.range-labels { display: flex; justify-content: space-between; color: #a3aa9a; font-size: 9px; }
.settings-split { display: grid; grid-template-columns: 1fr 1.5fr; gap: 15px; }
.select-field, .seed-field { display: flex; flex-direction: column; gap: 9px; }
.select-field > span, .seed-field > span:first-child { font-size: 10px; color: #747e68; }
.select-field select { -webkit-appearance: none; appearance: none; width: 100%; height: 39px; padding: 0 28px 0 11px; border: 1px solid #dfe4d5; border-radius: 8px; background: #fdfefb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23859076' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center; font-size: 11px; color: #5c6951; }
.seed-field small { color: #a0a899; font-size: 8px; margin-left: 4px; }
.seed-input { display: flex; border: 1px solid #dfe4d5; border-radius: 8px; background: #fdfefb; height: 39px; }
.seed-input input { border: 0; background: transparent; padding: 0 11px; width: 100%; min-width: 0; font-size: 11px; color: #5c6951; }
.seed-input button { width: 36px; display: grid; place-items: center; background: transparent; color: #93a080; }
.seed-input svg { width: 14px; height: 14px; }
.advanced-field { margin-top: 16px; }
.advanced-toggle { display: flex; align-items: center; gap: 5px; padding: 5px 0; font-size: 10px; background: transparent; color: #87927a; min-height: 32px; }
.advanced-toggle svg { width: 12px; height: 12px; }
.advanced-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
#advanced-content { margin-top: 10px; }
#advanced-content label { font-size: 11px; }
#advanced-content label span { font-size: 9px; color: var(--muted); }
#advanced-content input { width: 100%; margin-top: 8px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 12px; background: #fff; }
.form-error { color: var(--error); font-size: 11px; line-height: 1.7; background: #f9eeea; padding: 10px 12px; border-radius: 8px; margin: 14px 0 0; }
.generate-button { display: flex; align-items: center; gap: 10px; justify-content: center; width: 100%; padding: 14px 18px; margin-top: 23px; min-height: 54px; border-radius: 11px; background: var(--lime); color: #35432a; font-weight: 550; font-size: 14px; box-shadow: 0 3px 7px #637a2610; transition: background .2s, transform .2s; }
.generate-button:hover { background: #cef176; transform: translateY(-1px); }
.generate-button:active { transform: translateY(0); }
.generate-icon { display: flex; }
.generate-icon svg { width: 17px; height: 17px; }
.generate-arrow { margin-left: auto; width: 18px; height: 18px; }
.generate-button::before { content: ''; width: 18px; }
.generate-icon { margin-left: -28px; }
.composer-footnote { display: flex; align-items: center; justify-content: center; gap: 5px; color: #9ca493; font-size: 9px; margin-top: 12px; }
.composer-footnote svg { width: 11px; height: 11px; }
.canvas-column { position: sticky; top: 26px; min-width: 0; padding-top: 13px; }
.canvas-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 9px; letter-spacing: 1.1px; color: #8c9483; }
.canvas-heading > div { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .6px; color: #737d69; }
.canvas-heading .tiny-dot { width: 4px; height: 4px; }
.canvas { position: relative; width: 100%; aspect-ratio: 1; border-radius: 20px; background: #eaece3; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.canvas::before { content: ''; position: absolute; inset: 0; opacity: .24; background-image: radial-gradient(#919e80 .6px, transparent .6px); background-size: 14px 14px; pointer-events: none; }
.canvas-empty { text-align: center; padding: 35px 15px; z-index: 1; }
.empty-art { width: 170px; height: 145px; margin: 0 auto 20px; position: relative; display: grid; place-items: center; }
.art-orbit { position: absolute; width: 145px; height: 92px; border: 1px solid #b3bca5; border-radius: 50%; transform: rotate(-32deg); }
.orbit-two { transform: rotate(35deg); width: 133px; height: 95px; border-color: #c5cdb8; }
.art-sphere { position: absolute; width: 87px; height: 87px; border-radius: 50%; background: radial-gradient(circle at 33% 24%, #f1f6de 0, #dbe8b6 25%, #b5c98d 58%, #8b9d71 100%); box-shadow: 4px 15px 22px -9px #8b9c6780; }
.empty-art svg { position: relative; width: 30px; height: 30px; color: #f8fcef; stroke-width: 1; filter: drop-shadow(0 1px 2px #7b926444); }
.canvas-empty h2 { font-size: 20px; font-weight: 450; letter-spacing: 1px; margin: 0 0 10px; color: #69745b; }
.canvas-empty p { font-size: 11px; color: #929d83; margin: 0; letter-spacing: .4px; }
.empty-palette { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.empty-palette span { display: block; width: 17px; height: 5px; border-radius: 3px; background: #c7d1b6; }
.empty-palette span:nth-child(2) { background: #b5c5a0; }
.empty-palette span:nth-child(3) { background: #8eaa68; }
.empty-palette span:nth-child(4) { background: #bfc8a6; }
.empty-palette span:nth-child(5) { background: #d5dbc8; }
#result-image { width: 100%; height: 100%; object-fit: contain; position: relative; background: #e8ece1; }
.canvas.has-result { background: #dfe5d7; }
.canvas.has-result::before { display: none; }
.expand-button { position: absolute; right: 15px; bottom: 15px; width: 40px; height: 40px; background: #fffffff0; display: grid; place-items: center; border-radius: 11px; box-shadow: 0 3px 15px #25371815; color: #627451; }
.expand-button svg { width: 17px; height: 17px; }
.result-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: #8e9683; padding: 16px 1px 0; }
.result-info > div { display: flex; gap: 9px; align-items: center; }
.result-model { color: #67765a; font-weight: 500; }
.result-divider { height: 9px; width: 1px; background: #d4dbca; }
#result-time { font-size: 9px; }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }
.result-actions button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; border-radius: 9px; font-size: 11px; }
.result-actions svg { width: 15px; height: 15px; }
.download-button { flex: 1; background: var(--dark); color: #f0f3e8; }
.copy-button { flex: 1; background: transparent; border: 1px solid #dce2d1; color: #728261; }
.expiry-note { margin: 12px 0 0; text-align: center; color: #98a18c; font-size: 9px; line-height: 1.8; }
.canvas-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid #e3e7da; font-size: 8px; color: #a1aa94; letter-spacing: .7px; }
.canvas-footer > span:first-child { display: flex; align-items: center; gap: 5px; }
.canvas-footer .tiny-dot { width: 3px; height: 3px; }
.canvas-footer > span:last-child { font-size: 9px; letter-spacing: .5px; }
.sparkle { color: #8f9e75; font-size: 19px; vertical-align: middle; margin-left: 5px; line-height: 1; }
.canvas-loading { text-align: center; padding: 25px; z-index: 1; }
.loading-orbit { width: 75px; height: 75px; position: relative; margin: 0 auto 30px; animation: rotate 5s linear infinite; }
.loading-orbit::before { content: ''; position: absolute; inset: 0; border: 1px solid #bdcbaa; border-radius: 50%; }
.loading-orbit::after { content: ''; position: absolute; inset: 11px; border: 1px dashed #a5b992; border-radius: 50%; }
.loading-orbit span { position: absolute; border-radius: 50%; background: #93af67; width: 9px; height: 9px; left: 7px; top: 10px; }
.loading-orbit span:nth-child(2) { width: 6px; height: 6px; left: auto; right: 3px; top: 46px; background: #c0d1a5; }
.loading-orbit span:nth-child(3) { width: 20px; height: 20px; left: 29px; top: 27px; background: #e4edcd; }
.canvas-loading h2 { font-size: 16px; font-weight: 450; color: #6c7b5b; }
.canvas-loading p { font-size: 11px; line-height: 1.8; color: #929e82; }
.elapsed { font-variant-numeric: tabular-nums; color: #7c8e69; font-size: 12px; letter-spacing: 2px; margin-top: 17px; }
.cancel-button { background: transparent; border: 1px solid #ccd6bc; color: #7b8b69; border-radius: 8px; padding: 9px 18px; font-size: 11px; margin-top: 18px; min-width: 112px; }
@keyframes rotate { to { transform: rotate(360deg); } }
.site-footer { max-width: 1440px; margin: 0 auto; padding: 0 5vw 28px; display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: #a4ac9b; letter-spacing: .4px; }
.modal { border: 1px solid #e4e8dc; background: #fafbf6; color: var(--ink); border-radius: 22px; padding: 28px; width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 100px #1c291e30; }
.modal::backdrop, .history-drawer::backdrop, .lightbox::backdrop { background: #1e2b24a8; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-heading h2 { margin: 0; font-size: 18px; font-weight: 550; }
.modal-icon { width: 42px; height: 42px; background: #e8efdb; border-radius: 12px; display: grid; place-items: center; color: #748b56; }
.icon-button { background: #e9ede2; border-radius: 50%; display: grid; place-items: center; width: 36px; height: 36px; color: #718160; flex-shrink: 0; }
.icon-button svg { width: 16px; height: 16px; }
.modal h2 { font-size: 23px; font-weight: 500; letter-spacing: -.6px; margin: 0 0 12px; }
.modal-description { font-size: 12px; color: #8c9780; line-height: 1.9; margin: 0 0 23px; }
.modal form > label { display: block; font-size: 11px; margin-bottom: 8px; color: #67745a; }
.modal input { display: block; width: 100%; height: 45px; border: 1px solid #d5deca; border-radius: 9px; padding: 0 13px; font-size: 13px; background: #fff; }
.key-security { font-size: 9px; color: #8c9a7c; display: flex; align-items: center; gap: 6px; line-height: 1.8; margin: 14px 0 25px; }
.primary-button { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; background: var(--lime); min-height: 47px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #42562f; }
.primary-button svg { width: 17px; height: 17px; }
.modal-note { font-size: 9px; text-align: center; color: #9aa68b; margin: 15px 0 0; }
.history-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(410px, 100%); height: 100%; max-height: 100%; max-width: 100%; border: 0; border-radius: 20px 0 0 20px; background: #f9faf5; padding: 28px 24px calc(20px + env(safe-area-inset-bottom)); color: var(--ink); }
.history-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.history-header h2 { font-size: 26px; font-weight: 450; margin: 10px 0 0; letter-spacing: -1px; }
.history-header h2 span { font-size: 12px; color: #9da991; margin-left: 5px; }
.history-description { font-size: 10px; line-height: 1.8; color: #98a08e; margin: 13px 0 23px; }
.history-list { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.history-item { min-width: 0; }
.history-preview { padding: 0; width: 100%; aspect-ratio: 1; display: block; background: #e7ecdd; border-radius: 11px; overflow: hidden; position: relative; }
.history-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.history-preview:hover img { transform: scale(1.04); }
.history-model { position: absolute; left: 8px; top: 8px; padding: 3px 6px; border-radius: 4px; font-size: 8px; background: #fffffff0; color: #687956; }
.history-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 8px 1px; }
.history-meta span { color: #89967a; font-size: 9px; }
.history-meta button { width: 28px; height: 28px; display: grid; place-items: center; color: #97a287; background: transparent; }
.history-meta svg { width: 13px; height: 13px; }
.history-empty { text-align: center; color: #98a98a; padding: 70px 0; }
.history-empty svg { width: 32px; height: 32px; stroke-width: 1; margin-bottom: 10px; }
.history-empty p { font-size: 12px; }
.history-bottom { margin-top: 25px; }
.clear-button { display: flex; gap: 7px; align-items: center; justify-content: center; width: 100%; border: 1px solid #e2e6d9; color: #929c86; background: transparent; border-radius: 9px; min-height: 40px; font-size: 11px; }
.clear-button svg { width: 14px; height: 14px; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 95vw; max-height: 92vh; width: auto; height: auto; overflow: visible; }
.lightbox img { display: block; max-width: 95vw; max-height: 92vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: -46px; right: 0; background: #ffffffe8; }
.toast { position: fixed; bottom: calc(25px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 15px); max-width: calc(100% - 36px); padding: 12px 18px; background: #283724; color: #f2f6eb; box-shadow: 0 6px 24px #223d1920; border-radius: 11px; font-size: 12px; line-height: 1.7; text-align: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1200px) {
  .workspace { grid-template-columns: minmax(390px, 460px) minmax(500px, 1fr); padding-top: 52px; gap: clamp(60px, 8vw, 125px); }
  .canvas { max-height: calc(100vh - 200px); }
  .intro h1 { font-size: 38px; }
}
@media (max-width: 900px) {
  .workspace { gap: 32px; padding-left: 4vw; padding-right: 4vw; grid-template-columns: minmax(320px, .9fr) minmax(330px, 1.1fr); }
  .site-header { padding: 0 4vw; }
  .privacy-badge { display: none; }
  .header-actions { gap: 17px; }
  .canvas-footer > span:last-child { display: none; }
}
@media (max-width: 700px) {
  .site-header { height: 70px; padding: 0 22px; }
  .brand-name { font-size: 23px; }
  .brand-mark { width: 26px; transform: skew(-12deg) scale(.88); }
  .brand { gap: 8px; }
  .brand-subtitle, .brand-divider { display: none; }
  .header-actions { gap: 18px; }
  .text-button { min-height: 40px; }
  .text-button > span:not(.history-count) { display: none; }
  .avatar-button { width: 34px; height: 34px; }
  .workspace { display: flex; flex-direction: column; padding: 32px 22px 40px; gap: 35px; }
  .composer-column, .canvas-column { width: 100%; }
  .intro h1 { font-size: 32px; margin-top: 13px; }
  .intro p { font-size: 12px; }
  .model-switch { margin-top: 26px; }
  .model-option { padding: 11px 12px; }
  .model-caption { font-size: 10px; }
  .mode-row { margin-top: 26px; }
  .mode-switch button { min-height: 42px; padding-top: 0; }
  .mode-hint { font-size: 10px; }
  .prompt-field textarea { font-size: 16px; min-height: 130px; }
  .negative-block input { font-size: 16px; min-height: 40px; }
  .settings-panel { margin-top: 23px; }
  .settings-panel > summary { min-height: 56px; }
  .size-preset { padding: 9px 11px; min-height: 42px; }
  .range { height: 5px; margin-top: 20px; margin-bottom: 14px; }
  .range::-webkit-slider-thumb { width: 21px; height: 21px; border-width: 4px; }
  .range::-moz-range-thumb { width: 13px; height: 13px; border-width: 4px; }
  .select-field select, .seed-input { height: 43px; }
  .custom-size input { height: 43px; font-size: 16px; }
  .seed-input input { font-size: 16px; }
  .generate-button { min-height: 55px; }
  .canvas-column { position: static; padding-top: 0; }
  .canvas-heading { margin-bottom: 13px; }
  .canvas { border-radius: 17px; }
  .canvas-empty { padding: 25px 15px; }
  .empty-art { transform: scale(.84); margin-bottom: 7px; margin-top: -10px; }
  .canvas-empty h2 { font-size: 18px; }
  .canvas-empty p { font-size: 10px; }
  .empty-palette { margin-top: 22px; }
  .result-actions button { min-height: 47px; font-size: 12px; }
  .canvas-footer { margin-top: 28px; }
  .canvas-footer > span:last-child { display: inline; }
  .site-footer { padding: 0 22px 26px; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 8px; }
  .modal { padding: 25px; }
  .modal input { height: 48px; font-size: 16px; }
  .history-drawer { inset: auto 0 0; width: 100%; height: min(82dvh, 760px); border-radius: 22px 22px 0 0; padding: 24px 22px calc(20px + env(safe-area-inset-bottom)); }
  .history-list { gap: 12px; }
  .history-header h2 { font-size: 24px; }
  .small-button { min-height: 36px; }
  .reference-remove { width: 29px; height: 29px; }
}
@media (max-width: 370px) {
  .site-header, .workspace { padding-left: 17px; padding-right: 17px; }
  .intro h1 { font-size: 29px; }
  .model-option { gap: 8px; padding: 10px; }
  .model-symbol { width: 29px; height: 29px; }
  .size-presets { gap: 5px; }
  .size-preset { padding: 8px; gap: 4px; }
  .mode-hint { padding-left: 10px; }
  .mode-row { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
