/* ============================================================
   Forma — Workshop Ledger
   Visual world: the studio workbench. Ink on a warm dark ground,
   work-order tickets on bone paper, registration-orange accents.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Azeret Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/azeret-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Azeret Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/azeret-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --ground: #14120e;
  --ground-2: #1c1913;
  --ground-3: #262119;
  --paper: #f2ecdd;
  --paper-2: #e6dcc5;
  --paper-3: #d5c8ab;
  --ink: #16140f;
  --ink-2: #4a4232;
  --ink-3: #6c6350;
  --on-ground: #f2ecdd;
  --on-ground-2: #b8ad95;
  --on-ground-3: #8b816b;
  --signal: #e8481c;
  --signal-deep: #a8330c;
  --line-dark: rgba(242, 236, 221, 0.16);
  --line-dark-strong: rgba(242, 236, 221, 0.34);
  --line-paper: rgba(22, 20, 15, 0.22);
  --line-paper-soft: rgba(22, 20, 15, 0.11);

  --cat-baking: #9a4e12;
  --cat-ceramics: #234c68;
  --cat-floristry: #96213f;
  --cat-painting: #4a2f96;

  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-50: 0.625rem;
  --fs-100: 0.6875rem;
  --fs-200: 0.75rem;
  --fs-300: 0.8125rem;
  --fs-400: 0.9375rem;
  --fs-500: 1rem;
  --fs-600: 1.25rem;
  --fs-700: 1.5rem;
  --fs-800: 2rem;

  --radius: 3px;
  --shell: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  scrollbar-color: rgba(242, 236, 221, 0.3) var(--ground);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ground);
  color: var(--on-ground);
  font-family: var(--font-body);
  font-size: var(--fs-500);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::selection,
body ::selection {
  background: var(--signal);
  color: var(--paper);
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a { color: inherit; text-underline-offset: 0.22em; }

input,
select,
textarea { caret-color: var(--signal); }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Ambient bench ---------- */
.bench {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(232, 72, 28, 0.10), transparent 55%),
    radial-gradient(90% 60% at 100% 110%, rgba(74, 47, 150, 0.10), transparent 60%),
    repeating-linear-gradient(0deg, rgba(242, 236, 221, 0.022) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(90deg, rgba(242, 236, 221, 0.022) 0 1px, transparent 1px 88px),
    var(--ground);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.7rem 1.1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-200);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--line-dark);
}

.masthead__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2.75rem 2rem 1.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
}

.brand {
  margin: 0;
  align-self: start;
}
.brand__link {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}
.brand__mark {
  color: var(--signal);
  flex: none;
  width: 40px;
  height: 40px;
}
.brand__name {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-200);
  line-height: 1.75;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-ground-2);
  max-width: 34ch;
  padding-bottom: 0.4rem;
}

.masthead__meta {
  display: grid;
  gap: 0.85rem;
  text-align: right;
  padding-bottom: 0.4rem;
}
.masthead__meta div { display: grid; gap: 0.15rem; }
.masthead__meta dt {
  font-family: var(--font-mono);
  font-size: var(--fs-50);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--on-ground-3);
}
.masthead__meta dd {
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  color: var(--on-ground);
  font-variant-numeric: tabular-nums;
}

/* ---------- Ledger ---------- */
.ledger {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.ledger__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  align-items: end;
  gap: 2.5rem;
  padding-bottom: 2rem;
}

.ledger__intro h2 {
  font-weight: 800;
  font-stretch: 105%;
  font-size: var(--fs-800);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.ledger__sub {
  margin-top: 0.6rem;
  max-width: 46ch;
  color: var(--on-ground-2);
  font-size: var(--fs-400);
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) auto;
  gap: 1rem;
  align-items: end;
}

.field { display: grid; gap: 0.45rem; min-width: 0; }
.field__label {
  font-family: var(--font-mono);
  font-size: var(--fs-50);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-ground-2);
}
.field__control { position: relative; display: flex; align-items: center; }

.field__icon,
.field__chevron {
  position: absolute;
  left: 0.85rem;
  color: var(--on-ground-3);
  pointer-events: none;
}
.field__chevron { left: auto; right: 0.85rem; }

.field input,
.field select {
  width: 100%;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--ground-2);
  color: var(--on-ground);
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-500);
  padding: 0.72rem 0.9rem 0.72rem 2.5rem;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.field select { padding-right: 2.4rem; cursor: pointer; }
.field input::placeholder { color: var(--on-ground-3); }
.field input:hover,
.field select:hover { border-color: rgba(242, 236, 221, 0.5); }
.field input:focus,
.field select:focus {
  border-color: var(--signal);
  background: var(--ground-3);
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 72, 28, 0.28);
}
.field input[type="search"]::-webkit-search-decoration,
.field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.9rem;
  padding: 0 0.95rem;
  background: var(--ground-2);
  color: var(--on-ground);
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--fs-200);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.toggle:hover { border-color: rgba(242, 236, 221, 0.55); }
.toggle__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  border: 1.5px solid var(--on-ground-3);
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.toggle__count {
  min-width: 1.5rem;
  padding: 0.1rem 0.35rem;
  text-align: center;
  border-radius: 2px;
  background: rgba(242, 236, 221, 0.12);
  font-variant-numeric: tabular-nums;
}
.toggle[aria-pressed="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}
.toggle[aria-pressed="true"] .toggle__dot {
  background: var(--ink);
  border-color: var(--ink);
}
.toggle[aria-pressed="true"] .toggle__count {
  background: rgba(22, 20, 15, 0.16);
  color: var(--ink);
}

.ledger__status {
  font-family: var(--font-mono);
  font-size: var(--fs-200);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-ground-2);
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line-dark);
  font-variant-numeric: tabular-nums;
}

