@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
.app-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  box-sizing: border-box;
}

.ds-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  font-weight: 600;
  display: block;
  text-align: center;
}

.ds-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
}
@media (max-width: 1360px) {
  .ds-grid-2 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.ds-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ds-imgbox {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-imgbox img.imgbox-image {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
}
.ds-imgbox .ds-nav-arrow, .ds-imgbox .ds-floating-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ds-imgbox:hover .ds-nav-arrow, .ds-imgbox:hover .ds-floating-actions {
  opacity: 1;
  pointer-events: auto;
}

.ds-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.ds-nav-arrow:hover {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%) scale(1.05);
}
.ds-nav-arrow.left {
  left: 16px;
}
.ds-nav-arrow.right {
  right: 16px;
}
.ds-nav-arrow svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.ds-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ds-input {
  flex: 1;
  padding: 16px 24px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0b2239;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  min-height: 52px;
}
.ds-input:focus {
  outline: none;
  border-color: #cbd5e1;
  box-shadow: 0 0 0 4px #f3f5fa;
}
.ds-input[readonly] {
  background: #f8fafc;
  cursor: default;
}

textarea.ds-input {
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.5;
}

.ds-btn {
  padding: 16px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0b2239;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  gap: 8px;
  white-space: nowrap;
}
.ds-btn-outline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #374151;
}
.ds-btn-outline:hover {
  border-color: #9ca3af;
  background: #f8fafc;
}
.ds-btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: #475569;
}
.ds-btn-ghost:hover {
  background: #f3f5fa;
  color: #1f2937;
}

.ds-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ds-chip {
  padding: 10px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}
.ds-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1f2937;
}
.ds-chip:focus, .ds-chip:active, .ds-chip.active {
  background: #ffffff;
  color: #7f549e;
  border-color: #7f549e;
  outline: none;
}

.ds-floating-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.ds-floating-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  text-decoration: none;
}
.ds-floating-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}
.ds-floating-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}
.ds-floating-btn.active svg {
  fill: #7f549e;
  fill-opacity: 0.5;
  stroke: #7f549e;
}

.ds-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
  display: none;
}
.ds-dropdown.active {
  display: block;
  animation: dsFadeIn 0.2s ease-out;
}
.ds-dropdown .ds-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
}
.ds-dropdown .ds-dropdown-item:hover {
  background: #f8fafc;
  color: #1f2937;
}
.ds-dropdown .ds-dropdown-item.danger {
  color: #ef4444;
}
.ds-dropdown .ds-dropdown-item.danger:hover {
  background: #fee2e2;
}

.ds-top-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.ds-nav-link {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.ds-nav-link:hover {
  color: #6f58c9;
}

.ds-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  width: 100%;
  border-top: 1px solid #e2e8f0;
}
@media (max-width: 900px) {
  .ds-toolbar {
    flex-wrap: wrap;
  }
}

.ds-select-wrap {
  position: relative;
  min-width: 160px;
}
.ds-select-wrap select.ds-input {
  appearance: none;
  padding-right: 48px;
  cursor: pointer;
}
.ds-select-wrap .ds-select-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca3af;
  width: 20px;
  height: 20px;
}

.ds-slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.ds-slider-group .ds-slider-label {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ds-slider-group .ds-slider-value {
  font-size: 11px;
  color: #6b7280;
}
.ds-slider-group input[type=range].ds-slider {
  flex: 1;
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  background: #cbd5e1;
  border-radius: 2px;
  outline: none;
}
.ds-slider-group input[type=range].ds-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #1f2937;
  cursor: pointer;
}
.ds-slider-group input[type=range].ds-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #1f2937;
  cursor: pointer;
}

.ds-input-with-btn {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
}
.ds-input-with-btn input.ds-input {
  border-radius: 8px;
  padding-right: 36px;
}
.ds-input-with-btn button.ds-input-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.ds-input-with-btn button.ds-input-btn:hover {
  color: #1f2937;
}
.ds-input-with-btn button.ds-input-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.app-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.app-nav-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.app-nav-brand {
  font-size: 19.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.05em;
}

.app-nav-divider {
  width: 1px;
  height: 28px;
  background: #e2e8f0;
  flex-shrink: 0;
  margin: 0 15px;
}

