:root {
  --bg: #f2efe8;
  --panel: #fffdf9;
  --ink: #1f2a30;
  --muted: #6b7478;
  --accent: #0f7b6c;
  --accent-strong: #0a5b50;
  --line: #d9d2c7;
  --warm: #f7b267;
  --error: #8f2d2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(247, 178, 103, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f3ed 0%, var(--bg) 100%);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
}

h1, h2, h3 {
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.lede {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.status-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(50, 40, 20, 0.06);
}

.status-card {
  padding: 20px;
}

.status-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.status-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.status-card div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.panel {
  padding: 20px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="file"],
input[type="number"],
select,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font: inherit;
}

button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

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

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 14px;
}

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

figure {
  margin: 0;
}

img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ece7de;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.detections ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.detections li {
  margin-bottom: 8px;
}

code,
pre {
  font-family: "Cascadia Code", "Consolas", monospace;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f1e8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
}

.error-box {
  color: var(--error);
  background: #fff1f1;
}

.flagged-grid {
  display: grid;
  gap: 12px;
}

.thumb-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  background: #fffaf2;
}

.thumb-card img {
  max-height: 110px;
  object-fit: cover;
}

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

  .thumb-card {
    grid-template-columns: 1fr;
  }
}