/* ---------- Tickets ---------- */
.tickets {
  display: grid;
  gap: 1rem;
}

.ticket {
  position: relative;
}

.ticket__face {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem 8rem minmax(0, 1fr) 12.5rem auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 1.4rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 14px 34px -18px rgba(0, 0, 0, 0.9),
    0 2px 0 rgba(0, 0, 0, 0.35);
}
.ticket__face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(22, 20, 15, 0.018) 0 1px, transparent 1px 4px);
  opacity: 0.9;
}

.ticket__index {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  color: var(--ink-3);
}
.ticket__pin {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  background: var(--ground);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.ticket__num {
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  letter-spacing: 0.04em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.ticket__thumb {
  position: relative;
  width: 8rem;
  height: 6rem;
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.ticket__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition: transform 420ms var(--ease), filter 320ms var(--ease);
}
.ticket:hover .ticket__img,
.ticket:focus-within .ticket__img { transform: scale(1.045); filter: saturate(1) contrast(1.03); }
.ticket__thumbedge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(22, 20, 15, 0.18);
}

.ticket__main { min-width: 0; }

.ticket__tags { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }

.stamp {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-50);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1;
  padding: 0.3rem 0.5rem 0.26rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  color: var(--ink-2);
  white-space: nowrap;
}
.stamp[data-cat="Baking"] { color: var(--cat-baking); }
.stamp[data-cat="Ceramics"] { color: var(--cat-ceramics); }
.stamp[data-cat="Floristry"] { color: var(--cat-floristry); }
.stamp[data-cat="Painting"] { color: var(--cat-painting); }

.stamp--saved {
  display: none;
  color: var(--signal-deep);
  border-style: double;
  border-width: 3px;
  transform: rotate(-4deg);
}
.js-ticket-saved { display: none; }
.ticket[data-saved="true"] .js-ticket-saved { display: inline-flex; }

.ticket__title {
  font-weight: 800;
  font-stretch: 105%;
  font-size: var(--fs-700);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.ticket__desc {
  margin-top: 0.4rem;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: var(--fs-400);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket__who {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.ticket__data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1rem;
  padding-left: 1.4rem;
  border-left: 1px dashed var(--line-paper);
}
.ticket__datum { min-width: 0; }
.ticket__datum:first-child { grid-column: 1 / -1; }
.ticket__datum dt {
  font-family: var(--font-mono);
  font-size: var(--fs-50);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
  margin-bottom: 0.1rem;
}
.ticket__datum dd {
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  color: var(--ink);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.ticket__act { display: flex; justify-content: flex-end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.05rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-200);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }

.btn--open .btn__arrow { transition: transform 220ms var(--ease); }
.btn--open:hover .btn__arrow { transform: translateX(3px); }

/* Save = rubber stamp */
.btn--save {
  border-color: var(--signal-deep);
  color: var(--signal-deep);
  border-width: 2px;
}
.btn--save:hover { background: rgba(168, 51, 12, 0.08); color: var(--signal-deep); }
.btn--save[aria-pressed="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}
.btn--save[aria-pressed="true"]:hover {
  background: var(--signal-deep);
  border-color: var(--signal-deep);
  color: var(--paper);
}

.btn--close { border-color: var(--line-paper); color: var(--ink-2); }
.btn--close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn--ghost {
  border-color: var(--paper-3);
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Detail (unfolded work order) ---------- */
.detail {
  margin-top: 0.15rem;
  background: var(--paper);
  color: var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 20px 40px -22px rgba(0, 0, 0, 0.95);
  animation: unfold 320ms var(--ease) both;
}
@keyframes unfold {
  from { clip-path: inset(0 0 100% 0); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

.detail__rule {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--line-paper);
  margin: 0 1.4rem;
}
.detail__punch {
  position: absolute;
  left: -1.85rem;
  top: -0.55rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--ground);
}

.detail__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.6rem 1.4rem 1.7rem;
}

.detail__photo {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 0 0 1px rgba(22, 20, 15, 0.16);
}
.detail__img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail__body { min-width: 0; }
.detail__tags { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.detail__title {
  font-weight: 800;
  font-stretch: 110%;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.detail__text {
  margin-top: 0.75rem;
  max-width: 58ch;
  color: var(--ink-2);
  font-size: var(--fs-500);
  line-height: 1.65;
}

.detail__specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.4rem;
  margin-top: 1.4rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line-paper-soft);
}
.detail__specs dt {
  font-family: var(--font-mono);
  font-size: var(--fs-50);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-bottom: 0.15rem;
}
.detail__specs dd {
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.detail__specs > div:first-child { grid-column: 1 / -1; }

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.js-detail-saved { display: none; }
.detail[data-saved="true"] .js-detail-saved { display: inline-flex; }

.detail.is-stamping .js-detail-saved {
  animation: press 420ms var(--ease) both;
}
@keyframes press {
  0% { transform: scale(1.7) rotate(-14deg); opacity: 0; }
  55% { transform: scale(0.94) rotate(-7deg); opacity: 1; }
  100% { transform: scale(1) rotate(-4deg); opacity: 1; }
}

.detail__stampmark {
  position: absolute;
  right: 1.4rem;
  bottom: 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--line-paper);
  transform: rotate(-3deg);
  pointer-events: none;
}

/* ---------- Empty & error ---------- */
.empty,
.error {
  margin-top: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  border: 1.5px dashed var(--line-dark-strong);
  border-radius: var(--radius);
  background: var(--ground-2);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}
.empty__mark,
.error__title { color: var(--signal); }
.empty__mark { opacity: 0.85; }
.empty__title,
.error__title {
  font-size: var(--fs-600);
  font-weight: 800;
  font-stretch: 105%;
  letter-spacing: -0.01em;
}
.empty__text,
.error__text {
  max-width: 44ch;
  color: var(--on-ground-2);
  font-size: var(--fs-400);
}
.empty .btn--ghost,
.error .btn--ghost { margin-top: 0.6rem; color: var(--on-ground); border-color: var(--line-dark-strong); }
.empty .btn--ghost:hover,
.error .btn--ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- Colophon ---------- */
.colophon {
  border-top: 1px solid var(--line-dark);
}
.colophon__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 2rem 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
}
.colophon__note {
  max-width: 62ch;
  font-size: var(--fs-300);
  color: var(--on-ground-2);
}
.colophon__marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--on-ground-3);
}

