:root {
  --bg: #f3f0ea;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #191919;
  --muted: #626667;
  --line: rgba(25, 25, 25, 0.1);
  --accent: #0f6c63;
  --accent-dark: #0b4f49;
  --shadow: 0 24px 80px rgba(25, 25, 25, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 63px,
      rgba(25, 25, 25, 0.045) 63px,
      rgba(25, 25, 25, 0.045) 64px
    ),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(calc(100% - 32px), 1180px);
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 28px;
  align-items: start;
  padding: 28px 0 48px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 11ch;
  font-size: 4rem;
  line-height: 1.04;
}

.hero-text,
.status,
.upload-zone span,
.preview-empty {
  color: var(--muted);
  line-height: 1.75;
}

.hero-panel,
.tool-panel,
.preview-panel,
.result-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel {
  padding: 18px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.badge-row span {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 700;
}

.tool-panel {
  padding: 18px;
}

.field-group + .field-group {
  margin-top: 18px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

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

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-weight: 700;
  cursor: pointer;
}

.segmented input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #f7fbfa;
}

.upload-zone {
  display: grid;
  gap: 8px;
  padding: 22px 18px;
  border: 1px dashed rgba(25, 25, 25, 0.18);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.upload-zone strong {
  font-size: 1rem;
}

.upload-zone em {
  color: var(--text);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 700;
}

#file-input {
  display: none;
}

.primary-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #f7fbfa;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
}

.primary-button:hover,
.download-link:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.mode-hint {
  min-height: 44px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.result-section {
  padding-top: 8px;
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 2.3rem;
  line-height: 1.12;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.preview-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}

.preview-empty {
  text-align: center;
  max-width: 26rem;
}

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

.hidden {
  display: none;
}

.result-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px;
}

.result-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.result-meta strong {
  display: block;
  margin-top: 10px;
  font-size: 1.04rem;
  line-height: 1.6;
}

.download-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

  .hero h1 {
    max-width: none;
    font-size: 3rem;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(calc(100% - 20px), 1180px);
    padding-top: 18px;
  }

  .hero {
    gap: 20px;
    padding-top: 16px;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

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

  .preview-panel {
    min-height: 280px;
  }
}
