:root {
  --bg: #f6f1e7;
  --bg-accent: #f2dfc9;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf9;
  --surface-muted: #f3ede2;
  --border: rgba(89, 71, 41, 0.14);
  --text: #17211d;
  --muted: #667068;
  --accent: #136a57;
  --accent-soft: rgba(19, 106, 87, 0.12);
  --accent-warm: #e18a4f;
  --danger: #b25744;
  --shadow: 0 24px 70px rgba(30, 35, 27, 0.11);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
  --body-grad-a: rgba(225, 138, 79, 0.24);
  --body-grad-b: rgba(19, 106, 87, 0.14);
  --body-stop-a: #f9f3ea;
  --body-stop-b: #f6f1e7;
  --body-stop-c: #f1eadf;
  --theme-icon-bg: rgba(255, 255, 255, 0.78);
  --drawer-width: 500px;
  --shell-gap: 18px;
  --topbar-top: 10px;
  --topbar-height: 76px;
  --topbar-padding-block: 0px;
  --topbar-padding-inline: 16px;
  --stack-gap: 14px;
  --drawer-bottom-gap: 22px;
  --dock-top: calc(var(--topbar-top) + var(--topbar-height) + var(--stack-gap));
}

:root[data-theme="dark"] {
  --bg: #111714;
  --bg-accent: #1a231f;
  --surface: rgba(20, 28, 24, 0.84);
  --surface-strong: #16201c;
  --surface-muted: #1c2722;
  --border: rgba(223, 237, 229, 0.11);
  --text: #edf4ef;
  --muted: #9faea4;
  --accent: #68cfb1;
  --accent-soft: rgba(104, 207, 177, 0.12);
  --accent-warm: #efad73;
  --danger: #f08b75;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --body-grad-a: rgba(239, 173, 115, 0.14);
  --body-grad-b: rgba(104, 207, 177, 0.12);
  --body-stop-a: #111714;
  --body-stop-b: #101613;
  --body-stop-c: #0b0f0d;
  --theme-icon-bg: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--body-grad-a), transparent 32%),
    radial-gradient(circle at right 10%, var(--body-grad-b), transparent 24%),
    linear-gradient(180deg, var(--body-stop-a) 0%, var(--body-stop-b) 55%, var(--body-stop-c) 100%);
  transition:
    background 280ms ease,
    color 220ms ease;
}

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

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  text-decoration: 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;
}

.page-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 24px;
}

.topbar {
  position: sticky;
  top: var(--topbar-top);
  z-index: 30;
  display: block;
  height: var(--topbar-height);
  max-height: 100px;
  padding: var(--topbar-padding-block) var(--topbar-padding-inline);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 247, 0.68);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: var(--shadow);
  overflow: hidden;
}



:root[data-theme="dark"] .topbar {
  background: rgba(16, 23, 20, 0.72);
}

.topbar__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-width: 0;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.brand-block {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

:root[data-theme="dark"] .brand-block::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: min(44vw, 340px);
  height: 58%;
  transform: translateY(-50%);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.92;
  background:
    radial-gradient(circle at 24% 50%, rgba(140, 208, 255, 0.22), transparent 42%),
    radial-gradient(circle at 54% 50%, rgba(255, 255, 255, 0.12), transparent 48%);
  filter: blur(16px);
}

:root[data-theme="dark"] .brand-logo {
  filter:
    brightness(1.08)
    contrast(1.04)
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.22))
    drop-shadow(0 10px 28px rgba(102, 182, 255, 0.16));
}

.panel__header h2,
.drawer__header h2,
.modal__content h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}


.eyebrow,
.panel__eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.privacy-pill,
.hint-chip,
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.status-dot {
  background: rgba(225, 138, 79, 0.14);
  color: #a46034;
}

.theme-fab {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.68);
  backdrop-filter: blur(22px) saturate(135%);
  box-shadow: 0 12px 28px rgba(20, 24, 22, 0.1);
}

:root[data-theme="dark"] .theme-fab {
  background: rgba(16, 23, 20, 0.74);
}

.theme-fab__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 800;
}

.language-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.68);
  backdrop-filter: blur(18px) saturate(130%);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(20, 24, 22, 0.08);
}

:root[data-theme="dark"] .language-pill {
  background: rgba(16, 23, 20, 0.74);
}

.language-pill__label {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.language-pill__text {
  font-size: 0.92rem;
  font-weight: 700;
}

.mode-switch {
  display: inline-flex;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px);
}

.mode-switch--compact {
  width: 100%;
  margin-top: 4px;
}

.mode-switch--compact .mode-pill {
  flex: 1;
  justify-content: center;
}

.resize-mode-cards {
  display: grid;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.resize-mode-card {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 126px;
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(245, 239, 228, 0.66));
  color: var(--text);
  text-align: center;
}

.resize-mode-card:last-child {
  grid-column: auto;
}

.resize-mode-card[data-resize-mode="max"] {
  grid-column: 1 / -1;
}

.resize-mode-card__mark {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(19, 106, 87, 0.28);
  border-radius: 999px;
  color: transparent;
  font-size: 0.96rem;
  font-weight: 800;
}

.resize-mode-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.14), rgba(225, 138, 79, 0.18));
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.34rem;
  font-weight: 700;
}

