/*
 * Hisoka Notebook UX/UI Interaction Layer (v1.2.0)
 * Mapped to hisoka.blog warm paper light/dark palette.
 *
 * Lucian UX/UI Prompt #219 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#219
 * Lucian UX/UI Prompt #471 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#471
 * Lucian UX/UI Prompt #046 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#046
 * Lucian UX/UI Prompt #039 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#039
 * Lucian UX/UI Prompt #008 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#008
 * Lucian UX/UI Prompt #275 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#275
 * Lucian UX/UI Prompt #220 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#220
 * Lucian UX/UI Prompt #435 · MIT License (c) 2026 Seokwoooo · https://lucianlabs.dev/uxui-prompt/#435
 */

/* --------------------------------------------------------------------------
   1. Lucian --ux-* Token Bridge (Paper Light / Dark) + Shared .ux Base
   -------------------------------------------------------------------------- */
:root {
  --ux-page: var(--bg, #f3ecdf);
  --ux-surface: var(--panel, var(--wave-panel, #fbf7ee));
  --ux-surface-2: var(--bg-2, #eee5d6);
  --ux-surface-3: #e3d8c6;
  --ux-ink: var(--ink, #211f1a);
  --ux-ink-2: var(--muted, #5c544a);
  --ux-ink-3: var(--muted-2, #706456);
  --ux-line: rgba(141, 125, 104, 0.34);
  --ux-line-2: rgba(141, 125, 104, 0.56);
  --ux-accent: var(--accent, #a83319);
  --ux-accent-ink: var(--accent-ink, #fffaf1);
  --ux-accent-soft: rgba(168, 51, 25, 0.12);
  --ux-mint: #267855;
  --ux-hl-ink: rgba(242, 198, 72, 0.58);
  --ux-shadow: rgba(33, 31, 26, 0.08);
  --ux-shadow-strong: rgba(33, 31, 26, 0.22);
  --ux-key-base: #d4c9b8;
  --ux-key-top-1: #fffdf8;
  --ux-key-top-2: #efe7da;
  --ux-key-shine: rgba(255, 255, 255, 0.88);
  --ux-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ux-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --ux-radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ux-surface-3: #2c2821;
    --ux-line: rgba(237, 229, 216, 0.13);
    --ux-line-2: rgba(237, 229, 216, 0.24);
    --ux-accent-soft: rgba(226, 112, 82, 0.18);
    --ux-mint: #5cc999;
    --ux-hl-ink: rgba(226, 178, 68, 0.38);
    --ux-shadow: rgba(0, 0, 0, 0.45);
    --ux-shadow-strong: rgba(0, 0, 0, 0.72);
    --ux-key-base: #0d0c0a;
    --ux-key-top-1: #2b2722;
    --ux-key-top-2: #211e1a;
    --ux-key-shine: rgba(255, 255, 255, 0.11);
  }
}

@supports (color: light-dark(white, black)) {
  :root {
    --ux-surface-3: light-dark(#e3d8c6, #2c2821);
    --ux-line: light-dark(rgba(141, 125, 104, 0.34), rgba(237, 229, 216, 0.13));
    --ux-line-2: light-dark(rgba(141, 125, 104, 0.56), rgba(237, 229, 216, 0.24));
    --ux-accent-soft: light-dark(rgba(168, 51, 25, 0.12), rgba(226, 112, 82, 0.18));
    --ux-mint: light-dark(#267855, #5cc999);
    --ux-hl-ink: light-dark(rgba(242, 198, 72, 0.58), rgba(226, 178, 68, 0.38));
    --ux-shadow: light-dark(rgba(33, 31, 26, 0.08), rgba(0, 0, 0, 0.45));
    --ux-shadow-strong: light-dark(rgba(33, 31, 26, 0.22), rgba(0, 0, 0, 0.72));
    --ux-key-base: light-dark(#d4c9b8, #0d0c0a);
    --ux-key-top-1: light-dark(#fffdf8, #2b2722);
    --ux-key-top-2: light-dark(#efe7da, #211e1a);
    --ux-key-shine: light-dark(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.11));
  }
}

:root:has(> head > meta[name='color-scheme'][content='light']) {
  --ux-surface-3: #e3d8c6;
  --ux-line: rgba(141, 125, 104, 0.34);
  --ux-line-2: rgba(141, 125, 104, 0.56);
  --ux-accent-soft: rgba(168, 51, 25, 0.12);
  --ux-mint: #267855;
  --ux-hl-ink: rgba(242, 198, 72, 0.58);
  --ux-shadow: rgba(33, 31, 26, 0.08);
  --ux-shadow-strong: rgba(33, 31, 26, 0.22);
  --ux-key-base: #d4c9b8;
  --ux-key-top-1: #fffdf8;
  --ux-key-top-2: #efe7da;
  --ux-key-shine: rgba(255, 255, 255, 0.88);
}

:root:has(> head > meta[name='color-scheme'][content='dark']) {
  --ux-surface-3: #2c2821;
  --ux-line: rgba(237, 229, 216, 0.13);
  --ux-line-2: rgba(237, 229, 216, 0.24);
  --ux-accent-soft: rgba(226, 112, 82, 0.18);
  --ux-mint: #5cc999;
  --ux-hl-ink: rgba(226, 178, 68, 0.38);
  --ux-shadow: rgba(0, 0, 0, 0.45);
  --ux-shadow-strong: rgba(0, 0, 0, 0.72);
  --ux-key-base: #0d0c0a;
  --ux-key-top-1: #2b2722;
  --ux-key-top-2: #211e1a;
  --ux-key-shine: rgba(255, 255, 255, 0.11);
}

.ux,
.ux * {
  box-sizing: border-box;
}

.ux {
  font-family: var(--font, 'Noto Sans KR', system-ui, -apple-system, sans-serif);
  color: var(--ux-ink);
  -webkit-font-smoothing: antialiased;
}

.ux button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.ux button:focus-visible,
.ux a:focus-visible,
.ux input:focus-visible,
.ux [tabindex]:focus-visible {
  outline: 2px solid var(--ux-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ux *,
  .ux *::before,
  .ux *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   2. #219 Circular Dark Mode Reveal & Rotating Sun/Moon Button
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html[data-theme-reveal='1']::view-transition-old(root),
  html[data-theme-reveal='1']::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  html[data-theme-reveal='1']::view-transition-old(root) {
    z-index: 1;
  }

  html[data-theme-reveal='1']::view-transition-new(root) {
    z-index: 2;
    animation: u219-reveal 0.68s cubic-bezier(0.65, 0, 0.35, 1) both;
  }

  @keyframes u219-reveal {
    from {
      clip-path: circle(0px at var(--u219-cx, 92vw) var(--u219-cy, 36px));
    }
    to {
      clip-path: circle(var(--u219-r, 150vmax) at var(--u219-cx, 92vw) var(--u219-cy, 36px));
    }
  }
}

body.home.blog.hisoka-orbit .u219-tg.notebook-theme-toggle,
.hisoka-wave-site .u219-tg.notebook-theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--ux-surface);
  color: var(--ux-ink);
  box-shadow:
    inset 0 0 0 1px var(--ux-line-2),
    0 1px 2px var(--ux-shadow);
  transition:
    transform 0.4s var(--ux-spring),
    box-shadow 0.25s var(--ux-ease),
    color 0.2s var(--ux-ease),
    background-color 0.2s var(--ux-ease);
}

body.home.blog.hisoka-orbit .u219-tg.notebook-theme-toggle:hover,
.hisoka-wave-site .u219-tg.notebook-theme-toggle:hover {
  color: var(--ux-accent);
  background: var(--ux-surface);
  box-shadow:
    inset 0 0 0 1px var(--ux-accent),
    0 6px 16px -10px var(--ux-shadow-strong);
  transform: translateY(-1px);
}

body.home.blog.hisoka-orbit .u219-tg.notebook-theme-toggle:active,
.hisoka-wave-site .u219-tg.notebook-theme-toggle:active {
  transform: scale(0.93);
}

.u219-tg svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  transition:
    transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1),
    opacity 0.3s var(--ux-ease);
}

.u219-tg .u219-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.65);
}

.u219-tg .u219-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.u219-tg[aria-pressed='true'] .u219-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.u219-tg[aria-pressed='true'] .u219-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.65);
}

/* --------------------------------------------------------------------------
   3. #471 Command Search Button (3D Keycap Trigger)
   -------------------------------------------------------------------------- */
body.home.blog.hisoka-orbit .nav-search.u471-b,
.hisoka-wave-site .nav-search.u471-b {
  --u471-k: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  min-height: 42px;
  padding: 0 7px 0 13px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  background: var(--ux-surface);
  color: var(--ux-ink-2);
  text-align: left;
  text-decoration: none;
  box-shadow:
    0 0 0 1px var(--ux-line-2),
    0 1px 2px var(--ux-shadow),
    0 12px 24px -18px var(--ux-shadow-strong);
  transform: scale(var(--u471-k));
  transition:
    transform 0.5s cubic-bezier(0.34, 1.7, 0.5, 1),
    box-shadow 0.35s var(--ux-ease),
    color 0.2s var(--ux-ease);
}

body.home.blog.hisoka-orbit .nav-search.u471-b:hover,
.hisoka-wave-site .nav-search.u471-b:hover {
  color: var(--ux-ink);
  background: var(--ux-surface);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ux-ink) 32%, transparent),
    0 2px 4px var(--ux-shadow),
    0 14px 28px -18px var(--ux-shadow-strong);
}

body.home.blog.hisoka-orbit .nav-search.u471-b.is-down,
.hisoka-wave-site .nav-search.u471-b.is-down {
  --u471-k: 0.975;
  transition:
    transform 0.14s var(--ux-ease),
    box-shadow 0.35s var(--ux-ease),
    color 0.2s;
}

body.home.blog.hisoka-orbit .nav-search.u471-b.is-hit,
.hisoka-wave-site .nav-search.u471-b.is-hit {
  box-shadow:
    0 0 0 1px var(--ux-accent),
    0 0 0 4px var(--ux-accent-soft),
    0 14px 28px -18px var(--ux-shadow-strong);
  transition:
    transform 0.5s cubic-bezier(0.34, 1.7, 0.5, 1),
    box-shadow 0.12s var(--ux-ease),
    color 0.2s;
}

body.home.blog.hisoka-orbit .nav-search.u471-b.is-pop,
.hisoka-wave-site .nav-search.u471-b.is-pop {
  animation: u471-pop 0.55s cubic-bezier(0.34, 1.6, 0.5, 1);
}

@keyframes u471-pop {
  0% { transform: scale(0.975); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

.u471-b .u471-ic {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.8;
  transition: transform 0.5s cubic-bezier(0.34, 1.8, 0.5, 1);
}

.u471-b.is-hit .u471-ic {
  transform: rotate(-14deg) scale(1.12);
}

.u471-b .u471-l {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.u471-ks {
  position: relative;
  z-index: 1;
  flex: none;
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
}

.u471-k {
  position: relative;
  display: block;
  font-family: inherit;
  min-width: 24px;
  height: 26px;
}

.u471-k::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  bottom: 0;
  border-radius: 7px;
  background: var(--ux-key-base);
  box-shadow:
    0 2px 3px -1px var(--ux-shadow),
    0 0 0 1px var(--ux-line);
  transition: box-shadow 0.2s var(--ux-ease);
}

.u471-k.is-wide {
  min-width: 34px;
}

.u471-t {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 23px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--ux-key-top-1), var(--ux-key-top-2));
  box-shadow:
    inset 0 0 0 1px var(--ux-line-2),
    inset 0 1px 0 var(--ux-key-shine);
  color: var(--ux-ink-2);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  transform: translateY(0);
  transition:
    transform 0.42s cubic-bezier(0.3, 1.9, 0.5, 1),
    color 0.25s,
    background-color 0.25s,
    box-shadow 0.25s;
}

.u471-k.is-wide .u471-t {
  font-size: 10.5px;
}

.u471-k.is-down::before {
  box-shadow:
    0 1px 1px -1px var(--ux-shadow),
    0 0 0 1px var(--ux-line);
  transition: box-shadow 0.08s;
}

.u471-k.is-down .u471-t {
  transform: translateY(3px);
  color: var(--ux-accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ux-accent) 55%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition:
    transform 0.07s var(--ux-ease),
    color 0.1s,
    box-shadow 0.1s;
}

.u471-k.is-ask .u471-t {
  animation: u471-ask 1.1s ease-in-out infinite;
}

@keyframes u471-ask {
  50% {
    transform: translateY(1px);
    box-shadow:
      inset 0 0 0 1px var(--ux-accent),
      0 0 0 3px var(--ux-accent-soft);
  }
}

.u471-rp {
  position: absolute;
  z-index: 0;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--ux-accent);
  opacity: 0;
  pointer-events: none;
  animation: u471-rp 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes u471-rp {
  0% { opacity: 0.26; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(26); }
}

@media (max-width: 640px) {
  body.home.blog.hisoka-orbit .nav-search.u471-b,
  .hisoka-wave-site .nav-search.u471-b {
    padding: 0 12px;
  }

  .u471-ks {
    display: none;
  }
}

@media (max-width: 440px) {
  body.home.blog.hisoka-orbit .nav-search.u471-b,
  .hisoka-wave-site .nav-search.u471-b {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .u471-b .u471-l {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Unify mobile hamburger button & menu drawer geometry with #219 / #471 */
body.home.blog.hisoka-orbit .mobile-menu summary,
.hisoka-wave-site .mobile-menu summary {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--ux-surface);
  color: var(--ux-ink);
  box-shadow:
    inset 0 0 0 1px var(--ux-line-2),
    0 1px 2px var(--ux-shadow);
  transition:
    transform 0.35s var(--ux-spring),
    box-shadow 0.25s var(--ux-ease),
    color 0.2s var(--ux-ease);
}

body.home.blog.hisoka-orbit .mobile-menu summary:hover,
.hisoka-wave-site .mobile-menu summary:hover {
  box-shadow:
    inset 0 0 0 1px var(--ux-accent),
    0 6px 16px -10px var(--ux-shadow-strong);
}

body.home.blog.hisoka-orbit .mobile-menu nav,
.hisoka-wave-site .mobile-menu nav {
  border: 0;
  border-radius: 16px;
  background: var(--ux-surface);
  box-shadow:
    0 0 0 1px var(--ux-line-2),
    0 20px 38px -18px var(--ux-shadow-strong);
}

/* --------------------------------------------------------------------------
   4. #046 Command Palette inside Native <dialog closedby="any">
   -------------------------------------------------------------------------- */
dialog.hisoka-cmd-dialog {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  margin: min(11vh, 92px) auto auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ux-ink);
  overflow: visible;
  opacity: 0;
  transform: translateY(-10px) scale(0.97);
  transition:
    opacity 0.24s var(--ux-ease),
    transform 0.34s var(--ux-spring),
    display 0.24s allow-discrete,
    overlay 0.24s allow-discrete;
}

dialog.hisoka-cmd-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog.hisoka-cmd-dialog[open] {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}

dialog.hisoka-cmd-dialog:modal {
  overscroll-behavior: contain;
}

dialog.hisoka-cmd-dialog::backdrop {
  background: rgba(24, 22, 19, 0.44);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  overscroll-behavior: contain;
  opacity: 0;
  transition:
    opacity 0.24s var(--ux-ease),
    display 0.24s allow-discrete,
    overlay 0.24s allow-discrete;
}

dialog.hisoka-cmd-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.hisoka-cmd-dialog[open]::backdrop {
    opacity: 0;
  }
}

.u046 {
  position: relative;
  width: 100%;
  height: min(496px, calc(100dvh - 48px));
}

.u046-pal {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--ux-surface);
  box-shadow:
    0 0 0 1px var(--ux-line-2),
    0 34px 60px -30px var(--ux-shadow-strong),
    0 6px 18px -6px var(--ux-shadow);
  overflow: hidden;
}

.u046-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  flex: none;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--ux-line);
  cursor: text;
  transition: border-color 0.3s;
}

