:root {
  color-scheme: light;
  --ink: #202421;
  --subtle: #575e56;
  --surface: #fff;
  --canvas: #f7f5ef;
  --stroke: #e3dfd6;
  --accent: #f6b43a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

.layout {
  max-width: 70rem;
  margin-inline: auto;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(3rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.page-header, .issue-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}
.page-header { align-items: center; min-height: 3rem; }
.wordmark { font-size: .95rem; font-weight: 750; margin: 0; }
.project { padding-block: 1.2rem; }
.project h1 { font-size: clamp(1.8rem, 6vw, 3.5rem); margin: 0; letter-spacing: -.055em; line-height: 1.04; }
.project p { color: var(--subtle); margin-block: .6rem 1rem; }

.totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 1rem;
  padding-block: .8rem;
}
.totals div { display: grid; padding-inline: clamp(.45rem, 4vw, 1.25rem); gap: .16rem; }
.totals div + div { border-left: 1px solid var(--stroke); }
.totals strong { font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.totals span { color: var(--subtle); font-size: .9rem; }

.issues { display: grid; grid-template-columns: minmax(0, 1fr); gap: .85rem; align-items: start; }
.issue { background: var(--surface); border: 1px solid var(--stroke); border-radius: 1.1rem; padding: .9rem; min-width: 0; }
.issue h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; overflow-wrap: anywhere; }
.meta { margin: .4rem 0 0; color: var(--subtle); font-size: .94rem; }
.notes { line-height: 1.45; margin-block: .6rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { font-size: .78rem; font-weight: 700; border-radius: 2rem; background: #fcf0d6; color: #714300; padding: .35rem .68rem; }
.badge.in_review { background: #e2edf9; color: #285176; }
.badge.accepted { background: #e5f1e7; color: #245838; }
.badge.returned { background: #f8e6dc; color: #813619; }

.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .8rem; }
.photos figure { margin: 0; min-width: 0; }
.photos img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .6rem; background: var(--canvas); }
.photos figcaption { font-size: .79rem; color: var(--subtle); margin-top: .3rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.82rem;
  padding: .65rem 1rem;
  border-radius: .7rem;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.button.secondary { background: var(--surface); border-color: var(--stroke); }
.button[disabled] { opacity: .55; cursor: default; }
.button:focus-visible, input:focus-visible { outline: 3px solid #315579; outline-offset: 3px; }
.upload { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: .95rem; gap: .55rem; }
.upload input { max-width: 100%; font: inherit; padding: .35rem 0; }
.upload input::file-selector-button {
  border: 1px solid var(--stroke);
  border-radius: .6rem;
  padding: .5rem .7rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.upload label { font-weight: 600; }
.feedback { color: var(--subtle); font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
.feedback.error, #load-state.error { color: #843720; }

@media (min-width: 48rem) {
  .layout { padding-inline: 2rem; }
  .issues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue { padding: 1.15rem; }
}