.resize-mode-card__label {
  max-width: 100%;
  min-height: 2.4em;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

.resize-mode-card.active {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.resize-mode-card.active .resize-mode-card__mark {
  background: rgba(19, 106, 87, 0.12);
  border-color: rgba(19, 106, 87, 0.4);
  color: var(--accent);
}

.info-box--compact {
  margin-top: 14px;
  padding: 14px 16px;
}

.mode-pill,
.action-chip,
.mini-chip,
.secondary-button,
.ghost-button,
.primary-link {
  transition:
    transform var(--transition),
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.mode-pill.active {
  background: rgba(20, 26, 24, 0.92);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 26, 24, 0.18);
}

.mode-pill:disabled,
.mode-pill[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  filter: saturate(0.72);
}

.start-button,
.secondary-button,
.ghost-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
}

.start-button {
  color: #fff;
  background:
    linear-gradient(135deg, #136a57 0%, #0d8f72 100%);
  box-shadow: 0 12px 28px rgba(19, 106, 87, 0.28);
}

.start-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: saturate(0.65);
  box-shadow: none;
}

.start-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.action-chip:hover,
.mini-chip:hover,
.mode-pill:hover,
.primary-link:hover {
  transform: translateY(-1px);
}

.secondary-button,
.primary-link {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
}

.primary-link.secondary {
  background: transparent;
}

.ghost-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.banner-row,
.action-strip,
.preview-layout,
.lower-layout,
.upload-meta,
.form-grid,
.builder-toolbar,
.modal__actions {
  display: grid;
  gap: 16px;
}

.banner-row {
  margin-top: 12px;
}

.session-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.session-toolbar__mode {
  justify-self: center;
  text-align: center;
  min-height: 52px;
  padding: 12px 20px;
  font-size: 0.98rem;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(19, 106, 87, 0.12);
}

.mode-dock {
  position: sticky;
  top: var(--dock-top);
  z-index: 28;
  margin-top: 14px;
}

.banner-row--slim .ad-unit--leaderboard {
  min-height: 70px;
}

.ad-unit {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(19, 106, 87, 0.26);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.08), rgba(225, 138, 79, 0.12));
}

.ad-unit::before {
  content: "";
  position: absolute;
  inset: auto -22px -22px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.34);
}

.ad-unit__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
  padding: 18px;
}

.ad-unit__label,
.reward-card__label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.ad-unit__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.ad-unit__copy {
  color: var(--muted);
  line-height: 1.55;
}

.ad-unit__meta {
  font-size: 0.9rem;
  font-weight: 700;
  color: #91552e;
}

.ad-unit--leaderboard {
  min-height: 82px;
}

.ad-unit--rectangle {
  min-height: 280px;
}

.action-strip {
  grid-template-columns: repeat(9, minmax(88px, 1fr));
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(22px) saturate(135%);
  margin: 0;
}

:root[data-theme="dark"] .action-strip {
  background: rgba(16, 23, 20, 0.62);
}

:root[data-theme="dark"] .action-chip {
  color: #c4d3ca;
  border-color: rgba(223, 237, 229, 0.08);
}

:root[data-theme="dark"] .action-chip__icon {
  background: rgba(255, 255, 255, 0.08);
  color: #edf4ef;
}

:root[data-theme="dark"] .action-chip.active {
  background: rgba(28, 38, 34, 0.96);
  color: #f5fbf7;
  border-color: rgba(104, 207, 177, 0.2);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .action-chip.active .action-chip__icon {
  background: rgba(104, 207, 177, 0.16);
  color: #f5fbf7;
}

.action-chip {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 14px 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  overflow: hidden;
}

.action-chip.active {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 14px 28px rgba(28, 32, 25, 0.12);
}

.action-chip--accent {
  background:
    linear-gradient(135deg, rgba(225, 138, 79, 0.12), rgba(19, 106, 87, 0.08));
}

.action-chip__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 1.58rem;
  line-height: 1;
}

.action-chip__ribbon {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 1;
  box-sizing: border-box;
  width: 66px;
  min-height: 22px;
  padding: 6px 4px 5px;
  background: linear-gradient(135deg, rgba(225, 138, 79, 0.96), rgba(19, 106, 87, 0.94));
  color: #fff;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.012em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 10px 22px rgba(19, 106, 87, 0.18);
  pointer-events: none;
}

.action-chip__label {
  font-size: 0.88rem;
  line-height: 1.15;
  white-space: normal;
}

.action-chip[data-tool="rename"] {
  padding-top: 24px;
}

.workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 16px;
}

.workspace-main,
.support-column {
  display: grid;
  gap: var(--shell-gap);
}

.workspace-main {
  flex: 1 1 auto;
  min-height: 0;
}

.banner-row,
.mode-dock,
.session-toolbar,
.workspace-main,
.trust-footer {
  transition: padding-right 260ms ease;
}

.page-shell[data-drawer="open"] .banner-row,
.page-shell[data-drawer="open"] .mode-dock,
.page-shell[data-drawer="open"] .session-toolbar,
.page-shell[data-drawer="open"] .workspace-main,
.page-shell[data-drawer="open"] .trust-footer {
  padding-right: calc(var(--drawer-width) + 28px);
}

.page-shell[data-stage="upload"] #editStage,
.page-shell[data-stage="upload"] #progressStage,
.page-shell[data-stage="edit"] #uploadStage,
.page-shell[data-stage="edit"] #progressStage,
.page-shell[data-stage="processing"] #uploadStage,
.page-shell[data-stage="processing"] #editStage {
  display: none;
}

.page-shell[data-stage="upload"] .upload-meta {
  display: none;
}

#uploadStage,
#editStage,
#progressStage {
  animation: surfaceReveal 240ms ease;
}

.page-shell[data-stage="processing"] #progressStage {
  grid-template-columns: minmax(0, 1fr);
}

.page-shell[data-stage="upload"] .workspace-main,
.page-shell[data-stage="upload"] #uploadStage {
  min-height: 100%;
}

.support-column[hidden] {
  display: none !important;
}

.page-shell[data-stage="processing"] .drawer {
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
}

.panel,
.drawer__surface,
.modal__card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.panel {
  padding: 22px;
}

.panel__header--upload {
  align-items: flex-start;
}

.upload-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.panel__header,
.drawer__header,
.global-progress__head,
.saved-recipes__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel__header p,
.panel__header h2,
.drawer__description,
.panel__footer,
.queue-summary,
.queue-empty,
.notes-list,
.info-box,
.field span,
.dropzone p,
.modal__content p,
.reward-card__body span {
  color: var(--muted);
}

.panel__header h2 {
  font-size: 1.22rem;
}

.dropzone {
  display: flex;
  flex: 1 1 auto;
  margin-top: 14px;
  padding: 20px;
  border: 1.5px dashed rgba(19, 106, 87, 0.28);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 249, 241, 0.88));
  outline: none;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(19, 106, 87, 0.08), rgba(225, 138, 79, 0.08));
}

