:root {
  --bg: #0b0d11;
  --panel: #12161d;
  --panel-2: #171c25;
  --line: #2a3240;
  --text: #f5f7fb;
  --muted: #9aa6b7;
  --accent: #6ea8fe;
  --accent-2: #8cc5ff;
  --success: #76d39b;
  --danger: #ff8a8a;
  --shadow: 0 18px 50px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { padding: 28px 18px 48px; }
.shell { width: min(1180px, 100%); margin: 0 auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
h1 { margin: 4px 0 4px; font-size: clamp(32px, 5vw, 56px); line-height: 1; }
.topbar p { margin: 8px 0 0; color: var(--muted); max-width: 680px; }
.badge { padding: 9px 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.badge.ok { color: var(--success); border-color: rgba(118,211,155,.35); }
.badge.bad { color: var(--danger); border-color: rgba(255,138,138,.35); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin: 16px 0; box-shadow: var(--shadow); }
.panel-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.panel-title-row > div:first-child { display: flex; align-items: center; gap: 12px; }
.step { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--panel-2); color: var(--accent-2); font-weight: 800; font-size: 13px; }
h2 { margin: 0; font-size: 20px; }
.button { appearance: none; border: 0; border-radius: 11px; min-height: 42px; padding: 0 15px; font-weight: 750; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: transform .12s ease, opacity .12s ease, background .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.primary { background: var(--accent); color: #07101d; min-width: 190px; }
.button.secondary { background: #222a36; color: var(--text); border: 1px solid #374254; }
.button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.drop-zone { min-height: 360px; border: 1.5px dashed #3a4659; background: #0e1218; border-radius: 16px; overflow: hidden; display: grid; place-items: center; cursor: pointer; position: relative; transition: border-color .15s ease, background .15s ease; }
.drop-zone.dragover { border-color: var(--accent); background: #111b28; }
.drop-empty { text-align: center; display: grid; gap: 8px; color: var(--muted); padding: 30px; }
.drop-empty strong { color: var(--text); }
.drop-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 6px; background: var(--panel-2); font-size: 26px; color: var(--accent-2); }
.preview-image { display: block; width: 100%; max-height: 640px; object-fit: contain; background: #090b0f; }
.meta-line { margin-top: 10px; color: var(--muted); font-size: 13px; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; font-weight: 760; color: #c9d2df; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.35; }
select, textarea, .readonly { width: 100%; border: 1px solid #344053; background: #0d1117; color: var(--text); border-radius: 12px; padding: 12px 13px; outline: none; font: inherit; }
select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,168,254,.10); }
.readonly { min-height: 44px; display: flex; align-items: center; color: var(--accent-2); font-weight: 800; }
.prompt-field { margin-top: 15px; }
textarea { resize: vertical; min-height: 118px; }
.prompt-footer { display: flex; justify-content: flex-end; color: var(--muted); font-size: 12px; }
.action-row { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.status-text { color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(7,16,29,.3); border-top-color: #07101d; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-wrap { margin-top: 14px; display: flex; align-items: center; gap: 12px; }
.progress-track { height: 8px; background: #232b37; border-radius: 999px; overflow: hidden; flex: 1; }
.progress-bar { width: 0; height: 100%; background: var(--accent); transition: width .25s ease; }
#progressText { color: var(--muted); font-size: 12px; min-width: 46px; text-align: right; }
.result-panel { min-height: 280px; }
.result-empty { min-height: 220px; border: 1px dashed #30394a; border-radius: 16px; display: grid; place-items: center; color: #778497; background: #0e1116; }
.result-placeholder { padding: 28px; text-align: center; }
.single-card { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0a0d12; }
.single-card img { width: 100%; max-height: 820px; object-fit: contain; display: block; }
.card-caption { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 13px; background: var(--panel-2); }
.card-caption .model-name { font-weight: 800; }
.card-caption .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.icon-button { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--text); background: #242e3d; text-decoration: none; border: 1px solid #3a4659; font-size: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.result-card { border: 1px solid var(--line); background: #0c1016; border-radius: 15px; overflow: hidden; min-width: 0; }
.result-card .thumb { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; background: #080a0e; overflow: hidden; }
.result-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.result-card.error { border-color: rgba(255,138,138,.35); }
.error-box { color: var(--danger); padding: 18px; font-size: 13px; line-height: 1.45; }
footer { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 16px 4px 0; color: #6f7b8b; font-size: 12px; }
.hidden { display: none !important; }
@media (max-width: 720px) {
  body { padding: 16px 10px 30px; }
  .topbar { display: block; }
  .badge { margin-top: 14px; display: inline-block; }
  .panel { padding: 16px; border-radius: 16px; }
  .panel-title-row { align-items: flex-start; }
  .controls-grid { grid-template-columns: 1fr; }
  .drop-zone { min-height: 260px; }
  .action-row { align-items: stretch; flex-direction: column; }
  .button.primary { width: 100%; }
}
