:root {
  --bg: #080b10;
  --surface: rgba(13, 17, 24, 0.82);
  --surface-strong: rgba(19, 24, 32, 0.94);
  --surface-soft: rgba(22, 28, 37, 0.9);
  --line: rgba(235, 194, 54, 0.14);
  --line-strong: rgba(235, 194, 54, 0.3);
  --text: #f3f0e6;
  --text-muted: #c5c0b1;
  --text-soft: #8e8a7b;
  --brand: #efc53a;
  --brand-deep: #d6ab21;
  --brand-soft: rgba(239, 197, 58, 0.12);
  --accent: #f3d65e;
  --accent-soft: rgba(243, 214, 94, 0.1);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.28);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(7, 8, 11, 0.78), rgba(7, 8, 11, 0.84)),
    url("./site-background.png") center center / cover fixed no-repeat;
}

body.auth-pending #registerButton,
body.auth-pending #historyButton,
body.auth-pending #galleryButton {
  visibility: hidden;
}

body.app-pending .theme-toggle,
body.app-pending .nav-button {
  visibility: hidden;
}

body.app-pending *,
body.app-pending *::before,
body.app-pending *::after {
  transition: none !important;
  animation: none !important;
}

body[data-theme="light"] {
  --surface: rgba(246, 240, 227, 0.82);
  --surface-strong: rgba(252, 247, 236, 0.92);
  --surface-soft: rgba(237, 230, 216, 0.84);
  --line: rgba(157, 122, 18, 0.18);
  --line-strong: rgba(157, 122, 18, 0.3);
  --text: #18140d;
  --text-muted: #5b5142;
  --text-soft: #8a7c64;
  --brand-deep: #9b7510;
}

body[data-theme="classic"] {
  --surface: rgba(18, 24, 34, 0.78);
  --surface-strong: rgba(28, 34, 44, 0.9);
  --surface-soft: rgba(35, 42, 54, 0.82);
  --line: rgba(69, 111, 189, 0.18);
  --line-strong: rgba(69, 111, 189, 0.28);
  --text: #ecf3ff;
  --text-muted: #bfd0ea;
  --text-soft: #8ea3c2;
  --brand: #2f5fb8;
  --brand-deep: #23488c;
  --brand-soft: rgba(47, 95, 184, 0.1);
  --accent: #3b6fd1;
  --accent-soft: rgba(59, 111, 209, 0.1);
  --shadow-lg: 0 24px 80px rgba(31, 60, 111, 0.12);
  --shadow-md: 0 12px 40px rgba(31, 60, 111, 0.08);
  background:
    linear-gradient(rgba(10, 16, 28, 0.68), rgba(10, 16, 28, 0.76)),
    url("./site-background.png") center center / cover fixed no-repeat;
}

