/* v09_52 self-hosted pass: shell imports local Noto Sans JP variable bridge; page stack preserved */

/* === SHIIKA generic long-page stylesheet / v07_30 === */
html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}
:root {
  --hub-page-font-sans: "Noto Sans JP Variable", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --pdf-dialogue-bubble-max-inline-size: 36.5rem;
  --pdf-dialogue-body-max-inline-size: none;
  --pdf-dialogue-body-padding-inline: 15px;
  --pdf-dialogue-body-padding-block-start: 9px;
  --pdf-dialogue-body-padding-block-end: 11px;
  --hub-layout-shell-wide-max: var(--hub-stage-max-width, 1560px);
  --hub-layout-shell-wide-gap: var(--hub-stage-gap, 16px);
  --hub-dialogue-avatar-size: 120px;
  --hub-dialogue-avatar-radius: 24px;
  --hub-dialogue-avatar-shadow: 0 10px 24px rgba(12,26,50,.10);
  --hub-dialogue-unit-gap: 18px;
        }
/* Imported dialogue typography. Scoped to imported content; shell laws stay shared. */
.dialogue-log .body strong { font-weight: 700; }
.dialogue-log .body p { margin: 0 0 1.2em; }
.dialogue-log .body blockquote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid #9ebbd0;
  background: #f0f6fb;
  color: inherit;
}
.dialogue-log .body ul, .dialogue-log .body ol { margin: 0 0 14px; padding-left: 1.6em; }
.dialogue-log .body li + li { margin-top: 5px; }
.dialogue-log .body h3 { margin: 0 0 12px; font-size: 1.03em; line-height: 1.8; }
.dialogue-log .body code { font: .92em/1.8 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.dialogue-log .body hr { margin: 16px 0; border: 0; border-top: 1px solid #c5d5e1; }
.dialogue-log .body > :last-child { margin-bottom: 0; }
.dialogue-log .dialogue-window-sequence { color: #5b7287; font-size: 11px; white-space: nowrap; }
.dialogue-log .dialogue-continuation { margin-top: 10px; }
.dialogue-log .dialogue-missing-attachment { margin: 0 0 14px; padding: 16px; border: 1px dashed #9ebbd0; background: #f0f6fb; }
.dialogue-log .dialogue-missing-attachment figcaption { margin-top: 8px; color: #526b80; font-size: .85em; line-height: 1.7; }

/* Shared dialogue-avatar law: 120px fallback; supported browsers use 60–120px.
   Keep the occupied flex slot, image and emote frame on this one token.
   No resize observer, per-page rule or size animation is required. */
@supports (width: clamp(60px, 10vw, 120px)) {
  :root {
    --hub-dialogue-avatar-size: clamp(60px, 10vw, 120px);
    --hub-dialogue-avatar-radius: calc(var(--hub-dialogue-avatar-size) * .2);
    --hub-dialogue-avatar-shadow: 0 calc(var(--hub-dialogue-avatar-size) / 12) calc(var(--hub-dialogue-avatar-size) / 5) rgba(12,26,50,.10);
    --hub-dialogue-unit-gap: calc(var(--hub-dialogue-avatar-size) * .15);
  }
}
body {
  margin: 0;
  color: #13253f;
  position: relative;
  background: transparent;
  font-family: var(--hub-page-font-sans);
  font-weight: 500;
  font-synthesis-weight: none;
}
body > :not(script):not(style) {
  position: relative;
  z-index: 1;
}
.title,
.sub,
.topic-label,
.body {
  font-family: var(--hub-page-font-sans);
  font-weight: 500;
  font-synthesis-weight: none;
}
.page {
  max-width: none;
  margin: 0;
  padding: 0;
}
.wiki-frame {
  width: clamp(1440px, calc(100vw - 24px), 1540px);
  margin: 18px auto 34px;
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px;
}
.wiki-sidebar,
.wiki-main,
.wiki-aside {
  position: relative;
  top: auto;
}
.wiki-sidebar {
  width: 260px;
  flex: 0 0 260px;
}
.wiki-main {
  min-width: 0;
  flex: 1 1 760px;
}
.wiki-aside {
  width: 240px;
  flex: 0 0 240px;
}
.wiki-sidebar,
.wiki-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wiki-brand,
.wiki-card,
.wiki-nav-group,
.shell {
  border: 1px solid #b6cdea;
  border-radius: 22px;
  box-shadow: 0 9px 20px rgba(9,20,40,.048);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.wiki-brand,
.wiki-card,
.wiki-nav-group {
  background: rgba(247,251,255,.95);
}
.shell {
  background: rgba(248, 251, 255, 0.975);
}
.wiki-brand { padding: 18px 16px 16px; }
.wiki-brand-kicker {
  font-size: 11px;
  font-weight: 800;
  color: #566f8b;
  letter-spacing: .05em;
}
.wiki-brand-title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: #18334f;
}
.wiki-brand-copy {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #526882;
}
.wiki-card-copy,
.wiki-brand-copy,
.page p,
.page li,
.body,
.body p,
.body li {
  font-weight: 500;
}
.wiki-nav-group,
.wiki-card {
  padding: 12px;
}
.wiki-nav-title,
.wiki-card-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: #58708b;
  letter-spacing: .03em;
}
.wiki-nav-list,
.wiki-mini-toc {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wiki-nav-link {
  display: block;
  padding: 9px 11px;
  border-radius: 14px;
  text-decoration: none;
  color: #284863;
  background: #eaf4ff;
  border: 1px solid #c2d9ee;
  font-size: 13px;
  line-height: 1.45;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.wiki-nav-link:hover { background: #dff0ff; border-color: #aec6e1; }
.wiki-nav-link.is-current {
  background: #d5e7fa;
  border-color: #96bee6;
  color: #2f6dac;
  font-weight: 700;
}
.wiki-nav-link.mini {
  font-size: 12px;
  padding: 8px 10px;
}
.wiki-main .page {
  max-width: none;
  margin: 0;
  padding: 0;
}
.wiki-main .shell { overflow: visible; }
.wiki-card-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #60728a;
}
.head {
  position: relative;
  top: auto;
  z-index: 1;
  padding: 26px 30px 22px;
  border-bottom: 1px solid #d1dbe8;
  background: #f7fbff;
}
.head::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: #d1dbe8;
}
.kicker {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #c1cfdf;
  font-size: 12px;
  color: #586d86;
  background: #eaf4ff;
  font-weight: 700;
  letter-spacing: .02em;
}
.title {
  margin: 14px 0 8px;
  font-size: 29px;
  line-height: 1.2;
  font-weight: 800;
}
.sub {
  margin: 0;
  color: #566f89;
  font-size: 14px;
  line-height: 1.8;
  max-width: 820px;
}
.topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #cbd7e4;
  overflow: visible;
}
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: #4f6881;
  background: #edf5ff;
  border: 1px solid #c2d9ee;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 6px rgba(12,26,50,.03);
}
.topic-chip:hover {
  background: #dcedff;
  border-color: #aac0da;
}
.topic-chip.is-active {
  background: #e6f2ff;
  color: #35608e;
  border-color: #9dbbe0;
  box-shadow: 0 2px 8px rgba(25,81,141,.06);
}
.chat { padding: 24px 28px 34px; }

/* archive-dialogue shared profiles
   Archive dialogue pages resolve through reusable layout profiles.
   Width, ornament, shell width, and avatar bands should not depend on file-specific CSS selectors. */
/* Background route note: archive dialogue pages no longer add page-specific backdrop washes here.
   Global backdrop rendering is unified in hub_shell_v07_32.css via body::before only. */
.topic-break {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 18px 0 10px;
  font: inherit;
}
.topic-break::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px dashed #bfd0e2;
  transform: translateY(-50%);
}
.topic-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(242,246,251,.97);
  border: 1px solid #c2d1e2;
  box-shadow: 0 4px 12px rgba(12,26,50,.05);
}
.topic-no {
  font-size: 11px;
  font-weight: 800;
  color: #58708b;
  letter-spacing: .04em;
}
.topic-label {
  font-size: 12px;
  font-weight: 800;
  color: #304e6e;
}
.row {
  position: relative;
  margin: 0 0 14px;
}
.row.user {
  display: flex;
  justify-content: flex-end;
}
.unit {
  display: flex;
  align-items: flex-start;
  gap: var(--hub-dialogue-unit-gap);
}
.row.user .unit {
  flex-direction: row-reverse;
  max-inline-size: 100%;
}
.avatar {
  width: var(--hub-dialogue-avatar-size);
  flex: 0 0 var(--hub-dialogue-avatar-size);
}
.avatar img {
  display: block;
  width: var(--hub-dialogue-avatar-size);
  height: var(--hub-dialogue-avatar-size);
  border-radius: var(--hub-dialogue-avatar-radius);
  object-fit: cover;
  object-position: center;
  background:
    radial-gradient(140% 70% at 50% 0%, rgba(255,255,255,.20) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(180deg, #eef7ff 0%, #def0ff 100%);
  border: 1px solid rgba(184, 202, 226, .94);
  box-shadow: var(--hub-dialogue-avatar-shadow);
}


.stack {
  min-width: 0;
  display: grid;
  gap: 6px;
  max-width: min(100%, 980px);
}
.row.user .stack {
  justify-items: end;
}
body[data-page-kind="dialogue"] .stack {
  justify-items: start;
}
body[data-page-kind="dialogue"] .row.user .stack {
  justify-items: end;
}
/* Keep each historical USER text origin fixed even for a short utterance.
   Bound the whole unit by the existing reading width plus avatar and gap;
   max-inline-size keeps it within the available row on narrow screens. */
.dialogue-log .row.user[data-source-turn] > .unit {
  inline-size: calc(var(--pdf-dialogue-bubble-max-inline-size) + var(--hub-dialogue-avatar-size) + var(--hub-dialogue-unit-gap));
  max-inline-size: 100%;
}
.dialogue-log .row.user[data-source-turn] > .unit > .stack {
  flex: 1 1 0;
}
.dialogue-log .row.user[data-source-turn] > .unit > .stack > .win {
  inline-size: 100%;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #5b728a;
}
body[data-page-kind="dialogue"] .meta {
  max-inline-size: min(100%, var(--pdf-dialogue-bubble-max-inline-size));
  justify-self: start;
}
.row.user .meta {
  justify-self: end;
  justify-content: flex-end;
}
body[data-page-kind="dialogue"] .row.user .meta {
  justify-self: end;
}
.role {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e6f2ff;
  border: 1px solid #bacbdd;
}
/* Historical USER/BUDDY labels are visual noise; keep their accessible text.
   Explicit display names opt out, while page guides/editorial notes are outside
   historical rows and remain visible. No stage/body/editor-baseline mutation. */
.dialogue-log .row[data-source-turn] .meta > .role:not([data-speaker-name]) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.win {
  border-radius: 22px;
  border: 1px solid #c1cfdf;
  background: rgba(244,248,255,.97);
  box-shadow: 0 7px 18px rgba(12,26,50,.055);
  min-width: 0;
}
body[data-page-kind="dialogue"] .win {
  inline-size: auto;
  width: auto;
  max-inline-size: min(100%, var(--pdf-dialogue-bubble-max-inline-size));
  justify-self: start;
}
body[data-page-kind="dialogue"] .row.user .win {
  background: rgba(236, 245, 255, 0.99);
  border-color: #afc4dd;
}

body[data-page-kind="dialogue"] .body {
  max-inline-size: none;
  width: auto;
  padding: var(--pdf-dialogue-body-padding-block-start) var(--pdf-dialogue-body-padding-inline) var(--pdf-dialogue-body-padding-block-end);
  font-size: 15.5px;
  line-height: 1.96;
  letter-spacing: .01em;
  word-break: normal;
  overflow-wrap: break-word;
  line-break: normal;
  text-wrap: wrap;
  hanging-punctuation: none;
  font-kerning: auto;
}
body[data-page-kind="dialogue"] .msgId {
  padding: 11px var(--pdf-dialogue-body-padding-inline) 0;
}
body[data-page-kind="dialogue"] .body p {
  margin: 0 0 14px;
}
body[data-page-kind="dialogue"] .body p:last-child {
  margin-bottom: 0;
}
body[data-page-kind="dialogue"] .body .lead {
  font-size: 16px;
  line-height: 1.88;
}
body[data-page-kind="dialogue"] .body p.beat {
  margin: 2px 0 12px;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: .04em;
  color: #587490;
  text-align: center;
}
.win-mid {
  background: rgba(249, 252, 255, 0.99);
}
.row.user .win {
  justify-self: end;
  background: linear-gradient(180deg, rgba(239,248,255,.985), rgba(228,241,255,.985));
  border-color: #afc4dd;
}
.msgId {
  padding: 10px 14px 0;
  font-size: 11px;
  font-weight: 800;
  color: #5b728a;
  letter-spacing: .03em;
}
.body {
  padding: 8px 14px 14px;
  font-size: 15px;
  line-height: 1.9;
  color: #152740;
  overflow-wrap: anywhere;
}
.body p {
  margin: 0 0 12px;
}
.body p:last-child {
  margin-bottom: 0;
}
.body .lead {
  font-size: 16px;
  font-weight: 700;
}
.note-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #c2d9ee;
  background: #eaf4ff;
  box-shadow: 0 4px 12px rgba(12,26,50,.05);
}
.note-box-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #566f8b;
}
.note-box p,
.note-box ul {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: #596f87;
}
.note-box ul {
  padding-left: 18px;
}
.note-box li + li {
  margin-top: 6px;
}
.tail-nav {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.back-top {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #355f8d;
  background: #edf5ff;
  border: 1px solid #c2d9ee;
  font-weight: 700;
  font-size: 13px;
}
.back-top:hover { background: #d7e1f2; }

/* enhancement gates */
@supports (display: grid) {
  html.enh-grid .wiki-frame {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 240px;
  }
}
@supports ((position: sticky) or (position: -webkit-sticky)) {
  @media (min-width: 941px) {
    html.enh-sticky .wiki-sidebar,
    html.enh-sticky .wiki-aside {
      position: sticky;
      top: 18px;
    }
    /* Row-level sticky avatars were causing expensive repaint/recomposite
       behavior on long dialogue/archive pages, especially PDF-style pages
       with larger bubbles. Keep sticky only for shell sidebars. */
    html.enh-sticky .avatar {
      position: static;
      top: auto;
    }
  }
  html.enh-sticky .head {
    position: sticky;
    top: 0;
    z-index: 30;
  }
}
@supports (content-visibility: auto) {
  /* Disabled by default for archive-style long pages.
     Row-level content-visibility can produce blank-then-repaint artifacts
     during fast scrolling, which is worse for perceived stability on low-spec devices.
     Keep as an explicit opt-in only. */
  html.enh-contentvis .row {
    content-visibility: auto;
    contain-intrinsic-size: auto 168px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 1260px) {
  .wiki-frame {
    display: block;
    max-width: 1120px;
  }
  .wiki-sidebar,
  .wiki-main,
  .wiki-aside {
    width: auto;
    flex: none;
  }
  .wiki-sidebar,
  .wiki-main,
  .wiki-aside {
    margin-bottom: 14px;
  }
}
@media (max-width: 940px) {
  .row.assistant { padding-right: 32px; }
  .row.user { padding-left: 32px; }
  .stack { max-width: calc(100vw - 176px); }
}
@media (max-width: 720px) {
  body[data-page-kind="dialogue"] .body {
    max-inline-size: none;
    font-size: 14.5px;
    line-height: 1.92;
    padding: 8px 14px 10px;
  }
  body[data-page-kind="dialogue"] .msgId {
    padding: 10px 14px 0;
  }
  body[data-page-kind="dialogue"] .body .lead {
    font-size: 15px;
  }
  .wiki-frame {
    margin: 10px auto 18px;
    padding: 0 8px;
  }
  .head {
    position: relative;
    top: auto;
    padding: 20px 16px 16px;
  }
  .chat { padding: 18px 12px 24px; }
  .title { font-size: 24px; }
  .row.assistant,
  .row.user {
    padding-left: 0;
    padding-right: 0;
  }
  .stack {
    max-width: calc(100vw - 106px);
  }
  .body {
    font-size: 14px;
    line-height: 1.82;
  }
}


/* layout profile law
   Keep layoutProfile as the routing surface for archive/hub width, but reduce it to token assignment.
   Actual shell rules are defined once below. Avatar size is globally unified and no longer routed by page profile. */
body[data-layout-profile="archive-dialogue-standard"],
body[data-layout-profile="archive-shell-standard"] {
  --hub-layout-shell-wide-max: 1450px;
  --hub-layout-shell-wide-gap: 14px;
}
@media (min-width: 1500px) {
  body[data-layout-profile] .hub-shell {
    width: min(calc(100% - 32px), var(--hub-layout-shell-wide-max));
    gap: var(--hub-layout-shell-wide-gap);
  }
}

/* html_v09_65 — standalone shell pages use stage-chunk bootstrap placeholders */
.hub-stage-placeholder-article .hub-stage-placeholder-page {
  min-height: clamp(180px, 24vh, 260px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.hub-stage-placeholder-copy {
  margin: 0;
  color: var(--hub-muted, #4f6987);
}


/* v10_01 section catalog scaffolding */
.hub-section-catalog-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.hub-section-catalog-card {
  border: 1px solid #c6d6e8;
  border-radius: 22px;
  background: rgba(247,251,255,.96);
  box-shadow: 0 9px 20px rgba(9,20,40,.045);
  padding: 18px 18px 16px;
}
.hub-section-catalog-card > h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  color: #18334f;
}
.hub-section-catalog-lead {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: #566f89;
}
.hub-section-catalog {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.hub-section-catalog-link {
  display: block;
  text-decoration: none;
  border: 1px solid #bfd0e2;
  border-radius: 18px;
  background: #eef6ff;
  color: #284863;
  padding: 13px 14px;
}
.hub-section-catalog-link:hover {
  background: #e2effd;
  border-color: #a8bfdc;
}
.hub-section-catalog-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hub-section-catalog-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #aac0da;
  background: #d9e9fa;
  color: #315d95;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}
.hub-section-catalog-main {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 800;
}
.hub-section-catalog-sub {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: #576d87;
}
.hub-section-catalog-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #60728a;
}
.hub-inline-utility-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}


/* buddy emote overlay layer v10_17
   Roll-up: structure rebuild + hard refine + adopted raster normalize + box-upsize fix.
   Sizes/offsets keep their 120px-avatar proportions at every viewport width. */
:root {
  --hub-buddy-emote-size-s: calc(var(--hub-dialogue-avatar-size) * 46 / 120);
  --hub-buddy-emote-size-m: calc(var(--hub-dialogue-avatar-size) * 62 / 120);
  --hub-buddy-emote-size-l: calc(var(--hub-dialogue-avatar-size) * 74 / 120);
  --hub-buddy-emote-offset-edge: calc(var(--hub-dialogue-avatar-size) * -.1);
  --hub-buddy-emote-offset-side: calc(var(--hub-dialogue-avatar-size) * -.15);
}
.avatar {
  position: relative;
  overflow: visible;
}
.buddy-avatar-frame {
  position: relative;
  display: block;
  inline-size: var(--hub-dialogue-avatar-size);
  block-size: var(--hub-dialogue-avatar-size);
  overflow: visible;
}
.buddy-avatar-frame > img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}
.buddy-emote {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  inline-size: var(--hub-buddy-emote-size, var(--hub-buddy-emote-size-m));
  block-size: var(--hub-buddy-emote-size, var(--hub-buddy-emote-size-m));
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: translate3d(0, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1)));
  filter: drop-shadow(0 3px 8px rgba(10,18,28,.18));
}
.buddy-emote::before {
  content: none;
  display: none;
}
.buddy-emote--s { --hub-buddy-emote-size: var(--hub-buddy-emote-size-s); }
.buddy-emote--m { --hub-buddy-emote-size: var(--hub-buddy-emote-size-m); }
.buddy-emote--l { --hub-buddy-emote-size: var(--hub-buddy-emote-size-l); }
.buddy-emote--xl { --hub-buddy-emote-size: calc(var(--hub-buddy-emote-size-l) * 1.16); }
.buddy-emote--top-right {
  inset-block-start: var(--hub-buddy-emote-offset-edge);
  inset-inline-end: var(--hub-buddy-emote-offset-edge);
}
.buddy-emote--top-left {
  inset-block-start: var(--hub-buddy-emote-offset-edge);
  inset-inline-start: var(--hub-buddy-emote-offset-edge);
}
.buddy-emote--top-center {
  inset-block-start: var(--hub-buddy-emote-offset-edge);
  inset-inline-start: 50%;
  transform: translate3d(-50%, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1)));
}
.buddy-emote--side-right {
  inset-block-start: 50%;
  inset-inline-end: var(--hub-buddy-emote-offset-side);
  transform: translate3d(0, -50%, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1)));
}
/* adopted raster marks: canonical ids bikku / hatena / sweat / tenten / piki.
   legacy aliases kept for backward compatibility: hate -> hatena, dots -> tenten.
   raster trims were normalized so base-scale can stay close to 1. */
