/**
 * Chillax by Manushi Parikh / Indian Type Foundry
 * Source supplied by the site owner via Fontshare webfont package.
 */
@font-face {
  font-family: "Chillax";
  src: url("./assets/fonts/Chillax-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #12202f;
  --muted: #66717e;
  --paper: #f7f8f7;
  --white: #ffffff;
  --line: #dfe3e6;
  --line-strong: #b9c1c8;
  --lime: #caff62;
  --lime-dark: #9fdb2f;
  --on-lime: #12202f;
  --brand-bg: #12202f;
  --brand-text: #caff62;
  --blue: #4263eb;
  --stage: #e9ecef;
  --danger: #bc3d32;
  --shadow: 0 24px 80px rgba(18, 32, 47, 0.1);
  --grid-line: rgba(18, 32, 47, 0.035);
  --topbar-bg: rgba(247, 248, 247, 0.88);
  --control-bg: #ffffff;
  --soft-bg: #f2f4f4;
  --soft-bg-hover: #e2e6e8;
  --soft-bg-selected: #f8faf7;
  --stage-panel-bg: #fbfcfb;
  --track: #dce1e4;
  --subtle-text: #8b959c;
  --control-border: #c2c9ce;
  --control-border-hover: #aeb7bd;
  --drop-border: #adb6bd;
  --drag-bg: #e9edff;
  --secondary-hover: #26394b;
  --disabled-bg: #edf0f1;
  --disabled-text: #9aa3aa;
  --surface-shadow: rgba(18, 32, 47, 0.18);
  --compact-shadow: rgba(18, 32, 47, 0.09);
  --preview-shadow: rgba(18, 32, 47, 0.16);
  --lime-glow: rgba(202, 255, 98, 0.22);
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: "Chillax", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #aeb8c4;
  --paper: #0d141d;
  --white: #151f2b;
  --line: #293746;
  --line-strong: #445467;
  --blue: #8ea4ff;
  --stage: #111a24;
  --danger: #ff7f75;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --grid-line: rgba(255, 255, 255, 0.035);
  --topbar-bg: rgba(13, 20, 29, 0.88);
  --control-bg: #17222e;
  --soft-bg: #101923;
  --soft-bg-hover: #273442;
  --soft-bg-selected: #1a2633;
  --stage-panel-bg: #111923;
  --track: #3a4857;
  --subtle-text: #8d99a6;
  --control-border: #465567;
  --control-border-hover: #637386;
  --drop-border: #536274;
  --drag-bg: #1a2541;
  --secondary-hover: #dce4ec;
  --disabled-bg: #283542;
  --disabled-text: #7d8995;
  --surface-shadow: rgba(0, 0, 0, 0.34);
  --compact-shadow: rgba(0, 0, 0, 0.24);
  --preview-shadow: rgba(0, 0, 0, 0.38);
  --lime-glow: rgba(202, 255, 98, 0.1);
  --brand-bg: #caff62;
  --brand-text: #12202f;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(66, 99, 235, 0.32);
  outline-offset: 3px;
}

.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;
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  width: max-content;
}

.brand-mark {
  width: 34px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-bg);
  color: var(--brand-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.theme-toggle,
.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--ink);
  box-shadow: 0 5px 16px var(--compact-shadow);
}

.theme-toggle {
  gap: 8px;
  padding: 7px 9px 7px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.theme-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.theme-icon svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
}

.theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.theme-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--track);
  transition: background-color 180ms ease;
}

.theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 180ms ease;
}

.theme-toggle[aria-pressed="true"] .theme-track {
  background: var(--blue);
}

.theme-toggle[aria-pressed="true"] .theme-thumb {
  transform: translateX(14px);
}

.language-icon {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

#language-select {
  min-height: 46px;
  width: 150px;
  appearance: none;
  cursor: pointer;
  padding: 10px 40px 10px 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  color-scheme: light;
  font-size: 14px;
  font-weight: 750;
}

#language-select option {
  background: #ffffff;
  color: #12202f;
}

[data-theme="dark"] #language-select {
  color-scheme: dark;
}

[data-theme="dark"] #language-select option {
  background: #17222e;
  color: #f4f7fb;
}

.language-switcher:focus-within {
  outline: 3px solid rgba(66, 99, 235, 0.32);
  outline-offset: 3px;
}

#language-select:focus-visible {
  outline: 0;
}

.select-chevron {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.workspace {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 84px) 0 56px;
}