.app-nav-page {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-nav-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.app-nav-desc {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-shrink: 0;
}

.app-nav-spacer {
  flex: 1;
}

.app-nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 8px;
  transition: 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.app-nav-link:hover {
  background: rgba(111, 88, 201, 0.06);
  color: #6f58c9;
  border-color: rgba(111, 88, 201, 0.2);
  text-decoration: none;
}
.app-nav-link.active {
  background: rgba(111, 88, 201, 0.1);
  color: #6f58c9;
  border-color: rgba(111, 88, 201, 0.25);
}

.app-nav-back {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(111, 88, 201, 0.25);
  background: #ffffff;
  transition: 0.15s;
  white-space: nowrap;
}
.app-nav-back:hover {
  background: rgba(111, 88, 201, 0.06);
  color: #6f58c9;
  text-decoration: none;
}

.app-main {
  padding: 24px 16px;
  box-sizing: border-box;
}

.brush-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  margin-bottom: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  flex-wrap: wrap;
}
.brush-toolbar.brush-active {
  background: #f8fafc;
  border-color: #7f549e;
}

.brush-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.brush-toggle-btn:hover {
  color: #6b7280;
}
.brush-active .brush-toggle-btn {
  color: #7f549e;
}

.brush-size-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}
.brush-size-wrap input[type=range] {
  width: 80px;
  accent-color: #6b7280;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  appearance: none;
  cursor: pointer;
}
.brush-size-wrap input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
}
.brush-size-wrap input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: #9ca3af;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -5px;
}

.brush-size-val {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  min-width: 24px;
  text-align: right;
}

.brush-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.15s;
  padding: 0;
  margin-left: auto;
}
.brush-clear-btn:hover {
  background: #f8fafc;
  color: #ef4444;
}

.brush-source-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(111, 88, 201, 0.08);
  white-space: nowrap;
}

.brush-send-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 8px;
  border: none;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.brush-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.brush-send-btn:not(:disabled):hover {
  background: #dc2626;
}

.imgbox {
  position: relative;
  overflow: hidden;
}
.imgbox.painting .mask-canvas, .ds-imgbox.painting .mask-canvas {
  pointer-events: all;
  cursor: crosshair;
}

.mask-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: multiply;
  opacity: 0.55;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #1f2937;
  min-height: 100vh;
  width: 100%;
}

a {
  color: #6f58c9;
  text-decoration: none;
  transition: 0.15s;
}
a:hover {
  text-decoration: underline;
}

.page-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  width: 100%;
}
.page-center.middle {
  align-items: center;
}

.container {
  width: 100%;
  padding: 32px 8px 48px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.page {
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0;
}

.title-sm {
  font-size: 20px;
  font-weight: 750;
}

.subtitle {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

.card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(111, 88, 201, 0.12);
  border: 1px solid rgba(111, 88, 201, 0.14);
  width: 100%;
  box-sizing: border-box;
}

.card-padded {
  padding: 32px;
}

.card-main {
  max-width: 1700px;
}

.panel {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(111, 88, 201, 0.2);
  width: 100%;
  box-sizing: border-box;
}

.panel-flex {
  display: flex;
  flex-direction: column;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

label, .label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 6px;
}

textarea {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(111, 88, 201, 0.25);
  resize: none;
  background: #ffffff;
  color: #1f2937;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
  transition: box-shadow 0.2s, border-color 0.2s;
}
textarea:focus {
  outline: none;
  border-color: #6f58c9;
  box-shadow: 0 0 0 2px rgba(111, 88, 201, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #7b61d3, #6f58c9);
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(111, 88, 201, 0.25), 0 0 0 1px rgba(111, 88, 201, 0.15);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, filter 0.15s ease-out;
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 30px rgba(111, 88, 201, 0.35), 0 0 0 1px rgba(111, 88, 201, 0.9);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(111, 88, 201, 0.25);
}

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

.preset-button {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}
.preset-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1f2937;
}
.preset-button:focus, .preset-button:active, .preset-button.active {
  background: #ffffff;
  color: #7f549e;
  border-color: #7f549e;
  outline: none;
}

.danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: 0.15s;
}
.danger:hover {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.15);
  background: rgba(239, 68, 68, 0.12);
}

