:root {
  --ink: #292c25;
  --green: #394a3c;
  --gold: #d6b684;
  --paper: #f4efdf;
  --dim: #716f60;
  --line: #d5cdb8;
  --serif: 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'PMingLiU', serif;
  --sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color-scheme: light;
  font-family: var(--sans);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #272921;
  color: #f5efdb;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}
button:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #cc9c5d;
  outline-offset: 3px;
}
button {
  touch-action: manipulation;
}
button i {
  font-style: normal;
}
button b {
  font-weight: 500;
}
#academy {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: #4a4539;
}
#world,
.lens,
#labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#world {
  display: block;
  touch-action: none;
  outline: none !important;
}
.lens,
#labels {
  pointer-events: none;
}
.lens {
  background:
    linear-gradient(180deg, #131a187a 0, transparent 15%, transparent 68%, #14191494 100%),
    linear-gradient(90deg, #161b1818, transparent 20%, transparent 85%, #14191414);
}
.top {
  position: absolute;
  top: max(25px, env(safe-area-inset-top));
  left: clamp(19px, 3.15vw, 58px);
  right: clamp(19px, 3.15vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fcf5e5;
  text-shadow: 0 2px 12px #231e18bb;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seal-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 47px;
  background: #a9543f;
  color: #ffebca;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.02;
  border: 1.5px solid #e6b097;
  outline: 1px solid #ad614b;
  outline-offset: 2px;
  border-radius: 2px;
  box-shadow: 0 1px 5px #1c151c40;
  transform: rotate(-2deg);
  text-align: center;
}
.brand h1 {
  font: 650 26px/1.18 var(--serif);
  letter-spacing: 0.12em;
  margin: 0;
}
.brand small {
  display: block;
  font:
    9px/1.8 Georgia,
    serif;
  letter-spacing: 0.28em;
  color: #e8d4ab;
}
.utilities {
  display: flex;
  align-items: center;
  gap: 8px;
}
.presence,
.tool,
.action-strip button {
  color: #fbf1d9;
  background: #202820cf;
  border: 1px solid #d1bc8a54;
  box-shadow: 0 3px 16px #211c1925;
  backdrop-filter: blur(10px);
}
.presence {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  font-size: 12px;
  letter-spacing: 0.07em;
  border-radius: 22px;
}
.presence i {
  width: 6px;
  height: 6px;
  background: #a9cd95;
  border-radius: 50%;
  box-shadow: 0 0 5px #8cb181;
}
.tool {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 5px;
}
.tool.square {
  width: 39px;
  padding: 0;
}
.tool:hover,
.action-strip button:hover {
  background: #3b4739eb;
  border-color: #d9bd7e;
}
.icon-canvas {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}
.place {
  position: absolute;
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 16px));
  left: clamp(19px, 3.15vw, 58px);
  pointer-events: none;
  text-shadow: 0 2px 14px #171a16;
}
.place-code {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f1d9a9;
  font:
    10px Georgia,
    serif;
  letter-spacing: 0.21em;
}
.gold-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: #d6b781;
}
.zone-title {
  font: 600 clamp(34px, 3.4vw, 54px)/1.35 var(--serif);
  letter-spacing: 0.08em;
}
.place > span {
  font: 12px/1.9 var(--sans);
  color: #ede8db;
  letter-spacing: 0.14em;
}
.controls {
  position: absolute;
  bottom: 31px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #fff2c62a;
  border-radius: 6px;
  padding: 8px 13px;
  background: #1e201c9c;
  color: #eee8da;
  white-space: nowrap;
  font-size: 11px;
  pointer-events: none;
}
.controls,
.look-hint {
  transition:
    opacity 550ms ease,
    visibility 550ms;
}
.knows-controls .controls,
.knows-controls .look-hint {
  opacity: 0;
  visibility: hidden;
}
@media (min-width: 681px) and (pointer: fine) {
  .knows-controls .action-strip {
    bottom: max(35px, env(safe-area-inset-bottom));
    transition: bottom 500ms ease;
  }
}
.map-help {
  margin-top: 12px;
  font-size: 12px;
  color: var(--green);
}
.map-help summary {
  cursor: pointer;
  width: fit-content;
  padding: 5px 0;
}
.map-help p {
  margin: 3px 0;
}
@media (max-width: 420px) {
  .top .brand h1 {
    font-size: 18px;
    white-space: nowrap;
  }
  .top .presence {
    position: absolute;
    left: 0;
    top: calc(100% + 7px);
    padding: 4px 8px;
  }
  .top .utilities .tool {
    height: 42px;
    width: 42px;
    padding: 0;
  }
}
.controls span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.controls em {
  height: 11px;
  width: 1px;
  background: #faf3db45;
}
.controls .icon-canvas {
  width: 15px;
  height: 15px;
}
kbd {
  font:
    10px/1.1 system-ui,
    sans-serif;
  padding: 3px 4px;
  background: #ece4cf13;
  border: 1px solid #e2d8c654;
  border-radius: 3px;
  color: #f7f0dc;
}
.action-strip {
  position: absolute;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  max-width: 85%;
}
.action-strip button {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  border-radius: 24px;
  padding: 9px 17px;
  font-size: 13px;
  white-space: nowrap;
}
.action-strip small {
  color: #d7c5a2;
}
.action-strip[hidden] {
  display: none;
}
.tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 7px;
  border-radius: 4px;
  background: #293128c9;
  border: 1px solid #f2dcb544;
  color: #f3ebd7;
  font-size: 10px;
  white-space: nowrap;
  transform-origin: center;
  line-height: 1.4;
}
.tag.staff {
  color: #e4cb97;
}
#toast {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translate(-50%, -6px);
  opacity: 0;
  transition: 0.18s;
  pointer-events: none;
  color: #fff8e6;
  background: #2e352ce8;
  border-radius: 5px;
  padding: 9px 15px;
  font-size: 13px;
  text-align: center;
  max-width: 85%;
}
#toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.touch-controls {
  display: none;
}
#loading {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 45% 40%, #5c5846, #252d26 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.32s;
  z-index: 3;
}
#loading[hidden] {
  display: none;
}
#loading h2 {
  font: 600 42px var(--serif);
  letter-spacing: 0.22em;
  margin: 23px 0 8px;
}
#loading small {
  color: #d6c9ae;
  letter-spacing: 0.16em;
}
#loading > i {
  width: 45px;
  height: 1px;
  background: #bca06e;
  margin: 20px;
  animation: breathe 1.4s infinite alternate;
}
@keyframes breathe {
  to {
    transform: scaleX(0.4);
    opacity: 0.3;
  }
}
dialog {
  --pad: clamp(18px, 2.8vw, 35px);
  border: 1px solid #b3a382;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(830px, calc(100vw - 34px));
  max-height: min(84dvh, 830px);
  max-width: 100vw;
  border-radius: 8px;
  box-shadow: 0 24px 100px #10171270;
  overscroll-behavior: contain;
}
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #15201889;
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.sheet {
  background: linear-gradient(110deg, #fffbef82, transparent 53%);
  padding: var(--pad);
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 19px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
}
.sheet-head small,
.micro {
  color: #857350;
  font:
    10px/1.4 Georgia,
    serif;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
.sheet-head h2 {
  font: 600 clamp(24px, 3vw, 35px)/1.35 var(--serif);
  letter-spacing: 0.07em;
  margin: 3px 0 0;
}
.sheet-head button,
.round-btn {
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  width: 32px;
  height: 32px;
}
.sheet-head button:hover,
.ghost:hover {
  background: #eae5d4;
}
.sheet p {
  margin: 0;
}
.sheet button:not(.swatch):not(:disabled):active {
  transform: translateY(1px);
}
.muted {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.7;
}
.primary,
.ghost,
.quiet {
  border: 1px solid #485747;
  background: var(--green);
  color: var(--paper);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 13px;
  min-height: 38px;
}
.ghost {
  background: transparent;
  color: var(--ink);
  border-color: #b8ab8f;
}
.quiet {
  border: 0;
  background: none;
  color: #536448;
  padding: 6px 5px;
  min-height: 32px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.right {
  margin-left: auto;
}
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 18px;
  margin-top: 17px;
  border-top: 1px solid var(--line);
}
.book-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 15px;
}
.book-choice {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 13px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffaf07a;
  color: var(--ink);
}
.book-choice:hover,
.loc-row:hover {
  border-color: #a39168;
  background: #fffaeb;
}
.cover {
  height: 65px;
  width: 49px;
  flex-shrink: 0;
  border-radius: 1px 3px 3px 1px;
  box-shadow:
    inset 3px 0 2px #ffffff28,
    inset 6px 0 1px #0002,
    1px 1px 3px #45371f55;
  display: grid;
  place-items: center;
  color: #f4e0b3;
  font: 13px var(--serif);
  letter-spacing: 0.07em;
}
.cover i {
  font-style: normal;
  writing-mode: vertical-rl;
  border: 1px solid #ecdcb67d;
  padding: 4px 1px;
  font-size: 10px;
}
.book-choice strong,
.loc-row strong {
  font: 600 17px var(--serif);
}
.book-choice small,
.loc-row small {
  display: block;
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
}
.reading {
  border-left: 3px solid #b8aa81;
  padding: 7px clamp(12px, 3vw, 29px) 12px;
  background: repeating-linear-gradient(0deg, transparent 0 31px, #ad947711 31px 32px);
}
.reading h3 {
  font: 600 27px var(--serif);
  margin: 11px 0 13px;
}
.reading p {
  font: clamp(16px, 2vw, 19px)/1.95 var(--serif);
  margin-top: 10px;
  letter-spacing: 0.045em;
}
.map-layout,
.craft-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}
.map-box {
  align-self: stretch;
  border: 1px solid var(--line);
  background: #e6e0cf;
  border-radius: 4px;
  display: grid;
  place-items: center;
  padding: 9px;
  min-height: 220px;
}
.map-box canvas {
  width: 100%;
  height: auto;
}
.map-locations {
  display: grid;
  gap: 5px;
}
.loc-row {
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 7px;
  gap: 9px;
  color: var(--ink);
}
.loc-row em {
  font: 12px Georgia;
  color: #8e7a57;
}
.loc-row .go {
  margin-left: auto;
  color: #716b53;
}
.map-legend {
  font-size: 11px;
  color: var(--dim);
  display: flex;
  gap: 12px;
  margin-top: 11px;
}
.entry-list {
  display: grid;
  gap: 9px;
  margin: 13px 0 0;
}
.entry {
  padding: 10px 12px;
  background: #eae5d7;
  border-left: 2px solid #aa946b;
  color: #414638;
  font-size: 14px;
  line-height: 1.6;
}
.wish-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 22px;
}
.wish-form label {
  font: 600 17px var(--serif);
}
textarea {
  background: #fffdf3;
  border: 1px solid #c4b79d;
  border-radius: 3px;
  width: 100%;
  min-height: 110px;
  margin: 9px 0 5px;
  padding: 11px;
  resize: vertical;
  color: #36362d;
}
.wish-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  max-height: 340px;
  overflow: auto;
  padding: 3px;
}
.note {
  min-height: 91px;
  font: 14px/1.6 var(--serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 11px 12px;
  box-shadow: 1px 2px 3px #34271920;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #39382d;
}
.note small {
  font: 10px var(--sans);
  color: #5c5c50;
  align-self: flex-end;
  margin-top: 6px;
}
.rice {
  background: #e9dbb1;
}
.sage {
  background: #cbd4b9;
}
.honey {
  background: #e6c77c;
}
.rose {
  background: #e3c1b8;
}
.swatches {
  display: flex;
  gap: 9px;
  align-items: center;
}
.swatch {
  padding: 0;
  width: 23px;
  height: 23px;
  border: 1px solid #8c846a70;
  border-radius: 50%;
}
.swatch[aria-pressed='true'] {
  outline: 2px solid #667159;
  outline-offset: 2px;
}
.craft-view {
  position: relative;
  background: #26332d;
  border-radius: 5px;
  overflow: hidden;
  min-height: 284px;
  touch-action: none;
}
.craft-view canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  inset: 0;
  touch-action: none;
}
.craft-view .spec {
  position: absolute;
  color: #dbcaa9;
  left: 13px;
  bottom: 12px;
  letter-spacing: 0.12em;
  font:
    10px Georgia,
    serif;
  pointer-events: none;
}
.craft-info h3 {
  font: 600 24px var(--serif);
  margin: 4px 0 9px;
}
.meter {
  height: 5px;
  background: #d8cfb5;
  border-radius: 3px;
  margin: 15px 0 7px;
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: #8a613f;
  transition: width 0.12s;
}
.craft-status {
  font: 13px/1.7 var(--sans);
  color: #605d4e;
  min-height: 23px;
}
.bead-sequence {
  display: flex;
  gap: 6px;
  margin: 14px 0;
}
.bead {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff6db;
  font: 10px var(--sans);
  box-shadow: inset -2px -2px 3px #0004;
}
.wood {
  background: #76513a;
}
.amber {
  background: #bf8d3a;
}
.jade {
  background: #739389;
}
.bead.done {
  outline: 1px solid #5c754f;
  outline-offset: 2px;
}
.bead-keys {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.bead-keys button {
  padding: 6px 8px;
}
.stamp-paper {
  height: 130px;
  width: 100%;
  background: repeating-linear-gradient(90deg, #f2ead0 0 20px, #eee3c7 20px 21px);
  border: 1px solid #d1c29b;
  position: relative;
  overflow: hidden;
  touch-action: none;
  margin-top: 9px;
  border-radius: 3px;
}
.stamp-paper .target,
.stamp-paper .cursor,
.stamp-paper .imprint {
  position: absolute;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.stamp-paper .target {
  border: 1px dashed #ac8a61;
  left: 60%;
  top: 52%;
}
.stamp-paper .cursor {
  border: 2px solid #965644;
  background: #a65f4c24;
}
.stamp-paper .imprint {
  object-fit: contain;
}
.stamp-paper .legend {
  position: absolute;
  left: 9px;
  top: 8px;
  color: #a39878;
  font: 12px var(--serif);
  writing-mode: vertical-rl;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (pointer: coarse), (max-width: 680px) {
  .top {
    top: max(15px, env(safe-area-inset-top));
    left: 17px;
    right: 17px;
  }
  .brand {
    gap: 8px;
  }
  .brand h1 {
    font-size: 20px;
  }
  .brand small {
    font-size: 7px;
  }
  .seal-logo {
    width: 25px;
    height: 36px;
    font-size: 14px;
  }
  .utilities {
    gap: 4px;
  }
  .tool {
    height: 33px;
    padding: 0 7px;
  }
  .tool b {
    display: none;
  }
  .tool.square {
    width: 31px;
  }
  .presence {
    font-size: 10px;
    padding: 6px 8px;
    gap: 5px;
  }
  .controls {
    display: none;
  }
  .touch-controls {
    display: block;
  }
  #stick {
    position: absolute;
    bottom: max(22px, env(safe-area-inset-bottom));
    left: 23px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 1px solid #e0d4b680;
    background: #25332973;
    touch-action: none;
  }
  #stick i {
    position: absolute;
    left: 27px;
    top: 27px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e7d7b084;
    background: #9eaa9279;
  }
  .look-hint {
    position: absolute;
    right: 21px;
    bottom: 15px;
    font-size: 9px;
    color: #e0dbbf;
    letter-spacing: 0.09em;
  }
  .place {
    left: 18px;
    bottom: 134px;
  }
  .zone-title {
    font-size: 29px;
  }
  .place-code {
    font-size: 8px;
  }
  .place > span {
    font-size: 10px;
  }
  .action-strip {
    bottom: 114px;
  }
  .action-strip small,
  .action-strip kbd {
    display: none;
  }
  .action-strip button {
    padding: 9px 12px;
  }
  .map-layout,
  .craft-layout,
  .wish-layout {
    gap: 12px;
  }
  .craft-view {
    min-height: 232px;
  }
  .book-choice {
    gap: 8px;
  }
  .book-choice strong {
    font-size: 15px;
  }
  .book-choice small {
    font-size: 10px;
  }
  .sheet-head {
    margin-bottom: 12px;
    padding-bottom: 11px;
  }
}
@media (max-width: 580px) {
  dialog {
    width: calc(100vw - 20px);
    max-height: 88dvh;
  }
  .sheet {
    padding: 17px;
  }
  .map-layout,
  .craft-layout,
  .wish-layout {
    grid-template-columns: 1fr;
  }
  .map-box {
    min-height: 110px;
  }
  .map-box canvas {
    max-height: 145px;
    object-fit: contain;
  }
  .map-locations {
    grid-template-columns: 1fr 1fr;
  }
  .loc-row {
    gap: 6px;
  }
  .loc-row strong {
    font-size: 15px;
  }
  .loc-row small {
    font-size: 10px;
  }
  .book-list {
    gap: 6px;
  }
  .book-choice {
    padding: 6px;
  }
  .cover {
    width: 34px;
    height: 53px;
  }
  .craft-view {
    min-height: 175px;
  }
  .wish-list {
    max-height: 170px;
  }
  .actions {
    margin-top: 11px;
  }
  .action-strip {
    bottom: 82px;
  }
  .place {
    max-width: 60%;
    bottom: 149px;
  }
  .map-legend {
    font-size: 10px;
  }
}
@media (max-height: 510px) and (orientation: landscape) {
  .top {
    top: 9px;
  }
  .place {
    bottom: 95px;
  }
  .zone-title {
    font-size: 24px;
  }
  .place > span {
    display: none;
  }
  #stick {
    width: 70px;
    height: 70px;
    bottom: 12px;
  }
  #stick i {
    left: 19px;
    top: 19px;
  }
  dialog {
    max-height: 94dvh;
  }
  .action-strip {
    bottom: 42px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
.knot-pad {
  display: block;
  width: 100%;
  height: auto;
  max-height: 185px;
  margin: 11px 0;
  touch-action: none;
  border: 1px solid #cabfa6;
  border-radius: 3px;
}
.specimen-flip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  background: #26352bd6;
  border: 1px solid #ddcda37a;
  color: #e2d6b7;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 4px;
}
.action-strip {
  display: flex;
  gap: 7px;
}
.action-strip button[hidden] {
  display: none;
}
.action-strip #stand-action {
  padding: 9px 12px;
}
.art-scroll {
  width: 100%;
  overflow-x: auto;
  background: #b5a47c;
  padding: 10px;
  margin: 0 0 14px;
  border: 1px solid #ae9b73;
}
.art-scroll img {
  display: block;
  width: max(100%, 920px);
  height: auto;
}

