:root{
  --bg0:#f7f7fb; --bg1:#ffffff;
  --text:rgba(15,23,42,.92); --muted:rgba(15,23,42,.72);
  --line:rgba(15,23,42,.12); --panel:rgba(15,23,42,.04);
  --shadow:0 24px 70px rgba(2,8,23,.10);
  --shadow2:0 12px 28px rgba(2,8,23,.08);
  --r:18px; --r2:28px; --max:1160px;

  --maroon:#800000; --slate:#2f4f4f; --midnight:#191970;
  --accent:var(--maroon);
  --accent2:var(--midnight);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;

  --fs-hero:clamp(32px, 3.6vw, 48px);
  --fs-h2:22px;
  --fs-lead:17px;
  --fs-body:15px;
  --fs-small:13px;
  --fs-nav:14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; font-family:var(--sans); color:var(--text); overflow-x:hidden;
  background:
    radial-gradient(900px 520px at 18% 8%, rgba(128,0,0,.10), transparent 60%),
    radial-gradient(900px 520px at 82% 14%, rgba(25,25,112,.08), transparent 60%),
    radial-gradient(900px 520px at 55% 92%, rgba(47,79,79,.06), transparent 60%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 55%, var(--bg0) 100%);
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; text-underline-offset:3px; }

.wrap{ max-width:var(--max); margin:0 auto; padding:0 20px; }
.card{
  border-radius:var(--r2); background:rgba(255,255,255,.82);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:var(--shadow);
  overflow:hidden;
}

/* Card inner padding utility (used on Members page to keep text away from edges) */
.card.pad{ padding:22px 22px; }
@media (max-width: 900px){ .card.pad{ padding:18px 18px; } }
.tile{
  padding:18px; border-radius:var(--r);
  background:rgba(255,255,255,.86);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 10px 25px rgba(2,8,23,.06);
}
.grid{ display:grid; gap:14px; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }

header{
  position:sticky; top:0; z-index:80;
  background:rgba(255,255,255,.82);
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(12px);
}
.top{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:14px 0;
}
.brand{ display:flex; align-items:center; gap:12px; min-width:260px; }
.brand .mark{
  width:44px; height:44px; border-radius:18px;
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 14px 28px rgba(128,0,0,.12);
  background:rgba(255,255,255,.9);
  display:grid; place-items:center;
}
.brand .t1{ font-weight:800; letter-spacing:.02em; font-size:13px; color:rgba(15,23,42,.70); }
.brand .t2{ font-weight:950; letter-spacing:.02em; font-size:16px; line-height:1.1; }

nav{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.navlink{
  font-size:var(--fs-nav); color:rgba(15,23,42,.72);
  padding:8px 10px; border-radius:12px; border:1px solid transparent;
}
.navlink:hover{ color:rgba(15,23,42,.92); border-color:rgba(15,23,42,.12); background:rgba(15,23,42,.04); text-decoration:none; }
.navlink.active{
  color:rgba(15,23,42,.92);
  background:rgba(128,0,0,.08);
  border-color:rgba(128,0,0,.18);
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 15px; border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.75);
  color:rgba(15,23,42,.92);
  font-size:14px; font-weight:900;
  box-shadow:var(--shadow2);
  transition:transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn.primary{
  border-color:rgba(128,0,0,.30);
  background:linear-gradient(135deg, rgba(128,0,0,.92), rgba(25,25,112,.72));
  color:rgba(255,255,255,.96);
  box-shadow:0 20px 45px rgba(128,0,0,.14);
}
.btn:hover{ text-decoration:none; transform:translateY(-1px); }
.btn:active{ transform:translateY(0); }

/* Form */
.input{
  width:100%;
  max-width:720px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.85);
  color:rgba(15,23,42,.92);
  outline:none;
  font-size:15px;
  line-height:1.4;
  box-shadow:0 1px 0 rgba(15,23,42,.04) inset, var(--shadow2);
}
.input:focus{
  border-color:rgba(128,0,0,.35);
  box-shadow:0 0 0 3px rgba(128,0,0,.12), var(--shadow2);
}

