*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none !important}
body{font-family:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP",-apple-system,sans-serif;color:#1f2430;font-size:14px;background:#f6f7f9}
button,select,input{font:inherit;color:inherit}
button{cursor:pointer}

.top{display:flex;align-items:center;gap:10px;background:#fff;padding:14px 24px;border-bottom:1px solid #e3e5ea}
.logo{width:30px;height:30px;border-radius:7px;background:#2eb67d;color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center;flex:none}
.ttl{font-weight:800;font-size:17px}
.me{margin-left:auto;display:flex;align-items:center;gap:8px;color:#454b57}
.av{width:28px;height:28px;border-radius:50%;background:#e8a33d;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;object-fit:cover}

.main{display:flex;gap:20px;padding:20px 24px 0;align-items:flex-start}
.side{width:290px;flex:none}
.card{background:#fff;border:1px solid #e3e5ea;border-radius:10px;padding:16px 18px}
.card-title{font-weight:800;font-size:15px;margin-bottom:12px}
.step{display:flex;align-items:center;gap:8px;font-weight:800;font-size:13.5px;margin:16px 0 8px}
.step.first{margin-top:0}
.num{width:20px;height:20px;border-radius:50%;background:#1264a3;color:#fff;font-size:12px;display:flex;align-items:center;justify-content:center}
.lab{font-weight:700;font-size:12.5px;color:#454b57;margin:10px 0 5px}
.in,select{border:1px solid #cfd3da;border-radius:6px;padding:7px 10px;background:#fff;width:100%;font-variant-numeric:tabular-nums}
.pair{display:flex;align-items:center;gap:8px}
.seg{display:flex;border:1px solid #cfd3da;border-radius:6px;overflow:hidden}
.seg button{flex:1;padding:6px 0;font-weight:700;color:#5b6170;background:#fff;border:none}
.seg button.on{background:#1264a3;color:#fff}
.seg button[data-kind=off].on{background:#b8243c}
.btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cfd3da;border-radius:6px;padding:8px 14px;font-weight:700;background:#fff}
.btn:disabled{opacity:.5;cursor:default}
.btn.pri{background:#007a5a;border-color:#007a5a;color:#fff}
.btn.blue{background:#1264a3;border-color:#1264a3;color:#fff}
.btn.w{width:100%}
.note{color:#6b7280;font-size:12px;margin-top:8px;line-height:1.5}
#err{color:#b8243c;font-weight:700}

.cal{position:relative;flex:1;min-width:0;background:#fff;border:1px solid #e3e5ea;border-radius:10px;overflow:hidden}
.ch2{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid #e3e5ea}
.ch2 .m{font-weight:800;font-size:17px}
.ch2 .nav{background:none;border:none;color:#5b6170;font-size:18px;padding:0 6px}
.legend{margin-left:auto;display:flex;gap:12px;font-size:12px;color:#5b6170}
.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:4px;vertical-align:-1px}
.lg-chg{background:#fff1c7}.lg-sel{background:#dcebf9}
.grid{display:grid;grid-template-columns:repeat(7,1fr)}
.wd{font-size:12px;font-weight:700;text-align:center;padding:7px 0;border-bottom:1px solid #e3e5ea;background:#fafbfc;color:#6b7280}
.wd.sat{color:#1f6fbf}.wd.sun{color:#c0392b}
.c{height:88px;border:none;border-right:1px solid #eef0f3;border-bottom:1px solid #eef0f3;padding:6px 7px;position:relative;font-size:12px;text-align:left;background:#fff;overflow:hidden}
.c:nth-child(7n+7){border-right:none}
.c .n{font-weight:800;font-size:13px}
.c.other{cursor:default}
.c.other .n{color:#c3c7cf !important}
.c.past{background:#fafbfc}
.c.past .v{color:#9aa0ab}
.c.sat .n{color:#1f6fbf}.c.sun .n,.c.hol .n{color:#c0392b}
.c .hl{font-size:10px;color:#c0392b;margin-left:3px;font-weight:700}
.c.today .n{background:#1264a3;color:#fff;border-radius:50%;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center}
.v{margin-top:6px;font-variant-numeric:tabular-nums;font-weight:700;color:#1f2430;line-height:1.35}
.v.off{color:#b8243c}
.v small{display:block;font-weight:400;color:#6b7280;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.c.chg{background:#fff8db}
.c.chg::after{content:"変更あり";position:absolute;right:6px;bottom:5px;font-size:10px;font-weight:700;color:#a8650b}
.c.sel{background:#dcebf9;box-shadow:inset 0 0 0 2px #1264a3}
.c.sel::before{content:"✓";position:absolute;right:7px;top:5px;width:18px;height:18px;border-radius:50%;background:#1264a3;color:#fff;font-size:11px;display:flex;align-items:center;justify-content:center;font-weight:800}
.selecting .c:not(.other):hover{box-shadow:inset 0 0 0 2px #7fb0dc}
.guide{background:#1264a3;color:#fff;padding:9px 16px;font-weight:700;font-size:13.5px}
.selbar{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid #e3e5ea;background:#fff}
.selbar .cnt{font-weight:800}
.selbar .sp{margin-left:auto;display:flex;gap:8px}

/* スポットライト：日付を選んでいる間は、カレンダー以外を暗くする */
.dim{position:fixed;inset:0;background:rgba(17,24,39,.55);z-index:20}
.cal.spot{z-index:21;box-shadow:0 0 0 4px rgba(255,255,255,.9),0 12px 40px rgba(0,0,0,.35)}

/* メンバーの予定（ポータルの横スクロール予定と同じ作り：名前の列は固定、日付の列は104px） */
.tl{margin:20px 24px 0}
.tlh{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.tlh .m{font-weight:800;font-size:16px}
.tlh .t2{font-weight:700;color:#454b57;font-size:13px;margin-left:6px}
.tlh .r{margin-left:auto;display:flex;align-items:center;gap:4px;font-size:12px;color:#5b6170}
.tlh .hint{color:#9aa0ab;margin-right:6px}
.tlh .b{background:none;border:none;padding:3px 9px;border-radius:6px;color:#5b6170}
.tlh .b:hover{background:#eceef2}
.tlb{position:relative;background:#fff;border-radius:14px;box-shadow:0 1px 2px rgba(0,0,0,.06);border:1px solid #eceef2;overflow-x:auto;overscroll-behavior-x:contain}
.tlin{min-width:max-content}
.tlr{display:flex;border-bottom:1px solid #f1f2f5;font-size:12px}
.tlr:last-child{border-bottom:none}
.tlr.hd{border-bottom:1px solid #e3e5ea}
.nm{width:152px;flex:none;padding:8px 12px;display:flex;align-items:center;gap:8px;position:sticky;left:0;z-index:2;background:#fff;border-right:1px solid #f1f2f5}
.tlr.hd .nm{background:#f8fafc;color:#5b6170;font-weight:600}
.tlr.self,.tlr.self .nm{background:#f8fafc}
.ava{width:24px;height:24px;border-radius:50%;flex:none;color:#fff;font-weight:700;font-size:11px;display:flex;align-items:center;justify-content:center;background:#94a3b8;object-fit:cover}
.nm .who{font-weight:600;line-height:1.2}
.nm .you{font-size:10px;color:#9aa0ab}
.dc{width:104px;flex:none;padding:8px}
.tlr.hd .dc{text-align:center;font-weight:600;color:#5b6170;background:#fbfcfd}
.tlr.hd .dc.sun{color:#ef4444}.tlr.hd .dc.sat{color:#3b82f6}
.dc.today{background:rgba(15,23,42,.05) !important}
.pill{border-radius:4px;padding:2px 3px;text-align:center;font-size:10px;letter-spacing:-.2px;margin-bottom:4px;line-height:1.35}
.p-s{background:#e0f2fe;color:#0c4a6e}.p-a{background:#d1fae5;color:#064e3b}.p-o{background:#ffe4e6;color:#881337}
.dash{text-align:center;color:#cbd5e1;font-size:10.5px}
.endpad{height:110px}

/* 保存のバー：変更があるときだけ下からせり上がる */
.savebar{position:fixed;left:50%;bottom:22px;transform:translate(-50%,160%);width:min(640px,calc(100% - 24px));display:flex;align-items:center;gap:14px;
  background:#fff;border:1px solid #e3e5ea;border-radius:12px;padding:12px 14px 12px 20px;z-index:30;
  box-shadow:0 -2px 6px rgba(0,0,0,.04),0 14px 36px rgba(17,24,39,.28);transition:transform .28s cubic-bezier(.2,.8,.2,1);visibility:hidden}
.savebar.show{transform:translate(-50%,0);visibility:visible}
.savebar .msg{color:#454b57}.savebar .msg b{color:#a8650b}
.savebar .sp{margin-left:auto;display:flex;gap:10px;flex:none}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);background:#1f2430;color:#fff;border-radius:8px;padding:10px 18px;font-weight:700;z-index:31}

/* 案内だけのページ */
.msgpage{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:16px}
.msgbox{background:#fff;border:1px solid #e3e5ea;border-radius:12px;padding:40px 36px;max-width:520px;text-align:center}
.msgbox .logo{width:44px;height:44px;font-size:20px;margin:0 auto 14px;border-radius:10px}
.msgbox h1{font-size:19px;margin-bottom:10px}
.msgbox p{color:#454b57;line-height:1.7}
.pick{display:grid;gap:8px;margin-top:18px}

@media (max-width:860px){
  .main{flex-direction:column}
  .side{width:100%}
  .top,.main{padding-left:16px;padding-right:16px}
  .tl{margin-left:16px;margin-right:16px}
  .c{height:70px;padding:4px}
  .v{font-size:10.5px}
  .c .hl{display:none}
  .tlh .hint{display:none}
}