/* ---------- Focus-visible on paper ---------- */
.ticket :focus-visible,
.detail :focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .masthead__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 1.5rem;
  }
  .brand__tag { grid-column: 1 / -1; order: 3; padding-bottom: 0; }
  .ledger__head { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .controls { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto; }
  .ticket__face {
    grid-template-columns: 2.75rem 7rem minmax(0, 1fr) 11rem;
    gap: 1.15rem;
  }
  .ticket__act { grid-column: 1 / -1; justify-content: stretch; }
  .btn--open { width: 100%; }
}

@media (max-width: 780px) {
  .masthead__inner { padding: 2rem 1.25rem 1.4rem; }
  .ledger { padding: 2rem 1.25rem 3.5rem; }
  .colophon__inner { padding: 1.75rem 1.25rem 3rem; }
  .controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .toggle { grid-column: 1 / -1; justify-content: center; }
  .ledger__status { padding-bottom: 1rem; }

  .ticket__face {
    grid-template-columns: 5.75rem minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "data data"
      "act act";
    align-items: start;
    gap: 1rem 1.1rem;
    padding: 1.1rem 1.1rem 1.2rem;
  }
  .ticket__index { display: none; }
  .ticket__thumb { grid-area: thumb; width: 5.75rem; height: 5.75rem; }
  .ticket__main { grid-area: main; }
  .ticket__data {
    grid-area: data;
    padding-left: 0;
    padding-top: 1rem;
    border-left: 0;
    border-top: 1px dashed var(--line-paper);
  }
  .ticket__act { grid-area: act; }
  .ticket__title { font-size: 1.35rem; }
  .ticket__desc { -webkit-line-clamp: 3; }

  .detail__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.25rem 1.1rem 1.4rem;
  }
  .detail__img { aspect-ratio: 16 / 10; }
  .detail__stampmark { display: none; }
}

@media (max-width: 430px) {
  .masthead__inner { padding: 1.5rem 1.1rem 1.2rem; row-gap: 1rem; }
  .brand__name { font-size: 3rem; }
  .brand__tag { font-size: var(--fs-100); }
  .masthead__meta {
    grid-auto-flow: column;
    gap: 1rem;
    text-align: left;
    padding-bottom: 0;
  }
  .masthead__meta dd { font-size: var(--fs-200); }
  .ledger { padding: 1.5rem 1.1rem 3rem; }
  .controls { grid-template-columns: minmax(0, 1fr) auto; }
  .field--search { grid-column: 1 / -1; }
  .field--select { grid-column: 1; }
  .toggle { grid-column: 2; }
  .ticket__face {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "thumb"
      "main"
      "data"
      "act";
  }
  .ticket__thumb { width: 100%; height: 10.5rem; }
  .detail__specs { grid-template-columns: minmax(0, 1fr); gap: 0.85rem; }
  .detail__actions .btn { flex: 1 1 auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .detail { animation: none; }
  .detail.is-stamping .js-detail-saved { animation: none; }
  .ticket__img,
  .btn,
  .btn__arrow { transition: none; }
  * { scroll-behavior: auto !important; }
}
