:root {
  --bg: #fff4d7;
  --bg-2: #ffd56b;
  --ink: #111111;
  --ink-soft: rgba(17, 17, 17, 0.72);
  --accent: #ff5a36;
  --accent-2: #13b8a6;
  --accent-3: #ffcb3d;
  --accent-4: #ff87b6;
  --card: rgba(255, 249, 239, 0.94);
  --line: rgba(17, 17, 17, 0.1);
  --shadow: 0 24px 70px rgba(17, 17, 17, 0.14);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 90, 54, 0.2), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(19, 184, 166, 0.18), transparent 22%),
    radial-gradient(circle at 70% 88%, rgba(255, 135, 182, 0.18), transparent 20%),
    linear-gradient(135deg, var(--bg), #ffe7b2 45%, #fff6e7);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 90, 54, 0.18), rgba(255, 203, 61, 0.14) 40%, rgba(19, 184, 166, 0.18)),
    var(--card);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 260px;
  height: 260px;
  top: -90px;
  right: -60px;
  background: rgba(255, 90, 54, 0.14);
}

.hero::after {
  width: 180px;
  height: 180px;
  left: -40px;
  bottom: -80px;
  background: rgba(19, 184, 166, 0.12);
}

.hero-copy,
.hero-side {
  position: relative;
  z-index: 1;
}

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

.eyebrow {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  font-family: "Fredoka", sans-serif;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-family: "Fredoka", "Noto Sans SC", sans-serif;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  word-break: keep-all;
}

h2 {
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.intro {
  max-width: 640px;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.intro-note {
  max-width: 640px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(17, 17, 17, 0.58);
}

.intro-note-strong {
  font-weight: 900;
}

.intro-note-playful {
  color: #d84c23;
}

.intro-note-realistic {
  color: #0d8d83;
}

.workflow-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.workflow-chip {
  position: relative;
  display: block;
  min-width: 0;
}

.workflow-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.workflow-chip-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 2px solid transparent;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
  cursor: pointer;
}

.workflow-chip-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.workflow-chip-playful .workflow-chip-copy {
  color: #fff6ed;
  background:
    linear-gradient(145deg, #ff622d 0%, #ff7d2f 42%, #ffb53d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 22px rgba(255, 90, 54, 0.2);
}

.workflow-chip-realistic .workflow-chip-copy {
  color: #eefcff;
  background:
    linear-gradient(145deg, #117e85 0%, #11a4a8 42%, #38bed5 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 22px rgba(19, 184, 166, 0.2);
}

.workflow-chip-copy strong {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 10px rgba(17, 17, 17, 0.16);
}

.workflow-chip-copy small {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.84);
}

.workflow-chip:hover .workflow-chip-copy {
  transform: translateY(-1px);
}

.workflow-chip input:focus-visible + .workflow-chip-copy {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.78),
    0 0 0 8px rgba(17, 17, 17, 0.12);
}

.workflow-chip input:not(:checked) + .workflow-chip-copy {
  opacity: 0.5;
  filter: saturate(0.68) brightness(0.9);
  transform: scale(0.97);
}

.workflow-chip-playful input:checked + .workflow-chip-copy {
  opacity: 1;
  border-color: rgba(255, 248, 239, 0.98);
  transform: translateY(-3px) scale(1.03);
  filter: saturate(1.08) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 0 4px rgba(255, 255, 255, 0.72),
    0 0 0 8px rgba(255, 90, 54, 0.28),
    0 20px 40px rgba(255, 90, 54, 0.34);
}

.workflow-chip-realistic input:checked + .workflow-chip-copy {
  opacity: 1;
  border-color: rgba(244, 254, 255, 0.98);
  transform: translateY(-3px) scale(1.03);
  filter: saturate(1.08) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(255, 255, 255, 0.72),
    0 0 0 8px rgba(19, 184, 166, 0.24),
    0 20px 40px rgba(19, 184, 166, 0.32);
}

.workflow-chip input:checked + .workflow-chip-copy::before {
  opacity: 1;
}

.panel {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  align-items: stretch;
}

.workspace > .panel {
  margin-top: 0;
}

.top-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.top-grid > .panel {
  margin-top: 0;
}

.showcase-panel {
  margin-top: 0;
  margin-bottom: 12px;
}

.showcase-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.showcase-label {
  margin: 0 0 4px;
  font-family: "Fredoka", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(17, 17, 17, 0.46);
}

.showcase-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.showcase-rail[data-loading="true"] {
  opacity: 0.72;
}

.showcase-card {
  margin: 0;
  flex: 0 0 clamp(228px, 24vw, 288px);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.07);
  scroll-snap-align: start;
}

