/* Pigeonhole — Team Task Mailroom
   A sorting-office metaphor: kraft paper, rubber stamps, typewritten letters,
   pigeonhole cubbies, and envelopes that open into letters. */

@font-face {
  font-family: "Pigeon Stamp";
  src: url("/artifacts/team-inbox--v1--s4-whacky--glm-5.2--web-design-guidelines--2026-09-18T22-19-18-618Z/assets/oswald.ttf") format("truetype");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "Pigeon Type";
  src: url("/artifacts/team-inbox--v1--s4-whacky--glm-5.2--web-design-guidelines--2026-09-18T22-19-18-618Z/assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Pigeon Sans";
  src: url("/artifacts/team-inbox--v1--s4-whacky--glm-5.2--web-design-guidelines--2026-09-18T22-19-18-618Z/assets/space-grotesk.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Pigeon Serif";
  src: url("/artifacts/team-inbox--v1--s4-whacky--glm-5.2--web-design-guidelines--2026-09-18T22-19-18-618Z/assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #efe4ca;
  --paper-deep: #e6d6b3;
  --paper-shadow: #cdbb92;
  --ink: #241d14;
  --ink-soft: #5a4d3b;
  --ink-faint: #8a7a5e;
  --felt: #1f3a2e;
  --felt-deep: #15271f;

  --todo: #9c6b1f;
  --todo-ink: #6e4a13;
  --ip: #1d5da8;
  --ip-ink: #154184;
  --blocked: #b02f23;
  --blocked-ink: #831f16;
  --done: #2f7d4f;
  --done-ink: #1f5d3a;

  --line: #2a2014;
  --ring: #1a1208;
  --radius: 3px;
  --shadow: 0 1px 0 rgba(0,0,0,.12), 0 6px 18px -10px rgba(60,40,10,.5);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#desk { scroll-margin-top: 84px; }
:where(h1,h2,h3) { scroll-margin-top: 84px; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Pigeon Sans", system-ui, sans-serif;
  line-height: 1.5;
  background-image:
    radial-gradient(120% 90% at 50% -10%, #f6ecd2 0%, var(--paper) 38%, var(--paper-deep) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0 0.07  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

body:focus-within { scroll-padding-top: 84px; }

:where(a, button, input, select, textarea, [tabindex]) {
  touch-action: manipulation;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: top 180ms ease;
}
.skip-link:focus { top: 0; }

/* ---------- Focus ---------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ip);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Masthead ---------- */
.masthead { position: relative; }
.masthead__rule {
  height: 6px;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 22px);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}
.masthead__rule--bottom { margin-top: 0; }
.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); transition: color 140ms ease; }
.brand:hover { color: var(--ip-ink); }
.brand__mark { width: 46px; height: 46px; color: var(--ink); }
.brand__name {
  font-family: "Pigeon Serif", Georgia, serif;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  letter-spacing: 0.01em;
  line-height: 1;
}
.masthead__tagline {
  margin: 0;
  align-self: end;
  font-family: "Pigeon Type", monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.masthead__tagline .year { font-variant-numeric: tabular-nums; }
.masthead__postmark {
  justify-self: end;
  display: grid;
  gap: 2px;
  text-align: center;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  color: var(--ink-soft);
  border: 2px dashed var(--ink-faint);
  border-radius: 50%;
  padding: 12px 14px;
  opacity: 0.85;
  transform: rotate(-6deg);
}
.postmark__date { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .masthead__inner { grid-template-columns: auto auto; row-gap: 14px; }
  .masthead__tagline { grid-column: 1 / -1; align-self: start; }
  .masthead__postmark { padding: 8px 10px; font-size: 0.58rem; }
  .brand__mark { width: 38px; height: 38px; }
}

/* ---------- Controls ---------- */
.controls {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px) 8px;
}
.controls__row {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 16px;
  align-items: end;
}
@media (max-width: 620px) {
  .controls__row { grid-template-columns: 1fr; gap: 14px; }
}

.field__label {
  display: block;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--ink-soft);
  margin: 0 0 6px 2px;
}
.field__control { position: relative; }
.field__control--select { display: inline-flex; }

#search, #filter, #status-control {
  width: 100%;
  font: inherit;
  font-family: "Pigeon Type", monospace;
  font-size: 0.95rem;
  color: var(--ink);
  background-color: #fbf4dd;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 14px;
  appearance: none;
  -webkit-appearance: none;
}
#search { padding-left: 40px; }
#filter, #status-control { padding-right: 38px; cursor: pointer; }
#search::placeholder { color: var(--ink-faint); }
#search:focus-visible, #filter:focus-visible, #status-control:focus-visible {
  outline: 3px solid var(--ip);
  outline-offset: 1px;
}
.field__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--ink-soft);
  pointer-events: none;
}
.field__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-soft);
  pointer-events: none;
}

