:root {
  --pink: #e4007f; --ink: #1f2340; --mute: #6d7088; --line: #ecdfe7; --blush: #fff3f8; --paper: #ffffff; --night: #2d3a78; --gray: #9a9cac;
  --tabs: calc(56px + env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif; font-weight: 500; line-height: 1.55; -webkit-text-size-adjust: 100%; }
body { padding-bottom: var(--tabs); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
#view { max-width: 480px; margin: 0 auto; padding: 20px 18px 28px; }
.state { text-align: center; color: var(--mute); padding: 64px 12px; }
.state button { display: inline-block; margin-top: 14px; }
.primary { background: var(--pink); color: #fff; border-radius: 999px; padding: 11px 26px; font-weight: 700; }

/* 生写真: 白フチの公式写真がこの画面の主役。顔に何も重ねない */
.nama-wrap { background: var(--blush); margin: -20px -18px 18px; padding: 26px 0 22px; text-align: center; }
.nama { display: inline-block; background: #fff; padding: 9px 9px 0; box-shadow: 0 8px 22px rgba(31, 35, 64, .16); transform: rotate(-1.6deg); }
.nama img { display: block; width: min(58vw, 240px); height: min(58vw, 240px); object-fit: cover; }
.nama-name { padding: 8px 0 9px; font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.prof { text-align: center; color: var(--mute); font-size: 13px; margin: 0 0 14px; }
.sns { display: flex; gap: 8px; margin-bottom: 26px; }
.sns a { flex: 1; text-align: center; text-decoration: none; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 0; font-size: 13px; font-weight: 700; }
h2.sec { font-size: 16px; margin: 0 0 4px; font-weight: 700; }
.list { list-style: none; margin: 0 0 24px; padding: 0; }
.list li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list .when { color: var(--mute); font-size: 13px; }
.list .time { display: inline-block; margin-right: 6px; font-weight: 700; }
.list .empty { display: block; color: var(--mute); }
.change { display: block; margin: 0 auto; color: var(--pink); font-weight: 700; padding: 8px 12px; }

/* カレンダー */
.month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month strong { font-size: 18px; }
.month button { width: 40px; height: 40px; font-size: 20px; color: var(--pink); }
.seg { display: flex; border: 1.5px solid var(--pink); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.seg button { flex: 1; padding: 7px 0; font-size: 13px; font-weight: 700; color: var(--pink); }
.seg button[aria-pressed="true"] { background: var(--pink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 18px; }
.dow { text-align: center; font-size: 11px; color: var(--mute); padding-bottom: 4px; }
.dow.sun, .day.sun .n { color: var(--pink); } .dow.sat, .day.sat .n { color: var(--night); }
.day { min-height: 50px; padding: 5px 0 3px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.day .n { font-size: 14px; }
.day.today .n { background: var(--ink); color: #fff; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; text-align: center; }
.day[aria-pressed="true"] { background: var(--blush); box-shadow: inset 0 0 0 1.5px var(--pink); }
.dots { display: flex; gap: 2px; height: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--night); }
.dot.stage { background: var(--pink); } .dot.closed { background: var(--gray); }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--mute); margin: -8px 0 16px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }

/* 下のタブ */
.tabs[hidden] { display: none; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabs); padding-bottom: env(safe-area-inset-bottom); display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 5; }
.tab { flex: 1; font-size: 13px; color: var(--mute); font-weight: 700; }
.tab[aria-current="page"] { color: var(--pink); box-shadow: inset 0 3px 0 var(--pink); }

/* 推しを選ぶ */
.sheet { position: fixed; inset: 0; background: #fff; z-index: 10; display: flex; flex-direction: column; padding: 16px 18px 0; }
.sheet[hidden] { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 18px; margin: 0; }
.plain { color: var(--pink); font-weight: 700; padding: 8px 0 8px 12px; }
#search { width: 100%; margin: 10px 0 12px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--blush); }
.sheet-body { flex: 1; overflow-y: auto; padding-bottom: 28px; }
.sheet-body h3 { font-size: 13px; color: var(--mute); margin: 14px 0 6px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 8px; }
.pick button { text-align: center; font-size: 12px; line-height: 1.35; }
.pick img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--blush); margin-bottom: 4px; }
.pick button[aria-current="true"] img { box-shadow: 0 0 0 3px var(--pink); }
@media (prefers-reduced-motion: reduce) { .nama { transform: none; } }