.dropzone__inner {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: clamp(220px, 30vh, 360px);
  width: 100%;
  text-align: center;
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--text);
  color: #fff;
  font-size: 2rem;
}

.pick-files-button {
  min-height: 58px;
  padding: 0 28px;
  border-radius: 18px;
  font-size: 1rem;
}

.dropzone h3 {
  margin: 0;
  font-size: 1.4rem;
}

.dropzone p {
  max-width: 680px;
  margin: 0 auto;
}

.dropzone__limits {
  max-width: 760px;
  margin: 4px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(19, 106, 87, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

:root[data-theme="dark"] .dropzone__limits {
  border-color: rgba(104, 207, 177, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #d7e7df;
}

.upload-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.panel--upload {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: clamp(460px, calc(100dvh - 360px), 720px);
  align-content: stretch;
}

.metric-list {
  display: grid;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
}

.metric-list--dense .field-row {
  min-height: 72px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(89, 71, 41, 0.1);
}

.field-row:last-child {
  border-bottom: 0;
}

.field-row span {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.field-row input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.upload-stat {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.upload-stat span,
.field span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.88rem;
}

.upload-stat strong,
.field strong,
.global-progress__head strong,
.queue-summary {
  font-size: 0.98rem;
}

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

.constructor-stage {
  display: grid;
  gap: 16px;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin-bottom: 16px;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid rgba(19, 106, 87, 0.18);
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(245, 239, 228, 0.58)),
    radial-gradient(circle at 12% 0%, rgba(104, 207, 177, 0.16), transparent 32%);
  box-shadow: 0 20px 46px rgba(31, 24, 12, 0.08);
  transition:
    width 260ms ease,
    max-width 260ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.constructor-stage[hidden] {
  display: none;
}

.page-shell[data-drawer="open"] .constructor-stage {
  width: calc(100% - var(--drawer-width) - 28px);
  max-width: calc(100% - var(--drawer-width) - 28px);
}

.constructor-stage__head,
.constructor-settings-host__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.constructor-stage__head strong,
.constructor-settings-host__head strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.04rem;
}

.constructor-stage__head span,
.constructor-settings-host__head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.constructor-stage__flow {
  min-height: 132px;
}

.constructor-stage__flow--empty.builder-list--flow {
  display: grid;
  place-items: center;
  padding: 18px;
}

:root[data-theme="dark"] .constructor-stage {
  border-color: rgba(104, 207, 177, 0.18);
  background:
    linear-gradient(135deg, rgba(24, 34, 30, 0.92), rgba(39, 47, 38, 0.72)),
    radial-gradient(circle at 12% 0%, rgba(104, 207, 177, 0.12), transparent 32%);
}

:root[data-theme="dark"] .constructor-stage__empty,
:root[data-theme="dark"] .builder-list--flow {
  border-color: rgba(104, 207, 177, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .scenario-card {
  border-color: rgba(223, 237, 229, 0.08);
  background:
    linear-gradient(145deg, rgba(28, 38, 34, 0.96), rgba(20, 29, 26, 0.86));
  color: #f5fbf7;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .scenario-card__label {
  color: #f7fdf9;
}

:root[data-theme="dark"] .scenario-card__icon,
:root[data-theme="dark"] .scenario-card__index {
  background: rgba(104, 207, 177, 0.14);
  color: #effbf5;
}

:root[data-theme="dark"] .builder-palette__card {
  border-color: rgba(104, 207, 177, 0.18);
  background:
    linear-gradient(145deg, rgba(33, 46, 40, 0.98), rgba(20, 29, 26, 0.94));
  color: #f7fdf9;
  box-shadow:
    0 0 0 1px rgba(104, 207, 177, 0.08),
    0 16px 30px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] .builder-palette__label {
  color: #f7fdf9;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .builder-palette__icon {
  background: rgba(104, 207, 177, 0.14);
  color: #effbf5;
}

.preview-stage,
.result-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(340px, 46vh, 560px);
  min-height: 0;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(245, 239, 228, 0.9), rgba(255, 255, 255, 0.92));
}

:root[data-theme="dark"] .preview-stage,
:root[data-theme="dark"] .result-stage,
:root[data-theme="dark"] .dropzone {
  background:
    linear-gradient(145deg, rgba(28, 37, 33, 0.92), rgba(16, 23, 20, 0.96));
}

:root[data-theme="dark"] .dropzone__icon {
  background: rgba(104, 207, 177, 0.14);
  color: #effbf5;
  box-shadow: inset 0 0 0 1px rgba(104, 207, 177, 0.22);
}

.preview-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.result-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.result-stage[data-text-drag="true"] {
  cursor: grab;
}

.result-stage[data-text-drag="true"]:active {
  cursor: grabbing;
}

.gif-live-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.gif-live-overlay.hidden {
  display: none;
}

.gif-live-overlay__watermark,
.gif-live-overlay__text-line {
  position: absolute;
  max-width: min(86%, 680px);
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-align: center;
}

.gif-live-overlay__watermark--text {
  width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.gif-live-overlay__watermark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gif-live-overlay__text-line {
  left: 50%;
  transform: translateX(-50%);
  font-family: "Space Grotesk", Impact, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  paint-order: stroke fill;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 32px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(245, 239, 228, 0.58), rgba(255, 255, 255, 0.52));
}

.crop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.crop-overlay.hidden {
  display: none;
}

.crop-overlay__line {
  position: absolute;
  display: block;
  opacity: 0.9;
}

.crop-overlay__line[hidden],
.crop-overlay__six-grid[hidden],
.crop-overlay__dot[hidden],
.crop-overlay__badge[hidden] {
  display: none;
}

.crop-overlay__line--vertical {
  top: 0;
  bottom: 0;
  width: 1px;
  background:
    linear-gradient(180deg, transparent, rgba(239, 173, 115, 0.95), transparent);
  box-shadow: 0 0 18px rgba(239, 173, 115, 0.28);
}

.crop-overlay__line--horizontal {
  left: 0;
  right: 0;
  height: 1px;
  background:
    linear-gradient(90deg, transparent, rgba(104, 207, 177, 0.95), transparent);
  box-shadow: 0 0 18px rgba(104, 207, 177, 0.28);
}

.crop-overlay__line--third {
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 0 0 1px rgba(19, 106, 87, 0.42),
    0 0 18px rgba(19, 106, 87, 0.2);
}

.crop-overlay__six-grid {
  position: absolute;
  display: block;
  border: 1px dashed rgba(255, 255, 255, 0.58);
  border-radius: 10px;
  background:
    linear-gradient(
      90deg,
      transparent calc(16.666% - 0.5px),
      rgba(19, 106, 87, 0.58) calc(16.666% - 0.5px) calc(16.666% + 0.5px),
      transparent calc(16.666% + 0.5px)
    ),
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      rgba(19, 106, 87, 0.46) calc(50% - 0.5px) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      90deg,
      transparent calc(83.333% - 0.5px),
      rgba(19, 106, 87, 0.58) calc(83.333% - 0.5px) calc(83.333% + 0.5px),
      transparent calc(83.333% + 0.5px)
    ),
    linear-gradient(
      0deg,
      transparent calc(16.666% - 0.5px),
      rgba(239, 173, 115, 0.58) calc(16.666% - 0.5px) calc(16.666% + 0.5px),
      transparent calc(16.666% + 0.5px)
    ),
    linear-gradient(
      0deg,
      transparent calc(50% - 0.5px),
      rgba(239, 173, 115, 0.46) calc(50% - 0.5px) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      0deg,
      transparent calc(83.333% - 0.5px),
      rgba(239, 173, 115, 0.58) calc(83.333% - 0.5px) calc(83.333% + 0.5px),
      transparent calc(83.333% + 0.5px)
    );
  box-shadow: 0 0 0 1px rgba(19, 106, 87, 0.18);
}

.crop-overlay__dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow:
    0 0 0 6px rgba(104, 207, 177, 0.14),
    0 0 0 10px rgba(225, 138, 79, 0.1);
  transform: translate(-50%, -50%);
}

.crop-overlay__badge {
  position: absolute;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.88);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 14px 22px rgba(26, 26, 26, 0.12);
  transform: translate(-50%, calc(-100% - 14px));
}