.u046-field svg {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: var(--ux-ink-3);
  stroke-width: 2;
  stroke-linecap: round;
}

.u046-in {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ux-ink);
  outline: none;
}

.u046-in:focus-visible {
  outline: none;
}

.u046-in::placeholder {
  color: var(--ux-ink-3);
}

.u046-field:has(.u046-in:focus-visible) {
  box-shadow: inset 0 -2px 0 var(--ux-accent);
}

.u046-kbd {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--ux-surface-2);
  box-shadow: inset 0 -1px 0 var(--ux-line-2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ux-ink-3);
  font-family: inherit;
  white-space: nowrap;
}

.u046-close-btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: var(--ux-surface-2);
  box-shadow: inset 0 -1px 0 var(--ux-line-2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ux-ink-3);
  white-space: nowrap;
}

.u046-close-btn:hover {
  color: var(--ux-ink);
  background: var(--ux-surface-3);
}

.u046-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ux-line-2) transparent;
  overscroll-behavior: contain;
  padding: 6px 8px 10px;
}

.u046-hl {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 48px;
  border-radius: 13px;
  background: var(--ux-accent-soft);
  box-shadow: inset 3px 0 0 var(--ux-accent);
  transform: translateY(var(--y, 0));
  transition:
    transform 0.4s var(--ux-spring),
    height 0.25s var(--ux-ease),
    opacity 0.2s;
  pointer-events: none;
}

