.cardboard-game .rpg-inventory[data-view='craft'] {
  height: calc(var(--panel-width) * 992 / 1586);
  overflow: visible;
}

.cardboard-game .rpg-inventory[data-view='craft'] .pack-body {
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 0;
  transform: none;
  overflow: visible;
  container-type: inline-size;
}

.trial-table {
  --u: calc(100cqw / 1586);
  --bench-paper: #f7d399;
  --bench-ink: #451d0f;
  --sideboard: url('assets/craft-reference/sideboard.webp');
  --bench-label: url('assets/cardboard/paper-label.webp');
  --bench-red: url('assets/cardboard/red-label.webp');
  --bench-wood: url('assets/craft-reference/compact-desk.webp');
  --bench-felt: url('assets/craft-reference/compact-mat.webp');
  --bench-shadow: #251408a8;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  color: var(--bench-ink);
  font: 700 max(12px, calc(25 * var(--u)))/1.12 Georgia, 'Times New Roman', serif;
}
.trial-table::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--sideboard) center / 100% 100% no-repeat;
  clip-path: polygon(3.2% 9%, 3.6% 6.2%, 5.8% 4.4%, 8.9% 3.7%, 34.7% 3.1%, 36.6% 1.7%,
    43% 1%, 62% 1%, 64% 1.5%, 65.3% 3.5%, 91.4% 4.1%, 92.4% 2%, 93.5% 1%, 96% 1.2%, 97.5% 3.8%,
    97% 8.4%, 96.9% 84.9%, 97.9% 85.1%, 98.4% 88.2%, 98.2% 94.5%, 97.2% 96.3%, 3.5% 96.3%,
    1.9% 94.1%, 1.5% 87.6%, 2.7% 85.2%, 3.4% 84.8%);
}

.trial-table :is(h3, h4, p) { margin: 0; }
.trial-table button:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 2px; }
.trial-toolbar, .trial-toolbar nav { display: contents; }

