:root {
  --bg-a: #fcf7ef;
  --bg-b: #e8f7f2;
  --ink: #13242f;
  --muted: #5d6d79;
  --card: rgba(255, 255, 255, 0.88);
  --border: #d8e1e7;
  --primary: #0f766e;
  --danger: #b91c1c;
  --amber: #b45309;
  --blue: #1d4ed8;
  --teal: #0f766e;
  --rose: #be123c;
  --slate: #475569;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Sora', sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-a), var(--bg-b));
  min-height: 100vh;
}

.app-bg {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 18% 20%, #f59e0b2a 0, transparent 36%),
    radial-gradient(circle at 85% 78%, #10b9812a 0, transparent 32%);
  pointer-events: none;
}

.app {
  position: relative;
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 5.6rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-family: 'Space Mono', monospace;
  color: #9a3412;
}

h1 {
  margin: 0.25rem 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

.sub,
.muted {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.screen {
  display: none;
  gap: 0.85rem;
}

.screen.active {
  display: grid;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem;
  backdrop-filter: blur(2px);
  box-shadow: 0 8px 20px #10232f12;
}

.panel.compact {
  padding: 0.8rem;
}

.stack {
  display: grid;
  gap: 0.6rem;
}

.row {
  display: flex;
  gap: 0.5rem;
}

.mt {
  margin-top: 0.6rem;
}

label {
  display: grid;
  gap: 0.26rem;
  font-size: 0.82rem;
  color: #334155;
  font-family: 'Space Mono', monospace;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.62rem 0.7rem;
  background: #fff;
}

button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: var(--primary);
  color: #fff;
}

button.ghost {
  background: #fff;
  border-color: var(--border);
  color: #1f2937;
}

.dropzone {
  border: 2px dashed #8fb0ab;
  border-radius: 14px;
  min-height: 110px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #28554f;
  padding: 0.8rem;
  cursor: pointer;
  background: #f4fbf9;
}

.dropzone input {
  display: none;
}

.thumbs {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.5rem;
}

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

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

.thumb p {
  margin: 0;
  padding: 0.3rem;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #475569;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.chip {
  border-radius: 999px;
  padding: 0.44rem 0.72rem;
  font-size: 0.8rem;
  border: 1px solid #b7d5cf;
  background: #effaf7;
  color: #0f766e;
}

.card-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.group-head {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.badge {
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  font-family: 'Space Mono', monospace;
  color: #fff;
}

.badge.blue { background: var(--blue); }
.badge.amber { background: var(--amber); }
.badge.teal { background: var(--teal); }
.badge.rose { background: var(--rose); }
.badge.slate { background: var(--slate); }

.return-card {
  padding: 0.75rem 0.8rem;
  border-top: 1px solid #edf2f7;
  display: grid;
  gap: 0.45rem;
}

.return-main {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.return-title {
  margin: 0;
  font-size: 0.95rem;
}

.return-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}

.urgency {
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  height: fit-content;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
}

.urgency.urgent { background: #fee2e2; color: #991b1b; }
.urgency.soon { background: #fff7d6; color: #92400e; }
.urgency.normal { background: #e2e8f0; color: #334155; }

.artifacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.45rem;
}

.artifact {
  border: 1px solid #dce6ec;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.artifact img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.artifact p {
  margin: 0;
  font-size: 0.72rem;
  padding: 0.3rem 0.45rem;
  color: #475569;
}

.callout {
  border: 1px solid #cde5df;
  border-radius: 12px;
  background: #f2fbf8;
  min-height: 44px;
  padding: 0.65rem;
  font-size: 0.88rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0.7rem;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 1rem));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.34rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 26px #10232f20;
  padding: 0.34rem;
  backdrop-filter: blur(5px);
}

.nav-item {
  border-radius: 12px;
  padding: 0.56rem 0.2rem;
  background: transparent;
  border: 0;
  color: #475569;
  font-size: 0.78rem;
}

.nav-item.active {
  background: #0f766e;
  color: #fff;
}

@media (max-width: 520px) {
  .app {
    padding: 0.75rem 0.75rem 5.5rem;
  }

  .topbar {
    gap: 0.55rem;
  }

  .bottom-nav {
    width: calc(100% - 0.8rem);
  }
}