.crop-overlay__badge.crop-overlay__badge--below {
  transform: translate(-50%, 16px);
}

:root[data-theme="dark"] .crop-overlay__badge {
  background: rgba(17, 23, 20, 0.9);
}

:root[data-theme="dark"] .empty-state {
  background:
    linear-gradient(145deg, rgba(28, 37, 33, 0.54), rgba(16, 23, 20, 0.52));
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.92rem;
}

.panel__footer--downloads {
  align-items: flex-end;
}

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

.download-group--processing {
  margin-top: 14px;
}

.primary-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.lower-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}

.lower-layout[data-compact="true"] {
  grid-template-columns: minmax(0, 1fr);
}

.processing-result {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
}

.processing-result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.processing-result__head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.02rem;
}

.processing-result__meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.global-progress {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.progress-track {
  position: relative;
  height: 12px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 29, 0.08);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #136a57, #e18a4f);
}

.queue-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.queue-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.queue-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.queue-item__head,
.queue-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-item__name {
  font-weight: 800;
}

.queue-item__status {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 800;
}

.queue-item__meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.notes-list {
  display: grid;
  gap: 12px;
  padding-left: 20px;
  margin: 18px 0 0;
  line-height: 1.5;
}

.drawer {
  position: fixed;
  top: var(--dock-top);
  right: 18px;
  z-index: 35;
  width: var(--drawer-width);
  height: calc(100dvh - var(--dock-top) - var(--drawer-bottom-gap));
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.drawer__surface {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 0 22px 36px;
  transform: translateX(26px);
  opacity: 0;
  transition:
    transform 260ms ease,
    opacity 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.drawer.open {
  pointer-events: auto;
}

.drawer.open .drawer__surface {
  transform: translateX(0);
  opacity: 1;
}

.drawer__footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  padding-bottom: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0), rgba(255, 252, 247, 0.94) 28%);
  border-top: 1px solid rgba(89, 71, 41, 0.08);
}

:root[data-theme="dark"] .drawer__footer {
  background:
    linear-gradient(180deg, rgba(20, 28, 24, 0), rgba(20, 28, 24, 0.96) 28%);
  border-top-color: rgba(223, 237, 229, 0.08);
}

.start-button--drawer {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
}

.drawer__section-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.06rem;
}

.drawer__panel {
  display: none;
  margin-top: 22px;
  min-width: 0;
  scroll-margin-bottom: 140px;
}

.drawer__panel.active {
  display: block;
  animation: panelSlideIn 220ms ease;
}

.drawer__batch-settings {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(89, 71, 41, 0.1);
}

.drawer__batch-settings[hidden] {
  display: none !important;
}

.drawer__batch-settings .info-box {
  margin-top: 0;
}

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

.drawer__panel > .field + .field,
.drawer__panel > .field + .form-grid,
.drawer__panel > .form-grid + .form-grid,
.drawer__panel > .form-grid + .field {
  margin-top: 18px;
}

.drawer__panel > .info-box + .field,
.drawer__panel > .info-box + .form-grid,
.drawer__panel > .info-box + .preset-grid,
.drawer__panel > .info-box + .preset-section {
  margin-top: 18px;
}

.form-grid > * {
  min-width: 0;
}

.form-grid--color {
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="file"],
.field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.field input[type="file"] {
  padding-top: 12px;
}

#watermarkTextFields,
#watermarkImageFields {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.form-grid--watermark {
  margin-top: 18px;
}

.field--range {
  margin-top: 14px;
}

.field--range input[type="range"] {
  width: 100%;
}

