
#notes-tab {
  position:fixed;right:0;top:48%;z-index:90;
  writing-mode:vertical-rl;padding:17px 11px;
  border:1px solid #e8920c80;border-right:0;border-radius:5px 0 0 5px;
  background:#242624;color:#eeeae1;
  font:11px "Michroma",sans-serif;letter-spacing:.14em;
  cursor:pointer;box-shadow:0 3px 16px #0004;
}
#notes-tab[hidden]{display:none}
#subnautiq-notes,#subnautiq-notes *{box-sizing:border-box}
#subnautiq-notes {
  width:min(1100px,98vw);height:96dvh;max-width:98vw;max-height:96dvh;
  margin:auto;padding:14px 18px;border:1px solid #eeeae130;
  background:#242624;color:#eeeae1;overflow:hidden;
  font:14px "Source Sans 3",sans-serif;
}
#subnautiq-notes[open]{display:flex;flex-direction:column}
#subnautiq-notes::backdrop{background:#000c}
/* Gentle Notes opening */
@media(prefers-reduced-motion:no-preference){
  #subnautiq-notes[open]{animation:notes-open 200ms ease-out both}
  #subnautiq-notes[open]::backdrop{animation:notes-backdrop-open 200ms ease-out both}
}
@keyframes notes-open{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes notes-backdrop-open{
  from{opacity:0}
  to{opacity:1}
}

#subnautiq-notes .notes-head {
  display:flex;align-items:center;justify-content:space-between;
  flex-shrink:0;min-height:44px;
}
#notes-title{margin:0;font:12px "Michroma",sans-serif;letter-spacing:.12em}
#subnautiq-notes button {
  min-width:44px;min-height:44px;border:0;background:transparent;
  color:inherit;font:inherit;cursor:pointer;
}
#subnautiq-notes button:disabled{opacity:.25;cursor:default}
#subnautiq-notes button:focus-visible,#notes-tab:focus-visible,
#notes-book:focus-visible{outline:2px solid #e8920c;outline-offset:3px}
#subnautiq-notes .notes-body {
  flex:1;min-height:0;display:flex;align-items:center;
  justify-content:center;padding:10px 0;
  container-type:size;
}
#notes-book {
  position:relative;width:min(100cqw,70.727cqh);
  aspect-ratio:1440 / 2036;flex-shrink:0;
  background:#eee7d8;perspective:1400px;touch-action:pan-y pinch-zoom;
  box-shadow:0 12px 38px #0006;
}
#notes-book img {
  position:absolute;inset:0;width:100%;height:100%;
  display:block;object-fit:contain;user-select:none;
}
#notes-page{transform-origin:left center;backface-visibility:hidden}
#notes-under{visibility:hidden}
#notes-book.is-turning #notes-under{visibility:visible}
#notes-book.turn-next #notes-page{animation:notes-next .48s ease-in both}
#notes-book.turn-prev #notes-page{animation:notes-prev .48s ease-out both}
@keyframes notes-next{to{transform:rotateY(-100deg);filter:brightness(.65)}}
@keyframes notes-prev{from{transform:rotateY(-100deg);filter:brightness(.65)}
to{transform:rotateY(0);filter:brightness(1)}}
#subnautiq-notes .notes-controls {
  display:flex;justify-content:center;align-items:center;gap:28px;flex-shrink:0;
}
#notes-count{font-size:12px;letter-spacing:.12em}
#subnautiq-notes .notes-hint {
  text-align:center;font-size:10px;letter-spacing:.1em;
  margin:0 0 3px;opacity:.65;flex-shrink:0;
}
#notes-book .notes-corner {
  position:absolute;top:0;right:0;width:48px;height:48px;
  background:linear-gradient(45deg,transparent 48%,#b9ad96 50%,#e1d6c0 58%,#faf4e7 90%);
  filter:drop-shadow(-3px 4px 3px #0003);
  transform-origin:top right;
  opacity:0;pointer-events:none;
}
#notes-book.nudge .notes-corner{animation:notes-nudge 1.5s ease .5s 2}
@keyframes notes-nudge{0%,100%{opacity:0;transform:scale(.4)}
45%,65%{opacity:1;transform:scale(1)}}
@media(max-width:700px){
  #subnautiq-notes{
    width:100vw;max-width:100vw;
    height:100dvh;max-height:100dvh;
    margin:0;border:0;border-radius:0;
    padding:calc(8px + env(safe-area-inset-top))
      calc(10px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      calc(10px + env(safe-area-inset-left));
  }
  #notes-tab{padding:14px 9px;font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  #notes-book.turn-next #notes-page,#notes-book.turn-prev #notes-page,
  #notes-book.nudge .notes-corner{animation:none}
}
