:root {
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: rgba(255, 255, 255, 0.98);
  --glass: rgba(255, 255, 255, 0.22);
  --glass-border: rgba(255, 255, 255, 0.5);
  --line: rgba(0, 0, 0, 0.08);
  --shadow: 0 18px 60px rgba(30, 41, 59, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08), transparent 48%),
    radial-gradient(ellipse at 82% 55%, rgba(236, 72, 153, 0.08), transparent 48%),
    radial-gradient(ellipse at 50% 18%, rgba(16, 185, 129, 0.06), transparent 42%),
    #f5f5f7;
}

.login-wrapper {
  width: min(100%, 400px);
}

.brand {
  margin-bottom: 48px;
  text-align: center;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.24);
}

.brand h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-card {
  padding: 40px 32px 32px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  outline: none;
  background: #fafafa;
  color: var(--text);
  font-size: 15px;
  transition: border 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 44px;
}

.toggle-pw {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--muted);
  line-height: 1;
  transform: translateY(-50%);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  color: #6e6e73;
  font-size: 13px;
}

.form-options label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.btn-login {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  background: #1d1d1f;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-secondary-auth {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  background: #fff;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 700;
}

.btn-secondary-auth:hover:not(:disabled) {
  background: #f5f5f7;
}

.btn-login:hover:not(:disabled) {
  background: #2d2d2f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.btn-login.loading .btn-text {
  display: none;
}

.btn-login.loading .spinner {
  display: inline-block;
}

.form-error {
  display: none;
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
}

.form-error.show {
  display: block;
}

.footer {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.app-page {
  min-height: 100vh;
  background: #fff;
}

.morph-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, #f0f4ff 0%, #fdf2f8 30%, #f5f3ff 62%, #ecfdf5 100%);
}

.texture-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.86)),
    url("./assets/ai-workspace-bg.png") center / cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

.dynamic-island {
  position: sticky;
  top: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 16px auto 0;
  padding: 6px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(30px) saturate(150%);
}

.island-btn,
.island-logout,
.island-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.island-btn,
.island-logout {
  text-decoration: none;
}

.island-user strong {
  margin-left: 4px;
}

.island-btn {
  padding: 0 18px;
  border: 0;
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.island-user {
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
}

.island-logout {
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
}

.canvas-wrapper {
  position: relative;
  z-index: 10;
  min-height: calc(100vh - 68px);
  padding: 26px 24px 42px;
}

.site-footer {
  position: relative;
  z-index: 10;
  padding: 0 16px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

.canvas-inner,
.viewport {
  width: 100%;
}

.viewport-inner {
  width: min(100%, 1700px);
  margin: 0 auto;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 4fr) minmax(0, 8fr);
  gap: 24px;
  align-items: stretch;
}

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

.card {
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.card:hover {
  background: var(--card-strong);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.card-sm {
  padding: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 800;
}

.card-title-sm {
  font-size: 14px;
}

.card-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

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

.input,
.edit-input-col textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.input {
  min-height: 144px;
  padding: 12px 16px;
}

.input:focus,
.edit-input-col textarea:focus {
  border-color: #818cf8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.style-tag {
  padding: 7px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: border 0.15s, background 0.15s, color 0.15s;
}

.style-tag:hover,
.style-tag.active {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.14);
  color: #4338ca;
}

.upload-zone {
  min-height: 132px;
  padding: 20px;
  border: 2px dashed rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  text-align: center;
  transition: border 0.2s, background 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.07);
}

.upload-icon {
  margin-bottom: 8px;
  font-size: 32px;
  opacity: 0.48;
}

.upload-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.upload-hint,
.ref-count {
  color: var(--muted);
  font-size: 11px;
}

.upload-hint {
  margin-top: 4px;
  opacity: 0.7;
}

.ref-count {
  margin-top: 7px;
  text-align: center;
}

.cost-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.ref-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ref-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
}

.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ref-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
}

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

.settings-row label {
  min-width: 0;
}