.buddy-emote--bikku {
  --hub-buddy-emote-base-scale: 1.00;
  background-image: url('../assets/emotes/bikku.png');
}
.buddy-emote--dots, .buddy-emote--tenten {
  --hub-buddy-emote-base-scale: 1;
  background-image: url('../assets/emotes/tenten.png');
}
.buddy-emote--hate, .buddy-emote--hatena {
  --hub-buddy-emote-base-scale: 1.00;
  background-image: url('../assets/emotes/hatena.png');
}
.buddy-emote--kira {
  --hub-buddy-emote-base-scale: 1;
  background-image: url('../assets/emotes/kira.static.svg');
}
.buddy-emote--moya {
  --hub-buddy-emote-base-scale: 1;
  background-image: url('../assets/emotes/moya.static.svg');
}
.buddy-emote--piki {
  --hub-buddy-emote-base-scale: 1;
  background-image: url('../assets/emotes/piki.png');
}
.buddy-emote--pressure {
  --hub-buddy-emote-base-scale: 1;
  background-image: url('../assets/emotes/pressure.static.svg');
}
.buddy-emote--sweat {
  --hub-buddy-emote-base-scale: 1.00;
  background-image: url('../assets/emotes/sweat.png');
}
.buddy-emote.is-motion-pop,
.buddy-emote.is-motion-pulse,
.buddy-emote.is-motion-drift,
.buddy-emote.is-motion-shiver {
  will-change: transform, opacity;
}
.buddy-emote.is-motion-pop { animation: hubBuddyEmotePop 1.2s cubic-bezier(.26,.04,.18,1) infinite; }
.buddy-emote.is-motion-pulse { animation: hubBuddyEmotePulse 2.2s cubic-bezier(.4,0,.2,1) infinite; }
.buddy-emote.is-motion-drift { animation: hubBuddyEmoteDrift 2.4s cubic-bezier(.4,0,.2,1) infinite; }
.buddy-emote.is-motion-shiver { animation: hubBuddyEmoteShiver 1.2s steps(2, end) infinite; }
@keyframes hubBuddyEmotePop {
  0%, 100% { opacity: .96; transform: translate3d(0, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1))); }
  18% { opacity: 1; transform: translate3d(0, -1px, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1) * 1.12)); }
  30% { opacity: .98; transform: translate3d(0, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1) * .98)); }
}
@keyframes hubBuddyEmotePulse {
  0%, 100% { opacity: .92; transform: translate3d(0, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1))); }
  50% { opacity: 1; transform: translate3d(0, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1) * 1.05)); }
}
@keyframes hubBuddyEmoteDrift {
  0%, 100% { opacity: .94; transform: translate3d(0, 0, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1))); }
  50% { opacity: 1; transform: translate3d(0, -1px, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1) * 1.02)); }
}
@keyframes hubBuddyEmoteShiver {
  0%, 100% { opacity: .96; transform: translate3d(0, -50%, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1))); }
  25% { opacity: 1; transform: translate3d(1px, -50%, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1))); }
  75% { opacity: .98; transform: translate3d(-1px, -50%, 0) scale(calc(var(--hub-buddy-emote-base-scale, 1) * var(--hub-buddy-emote-scale, 1))); }
}
@media (prefers-reduced-motion: reduce) {
  .buddy-emote { animation: none !important; will-change: auto; }
}
/* Keep the previous compact emote sizes when fluid avatar sizing is unavailable. */
@supports not (width: clamp(60px, 10vw, 120px)) {
  @media (max-width: 720px) {
    :root {
      --hub-buddy-emote-size-s: 38px;
      --hub-buddy-emote-size-m: 52px;
      --hub-buddy-emote-size-l: 64px;
    }
  }
}
/* Seeker information pages — additive, scoped content styling only. */
/* Static information pages: payload-scoped, no added runtime or animation. */
.hub-info-page { padding: 26px 28px 32px; color: #13253f; overflow-wrap: anywhere; }
.hub-info-page h1 { margin: 12px 0; font-size: clamp(24px, 3vw, 30px); line-height: 1.5; }
.hub-info-page h2 { margin: 0 0 12px; font-size: 19px; line-height: 1.6; }
.hub-info-page h3 { font-size: 16px; line-height: 1.6; }
.hub-info-page p, .hub-info-page li { font-size: 15px; line-height: 1.9; }
.hub-info-page p { margin: 0 0 14px; }
.hub-info-page ul, .hub-info-page ol { padding-inline-start: 1.5em; }
.hub-info-page li + li { margin-top: 8px; }
.hub-info-page a:not(.hub-ghost-btn), .hub-info-promo a:not(.hub-ghost-btn) { color: #244f7b; text-underline-offset: .2em; }
.hub-info-page a:focus-visible, .hub-info-promo a:focus-visible { outline: 3px solid #315f8b; outline-offset: 3px; }
.hub-info-section, .hub-info-card { margin-top: 20px; padding: 20px; border: 1px solid #bfd3e7; border-radius: 18px; background: #f7fbff; }
.hub-info-section > :last-child, .hub-info-card > :last-child { margin-bottom: 0; }
.hub-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 16px; margin-top: 20px; }
.hub-info-grid > .hub-info-card { margin-top: 0; }
.hub-info-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-block: 18px; }
.hub-info-page .hub-ghost-btn, .hub-info-promo .hub-ghost-btn { min-block-size: 44px; max-inline-size: 100%; display: inline-flex; align-items: center; justify-content: center; white-space: normal; text-align: center; line-height: 1.6; }
/* Native disabled state: the unpublished install control never navigates. */
.hub-info-page .hub-ghost-btn:disabled { font-family: inherit; cursor: not-allowed; background: #edf1f5; border-color: #c6d0db; color: #526479; opacity: 1; transform: none; transition: none; }
.hub-info-label { display: inline-block; padding: 5px 12px; border: 1px solid #bdd2e7; border-radius: 999px; background: #eaf4ff; color: #355777; font-size: 13px; }
.hub-info-muted { color: #526b87; }
.hub-info-promo { margin-block: 20px; padding: 20px; border: 1px solid #bfd3e7; border-radius: 18px; background: #f7fbff; }
.hub-info-promo h2 { line-height: 1.6; }
.hub-info-page .hub-info-placeholder { margin: 0; padding: 24px 16px; border: 1px dashed #9db7d0; border-radius: 14px; background: #edf5fc; color: #526b87; text-align: center; }
@media (max-width: 720px) {
  .hub-info-page { padding: 20px 16px 26px; }
  .hub-info-section, .hub-info-card, .hub-info-promo { padding: 16px; }
}


/* Editorial notices are separate from original speaker turns. Static only. */
.dialogue-log .dialogue-moderation-note .unit { max-inline-size: 100%; }
.dialogue-log .dialogue-moderation-note .win {
  background: #fff5e1;
  border: 1px dashed #be995d;
  box-shadow: none;
}
.dialogue-log .dialogue-moderation-note .role {
  color: #6e4e20;
  background: #fff5e1;
  border-color: #cfb486;
}

/* Dialogue volume guides are editorial navigation, separate from source turns. */
.dialogue-log .dialogue-volume-guide {
  position: relative;
  margin: 32px 0;
  text-align: left;
}
.dialogue-log .dialogue-volume-guide .unit {
  justify-content: flex-start;
}
.dialogue-log .dialogue-volume-guide .dialogue-volume-link {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 0;
  color: #244f7b;
  text-decoration: underline;
  text-underline-offset: .2em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.dialogue-log .dialogue-volume-guide .dialogue-volume-link:focus-visible {
  outline: 2px solid #315f8b;
  outline-offset: 3px;
}
@media (max-width: 940px) {
  .dialogue-log .dialogue-volume-guide {
    padding-right: 32px;
  }
}
@media (max-width: 720px) {
  .dialogue-log .dialogue-volume-guide {
    margin: 24px 0;
    padding-right: 0;
  }
}

/* Series cards contain individual volume links, not one whole-card link. */
article.hub-section-catalog-series {
  cursor: default;
}
article.hub-section-catalog-series:hover {
  background: #eef6ff;
  border-color: #bfd0e2;
}
.hub-section-catalog-series .hub-section-catalog-parts {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 1.35em;
}
.hub-section-catalog-series .hub-section-catalog-parts > li {
  min-width: 0;
}
.hub-section-catalog-series .hub-section-catalog-part-link {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 4px 0;
  color: #244f7b;
  line-height: 1.7;
  text-decoration: underline;
  text-underline-offset: .2em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.hub-section-catalog-series .hub-section-catalog-part-link:focus-visible {
  outline: 2px solid #315f8b;
  outline-offset: 3px;
}

/* Site FAQ: editorial Q/A, independent of historical dialogue/avatars. */
.hub-faq-page .faq-list,
.hub-kaitai-page .kaitai-list { max-width: 56rem; }
.hub-faq-page .faq-item,
.hub-kaitai-page .kaitai-item { margin: 0; padding: 24px 0; border-bottom: 1px solid #cbd8e6; }
.hub-faq-page .faq-item:first-child,
.hub-kaitai-page .kaitai-item:first-child { padding-top: 8px; }
.hub-faq-page .body { margin: 0; }
.hub-faq-page .faq-question,
.hub-faq-page .faq-answer { display: grid; grid-template-columns: 1.7em minmax(0, 1fr); gap: 0; margin: 0; line-height: 1.9; }
.hub-faq-page .faq-question { font-weight: 700; }
.hub-faq-page .faq-answer { margin-top: 6px; }
.hub-faq-page .faq-text { min-width: 0; overflow-wrap: anywhere; }
.hub-faq-page .faq-label { white-space: nowrap; }

/* Original reference: share the FAQ reading width/rhythm, preserve source text. */
.hub-kaitai-page .kaitai-source-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 15px; line-height: 1.9; }
.hub-kaitai-page h1.kaitai-source-text { font-size: clamp(24px, 3vw, 30px); line-height: 1.5; margin: 12px 0; }
.hub-kaitai-page h2.kaitai-source-text { margin: 32px 0 16px; font-size: 19px; line-height: 1.5; }
.hub-kaitai-page h3.kaitai-source-text { font-weight: 700; margin-bottom: 6px; }
.hub-kaitai-page .kaitai-introduction { padding: 8px 0 24px; }
.hub-kaitai-page .kaitai-source-gap { display: none; }
.hub-kaitai-page [data-shell-toc-item] { scroll-margin-top: 118px; }
