.skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { left:16px; top:16px; width:auto; height:auto; padding:8px 12px; background:#fff; outline:2px solid; border-radius:6px; z-index:1000; }
/* a11y utility */
.sr-only{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}

/* === pub-year spacing (strong) === */

/* 強制適用：年度見出しの余白 */
.accordion-panel > .pub-year,
.pub-year{
  display:block !important;
  margin: 1.2rem 0 0.6rem !important;
  padding-left: 0.35em !important;
  letter-spacing: .02em !important;
}
/* 年度直下のリストの間隔 */
.pub-year + ul, .pub-year + ol, .pub-year + dl{
  margin-top: .45rem !important;
}


/* === headings enlarge (strong) === */

/* 強制適用：トップの目次見出しを拡大 */
section#welcome > details > summary,
section#news > details > summary,
#welcome details > summary,
#news details > summary{
  font-size: clamp(1.18rem, 2.4vw, 1.45rem) !important;
  font-weight: 650 !important;
}



/* === user-request override (2025-09-04 02:52) === */
/* 1) Publications 年度見出し 左余白を約1cmに */
.accordion-panel > .pub-year,
.pub-year{
  padding-left: 1cm !important;
}


/* === user-request override (2025-09-04 02:52) === */
/* 2) 「ようこそ」「お知らせ」見出しをさらに +2pt */
section#welcome > details > summary,
section#news > details > summary,
#welcome details > summary,
#news details > summary{
  font-size: calc(clamp(1.18rem, 2.4vw, 1.45rem) + 2pt) !important;
}



/* === user-request (apply to all TOC summaries) 2025-09-04 02:54 === */
section.accordion > details > summary,
.accordion > details > summary,
details.accordion > summary {
  font-size: calc(clamp(1.18rem, 2.4vw, 1.45rem) + 2pt) !important;
  font-weight: 650 !important;
}



/* === mobile accordion tweaks (2025-09-04 02:56) === */
@media (max-width: 640px){
  /* 目次（accordion の summary）全般のタップ領域拡大＆行間/余白最適化 */
  section.accordion > details > summary,
  .accordion > details > summary,
  details.accordion > summary,
  #welcome > details > summary,
  #news > details > summary{
    display:flex !important;
    align-items:center !important;
    min-height: 48px !important;        /* WCAG推奨相当のタップサイズ */
    padding: 12px 16px !important;       /* タップ余白を拡大 */
    margin: 6px 0 8px !important;
    line-height: 1.45 !important;
    border-radius: 10px !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
  }
  /* summaryのマーカー（▶︎）が大きすぎる場合の調整（WebKit系対策） */
  summary::-webkit-details-marker{ transform: scale(1.1); }
  /* パネル内の本文まわりの余白最適化 */
  .accordion-panel, .accordion-content, .content{
    padding: 6px 2px;
  }
}
/* フォーカス可視化（キーボード操作時） */
section.accordion > details > summary:focus-visible,
.accordion > details > summary:focus-visible{
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 10px;
}