/* ---------- Cubbies (pigeonholes) ---------- */
.cubbies {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0 14px;
}
@media (max-width: 620px) {
  .cubbies { grid-template-columns: repeat(5, 1fr); gap: 6px; }
}
.cubby {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  justify-items: center;
  text-align: center;
  padding: 10px 6px 9px;
  border: 2px solid var(--line);
  border-top-width: 3px;
  border-radius: 2px 2px 6px 6px;
  background: linear-gradient(180deg, #d9c393 0%, #c3a96f  100%);
  box-shadow: inset 0 8px 14px -8px rgba(0,0,0,.45), inset 0 -3px 0 rgba(255,255,255,.12);
  color: var(--ink);
  font-family: "Pigeon Stamp", sans-serif;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.cubby:hover { background: linear-gradient(180deg, #e0cf9d 0%, #cdb371 100%); }
.cubby:active { transform: translateY(1px); }
.cubby[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--ink) 0%, #3a2c18 100%);
  color: var(--paper);
  box-shadow: inset 0 6px 14px -6px rgba(0,0,0,.6), 0 0 0 3px var(--ip);
}
.cubby__slot {
  width: 100%;
  height: 30px;
  border: 2px solid rgba(36,29,20,.55);
  border-radius: 2px;
  background: #6b5631;
  background-image: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.05));
  box-shadow: inset 0 5px 8px -4px rgba(0,0,0,.7);
}
.cubby__slot--todo { background: linear-gradient(180deg, var(--todo), var(--todo-ink)); }
.cubby__slot--ip { background: linear-gradient(180deg, var(--ip), var(--ip-ink)); }
.cubby__slot--blocked { background: linear-gradient(180deg, var(--blocked), var(--blocked-ink)); }
.cubby__slot--done { background: linear-gradient(180deg, var(--done), var(--done-ink)); }
.cubby[aria-pressed="true"] .cubby__slot { border-color: var(--paper); opacity: 0.95; }
.cubby__label { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.1; }
.cubby__count {
  font-family: "Pigeon Type", monospace;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 1px 8px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  min-width: 26px;
}
@media (max-width: 620px) {
  .cubby { padding: 7px 3px 6px; }
  .cubby__slot { height: 20px; }
  .cubby__label { font-size: 0.58rem; letter-spacing: 0.03em; }
  .cubby__count { font-size: 0.72rem; }
}

.result-line {
  margin: 6px 2px 0;
  font-family: "Pigeon Type", monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.result-line__count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

/* ---------- Desk & mail ---------- */
.desk {
  position: relative;
  max-width: var(--maxw);
  margin: 18px auto 0;
  padding: 26px clamp(16px, 4vw, 40px) 60px;
  border-radius: 10px;
}
.desk__felt {
  position: absolute;
  inset: 14px 0 0;
  background:
    repeating-linear-gradient(45deg, rgba(20,40,30,.05) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, transparent 0, rgba(0,0,0,.05) 100%);
  pointer-events: none;
  border-radius: 8px;
  z-index: 0;
}

.mail {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
@media (max-width: 620px) {
  .mail { grid-template-columns: 1fr; gap: 16px; }
}

/* Envelope item */
.envelope-item {
  position: relative;
  background: linear-gradient(160deg, #f7eed3 0%, #ecd9ac 100%);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  min-height: 150px;
  transform: rotate(var(--tilt, -0.6deg));
  transition: transform 140ms ease, box-shadow 160ms ease;
}
.envelope-item > * { pointer-events: none; }
.envelope-item:nth-child(even) { --tilt: 0.7deg; }
.envelope-item:nth-child(3n) { --tilt: -1.1deg; }
.envelope-item:nth-child(4n) { --tilt: 1.4deg; }
.envelope-item:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 1px 0 rgba(0,0,0,.12), 0 14px 26px -12px rgba(60,40,10,.55); }
.envelope-item:focus-within { outline: 3px solid var(--ip); outline-offset: 2px; border-radius: 4px; }

.open-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  border-radius: var(--radius);
}
.open-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.open-item:focus-visible { outline: 3px solid var(--ip); outline-offset: 2px; }

.env__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.env__postage {
  width: 46px;
  height: 56px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, var(--ip), var(--ip-ink));
  color: #f3e7c6;
  display: grid;
  place-items: center;
  font-family: "Pigeon Stamp", sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  border-radius: 2px;
  box-shadow: 0 2px 0 rgba(0,0,0,.2);
  position: relative;
  border: 1px dashed rgba(255,255,255,.45);
  transform: rotate(-3deg);
}
.env__postage::before, .env__postage::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: radial-gradient(circle, rgba(255,255,255,.5) 1px, transparent 1.4px) 0 0/6px 6px;
}
.env__postage::before { top: -2px; }
.env__postage::after { bottom: -2px; }

