* { box-sizing: border-box }
:root { font-family:"Hiragino Kaku Gothic ProN","Yu Gothic","Meiryo","Noto Sans JP",sans-serif; color:#111; background:#F5F6F8; --green:#06C755; --line:#E4E8ED; --muted:#566371 }
body { margin:0 }
[hidden] { display:none!important }
button,input,textarea { font:inherit }
button { cursor:pointer; color:inherit; border:0; background:none; touch-action:manipulation }
button:focus-visible,input:focus-visible,textarea:focus-visible { outline:3px solid #047944; outline-offset:2px }
button:disabled { opacity:.55; cursor:wait }
h1,h2,p { margin:0 }
.header { position:sticky; top:0; z-index:2; background:#fff; border-bottom:1px solid var(--line); padding-top:env(safe-area-inset-top) }
.bar { max-width:780px; margin:auto; min-height:70px; padding:0 16px; display:flex; align-items:center; gap:14px; justify-content:space-between }
.brand { display:flex; align-items:center; gap:9px; font-size:.9rem; font-weight:750; color:#25382d }
.brand span { width:17px; height:16px; border:2px solid #058947; border-top-width:5px; border-radius:4px }
.month-nav { display:flex; align-items:center; gap:5px }
.month-nav h1 { font-size:1.17rem; min-width:8ch; text-align:center }
.month-button { border:1px solid var(--line); border-radius:12px; min-width:42px; min-height:42px; font-size:1.5rem; line-height:1 }
.today,.gate button { border-radius:999px; padding:10px 17px; min-height:42px; background:var(--green); color:#062918; font-weight:800 }
main { max-width:780px; margin:0 auto; padding:18px 16px 100px }
.calendar { background:#fff; border:1px solid var(--line); border-radius:20px; overflow:hidden }
.week,.grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center }
.week { padding:12px 0 8px; color:var(--muted); font-size:.875rem; font-weight:700 }
.week span:first-child,.day.sunday { color:#a73542 }
.week span:last-child,.day.saturday { color:#24599e }
.day { display:grid; justify-items:center; align-content:start; gap:4px; min-height:57px; border-top:1px solid #eef0f2; border-right:1px solid #eef0f2; padding:5px 2px 4px; font-weight:700 }
.day:nth-child(7n) { border-right:0 }
.day:hover { background:#f3fcf6 }
.day.outside { color:#687681; background:#fbfcfd }
.day-number { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; border:1px solid transparent }
.day[aria-current=date] .day-number { border-color:#00864a }
.day[aria-pressed=true] .day-number { background:var(--green); color:#052719; border-color:transparent }
.dots { display:flex; justify-content:center; flex-wrap:wrap; gap:3px; min-height:6px }
.dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--person) }
.legend { display:flex; flex-wrap:wrap; gap:8px 13px; padding:12px; border-top:1px solid #eef0f2 }
.legend span { display:inline-flex; gap:5px; align-items:center; font-size:.78rem; font-weight:700 }
.papa { --person:#3679cb; --wash:#e0efff; --ink:#153e6b }
.mama { --person:#d75077; --wash:#ffe6ee; --ink:#812844 }
.yuta { --person:#218064; --wash:#daf4e8; --ink:#16543e }
.twins { --person:#bb6409; --wash:#ffedce; --ink:#714007 }
.all { --person:#008d40; --wash:#baf4d1; --ink:#115031 }
.agenda { background:#EDF1F5; border-radius:20px; margin-top:16px; padding:17px }
.agenda-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px }
.agenda h2,.sheet-head h2 { font-size:1.13rem }
#count,#status { color:var(--muted); font-size:.875rem; margin-top:4px }
#status:not(:empty) { padding-bottom:12px }
.subtle { color:#29474b; border:1px solid #c9d3dc; border-radius:10px; min-height:40px; padding:0 12px; font-weight:700 }
#entries { display:grid; gap:10px }
.entry { width:100%; text-align:left; background:#fff; padding:13px 15px; border-radius:4px 16px 16px 16px; display:grid; gap:6px; border-left:4px solid var(--person); overflow-wrap:anywhere }
.entry-top { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:.875rem }
.badge { background:var(--wash); color:var(--ink); padding:3px 9px; border-radius:30px; font-weight:800; font-size:.875rem }
.memo { font-size:.875rem; color:var(--muted); white-space:pre-wrap }
.dock { position:fixed; z-index:3; bottom:0; left:0; right:0; background:#ffffffed; border-top:1px solid var(--line); padding:10px 16px calc(10px + env(safe-area-inset-bottom)); text-align:center }
#add,#save { border-radius:14px; background:var(--green); color:#052719; font-weight:800; min-height:49px; padding:0 20px }
#add { width:min(100%,440px) }
dialog { width:min(100%,540px); max-height:92dvh; max-width:none; padding:0; border:0; border-radius:24px 24px 0 0; margin:auto auto 0; box-shadow:0 -12px 40px #16273730 }
dialog::backdrop { background:#15253765 }
form { padding:18px 20px calc(20px + env(safe-area-inset-bottom)) }
.sheet-head,.sheet-actions { display:flex; justify-content:space-between; align-items:center; gap:12px }
#close { font-size:1.5rem; width:42px; height:42px; border-radius:12px; background:#F5F6F8 }
.fields { display:grid; grid-template-columns:1fr 1fr; gap:12px }
label { display:grid; gap:5px; font-weight:700; font-size:.875rem; margin-top:11px; min-width:0 }
label input:not([type=checkbox]):not([type=radio]),textarea { background:#F5F6F8; color:#111; border:1px solid #d7dfe6; border-radius:9px; padding:9px; min-height:43px; width:100%; font-size:1rem }
.all-day { display:flex; align-items:center; gap:7px; min-height:28px }
.all-day input,.choices input { accent-color:#057a42 }
fieldset { border:0; padding:0; margin:9px 0 0; min-width:0 }
legend { padding:0; font-size:.875rem; font-weight:700 }
.choices { display:flex; flex-wrap:wrap; gap:6px }
.choices label { display:flex; align-items:center; background:var(--wash); color:var(--ink); border-radius:22px; padding:5px 9px; margin-top:4px; min-height:34px; gap:4px }
.choices label { white-space:nowrap }
.choices input { width:14px; height:14px; margin:0 }
#form-status { color:#a22a35; margin:11px 0; font-size:.875rem }
#save { flex:1 }
#remove { color:#a22a35; min-height:44px; padding:0 14px; border:1px solid #e8bdc1; border-radius:12px; font-weight:700 }
.gate { margin:15vh auto 0; width:min(90%,420px); padding:30px; background:#fff; border:1px solid var(--line); border-radius:24px; text-align:center }
.gate h1 { font-size:1.3rem; margin:14px 0 8px }
.gate p { color:var(--muted) }
.gate button { margin-top:18px }
@media (max-width:520px) { .brand { display:none } main { padding:12px 9px 94px } .bar { min-height:61px } }
@media (min-width:650px) { .day { min-height:69px } dialog { margin:auto; border-radius:24px } }