.u046-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.u046-g {
  padding: 10px 10px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ux-ink-3);
}

.u046-op {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 7px 10px;
  border-radius: 13px;
  font-size: 0.91rem;
  font-weight: 600;
  color: var(--ux-ink-2);
  cursor: pointer;
  animation: u046-in 0.4s var(--ux-spring) backwards;
  animation-delay: calc(min(var(--i, 0), 8) * 24ms);
}

.u046-op[aria-selected='true'] {
  color: var(--ux-ink);
}

.u046-op mark {
  background: none;
  color: var(--ux-accent);
  font-weight: 800;
}

.u046-ic {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--c, var(--ux-surface-2));
  color: var(--ux-accent-ink);
}

.u046-ic.plain {
  background: var(--ux-surface-2);
  color: var(--ux-ink-2);
}

.u046-ic svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.u046-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.u046-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.u046-sub {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ux-ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u046-op .u046-kbd {
  margin-left: auto;
  flex: none;
}

.u046-empty {
  padding: 36px 12px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ux-ink-3);
}

.u046-empty b {
  display: block;
  margin-bottom: 5px;
  font-size: 0.96rem;
  color: var(--ux-ink);
}

@keyframes u046-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.u046-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  flex: none;
  padding: 0 16px;
  border-top: 1px solid var(--ux-line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ux-ink-3);
}