main{ padding:22px 0 8px; }
.hero{ padding:12px 0 6px; }
.kicker{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:999px;
  background:rgba(15,23,42,.04); border:1px solid rgba(15,23,42,.10);
  color:rgba(15,23,42,.78); font-size:13px; font-weight:900;
}
.kicker .dot{
  width:9px; height:9px; border-radius:99px; background:var(--accent2);
  box-shadow:0 0 0 0 rgba(25,25,112,.26);
  animation:pulse 1.8s ease-in-out infinite;
}
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(25,25,112,.26); }
  60%{ box-shadow:0 0 0 12px rgba(25,25,112,0); }
  100%{ box-shadow:0 0 0 0 rgba(25,25,112,0); }
}
h1{ margin:14px 0 10px; font-size:var(--fs-hero); line-height:1.10; letter-spacing:.01em; }
h2{ margin:0; font-size:var(--fs-h2); letter-spacing:.02em; }
.lead{ margin:0; color:rgba(15,23,42,.74); line-height:1.85; font-size:var(--fs-lead); max-width:72ch; }
.sectionTitle{
  display:flex; align-items:flex-end; justify-content:space-between; gap:10px;
  margin:8px 0 12px;
}
.sectionTitle p{ margin:6px 0 0; color:rgba(15,23,42,.70); font-size:14px; line-height:1.6; }

.imgCard{
  border-radius:var(--r2); overflow:hidden; border:1px solid rgba(15,23,42,.10);
  background:rgba(15,23,42,.04); position:relative; min-height:300px;
  box-shadow:var(--shadow2);
}
.imgCard img{ width:100%; height:100%; object-fit:cover; display:block; }
.imgCard::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 45%, rgba(15,23,42,.56) 100%);
  pointer-events:none;
}
.imgLabel{
  position:absolute; left:14px; right:14px; bottom:12px; z-index:2;
  display:flex; align-items:flex-end; justify-content:space-between; gap:10px;
}
.imgLabel b{ font-size:15px; letter-spacing:.02em; color:rgba(255,255,255,.96); }
.imgLabel span{ font-size:13px; color:rgba(255,255,255,.84); }

.chips{ display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.chip{
  font-size:13px; padding:7px 11px; border-radius:999px;
  background:rgba(15,23,42,.04); border:1px solid rgba(15,23,42,.10);
  color:rgba(15,23,42,.78); font-weight:800;
}

/* --- Performance (publications) --- */
body[data-page="performance"] .pubYear{
  border:1px solid rgba(15,23,42,.10);
  border-radius:14px;
  background:rgba(255,255,255,.78);
  margin-top:10px;
  overflow:hidden;
}
body[data-page="performance"] .pubYear>summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  font-size:14px;
  color:rgba(15,23,42,.92);
}
body[data-page="performance"] .pubYear>summary::-webkit-details-marker{ display:none; }
body[data-page="performance"] .pubYear>summary .muted{ color:rgba(15,23,42,.55); font-weight:800; font-size:12px; }
body[data-page="performance"] .pubList{ margin:0; padding:0 16px 14px 34px; }
body[data-page="performance"] .pubItem{ margin:12px 0; }
body[data-page="performance"] .pubTitle{ font-weight:950; line-height:1.55; color:rgba(15,23,42,.92); }
body[data-page="performance"] .pubMeta{ margin-top:6px; color:rgba(15,23,42,.68); font-size:13px; line-height:1.7; }
body[data-page="performance"] .pubLinks{ margin-top:6px; font-size:13px; }
body[data-page="performance"] .pubLinks a{ color:#800000; text-decoration:none; border-bottom:1px solid rgba(128,0,0,.28); }
body[data-page="performance"] .pubLinks a:hover{ border-bottom-color:rgba(128,0,0,.55); }

hr.sep{ border:none; border-top:1px solid rgba(15,23,42,.10); margin:18px 0; }

footer{
  border-top:1px solid rgba(15,23,42,.10);
  padding:26px 0 42px;
  color:rgba(15,23,42,.62);
  font-size:13px;
}
.footGrid{ display:grid; grid-template-columns:1.2fr .8fr; gap:14px; }
.footCard{ padding:16px; border-radius:var(--r); background:rgba(255,255,255,.82); border:1px solid rgba(15,23,42,.10); box-shadow:0 10px 22px rgba(2,8,23,.05); }

.reveal{ opacity:0; transform:translateY(14px); transition:opacity .6s ease, transform .6s ease; }
.reveal.on{ opacity:1; transform:translateY(0); }


/* --- Mobile nav (hamburger + drawer) --- */
.hamburger{
  display:none;
  width:44px;height:44px;border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.78);
  box-shadow:var(--shadow2);
  align-items:center;justify-content:center;
  cursor:pointer;
}
.hamburger:focus{ outline:3px solid rgba(25,25,112,.25); outline-offset:2px; }

