.tt-kit {
  --tt-ink: #262237;
  --tt-muted: #574f62;
  --tt-land: #f4ce7e;
  --tt-dark: #272336;
  color: var(--tt-ink);
  font: 400 1rem/1.45 "Trebuchet MS", Arial, sans-serif;
  margin: 1.4rem 0;
}
.tt-kit, .tt-kit *, .tt-kit *::before, .tt-kit *::after { box-sizing: border-box; }
.tt-kit button { font-family: inherit; }
.tt-kit button:focus-visible { outline: 3px solid #a65d12; outline-offset: 2px; }
.tt-navigation { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .65rem; }
.tt-navigation button {
  flex: 1 1 8rem;
  padding: .6rem .72rem;
  background: #f8f6f3;
  border: 1px solid #c7c1ce;
  color: #393345;
  text-align: left;
  font-size: .85rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.tt-navigation button span { display: inline-block; margin-right: .25rem; font: 700 .7rem/1.2 monospace; }
.tt-navigation button[aria-pressed=true] { background: var(--tt-dark); border-color: var(--tt-dark); color: #ffdf99; }
.tt-stage {
  padding: clamp(.7rem, 2.3vw, 1.6rem);
  border: 1px solid #bdb7c2;
  background: #fffdf7;
  overflow-wrap: anywhere;
}
.tt-stage[hidden] { display: none; }
.tt-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin: 0 0 .45rem; }
.tt-folio, .tt-scale, .tt-legend strong, .tt-piece-info small {
  font: 700 .68rem/1.3 "Courier New", monospace;
  letter-spacing: .045em;
}
.tt-folio { color: #705535; text-transform: uppercase; }
.tt-heading h3 { margin: .19rem 0 0; font: 700 clamp(1.4rem, 3.1vw, 2.25rem)/1.08 Georgia, serif; color: var(--tt-ink); }
.tt-scale { flex: none; text-align: right; color: #59496a; white-space: nowrap; }
.tt-scale small { display: block; font-weight: 400; font-size: .65rem; }
.tt-detail { margin: 0 0 .75rem; color: var(--tt-muted); font: 400 .93rem/1.45 Georgia, serif; white-space: pre-line; }
.tt-frame {
  display: grid;
  grid-template-columns: 1.12rem minmax(0, 1fr);
  grid-template-rows: 1.12rem auto;
  width: 100%;
  margin: .5rem auto 0;
}
.tt-xaxis, .tt-yaxis, .tt-cross {
  background: #302b38;
  color: #fff0c9;
  font: 700 clamp(.5rem, 1.3vw, .69rem)/1 monospace;
  text-align: center;
}
.tt-cross, .tt-xaxis span, .tt-yaxis span { display: grid; place-items: center; }
.tt-xaxis { display: grid; grid-template-columns: repeat(12, 1fr); }
.tt-yaxis { display: grid; grid-template-rows: repeat(8, 1fr); }
.tt-board {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  isolation: isolate;
  overflow: hidden;
  background: #b3a18a;
  outline: 1px solid #49404a;
  outline-offset: -1px;
}
.tt-board .tt-underlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: fill;
  pointer-events: none;
}
.tt-grid-lines, .tt-landmarks, .tt-counters {
  position: absolute; inset: 0; pointer-events: none;
}
.tt-grid-lines i { position: absolute; }
.tt-col-line { top: 0; bottom: 0; border-left: 1px solid #fdf6db94; box-shadow: -1px 0 #1c19225c; }
.tt-row-line { left: 0; right: 0; border-top: 1px solid #fdf6db94; box-shadow: 0 -1px #1c19225c; }
.tt-pin, .tt-onboard, .tt-cursor {
  position: absolute;
  left: calc((var(--col) - 1) * 100% / 12);
  top: calc((var(--row) - 1) * 100% / 8);
  width: calc(100% / 12);
  height: 12.5%;
  pointer-events: none;
}
.tt-pin { display: flex; align-items: start; justify-content: end; padding: 1px 1px 0 0; }
.tt-pin.tt-shared-pin { justify-content: start; padding-left: 1px; }
.tt-pin b, .tt-legend b {
  display: inline-grid; place-items: center;
  border: 1px solid #3c2b21;
  border-radius: 50% 50% 50% 0;
  background: #ffe3a0;
  color: #332418;
  font: 800 .72rem/1 "Courier New", monospace;
  width: 1.18rem; height: 1.18rem;
}
.tt-pin b { box-shadow: 0 1px 3px #211a18b0; width: min(47%, 1.32rem); height: auto; aspect-ratio: 1; }
.tt-onboard { display: grid; place-items: center; }
.tt-onboard .tt-token { width: 91%; height: 91%; font-size: clamp(.55rem, 2.3vw, 1.25rem); box-shadow: 0 1px 3px #100d18b8; }
.tt-onboard .tt-token b { font-size: .51em; }
.tt-onboard .tt-token .tt-crest { font-size: 1.15em; }
.tt-surface {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; cursor: crosshair;
  touch-action: manipulation;
}
.tt-kit button.tt-surface:focus-visible { outline: 3px solid #ffe39a; outline-offset: -3px; }
.tt-cursor { visibility: hidden; border: 2px dotted #fff9df; box-shadow: inset 0 0 0 2px #382b48; }
.tt-board:has(.tt-surface:focus-visible) .tt-cursor { visibility: visible; }
.tt-legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.15rem; padding: 0; margin: .6rem 0 .2rem;
  list-style: none; color: #453b47; font-size: .8rem;
}
.tt-legend li { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.tt-legend b { width: 1rem; height: 1rem; flex: none; font-size: .64rem; }
.tt-legend strong { color: #594837; }
.tt-field-note { margin: .52rem 0; font-size: .85rem; line-height: 1.35; color: #4c4250; }
.tt-field-note strong { display: block; margin-bottom: .08rem; color: #4c335a; font: 700 .7rem/1.2 "Courier New", monospace; text-transform: uppercase; letter-spacing: .055em; }
.tt-inventory { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid #d7d0cd; }
.tt-inventory h4 { font: 700 1.12rem/1.2 Georgia, serif; margin: 0 0 .2rem; color: #33283e; }
.tt-inventory > p { font-size: .78rem; margin: 0 0 .5rem; color: #564e58; }
.tt-rack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .36rem; }
.tt-pick, .tt-cutout {
  display: flex; flex-direction: column; align-items: center; gap: .32rem; text-align: center;
  color: var(--tt-ink); overflow-wrap: anywhere; min-width: 0;
}
.tt-pick { border: 1px solid #c6bdc9; background: #f6f3ed; padding: .42rem .22rem; min-height: 3rem; cursor: pointer; }
.tt-pick[aria-pressed=true] { outline: 2px solid #654e74; outline-offset: -2px; background: #e8e1ef; }
.tt-pick:hover { border-color: #625068; }
.tt-token {
  display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden;
  border: 2px solid #4f3a75; box-shadow: inset 0 0 0 1px #f6ecd8;
  border-radius: 50%; aspect-ratio: 1; width: 2.5rem; flex-shrink: 0;
  background: #ded3ef; color: #35264c;
}
.tt-token.tt-foe { border-color: #814426; background: #f2ca9d; color: #593725; }
.tt-token > img {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%;
  border: none; margin: 0; object-fit: cover;
}
.tt-crest { line-height: 1; font: 700 1.3rem/1 Georgia, serif; }
.tt-token b {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); min-width: 49%;
  padding: .06em .25em; border-radius: 2px 2px 0 0; color: white; background: #45335e;
  text-align: center; font: 800 .58rem/1.08 "Trebuchet MS", Arial, sans-serif; letter-spacing: .025em;
}
.tt-foe b { background: #66391e; }
.tt-piece-info { display: block; min-width: 0; line-height: 1.18; }
.tt-piece-info strong { display: block; font-size: .76rem; }
.tt-piece-info small { display: block; margin-top: .14rem; color: #685f69; font-size: .58rem; }
.tt-controls { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: space-between; margin-top: .5rem; }
.tt-status { margin: 0; color: #493957; font-size: .82rem; font-weight: 700; }
.tt-return { border: 1px solid #918296; color: #48374f; background: #fffefa; padding: .36rem .52rem; font-size: .77rem; cursor: pointer; }
.tt-return:disabled { opacity: .48; cursor: default; }
.tt-paper .tt-stage { margin: 1rem 0; }
.tt-cut { display: inline-grid; place-items: center; padding: 2px; border: 1px dashed #39313c; border-radius: 50%; }
@media screen and (max-width: 520px) {
  .tt-frame { grid-template-columns: .85rem minmax(0, 1fr); grid-template-rows: .9rem auto; }
  .tt-pin b { font-size: .49rem; }
  .tt-rack { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .tt-navigation button { flex-basis: 5rem; padding: .5rem; font-size: .75rem; }
}
@media print {
  .tt-paper { --tt-cell: min(.58in, 8vw); margin: 0; color: #17151b; }
  .tt-paper, .tt-paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-paper .tt-stage {
    display: block; border: 0; padding: 0; margin: 0;
    break-before: page; page-break-before: always; break-inside: avoid; background: white;
  }
  .tt-paper .tt-heading { margin: 0 0 3pt; }
  .tt-paper .tt-heading h3 { font-size: 19pt; }
  .tt-paper .tt-detail { font-size: 9pt; line-height: 1.25; margin-bottom: 4pt; }
  .tt-paper .tt-folio, .tt-paper .tt-scale { font-size: 7.5pt; }
  .tt-paper .tt-frame {
    width: calc(var(--tt-cell) * 12 + .17in); max-width: 100%;
    grid-template-columns: .17in minmax(0, 1fr); grid-template-rows: .17in auto; margin: 4pt auto 0;
  }
  .tt-paper .tt-xaxis, .tt-paper .tt-yaxis { font-size: 6.5pt; }
  .tt-paper .tt-pin b { font-size: 8pt; }
  .tt-paper .tt-legend { margin: 5pt 0 0; font-size: 8pt; }
  .tt-paper .tt-field-note { font-size: 9pt; margin: 4pt 0; }
  .tt-paper .tt-inventory { margin: 6pt 0 0; padding: 4pt 0 0; }
  .tt-paper .tt-inventory h4 { font-size: 12pt; }
  .tt-paper .tt-inventory > p { margin-bottom: 5pt; font-size: 8pt; }
  .tt-paper .tt-rack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5pt; }
  .tt-paper .tt-cutout { gap: 3pt; break-inside: avoid; }
  .tt-paper .tt-cut { width: calc(var(--tt-cell) * .97); height: calc(var(--tt-cell) * .97); padding: 1.7pt; border: .7pt dashed #242129; }
  .tt-paper .tt-cut .tt-token { width: 100%; height: 100%; border-width: 1.4pt; }
  .tt-paper .tt-token b { font-size: 6pt; }
  .tt-paper .tt-piece-info strong { font-size: 8pt; }
  .tt-paper .tt-piece-info small { font-size: 6.4pt; }
}