.check-row,
.info-box {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  min-height: 76px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.check-row input {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-top: 1px;
  appearance: none;
  border: 1.5px solid rgba(19, 106, 87, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.check-row input::after {
  content: "\2713";
  color: transparent;
  font-size: 1.02rem;
  font-weight: 800;
}

.check-row span {
  flex: 1 1 auto;
  min-width: 0;
}

.check-row input:checked {
  background: rgba(19, 106, 87, 0.12);
  border-color: rgba(19, 106, 87, 0.4);
}

.check-row input:checked::after {
  color: var(--accent);
}

.check-stack {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.check-stack .check-row {
  flex-direction: column;
  justify-content: center;
  margin-top: 0;
  min-height: 74px;
  padding: 12px 10px;
  text-align: center;
}

.check-stack .check-row input {
  width: 28px;
  height: 28px;
}

[data-panel="effects"] .field {
  gap: 10px;
}

[data-panel="effects"] .form-grid {
  gap: 18px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.preset-grid {
  display: grid;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.preset-grid--triple {
  grid-template-columns: repeat(3, minmax(132px, 1fr));
}

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

.preset-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.preset-section--compact {
  margin-top: 14px;
}

.preset-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.preset-section__head strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.preset-section__head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.preset-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(245, 239, 228, 0.66));
  color: var(--text);
  text-align: left;
  min-width: 0;
}

.preset-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.preset-card span {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.preset-card.active {
  border-color: rgba(19, 106, 87, 0.38);
  background: rgba(19, 106, 87, 0.1);
  box-shadow: 0 14px 28px rgba(19, 106, 87, 0.12);
}

.preset-card--square {
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: center;
  min-height: 126px;
  padding: 16px 12px;
  text-align: center;
}

.preset-card--square > strong {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  min-height: 2.4em;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.preset-card--square > span:not(.preset-card__glyph) {
  display: flex;
  align-items: start;
  justify-content: center;
  width: 100%;
  min-height: 2.8em;
  text-align: center;
  font-size: clamp(0.72rem, 1.8vw, 0.88rem);
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.preset-card__glyph {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.14), rgba(225, 138, 79, 0.18));
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.34rem;
  font-weight: 700;
}

.ghost-link {
  padding: 0;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.color-swatch {
  position: relative;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.color-swatch.active {
  border-color: rgba(19, 106, 87, 0.4);
  box-shadow:
    0 14px 28px rgba(19, 106, 87, 0.14),
    inset 0 0 0 2px rgba(255, 255, 255, 0.48);
}

.color-swatch.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 0.82rem;
  font-weight: 800;
}

.color-preview {
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.04)),
    var(--color-preview, #ffffff);
}

.field-readout {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] .field-readout {
  background: rgba(28, 38, 34, 0.92);
}

.drawer__header {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -22px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(89, 71, 41, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(255, 252, 247, 0.92));
  backdrop-filter: blur(16px);
}

.drawer__header .panel__eyebrow {
  margin-bottom: 2px;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
}

.drawer__header h2 {
  font-size: clamp(1.42rem, 3vw, 1.78rem);
}

.drawer__header .start-button--drawer {
  width: min(100%, 320px);
  margin-top: 10px;
}

:root[data-theme="dark"] .drawer__header {
  background:
    linear-gradient(180deg, rgba(20, 28, 24, 0.98), rgba(20, 28, 24, 0.92));
  border-bottom-color: rgba(223, 237, 229, 0.08);
}

.drawer__surface > * {
  min-width: 0;
}

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

.format-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  text-align: left;
}

.format-card__icon {
  display: grid;
  place-items: center;
  align-content: center;
  flex: 0 0 62px;
  width: 62px;
  height: 48px;
  padding: 0 10px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.14), rgba(225, 138, 79, 0.18));
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-align: center;
}

.format-card__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.format-card__meta strong {
  font-size: 0.98rem;
}

.format-card__meta small {
  color: var(--muted);
  line-height: 1.35;
}

.field--file-picker {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px dashed rgba(19, 106, 87, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(245, 239, 228, 0.64));
  align-content: start;
}

.file-picker-button {
  width: 100%;
  min-height: 60px;
  border-radius: 18px;
  border: 1px solid rgba(19, 106, 87, 0.18);
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.1), rgba(225, 138, 79, 0.12));
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(19, 106, 87, 0.08);
}

:root[data-theme="dark"] .field--file-picker {
  background:
    linear-gradient(145deg, rgba(26, 36, 32, 0.88), rgba(18, 26, 22, 0.8));
  border-color: rgba(104, 207, 177, 0.14);
}

:root[data-theme="dark"] .file-picker-button {
  border-color: rgba(104, 207, 177, 0.18);
  background:
    linear-gradient(135deg, rgba(104, 207, 177, 0.12), rgba(239, 173, 115, 0.12));
}

.format-card.active {
  border-color: rgba(19, 106, 87, 0.36);
  background: rgba(19, 106, 87, 0.1);
  box-shadow: 0 14px 30px rgba(19, 106, 87, 0.12);
}

.format-card[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  filter: saturate(0.75);
}

#centerCropButton {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  min-height: 58px;
  border-radius: 18px;
  border-color: rgba(19, 106, 87, 0.22);
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.14), rgba(225, 138, 79, 0.16));
  box-shadow: 0 16px 34px rgba(19, 106, 87, 0.12);
  font-weight: 800;
}

#centerCropButton::before {
  content: "◎";
  font-size: 1rem;
  line-height: 1;
}

:root[data-theme="dark"] #centerCropButton {
  background:
    linear-gradient(135deg, rgba(32, 52, 44, 0.96), rgba(65, 54, 39, 0.9));
  border-color: rgba(104, 207, 177, 0.2);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.mini-chip {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.mini-chip.active {
  background: var(--text);
  color: #fff;
}

.builder-palette,
.builder-list,
.saved-recipes {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.builder-list[hidden] {
  display: none;
}

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

.builder-palette__card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(245, 239, 228, 0.66));
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  cursor: grab;
  text-align: left;
}

.builder-palette__card:active {
  cursor: grabbing;
}

.builder-palette__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(19, 106, 87, 0.1);
  font-size: 1.12rem;
  line-height: 1;
}

.builder-palette__label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.1;
}

.builder-toolbar {
  display: none;
}

.builder-list--flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  min-width: 0;
  padding: 14px 18px;
  border: 1px dashed rgba(19, 106, 87, 0.24);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.56), rgba(245, 239, 228, 0.32));
  scrollbar-width: thin;
}