.hamburger .bar{
  width:18px;height:2px;background:rgba(15,23,42,.86);
  border-radius:2px; position:relative; display:block;
}
.hamburger .bar::before,
.hamburger .bar::after{
  content:""; position:absolute; left:0; width:18px; height:2px;
  background:rgba(15,23,42,.86); border-radius:2px;
}
.hamburger .bar::before{ top:-6px; }
.hamburger .bar::after{ top:6px; }

.drawerOverlay{
  position:fixed; inset:0; background:rgba(2,8,23,.40);
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  z-index:90;
}
.drawer{
  position:fixed; top:0; right:0; height:100vh; width:min(92vw, 380px);
  background:rgba(255,255,255,.92);
  border-left:1px solid rgba(15,23,42,.12);
  box-shadow:-20px 0 60px rgba(2,8,23,.14);
  transform:translateX(105%); transition:transform .22s ease;
  z-index:91;
  display:flex; flex-direction:column;
  backdrop-filter:blur(10px);
}
.drawerHeader{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 16px; border-bottom:1px solid rgba(15,23,42,.10);
}
.drawerHeader b{ font-size:14px; letter-spacing:.02em; }
.drawerClose{
  width:42px;height:42px;border-radius:14px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(15,23,42,.04);
  cursor:pointer;
}
.drawerClose:focus{ outline:3px solid rgba(25,25,112,.25); outline-offset:2px; }
.drawerNav{ padding:10px 10px 18px; display:flex; flex-direction:column; gap:6px; }
.drawerNav a{
  padding:12px 12px; border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.82);
  font-weight:900; color:rgba(15,23,42,.84);
}
.drawerNav a.active{
  background:rgba(128,0,0,.08);
  border-color:rgba(128,0,0,.18);
  color:rgba(15,23,42,.92);
}
.drawerCta{ padding:0 10px 18px; display:grid; gap:10px; }
body.navOpen{ overflow:hidden; }
body.navOpen .drawerOverlay{ opacity:1; pointer-events:auto; }
body.navOpen .drawer{ transform:translateX(0); }


@media (max-width: 980px){
  nav{ display:none; }
  .hamburger{ display:flex; }
  .cta{ display:none !important; }
  .grid2{ grid-template-columns:1fr; }
  .grid3{ grid-template-columns:1fr; }
  .imgCard{ min-height:240px; }
  .footGrid{ grid-template-columns:1fr; }
}
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}


/* --- v16: SUPER ENLARGE LOGO (force override) --- */
header.top{ padding:6px 0 !important; }
.brand{ gap:16px !important; }

/* Kill any chip/box; logo should be huge */
.mark{
  width:140px !important;
  height:140px !important;
  padding:0 !important;
  border:none !important;
  box-shadow:none !important;
  background:transparent !important;
  border-radius:0 !important;
  display:grid !important;
  place-items:center !important;
}

/* Force the image to fill the mark */
header.top .mark img,
header.top .brand .mark img,
.mark > img{
  width:140px !important;
  height:140px !important;
  max-width:none !important;
  max-height:none !important;
  display:block !important;
}

@media (max-width: 980px){
  .mark{ width:118px !important; height:118px !important; }
  header.top .mark img, header.top .brand .mark img, .mark > img{ width:118px !important; height:118px !important; }
}
@media (max-width: 420px){
  .mark{ width:98px !important; height:98px !important; }
  header.top .mark img, header.top .brand .mark img, .mark > img{ width:98px !important; height:98px !important; }
}

/* If nav gets cramped, allow wrap */
.topbar{ flex-wrap:wrap !important; }
.topbar nav{ flex:1 1 520px !important; min-width:260px !important; }
@media (max-width: 1100px){
  .topbar nav{ order:3 !important; width:100% !important; margin-top:10px !important; }
  .topbar .cta{ order:2 !important; margin-left:auto !important; }
}


/* --- v17: use tight logo image (no built-in white margin) --- */
.mark{ background:transparent !important; border:none !important; box-shadow:none !important; padding:0 !important; }
.mark img{ object-fit:contain !important; }


