/* Keep visual changes here so Butterfly remains easy to upgrade. */

:root {
  --kral-accent: #38bdf8;
  --kral-accent-soft: #a5f3fc;
  --kral-surface: rgba(255, 255, 255, 0.88);
  --kral-border: rgba(15, 23, 42, 0.08);
  --kral-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 12% 10%, rgba(56, 189, 248, 0.1), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.08), transparent 26rem), #f4f7fb;
}

#page-header.full_page {
  height: 100vh !important;
  min-height: 100vh;
  background-attachment: scroll !important;
  background-position: center 42% !important;
  background-size: cover !important;
}

#page-header.full_page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(6, 12, 24, 0.82) 0%,
      rgba(6, 12, 24, 0.48) 48%,
      rgba(6, 12, 24, 0.24) 100%
    ),
    linear-gradient(0deg, rgba(6, 12, 24, 0.54) 0%, transparent 45%);
}

#page-header #site-info,
#page-header #scroll-down {
  position: relative;
  z-index: 1;
}

#nav {
  z-index: 2;
}

/* Character portraits are limited to the site navigation hierarchy. */
.kral-character-icon,
#search-button .site-page > i.fa-search {
  --kral-character-image: none;
  --kral-character-position: center;
  display: inline-block !important;
  flex: 0 0 auto;
  width: 2.15rem !important;
  height: 2.15rem;
  margin-right: 0.14rem;
  border: 1px solid rgba(164, 220, 244, 0.78);
  border-radius: 7px;
  background-color: #eef7fb;
  background-image: var(--kral-character-image);
  background-position: var(--kral-character-position);
  background-repeat: no-repeat;
  background-size: 106%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.52),
    inset 0 -6px 10px rgba(38, 111, 148, 0.1),
    0 0 0 1px rgba(3, 12, 22, 0.34),
    0 3px 8px rgba(0, 0, 0, 0.3);
  font-size: 0;
  vertical-align: middle;
  transform: translateY(-1px);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    transform 160ms ease;
}

.kral-character-home {
  --kral-character-image: url('/img/icons/navigation/home.webp');
}

.kral-character-resume {
  --kral-character-image: url('/img/icons/navigation/resume.webp');
}

.kral-character-blog {
  --kral-character-image: url('/img/icons/navigation/blog.webp');
}

.kral-character-notes {
  --kral-character-image: url('/img/icons/navigation/notes.webp');
}

.kral-character-archive {
  --kral-character-image: url('/img/icons/navigation/archive.webp');
}

.kral-character-categories {
  --kral-character-image: url('/img/icons/navigation/categories.webp');
}

.kral-character-tags {
  --kral-character-image: url('/img/icons/navigation/tags.webp');
}

.kral-character-projects {
  --kral-character-image: url('/img/icons/navigation/projects.webp');
}

.kral-character-project-home {
  --kral-character-image: url('/img/icons/navigation/project-home.webp');
}

.kral-character-kita {
  --kral-character-image: url('/img/icons/navigation/kita.webp');
}

.kral-character-game-archive {
  --kral-character-image: url('/img/icons/navigation/game-archive.webp');
}

.kral-character-github {
  --kral-character-image: url('/img/icons/navigation/github.webp');
}

#search-button .site-page > i.fa-search {
  --kral-character-image: url('/img/icons/navigation/search.webp');
}

#nav .site-page:hover > .kral-character-icon,
#nav .site-page:focus-visible > .kral-character-icon,
#sidebar-menus .site-page:hover > .kral-character-icon,
#sidebar-menus .site-page:focus-visible > .kral-character-icon,
#search-button .site-page:hover > i.fa-search,
#search-button .site-page:focus-visible > i.fa-search {
  border-color: #a7e7ff;
  filter: saturate(1.08) brightness(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.68),
    inset 0 -6px 10px rgba(38, 111, 148, 0.12),
    0 0 0 2px rgba(56, 189, 248, 0.34),
    0 5px 12px rgba(0, 0, 0, 0.36);
  transform: translateY(-2px);
}

.menus_item_child .kral-character-icon {
  width: 1.9rem !important;
  height: 1.9rem;
}

#sidebar-menus .kral-character-icon {
  width: 2.15rem !important;
  height: 2.15rem;
}

#search-button .site-page > i.fa-search {
  margin-right: 0;
  font-size: 0 !important;
}

.kral-character-icon::before,
#search-button .site-page > i::before,
#search-button .site-page > i.fa-search::before {
  content: none !important;
}

#page-header.full_page #site-info {
  padding: 0 1rem;
  text-align: center;
}

#page-header.full_page #site-title {
  display: none;
}

#site-subtitle {
  min-height: 2.5rem;
  margin-top: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.65rem) !important;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75);
}

#subtitle {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

#scroll-down .scroll-down-effects {
  color: rgba(255, 255, 255, 0.82);
}

#page-header.not-home-page {
  background: linear-gradient(135deg, #0f172a, #1e293b) !important;
}

#content-inner.layout {
  max-width: 1200px;
  align-items: flex-start;
  gap: 1.5rem;
  padding-top: 3.5rem;
  padding-right: 1rem;
  padding-left: 1rem;
}

.kral-home-layout {
  flex-wrap: wrap;
}

.kral-home-layout > #recent-posts {
  width: calc(100% - 314px);
}

.kral-start-here {
  width: 100%;
  flex: 0 0 100%;
}

.kral-start-header {
  display: flex;
  margin: 0 0 1.25rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.kral-start-header > div {
  flex: 0 0 auto;
}

.kral-start-kicker {
  margin: 0 0 0.35rem;
  color: #0284c7;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.kral-start-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.kral-start-header > p {
  max-width: 31rem;
  margin: 0;
  color: #64748b;
  line-height: 1.75;
  text-align: right;
}

.kral-start-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

/*
 * Adapted from D-Sketon/hexo-theme-reimu's home category cards (MIT).
 * Upstream notice and license: THIRD_PARTY_NOTICES.md
 */
.kral-start-card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 220px;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  color: #fff;
  isolation: isolate;
}

.kral-start-card::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.56));
  content: '';
  transition: background-color 0.6s ease;
}

.kral-start-card img {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0.78;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.kral-start-card-projects img {
  object-position: center 42%;
}

.kral-start-card-notes img {
  object-position: center 52%;
}

.kral-start-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  padding: 1.25rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.78);
}

.kral-start-card-content strong {
  font-size: clamp(1.9rem, 3.3vw, 2.65rem);
  line-height: 1.25;
}

.kral-start-card-content small {
  margin-top: 0.65rem;
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  line-height: 1.5;
}

.kral-start-card:hover {
  color: #fff;
}

.kral-start-card:hover::after {
  background-color: rgba(0, 0, 0, 0.1);
}

.kral-start-card:hover img {
  opacity: 0.68;
  transform: scale(1.04);
}

.kral-start-card:focus-visible {
  outline: 3px solid var(--kral-accent);
  outline-offset: 4px;
}

.recent-post-item,
#aside-content .card-widget,
#page,
#post {
  border: 1px solid var(--kral-border);
  border-radius: 20px !important;
  background: var(--kral-surface) !important;
  box-shadow: var(--kral-shadow) !important;
  backdrop-filter: blur(18px);
}

#aside-content {
  width: 290px;
}

#aside-content .card-widget {
  overflow: hidden;
}

#aside-content .card-announcement > .item-headline {
  display: none;
}

#aside-content .card-announcement .announcement_content {
  text-align: left;
}

.kral-now h3 {
  margin: 0 0 0.85rem;
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.kral-now dl {
  margin: 0;
}

.kral-now dl > div {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.48rem 0;
  border-top: 1px solid var(--kral-border);
}

.kral-now dl > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.kral-now dt,
.kral-now dd {
  margin: 0;
  line-height: 1.55;
}

.kral-now dt {
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 750;
}

.kral-now dd {
  color: #64748b;
  font-size: 0.82rem;
}

/* Keep long article series readable without turning the aside into a cover wall. */
#aside-content .card-post-series .aside-list {
  counter-reset: kral-series-item;
}

#aside-content .card-post-series .aside-list-item {
  counter-increment: kral-series-item;
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.55rem 0;
  align-items: start;
}

#aside-content .card-post-series .aside-list-item::before {
  content: counter(kral-series-item, decimal-leading-zero);
  padding-top: 0.1rem;
  color: var(--card-meta);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#aside-content .card-post-series .thumbnail,
