.record-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  padding: .6rem 0 .9rem;
}

.record-design { position: relative; }
.record-design summary, .record-mode button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 42px;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #171d17;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
}

.record-design summary { min-width: 142px; justify-content: space-between; list-style: none; }
.record-design summary::-webkit-details-marker { display: none; }
.record-design[open] summary svg { transform: rotate(180deg); }
.record-design summary:hover, .record-mode button:hover { border-color: #708365; }
.record-mode { display: flex; gap: .3rem; }
.record-mode button { color: #b7c1af; }
.record-mode button[aria-pressed="true"] { border-color: #c4d8a9; background: #c4d8a9; color: #141d13; }
.record-mode button svg { width: .98rem; }
.record-count { margin-left: auto; color: var(--accent); font-size: .9rem; font-variant-numeric: tabular-nums; }

.design-menu {
  position: absolute;
  top: calc(100% + .55rem);
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .56rem;
  width: min(41rem, calc(100vw - 3.2rem));
  max-height: min(32rem, 65dvh);
  overflow: auto;
  padding: .7rem;
  border: 1px solid #53644c;
  border-radius: 10px;
  background: #171d17;
  box-shadow: 0 16px 35px #0e130dc9;
}
.design-menu button {
  display: grid;
  align-content: start;
  gap: .4rem;
  padding: .32rem .32rem .48rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #222b20;
  font-size: .9rem;
}
.design-menu button:hover { border-color: #90ab82; }
.design-menu button[aria-pressed="true"] { border-color: #bcceac; background: #364833; }
.design-thumbnail {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1100 / 785;
  border-radius: 3px;
  background: #30362e;
}

.record-footer, .record-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem 1rem;
}
.record-footer {
  justify-content: space-between;
  padding: .9rem .1rem;
  color: var(--muted);
  font-size: .89rem;
}
.record-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.record-scroll-hint { display: none; }
.record-viewport {
  --pin-ink: #134a31;
  --pin-shadow: #ffff;
  --pin-focus: #224b35;
  --pin-hover: #bbdcc233;
  --pin-note: #a75214;
  width: 100%;
  overflow: auto;
  border-radius: 5px;
  background: #e7dfd1;
  box-shadow: 0 12px 35px #070d0780;
}
.record-viewport[data-dark] {
  --pin-ink: #fff3bd;
  --pin-shadow: #141a16;
  --pin-focus: #efe8ba;
  --pin-hover: #fff3bf26;
  --pin-note: #ffd28b;
  background: #1b1f1a;
}
.record-sheet { position: relative; min-width: 795px; }
.record-sheet img { display: block; width: 100%; height: auto; pointer-events: none; }
.record-sheet .record-mark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: 5.2%;
  height: 5.1%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  transform: translate(-50%, -50%);
  color: var(--pin-ink);
  font-size: clamp(1.05rem, 2.1vw, 1.65rem);
  font-weight: 700;
}
.record-sheet .record-mark[data-pin="pretender"] { height: 3.1%; }
.record-sheet .pin-tick { visibility: hidden; }
.record-sheet .record-mark[aria-pressed="true"] .pin-tick {
  visibility: visible;
  text-shadow: 0 1px 2px var(--pin-shadow);
}
.record-sheet .record-mark:hover { border-color: var(--pin-focus); background: var(--pin-hover); }
.record-sheet .record-mark:focus-visible { outline: 2px solid var(--pin-focus); outline-offset: 0; background: var(--pin-hover); }
.record-note-dot {
  position: absolute;
  right: 12%;
  top: 16%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pin-note);
  visibility: hidden;
}
.record-mark[data-has-note] .record-note-dot { visibility: visible; }
.sheet-epilogue { position: absolute; inset: 59.9% 8.5% 35.6%; border-radius: 4px; }
.sheet-epilogue:focus-visible { outline: 2px solid var(--pin-focus); outline-offset: 0; }
.sheet-epilogue:hover { background: var(--pin-hover); }
#record-page[data-record-mode="note"] .record-mark { cursor: text; }

.record-dialog {
  width: min(92vw, 410px);
  padding: 1.2rem;
  border: 1px solid #768b6d;
  border-radius: 12px;
  background: #202820;
  color: var(--text);
  box-shadow: 0 18px 56px #101610b0;
}
.record-dialog::backdrop { background: #081009b9; }
.record-dialog form { display: grid; gap: .7rem; }
.record-dialog h2 { font: 700 1.8rem/1.1 var(--heading); }
.record-dialog label { color: var(--accent); font-size: .9rem; }
.record-dialog textarea {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  padding: .65rem;
  border: 1px solid #697963;
  border-radius: 6px;
  background: #151c15;
  color: var(--text);
  font: inherit;
}
.note-done {
  justify-self: end;
  min-height: 42px;
  padding-inline: 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #121b11;
  font-weight: 700;
}

@media (max-width: 854px) {
  .record-scroll-hint { display: block; margin: 0 0 .45rem; color: var(--muted); font-size: .88rem; }
}
@media (max-width: 520px) {
  .record-toolbar { gap: .55rem; }
  .record-design summary { min-width: 110px; gap: .3rem; }
  .record-mode button { padding-inline: .5rem; gap: .33rem; }
  .record-count { margin-inline: 0; font-size: .83rem; }
  .design-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-footer { font-size: .84rem; }
}