.u046-foot .u046-kbd {
  height: 20px;
  padding: 0 5px;
  margin-right: 4px;
  font-size: 11px;
}

.u046-done {
  margin-left: auto;
  color: var(--ux-mint);
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s,
    transform 0.35s var(--ux-spring);
  white-space: nowrap;
}

.u046-done.show {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   5. #039 Sliding Pill Category Filter Tabs on Homepage #latest
   -------------------------------------------------------------------------- */
.u039-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.u039-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px;
  border-radius: 999px;
  background: var(--ux-surface);
  box-shadow:
    0 0 0 1px var(--ux-line-2),
    0 6px 16px -14px var(--ux-shadow-strong);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.u039-tabs::-webkit-scrollbar {
  display: none;
}

.u039-pill {
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: var(--w, 64px);
  border-radius: 999px;
  background: var(--ux-ink);
  transform: translateX(var(--x, 5px));
  box-shadow: 0 8px 16px -10px var(--ux-shadow-strong);
  transition:
    transform 0.5s var(--ux-spring),
    width 0.5s var(--ux-spring);
  pointer-events: none;
}

.u039-tab {
  position: relative;
  z-index: 1;
  flex: none;
  height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ux-ink-2);
  white-space: nowrap;
  transition: color 0.35s var(--ux-ease);
}

