:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(34, 36, 38, 0.1);
  --text: #141414;
  --muted: #5f6358;
  --accent: #1f6d5a;
  --accent-strong: #154c3f;
  --danger: #a23b31;
  --shadow: 0 22px 60px rgba(27, 29, 26, 0.08);
  --radius: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111312;
    --panel: rgba(26, 28, 27, 0.94);
    --panel-strong: #1f2221;
    --line: rgba(240, 238, 233, 0.1);
    --text: #f5f2ea;
    --muted: #b0b5ab;
    --accent: #83d2bb;
    --accent-strong: #a1ead5;
    --danger: #ff9187;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  margin: 20px 0;
}

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

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  align-items: flex-start;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
}

h1,
h2,
h3,
.upload-title {
  margin: 0;
  font-family: 'Fraunces', serif;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.96;
}

h2 {
  font-size: 1.8rem;
}

h3,
.upload-title {
  font-size: 1.25rem;
}

.lede {
  max-width: 56ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.compact {
  gap: 14px;
}

.section-heading,
.upload-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

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

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

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.qr-block {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

#qr-image {
  width: 100%;
  aspect-ratio: 1;
  padding: 14px;
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--line);
}

.payload-card,
.response-card {
  margin: 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  overflow: auto;
}

.payload-line {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.payload-line span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.payload-card code,
.response-card,
#payload {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

#payload {
  margin: 0;
  white-space: pre-wrap;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.ghost-button {
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: rgba(162, 59, 49, 0.1);
  color: var(--danger);
  font-weight: 800;
}

.uploads-panel {
  min-height: 360px;
}

.uploads-list {
  display: grid;
  gap: 16px;
}

.upload-card {
  padding: 22px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.upload-meta,
.file-caption,
.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.file-card {
  color: inherit;
  text-decoration: none;
}

.image-card img,
.file-card-generic {
  display: block;
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.image-card img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.file-card-generic {
  min-height: 220px;
  padding: 18px;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(31, 109, 90, 0.12);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.empty-state {
  padding: 36px 20px 10px;
  text-align: center;
}

@media (max-width: 960px) {
  .layout,
  .qr-block {
    grid-template-columns: 1fr;
  }

  .hero,
  .section-heading,
  .upload-header {
    flex-direction: column;
  }

  .hero-meta {
    white-space: normal;
  }
}
