#nota-guide-launcher {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 6px;
  border-color: var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--line) 76%, transparent);
  transition: opacity 350ms ease, transform 350ms ease, background var(--duration);
}

#nota-guide-launcher.is-quiet {
  opacity: .7;
  transform: scale(.9);
}

#nota-guide-launcher:is(:hover, :focus-visible) {
  opacity: 1;
  transform: none;
}

.nota-book {
  display: block;
  width: 100%;
  height: 100%;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.nota-book-page {
  fill: var(--btn);
  stroke: color-mix(in srgb, var(--btn) 72%, var(--line));
  stroke-width: 1.5;
}

.nota-page-corner {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--btn) 65%, var(--line));
  stroke-width: 1.1;
}

.nota-turning-page {
  opacity: 0;
  transform-box: view-box;
  transform-origin: 24px 28px;
  filter: drop-shadow(2px 2px 1px var(--cast-shadow));
}

.nota-turning-sheet {
  fill: var(--surface);
  stroke: color-mix(in srgb, var(--btn) 78%, var(--line));
  stroke-width: 1.6;
}

.nota-turning-line {
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1;
  opacity: .72;
}

#nota-guide-launcher.is-page-turning .nota-turning-page {
  animation: nota-page-turn 980ms cubic-bezier(.16, 1, .3, 1);
}

#nota-guide-launcher.is-page-turning .nota-book {
  animation: nota-book-lift 980ms cubic-bezier(.16, 1, .3, 1);
}

.nota-book-fold {
  fill: none;
  stroke: var(--onbtn);
  stroke-linecap: round;
  stroke-width: 1.8;
  opacity: .7;
}

.nota-eyebrow {
  fill: none;
  stroke: var(--onbtn);
  stroke-linecap: round;
  stroke-width: 1.35;
  opacity: .9;
}

.nota-eye-white { fill: var(--onbtn); }
.nota-eye-dot { fill: var(--ink); }
.nota-eye-glint { fill: var(--onbtn); }

.nota-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: nota-blink 14s 3.5s infinite;
}

#nota-guide-launcher.is-quiet .nota-eye {
  animation-play-state: paused;
}

@keyframes nota-blink {
  0%, 2%, 4%, 100% { transform: scaleY(1); }
  3% { transform: scaleY(.08); }
}

@keyframes nota-page-turn {
  0% { opacity: 0; transform: translateX(0) scaleX(1) skewY(0); }
  10% { opacity: 1; transform: translateX(0) scaleX(1) skewY(0); }
  43% { opacity: 1; transform: translateX(-1px) scaleX(.1) skewY(-7deg); }
  54% { opacity: 1; transform: translateX(-1px) scaleX(-.1) skewY(7deg); }
  90% { opacity: 1; transform: translateX(0) scaleX(-1) skewY(0); }
  100% { opacity: 0; transform: translateX(0) scaleX(-1) skewY(0); }
}

@keyframes nota-book-lift {
  0%, 100% { transform: translateY(0) rotate(0); }
  38% { transform: translateY(-1.5px) rotate(-2deg); }
  64% { transform: translateY(-1px) rotate(1.5deg); }
}

.nota-tour-open { overflow: hidden; }

#nota-tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--ink) 38%, transparent);
}

#nota-tour-spotlight {
  position: fixed;
  z-index: 31;
  border: 3px solid var(--onbtn);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px color-mix(in srgb, var(--ink) 42%, transparent),
              0 8px 24px color-mix(in srgb, var(--ink) 22%, transparent);
  pointer-events: none;
  transition: opacity 180ms ease;
}

#nota-tour-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 32;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 52px color-mix(in srgb, var(--ink) 28%, transparent);
}

#nota-tour-card.nota-card-top {
  top: 16px;
  bottom: auto;
}

.nota-tour-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}

.nota-tour-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 5px;
  border-radius: 14px;
  background: var(--soft);
}

.nota-tour-mark .nota-eye { animation: none; }
.nota-tour-name { display: block; font-size: 12px; color: var(--muted); }
#nota-tour-title { font-size: 20px; }

#nota-tour-close {
  min-width: 44px;
  width: 44px;
  padding: 8px;
  font-size: 22px;
  line-height: 1;
}

#nota-tour-body {
  margin-top: 18px;
  color: var(--muted);
}

.nota-tour-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}

.nota-tour-progress span {
  display: block;
  width: 24px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
}

.nota-tour-progress span.is-current { background: var(--purple); }

.nota-tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.nota-tour-actions > div { display: flex; gap: 8px; }
.nota-tour-actions button { min-height: 44px; }

.nota-help-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 20px;
}

.nota-help-actions button {
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  white-space: normal;
}

.nota-help-tour {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 850px) {
  #nota-guide-launcher {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  #nota-tour-card {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    padding: 18px;
  }
}

@media (max-width: 420px) {
  #nota-tour-card { width: calc(100vw - 24px); right: 12px; }
  .nota-tour-actions { align-items: stretch; }
  .nota-tour-actions > div { flex: 1; justify-content: flex-end; }
  .nota-tour-actions button { padding-inline: 11px; }
  .nota-help-actions { grid-template-columns: 1fr; }
}

[data-motion=off] .nota-eye,
[data-motion=off] .nota-turning-page,
[data-motion=off] .nota-book,
[data-motion=off] #nota-guide-launcher,
[data-motion=off] #nota-tour-spotlight {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .nota-eye,
  .nota-turning-page,
  .nota-book,
  #nota-guide-launcher,
  #nota-tour-spotlight {
    animation: none !important;
    transition: none !important;
  }
}