.error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #dc2626;
  font-size: 12px;
  line-height: 1.5;
}

.placeholder {
  padding: 18px;
  color: #6b7280;
  font-size: 13px;
  text-align: center;
}

.imgbox {
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px dashed rgba(111, 88, 201, 0.32);
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.imgbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.imgbox.ai-box {
  position: relative;
}
.imgbox.ai-box:hover .nav-arrow, .imgbox.ai-box:focus-within .nav-arrow, .imgbox.ai-box:focus .nav-arrow {
  display: flex;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(111, 88, 201, 0.28);
  background: rgba(255, 255, 255, 0.92);
  color: #1f2937;
  cursor: pointer;
  font-weight: 900;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: 0.15s;
}
.nav-arrow:hover {
  border-color: rgba(111, 88, 201, 0.85);
  box-shadow: 0 4px 12px rgba(111, 88, 201, 0.15);
}
.nav-arrow.left {
  left: 10px;
}
.nav-arrow.right {
  right: 10px;
}

.variant-button {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: rgba(111, 88, 201, 0.08);
  color: #4b3fa0;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  transition: 0.1s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.variant-button.active {
  background: rgba(111, 88, 201, 0.85);
  color: #ffffff;
}
.variant-button:hover:not(.active) {
  background: rgba(111, 88, 201, 0.18);
}

.res-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

.res-badge-left {
  background: rgba(111, 88, 201, 0.82);
  top: 10px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

table.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: 14px;
  overflow: hidden;
}

.usage-table thead th {
  text-align: left;
  padding: 12px;
  background: #e2e8f0;
  color: #475569;
  border-bottom: 2px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 1;
}
.usage-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  color: #1f2937;
}
.usage-table tbody tr:hover td {
  background: #f1f5f9;
}

.stat-box {
  background: #ffffff;
  border: 1px solid rgba(111, 88, 201, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}
.stat-box .k {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.stat-box .v {
  font-size: 18px;
  font-weight: 700;
}

.muted {
  color: #6b7280;
}

.ok {
  color: #10b981;
  font-weight: bold;
}

.err {
  color: #ef4444;
  font-weight: bold;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 960px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
.grid-item:hover .grid-thumbnail {
  transform: scale(1.05);
}

.usage-stats-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.usage-stats-grid .stat-box {
  flex: 1;
  min-width: 140px;
}

.usage-info-bar {
  display: flex;
  gap: 24px;
  background: #eef2ff;
  padding: 12px 16px;
  border-radius: 12px;
  color: #4f46e5;
  font-size: 13px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border: 1px solid rgba(111, 88, 201, 0.15);
  align-items: center;
}

.usage-info-item strong {
  font-weight: 600;
  color: #3730a3;
  margin-right: 4px;
}

.usage-table-container {
  overflow: auto;
  max-height: calc(100vh - 260px);
  border-radius: 14px;
}

.usage-pricing {
  margin-top: 14px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.preset-layout-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.preset-layout-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
  margin-top: 16px;
}

.preset-grid-main {
  margin: 0;
}

.preset-grid-gallery {
  flex: 1 1 240px;
  margin: 0;
}

.prompt-wrapper {
  display: flex;
  flex-direction: column;
}

.preset-layout-main .prompt-wrapper {
  flex: 1;
}

.prompt-wrapper-gallery {
  flex: 1 1 300px;
}

.prompt-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 8px;
}

.prompt-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex: 1;
}

.prompt-input-container {
  flex: 1;
  position: relative;
  min-width: 0;
}

.prompt-textarea {
  width: 100%;
  height: 100%;
  min-height: 80px;
  border-radius: 12px;
  padding: 15px 12px 28px 12px;
  border: 1px solid rgba(111, 88, 201, 0.3);
  resize: none;
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  overflow: hidden;
}
.prompt-textarea::placeholder {
  text-transform: none;
}
.prompt-textarea:focus {
  border-color: #7f549e;
  box-shadow: 0 0 0 1px #7f549e;
  outline: none;
  background: #ffffff;
}

.prompt-textarea-main {
  min-height: 220px;
}

.char-counter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: #9ca3af;
  pointer-events: none;
}