.env__stamp {
  text-align: right;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  border: 3px double currentColor;
  padding: 6px 8px 5px;
  border-radius: 3px;
  transform: rotate(var(--stamp-tilt, 8deg));
  opacity: 0.92;
  align-self: flex-start;
}
.env__stamp .stamp__label { display: block; font-size: 0.72rem; font-weight: 700; }
.env__stamp .stamp__sub { display: block; font-size: 0.56rem; opacity: 0.8; margin-top: 2px; }

.env__stamp--todo { color: var(--todo-ink); }
.env__stamp--ip { color: var(--ip-ink); }
.env__stamp--blocked { color: var(--blocked-ink); }
.env__stamp--done { color: var(--done-ink); }

.env__title {
  font-family: "Pigeon Type", monospace;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin: 6px 0 8px;
  color: var(--ink);
  text-wrap: balance;
}
.env__meta {
  font-family: "Pigeon Type", monospace;
  font-size: 0.76rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 10px;
}
.env__meta b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.env__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.env__tag {
  font-family: "Pigeon Type", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.25);
}
.env__foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed var(--ink-faint);
  padding-top: 9px;
}
.open-item__label {
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--ink);
}
.open-item svg { width: 14px; height: 14px; color: var(--ink); }
.env__comments {
  font-family: "Pigeon Type", monospace;
  font-size: 0.74rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- Empty state ---------- */
.empty {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 50px 20px 40px;
  border: 2px dashed var(--ink-faint);
  border-radius: 8px;
  background: rgba(255,255,255,.3);
}
.empty__stamp {
  display: inline-grid;
  gap: 2px;
  justify-items: center;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 1.1rem;
  color: var(--blocked-ink);
  border: 3px double var(--blocked-ink);
  padding: 12px 18px;
  border-radius: 4px;
  transform: rotate(-7deg);
  opacity: 0.85;
  margin-bottom: 18px;
}
.empty__title { font-family: "Pigeon Serif", serif; margin: 0 0 6px; }
.empty__body { margin: 0 0 18px; color: var(--ink-soft); font-family: "Pigeon Type", monospace; font-size: 0.9rem; }
.empty__recover {
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
}
.empty__recover:hover { background: #3a2c18; }

/* ---------- Detail dialog (envelope -> letter) ---------- */
.letter-dialog {
  width: min(680px, 100vw);
  max-width: 96vw;
  max-height: 92vh;
  padding: 0;
  border: none;
  background: transparent;
  margin: auto;
  overflow: visible;
  color: var(--ink);
}
.letter-dialog::backdrop {
  background: rgba(20,12,4,.55);
  backdrop-filter: blur(2px);
}
.letter-dialog[open] { animation: env-rise 240ms ease both; }
@keyframes env-rise {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.envelope {
  position: relative;
  background: linear-gradient(160deg, #f7eed3 0%, #ecd2a3 100%);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 30px 60px -20px rgba(30,20,5,.6);
  max-height: 92vh;
  overflow: auto;
  overscroll-behavior: contain;
}
.envelope__flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  border-bottom: 26px solid #d8be86;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  z-index: 3;
  pointer-events: none;
}
.envelope__seal {
  position: absolute;
  top: 6px; right: 18px;
  z-index: 4;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d24637, #8e2418);
  color: #f3e7c6;
  display: grid;
  place-items: center;
  font-family: "Pigeon Serif", serif;
  font-size: 1.1rem;
  box-shadow: 0 2px 0 rgba(0,0,0,.25), inset 0 -3px 6px rgba(0,0,0,.35);
}
.envelope__addr {
  position: absolute;
  top: 14px; left: 18px;
  z-index: 4;
  display: none;
  font-family: "Pigeon Type", monospace;
  font-size: 0.62rem;
  color: var(--ink-soft);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.letter {
  position: relative;
  z-index: 5;
  margin: 26px 0 0;
  background: #fbf4dd;
  border: 1px solid var(--paper-shadow);
  border-radius: 4px 4px 6px 6px;
  padding: clamp(18px, 4vw, 30px);
  box-shadow: 0 -8px 18px -10px rgba(0,0,0,.25);
  font-family: "Pigeon Type", monospace;
}
.letter[open] {}

.letter__head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: start;
  border-bottom: 2px solid var(--line);
  padding-bottom: 14px;
}
.letter__id {
  grid-column: 1;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.letter__postmark {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: center;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.56rem;
  color: var(--ink-soft);
  border: 2px dashed var(--ink-faint);
  border-radius: 50%;
  padding: 8px 10px;
  opacity: 0.8;
  transform: rotate(6deg);
}
.letter__title {
  grid-column: 1;
  margin: 2px 0 0;
  font-family: "Pigeon Serif", Georgia, serif;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  line-height: 1.15;
  text-wrap: balance;
}
.letter__stamp {
  grid-column: 1 / -1;
  justify-self: start;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
  border: 3px double currentColor;
  padding: 9px 12px 8px;
  border-radius: 4px;
  transform: rotate(-4deg);
  opacity: 0.92;
  margin-top: 4px;
}
.letter__stamp .stamp__label { display: block; font-size: 1rem; font-weight: 700; }
.letter__stamp .stamp__sub { display: block; font-size: 0.66rem; opacity: 0.78; margin-top: 3px; }
.letter__stamp--todo { color: var(--todo-ink); }
.letter__stamp--ip { color: var(--ip-ink); }
.letter__stamp--blocked { color: var(--blocked-ink); }
.letter__stamp--done { color: var(--done-ink); }

@media (max-width: 520px) {
  .letter__postmark { grid-row: 1; }
  .letter__title { grid-column: 1 / -1; }
}

.letter__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 18px;
  margin: 16px 0 0;
}
.letter__meta dt {
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
  color: var(--ink-faint);
}
.letter__meta dd { margin: 2px 0 0; font-size: 0.9rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.letter__body {
  margin: 16px 0 4px;
  white-space: pre-line;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink);
  padding-left: 12px;
  border-left: 3px solid var(--paper-shadow);
}

/* Re-stamp form */
.restamp {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}
.restamp__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.field__control--select { flex: 0 0 auto; min-width: 220px; }
.restamp__help { margin: 0; font-size: 0.76rem; color: var(--ink-faint); flex: 1 1 180px; }
.restamp__feedback {
  margin-top: 10px;
  min-height: 22px;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  color: var(--done-ink);
}

.letter__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.seal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 140ms ease, transform 120ms ease;
}
.seal-btn:hover { background: #3a2c18; }
.seal-btn:active { transform: translateY(1px); }
.seal-btn svg { width: 16px; height: 16px; }

/* Stamp-slam feedback animation on the letter stamp */
.letter__stamp.slam {
  animation: slam 320ms cubic-bezier(.2,.8,.3,1.2);
}
@keyframes slam {
  0% { opacity: 0; transform: rotate(-4deg) scale(2.4) translateY(-6px); }
  55% { opacity: 0.95; transform: rotate(-4deg) scale(1) translateY(0); }
  100% { opacity: 0.92; transform: rotate(-4deg) scale(1); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  font-family: "Pigeon Stamp", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  padding: 10px 16px;
  border-radius: 6px;
  border: 2px solid var(--line);
  box-shadow: 0 12px 24px -10px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 200ms ease, transform 200ms ease;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footnote ---------- */
.footnote {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 40px) 40px;
  font-family: "Pigeon Type", monospace;
  font-size: 0.74rem;
  color: var(--ink-faint);
  text-align: center;
  border-top: 1px dashed var(--ink-faint);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .envelope-item { transform: none !important; }
  .envelope-item:hover { transform: none !important; }
  .letter-dialog[open] { animation: none !important; }
  .letter__stamp.slam { animation: none !important; opacity: 0.92; }
}

/* ---------- Safe areas ---------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .footnote { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
  .toast { bottom: max(24px, env(safe-area-inset-bottom)); }
}