.showcase-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.showcase-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(17, 17, 17, 0.05);
}

.image-model-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.84), rgba(17, 17, 17, 0.68));
  color: rgba(255, 248, 239, 0.96);
  font-family: "Fredoka", "Noto Sans SC", sans-serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.2);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.image-model-badge-preview {
  top: 14px;
  left: 14px;
  z-index: 3;
}

.image-model-badge-showcase {
  top: 10px;
  left: 10px;
  z-index: 1;
  min-height: 24px;
  padding: 5px 9px;
  font-size: 11px;
}

.showcase-card-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.showcase-card-prompt {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(17, 17, 17, 0.82);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 65px;
}

.showcase-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.showcase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.showcase-pill-neutral {
  background: rgba(17, 17, 17, 0.07);
  color: rgba(17, 17, 17, 0.72);
}

.showcase-pill-playful {
  background: rgba(255, 90, 54, 0.14);
  color: rgba(187, 57, 25, 0.96);
}

.showcase-pill-realistic {
  background: rgba(19, 184, 166, 0.14);
  color: rgba(0, 118, 106, 0.96);
}

.showcase-pill-cursed {
  background: rgba(255, 203, 61, 0.22);
  color: rgba(129, 87, 0, 0.96);
}

.showcase-pill-warning {
  background: rgba(198, 40, 40, 0.12);
  color: rgba(154, 18, 18, 0.92);
}

.showcase-card-footnote {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(17, 17, 17, 0.48);
}

.showcase-empty {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(17, 17, 17, 0.14);
  background: rgba(255, 255, 255, 0.58);
  color: rgba(17, 17, 17, 0.56);
}

