:root {
  color-scheme: light;
  font-family:
    Inter,
    "Noto Sans JP",
    "Yu Gothic UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: #201c16;
  background: #eee8dc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #201c16;
  --muted: #746e64;
  --paper: #fffdf8;
  --line: rgb(55 45 31 / 14%);
  --give: #ee6b56;
  --give-soft: #fff0e9;
  --want: #3a88a6;
  --want-soft: #e9f5f8;
  --match: #e7b93f;
  --green: #2e684f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 86% 3%, rgb(231 185 63 / 22%), transparent 22rem),
    radial-gradient(circle at 5% 40%, rgb(58 136 166 / 10%), transparent 25rem), #f3efe6;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 50;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--ink);
  transform: translateY(-110%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
footer,
main {
  width: min(78rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header,
.site-header nav,
.brand,
footer,
footer nav,
.panel-heading,
.sticker-tray header,
.card-heading,
.compare-dock > header,
.match-result > header,
.manage-heading,
.status-row,
.control-row,
.ticket-actions,
.result-actions,
.card-tools {
  display: flex;
  align-items: center;
}

.site-header {
  min-height: 4.25rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.site-header nav {
  gap: 1.1rem;
  font-size: 0.8rem;
  font-weight: 750;
}

.site-header nav a {
  text-decoration: none;
}

.brand {
  gap: 0.65rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 2rem;
  height: 1.55rem;
}

.brand-mark i {
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--give-soft);
  border: 2px solid var(--give);
  border-radius: 0.35rem;
  box-shadow: 0 0.18rem 0 rgb(117 49 35 / 18%);
  transform: rotate(-7deg);
}

.brand-mark i:last-child {
  inset: 0 0 0 auto;
  background: var(--want-soft);
  border-color: var(--want);
  transform: rotate(7deg);
}

.nav-cta {
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  color: white;
  background: var(--ink);
  border-radius: 0.65rem;
}

footer {
  min-height: 6rem;
  justify-content: space-between;
  gap: 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

footer nav {
  gap: 1rem;
}

.builder-shell,
.card-shell,
.manage-shell,
.guide-shell {
  padding-block: 1.75rem 4rem;
}

.product-heading {
  display: grid;
  min-height: 9rem;
  padding: 0.6rem 0.35rem 1.55rem;
  align-items: center;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr) 18rem;
}

.heading-copy > p:last-child,
.card-heading p,
.manage-heading p,
.guide-shell header p,
.prose p,
.empty-shell p {
  color: var(--muted);
  line-height: 1.75;
}

.heading-copy > p:last-child {
  max-width: 40rem;
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 0.38rem;
  color: #9d4c3c;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

h1,
h2,
p {
  max-width: 48rem;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  line-height: 1.2;
}

h2 {
  font-size: 1rem;
}

.overlap-emblem {
  position: relative;
  width: 17rem;
  height: 6.5rem;
  margin-inline: auto;
}

.emblem-tray {
  position: absolute;
  top: 0.55rem;
  display: grid;
  width: 10rem;
  height: 5.4rem;
  padding: 0.75rem;
  background: rgb(255 240 233 / 90%);
  border: 1px solid rgb(238 107 86 / 45%);
  border-radius: 1rem;
  box-shadow: 0 0.7rem 1.4rem rgb(67 43 30 / 10%);
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  transform: rotate(-5deg);
}

.emblem-tray.right {
  right: 0;
  background: rgb(233 245 248 / 90%);
  border-color: rgb(58 136 166 / 45%);
  transform: rotate(5deg);
}

.emblem-tray i,
.mini-tray i,
.mini-match i {
  display: grid;
  min-width: 0;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 0.18rem 0 rgb(59 48 35 / 12%);
}

.overlap-emblem > b {
  position: absolute;
  inset: 50% 50% auto auto;
  z-index: 2;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  color: var(--ink);
  background: var(--match);
  border: 4px solid #f3efe6;
  border-radius: 50%;
  place-items: center;
  transform: translate(50%, -50%);
}

.notice {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: #fff8db;
  border: 1px solid #e7c967;
  border-radius: 0.8rem;
  font-size: 0.83rem;
  font-weight: 750;
}

.notice.error,
.manage-message.error {
  color: #8e3028;
}

.builder-workspace {
  display: grid;
  overflow: hidden;
  min-height: 43rem;
  background: rgb(255 253 248 / 92%);
  border: 1px solid var(--line);
  border-radius: 1.3rem;
  box-shadow: 0 1.6rem 4rem rgb(67 51 28 / 11%);
  grid-template-columns: minmax(19rem, 0.92fr) minmax(0, 1.08fr);
}

.builder-panel,
.preview-panel {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 1.85rem);
}

.builder-panel {
  display: flex;
  gap: 1.05rem;
  flex-direction: column;
  background: #fffdf8;
  border-right: 1px solid var(--line);
}

.preview-panel {
  display: grid;
  gap: 1.2rem;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgb(45 37 27 / 3%) 32px), #eae6dc;
  grid-template-rows: auto 1fr auto;
}

.panel-heading {
  min-height: 2.7rem;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading > span,
.compare-dock > header > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.field {
  display: grid;
  gap: 0.45rem;
  color: #514b43;
  font-size: 0.76rem;
  font-weight: 850;
}

.field > span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.field > span small {
  color: var(--muted);
  font-weight: 650;
}

.field i {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  background: var(--give);
  border-radius: 0.18rem;
  transform: rotate(-5deg);
}

.want-field i {
  background: var(--want);
  transform: rotate(5deg);
}

input,
textarea {
  width: 100%;
  color: var(--ink);
  background: white;
  border: 1px solid #d5cec1;
  border-radius: 0.7rem;
}

input {
  min-height: 2.7rem;
  padding: 0.65rem 0.78rem;
}

textarea {
  min-height: 8.4rem;
  padding: 0.78rem;
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: #a7a096;
}

.list-inputs,
.compare-inputs {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field > small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.55rem;
  color: #514b43;
  font-size: 0.76rem;
  font-weight: 850;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.choice-row label {
  position: relative;
}

.choice-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-row span {
  display: inline-flex;
  min-height: 2.35rem;
  padding-inline: 0.9rem;
  align-items: center;
  background: white;
  border: 1px solid #d5cec1;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.choice-row input:checked + span {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.button {
  display: inline-flex;
  min-height: 2.8rem;
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--ink);
  border-radius: 0.7rem;
  font-weight: 900;
  text-decoration: none;
}

.primary {
  color: white;
  background: var(--ink);
}

.secondary {
  color: var(--ink);
  background: white;
}

.form-boundary {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  text-align: center;
}

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

.tray-stage {
  display: grid;
  min-height: 30rem;
  align-content: center;
  grid-template-columns: minmax(0, 1fr) 4rem minmax(0, 1fr);
}

.sticker-tray {
  position: relative;
  min-width: 0;
  min-height: 20rem;
  padding: 1rem;
  background: var(--give-soft);
  border: 1px solid rgb(238 107 86 / 38%);
  border-radius: 1.15rem;
  box-shadow: 0 0.8rem 1.6rem rgb(62 46 31 / 9%);
  transform: rotate(-1.8deg);
}

.sticker-tray.want {
  background: var(--want-soft);
  border-color: rgb(58 136 166 / 35%);
  transform: rotate(1.8deg);
}

.sticker-tray header {
  min-height: 2.7rem;
  gap: 0.5rem;
  border-bottom: 1px dashed rgb(48 39 27 / 20%);
}

.sticker-tray header strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.tray-dot {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--give);
  border-radius: 0.2rem;
  box-shadow: 0 0 0 4px rgb(238 107 86 / 12%);
}

.want .tray-dot {
  background: var(--want);
  box-shadow: 0 0 0 4px rgb(58 136 166 / 12%);
}

.sticker-grid {
  display: grid;
  padding-top: 1rem;
  gap: 0.62rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sticker {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0.25rem;
  place-items: center;
  color: #3b332b;
  background: linear-gradient(135deg, rgb(255 255 255 / 70%), transparent 48%), #fffdf8;
  border: 1px solid rgb(65 53 36 / 14%);
  border-radius: 0.55rem;
  box-shadow: 0 0.22rem 0 rgb(73 54 31 / 15%);
  text-align: center;
  transform: rotate(-1deg);
}

.sticker:nth-child(2n) {
  transform: rotate(1.5deg);
}

.sticker:nth-child(3n) {
  transform: rotate(-2deg);
}

.sticker b {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(0.58rem, 1.4vw, 0.78rem);
  text-overflow: ellipsis;
}

.sticker small {
  position: absolute;
  inset: 0.18rem 0.22rem auto auto;
  display: grid;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0.1rem;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.56rem;
  place-items: center;
}

.match-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-direction: column;
}

.match-rail span {
  width: 1px;
  height: 4rem;
  background: linear-gradient(transparent, rgb(50 41 28 / 30%));
}

.match-rail span:last-child {
  background: linear-gradient(rgb(50 41 28 / 30%), transparent);
}

.match-rail b {
  color: var(--muted);
  font-size: 0.6rem;
  writing-mode: vertical-rl;
}

.match-rail strong {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  background: var(--match);
  border: 4px solid #eae6dc;
  border-radius: 50%;
  place-items: center;
  box-shadow: 0 0.4rem 1rem rgb(90 66 11 / 20%);
}

.preview-caption {
  display: flex;
  padding: 0.9rem 1rem;
  align-items: center;
  gap: 0.8rem;
  background: rgb(255 253 248 / 72%);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

.preview-caption p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.caption-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  background: var(--match);
  border-radius: 50%;
  place-items: center;
  font-weight: 900;
}

.card-shell {
  max-width: 68rem;
  margin-inline: auto;
}

.card-heading {
  min-height: 8rem;
  padding-inline: 0.3rem;
  justify-content: space-between;
  gap: 2rem;
}

.card-heading p {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
}

.card-meta {
  display: grid;
  min-width: 6.5rem;
  padding: 0.8rem 1rem;
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  text-align: center;
}

.card-meta span {
  color: var(--muted);
  font-size: 0.62rem;
}

.owner-trays {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr);
}

.owner-trays .sticker-tray {
  min-height: 17rem;
}

.owner-trays .sticker-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-spine {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin: auto;
  background: var(--match);
  border-radius: 50%;
  place-items: center;
  font-weight: 900;
}

.compare-dock,
.match-result {
  margin-top: 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: 0 1rem 2.5rem rgb(65 49 26 / 8%);
}

.compare-dock > header {
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.compare-inputs textarea {
  min-height: 7rem;
}

.overlap-button {
  width: 100%;
  margin-top: 1rem;
  color: var(--ink);
  background: var(--match);
  border-color: #bb8d18;
}

.button-trays {
  position: relative;
  display: inline-block;
  width: 1.6rem;
  height: 1.1rem;
}

.button-trays i {
  position: absolute;
  width: 1rem;
  height: 1rem;
  background: var(--give);
  border: 2px solid white;
  border-radius: 0.25rem;
  transform: rotate(-8deg);
}

.button-trays i:last-child {
  right: 0;
  background: var(--want);
  transform: rotate(8deg);
}

.match-result {
  background: radial-gradient(circle at 90% 10%, rgb(231 185 63 / 20%), transparent 12rem), #fffdf8;
  border-color: #d8b75a;
}

.match-result[hidden] {
  display: none;
}

.match-result > header {
  gap: 0.85rem;
}

.match-result > header > strong {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin-left: auto;
  background: var(--match);
  border-radius: 50%;
  place-items: center;
}

.match-orbit {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  background: var(--ink);
  border-radius: 50%;
  color: white;
  place-items: center;
}

.result-columns {
  display: grid;
  margin-block: 1.2rem;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-columns > section {
  padding: 0.9rem;
  background: #f7f3ea;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.result-columns > section > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.result-stickers {
  display: flex;
  min-height: 4rem;
  padding-top: 0.7rem;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.result-stickers .sticker {
  width: 3.6rem;
  aspect-ratio: 1;
}

.result-stickers .match {
  outline: 3px solid rgb(231 185 63 / 55%);
  outline-offset: 2px;
}

.result-empty {
  color: #9a9389;
  font-size: 0.78rem;
}

.result-actions {
  justify-content: flex-end;
  gap: 0.6rem;
}

.card-tools {
  padding: 1rem 0.3rem 0;
  justify-content: flex-end;
  gap: 1rem;
}

.text-link,
.text-button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.7rem;
}

.manage-shell {
  max-width: 68rem;
  margin-inline: auto;
}

.manage-heading {
  min-height: 10rem;
  gap: 1.2rem;
}

.manage-heading p {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
}

.manage-key {
  position: relative;
  width: 5rem;
  height: 4rem;
  flex: 0 0 auto;
}

.manage-key i {
  position: absolute;
  top: 0.5rem;
  width: 3rem;
  height: 3rem;
  background: var(--give-soft);
  border: 2px solid var(--give);
  border-radius: 0.7rem;
  transform: rotate(-8deg);
}

.manage-key i:nth-child(2) {
  right: 0;
  background: var(--want-soft);
  border-color: var(--want);
  transform: rotate(8deg);
}

.manage-key span {
  position: absolute;
  inset: 50% 50% auto auto;
  z-index: 2;
  display: grid;
  width: 2rem;
  height: 2rem;
  background: var(--match);
  border: 3px solid #f3efe6;
  border-radius: 50%;
  place-items: center;
  transform: translate(50%, -50%);
}

.manage-grid {
  display: grid;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: 0 1rem 3rem rgb(65 49 26 / 9%);
  grid-template-columns: 1.15fr 0.85fr;
}

.share-ticket,
.manage-controls {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.share-ticket {
  display: flex;
  gap: 0.9rem;
  flex-direction: column;
  background: radial-gradient(circle at 10% 10%, rgb(238 107 86 / 13%), transparent 15rem), #f7f2e8;
  border-right: 1px dashed rgb(54 43 29 / 25%);
}

.share-ticket > span,
.status-row span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.share-ticket > strong {
  font-size: 1.25rem;
}

.share-ticket code {
  display: block;
  overflow: hidden;
  padding: 0.85rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-actions,
.control-row {
  flex-wrap: wrap;
  gap: 0.55rem;
}

.manage-controls {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

.status-row {
  justify-content: space-between;
}

.status-row strong {
  padding: 0.35rem 0.65rem;
  color: #1e684b;
  background: #e7f4ec;
  border-radius: 999px;
  font-size: 0.72rem;
}

.manage-controls > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.65;
}

.danger-button {
  align-self: flex-start;
  padding: 0;
  color: #a33f35;
  background: transparent;
  border: 0;
  font-size: 0.72rem;
  text-decoration: underline;
}

.manage-message {
  min-height: 1.2rem;
}

.guide-shell,
.prose,
.empty-shell {
  max-width: 68rem;
  margin-inline: auto;
}

.guide-shell > header {
  padding-block: 2rem;
}

.guide-shell > header p {
  margin-bottom: 0.4rem;
}

.guide-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-grid > section {
  position: relative;
  min-height: 18rem;
  padding: 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.step-number {
  display: grid;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  place-items: center;
  font-weight: 900;
}

.mini-tray,
.mini-match {
  display: grid;
  height: 6rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--give-soft);
  border: 1px solid rgb(238 107 86 / 35%);
  border-radius: 0.8rem;
  gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
  transform: rotate(-1deg);
}

.mini-tray.want {
  background: var(--want-soft);
  border-color: rgb(58 136 166 / 35%);
  transform: rotate(1deg);
}

.mini-match {
  align-items: center;
  background: #f6efd8;
  border-color: #d8b75a;
}

.mini-match b {
  text-align: center;
}

.guide-grid p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.safety-board {
  display: grid;
  margin-top: 1rem;
  padding: 1.3rem;
  align-items: center;
  gap: 1rem;
  background: #26362f;
  border-radius: 1rem;
  color: white;
  grid-template-columns: 1fr auto;
}

.safety-board p {
  margin: 0;
  color: #ccd6d1;
  font-size: 0.76rem;
  line-height: 1.65;
}

.safety-board .button {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--ink);
  background: var(--match);
  border-color: var(--match);
}

.prose {
  max-width: 48rem;
  padding-block: 4rem 5rem;
}

.prose h1 {
  margin-bottom: 2.2rem;
}

.prose h2 {
  margin-top: 2rem;
}

.prose p {
  font-size: 0.86rem;
}

.empty-shell {
  display: grid;
  min-height: 35rem;
  padding-block: 5rem;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-shell p {
  margin: 0.5rem 0 1.3rem;
}

.empty-tray {
  display: grid;
  width: 8rem;
  height: 6rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  border: 1px dashed #aaa194;
  border-radius: 1rem;
  gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
}

.empty-tray i {
  border: 1px dashed #c5bcae;
  border-radius: 0.45rem;
}

.button:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.choice-row input:focus-visible + span {
  outline: 3px solid #d39e16;
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .product-heading {
    grid-template-columns: 1fr 13rem;
  }

  .overlap-emblem {
    width: 13rem;
    transform: scale(0.82);
    transform-origin: right center;
  }

  .builder-workspace {
    grid-template-columns: 1fr;
  }

  .builder-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tray-stage {
    min-height: 27rem;
  }

  .owner-trays .sticker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .manage-grid {
    grid-template-columns: 1fr;
  }

  .share-ticket {
    border-right: 0;
    border-bottom: 1px dashed rgb(54 43 29 / 25%);
  }
}

@media (max-width: 640px) {
  .site-header,
  footer,
  main {
    width: min(100% - 1rem, 78rem);
  }

  .site-header {
    min-height: 3.7rem;
  }

  .site-header nav {
    gap: 0.7rem;
  }

  .site-header nav > a:not(.nav-cta) {
    display: none;
  }

  .builder-shell,
  .card-shell,
  .manage-shell,
  .guide-shell {
    padding-block: 1rem 2.5rem;
  }

  .product-heading {
    min-height: auto;
    padding: 0.7rem 0.25rem 1.2rem;
    gap: 0.7rem;
    grid-template-columns: 1fr 5rem;
  }

  h1 {
    font-size: 1.48rem;
  }

  .heading-copy > p:last-child {
    font-size: 0.78rem;
  }

  .overlap-emblem {
    width: 5rem;
    height: 5rem;
    transform: scale(0.5);
    transform-origin: center;
  }

  .builder-workspace {
    min-height: 0;
    border-radius: 0.9rem;
  }

  .builder-panel,
  .preview-panel {
    padding: 1rem;
  }

  .list-inputs,
  .compare-inputs {
    grid-template-columns: 1fr;
  }

  .tray-stage {
    min-height: 24rem;
    grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr);
  }

  .sticker-tray {
    min-height: 17rem;
    padding: 0.7rem;
    border-radius: 0.8rem;
  }

  .sticker-tray header h2 {
    font-size: 0.78rem;
  }

  .sticker-grid {
    gap: 0.38rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-rail strong {
    width: 2.2rem;
    height: 2.2rem;
    border-width: 3px;
  }

  .preview-caption {
    align-items: flex-start;
  }

  .card-heading {
    min-height: 7rem;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
  }

  .card-meta {
    grid-auto-flow: column;
    align-items: center;
    gap: 0.5rem;
  }

  .owner-trays {
    grid-template-columns: minmax(0, 1fr) 2.4rem minmax(0, 1fr);
  }

  .owner-trays .sticker-tray {
    min-height: 14rem;
  }

  .owner-trays .sticker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-spine {
    width: 2rem;
    height: 2rem;
  }

  .compare-dock,
  .match-result {
    padding: 1rem;
    border-radius: 0.85rem;
  }

  .compare-dock > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-columns,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .result-actions,
  .ticket-actions,
  .control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .manage-heading {
    min-height: 8rem;
    align-items: flex-start;
  }

  .manage-key {
    width: 3.6rem;
    transform: scale(0.75);
    transform-origin: left top;
  }

  .safety-board {
    grid-template-columns: 1fr;
  }

  .safety-board .button {
    grid-column: 1;
    grid-row: auto;
  }

  footer {
    min-height: 7rem;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 0.7rem;
  }
}

@media print {
  .site-header,
  footer,
  .compare-dock,
  .card-tools,
  .result-actions {
    display: none;
  }

  body {
    background: white;
  }

  .card-shell {
    padding: 0;
  }
}