body[data-theme="classic-light"] {
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft: #f6f8fb;
  --line: rgba(38, 59, 92, 0.1);
  --line-strong: rgba(38, 59, 92, 0.18);
  --text: #18212f;
  --text-muted: #5c697b;
  --text-soft: #8a96a8;
  --brand: #2f5fb8;
  --brand-deep: #23488c;
  --brand-soft: rgba(47, 95, 184, 0.1);
  --accent: #3b6fd1;
  --accent-soft: rgba(59, 111, 209, 0.1);
  --shadow-lg: 0 24px 80px rgba(31, 60, 111, 0.12);
  --shadow-md: 0 12px 40px rgba(31, 60, 111, 0.08);
  background:
    linear-gradient(rgba(237, 242, 247, 0.82), rgba(237, 242, 247, 0.88)),
    url("./site-background.png") center center / cover fixed no-repeat;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

body.modal-open {
  overflow: hidden;
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 16px auto 28px;
}

.toast-stack {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(18, 27, 42, 0.46);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-modal {
  position: relative;
  width: min(520px, 100%);
  padding: 26px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(13, 17, 24, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

body[data-theme="classic-light"] .auth-modal {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 60px rgba(21, 39, 74, 0.22);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

body[data-theme="classic-light"] .auth-close {
  background: #edf2f7;
}

.auth-copy {
  margin-bottom: 18px;
  padding-right: 34px;
}

.auth-copy h2 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

body[data-theme="classic-light"] .auth-tabs {
  background: #f2f5fa;
}

.auth-tab {
  padding: 12px 14px;
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab--active {
  background: rgba(239, 197, 58, 0.14);
  color: var(--brand);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

body[data-theme="classic-light"] .auth-tab--active {
  background: #ffffff;
  color: var(--brand-deep);
  box-shadow: 0 8px 18px rgba(31, 60, 111, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-control {
  position: relative;
  display: block;
}

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

.field-control input {
  width: 100%;
  padding: 14px 44px 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(235, 194, 54, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body[data-theme="classic-light"] .field-control input {
  border: 1px solid rgba(38, 59, 92, 0.1);
  background: #fbfcfe;
}

.field-control input:focus {
  border-color: rgba(239, 197, 58, 0.42);
  box-shadow: 0 0 0 4px rgba(239, 197, 58, 0.1);
}

.field-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

body[data-theme="classic-light"] .field-clear {
  background: #e9eef6;
}

.field-clear:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

body[data-theme="classic-light"] .field-clear:hover {
  background: #dbe5f3;
}

.auth-rules {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(235, 194, 54, 0.1);
}

body[data-theme="classic-light"] .auth-rules {
  background: #f5f8fc;
  border: 1px solid rgba(38, 59, 92, 0.08);
}

.auth-rules strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.auth-rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.consent-field {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(235, 194, 54, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.consent-field input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.consent-field a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.consent-field a:hover {
  text-decoration: underline;
}

body[data-theme="classic-light"] .consent-field {
  background: #f5f8fc;
  border-color: rgba(38, 59, 92, 0.08);
}

.auth-submit {
  margin-top: 4px;
  padding: 15px 18px;
  border-radius: 16px;
  background: var(--brand);
  color: #f7fbff;
  font-weight: 800;
  cursor: pointer;
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.payment-modal,
.account-modal,
.gallery-modal {
  width: min(760px, 100%);
}

.gallery-modal {
  width: min(1240px, 100%);
  max-height: min(86vh, 920px);
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery-viewer-overlay {
  background: rgba(6, 10, 18, 0.84);
  backdrop-filter: blur(10px);
}

.gallery-viewer-modal {
  position: relative;
  width: min(96vw, 1400px);
  height: min(94vh, 1020px);
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.gallery-viewer-toolbar {
  position: fixed;
  top: 26px;
  left: 28px;
  right: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gallery-viewer-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 34px 34px 42px;
  overflow: hidden;
}

.gallery-viewer-stage::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 34px;
  border: 1px solid rgba(108, 149, 235, 0.12);
  background:
    radial-gradient(circle at top left, rgba(76, 115, 190, 0.22), transparent 30%),
    radial-gradient(circle at bottom right, rgba(239, 197, 58, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(13, 20, 34, 0.94), rgba(9, 14, 24, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 28px 80px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.gallery-viewer-stage img {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 56px);
  max-height: calc(94vh - 130px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 28px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.gallery-viewer-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(13, 18, 29, 0.72);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.gallery-viewer-icon:hover {
  transform: translateY(-1px);
  background: rgba(18, 24, 38, 0.9);
  border-color: rgba(255, 255, 255, 0.24);
}

.gallery-viewer-icon-close {
  font-size: 26px;
}

@media (max-width: 640px) {
  .gallery-viewer-toolbar {
    top: 14px;
    left: 16px;
    right: 16px;
    gap: 8px;
  }

  .gallery-viewer-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
}

.payment-packages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.payment-package {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(235, 194, 54, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="classic-light"] .payment-package {
  border: 1px solid rgba(38, 59, 92, 0.08);
  background: #f8fbff;
}

.payment-package span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.payment-package strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.payment-package p {
  margin: 0 0 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.payment-package__price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.payment-link {
  display: inline-flex;
  text-decoration: none;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.auth-switch-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-inline-link,
.badge-button {
  appearance: none;
  -webkit-appearance: none;
}

.auth-inline-link {
  padding: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.toast {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(16, 20, 27, 0.95);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  transform: translateY(-6px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--error {
  border-color: rgba(206, 86, 86, 0.28);
  background: rgba(48, 20, 20, 0.95);
}

.toast--info {
  border-color: rgba(235, 194, 54, 0.2);
  background: rgba(20, 18, 12, 0.95);
}

.toast__title {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.toast__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.84);
}

.topbar,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.topbar {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

body[data-theme="light"] .topbar,
body[data-theme="light"] .panel,
body[data-theme="light"] .site-footer,
body[data-theme="light"] .about-hero,
body[data-theme="light"] .about-section {
  box-shadow: 0 18px 48px rgba(20, 16, 9, 0.12);
}

body[data-theme="classic"] .topbar,
body[data-theme="classic"] .panel,
body[data-theme="classic"] .site-footer,
body[data-theme="classic"] .about-hero,
body[data-theme="classic"] .about-section {
  box-shadow: 0 16px 40px rgba(10, 18, 34, 0.22);
}

body[data-theme="classic-light"] .topbar,
body[data-theme="classic-light"] .panel,
body[data-theme="classic-light"] .site-footer,
body[data-theme="classic-light"] .about-hero,
body[data-theme="classic-light"] .about-section {
  box-shadow: 0 16px 40px rgba(31, 60, 111, 0.08);
}

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

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand);
  color: #111317;
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -0.08em;
  box-shadow: 0 14px 28px rgba(239, 197, 58, 0.22);
}

body[data-theme="dark"] .brand-mark,
body[data-theme="light"] .brand-mark,
body[data-theme="classic"] .brand-mark,
body[data-theme="classic-light"] .brand-mark {
  background: #efc53a;
  color: #111317;
}

body[data-theme="classic"] .brand-mark,
body[data-theme="classic-light"] .brand-mark {
  color: #ffffff;
}

.brand-copy h1,
.section-heading h3,
.preview-header h2 {
  margin: 0;
  letter-spacing: -0.04em;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
}

.brand-copy h1 {
  font-size: clamp(26px, 2vw, 32px);
  margin-bottom: 4px;
}

.brand-copy p,
.panel-text,
.hint-text,
.summary-card p,
.result-placeholder p,
.loading-state p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.topbar-badges,
.preview-meta,
.tip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.badge,
.section-meta,
.tip-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-dark {
  background: var(--brand-deep);
  color: #101215;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body[data-theme="classic"] .badge-dark {
  color: #ffffff;
}

body[data-theme="classic-light"] .badge-dark {
  color: #ffffff;
}

.badge-button {
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.badge-button:hover {
  transform: translateY(-1px);
  background: var(--brand);
  box-shadow: 0 12px 24px rgba(239, 197, 58, 0.22);
}

.badge-button:hover,
.badge-button:focus,
.badge-button:focus-visible,
.badge-button:active,
.badge-button:visited {
  text-decoration: none;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(235, 194, 54, 0.18);
  color: var(--brand);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(239, 197, 58, 0.14);
  border-color: rgba(239, 197, 58, 0.32);
  color: var(--brand);
}

.theme-toggle__icon {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.theme-toggle__icon--sun {
  background-image: url("./theme-sun.png");
}

.theme-toggle__icon--moon {
  background-image: url("./theme-moon.png");
}

body[data-theme="light"] .theme-toggle {
  background: rgba(157, 122, 18, 0.1);
  border-color: rgba(157, 122, 18, 0.24);
  color: #7b5e12;
}

body[data-theme="light"] .theme-toggle:hover {
  background: rgba(157, 122, 18, 0.18);
  border-color: rgba(157, 122, 18, 0.34);
  color: #624907;
}

body[data-theme="classic"] .theme-toggle {
  background: rgba(47, 95, 184, 0.14);
  border-color: rgba(47, 95, 184, 0.24);
  color: #8eb4f7;
}

body[data-theme="classic"] .theme-toggle:hover {
  background: rgba(47, 95, 184, 0.24);
  border-color: rgba(47, 95, 184, 0.38);
  color: #d8e6ff;
}

body[data-theme="classic-light"] .theme-toggle {
  background: rgba(47, 95, 184, 0.1);
  border-color: rgba(47, 95, 184, 0.18);
  color: #23488c;
}

body[data-theme="classic-light"] .theme-toggle:hover {
  background: rgba(47, 95, 184, 0.18);
  border-color: rgba(47, 95, 184, 0.28);
  color: #1b386c;
}

.badge-soft {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-accent {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.badge-outline,
.section-meta {
  border: 1px solid rgba(235, 194, 54, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.workspace {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  gap: 16px;
  align-items: start;
}

.controls-column,
.preview-column {
  min-width: 0;
}

.controls-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  padding: 18px;
  background: var(--surface);
}

.preview-header h2 {
  font-size: clamp(24px, 1.6vw, 30px);
  margin-bottom: 8px;
}

.section-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
}

body[data-theme="light"] .section-kicker {
  color: #8b6710;
}

body[data-theme="classic"] .section-kicker {
  color: #2662d9;
}

body[data-theme="classic-light"] .section-kicker {
  color: #2662d9;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.panel-text {
  font-size: 14px;
}

.preset-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.nav-button,
.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.nav-button {
  background: var(--brand);
  color: #111317;
}

.nav-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.nav-button:hover {
  background: var(--brand-deep);
}

.nav-button:disabled {
  opacity: 0.26;
  cursor: default;
  transform: none;
}

.nav-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.preset-viewport {
  overflow: hidden;
  padding-block: 6px;
  margin-block: -6px;
}

.preset-track {
  display: flex;
  gap: 12px;
  transition: transform 0.25s ease;
  will-change: transform;
  padding-block: 4px;
}

.preset-card {
  flex: 0 0 auto;
  width: calc((100% - 24px) / 3);
  min-width: calc((100% - 24px) / 3);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.preset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 197, 58, 0.34);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.preset-card.active {
  border-color: rgba(239, 197, 58, 0.56);
  box-shadow: 0 0 0 3px rgba(239, 197, 58, 0.14);
}

.style-upload-card {
  position: relative;
  flex: 0 0 auto;
  width: calc((100% - 24px) / 3);
  min-width: calc((100% - 24px) / 3);
  min-height: 222px;
  padding: 10px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.style-upload-card:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 197, 58, 0.34);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.style-upload-card.has-image {
  border-style: solid;
}

.style-upload-card img {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}

.style-upload-plus {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.42);
  font-size: 38px;
  line-height: 1;
}

body[data-theme="classic-light"] .style-upload-plus {
  background: rgba(47, 95, 184, 0.06);
  color: rgba(35, 25, 18, 0.35);
}

.style-upload-copy {
  display: grid;
  gap: 4px;
}

.style-upload-copy strong,
.style-upload-copy small {
  display: block;
}

.style-upload-copy strong {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.style-upload-copy small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.style-upload-remove {
  display: none;
}

.style-upload-card.has-image .style-upload-remove {
  display: grid;
}

.preset-art {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border-radius: 14px;
  margin-bottom: 10px;
}

.preset-cyber,
.preset-nordic,
.preset-fantasy,
.preset-bauhaus,
.preset-zen,
.preset-classic,
.preset-space,
.preset-botanic {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.preset-cyber { background-image: url("./preset-photo-1.png"); }
.preset-nordic { background-image: url("./preset-photo-2.png"); }
.preset-fantasy { background-image: url("./preset-photo-3.png"); }
.preset-bauhaus { background-image: url("./preset-photo-4.png"); }
.preset-zen { background-image: url("./preset-photo-5.png"); }
.preset-classic { background-image: url("./preset-photo-6.png"); }
.preset-space { background-image: url("./preset-photo-7.png"); }
.preset-botanic { background-image: url("./preset-photo-8.png"); }

.preset-name {
  display: block;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.tip-row {
  margin-bottom: 14px;
}

.tip-chip {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(235, 194, 54, 0.12);
  color: var(--text-muted);
}

.prompt-input {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.prompt-input:focus {
  outline: none;
  border-color: rgba(239, 197, 58, 0.42);
  box-shadow: 0 0 0 4px rgba(239, 197, 58, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.input-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hint-text {
  font-size: 13px;
}

.prompt-mode-button {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.prompt-mode-button:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 197, 58, 0.3);
  color: var(--text);
}

.prompt-mode-button.is-active {
  background: rgba(239, 197, 58, 0.16);
  border-color: rgba(239, 197, 58, 0.5);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(239, 197, 58, 0.12);
}

body[data-theme="classic-light"] .prompt-mode-button {
  background: rgba(47, 95, 184, 0.05);
  border-color: rgba(47, 95, 184, 0.12);
  color: #5d6b84;
}

body[data-theme="classic-light"] .prompt-mode-button:hover {
  border-color: rgba(47, 95, 184, 0.24);
  color: #233145;
}

body[data-theme="classic-light"] .prompt-mode-button.is-active {
  background: rgba(47, 95, 184, 0.12);
  border-color: rgba(47, 95, 184, 0.34);
  color: #163056;
  box-shadow: 0 0 0 3px rgba(47, 95, 184, 0.1);
}

.double-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 14px;
}

.upload-grid,
.size-grid {
  display: grid;
  gap: 8px;
}

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

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

.upload-box {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1.5px dashed rgba(235, 194, 54, 0.22);
  background: var(--surface-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.upload-box:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 197, 58, 0.42);
  background: rgba(255, 255, 255, 0.07);
}

.upload-box.has-image {
  border-style: solid;
}

.upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-plus {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: rgba(255, 255, 255, 0.32);
}

body[data-theme="classic-light"] .upload-plus {
  color: rgba(35, 25, 18, 0.35);
}

.remove-image {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #111317;
  display: none;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 8px 18px rgba(239, 197, 58, 0.24);
  border: 2px solid rgba(10, 12, 16, 0.84);
}

.upload-box.has-image .remove-image {
  display: grid;
}

.remove-image:hover {
  background: var(--accent);
}

.size-button {
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.size-button:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 197, 58, 0.38);
}

.size-button.active {
  color: var(--brand-deep);
  border-color: rgba(239, 197, 58, 0.44);
  background: rgba(239, 197, 58, 0.12);
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.action-panel h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.generate-button {
  min-width: 260px;
  padding: 17px 22px;
  border-radius: 18px;
  background: var(--brand);
  color: #111317;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(239, 197, 58, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

body[data-theme="classic"] .generate-button {
  color: #ffffff;
}

body[data-theme="classic-light"] .generate-button {
  color: #ffffff;
}

.generate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(239, 197, 58, 0.24);
}

.generate-button:disabled {
  opacity: 0.58;
  cursor: default;
  transform: none;
}

.generate-button svg {
  width: 18px;
  height: 18px;
  color: #111317;
}

body[data-theme="classic"] .generate-button svg {
  color: #ffffff;
}

body[data-theme="classic-light"] .generate-button svg {
  color: #ffffff;
}

.preview-panel {
  position: sticky;
  top: 16px;
  background: var(--surface);
}

.site-footer {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(160px, 0.8fr));
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(38, 59, 92, 0.08);
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-brand-mark {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.footer-brand h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.footer-brand p,
.footer-column a,
.footer-bottom span,
.footer-bottom-links a {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-column span {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.footer-column a:hover,
.footer-bottom-links a:hover {
  color: var(--brand);
}

body[data-theme="light"] .footer-column a:hover,
body[data-theme="light"] .footer-bottom-links a:hover {
  color: #6f5207;
}

body[data-theme="classic"] .footer-column a:hover,
body[data-theme="classic"] .footer-bottom-links a:hover {
  color: var(--brand);
}

body[data-theme="classic-light"] .footer-column a:hover,
body[data-theme="classic-light"] .footer-bottom-links a:hover {
  color: var(--brand);
}

.footer-bottom {
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-bottom-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

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

.result-stage {
  position: relative;
  min-height: 520px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body[data-theme="light"] .result-stage {
  background: rgba(255, 249, 238, 0.82);
}

body[data-theme="classic"] .result-stage {
  background: rgba(17, 23, 34, 0.72);
}

body[data-theme="classic-light"] .result-stage {
  background: #f3f6fa;
}

.result-placeholder,
.loading-state,
.result-error {
  text-align: center;
  padding: 32px;
}

.placeholder-icon {
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  color: rgba(35, 25, 18, 0.35);
}

body[data-theme="dark"] .placeholder-icon {
  color: rgba(239, 197, 58, 0.4);
}

body[data-theme="light"] .placeholder-icon {
  color: rgba(157, 122, 18, 0.34);
}

body[data-theme="classic"] .placeholder-icon {
  color: rgba(126, 169, 255, 0.34);
}

body[data-theme="classic-light"] .placeholder-icon {
  color: rgba(35, 25, 18, 0.35);
}

.result-placeholder strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.result-error {
  max-width: 420px;
}

.result-error strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: #aa3d3d;
}

.result-error p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-state.visible {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(89, 61, 33, 0.14);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

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

.result-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
  display: none;
}

.result-image.visible {
  display: block;
}

.result-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.result-stage:hover .result-actions,
.result-actions.visible {
  opacity: 1;
}

.icon-button {
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
}

.icon-button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.icon-button:hover {
  background: var(--brand);
  color: #111317;
}

.icon-button-text {
  width: auto;
  padding: 0 14px;
  gap: 8px;
  display: inline-flex;
  align-items: center;
}

.icon-button-text span {
  font-size: 13px;
  font-weight: 800;
}

.icon-button-saved {
  background: var(--brand);
  color: #111317;
}

.summary-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(235, 194, 54, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="classic-light"] .summary-card {
  border: 1px solid rgba(89, 61, 33, 0.08);
  background: rgba(255, 255, 255, 0.75);
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.summary-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.summary-card p {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.gallery-empty {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px dashed rgba(235, 194, 54, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="classic-light"] .gallery-empty {
  border: 1px dashed rgba(38, 59, 92, 0.16);
  background: #f8fbff;
}

.gallery-empty strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.gallery-empty p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.gallery-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding-right: 6px;
  align-content: start;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(235, 194, 54, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  aspect-ratio: 1 / 1;
  padding: 0;
  cursor: zoom-in;
  isolation: isolate;
}

body[data-theme="classic-light"] .gallery-card {
  border: 1px solid rgba(38, 59, 92, 0.08);
  background: #fbfcfe;
  box-shadow: 0 12px 28px rgba(38, 59, 92, 0.08);
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.gallery-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.22s ease, filter 0.22s ease;
}

body[data-theme="classic-light"] .gallery-card__image {
  background: #edf2f7;
}

.gallery-card:hover .gallery-card__image {
  transform: scale(1.045);
  filter: saturate(1.05) contrast(1.02);
}

.gallery-card:hover {
  border-color: rgba(239, 197, 58, 0.28);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
}

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

.gallery-viewer-button {
  border: 1px solid rgba(103, 155, 255, 0.22);
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(180deg, rgba(61, 108, 190, 0.34), rgba(33, 62, 121, 0.34));
  color: #f3f8ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(8, 18, 42, 0.18);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.gallery-viewer-button:hover {
  background: linear-gradient(180deg, rgba(73, 126, 221, 0.44), rgba(39, 74, 144, 0.44));
  border-color: rgba(128, 176, 255, 0.34);
  transform: translateY(-1px);
}

.gallery-viewer-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.gallery-viewer-button-danger {
  background: linear-gradient(180deg, rgba(34, 64, 124, 0.94), rgba(23, 45, 94, 0.94));
  color: #eff6ff;
  border-color: rgba(121, 166, 245, 0.22);
}

.gallery-viewer-button-danger:hover {
  background: linear-gradient(180deg, rgba(44, 82, 158, 0.98), rgba(28, 56, 114, 0.98));
  border-color: rgba(141, 186, 255, 0.34);
}

body[data-theme="classic-light"] .gallery-viewer-button {
  background: linear-gradient(180deg, #f4f8ff, #e6eefc);
  color: #27477f;
  border-color: rgba(47, 95, 184, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 24px rgba(47, 95, 184, 0.1);
}

body[data-theme="classic-light"] .gallery-viewer-button:hover {
  background: linear-gradient(180deg, #ffffff, #edf4ff);
  border-color: rgba(47, 95, 184, 0.24);
}

body[data-theme="classic-light"] .gallery-viewer-button-danger {
  background: linear-gradient(180deg, #2f5fb8, #284f97);
  color: #ffffff;
  border-color: rgba(47, 95, 184, 0.22);
}

body[data-theme="classic-light"] .gallery-viewer-button-danger:hover {
  background: linear-gradient(180deg, #3f72cf, #305eaf);
}

body[data-theme="classic-light"] .gallery-viewer-stage::before {
  border-color: rgba(47, 95, 184, 0.1);
  background:
    radial-gradient(circle at top left, rgba(47, 95, 184, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(235, 194, 54, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(238, 244, 252, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 22px 54px rgba(38, 59, 92, 0.12);
}

body[data-theme="classic-light"] .gallery-viewer-stage img {
  box-shadow:
    0 22px 50px rgba(38, 59, 92, 0.16),
    0 0 0 1px rgba(47, 95, 184, 0.08);
}

.gallery-action:hover {
  background: rgba(255, 255, 255, 0.14);
}

body[data-theme="classic-light"] .gallery-action:hover {
  background: #dfe8f8;
}

.gallery-action-danger {
  background: #fff2f2;
  color: #b64545;
}

.gallery-action-danger:hover {
  background: #ffe3e3;
}

.format-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.format-summary-row strong {
  margin-bottom: 0;
}

.format-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: auto;
  margin-bottom: 0;
  flex-shrink: 0;
}

.format-preview {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid rgba(47, 95, 184, 0.22);
  background: linear-gradient(180deg, #eef3fb 0%, #f7faff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.8),
    0 10px 18px rgba(47, 95, 184, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.format-preview::before {
  content: "";
  display: block;
  width: var(--format-inner-width, 64px);
  height: var(--format-inner-height, 64px);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(47, 95, 184, 0.1), rgba(47, 95, 184, 0.04)),
    #ffffff;
  border: 1px solid rgba(47, 95, 184, 0.2);
  box-sizing: border-box;
}

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

  .preview-panel {
    position: static;
  }

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

@media (max-width: 840px) {
  .page-shell {
    width: min(100vw - 20px, 1440px);
    margin: 10px auto 20px;
  }

  .toast-stack {
    bottom: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .topbar,
  .panel {
    padding: 16px;
    border-radius: 24px;
  }

  .auth-modal {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .topbar,
  .action-panel,
  .preview-header,
  .input-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .double-panel,
  .summary-grid,
  .footer-grid,
  .payment-packages,
  .account-summary {
    grid-template-columns: 1fr;
  }

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

  .generate-button {
    width: 100%;
    min-width: 0;
  }

  .result-stage {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .gallery-viewer-toolbar {
    top: 14px;
    right: 14px;
    gap: 8px;
  }

  .gallery-viewer-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .gallery-viewer-stage {
    padding: 24px 16px 24px;
  }

  .gallery-viewer-stage::before {
    inset: 10px;
    border-radius: 24px;
  }

  .gallery-viewer-stage img {
    max-width: calc(100% - 24px);
    max-height: calc(92vh - 46px);
  }

  .gallery-viewer-actions {
    gap: 8px;
  }

  .gallery-viewer-button {
    padding: 10px 14px;
    font-size: 12px;
  }

  .preset-nav {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .nav-button {
    width: 38px;
    height: 38px;
  }

  .preset-track {
    gap: 10px;
  }

  .preset-card,
  .style-upload-card {
    width: calc((100% - 10px) / 2);
    min-width: calc((100% - 10px) / 2);
    border-radius: 18px;
    padding: 8px;
  }

  .style-upload-card {
    min-height: 0;
    gap: 8px;
  }

  .preset-art,
  .style-upload-card img,
  .style-upload-plus {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
  }

  .preset-name,
  .style-upload-copy strong {
    font-size: 11px;
  }

  .style-upload-copy small {
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

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

@media (max-width: 420px) {
  .preset-nav {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .nav-button {
    width: 34px;
    height: 34px;
  }

  .preset-card,
  .style-upload-card {
    width: calc((100% - 8px) / 2);
    min-width: calc((100% - 8px) / 2);
    padding: 7px;
  }

  .preset-track {
    gap: 8px;
  }

  .style-upload-copy small {
    -webkit-line-clamp: 2;
  }
}

.about-shell {
  width: min(1080px, calc(100vw - 32px));
}

.about-page {
  display: grid;
  gap: 18px;
}

.about-topbar {
  margin-bottom: 18px;
}

.about-hero,
.about-section {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(13, 17, 24, 0.88);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 34px 36px;
}

.about-hero-copy h2,
.about-section-head h3 {
  margin: 0;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  letter-spacing: -0.04em;
  color: var(--text);
}

.about-hero-copy h2 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.02;
}

.about-lead {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-muted);
}

.about-hero-note {
  align-self: end;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(235, 194, 54, 0.1);
}

.about-hero-note span,
.about-list-card span,
.about-step span {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.about-hero-note strong,
.about-step strong,
.about-principle strong {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.2;
}

.about-hero-note p,
.about-text-block p,
.about-list-card li,
.about-step p,
.about-principle p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 16px;
}

.about-section {
  padding: 28px 30px;
}

.about-section-soft {
  background: rgba(17, 22, 30, 0.92);
}

.about-section-head {
  margin-bottom: 22px;
}

.about-section-head h3 {
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.08;
}

.about-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.about-text-block {
  display: grid;
  gap: 16px;
}

.about-list-card {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(235, 194, 54, 0.1);
}

.about-list-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

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

.about-step,
.about-principle {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(235, 194, 54, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.about-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 980px) {
  .about-hero,
  .about-columns,
  .about-principles {
    grid-template-columns: 1fr;
  }

  .about-steps {
    grid-template-columns: 1fr;
  }

  .about-hero-copy h2 {
    font-size: 38px;
  }
}

@media (max-width: 720px) {
  .about-shell {
    width: min(100vw - 16px, 100%);
  }

  .about-hero,
  .about-section {
    padding: 20px;
    border-radius: 22px;
  }

  .about-hero-copy h2 {
    font-size: 30px;
  }

  .about-lead,
  .about-hero-note p,
  .about-text-block p,
  .about-list-card li,
  .about-step p,
  .about-principle p {
    font-size: 15px;
  }
}

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

.tariff-card {
  padding: 24px 22px;
  border-radius: 22px;
  border: 1px solid rgba(235, 194, 54, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.tariff-card--accent {
  background: rgba(239, 197, 58, 0.08);
  border-color: rgba(239, 197, 58, 0.24);
  box-shadow: inset 0 0 0 1px rgba(239, 197, 58, 0.08);
}

.tariff-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.tariff-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.tariff-price {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.tariff-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.tariffs-hero .about-hero-note {
  background: #eef4ff;
}

.tariffs-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .tariffs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tariffs-steps {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 420px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