.settings-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-row select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font-size: 13px;
}

.custom-size-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.custom-size-row label {
  min-width: 0;
}

.custom-size-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.custom-size-row input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font-size: 13px;
}

.custom-size-row input:focus,
.settings-row select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.generate-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.count-stepper {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
}

.count-stepper button,
.count-stepper span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.count-stepper span {
  color: var(--text);
  font-size: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 16px;
}

.btn-accent {
  flex: 1;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.24);
}

.btn-primary {
  min-height: 40px;
  padding: 0 20px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
}

.btn-outline {
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  color: var(--text);
}

.btn:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

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

.gallery-shell {
  display: flex;
  min-height: 620px;
  height: 100%;
  flex-direction: column;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.gallery-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.gallery-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.result-status {
  margin-bottom: 10px;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
}

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

.placeholder-card {
  position: relative;
  display: flex;
  min-height: 220px;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
}

.placeholder-card span {
  margin-bottom: 8px;
  font-size: 28px;
  opacity: 0.36;
}

.placeholder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  animation: pulse 2.5s ease-in-out infinite;
}

.result-card {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  animation: fadeUp 0.35s ease forwards;
  transition: transform 0.25s, box-shadow 0.25s;
}

.result-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.result-card img {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.result-meta {
  padding: 10px 12px 5px;
  color: var(--muted);
  font-size: 12px;
}

.result-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.result-actions button,
.result-actions a {
  flex: 1;
  min-height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
  color: #4f46e5;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 32px;
}

.history-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

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

.history-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: 96px 72px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  text-align: left;
}

.history-item strong {
  color: #4f46e5;
  font-size: 12px;
}

.history-item em {
  overflow: hidden;
  color: var(--text);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-wrapper {
  position: relative;
  z-index: 10;
  width: min(100% - 48px, 1440px);
  margin: 28px auto 56px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  margin-bottom: 20px;
}

.admin-card {
  min-width: 0;
}

.credit-form {
  display: grid;
  gap: 12px;
}

.credit-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.credit-form input,
.credit-form select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.admin-message {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 13px;
}

.admin-message.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

td {
  color: var(--text);
}

.text-success {
  color: #15803d;
  font-weight: 800;
}

.text-danger {
  color: #dc2626;
  font-weight: 800;
}

.shimmer {
  min-height: 220px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(241, 245, 249, 0.6) 25%, rgba(226, 232, 240, 0.82) 50%, rgba(241, 245, 249, 0.6) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.failed-card {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--danger);
  text-align: center;
  font-size: 13px;
}

.modal-overlay,
.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.76);
}

.modal-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48);
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 30px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 34px;
  opacity: 0.78;
}

.edit-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.edit-card {
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.edit-head h3 {
  margin: 0;
  color: #1e293b;
  font-size: 18px;
}

.edit-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.edit-body {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(230px, 2fr);
  gap: 16px;
}

.edit-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.edit-preview-col img {
  display: block;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.edit-input-col textarea {
  min-height: 112px;
  padding: 10px 12px;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.42;
  }
  50% {
    opacity: 0.9;
  }
}

@media (max-width: 1040px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .gallery-shell {
    min-height: 540px;
  }
}

@media (max-width: 680px) {
  .canvas-wrapper {
    padding: 20px 14px 32px;
  }

  .dynamic-island {
    width: calc(100% - 24px);
    justify-content: center;
  }

  .island-btn {
    flex: 1;
  }

  .workspace-grid,
  .result-grid,
  .settings-row,
  .edit-body,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-wrapper {
    width: calc(100% - 28px);
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .gallery-shell {
    padding: 18px;
    border-radius: 24px;
  }

  .gallery-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .generate-row {
    align-items: stretch;
    flex-direction: column;
  }

  .count-stepper {
    align-self: flex-start;
  }

  .login-card {
    padding: 28px 20px 24px;
  }

  .brand {
    margin-bottom: 32px;
  }
}
