:root {
  color-scheme: light;
  --panel: rgba(255, 251, 245, 0.97);
  --panel-strong: rgba(255, 247, 238, 0.995);
  --ink: #223337;
  --muted: #62716f;
  --line: rgba(34, 51, 55, 0.1);
  --accent: #0f766e;
  --accent-strong: #09534d;
  --shadow: 0 28px 70px rgba(31, 46, 52, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 203, 126, 0.18), transparent 28%),
    radial-gradient(circle at right top, rgba(25, 148, 137, 0.12), transparent 30%),
    linear-gradient(180deg, #f5ecdf 0%, #ece2d4 100%);
  overflow-x: hidden;
}

.backdrop,
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.backdrop-a {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 166, 83, 0.22), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(15, 118, 110, 0.1), transparent 24%);
  filter: blur(20px);
  opacity: 0.38;
}

.backdrop-b {
  background:
    radial-gradient(circle at 70% 78%, rgba(15, 118, 110, 0.07), transparent 18%),
    radial-gradient(circle at 25% 84%, rgba(217, 119, 6, 0.06), transparent 20%);
  opacity: 0.34;
}

.grain {
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(34, 51, 55, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 51, 55, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, black, transparent 96%);
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.topbar,
.main-grid .panel {
  animation: rise-in 0.7s ease both;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 24px 26px;
}

.title-block {
  display: grid;
  gap: 10px;
}

.eyebrow,
.panel-label {
  margin: 0;
  font-size: 0.77rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.title-block h1,
.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Georgia", serif;
  letter-spacing: -0.035em;
  color: #2e4340;
}

.title-block h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 0.94;
}

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

.field > span,
.export-field > span {
  font-size: 0.92rem;
}

.export-field {
  min-width: 220px;
}

.export-field-bottom {
  min-width: 0;
}

.text-input,
.select-input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 15px;
  font: inherit;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.text-input:focus,
.select-input:focus {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
  background: white;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(350px, 0.88fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.left-column {
  display: grid;
  gap: 18px;
}

.main-grid .panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.muted {
  margin: 0;
  color: var(--muted);
}

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

.preset-button {
  border: 0;
  border-radius: 18px;
  padding: 12px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
  box-shadow: 0 12px 20px rgba(18, 32, 38, 0.08);
}

.preset-button:hover,
.preset-button:focus-visible {
  transform: translateY(-1px);
  background: white;
  box-shadow: 0 16px 24px rgba(18, 32, 38, 0.14);
}

.preset-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}

.preset-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.generator-form {
  display: grid;
  gap: 16px;
}

.field-grid,
.detail-band {
  display: grid;
  gap: 14px;
}

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

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.detail-band {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.09), rgba(255, 183, 77, 0.1)),
    rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 118, 110, 0.1);
}

.detail-copy {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: #304340;
  overflow-wrap: anywhere;
}

.primary-button,
.secondary-button,
.link-button {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 30px rgba(15, 118, 110, 0.2);
}

.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.preview-panel {
  display: grid;
  gap: 18px;
}

.checkerboard {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(34, 51, 55, 0.08);
  background-image:
    linear-gradient(45deg, rgba(34, 51, 55, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(34, 51, 55, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(34, 51, 55, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(34, 51, 55, 0.08) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}

.preview-stage {
  width: min(100%, 340px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.dimension-preview {
  --preview-width: 100%;
  --preview-height: 100%;
  width: var(--preview-width);
  height: var(--preview-height);
  max-width: 100%;
  max-height: 100%;
  border: 2px dashed rgba(15, 118, 110, 0.46);
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.dimension-preview span {
  display: inline-flex;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 650;
}

.session-shell {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(34, 51, 55, 0.08);
}

.recent-exports {
  display: grid;
  gap: 12px;
}

.export-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(34, 51, 55, 0.08);
}

.export-card-title {
  margin: 0;
  font-weight: 700;
}

.export-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  color: var(--ink);
  background: rgba(34, 51, 55, 0.07);
}

.link-button {
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
  text-decoration: none;
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed rgba(34, 51, 55, 0.14);
  text-align: center;
  color: var(--muted);
}

.toast-rack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 20;
}

.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: 16px;
  color: white;
  background: rgba(34, 51, 55, 0.92);
  box-shadow: 0 20px 40px rgba(34, 51, 55, 0.18);
  animation: rise-in 220ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@media (max-width: 980px) {
  .topbar,
  .main-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1000px);
    margin-top: 12px;
  }

  .topbar,
  .main-grid .panel {
    padding: 18px;
  }

  .preset-grid,
  .field-grid,
  .detail-band {
    grid-template-columns: 1fr;
  }

  .checkerboard {
    min-height: 260px;
    padding: 18px;
  }
}
