:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #676b73;
  --line: #d8dbe2;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --accent: #0f6b5f;
  --accent-dark: #094b43;
  --warm: #c95f35;
  --blue: #2f5d8c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(16px, 4vw, 48px) 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.digest-link {
  flex: 0 0 auto;
  color: var(--panel);
  background: var(--ink);
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 32px) 48px;
}

.queue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.queue-summary div {
  min-height: 76px;
  padding: 14px;
  background: var(--panel);
}

.queue-summary strong {
  display: block;
  color: var(--blue);
  font-size: 1.7rem;
  line-height: 1;
}

.queue-summary span {
  color: var(--muted);
  font-size: 0.88rem;
}

.scan-status {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(74px, 1fr)) auto;
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.scan-status div,
.scan-status form {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  background: var(--panel);
}

.scan-status strong {
  color: var(--accent-dark);
  font-size: 1.05rem;
}

.scan-status span {
  color: var(--muted);
  font-size: 0.82rem;
}

.scan-status button {
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--panel);
  background: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.filters {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter {
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
}

.filter.is-active {
  border-color: var(--accent);
  color: var(--panel);
  background: var(--accent);
}

.digest-preview {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warm);
  border-radius: 8px;
  background: var(--panel);
}

.digest-preview pre {
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.5;
}

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

.show-card {
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.show-card[hidden] {
  display: none;
}

.image-link {
  display: block;
  aspect-ratio: 4 / 3;
  background: #e7e3dd;
}

.image-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.show-body {
  padding: 16px;
}

.show-kicker,
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.show-body h2 {
  margin: 10px 0 4px;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.artist {
  margin: 0 0 16px;
  color: var(--muted);
}

.meta-row strong {
  color: var(--warm);
  white-space: nowrap;
}

.visit-note {
  margin: 14px 0 0;
  color: var(--accent-dark);
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.actions form,
.actions label,
.visit-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.actions label span {
  color: var(--muted);
  font-size: 0.82rem;
}

.actions select,
.actions input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--panel);
}

.actions input {
  flex: 1 1 140px;
}

.visit-form input {
  width: 100%;
  flex: 0 1 auto;
}

.actions button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--panel);
  background: var(--accent-dark);
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 680px) {
  .topbar {
    display: block;
  }

  .digest-link {
    display: inline-block;
    margin-top: 14px;
  }

  .queue-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scan-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions form,
  .visit-form {
    align-items: stretch;
    flex-direction: column;
  }

  .actions label {
    width: 100%;
    justify-content: space-between;
  }

  .actions select,
  .actions input,
  .actions button {
    width: 100%;
  }
}

@container (max-width: 360px) {
  .actions form,
  .visit-form {
    align-items: stretch;
    flex-direction: column;
  }

  .actions label {
    width: 100%;
    justify-content: space-between;
  }

  .actions select,
  .actions input,
  .actions button {
    width: 100%;
  }
}
