:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",sans-serif;color:#303f3b;background:#ebece7;font-synthesis:none;--work:#4b6f93;--work-text:#243f60;--private:#b17754}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;color:inherit;border:0;background:transparent;touch-action:manipulation}button:focus-visible{outline:3px solid #b17754;outline-offset:-3px}.planner{max-width:650px;margin:auto;height:100vh;height:100dvh;background:#f8f7f3;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top);position:relative}.month-panel{height:66%;min-height:0;display:flex;flex-direction:column;padding:20px 18px 8px}header{display:flex;align-items:center;justify-content:space-between}h1{font-size:29px;font-weight:500;margin:5px 0 0;letter-spacing:-1px}.eyebrow{font-size:9px;letter-spacing:2.3px;color:#82918a;font-weight:600}.today{border:1px solid #d5dcd4;border-radius:20px;padding:7px 16px;font-size:12px}nav{display:flex;align-items:center;justify-content:space-between;margin:5px 0 8px}nav p{font-size:12px;color:#7b8981;margin:0}nav button{font-size:25px;width:40px;height:32px}.weekdays,.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.weekdays{text-align:center;font-size:10px;color:#859188;padding-bottom:10px}.weekdays span:first-child{color:#b17770}.weekdays span:last-child{color:#718d9c}.calendar{flex:1;min-height:0;grid-auto-rows:minmax(0,1fr);border-top:1px solid #dedfd7}.day{border-bottom:1px solid #e2e4dc;border-right:1px solid #ecece5;min-width:0;overflow:hidden;text-align:left;padding:4px 2px;display:flex;flex-direction:column;gap:2px}.day:nth-child(7n){border-right:0}.day.outside{opacity:.4}.day.selected{background:#e8eee6;border-radius:6px}.date-number{display:flex;align-items:center;justify-content:center;width:23px;height:23px;border-radius:50%;font-size:12px;flex-shrink:0}.day.is-today .date-number{background:#366d61;color:white}.day:nth-child(7n+1) .date-number{color:#b17770}.day.is-today .date-number{color:white}.chip{font-size:9px;line-height:15px;border-radius:3px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 3px;flex-shrink:0;max-width:100%;background:#e3ebf3;color:var(--work-text)}.chip.private{background:#f0e4d9;color:#945e3d}.more{font-size:9px;color:#768179;padding-left:3px}.legend{display:flex;justify-content:flex-end;gap:12px;font-size:9px;color:#829087;padding-top:8px}.legend span{display:flex;align-items:center;gap:5px}.legend i{width:5px;height:5px;border-radius:50%}.work-dot{background:var(--work)}.private-dot{background:var(--private)}.agenda{flex:1;min-height:0;border-top:1px solid #dce1d7;padding:16px 22px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;background:#fffefa;border-radius:22px 22px 0 0;box-shadow:0 -5px 16px #394a3810}.agenda-head{display:flex;justify-content:space-between;align-items:center;flex-shrink:0;margin-bottom:12px}h2{font-size:19px;font-weight:500;margin:4px 0}.add{background:#366d61;color:white;border-radius:50%;width:42px;height:42px;font-size:25px;box-shadow:0 3px 8px #366d6122}.events{overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:0}.event{display:flex;width:100%;text-align:left;align-items:center;gap:14px;padding:12px 2px;border-bottom:1px solid #efeee7}.event-time{font-size:11px;min-width:75px;color:#7c877e;line-height:1.7}.event-body{border-left:3px solid var(--work);padding-left:12px;min-width:0;flex:1}.event.private .event-body{border-color:var(--private)}.event-name{font-size:14px;overflow-wrap:anywhere}.event.work .event-name{color:var(--work-text)}.event-location{font-size:10px;color:#899086;margin-top:4px;overflow-wrap:anywhere}.event-arrow{color:#a8b1a6}.empty{text-align:center;color:#899487;font-size:12px;padding:15px 0;line-height:2}.empty strong{font-weight:400;color:#4e6659;font-size:15px}.status{position:absolute;bottom:15px;left:12px;right:12px;background:#553e33;color:white;padding:12px;border-radius:8px;font-size:12px;z-index:3}dialog{width:min(94%,480px);max-height:90vh;max-height:90dvh;overflow:auto;border:0;border-radius:20px;background:#fffefa;color:#303f3b;padding:24px;box-shadow:0 20px 80px #0003}dialog::backdrop{background:#1c322950}.form-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.form-heading button{font-size:26px;width:40px;height:40px}form>label,.time-row label{display:block;font-size:12px;margin:14px 0}input:not([type=radio]),select,textarea{display:block;width:100%;min-height:44px;border:1px solid #dce0d5;background:white;border-radius:8px;padding:10px;margin-top:7px;font-size:16px;color:#303f3b}textarea{resize:vertical}.required{font-size:10px;color:#a57355;margin-left:5px}fieldset{border:0;padding:0;margin:16px 0;display:flex;gap:20px;font-size:13px}legend{font-size:12px;margin-bottom:10px}fieldset label{display:flex;align-items:center;gap:6px}input[type=radio]{accent-color:#366d61}.time-row{display:flex;gap:12px}.time-row label{flex:1;margin:0}.hint{font-size:10px;line-height:1.7;color:#7b877c}.form-actions{display:flex;gap:12px;margin-top:18px}.save{margin-left:auto;background:#366d61;color:white;padding:13px 30px;border-radius:9px}.delete{color:#ae5d51;padding:12px}#form-error{font-size:12px;color:#ae5d51}@media(min-width:700px){.planner{border-left:1px solid #dce1d7;border-right:1px solid #dce1d7}.month-panel{padding-left:28px;padding-right:28px}.chip{font-size:11px;line-height:18px}}@media(max-height:680px){.month-panel{padding-top:10px}h1{font-size:23px}nav{margin:1px 0 4px}.agenda{padding-top:10px}.agenda-head{margin-bottom:4px}.date-number{height:20px}.day{gap:1px;padding-top:2px}}

