:root {
  --bg: #ffffff;
  --panel: rgba(246, 246, 248, 0.58);
  --panel-soft: rgba(255, 255, 255, 0.46);
  --panel-solid: rgba(255, 255, 255, 0.82);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --line-strong: rgba(60, 60, 67, 0.30);
  --input: rgba(255, 255, 255, 0.72);
  --primary: #007aff;
  --primary-hover: #006ee6;
  --accent: #bf5b00;
  --danger: #d70015;
  --success: #248a3d;
  --glass-highlight: rgba(255, 255, 255, 0.96);
  --glass-shadow: rgba(0, 0, 0, 0.10);
  --shadow: 0 14px 42px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 -1px 0 rgba(0, 0, 0, 0.07);
  --radius: 26px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #09090b;
  --panel: rgba(35, 35, 39, 0.56);
  --panel-soft: rgba(52, 52, 57, 0.38);
  --panel-solid: rgba(48, 48, 52, 0.82);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.26);
  --input: rgba(20, 20, 23, 0.42);
  --primary: #0a84ff;
  --primary-hover: #409cff;
  --accent: #ff9f0a;
  --danger: #ff453a;
  --success: #30d158;
  --glass-highlight: rgba(255, 255, 255, 0.20);
  --glass-shadow: rgba(0, 0, 0, 0.38);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.20);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: #ffffff;
  background-attachment: fixed;
  isolation: isolate;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 38vw;
  height: 38vw;
  min-width: 320px;
  min-height: 320px;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0;
}

body::before {
  top: 14%;
  left: -14vw;
  background: radial-gradient(circle, rgba(85, 215, 255, 0.46), transparent 68%);
}

body::after {
  right: -16vw;
  bottom: -12%;
  background: radial-gradient(circle, rgba(155, 103, 255, 0.42), transparent 68%);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 16%, rgba(0, 122, 255, 0.30), transparent 32rem),
    radial-gradient(circle at 88% 18%, rgba(94, 92, 230, 0.24), transparent 34rem),
    linear-gradient(145deg, #050507, var(--bg));
}

[data-theme="dark"] body::before,
[data-theme="dark"] body::after {
  opacity: 0.42;
}

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

button {
  border: 0;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 66%, transparent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
}

.topbar-inner {
  width: 100%;
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-name {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.mode-chip {
  display: inline-flex;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: linear-gradient(145deg, var(--glass-highlight), var(--panel-soft));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(16px) saturate(160%);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-moon {
  display: none;
}

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

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

.workspace {
  width: 100%;
  min-height: calc(100dvh - 116px);
  margin: 0 auto;
  padding: 20px 20px 14px;
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(420px, 1fr) minmax(248px, 300px);
  gap: 20px;
}

.panel {
  position: relative;
  background:
    linear-gradient(145deg, var(--glass-highlight), transparent 32%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
}

.controls-panel {
  padding: 20px;
  height: calc(100dvh - 104px);
  align-self: start;
  overflow: auto;
}

.output-panel {
  padding: 20px;
  height: calc(100dvh - 104px);
  min-height: 620px;
  align-self: start;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.examples-panel {
  height: calc(100dvh - 104px);
  min-height: 620px;
  padding: 16px;
  align-self: start;
  overflow: auto;
}

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

.examples-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.examples-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.examples-count {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel-solid));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.example-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.example-card {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #ffffff;
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 22px var(--glass-shadow);
  cursor: pointer;
  text-align: left;
  isolation: isolate;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.example-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--glass-shadow);
}

.example-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 50%, transparent);
  outline-offset: 2px;
}

.example-card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 300ms ease;
}

.example-card:hover .example-card-image {
  transform: scale(1.045);
}

.example-card-caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: grid;
  gap: 1px;
  padding: 22px 9px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.example-card-category {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.example-card-title {
  overflow: hidden;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1181px) {
  body[data-mode="image"] .output-panel {
    grid-column: 2 / -1;
  }
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  box-shadow: inset 0 1px 5px rgba(22, 33, 58, 0.08), 0 1px 0 var(--glass-highlight);
}

.mode-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.mode-tab svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.mode-tab.active {
  color: var(--text);
  background: linear-gradient(145deg, var(--panel-solid), var(--panel-soft));
  border: 1px solid var(--line);
  box-shadow: 0 5px 16px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.field-group {
  margin-bottom: 14px;
}

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

label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.label-row label {
  margin-bottom: 0;
}

.label-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.range-value {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel-solid));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 999px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.char-counter {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.char-counter.warn {
  color: var(--accent);
}

.char-counter.over {
  color: var(--danger);
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  min-height: 142px;
  resize: vertical;
}

select {
  cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  background: var(--panel-solid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent), inset 0 1px 0 var(--glass-highlight);
}

input.image-count-range {
  --range-progress: 0%;
  width: 100%;
  height: 22px;
  min-height: 22px;
  margin: 3px 0 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--primary) 0 var(--range-progress),
    var(--line-strong) var(--range-progress) 100%
  );
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 6px;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
}

input.image-count-range:focus {
  background-color: transparent;
  box-shadow: none;
}

input.image-count-range:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
  outline-offset: 3px;
}

