:root {
  --bg: #f4efe7;
  --paper: #fffdf9;
  --ink: #1a2230;
  --muted: #5d6675;
  --accent: #0f766e;
  --accent-deep: #0b4f4b;
  --warning: #9a3412;
  --line: rgba(26, 34, 48, 0.12);
  --shadow: 0 24px 60px rgba(26, 34, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(180deg, #f7f2eb 0%, #efe8dc 100%);
}

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

.shell-narrow {
  width: min(860px, calc(100% - 32px));
}

.hero-card,
.panel,
.feedback {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 32px;
  margin-bottom: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-deep);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Bitter", "Georgia", serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.4rem);
}

h3 {
  font-size: 1.1rem;
}

.lead,
.panel p,
.feedback li,
.fine-print {
  color: var(--muted);
  line-height: 1.55;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-meta span,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
}

.panel,
.feedback {
  padding: 28px;
}

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

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

.field span {
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(26, 34, 48, 0.16);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.upload-box {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px dashed rgba(15, 118, 110, 0.35);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
}

.file-input {
  position: relative;
  display: inline-flex;
  width: fit-content;
  cursor: pointer;
}

.file-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-input span,
.submit-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.file-input span,
.submit-button {
  background: var(--ink);
  color: #fff;
}

.secondary-button {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-deep);
}

.secondary-button[disabled] {
  opacity: 0.45;
}

.file-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(26, 34, 48, 0.05);
}

.camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #0f172a;
  aspect-ratio: 4 / 3;
}

#camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.scan-thumb {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.scan-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.feedback-error {
  margin-bottom: 24px;
  border-color: rgba(154, 52, 18, 0.2);
  background: rgba(255, 247, 237, 0.95);
}

.result-panel {
  display: grid;
  gap: 24px;
}

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

.button-link {
  width: fit-content;
}

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

  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero-card,
  .panel,
  .feedback {
    border-radius: 22px;
    padding: 22px;
  }
}