.tool-intro {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  column-gap: 40px;
  align-items: end;
  max-width: 900px;
  margin-bottom: 38px;
}

.tool-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 5.2vw, 74px);
  line-height: 1.14;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.tool-intro > p:last-child {
  margin: 0 0 4px;
  max-width: 480px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(315px, 390px) minmax(0, 1fr);
  min-height: 680px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 30px;
  border-right: 1px solid var(--line);
}

.control-heading {
  display: flex;
  align-items: flex-start;
  padding-bottom: 26px;
}

.control-heading h2,
.stage-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.control-heading h2 {
  margin: 0;
}

.control-group {
  margin: 0;
  padding: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.control-group legend,
.legend-row legend {
  padding: 0;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 720;
}

.label-type-group {
  position: relative;
}

.legend-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  background: var(--soft-bg);
  color: var(--muted);
  font: 800 12px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.info-button:hover,
.info-button[aria-expanded="true"] {
  border-color: var(--control-border-hover);
  background: var(--soft-bg-hover);
  color: var(--ink);
}

.info-button:focus-visible,
.info-close-button:focus-visible {
  outline: 3px solid rgba(20, 106, 190, 0.24);
  outline-offset: 2px;
}

.info-popover {
  position: absolute;
  top: 57px;
  left: 0;
  z-index: 20;
  width: min(342px, calc(100vw - 64px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  box-shadow: 0 16px 42px var(--surface-shadow);
}

.info-popover[hidden] {
  display: none;
}

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

.info-popover-header strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.info-close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin: -5px -5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.info-close-button:hover {
  background: var(--soft-bg);
  color: var(--ink);
}

.info-close-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.info-popover-entry + .info-popover-entry {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.info-popover-entry span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.info-popover-entry p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.legend-row output {
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-bg);
}

.segment {
  position: relative;
  cursor: pointer;
}

.segment input,
.position-option input,
.swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

html[lang="pl"] .segment span {
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.segment.is-selected span {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 3px 9px var(--compact-shadow);
}

.range {
  width: 100%;
  height: 20px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--ink) 0 var(--range-progress, 31%), var(--track) var(--range-progress, 31%) 100%);
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: var(--track);
}

.range::-moz-range-progress {
  height: 4px;
  border-radius: 99px;
  background: var(--ink);
}

.range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 6px rgba(18, 32, 47, 0.25);
}

.range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), 0 2px 6px rgba(18, 32, 47, 0.25);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: var(--subtle-text);
  font-size: 11px;
}

.position-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.position-option {
  position: relative;
  cursor: pointer;
}

.position-option > span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.position-option.is-selected > span {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--soft-bg-selected);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.position-option b {
  font: inherit;
}

.corner {
  position: relative;
  width: 18px;
  height: 14px;
  border: 1px solid var(--control-border-hover);
  border-radius: 2px;
}

.corner::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
}

.corner-tl::after { top: 2px; left: 2px; }
.corner-tr::after { top: 2px; right: 2px; }
.corner-bl::after { bottom: 2px; left: 2px; }
.corner-br::after { right: 2px; bottom: 2px; }

.control-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(140px, 1.2fr);
  gap: 24px;
}

.swatches {
  display: flex;
  gap: 10px;
}

.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--white);
}

.swatch.is-selected {
  box-shadow: inset 0 0 0 3px var(--white), 0 0 0 2px var(--blue);
}