.hero .hero-copy {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.composer,
.preview,
.history-panel {
  border-width: 1.5px;
}

.composer {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.input-stack {
  display: grid;
  gap: 12px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 800;
  color: rgba(17, 17, 17, 0.78);
}

.preview {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.history-panel {
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 124px;
  border: 2px solid rgba(17, 17, 17, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

textarea:focus {
  border-color: rgba(255, 90, 54, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.14);
}

.prompt-output[readonly] {
  background: rgba(255, 248, 231, 0.96);
  color: rgba(17, 17, 17, 0.82);
  cursor: text;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  align-items: center;
  justify-content: flex-start;
}

.mode-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.04);
  border: 1px solid rgba(17, 17, 17, 0.08);
  cursor: pointer;
}

.action-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.inline-toggle {
  width: auto;
  min-height: 46px;
  padding: 0 12px;
  margin-top: 0;
  background: rgba(17, 17, 17, 0.06);
  flex: 0 0 112px;
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.inline-toggle span {
  font-size: 13px;
  white-space: nowrap;
}

.mode-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.mode-toggle span {
  font-weight: 800;
  color: var(--ink);
  display: inline-block;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, background 180ms ease;
}

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

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--ink), #2a2a2a);
  color: #fff7ef;
  box-shadow: 0 14px 32px rgba(17, 17, 17, 0.22);
  flex-shrink: 0;
  min-width: 128px;
}

.button.secondary {
  background: linear-gradient(135deg, var(--accent), #ff8356);
  color: white;
  box-shadow: 0 14px 30px rgba(255, 90, 54, 0.26);
  min-width: 170px;
}

.button.ghost {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: none;
}

.status {
  margin: 0;
  color: var(--ink-soft);
}

.status-stack {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.progress-block {
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(17, 17, 17, 0.04);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.09);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--accent), var(--accent-3) 45%, var(--accent-2));
  transition: width 280ms ease;
}

.status-card {
  margin-top: 8px;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(17, 17, 17, 0.05);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.status-card .status {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.timing-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.timing-pill {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.timing-label {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(17, 17, 17, 0.52);
  white-space: nowrap;
}

.timing-value {
  font-family: "Fredoka", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(17, 17, 17, 0.88);
  text-align: right;
}

.timing-value[data-state="idle"] {
  color: rgba(17, 17, 17, 0.42);
}

.timing-value[data-state="pending"] {
  color: rgba(17, 17, 17, 0.56);
}

.timing-value[data-state="done"] {
  color: rgba(17, 17, 17, 0.9);
}

.timing-value[data-state="error"] {
  color: #c62828;
}

.status-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.preview-shell,
.history-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-toolbar,
.history-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.preview-label,
.history-label {
  margin: 0 0 4px;
  font-family: "Fredoka", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(17, 17, 17, 0.46);
}

.history-count {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(17, 17, 17, 0.52);
  text-align: right;
}

.preview-stage {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 300px;
  border-radius: 24px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    radial-gradient(circle at top left, rgba(255, 90, 54, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(19, 184, 166, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 215, 0.94));
}

.empty-state,
.preview-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.empty-card,
.preview-loading-card {
  width: min(320px, 100%);
  padding: 22px 18px;
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow: 0 18px 46px rgba(17, 17, 17, 0.08);
}

.empty-copy {
  margin-top: 14px;
}

.empty-copy strong,
.preview-loading-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.empty-copy p,
.preview-loading-card p {
  max-width: 240px;
  margin: 8px auto 0;
  line-height: 1.5;
  font-size: 14px;
  color: rgba(17, 17, 17, 0.56);
}

.empty-illustration {
  position: relative;
  width: 84px;
  height: 60px;
  margin: 0 auto;
}

.empty-illustration span {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.empty-illustration span:nth-child(1) {
  width: 54px;
  height: 54px;
  left: 0;
  top: 0;
  background: rgba(255, 90, 54, 0.22);
}

.empty-illustration span:nth-child(2) {
  width: 42px;
  height: 42px;
  right: 0;
  top: 10px;
  background: rgba(19, 184, 166, 0.22);
}

.empty-illustration span:nth-child(3) {
  width: 34px;
  height: 34px;
  left: 30px;
  bottom: -4px;
  background: rgba(255, 203, 61, 0.32);
}

#resultImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.74);
  cursor: zoom-in;
}

.preview-loading {
  background: rgba(255, 244, 215, 0.82);
  backdrop-filter: blur(6px);
  z-index: 2;
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 50%;
  border: 5px solid rgba(17, 17, 17, 0.1);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 900ms linear infinite;
}

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

.history-list-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(255, 255, 255, 0.4);
  padding: 10px;
}

.history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  align-content: start;
  overflow: auto;
  max-height: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.history li {
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 17, 17, 0.08);
  line-height: 1.55;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.05);
}

.history-empty {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 120px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(17, 17, 17, 0.1);
  color: rgba(17, 17, 17, 0.5);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.site-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 8px 0 0;
  font-size: 13px;
  color: rgba(17, 17, 17, 0.58);
  flex-wrap: wrap;
  text-align: center;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.image-modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.image-modal::backdrop {
  background: rgba(17, 17, 17, 0.8);
  backdrop-filter: blur(4px);
}

.image-modal-shell {
  position: relative;
  width: min(1100px, calc(100vw - 24px));
  margin: 0 auto;
}

#modalImage {
  display: block;
  width: 100%;
  max-height: calc(100vh - 24px);
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(17, 17, 17, 0.78);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 960px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

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

  .showcase-card {
    flex-basis: clamp(220px, 44vw, 280px);
  }

  .hero {
    display: block;
  }

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

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 14px;
    padding-bottom: 28px;
  }

  .panel {
    border-radius: 22px;
    padding: 16px;
  }

  .showcase-head {
    flex-direction: column;
    align-items: start;
  }

  .showcase-card {
    flex-basis: min(80vw, 260px);
  }

  .preview-head {
    flex-direction: column;
  }

  h1 {
    font-size: clamp(32px, 10vw, 42px);
    white-space: normal;
  }

  .intro {
    font-size: 14px;
  }

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

  .button {
    width: 100%;
    justify-content: center;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .action-cluster {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .action-cluster .button,
  .action-cluster .inline-toggle {
    width: auto;
  }

  .action-cluster .button.secondary {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .inline-toggle {
    width: 118px;
    min-width: 118px;
    flex: 0 0 118px;
    padding: 0 10px;
  }

  .inline-toggle span {
    font-size: 12px;
  }

  .mode-toggle {
    grid-template-columns: auto 1fr;
  }

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

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

  textarea {
    min-height: 94px;
    padding: 14px 16px;
    font-size: 15px;
  }

  .preview-stage {
    min-height: 260px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .button,
  .progress-bar,
  .spinner {
    transition: none;
    animation: none;
  }
}