.image-count-range::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border-radius: 999px;
}

.image-count-range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  border: 1px solid rgba(60, 60, 67, 0.22);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), inset 0 1px 0 #ffffff;
}

.image-count-range::-moz-range-track {
  height: 6px;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.image-count-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 1px solid rgba(60, 60, 67, 0.22);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), inset 0 1px 0 #ffffff;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

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

.source-field {
  margin-bottom: 16px;
}

.upload-zone {
  width: 100%;
  min-height: 116px;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: linear-gradient(145deg, var(--panel-soft), transparent);
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.upload-zone input {
  display: none;
}

.upload-zone:hover,
.upload-zone.dragging {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel-soft));
}

.upload-zone.has-source {
  border-style: solid;
  background: #000;
}

.upload-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 760;
}

.upload-empty svg {
  width: 18px;
  height: 18px;
}

.source-preview {
  width: 100%;
  height: 100%;
  min-height: 116px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 1px;
  background: #05070a;
}

.source-preview img {
  width: 100%;
  height: 116px;
  object-fit: contain;
}

.text-btn {
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.text-btn:not(:disabled):hover {
  color: var(--danger);
}

.text-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.ratio-btn {
  height: 34px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 var(--glass-highlight);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ratio-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.ratio-btn.active {
  color: #ffffff;
  background: linear-gradient(180deg, #2997ff, var(--primary));
  border-color: var(--primary);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 780;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  color: #ffffff;
  background: linear-gradient(180deg, #2997ff, var(--primary));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary) 36%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.primary-btn:not(:disabled):hover {
  background: linear-gradient(180deg, #47a5ff, var(--primary-hover));
  transform: translateY(-1px);
  box-shadow: 0 18px 38px color-mix(in srgb, var(--primary) 44%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.primary-btn:disabled {
  opacity: 0.62;
  cursor: wait;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.secondary-btn {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--text);
  background: linear-gradient(145deg, var(--glass-highlight), var(--panel-soft));
  border: 1px solid var(--line);
  font-size: 13px;
  box-shadow: 0 7px 18px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(14px);
}

.secondary-btn svg {
  width: 16px;
  height: 16px;
}

.secondary-btn:not(:disabled):hover {
  color: var(--primary);
  border-color: var(--primary);
}

.secondary-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}

.output-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.output-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.preview-grid {
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--panel-soft) 85%, #000) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--panel-soft) 85%, #000) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--panel-soft) 85%, #000) 75%),
    linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--panel-soft) 85%, #000) 75%),
    color-mix(in srgb, var(--panel-soft) 82%, transparent);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: inset 0 1px 16px rgba(25, 38, 67, 0.08), 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(12px);
}

.preview-grid.has-image {
  padding: 10px;
}

.preview-grid.multi-image {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  place-items: stretch;
  gap: 10px;
}

.preview-grid.multi-image .image-tile:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.placeholder-icon {
  width: 56px;
  height: 56px;
  opacity: 0.42;
}

.image-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05070a;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 18px 45px var(--glass-shadow);
}

.image-tile img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.tile-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 160ms ease;
}

.image-tile:hover .tile-footer,
.image-tile:focus-within .tile-footer {
  opacity: 1;
}

.tile-footer span {
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.tile-download {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 6px;
  cursor: pointer;
}

.tile-download:hover {
  background: rgba(255, 255, 255, 0.24);
}

.tile-download svg {
  width: 16px;
  height: 16px;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: min(360px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(170%);
  pointer-events: auto;
  font-size: 13px;
  font-weight: 650;
  animation: toast-in 180ms ease both;
}

.toast-success {
  background: #065f46;
  color: #ecfdf5;
}

.toast-error {
  background: #7f1d1d;
  color: #fef2f2;
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.toast.fade-out {
  animation: toast-out 180ms ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.footer {
  width: 100%;
  min-height: 38px;
  margin: 0 auto;
  padding: 0 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  text-shadow: 0 1px 12px color-mix(in srgb, var(--bg) 80%, transparent);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

  .controls-panel {
    height: 560px;
    max-height: none;
  }

  .output-panel {
    height: 560px;
    min-height: 0;
  }

  .examples-panel {
    grid-column: 1 / -1;
    height: auto;
    min-height: 0;
  }

  .example-prompts {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar-inner,
  .workspace,
  .footer {
    width: 100%;
  }

  .workspace {
    padding: 12px 12px 14px;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    height: 58px;
    padding: 0 12px;
  }

  .footer {
    padding: 0 12px 12px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 14px;
  }

  .mode-chip {
    font-size: 11px;
  }

  .panel,
  .controls-panel,
  .output-panel {
    padding: 12px;
  }

  .controls-panel {
    height: auto;
  }

  .mode-tabs,
  .row,
  .row-3 {
    grid-template-columns: 1fr;
  }

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

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

  .output-head {
    align-items: stretch;
    flex-direction: column;
  }

  .output-actions {
    width: 100%;
  }

  .secondary-btn {
    flex: 1;
  }

  .output-panel {
    height: 470px;
    min-height: 0;
  }
}

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

  .output-head h1 {
    font-size: 19px;
  }
}

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