/* ポケGOこよみ — warm "almanac paper" look. Category colours come in per element as --c. */
:root {
  --bg: #f6f2ea;
  --card: #fffdf8;
  --card2: #fbf7ef;
  --ink: #1d2833;
  --muted: #6a7480;
  --line: #e7dfd0;
  --accent: #11806f;
  --accent-ink: #0c5f53;
  --sat: #2e6db4;
  --sun: #c93a3a;
  --today: #f2b632;
  --shadow: 0 1px 0 rgba(60, 40, 10, .05), 0 6px 18px -12px rgba(60, 40, 10, .25);
  --round: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181d;
    --card: #1c2028;
    --card2: #20252e;
    --ink: #e8ebee;
    --muted: #a2abb6;
    --line: #2f3540;
    --accent: #3cc2ab;
    --accent-ink: #7fdcca;
    --sat: #7fb2ee;
    --sun: #f08a8a;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 system-ui, -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', 'Meiryo', sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent-ink); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--round); line-height: 1.3; margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* header */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.head-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 14px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo { width: 34px; height: 34px; color: var(--ink); }
.bn { font-family: var(--round); font-weight: 900; font-size: 23px; letter-spacing: .02em; }
.tagline { margin: 0; color: var(--muted); font-size: 13px; }
.mnav-top { margin-left: auto; display: flex; gap: 6px; }
.mnav-top a { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); }
.mnav-top a[aria-current] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.stripe { display: flex; height: 5px; }
.stripe i { flex: 1; background: var(--c); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 20px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.m-lead { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.empty-note { color: var(--muted); font-size: 14px; }

/* week */
.wk-tabs { display: inline-flex; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.wk-tabs button { border: 0; background: none; font: inherit; font-weight: 700; font-size: 13px; padding: 4px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.wk-tabs button.on { background: var(--ink); color: var(--card); }
.wk-range { margin: 0 0 10px; font-family: var(--round); font-weight: 700; font-size: 15px; color: var(--accent-ink); }
.hi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.hi { position: relative; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--c) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); border-radius: 14px; padding: 10px 12px 10px 14px; overflow: hidden; }
.hi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.hi-when { font-size: 12px; font-weight: 700; color: var(--muted); }
.hi-title { font-family: var(--round); font-size: 16px; line-height: 1.35; }
.hi-mons { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px 0 2px; }
.hi-mons .mon { height: 42px; width: auto; }
.hi-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.wk-days { display: grid; gap: 6px; }
.wk-day { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 8px 8px; }
.wk-day.today { border-color: var(--today); box-shadow: inset 0 0 0 1px var(--today); }
.wk-date { text-align: center; line-height: 1.1; padding-top: 2px; }
.wk-date b { display: block; font-family: var(--round); font-size: 26px; }
.wk-date span { font-size: 12px; color: var(--muted); font-weight: 700; }
.wk-date small { display: block; font-size: 10px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.wk-date.sat b, .wk-date.sat span { color: var(--sat); }
.wk-date.sun b, .wk-date.sun span { color: var(--sun); }
.wk-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.wk-lines li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 14px; line-height: 1.45; padding-left: 9px; border-left: 3px solid var(--c); min-height: 28px; }
.wk-lines li.q { opacity: .72; font-size: 13px; }
.wk-lines li.star .wk-x { font-weight: 700; }
.wk-lines li.star .wk-x::after { content: ' ★'; color: #e0a100; }
.wk-lines li.x .wk-x { color: var(--muted); }
.wk-lines li.none { border-left-color: transparent; color: var(--muted); font-size: 13px; }
.wk-t { font-weight: 700; color: var(--accent-ink); min-width: 92px; font-variant-numeric: tabular-nums; }
.wk-x { flex: 1 1 220px; }
.wk-i { display: flex; gap: 1px; }
.mon.sm { height: 26px; width: auto; }

/* month head + chips */
.month-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.m-title { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: center; gap: 2px 6px; text-align: center; }
.m-title small { font-size: 15px; color: var(--muted); }
.m-title b { font-size: 34px; font-weight: 900; }
.m-title span { font-size: 15px; color: var(--muted); }
.mnav { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); text-decoration: none; color: var(--ink); font-size: 22px; line-height: 1; }
.mnav.off { opacity: .3; }
.month .m-lead { text-align: center; }
.m-note { margin: -4px auto 12px; max-width: 760px; font-size: 12.5px; color: var(--muted); background: var(--card2); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 12px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip .n { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--card); border-radius: 999px; padding: 0 6px; }
.chip.on { background: color-mix(in srgb, var(--c, var(--ink)) 16%, var(--card)); border-color: var(--c, var(--ink)); }
.chip-all.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip-all.on .n { background: rgba(255, 255, 255, .2); color: inherit; }

/* calendar */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
.cal { container: cal / inline-size; min-width: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wh { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.wh.sat { color: var(--sat); }
.wh.sun { color: var(--sun); }
.cell { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 104px; min-width: 0; padding: 5px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); color: var(--ink); font: inherit; cursor: pointer; overflow: hidden; }
.cell.blank { background: transparent; border-style: dashed; opacity: .4; cursor: default; }
.cell:hover:not(.blank) { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.cell.empty { background: var(--card); }
.cell.sel { outline: 2.5px solid var(--ink); outline-offset: -1px; background: var(--card); }
.num { font-family: var(--round); font-weight: 700; font-size: 15px; line-height: 1.2; display: flex; align-items: baseline; gap: 4px; }
.cell.sat .num { color: var(--sat); }
.cell.sun .num { color: var(--sun); }
.cell.today .num::before { content: '今日'; font-family: system-ui, sans-serif; font-size: 9.5px; font-weight: 800; color: #3b2a00; background: var(--today); border-radius: 4px; padding: 0 4px; order: 2; }
.hol { font-size: 9.5px; font-weight: 700; font-family: system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pills { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pill { display: flex; align-items: center; gap: 3px; min-width: 0; font-size: 11px; line-height: 1.3; padding: 1px 4px 1px 2px; border-radius: 6px; background: color-mix(in srgb, var(--c) 13%, var(--card)); border-left: 3px solid var(--c); }
.pill .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.x .t { text-decoration: line-through; color: var(--muted); }
.mon.pi { height: 20px; width: auto; flex: none; }
.pdot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin: 0 3px; }
.more { font-size: 10.5px; font-weight: 700; color: var(--muted); padding-left: 3px; }
.dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; padding-top: 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.k-dot i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 2px; }
.k-dot i + i { background: #a23cc0; margin-right: 5px; }

/* day panel + event cards */
.day-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.day-title { font-size: 19px; }
.day-n { font-size: 12px; color: var(--muted); font-weight: 700; }
.ev-list { display: grid; gap: 8px; }
.ev { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 12px; padding: 10px 12px; }
.ev.is-cancelled { border-left-style: dashed; opacity: .8; }
.ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 1px 8px 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 14%, var(--card)); white-space: nowrap; }
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.tag-start, .tag-day { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tag-end { color: var(--sun); border-color: color-mix(in srgb, var(--sun) 40%, var(--line)); }
.ev-title { font-size: 16px; margin: 6px 0 2px; }
.ev-when { margin: 0; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tz { font-size: 10.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.ev-mons { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.ev-mons .mon { height: 52px; width: auto; }
.ev-names { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ev-notes { margin: 6px 0 0; padding-left: 1.1em; font-size: 13.5px; }
.ev-notes li { margin: 1px 0; }
.ev-src { margin: 6px 0 0; font-size: 12.5px; }
.ev-src .sep { color: var(--muted); margin: 0 4px; }
.chk { color: var(--muted); margin-left: 4px; }
.ev-tnote { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
details.quiet { margin-top: 10px; }
details.quiet > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
details.quiet .ev-list { margin-top: 6px; }

/* month list */
.lgroup { margin: 0 0 12px; }
.lg-h { font-size: 14px; color: var(--muted); margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
details.row { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; background: var(--card2); margin: 0 0 6px; }
details.row > summary { list-style: none; display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 7px 10px; cursor: pointer; }
details.row > summary::-webkit-details-marker { display: none; }
details.row[open] > summary { border-bottom: 1px solid var(--line); }
details.row > .ev { border: 0; border-radius: 0 0 10px 10px; }
.r-when { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.r-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.r-title { font-weight: 700; font-size: 14px; }
.r-mons { display: flex; gap: 1px; }
details.row.is-cancelled .r-title { color: var(--muted); }

/* shop + about + footer */
.shop-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.shop-item { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.shop-item b { font-family: var(--round); font-size: 16px; }
.shop-item span { font-size: 13px; color: var(--muted); }
.shop-item em { font-style: normal; font-weight: 700; font-size: 13px; color: var(--accent-ink); margin-top: 2px; }
.shop-note { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
.about-dl { margin: 10px 0 0; display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.about-dl dt { font-weight: 700; }
.about-dl dd { margin: 0; color: var(--ink); }
.site-foot { border-top: 1px solid var(--line); padding: 18px 0 32px; color: var(--muted); font-size: 12.5px; }
.site-foot p { margin: 4px 0; }
.f-brand { font-family: var(--round); font-weight: 900; font-size: 16px; color: var(--ink); }
.rights { font-size: 12px; }

/* the calendar goes compact (icons only) by its own width, not the window's */
@container cal (max-width: 699px) {
  .cal-grid { gap: 3px; }
  .cell { min-height: 64px; padding: 3px 2px; border-radius: 8px; gap: 1px; }
  .num { font-size: 13px; justify-content: center; }
  .hol { display: none; }
  .cell.today .num::before { content: ''; width: 6px; height: 6px; padding: 0; border-radius: 50%; order: 0; align-self: center; }
  .pills { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0 1px; }
  .pill { background: none; border: 0; padding: 0; }
  .pill .t { display: none; }
  .mon.pi { height: 22px; }
  .more { display: none; }
  .dots { justify-content: center; gap: 2px; }
  .dots i { width: 5px; height: 5px; }
}
@container cal (max-width: 420px) {
  .pill:nth-child(n+3) { display: none; }
  .mon.pi { height: 20px; }
  .wh { font-size: 11px; }
}

/* narrower windows: the day panel goes under the calendar */
@media (max-width: 1179px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .day-panel { position: static; max-height: none; scroll-margin-top: 10px; }
}
@media (max-width: 719px) {
  body { font-size: 14.5px; }
  .card { padding: 14px 12px; border-radius: 14px; margin: 12px 0; }
  .wrap { padding: 0 10px; }
  .bn { font-size: 20px; }
  .tagline { width: 100%; order: 3; font-size: 12px; }
  .mnav-top { margin-left: auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .day-panel { padding: 10px 8px; }
  .m-title b { font-size: 28px; }
  .hi-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px 12px; padding: 0 12px 4px; scrollbar-width: none; }
  .hi-row::-webkit-scrollbar { display: none; }
  .hi { flex: 0 0 82%; scroll-snap-align: start; }
  .hi-mons .mon { height: 36px; }
  .wk-day { grid-template-columns: 44px 1fr; gap: 6px; padding: 7px 8px 7px 4px; }
  .wk-date b { font-size: 22px; }
  .wk-date small { font-size: 9px; }
  .wk-lines li { gap: 0 8px; }
  .wk-t { min-width: 0; width: 100%; font-size: 12.5px; }
  .wk-x { flex: 1 1 120px; }
  details.row > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .r-when { grid-column: 1 / -1; }
  .r-main { flex-wrap: wrap; gap: 4px 6px; }
  .about-dl { grid-template-columns: 1fr; gap: 2px; }
  .about-dl dd { margin-bottom: 8px; }
}
