:root {
  --bg: #f3efe6;
  --panel: rgba(255, 252, 245, 0.86);
  --ink: #1f2933;
  --muted: #5e6a73;
  --line: rgba(31, 41, 51, 0.12);
  --accent: #b14d2f;
  --accent-dark: #7b2d17;
  --shadow: 0 22px 60px rgba(55, 42, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 135, 93, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(84, 133, 140, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f3ea 0%, var(--bg) 100%);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.page {
  width: min(1120px, calc(100vw - 32px));
  margin: 28px auto 48px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero h1,
.result-card h2 {
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.96;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-dark);
}

.lede {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
}

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

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

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

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field select,
.actions button,
.actions .download {
  border-radius: 14px;
  border: 1px solid rgba(31, 41, 51, 0.14);
  padding: 12px 14px;
  font: inherit;
}

.field-file input {
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions button,
.actions .download {
  min-width: 190px;
  text-align: center;
  text-decoration: none;
}

.actions button {
  background: linear-gradient(135deg, var(--accent) 0%, #d78552 100%);
  color: white;
  cursor: pointer;
}

.actions button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.actions .download {
  background: white;
  color: var(--accent-dark);
}

.actions .download.disabled {
  pointer-events: none;
  opacity: 0.45;
}

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

.result-card {
  display: grid;
  gap: 12px;
}

.result-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.preview {
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.checker {
  background:
    linear-gradient(45deg, rgba(31, 41, 51, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(31, 41, 51, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(31, 41, 51, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(31, 41, 51, 0.06) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

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

.meta,
.status-panel {
  color: var(--muted);
}

.meta a {
  color: var(--accent-dark);
}

#status {
  margin: 0;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

@media (max-width: 720px) {
  .page {
    width: min(100vw - 20px, 1120px);
    margin-top: 10px;
  }

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

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