*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #fff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1a1a1a; }
.aus-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1a1a1a; }
.aus-header { margin-bottom: 28px; }
.aus-header-inner { display: flex; align-items: center; justify-content: space-between; }
.aus-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: #1a1a1a; }
.aus-credits-pill { display: flex; align-items: center; gap: 6px; background: #f5f3ff; border: 1px solid #d4c5f9; border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: #6d28d9; }
.aus-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .aus-body { grid-template-columns: 1fr; } }
.aus-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.aus-section-label { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }
.aus-dropzone { border: 2px dashed #d1d5db; border-radius: 10px; padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; min-height: 140px; display: flex; align-items: center; justify-content: center; position: relative; }
.aus-dropzone:hover, .aus-dropzone.drag-over { border-color: #7c3aed; background: #f5f3ff; }
.aus-dropzone p { margin: 8px 0 0; font-size: 13px; color: #555; }
.aus-sub { font-size: 11px; color: #999; margin-top: 4px; }
.aus-link-btn { background: none; border: none; color: #7c3aed; cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }
.aus-toggle-row { display: flex; gap: 8px; }
.aus-toggle-btn { flex: 1; padding: 8px; background: #f9fafb; border: 2px solid #e5e7eb; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; color: #555; transition: all .15s; }
.aus-toggle-btn.active { border-color: #7c3aed; background: #f5f3ff; color: #6d28d9; }
.aus-run-btn { width: 100%; margin-top: 18px; padding: 12px; background: #7c3aed; border: none; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s; }
.aus-run-btn:hover { opacity: .88; }
.aus-run-btn:disabled { opacity: .5; cursor: not-allowed; }
.aus-cost-badge { background: rgba(255,255,255,0.2); border-radius: 10px; padding: 2px 8px; font-size: 11px; }
.aus-hint { font-size: 11px; color: #888; margin-top: 10px; min-height: 16px; }
.aus-result-area { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; min-height: 320px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.aus-result-empty { text-align: center; color: #ccc; }
.aus-result-empty p { margin-top: 12px; font-size: 13px; }
.aus-progress-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; width: 100%; }
.aus-spinner { width: 44px; height: 44px; border: 3px solid #0ea5e9; border-top-color: transparent; border-radius: 50%; animation: aus-spin 0.8s linear infinite; }
@keyframes aus-spin { to { transform: rotate(360deg); } }
.aus-progress-label { font-size: 13px; font-weight: 600; color: #555; }
.aus-progress-track { width: 220px; height: 5px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.aus-progress-bar { height: 100%; background: #0ea5e9; border-radius: 3px; width: 0%; transition: width .5s ease; }
.aus-cancel-btn { background: none; border: 1px solid #d1d5db; color: #888; border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: 12px; }
.aus-result-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.aus-dl-btn { display: flex; align-items: center; gap: 6px; background: #1a6e42; color: #fff; border: none; border-radius: 7px; padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.aus-dl-btn:hover { opacity: .85; }
.aus-again-btn { display: flex; align-items: center; gap: 6px; background: #f9fafb; color: #555; border: 1px solid #e5e7eb; border-radius: 7px; padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.aus-again-btn:hover { border-color: #7c3aed; color: #6d28d9; }
.aus-modal { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 28px; max-width: 340px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.aus-variant-btn { width: 100%; background: #f9fafb; border: 2px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; cursor: pointer; text-align: left; transition: all .15s; font-family: inherit; }
.aus-variant-btn:hover { border-color: #7c3aed; background: #f5f3ff; }
.aus-variant-btn.active { border-color: #7c3aed; background: #f5f3ff; }
.aus-variant-credits { font-size: 12px; color: #6d28d9; font-weight: 600; }
.aus-edit-btn { display: flex; align-items: center; gap: 6px; background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; border-radius: 7px; padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.aus-edit-btn:hover { background: #e0f2fe; border-color: #0ea5e9; }
.aus-history-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display:flex; align-items:center; gap:12px; }
.aus-history-item-thumb { position: relative; width: 120px; flex-shrink:0; border-radius: 7px; overflow: hidden; cursor: col-resize; user-select: none; line-height: 0; }
.aus-history-compare { position: relative; width: 100%; border-radius: 8px; overflow: hidden; cursor: col-resize; user-select: none; line-height: 0; margin-bottom: 12px; }
.aus-history-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.aus-history-edit-panel { display: none; margin-top: 10px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; }

/* ── Image Generator ── */
.gen-field { width:100%; background:#f9fafb; border:1px solid #e5e7eb; border-radius:8px; color:#1a1a1a; font-size:13px; padding:9px 12px; font-family:inherit; outline:none; }
.gen-field:focus { border-color:#7c3aed; background:#fff; }
textarea.gen-field { resize:vertical; min-height:110px; line-height:1.5; }
.gen-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px; }
.gen-count { display:flex; gap:6px; }
.gen-count .aus-toggle-btn { padding:8px 0; }
.gen-cost { font-size:12px; color:#6d28d9; margin-top:10px; font-weight:600; }
.gen-grid { display:grid; grid-template-columns:1fr; gap:12px; width:100%; }
.gen-grid.n2, .gen-grid.n3, .gen-grid.n4 { grid-template-columns:1fr 1fr; }
.gen-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; display:flex; flex-direction:column; }
.gen-card-img { position:relative; overflow:hidden; background:repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; display:flex; align-items:center; justify-content:center; }
.gen-card-expand { position:absolute; top:6px; right:6px; z-index:21; width:28px; height:28px; border-radius:6px; border:none; background:rgba(0,0,0,.55); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.gen-card-img img { display:block; width:100%; height:auto; }
.gen-card-actions { display:flex; gap:6px; padding:8px; flex-wrap:wrap; border-top:1px solid #f0f0f0; }
.gen-card-actions button { flex:1; min-width:70px; font-size:11px; padding:7px 6px; justify-content:center; }
.gen-card-info { font-size:10px; color:#888; padding:0 8px 8px; }
.gen-card-edit { display:none; padding:8px; border-top:1px solid #f0f0f0; background:#f9fafb; }
.gen-card-edit textarea { width:100%; min-height:56px; font-size:12px; }
.gen-card-edit .gen-edit-btns { display:flex; gap:6px; margin-top:6px; }
.gen-card-busy { padding:6px 8px; font-size:11px; color:#6d28d9; display:none; }
.gen-history-item { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:10px; display:flex; gap:12px; align-items:center; }
.gen-history-thumbs { display:flex; gap:4px; flex-shrink:0; }
.gen-history-thumbs img { width:56px; height:56px; object-fit:cover; border-radius:6px; border:1px solid #e5e7eb; cursor:pointer; }
.gen-lightbox { display:none; position:fixed; inset:0; background:rgba(0,0,0,.9); z-index:999999; align-items:center; justify-content:center; cursor:zoom-out; }
.gen-lightbox img { max-width:92vw; max-height:90vh; border-radius:8px; }
@media (max-width:768px) { .gen-row { grid-template-columns:1fr; } }

/* Hard Edges */
.gen-hard-canvas { display:block; width:100%; height:auto; position:absolute; top:0; left:0; }
.gen-card-img img { position:relative; }
.gen-hard-help { font-size:11px; color:#555; line-height:1.5; margin-bottom:8px; }
.gen-hard-help i { color:#7c3aed; font-style:normal; }
.gen-hard-row { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:600; color:#444; }
.gen-hard-row input { flex:1; accent-color:#7c3aed; }
.gen-hard-val { min-width:30px; text-align:right; font-variant-numeric:tabular-nums; }
.gen-hard-stats { font-size:11px; color:#6d28d9; margin:6px 0 8px; line-height:1.5; }
.gen-hard-stats span { color:#888; }
