:root {
  --ground: #D8D5CD;
  --card: #EFECE4;
  --ink: #1A1916;
  --label: #6A6560;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
html { color-scheme: light; }
body {
  min-width: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  font-weight: 400;
  cursor: grab;
}
body.is-dragging { cursor: grabbing; }
body.is-open { cursor: default; }
a { color: inherit; text-decoration: underline; text-underline-offset: 0.18em; }
a:focus-visible,
button:focus-visible,
.card:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0.6rem;
  z-index: 80;
  background: var(--card);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
}
.skip:focus { left: 0.7rem; }
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 3.6rem;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 1.1rem;
  padding: 0.35rem 0.7rem 0.2rem;
  pointer-events: none;
}
.chrome a,
.chrome button { pointer-events: auto; }
.chrome .name {
  margin: 0;
  font-size: 12.5px;
  font-weight: 400;
}
.chrome .name a { text-decoration: none; }
.chrome .name a:hover { text-decoration: underline; }
.chrome nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.chrome nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.chrome nav a[aria-current="page"] { color: var(--ink); }
.mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.15rem 0.2rem;
}
.mark img {
  display: block;
  width: 36px;
  height: auto;
}

.zooms {
  position: fixed;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 14;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.zooms button {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(26, 25, 22, 0.18);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}
.world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
}
.card {
  position: absolute;
  margin: 0;
  background: var(--card);
  padding: 7px 7px 10px;
  cursor: pointer;
  min-width: 0;
}
.card:has(.cap) { z-index: 2; }
.card img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}
.card.logo img { width: 100%; height: auto; }
.card .cap {
  margin: 0.5rem 0.2rem 0.15rem;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.by {
  position: fixed;
  right: 0.7rem;
  bottom: 0.55rem;
  z-index: 16;
  font-size: 12px;
  color: var(--ink);
  min-height: 44px;
  display: inline-flex;
  align-items: flex-end;
  padding: 0.4rem 0.1rem;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(216, 213, 205, 0.64);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 1.6rem 1.15rem 2rem;
  overflow: auto;
  scrollbar-width: thin;
}
.overlay[hidden] { display: none; }
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16.5rem, 23rem);
  grid-template-rows: minmax(0, 1fr);
  gap: 0 1.4rem;
  align-items: start;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.detail.is-notes {
  display: flex;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: min(38rem, 94vw);
  max-height: 100%;
  align-self: flex-start;
  margin: 3.2vh 1.6vw 0;
}
.detail.is-notes .detail-card { display: none; }
.detail-card {
  background: transparent;
  padding: 0;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}
.detail-card img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 3.8rem);
  object-fit: contain;
  object-position: center;
}
.detail-card .cap { display: none; }
.detail-sheet:focus { outline: none; }
.detail-sheet {
  background: rgba(239, 236, 228, 0.92);
  padding: 0.15rem 1.15rem 1.4rem;
  margin: 0;
  width: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  max-height: 100%;
  overflow: auto;
  scrollbar-width: thin;
  align-self: start;
}
.detail.is-notes .detail-sheet {
  width: min(28rem, 94vw);
  max-height: calc(100dvh - 7.5rem);
}
.detail.is-notes .detail-sheet:has(.ueber-stills) {
  width: min(38rem, 94vw);
}
.ueber-stills {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 0.75rem;
  margin: 0 0 1.5rem;
}
.ueber-stills figure {
  margin: 0;
  background: var(--card);
  padding: 6px 6px 8px;
}
.ueber-stills figure:nth-child(1) { width: 44%; }
.ueber-stills figure:nth-child(2) { width: 30%; }
.ueber-stills figure:nth-child(3) { width: 46%; }
.ueber-stills figure:nth-child(4) { width: 36%; }
.ueber-stills img {
  display: block;
  width: 100%;
  height: auto;
}
.ueber-stills figcaption {
  margin: 0.45rem 0.15rem 0.1rem;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
}
.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 -1.15rem 1.1rem;
  padding: 0.15rem 1.15rem 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(239, 236, 228, 0.96);
}
.sheet-bar button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0.15rem;
  min-height: 44px;
  min-width: 44px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.sheet-bar button:focus { outline: none; }
.sheet-bar button:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.sheet-bar .back { font-size: 1.15rem; }
.sheet-bar .esc { text-align: right; min-width: 0; }
.sheet-bar kbd {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 0.05em 0.4em;
  margin-right: 0.35em;
  font: inherit;
  font-size: 11px;
}
.sheet-body { min-width: 0; }
.sheet-body .note:empty { display: none; }
.sheet-body .note {
  margin: 0 0 1.4rem;
  white-space: pre-line;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 36em;
}
.sheet-body .note p { margin: 0 0 0.9em; }
.sheet-body .note p:last-child { margin-bottom: 0; }
.facts {
  margin: 1.2rem 0 0;
  font-size: 12px;
  line-height: 1.5;
}
.facts div {
  display: grid;
  grid-template-columns: 6.6em minmax(0, 1fr);
  gap: 0.2em 0.85em;
  margin: 0 0 0.35em;
}
.facts dt {
  margin: 0;
  color: var(--label);
  font-weight: 400;
}
.facts dd { margin: 0; min-width: 0; }
.names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85em 2.2em;
}
.names li {
  margin: 0;
  padding: 0.15em 0;
  min-height: 1.6em;
}

form { margin: 1.1rem 0 0; }
form label {
  display: block;
  color: var(--label);
  margin: 0.85rem 0 0.15rem;
}
form input,
form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  padding: 0.55rem 0;
  min-height: 44px;
}
form textarea { min-height: 7.5rem; resize: vertical; }
form .send {
  display: inline-flex;
  align-items: center;
  margin: 1rem 0 0;
  padding: 0;
  min-height: 44px;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.note-status { margin: 0.8rem 0 0; color: var(--label); }

@media (min-width: 721px) {
  .overlay { overflow: hidden; }
}
@media (max-width: 720px) {
  .chrome { right: 3.4rem; padding: 0.15rem 0.35rem; }
  .overlay { padding: 4.4rem 0.7rem 4.8rem; align-items: stretch; }
  .detail {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(46vh, auto) auto;
    gap: 0.7rem;
    width: 100%;
    height: auto;
    min-height: 0;
    align-items: stretch;
  }
  .detail.is-notes {
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
  }
  .detail-card {
    width: 100%;
    height: auto;
    min-height: 46vh;
    align-self: stretch;
  }
  .detail-card img { max-height: 58vh; width: 100%; }
  .detail-sheet {
    width: 100%;
    max-height: none;
    align-self: stretch;
  }
  .detail.is-notes .detail-sheet {
    width: 100%;
    max-height: calc(100dvh - 9.4rem);
    overflow: auto;
  }
  .names { gap: 0.95em 1.2em; }
  .ueber-stills figure:nth-child(1),
  .ueber-stills figure:nth-child(3) { width: 48%; }
  .ueber-stills figure:nth-child(2) { width: 38%; }
  .ueber-stills figure:nth-child(4) { width: 42%; }
}
