/* Presentation hierarchy: content sheets, action sheets, and focused alerts. */
dialog{letter-spacing:-.02em}
dialog::backdrop{background:rgba(0,0,0,.25);-webkit-backdrop-filter:none;backdrop-filter:none}
dialog.sheet{padding:0;width:min(600px,calc(100% - 48px));height:min(780px,86dvh);max-height:86dvh;border-radius:28px;background:var(--canvas);border:1px solid var(--edge);box-shadow:0 24px 90px #0003;-webkit-backdrop-filter:none;backdrop-filter:none;overflow:hidden}
dialog.sheet[open]{display:flex;flex-direction:column}
.sheet-grabber{display:none;flex-shrink:0}
.sheet-grabber{touch-action:none}
.sheet-nav{position:relative;flex-shrink:0;margin:0;min-height:68px;padding:12px 20px;display:grid;grid-template-columns:64px minmax(0,1fr) 64px;gap:6px;background:var(--glass);-webkit-backdrop-filter:blur(24px) saturate(150%);backdrop-filter:blur(24px) saturate(150%);border-bottom:1px solid var(--line);z-index:2}
.sheet-nav h2{grid-column:2;font-size:17px;line-height:1.35;font-weight:650;text-align:center;letter-spacing:-.025em;overflow-wrap:anywhere}
.sheet-nav>button{grid-column:3;width:64px;min-height:44px;height:44px;border-radius:50px;background:var(--wash);color:var(--accent);font-size:15px;font-weight:650;padding:0 8px}
.sheet-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:12px 24px 32px;scrollbar-width:thin;scroll-padding:16px}
.sheet-intro{font-size:13px!important;line-height:1.55!important;color:var(--muted);margin:8px 0 22px;padding:0 12px}
.settings-section{margin:26px 0 0;padding:0;background:none;border:0;border-radius:0}
.settings-section h3{font-size:13px;line-height:1.5;font-weight:500;color:var(--muted);margin:0 12px 7px;letter-spacing:0}
.settings-group{border-radius:14px;overflow:hidden;background:var(--surface);margin:0 0 10px}
.settings-row{display:flex;align-items:center;position:relative;width:100%;min-height:50px;text-align:left;padding:13px 16px;font-size:16px;line-height:1.45;font-weight:400;color:var(--accent);border:0;background:none;border-radius:0;text-decoration:none;box-shadow:none;margin:0;gap:10px;white-space:normal;overflow-wrap:anywhere}
dialog a.settings-row{font-size:16px;color:var(--accent)}
.settings-row+.settings-row::before,.settings-info-row+.settings-row::before{content:"";position:absolute;left:16px;right:0;top:0;height:1px;background:var(--line)}
.settings-row:hover:not(:disabled){background:var(--wash)}.settings-row:disabled,.settings-row[aria-disabled="true"]{color:var(--muted);opacity:.55;cursor:default}
.settings-row.disclosure{padding-right:36px;color:var(--ink)}.settings-row.disclosure::after{content:"";position:absolute;right:18px;width:7px;height:7px;border-top:1.8px solid var(--muted);border-right:1.8px solid var(--muted);transform:rotate(45deg)}
.settings-row.danger{color:#c33732}.settings-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;min-height:50px;font-size:16px;line-height:1.45;color:var(--ink)}#drive-state{color:var(--muted);font-size:14px;text-align:right}
.settings-section p.settings-footnote{font-size:12px;line-height:1.55;margin:7px 12px;color:var(--muted)}
.settings-status{font-size:13px;line-height:1.55;margin:0 12px 12px;padding:0;background:none;border-radius:0;color:var(--muted)}.settings-status.error{padding:12px;background:#fff1ee;color:#a23d31;border-radius:12px}
.drive-files:empty{display:none}.drive-files{border-radius:14px;background:var(--surface);max-height:none;margin-top:12px}.drive-file{padding:14px 16px}.drive-file strong{font-size:14px}.drive-file span{font-size:12px}
.advanced-section{margin-top:26px}.advanced-section details{margin:0;border-radius:14px;background:var(--surface);overflow:hidden}.advanced-section summary{padding:13px 16px;min-height:50px;font-size:15px;color:var(--ink)}.setup-content{padding:0 16px 18px}.setup-content p,.setup-content li{font-size:13px}.setup-content .settings-row{padding-left:0}.setup-content input{border-radius:10px}.setup-content code{font-size:11px}
/* Long reading and calendar tasks share one sheet presentation. */
#help .sheet-content{font-size:15px}#help ol{padding-left:24px}#help li{padding-left:4px;font-size:15px;margin:20px 0}#help p{font-size:13px}#calendar.sheet{height:auto;max-height:86dvh;width:min(430px,calc(100% - 32px))}#calendar .sheet-content{padding:10px 20px 22px}#calendar .sheet-content>p{font-size:13px;margin:8px 0}#calendar .month-nav{margin-top:18px}
/* Choice of an action is separate from editing or confirming data. */
#menu.action-sheet{width:min(380px,calc(100% - 24px));padding:0;border:0;box-shadow:none;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;overflow:visible}
.action-group{border:1px solid var(--edge);border-radius:26px;overflow:hidden;background:var(--glass);-webkit-backdrop-filter:blur(28px) saturate(150%);backdrop-filter:blur(28px) saturate(150%);box-shadow:var(--shadow)}
.action-title{padding:18px 16px 13px;text-align:center;font-size:13px;font-weight:500;color:var(--muted);margin:0;border-bottom:1px solid var(--line)}
#menu .menu-action{min-height:56px;margin:0;padding:14px 16px;font-size:17px;font-weight:400;text-align:center;color:var(--accent);border-color:var(--line)}#menu .menu-action:last-child{border:0}#menu .menu-action.danger{color:#c33732}
#menu .action-cancel{display:block;width:100%;min-height:56px;margin-top:8px;border:1px solid var(--edge);border-radius:26px;background:var(--glass);-webkit-backdrop-filter:blur(28px);backdrop-filter:blur(28px);font-size:17px;font-weight:650;color:var(--accent);box-shadow:var(--shadow)}
/* Alerts stay small, with a clear title and full-width explicit actions. */
dialog.confirm-alert{padding:0;width:min(310px,calc(100% - 56px));height:auto;max-height:calc(100dvh - 48px);border-radius:26px;background:var(--glass);-webkit-backdrop-filter:blur(30px) saturate(150%);backdrop-filter:blur(30px) saturate(150%);overflow:auto;box-shadow:0 14px 70px #0003}
.alert-content{padding:24px 20px 18px;text-align:center}.alert-content h2{font-size:17px;line-height:1.35;font-weight:650;letter-spacing:-.025em;margin:0 0 9px}.alert-content p{font-size:13px;line-height:1.55;color:var(--ink);margin:8px 0}.alert-content label{font-size:13px;line-height:1.5;color:var(--ink);text-align:left;margin-top:14px}.alert-content input{font-size:16px;min-height:40px;padding:8px 10px;border-radius:9px;background:var(--surface);margin:8px 0 0}.alert-actions{display:flex;flex-direction:column;border-top:1px solid var(--line)}.alert-actions button{width:100%;min-height:50px;white-space:normal;padding:12px 16px;margin:0;background:transparent;box-shadow:none;border:0;border-radius:0;font-size:17px;line-height:1.35;color:var(--accent);font-weight:400}.alert-actions button+button{border-top:1px solid var(--line)}.alert-actions button:last-child{font-weight:650}.alert-actions button.danger{color:#c33732}.alert-actions button:disabled{opacity:.4}.confirm-alert #restore-summary{font-variant-numeric:tabular-nums}
@media(max-width:759px){dialog.sheet{width:100%;max-width:100%;height:94dvh;max-height:94dvh;margin:auto 0 0;border-radius:30px 30px 0 0;border-bottom:0;box-shadow:0 -8px 50px #0002}.sheet-grabber{display:block;width:36px;height:5px;border-radius:3px;background:var(--muted);opacity:.4;margin:9px auto 1px}.sheet-nav{min-height:61px;padding:8px 16px;border:0;background:var(--canvas);-webkit-backdrop-filter:none;backdrop-filter:none}.sheet-nav::after{content:"";height:1px;background:var(--line);position:absolute;bottom:0;left:0;right:0}.sheet-content{padding:10px 20px calc(24px + env(safe-area-inset-bottom))}.sheet-intro{margin-top:8px;margin-bottom:20px}.settings-section{margin-top:24px}.settings-row,.settings-info-row,dialog a.settings-row{font-size:17px;min-height:50px}.sheet-nav h2{font-size:17px}.sheet-nav>button{font-size:15px}#calendar.sheet{width:100%;height:auto;max-height:94dvh;border-radius:30px 30px 0 0;margin:auto 0 0}#calendar .sheet-content{padding:4px 24px calc(18px + env(safe-area-inset-bottom))}#calendar-grid button,#calendar-grid .blank{height:46px}#menu.action-sheet{margin:auto auto calc(10px + env(safe-area-inset-bottom));width:calc(100% - 24px)}dialog.confirm-alert{margin:auto;height:auto;border-radius:26px;max-height:calc(100dvh - 40px);width:min(310px,calc(100% - 48px))}}
@media(prefers-color-scheme:dark){.settings-row.danger,#menu .menu-action.danger,.alert-actions button.danger{color:#ff817b}.settings-status.error{background:#502820;color:#ffb4a9}}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.action-group,#menu .action-cancel,dialog.confirm-alert{background:var(--surface)}}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){.sheet-nav,.action-group,#menu .action-cancel,dialog.confirm-alert{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none}}
@media(prefers-reduced-motion:no-preference){dialog.sheet[open]{animation:sheet-enter .28s cubic-bezier(.2,.8,.2,1)}#menu[open]{animation:sheet-enter .22s ease-out}dialog.confirm-alert[open]{animation:alert-enter .16s ease-out}@keyframes sheet-enter{from{opacity:.5;transform:translateY(40px)}to{opacity:1;transform:translateY(0)}}@keyframes alert-enter{from{opacity:0;transform:scale(1.03)}to{opacity:1;transform:scale(1)}}}

@media(max-width:759px){.sheet-grabber{width:100%;height:22px;margin:0;background:none;opacity:1;display:grid;place-items:center}.sheet-grabber::after{content:"";display:block;width:36px;height:5px;border-radius:3px;background:var(--muted);opacity:.4}}

#reset-confirm.confirm-alert,#restore-confirm.confirm-alert,#remove-confirm.confirm-alert{height:fit-content;width:min(310px,calc(100% - 48px))}#calendar.sheet{height:fit-content}

.cloud-panel{margin:0 20px 12px;padding:14px 16px;border-radius:20px;background:var(--surface);border:1px solid var(--line)}.cloud-panel strong{display:block;font-size:13px;overflow-wrap:anywhere}.cloud-panel p{font-size:12px;line-height:1.5;color:var(--muted);margin:6px 0}.cloud-panel button{font-size:13px;min-height:44px;margin:4px 0 0;padding:8px 14px;color:var(--accent)}.cloud-panel .primary{color:#fff}.cloud-panel button:not(.primary){padding-left:0}.sidebar-bottom #offline{line-height:1.5}dialog.confirm-alert{height:fit-content}.settings-group:has(#cloud-migrate[hidden]){display:none}@media(max-height:650px){.cloud-panel{padding:8px 12px;margin-bottom:6px}.list-heading{padding-top:12px;padding-bottom:10px}.group-search{margin-bottom:12px}}