.btn-generate-custom {
  flex: 0 0 110px;
  background: #eef2ff;
  border-color: #6f58c9;
  font-weight: 700;
  color: #6f58c9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: auto;
}

.top-row {
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
}

@media (max-width: 960px) {
  .top-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
.header-content {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.header-title {
  margin: 0;
  font-size: 28px;
}

.header-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.header-links {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.header-link {
  text-decoration: none;
  font-weight: 600;
  color: #6f58c9;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.col-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  min-height: 24px;
  padding-bottom: 6px;
}
.col-header .label {
  margin-bottom: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

.dropzone {
  cursor: pointer;
  position: relative;
  border: 2px dashed rgba(111, 88, 201, 0.4);
  background: #f8fafc;
  transition: background 0.2s;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 500px;
  max-height: 500px;
  border-radius: 16px;
}

.dropzone-text {
  color: #6b7280;
  font-size: 15px;
  pointer-events: none;
}

.dropzone-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.dropzone-hint {
  font-size: 12px;
  margin-top: 8px;
}

.preview-image {
  display: none;
  max-height: 500px;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  margin: auto;
}

.submit-hint {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
}

.error-msg {
  margin-top: 16px;
}

.header-title-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-link-btn {
  font-size: 13px;
  background: #ffffff;
  border: 1px solid rgba(111, 88, 201, 0.3);
  padding: 6px 12px;
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
}

.comparison-wrapper {
  margin-top: 4px;
}

.imgbox-image {
  cursor: zoom-in;
}

.generate-next-label {
  margin-top: 14px;
  margin-bottom: 10px;
}

.left-controls-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.variant-badges-container {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.variant-badges {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  padding: 6px;
  border-radius: 14px;
  display: flex;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.variant-menu-wrapper {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.header-prompt-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(111, 88, 201, 0.82);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  margin: 0 6px;
}

.header-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(111, 88, 201, 0.3);
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: 0.15s;
}
.header-icon:hover {
  background: rgba(111, 88, 201, 0.05);
  border-color: rgba(111, 88, 201, 0.5);
  color: #6f58c9;
}

.menu-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(111, 88, 201, 0.3);
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: 0.15s;
}
.menu-toggle-btn:hover {
  background: rgba(111, 88, 201, 0.05);
  border-color: rgba(111, 88, 201, 0.5);
  color: #6f58c9;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  text-align: left;
  background: #ffffff;
  border: 1px solid rgba(111, 88, 201, 0.25);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.15);
  padding: 8px;
  width: 200px;
  z-index: 100;
}

.dropdown-form {
  margin-bottom: 6px;
}

.dropdown-btn-primary {
  width: 100%;
  border: 1px solid transparent;
  text-align: left;
  background: rgba(111, 88, 201, 0.08);
  padding: 10px 12px;
  color: #1f2937;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  transition: 0.15s;
  box-sizing: border-box;
}
.dropdown-btn-primary:hover {
  background: rgba(111, 88, 201, 0.15);
  border-color: rgba(111, 88, 201, 0.4);
  box-shadow: 0 4px 12px rgba(111, 88, 201, 0.15);
  color: #6f58c9;
}

.dropdown-btn-danger {
  width: 100%;
  border: none;
  text-align: left;
  background: rgba(239, 68, 68, 0.08);
  padding: 10px 12px;
}

.correct-form {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.correct-label {
  margin-bottom: 8px;
}

.btn-generate-correct {
  flex: 0 0 110px;
  height: auto;
  text-align: center;
  background: #6f58c9;
  color: #ffffff;
  border: none;
  padding: 12px;
  font-weight: bold;
  font-size: 13px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 10px;
}

.grid-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 6px;
  overflow: hidden;
  border: none;
  text-decoration: none;
  position: relative;
  background: #f8fafc;
}

.grid-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease-out;
}

.grid-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #6b7280;
  font-size: 11px;
}

.grid-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 12px;
  padding: 6px;
  text-align: center;
  font-weight: 600;
}

.grid-delete-form {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.grid-item:hover .grid-delete-form {
  opacity: 1;
}

.grid-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.grid-delete-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  transform: scale(1.15);
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  z-index: 10000;
  pointer-events: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffffff;
  font-size: 30px;
  cursor: pointer;
  z-index: 10000;
  padding: 10px;
}