.u039-tab:hover {
  color: var(--ux-ink);
}

.u039-tab[aria-selected='true'] {
  color: var(--ux-page);
}

.u039-count {
  font-size: 0.8125rem;
  color: var(--ux-ink-3);
  font-variant-numeric: tabular-nums;
}

.journal-feed .post-row.is-tab-hidden {
  display: none;
}

.journal-feed .post-row.is-tab-enter {
  animation: u039-row-enter 0.48s var(--ux-spring) backwards;
  animation-delay: calc(min(var(--stagger, 0), 8) * 38ms);
}

@keyframes u039-row-enter {
  from {
    opacity: 0;
    transform: translateX(calc(var(--dir, 1) * 28px));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.u039-archive-cta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.u039-archive-cta[hidden] {
  display: none;
}

.u039-archive-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.u039-archive-cta a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Subtle interactive lift on editorial post rows */
body.home.blog.hisoka-orbit .post-row,
.hisoka-wave-site .related-post,
.hisoka-wave-site .archive-post {
  transition: background-color 0.22s var(--ux-ease), border-color 0.22s var(--ux-ease);
}

body.home.blog.hisoka-orbit .post-arrow,
.hisoka-wave-site .related-post__arrow,
.hisoka-wave-site .archive-post__arrow {
  transition: transform 0.32s var(--ux-spring), color 0.2s var(--ux-ease);
}

body.home.blog.hisoka-orbit .post-row:hover .post-arrow,
.hisoka-wave-site .related-post:hover .related-post__arrow,
.hisoka-wave-site .archive-post:hover .archive-post__arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   6. #008 Code Block Copy Button (MWG copy-button + Check Morph)
   -------------------------------------------------------------------------- */
.u008-wrap {
  position: relative;
  margin-block: 2em;
  border: 1px solid var(--line);
  background: var(--wave-code-background, var(--ux-surface-2));
  transition: box-shadow 0.45s var(--ux-ease), border-color 0.35s var(--ux-ease);
}

.u008-wrap.is-copied {
  border-color: var(--ux-mint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ux-mint) 16%, transparent);
}

.u008-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 40px;
  padding: 5px 8px 5px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ux-surface) 60%, transparent);
}