/* Near-use tools share the quiet typography of the paper inventory slips. */
.brand .seal-logo,
#loading .seal-logo {
  width: 35px;
  height: 36px;
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0;
  background: #8d4035;
  border-radius: 4px;
  outline-offset: -4px;
}
.brand small {
  letter-spacing: 0.22em;
  font-size: 9px;
}
.zone-title {
  font-size: clamp(24px, 2.23vw, 35px);
  font-weight: 500;
}
.tray-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 12px;
}
.piece-tile {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 0 0 10px;
  color: var(--ink);
}
.piece-tile img,
.compare-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: cover;
  background: #c8bb9f;
  border-radius: 3px;
}
.piece-tile span,
.piece-tile small {
  display: block;
  margin: 6px 1px 0;
}
.piece-tile span {
  font: 600 16px/1.4 var(--serif);
}
.piece-tile small {
  color: var(--dim);
  font-size: 11px;
}
.piece-tile:hover img,
.piece-tile:focus-visible img {
  outline: 2px solid #ac8154;
  outline-offset: -2px;
}
.piece-tools,
.album-tabs {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.piece-tools {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.compare-pair,
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.archive-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
}
.live-figure {
  margin: 0;
}
.live-figure img {
  width: 100%;
  display: block;
  height: clamp(210px, 39vh, 355px);
  object-fit: contain;
  background: #302d25;
  border-radius: 3px;
}
.live-figure figcaption {
  font: 13px/1.8 var(--serif);
  color: var(--dim);
  margin-top: 9px;
}
.album-tabs {
  align-items: stretch;
  flex-direction: column;
}
.album-tabs button {
  text-align: left;
}
.album-tabs [aria-pressed='true'] {
  color: #864735;
  border-left: 2px solid #984c36;
}
.live-reference {
  font: 13px/1.6 var(--serif);
  color: var(--ink);
  margin: 0.5rem 0;
}
.live-reference summary {
  cursor: pointer;
  color: #73563b;
}
.live-reference img {
  display: block;
  width: min(100%, 220px);
  max-height: 172px;
  object-fit: contain;
  background: #dad1bb;
  margin: 8px 0;
}
#labels .staff {
  opacity: 0.72;
}
@media (max-width: 650px) {
  .tray-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px 8px;
  }
  .piece-tile span {
    font-size: 14px;
  }
  .archive-layout {
    display: block;
  }
  .album-tabs {
    flex-direction: row;
  }
  .live-figure img {
    height: 28dvh;
  }
  .compare-pair {
    gap: 11px;
  }
  .compare-item h3 {
    font-size: 17px;
  }
  .brand .seal-logo {
    width: 28px;
    height: 29px;
    font-size: 18px;
  }
}

