:root {
  --bg: #031018;
  --bg-deep: #01080d;
  --surface: rgba(8, 25, 36, 0.88);
  --surface-soft: rgba(9, 32, 45, 0.76);
  --border: rgba(46, 203, 244, 0.2);
  --border-strong: rgba(126, 247, 255, 0.36);
  --text: #e8fbff;
  --muted: #8eb7c5;
  --brand: #08b6e8;
  --brand-deep: #0b7da7;
  --brand-bright: #7ef7ff;
  --success: #28d29c;
  --error: #ff7f7f;
  --shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Lexend", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --page-bg:
    radial-gradient(circle at 0% 0%, rgba(8, 182, 232, 0.22), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(11, 125, 167, 0.24), transparent 18%),
    linear-gradient(180deg, #06141d 0%, #031018 46%, #01080d 100%);
  --page-grid:
    linear-gradient(60deg, rgba(126, 247, 255, 0.055) 1px, transparent 1px),
    linear-gradient(-60deg, rgba(126, 247, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(126, 247, 255, 0.02) 1px, transparent 1px);
  --page-grid-mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 88%);
  --panel-bg: linear-gradient(180deg, rgba(9, 31, 44, 0.94), rgba(4, 16, 24, 0.9));
  --panel-highlight: linear-gradient(135deg, rgba(126, 247, 255, 0.08), transparent 34%, transparent 70%, rgba(8, 182, 232, 0.06));
  --pill-border: rgba(126, 247, 255, 0.24);
  --pill-bg: rgba(7, 43, 60, 0.68);
  --input-bg: rgba(2, 12, 18, 0.74);
  --input-bg-focus: rgba(2, 14, 22, 0.84);
  --toggle-bg: rgba(5, 19, 28, 0.58);
  --code-bg: rgba(1, 9, 14, 0.9);
  --empty-bg: linear-gradient(180deg, rgba(7, 23, 33, 0.72), rgba(3, 12, 18, 0.94));
  --card-bg: linear-gradient(180deg, rgba(7, 24, 34, 0.96), rgba(4, 12, 18, 0.94));
  --card-stage-bg:
    radial-gradient(circle at top, rgba(8, 182, 232, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(4, 18, 26, 0.84), rgba(1, 8, 12, 0.96));
  --mesh-bg:
    radial-gradient(circle at top right, rgba(126, 247, 255, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(7, 28, 40, 0.96), rgba(5, 18, 26, 0.92));
  --mesh-grid:
    linear-gradient(60deg, rgba(8, 182, 232, 0.15) 2px, transparent 2px),
    linear-gradient(-60deg, rgba(8, 182, 232, 0.12) 2px, transparent 2px),
    linear-gradient(0deg, rgba(126, 247, 255, 0.06) 2px, transparent 2px);
  --mesh-orb: radial-gradient(circle, rgba(8, 182, 232, 0.28), transparent 65%);
  --stats-bg: rgba(4, 16, 24, 0.58);
  --link-border: rgba(126, 247, 255, 0.24);
  --ghost-bg: rgba(255, 255, 255, 0.03);
  --ghost-border: rgba(142, 183, 197, 0.14);
  --secondary-bg: rgba(8, 182, 232, 0.12);
  --secondary-border: rgba(126, 247, 255, 0.24);
  --focus-ring: 0 0 0 4px rgba(8, 182, 232, 0.16);
  --title-shadow: 0 0 26px rgba(8, 182, 232, 0.18);
  --theme-toggle-bg: rgba(6, 28, 39, 0.82);
  --theme-toggle-border: rgba(126, 247, 255, 0.26);
  --theme-toggle-hover: rgba(10, 46, 62, 0.96);
  --theme-toggle-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

:root[data-theme="light"] {
  --bg: #dff5fb;
  --bg-deep: #f8fdff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-soft: rgba(239, 251, 255, 0.88);
  --border: rgba(11, 125, 167, 0.16);
  --border-strong: rgba(8, 182, 232, 0.3);
  --text: #0a2b38;
  --muted: #557989;
  --brand: #08b6e8;
  --brand-deep: #0b7da7;
  --brand-bright: #0f8fc0;
  --shadow: 0 24px 56px rgba(10, 54, 72, 0.12);
  --page-bg:
    radial-gradient(circle at 0% 0%, rgba(8, 182, 232, 0.12), transparent 22%),
    radial-gradient(circle at 100% 0%, rgba(11, 125, 167, 0.1), transparent 20%),
    linear-gradient(180deg, #f7fdff 0%, #ebf9ff 44%, #dff5fb 100%);
  --page-grid:
    linear-gradient(60deg, rgba(8, 182, 232, 0.06) 1px, transparent 1px),
    linear-gradient(-60deg, rgba(8, 182, 232, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(8, 182, 232, 0.03) 1px, transparent 1px);
  --page-grid-mask: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 88%);
  --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(236, 249, 255, 0.92));
  --panel-highlight: linear-gradient(135deg, rgba(8, 182, 232, 0.08), transparent 34%, transparent 70%, rgba(8, 182, 232, 0.04));
  --pill-border: rgba(8, 182, 232, 0.18);
  --pill-bg: rgba(235, 249, 255, 0.84);
  --input-bg: rgba(255, 255, 255, 0.92);
  --input-bg-focus: rgba(255, 255, 255, 0.98);
  --toggle-bg: rgba(240, 251, 255, 0.94);
  --code-bg: rgba(245, 252, 255, 0.95);
  --empty-bg: linear-gradient(180deg, rgba(248, 253, 255, 0.96), rgba(234, 249, 255, 0.94));
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 250, 255, 0.94));
  --card-stage-bg:
    radial-gradient(circle at top, rgba(8, 182, 232, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(244, 252, 255, 0.96), rgba(233, 248, 255, 0.96));
  --mesh-bg:
    radial-gradient(circle at top right, rgba(126, 247, 255, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 249, 255, 0.92));
  --mesh-grid:
    linear-gradient(60deg, rgba(8, 182, 232, 0.12) 2px, transparent 2px),
    linear-gradient(-60deg, rgba(8, 182, 232, 0.08) 2px, transparent 2px),
    linear-gradient(0deg, rgba(8, 182, 232, 0.05) 2px, transparent 2px);
  --mesh-orb: radial-gradient(circle, rgba(8, 182, 232, 0.18), transparent 65%);
  --stats-bg: rgba(243, 252, 255, 0.94);
  --link-border: rgba(8, 182, 232, 0.22);
  --ghost-bg: rgba(255, 255, 255, 0.72);
  --ghost-border: rgba(85, 121, 137, 0.16);
  --secondary-bg: rgba(8, 182, 232, 0.08);
  --secondary-border: rgba(8, 182, 232, 0.18);
  --focus-ring: 0 0 0 4px rgba(8, 182, 232, 0.14);
  --title-shadow: 0 0 18px rgba(8, 182, 232, 0.12);
  --theme-toggle-bg: rgba(255, 255, 255, 0.94);
  --theme-toggle-border: rgba(8, 182, 232, 0.18);
  --theme-toggle-hover: rgba(238, 250, 255, 0.98);
  --theme-toggle-shadow: 0 16px 32px rgba(11, 125, 167, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--page-grid);
  background-size: 120px 104px;
  mask-image: var(--page-grid-mask);
  opacity: 0.95;
}

a {
  color: inherit;
}

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

.page-shell {
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
  position: relative;
  z-index: 1;
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--panel-highlight);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(122px, 12vw, 168px);
  gap: 2rem;
  padding: 1.75rem;
  align-items: start;
}

.hero-copy,
.hero-visual,
.control-card,
.status-card,
.logs-card,
.results-panel {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
  padding: 0.25rem 0;
  min-width: 0;
}

.page-topbar {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 30;
  margin: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--text);
  box-shadow: var(--theme-toggle-shadow);
  backdrop-filter: blur(14px);
}

.theme-toggle:hover:not(:disabled) {
  background: var(--theme-toggle-hover);
}

.theme-toggle__icon {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  color: var(--brand-deep);
  flex-shrink: 0;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

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

.eyebrow-row,
.hero-actions,
.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.eyebrow,
.hero-pill,
.mesh-kicker,
.section-kicker,
.control-card legend {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 800;
}

.eyebrow,
.mesh-kicker,
.section-kicker,
.control-card legend {
  color: var(--brand-bright);
}

.hero-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.575rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.text-link {
  text-decoration: none;
  border-bottom: 1px solid var(--link-border);
  padding-bottom: 0.16rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  color: var(--brand-bright);
  border-color: var(--brand-bright);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-primary {
  color: #02212c;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  box-shadow: 0 18px 36px rgba(8, 182, 232, 0.24);
}

.btn-secondary {
  color: var(--text);
  background: var(--secondary-bg);
  border: 1px solid var(--secondary-border);
}

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

.hero-visual {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  align-self: stretch;
}

.hero-logo-strip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.9rem;
  width: 100%;
  min-height: 100%;
  padding-top: 0.15rem;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: 168px;
  max-height: 76px;
  height: auto;
  object-fit: contain;
}

.mesh-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(126, 247, 255, 0.22);
  background: var(--mesh-bg);
  overflow: hidden;
}

.mesh-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mesh-grid);
  background-size: 96px 84px;
  opacity: 0.56;
  mix-blend-mode: screen;
}

