:root{--ink:#3e4a43;--muted:#858c83;--green:#638870;--paper:#faf8f4;--line:#edece5;--soft:#eef3e9;--peach:#efb6a0;--radius:22px;font-family:-apple-system,BlinkMacSystemFont,'Hiragino Kaku Gothic ProN','Noto Sans JP',sans-serif;color:var(--ink);background:#eeeae2;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer;color:inherit;border:0;background:none;touch-action:manipulation}button:disabled{opacity:.5;cursor:wait}button:focus-visible,a:focus-visible{outline:3px solid #d7946f;outline-offset:2px}input:focus,textarea:focus{outline:2px solid #92b09a}button{min-height:44px}h1,h2,p{margin:0}.app{max-width:900px;margin:auto;min-height:100dvh;background:var(--paper);padding:env(safe-area-inset-top) 30px calc(100px + env(safe-area-inset-bottom));box-shadow:0 0 60px #45583e09}header{height:100px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:13px}.brand h1{font-size:20px;letter-spacing:.06em;font-weight:700}.brand p{font-size:11px;color:var(--muted);margin-top:7px;letter-spacing:.13em}.logo{width:45px;height:47px;display:grid;place-items:center;background:#dae5cf;color:var(--green);border-radius:15px;font-size:37px;position:relative}.logo b{position:absolute;font-size:22px;right:-7px;bottom:-5px;color:#d7997b;text-shadow:0 0 4px var(--paper)}.round{font-size:24px;width:44px;height:44px;border-radius:50%;background:white;border:1px solid var(--line)}.ad{height:54px;border:1px dashed #dbddd3;background:#f1f1e9;border-radius:13px;display:flex;align-items:center;justify-content:center;gap:12px;color:#929889;font-size:11px;position:relative;letter-spacing:.1em}.ad-tag{font-size:9px;border:1px solid #cad0c3;border-radius:4px;padding:2px 5px}.ad-flower{font-size:30px;color:#cbd7bf;position:absolute;right:20px}.calendar-head{padding:27px 2px 14px}.calendar-head>div:first-child{display:flex;align-items:center;justify-content:space-between}.eyebrow{font-size:12px;color:var(--green);font-weight:650}.share-small{font-size:12px;min-height:30px;color:var(--green)}.month-row{display:flex;align-items:center;justify-content:space-between;margin-top:10px}.month-row h2{font-size:31px;font-weight:600;letter-spacing:.04em}.month-row h2 small{font-size:16px;font-weight:500;margin-left:8px}.month-controls{display:flex;gap:7px;align-items:center}.month-controls button{border:1px solid #e4e7dd;background:#fff;border-radius:12px;min-width:42px;font-size:26px}.month-controls #today{font-size:12px;padding:0 14px}.status{font-size:10px;color:var(--muted);min-height:15px;margin-top:7px}.status.failed{color:#af605a}.calendar{background:white;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.week,.days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.week{padding:16px 0 11px;text-align:center;background:#fffefa;font-size:11px;color:var(--muted)}.week span:first-child{color:#cf8d88}.week span:last-child{color:#81a0bb}.day{height:100px;min-width:0;border-top:1px solid var(--line);border-right:1px solid #f3f2ed;padding:6px 5px;text-align:left;display:flex;flex-direction:column;align-items:center;overflow:hidden;position:relative}.day:nth-child(7n){border-right:0}.day .number{height:26px;min-height:26px;min-width:26px;border-radius:50%;display:grid;place-items:center;font-size:12px;margin-bottom:4px}.day.sunday .number{color:#c17b79}.day.saturday .number{color:#7091ad}.day.outside{background:#fdfcf9;color:#bcbeb7}.day.today .number{border:1px solid #a9b99b}.day.selected{background:#f0f5ec}.day.selected .number{background:var(--green);color:white;border:none}.event-chip{display:flex;align-items:center;gap:3px;width:100%;min-height:19px;padding:2px 4px;border-radius:5px;margin-bottom:3px;font-size:9px;line-height:1.4}.event-chip .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.event-chip .emoji{font-size:13px}.more{font-size:9px;color:var(--muted)}.agenda{padding:24px 2px}.agenda-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}.agenda-heading h2{font-size:16px}.agenda-heading>span{font-size:11px;color:var(--muted)}.event-row{width:100%;display:flex;align-items:center;background:white;border:1px solid var(--line);border-radius:18px;padding:14px;margin-bottom:10px;text-align:left;gap:14px}.badge{width:48px;min-width:48px;height:48px;display:grid;place-items:center;font-size:27px;border-radius:15px}.event-info{min-width:0;flex:1}.event-info strong{font-size:14px;display:block;word-break:break-word}.event-info p{color:var(--muted);font-size:11px;margin-top:6px}.event-info .note{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.chevron{color:#b5b9ae;font-size:23px}.empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:18px 0;gap:10px}.empty .flower{font-size:35px;filter:saturate(.7)}.empty p{font-size:12px;color:var(--muted)}.empty button{color:var(--green);font-size:12px;text-decoration:underline}.bottom{position:fixed;bottom:0;left:50%;transform:translateX(-50%);max-width:900px;width:100%;background:#fffcf7f5;backdrop-filter:blur(14px);border-top:1px solid #e9e8e0;display:flex;align-items:center;justify-content:space-around;gap:20px;padding:12px 25px calc(12px + env(safe-area-inset-bottom));z-index:2}.bottom button{font-size:10px;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--muted)}.bottom button>span{font-size:23px}.bottom .active{color:var(--green)}.bottom .add{flex-direction:row;font-size:13px;font-weight:650;background:var(--green);color:white;padding:8px 30px;border-radius:100px;gap:10px;box-shadow:0 4px 12px #51745820}.bottom .add span{font-size:24px}dialog{padding:0;border:0;border-radius:26px;max-width:520px;width:calc(100% - 24px);max-height:90dvh;color:var(--ink);background:var(--paper);box-shadow:0 20px 90px #34483b30}dialog::backdrop{background:#27372b70;backdrop-filter:blur(3px)}.dialog-header{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--paper);padding:20px 22px 12px;z-index:3;border-bottom:1px solid var(--line)}.dialog-header h2{font-size:19px}.form-body{padding:18px 22px 24px}label,.section-title.field-heading{font-size:12px;font-weight:650}label{display:block;margin-bottom:17px}input:not([type=checkbox]),textarea{display:block;width:100%;margin-top:8px;padding:13px;border-radius:11px;border:1px solid #dce1d4;background:white;color:var(--ink);font-size:16px;min-width:0}textarea{resize:vertical;font-size:16px;line-height:1.7}.required{font-size:10px;color:#b38168;margin-left:6px}.muted{font-size:10px;color:var(--muted);font-weight:400}.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.two[hidden],[hidden]{display:none!important}.toggle{display:flex;justify-content:space-between;align-items:center;position:relative;min-height:40px}.toggle input{position:absolute;right:0;opacity:0;width:44px;height:30px}.switch{width:44px;height:26px;border-radius:30px;background:#d3d9ce;padding:3px}.switch:after{content:'';display:block;width:20px;height:20px;border-radius:50%;background:white;transition:transform .2s}.toggle input:checked+.switch{background:var(--green)}.toggle input:checked+.switch:after{transform:translateX(18px)}.toggle input:focus-visible+.switch{outline:2px solid #c59062}.icon-heading{display:flex;justify-content:space-between;align-items:center}.icon-heading label{margin:0}.icon-heading span{font-size:12px;color:var(--green)}.categories{display:flex;overflow:auto;gap:6px;margin:12px 0}.categories button{white-space:nowrap;border:1px solid #e1e4da;padding:6px 12px;border-radius:30px;font-size:11px;min-height:34px;background:white}.categories button.selected{background:var(--green);color:white;border-color:var(--green)}.icon-picker{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;margin-bottom:22px}.icon-picker button{border:1px solid #e8e9e1;background:white;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:7px 0;gap:4px}.icon-picker button.selected{border:2px solid var(--green);background:#eaf0e3}.icon-picker .emoji{font-size:26px}.icon-picker small{font-size:8px;white-space:nowrap}.primary,.secondary{width:100%;min-height:48px;padding:12px;border-radius:13px;font-size:13px;font-weight:650;margin-top:6px}.primary{background:var(--green);color:white}.secondary{border:1px solid #d8dfd0;background:white;color:var(--green)}.danger{color:#b26565;width:100%;font-size:12px;margin-top:12px}.error{color:#ad5555;font-size:12px;line-height:1.7;margin:8px 0}.notice{display:flex;gap:13px;background:var(--soft);padding:17px;border-radius:17px;margin-bottom:20px}.notice>span{font-size:30px}.notice strong{font-size:13px}.notice p,.help{font-size:11px;color:var(--muted);line-height:1.8;margin-top:6px}.section-title{font-size:14px;margin:22px 0 12px}.connection-state{font-size:12px;line-height:1.8;background:white;padding:14px;border-radius:12px}.members{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}.member{font-size:11px;background:#e9efe2;color:var(--green);padding:8px 12px;border-radius:20px}.code{font:12px monospace;background:white;padding:12px;border:1px solid var(--line);border-radius:10px;overflow-wrap:anywhere;user-select:all;margin:10px 0}.about{margin-top:20px;font-size:11px;line-height:1.8;color:var(--muted)}.about summary{min-height:32px;cursor:pointer}.toast{position:fixed;bottom:calc(105px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:10;background:#3e5146;color:white;font-size:12px;border-radius:40px;padding:13px 23px;max-width:90%;text-align:center}.inline-actions{display:flex;gap:8px}.inline-actions>*{flex:1}.small-text{font-size:11px;color:var(--muted);line-height:1.8}.sync-button{color:var(--green);font-size:11px;text-decoration:underline;min-height:30px}
@media(min-width:700px){.app{padding-left:50px;padding-right:50px}.day{height:115px}.event-chip{font-size:11px}.event-chip .emoji{font-size:15px}.agenda{max-width:600px;margin:auto}.brand h1{font-size:23px}}
@media(max-width:480px){.app{padding-left:14px;padding-right:14px}header{height:85px}.brand h1{font-size:17px}.brand p{font-size:10px}.logo{width:39px;height:42px;font-size:32px}.ad{height:50px}.calendar-head{padding-top:18px}.month-row h2{font-size:26px}.day{height:87px;padding:5px 2px}.event-chip{font-size:8px;padding:2px;gap:1px}.event-chip .emoji{font-size:12px}.day .number{font-size:11px}.bottom{gap:8px;padding-left:14px;padding-right:14px}.bottom .add{padding:8px 20px}.dialog-header{padding:15px 17px 10px}.form-body{padding:15px 17px 22px}.two{gap:8px}.two input{font-size:16px;padding:12px 7px}.agenda{padding-top:20px}.month-controls{gap:4px}.month-controls button{min-width:36px}.icon-picker{gap:4px}}
.view-switch{display:flex;gap:3px;background:#e9ede3;border-radius:13px;padding:4px;margin-top:16px;width:180px}.view-switch button{flex:1;border-radius:10px;font-size:13px;min-height:34px}.view-switch button[aria-pressed=true]{background:white;color:var(--green);font-weight:700;box-shadow:0 2px 4px #314a3310}.icon-trigger{display:flex;align-items:center;gap:10px;width:100%;padding:14px;border:1px solid #dce1d4;background:white;border-radius:13px;margin-bottom:18px;font-size:13px}.icon-trigger #chosen-icon{margin-left:auto;color:var(--green)}.color-picker{display:flex;justify-content:space-between;gap:3px;margin:-8px 0 18px}.color-picker button{width:38px;height:40px;min-height:40px;border-radius:50%;display:grid;place-items:center;padding:4px}.color-picker button span{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:17px}.color-picker button.selected{outline:2px solid var(--green);outline-offset:-2px}.date-columns{margin-bottom:18px;min-width:0}.date-columns fieldset{border:0;padding:0;margin:0;min-width:0;overflow:hidden}.date-columns legend{font-size:12px;font-weight:650;margin-bottom:4px}.date-columns input{max-width:100%;min-width:0;width:100%;box-sizing:border-box;-webkit-appearance:none;appearance:none}.date-columns input::-webkit-date-and-time-value{text-align:left}.time-input{margin-bottom:0}select{width:100%;display:block;background:white;color:var(--ink);font:inherit;font-size:16px;padding:13px;border:1px solid #dce1d4;border-radius:11px;margin-top:8px;min-height:46px}.map-button{display:block;margin:-12px 0 16px;color:var(--green);font-size:12px;text-decoration:underline}.repeat-label{margin-top:20px}#enable-notifications{font-size:12px;margin-bottom:4px}.illustration-slot{grid-column:1/-1;border:1px dashed #c5d1bc;border-radius:16px;padding:22px;text-align:center;background:#f2f5ed;color:var(--muted);font-size:12px;line-height:1.9}.illustration-slot strong{display:block;color:var(--green)}.slot-previews{display:flex;justify-content:center;gap:10px;margin:12px 0}.slot-previews span{width:44px;height:44px;border:1px dashed #bdcbb5;border-radius:13px;display:grid;place-items:center;font-size:22px;color:#b4c3ac}.agenda .event-row{border-left:4px solid var(--event-color,var(--green))}
.timeline-scroll{max-height:65dvh;overflow:auto;border:1px solid var(--line);border-radius:16px;background:white;overscroll-behavior:contain;position:relative}.timeline-inner{min-width:650px}.timeline-inner.single{min-width:0}.timeline-header,.all-day-row,.time-body{display:grid;grid-template-columns:46px repeat(var(--columns),minmax(0,1fr))}.timeline-header{position:sticky;top:0;z-index:4;background:#fffdf8;border-bottom:1px solid var(--line)}.timeline-header button{font-size:11px;border-left:1px solid var(--line);padding:8px 1px}.timeline-header button.selected{background:#e8efe2;color:var(--green);font-weight:700}.time-label{font-size:10px;color:var(--muted);text-align:center;padding:12px 0}.all-day-row{border-bottom:1px solid var(--line)}.all-day-cell{border-left:1px solid var(--line);min-height:44px;padding:4px;display:flex;flex-direction:column;gap:3px}.all-day-cell button{min-height:25px;padding:5px;text-align:left;font-size:10px;border-radius:5px;word-break:break-word}.hours{position:relative;height:1440px;color:var(--muted);font-size:10px}.hour-label{position:absolute;right:6px;transform:translateY(-6px)}.hour-label:first-child{transform:none}.time-column{height:1440px;position:relative;border-left:1px solid var(--line);background:repeating-linear-gradient(to bottom,transparent 0px,transparent 29px,#f6f6f0 29px,#f6f6f0 30px,transparent 30px,transparent 59px,#e7eae1 59px,#e7eae1 60px)}.hour-slot{position:absolute;left:0;right:0;height:60px;min-height:0;border:0;z-index:0}.hour-slot:focus-visible{outline-offset:-3px}.timed-event{position:absolute;z-index:1;border-radius:6px;border-left:3px solid var(--event-color);padding:3px 4px;min-height:0;overflow:hidden;text-align:left;font-size:10px;line-height:1.4;box-shadow:0 1px 3px #24372312}.timed-event strong{display:block;word-break:break-word}.timed-event small{display:block;font-size:9px}.timeline-hint{font-size:10px;color:var(--muted);margin:9px 2px}.month-row h2.period-title{font-size:20px}.agenda .event-info .location{color:var(--green)}@media(max-width:380px){.color-picker button{width:32px}.date-columns input{font-size:16px;padding:10px 3px}.month-row h2.period-title{font-size:17px}}

/* Keep native form focus from zooming the iPhone viewport. Allow grid and flex content to shrink. */
.app{width:100%;min-width:0}main,.calendar-head,.calendar,.agenda,#timeline-view{min-width:0;max-width:100%}
.event-chip .title{min-width:0}.event-chip .emoji{flex-shrink:0}
#calendar-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.share-small,.month-controls{flex-shrink:0}
@media(max-width:380px){.month-row{gap:8px;flex-wrap:wrap}.month-row h2{font-size:23px}.month-controls #today{padding:0 9px}}

/* Compact calendar shell: safe areas, bottom controls and bottom advertising. */
.app{padding:env(safe-area-inset-top) 6px calc(124px + env(safe-area-inset-bottom))}
header{height:56px;gap:8px;position:sticky;top:0;background:var(--paper);z-index:5}
#month-picker-button{display:flex;align-items:center;gap:6px;min-width:0;padding:0 4px;font-size:25px;font-weight:650;white-space:nowrap}
#month-title small{font-size:14px;margin:0 3px}.month-caret{font-size:15px;color:var(--green)}
.header-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}#today{font-size:13px;border:1px solid var(--line);border-radius:10px;padding:0 10px;background:white}
.calendar-head{padding:0 4px 6px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.eyebrow{font-size:10px}.status{font-size:9px;margin:0;min-height:0}.error:empty{display:none}
.calendar{border-radius:9px}.week{padding:7px 0}.day{height:82px;padding:3px 1px}.day .number{margin-bottom:2px}
.agenda{padding:10px 2px;max-width:none}.agenda-heading{margin-bottom:7px}.event-row{padding:8px;gap:8px;border-radius:10px;margin-bottom:5px}.badge{width:36px;min-width:36px;height:36px;font-size:23px}.empty{padding:9px 0;gap:5px}
.bottom{display:block;padding:0 6px env(safe-area-inset-bottom);border-top:1px solid var(--line);border-radius:0;max-width:900px}
.bottom-tools{display:flex;align-items:center;justify-content:space-between;height:66px;gap:10px;padding:4px 2px}
.view-switch{width:194px;max-width:70%;margin:0;padding:3px;border-radius:12px}.bottom .view-switch button{display:block;font-size:14px;min-height:42px;color:var(--ink)}.bottom .view-switch button[aria-pressed=true]{color:var(--green)}
.bottom .add{display:grid;place-items:center;flex:none;width:52px;height:52px;border-radius:50%;padding:0;font-size:34px;line-height:1;min-height:52px}
.ad{height:50px;min-height:50px;border-radius:0;border:0;border-top:1px dashed #d9ddd2;font-size:10px;letter-spacing:0}
dialog>.ad{position:sticky;bottom:0;z-index:4;background:#f1f1e9}dialog{max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px)}
.timeline-scroll{width:100%;max-width:100%;overflow-x:hidden;overflow-y:auto;max-height:calc(100dvh - 238px);touch-action:pan-y pinch-zoom}
.timeline-inner{min-width:0;width:100%}.timeline-header,.all-day-row,.time-body{grid-template-columns:30px repeat(7,minmax(0,1fr))}
.timeline-header button{min-width:0;font-size:10px;padding:3px 0;line-height:1.3}.timeline-header button span,.timeline-header button strong{display:block}.timeline-header button strong{font-size:14px}
.time-label{font-size:9px;padding:8px 0}.all-day-cell{min-width:0;padding:2px;gap:2px}.all-day-cell button{min-width:0;width:100%;font-size:9px;padding:3px 1px;overflow:hidden;overflow-wrap:anywhere}
.time-column,.hours{min-width:0}.hour-label{right:2px;font-size:8px}.timed-event{padding:2px 1px;border-left-width:2px;font-size:9px}.timed-event strong{overflow-wrap:anywhere}.timed-event small{font-size:8px;overflow:hidden}.timeline-hint{margin:4px 0;font-size:9px}
#list-view{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:white}.list-day{display:grid;grid-template-columns:42px minmax(0,1fr);border-bottom:1px solid var(--line);min-height:49px}.list-day:last-child{border-bottom:0}.list-day.is-today{background:#f0f5ec}.list-date{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border-right:1px solid var(--line);padding:4px;font-size:10px}.list-date strong{font-size:18px}.list-items{min-width:0;padding:3px}.list-event{width:100%;display:flex;align-items:center;gap:5px;text-align:left;border-left:3px solid;min-height:40px;padding:4px;margin-bottom:2px}.list-time{font-size:10px;flex:0 0 65px}.list-title{font-size:12px;min-width:0;overflow-wrap:anywhere}.list-empty{color:var(--muted);font-size:11px;width:100%;text-align:left;padding:4px 8px;min-height:42px}
.toast{bottom:calc(130px + env(safe-area-inset-bottom))}
@media(min-width:700px){.app{padding-left:12px;padding-right:12px}.day{height:100px}}

/* The viewport owns the header and toolbar; only the calendar content scrolls. */
html,body{height:100%;overflow:hidden}
.app{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:env(safe-area-inset-top) 6px 0}
.app>header{position:relative;top:auto;flex:0 0 56px}
#calendar-content{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;padding-bottom:8px}
.bottom{position:relative;left:auto;bottom:auto;transform:none;flex:0 0 auto;width:100%;padding:0 2px env(safe-area-inset-bottom)}
.bottom .view-switch button{display:flex;align-items:center;justify-content:center;flex-direction:row;text-align:center;padding:0 6px;line-height:1.3}
.ad{height:100px;min-height:100px;margin-top:8px;border:1px dashed #d9ddd2;border-radius:8px}
dialog>.ad{position:static;margin:8px 0 0}
.schedule-row{display:flex;align-items:center;gap:7px;width:100%;min-width:0;min-height:52px;padding:6px 5px;margin:0;text-align:left;border-left:8px solid var(--event-color);background:#fff;border-radius:4px}
.schedule-row+.schedule-row{margin-top:3px}
.schedule-time{flex:0 0 44px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;font-size:12px;font-variant-numeric:tabular-nums;line-height:1.25;white-space:nowrap}.schedule-time .end-time{color:var(--muted)}
.schedule-icon{flex:0 0 27px;text-align:center;font-size:23px}.schedule-content{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.schedule-content strong{font-size:13px;font-weight:600;overflow-wrap:anywhere}.schedule-location{font-size:11px;color:var(--green);overflow-wrap:anywhere}
#list-view{border:0;border-radius:0;overflow:visible;background:transparent}.list-day{grid-template-columns:36px minmax(0,1fr) 38px;gap:0;margin-bottom:6px;border:1px solid var(--line);border-radius:7px;background:white;overflow:hidden}.list-day:last-child{border-bottom:1px solid var(--line);margin-bottom:0}.list-items{padding:3px;min-width:0}.list-add{align-self:start;display:grid;place-items:center;min-height:44px;width:38px;padding:0;color:var(--green);font-size:25px}.list-day.is-today .schedule-row{background:transparent}
.toast{bottom:calc(78px + env(safe-area-inset-bottom))}
@media(min-width:700px){.app{padding-left:12px;padding-right:12px}}

.title-entry{display:flex;align-items:stretch;gap:0;margin-bottom:17px;border:1px solid #dce1d4;border-radius:11px;background:white;overflow:hidden}
.title-entry .icon-trigger{flex:0 0 56px;width:56px;min-height:50px;margin:0;padding:8px;display:flex;align-items:center;justify-content:center;border:0;border-right:1px solid #dce1d4;border-radius:0;background:transparent}
.title-entry .icon-trigger #chosen-icon{margin:0;font-size:28px;line-height:1}
.title-entry input[name=title]{flex:1;min-width:0;width:0;margin:0;border:0;border-radius:0;padding:12px;font-size:16px;background:transparent}
.title-entry:focus-within{outline:2px solid #92b09a}.title-entry input:focus{outline:none}

/* Optional icon placeholder is crisp, selectable UI text rather than a bitmap. */
.title-entry .icon-trigger #chosen-icon.icon-placeholder{display:grid;place-content:center;width:38px;height:38px;border:1px solid #a8bba9;border-radius:50%;font-size:11px;line-height:1.15;white-space:pre-line;text-align:center;color:var(--green)}
.schedule-icon:empty,.event-chip .emoji:empty{display:none}
.day.sunday,.week span:first-child,.list-day.sunday{background:#fff3f3}
.day.saturday,.week span:last-child,.list-day.saturday{background:#f1f6ff}
.day.selected{box-shadow:inset 0 0 0 2px #9ab59d}.day.sunday.selected{background:#fce9e9}.day.saturday.selected{background:#e8f0fc}
.timeline-header button:nth-child(2),.all-day-cell:nth-child(2),.time-column:nth-child(2){background-color:#fff3f3}
.timeline-header button:nth-child(8),.all-day-cell:nth-child(8),.time-column:nth-child(8){background-color:#f1f6ff}
.timeline-header button.selected{box-shadow:inset 0 0 0 2px #9ab59d}
.schedule-content{flex-direction:row;align-items:baseline;gap:14px;overflow:hidden}.schedule-content strong{font-size:16px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.schedule-location{font-size:14px;flex:0 1 45%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.timed-event{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}.timed-event strong,.timed-event small{flex-shrink:0}
.week-ad{margin-top:0;border-radius:0}
.list-day{grid-template-columns:36px minmax(0,1fr);grid-template-rows:auto 44px}.list-date{grid-row:1 / 3}.list-items{grid-column:2;grid-row:1}.list-add{grid-column:2;grid-row:2;justify-self:end;align-self:end;width:44px;margin-right:2px}.list-day .schedule-row{background:transparent}

.holiday-name{display:block;max-width:100%;font-size:9px;color:#ae6262;line-height:1.25;overflow-wrap:anywhere;margin-bottom:2px;flex-shrink:0}
.day.holiday,.day.saturday.holiday,.list-day.holiday,.list-day.saturday.holiday{background:#fff3f3}
.day.holiday.selected{background:#fce9e9}.day.holiday .number{color:#c17b79}.day.holiday.selected .number{color:white}
.timeline-header button.holiday,.all-day-cell.holiday,.time-column.holiday{background-color:#fff3f3}
.holiday-row{display:flex;align-items:center;gap:10px;padding:7px 6px;margin-bottom:3px;background:#fff3f3;border-left:3px solid #db9c9c;border-radius:4px;color:#ae6262;font-size:14px}.holiday-row>span{font-size:11px;flex:0 0 44px}.holiday-row strong{font-weight:600;overflow-wrap:anywhere}
.holiday-status{font-size:10px;color:var(--muted);padding:0 4px 5px}.holiday-status:empty{display:none}

/* Three aligned event lanes, including space for a holiday and overflow count. */
.week{font-weight:700}
.days .day{height:112px;min-height:112px;padding:0;border-right:0;align-items:stretch;box-shadow:inset -1px 0 #edece5}
.days .day.selected{box-shadow:inset 0 0 0 2px #9ab59d}
.days .day .number{align-self:flex-start;display:grid;place-items:center;font-size:11px;font-weight:700;line-height:18px;width:20px;min-width:20px;height:18px;min-height:18px;margin:2px 0 0 3px;border-radius:5px}
.days .day .holiday-name{height:14px;min-height:14px;line-height:14px;margin:0;padding:0 3px;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.month-slot{display:flex;align-items:center;gap:2px;height:20px;min-height:20px;flex:0 0 20px;margin:0 0 1px;width:100%;overflow:hidden;font-size:9px;line-height:18px;text-align:left}
.month-event .emoji{font-size:12px;flex-shrink:0}.month-event .title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.month-event.segment-start{border-top-left-radius:4px;border-bottom-left-radius:4px;padding-left:3px}.month-event.segment-end{border-top-right-radius:4px;border-bottom-right-radius:4px}.month-event.single{width:calc(100% - 4px);margin-left:2px;margin-right:2px}
.days .day .more{height:14px;min-height:14px;line-height:14px;text-align:left;padding-left:3px;font-size:8px}

/* Center the period independently of the unequal side controls. */
.app>header{display:grid;grid-template-columns:64px minmax(0,1fr) 64px;gap:2px}
.header-actions{display:contents}
#month-picker-button{grid-column:2;grid-row:1;justify-self:center;justify-content:center;font-size:clamp(20px,6vw,25px);padding:0;gap:0}
#month-title small{font-size:13px;margin:0 2px}
#today{grid-column:1;grid-row:1;justify-self:start;padding:0 8px}
#settings{grid-column:3;grid-row:1;justify-self:end}
/* Keep lanes aligned within each week without reserving an empty holiday line. */
.days .day{height:100px;min-height:100px;box-shadow:inset -1px 0 var(--line)}
.days .day .number{margin-top:2px;margin-bottom:2px}
.days .day .holiday-name{display:none}
.days .day.selected,.timeline-header button.selected{box-shadow:inset 0 0 0 2px var(--green)}
:root{--surface:#fff}
.calendar,.round,#today,.schedule-row,.list-day,.event-row,.connection-state,.code,.title-entry,.icon-trigger,.secondary,.categories button,.icon-picker button,input:not([type=checkbox]),textarea,select{background-color:var(--surface);border-color:var(--line)}
/* Preserve each event color after the shared theme border colors. */
.schedule-row{border-left-color:var(--event-color,var(--green))}
.week,.bottom,.timeline-header,.hours{background-color:var(--paper)}
.view-switch,.notice,.member,.ad,dialog>.ad{background-color:var(--soft)}
.bottom{background:var(--paper)}
.view-switch button[aria-pressed=true]{background:var(--surface)}
.day.outside{background:var(--paper)}
.day.selected,.list-day.is-today{background-color:var(--soft)}
/* Weekend and holiday colors retain their meaning in every theme. */
.day.sunday,.day.holiday,.day.saturday.holiday{background-color:#fff3f3}
.day.saturday{background-color:#f1f6ff}
.theme-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 18px}
.theme-tile{display:flex;flex-direction:column;justify-content:flex-start;gap:6px;min-width:0;padding:6px;border:2px solid var(--line);border-radius:14px;text-align:left;background:var(--surface);transition:border-color .16s ease,transform .12s ease,box-shadow .16s ease}
.theme-tile:active{transform:scale(.98)}
.theme-tile[aria-pressed=true]{border-color:var(--green);box-shadow:0 4px 14px var(--shadow)}
.theme-preview{display:block;padding:8px;border-radius:9px;background:var(--preview-paper);color:var(--preview-ink);pointer-events:none;border:1px solid var(--preview-line);overflow:hidden}
.preview-strip{display:block;height:3px;border-radius:999px;margin:-2px 0 6px;background:var(--preview-strip,var(--preview-accent))}
.preview-heading{display:block;text-align:center;font-size:10px;font-weight:750;margin-bottom:5px;color:var(--preview-ink)}
.preview-week{display:block;text-align:center;font-size:7px;word-spacing:3px;padding-bottom:3px;color:var(--preview-accent);font-weight:700}
.preview-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));background:var(--preview-surface);border-top:1px solid var(--preview-line);border-left:1px solid var(--preview-line);border-radius:4px;overflow:hidden}
.preview-grid>span{height:21px;border-right:1px solid var(--preview-line);border-bottom:1px solid var(--preview-line);font-size:7px;padding:1px 2px;color:var(--preview-ink)}
.preview-grid i{display:block;height:4px;border-radius:2px;margin-top:2px;background:var(--preview-accent)}
.preview-grid i.b1{background:var(--bar-1,var(--preview-accent))}
.preview-grid i.b2{background:var(--bar-2,var(--preview-accent))}
.preview-grid i.b3{background:var(--bar-3,var(--preview-accent))}
.preview-toolbar{display:flex;align-items:center;justify-content:space-between;margin-top:6px}
.preview-toolbar i{width:56%;height:11px;background:var(--preview-soft);border-radius:999px}
.preview-toolbar b{border-radius:50%;background:var(--preview-fab,var(--preview-accent));color:var(--preview-fab-ink,#fff);width:17px;height:17px;display:grid;place-items:center;font-size:13px;line-height:1}
.theme-title{display:flex;align-items:center;justify-content:center;min-height:1.4em;padding:0 2px;font-size:12px;line-height:1.4;font-weight:700;text-align:center;overflow-wrap:anywhere}
.theme-footer{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-top:auto;padding:1px 2px;min-width:0}
.theme-tag{flex:none;margin-left:auto;white-space:nowrap;font-style:normal;font-size:9px;font-weight:650;padding:2px 6px;border-radius:999px;background:var(--soft);color:var(--green)}
.theme-check{display:block;min-height:13px;padding:1px 2px 0;font-size:9px;font-weight:700;color:var(--green)}

/* Weekday boundaries align with date columns; weekend color fills the full cell. */
.week{padding:0;align-items:stretch}
.week>span{display:grid;place-items:center;min-height:29px;padding:7px 0;border-right:1px solid var(--line)}
.week>span:last-child{border-right:0}
/* Keep the period centered with Today immediately before the menu on the right. */
.app>header{grid-template-columns:88px minmax(0,1fr) 88px}
#month-picker-button{font-size:clamp(18px,5vw,23px)}
.header-actions{display:flex;grid-column:3;grid-row:1;justify-content:flex-end;gap:4px}
#today{padding:0 5px;min-width:40px;font-size:12px}
#settings{flex:0 0 44px}
.agenda-date{display:flex;align-items:baseline;gap:8px;flex:1;min-width:0;flex-wrap:wrap}
.agenda-date h2{flex:none}
.selected-holiday{font-size:13px;font-weight:600;color:#ae6262;overflow-wrap:anywhere}
.selected-holiday:empty{display:none}
.agenda-heading{gap:8px;align-items:baseline}
#event-count{flex:none;white-space:nowrap}

/* Week dates, holidays and spanning events stay outside the time scroller. */
#calendar-content:has(#timeline-view:not([hidden])){display:flex;flex-direction:column;overflow:hidden}
#calendar-content:has(#timeline-view:not([hidden]))>.calendar-head{flex:none}
#timeline-view:not([hidden]){display:flex;flex-direction:column;flex:1;min-height:0}
#timeline-view .timeline-scroll{flex:1;min-height:70px;max-height:none;border-radius:0 0 8px 8px;scrollbar-width:none}
#timeline-view .timeline-scroll::-webkit-scrollbar{display:none}
#calendar-content:has(#timeline-view:not([hidden]))>.agenda{flex:0 1 auto;max-height:20dvh;min-height:0;overflow:auto;width:100%;padding:8px 2px}
.week-fixed{flex:0 1 auto;min-height:44px;max-height:45%;overflow-y:auto;scrollbar-width:none;background:var(--surface);border:1px solid var(--line);border-bottom:0;border-radius:8px 8px 0 0}
.week-fixed .timeline-header{position:static}
.week-holidays,.week-band-row{display:grid;grid-template-columns:30px repeat(7,minmax(0,1fr));border-bottom:1px solid var(--line)}
.week-holidays .all-day-cell{min-height:0;padding:3px 1px;border-left:1px solid var(--line)}
.week-holidays .holiday-name{margin:0;font-size:8px;line-height:1.3}
.week-band-row .time-label{padding:3px 0}
.week-band-cell{min-width:0;box-shadow:inset 1px 0 var(--line);padding:2px 0 0}
.week-band-cell:nth-child(2){background:#fff3f3}.week-band-cell:nth-child(8){background:#f1f6ff}.week-band-cell.holiday{background:#fff3f3}
.week-band-slot{display:flex;flex-direction:column;justify-content:center;align-items:stretch;width:100%;height:32px;min-height:32px;margin:0 0 2px;padding:0;border-radius:0;overflow:hidden;text-align:left;font-size:9px;line-height:1.25}
.week-band-slot.segment-start{border-top-left-radius:4px;border-bottom-left-radius:4px;padding-left:2px}
.week-band-slot.segment-end{border-top-right-radius:4px;border-bottom-right-radius:4px}
.band-title,.week-band-slot small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.week-band-slot small{font-size:7px}
.week-band-more{display:block;width:100%;height:24px;min-height:24px;font-size:9px;padding:0 2px;text-align:left;color:var(--green)}

/* Every list day reserves the same compact holiday line, including ordinary days. */
.list-holiday{height:16px;min-height:16px;line-height:16px;padding:0 4px;margin:0 0 2px;color:#ae6262;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* All-day bands share the month view's 20px lane height. */
.all-day-bands .week-band-slot{height:20px;min-height:20px;margin-bottom:1px;line-height:18px}
/* Add lives in the compact holiday strip, so no extra bottom row is reserved. */
.list-day{grid-template-rows:auto}
.list-date{grid-row:1}
.list-holiday{display:flex;align-items:center;justify-content:space-between;gap:4px;overflow:visible}
.list-holiday-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-holiday .list-add{display:grid;place-items:center;flex:0 0 28px;width:28px;height:16px;min-height:16px;margin:0;padding:0;font-size:10px;line-height:16px;align-self:center}

.list-holiday{border-bottom:1px solid #d9dcdf}
.schedule-edit{display:flex;align-items:center;gap:7px;flex:1;min-width:0;padding:0;text-align:left;min-height:40px}
.schedule-row>.schedule-location{flex:0 1 42%;min-width:0;min-height:40px;padding:0 3px;text-align:left;text-decoration:underline;text-underline-offset:3px}
.menu-items{display:flex;flex-direction:column;gap:8px}
.menu-items>button{display:flex;align-items:center;justify-content:space-between;text-align:left;padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:16px}
.menu-items small{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.menu-back{font-size:28px;min-width:44px;padding:0}
#sharing .dialog-header h2,#theme-dialog .dialog-header h2{flex:1;margin-left:6px}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.detail-title{display:flex;align-items:center;gap:8px;font-size:19px;margin:0 0 18px;overflow-wrap:anywhere}
.detail-fields{display:grid;grid-template-columns:65px minmax(0,1fr);gap:14px 10px;margin:0 0 20px;font-size:14px;line-height:1.6}
.detail-fields dt{color:var(--muted);font-size:12px}.detail-fields dd{margin:0;min-width:0;overflow-wrap:anywhere}
.detail-note{white-space:pre-wrap}.detail-repeat{display:block;font-size:12px;color:var(--muted)}
.detail-location{padding:0;text-align:left;color:var(--green);text-decoration:underline;overflow-wrap:anywhere;max-width:100%}
.detail-color{display:inline-block;width:14px;height:14px;border-radius:50%;vertical-align:middle;margin-right:6px}

/* Account and calendar controls keep server settings out of the user flow. */
.calendar-choice{display:flex;gap:8px;align-items:center;margin:8px 0}.calendar-choice label{flex:1;min-width:0;margin:0;overflow-wrap:anywhere}.calendar-choice input{width:20px;height:20px;vertical-align:middle}.calendar-choice button{width:auto;min-height:36px;margin:0;padding:5px 9px;font-size:11px}
#connection form{margin-bottom:18px}#connection select,#calendar-settings-content select,#event-calendar{width:100%;min-height:40px;margin-top:6px;padding:6px;border:1px solid var(--line);border-radius:8px;font:inherit}
.member-setting{padding:8px 0;border-bottom:1px solid var(--line)}.member-setting span{display:block;overflow-wrap:anywhere}.member-setting .danger{margin:0}.calendar-label{display:block;font-size:9px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.schedule-content:has(.calendar-label){flex-direction:column;gap:2px;align-items:stretch}

.save-status:not(:empty){position:sticky;top:0;z-index:4;background:var(--soft);color:var(--ink);padding:12px;border-radius:10px;margin-bottom:12px;font-size:14px;font-weight:650}

/* Direct calendar visibility controls in the unused left header slot. */
#calendar-visibility-button{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:6px;border-radius:12px;background:var(--soft);color:var(--ink);font-size:13px}
#calendar-visibility-button svg{flex-shrink:0}
#calendar-visibility{width:min(440px,calc(100vw - 24px))}
#visibility-options{display:grid;gap:8px}
.visibility-choice{display:flex;align-items:center;gap:12px;min-height:56px;padding:12px;border:1px solid var(--line);border-radius:12px;cursor:pointer;background:var(--paper)}
.visibility-choice>span:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
.visibility-choice input{appearance:none;flex:0 0 44px;width:44px;height:26px;margin:0;padding:2px;border:0;border-radius:20px;background:#8b8b8b;cursor:pointer}
.visibility-choice input:before{content:"";display:block;width:22px;height:22px;border-radius:50%;background:white;transition:transform .15s}
.visibility-choice input:checked{background:var(--green)}
.visibility-choice input:checked:before{transform:translateX(18px)}
.visibility-choice input:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
.visibility-choice input:disabled{opacity:.5;cursor:wait}
.visibility-state{width:30px;font-size:12px;font-weight:700;color:var(--muted)}

/* First-use choice: one screen, no additional registration form. */
#welcome{width:min(440px,calc(100vw - 24px))}
.welcome-body{text-align:center;padding:28px 24px}
.welcome-icon{display:block;color:var(--green);font-size:48px;line-height:1.2}
.welcome-body h2{font-size:22px;line-height:1.5;margin:14px 0}
.welcome-body>p{line-height:1.8}
.welcome-actions{display:grid;gap:10px;margin:20px 0}
.welcome-actions button{margin:0;min-height:48px;width:100%}
#welcome-guest{margin-top:10px}
.account-notice{margin:8px 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--soft);font-size:13px}
.account-notice p{margin:0 0 8px;line-height:1.6}
.account-notice .secondary{margin:0;width:auto;min-height:44px}

/* Whole-screen visual polish and complete theme token coverage (light, cute, cool, dark, colorful). */
:root{color-scheme:var(--scheme,light);background:var(--outer-bg,#eeeae2);--outer-bg:#eeeae2;--app-bg:var(--paper);--header-bg:transparent;--bottom-bg:var(--paper);--surface-elevated:#fffefa;--accent-2:var(--green);--fab-bg:var(--green);--fab-ink:#ffffff;--sunday-bg:#fff3f3;--sunday-selected:#fce9e9;--sunday-ink:#c15f5d;--saturday-bg:#f1f6ff;--saturday-selected:#e8f0fc;--saturday-ink:#4d77a3;--holiday-border:#db9c9c;--danger-ink:#b94a48;--grid-half:#f5f4ee;--grid-hour:#e4e6dc;--switch-off:#cfd6cb;--toast-bg:#3e5146;--toast-ink:#ffffff;--backdrop:rgba(30,40,35,0.45);--shadow:rgba(34,48,38,0.08);--header-strip:transparent}
body{color:var(--ink)}
.app{position:relative;background:var(--app-bg,var(--paper));box-shadow:0 0 60px var(--shadow)}
.app>header{background:var(--header-bg,transparent);position:relative;padding-top:3px}
.app>header::before,.dialog-header::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--header-strip,transparent);pointer-events:none}
#month-picker-button{color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:.02em}
#calendar-visibility-button{border:1px solid var(--line);transition:transform .12s ease,background-color .16s ease}
.round,#today{transition:transform .12s ease,background-color .16s ease,border-color .16s ease;box-shadow:0 1px 4px var(--shadow)}
.round:active,#today:active,#calendar-visibility-button:active,.bottom .add:active,.primary:active,.secondary:active{transform:scale(.97)}
.calendar{border-radius:14px;box-shadow:0 3px 16px var(--shadow)}
.week{background:var(--surface-elevated,var(--paper));border-bottom:1px solid var(--line)}
.week>span:first-child{background:var(--sunday-bg);color:var(--sunday-ink)}
.week>span:last-child{background:var(--saturday-bg);color:var(--saturday-ink)}
.days .day{transition:background-color .14s ease}
.day.outside{background:var(--app-bg,var(--paper));color:var(--muted);opacity:.78}
.day.sunday,.day.holiday,.day.saturday.holiday,.list-day.sunday,.list-day.holiday,.list-day.saturday.holiday{background-color:var(--sunday-bg)}
.day.saturday,.list-day.saturday{background-color:var(--saturday-bg)}
.day.selected,.list-day.is-today{background-color:var(--soft)}
.day.sunday.selected,.day.holiday.selected{background-color:var(--sunday-selected)}
.day.saturday.selected{background-color:var(--saturday-selected)}
.day.sunday .number,.day.holiday .number{color:var(--sunday-ink)}
.day.saturday .number{color:var(--saturday-ink)}
.day.today .number{border:1.5px solid var(--green);background:var(--soft);color:var(--green)}
.day.selected .number,.day.holiday.selected .number{background:var(--green);color:var(--fab-ink);border:none}
.month-event,.week-band-slot,.timed-event{color:var(--ink)}
.month-event.single,.month-event.segment-start{border-radius:4px}
.month-event.segment-start:not(.segment-end){border-top-right-radius:0;border-bottom-right-radius:0}
.month-event.segment-end:not(.segment-start){border-top-left-radius:0;border-bottom-left-radius:0}
.selected-holiday{color:var(--sunday-ink)}
#event-count{background:var(--soft);color:var(--green);font-weight:700;padding:3px 9px;border-radius:999px;font-size:11px}
.schedule-row{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--event-color,var(--green));border-radius:10px;padding:8px;box-shadow:0 1px 4px var(--shadow)}
.schedule-row+.schedule-row{margin-top:6px}
.holiday-row{background:var(--sunday-bg);border-left:4px solid var(--holiday-border);color:var(--sunday-ink);border-radius:8px}
#list-view .list-day{border-radius:12px;box-shadow:0 1px 6px var(--shadow)}
.list-day.is-today{border-color:var(--green)}
.list-day .schedule-row{background:transparent;border:0;border-left:3px solid var(--event-color,var(--green));border-radius:4px;box-shadow:none;padding:6px 5px}
.list-holiday{color:var(--sunday-ink);border-bottom-color:var(--line)}
.week-fixed{border-radius:12px 12px 0 0;box-shadow:0 1px 8px var(--shadow)}
#timeline-view .timeline-scroll{border-radius:0 0 12px 12px;background:var(--surface);border-color:var(--line);box-shadow:0 3px 14px var(--shadow)}
.timeline-header{background:var(--surface-elevated,var(--paper));border-bottom-color:var(--line)}
.timeline-header button:nth-child(2),.all-day-cell:nth-child(2),.time-column:nth-child(2),.week-band-cell:nth-child(2),
.timeline-header button.holiday,.all-day-cell.holiday,.time-column.holiday,.week-band-cell.holiday{background-color:var(--sunday-bg)}
.timeline-header button:nth-child(8),.all-day-cell:nth-child(8),.time-column:nth-child(8),.week-band-cell:nth-child(8){background-color:var(--saturday-bg)}
.timeline-header button.selected{background:var(--soft);color:var(--green)}
.hours{background-color:var(--surface-elevated,var(--paper))}
.time-column{border-left-color:var(--line);background:repeating-linear-gradient(to bottom,transparent 0px,transparent 29px,var(--grid-half) 29px,var(--grid-half) 30px,transparent 30px,transparent 59px,var(--grid-hour) 59px,var(--grid-hour) 60px)}
.holiday-name{color:var(--sunday-ink)}
.bottom{background:var(--bottom-bg,var(--paper));backdrop-filter:blur(14px);border-top-color:var(--line)}
.view-switch{background:var(--soft)}
.view-switch button[aria-pressed=true]{background:var(--surface);color:var(--green);box-shadow:0 2px 8px var(--shadow)}
.bottom .add{background:var(--fab-bg,var(--green));color:var(--fab-ink,#fff);box-shadow:0 6px 18px var(--shadow)}
dialog{background:var(--paper);color:var(--ink);box-shadow:0 22px 90px var(--shadow);border:1px solid var(--line)}
dialog::backdrop{background:var(--backdrop);backdrop-filter:blur(4px)}
.dialog-header{background:var(--paper);border-bottom-color:var(--line);overflow:hidden}
.menu-items>button,.visibility-choice{border-radius:12px;box-shadow:0 1px 4px var(--shadow)}
.visibility-choice{background:var(--surface)}
.visibility-choice input{background:var(--switch-off)}
.visibility-choice input:checked{background:var(--green)}
.primary{background:var(--fab-bg,var(--green));color:var(--fab-ink,#fff);box-shadow:0 4px 12px var(--shadow)}
.secondary{background:var(--surface);color:var(--green);border-color:var(--line)}
.danger,.error,.status.failed{color:var(--danger-ink)}
.title-entry{background:var(--surface);border-color:var(--line)}
.title-entry .icon-trigger{border-right-color:var(--line)}
.title-entry .icon-trigger #chosen-icon.icon-placeholder{border-color:var(--line);color:var(--green)}
.title-entry:focus-within,input:focus,textarea:focus,select:focus{outline:2px solid var(--green)}
button:focus-visible,a:focus-visible{outline:3px solid var(--accent-2,var(--green));outline-offset:2px}
.switch{background:var(--switch-off)}
.categories button.selected{background:var(--green);color:var(--fab-ink,#fff);border-color:var(--green)}
.icon-picker button.selected{border:2px solid var(--green);background:var(--soft)}
.illustration-slot{border-color:var(--line);background:var(--soft)}
.slot-previews span{border-color:var(--line);color:var(--muted)}
.ad,dialog>.ad{background:var(--soft);border:1px dashed var(--line);color:var(--muted)}
.ad-tag{border-color:var(--line)}
.toast{background:var(--toast-bg);color:var(--toast-ink);box-shadow:0 8px 24px var(--shadow)}

/* Keep event colors visible and holiday colors ahead of Saturday styling. */
.schedule-row,.list-day .schedule-row{border-left-width:8px}
.day.saturday.holiday.selected{background-color:var(--sunday-selected)}
.day.saturday.holiday .number{color:var(--sunday-ink)}
.day.saturday.holiday.selected .number{color:var(--fab-ink)}
.timeline-header button.holiday,.all-day-cell.holiday,.time-column.holiday,.week-band-cell.holiday{background-color:var(--sunday-bg)}
.theme-label{flex-wrap:wrap}
.theme-label strong{overflow:visible;white-space:normal;overflow-wrap:anywhere}

/* Hand-drawn cute & cool SVG event illustrations across all views and picker sizes. */
.pocket-icon{display:inline-block;vertical-align:middle;flex-shrink:0;width:1em;height:1em;filter:drop-shadow(0 1px 1px var(--shadow))}
.pocket-icon.picker-svg{width:32px;height:32px}
.pocket-icon.icon-chosen{width:34px;height:34px}
.pocket-icon.icon-md{width:26px;height:26px}
.pocket-icon.icon-sm{width:14px;height:14px}
.pocket-icon.icon-xs{width:13px;height:13px;vertical-align:-2px;margin-right:2px}
.title-entry .icon-trigger #chosen-icon{display:grid;place-items:center}
.schedule-icon{flex:0 0 28px;display:grid;place-items:center}
.detail-title{display:flex;align-items:center;gap:8px}
.detail-icon{display:inline-grid;place-items:center;flex-shrink:0}
.detail-icon:empty{display:none}
.month-event .emoji{display:inline-grid;place-items:center;flex-shrink:0}
.band-title{display:inline-flex;align-items:center;gap:2px;max-width:100%}
.timed-event strong{display:flex;align-items:center;gap:2px;flex-wrap:wrap}
.icon-picker{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
@media(min-width:440px){.icon-picker{grid-template-columns:repeat(5,minmax(0,1fr))}}
.icon-picker button{background:var(--surface);border-color:var(--line);padding:8px 4px;gap:5px;transition:transform .12s ease,border-color .14s ease}
.icon-picker button:active{transform:scale(.96)}
.icon-picker small{font-size:10px;line-height:1.25;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.categories{padding-bottom:4px;scrollbar-width:thin}
.categories button{background:var(--surface);border-color:var(--line);color:var(--ink)}

/* Match the event editor's frame while keeping selector heights stable. */
:is(#icons-dialog,#icon-search-dialog,#calendar-visibility,#menu-dialog){
  position:fixed;
  inset:0;
  margin:auto;
  width:calc(100% - 24px);
  max-width:520px;
  height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);
  max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);
  border-radius:26px;
  overflow:hidden;
}
:is(#icons-dialog,#icon-search-dialog,#calendar-visibility,#menu-dialog)[open]{display:flex;flex-direction:column}
:is(#icons-dialog,#icon-search-dialog,#calendar-visibility,#menu-dialog)>.dialog-header{position:relative;flex:0 0 auto}
:is(#icons-dialog,#icon-search-dialog,#calendar-visibility,#menu-dialog)>.form-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
:is(#icons-dialog,#icon-search-dialog,#calendar-visibility,#menu-dialog)>.ad{flex:0 0 54px;margin:0}

/* Fast actions retain independent targets; selector ads stay outside scrolling content. */
.schedule-with-actions{display:flex;align-items:center;gap:2px;min-width:0}
.schedule-with-actions>.schedule-row{flex:1;min-width:0}
.event-actions,.detail-actions{display:flex;align-items:center;gap:6px;flex:none;justify-content:flex-end}
.event-action{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--green);line-height:1}
.event-action svg{display:block;flex:0 0 20px;width:20px;height:20px}
.detail-actions>.event-action{flex:1 1 0;min-width:0;width:auto;height:48px;gap:8px;font-size:14px;font-weight:650;white-space:nowrap}
.event-action[hidden]{display:none}
.event-action.danger{color:var(--danger-ink)}
.detail-actions{margin-top:16px;padding:12px 0 0;border-top:1px solid var(--line);background:transparent}
/* A definite height prevents WebKit from collapsing the flexing details body. */
#event-detail{height:min(760px,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px))}
#event-detail[open]{display:flex;flex-direction:column;overflow:hidden}
#event-detail>.form-body{min-height:0;overflow-y:auto;flex:1 1 auto;overscroll-behavior:contain;background:var(--paper)}
#event-detail>.dialog-header,#event-detail>.ad{flex-shrink:0}
:is(#calendar-visibility,#menu-dialog)>.ad{flex:0 0 70px;height:70px;min-height:70px;margin:0}
.list-month>h2{font-size:17px;margin:12px 4px;color:var(--ink)}
.month-boundary-ad{margin:16px 0;min-height:100px}
#calendar-content:has(#list-view:not([hidden])){overflow-anchor:none}

/* Every date has one full-width blank entry row below its events. */
.list-add-row{display:flex;align-items:center;justify-content:flex-end;width:100%;min-height:44px;padding:4px 12px;margin:0;border:0;border-radius:0;background:transparent;color:var(--green);font-size:24px;text-align:right}
.list-add-row:active{background:var(--soft)}

/* The month agenda card encloses its content and both action buttons. */
#event-list>.schedule-with-actions{padding:6px;gap:4px;border:1px solid var(--line);border-left:8px solid var(--event-color,var(--green));border-radius:10px;background:var(--surface);box-shadow:0 1px 4px var(--shadow)}
#event-list>.schedule-with-actions+.schedule-with-actions{margin-top:6px}
#event-list>.schedule-with-actions>.schedule-row{border:0;border-radius:0;padding:2px;box-shadow:none;background:transparent}

/* Compact separators keep each event and the add row part of the daily list. */
.list-items>.schedule-with-actions+.schedule-with-actions{border-top:1px solid var(--line);margin-top:2px;padding-top:2px}
.list-items>.schedule-with-actions+.list-add-row{border-top:1px solid var(--line);margin-top:2px}
.list-holiday{border-bottom-color:var(--line)}

/* Compact row controls reserve more width for the event title. */
.schedule-with-actions .event-action,.detail-place .map-action{flex:0 0 34px;width:34px;height:34px;min-height:34px;padding:6px;border-radius:9px}
.schedule-with-actions .event-action svg,.detail-place .map-action svg{flex:0 0 18px;width:18px;height:18px}
.schedule-with-actions .event-actions{gap:4px}
.detail-place{display:flex;align-items:center;gap:8px;min-width:0}
.detail-place>span{flex:1;min-width:0;overflow-wrap:anywhere}
/* Keep tiny week icons on the first line without compositing filters. */
.timed-event{min-height:20px}
.timed-event strong{flex-wrap:nowrap;align-items:flex-start;min-height:13px}
.timed-title{min-width:0;overflow-wrap:anywhere}
.timed-event .pocket-icon.icon-xs,.band-title .pocket-icon.icon-xs{display:block;flex:0 0 13px;width:13px;height:13px;min-width:13px}


#timeline-view .pocket-icon{filter:none;object-fit:contain;vertical-align:top}

/* Smooth interactive horizontal swipe stages for month and week views. */
.calendar,#timeline-view{position:relative;overflow:hidden;touch-action:pan-y pinch-zoom}
.days,.week-slide-body{backface-visibility:hidden;will-change:transform}
.swipe-peek{position:absolute;left:0;right:0;width:100%;z-index:2;pointer-events:none;background:var(--surface)}
#timeline-view .swipe-peek{background:var(--app-bg,var(--paper))}
@media(prefers-reduced-motion:reduce){.days,.week-slide-body,.swipe-peek{transition:none!important}}

/* Bound the time scroller inside both the live and preview week panes. */
.week-slide-body{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;overflow:hidden}
.week-slide-body>.timeline-hint{flex:none}

/* Identical control height for destination, reminder and repeat. */
#event-form :is(#event-calendar,#reminder,#repeat),#connection #default-calendar{display:block;width:100%;height:48px;min-height:48px;margin-top:8px;padding:10px 13px;border:1px solid var(--line);border-radius:11px;font:inherit;font-size:16px;background:var(--surface);color:var(--ink)}
.week-holidays>.time-label,.week-holidays>.all-day-cell{height:20px;min-height:20px;padding:2px 1px;line-height:16px;overflow:hidden}
.week-holidays .holiday-name{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:16px;font-size:8px;margin:0}
#days,#timeline-view{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}

.scope-options{display:grid;gap:10px}.scope-options button{min-height:48px}

.icon-picker-toolbar{display:flex;align-items:center;gap:8px}.icon-picker-toolbar>#open-icon-search{display:flex;align-items:center;justify-content:center;flex:0 0 44px;height:44px;margin:0;padding:0}.icon-picker-toolbar>#clear-icon{flex:1;min-width:0;min-height:44px;margin:0;padding:0 8px;white-space:nowrap}.icon-search-field{display:flex;align-items:center;gap:6px;flex:1;min-width:0;height:44px;margin:0;padding:0 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--muted)}.icon-search-field:focus-within{outline:2px solid var(--accent);outline-offset:2px}.icon-search-field>svg{flex:none}.icon-search-field>#icon-search{flex:1;min-width:0;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--ink);font-size:16px;box-shadow:none}.icon-search-field>#icon-search:focus{outline:none}.icon-search-empty{grid-column:1/-1;font-size:13px;color:var(--muted)}
/* Shared profile and permission controls use the current theme. */
.profile-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 36px;width:36px;height:36px;border-radius:50%;overflow:hidden;background:var(--soft);font-size:24px;line-height:1;border:1px solid var(--line)}
.profile-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.member-name{display:flex;align-items:center;gap:9px;background:transparent;color:var(--ink);text-align:left;font:inherit;min-height:44px;overflow-wrap:anywhere}
.member-setting{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:12px 0;border-bottom:1px solid var(--line)}
.permission-row{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;font-size:13px}
.permission-row label,.public-field{display:flex;align-items:center;gap:5px;margin:0;min-height:38px;white-space:nowrap}
.permission-row input,.public-field input{width:18px;height:18px;accent-color:var(--accent)}
.public-field{margin-bottom:18px;font-size:12px}
#profile-editor[open],#member-profile[open]{display:flex;flex-direction:column;max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)}
#introduction-form{display:flex;flex-direction:column;min-height:0;overflow:hidden}
#introduction-form>.form-body,#member-profile>.form-body{overflow-y:auto;min-height:0;overscroll-behavior:contain}
#profile-editor .dialog-header,#member-profile .dialog-header,#profile-editor>.ad,#member-profile>.ad{flex-shrink:0}
#profile-editor textarea,#profile-editor input:not([type=checkbox]){background:var(--surface);border-color:var(--line);color:var(--ink)}
.event-audit{padding:12px 0;border-top:1px solid var(--line)}
.audit-row{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;overflow-wrap:anywhere}
.audit-row small{display:block;color:var(--muted);font-size:11px;margin-top:3px}

/* Profile editing and transient feedback */
.profile-summary{display:flex;align-items:center;gap:10px;margin:10px 0 20px}.profile-summary strong{flex:1;overflow-wrap:anywhere}
.profile-edit-button{flex:0 0 40px;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;min-height:40px;border:1px solid var(--line);border-radius:10px;color:var(--green);background:var(--surface,#fff)}
.birthday-fields{border:0;padding:0;margin:16px 0}.birthday-fields legend{font-weight:650;font-size:12px;margin-bottom:8px}.birthday-fields label{margin-bottom:0}
#profile-editor select{display:block;width:100%;min-height:48px;margin-top:8px;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface,#fff);color:var(--ink);font:inherit;font-size:16px}
#toast{position:fixed;inset:auto;top:calc(env(safe-area-inset-top) + 20px);bottom:auto;left:50%;transform:translateX(-50%);margin:0;border:0;max-width:min(90vw,480px);width:max-content;pointer-events:none;z-index:10000;border-radius:14px}
#toast::backdrop{background:transparent;pointer-events:none}

/* Weekend and holiday labels retain their colors even on the selected date. */
.timeline-header button.saturday span,.timeline-header button.saturday strong,.list-day.saturday>.list-date{color:var(--saturday-ink)}
.timeline-header button.sunday span,.timeline-header button.sunday strong,.timeline-header button.holiday span,.timeline-header button.holiday strong,.list-day.sunday>.list-date,.list-day.holiday>.list-date{color:var(--sunday-ink)}
:is(#theme-dialog,#sharing,#calendar-settings,#profile-editor,#avatar-crop,#profile-image-dialog){position:fixed;inset:0;margin:auto;width:calc(100% - 24px);max-width:520px;height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);overflow:hidden;border-radius:26px}
:is(#theme-dialog,#sharing,#calendar-settings,#profile-editor,#avatar-crop,#profile-image-dialog)[open]{display:flex;flex-direction:column}
:is(#theme-dialog,#sharing,#calendar-settings,#avatar-crop,#profile-image-dialog)>.dialog-header{position:relative;flex:0 0 auto}
:is(#theme-dialog,#sharing,#calendar-settings,#avatar-crop,#profile-image-dialog)>.form-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
:is(#theme-dialog,#sharing,#calendar-settings,#profile-editor)>.ad{flex:0 0 70px;height:70px;min-height:70px;margin:0}
#introduction-form{flex:1}#introduction-form>.form-body{flex:1}
.avatar-presets{display:grid;grid-auto-flow:column;grid-auto-columns:72px;gap:8px;margin:12px 0;padding:2px 2px 10px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity}
.avatar-presets button{scroll-snap-align:start}
.avatar-presets button{padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface);min-width:0}
.avatar-presets img{display:block;width:100%;aspect-ratio:1;border-radius:50%}.avatar-presets span{display:block;font-size:10px;overflow-wrap:anywhere}
.avatar-crop-stage{margin:20px auto;width:min(100%,320px);aspect-ratio:1;border-radius:50%;overflow:hidden;border:3px solid var(--green);background:var(--surface)}
#avatar-canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}#avatar-canvas:active{cursor:grabbing}
#avatar-zoom{width:100%;padding:0;accent-color:var(--green)}

/* Keep picker controls visible; only the illustration grid scrolls. */
#icons-dialog>.form-body{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
#icons-dialog .icon-picker-toolbar,#icons-dialog #categories{flex:0 0 auto}
#icon-picker-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#icon-picker{align-content:start;padding-bottom:16px}
.profile-image-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-items:stretch;margin:16px 0}
.profile-image-actions>.secondary{margin:0;padding:8px 4px;font-size:12px;min-width:0}
#profile-image-preview{text-align:center}
#profile-image-preview .profile-avatar{width:96px;height:96px;font-size:48px}
.avatar-none{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:12px;padding:8px 12px;background:var(--surface)}
#profile-image-dialog>.ad{flex:0 0 70px;margin:0}

/* Category panes follow the finger while toolbar and genre tabs stay fixed. */
#icon-picker-scroll{position:relative;overflow-x:hidden}
#icon-picker-scroll[data-sliding]{overflow-y:hidden}
.icon-slide-peek{position:absolute;left:0;width:100%;margin:0;pointer-events:none;background:var(--paper);align-content:start;will-change:transform}
#icon-picker-scroll[data-sliding] #icon-picker{will-change:transform}
.menu-rokuyo{margin:12px 0 0;padding:12px 0;border-top:1px solid var(--line);font-size:14px}
.rokuyo{color:var(--muted);font-size:11px;font-weight:400;white-space:nowrap;line-height:1.3}
.rokuyo:empty{display:none}
.month-rokuyo{position:absolute;top:4px;right:3px;font-size:9px;pointer-events:none}
.timeline-header .week-date-label{display:block;font-size:13px;white-space:nowrap;line-height:1.4}
.timeline-header .week-date-label>span{display:inline;font-size:10px}
.timeline-header button .week-rokuyo{display:block;font-size:10px;color:var(--muted)!important;line-height:1.4}
.list-holiday>.rokuyo{margin-left:auto;flex:none;font-size:10px}
@media(max-width:360px){.timeline-header .week-date-label{font-size:11px}.timeline-header .week-date-label>span{font-size:9px}.month-rokuyo{font-size:8px;right:2px}}

.calendar-management-name{flex:1;min-width:0;overflow-wrap:anywhere}
