:root {
  --paper: #efe7d3;
  --ink: #1a1714;
  --mute: #5c5348;
  --rule: #c9b99a;
  --rust: #9a3412;
  --chip: #f7f1e3;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
}

body {
  background: #d8cdb4;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(12px, 2.6vw, 14px);
  line-height: 1.45;
}

.sheet {
  width: min(980px, 100%);
  margin: clamp(0px, 3vw, 28px) auto clamp(24px, 6vw, 64px);
  padding: clamp(16px, 4vw, 36px) clamp(14px, 4vw, 40px) clamp(18px, 3vw, 28px);
  background: var(--paper);
  border: 1px solid #b9a882;
  box-shadow: 0 18px 0 -12px #8d7b58;
}

.mast {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 18px;
}

.mast-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
}

h1 {
  margin: 0;
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: clamp(30px, 8vw, 50px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.9;
}

.issue,
.lede,
.meta,
.grid-note,
.status,
footer {
  color: var(--mute);
}

.issue {
  margin: 0;
  text-align: right;
  max-width: 28ch;
}

.lede {
  margin: 14px 0 0;
  max-width: 62ch;
}

.meta {
  overflow-wrap: anywhere;
  text-align: right;
}

h2 {
  margin: 0;
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 600;
}

.intake,
.report {
  margin-top: clamp(18px, 4vw, 28px);
}

.intake-head,
.report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.drop {
  display: block;
  border: 1px dashed var(--ink);
  background: var(--chip);
  padding: clamp(14px, 3vw, 18px) 16px;
  cursor: pointer;
}

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drop-label strong {
  font-weight: 500;
  color: var(--ink);
}

.drop.is-hot {
  background: #ead9b3;
}

.stage {
  margin-top: 14px;
  min-height: min(220px, 40vw);
  border: 1px solid var(--rule);
  background: #e4d8bc;
  position: relative;
  overflow: hidden;
}

.stage-empty {
  margin: 0;
  padding: clamp(48px, 16vw, 88px) 16px;
  text-align: center;
  color: var(--mute);
}

.stage.is-empty .frame {
  display: none;
}

.stage:not(.is-empty) .stage-empty {
  display: none;
}

.frame {
  position: relative;
  display: block;
  width: 100%;
}

.frame img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.pins {
  position: absolute;
  inset: 0;
}

.pin {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 7px;
  line-height: 12px;
  text-align: center;
  font-weight: 500;
  pointer-events: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 7px 10px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  background: transparent;
  color: var(--mute);
  border-color: var(--rule);
}

.grid-note {
  margin: 0 0 12px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ink);
  max-height: min(70vh, 720px);
  overflow-y: auto;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--chip);
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e8dcc3;
  position: sticky;
  top: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.blank td {
  color: var(--mute);
  text-align: center;
  padding: 28px 10px;
  white-space: normal;
}

.swatch {
  display: inline-block;
  width: 42px;
  height: 14px;
  border: 1px solid var(--ink);
  vertical-align: middle;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
}

.status.is-ok {
  color: #215e38;
}

.status.is-err {
  color: var(--rust);
}

footer {
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0;
}

footer p {
  margin: 0;
  white-space: nowrap;
  overflow-x: auto;
}

footer a {
  color: var(--ink);
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .sheet {
    margin: 0;
    border: 0;
    box-shadow: none;
    min-height: 100vh;
  }

  .mast-row,
  .intake-head,
  .report-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .issue,
  .meta {
    text-align: left;
    max-width: none;
  }

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

  footer p {
    white-space: normal;
  }

  .pin {
    width: 11px;
    height: 11px;
    margin: -5px 0 0 -5px;
    font-size: 0;
    line-height: 0;
  }
}

@media (max-width: 420px) {
  table {
    min-width: 480px;
  }

  th,
  td {
    padding: 6px 8px;
  }
}
