:root {
  --bg0: #07060d;
  --bg1: #0b0717;
  --panel: rgba(16, 14, 26, 0.7);
  --panel2: rgba(16, 14, 26, 0.45);
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.6);
  --muted2: rgba(255, 255, 255, 0.42);
  --accent: #8b5cf6;
  --accent2: #a78bfa;
  --danger: #ef4444;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.75) rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.86), rgba(99, 102, 241, 0.72));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.92), rgba(129, 140, 248, 0.82));
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 50% -120px, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(99, 102, 241, 0.22), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 320px 1fr 420px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(99, 102, 241, 0.85));
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.model-picker {
  display: flex;
  justify-content: center;
}

.model-pill {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.model-pill-icon {
  color: var(--accent2);
  font-weight: 700;
}

.model-select {
  appearance: none;
  background: transparent;
  color: var(--text);
  border: none;
  outline: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding-right: 18px;
  cursor: pointer;
}

.model-select option {
  color: #111827;
}

.model-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: rgba(255, 255, 255, 0.86);
}

.topnav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.lang-switch {
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-icon {
  font-size: 14px;
  opacity: 0.9;
}

.lang-select {
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
  cursor: pointer;
}

.lang-select option {
  color: #111827;
}

.nav-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-btn-primary {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.34);
  color: rgba(255, 255, 255, 0.9);
}

.content {
  flex: 1;
  min-height: 0;
  padding: 18px;
}

.banner {
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: radial-gradient(500px 120px at 50% 0%, rgba(139, 92, 246, 0.22), transparent 70%),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.14);
  margin-bottom: 14px;
}

.banner-title {
  font-weight: 900;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.92);
}

.workspace {
  height: calc(100% - 64px);
  min-height: 520px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 16px;
  align-items: stretch;
}

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.panel-left,
.panel-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-left {
  padding: 14px;
  gap: 14px;
  overflow-y: auto;
  max-height: 100%;
}

.panel-section {
  border-radius: 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 12px;
}

.section-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 10px;
}

.upload-box {
  position: relative;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
  padding: 12px;
  display: grid;
  place-items: center;
  min-height: 130px;
  outline: none;
}

.upload-box:hover {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.06);
}

.upload-box.is-dragover {
  border-color: rgba(139, 92, 246, 0.75);
  background: rgba(139, 92, 246, 0.1);
}

.upload-box.edit-mode {
  border-color: rgba(139, 92, 246, 0.75);
  background: rgba(139, 92, 246, 0.1);
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-inner {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
}

.upload-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.8);
}

.upload-text {
  font-weight: 800;
}

.upload-sub {
  font-size: 12px;
  color: var(--muted2);
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-thumbs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, 95px);
  gap: 10px;
}

.upload-thumb {
  position: relative;
  width: 95px;
  height: 95px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  font-weight: 800;
}

.upload-thumb-remove:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
}

.mini-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-weight: 700;
}

.mini-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mini-btn:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.12);
}

#btn-toggle-edit {
  top: 44px;
}

.prompt-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 12px;
  outline: none;
  line-height: 1.5;
}

.prompt-input:focus {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.field-block+.field-block {
  margin-top: 12px;
}

.field-label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 800;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.seg-btn {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.seg-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.seg-btn.active {
  background: rgba(139, 92, 246, 0.28);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.chip.active {
  background: rgba(139, 92, 246, 0.24);
  border-color: rgba(139, 92, 246, 0.5);
}

.actions {
  display: grid;
  gap: 10px;
}

.generate-btn {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.55);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.5), rgba(99, 102, 241, 0.45));
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spark {
  color: rgba(255, 255, 255, 0.95);
}

.status {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.status.is-error {
  color: rgba(239, 68, 68, 0.9);
}

.tabs {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.tab {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.tab-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
}

.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-shell {
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-empty {
  text-align: center;
  display: grid;
  gap: 8px;
}

.preview-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
  margin: 0 auto;
}

.preview-text {
  font-weight: 900;
  color: rgba(255, 255, 255, 0.85);
}

.preview-sub {
  font-size: 12px;
  color: var(--muted2);
}

.result-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.1);
}

.preview-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

button.secondary,
button.primary {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-weight: 800;
}

button.secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.primary {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.2);
}

.code-shell+.code-shell {
  margin-top: 12px;
}

.code-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 8px;
}

.code-block {
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.88);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  max-height: 42vh;
}

.hidden {
  display: none !important;
}