.constructor-stage__empty {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 100%;
  min-height: 100%;
  padding: 18px;
  border: 1px dashed rgba(19, 106, 87, 0.2);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.constructor-stage__empty-copy {
  pointer-events: none;
}

.scenario-slot--empty,
.scenario-slot--empty.scenario-slot--active {
  flex: 1 1 100%;
  width: 100%;
  min-width: 100%;
  min-height: 100px;
}

.scenario-slot--empty .scenario-slot__arrow {
  display: none;
}

.scenario-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: center;
  gap: 9px;
  flex: 0 0 clamp(116px, 12vw, 156px);
  min-height: 112px;
  padding: 18px 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(245, 239, 228, 0.66));
  color: var(--text);
  font-weight: 850;
  text-align: center;
  cursor: grab;
  box-shadow: 0 14px 28px rgba(28, 32, 25, 0.1);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.scenario-card:active {
  cursor: grabbing;
}

.scenario-card:not(:last-child)::after {
  content: none;
}

.scenario-slot {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  align-self: stretch;
  display: grid;
  place-items: center;
  transition:
    flex-basis 180ms ease,
    width 180ms ease,
    min-width 180ms ease,
    opacity 180ms ease;
}

.scenario-slot__arrow {
  color: var(--accent);
  font-size: 1.38rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.scenario-slot:not(.scenario-slot--arrow) .scenario-slot__arrow {
  opacity: 0;
}

.scenario-slot--active {
  flex-basis: var(--builder-slot-width, 148px);
  width: var(--builder-slot-width, 148px);
  min-width: var(--builder-slot-width, 148px);
}

.scenario-slot--active .scenario-slot__arrow {
  opacity: 0;
}

.scenario-slot--active::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), #e18a4f);
  box-shadow: 0 0 0 6px rgba(19, 106, 87, 0.1);
  transform: translateX(-50%);
}

.scenario-card__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(19, 106, 87, 0.1);
  font-size: 1.5rem;
  line-height: 1;
}

.scenario-card__label {
  font-size: 0.9rem;
  line-height: 1.12;
}