/* --- v18: restore normal logo size (keep tight logo, no margin) --- */
header.top{ padding:10px 0 !important; }
.brand{ gap:12px !important; }

.mark{
  width:84px !important;
  height:84px !important;
  border-radius:0 !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  padding:0 !important;
  display:grid !important;
  place-items:center !important;
}
header.top .mark img,
header.top .brand .mark img,
.mark > img{
  width:84px !important;
  height:84px !important;
  max-width:none !important;
  max-height:none !important;
  display:block !important;
  object-fit:contain !important;
}

@media (max-width: 980px){
  .mark{ width:72px !important; height:72px !important; }
  header.top .mark img, header.top .brand .mark img, .mark > img{ width:72px !important; height:72px !important; }
}
@media (max-width: 420px){
  .mark{ width:64px !important; height:64px !important; }
  header.top .mark img, header.top .brand .mark img, .mark > img{ width:64px !important; height:64px !important; }
}


/* --- v19: prevent lab name wrapping in header --- */
.topbar{ align-items:center !important; }
.brand{ flex:1 1 auto !important; min-width:0 !important; }
.brandText{ flex:1 1 auto !important; min-width:0 !important; }

/* Force single-line lab name */
.brandText h1,
.brandText .labname,
.brandText .title{
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* Give text more room by slightly shrinking logo */
.mark{ width:76px !important; height:76px !important; }
header.top .mark img,
header.top .brand .mark img,
.mark > img{ width:76px !important; height:76px !important; }

/* Make the name fit better on mid-width screens */
@media (max-width: 1200px){
  .brandText h1, .brandText .labname, .brandText .title{ font-size:20px !important; }
}
@media (max-width: 980px){
  .mark{ width:68px !important; height:68px !important; }
  header.top .mark img, header.top .brand .mark img, .mark > img{ width:68px !important; height:68px !important; }
  .brandText h1, .brandText .labname, .brandText .title{ font-size:18px !important; }
}
@media (max-width: 420px){
  .mark{ width:60px !important; height:60px !important; }
  header.top .mark img, header.top .brand .mark img, .mark > img{ width:60px !important; height:60px !important; }
  .brandText h1, .brandText .labname, .brandText .title{ font-size:16px !important; }
}


/* --- v24: square-ish recruit image frame --- */
.imgCard picture, .imgCard img{
  width:100%;
  height:100%;
  object-fit:cover;
}
/* If the card height isn't square, enforce ratio (modern browsers) */
.imgCard{ aspect-ratio: 1 / 1; }


/* --- v27: force-hide any hero image caption/strapline on recruit collage --- */
.imgCard .caption,
.imgCard .tagline,
.imgCard .strap,
.imgCard .heroCaption,
.imgCard figcaption{ display:none !important; }
.imgCard::before,
.imgCard::after{ content:none !important; }


/* --- v30: footer left empty box removed -> make remaining footer panel full width --- */
.footerGrid{ grid-template-columns: 1fr !important; }

/* --- v34: hamburger bars + no stray glyph --- */
.hamburger{ font-size:0; line-height:0; overflow:hidden; }

/* --- v35: prevent overflow + kill stray left glyph --- */
html, body{ overflow-x:hidden; }


/* --- v37: contact page fit + maps --- */
.card{ overflow:hidden; }
.metaList, .metaList div{ word-break: break-word; overflow-wrap:anywhere; }
.actions{ flex-wrap:wrap; gap:10px; }
.actions .btn{ white-space:nowrap; }

.mapEmbed{ margin-top:14px; border-radius:18px; overflow:hidden; border:1px solid rgba(0,0,0,.08); background:#fff; }
.mapEmbed iframe{ width:100%; height:320px; border:0; display:block; }

.mapGrid{ margin-top:14px; display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
@media (max-width: 900px){ .mapGrid{ grid-template-columns: 1fr; } .mapEmbed iframe{ height:280px; } }

.mapFigure{ margin:0; border-radius:18px; overflow:hidden; border:1px solid rgba(0,0,0,.08); background:#fff; }
.mapFigure img{ width:100%; height:auto; display:block; }
.mapFigure figcaption{ padding:10px 12px; font-size:13px; color: var(--muted); }


/* --- v38: contact typography fit + button wrapping --- */
.metaList{ line-height:1.65; }
.metaList div{ padding-right:10px; }
.metaList b{ display:inline-block; }
.note{ color: var(--muted); font-size: 0.95em; }

/* Buttons: allow wrapping for JP text on narrow widths */
.actions .btn{ white-space: normal; text-align:center; line-height:1.2; padding:10px 14px; }

/* Slightly more inner breathing room in cards on narrow screens */
@media (max-width: 900px){
  .card{ padding:18px 18px; }
}


/* --- v39: slight inner inset for top cards (match screenshot) --- */
.card.inset{ padding-left:26px; }
@media (max-width: 900px){
  .card.inset{ padding-left:20px; }
}


/* --- v40: more breathing room (top/left) inside cards --- */
.card.inset{ padding-top:26px !important; padding-left:28px !important; }
@media (max-width: 900px){
  .card.inset{ padding-top:22px !important; padding-left:22px !important; }
}


/* --- v41: keep maps away from right edge (match left padding) --- */
.card.inset .mapEmbed,
.card.inset .mapGrid{
  padding-right: 22px;
  box-sizing: border-box;
}
@media (max-width: 900px){
  .card.inset .mapEmbed,
  .card.inset .mapGrid{
    padding-right: 18px;
  }
}

/* Ensure figures/iframe never overflow container */
.mapEmbed iframe{ max-width:100%; }
.mapFigure{ max-width:100%; }


/* --- v42: members page photo + tables + past member cards --- */
.photoFrame{
  border-radius:22px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
}
.card.pad .photoFrame{ margin-top:10px; }
.photoFrame img{ width:100%; height:360px; object-fit:cover; object-position:center; display:block; }
@media (max-width: 900px){ .photoFrame img{ height:260px; } }

.tableWrap{ overflow:auto; border-radius:18px; border:1px solid rgba(0,0,0,.08); background:#fff; }
.memberTable{ width:100%; border-collapse:separate; border-spacing:0; min-width:680px; }
.memberTable th, .memberTable td{ padding:12px 14px; border-bottom:1px solid rgba(0,0,0,.06); vertical-align:top; }
.memberTable th{ text-align:left; font-weight:700; color: var(--text); background: rgba(128,0,0,.04); position:sticky; top:0; }
.memberTable tbody tr:hover td{ background: rgba(0,0,0,.015); }

/* ===== Members (v43): slim directory + past accordion ===== */
.membersSlim{ display:flex; flex-direction:column; gap:16px; }
.memberGroup{ padding-top:6px; }
.memberGroup .h4{ margin:0 0 8px; font-size:15px; letter-spacing:.02em; color:var(--text); }
.memberRows{ display:flex; flex-direction:column; border:1px solid rgba(0,0,0,.06); border-radius:14px; overflow:hidden; background:rgba(255,255,255,.65); }
.memberRow{ display:grid; grid-template-columns: 112px minmax(0,160px) minmax(0,1fr); gap:12px; padding:12px 14px; align-items:start; border-top:1px solid rgba(0,0,0,.06); }
.memberRow:first-child{ border-top:none; }
.memberRow .badge{ display:inline-flex; align-items:center; justify-content:center; height:26px; padding:0 10px; border-radius:999px; font-size:12px; font-weight:700; background:rgba(128,0,0,.08); color:#5e0000; border:1px solid rgba(128,0,0,.14); white-space:nowrap; }
.memberRow .name{ font-weight:800; letter-spacing:.02em; min-width:0; }
.memberRow .aff{ color:rgba(0,0,0,.72); line-height:1.45; min-width:0; overflow-wrap:anywhere; word-break:break-word; }

.pastMembers{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.accordion{ border:1px solid rgba(0,0,0,.08); border-radius:14px; background:rgba(255,255,255,.65); overflow:hidden; }
.accordion > summary{ list-style:none; cursor:pointer; padding:12px 14px; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.accordion > summary::-webkit-details-marker{ display:none; }
.accordion > summary::after{ content:""; width:10px; height:10px; border-right:2px solid rgba(0,0,0,.35); border-bottom:2px solid rgba(0,0,0,.35); transform:rotate(45deg); transition:transform .2s ease; margin-left:auto; }
.accordion[open] > summary::after{ transform:rotate(225deg); }
.accYear{ font-weight:900; letter-spacing:.02em; min-width:0; }
.accCount{ font-size:12px; color:rgba(0,0,0,.55); }
.pastRows{ border-top:1px solid rgba(0,0,0,.06); }
.pastRow{ display:grid; grid-template-columns: minmax(0,1.2fr) minmax(120px,160px) minmax(0,1fr); gap:12px; padding:12px 14px; border-top:1px solid rgba(0,0,0,.06); }
.pastRow:first-child{ border-top:none; }
.pastRole{ color:rgba(0,0,0,.62); line-height:1.45; overflow-wrap:anywhere; word-break:break-word; }
.pastName{ font-weight:800; }
.pastAff{ color:rgba(0,0,0,.72); line-height:1.45; overflow-wrap:anywhere; word-break:break-word; }

@media (max-width: 860px){
  .memberRow{ grid-template-columns: 110px 1fr; }
  .memberRow .aff{ grid-column: 1 / -1; }
  .memberRow .badge{ max-width:100%; overflow:hidden; text-overflow:ellipsis; }
  .pastRow{ grid-template-columns: 1fr; }
  .pastName{ margin-top:2px; }
}

/* Defensive: never show hidden sources (prevents past member cards + accordion coexistence) */
[hidden]{ display:none !important; }
.pastSource{ display:none !important; }

@media (max-width: 420px){
  .memberRow{ padding:10px 12px; }
  .memberRow .badge{ font-size:11px; padding:0 8px; }
}

.peopleGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 1100px){ .peopleGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px){ .peopleGrid{ grid-template-columns: 1fr; } }

.personCard{
  border-radius:18px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  padding:14px 14px;
}
.personRole{ font-size:12px; color: var(--muted); }
.personName{ font-size:16px; font-weight:800; margin-top:6px; }
.personAff{ font-size:13px; color: var(--muted); margin-top:6px; line-height:1.45; word-break:break-word; overflow-wrap:anywhere; }


/* --- Photo Gallery (photos.html) --- */
.photoActions{ margin-top:14px; display:flex; justify-content:flex-start; }
.photoActions .btn{ padding:10px 14px; border-radius:14px; font-weight:800; }

.galleryAccordion{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.galYear{ border:1px solid rgba(15,23,42,.10); border-radius:16px; background:rgba(255,255,255,.65); overflow:hidden; }
.galYear summary{ list-style:none; cursor:pointer; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.galYear summary::-webkit-details-marker{ display:none; }
.galYearLabel{ font-weight:950; letter-spacing:.02em; }
.galYearCount{ font-size:12px; font-weight:850; color:rgba(15,23,42,.62); }
.galYearBody{ padding:0 16px 16px; }
.galEvent{ padding:14px 0; border-top:1px solid rgba(15,23,42,.08); }
.galEvent:first-child{ border-top:none; }
.galEventTitle{ margin:0 0 10px; font-size:14px; line-height:1.5; color:rgba(15,23,42,.88); font-weight:850; }
.galGrid{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; }
.galItem{ display:block; border-radius:14px; overflow:hidden; border:1px solid rgba(15,23,42,.10); background:rgba(255,255,255,.85); }
.galItem img{ width:100%; height:170px; object-fit:cover; display:block; }
@media (max-width: 980px){
  .galGrid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .galItem img{ height:160px; }
}
@media (max-width: 520px){
  .galGrid{ grid-template-columns:repeat(1, minmax(0,1fr)); }
  .galItem img{ height:auto; }
}


/* --- v44: greeting page polish --- */
/* Keep the professor photo from being upscaled too much (small source image).
   Fix the photo column width and let the image keep its natural height. */
body[data-page="greeting"] .greetingGrid{
  align-items:start;
  grid-template-columns: minmax(240px, 360px) 1fr;
}
body[data-page="greeting"] .greetingPhotoCard{
  min-height:unset;
  aspect-ratio:auto;
  max-width:360px;
  margin-inline:auto;
  background:rgba(255,255,255,.86);
}
body[data-page="greeting"] .greetingPhotoCard picture{ display:block; width:100%; }
body[data-page="greeting"] .greetingPhotoCard img{
  height:auto !important;
  object-fit:contain !important;
  object-position:center 20%;
}
@media (max-width: 900px){
  body[data-page="greeting"] .greetingGrid{ grid-template-columns:1fr; }
  body[data-page="greeting"] .greetingPhotoCard{ max-width:520px; }
  /* On mobile, allow a slightly wider crop without forcing upscaling */
  body[data-page="greeting"] .greetingPhotoCard img{ object-position: center 30%; }
}

/* --- recruit page hero layout tweaks --- */
body[data-page="recruit"] .hero .grid2{
  grid-template-columns: minmax(240px, 420px) 1fr;
  align-items: start;
}
body[data-page="recruit"] .recruitHeroPhoto{
  max-width: 420px;
  justify-self: start;
}
@media (max-width: 900px){
  body[data-page="recruit"] .hero .grid2{ grid-template-columns: 1fr; }
  body[data-page="recruit"] .recruitHeroPhoto{ max-width: none; }
}

/* =====================
   Research page tweaks
   - Figure label readability
   - No-crop figure fit (contain)
   ===================== */
body[data-page="research"] .imgLabel{
  background: rgba(0,0,0,.5);
  padding: 10px 12px;
  border-radius: 14px;
}
body[data-page="research"] .imgLabel .chip{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
  color: rgba(255,255,255,.92);
}

/* Only figure cards should avoid cropping
   - add inner padding so figures don't touch the frame
   - size the frame to the figure (without stretching)
*/
body[data-page="research"] .imgCard.figCard{
  min-height: auto;
  padding: 14px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
body[data-page="research"] .imgCard.figCard img{
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
body[data-page="research"] .imgCard.figCard::after{ background: none; }

/* keep label comfortably inset within the padded frame */
body[data-page="research"] .imgCard.figCard .imgLabel{
  left: 14px;
  right: 14px;
  bottom: 14px;
}

/* --- Performance: slideshow in hero --- */
body[data-page="performance"] .perfSlideshow{
  position: relative;
  overflow: hidden;
}
body[data-page="performance"] .perfSlideshow .perfSlides{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
body[data-page="performance"] .perfSlideshow .perfSlide{
  position:absolute;
  max-width:90%;
  max-height:90%;
  width:auto;
  height:auto;
  object-fit:contain;
  opacity:0;
  transform: scale(0.995);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
body[data-page="performance"] .perfSlideshow .perfSlide.is-active{
  opacity:1;
  transform: scale(1);
}

/* =========================================================
   performance_list.html (業績一覧)
   Year / count spacing (e.g., "2025 2報")
   ========================================================= */
body[data-page="performance-list"] details summary .muted{
  display: inline-block;
  margin-left: 1ch; /* one character-ish spacing */
}


/* --- Optout table --- */
.tbl{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;border:1px solid rgba(15,23,42,.12);border-radius:14px;}
.tbl th,.tbl td{padding:12px 14px;border-bottom:1px solid rgba(15,23,42,.08);vertical-align:top;font-size:14px;line-height:1.6;}
.tbl thead th{background:rgba(15,23,42,.03);font-weight:700;}
.tbl tbody tr:last-child td{border-bottom:none;}

/* =========================================================
   Home: NEWS (WordPress posts)
   - Scrollable list so all items can be viewed
   ========================================================= */
body[data-page="home"] .newsScroll{
  max-height: 320px; /* scroll to view all */
  overflow: auto;
  padding-right: 6px;
}
body[data-page="home"] .newsScroll::-webkit-scrollbar{width:10px;}
body[data-page="home"] .newsScroll::-webkit-scrollbar-thumb{background:rgba(15,23,42,.18);border-radius:999px;border:3px solid transparent;background-clip:content-box;}

/* --- TOP: NEWSをスマホでは「5件分の高さ」にして枠内スクロール --- */
@media (max-width: 640px){
  .newsScroll{
    max-height: 18.5rem; /* だいたい5件分の高さ */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== Performance list: spacing + DOI color ===== */

/* 文献同士を「1行」あける */
body[data-page="performance-list"] .pubItem{
  margin: 1em 0;
}

/* DOIリンク色を #8b0000 に統一（下線つき） */
body[data-page="performance-list"] a[href^="https://doi.org/"],
body[data-page="performance-list"] a[href^="http://doi.org/"],
body[data-page="performance-list"] a[href*="doi.org/"],
body[data-page="performance-list"] .pubLinks a{
  color: #8b0000 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

/* （おまけ）研究業績ページ側も同じ色に揃える */
body[data-page="performance"] a[href^="https://doi.org/"],
body[data-page="performance"] a[href^="http://doi.org/"],
body[data-page="performance"] a[href*="doi.org/"],
body[data-page="performance"] .pubLinks a{
  color: #8b0000 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}