/* === links page grouping & icon (2025-09-04 02:56) === */
.link-groups{
  display:grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (max-width: 900px){
  .link-groups{ grid-template-columns: 1fr; }
}
.link-group h3{
  margin: .2rem 0 .4rem;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
}
.link-list{ margin: .25rem 0 1.2rem; padding-left: 1.1rem; }
.link-list li{ margin: .35rem 0; line-height: 1.5; }

/* 外部リンクアイコン（リンクページのみ） */
.link-list a[target="_blank"]::after{
  content: "↗";
  font-size: .9em;
  margin-left: .35em;
}



/* === Publications TOC + BackToTop (2025-09-04 02:59) === */
.year-toc{
  margin: .8rem 0 1.2rem;
  padding: .6rem .8rem;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
}
.year-toc-title{ display:block; margin-bottom: .3rem; font-weight: 600; }
.year-toc-list{ display:flex; flex-wrap:wrap; gap: .5rem .75rem; padding-left: .2rem; margin: 0; list-style: none; }
.year-toc-list a{ text-decoration: none; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.back-to-top{ text-align: right; margin: .6rem 0 1.2rem; }
.back-to-top a{ text-decoration: none; font-size: .95rem; border-bottom: 1px dotted currentColor; }
@media (max-width: 640px){
  .year-toc{ padding: .6rem .7rem; border-radius: 8px; }
  .year-toc-list{ gap: .35rem .6rem; }
  .back-to-top a{ font-size: .95rem; }
}



/* === details/summary TOC + current year highlight (FY=2025) === */
details.year-toc{
  margin: .8rem 0 1.2rem;
  padding: .4rem .6rem .6rem;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
}
details.year-toc > summary{
  cursor: pointer;
  font-weight: 650;
  padding: .35rem .25rem;
  line-height: 1.35;
  list-style: none;
}
details.year-toc > summary::-webkit-details-marker{
  display: inline-block;
  transform: scale(1.1);
  margin-right: .2rem;
}
details.year-toc[open] > summary{
  border-bottom: 1px dashed rgba(0,0,0,.25);
  margin-bottom: .35rem;
}
.year-toc-list{ display:flex; flex-wrap:wrap; gap: .5rem .75rem; padding-left: .2rem; margin: 0; list-style: none; }
.year-toc-list li a{ text-decoration: none; border-bottom: 1px dashed currentColor; padding: 0 .1em .08em; }
.year-toc-list li.current-year a{
  font-weight: 800;
  background: rgba(255, 215, 0, .25); /* soft highlight */
  border-radius: 6px;
}
@media (max-width: 640px){
  details.year-toc{ padding: .35rem .5rem .5rem; border-radius: 8px; }
  .year-toc-list{ gap: .35rem .6rem; }
}



/* === Responsive TOC behavior + brand highlight === */
/* Brand tokens (tweak freely to match lab colors) */
:root{
  --brand-accent: #0068B7;            /* ブルー(例) */
  --brand-accent-bg: rgba(0,104,183,.18);
}

/* Desktop: even when details is not [open], show content (approximate "expanded by default") */
@media (min-width: 900px){
  details.year-toc:not([open]) > *:not(summary){ display:block !important; }
  /* optional: keep clickable; if非クリック化したい場合は pointer-events: none; を付ける */
}

/* Mobile(<=640px): semantic default (closed) を採用 → 追加ルール不要 */

/* Summary visuals */
details.year-toc > summary{
  cursor:pointer;
  font-weight: 650;
  padding:.35rem .25rem;
  line-height:1.35;
}
details.year-toc[open] > summary{
  border-bottom:1px dashed rgba(0,0,0,.25);
  margin-bottom:.35rem;
}

/* TOC list layout */
.year-toc{ margin:.8rem 0 1.2rem; padding:.4rem .6rem .6rem; border-radius:10px; background:rgba(0,0,0,.04); }
.year-toc-list{ display:flex; flex-wrap:wrap; gap:.5rem .75rem; padding-left:.2rem; margin:0; list-style:none; }
.year-toc-list li a{ text-decoration:none; border-bottom:1px dashed currentColor; padding:0 .1em .08em; }

/* Current FY highlight (brand color / thicker weight / larger radius) */
.year-toc-list li.current-year a{
  color: var(--brand-accent);
  font-weight: 825;
  background: var(--brand-accent-bg);
  border-radius: 12px;
  border-bottom-color: var(--brand-accent);
}
.year-current-marker{ font-size:.9em; margin-left:.25em; color: var(--brand-accent); font-weight:700; }

@media (max-width: 640px){
  .year-toc{ padding:.35rem .5rem .5rem; border-radius:8px; }
  .year-toc-list{ gap:.35rem .6rem; }
}



/* === TOC as static block (no accordion) === */
.year-toc{ margin:.8rem 0 1.2rem; padding:.4rem .6rem .6rem; border-radius:10px; background:rgba(0,0,0,.04); }
.year-toc-title{ display:block; font-weight:650; margin-bottom:.35rem; }
.year-toc-list{ display:flex; flex-wrap:wrap; gap:.5rem .75rem; padding-left:.2rem; margin:0; list-style:none; }



/* === TOC uniform link color (2025-09-04 03:17) === */
.year-toc-list a,
.year-toc-list a:visited{
  color: inherit !important;
}
/* Avoid unintended breaks by ensuring items wrap naturally */
.year-toc-list{ flex-wrap: wrap; }



/* === Publications: force accordions open on initial load === */
.page-publications .accordion-panel{
  display: block !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}



/* === Publications separators & tone + scroll offset (2025-09-04 03:25) === */
/* Offset anchor targets to account for fixed header (if any) */
.page-publications .pub-year{ scroll-margin-top: 80px; }

/* Top border between year blocks (skip the first one) */
.page-publications .accordion-panel h3.pub-year{
  border-top: 1px solid rgba(0,0,0,.12);
  padding-top: .6rem;
  margin-top: 1.4rem;
}
.page-publications .accordion-panel h3.pub-year:first-of-type{
  border-top: none;
  margin-top: .6rem;
}

/* Soft background tone for the list immediately following a year heading */
.page-publications .pub-year + ul,
.page-publications .pub-year + ol,
.page-publications .pub-year + dl{
  background: rgba(0,0,0,.02);
  padding: .6rem .9rem .75rem;
  border-radius: 8px;
}

/* Dark mode tune */
@media (prefers-color-scheme: dark){
  .page-publications .accordion-panel h3.pub-year{ border-top-color: rgba(255,255,255,.14); }
  .page-publications .pub-year + ul,
  .page-publications .pub-year + ol,
  .page-publications .pub-year + dl{ background: rgba(255,255,255,.05); }
}



/* === publications: darker tone & squarer corners (2025-09-04 03:28) === */
.page-publications .pub-year + ul,
.page-publications .pub-year + ol,
.page-publications .pub-year + dl{
  background: rgba(0,0,0,.05) !important; /* was .02 */
  border-radius: 3px !important;          /* was 8px */
}
@media (prefers-color-scheme: dark){
  .page-publications .pub-year + ul,
  .page-publications .pub-year + ol,
  .page-publications .pub-year + dl{
    background: rgba(255,255,255,.08) !important; /* was .05 */
    border-radius: 3px !important;
  }
}



/* === publication action buttons (ensured) === */
.pub-actions{ display:inline-flex; gap:.35rem; margin-left:.4rem; vertical-align:middle; }
.pub-btn{ font-size:.78em; line-height:1; border:1px solid currentColor; padding:.15em .38em; border-radius:4px; text-decoration:none; }
.pub-btn:hover{ opacity:.85; }
.pub-bibtex{ display:inline-block; }
.pub-bibtex > summary.pub-btn{ display:inline-block; cursor:pointer; list-style:none; }
.pub-bibtex > summary.pub-btn::-webkit-details-marker{ display:none; }
.pub-bibtex > pre{ margin:.35rem 0 0; padding:.4rem; border:1px dashed rgba(0,0,0,.25); background:rgba(0,0,0,.03); border-radius:4px; max-width: 100%; overflow:auto; }
@media (prefers-color-scheme: dark){
  .pub-bibtex > pre{ border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.05); }
}



/* === Unified content width === */
:root{
  --content-max: 1100px; /* adjust if you prefer narrower/wider */
  --content-pad: clamp(12px, 2vw, 24px);
}
/* Apply to common wrappers; non-matching pages are unaffected */
:is(main, .main, .content, .page, .container, #content){
  max-width: var(--content-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--content-pad);
  padding-right: var(--content-pad);
  box-sizing: border-box;
}
/* Tables and long code blocks shouldn't overflow */
:is(main, .main, .content, .page, .container, #content) :is(table, pre, code){
  max-width: 100%;
  overflow-x: auto;
}



/* === Back to top button === */
html{ scroll-behavior: smooth; }
.back-to-top{
  position: fixed;
  bottom: clamp(12px, 3vw, 24px);
  right: clamp(12px, 3vw, 24px);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; min-height: 44px; /* mobile tap target */
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,.75);
  color: #fff;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.back-to-top:hover{ opacity:.9; transform: translateY(-1px); }
.back-to-top:focus-visible{ outline: 2px solid #fff; outline-offset: 3px; }
.back-to-top-inline{ display: none !important; } /* hide legacy inline links */
@media (prefers-color-scheme: dark){
  .back-to-top{ background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); }
}



/* === Back to top: publications-only overrides === */
.pub-page .back-to-top{ position: fixed; bottom: clamp(12px, 3vw, 24px); right: clamp(12px, 3vw, 24px);
  z-index: 2000; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  background: rgba(0,0,0,.75); color:#fff; text-decoration:none; line-height:1; box-shadow:0 2px 10px rgba(0,0,0,.2); }
.pub-page .back-to-top:hover{ opacity:.9; transform: translateY(-1px); }
.pub-page .back-to-top:focus-visible{ outline:2px solid #fff; outline-offset:3px; }
/* Hide legacy inline "上に戻る" links only on publications page */
.pub-page .back-to-top-inline{ display: none !important; }



/* === Back to top: gray theme override === */
.pub-page .back-to-top{
  background: #6c757d; /* neutral gray to match site */
  color: #fff;
  border: 1px solid rgba(0,0,0,.15);
}
.pub-page .back-to-top:hover{ filter: brightness(1.05); }
@media (prefers-color-scheme: dark){
  .pub-page .back-to-top{
    background: #7a8288; /* slightly lighter gray in dark mode for contrast */
    border-color: rgba(255,255,255,.2);
  }
}



/* === Back to top: remove shadow & ghosts (publications only) === */
.pub-page .back-to-top{ box-shadow: none !important; text-shadow: none !important; }
.pub-page .back-to-top:hover{ filter: none !important; transform: none !important; }
.pub-page .back-to-top::before, .pub-page .back-to-top::after{ content: none !important; display: none !important; }
/* Hide common legacy elements that could appear as a black box in the same corner */
.pub-page #page-top,
.pub-page .page-top,
.pub-page .pagetop,
.pub-page .to-top,
.pub-page .totop{ display: none !important; }