#aside-content .card-post-series time {
  display: none;
}

#aside-content .card-post-series .content {
  min-width: 0;
  padding-left: 0;
}

#aside-content .card-post-series .title {
  font-size: 0.82rem;
  line-height: 1.45;
}

#aside-content .card-post-series .title:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--kral-accent);
  outline-offset: 3px;
}

/* Remote counters stay out of view unless Busuanzi returns a real value. */
#aside-content .webinfo-item:has(#busuanzi_value_site_uv),
#aside-content .webinfo-item:has(#busuanzi_value_site_pv),
.post-meta-pv-cv {
  display: none;
}

#aside-content .webinfo-item.kral-stat-ready:has(#busuanzi_value_site_uv),
#aside-content .webinfo-item.kral-stat-ready:has(#busuanzi_value_site_pv) {
  display: flex;
}

.post-meta-pv-cv.kral-stat-ready {
  display: inline;
}

.post-meta-separator:has(+ .post-meta-pv-cv:not(.kral-stat-ready)) {
  display: none;
}

#kral-random-post:focus-visible {
  outline: 2px solid var(--kral-accent);
  outline-offset: 3px;
}

#kral-random-post:disabled {
  cursor: wait;
  opacity: 0.45;
}

#aside-content .card-info .avatar-img,
#sidebar-menus > .avatar-img {
  position: relative;
  isolation: isolate;
  padding: 3px;
  border: 0;
  background: #10152b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 22px rgba(34, 211, 238, 0.38),
    0 12px 32px rgba(109, 40, 217, 0.25);
}

#aside-content .card-info .avatar-img::before,
#sidebar-menus > .avatar-img::before {
  position: absolute;
  z-index: 0;
  inset: -45%;
  background: conic-gradient(from 0deg, #22d3ee, #818cf8 30%, #f472b6 58%, #fb7185 76%, #22d3ee);
  content: '';
  animation: kral-avatar-halo 8s linear infinite;
}

#aside-content .card-info .avatar-img::after,
#sidebar-menus > .avatar-img::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    112deg,
    transparent 34%,
    rgba(255, 255, 255, 0.42) 47%,
    transparent 60%
  );
  content: '';
  pointer-events: none;
  animation: kral-avatar-glint 5.8s ease-in-out infinite;
}

#aside-content .card-info .avatar-img img,
#sidebar-menus > .avatar-img img {
  position: absolute;
  z-index: 1;
  inset: 3px;
  width: calc(100% - 6px) !important;
  height: calc(100% - 6px) !important;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  object-position: center;
  transform: none !important;
  transition:
    filter 180ms ease,
    transform 180ms ease !important;
}

#aside-content .card-info .avatar-img:hover img,
#sidebar-menus > .avatar-img:hover img {
  filter: saturate(1.08) brightness(1.04);
  transform: scale(1.035) !important;
}

@keyframes kral-avatar-halo {
  to {
    transform: rotate(1turn);
  }
}

@keyframes kral-avatar-glint {
  0%,
  58% {
    transform: translateX(-145%) rotate(8deg);
  }

  78%,
  100% {
    transform: translateX(145%) rotate(8deg);
  }
}

#aside-content .card-info .author-info-name {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

#aside-content .card-info .author-info-description {
  color: #64748b;
}

#aside-content .card-info #card-info-btn {
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, var(--kral-accent));
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.22);
}

#aside-content .card-info #card-info-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.recent-post-item {
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

/* Keep the sparse initial homepage balanced; masonry resumes at two posts. */
#recent-posts .recent-post-items > .recent-post-item:only-child {
  width: 100% !important;
}

.recent-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16) !important;
}

.recent-post-item .recent-post-info {
  padding: 1.55rem 1.65rem 1.75rem !important;
}

.recent-post-item .article-title {
  font-size: clamp(1.3rem, 2vw, 1.65rem) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.recent-post-item .content {
  margin-top: 1rem;
  line-height: 1.8;
}

.recent-post-item .post_cover a:focus-visible,
.recent-post-item .article-title:focus-visible {
  border-radius: 8px;
  outline: 3px solid var(--kral-accent);
  outline-offset: 4px;
}

#page,
#post {
  padding: clamp(1.5rem, 4vw, 3rem);
}

#article-container {
  max-width: none;
}

#article-container .mermaid-wrap {
  max-width: 100%;
  overflow-x: auto;
  padding: 0.5rem 0;
  overscroll-behavior-inline: contain;
}

#article-container .mermaid-wrap > svg {
  display: block;
  height: auto !important;
  margin-right: auto;
  margin-left: auto;
}

/*
 * The Notes library follows the five information-density modes documented by
 * E-Hentai Galleries. Styling and markup are independently implemented for
 * this site; no upstream CSS or assets are copied.
 */
#content-inner.layout:has(.kral-notes-gallery) {
  width: 100%;
  max-width: 1720px;
  padding: 0.75rem;
}

#page:has(.kral-notes-gallery) {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 10px;
  background: #e9edf3;
  box-shadow: 0 18px 58px rgba(15, 23, 42, 0.12);
}

html[data-theme='dark'] #page:has(.kral-notes-gallery) {
  border-color: rgba(148, 163, 184, 0.14);
  background: #05070c;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.32);
}

#page:has(.kral-notes-gallery) > .page-title {
  display: none;
}

.kral-notes-gallery {
  --notes-accent: #0284c7;
  --notes-border: rgba(15, 23, 42, 0.18);
  --notes-border-strong: rgba(15, 23, 42, 0.34);
  --notes-panel: rgba(255, 255, 255, 0.74);
  --notes-panel-strong: #f8fafc;
  --notes-row: rgba(255, 255, 255, 0.56);
  --notes-row-alt: rgba(226, 232, 240, 0.66);
  --notes-text: #172033;
  --notes-muted: #64748b;
  --notes-tag: #334155;
  --notes-tag-bg: rgba(226, 232, 240, 0.9);
  padding: clamp(0.8rem, 2vw, 1.25rem);
  color: var(--notes-text);
}

html[data-theme='dark'] .kral-notes-gallery {
  --notes-accent: #38bdf8;
  --notes-border: rgba(148, 163, 184, 0.16);
  --notes-border-strong: rgba(148, 163, 184, 0.3);
  --notes-panel: rgba(15, 23, 42, 0.8);
  --notes-panel-strong: #0f172a;
  --notes-row: rgba(15, 23, 42, 0.72);
  --notes-row-alt: rgba(30, 41, 59, 0.72);
  --notes-text: #e5e7eb;
  --notes-muted: #94a3b8;
  --notes-tag: #cbd5e1;
  --notes-tag-bg: rgba(51, 65, 85, 0.84);
}

.kral-notes-header {
  margin-bottom: 0.85rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--notes-border);
  background: var(--notes-panel);
}

.kral-notes-header__title {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  column-gap: 1rem;
}