.u008-lang {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ux-ink-3);
}

.u008-pre-stage {
  position: relative;
  overflow: hidden;
}

.u008-pre-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in srgb, var(--ux-mint) 26%, transparent) 50%,
    transparent 80%
  );
  transform: translateX(-110%);
  pointer-events: none;
}

.u008-wrap.is-copied .u008-pre-stage::after {
  animation: u008-sweep 0.7s var(--ux-ease);
}

@keyframes u008-sweep {
  to {
    transform: translateX(110%);
  }
}

.hisoka-wave-site :is(.entry-content, .page-content) .u008-wrap pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.u008-act {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.u008-btn {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  padding: 0;
  border-radius: 9px;
  background: var(--ux-surface);
  color: var(--ux-ink-2);
  box-shadow: inset 0 0 0 1px var(--ux-line);
  transition:
    background-color 0.3s var(--ux-ease),
    color 0.3s var(--ux-ease),
    opacity 0.2s var(--ux-ease),
    transform 0.45s var(--ux-spring);
}

@media (hover: hover) {
  .u008-wrap .u008-btn {
    opacity: 0;
  }

  .u008-wrap:is(:hover, :focus-within) .u008-btn,
  .u008-wrap .u008-btn:is(:focus-visible, [data-copied], [data-failed]) {
    opacity: 1;
  }
}

.u008-btn:hover {
  background: var(--ux-surface-3);
  color: var(--ux-ink);
}

.u008-btn:active {
  transform: scale(0.88);
}

.u008-btn svg {
  position: absolute;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    opacity 0.25s var(--ux-ease),
    transform 0.5s var(--ux-spring);
}

.u008-ok {
  opacity: 0;
  transform: scale(0.4) rotate(-30deg);
}

.u008-ok path {
  stroke-width: 2.6;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 0.4s var(--ux-ease) 0.1s;
}

.u008-btn[data-copied] {
  background: var(--ux-mint);
  color: var(--ux-accent-ink);
  box-shadow: none;
}

.u008-btn[data-copied] .u008-cp {
  opacity: 0;
  transform: scale(0.4) rotate(30deg);
}

.u008-btn[data-copied] .u008-ok {
  opacity: 1;
  transform: none;
}

.u008-btn[data-copied] .u008-ok path {
  stroke-dashoffset: 0;
}

.u008-tip {
  position: absolute;
  right: 0;
  top: -38px;
  padding: 5px 10px;
  border-radius: 9px;
  background: var(--ux-ink);
  color: var(--ux-page);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.84);
  transform-origin: 80% 100%;
  transition:
    opacity 0.25s var(--ux-ease),
    transform 0.5s var(--ux-spring);
  z-index: 4;
}

.u008-tip::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: inherit;
  border-radius: 2px;
  transform: rotate(45deg);
}

.u008-wrap.is-copied .u008-tip,
.u008-link-copy.is-copied .u008-tip {
  opacity: 1;
  transform: none;
}

/* Inline article link copy button inside .entry-author */
.u008-link-copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-top: 2px;
}

.u008-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ux-surface-2);
  color: var(--ux-ink);
  box-shadow: inset 0 0 0 1px var(--ux-line-2);
  font-size: 12px;
  font-weight: 600;
  transition:
    background-color 0.25s var(--ux-ease),
    color 0.25s var(--ux-ease),
    box-shadow 0.25s var(--ux-ease),
    transform 0.35s var(--ux-spring);
}

.u008-link-btn:hover {
  box-shadow: inset 0 0 0 1px var(--ux-accent);
  color: var(--ux-accent);
}