/* 時刻入力だけをコンパクトな時・分の2欄へ変更 */
.time-row{display:grid;gap:10px;margin:14px 0}
.time-control{display:grid;grid-template-columns:64px minmax(0,1fr) minmax(0,1fr);align-items:center;gap:8px;font-size:12px}
.time-control select{min-width:0;min-height:44px;margin:0;padding:10px 6px;font-size:16px}
.time-control select:disabled{color:#899086;background:#f1f2ec;opacity:1}

/* iPhoneでも左寄せの曜日付き表示。タップは従来のdate入力が受け取る。 */
.date-control{position:relative;display:block;margin-top:7px;min-width:0}
.date-display{display:flex;align-items:center;width:100%;min-height:44px;border:1px solid #dce0d5;background:white;border-radius:8px;padding:10px;font-size:16px;line-height:1.5;color:#303f3b;text-align:left;pointer-events:none}
.date-control input[type=date]{position:absolute;inset:0;width:100%;height:100%;min-width:0;margin:0;opacity:0;cursor:pointer}
.date-control:focus-within .date-display{outline:2px solid #366d61;outline-offset:2px}

/* 種類の選択だけを、指で押しやすいボタン表示にする。 */
.category-picker{min-width:0;gap:10px}
.category-picker label{position:relative;display:block;flex:1;min-width:0;cursor:pointer;touch-action:manipulation}
.category-picker input[type=radio]{position:absolute;width:1px;height:1px;margin:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.category-picker label span{display:flex;align-items:center;justify-content:center;min-height:48px;width:100%;padding:10px 6px;border:1px solid #dce0d5;border-radius:8px;background:white;font-size:15px;line-height:1.5;text-align:center}
.category-picker input[value=work]+span{color:var(--work-text)}
.category-picker input[value=private]+span{color:#945e3d}
.category-picker input[value=work]:checked+span{background:#e3ebf3;border-color:var(--work);box-shadow:inset 0 0 0 1px var(--work)}
.category-picker input[value=private]:checked+span{background:#f0e4d9;border-color:var(--private);box-shadow:inset 0 0 0 1px var(--private)}
.category-picker input:focus-visible+span{outline:2px solid currentColor;outline-offset:3px}

/* 普段は閉じておけるバックアップ操作 */
.backup{flex-shrink:0;margin-top:8px;font-size:12px;color:#7b8981}
.backup summary{cursor:pointer;min-height:44px;display:list-item;align-content:center;padding:10px 0}
.backup-actions{display:flex;gap:10px;flex-wrap:wrap}
.backup-actions button{flex:1;min-height:44px;padding:10px;border:1px solid #d5dcd4;border-radius:8px;background:white;color:#303f3b;font-size:13px}
.backup-actions button:disabled{opacity:.5;cursor:default}
#backup-file[hidden]{display:none}
#backup-message:empty,#restore-error:empty{display:none}
#backup-message,#restore-count,#restore-description{line-height:1.7}
#restore-error{color:#ae5d51;font-size:12px;line-height:1.7}
#confirm-restore{background:#366d61;color:white;border-color:#366d61}