.scenario-card__index {
  position: absolute;
  left: 10px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(19, 106, 87, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.scenario-card__remove {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: scale(0.84);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.scenario-card:hover .scenario-card__remove,
.scenario-card:focus-within .scenario-card__remove {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.scenario-card__remove:hover {
  background: #bf1f1b;
}

.scenario-card.builder-step--selected {
  border-color: rgba(19, 106, 87, 0.48);
  box-shadow:
    0 0 0 3px rgba(19, 106, 87, 0.12),
    0 18px 34px rgba(19, 106, 87, 0.12);
  transform: translateY(-2px);
}

.scenario-card.builder-step--drag-over {
  border-color: rgba(225, 138, 79, 0.58);
  box-shadow:
    0 0 0 3px rgba(225, 138, 79, 0.14),
    0 18px 34px rgba(225, 138, 79, 0.1);
}

.scenario-card--drag-source {
  opacity: 0.54;
}

.scenario-card,
.scenario-card * {
  user-select: none;
}

.panel--batch-tools {
  display: grid;
  gap: 14px;
}

.panel--batch-tools .info-box {
  margin-top: 0;
}

.panel--batch-tools strong {
  color: var(--text);
}

.builder-step,
.saved-recipe {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.builder-step--flow {
  position: relative;
  min-width: 164px;
  align-content: space-between;
  cursor: grab;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.builder-step--flow:active {
  cursor: grabbing;
}

.builder-step--flow:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -18px;
  top: 50%;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  transform: translateY(-50%);
}

.builder-step.builder-step--drag-over {
  border-color: rgba(19, 106, 87, 0.58);
  box-shadow: 0 0 0 3px rgba(19, 106, 87, 0.12);
}

.builder-step.builder-step--selected {
  border-color: rgba(19, 106, 87, 0.52);
  box-shadow:
    0 0 0 3px rgba(19, 106, 87, 0.12),
    0 18px 34px rgba(19, 106, 87, 0.1);
  transform: translateY(-1px);
}

.builder-flow-drop {
  outline: 2px dashed rgba(19, 106, 87, 0.34);
  outline-offset: 3px;
}

.constructor-settings-host {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.constructor-settings-host[hidden] {
  display: none;
}

.drawer__panel--constructor-settings {
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(19, 106, 87, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
}

:root[data-theme="dark"] .drawer__panel--constructor-settings {
  border-color: rgba(104, 207, 177, 0.16);
  background: rgba(20, 29, 26, 0.72);
}

.builder-step__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.saved-recipe {
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.saved-recipe__title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.saved-recipe__chain {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  word-break: break-word;
}

.builder-step__head span {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.builder-step__actions,
.saved-recipe__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-recipe__actions {
  width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
  align-items: center;
}

.builder-step__button,
.saved-recipe__button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.saved-recipe__button {
  min-width: 120px;
}

.saved-recipe__button--danger {
  border-color: rgba(225, 57, 53, 0.22);
  background: rgba(225, 57, 53, 0.08);
  color: #b42318;
}

.saved-recipe__button--danger:hover {
  background: rgba(225, 57, 53, 0.14);
}

.recipe-box {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 13, 0.56);
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(540px, calc(100vw - 28px));
  padding: 24px;
  background: #fffdf9;
}

:root[data-theme="dark"] .modal__card {
  background: #16201c;
}

.modal__content.hidden {
  display: none;
}

.modal__content p {
  line-height: 1.6;
}

#rewardPrompt .panel__eyebrow {
  text-align: center;
}

.modal__actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.modal__actions--single {
  grid-template-columns: 1fr;
}

.language-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.language-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  text-align: left;
}

.language-option strong {
  font-size: 1rem;
}

.language-option span {
  color: var(--muted);
}

.language-option.active {
  border-color: rgba(19, 106, 87, 0.36);
  background: rgba(19, 106, 87, 0.1);
}

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

:root[data-theme="dark"] .language-option {
  background: rgba(24, 33, 29, 0.84);
}

.trust-footer {
  margin-top: 18px;
}

.trust-footer__inner {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.58);
  backdrop-filter: blur(18px) saturate(125%);
  color: var(--muted);
  text-align: center;
}

.trust-footer__pill {
  justify-self: center;
}

.trust-footer__text {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

:root[data-theme="dark"] .trust-footer__inner {
  background: rgba(16, 23, 20, 0.66);
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reward-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(19, 106, 87, 0.26);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(19, 106, 87, 0.08), rgba(225, 138, 79, 0.12));
}

.reward-card__body {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

:root[data-theme="dark"] .status-dot {
  background: rgba(239, 173, 115, 0.14);
  color: #f4c89d;
}

:root[data-theme="dark"] .privacy-pill,
:root[data-theme="dark"] .hint-chip {
  background: rgba(104, 207, 177, 0.14);
  color: #dff8ef;
}

:root[data-theme="dark"] .ad-unit__meta {
  color: #efc091;
}

:root[data-theme="dark"] .mode-switch,
:root[data-theme="dark"] .upload-stat,
:root[data-theme="dark"] .queue-item,
:root[data-theme="dark"] .queue-empty,
:root[data-theme="dark"] .global-progress,
:root[data-theme="dark"] .processing-result,
:root[data-theme="dark"] .check-row,
:root[data-theme="dark"] .info-box,
:root[data-theme="dark"] .metric-list,
:root[data-theme="dark"] .format-card,
:root[data-theme="dark"] .preset-card,
:root[data-theme="dark"] .resize-mode-card,
:root[data-theme="dark"] .builder-step,
:root[data-theme="dark"] .saved-recipe {
  background: rgba(24, 33, 29, 0.84);
}

:root[data-theme="dark"] .saved-recipe {
  border-color: rgba(104, 207, 177, 0.12);
  background:
    linear-gradient(145deg, rgba(28, 38, 34, 0.96), rgba(20, 29, 26, 0.9));
  color: #f5fbf7;
}

:root[data-theme="dark"] .saved-recipe__title {
  color: #f7fdf9;
}

:root[data-theme="dark"] .saved-recipe__chain {
  color: rgba(239, 251, 245, 0.78);
}

:root[data-theme="dark"] .saved-recipe__button {
  border-color: rgba(104, 207, 177, 0.18);
  background: rgba(31, 43, 38, 0.98);
  color: #eefaf4;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .saved-recipe__button--danger {
  border-color: rgba(255, 120, 120, 0.34);
  background: rgba(122, 30, 30, 0.62);
  color: #ffe2e2;
}

:root[data-theme="dark"] .field input[type="text"],
:root[data-theme="dark"] .field input[type="number"],
:root[data-theme="dark"] .field input[type="file"],
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field-row input {
  background: rgba(28, 38, 34, 0.92);
  color: var(--text);
}

:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .primary-link {
  background: rgba(24, 33, 29, 0.92);
  color: var(--text);
}

:root[data-theme="dark"] .primary-link.secondary,
:root[data-theme="dark"] .ghost-button {
  background: rgba(24, 33, 29, 0.4);
  color: #d7e6df;
  border-color: rgba(223, 237, 229, 0.14);
}

:root[data-theme="dark"] .drawer__panel[data-panel="constructor"] .builder-palette__card {
  border-color: rgba(104, 207, 177, 0.2);
  background:
    linear-gradient(145deg, rgba(34, 47, 41, 0.98), rgba(18, 25, 22, 0.96));
  color: #f5fcf8;
  box-shadow:
    0 0 0 1px rgba(104, 207, 177, 0.08),
    0 18px 32px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .drawer__panel[data-panel="constructor"] .builder-palette__label,
:root[data-theme="dark"] .constructor-stage .scenario-card__label {
  color: #f7fdf9;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .constructor-stage .scenario-card {
  border-color: rgba(104, 207, 177, 0.14);
  background:
    linear-gradient(145deg, rgba(30, 40, 36, 0.98), rgba(17, 24, 21, 0.94));
  color: #f5fbf7;
}

:root[data-theme="dark"] .saved-recipe__button.secondary-button {
  border-color: rgba(104, 207, 177, 0.18);
  background: rgba(32, 45, 39, 0.98);
  color: #eefaf4;
}

:root[data-theme="dark"] .saved-recipe__button.ghost-button {
  border-color: rgba(255, 120, 120, 0.34);
  background: rgba(122, 30, 30, 0.62);
  color: #ffe2e2;
}

:root[data-theme="dark"] .saved-recipe__button.secondary-button:hover {
  background: rgba(42, 58, 51, 0.98);
}

:root[data-theme="dark"] .saved-recipe__button.ghost-button:hover {
  background: rgba(146, 36, 36, 0.68);
}

:root[data-theme="dark"] .panel__footer span,
:root[data-theme="dark"] .processing-result__meta,
:root[data-theme="dark"] .queue-item__meta,
:root[data-theme="dark"] .ad-unit__copy,
:root[data-theme="dark"] .upload-stat span,
:root[data-theme="dark"] .field span,
:root[data-theme="dark"] .language-option span {
  color: #c6d4cc;
}

:root[data-theme="dark"] .panel__footer .hint-chip {
  color: #dff8ef;
}

:root[data-theme="dark"] .resize-mode-card {
  border-color: rgba(223, 237, 229, 0.08);
}

:root[data-theme="dark"] .resize-mode-card__icon {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .resize-mode-card.active {
  background: rgba(30, 41, 36, 0.96);
}

:root[data-theme="dark"] .check-row input {
  background: rgba(28, 38, 34, 0.92);
}

:root[data-theme="dark"] .mini-chip {
  background: rgba(24, 33, 29, 0.92);
  color: #d7e6df;
}

:root[data-theme="dark"] .mini-chip.active {
  background: rgba(104, 207, 177, 0.18);
  border-color: rgba(104, 207, 177, 0.34);
  color: #f4fffb;
}

:root[data-theme="dark"] .mode-pill.active {
  background: rgba(104, 207, 177, 0.16);
  color: #eff9f4;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.progress-track--reward {
  margin-top: 18px;
  height: 14px;
}

.cropper-view-box,
.cropper-face {
  border-radius: 16px;
}

@media (max-width: 1220px) {
  .banner-row,
  .workspace-main,
  .mode-dock,
  .session-toolbar,
  .trust-footer {
    padding-right: 0;
  }

  .constructor-stage {
    width: 100%;
    max-width: 100%;
  }

  .drawer {
    position: static;
    display: none;
    width: 100%;
    height: auto;
    margin-top: 18px;
  }

  .drawer.open {
    display: block;
    pointer-events: auto;
  }

  .preview-layout {
    grid-template-columns: 1fr;
  }

  .action-strip {
    grid-template-columns: repeat(9, minmax(88px, 1fr));
  }
}

@media (max-width: 640px) {
  .saved-recipe__actions {
    flex-wrap: wrap;
  }

  .saved-recipe__button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  :root {
    --topbar-height: 68px;
    --topbar-padding-block: 0px;
    --topbar-padding-inline: 12px;
  }

  .upload-meta,
  .lower-layout {
    grid-template-columns: 1fr;
  }

  .panel__header,
  .drawer__header,
  .processing-result__head,
  .trust-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .mode-switch {
    width: 100%;
  }

  .session-toolbar {
    grid-template-columns: 1fr;
  }

  .session-toolbar__mode {
    justify-self: stretch;
  }

  .upload-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .mode-pill {
    flex: 1;
    justify-content: center;
  }

  .page-shell {
    padding: 12px 12px 22px;
  }

  .topbar {
    top: 10px;
    border-radius: 24px;
  }

  .topbar__main {
    gap: 12px;
  }

  .topbar__actions {
    margin-left: auto;
  }

  .action-strip {
    border-radius: 22px;
    grid-template-columns: repeat(9, minmax(88px, 1fr));
  }

  .action-chip {
    min-height: 102px;
  }

  .banner-row {
    padding-right: 0;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

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

@media (max-width: 760px) {
  :root {
    --shell-gap: 12px;
    --stack-gap: 10px;
  }

  .page-shell {
    padding: 10px 10px 18px;
  }

  .page-shell[data-drawer="open"] {
    padding-bottom: min(72dvh, 640px);
  }

  .action-strip {
    display: flex;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .action-strip::-webkit-scrollbar {
    display: none;
  }

  .action-chip {
    flex: 0 0 92px;
    min-width: 92px;
    min-height: 84px;
    padding: 16px 8px 10px;
    scroll-snap-align: start;
  }

  .action-chip[data-tool="rename"] {
    padding-top: 28px;
  }

  .action-chip__icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 1.28rem;
  }

  .action-chip__label {
    font-size: 0.78rem;
  }

  .action-chip__ribbon {
    top: 5px;
    width: 58px;
    font-size: 0.52rem;
  }

  .session-toolbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .mode-switch {
    grid-column: 1 / -1;
  }

  .session-toolbar__mode {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  #clearFiles {
    min-height: 48px;
    padding-inline: 16px;
  }

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

  .upload-stat {
    padding: 14px;
  }

  .panel--upload {
    min-height: auto;
  }

  .dropzone {
    padding: 16px;
    border-radius: 24px;
  }

  .dropzone__inner {
    min-height: clamp(180px, 34vh, 250px);
    gap: 12px;
  }

  .dropzone__icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 1.7rem;
  }

  .dropzone h3 {
    font-size: 1.18rem;
  }

  .dropzone__limits {
    font-size: 0.86rem;
  }

  .pick-files-button {
    width: 100%;
    min-height: 52px;
  }

  .preview-stage,
  .result-stage {
    height: clamp(220px, 36vh, 320px);
  }

  .drawer {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 45;
    display: block;
    width: auto;
    height: auto;
    max-height: min(72dvh, 640px);
    margin-top: 0;
    pointer-events: none;
  }

  .drawer__surface {
    height: auto;
    max-height: min(72dvh, 640px);
    padding: 0 18px 28px;
    border-radius: 24px;
    transform: translateY(24px);
    opacity: 0;
    box-shadow: 0 24px 48px rgba(20, 24, 22, 0.22);
  }

  .drawer.open {
    pointer-events: auto;
  }

  .drawer.open .drawer__surface {
    transform: translateY(0);
    opacity: 1;
  }

  .form-grid,
  .builder-toolbar,
  .modal__actions,
  .format-picker {
    grid-template-columns: 1fr;
  }

  .preset-section__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .drawer__header {
    margin: 0 -18px;
    padding: 18px 18px 16px;
  }

  .drawer__panel {
    margin-top: 18px;
  }

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

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

  .builder-palette,
  .builder-list,
  .saved-recipes {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  :root {
    --topbar-height: 60px;
    --topbar-padding-block: 0px;
    --topbar-padding-inline: 10px;
  }

  .topbar,
  .panel,
  .drawer__surface,
  .modal__card {
    padding: 18px;
    border-radius: 22px;
  }

  .topbar {
    padding: var(--topbar-padding-block) var(--topbar-padding-inline);
  }

  .preview-stage,
  .result-stage {
    height: clamp(280px, 40vh, 360px);
  }

  .upload-meta {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .builder-toolbar,
  .modal__actions {
    grid-template-columns: 1fr;
  }

  .format-picker {
    grid-template-columns: 1fr;
  }

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

  .preset-section__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-chip {
    min-height: 96px;
  }

  .action-strip {
    padding-inline: 8px;
  }

  .topbar__main {
    gap: 8px;
  }

  .topbar__actions {
    gap: 8px;
    margin-left: auto;
  }

  .brand-logo {
    max-width: 100%;
  }

  .language-pill {
    min-height: 44px;
    padding: 0 10px;
    gap: 8px;
  }

  .language-pill__label {
    width: 28px;
    height: 28px;
  }

  .language-pill__text {
    display: none;
  }

  .theme-fab {
    width: 44px;
    height: 44px;
  }

  .theme-fab__icon {
    width: 28px;
    height: 28px;
  }

  .preset-grid,
  .preset-grid--triple,
  .check-stack,
  .resize-mode-cards {
    grid-template-columns: 1fr;
  }

  .drawer,
  .drawer__surface {
    max-height: min(76dvh, 680px);
  }
}

@media (max-height: 820px) {
  .page-shell[data-stage="upload"] .banner-row {
    display: none;
  }
}

@keyframes surfaceReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