.kral-notes-header__title > p {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  color: var(--notes-accent);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.kral-notes-header__title > h1 {
  margin: 0;
  color: var(--notes-text);
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.kral-notes-header__title > span {
  max-width: 44rem;
  padding-bottom: 0.18rem;
  color: var(--notes-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.kral-notes-controls {
  display: grid;
  margin-top: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, auto);
  gap: 0.65rem;
}

.kral-notes-search {
  display: grid;
  min-height: 2.75rem;
  border: 1px solid var(--notes-border-strong);
  background: var(--notes-panel-strong);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.kral-notes-search > i {
  margin-left: 0.85rem;
  color: var(--notes-muted);
  font-size: 0.82rem;
}

.kral-notes-search input,
.kral-notes-search button,
.kral-notes-view-picker select {
  font: inherit;
}

.kral-notes-search input {
  min-width: 0;
  height: 100%;
  padding: 0 0.75rem;
  border: 0;
  outline: 0;
  color: var(--notes-text);
  background: transparent;
}

.kral-notes-search input::placeholder {
  color: var(--notes-muted);
}

.kral-notes-search button,
.kral-notes-status button {
  border: 0;
  color: var(--notes-accent);
  background: transparent;
  cursor: pointer;
}

.kral-notes-search button {
  height: 100%;
  padding: 0 0.85rem;
  border-left: 1px solid var(--notes-border);
  font-size: 0.78rem;
}

.kral-notes-view-picker {
  display: grid;
  min-height: 2.75rem;
  border: 1px solid var(--notes-border-strong);
  background: var(--notes-panel-strong);
  grid-template-columns: auto minmax(7rem, 1fr);
  align-items: center;
}

.kral-notes-view-picker > span {
  padding-left: 0.8rem;
  color: var(--notes-muted);
  font-size: 0.72rem;
}

.kral-notes-view-picker select {
  height: 100%;
  padding: 0 1.8rem 0 0.65rem;
  border: 0;
  outline: 0;
  color: var(--notes-text);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.kral-notes-filter {
  margin-top: 0.7rem;
}

.kral-notes-filter__quick,
.kral-notes-filter__all > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.kral-notes-filter__tag {
  display: inline-flex;
  min-height: 1.85rem;
  padding: 0.2rem 0.48rem;
  border: 1px solid var(--notes-border);
  color: var(--notes-tag);
  background: var(--notes-tag-bg);
  align-items: center;
  gap: 0.38rem;
  font-size: 0.7rem;
  cursor: pointer;
}

.kral-notes-filter__tag small {
  color: var(--notes-muted);
  font-size: 0.62rem;
}

.kral-notes-filter__tag:hover,
.kral-notes-filter__tag[aria-pressed='true'] {
  border-color: var(--notes-accent);
  color: var(--notes-accent);
}

.kral-notes-filter__tag[aria-pressed='true'] {
  background: color-mix(in srgb, var(--notes-accent) 14%, var(--notes-panel-strong));
}

.kral-notes-filter__all {
  margin-top: 0.45rem;
}

.kral-notes-filter__all summary {
  width: fit-content;
  color: var(--notes-muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.kral-notes-filter__all summary span {
  margin-left: 0.25rem;
  color: var(--notes-accent);
}

.kral-notes-filter__all > div {
  max-height: 13rem;
  margin-top: 0.55rem;
  padding: 0.6rem;
  overflow-y: auto;
  border: 1px solid var(--notes-border);
  background: var(--notes-panel-strong);
}

.kral-notes-status {
  display: flex;
  margin-top: 0.65rem;
  justify-content: space-between;
  color: var(--notes-muted);
  font-size: 0.7rem;
}

.kral-notes-status button {
  padding: 0;
}

.kral-notes-empty {
  margin: 2rem 0;
  color: var(--notes-muted);
  text-align: center;
}

.kral-notes-entry[hidden],
.kral-notes-empty[hidden] {
  display: none !important;
}

#article-container .kral-notes-entry__link {
  color: inherit;
  text-decoration: none !important;
  background-image: none !important;
  border-bottom: 0 !important;
  outline: 0;
}

.kral-notes-entry__media {
  overflow: hidden;
  background: #020617;
}

.kral-notes-entry__media img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0.92);
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    filter 260ms ease,
    transform 360ms ease;
}

.kral-notes-entry__content {
  min-width: 0;
}

.kral-notes-entry__identity,
.kral-notes-entry__details,
.kral-notes-entry__tags {
  display: flex;
  align-items: center;
}

.kral-notes-entry__identity {
  gap: 0.65rem;
  color: var(--notes-muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.kral-notes-entry__category {
  color: var(--notes-accent);
  font-weight: 750;
}

#article-container .kral-notes-entry h2 {
  margin: 0;
  overflow: hidden;
  color: var(--notes-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.42;
  text-decoration: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kral-notes-entry__details {
  min-width: 0;
  gap: 0.65rem;
  color: var(--notes-muted);
  font-size: 0.68rem;
}

.kral-notes-entry__series {
  overflow: hidden;
  color: var(--notes-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kral-notes-entry__tags {
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.kral-notes-entry__tag,
.kral-notes-entry__untagged {
  padding: 0.13rem 0.34rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--notes-tag);
  background: var(--notes-tag-bg);
  font-size: 0.62rem;
  line-height: 1.25;
}

.kral-notes-entry__reading {
  flex: 0 0 auto;
  white-space: nowrap;
}

.kral-notes-entry__link:hover .kral-notes-entry__media img,
.kral-notes-entry__link:focus-visible .kral-notes-entry__media img {
  filter: brightness(1.05);
}

.kral-notes-entry__link:focus-visible {
  outline: 2px solid var(--notes-accent);
  outline-offset: 2px;
}

/* Minimal: one restrained row with no cover or tags. */
.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-results,
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-results,
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-results,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-results {
  border: 1px solid var(--notes-border-strong);
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry {
  border-bottom: 1px solid var(--notes-border);
  background: var(--notes-row);
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry:nth-child(even) {
  background: var(--notes-row-alt);
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry:last-child,
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry:last-child,
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry:last-child,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry:last-child {
  border-bottom: 0;
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__media,
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__media {
  display: none;
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__content {
  display: grid;
  min-height: 2rem;
  padding: 0.28rem 0.55rem;
  grid-template-columns: 13rem minmax(0, 1fr) 6.5rem;
  align-items: center;
  gap: 0.65rem;
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__tags,
.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__series {
  display: none;
}

.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__details {
  justify-content: flex-end;
}

/* Minimal+: compact rows with a second line for tags. */
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__content {
  display: grid;
  min-height: 3.15rem;
  padding: 0.4rem 0.6rem;
  grid-template-columns: 13rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    'identity title'
    'identity details';
  align-items: center;
  gap: 0.15rem 0.65rem;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__identity {
  grid-area: identity;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry h2 {
  grid-area: title;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__details {
  grid-area: details;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__series {
  display: none;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__tags {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow: hidden;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__tag:nth-child(n + 4) {
  display: none;
}

/* Compact: a small thumbnail and a dense double-row listing. */
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__link {
  display: grid;
  min-height: 5.1rem;
  padding: 0.38rem;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.65rem;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__media {
  border: 1px solid var(--notes-border);
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__media img {
  height: 100%;
  object-fit: cover;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__content {
  display: grid;
  padding: 0.15rem 0;
  grid-template-rows: auto auto 1fr;
  align-content: center;
  gap: 0.22rem;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__series,
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__tag:nth-child(n + 5) {
  display: none;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__tags {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Extended: a large left cover with full browsing metadata. */
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__link {
  display: grid;
  min-height: 9rem;
  padding: 0.55rem;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr);
  gap: 1rem;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__media {
  border: 1px solid var(--notes-border);
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__media img {
  height: 100%;
  object-fit: cover;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__content {
  display: flex;
  padding: 0.35rem 0;
  justify-content: center;
  flex-direction: column;
  gap: 0.55rem;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry h2 {
  font-size: 1.1rem;
  white-space: normal;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__details {
  flex-wrap: wrap;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__series {
  flex-basis: 100%;
}

/* Thumbnail: the default film-library view. */
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
  column-count: 1;
  column-gap: 10px;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry {
  display: inline-block;
  width: 100%;
  margin: 0 0 10px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link {
  position: relative;
  display: block;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #090d16;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 2px 8px rgba(2, 6, 23, 0.16);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__media {
  display: block;
  border-radius: 3px;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__content {
  position: absolute;
  display: flex;
  padding: clamp(0.7rem, 2.2vw, 1.15rem);
  inset: 3px;
  justify-content: flex-end;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(2, 6, 23, 0.42) 58%,
    rgba(2, 6, 23, 0.96)
  );
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 220ms ease,
    transform 260ms ease;
  pointer-events: none;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__identity,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__series {
  display: none;
}

#article-container .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__content h2 {
  order: 2;
  color: #fff;
  font-size: clamp(0.9rem, 1.4vw, 1.08rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  white-space: normal;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__details {
  display: contents;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__tags {
  margin-bottom: 0.45rem;
  order: 1;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__tag,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__untagged {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(6px);
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__tag:nth-child(n + 3) {
  display: none;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__reading {
  margin-top: 0.38rem;
  order: 3;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.65rem;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:hover,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:focus-visible {
  border-color: rgba(125, 211, 252, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 4px 16px rgba(2, 6, 23, 0.28);
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:hover img,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:focus-visible img {
  transform: translate3d(0, 0, 0) scale(1.012);
}

.kral-notes-gallery[data-notes-view='thumbnail']
  .kral-notes-entry__link:hover
  .kral-notes-entry__content,
.kral-notes-gallery[data-notes-view='thumbnail']
  .kral-notes-entry__link:focus-visible
  .kral-notes-entry__content {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 640px) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
    column-count: 2;
  }
}

@media (min-width: 1100px) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
    column-count: 3;
  }
}

@media (min-width: 1600px) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
    column-count: 4;
  }
}

@media (hover: none), (pointer: coarse) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__content {
    background: linear-gradient(
      180deg,
      transparent 44%,
      rgba(2, 6, 23, 0.38) 66%,
      rgba(2, 6, 23, 0.92)
    );
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 700px) {
  .kral-notes-header__title {
    display: block;
  }

  .kral-notes-header__title > span {
    display: block;
    margin-top: 0.65rem;
  }

  .kral-notes-controls {
    grid-template-columns: 1fr;
  }

  .kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__content,
  .kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__content {
    display: grid;
    padding: 0.55rem;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: none;
    gap: 0.24rem;
  }

  .kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__identity,
  .kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry h2,
  .kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__details {
    grid-area: auto;
  }

  .kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry__details {
    justify-content: flex-start;
  }

  .kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__link {
    grid-template-columns: 5.6rem minmax(0, 1fr);
  }

  .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__link {
    grid-template-columns: 8.25rem minmax(0, 1fr);
  }

  .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry h2 {
    font-size: 0.94rem;
  }
}

.type-resume #page {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.type-resume #article-container h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.04em;
}

.type-resume #article-container h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--kral-border);
}

#footer {
  border-top: 1px solid var(--kral-border);
  background: transparent !important;
}

html[data-theme='dark'] {
  --kral-surface: rgba(15, 23, 42, 0.86);
  --kral-border: rgba(148, 163, 184, 0.14);
  --kral-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

html[data-theme='dark'] body {
  background:
    radial-gradient(circle at 12% 10%, rgba(14, 165, 233, 0.1), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.1), transparent 26rem), #080d18;
}

html[data-theme='dark'] #aside-content .card-info .author-info-description {
  color: #94a3b8;
}

html[data-theme='dark'] .kral-now dt {
  color: #e2e8f0;
}

html[data-theme='dark'] .kral-now dd {
  color: #94a3b8;
}

html[data-theme='dark'] .kral-start-header h2 {
  color: #e2e8f0;
}

html[data-theme='dark'] .kral-start-header > p {
  color: #94a3b8;
}

@media (max-width: 1024px) {
  #content-inner.layout {
    gap: 1rem;
  }

  .kral-home-layout > #recent-posts {
    width: calc(100% - 276px);
  }

  #aside-content {
    width: 260px;
  }
}

@media (max-width: 900px) {
  .kral-home-layout > #recent-posts {
    width: 100%;
  }
}

@media (max-width: 768px) {
  #page-header.full_page {
    height: 100svh !important;
    min-height: 100svh;
    background-position: 58% center !important;
  }

  #page-header.full_page #site-info {
    padding: 0 1.5rem;
  }

  #site-subtitle {
    min-height: 4rem;
    font-size: 1rem !important;
    line-height: 1.6;
  }

  #content-inner.layout {
    padding-top: 1.5rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .kral-start-header {
    margin-bottom: 1rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .kral-start-header > p {
    max-width: 34rem;
    text-align: left;
  }

  .kral-start-grid {
    grid-template-columns: 1fr;
    gap: 1.125rem;
  }

  .kral-start-card {
    min-height: 170px;
    aspect-ratio: 16 / 9;
  }

  .recent-post-item .recent-post-info {
    padding: 1.5rem !important;
  }

  #page,
  #post {
    padding: 1.35rem;
    border-radius: 18px !important;
  }
}

/*
 * /notes/: ExHentai-style archive skin.
 * This is an independent implementation using the blog's own article data.
 * Thumbnail keeps the existing image-library interaction; the other modes use
 * the compact grey table geometry shown by the reference archive.
 */
body:has(.kral-notes-gallery) {
  --notes-sea-white: #f4fcff;
  --notes-sea-ice: #d9f4ff;
  --notes-sea-cyan: #78d9ff;
  --notes-sea-blue: #239fd6;
  --notes-sea-deep: #052742;
  background:
    radial-gradient(68rem 34rem at 48% -8%, rgba(255, 255, 255, 0.2), transparent 58%),
    radial-gradient(ellipse at 84% 16%, rgba(137, 224, 255, 0.08), transparent 30%),
    linear-gradient(
      180deg,
      rgba(221, 247, 255, 0.02) 0%,
      rgba(58, 158, 205, 0.06) 42%,
      rgba(3, 31, 55, 0.26) 100%
    ),
    url('/img/start/projects.webp') center 42% / cover fixed no-repeat !important;
}

html[data-theme='dark'] body:has(.kral-notes-gallery) {
  background:
    radial-gradient(68rem 34rem at 48% -8%, rgba(224, 247, 255, 0.14), transparent 58%),
    radial-gradient(ellipse at 84% 16%, rgba(89, 199, 240, 0.07), transparent 30%),
    linear-gradient(
      180deg,
      rgba(94, 195, 232, 0.02) 0%,
      rgba(15, 94, 137, 0.08) 42%,
      rgba(1, 21, 39, 0.38) 100%
    ),
    url('/img/start/projects.webp') center 42% / cover fixed no-repeat !important;
}

body:has(.kral-notes-gallery) #body-wrap {
  background: transparent !important;
}

body:has(.kral-notes-gallery) #web_bg {
  display: none;
}

body:has(.kral-notes-gallery) #content-inner.layout {
  width: min(1515px, calc(100% - 32px));
  max-width: none;
  margin: 22px auto 32px;
  padding: 0;
}

body:has(.kral-notes-gallery) #page-header {
  display: none !important;
}

body:has(.kral-notes-gallery) #page {
  position: relative;
  isolation: isolate;
  width: 100%;
  margin: 0;
  padding: 0 !important;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 18px !important;
  color: #f2f2f2;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.022),
    transparent 24%,
    transparent 76%,
    rgba(210, 244, 255, 0.014)
  ) !important;
  box-shadow:
    0 22px 68px rgba(0, 38, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 1px 0 0 rgba(255, 255, 255, 0.3),
    inset -1px 0 0 rgba(153, 226, 255, 0.22),
    inset 0 -1px 0 rgba(105, 207, 245, 0.28) !important;
  -webkit-backdrop-filter: saturate(1.04) contrast(1.02);
  backdrop-filter: saturate(1.04) contrast(1.02);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

body:has(.kral-notes-gallery) #article-container {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.25;
}

body:has(.kral-notes-gallery) #page > .page-title {
  display: none;
}

body:has(.kral-notes-gallery) #page-header.not-top-img {
  margin-bottom: 0;
}

.kral-notes-gallery {
  --notes-page: rgba(255, 255, 255, 0.035);
  --notes-panel: rgba(255, 255, 255, 0.055);
  --notes-field: rgba(2, 30, 49, 0.3);
  --notes-row: rgba(8, 47, 76, 0.58);
  --notes-row-alt: rgba(24, 70, 99, 0.58);
  --notes-border: rgba(232, 249, 255, 0.28);
  --notes-border-light: rgba(255, 255, 255, 0.52);
  --notes-text: #f5fbff;
  --notes-muted: #c6e2ef;
  --notes-link: #f7fcff;
  padding: 0 19px 18px;
  color: var(--notes-text);
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
}

html[data-theme='dark'] .kral-notes-gallery {
  --notes-page: rgba(255, 255, 255, 0.025);
  --notes-panel: rgba(255, 255, 255, 0.04);
  --notes-field: rgba(1, 24, 41, 0.36);
  --notes-row: rgba(5, 37, 63, 0.66);
  --notes-row-alt: rgba(18, 55, 83, 0.64);
  --notes-border: rgba(218, 242, 255, 0.24);
  --notes-border-light: rgba(238, 250, 255, 0.46);
}

.kral-notes-subnav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 39px;
  margin: 8px 0 0;
  padding: 0 305px;
  align-items: center;
  justify-content: center;
  gap: 27px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.026),
    transparent 48%,
    rgba(191, 235, 252, 0.012)
  );
  box-shadow:
    0 8px 26px rgba(0, 39, 68, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(120, 216, 251, 0.25),
    inset 1px 0 0 rgba(255, 255, 255, 0.18),
    inset -1px 0 0 rgba(167, 231, 255, 0.16);
  -webkit-backdrop-filter: blur(1px) saturate(1.06);
  backdrop-filter: blur(1px) saturate(1.06);
  white-space: nowrap;
}

#article-container .kral-notes-subnav a {
  position: relative;
  color: #f4f4f4;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}

#article-container .kral-notes-subnav a::before {
  position: absolute;
  left: -9px;
  color: rgba(217, 244, 255, 0.68);
  content: '›';
}

#article-container .kral-notes-subnav a:hover {
  color: #dff8ff;
}

.kral-notes-header {
  margin: 0;
  padding: 8px 0 9px;
  border: 0;
  background: transparent;
}

.kral-notes-brand {
  margin: 0 0 11px;
  color: #f4f4f4;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 28, 49, 0.72);
}

#article-container .kral-notes-brand a,
#article-container .kral-notes-brand span {
  color: #f3e7d3;
  text-decoration: underline !important;
}

.kral-notes-search-panel {
  position: relative;
  width: min(915px, calc(100% - 40px));
  margin: 0 auto 10px;
  padding: 12px 48px 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.028),
    transparent 42%,
    rgba(200, 240, 255, 0.014)
  );
  box-shadow:
    0 14px 38px rgba(0, 44, 75, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 1px 0 0 rgba(255, 255, 255, 0.22),
    inset -1px 0 0 rgba(151, 226, 255, 0.2),
    inset 0 -1px 0 rgba(113, 216, 255, 0.28);
  -webkit-backdrop-filter: blur(1.5px) saturate(1.06);
  backdrop-filter: blur(1.5px) saturate(1.06);
}

.kral-notes-quick-filters {
  display: grid;
  margin-bottom: 15px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 14px;
}

.kral-notes-filter-button {
  position: relative;
  display: flex;
  height: 26px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  color: #fff;
  background: var(--notes-filter-tone, rgba(92, 126, 143, 0.94)) !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 5px 15px rgba(0, 36, 65, 0.13);
  cursor: pointer;
}

.kral-notes-filter-button small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 400;
}

.kral-notes-tone-0 {
  --notes-filter-tone: rgba(199, 43, 35, 0.94);
}

.kral-notes-tone-1 {
  --notes-filter-tone: rgba(232, 108, 28, 0.94);
}

.kral-notes-tone-2 {
  --notes-filter-tone: rgba(230, 155, 10, 0.94);
}

.kral-notes-tone-3 {
  --notes-filter-tone: rgba(103, 160, 112, 0.94);
}

.kral-notes-tone-4 {
  --notes-filter-tone: rgba(177, 163, 84, 0.94);
}

.kral-notes-tone-5 {
  --notes-filter-tone: rgba(73, 172, 211, 0.94);
}

.kral-notes-tone-6 {
  --notes-filter-tone: rgba(55, 105, 184, 0.94);
}

.kral-notes-tone-7 {
  --notes-filter-tone: rgba(123, 45, 174, 0.94);
}

.kral-notes-tone-8 {
  --notes-filter-tone: rgba(176, 38, 128, 0.94);
}

.kral-notes-tone-9 {
  --notes-filter-tone: rgba(119, 119, 119, 0.94);
}

.kral-notes-filter-button:hover,
.kral-notes-filter-button[aria-pressed='true'] {
  filter: brightness(1.12);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 0 0 2px rgba(109, 216, 255, 0.18),
    0 8px 24px rgba(0, 70, 108, 0.2);
}

.kral-notes-search-row {
  position: relative;
  display: grid;
  height: 33px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.kral-notes-search-row > .sr-only,
.kral-notes-view-picker > .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.kral-notes-search-row input,
.kral-notes-search-row button,
.kral-notes-view-picker select {
  border: 1px solid rgba(238, 250, 255, 0.42);
  border-radius: 10px;
  color: #f4f4f4;
  background: rgba(1, 28, 47, 0.3);
  box-shadow:
    inset 0 1px 8px rgba(0, 18, 35, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.1);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.kral-notes-search-row input {
  min-width: 0;
  padding: 2px 8px;
  outline: 0;
}

.kral-notes-search-row input:focus {
  border-color: rgba(174, 233, 255, 0.9);
  box-shadow:
    0 0 0 4px rgba(90, 200, 244, 0.14),
    inset 0 1px 8px rgba(0, 18, 35, 0.14);
}

.kral-notes-search-row input::placeholder {
  color: #a9aaae;
}

.kral-notes-search-row button {
  padding: 0 10px;
  cursor: pointer;
}

.kral-notes-search-row button:hover {
  background: rgba(91, 155, 191, 0.38);
}

.kral-notes-advanced-links {
  display: flex;
  min-height: 28px;
  padding-top: 6px;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
}

.kral-notes-advanced-links details {
  position: relative;
}

.kral-notes-advanced-links summary {
  color: #f4f4f4;
  font-size: 14px;
  list-style: none;
  text-decoration: underline;
  cursor: pointer;
}

.kral-notes-advanced-links summary::-webkit-details-marker {
  display: none;
}

.kral-notes-advanced-summary--hide {
  display: none;
}

.kral-notes-advanced[open] .kral-notes-advanced-summary--show {
  display: none;
}

.kral-notes-advanced[open] .kral-notes-advanced-summary--hide {
  display: inline;
}

.kral-notes-advanced-panel {
  display: grid;
  width: 360px;
  margin: 8px 0 2px -115px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kral-notes-advanced-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: rgba(235, 249, 255, 0.82);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.kral-notes-advanced-control select {
  min-width: 0;
  height: 29px;
  padding: 0 7px;
  border: 1px solid rgba(238, 250, 255, 0.38);
  border-radius: 7px;
  color: #f4f4f4;
  background: rgba(1, 28, 47, 0.3);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.kral-notes-active-filters {
  display: flex;
  min-height: 29px;
  margin-top: 2px;
  padding: 6px 0 0;
  border-top: 1px solid rgba(235, 249, 255, 0.18);
  align-items: center;
  gap: 8px;
}

.kral-notes-active-filters[hidden] {
  display: none;
}

.kral-notes-active-filters__label {
  flex: 0 0 auto;
  color: rgba(224, 246, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.kral-notes-active-filters__list {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 5px;
}

.kral-notes-active-filters__list button,
.kral-notes-active-filters > [data-notes-clear-active] {
  min-height: 21px;
  padding: 2px 8px;
  border: 1px solid rgba(224, 246, 255, 0.34);
  border-radius: 999px;
  color: #eefaff;
  background: rgba(2, 35, 59, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
}

.kral-notes-active-filters__list button:hover,
.kral-notes-active-filters__list button:focus-visible,
.kral-notes-active-filters > [data-notes-clear-active]:hover,
.kral-notes-active-filters > [data-notes-clear-active]:focus-visible {
  border-color: rgba(255, 255, 255, 0.68);
  color: #fff;
  background: rgba(73, 153, 192, 0.3);
  outline: 0;
}

.kral-notes-active-filters > [data-notes-clear-active] {
  flex: 0 0 auto;
  border-color: transparent;
  color: rgba(224, 246, 255, 0.68);
  background: transparent;
}

.kral-notes-all-tags > div {
  position: absolute;
  z-index: 15;
  width: 650px;
  max-height: 260px;
  margin: 7px 0 0;
  padding: 9px;
  overflow: auto;
  border: 1px solid rgba(238, 250, 255, 0.36);
  border-radius: 12px;
  color: #efefef;
  background: rgba(4, 42, 69, 0.82);
  box-shadow:
    0 16px 38px rgba(2, 19, 37, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

.kral-notes-all-tags > div {
  display: grid;
  right: -170px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.kral-notes-filter-button--tag {
  min-width: 0;
  height: 24px;
  justify-content: space-between;
  font-size: 11px;
}

.kral-notes-seekbar {
  display: flex;
  width: min(905px, calc(100% - 50px));
  height: 23px;
  margin: 0 auto 5px;
  padding: 0 8px;
  border-radius: 13px;
  border: 1px solid rgba(238, 250, 255, 0.24);
  background: rgba(255, 255, 255, 0.012);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(116, 213, 250, 0.2),
    0 5px 18px rgba(0, 45, 75, 0.06);
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.kral-notes-seekbar span {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 26%,
    rgba(255, 255, 255, 0.82),
    rgba(179, 231, 252, 0.38) 42%,
    rgba(40, 133, 178, 0.24) 72%
  );
  box-shadow:
    inset 0 -1px 2px rgba(0, 69, 108, 0.22),
    0 2px 5px rgba(0, 37, 66, 0.14);
}

.kral-notes-seekbar span.is-active {
  border-color: rgba(255, 255, 255, 0.86);
  background: #e4f9ff;
  box-shadow:
    0 0 0 4px rgba(92, 210, 255, 0.16),
    0 0 14px rgba(106, 220, 255, 0.58);
}

.kral-notes-result-count {
  margin: 0 0 5px;
  color: #fff;
  font-size: 15px;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 28, 49, 0.72);
}

.kral-notes-toolbar {
  position: relative;
  min-height: 39px;
}

.kral-notes-pagination {
  display: flex;
  width: fit-content;
  margin: 0 auto;
  align-items: center;
  gap: 38px;
}

.kral-notes-pagination button,
.kral-notes-pagination span {
  padding: 2px 0;
  border: 0;
  color: #f5f5f5;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  text-shadow: 0 2px 12px rgba(0, 28, 49, 0.62);
  white-space: nowrap;
}

.kral-notes-pagination button {
  cursor: pointer;
}

.kral-notes-pagination button:hover:not(:disabled) {
  color: #d9f5ff;
  text-decoration: underline;
}

.kral-notes-pagination button:disabled {
  color: #8d8f94;
  cursor: default;
}

.kral-notes-view-picker {
  display: block;
  position: absolute;
  width: 158px;
  height: 35px;
  min-height: 0;
  right: 0;
  bottom: 0;
  border: 0;
  background: transparent;
  grid-template-columns: none;
}

.kral-notes-pagination--bottom {
  margin-top: 14px;
  padding: 9px 18px;
  border: 1px solid rgba(238, 250, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.012) 54%,
    rgba(150, 216, 243, 0.04)
  );
  box-shadow:
    0 10px 26px rgba(0, 39, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    inset 0 -1px 0 rgba(99, 204, 244, 0.14);
  -webkit-backdrop-filter: blur(9px) saturate(1.14);
  backdrop-filter: blur(9px) saturate(1.14);
}

.kral-notes-view-picker select {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 9px;
  font-weight: 700;
  cursor: pointer;
}

.kral-notes-list-shell {
  min-width: 720px;
  overflow: hidden;
  border: 1px solid rgba(230, 247, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  box-shadow:
    0 16px 34px rgba(2, 21, 40, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.kral-notes-list-head,
#article-container .kral-notes-entry__link {
  display: grid;
  grid-template-columns: 118px 142px 24px minmax(0, 1fr) 100px 155px;
  align-items: center;
}

.kral-notes-list-head {
  min-height: 27px;
  color: #fff;
  background: rgba(2, 37, 62, 0.72);
  box-shadow: inset 0 -1px 0 rgba(225, 246, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.kral-notes-list-head span:nth-child(2),
.kral-notes-list-head span:nth-child(4) {
  text-align: center;
}

.kral-notes-results {
  border: 0 !important;
}

.kral-notes-entry,
.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(220, 244, 255, 0.08);
  background: var(--notes-row);
}

.kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='minimal'] .kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry:nth-child(even),
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry:nth-child(even) {
  background: var(--notes-row-alt);
}

.kral-notes-entry[hidden],
.kral-notes-empty[hidden] {
  display: none !important;
}

#article-container .kral-notes-entry__link {
  min-height: 29px;
  padding: 0 6px;
  color: var(--notes-link);
  text-decoration: none !important;
  background: transparent;
  outline: 0;
}

#article-container .kral-notes-entry__link:hover {
  color: #fff;
  background: rgba(191, 230, 248, 0.12);
}

#article-container .kral-notes-entry__link:focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid #b8edff;
  outline-offset: -2px;
}

.kral-notes-entry__category {
  display: block;
  width: 110px;
  max-width: calc(100% - 4px);
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  color: #fff;
  background: var(--notes-filter-tone, rgba(87, 126, 146, 0.78));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.kral-notes-entry time {
  color: #f2f2f2;
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  white-space: nowrap;
}

.kral-notes-entry__status-dot {
  display: inline-flex;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  background: #6bbd2a;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.kral-notes-entry__title-cell,
.kral-notes-entry__content {
  min-width: 0;
}

.kral-notes-entry__media {
  display: none;
  overflow: hidden;
  border: 1px solid rgba(220, 244, 255, 0.22);
  border-radius: 4px;
  background: rgba(3, 35, 59, 0.68);
}

.kral-notes-entry__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
  transition: filter 150ms ease;
}

.kral-notes-entry__content {
  display: flex;
  align-items: center;
  gap: 8px;
}

#article-container .kral-notes-entry h2 {
  margin: 0;
  overflow: hidden;
  color: #f2f2f2;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.22;
  text-decoration: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kral-notes-entry__tags {
  display: none;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.kral-notes-entry__tag,
.kral-notes-entry__untagged {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(218, 242, 255, 0.32);
  border-radius: 4px;
  color: #ededed;
  background: rgba(207, 238, 250, 0.16);
  font-size: 10px;
  line-height: 1.35;
}

.kral-notes-entry__reading,
.kral-notes-entry__uploader {
  overflow: hidden;
  color: #efefef;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kral-notes-empty {
  margin: 0;
  padding: 28px;
  border: 1px solid #111;
  border-top: 0;
  color: #f2f2f2;
  text-align: center;
}

/* Minimal+: the same dense listing with a second watched-tag line. */
.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__link {
  min-height: 43px;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__content {
  display: grid;
  align-content: center;
  gap: 3px;
}

.kral-notes-gallery[data-notes-view='minimal-plus'] .kral-notes-entry__tags {
  display: flex;
}

/* Compact: small cover plus two compact information rows. */
.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__link {
  min-height: 71px;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__title-cell,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__title-cell {
  display: grid;
  min-width: 0;
  align-items: stretch;
  gap: 8px;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__title-cell {
  grid-template-columns: 78px minmax(0, 1fr);
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__media,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__media {
  display: block;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__media {
  height: 59px;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__content,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__content {
  display: grid;
  align-content: center;
  gap: 5px;
}

.kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__tags,
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__tags {
  display: flex;
}

/* Extended: larger cover and full tag line, preserving the same table columns. */
.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__link {
  min-height: 132px;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__title-cell {
  grid-template-columns: 190px minmax(0, 1fr);
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__media {
  height: 118px;
}

#article-container .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry h2 {
  font-size: 16px;
  font-weight: 700;
  white-space: normal;
}

.kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__tags {
  flex-wrap: wrap;
  white-space: normal;
}

/* Thumbnail: preserve the existing dense image-library treatment. */
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-list-shell {
  min-width: 0;
  overflow: visible;
  border: 0;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-list-head {
  display: none;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
  column-count: 1;
  column-gap: 10px;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry:nth-child(even) {
  display: inline-block;
  width: 100%;
  margin: 0 0 10px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid rgba(224, 246, 255, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow:
    0 10px 26px rgba(0, 31, 55, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  page-break-inside: avoid;
}

#article-container .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link {
  position: relative;
  display: block;
  min-height: 0;
  padding: 3px;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__category,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry time,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__status-dot,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__uploader {
  display: none;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__title-cell,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__media {
  display: block;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__media {
  border: 0;
  border-radius: 3px;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__media img {
  width: 100%;
  height: auto;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__content {
  position: absolute;
  display: flex;
  padding: 15px;
  inset: 3px;
  justify-content: flex-end;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(2, 6, 23, 0.42) 58%,
    rgba(2, 6, 23, 0.96)
  );
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 220ms ease,
    transform 260ms ease;
  pointer-events: none;
}

#article-container .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry h2 {
  order: 2;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
  white-space: normal;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__tags {
  display: flex;
  margin-bottom: 7px;
  order: 1;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__tag:nth-child(n + 3) {
  display: none;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__reading {
  position: absolute;
  right: 15px;
  bottom: 15px;
  order: 3;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  opacity: 0;
  transition: opacity 220ms ease;
}

.kral-notes-gallery[data-notes-view='thumbnail']
  .kral-notes-entry__link:hover
  .kral-notes-entry__content,
.kral-notes-gallery[data-notes-view='thumbnail']
  .kral-notes-entry__link:focus-visible
  .kral-notes-entry__content {
  opacity: 1;
  transform: translateY(0);
}

.kral-notes-gallery[data-notes-view='thumbnail']
  .kral-notes-entry__link:hover
  .kral-notes-entry__reading,
.kral-notes-gallery[data-notes-view='thumbnail']
  .kral-notes-entry__link:focus-visible
  .kral-notes-entry__reading {
  opacity: 1;
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:hover img {
  filter: brightness(1.05);
}

.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:hover,
.kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__link:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(174, 233, 255, 0.72);
}

@media (min-width: 640px) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
    column-count: 2;
  }
}

@media (min-width: 1100px) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
    column-count: 3;
  }
}

@media (min-width: 1600px) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-results {
    column-count: 4;
  }
}

@media (max-width: 1050px) {
  .kral-notes-subnav {
    padding: 0 16px;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .kral-notes-pagination {
    margin-left: 0;
    gap: 20px;
  }

  .kral-notes-list-shell {
    overflow-x: auto;
  }
}

@media (max-width: 700px) {
  body:has(.kral-notes-gallery) {
    background-attachment: scroll !important;
  }

  body:has(.kral-notes-gallery) #content-inner.layout {
    width: calc(100% - 12px);
    margin-top: 8px;
  }

  .kral-notes-gallery {
    padding: 0 7px 9px;
  }

  .kral-notes-subnav {
    scrollbar-width: none;
  }

  .kral-notes-subnav::-webkit-scrollbar {
    display: none;
  }

  .kral-notes-search-panel {
    width: 100%;
    padding: 9px;
  }

  .kral-notes-quick-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .kral-notes-search-row {
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .kral-notes-search-row input,
  .kral-notes-search-row button {
    min-height: 33px;
  }

  .kral-notes-seekbar {
    width: 100%;
    overflow: hidden;
  }

  .kral-notes-seekbar span {
    flex-basis: 9px;
    width: 9px;
    height: 9px;
  }

  .kral-notes-toolbar {
    min-height: 78px;
  }

  .kral-notes-pagination {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
  }

  .kral-notes-pagination button,
  .kral-notes-pagination span {
    font-size: 13px;
  }

  .kral-notes-view-picker {
    width: 145px;
    right: 0;
    bottom: 0;
  }

  .kral-notes-list-shell {
    min-width: 0;
    overflow: hidden;
  }

  .kral-notes-list-head,
  #article-container .kral-notes-entry__link {
    grid-template-columns: 104px 22px minmax(0, 1fr);
  }

  .kral-notes-list-head span:nth-child(2),
  .kral-notes-list-head span:nth-child(5),
  .kral-notes-list-head span:nth-child(6),
  .kral-notes-entry time,
  .kral-notes-entry__reading,
  .kral-notes-entry__uploader {
    display: none;
  }

  .kral-notes-list-head span:first-child::after {
    content: 'Category';
  }

  .kral-notes-list-head span:first-child,
  .kral-notes-list-head span:nth-child(4) {
    text-align: center;
  }

  .kral-notes-entry__category {
    width: 98px;
    padding-right: 5px;
    padding-left: 5px;
  }

  #article-container .kral-notes-entry h2 {
    font-size: 12.5px;
  }

  .kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__title-cell,
  .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__title-cell {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
  }

  .kral-notes-gallery[data-notes-view='compact'] .kral-notes-entry__media {
    height: 50px;
  }

  .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__link {
    min-height: 84px;
  }

  .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry__media {
    height: 70px;
  }

  #article-container .kral-notes-gallery[data-notes-view='extended'] .kral-notes-entry h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }

  .kral-notes-active-filters {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .kral-notes-active-filters__label {
    padding-top: 4px;
  }

  .kral-notes-all-tags > div {
    position: fixed;
    width: calc(100vw - 30px);
    max-height: 52vh;
    top: 22vh;
    right: 15px;
    left: 15px;
  }

  .kral-notes-all-tags > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kral-notes-advanced-panel {
    width: min(330px, calc(100vw - 42px));
    margin-left: -85px;
  }
}

@media (hover: none), (pointer: coarse) {
  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__content {
    background: linear-gradient(
      180deg,
      transparent 44%,
      rgba(2, 6, 23, 0.38) 66%,
      rgba(2, 6, 23, 0.92)
    );
    opacity: 1;
    transform: none;
  }

  .kral-notes-gallery[data-notes-view='thumbnail'] .kral-notes-entry__reading {
    opacity: 1;
  }
}

@media (hover: hover) and (pointer: fine) {
  html,
  body,
  #body-wrap {
    cursor: url('/img/cursor/kral-cursor-default.png'), auto;
  }

  a,
  button,
  [role='button'],
  summary,
  label,
  select,
  input[type='button'],
  input[type='checkbox'],
  input[type='radio'],
  input[type='reset'],
  input[type='submit'],
  .site-page,
  .menus_item {
    cursor: url('/img/cursor/kral-cursor-pointer.png'), pointer !important;
  }

  input:not([type]),
  input[type='email'],
  input[type='password'],
  input[type='search'],
  input[type='tel'],
  input[type='text'],
  input[type='url'],
  textarea,
  [contenteditable='true'],
  #article-container p,
  #article-container li,
  #article-container code,
  #article-container blockquote {
    cursor: url('/img/cursor/kral-cursor-text.png'), text !important;
  }
}

/* Comments: a soft anime-colored backplate with an irregular sticker rail. */
#post > .custom-hr:has(+ #post-comment) {
  display: none;
}

#post-comment {
  --kral-comment-surface-a: #f3fbff;
  --kral-comment-surface-b: #fff3fa;
  --kral-comment-panel: rgba(255, 255, 255, 0.8);
  --kral-comment-panel-edge: rgba(126, 151, 211, 0.22);
  --kral-comment-label-a: #8ce6ef;
  --kral-comment-label-b: #b6a9f4;
  --kral-comment-label-c: #f3a5cf;
  --kral-comment-ink: #3d3b61;
  --kral-comment-sticker-outline: rgba(255, 255, 255, 0.94);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 2.8rem;
  padding: 5.35rem 1.25rem 5.15rem;
  border: 1px solid transparent;
  border-radius: 26px;
  background:
    radial-gradient(circle at 10% 3%, rgba(91, 218, 232, 0.2), transparent 29%) padding-box,
    radial-gradient(circle at 92% 96%, rgba(244, 142, 201, 0.17), transparent 31%) padding-box,
    radial-gradient(circle, rgba(117, 126, 192, 0.13) 0 1px, transparent 1.4px) 0 0 / 22px 22px
      padding-box,
    linear-gradient(145deg, var(--kral-comment-surface-a), var(--kral-comment-surface-b))
      padding-box,
    linear-gradient(115deg, #6ddce7, #aaa4f4 54%, #f3a1ce) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 20px 48px rgba(47, 56, 104, 0.14);
}

#post-comment .kral-comment-stickers {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  user-select: none;
}

#post-comment .kral-comment-sticker {
  position: absolute;
  display: block;
  width: var(--kral-sticker-size);
  aspect-ratio: 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(1.25px 0 0 var(--kral-comment-sticker-outline))
    drop-shadow(-1.25px 0 0 var(--kral-comment-sticker-outline))
    drop-shadow(0 1.25px 0 var(--kral-comment-sticker-outline))
    drop-shadow(0 -1.25px 0 var(--kral-comment-sticker-outline))
    drop-shadow(0 6px 7px rgba(24, 24, 61, 0.2));
}

#post-comment .kral-comment-sticker--idea {
  --kral-sticker-size: 50px;
  top: 14px;
  left: 18px;
  background-image: url('/img/reactions/anki-tan/sticker-idea.png');
  transform: rotate(-7deg);
}

#post-comment .kral-comment-sticker--cool {
  --kral-sticker-size: 44px;
  top: 10px;
  left: 59%;
  background-image: url('/img/reactions/anki-tan/sticker-cool.png');
  transform: rotate(6deg);
}

#post-comment .kral-comment-sticker--salute {
  --kral-sticker-size: 56px;
  top: 15px;
  right: 19px;
  background-image: url('/img/reactions/anki-tan/sticker-salute.png');
  transform: rotate(8deg);
}

#post-comment .kral-comment-sticker--thanks {
  --kral-sticker-size: 52px;
  bottom: 12px;
  left: 24px;
  background-image: url('/img/reactions/anki-tan/sticker-thanks.png');
  transform: rotate(-8deg);
}

#post-comment .kral-comment-sticker--giggle {
  --kral-sticker-size: 43px;
  bottom: 27px;
  left: 28%;
  background-image: url('/img/reactions/anki-tan/sticker-giggle.png');
  transform: rotate(7deg);
}

#post-comment .kral-comment-sticker--crown {
  --kral-sticker-size: 54px;
  right: 29%;
  bottom: 10px;
  background-image: url('/img/reactions/anki-tan/sticker-crown.png');
  transform: rotate(-5deg);
}

#post-comment .kral-comment-sticker--heart {
  --kral-sticker-size: 44px;
  right: 23px;
  bottom: 25px;
  background-image: url('/img/reactions/anki-tan/sticker-heart.png');
  transform: rotate(10deg);
}

#post-comment .comment-head {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: flex;
  height: 5.35rem;
  align-items: center;
  margin: 0 0 0.75rem;
  padding: 0 82px 0 76px;
}

#post-comment .comment-headline {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.46rem 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 11px 8px 12px 7px;
  background: linear-gradient(
    102deg,
    var(--kral-comment-label-a),
    var(--kral-comment-label-b) 56%,
    var(--kral-comment-label-c)
  );
  box-shadow: 0 7px 16px rgba(55, 58, 116, 0.14);
  color: var(--kral-comment-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  line-height: 1;
  transform: rotate(-0.8deg);
}

#post-comment .comment-headline > i {
  display: none;
}

#post-comment .comment-headline::before {
  margin-right: 0.45rem;
  content: 'KOHARU /';
  opacity: 0.55;
}

#post-comment .comment-headline > span {
  color: inherit;
  font-size: inherit;
  font-weight: 750;
}

#post-comment .comment-wrap {
  position: relative;
  z-index: 2;
}

#post-comment .comment-wrap,
#giscus-wrap {
  min-width: 0;
}

#post-comment .comment-wrap > div {
  position: relative;
  padding: clamp(0.55rem, 1.4vw, 0.85rem);
  border: 1px solid var(--kral-comment-panel-edge);
  border-radius: 18px;
  background: var(--kral-comment-panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 24px rgba(48, 46, 99, 0.08);
}

#post-comment iframe.giscus-frame {
  display: block;
}

[data-theme='dark'] #post-comment {
  --kral-comment-surface-a: #121a31;
  --kral-comment-surface-b: #25182e;
  --kral-comment-panel: rgba(7, 13, 29, 0.78);
  --kral-comment-panel-edge: rgba(148, 177, 227, 0.2);
  --kral-comment-label-a: #74dce7;
  --kral-comment-label-b: #a69bef;
  --kral-comment-label-c: #ec97c6;
  --kral-comment-ink: #17182d;
  --kral-comment-sticker-outline: rgba(235, 243, 255, 0.92);
  background:
    radial-gradient(circle at 10% 3%, rgba(75, 213, 225, 0.18), transparent 30%) padding-box,
    radial-gradient(circle at 92% 96%, rgba(238, 128, 191, 0.16), transparent 31%) padding-box,
    radial-gradient(circle, rgba(177, 176, 238, 0.09) 0 1px, transparent 1.4px) 0 0 / 22px 22px
      padding-box,
    linear-gradient(145deg, var(--kral-comment-surface-a), var(--kral-comment-surface-b))
      padding-box,
    linear-gradient(115deg, #54d5df, #9c91ec 54%, #ed8fc5) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 22px 54px rgba(2, 5, 20, 0.34);
}

@media (max-width: 640px) {
  #post-comment {
    margin-top: 2.25rem;
    padding: 4.55rem 0.65rem 4.1rem;
    border-radius: 20px;
  }

  #post-comment .kral-comment-sticker--idea {
    --kral-sticker-size: 38px;
    top: 11px;
    left: 11px;
  }

  #post-comment .kral-comment-sticker--salute {
    --kral-sticker-size: 42px;
    top: 14px;
    right: 11px;
  }

  #post-comment .kral-comment-sticker--cool,
  #post-comment .kral-comment-sticker--giggle,
  #post-comment .kral-comment-sticker--crown {
    display: none;
  }

  #post-comment .kral-comment-sticker--thanks {
    --kral-sticker-size: 38px;
    bottom: 11px;
    left: 12px;
  }

  #post-comment .kral-comment-sticker--heart {
    --kral-sticker-size: 36px;
    right: 12px;
    bottom: 18px;
  }

  #post-comment .comment-head {
    height: 4.55rem;
    justify-content: center;
    margin: 0;
    padding: 0 52px;
  }

  #post-comment .comment-headline {
    padding: 0.36rem 0.56rem;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  #post-comment .comment-wrap > div {
    padding: 0.35rem;
    border-radius: 14px;
  }
}

@media (max-width: 360px) {
  #post-comment .kral-comment-sticker--salute {
    display: none;
  }

  #post-comment .comment-head {
    justify-content: flex-end;
    padding-right: 11px;
    padding-left: 53px;
  }
}

/* Long-form posts: offer an explicit, local-only reading resume point. */
.kral-reading-resume {
  position: fixed;
  z-index: 1200;
  right: 1.25rem;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  width: min(560px, calc(100vw - 2.5rem));
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--kral-border);
  border-radius: 16px;
  background: var(--card-bg);
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
  color: var(--font-color);
  opacity: 0;
  backdrop-filter: blur(16px) saturate(1.08);
  transform: translateY(16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.kral-reading-resume.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.kral-reading-resume__icon {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.16));
  color: var(--kral-accent);
  font-size: 1rem;
  place-items: center;
}

.kral-reading-resume__content {
  min-width: 0;
}

.kral-reading-resume__eyebrow,
.kral-reading-resume__title {
  display: block;
}

.kral-reading-resume__eyebrow {
  margin-bottom: 0.12rem;
  color: var(--font-color);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.62;
}

.kral-reading-resume__title {
  overflow: hidden;
  color: var(--font-color);
  font-size: 0.92rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kral-reading-resume__actions {
  display: flex;
  gap: 0.4rem;
}

.kral-reading-resume__button {
  min-height: 2.25rem;
  padding: 0.42rem 0.7rem;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.kral-reading-resume__button--quiet {
  background: transparent;
  color: var(--font-color);
  opacity: 0.7;
}

.kral-reading-resume__button--primary {
  background: var(--kral-accent);
  color: #062033;
  font-weight: 700;
}

.kral-reading-resume__button:hover,
.kral-reading-resume__button:focus-visible {
  transform: translateY(-1px);
}

.kral-reading-resume__button--quiet:hover,
.kral-reading-resume__button--quiet:focus-visible {
  background: rgba(127, 127, 127, 0.12);
  opacity: 1;
}

.kral-reading-resume__button:focus-visible {
  outline: 2px solid var(--kral-accent);
  outline-offset: 2px;
}

@media (max-width: 680px) {
  .kral-reading-resume {
    right: 0.8rem;
    bottom: max(0.8rem, env(safe-area-inset-bottom));
    grid-template-columns: auto minmax(0, 1fr);
    width: calc(100vw - 1.6rem);
    padding: 0.78rem;
  }

  .kral-reading-resume__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .recent-post-item,
  .recent-post-item .post-bg,
  .kral-notes-entry__link,
  .kral-notes-entry__media img,
  .kral-notes-entry__content,
  .kral-start-card img,
  .kral-start-card::after,
  .kral-character-icon,
  #search-button .site-page > i.fa-search,
  #aside-content .card-info .avatar-img img,
  #sidebar-menus > .avatar-img img {
    transition: none !important;
  }

  .kral-reading-resume,
  .kral-reading-resume__button {
    transition: none !important;
  }

  #aside-content .card-info .avatar-img::before,
  #aside-content .card-info .avatar-img::after,
  #sidebar-menus > .avatar-img::before,
  #sidebar-menus > .avatar-img::after {
    animation: none !important;
  }

  .recent-post-item:hover,
  .recent-post-item:hover .post-bg,
  .kral-notes-entry__link:hover .kral-notes-entry__media img,
  .kral-start-card:hover img,
  #nav .site-page:hover > .kral-character-icon,
  #sidebar-menus .site-page:hover > .kral-character-icon,
  #search-button .site-page:hover > i.fa-search,
  #aside-content .card-info .avatar-img:hover img,
  #sidebar-menus > .avatar-img:hover img {
    transform: none !important;
  }

  .kral-reading-resume__button:hover,
  .kral-reading-resume__button:focus-visible {
    transform: none !important;
  }
}

@media print {
  #page-header,
  #footer,
  #rightside,
  #post-comment,
  .pagination-post,
  .post-copyright,
  .tag_share {
    display: none !important;
  }

  .kral-reading-resume {
    display: none !important;
  }

  body,
  #body-wrap,
  #content-inner,
  #page,
  #post {
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .type-resume #page {
    max-width: none;
    padding: 0;
  }
}
