:root {
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;

  --ink: #1a1a18;
  --ink-muted: #5d5d57;
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --rule: #e2e0d9;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --error: #a3322a;
  --success: #2f6b3a;
  --warning: #8a5a00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece9e2;
    --ink-muted: #a7a49b;
    --paper: #141413;
    --paper-raised: #1c1c1a;
    --rule: #302f2c;
    --accent: #8fc4b2;
    --accent-ink: #10201b;
    --error: #f0a59d;
    --success: #9fd8a8;
    --warning: #f1c97a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
}

.brand span {
  color: var(--ink-muted);
}

.account {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  color: var(--ink-muted);
  font-size: 1rem;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 2rem;
}

h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.5rem;
}

.panel {
  max-width: 28rem;
}

label {
  display: block;
  margin: 1rem 0 0.375rem;
  font-weight: 600;
}

input[type='email'],
input[type='password'],
input[type='text'] {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--ink-muted);
  border-radius: 0.375rem;
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
}

input:focus-visible,
button:focus-visible,
a:focus-visible,
.drop:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.primary,
.button-like {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a {
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-top: 1.5rem;
}

.error {
  margin: 1rem 0 0;
  color: var(--error);
  font-weight: 600;
}

.error:empty {
  display: none;
}

.loading,
.quiet {
  color: var(--ink-muted);
}

fieldset {
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.categories label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  padding: 0.625rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
  background: var(--paper-raised);
  font-weight: 500;
  cursor: pointer;
}

.categories label:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.categories input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent);
}

.drop {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  padding: 2.5rem 1rem;
  border: 2px dashed var(--ink-muted);
  border-radius: 0.5rem;
  background: var(--paper-raised);
  font-weight: 400;
  text-align: center;
  cursor: pointer;
}

.drop.dragging {
  border-color: var(--accent);
  background: var(--paper);
}

.drop-hint {
  color: var(--ink-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.queue,
.gallery-photos {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.thumb {
  width: 6rem;
  height: 6rem;
  border-radius: 0.25rem;
  background: var(--rule);
  object-fit: cover;
}

.item label {
  margin-top: 0;
}

.item .status {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
}

.item[data-state='error'] .status,
.item .status.problem {
  color: var(--error);
  font-weight: 600;
}

.item[data-state='live'] .status {
  color: var(--success);
  font-weight: 600;
}

.item[data-state='slow'] .status {
  color: var(--warning);
  font-weight: 600;
}

.item progress {
  width: 100%;
  margin-top: 0.5rem;
  accent-color: var(--accent);
}

.item .remove {
  margin-top: 0.5rem;
}

.gallery-photos li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
}

.badge {
  color: var(--ink-muted);
  font-size: 1rem;
}

.badge.live {
  color: var(--success);
}

.footnote {
  margin-top: 3rem;
  font-size: 1rem;
}

@media (max-width: 30rem) {
  .item {
    grid-template-columns: 4.5rem 1fr;
  }

  .thumb {
    width: 4.5rem;
    height: 4.5rem;
  }
}