.lightbox-prev {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-size: 40px;
  cursor: pointer;
  padding: 20px;
  z-index: 10000;
}

.lightbox-next {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-size: 40px;
  cursor: pointer;
  padding: 20px;
  z-index: 10000;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-upscale-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
  backdrop-filter: blur(4px);
}
.lightbox-upscale-btn:hover {
  background: #6f58c9;
  border-color: transparent;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 440px;
  max-width: 90%;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-close {
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  padding: 4px;
}

.modal-text {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 20px;
}

.upscale-section {
  margin-top: 14px;
  text-align: center;
}

.upscale-trigger-btn {
  width: 100%;
  border-radius: 8px;
  padding: 14px;
  box-shadow: none;
  font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.upscale-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upscale-option-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(111, 88, 201, 0.2);
  background: #ffffff;
  cursor: pointer;
  transition: 0.15s;
}
.upscale-option-btn:hover {
  border-color: #6f58c9;
  box-shadow: 0 4px 12px rgba(111, 88, 201, 0.1);
  background: #f8fafc;
}
.upscale-option-btn strong {
  font-size: 15px;
  color: #1f2937;
}
.upscale-option-btn span {
  font-size: 12px;
  color: #6b7280;
}
.upscale-option-btn.premium {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}
.upscale-option-btn.premium:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #d97706;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-links-group {
  display: flex;
  gap: 10px;
}

.rate-config {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rate-config label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
}

.rate-input {
  width: 70px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
}

.cell-time {
  line-height: 1.2;
}

.cell-time-sec {
  font-size: 0.85em;
  opacity: 0.7;
}

.cell-filename {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-content-wide {
  width: 90%;
  max-width: 1100px;
  padding: 0;
}

.modal-header-padded {
  padding: 32px 40px 0 40px;
}

.modal-title-lg {
  margin: 0;
  font-size: 24px;
}

.upscale-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
}

.upscale-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.upscale-panel.ai-panel {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(217, 70, 239, 0.05) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.upscale-panel.ai-panel .upscale-panel-title {
  color: #6d28d9;
}
.upscale-panel.ai-panel .upscale-panel-desc {
  color: #4b5563;
}

.upscale-panel-title {
  font-weight: 700;
  color: #374151;
  font-size: 18px;
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: normal;
}

.upscale-panel-desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

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

.upscale-opt-btn {
  text-align: left;
  position: relative;
  padding: 14px 20px;
}

.upscale-price {
  font-size: 12px;
  color: #8b5cf6;
  margin-top: 4px;
}

.modal-footer-styled {
  padding: 24px 40px;
  border-top: 1px solid #e2e8f0;
  text-align: right;
  background: #f8fafc;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.modal-cancel-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 12px 32px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}
.modal-cancel-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #f87171;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.1);
}

.error-title {
  margin-top: 0;
}

.error-desc {
  line-height: 1.5;
}

.error-back-link {
  display: inline-block;
  margin-top: 10px;
  color: #b91c1c;
  font-weight: bold;
  text-decoration: none;
  border-bottom: 2px solid #fca5a5;
}

.hidden {
  display: none !important;
}

.flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pos-relative {
  position: relative;
}

.display-block {
  display: block;
}

@media (max-width: 900px) {
  .upscale-columns {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
}
.toolbar-end {
  justify-content: flex-end;
}

.magic-box {
  width: 100%;
  max-width: 500px;
  height: 400px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(111, 88, 201, 0.15);
  border: 1px solid rgba(111, 88, 201, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.magic-wand {
  font-size: 64px;
  margin-bottom: 24px;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-15px) rotate(15deg) scale(1.1);
  }
}
.magic-title {
  color: #4338ca;
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 800;
}

.magic-description {
  color: #64748b;
  font-size: 15px;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.loader-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #6f58c9, #4338ca);
  border-radius: 4px;
  animation: loading 1.5s infinite ease-in-out alternate;
}

@keyframes loading {
  0% {
    transform: translateX(-50%);
    width: 40%;
  }
  100% {
    transform: translateX(250%);
    width: 60%;
  }
}
.status-pill {
  margin-top: 32px;
  background: #f1f5f9;
  color: #475569;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid #cbd5e1;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.picker {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 260px;
}
.picker label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  white-space: nowrap;
}

select {
  flex: 1 1 auto;
  min-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(111, 88, 201, 0.26);
  background: #ffffff;
  color: #1f2937;
  outline: none;
  font-family: inherit;
}
select:focus {
  border-color: rgba(111, 88, 201, 0.8);
  box-shadow: 0 0 0 1px rgba(111, 88, 201, 0.28);
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
@media (max-width: 900px) {
  .comparison {
    grid-template-columns: 1fr;
  }
}

.comparison-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 4px;
  display: block;
}

.variant-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
}