.u008-link-btn:active {
  transform: scale(0.95);
}

.u008-link-btn .u008-ico {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
}

.u008-link-btn .u008-ico svg {
  position: absolute;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.22s var(--ux-ease), transform 0.45s var(--ux-spring);
}

.u008-link-btn[data-copied] {
  background: var(--ux-mint);
  color: var(--ux-accent-ink);
  box-shadow: none;
}

.u008-link-btn[data-copied] .u008-cp {
  opacity: 0;
  transform: scale(0.4) rotate(30deg);
}

.u008-link-btn[data-copied] .u008-ok {
  opacity: 1;
  transform: none;
}

.u008-link-btn[data-copied] .u008-ok path {
  stroke-dashoffset: 0;
}

/* --------------------------------------------------------------------------
   7. #275 Scrollspy TOC Track + MWG scrollspy
   -------------------------------------------------------------------------- */
.hisoka-wave-site .article-toc ol.u275-ul {
  position: relative;
  padding: 4px 0 18px 14px;
  scroll-target-group: auto;
}

.hisoka-wave-site .article-toc ol.u275-ul::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 20px;
  width: 2px;
  border-radius: 2px;
  background: var(--ux-line);
}

.hisoka-wave-site .article-toc .u275-mk {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 24px;
  border-radius: 2px;
  background: var(--ux-accent);
  transform: translateY(8px);
  transition:
    transform 0.35s var(--ux-spring),
    height 0.35s var(--ux-spring),
    opacity 0.25s var(--ux-ease);
  pointer-events: none;
}

.hisoka-wave-site .article-toc ol.u275-ul a {
  padding-block: 7px;
  color: var(--ux-ink-3);
  transition: color 0.22s var(--ux-ease);
}

.hisoka-wave-site .article-toc ol.u275-ul a:is(:target-current, .on, [aria-current='true']) {
  color: var(--ux-ink);
  font-weight: 700;
}

.hisoka-wave-site .article-toc ol.u275-ul a:hover {
  color: var(--ux-accent);
}

/* --------------------------------------------------------------------------
   8. #220 Selection Quote Tooltip & Paper Highlighter (Fine Pointer)
   -------------------------------------------------------------------------- */
.u220-hl-mark {
  background-color: transparent;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  background-image: linear-gradient(var(--ux-hl-ink), var(--ux-hl-ink));
  background-repeat: no-repeat;
  background-size: 0% 42%;
  background-position: 0 88%;
  transition: background-size 0.55s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.u220-hl-mark.is-hl {
  background-size: 100% 42%;
}

.u220-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 145;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--ux-ink);
  color: var(--ux-page);
  box-shadow:
    0 12px 26px -10px var(--ux-shadow-strong),
    0 2px 6px -2px var(--ux-shadow);
  transform: translate(-50%, -100%) scale(0.86);
  transform-origin: 50% 100%;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.16s var(--ux-ease),
    transform 0.26s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.u220-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-bottom: 0;
  border-top-color: var(--ux-ink);
}

.u220-tip.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 10px)) scale(1);
}

.u220-tip button {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ux-page);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.16s;
}

.u220-tip button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.u220-tip svg {
  width: 15px;
  height: 15px;
}

.u220-cp .u220-ok {
  display: none;
}

.u220-cp.is-ok .u220-ok {
  display: block;
}

.u220-cp.is-ok .u220-cpi {
  display: none;
}

/* --------------------------------------------------------------------------
   9. #435 Stacked Spring Toast Notifications
   -------------------------------------------------------------------------- */
.u435-host {
  position: fixed;
  right: 20px;
  bottom: 72px;
  z-index: 155;
  width: min(332px, calc(100vw - 24px));
  pointer-events: none;
}

.u435-rg {
  position: relative;
  width: 100%;
  height: 76px;
}

.u435-t {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 13px;
  border-radius: 15px;
  background: var(--ux-surface);
  box-shadow:
    0 0 0 1px var(--ux-line-2),
    0 14px 30px -14px var(--ux-shadow-strong),
    0 2px 6px -2px var(--ux-shadow);
  transform-origin: 50% 100%;
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(var(--s, 1));
  opacity: var(--o, 1);
  transition:
    transform 0.62s cubic-bezier(0.3, 1.42, 0.52, 1),
    opacity 0.3s var(--ux-ease);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  pointer-events: auto;
}

