:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #fafbfd;
  --surface-strong: #fbfcfe;
  --surface-soft: #e8edf5;
  --text: #151a22;
  --muted: #596474;
  --line: #cbd3df;
  --line-strong: #aab5c5;
  --accent: #2458bd;
  --accent-hover: #19489f;
  --accent-soft: #e0e9fb;
  --danger: #a63832;
  --focus: #123f9a;
  --shadow: 0 28px 80px rgba(35, 53, 82, 0.11);
  --radius-card: 14px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --max-width: 1400px;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151c;
  --surface: #171c24;
  --surface-strong: #1d232d;
  --surface-soft: #242c38;
  --text: #f0f3f7;
  --muted: #aeb8c7;
  --line: #374252;
  --line-strong: #526075;
  --accent: #78a2ff;
  --accent-hover: #99b9ff;
  --accent-soft: #1f3562;
  --danger: #ff9188;
  --focus: #aac3ff;
  --shadow: 0 24px 70px rgba(2, 6, 12, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  transition: background-color 180ms ease, color 180ms ease;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #f8fbff;
  font-size: 14px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.nav-links a:hover,
.footer-links a:hover {
  color: var(--accent);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface-strong) 88%, transparent);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.language-control:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.language-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.language-mark {
  width: 34px;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.language-control select {
  min-width: 116px;
  min-height: 38px;
  padding: 7px 34px 7px 11px;
  border: 0;
  border-radius: inherit;
  appearance: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.01em;
  outline: 0;
}

.language-control::after {
  content: "";
  position: absolute;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

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

.theme-button,
.text-button,
.copy-button {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.theme-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  min-width: 92px;
  font-size: 13px;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.theme-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.auth-trigger,
.account-trigger {
  min-height: 40px;
  border-radius: var(--radius-control);
  cursor: pointer;
  white-space: nowrap;
}

.auth-trigger {
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #f8fbff;
  font-size: 13px;
  font-weight: 760;
}

.auth-trigger:hover {
  background: var(--accent-hover);
}

:root[data-theme="dark"] .auth-trigger {
  color: #0e1625;
}

.account-trigger {
  padding: 4px 10px 4px 5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.account-trigger:hover {
  border-color: var(--accent);
}

.account-initials {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
}

.account-balance {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.account-balance strong {
  color: var(--text);
  font-size: 14px;
}

.hero {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  align-items: center;
  gap: clamp(48px, 6vw, 96px);
  padding: 36px 0 64px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.output-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 5vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.058em;
  text-wrap: balance;
}

.hero-subtitle {
  max-width: 560px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 20px);
}

.hero-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 760;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:active,
.segment:active,
.copy-button:active,
.text-button:active,
.theme-button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent);
  color: #f8fbff;
}

.button-primary:hover {
  background: var(--accent-hover);
}

:root[data-theme="dark"] .button-primary {
  color: #0e1625;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--accent);
}

.auth-dialog {
  width: min(calc(100% - 32px), 720px);
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.auth-dialog::backdrop {
  background: rgba(9, 15, 25, 0.62);
  backdrop-filter: blur(5px);
}

.auth-shell {
  position: relative;
  padding: 44px;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
}

.auth-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.auth-kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-dialog h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.auth-intro {
  max-width: 42ch;
  margin-bottom: 28px;
  color: var(--muted);
}

.auth-google-button {
  width: 100%;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.auth-google-button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.auth-google-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.auth-divider {
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-form label {
  font-size: 13px;
  font-weight: 760;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.auth-form input::placeholder {
  color: var(--muted);
  opacity: 0.82;
}

.auth-form .button {
  width: 100%;
  margin-top: 8px;
}

.auth-helper,
.auth-message,
.account-email {
  color: var(--muted);
  font-size: 12px;
}

.auth-helper {
  margin: 0;
}

.auth-message {
  min-height: 20px;
  margin: 14px 0 0;
}

.auth-message.is-error {
  color: var(--danger);
}

.auth-code-form input {
  font-size: 22px;
  font-weight: 760;
  letter-spacing: 0.28em;
  text-align: center;
}

.auth-back-button {
  width: max-content;
  margin: 4px auto 0;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
}

.account-email {
  margin-bottom: 26px;
  overflow-wrap: anywhere;
}

.account-metric {
  margin-bottom: 18px;
  padding: 22px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--accent-soft);
}

.account-metric strong {
  color: var(--accent);
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.04em;
}

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

.auth-signout {
  min-width: 150px;
}

.output-actions,
.account-actions,
.delete-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.output-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.account-history {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.account-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.account-section-heading h3,
.delete-account-form h3 {
  margin: 0 0 5px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.account-section-heading p,
.delete-account-form p,
.history-state {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.history-state {
  padding: 22px 0;
}

.history-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.history-item {
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.history-item-main {
  min-width: 0;
}

.history-item h4 {
  margin: 0 0 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  color: var(--muted);
  font-size: 11px;
}

.history-thumbnails {
  margin-top: 11px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.history-thumbnails img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
}

.history-actions {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 7px;
}

.history-action-row {
  display: flex;
  gap: 6px;
}

.history-actions .text-button {
  padding: 5px 7px;
  font-size: 11px;
}

.account-actions {
  margin-top: 24px;
  justify-content: space-between;
}

.danger-link {
  color: var(--danger);
}

.delete-account-form {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.delete-account-form label {
  margin: 16px 0 7px;
  display: block;
  font-size: 12px;
  font-weight: 760;
}

.delete-account-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.delete-account-actions {
  margin-top: 12px;
}

.danger-button {
  background: var(--danger);
  color: #11151c;
}

.danger-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.limit-warning {
  color: var(--danger);
  font-weight: 740;
}

.bullet-content {
  display: block;
}

.bullet-count {
  margin-top: 4px;
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.hero-visual {
  margin: 0;
  justify-self: end;
  width: min(100%, 540px);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-visual figcaption {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.channel-strip {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 74px;
  margin: 0 auto;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.channel-strip p {
  margin: 0;
}

.channel-strip p:last-child {
  text-align: right;
}

.channel-strip div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-strip span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.generator-section,
.workflow,
.pricing,
.site-footer {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.generator-section,
.workflow {
  padding: 112px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 42px;
}

.section-heading h2,
.pricing h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.section-heading p,
.pricing-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(390px, 0.82fr) minmax(0, 1.18fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.input-panel,
.output-panel {
  padding: clamp(26px, 4vw, 48px);
}

.input-panel {
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.panel-intro {
  margin-bottom: 30px;
  padding-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-intro p,
.panel-intro span {
  margin: 0;
}

.panel-intro p {
  font-size: 17px;
  font-weight: 780;
}

.panel-intro span {
  color: var(--muted);
  font-size: 12px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
label {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

label span[aria-hidden="true"] {
  color: var(--accent);
}

.platform-picker,
.field-block {
  margin-bottom: 24px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 9px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.segment.active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(25, 43, 73, 0.1);
}

.field-block label {
  display: block;
  margin-bottom: 8px;
}

.field-block input,
.field-block textarea,
.field-block select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-strong);
  color: var(--text);
  padding: 12px 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-block input:hover,
.field-block textarea:hover,
.field-block select:hover {
  border-color: var(--text);
}

.field-block input:focus,
.field-block textarea:focus,
.field-block select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-block textarea {
  min-height: 170px;
  resize: vertical;
}

.field-block input::placeholder,
.field-block textarea::placeholder {
  color: var(--muted);
  opacity: 0.86;
}

.photo-field {
  margin-bottom: 26px;
}

.upload-control {
  min-height: 114px;
  display: grid !important;
  align-content: center;
  gap: 4px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-strong) 72%, var(--accent-soft));
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.upload-control:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-control:active {
  transform: translateY(1px);
}

.upload-control-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.upload-control-copy {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.photo-preview-grid:empty {
  display: none;
}

.photo-preview {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.image-picker-toolbar {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.image-picker-title,
.image-selection-summary {
  margin: 0;
}

.image-picker-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

.image-selection-summary {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.compact-text-button {
  flex: 0 0 auto;
  padding: 4px 0;
  font-size: 12px;
}

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

.image-choice {
  min-height: 98px;
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.image-choice:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.image-choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.image-choice input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.image-choice span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.image-choice strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.image-choice small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.field-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 14px;
}

.helper,
.form-note,
.field-error {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-error {
  min-height: 1em;
  color: var(--danger);
  font-weight: 700;
}

.text-button,
.copy-button {
  padding: 8px 0;
  color: var(--accent);
}

.text-button:disabled,
.copy-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.output-panel {
  min-height: 810px;
  position: relative;
  background: var(--surface-strong);
}

.output-toolbar,
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.output-toolbar {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.output-kicker {
  margin-bottom: 4px;
}

.output-toolbar h3 {
  margin: 0;
  font-size: 21px;
}

.output-state {
  min-height: 560px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.output-state[hidden],
.results[hidden],
.toast[hidden] {
  display: none;
}

.empty-state h4,
.error-state h4 {
  margin: 18px 0 8px;
  font-size: 22px;
}

.empty-state p,
.error-state p {
  max-width: 420px;
  color: var(--muted);
}

.empty-glyph {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
}

.loading-state {
  justify-items: stretch;
  align-content: start;
  gap: 14px;
  padding-top: 54px;
}

.generation-progress {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
}

.skeleton {
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}

.skeleton-title {
  width: 78%;
  height: 34px;
}

.skeleton-line {
  width: 100%;
  height: 16px;
}

.skeleton-line.short {
  width: 64%;
}

.skeleton-block {
  width: 100%;
  height: 230px;
  margin-top: 22px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-visual {
    animation: arrive 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .hero-visual {
    animation-delay: 80ms;
  }

  .loading-state .skeleton {
    background: linear-gradient(100deg, var(--surface-soft) 20%, var(--surface) 45%, var(--surface-soft) 70%);
    background-size: 220% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
  }
}

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

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

.results {
  padding-top: 12px;
}

.image-result-group {
  padding-top: 28px;
}

.generation-usage {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

.generated-image-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.generated-image-card:first-child {
  grid-column: 1 / -1;
}

.generated-image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  background: var(--surface-soft);
}

.generated-image-card figcaption {
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.image-download {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.image-download:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-group {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.result-group:last-child {
  border-bottom: 0;
}

.result-heading h4 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-group p,
.result-group li {
  color: var(--text);
}

.result-group ul {
  margin: 0;
  padding-left: 20px;
}

.result-group li + li {
  margin-top: 10px;
}

.result-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 32px;
}

.character-count {
  margin: 8px 0 0;
  color: var(--muted) !important;
  font-size: 12px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
}

.workflow-visual {
  margin: 0;
}

.workflow-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.workflow-visual figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.workflow-steps {
  border-top: 1px solid var(--line-strong);
}

.workflow-steps article {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.workflow-steps strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.workflow-steps p {
  margin: 0;
  color: var(--muted);
}

.pricing {
  margin-bottom: 96px;
  padding: clamp(40px, 7vw, 80px);
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(44px, 7vw, 96px);
  align-items: center;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.pricing-label {
  margin-bottom: 14px !important;
  color: var(--accent) !important;
  font-size: 13px !important;
  font-weight: 800;
}

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

.price-option {
  min-height: 132px;
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
}

.price-options p,
.price-options span {
  margin: 0;
  color: var(--muted);
}

.price-options p {
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 780;
}

.price-options strong {
  font-size: 36px;
  letter-spacing: -0.04em;
}

.price-featured {
  grid-row: span 2;
  min-height: 276px;
  flex-direction: column;
  border-color: var(--accent) !important;
  background: var(--accent-soft);
}

.price-featured strong {
  margin-top: auto;
  font-size: clamp(48px, 5vw, 72px);
}

.price-featured small {
  max-width: 210px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  min-height: 220px;
  padding: 50px 0;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 420px;
  margin-top: 18px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 750;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr 0.82fr;
    gap: 32px;
  }

  h1 {
    font-size: clamp(3rem, 6vw, 3.75rem);
  }

  .workspace,
  .pricing {
    grid-template-columns: 1fr;
  }

  .workflow-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
    gap: 36px;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .output-panel {
    min-height: 680px;
  }

  .pricing {
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .site-header {
    width: min(calc(100% - 32px), var(--max-width));
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .site-header > .brand > span:last-child {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .language-control select {
    min-width: 104px;
    max-width: 116px;
  }

  .theme-button {
    display: none;
  }

  .language-control select {
    min-width: 88px;
    max-width: 94px;
  }

  .account-balance span {
    display: none;
  }

  .auth-shell {
    padding: 40px 24px 28px;
  }

  .auth-dialog {
    width: min(calc(100% - 20px), 720px);
    max-height: calc(100dvh - 20px);
  }

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

  .history-actions {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .account-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-signout {
    width: 100%;
  }

  .danger-link {
    align-self: center;
  }

  .delete-account-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .channel-strip,
  .generator-section,
  .workflow,
  .pricing,
  .site-footer {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 56px 0 72px;
  }

  .channel-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .channel-strip p {
    display: none;
  }

  .channel-strip div {
    justify-content: space-between;
  }

  .hero-copy,
  .hero-visual {
    width: 100%;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .generator-section,
  .workflow {
    padding: 72px 0;
  }

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

  .input-panel,
  .output-panel {
    padding: 24px;
  }

  .field-row,
  .result-grid,
  .workflow-grid,
  .price-options {
    grid-template-columns: 1fr;
  }

  .image-choice-grid {
    grid-template-columns: 1fr;
  }

  .image-picker-toolbar {
    align-items: flex-start;
  }

  .generated-image-grid {
    grid-template-columns: 1fr;
  }

  .generated-image-card:first-child {
    grid-column: auto;
  }

  .panel-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .workflow-grid {
    grid-template-rows: auto;
  }

  .workflow-primary {
    grid-row: auto;
    min-height: 360px !important;
  }

  .pricing {
    margin-bottom: 72px;
    padding: 32px 22px;
  }

  .price-featured {
    grid-row: auto;
    min-height: 230px;
  }

  .site-footer {
    min-height: auto;
    flex-direction: column;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11151c;
    --surface: #171c24;
    --surface-strong: #1d232d;
    --surface-soft: #242c38;
    --text: #f0f3f7;
    --muted: #aeb8c7;
    --line: #374252;
    --line-strong: #526075;
    --accent: #78a2ff;
    --accent-hover: #99b9ff;
    --accent-soft: #1f3562;
    --danger: #ff9188;
    --focus: #aac3ff;
    --shadow: 0 24px 70px rgba(2, 6, 12, 0.42);
  }
}
