:root {
  --sky: #38b6e3; --sky-deep: #1d8fc4; --pink: #f27bb0;
  --ink: #1d2b36; --bg: #f4fafd; --card: #fff; --line: #d8ecf5;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
.topbar { position: sticky; top: 0; z-index: 20; background: linear-gradient(120deg, #fff 60%, #e8f6fd); border-bottom: 2px solid var(--line); padding: 14px 20px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 34px; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.sub { font-size: 11px; color: #6b8a99; margin-top: 2px; }
.cats { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; }
.cats button { border: none; background: transparent; padding: 8px 16px; font-size: 13px; font-weight: 600; color: #5b7c8c; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.cats button.on { color: var(--sky-deep); border-bottom-color: var(--sky); }

/* member grid */
.period-sec { padding: 16px 20px 4px; }
.period-sec h3 { font-size: 12px; font-weight: 600; color: #7b98a6; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.period-sec h3::before { content: ""; width: 12px; height: 3px; border-radius: 2px; background: var(--pc, var(--sky)); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; text-align: left; transition: transform .15s, box-shadow .15s; padding: 0; }
.mcard:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(29,143,196,.16); }
.mcard .bar { height: 3px; background: var(--pc, var(--sky)); }
.mcard .in { padding: 8px 10px; }
.mcard .mid { font-size: 10px; font-family: ui-monospace, monospace; color: #9db4bf; display: flex; align-items: center; gap: 4px; }
.mcard .mn { font-size: 13px; font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .mr { font-size: 10px; color: #9db4bf; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .mc { font-size: 10px; font-family: ui-monospace, monospace; color: #9db4bf; margin-top: 4px; }
.mcard.grad { opacity: .55; }
.newbadge { background: var(--pink); color: #fff; font-size: 9px; font-weight: 700; border-radius: 4px; padding: 1px 5px; }
.focusmark { color: var(--pink); font-size: 10px; }

/* member detail */
.mdetail-head { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px 12px; }
.backbtn { border: none; background: none; color: #7b98a6; font-size: 12px; cursor: pointer; padding: 4px 0; }
.backbtn:hover { color: var(--ink); }
.mdetail-head h2 { font-size: 20px; font-weight: 700; margin-top: 4px; }
.mdetail-head .mrow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mdetail-head .mroma { font-size: 11px; color: #8aa5b3; letter-spacing: .12em; }
.mdetail-head .mcount { margin-left: auto; font-size: 22px; font-weight: 700; font-family: ui-monospace, monospace; color: var(--sky-deep); }
.mdetail-head .mcount small { font-size: 11px; font-weight: 400; color: #8aa5b3; }
.dlbtn { border: 1.5px solid var(--sky); background: var(--sky); color: #fff; border-radius: 8px; padding: 7px 16px; font-size: 12px; font-weight: 700; cursor: pointer; }
.dlbtn:disabled { opacity: .5; cursor: wait; }

/* toolbar / grid */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; flex-wrap: wrap; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs button { border: 1.5px solid var(--line); background: #fff; color: #4a6b7a; border-radius: 999px; padding: 5px 14px; font-size: 12px; cursor: pointer; font-weight: 600; }
.subtabs button.on { background: var(--sky); border-color: var(--sky); color: #fff; }
.seg { display: flex; background: #e4f2f9; border-radius: 8px; padding: 3px; }
.seg button { border: none; background: transparent; padding: 5px 14px; font-size: 12px; border-radius: 6px; cursor: pointer; color: #5b7c8c; font-weight: 600; }
.seg button.on { background: #fff; color: var(--sky-deep); box-shadow: 0 1px 3px rgba(0,60,90,.12); }
.search { flex: 1; max-width: 240px; min-width: 140px; border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13px; background: #fff; }
.count { font-size: 12px; color: #7b98a6; margin-left: auto; }
.grid { display: grid; padding: 0 20px 40px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(29,143,196,.18); }
.card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #e8f2f8; }
.card .meta { padding: 8px 10px; font-size: 11px; }
.card .meta .t { font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta .d { color: #7b98a6; margin-top: 2px; }
.card .newbadge { position: absolute; top: 8px; left: 8px; }
.voice-card { display: flex; flex-direction: column; padding: 10px; }
.voice-card .vt { font-size: 12px; font-weight: 700; min-height: 32px; }
.voice-card audio { width: 100%; margin-top: 8px; height: 32px; }
.pager { display: flex; justify-content: center; gap: 8px; padding-bottom: 40px; }
.pager button { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.pager button.on { background: var(--sky); color: #fff; border-color: var(--sky); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10,25,35,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 10px; }
.lb-cap { color: #cfe8f4; margin-top: 12px; font-size: 14px; }
.lb-close { position: absolute; top: 18px; right: 22px; border: none; background: none; color: #fff; font-size: 26px; cursor: pointer; }
.empty { text-align: center; padding: 80px 0; color: #8aa5b3; font-size: 14px; }
.dlprog { font-size: 11px; color: var(--sky-deep); }
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 0 12px 30px; }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
}