#panel[data-view='counter'] {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  background: transparent;
  color: #f7f1e4;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
#panel[data-view='counter']:active {
  cursor: grabbing;
}
#panel[data-view='counter']::backdrop {
  background: transparent;
  backdrop-filter: none;
}
#panel[data-view='counter'] .sheet {
  background: none;
  box-shadow: none;
  border: 0;
  pointer-events: none;
  max-height: none;
  min-height: 100%;
  padding: 0;
  overflow: visible;
}
#panel[data-view='counter'] .sheet-head {
  position: absolute;
  top: max(1.3rem, env(safe-area-inset-top));
  left: 2.6vw;
  right: 2.6vw;
  pointer-events: none;
  border: 0;
  background: none;
  align-items: flex-start;
}
#panel[data-view='counter'] .sheet-head > div {
  background: #243029e8;
  padding: 0.55rem 1.07rem 0.7rem;
  border-left: 2px solid #c8a976;
  border-radius: 0 3px 3px 0;
}
#panel[data-view='counter'] .sheet-head small {
  color: #d9c9a8;
}
#panel[data-view='counter'] .sheet-head h2 {
  font-size: clamp(19px, 2vw, 30px);
  color: #f6efde;
}
#panel[data-view='counter'] #panel-close {
  pointer-events: auto;
  color: #f5efdc;
  background: #2d342e;
  border-color: #a29677;
}
#panel[data-view='counter'] #panel-body {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: max(2.2rem, env(safe-area-inset-bottom));
  padding: 0;
  pointer-events: none;
}
.case-bar {
  margin: auto;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid #a9a38a6b;
  padding: 0.44rem 0.6rem 0.44rem 1rem;
  border-radius: 4px;
  background: #2a342eeb;
}
.case-bar p {
  color: #e9e3d3;
  margin: 0;
  font: 13px/1.6 var(--serif);
}
.case-bar button {
  pointer-events: auto;
  background: #eee4cf;
  color: #443d32;
}
body:has(#panel[data-view='counter'][open])
  :is(.top, .place, .action-strip, .controls, .touch-controls, #labels, #toast) {
  visibility: hidden;
}
.view-zoom {
  position: absolute;
  right: 0.48rem;
  top: 0.48rem;
  display: flex;
  gap: 3px;
}
.view-zoom button {
  border: 1px solid #c8bc9d7a;
  background: #29352ed9;
  color: #f7ecd1;
  width: 31px;
  height: 31px;
  border-radius: 3px;
  font-size: 17px;
  line-height: 1;
}
@media (max-width: 600px) {
  .case-bar {
    gap: 0.35rem;
  }
  .case-bar p {
    font-size: 11px;
  }
  .case-bar button {
    font-size: 12px;
    padding: 0.5rem;
  }
  .view-zoom button {
    width: 33px;
    height: 33px;
  }
}

.place {
  transition: opacity 1.4s ease;
}
.place.quiet-zone {
  opacity: 0.45;
}
.place.quiet-zone .place-code,
.place.quiet-zone #zone-sub {
  visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .place {
    transition: none;
  }
}
.object-prompt {
  font: 600 14px/1.6 var(--serif);
  margin: 18px 0 7px;
}

.craft-view .specimen-flip {
  right: auto;
  left: 0.5rem;
  top: 0.5rem;
}
.view-zoom {
  z-index: 2;
}

#panel[data-view='counter'] #panel-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font: 24px/1 var(--sans);
  color: #fff0d2;
}
#panel[data-view='counter'] #panel-close i {
  display: none;
}
#panel[data-view='counter'] #panel-close::after {
  content: '×';
}
.case-pan {
  display: none;
}
@media (max-aspect-ratio: 9/10) {
  .case-pan {
    display: block;
    width: 35px;
    height: 38px;
    border: 0;
    border-radius: 3px;
    font: 23px/1 var(--sans);
  }
  .case-bar {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 270px;
  }
  .case-bar p {
    width: 100%;
    text-align: center;
  }
}