.u435-t.is-drag {
  transition: opacity 0.3s var(--ux-ease);
  cursor: grabbing;
}

.u435-t > * {
  transition: opacity 0.25s var(--ux-ease);
}

.u435-t.is-back > * {
  opacity: 0;
}

.u435-ic {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
}

.u435-ic > span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition:
    opacity 0.25s var(--ux-ease),
    transform 0.45s cubic-bezier(0.34, 1.6, 0.5, 1);
}

.u435-ic .ok {
  background: var(--ux-mint);
  color: var(--ux-accent-ink);
}

.u435-ic .bk {
  background: var(--ux-surface-3);
  color: var(--ux-ink-2);
  opacity: 0;
  transform: scale(0.4) rotate(-90deg);
}

.u435-ic svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.u435-ic .ok path {
  stroke-dasharray: 18;
  stroke-dashoffset: 18;
  animation: u435-draw 0.4s var(--ux-ease) 0.22s forwards;
}

.u435-t.is-in .u435-ic .ok {
  animation: u435-pop 0.5s cubic-bezier(0.34, 1.7, 0.5, 1) 0.08s both;
}

@keyframes u435-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes u435-pop {
  from {
    transform: scale(0.3);
  }
}

.u435-t.is-undo .u435-ic .ok {
  opacity: 0;
  transform: scale(0.4) rotate(90deg);
}

.u435-t.is-undo .u435-ic .bk {
  opacity: 1;
  transform: none;
}

.u435-tx {
  flex: 1;
  min-width: 0;
  display: grid;
}

.u435-tx b {
  grid-area: 1 / 1;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    opacity 0.25s var(--ux-ease),
    transform 0.35s var(--ux-ease),
    filter 0.25s var(--ux-ease);
}

.u435-tx b + b {
  opacity: 0;
  transform: translateY(7px);
  filter: blur(3px);
}

.u435-t.is-undo .u435-tx b:first-child {
  opacity: 0;
  transform: translateY(-7px);
  filter: blur(3px);
}

.u435-t.is-undo .u435-tx b + b {
  opacity: 1;
  transform: none;
  filter: none;
}

.u435-un {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--ux-surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--ux-ink);
  transition:
    opacity 0.2s var(--ux-ease),
    transform 0.3s var(--ux-ease),
    background-color 0.15s;
}

.u435-un:hover {
  background: var(--ux-surface-3);
}

.u435-un[hidden] {
  display: none;
}

.u435-t.is-undo .u435-un {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.u435-x {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: none;
  color: var(--ux-ink-3);
  transition: background-color 0.15s, color 0.15s;
}

.u435-x:hover {
  background: var(--ux-surface-2);
  color: var(--ux-ink);
}

.u435-x svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.u435-pb {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
}

.u435-pb i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ux-mint);
  opacity: 0.78;
  transform-origin: 0 50%;
  animation: u435-pb linear forwards;
}

.u435-t.is-undo .u435-pb i {
  background: var(--ux-ink-3);
}

@keyframes u435-pb {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.u435-rg.is-paused .u435-pb i {
  animation-play-state: paused;
}

@media (max-width: 520px) {
  .u435-host {
    right: 12px;
    bottom: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .u435-pb {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   10. Scroll-Driven Reading Progress (MWG scroll-progress-indicator) & Top Btn
   -------------------------------------------------------------------------- */
@supports (animation-timeline: scroll()) {
  .hisoka-wave-site .reading-progress {
    width: 100% !important;
    height: 3px;
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: hisoka-read-progress auto linear;
    animation-timeline: scroll(root block);
    will-change: transform;
  }

  @keyframes hisoka-read-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

.hisoka-back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 140;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--ux-surface);
  color: var(--ux-ink-2);
  box-shadow:
    0 0 0 1px var(--ux-line-2),
    0 10px 22px -12px var(--ux-shadow-strong);
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.25s var(--ux-ease),
    transform 0.4s var(--ux-spring),
    color 0.2s,
    box-shadow 0.2s;
}

.hisoka-back-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hisoka-back-top:hover {
  color: var(--ux-accent);
  box-shadow:
    0 0 0 1px var(--ux-accent),
    0 12px 24px -12px var(--ux-shadow-strong);
}

.hisoka-back-top svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 520px) {
  .hisoka-back-top {
    right: 12px;
    bottom: 14px;
  }
}