.trial-toolbar button, .trial-close, .bench-recipe-side, .bench-mat, .bench-footer, .trial-warning, .bench-backpack {
  position: absolute;
  inset: calc(var(--y) * var(--u)) auto auto calc(var(--x) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
}

.trial-heading {
  position: absolute;
  inset: calc(19 * var(--u)) auto auto calc(634 * var(--u));
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: calc(2 * var(--u));
  width: calc(321 * var(--u));
  height: calc(72 * var(--u));
  padding: 0 calc(8 * var(--u));
  color: #ffdda2;
  font-size: max(16px, calc(44 * var(--u)));
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px #311609;
  white-space: nowrap;
}
.trial-heading::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: linear-gradient(#602b184f, #41150569), var(--bench-wood) center / 100% 180% no-repeat;
  mask: linear-gradient(to right, transparent, #000 4% 96%, transparent),
    linear-gradient(transparent, #000 9% 90%, transparent);
  mask-composite: intersect;
}
.trial-heading small { font-size: max(11px, calc(25 * var(--u))); }
.trial-table[data-stage='tutorial'] .trial-heading { font-size: max(16px, calc(33 * var(--u))); }

.trial-toolbar button span, .trial-toolbar button img {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.cardboard-game .trial-table :is(.trial-toolbar button, .trial-close) {
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 1;
  color: transparent;
}
.trial-close { --x: 1461; --y: 23; --w: 76; --h: 76; z-index: 7; border-radius: 50%; }
.trial-close:hover, .trial-toolbar button:not(:disabled):hover { backdrop-filter: brightness(1.14); }
.trial-toolbar button { border-radius: .33em; }
.trial-toolbar [data-trial-category='weapon'] { --x: 114; --y: 115; --w: 263; --h: 72; }
.trial-toolbar [data-trial-category='armor'] { --x: 389; --y: 117; --w: 217; --h: 69; }
.trial-toolbar [data-trial-category='jewelry'] { --x: 624; --y: 117; --w: 296; --h: 69; }
.trial-toolbar [data-trial-mode='assembly'] { --x: 1009; --y: 117; --w: 239; --h: 68; }
.trial-toolbar [data-trial-mode='upgrade'] { --x: 1252; --y: 117; --w: 240; --h: 68; }
.trial-toolbar button[aria-pressed='true'] {
  box-shadow: inset 0 0 0 calc(3 * var(--u)) #ffda9b, 0 0 calc(17 * var(--u)) #f7a637a8;
}
.trial-toolbar :is([data-trial-category='weapon'], [data-trial-mode='assembly'])[aria-pressed='false'] {
  backdrop-filter: brightness(.83) saturate(.81);
}
.cardboard-game .trial-toolbar [data-trial-category='weapon'][aria-pressed='false'] {
  background: url('assets/craft-reference/weapon-tab-neutral.webp') center / 109% 119% no-repeat;
}
.trial-toolbar button:disabled { cursor: default; }
.cardboard-game .trial-toolbar [data-trial-category][data-school-locked],
.cardboard-game .trial-toolbar [data-trial-category][data-school-locked]:hover,
.cardboard-game .trial-table[data-no-school] .trial-toolbar [data-trial-mode] {
  backdrop-filter: grayscale(1) brightness(.78);
  filter: grayscale(1);
}
.trial-toolbar [data-trial-category][data-school-locked][aria-expanded='true'] {
  box-shadow: inset 0 0 0 2px #eee0c6;
}

.bench-school-info {
  position: absolute;
  inset: calc(196 * var(--u)) 24% auto;
  z-index: 4;
  padding: .52em 1.05em .6em;
  background: var(--bench-label) center / 100% 100% no-repeat;
  filter: drop-shadow(0 3px 3px #2a120ca6);
  color: var(--bench-ink);
  font-size: max(13px, calc(23 * var(--u)));
  line-height: 1.22;
  text-align: center;
}
.bench-school-info strong { display: block; margin-bottom: .2em; font-size: 1.14em; }
.trial-table[data-no-school] .bench-school-info { inset: 45% 23% auto; padding: 1em; }

.bench-recipe-side { --x: 128; --y: 317; --w: 470; --h: 560; z-index: 3; display: flex; flex-direction: column; gap: calc(13 * var(--u)); }
.cardboard-game .bench-recipe-heading {
  align-self: center;
  min-height: calc(63 * var(--u));
  width: 66%;
  margin-left: 12%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  touch-action: pan-x;
}
.bench-recipe-heading:hover { backdrop-filter: brightness(1.11); }
.bench-recipe-rail {
  display: grid;
  align-content: start;
  min-height: 0;
  flex: 1;
  padding: calc(12 * var(--u)) calc(10 * var(--u)) calc(13 * var(--u));
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #bd8053 #4f2a17;
  background: var(--bench-wood) center / calc(220 * var(--u)) auto #6a3d23;
  box-shadow: inset 0 0 calc(20 * var(--u)) #30190b;
}

.cardboard-game .bench-recipe-card {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr);
  align-items: center;
  gap: .34em;
  width: 100%;
  min-height: calc(116 * var(--u));
  padding: calc(12 * var(--u)) calc(21 * var(--u));
  margin: 0;
  border: 0;
  border-radius: .36em;
  background: var(--bench-label) center / 100% 100% no-repeat;
  color: var(--bench-ink);
  text-align: left;
  font: inherit;
  font-size: max(15px, calc(31 * var(--u)));
  line-height: 1;
  filter: drop-shadow(0 calc(5 * var(--u)) calc(3 * var(--u)) var(--bench-shadow));
}
.bench-recipe-card:not(:first-child) { margin-top: calc(13 * var(--u)); }
.bench-recipe-card img { width: 100%; height: calc(91 * var(--u)); object-fit: contain; }
.bench-recipe-card[aria-pressed='true'] {
  touch-action: pan-x;
  box-shadow: inset 0 0 calc(10 * var(--u)) #ffc45d, 0 0 0 calc(2 * var(--u)) #ffcb6c, 0 0 calc(11 * var(--u)) #ffa32f;
}
.bench-recipe-card:disabled { filter: sepia(.3) saturate(.63) brightness(.92); opacity: 1; }
.bench-recipe-fold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .32s cubic-bezier(.22,.8,.25,1), opacity .22s ease;
}
.bench-recipe-fold > div { min-height: 0; overflow: hidden; }
.bench-recipe-rail[data-expanded='true'] .bench-recipe-fold {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
}
.bench-recipe-content {
  padding: calc(8 * var(--u)) calc(17 * var(--u)) calc(6 * var(--u));
}
.bench-output-tag {
  position: relative;
  margin-top: calc(8 * var(--u));
  padding: .47em .7em .55em 1.39em;
  background: var(--bench-label) center / 100% 100% no-repeat;
  filter: drop-shadow(0 .12em .12em var(--bench-shadow));
  font-size: max(14px, calc(24 * var(--u)));
}
.bench-output-tag::before {
  content: '';
  position: absolute;
  top: .81em;
  left: .67em;
  width: .31em;
  aspect-ratio: 1;
  border: 1px solid #73431f;
  border-radius: 50%;
  background: #50351d;
}
.bench-output-tag::after {
  content: '';
  position: absolute;
  top: .28em;
  left: .22em;
  width: .66em;
  height: .63em;
  transform: rotate(23deg);
  border: solid #88562f;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 75% 0;
  pointer-events: none;
}
.bench-output-tag header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .23em .55em; }
.bench-output-tag header strong { color: #843f24; }
.bench-output-tag header small, .bench-output-tag p { font-size: .78em; }
.trial-table .bench-output-tag p { margin-top: .35em; line-height: 1.25; }
.bench-output-stats { margin: .28em 0 0; }
.bench-output-stats > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5em;
  padding: .23em 0;
  border-top: 1px dashed #87492565;
}
.bench-output-stats dd { margin: 0; color: #465222; font-variant-numeric: tabular-nums; }
.bench-recipe-book {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .46em;
  margin-top: .25em;
  padding: .37em .55em .5em;
  color: #4d2916;
  background: var(--bench-label) center / 100% 100% no-repeat;
  font-size: max(13px, calc(23 * var(--u)));
  line-height: 1.15;
}
.bench-recipe-book img { width: 2em; height: 2em; object-fit: contain; }
.bench-recipe-book small { display: block; margin-top: .15em; font-size: .82em; color: #4b622e; }
.bench-recipe-book[data-known='false'] {
  box-shadow: inset .25em 0 #a54f28;
}
.bench-recipe-book[data-known='false'] small { color: #882d23; }
.bench-paper-action, .bench-choices button, .bench-operations button {
  padding: .32em .51em;
  border: 0;
  background: var(--bench-label) center / 100% 100% no-repeat;
  color: var(--bench-ink);
  font: inherit;
  font-size: max(11px, calc(20 * var(--u)));
}
.bench-choices, .bench-operations { display: flex; flex-wrap: wrap; gap: .24em; }
.bench-aspects {
  background: var(--bench-wood) center / calc(220 * var(--u)) auto #6a3d23;
  border-radius: .28em;
}
.bench-aspects .bench-choices { justify-content: center; padding: .23em .25em; }
.bench-aspects .bench-choices button {
  min-height: max(24px, calc(38 * var(--u)));
  padding: .28em .39em;
  font-size: max(10px, calc(16 * var(--u)));
}
.bench-operations {
  justify-content: center;
  margin-bottom: calc(-13 * var(--u));
  padding: calc(8 * var(--u)) 0;
  background: var(--bench-wood) center / calc(220 * var(--u)) auto #6a3d23;
}
.bench-choices { padding: .28em 0; }
.bench-choices button[aria-pressed='true'], .bench-operations button[aria-pressed='true'] { background-image: var(--bench-red); color: #fff2c0; }

.bench-mat {
  --x: 631;
  --y: 314;
  --w: 829;
  --h: 442;
  display: grid;
  justify-items: center;
  padding-top: calc(9 * var(--u));
  border: calc(5 * var(--u)) solid #aa672b;
  border-radius: 9% 4% 6% 7% / 12% 8% 10% 10%;
  background: var(--bench-felt) 0 58% / 117% 115% no-repeat #42482b;
  box-shadow: inset 0 0 calc(16 * var(--u)) #34270f9c, 0 calc(5 * var(--u)) calc(5 * var(--u)) var(--bench-shadow);
}
.bench-mat > h4 {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40%;
  height: calc(61 * var(--u));
  background: var(--bench-label) center / 100% 100% no-repeat;
  font-size: max(18px, calc(43 * var(--u)));
}
.bench-mat-parts {
  position: absolute;
  inset: 15% 4% 4% 4%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2%;
}
.cardboard-game .bench-mat-slot {
  display: grid;
  align-content: center;
  justify-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  min-width: 0;
  padding: .25em;
  border: 1px dashed #d9cb8b82;
  border-radius: .62em;
  background: #242f1b32;
  color: #f9e5ad;
  font: inherit;
  text-shadow: 0 1px #1e1f0e;
}
.bench-mat-slot img { width: 100%; height: 100%; min-height: 0; object-fit: contain; pointer-events: none; }
.bench-mat-slot:not(.is-filled) img { opacity: .54; filter: grayscale(1) sepia(.65) brightness(1.58); }
.bench-part-label {
  display: grid;
  justify-items: center;
  justify-self: stretch;
  gap: .15em;
  max-width: 100%;
  padding: .25em .33em;
  color: #ffe8b1;
  background: #282c18e8;
  border: 1px solid #a59a61;
  border-radius: .15em .5em .2em .42em;
  text-align: center;
  text-shadow: none;
  font-size: max(12px, calc(20 * var(--u)));
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.bench-part-status { font-size: max(10px, .8em); color: #e0cb97; }
.bench-mat-slot.is-filled .bench-part-status { color: #d5e49b; }
.bench-mat-slot:is(:hover, [aria-expanded='true'], [data-valid-drop='true']):not(:disabled) {
  border-color: #ffdb8d;
  background-color: #e7b45928;
}
.cardboard-game .bench-mat-slot.is-filled { border-color: transparent; background-color: transparent; }
.bench-mat-slot[data-position='2'] { grid-row: 2; grid-column: 1; }
.bench-mat-slot[data-position='3'] { grid-row: 2; grid-column: 2; }
.bench-mat-slot[data-position='4'] { grid-row: 2; grid-column: 3; }
.bench-mat-slot[data-position='5'] { grid-row: 1; grid-column: 3; }
.bench-mat-parts[data-count='1'] .bench-mat-slot { grid-row: span 2; }
.bench-mat-parts[data-count='2'] .bench-mat-slot { grid-row: span 2; }
.bench-mat-parts[data-count='2'] .bench-mat-slot:first-child { grid-column: 1; }
.bench-mat-parts[data-count='2'] .bench-mat-slot:nth-child(2) { grid-column: 2; }
.trial-table[data-stage='tutorial'] .bench-mat-parts[data-count='2'] .bench-mat-slot {
  position: absolute;
  grid-area: auto;
  top: 6%;
  left: 1%;
  width: 42%;
  height: 93%;
  border-color: transparent;
  background: transparent;
}
.trial-table[data-stage='tutorial'] .bench-mat-parts[data-count='2'] .bench-mat-slot[data-tutorial-slot='1'] {
  left: 40%;
  top: 24%;
  width: 37%;
  height: 63%;
}
.trial-table[data-stage='tutorial'] .bench-part-label { justify-self: center; min-width: 68%; }
.trial-table .bench-mat-parts[data-count] .bench-mat-slot.is-repositioned {
  z-index: 2;
  position: absolute;
  grid-area: auto;
  inset: var(--piece-y) auto auto var(--piece-x);
  width: 29%;
  height: 48%;
  transform: translate(-50%, -50%);
}
.bench-wire-outline > .bench-chalk-coil {
  align-self: center;
  width: calc(232 * var(--u));
  height: min(100%, calc(201 * var(--u)));
  max-width: 100%;
  background-image: var(--sideboard);
  background-size: calc(1586 * var(--u)) calc(992 * var(--u));
  background-position: calc(-1000 * var(--u)) calc(-462 * var(--u));
  mask-image: radial-gradient(ellipse at 50% 55%, black 51%, transparent 72%);
}
.bench-mat.is-working .bench-mat-parts { animation: bench-rattle .15s 5 alternate; }
@keyframes bench-rattle { to { transform: rotate(.8deg); filter: brightness(1.18); } }

.bench-wrap-scene {
  position: absolute;
  inset: 16% 5% 5%;
  overflow: hidden;
  pointer-events: none;
}
.bench-wrap-scene img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 47%;
  height: 96%;
  object-fit: contain;
  filter: drop-shadow(0 .17em .17em #2f2415a8);
  transform: translate(-50%, -50%);
  animation-duration: var(--wrap-duration);
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}
.bench-wrap-stick { animation-name: bench-position-stick; }
.bench-wrap-scene .bench-wrap-coil {
  z-index: 2;
  width: 20%;
  height: 37%;
  animation-name: bench-tighten-wire;
}
.bench-wrap-turns { animation-name: bench-lay-turns; }
.bench-wrap-result { animation-name: bench-show-wrapped-stick; }

@keyframes bench-position-stick {
  0% { left: 26%; top: 56%; transform: translate(-50%, -50%) rotate(-11deg) scale(.93); }
  23%, 74% { left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 1; }
  86%, 100% { opacity: 0; }
}
@keyframes bench-tighten-wire {
  0% { left: 68%; top: 61%; transform: translate(-50%, -50%) rotate(4deg); opacity: 1; }
  28% { left: 46%; top: 63%; transform: translate(-50%, -50%) rotate(-29deg) scale(.85); }
  37% { left: 42%; top: 57%; transform: translate(-50%, -50%) rotate(37deg) scale(.69, .88); }
  48% { left: 47%; top: 62%; transform: translate(-50%, -50%) rotate(110deg) scale(.62, .46); }
  60% { left: 42%; top: 62%; transform: translate(-50%, -50%) rotate(189deg) scale(.54, .67); opacity: 1; }
  79%, 100% { left: 47%; top: 59%; transform: translate(-50%, -50%) rotate(278deg) scale(.38, .52); opacity: 0; }
}
@keyframes bench-lay-turns {
  0%, 35% { opacity: 0; clip-path: circle(0 at 44% 59%); }
  45% { opacity: 1; clip-path: circle(6% at 44% 59%); }
  60%, 77% { opacity: 1; clip-path: circle(17% at 44% 64%); }
  83%, 100% { opacity: 0; clip-path: circle(17% at 44% 64%); }
}
@keyframes bench-show-wrapped-stick {
  0%, 70% { opacity: 0; transform: translate(-50%, -50%); }
  86% { opacity: 1; transform: translate(-50%, -50%) scale(1.042); filter: brightness(1.2) drop-shadow(0 .17em .17em #2f2415a8); }
  100% { top: 39%; opacity: 1; transform: translate(-50%, -50%) scale(.62); }
}

.bench-preview {
  position: absolute;
  z-index: 1;
  top: 6%;
  right: 4.6%;
  width: 24%;
  min-height: 42%;
  padding: .37em .42em .5em;
  display: grid;
  justify-items: center;
  gap: .17em;
  background: var(--bench-label) center / 100% 100% no-repeat #e4b67c;
  color: var(--bench-ink);
  text-align: center;
  clip-path: polygon(3% 2%, 97% 0, 99% 98%, 1% 100%, 0 51%);
  transform: rotate(10deg);
  filter: drop-shadow(0 calc(5 * var(--u)) calc(3 * var(--u)) var(--bench-shadow));
}
.bench-preview img { display: block; width: 87%; height: calc(135 * var(--u)); object-fit: contain; }
.bench-preview:not(.is-result) img { filter: brightness(.5) sepia(1) saturate(2.1); }
.bench-preview strong { font-size: .75em; }
.bench-preview.is-result { transform: none; inset: 21% 28% 8%; width: auto; }
.bench-preview.is-result img { height: calc(168 * var(--u)); }
.bench-preview.is-result strong { font-size: 1em; }
.bench-kit-art { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; width: 94%; gap: .2em; }
.bench-preview .bench-kit-art img { width: 100%; min-width: 0; }
.trial-table[data-stage='tutorial'] .bench-preview:not(.is-result) {
  top: 2%;
  right: 3%;
  width: calc(226 * var(--u));
  height: calc(223 * var(--u));
  background-image: var(--sideboard);
  background-size: calc(1586 * var(--u)) calc(992 * var(--u));
  background-position: calc(-1205 * var(--u)) calc(-331 * var(--u));
  transform: none;
  clip-path: polygon(16% 0, 100% 18%, 85% 100%, 0 77%);
}
.trial-table[data-stage='tutorial'] .bench-preview:not(.is-result) img { visibility: hidden; }

.bench-footer {
  --x: 642;
  --y: 759;
  --w: 819;
  --h: 115;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  padding: calc(5 * var(--u));
  gap: calc(12 * var(--u));
  background: var(--bench-wood) center / calc(210 * var(--u)) auto #694121;
}
.bench-total, .cardboard-game .trial-table .bench-actions { display: grid; align-content: center; justify-items: center; min-width: 0; }
.bench-total {
  gap: .1em;
  padding: .17em;
  background: var(--bench-label) center / 100% 100% no-repeat;
  text-align: center;
}
.bench-total strong { font-size: max(13px, calc(38 * var(--u))); }
.bench-total small { font-size: .58em; }
.bench-work-time {
  width: 82%;
  display: grid;
  justify-items: center;
  gap: .22em;
  font-size: max(13px, calc(26 * var(--u)));
  font-variant-numeric: tabular-nums;
}
.craft-timer {
  display: block;
  width: 100%;
  height: .45em;
  min-height: 4px;
  appearance: none;
  border: 0;
  border-radius: .25em;
  overflow: hidden;
  background: #54361f;
  color: #dca653;
  accent-color: #dca653;
}
.craft-timer::-webkit-progress-bar { background: #54361f; }
.craft-timer::-webkit-progress-value { background: #dca653; }
.craft-timer::-moz-progress-bar { background: #dca653; }
.bench-risk[data-risk] { color: #85291f; }
.bench-actions { position: relative; grid-template-rows: minmax(0, 1fr); }
.cardboard-game .trial-make {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: .22em .24em;
  border: 0;
  background: var(--bench-red) center / 100% 100% no-repeat #952d23;
  color: #ffdf94;
  font: inherit;
  font-size: max(15px, calc(45 * var(--u)));
  line-height: 1.05;
  text-shadow: 0 1px #72251a;
  border-radius: .23em;
}
.trial-table[data-mode='upgrade'] .trial-make { font-size: max(15px, calc(38 * var(--u))); }
.cardboard-game .trial-table .trial-make[data-to-inventory] {
  font-size: clamp(15px, calc(33 * var(--u)), 34px);
  text-wrap: balance;
}
.cardboard-game .trial-make:disabled { opacity: 1; filter: saturate(.75) brightness(.87); color: #efcb94; }
.cardboard-game .trial-make:hover:not(:disabled) { filter: brightness(1.1); }
.bench-actions .bench-paper-action { position: absolute; bottom: -.25em; right: 0; }
.cardboard-game .trial-table .bench-actions:has([data-bench-exchange]) { align-content: stretch; grid-template-rows: minmax(0, 1fr) auto; gap: 3px; }
.bench-actions:has([data-bench-exchange]) .trial-make { font-size: max(15px, calc(34 * var(--u))); }
.trial-table[data-mode='upgrade'] .bench-actions:has([data-bench-exchange]) .trial-make { font-size: max(15px, calc(28 * var(--u))); }
.bench-actions [data-bench-exchange].bench-paper-action { position: static; width: 100%; }
.trial-table .trial-warning {
  --x: 654;
  --y: 874;
  --w: 791;
  --h: 19;
  color: #ffe3aa;
  text-align: center;
  font-size: max(10px, calc(17 * var(--u)));
  line-height: 1.15;
  text-shadow: 0 1px #412618;
}

.bench-backpack {
  --x: 680;
  --y: 375;
  --w: 720;
  --h: 382;
  z-index: 6;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: .42em;
  padding: .73em .91em;
  border-radius: .55em;
  color: var(--bench-ink);
  background: url('assets/cardboard/cloth-grain.webp') center / calc(370 * var(--u)) auto #d9ac72;
  border: 2px dashed #84512d;
  box-shadow: 0 .35em .85em #221608d9, inset 0 0 .8em #86562b70;
  animation: bench-pack-in .23s ease-out;
}
@keyframes bench-pack-in { from { opacity: 0; transform: translateY(-.35em); } }
.bench-backpack header { display: flex; align-items: center; justify-content: space-between; }
.bench-backpack header h4 { font-size: 1.35em; }
.bench-backpack > p { font-size: .77em; }
.bench-close-paper {
  display: grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bench-red) center / 100% 100% no-repeat;
  color: #ffe6b5;
  font: inherit;
}
.bench-stock { display: flex; gap: .32em; flex-direction: column; overflow: auto; scrollbar-width: thin; }
.cardboard-game .bench-stock-card {
  display: grid;
  grid-template-columns: calc(69 * var(--u)) minmax(0, 1fr);
  gap: .53em;
  align-items: center;
  padding: .28em .5em;
  border: 0;
  background: var(--bench-label) center / 100% 100% no-repeat;
  color: var(--bench-ink);
  font: inherit;
  text-align: left;
}
.bench-stock-card img { width: 100%; height: calc(67 * var(--u)); object-fit: contain; }
.bench-stock-card small { display: block; font-size: .67em; margin-top: .22em; }
.bench-backpack > .bench-paper-action { justify-self: end; }
.bench-compact-pager, .bench-compact-details, .bench-status-short,
.bench-mobile-recipe-heading, .bench-mobile-scenes { display: none; }
.bench-recipe-browser { display: contents; }
.trial-table [data-valid-drop='true'] { outline: 2px solid #ffce7c; outline-offset: -2px; }

@media (prefers-reduced-motion: reduce) {
  .trial-table :is(.bench-recipe-fold, .bench-backpack, .bench-mat-parts, .bench-wrap-scene img) { transition: none; animation: none; }
  .bench-wrap-scene img:not(.bench-wrap-result) { visibility: hidden; }
}

@media (max-width: 760px), (max-height: 480px) {
  .cardboard-game .rpg-inventory[data-view='craft'] {
    height: var(--panel-height);
    overflow: hidden;
  }
  .cardboard-game .rpg-inventory[data-view='craft'] .pack-body { overflow: auto; }
  .trial-table {
    --u: max(.7px, calc(100cqw / 850));
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 100%;
    height: auto;
    overflow-x: clip;
    padding: 15px 10px 16px;
    background: var(--bench-wood) center / 140px auto #552b18;
    box-shadow: inset 0 0 18px #2c170d;
    font-size: 17px;
  }
  .trial-table::before { display: none; }
  .trial-table :is(.trial-toolbar button span, .trial-toolbar button img) {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    overflow: visible;
  }
  .trial-table .trial-heading, .trial-table[data-stage='tutorial'] .trial-heading {
    position: static;
    width: calc(100% - 36px);
    height: auto;
    gap: .12em;
    padding: .32em .6em;
    border: 1px solid #b4774d;
    border-radius: 9px 6px 7px 5px;
    background: linear-gradient(#602b184f, #41150569), var(--bench-wood) center / 130px auto;
    box-shadow: inset 0 0 5px #2a1109a3, 0 2px 4px var(--bench-shadow);
    font-size: 23px;
    white-space: normal;
  }
  .trial-heading::before { content: none; }
  .trial-heading small { font-size: 14px; }
  .trial-toolbar { display: grid; gap: 5px; background: var(--bench-wood) center / 125px auto; }
  .trial-toolbar nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
  .cardboard-game .trial-table .trial-toolbar button,
  .cardboard-game .trial-table .trial-toolbar [data-trial-category='weapon'][aria-pressed='false'] {
    position: static;
    width: auto;
    height: auto;
    min-height: 37px;
    padding: 3px 4px;
    background: var(--bench-label) center / 100% 100% no-repeat;
    color: var(--bench-ink);
    font-size: 13px;
    backdrop-filter: none !important;
  }
  .trial-toolbar button img { display: none; }
  .bench-school-info, .trial-table[data-no-school] .bench-school-info {
    position: static;
    padding: .6em .9em;
  }
  .trial-table[data-no-school] .bench-school-info { padding: .9em; }
  .trial-toolbar button[aria-pressed='true'] { box-shadow: inset 0 0 0 1px #ffd28a, 0 0 5px #ffb554bd; }
  .trial-toolbar button:disabled { opacity: .64; }
  .cardboard-game .trial-table button.trial-close {
    inset: 7px 8px auto auto;
    width: 35px;
    height: 35px;
    background: var(--sideboard) -666px -10px / 724px 453px no-repeat;
  }
  .trial-table :is(.bench-recipe-side, .bench-mat, .bench-footer, .trial-warning) { position: relative; inset: auto; width: 100%; height: auto; }
  .bench-recipe-side { gap: 5px; }
  .bench-operations { margin-bottom: -5px; }
  .cardboard-game .bench-recipe-heading {
    width: 64%;
    margin: 0;
    min-height: 34px;
    background: var(--bench-label) center / 100% 100% no-repeat;
    color: var(--bench-ink);
  }
  .bench-recipe-rail { flex: none; max-height: 278px; padding: 7px; }
  .cardboard-game .bench-recipe-card { grid-template-columns: 61px minmax(0, 1fr); min-height: 57px; padding: 3px 13px; font-size: 17px; }
  .bench-recipe-card:not(:first-child) { margin-top: 7px; }
  .bench-recipe-card img { height: 50px; }
  .bench-mat { min-height: clamp(218px, 69vw, 300px); }
  .bench-mat > h4 { height: 31px; width: min(70%, 230px); font-size: 20px; }
  .bench-part-label { font-size: 12px; }
  .bench-part-status { font-size: 10px; }
  .bench-mat-parts { inset: 17% 2% 3%; }
  .bench-preview { right: 3%; padding: .21em; top: 17%; }
  .bench-preview img { height: 77px; }
  .trial-table[data-stage='tutorial'] .bench-preview:not(.is-result) {
    width: 23%;
    height: 33%;
    min-height: 0;
    top: 17%;
    background: var(--bench-label) center / 100% 100% no-repeat;
    transform: rotate(10deg);
    clip-path: none;
  }
  .trial-table[data-stage='tutorial'] .bench-preview:not(.is-result) img { visibility: visible; }
  .bench-wire-outline > .bench-chalk-coil {
    width: 90%;
    height: 79px;
    background-size: 632px 395px;
    background-position: -400px -185px;
  }
  .bench-footer { padding: 2px; min-height: 57px; gap: 6px; }
  .bench-footer:has([data-bench-exchange]) { min-height: 77px; }
  .bench-total strong, .cardboard-game .trial-make, .trial-table[data-mode='upgrade'] .trial-make { font-size: 19px; }
  .trial-table .trial-warning { min-height: 26px; font-size: 12px; }
  .bench-backpack {
    position: fixed;
    inset: 50% auto auto 50%;
    width: min(calc(100vw - 34px), 550px);
    height: auto;
    min-height: 180px;
    max-height: 64dvh;
    transform: translate(-50%, -50%);
    animation: none;
  }
  .bench-stock { max-height: 37dvh; }
  .cardboard-game .bench-stock-card { grid-template-columns: 45px minmax(0, 1fr); }
  .bench-stock-card img { height: 43px; }
  .bench-preview.is-result img { height: 99px; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  .cardboard-game .rpg-inventory[data-view='craft']:has(.trial-table[data-stage='tutorial']) {
    --bench-edge-inline: max(9px, env(safe-area-inset-left), env(safe-area-inset-right));
    --bench-edge-block: max(8px, env(safe-area-inset-top), env(safe-area-inset-bottom));
    width: min(900px, calc(100vw - 2 * var(--bench-edge-inline)));
    height: min(420px, calc(100dvh - 2 * var(--bench-edge-block)));
    overflow: visible;
  }

  .cardboard-game .rpg-inventory[data-view='craft'] .pack-body:has(> .trial-table[data-stage='tutorial']) { overflow: clip; }
  .rpg-inventory[data-view='craft']:has(.trial-table[data-stage='tutorial'] .bench-preview.is-result) .pack-toast {
    clip-path: inset(50%);
  }

  .trial-table[data-stage='tutorial'] {
    display: grid;
    grid-template:
      'title title' 38px
      'recipes mat' minmax(0, 1fr)
      'recipes footer' auto
      'recipes note' auto / minmax(0, 1fr) minmax(0, 1.9fr);
    gap: 5px 7px;
    height: 100%;
    padding: 6px 8px 7px;
    border: 2px solid #b67a49;
    border-radius: 13px 10px 12px 9px;
    background: var(--bench-wood) center / 142px auto #552b18;
    box-shadow: inset 0 0 0 2px #7b9380, inset 0 0 12px #2c170d, 0 3px 7px #251408a8;
    font-size: .9rem;
  }

  .trial-table[data-stage='tutorial']::before,
  .trial-table[data-stage='tutorial'] .trial-toolbar,
  .trial-table[data-stage='tutorial'] .bench-recipe-card[aria-pressed='false'] { display: none; }

  .trial-table[data-stage='tutorial'] :is(.trial-heading, .bench-recipe-side, .bench-mat, .bench-footer, .trial-warning) {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .trial-table[data-stage='tutorial'] .trial-heading {
    grid-area: title;
    width: auto;
    margin-inline-end: 43px;
    border-radius: 6px;
    font-size: clamp(17px, 2.55vw, 24px);
  }

  .cardboard-game .trial-table[data-stage='tutorial'] .trial-close {
    inset: 2px 2px auto auto;
    width: 44px;
    height: 44px;
    background: url('assets/techniques/reference/close-stud.webp') center / 36px no-repeat;
  }

  .trial-table[data-stage='tutorial'] .bench-recipe-side { grid-area: recipes; gap: 3px; }
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-recipe-heading {
    width: 82%;
    min-height: 30px;
    margin: 0;
    background: var(--bench-label) center / 100% 100% no-repeat;
    color: var(--bench-ink);
    font-size: .97rem;
  }
  .trial-table[data-stage='tutorial'] .bench-recipe-rail { flex: 1; max-height: none; padding: 5px; overflow: clip; }
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-recipe-card {
    grid-template-columns: clamp(29px, 6vw, 48px) minmax(0, 1fr);
    min-height: 44px;
    padding: 3px 6px;
    font-size: clamp(14px, 2.3vw, 18px);
    line-height: 1.06;
  }
  .trial-table[data-stage='tutorial'] .bench-recipe-card img { height: 35px; }
  .trial-table[data-stage='tutorial'] .bench-recipe-content { padding: 2px; }
  .trial-table[data-stage='tutorial'] .bench-output-tag { padding: .34em .45em .37em 1.15em; font-size: clamp(12px, 1.9vw, 15px); }
  .trial-table[data-stage='tutorial'] .bench-output-stats > div { padding: .13em 0; }

  .trial-table[data-stage='tutorial'] .bench-mat { grid-area: mat; align-content: start; padding-top: 2px; border-width: 2px; }
  .trial-table[data-stage='tutorial'] .bench-mat > h4 { width: min(65%, 185px); height: 26px; font-size: 1rem; }
  .trial-table[data-stage='tutorial'] .bench-mat-parts {
    inset: 30px 5px 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, .66fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .trial-table[data-stage='tutorial'] .bench-mat-parts[data-count='2'] .bench-mat-slot[data-tutorial-slot]:not(.is-repositioned) {
    position: relative;
    inset: auto;
    grid-row: 1;
    width: 100%;
    height: 100%;
    border-color: #d9cb8b82;
  }
  .trial-table[data-stage='tutorial'] .bench-mat-slot:not(.is-filled) { background-color: #23281442; }
  .trial-table[data-stage='tutorial'] .bench-part-label { min-width: 0; padding: 2px 3px; font-size: .75rem; }
  .trial-table[data-stage='tutorial'] .bench-part-status { font-size: max(10px, .69rem); }
  .trial-table[data-stage='tutorial'] .bench-wire-outline > .bench-chalk-coil {
    width: 72%;
    height: 100%;
    background: url('assets/craft-reference/part-wire.webp') center / contain no-repeat;
    mask-image: none;
    opacity: .55;
    filter: grayscale(1) sepia(.45) brightness(1.75);
  }
  .trial-table[data-stage='tutorial'] .bench-preview:not(.is-result) {
    inset: 34px 3% 8% auto;
    width: 20%;
    min-height: 0;
    height: auto;
    background: var(--bench-label) center / 100% 100% no-repeat;
    clip-path: none;
    transform: rotate(6deg);
  }
  .trial-table[data-stage='tutorial'] .bench-preview img { height: 100%; min-height: 0; visibility: visible; }
  .trial-table[data-stage='tutorial'] .bench-preview.is-result {
    inset: 29px 20% 5px;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .trial-table[data-stage='tutorial'] .bench-wrap-scene { inset: 27px 5% 3px; }

  .trial-table[data-stage='tutorial'] .bench-footer { grid-area: footer; min-height: 44px; padding: 0; gap: 5px; }
  .trial-table[data-stage='tutorial'] :is(.bench-total strong, .trial-make) { font-size: clamp(15px, 2.3vw, 19px); }
  .cardboard-game .trial-table[data-stage='tutorial'] .trial-make[data-to-inventory] {
    font-size: clamp(14px, 2.3vw, 19px);
    white-space: nowrap;
  }
  .trial-table[data-stage='tutorial'] .trial-warning { grid-area: note; min-height: 1.2em; font-size: .75rem; }

  .trial-table[data-stage='tutorial'] .bench-backpack {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 2 / 5;
    gap: 3px;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 5px 8px 7px;
    transform: none;
  }
  .trial-table[data-stage='tutorial'] .bench-backpack > p { font-size: .8rem; }
  .trial-table[data-stage='tutorial'] .bench-close-paper { width: 38px; height: 38px; font-size: 1.2rem; }
  .trial-table[data-stage='tutorial'] .bench-stock { max-height: none; overflow: clip; }
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-stock-card { grid-template-columns: 39px minmax(0, 1fr); min-height: 44px; }
  .trial-table[data-stage='tutorial'] .bench-stock-card img { height: 36px; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 260px) {
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-recipe-heading { min-height: 25px; }
  .trial-table[data-stage='tutorial'] .bench-recipe-rail { padding: 3px; }
  .trial-table[data-stage='tutorial'] .bench-output-tag { margin-top: 3px; padding-block: .2em; }
  .trial-table[data-stage='tutorial'] .bench-output-stats > div { padding-block: .05em; line-height: 1; }
  .trial-table[data-stage='tutorial'] .bench-mat > h4 { height: 22px; }
  .trial-table[data-stage='tutorial'] .bench-mat-parts { inset-block-start: 25px; }
  .trial-table[data-stage='tutorial'] .bench-mat-slot[data-tutorial-slot]:not(.is-repositioned) {
    grid-template: minmax(0, 1fr) / minmax(0, .55fr) minmax(0, 1.45fr);
    align-items: center;
    gap: 2px;
  }
  .trial-table[data-stage='tutorial'] .bench-part-label { font-size: .69rem; }
  .trial-table[data-stage='tutorial'] .bench-part-label strong { white-space: nowrap; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  .cardboard-game .rpg-inventory[data-view='craft']:has(.trial-table[data-stage='campaign']) {
    --bench-edge-inline: max(8px, env(safe-area-inset-left), env(safe-area-inset-right));
    --bench-edge-block: max(6px, env(safe-area-inset-top), env(safe-area-inset-bottom));
    inset-block-start: 50%;
    width: min(960px, calc(100vw - 2 * var(--bench-edge-inline)));
    height: min(460px, calc(100dvh - 2 * var(--bench-edge-block)));
    overflow: visible;
  }

  .cardboard-game .rpg-inventory[data-view='craft'] .pack-body:has(> .trial-table[data-stage='campaign']) { overflow: clip; }

  .trial-table[data-stage='campaign'] {
    display: grid;
    grid-template:
      'title title' clamp(33px, 10dvh, 42px)
      'controls controls' auto
      'recipes mat' minmax(0, 1fr)
      'recipes footer' auto
      'note note' auto / minmax(0, .86fr) minmax(0, 1.14fr);
    gap: 5px 9px;
    min-height: 0;
    height: 100%;
    padding: 5px 13px 15px;
    border: 2px solid #b67a49;
    border-radius: 13px 10px 12px 9px;
    background: var(--bench-wood) center / 142px auto #552b18;
    box-shadow: inset 0 0 0 3px #2c170d, inset 0 0 0 8px #52776b, inset 0 0 0 10px #8a4727, 0 3px 7px var(--bench-shadow);
    font-size: .9rem;
    -webkit-tap-highlight-color: transparent;
  }
  .trial-table[data-stage='campaign']::before,
  .trial-table[data-stage='campaign'] .trial-heading::before { display: none; }
  .trial-table[data-stage='campaign'] :is(.trial-heading, .bench-recipe-side, .bench-mat, .bench-footer, .trial-warning) {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    min-height: 0;
  }
  .trial-table[data-stage='campaign'] .trial-heading {
    grid-area: title;
    flex-direction: row;
    gap: .7em;
    justify-self: center;
    margin: 0;
    min-width: min(45%, 310px);
    max-width: calc(100% - 91px);
    padding: 2px 1em;
    border: 2px solid #b4774d;
    border-radius: 8px 5px 7px 6px;
    background: linear-gradient(#602b184f, #41150569), var(--bench-wood) center / 190px auto;
    box-shadow: inset 0 0 0 2px #fff0b11a, 0 3px 4px #25120793;
    font-size: clamp(16px, 2.45vw, 22px);
  }
  .trial-table[data-stage='campaign'] .trial-heading small { font-size: 12px; }
  .cardboard-game .trial-table[data-stage='campaign'] .trial-close {
    inset: 1px 2px auto auto;
    width: 44px;
    height: 44px;
    background: url('assets/techniques/reference/close-stud.webp') center / 34px no-repeat;
  }
  .trial-table[data-stage='campaign'] .trial-toolbar { grid-area: controls; display: grid; grid-template-columns: 3fr 2fr; gap: 6px; }
  .trial-table[data-stage='campaign'] .trial-toolbar nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
  .trial-table[data-stage='campaign'] .trial-toolbar button span { position: static; width: auto; height: auto; clip-path: none; white-space: normal; }
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar button,
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar [data-trial-category='weapon'][aria-pressed='false'] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .32em;
    position: static;
    width: auto;
    height: auto;
    min-height: 33px;
    padding: 1px 4px;
    background: var(--bench-label) center / 100% 100% no-repeat;
    color: var(--bench-ink);
    font-size: clamp(12px, 1.9vw, 15px);
  }
  .trial-table[data-stage='campaign'] .trial-toolbar button img {
    display: block;
    position: static;
    width: 1.22em;
    height: 1.22em;
    clip-path: none;
    object-fit: contain;
    filter: grayscale(1) sepia(1) saturate(1.9) brightness(.62);
  }
  .trial-table[data-stage='campaign'] .trial-toolbar [data-trial-mode='upgrade']::before {
    content: '';
    flex: none;
    width: .95em;
    height: .95em;
    background: currentColor;
    clip-path: polygon(0 45%, 50% 0, 100% 45%, 83% 59%, 50% 29%, 17% 59%,
      0 77%, 50% 34%, 100% 77%, 83% 93%, 50% 63%, 17% 93%);
  }
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar button[aria-pressed='true'] {
    background-image: var(--bench-label);
    box-shadow: inset 0 0 0 2px #ffcf79, 0 0 7px #f3a347af;
    color: var(--bench-ink);
  }
  .trial-table[data-stage='campaign'] .bench-school-info { inset: 91px 6% auto auto; width: min(300px, 52%); }
  .trial-table[data-stage='campaign'][data-no-school] .bench-school-info { inset: auto; width: auto; grid-area: 3 / 1 / 6 / 3; align-self: center; margin: 0 10%; }
  .trial-table[data-stage='campaign'] .bench-recipe-side {
    grid-area: recipes;
    gap: 4px;
    padding: 4px 6px;
    border: 1px solid #bd8252;
    border-radius: 5px 7px 6px 8px;
    background: #3217076b;
    box-shadow: inset 0 0 9px #30170d;
    z-index: auto;
  }
  .trial-table[data-stage='campaign'] .bench-recipe-heading { display: none; }
  .trial-table[data-stage='campaign'] .bench-mobile-recipe-heading {
    align-self: start;
    display: flex;
    align-items: baseline;
    gap: .55em;
    min-height: 22px;
    padding: 1px 12px;
    background: var(--bench-label) center / 100% 100% no-repeat;
    font-size: 16px;
  }
  .trial-table[data-stage='campaign'] .bench-mobile-recipe-heading small { font-size: .74em; color: #815536; }
  .trial-table[data-stage='campaign'] .bench-aspects .bench-choices { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 0; }
  .trial-table[data-stage='campaign'] .bench-operations { margin: 0; padding: 0; }
  .trial-table[data-stage='campaign'] :is(.bench-choices button, .bench-operations button) { min-height: 29px; padding: 1px 3px; font-size: 12px; line-height: 1.05; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
    min-width: 0;
  }
  .trial-table[data-stage='campaign'] .bench-recipe-browser[data-bench-paged] {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
  }
  .trial-table[data-stage='campaign'] .bench-recipe-rail { display: contents; }
  .trial-table[data-stage='campaign'] .bench-recipe-card:not([aria-pressed='true']) { display: none; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-recipe-card { grid-row: 1; grid-template-columns: 39px minmax(0, 1fr); min-height: 46px; margin: 0; padding: 2px 8px; font-size: clamp(13px, 2.2vw, 18px); line-height: 1.1; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser[data-bench-paged] .bench-recipe-card { grid-column: 2; }
  .trial-table[data-stage='campaign'] .bench-recipe-card img { height: 37px; }
  .trial-table[data-stage='campaign'] .bench-compact-pager { display: grid; grid-template-columns: 40px 1fr 40px; justify-items: stretch; align-items: center; color: #fff2c0; text-align: center; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser > .bench-compact-pager { display: contents; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser > .bench-compact-pager span { position: absolute; clip-path: inset(50%); }
  .trial-table[data-stage='campaign'] .bench-recipe-browser .bench-compact-pager button { grid-row: 1; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser .bench-compact-pager button:first-child { grid-column: 1; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser .bench-compact-pager button:last-child { grid-column: 3; }
  .trial-table[data-stage='campaign'] :is(.bench-compact-pager button, .bench-compact-details) { min-height: 31px; padding: 2px 4px; border: 0; background: var(--bench-label) center / 100% 100% no-repeat; color: var(--bench-ink); font: inherit; }
  .trial-table[data-stage='campaign'] .bench-compact-pager button { font-size: 1.3em; line-height: 1; }
  .trial-table[data-stage='campaign'] .bench-compact-details { display: block; }
  .trial-table[data-stage='campaign'] .bench-recipe-fold {
    grid-column: 1 / -1;
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .trial-table[data-stage='campaign'] .bench-recipe-side:not([data-compact-details]) .bench-recipe-fold
    :is(.bench-recipe-book, [data-trial-details="close"]) { display: none; }
  .trial-table[data-stage='campaign'][data-mode='upgrade'] .bench-recipe-side:not([data-compact-details]) .bench-output-tag { display: none; }
  .trial-table[data-stage='campaign'] .bench-recipe-side[data-compact-details] .bench-recipe-fold {
    position: absolute;
    z-index: 5;
    inset: 3px;
    display: block;
    padding: 6px;
    border: 2px solid #b67a49;
    border-radius: 7px;
    background: linear-gradient(#2d160b29, #2d160b49), var(--bench-wood) center / 224px auto #552b18;
    box-shadow: 0 3px 12px #251408e6;
  }
  .trial-table[data-stage='campaign'] .bench-recipe-side[data-compact-details] .bench-recipe-options { display: none; }
  .trial-table[data-stage='campaign'] .bench-recipe-content { display: grid; gap: 3px; padding: 0; }
  .trial-table[data-stage='campaign'] .bench-recipe-content .bench-choices { padding-block: 0; }
  .trial-table[data-stage='campaign'] .bench-recipe-options { display: grid; gap: 3px; }
  .trial-table[data-stage='campaign'] .bench-recipe-options .bench-choices { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .trial-table[data-stage='campaign'] .bench-recipe-book { font-size: .9rem; overflow-wrap: anywhere; }
  .trial-table[data-stage='campaign'] .bench-recipe-content .bench-compact-details { justify-self: start; min-width: 96px; }
  .trial-table[data-stage='campaign'] .bench-output-tag { margin: 0; padding: .35em .65em .43em 1.15em; font-size: .875rem; }
  .trial-table[data-stage='campaign'] .bench-output-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .8em; }
  .trial-table[data-stage='campaign'] .bench-output-stats > div { padding: .13em 0; }
  .trial-table[data-stage='campaign'] .bench-mat { grid-area: mat; align-content: start; padding-top: 2px; border-width: 2px; }
  .trial-table[data-stage='campaign'] .bench-mat > h4 { width: min(65%, 185px); height: 25px; font-size: 1rem; }
  .trial-table[data-stage='campaign'] .bench-mat-parts { inset: 30px 4px 4px; grid-template-rows: minmax(0, 1fr); gap: 3px; }
  .trial-table[data-stage='campaign'] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) { grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .trial-table[data-stage='campaign'] .bench-mat-parts [data-position] { grid-area: auto; }
  .trial-table[data-stage='campaign'] .bench-mat-parts:is([data-count='2'], [data-count='4']) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-mat-slot {
    grid-template: minmax(0, 1fr) / minmax(0, .5fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 3px;
  }
  .trial-table[data-stage='campaign'] .bench-part-label { padding: 2px 3px; font-size: clamp(11px, 1.65vw, 14px); }
  .trial-table[data-stage='campaign'] .bench-mat-parts:is([data-count='1'], [data-count='2'], [data-count='3']) { inset-inline-end: 23%; }
  .trial-table[data-stage='campaign'] .bench-preview:not(.is-result) {
    inset: 37px 3% auto auto;
    width: 17%;
    height: min(53%, 121px);
    min-height: 0;
    padding: 4px 2px;
    background: var(--bench-label) center / 100% 100% no-repeat;
    clip-path: none;
    transform: rotate(7deg);
  }
  .trial-table[data-stage='campaign']:not([data-mobile-catalog]) .bench-mat:has(.bench-mat-parts:is([data-count='4'],[data-count='5'])) .bench-preview:not(.is-result) { display: none; }
  .trial-table[data-stage='campaign'] .bench-preview.is-result { inset: 28px 12% 5px; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  .trial-table[data-stage='campaign'] .bench-preview img { height: 100%; min-height: 0; max-height: 100%; }
  .trial-table[data-stage='campaign'] .bench-kit-art { min-height: 0; }
  .trial-table[data-stage='campaign'] .bench-footer { grid-area: footer; grid-template-columns: 1fr 1.2fr; min-height: 42px; padding: 0; gap: 4px; }
  .trial-table[data-stage='campaign'] .bench-footer:has([data-bench-exchange], [data-bench-cancel]) { grid-template-columns: 1fr 2fr; }
  .trial-table[data-stage='campaign'] .bench-total strong { font-size: clamp(14px, 2vw, 19px); }
  .trial-table[data-stage='campaign'] .bench-total small { font-size: .72rem; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-actions .trial-make { min-height: 35px; font-size: clamp(14px, 2vw, 19px); }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-paper-action { position: static; min-height: 24px; font: 700 13px/1.1 Georgia, serif; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-actions:has([data-bench-exchange], [data-bench-cancel]) { grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 4px; }
  .trial-table[data-stage='campaign'] .trial-warning { grid-area: note; font-size: .75rem; }
  .trial-table[data-stage='campaign'] .bench-backpack {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 3 / 5;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 3px;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 4px 7px;
    transform: none;
  }
  .trial-table[data-stage='campaign'] .bench-close-paper { width: 34px; height: 34px; font-size: 1.2rem; }
  .trial-table[data-stage='campaign'] .bench-stock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; max-height: none; overflow: clip; }
  .trial-table[data-stage='campaign'] .bench-stock :is([data-other-page], button:empty) { display: none; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-stock-card { grid-template-columns: 34px minmax(0, 1fr); min-height: 40px; padding: 3px 5px; overflow-wrap: anywhere; }
  .trial-table[data-stage='campaign'] .bench-stock-card img { height: 33px; }
  .trial-table[data-stage='campaign'] .bench-stock-card small { font-size: .72rem; }
  .trial-table[data-stage='campaign'] .bench-backpack .bench-compact-pager { color: var(--bench-ink); }
  .cardboard-game .rpg-inventory[data-view='craft']:has(.trial-table[data-stage='campaign']) .pack-toast {
    inset: 8px 49px auto auto;
    max-width: calc(100% - 83px);
    transform: none;
  }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  .trial-table .bench-mobile-scenes {
    display: block;
    position: absolute;
    z-index: -1;
    inset: 1px 1px auto;
    height: clamp(30px, 11dvh, 49px);
    overflow: hidden;
    border-radius: 9px 8px 4px 4px;
    background: url('assets/craft-reference/compact-header.webp') 50% 62% / 114% auto no-repeat #3a655d;
    pointer-events: none;
  }
  .trial-table .bench-mobile-scenes::before,
  .trial-table .bench-mobile-scenes::after {
    content: '';
    position: absolute;
    inset-block: 0;
    width: clamp(62px, 13vw, 109px);
    background-image: url('assets/craft-reference/compact-team.webp');
    background-size: 635% auto;
    background-repeat: no-repeat;
  }
  .trial-table .bench-mobile-scenes::before {
    left: 9%;
    background-position: left 54%;
    mask-image: linear-gradient(90deg, transparent, #000 13% 85%, transparent);
  }
  .trial-table .bench-mobile-scenes::after {
    right: 9%;
    background-position: right 68%;
    mask-image: linear-gradient(90deg, transparent, #000 13% 85%, transparent);
  }
  .trial-table::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: auto 2px 1px;
    height: clamp(7px, 3dvh, 14px);
    border-radius: 0 0 7px 8px;
    background: url('assets/craft-reference/compact-header.webp') left 68% / 340% auto no-repeat #3c6055;
    pointer-events: none;
  }
  .trial-table[data-stage='tutorial'] { padding: 6px 13px 14px; }
  .trial-table[data-stage='tutorial'] .trial-heading {
    justify-self: center;
    min-width: min(46%, 310px);
    max-width: calc(100% - 91px);
    margin: 0;
    padding-inline: 8px;
    border: 2px solid #b4774d;
    background: linear-gradient(#602b184f, #41150569), var(--bench-wood) center / 190px auto;
    box-shadow: inset 0 0 0 2px #fff0b11a, 0 3px 4px #25120793;
  }
  .trial-table[data-stage='tutorial'] .trial-heading::before { display: none; }
  .trial-table[data-stage='tutorial'] .bench-recipe-side {
    padding: 2px 4px;
    border: 1px solid #bd8252;
    border-radius: 5px 7px 6px 8px;
    background: #3217076b;
  }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 310px) {
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-recipe-heading { min-height: 24px; }
  .trial-table[data-stage='tutorial'] .bench-recipe-rail { padding: 3px; }
  .trial-table[data-stage='tutorial'] .bench-output-tag { margin-top: 4px; font-size: .84rem; }
  .trial-table[data-stage='tutorial'] .bench-output-stats > div { padding-block: .1em; }
  .trial-table[data-stage='campaign'] { grid-template-rows: 27px auto minmax(0, 1fr) auto auto; }
  .trial-table[data-stage='campaign'] { padding-block-end: 11px; gap: 3px 7px; }
  .trial-table[data-stage='campaign'] .bench-status-full { display: none; }
  .trial-table[data-stage='campaign'] .bench-status-short { display: inline; }
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar button,
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar [data-trial-category='weapon'][aria-pressed='false'] { min-height: 26px; }
  .trial-table[data-stage='campaign'] .bench-recipe-side { gap: 2px; padding: 3px 5px; }
  .trial-table[data-stage='campaign'] .bench-mobile-recipe-heading { min-height: 17px; padding-block: 0; font-size: 13px; }
  .trial-table[data-stage='campaign'] .bench-recipe-side:not([data-compact-details]) .bench-output-tag { display: none; }
  .trial-table[data-stage='campaign'] .bench-recipe-options { gap: 2px; }
  .trial-table[data-stage='campaign'] .bench-recipe-book { font-size: .8rem; }
  .trial-table[data-stage='campaign'] .bench-mat > h4 { height: 21px; font-size: .88rem; }
  .trial-table[data-stage='campaign'] .bench-mat-parts { inset-block-start: 23px; }
  .trial-table[data-stage='campaign'] .bench-preview:not(.is-result) { inset-block-start: 26px; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-mat-slot { grid-template: minmax(0, 1fr) / minmax(0, .45fr) minmax(0, 1.55fr); align-items: center; }
  .trial-table[data-stage='campaign'] .bench-mat-slot .bench-part-label { width: 100%; font-size: 11px; line-height: 1; }
  .trial-table[data-stage='campaign'] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-mat-slot { padding: 1px; }
  .trial-table[data-stage='campaign'] .bench-part-status { font-size: 10px; line-height: 1; }
  .trial-table[data-stage='campaign'] .bench-output-tag { font-size: .8rem; }
  .trial-table[data-stage='campaign'] :is(.bench-choices button, .bench-operations button) { min-height: 24px; }
  .trial-table[data-stage='campaign'] :is(.bench-compact-pager button, .bench-compact-details) { min-height: 26px; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-recipe-card { min-height: 34px; }
  .trial-table[data-stage='campaign'] .bench-recipe-card img { height: 27px; }
  .trial-table[data-stage='campaign'] .bench-footer { min-height: 35px; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-actions .trial-make { min-height: 32px; }
  .trial-table[data-stage='campaign'] .bench-total strong { font-size: 12px; }
  .trial-table[data-stage='campaign'] .bench-total small { font-size: 11px; }
  .trial-table[data-stage='campaign'] .trial-warning { font-size: 11px; }
}

@media (orientation: landscape) and (max-width: 1180px) and (min-height: 311px) and (max-height: 540px) {
  .trial-table[data-stage='campaign'][data-mode='assembly']:not([data-mobile-catalog]) [data-trial-details='open'] { display: none; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  html[data-mobile-game] .trial-table:is([data-stage='tutorial'], [data-stage='campaign']) .trial-heading {
    background: #304a38 url('assets/cardboard/cloth-grain.webp') center / 220px auto;
    background-blend-mode: multiply;
  }
  html[data-mobile-game] .cardboard-game .trial-table:is([data-stage='tutorial'], [data-stage='campaign']) .bench-actions .trial-make {
    min-height: 44px;
  }
  html[data-mobile-game] .trial-table:is([data-stage='tutorial'], [data-stage='campaign']) .bench-footer { min-height: 46px; }
  html[data-mobile-game] .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar button { min-height: 36px; }
}

@media (orientation: landscape) and (max-width: 670px) and (max-height: 310px) {
  .trial-table[data-stage='tutorial'] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-recipe-heading { min-height: 21px; }
  .cardboard-game .trial-table[data-stage='tutorial'] .bench-recipe-card { min-height: 36px; font-size: .88rem; }
  .trial-table[data-stage='tutorial'] .bench-recipe-card img { height: 28px; }
  .trial-table[data-stage='tutorial'] .bench-recipe-content { padding-block: 0; }
  .trial-table[data-stage='tutorial'] .bench-output-tag { margin-top: 1px; padding: .2em .42em .3em 1.07em; font-size: .78rem; }
  .trial-table[data-stage='campaign'] { gap: 2px 6px; }
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar button,
  .cardboard-game .trial-table[data-stage='campaign'] .trial-toolbar [data-trial-category='weapon'][aria-pressed='false'] { min-height: 24px; }
  .trial-table[data-stage='campaign'] .bench-mat > h4 { display: none; }
  .trial-table[data-stage='campaign'] .bench-mobile-recipe-heading { display: none; }
  .trial-table[data-stage='campaign'] .bench-recipe-browser[data-bench-paged] { grid-template-columns: 27px minmax(0, 1fr) 27px; gap: 3px; }
  .trial-table[data-stage='campaign'] :is(.bench-choices button, .bench-operations button, .bench-compact-details) { min-height: 22px; font-size: 11.5px; }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-recipe-card { min-height: 31px; }
  .trial-table[data-stage='campaign'] .bench-recipe-card img { height: 24px; }
  .trial-table[data-stage='campaign'] .bench-output-tag { padding: .28em .43em .35em 1.1em; }
  .trial-table[data-stage='campaign'] .bench-output-tag::before { left: .54em; }
  .trial-table[data-stage='campaign'] .bench-recipe-side[data-compact-details] { position: static; }
  .trial-table[data-stage='campaign'] .bench-recipe-side[data-compact-details] .bench-recipe-fold { inset: 9px 45px 53px 10px; }
  .trial-table[data-stage='campaign'] .bench-mat-parts,
  .trial-table[data-stage='campaign'] .bench-preview.is-result { inset-block-start: 4px; }
  .trial-table[data-stage='campaign'] .bench-mat-parts[data-count='4'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cardboard-game .trial-table[data-stage='campaign'] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-mat-slot {
    grid-template-columns: minmax(0, .35fr) minmax(0, 1.65fr);
    gap: 2px;
  }
  .trial-table[data-stage='campaign'] .bench-mat-slot .bench-part-label { padding: 1px 2px; font-size: 10.5px; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 310px),
  (orientation: landscape) and (max-width: 700px) and (max-height: 340px) {
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-recipe-side { grid-area: 3 / 1 / 6 / 2; }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-recipe-side[data-compact-details] { position: static; }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-recipe-side[data-compact-details] .bench-recipe-fold {
    inset: 9px 45px 53px 10px;
  }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .trial-warning { grid-column: 2; }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-mobile-recipe-heading { display: none; }
  html[data-mobile-game] .cardboard-game .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .trial-toolbar button {
    min-height: 27px;
    font-size: 11px;
  }
  .cardboard-game .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-recipe-card { min-height: 32px; }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-recipe-card img { height: 25px; }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) :is(.bench-choices button, .bench-operations button, .bench-compact-details) {
    min-height: 23px;
    font-size: 11px;
  }
  .cardboard-game .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-mat-slot {
    grid-template-columns: minmax(17px, .37fr) minmax(0, 1.63fr);
    padding: 1px;
    gap: 2px;
    overflow: hidden;
  }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-part-label {
    min-height: 0;
    max-height: 100%;
    align-content: center;
    padding: 1px 2px;
    overflow: hidden;
  }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-part-label > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .trial-table[data-stage='campaign'][data-mode='upgrade']:not([data-mobile-catalog]) .bench-part-status {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  .trial-table[data-mobile-catalog] {
    grid-template:
      'title title' clamp(29px, 9.5dvh, 41px)
      'controls controls' auto
      'recipes mat' minmax(0, 1fr)
      'recipes footer' auto
      'note note' auto / minmax(0, .41fr) minmax(0, 1fr);
    gap: clamp(3px, 1dvh, 5px);
    padding: 4px 10px 9px;
  }

  .trial-table[data-mobile-catalog] .bench-mobile-scenes::before,
  .trial-table[data-mobile-catalog] .bench-mobile-scenes::after { display: none; }

  html[data-mobile-game] .trial-table[data-mobile-catalog] .trial-heading {
    min-width: min(40%, 255px);
    border-color: #c19752;
    border-radius: 8px;
    color: #fff0c8;
    font-size: clamp(18px, 3vw, 28px);
  }

  .trial-table[data-mobile-catalog] .trial-toolbar {
    grid-template-columns: 3.12fr 2fr;
    gap: clamp(6px, 1.8vw, 17px);
  }

  html[data-mobile-game] .cardboard-game .trial-table[data-mobile-catalog] .trial-toolbar button {
    min-height: clamp(31px, 9.4dvh, 41px);
    border-radius: 6px;
    font-size: clamp(12px, 1.9vw, 19px);
  }

  .cardboard-game .trial-table[data-mobile-catalog] :is(.trial-toolbar button, .bench-operations button,
    .bench-catalog-recipes .bench-recipe-card)[aria-pressed='true'] {
    background: var(--bench-red) center / 100% 100% no-repeat #923f27;
    box-shadow: inset 0 0 0 1px #f9cf85, 0 0 5px #db99475c;
    color: #fff0c7;
  }

  .trial-table[data-mobile-catalog] .trial-toolbar button[aria-pressed='true'] img {
    filter: grayscale(1) sepia(.6) brightness(1.75);
  }

  .trial-table[data-mobile-catalog] .bench-catalog {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: start;
    min-width: 0;
    padding: clamp(4px, 1vw, 8px);
    gap: clamp(3px, 1dvh, 6px);
    border: 1px solid #98613c;
    border-radius: 7px;
    background: var(--bench-label) center / 100% 100% no-repeat #e6b780;
    box-shadow: inset 0 0 0 1px #ffdf9b9c, 0 2px 2px var(--bench-shadow);
  }

  .bench-assembly-aspect { position: relative; min-width: 0; }
  .cardboard-game .trial-table[data-mobile-catalog] .bench-assembly-aspect > button,
  .cardboard-game .trial-table[data-mobile-catalog] .bench-operations button {
    width: 100%;
    min-height: clamp(23px, 8.9dvh, 37px);
    padding: 1px .45em;
    border: 1px solid #a67247;
    border-radius: 5px;
    color: var(--bench-ink);
    background: var(--bench-label) center / 100% 100% no-repeat #efc58d;
    font: 700 clamp(11px, 1.8vw, 17px)/1.06 Georgia, serif;
  }

  .trial-table[data-mobile-catalog] .bench-assembly-aspect > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    text-align: start;
  }
  .trial-table[data-mobile-catalog] .bench-assembly-aspect > button::after {
    content: '';
    flex: 0 0 .4em;
    height: .4em;
    margin-inline: .18em;
    border: solid currentColor;
    border-width: 0 .13em .13em 0;
    transform: rotate(45deg) translateY(-.13em);
  }
  .bench-assembly-aspect-options:not([hidden]) {
    position: absolute;
    z-index: 6;
    inset: calc(100% + 3px) 0 auto;
    display: grid;
    padding: 4px;
    border: 2px solid #a27444;
    border-radius: 6px;
    background: var(--bench-wood) center / 160px auto #633a20;
    box-shadow: 0 3px 8px var(--bench-shadow);
  }
  .bench-assembly-aspect-options .bench-choices { display: grid; gap: 2px; padding: 0; }

  .trial-table[data-mobile-catalog] .bench-operations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    padding: 0;
  }
  .trial-table[data-mobile-catalog] .bench-operations button {
    min-height: clamp(21px, 6.4dvh, 30px);
    font-size: clamp(10px, 1.55vw, 15px);
  }

  .trial-table[data-mobile-catalog] .bench-catalog-recipes,
  .trial-table[data-mobile-catalog] .bench-catalog-recipes[data-bench-paged] {
    grid-row: 3;
    grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
    gap: 4px;
    min-height: 0;
  }
  .trial-table[data-mobile-catalog] .bench-catalog-recipes .bench-recipe-rail {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-auto-rows: minmax(0, 1fr);
    gap: clamp(2px, .8dvh, 5px);
    padding: 0;
    overflow: visible;
  }
  .cardboard-game .trial-table[data-mobile-catalog] .bench-catalog-recipes .bench-recipe-card {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: clamp(23px, 5.15vw, 48px) minmax(0, 1fr);
    align-content: stretch;
    align-items: center;
    gap: .38em;
    min-height: 0;
    max-height: clamp(34px, 18dvh, 70px);
    padding: 2px .45em;
    border: 1px solid #a77a50;
    border-radius: 7px;
    background-color: #eec58d;
    text-align: start;
    font-size: clamp(12px, 1.7vw, 16px);
    overflow: clip;
  }
  .trial-table[data-mobile-catalog] .bench-catalog-recipes .bench-recipe-card img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: clamp(26px, 11dvh, 45px);
  }
  .trial-table[data-mobile-catalog] .bench-catalog-recipes > .bench-compact-pager,
  .trial-table[data-mobile-catalog] .bench-catalog > .bench-compact-pager {
    display: grid;
    grid-template-columns: clamp(24px, 4.8vw, 40px) minmax(0, 1fr) clamp(24px, 4.8vw, 40px);
    align-items: center;
    gap: 2px;
    color: var(--bench-ink);
  }
  .trial-table[data-mobile-catalog] .bench-catalog-recipes > .bench-compact-pager {
    grid-column: 1;
    grid-row: 2;
  }
  .trial-table[data-mobile-catalog] .bench-catalog .bench-compact-pager button {
    grid-column: auto;
    grid-row: auto;
    min-height: clamp(23px, 8.4dvh, 37px);
    border: 1px solid #a16b44;
    border-radius: 5px;
    background-color: #efc58b;
  }
  .trial-table[data-mobile-catalog] .bench-catalog .bench-compact-pager button:first-child { grid-column: 1; }
  .trial-table[data-mobile-catalog] .bench-catalog .bench-compact-pager button:last-child { grid-column: 3; }
  .trial-table[data-mobile-catalog] .bench-catalog .bench-compact-pager span {
    position: static;
    clip-path: none;
    font-size: .87em;
  }
  .bench-catalog-tools:empty { display: none; }

  .trial-table[data-mobile-catalog] .bench-mat {
    --ingredient-gap: clamp(5px, 3vw, 21px);
    grid-template-columns: minmax(0, 2.22fr) clamp(15px, 3.8vw, 36px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    justify-items: stretch;
    gap: clamp(3px, 1.2dvh, 7px);
    padding: clamp(4px, 1.8dvh, 9px) clamp(5px, 2vw, 19px);
    border-color: #b8873d;
    border-radius: 7px;
    background: var(--bench-felt) 18% 49% / 108% 115% no-repeat #474e2b;
  }
  .bench-mat-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
  }
  .bench-mat-heading h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35em;
    min-width: 0;
    min-height: clamp(27px, 9.2dvh, 39px);
    padding: 2px .65em;
    background: var(--bench-label) center / 100% 100% no-repeat;
    font-size: clamp(14px, 2.5vw, 24px);
    line-height: 1.05;
    text-align: center;
    overflow-wrap: normal;
  }
  .bench-mat-heading h4 img {
    flex: none;
    width: clamp(23px, 4.5vw, 40px);
    height: clamp(23px, 7.3dvh, 35px);
    object-fit: contain;
  }
  .cardboard-game .trial-table[data-mobile-catalog] .bench-catalog-details {
    flex: none;
    min-height: clamp(27px, 8.4dvh, 36px);
    min-width: 0;
    padding: 2px .55em;
    border: 1px solid #a67445;
    border-radius: 4px;
    background: var(--bench-label) center / 100% 100% no-repeat #edcb94;
    color: var(--bench-ink);
    font: 700 clamp(10px, 1.55vw, 15px)/1.05 Georgia, serif;
  }

  .trial-table[data-mobile-catalog] .bench-mat-parts[data-count] {
    position: relative;
    grid-column: 1;
    grid-row: 2;
    inset: auto;
    grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr));
    gap: var(--ingredient-gap);
    min-width: 0;
    min-height: 0;
  }
  .trial-table[data-mobile-catalog] .bench-mat-parts[data-count='1'] { grid-template-columns: minmax(0, 1fr); }
  .trial-table[data-mobile-catalog] .bench-mat-parts[data-count='3'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trial-table[data-mobile-catalog] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) {
    grid-template: repeat(2, minmax(0, 1fr)) / repeat(2, minmax(0, 1fr));
    gap: clamp(2px, 1dvh, 6px);
  }
  .trial-table[data-mobile-catalog] .bench-mat-parts:is([data-count='5'], [data-count='6']) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cardboard-game .trial-table[data-stage='campaign'][data-mobile-catalog] .bench-mat-parts[data-count] .bench-mat-slot {
    position: relative;
    grid-area: auto;
    grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
    align-items: stretch;
    padding: 1px;
    border-radius: .6em;
  }
  .cardboard-game .trial-table[data-stage='campaign'][data-mobile-catalog]
    .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-mat-slot {
    grid-template: minmax(0, 1fr) / minmax(24px, .72fr) minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
  }
  .cardboard-game .trial-table[data-mobile-catalog] .bench-mat-slot.is-filled {
    border: 1px solid #edc47d;
    background-color: #e6d39816;
    box-shadow: inset 0 0 0 1px #ffe5a840;
  }
  .trial-table[data-mobile-catalog] .bench-mat-slot img {
    max-width: 91%;
    min-height: 0;
    padding: 1px;
    background: none;
    filter: drop-shadow(0 3px 3px #23190652);
  }
  .trial-table[data-mobile-catalog] .bench-mat-slot img[data-grade] { background: none; }
  .trial-table[data-mobile-catalog] .bench-mat-slot:not(.is-filled) img { opacity: .57; }
  .trial-table[data-mobile-catalog] .bench-mat-slot .bench-part-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    justify-self: stretch;
    column-gap: .34em;
    padding: 2px 3px;
    font-size: clamp(11px, 1.62vw, 16px);
    line-height: 1.05;
    overflow-wrap: normal;
  }
  .trial-table[data-mobile-catalog] .bench-part-label > * { min-width: 0; }
  .trial-table[data-mobile-catalog] .bench-rarity-name-short { display: none; }
  .trial-table[data-mobile-catalog] .bench-part-status { font-size: .88em; }
  .trial-table[data-mobile-catalog] .bench-mat-slot.is-filled .bench-part-status { color: #ffe8b1; }
  .trial-table[data-mobile-catalog] .bench-mat-parts[data-count='2'] .bench-mat-slot:first-child::after {
    content: '+';
    position: absolute;
    inset: 43% auto auto calc(100% + var(--ingredient-gap) / 2);
    transform: translate(-50%, -50%);
    color: #ffe4a3;
    font: 700 clamp(16px, 3.85vw, 34px)/1 Georgia, serif;
    pointer-events: none;
  }
  .bench-assembly-arrow {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    color: #ffe4a3;
    font: 700 clamp(18px, 4.7vw, 42px)/1 Georgia, serif;
  }
  .trial-table[data-stage='campaign'][data-mobile-catalog] .bench-mat .bench-preview {
    position: relative;
    grid-column: 3;
    grid-row: 2;
    inset: auto;
    display: grid;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 0;
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
    transform: none;
    clip-path: none;
    border: 0;
    background: none;
    filter: none;
  }
  .trial-table[data-mobile-catalog] .bench-preview :is(img, .bench-kit-art) {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    filter: drop-shadow(0 4px 4px #211a0d85);
  }
  .trial-table[data-stage='campaign'][data-mobile-catalog][data-mode='upgrade'] .bench-mat .bench-preview {
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .trial-table[data-mobile-catalog] .bench-rarity-caption {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 2px 3px;
    border: 1px solid #b7a468;
    border-radius: 4px;
    background: #282c18ed;
    color: #fff1c9;
    font-size: clamp(10px, 1.52vw, 15px);
    line-height: 1.05;
    text-align: center;
  }
  .trial-table[data-mobile-catalog] .bench-rarity-caption :is(strong, small) { font-size: 1em; }
  .trial-table[data-mobile-catalog] .bench-rarity-caption small { color: #d5e49b; }
  .trial-table[data-stage='campaign'][data-mobile-catalog] .bench-mat .bench-preview.is-result {
    grid-column: 1 / -1;
    width: min(60%, 340px);
    justify-self: center;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .trial-table[data-mobile-catalog] .bench-preview.is-result strong { color: #fff1c9; }
  .trial-table[data-mobile-catalog] .bench-mat:has(.bench-preview.is-result) :is(.bench-mat-parts, .bench-assembly-arrow) {
    display: none;
  }

  .trial-table[data-mobile-catalog] .bench-footer {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    min-height: clamp(38px, 11.4dvh, 50px);
    gap: clamp(4px, .8vw, 7px);
    background: none;
  }
  .trial-table[data-mobile-catalog] .bench-footer:has(.bench-assembly-stats) {
    grid-template-columns: minmax(0, 1fr) auto minmax(75px, .41fr);
  }
  .trial-table[data-mobile-catalog] .bench-footer:has([data-bench-cancel]) {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
  .bench-assembly-stats {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    align-items: baseline;
    gap: 2px 0;
    min-width: 0;
    margin: 0;
    padding: 3px 5px;
    background: var(--bench-label) center / 100% 100% no-repeat;
    font-size: clamp(10px, 1.56vw, 15px);
  }
  .bench-assembly-stats > div {
    display: flex;
    gap: .27em;
    align-items: baseline;
    padding: 0 clamp(2px, .55vw, 6px);
  }
  .bench-assembly-stats > div + div { border-inline-start: 1px solid #a77646; }
  .bench-assembly-stats dd { margin: 0; color: #425628; }
  .trial-table[data-mobile-catalog] .bench-total {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    justify-content: space-evenly;
    gap: 2px 4px;
    padding: 4px;
  }
  .trial-table[data-mobile-catalog] .bench-total strong { font-size: clamp(10px, 1.55vw, 15px); }
  .trial-table[data-mobile-catalog] .bench-total [data-bench-duration] {
    padding: 1px 3px;
    border: 1px solid #b08758;
    border-radius: 4px;
    background: #fbe0a8;
    font-size: clamp(10px, 1.7vw, 15px);
  }
  html[data-mobile-game] .cardboard-game .trial-table[data-mobile-catalog] .bench-actions .trial-make {
    min-height: 100%;
    border: 2px solid #bf9f5c;
    border-radius: .48em;
    color: #fff3d2;
    background: #405b35 url('assets/cardboard/cloth-grain.webp') center / 180px auto;
    background-blend-mode: multiply;
    box-shadow: inset 0 0 0 1px #e2c28483, 0 2px 3px var(--bench-shadow);
    font-size: clamp(15px, 2.5vw, 26px);
    text-shadow: 0 1px #2b311c;
  }
  html[data-mobile-game] .cardboard-game .trial-table[data-mobile-catalog][data-mode='upgrade'] .bench-actions .trial-make {
    font-size: clamp(12px, 2vw, 19px);
  }
  .trial-table[data-mobile-catalog] .trial-warning { font-size: clamp(10px, 1.37vw, 12px); }
  .trial-table[data-mobile-catalog] .bench-backpack { grid-area: 3 / 2 / 5 / 3; }

  .trial-table[data-mobile-catalog] .bench-rarity-settings:not([hidden]) {
    position: absolute;
    z-index: 7;
    inset: 11% 12% 10%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    padding: 6px 10px;
    border: 2px solid #b67a49;
    border-radius: 8px;
    background: var(--bench-wood) center / 175px auto #5c351e;
    box-shadow: 0 3px 12px var(--bench-shadow);
    color: #ffedbc;
  }
  .bench-rarity-settings > header { display: flex; justify-content: space-between; align-items: center; }
  .bench-rarity-settings > header h4 { font-size: clamp(15px, 2.2vw, 20px); }
  .bench-rarity-formula-content {
    display: grid;
    align-content: start;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 3px 7px;
    min-height: 0;
    color: var(--bench-ink);
  }
  .bench-rarity-formula-content .bench-output-tag { grid-column: 2; grid-row: 1 / span 3; }
  .bench-rarity-formula-content .bench-recipe-options .bench-choices { padding: 0; }
  .bench-rarity-formula-content .bench-paper-action { grid-column: 1; }
  .bench-rarity-scrap { display: inline-flex; align-items: center; gap: .3em; }
  .bench-rarity-scrap img { width: 1.5em; height: 1.5em; object-fit: contain; }
  .bench-rarity-scrap[data-missing] { color: #8c3022; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 328px) {
  .trial-table[data-mobile-catalog] {
    grid-template-rows: 27px auto minmax(0, 1fr) auto auto;
    gap: 3px;
    padding: 4px 7px 7px;
  }
  html[data-mobile-game] .cardboard-game .trial-table[data-mobile-catalog] .trial-toolbar button { min-height: 27px; }
  .cardboard-game .trial-table[data-mobile-catalog] .trial-close { width: 34px; height: 34px; background-size: 28px; }
  .trial-table[data-mobile-catalog] .bench-catalog { gap: 3px; padding: 4px; }
  .trial-table[data-mobile-catalog] .bench-catalog-recipes { gap: 3px; }
  .trial-table[data-mobile-catalog] .bench-mat { padding: 3px 6px; }
  .trial-table[data-mobile-catalog] .bench-mat-slot .bench-part-label { font-size: clamp(10px, 1.49vw, 13px); }
  html[data-mobile-game] .trial-table[data-mobile-catalog] .bench-footer { min-height: 36px; }
  .trial-table[data-mobile-catalog] .bench-backpack { grid-column: 1 / -1; }
  .trial-table[data-mobile-catalog] .bench-rarity-settings:not([hidden]) { inset: 7% 6% 7%; }
  .bench-rarity-settings .bench-close-paper { width: 28px; height: 28px; }
  .trial-table[data-mobile-catalog] .bench-rarity-formula-content .bench-output-stats { grid-template-columns: minmax(0, 1fr); }
  .trial-table[data-mobile-catalog] .bench-rarity-formula-content :is(.bench-recipe-book, .bench-output-tag) { font-size: 12px; }
  .bench-rarity-formula-content .bench-paper-action .bench-status-full { display: none; }
  .bench-rarity-formula-content .bench-paper-action .bench-status-short { display: inline; }
}

@media (orientation: landscape) and (max-width: 670px) and (max-height: 310px) {
  .trial-table[data-mobile-catalog] {
    grid-template-columns: minmax(0, .48fr) minmax(0, 1fr);
    grid-template-rows: 24px auto minmax(0, 1fr) auto auto;
    gap: 2px 4px;
  }
  html[data-mobile-game] .trial-table[data-mobile-catalog] .trial-heading { min-width: min-content; font-size: 17px; }
  .trial-table[data-mobile-catalog] .trial-heading small { font-size: 10px; }
  .trial-table[data-mobile-catalog] .trial-toolbar { gap: 4px; }
  html[data-mobile-game] .cardboard-game .trial-table[data-mobile-catalog] .trial-toolbar button { padding-inline: 2px; font-size: 11px; }
  .trial-table[data-mobile-catalog] .trial-toolbar button img { width: 1em; height: 1em; }
  .trial-table[data-mobile-catalog] .trial-toolbar [data-trial-mode='upgrade']::before { width: .8em; height: .8em; }
  .trial-table[data-mobile-catalog] .bench-catalog { padding: 2px 3px; gap: 2px; }
  .cardboard-game .trial-table[data-mobile-catalog] .bench-catalog-recipes .bench-recipe-card {
    grid-template-columns: 17px minmax(0, 1fr);
    gap: 3px;
    padding: 1px 2px;
    font-size: 10.5px;
  }
  .trial-table[data-mobile-catalog] .bench-catalog-recipes .bench-recipe-card img { max-height: 22px; }
  .trial-table[data-mobile-catalog] .bench-catalog .bench-compact-pager button { min-height: 19px; }
  .trial-table[data-mobile-catalog] .bench-mat { --ingredient-gap: 11px; padding: 2px 4px; }
  .bench-mat-heading h4 { min-height: 21px; padding-inline: 4px; font-size: 13px; }
  .bench-mat-heading h4 img { width: 19px; height: 18px; }
  .cardboard-game .trial-table[data-mobile-catalog] .bench-catalog-details { min-height: 20px; padding-inline: 3px; font-size: 10px; }
  .trial-table[data-mobile-catalog] .bench-mat-slot .bench-part-label {
    padding: 1px 2px;
    font-size: 9.5px;
  }
  .trial-table[data-mobile-catalog] .bench-rarity-name-full { display: none; }
  .trial-table[data-mobile-catalog] .bench-rarity-name-short { display: inline; }
  .trial-table[data-mobile-catalog] .bench-rarity-caption strong { display: none; }
  .trial-table[data-mobile-catalog] .bench-mat-parts[data-count='3'] .bench-part-label > span { display: none; }
  .cardboard-game .trial-table[data-stage='campaign'][data-mobile-catalog]
    .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-mat-slot {
    grid-template: minmax(0, 1fr) / minmax(16px, .55fr) minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
  }
  .trial-table[data-mobile-catalog] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-part-label {
    font-size: 9px;
    overflow: hidden;
  }
  .trial-table[data-mobile-catalog] .bench-mat-parts:is([data-count='4'], [data-count='5'], [data-count='6']) .bench-part-label > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .trial-table[data-mobile-catalog] .bench-total strong,
  .trial-table[data-mobile-catalog] .bench-assembly-stats,
  .trial-table[data-mobile-catalog] .trial-warning { font-size: 10px; }
  html[data-mobile-game] .trial-table[data-mobile-catalog] .bench-footer { min-height: 33px; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 540px) {
  .trial-table[data-bench-step] {
    --bench-step-head: clamp(31px, 10.1dvh, 43px);
    --bench-step-close: clamp(33px, 5vw, 44px);
    --bench-recipe-height: clamp(36px, 19.6dvh, 76px);
    gap: clamp(3px, 1dvh, 6px);
  }
  .trial-table[data-bench-step] .bench-mobile-scenes {
    height: calc(var(--bench-step-head) + 5px);
    background: var(--bench-wood) left center / 180px auto #5c351e;
    border-bottom: 1px solid #b67a49;
  }
  .trial-table[data-bench-step]:is([data-bench-step='schools'], [data-bench-step='mode']) {
    grid-template:
      'back title close' var(--bench-step-head)
      'tiles tiles tiles' minmax(0, 1fr) / minmax(72px, .35fr) minmax(0, 1.3fr) minmax(72px, .35fr);
    background: var(--bench-felt) 18% 49% / 108% 115% no-repeat #474e2b;
  }
  .trial-table[data-bench-step='work'] {
    grid-template:
      'back title filters close' var(--bench-step-head)
      'recipes recipes recipes recipes' var(--bench-recipe-height)
      'mat mat mat mat' minmax(0, 1fr)
      'footer footer footer footer' auto
      'note note note note' auto / max-content minmax(0, 1fr) minmax(0, max-content) var(--bench-step-close);
  }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] {
    grid-template:
      'back title title close' var(--bench-step-head)
      'filters filters filters filters' auto
      'recipes recipes recipes recipes' min(15.5dvh, 61px)
      'mat mat mat mat' minmax(0, 1fr)
      'footer footer footer footer' auto
      'note note note note' auto / max-content minmax(0, 1fr) minmax(0, 1fr) var(--bench-step-close);
  }
  html[data-mobile-game] .trial-table[data-bench-step] .trial-heading {
    width: auto;
    max-width: 100%;
    min-width: min(100%, 255px);
    padding-inline: clamp(4px, 1.4vw, 13px);
    white-space: normal;
    text-wrap: balance;
  }
  .cardboard-game .trial-table[data-bench-step] .trial-close {
    grid-area: close;
    position: relative;
    inset: auto;
    justify-self: end;
    align-self: center;
    width: var(--bench-step-close);
    height: var(--bench-step-close);
    background-size: 80%;
  }
  .cardboard-game .trial-table[data-bench-step] .bench-step-back {
    grid-area: back;
    align-self: center;
    justify-self: start;
    min-height: calc(var(--bench-step-head) - 4px);
    padding: 2px .72em;
    border: 1px solid #b48b56;
    border-radius: 5px;
    background: var(--bench-label) center / 100% 100% no-repeat #ebc38d;
    color: var(--bench-ink);
    font: 700 clamp(12px, 1.85vw, 18px)/1.05 Georgia, serif;
    white-space: nowrap;
  }
  .bench-stage-tiles {
    grid-area: tiles;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-self: center;
    justify-self: center;
    width: min(94%, 820px);
    height: min(80%, 258px);
    min-width: 0;
    min-height: 0;
    gap: clamp(8px, 2vw, 20px);
    margin: 0;
  }
  .cardboard-game .trial-table[data-bench-step] .bench-stage-tile {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 0;
    padding: clamp(5px, 2dvh, 15px);
    border: 2px solid #bb9055;
    border-radius: 12px;
    background: var(--bench-label) center / 100% 100% no-repeat #e7bd84;
    color: var(--bench-ink);
    box-shadow: 0 3px 8px #25170985;
    font: 700 clamp(19px, 4.2vw, 39px)/1.06 Georgia, serif;
    text-align: center;
  }
  .cardboard-game .trial-table[data-bench-step] .bench-stage-tile[aria-pressed='true'] {
    border-color: #ffc86c;
    background: var(--bench-red) center / 100% 100% no-repeat #923e29;
    color: #fff1cc;
    box-shadow: inset 0 0 0 1px #ffdf9b, 0 0 9px #ffb54766;
  }
  .bench-stage-tile img {
    width: min(61%, 180px);
    height: 100%;
    min-height: 0;
    object-fit: contain;
    filter: drop-shadow(1px 4px 3px #321a1090);
  }
  .bench-stage-tiles[data-for='mode'] .bench-stage-tile { grid-template-rows: minmax(0, 1fr) auto auto; }
  .bench-stage-tile small {
    padding: .22em .8em;
    border: 1px solid #b58859;
    border-radius: 4px;
    background: #f1d19b;
    color: var(--bench-ink);
    font-size: clamp(12px, 2.2vw, 22px);
  }
  .cardboard-game .trial-table[data-bench-step] .bench-stage-tile:disabled {
    color: #584330;
    filter: grayscale(.62) brightness(.86);
  }
  .trial-table[data-bench-step][data-no-school] .bench-school-info:not([hidden]) {
    position: relative;
    inset: auto;
    grid-area: tiles;
    align-self: center;
    justify-self: center;
    width: min(85%, 430px);
    margin: 0;
  }
  .bench-work-filters {
    grid-area: filters;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(3px, .7vw, 7px);
    min-width: 0;
  }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-work-filters { justify-content: center; }
  .bench-set-filter { position: relative; min-width: 0; }
  .cardboard-game .trial-table[data-bench-step] .bench-set-filter > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    min-height: clamp(23px, 8.9dvh, 37px);
    padding: 2px .5em;
    border: 1px solid #a67247;
    border-radius: 5px;
    background: var(--bench-label) center / 100% 100% no-repeat #efc58d;
    color: var(--bench-ink);
    font: 700 clamp(11px, 1.8vw, 17px)/1.06 Georgia, serif;
    text-align: start;
  }
  .bench-set-filter > button::after {
    content: '';
    flex: 0 0 .42em;
    height: .42em;
    margin-inline: .18em;
    border: solid currentColor;
    border-width: 0 .13em .13em 0;
    transform: rotate(45deg) translateY(-.13em);
  }
  .bench-set-options:not([hidden]) {
    position: absolute;
    z-index: 6;
    inset: calc(100% + 3px) 0 auto auto;
    display: grid;
    min-width: max(100%, 155px);
    padding: 4px;
    border: 2px solid #a27444;
    border-radius: 6px;
    background: var(--bench-wood) center / 160px auto #633a20;
    box-shadow: 0 3px 8px var(--bench-shadow);
  }
  .bench-set-options .bench-choices { display: grid; gap: 2px; padding: 0; }
  .trial-table[data-bench-step] .bench-work-filters .bench-operations { min-width: min(175px, 32vw); }
  .trial-table[data-bench-step='work'] .bench-catalog-recipes,
  .trial-table[data-bench-step='work'] .bench-catalog-recipes[data-bench-paged] {
    grid-area: recipes;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr) auto;
  }
  .trial-table[data-bench-step='work'] .bench-catalog-recipes .bench-recipe-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    background: none;
    box-shadow: none;
  }
  .cardboard-game .trial-table[data-bench-step='work'] .bench-catalog-recipes .bench-recipe-card {
    grid-column: auto;
    grid-row: 1;
    grid-template-columns: clamp(22px, 6.1vw, 55px) minmax(0, 1fr);
    align-content: center;
    justify-content: center;
    padding-inline: clamp(3px, 1vw, 10px);
    max-height: none;
    font-size: clamp(12px, 2.05vw, 19px);
  }
  .trial-table[data-bench-step='work'] .bench-catalog-recipes .bench-recipe-card img {
    height: 100%;
    max-height: clamp(20px, 12.2dvh, 53px);
  }
  .cardboard-game .trial-table[data-bench-step] .bench-catalog-recipes > .bench-compact-pager {
    position: static;
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: clamp(19px, 3.2vw, 30px) auto clamp(19px, 3.2vw, 30px);
    align-items: center;
    color: #ffe9b9;
    gap: 3px;
  }
  .trial-table[data-bench-step] .bench-catalog-recipes .bench-compact-pager span { position: static; clip-path: none; }
  .trial-table[data-bench-step] .bench-catalog-recipes .bench-compact-pager button { min-height: 23px; }
  .trial-table[data-bench-step='work'] .bench-backpack { grid-area: mat; height: 100%; }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-backpack { grid-area: 4 / 1 / 6 / -1; }
  .trial-table[data-bench-step='work'][data-mode='assembly'] .bench-backpack { grid-area: 3 / 1 / 5 / -1; }
  .trial-table[data-bench-step='work'] .bench-footer:has(.bench-assembly-stats) {
    grid-template-columns: minmax(0, 1fr) auto minmax(85px, .36fr);
  }
  .trial-table[data-bench-step='work'] .bench-mat { padding-inline: clamp(8px, 4vw, 35px); }
  .trial-table[data-bench-step='work'] .bench-mat-heading h4 { justify-self: center; }
}

@media (orientation: landscape) and (max-width: 1180px) and (max-height: 305px) {
  .trial-table[data-bench-step] { --bench-step-head: 27px; --bench-step-close: 30px; gap: 2px 4px; }
  .trial-table[data-bench-step='work'] .bench-mat { padding: 2px 7px; }
  .trial-table[data-bench-step='work'][data-mode='assembly'] .bench-backpack { grid-area: 2 / 1 / 5 / -1; }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-backpack { grid-area: 3 / 1 / 6 / -1; }
  .trial-table[data-bench-step='work'] .bench-backpack { gap: 2px; padding: 3px 6px; }
  .trial-table[data-bench-step='work'] .bench-backpack .bench-close-paper { width: 27px; height: 27px; }
  .bench-mat-heading h4 { min-height: 23px; font-size: clamp(13px, 2vw, 17px); }
  .bench-mat-heading h4 img { height: 20px; }
  .cardboard-game .trial-table[data-bench-step] .bench-catalog-details { min-height: 21px; }
  .trial-table[data-bench-step] .bench-work-filters :is(.bench-assembly-aspect > button, .bench-set-filter > button, .bench-operations button) {
    min-height: 22px;
    padding: 1px 4px;
    font-size: clamp(10px, 1.48vw, 13px);
  }
  .trial-table[data-bench-step='work'] .trial-warning { font-size: 10px; }
}

@media (orientation: landscape) and (max-width: 670px) and (max-height: 305px) {
  .trial-table[data-bench-step] { --bench-recipe-height: 37px; }
  html[data-mobile-game] .trial-table[data-bench-step] .trial-heading { min-width: 0; font-size: 15px; }
  .cardboard-game .trial-table[data-bench-step] .bench-step-back { padding-inline: 4px; font-size: 11px; }
  .trial-table[data-bench-step='work'] .bench-work-filters { max-width: 52vw; }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] { grid-template-rows: var(--bench-step-head) auto 31px minmax(0, 1fr) auto auto; }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-work-filters { max-width: none; }
  .cardboard-game .trial-table[data-bench-step='work'] .bench-catalog-recipes .bench-recipe-card {
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 3px;
    padding-inline: 2px;
    font-size: 10px;
  }
  .trial-table[data-bench-step='work'] .bench-catalog-recipes .bench-recipe-card img { max-height: 21px; }
  .trial-table[data-bench-step] .bench-mat-heading h4 { min-height: 20px; font-size: 12.5px; }
  .trial-table[data-bench-step] .bench-mat-heading h4 img { height: 16px; }
  .trial-table[data-stage='campaign'][data-bench-step='work'][data-mode='upgrade'] .bench-mat .bench-preview {
    grid-template: minmax(0, 1fr) / minmax(22px, .75fr) minmax(0, 1fr);
    align-items: center;
    gap: 2px;
  }
  .trial-table[data-bench-step] .bench-rarity-caption { gap: 1px; padding: 1px 2px; font-size: 9px; }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-mat-parts:is([data-count='4'], [data-count='5']) {
    grid-template: minmax(0, 1fr) / repeat(4, minmax(0, 1fr));
  }
  .cardboard-game .trial-table[data-stage='campaign'][data-bench-step='work']
    .bench-mat-parts:is([data-count='2'], [data-count='3']) .bench-mat-slot {
    grid-template: minmax(0, 1fr) / minmax(20px, .58fr) minmax(0, 1fr);
    align-items: center;
  }
  .trial-table[data-bench-step='work'] .bench-mat-slot img { height: 100%; max-height: 100%; }
  .trial-table[data-bench-step='work'] .bench-mat-parts:is([data-count='2'], [data-count='3']) .bench-part-label > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .trial-table[data-bench-step='work'] .bench-quality-suffix { display: none; }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-mat-slot .bench-part-label {
    gap: 0;
    padding-block: 0;
  }
  .trial-table[data-bench-step='work'][data-mode='upgrade'] .bench-mat-slot .bench-part-label > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .bench-stage-tile small { font-size: 12px; }
}
