/* tokens, pulled from the avatar's own beige-olive void + its one lime tag accent */
:root {
  --void: #6b6650;
  --paper: #e7e0c8;
  --paper-dark: #d9d1b3;
  --ink: #211f17;
  --ink-soft: #55503d;
  --rule: #b7ac86;
  --lime: #ccff00;
}

@font-face {
  font-family: 'Oswald';
  src: url('fonts/oswald-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('fonts/oswald-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inconsolata';
  src: url('fonts/inconsolata-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inconsolata';
  src: url('fonts/inconsolata-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Inconsolata';
  src: url('fonts/inconsolata-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: 'Inconsolata', monospace;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 96px;
}

.sheet {
  width: 100%;
  max-width: 620px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(20, 19, 12, 0.28);
  padding: 22px 24px 18px;
  transform: rotate(-0.35deg);
}

.letterhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 6px;
}

.brand {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand span {
  font-family: 'Inconsolata', monospace;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 8px;
  letter-spacing: 0;
}

.doc-id {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.photo-block {
  position: relative;
  border: 1px solid var(--ink);
  overflow: hidden;
  margin-bottom: 16px;
  height: 300px;
  background: #8d8768; /* the avatar's own void color, so the letterbox reads as scene, not crop */
}
.photo-block img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.stamp {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  border: 3px solid var(--lime);
  background: rgba(33, 31, 23, 0.74);
  padding: 4px 10px;
  transform: rotate(-9deg);
}

.manifest-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.field { display: flex; flex-direction: column; gap: 2px; }
.field .k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.field .v {
  font-size: 13px;
  font-weight: 500;
}

.ledger { position: relative; margin-top: 10px; }

.ledger-head, .ledger-body .row {
  display: grid;
  grid-template-columns: 48px 1fr 52px;
  gap: 8px;
  align-items: baseline;
}

.ledger-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
}
.col-qty { text-align: right; }

.ledger-body {
  height: 190px;
  overflow-y: auto;
  scrollbar-width: none;
}
.ledger-body::-webkit-scrollbar { display: none; }

.ledger-body .row {
  padding: 5px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 12.5px;
}
.ledger-body .row .col-line { color: var(--ink-soft); }
.ledger-body .row .col-qty { font-weight: 500; }

.ledger-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  background: linear-gradient(to bottom, rgba(231, 224, 200, 0), var(--paper));
  pointer-events: none;
}

.ledger-final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
}
.ledger-final .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.ca {
  font-family: 'Inconsolata', monospace;
  font-weight: 700;
  font-size: 13px;
  background: var(--paper-dark);
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 7px 10px;
  cursor: pointer;
  word-break: break-all;
  text-align: right;
  flex: 1;
  min-width: 0;
}
.ca:hover { background: var(--lime); }
.ca.copied { background: var(--lime); }

.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink);
}
.foot .buy {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--lime);
  padding: 9px 18px;
  text-decoration: none;
}
.foot .x {
  color: var(--paper);
  display: flex;
  padding: 6px;
}

@media (max-width: 480px) {
  .sheet { padding: 16px 16px 14px; transform: rotate(0deg); }
  .brand { font-size: 18px; }
  .photo-block { height: 220px; }
  .ledger-body { height: 150px; }
  .ledger-head, .ledger-body .row { grid-template-columns: 36px 1fr 44px; font-size: 11.5px; }
}

@media (max-height: 760px) {
  .photo-block { height: 220px; }
  .ledger-body { height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .ca { transition: none; }
}
