/* PDF Paster — print-shop paste-up look.
   Palette: desk #E9EDF1 · sheet #FFFFFF · ink #16324F · ink-soft #5A6B7C
            stamp red #C8402A (remove / errors only) · approve green #2E6B4F */

:root {
  --desk: #e9edf1;
  --sheet: #ffffff;
  --ink: #16324f;
  --ink-soft: #5a6b7c;
  --rule: #c9d2da;
  --stamp: #c8402a;
  --approve: #2e6b4f;
  --display: Cambria, Georgia, "Times New Roman", serif;
  --body: "Segoe UI", system-ui, sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--desk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  width: min(44rem, 100% - 2rem);
  margin: 0 auto;
  flex: 1;
}

/* Masthead */

.masthead {
  width: min(44rem, 100% - 2rem);
  margin: 2.5rem auto 2rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1rem;
}

.wordmark {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tagline { color: var(--ink-soft); margin-top: 0.25rem; }

/* Drop platen */

.platen {
  border: 2px dashed var(--ink-soft);
  border-radius: 6px;
  background: color-mix(in srgb, var(--sheet) 55%, transparent);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}

.platen:hover, .platen:focus-visible { border-color: var(--ink); background: var(--sheet); }
.platen:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.platen.dragover {
  border-color: var(--approve);
  border-style: solid;
  background: var(--sheet);
}

.platen-mark {
  width: 3rem; height: 3rem;
  stroke: var(--ink); fill: none; stroke-width: 2.5;
  margin-bottom: 0.5rem;
}
.platen-mark rect:first-child { fill: var(--desk); }
.platen-mark rect + rect { fill: var(--sheet); }

.platen-hint { color: var(--ink-soft); font-size: 0.875rem; margin-top: 0.25rem; }

/* Queue of sheets */

#queue-section { margin-top: 2.5rem; }

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.queue-title {
  font-family: var(--display);
  font-size: 1.375rem;
}

.queue-meta { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-soft); }

.queue-hint { color: var(--ink-soft); font-size: 0.875rem; margin: 0.25rem 0 1rem; }

.stack { list-style: none; display: grid; gap: 0.625rem; }

.sheet {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.625rem 0.875rem;
  box-shadow: 2px 2px 0 rgba(22, 50, 79, 0.08);
  cursor: grab;
}

.sheet.dragging { opacity: 0.45; cursor: grabbing; }
.sheet.drop-target { border-color: var(--ink); box-shadow: 0 -3px 0 var(--ink); }

.folio {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 2ch;
  text-align: right;
  color: var(--ink);
}

.sheet-body { flex: 1; min-width: 0; }

.sheet-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-detail { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); }

.sheet.error { border-color: var(--stamp); }
.sheet.error .sheet-detail { color: var(--stamp); font-family: var(--body); font-weight: 600; }
.sheet.error .folio { color: var(--rule); }

.sheet-controls { display: flex; gap: 0.25rem; }

.sheet-controls button {
  font-family: var(--body);
  font-size: 0.875rem;
  line-height: 1;
  width: 2rem; height: 2rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
}

.sheet-controls button:hover:not(:disabled) { border-color: var(--ink); }
.sheet-controls button:disabled { opacity: 0.3; cursor: default; }
.sheet-controls .remove { color: var(--stamp); }
.sheet-controls .remove:hover { border-color: var(--stamp); }
.sheet-controls button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* Output job line */

.jobline {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1rem;
}

.name-label { font-size: 0.875rem; color: var(--ink-soft); flex-basis: 100%; }

.name-wrap { display: flex; align-items: center; flex: 1; min-width: 12rem; }

#out-name {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.5rem 0.25rem 0.5rem 0.625rem;
  border: 1px solid var(--rule);
  border-right: none;
  border-radius: 3px 0 0 3px;
  background: var(--desk);
}

#out-name:focus-visible { outline: 2px solid var(--ink); outline-offset: -1px; }

.name-ext {
  font-family: var(--mono);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-left: none;
  border-radius: 0 3px 3px 0;
  padding: 0.5rem 0.625rem 0.5rem 0;
  background: var(--desk);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.combine {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sheet);
  background: var(--ink);
  border: none;
  border-radius: 3px;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
}

.combine:hover:not(:disabled) { background: #0f2438; }
.combine:disabled { opacity: 0.5; cursor: default; }
.combine:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Status + colophon */

.status { margin-top: 1rem; min-height: 1.5rem; }
.status.ok { color: var(--approve); font-weight: 600; }
.status.err { color: var(--stamp); font-weight: 600; }

.colophon {
  width: min(44rem, 100% - 2rem);
  margin: 3rem auto 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.colophon-notes {
  list-style: none;
  display: grid;
  gap: 0.375rem;
}

.colophon-notes li {
  padding-left: 1rem;
  text-indent: -1rem;
}

.colophon-notes li::before {
  content: "·";
  font-weight: 700;
  margin-right: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