.swatch-black { background: #101820; }
.swatch-gray { background: #77818a; }
.swatch-white { background: #fff; }

.opacity-control .legend-row legend {
  margin-bottom: 11px;
}

.action-stack {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--on-lime);
  box-shadow: inset 0 0 0 1px rgba(18, 32, 47, 0.14);
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  background: #d6ff83;
}

.primary-button:disabled {
  cursor: not-allowed;
  background: var(--disabled-bg);
  color: var(--disabled-text);
}

.primary-button svg {
  width: 20px;
  height: 20px;
}

.stage-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 30px;
  background: var(--stage-panel-bg);
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.stage-toolbar {
  padding-bottom: 20px;
}

.stage-toolbar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-title {
  display: inline-block;
}

.text-button {
  padding: 6px 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
}

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

.dropzone {
  min-height: 520px;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1.5px dashed var(--drop-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 30%, var(--lime-glow), transparent 36%),
    var(--stage);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone.is-dragging {
  border-color: var(--blue);
  background: var(--drag-bg);
  transform: scale(0.995);
}

.upload-state {
  width: min(420px, calc(100% - 40px));
  padding: 40px 24px;
  text-align: center;
}

.upload-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 9px 24px var(--compact-shadow);
}

.upload-icon svg {
  width: 32px;
  height: 32px;
}

.upload-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.upload-state > p:nth-of-type(2) {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.secondary-button {
  min-height: 44px;
  padding: 10px 19px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
}

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

.file-limit {
  display: block;
  margin-top: 14px;
  color: var(--subtle-text);
  font-size: 11px;
}

.preview-state {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-frame {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#preview-canvas {
  display: block;
  max-width: 100%;
  max-height: min(540px, 62vh);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 15px 40px var(--preview-shadow);
}

.site-footer {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 16px;
  color: var(--subtle-text);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}

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

.legal-link::before {
  content: "·";
  margin-right: 16px;
  color: var(--line-strong);
  text-decoration: none;
}

body.is-modal-open {
  overflow: hidden;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.legal-modal[hidden] {
  display: none;
}

.legal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 20, 0.58);
  backdrop-filter: blur(5px);
}

.legal-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--control-bg);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.3);
  outline: none;
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--control-bg) 92%, transparent);
  backdrop-filter: blur(14px);
}

.legal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.legal-header p {
  margin: 7px 0 0;
  color: var(--subtle-text);
  font-size: 12px;
}

.legal-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft-bg);
  color: var(--ink);
  cursor: pointer;
}

.legal-close:hover {
  background: var(--soft-bg-hover);
}

.legal-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.legal-content {
  padding: 30px;
}

.legal-content section + section {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.legal-content h3,
.legal-content h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.legal-content h3 {
  margin: 0 0 16px;
  font-size: 21px;
}

.legal-content h4 {
  margin: 25px 0 7px;
  font-size: 15px;
}

.legal-content p,
.legal-content address {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.65;
}

.legal-content address {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft-bg);
  color: var(--ink);
}

.legal-content a {
  color: var(--blue);
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 360px;
  padding: 13px 17px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 15px 40px rgba(18, 32, 47, 0.24);
  font-size: 14px;
  font-weight: 650;
}

.toast.is-error {
  background: var(--danger);
}

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

  .editor-shell {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .controls,
  .stage-panel {
    padding: 24px;
  }
}

@media (max-width: 820px) {
  .workspace {
    width: min(100% - 24px, 680px);
    padding-top: 36px;
  }

  .tool-intro {
    display: block;
    margin-bottom: 26px;
  }

  .tool-intro h1 {
    margin-bottom: 18px;
  }

  .editor-shell {
    grid-template-columns: 1fr;
  }

  .stage-panel {
    order: -1;
    border-bottom: 1px solid var(--line);
  }

  .controls {
    border-right: 0;
  }

  .stage-panel {
    min-height: 600px;
  }

  .dropzone {
    min-height: 470px;
  }

}

@media (max-width: 560px) {
  .topbar {
    min-height: 64px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px 16px;
  }

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

  .topbar-actions {
    gap: 8px;
  }

  .theme-toggle,
  .language-switcher {
    min-height: 44px;
  }

  .theme-toggle {
    gap: 7px;
    padding: 6px 8px 6px 10px;
  }

  #language-select {
    min-height: 42px;
    width: 118px;
    padding-right: 32px;
    padding-left: 36px;
    font-size: 13px;
  }

  .language-icon {
    left: 12px;
  }

  .select-chevron {
    right: 10px;
  }

  .workspace {
    width: min(100% - 16px, 520px);
    padding: 28px 0;
  }

  .site-footer {
    width: min(100% - 24px, 520px);
    padding-bottom: 24px;
    flex-direction: column;
  }

  .legal-link::before {
    content: none;
  }

  .legal-modal {
    align-items: end;
    padding: 12px;
  }

  .legal-dialog {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .legal-header {
    padding: 22px 20px 18px;
  }

  .legal-content {
    padding: 24px 20px;
  }

  .tool-intro h1 {
    font-size: 44px;
  }

  .tool-intro > p:last-child {
    font-size: 16px;
  }

  .editor-shell {
    border-radius: 18px;
  }

  .controls,
  .stage-panel {
    padding: 20px;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .dropzone {
    min-height: 390px;
  }

  .preview-state {
    padding: 12px;
  }

  .image-frame {
    min-height: 0;
  }

  .info-popover {
    width: min(320px, calc(100vw - 56px));
  }
}

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