.magic-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  border-radius: 16px;
}
.magic-overlay.active {
  opacity: 1;
  pointer-events: auto;
  display: flex;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.4);
}

.magic-stars {
  font-size: 48px;
  margin-bottom: 16px;
  animation: magic-spin 3s linear infinite;
}

.magic-text {
  font-weight: 700;
  color: #4338ca;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 20px;
}

.magic-progress-track {
  width: 140px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}

.magic-progress-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #6f58c9, #a855f7);
  border-radius: 2px;
  animation: magic-progress 1.5s infinite ease-in-out;
}

@keyframes magic-spin {
  0% {
    transform: rotate(0deg) scale(1);
    filter: hue-rotate(0deg);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
    filter: hue-rotate(90deg);
  }
  100% {
    transform: rotate(360deg) scale(1);
    filter: hue-rotate(0deg);
  }
}
@keyframes magic-progress {
  0% {
    transform: translateX(-100%);
    width: 20%;
  }
  50% {
    width: 60%;
  }
  100% {
    transform: translateX(200%);
    width: 20%;
  }
}
.image-reveal {
  animation: reveal-clear 0.8s ease-out forwards;
}

@keyframes reveal-clear {
  from {
    filter: blur(20px) brightness(1.5);
    transform: scale(1.05);
  }
  to {
    filter: blur(0) brightness(1);
    transform: scale(1);
  }
}
.success-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
}
.success-flash.active {
  animation: flash-anim 0.6s ease-out forwards;
}

@keyframes flash-anim {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}
.magic-processing {
  position: relative;
  overflow: hidden;
}
.magic-processing img {
  filter: blur(8px) brightness(0.8);
  transition: filter 0.8s ease;
}
.magic-processing::after {
  content: "✨";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  animation: magic-sparks 1.5s infinite;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(111, 88, 201, 0.6);
}

@keyframes magic-sparks {
  0% {
    transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(15deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    opacity: 0.5;
  }
}
.action-buttons-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 120px;
}
.action-buttons-column .preset-button,
.action-buttons-column .upscale-trigger-btn {
  flex: 1;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
}

@media (max-width: 1400px) {
  .preset-layout-gallery {
    flex-direction: column;
  }
  .preset-grid-gallery {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .action-buttons-column {
    width: 100%;
    flex-direction: row;
  }
}
@media (max-width: 768px) {
  .preset-grid-gallery {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Chat-style Input Box */
.chat-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.chat-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(111, 88, 201, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  background: #ffffff;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.chat-input-box:focus-within {
  border-color: #7f549e;
  box-shadow: 0 0 0 1px #7f549e;
}

.chat-thumbnail-preview {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(111, 88, 201, 0.15);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-thumbnail-preview .remove-thumbnail-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.chat-attachment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-attachment-btn label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  margin: 0;
  transition: background 0.15s, color 0.15s;
}

.chat-attachment-btn label:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.chat-attachment-btn svg {
  width: 20px;
  height: 20px;
}

.chat-prompt-textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  padding: 6px 0;
  font-family: inherit;
  font-size: 13.5px;
  color: #1f2937;
  height: 32px;
  min-height: 32px;
  line-height: 1.5;
  box-sizing: border-box;
}

.chat-prompt-textarea::placeholder {
  color: #9ca3af;
  text-transform: none;
}

.chat-prompt-textarea:focus {
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f3f4f6;
  border: none;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.chat-send-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

.chat-counter-row {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  margin-top: 2px;
  padding-right: 4px;
}

/*# sourceMappingURL=styles.css.map */