.modal-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-inner {
  width: min(920px, 100%);
  max-height: min(78vh, 860px);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(18, 14, 30, 0.96), rgba(10, 8, 16, 0.96));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.modal-header {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.modal-content {
  padding: 16px;
  overflow: auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.info-k {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 900;
  margin-bottom: 8px;
}

.info-v {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
}

.compare-intro {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.08);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.compare-table {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr;
  gap: 0;
}

.compare-row+.compare-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-head {
  background: rgba(139, 92, 246, 0.14);
}

.compare-col {
  padding: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.compare-row:not(.compare-head) .compare-col:nth-child(1) {
  color: var(--muted);
}

.compare-row:not(.compare-head) .compare-col:nth-child(4) {
  color: rgba(139, 92, 246, 0.9);
  font-weight: 900;
}

.compare-sections {
  display: grid;
  gap: 20px;
}

.compare-section {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.compare-section-title {
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.compare-list li {
  padding-left: 4px;
}

.compare-list strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 900;
}

.compare-desc {
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.compare-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.highlight-card {
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.08);
  padding: 12px;
}

.highlight-title {
  font-size: 13px;
  font-weight: 900;
  color: rgba(139, 92, 246, 0.95);
  margin-bottom: 6px;
}

.highlight-content {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.compare-footer {
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.08));
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.compare-footer strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 900;
}

.history-note {
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 12px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.history-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.history-open {
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
}

.history-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.history-thumb:hover {
  transform: scale(1.05);
}

.history-meta {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-download {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.9);
}

.history-download:hover {
  border-color: rgba(139, 92, 246, 0.55);
}

.history-prompt {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.35;
  max-height: 34px;
  overflow: hidden;
}

.history-sub {
  font-size: 11px;
  color: var(--muted2);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.history-empty {
  text-align: center;
  padding: 18px 0;
  color: var(--muted2);
  font-weight: 800;
}

.form-row+.form-row {
  margin-top: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.9);
  padding: 0 12px;
  outline: none;
}

.form-input:focus {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

.howto {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.howto-title {
  font-weight: 900;
  margin-bottom: 10px;
}

.howto-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.warn {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.form-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.input-with-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-actions .form-input {
  flex: 1;
  padding-right: 12px;
}

.input-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.input-action-btn:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.12);
}

.input-action-btn .btn-icon {
  font-size: 16px;
  line-height: 1;
}

.style-templates {
  margin-top: 14px;
}

.style-label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 800;
  margin-bottom: 8px;
}

.style-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.style-chip {
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.style-chip:hover {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.12);
  transform: translateY(-1px);
}

.style-chip:active {
  transform: translateY(0);
}

.style-icon {
  font-size: 16px;
}

.style-name {
  font-size: 12px;
}

.additional-prompt-section {
  margin-top: 14px;
}

.additional-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.additional-prompt-label {
  font-size: 12px;
  color: var(--muted2);
  font-weight: 800;
}

.clear-additional-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.clear-additional-btn:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}

.additional-prompt-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.08);
  color: var(--text);
  padding: 12px;
  outline: none;
  line-height: 1.5;
  font-size: 13px;
}

.additional-prompt-input:focus {
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 260px 1fr 340px;
  }

  .workspace {
    grid-template-columns: 380px 1fr;
  }

  .compare-highlights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px 14px;
  }

  .model-picker {
    justify-content: flex-start;
  }

  .topnav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .compare-row .compare-col {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .compare-row .compare-col:last-child {
    border-bottom: none;
  }

  .compare-row+.compare-row {
    border-top: 2px solid rgba(255, 255, 255, 0.12);
  }

  .compare-highlights {
    grid-template-columns: 1fr;
  }
}

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
}

.image-viewer-overlay.active {
  display: flex;
}

.image-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.image-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
  cursor: grab;
  user-select: none;
}

.image-viewer-image.dragging {
  cursor: grabbing;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

.image-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.image-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.image-viewer-nav.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.image-viewer-nav.disabled:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%);
}

.image-viewer-prev {
  left: 20px;
}

.image-viewer-next {
  right: 20px;
}

.image-viewer-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.image-viewer-control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.image-viewer-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

.image-viewer-counter {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  z-index: 10;
}
.enhancements-section {
  margin-top: 14px;
}

.toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-item input[type="checkbox"] {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-item input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.toggle-item input[type="checkbox"]:checked {
  background: rgba(139, 92, 246, 0.5);
  border-color: rgba(139, 92, 246, 0.5);
}

.toggle-item input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: #fff;
}

.toggle-text {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}