.mesh-card::after {
  content: "";
  position: absolute;
  right: -14%;
  bottom: -26%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--mesh-orb);
  filter: blur(12px);
}

.mesh-card > * {
  position: relative;
  z-index: 1;
}

.mesh-wordmark {
  margin-top: 0.25rem;
  max-width: 5.2ch;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.6rem);
  line-height: 0.88;
  letter-spacing: -0.08em;
  color: transparent;
  background: linear-gradient(135deg, #7ef7ff 0%, #1dc9f0 34%, #0f89b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: var(--title-shadow);
}

.mesh-card p {
  margin: 0;
  max-width: 28ch;
  color: rgba(232, 251, 255, 0.74);
}

.swatch-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.swatch {
  width: 50px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.visual-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.visual-stats div {
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: var(--stats-bg);
}

.visual-stats strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.visual-stats span {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.content-stack {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.5rem;
  align-items: stretch;
}

.config-column {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.5rem;
  min-height: 100%;
}

.support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.control-card,
.status-card,
.logs-card,
.results-panel {
  padding: 1.4rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
}

.section-header h2 {
  margin: 0.18rem 0 0;
  font-size: 1.32rem;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.section-kicker {
  display: block;
  margin-bottom: 0.1rem;
}

.section-note,
.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

fieldset {
  min-width: 0;
  margin: 0;
}

.control-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.output-card {
  justify-content: flex-start;
}

.control-card legend {
  padding: 0 0.55rem;
}

.control-card label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.control-card input[type="text"],
.control-card input[type="number"],
.control-card input[type="file"],
.control-card textarea,
.control-card select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.control-card textarea {
  min-height: 120px;
  resize: vertical;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.control-card input:focus,
.control-card textarea:focus,
.control-card select:focus {
  border-color: rgba(126, 247, 255, 0.62);
  box-shadow: var(--focus-ring);
  background: var(--input-bg-focus);
}

.control-card input[type="file"] {
  padding: 0.75rem;
}

.control-card input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  accent-color: var(--brand);
}

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

.field-group--full {
  grid-column: 1 / -1;
}

.small {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.toggle-grid {
  display: grid;
  gap: 0.9rem;
}

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

.inline-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: var(--toggle-bg);
}

.inline-toggle__content {
  flex: 1;
}

.inline-toggle__title {
  display: block;
  font-weight: 800;
}

.inline-toggle small {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.hero-status {
  margin-top: -0.15rem;
  min-height: 1.45em;
}

.status-pill {
  min-width: 0;
  min-height: 0;
  width: 0.9rem;
  height: 0.9rem;
  padding: 0;
  color: transparent;
  flex-shrink: 0;
}

.status-pill[data-state="neutral"] {
  border-color: rgba(126, 247, 255, 0.24);
  background: rgba(126, 247, 255, 0.36);
}

.status-pill[data-state="working"] {
  border-color: rgba(126, 247, 255, 0.42);
  background: rgba(8, 182, 232, 0.14);
  box-shadow: 0 0 0 4px rgba(8, 182, 232, 0.08);
}

.status-pill[data-state="success"] {
  border-color: rgba(71, 235, 180, 0.34);
  background: rgba(39, 200, 154, 0.14);
}

.status-pill[data-state="error"] {
  border-color: rgba(255, 138, 138, 0.3);
  background: rgba(255, 107, 107, 0.14);
}

pre {
  margin: 0;
  min-height: 250px;
  max-height: 340px;
  overflow: auto;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: var(--code-bg);
  color: #b9ecf7;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.88rem;
}

:root[data-theme="light"] pre {
  color: #174456;
}

.images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  border-radius: 22px;
  border: 1px dashed rgba(126, 247, 255, 0.18);
  background: var(--empty-bg);
  color: var(--muted);
}

.empty-state strong {
  display: block;
  font-size: 1.45rem;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  color: var(--text);
}

.empty-state p {
  margin: 0.75rem auto 0;
  max-width: 34ch;
}

.img-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.16);
  background: var(--card-bg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] .img-card {
  box-shadow: 0 18px 42px rgba(11, 125, 167, 0.12);
}

.img-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.img-card__title {
  font-weight: 800;
  word-break: break-word;
}

.format-chip {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 247, 255, 0.2);
  background: rgba(8, 182, 232, 0.15);
  color: var(--brand-bright);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.img-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 0.75rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: var(--card-stage-bg);
  overflow: hidden;
}

.img-card img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(720px, 80vh);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 9.5rem;
  text-decoration: none;
}

.download-link:hover {
  color: #02212c;
}

.reveal {
  animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1120px) {
  .config-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .config-column {
    grid-template-rows: auto auto;
  }

  .hero h1 {
    max-width: none;
  }

  .mesh-wordmark {
    max-width: none;
  }
}

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

  .hero-visual {
    justify-content: flex-start;
  }

  .hero-logo-strip {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    min-height: auto;
    width: 100%;
  }

  .hero-logo {
    width: clamp(88px, 26vw, 120px);
    max-height: 64px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 1rem), 100%);
    padding: 1rem 0 2rem;
  }

  .page-topbar {
    top: 0.8rem;
    right: 0.8rem;
  }

  .hero,
  .control-card,
  .status-card,
  .logs-card,
  .results-panel {
    padding: 1.1rem;
  }

  .hero h1 {
    font-size: clamp(1.15rem, 7vw, 1.9rem);
  }

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

  .btn {
    width: 100%;
  }

  .page-topbar .theme-toggle {
    width: 2.85rem;
    height: 2.85rem;
  }

  .field-grid,
  .format-grid,
  .visual-stats {
    grid-template-columns: 1fr;
  }

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

  .section-header {
    flex-direction: column;
  }

  pre {
    min-height: 180px;
  }
}

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