@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;800&display=swap");

/* === SHIIKA generic long-page stylesheet / v07_30 === */
html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}
:root {
  --hub-page-font-sans: "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;
}
body {
  margin: 0;
  color: #13253f;
  position: relative;
  background: transparent;
  font-family: var(--hub-page-font-sans);
  font-weight: 500;
  font-synthesis-weight: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #e6f1fc;
  background-image:
    radial-gradient(1820px 700px at 50% -16%, rgba(249,252,255,.99) 0%, rgba(205,229,255,.92) 24%, rgba(148,198,248,.38) 43%, rgba(116,176,238,.14) 59%, rgba(116,176,238,0) 74%),
    linear-gradient(180deg, #e8f3ff 0%, #deedf9 58%, #d9e9f7 100%);
  background-repeat: no-repeat;
}
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:
    radial-gradient(1680px 300px at 50% -12%, rgba(243,249,255,.97) 0%, rgba(226,239,255,.84) 26%, rgba(198,224,251,.36) 42%, rgba(198,224,251,0) 60%),
    linear-gradient(180deg, rgba(248,251,255,.988), rgba(242,248,255,.972));
}
.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 #bfd0e2;
  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: #8dacd3;
  color: #315d95;
  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:
    linear-gradient(180deg, rgba(248,251,255,.985), rgba(241,248,255,.972)),
    linear-gradient(90deg, rgba(97,154,225,.13), rgba(157,197,241,.09));
}
.head::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86,116,160,.32), transparent);
}
.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 #bfd0e2;
  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; }
.topic-break {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 18px 0 10px;
}
.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;
}
.unit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.row.user .unit {
  flex-direction: row-reverse;
}
.avatar {
  width: 80px;
  flex: 0 0 80px;
}
.avatar img {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(180deg, #eaf2fd 0%, #dce9f8 100%);
  border: 1px solid #b8cae2;
  box-shadow: 0 7px 18px rgba(12,26,50,.06);
}
.stack {
  min-width: 0;
  display: grid;
  gap: 6px;
  max-width: min(100%, 980px);
}
.row.user .stack {
  justify-items: end;
}
body[data-page-chip="PDF"] .stack {
  justify-items: start;
}
body[data-page-chip="PDF"] .row.user .stack {
  justify-items: end;
}
.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-chip="PDF"] .meta {
  max-inline-size: min(100%, var(--pdf-dialogue-bubble-max-inline-size));
  justify-self: start;
}
.row.user .meta {
  justify-content: flex-end;
}
body[data-page-chip="PDF"] .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;
}
.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-chip="PDF"] .win {
  inline-size: fit-content;
  max-inline-size: min(100%, var(--pdf-dialogue-bubble-max-inline-size));
  justify-self: start;
}
body[data-page-chip="PDF"] .row.user .win {
  justify-self: end;
}

body[data-page-chip="PDF"] .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: strict;
  text-wrap: pretty;
  hanging-punctuation: allow-end;
  font-kerning: normal;
}
body[data-page-chip="PDF"] .msgId {
  padding: 11px var(--pdf-dialogue-body-padding-inline) 0;
}
body[data-page-chip="PDF"] .body p {
  margin: 0 0 14px;
}
body[data-page-chip="PDF"] .body p:last-child {
  margin-bottom: 0;
}
body[data-page-chip="PDF"] .body .lead {
  font-size: 16px;
  line-height: 1.88;
}
body[data-page-chip="PDF"] .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: linear-gradient(180deg, rgba(246,249,254,.98), rgba(242,247,254,.99));
}
.row.user .win {
  background: linear-gradient(180deg, rgba(236,244,255,.98), rgba(226,237,252,.98));
  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 #bfd0e2;
  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 #bfd0e2;
  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;
    }
    html.enh-sticky .avatar {
      position: sticky;
      top: 86px;
    }
  }
  html.enh-sticky .head {
    position: sticky;
    top: 0;
    z-index: 30;
  }
}
@supports (content-visibility: auto) {
  .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-chip="PDF"] .body {
    max-inline-size: none;
    font-size: 14.5px;
    line-height: 1.92;
    padding: 8px 14px 10px;
  }
  body[data-page-chip="PDF"] .msgId {
    padding: 10px 14px 0;
  }
  body[data-page-chip="PDF"] .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;
  }
  .unit {
    gap: 10px;
  }
  .avatar,
  .avatar img {
    width: 56px;
    height: 56px;
  }
  .stack {
    max-width: calc(100vw - 106px);
  }
  .body {
    font-size: 14px;
    line-height: 1.82;
  }
}
