@font-face { font-family: Fraunces; src: url(/fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Figtree; src: url(/fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }

/* Catppuccin palettes, https://catppuccin.com/palette */
[data-flavor=latte] { color-scheme: light; --rosewater:#dc8a78; --flamingo:#dd7878; --pink:#ea76cb; --mauve:#8839ef; --red:#d20f39; --maroon:#e64553; --peach:#fe640b; --yellow:#df8e1d; --green:#40a02b; --teal:#179299; --sky:#04a5e5; --sapphire:#209fb5; --blue:#1e66f5; --lavender:#7287fd; --text:#4c4f69; --subtext1:#5c5f77; --subtext0:#6c6f85; --overlay2:#7c7f93; --overlay1:#8c8fa1; --overlay0:#9ca0b0; --surface2:#acb0be; --surface1:#bcc0cc; --surface0:#ccd0da; --base:#eff1f5; --mantle:#e6e9ef; --crust:#dce0e8; --on-accent:#eff1f5; --ev-mix:17%; --ev-text-mix:62%; --shadow:rgb(76 79 105 / .18); }
[data-flavor=frappe] { color-scheme: dark; --rosewater:#f2d5cf; --flamingo:#eebebe; --pink:#f4b8e4; --mauve:#ca9ee6; --red:#e78284; --maroon:#ea999c; --peach:#ef9f76; --yellow:#e5c890; --green:#a6d189; --teal:#81c8be; --sky:#99d1db; --sapphire:#85c1dc; --blue:#8caaee; --lavender:#babbf1; --text:#c6d0f5; --subtext1:#b5bfe2; --subtext0:#a5adce; --overlay2:#949cbb; --overlay1:#838ba7; --overlay0:#737994; --surface2:#626880; --surface1:#51576d; --surface0:#414559; --base:#303446; --mantle:#292c3c; --crust:#232634; }
[data-flavor=macchiato] { color-scheme: dark; --rosewater:#f4dbd6; --flamingo:#f0c6c6; --pink:#f5bde6; --mauve:#c6a0f6; --red:#ed8796; --maroon:#ee99a0; --peach:#f5a97f; --yellow:#eed49f; --green:#a6da95; --teal:#8bd5ca; --sky:#91d7e3; --sapphire:#7dc4e4; --blue:#8aadf4; --lavender:#b7bdf8; --text:#cad3f5; --subtext1:#b8c0e0; --subtext0:#a5adcb; --overlay2:#939ab7; --overlay1:#8087a2; --overlay0:#6e738d; --surface2:#5b6078; --surface1:#494d64; --surface0:#363a4f; --base:#24273a; --mantle:#1e2030; --crust:#181926; }
[data-flavor=mocha] { color-scheme: dark; --rosewater:#f5e0dc; --flamingo:#f2cdcd; --pink:#f5c2e7; --mauve:#cba6f7; --red:#f38ba8; --maroon:#eba0ac; --peach:#fab387; --yellow:#f9e2af; --green:#a6e3a1; --teal:#94e2d5; --sky:#89dceb; --sapphire:#74c7ec; --blue:#89b4fa; --lavender:#b4befe; --text:#cdd6f4; --subtext1:#bac2de; --subtext0:#a6adc8; --overlay2:#9399b2; --overlay1:#7f849c; --overlay0:#6c7086; --surface2:#585b70; --surface1:#45475a; --surface0:#313244; --base:#1e1e2e; --mantle:#181825; --crust:#11111b; }
[data-flavor=frappe],[data-flavor=macchiato],[data-flavor=mocha] { --on-accent:var(--crust); --ev-mix:88%; --ev-text-mix:0%; --shadow:rgb(0 0 0 / .35); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--base); color: var(--text); font: 400 15px/1.45 Figtree, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
#app { height: 100dvh; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.display { font-family: Fraunces, Georgia, serif; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 96; font-weight: 480; letter-spacing: -.012em; }
.muted { color: var(--subtext0); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 10px; background: var(--surface0); font-weight: 550; white-space: nowrap; transition: background .12s; }
.btn:hover:not(:disabled) { background: var(--surface1); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, var(--text)); }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface0); }
.btn.danger { color: var(--red); background: transparent; }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 15%, transparent); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--subtext1); }
.icon-btn:hover { background: var(--surface0); color: var(--text); }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .label { font-size: 13px; font-weight: 550; color: var(--subtext1); }
input:where(:not([type=checkbox], [type=radio], [type=file])), select, textarea { width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--surface1); background: var(--mantle); }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.error { color: var(--red); font-size: 14px; }

/* App shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100%; }
.rail { background: var(--mantle); display: flex; flex-direction: column; gap: 18px; padding: 16px 14px 12px; min-height: 0; overflow: hidden; z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 22px; padding: 0 4px; }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.rail .new { width: 100%; min-height: 40px; }
.rail-scroll { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 18px; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; flex-wrap: wrap; }
.topbar h1 { font-size: clamp(25px, 3vw, 36px); line-height: 1.1; margin-right: auto; white-space: nowrap; }
.menu-btn { display: none; }
.seg { display: inline-flex; background: var(--mantle); border-radius: 11px; padding: 3px; }
.seg button { padding: 0 12px; height: 30px; border-radius: 8px; color: var(--subtext0); font-weight: 550; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed=true] { background: var(--surface0); color: var(--text); }
.search { position: relative; width: 190px; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--overlay1); pointer-events: none; }
.search input[type=search] { padding-left: 34px; min-height: 36px; background: var(--mantle); border-color: transparent; }
.search-pop { position: absolute; top: 42px; right: 0; width: min(380px, 90vw); max-height: 60vh; overflow: auto; background: var(--mantle); border-radius: 12px; box-shadow: 0 12px 32px var(--shadow); padding: 6px; z-index: 40; }
.search-pop button { display: grid; width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; }
.search-pop button:hover, .search-pop button:focus-visible { background: var(--surface0); }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* Mini month */
.mini-head { display: flex; align-items: center; padding: 0 2px 4px 6px; font-weight: 600; }
.mini-head .icon-btn { width: 28px; height: 28px; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12.5px; }
.mini .wd { color: var(--overlay1); padding: 3px 0; }
.mini button { aspect-ratio: 1; border-radius: 50%; color: var(--subtext1); }
.mini button.out { color: var(--overlay0); }
.mini button:hover { background: var(--surface0); }
.mini button.sel { background: var(--surface1); color: var(--text); }
.mini button.today { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* Calendar list */
.cal-group h3 { font: 600 13px Figtree, sans-serif; color: var(--subtext0); padding: 0 6px 4px; display: flex; justify-content: space-between; align-items: center; min-height: 26px; }
.cal-group h3 .icon-btn { width: 26px; height: 26px; }
.cal-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.cal-row:hover { background: color-mix(in srgb, var(--surface0) 60%, transparent); }
.cal-toggle { flex: 1; min-width: 0; display: flex; gap: 9px; align-items: center; padding: 5px 6px; text-align: left; }
.cal-toggle span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 14px; height: 14px; border-radius: 5px; flex: none; background: var(--c); border: 2px solid var(--c); }
[aria-pressed=false] > .dot { background: transparent; }
[aria-pressed=false] > .dot + span { color: var(--overlay1); }
.cal-row .icon-btn { width: 26px; height: 26px; opacity: 0; }
.cal-row:hover .icon-btn, .cal-row .icon-btn:focus-visible { opacity: 1; }

/* The flavor picker is four tiny cups, each rendered in its own palette. */
.rail-foot { display: flex; align-items: center; gap: 4px; }
.cups { display: flex; gap: 5px; margin-right: auto; padding-left: 2px; }
.cup { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 210deg, var(--mauve) 0 25%, var(--peach) 0 50%, var(--green) 0 75%, var(--blue) 0); padding: 5px; transition: transform .15s; }
.cup::after { content: ''; display: block; height: 100%; border-radius: 50%; background: var(--base); }
.cup:hover { transform: scale(1.12); }
.cup[aria-pressed=true] { box-shadow: 0 0 0 2px var(--mantle), 0 0 0 4px var(--text); }
html.flavor-change::view-transition-old(root), html.flavor-change::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.flavor-change::view-transition-new(root) { z-index: 2; }

/* Week and day */
.wk { --hour: 52px; --gut: 58px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wk-head, .wk-all { display: grid; grid-template-columns: var(--gut) repeat(var(--n), minmax(0, 1fr)); padding-right: var(--sb, 0); }
.wk-day { padding: 2px 0 8px; display: flex; flex-direction: column; align-items: center; color: var(--subtext0); font-size: 13px; }
.wk-day b { font-family: Fraunces, serif; font-variation-settings: 'SOFT' 100, 'WONK' 1; font-weight: 450; font-size: 23px; line-height: 34px; width: 36px; text-align: center; border-radius: 50%; color: var(--text); }
.wk-day:hover b { background: var(--surface0); }
.wk-day.today { color: var(--accent); font-weight: 600; }
.wk-day.today b { background: var(--accent); color: var(--on-accent); }
.wk-all { border-bottom: 1px solid var(--surface0); position: relative; grid-auto-rows: 24px; min-height: 8px; max-height: 104px; overflow-y: auto; row-gap: 2px; padding-bottom: 4px; scrollbar-width: none; }
.wk-all .tz { grid-column: 1; grid-row: 1; font-size: 11px; color: var(--overlay1); text-align: right; padding-right: 8px; line-height: 24px; }
.wk-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface1) transparent; }
.wk-body { display: grid; grid-template-columns: var(--gut) repeat(var(--n), minmax(0, 1fr)); height: calc(var(--hour) * 24); position: relative; }
.wk-hours span { display: block; height: var(--hour); font-size: 11.5px; color: var(--overlay1); text-align: right; padding-right: 8px; transform: translateY(-.7em); }
.wk-hours span:first-child { visibility: hidden; }
.col { position: relative; border-left: 1px solid var(--surface0); touch-action: pan-y; cursor: crosshair; background-image: linear-gradient(var(--surface0) 1px, transparent 1px); background-size: 100% var(--hour); user-select: none; -webkit-user-select: none; }
.col.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--red); z-index: 6; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

.ev { --bg: color-mix(in srgb, var(--c) var(--ev-mix), var(--base)); --fg: color-mix(in srgb, var(--c) var(--ev-text-mix), var(--on-ev, var(--crust))); background: var(--bg); color: var(--fg); text-align: left; border-radius: 7px; font-size: 12.5px; line-height: 1.25; overflow: hidden; }
[data-flavor=latte] .ev { --on-ev: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 32%, transparent); }
.ev:hover { filter: brightness(1.05) saturate(1.05); }
.ev.past { opacity: .66; }
[data-flavor=latte] .ev.past { opacity: .8; }
.ev.tentative { background: repeating-linear-gradient(135deg, var(--bg) 0 6px, color-mix(in srgb, var(--bg) 72%, var(--base)) 6px 12px); }
.ev strong { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.timed { position: absolute; padding: 3px 6px; box-shadow: 0 0 0 1.5px var(--base); cursor: pointer; touch-action: pan-y; }
.ev.timed.tall strong { white-space: normal; }
.ev.timed span { display: block; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.timed.short { padding-block: 0; display: flex; gap: 5px; align-items: center; }
.ev.timed.short span { flex: none; }
.ev.dragging { opacity: .75; z-index: 8; box-shadow: 0 6px 16px var(--shadow); cursor: grabbing; }
.ev .grip { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.drag-ghost { position: absolute; left: 2px; right: 4px; background: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 7px; pointer-events: none; font-size: 12px; padding: 2px 6px; font-weight: 600; z-index: 7; }
.ev.bar { padding: 0 8px; height: 24px; line-height: 24px; margin: 0 2px; display: block; min-width: 0; }
.ev.bar strong { display: inline; }
.ev.bar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.ev.bar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }

/* Month */
.mo { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 0 0 0 1px; }
.mo-wd, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-wd div { padding: 2px 8px 6px; color: var(--subtext0); font-size: 13px; }
.mo-grid { grid-auto-rows: minmax(0, 1fr); border-top: 1px solid var(--surface0); }
.mo-cell { border-right: 1px solid var(--surface0); border-bottom: 1px solid var(--surface0); padding: 3px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; cursor: crosshair; }
.mo-cell.out { background: color-mix(in srgb, var(--mantle) 55%, transparent); }
.mo-cell.out .mo-n { color: var(--overlay0); }
.mo-n { align-self: flex-start; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; font-size: 13.5px; flex: none; }
.mo-n:hover { background: var(--surface0); }
.mo-cell.today .mo-n { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip { display: flex; gap: 5px; height: 20px; line-height: 20px; padding: 0 6px; flex: none; width: 100%; }
.chip strong { flex: 1; min-width: 0; font-weight: 600; }
.chip.plain { background: none; color: var(--text); box-shadow: none !important; }
.chip.plain::before { content: ''; width: 7px; height: 7px; margin-top: 6.5px; flex: none; border-radius: 3px; background: var(--c); }
.chip.plain:hover { background: var(--surface0); filter: none; }
.chip.plain time { color: var(--subtext0); }
.more { font-size: 12px; color: var(--subtext0); text-align: left; padding: 0 6px; border-radius: 6px; flex: none; }
.more:hover { background: var(--surface0); color: var(--text); }

/* Agenda */
.ag { flex: 1; overflow-y: auto; padding: 4px 18px 40px; }
.ag-inner { max-width: 760px; }
.ag-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--surface0); }
.ag-date b { font-size: 30px; line-height: 1; display: block; }
.ag-date.today { color: var(--accent); }
.ag-list { display: grid; gap: 2px; }
.ag-item { display: grid; grid-template-columns: 112px 12px minmax(0, 1fr); gap: 10px; align-items: baseline; text-align: left; padding: 6px 8px; border-radius: 8px; }
.ag-item:hover { background: var(--mantle); }
.ag-item i { width: 10px; height: 10px; border-radius: 4px; background: var(--c); }
.empty { margin: auto; text-align: center; display: grid; gap: 10px; justify-items: center; padding: 40px 20px; }
.empty h2 { font-size: 26px; }

/* Dialogs */
dialog { color: var(--text); border: 0; padding: 0; background: var(--base); box-shadow: 0 16px 60px var(--shadow); }
dialog::backdrop { background: color-mix(in srgb, var(--crust) 55%, transparent); }
dialog.sheet { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: none; width: min(460px, 100vw); animation: sheet .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet { from { transform: translateX(28px); opacity: 0; } }
.sheet form { height: 100%; display: flex; flex-direction: column; }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: grid; gap: 14px; align-content: start; }
.sheet-foot { display: flex; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--mantle); }
.title-input { font-size: 25px !important; padding: 4px 0 !important; border: 0 !important; border-bottom: 2px solid var(--surface1) !important; border-radius: 0 !important; background: none !important; outline: 0 !important; }
.title-input:focus { border-bottom-color: var(--accent) !important; }
.when { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
.when.allday { grid-template-columns: 1fr; }
.when.allday .t { display: none; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
dialog.small-d { width: min(400px, calc(100vw - 32px)); border-radius: 16px; margin: auto; padding: 20px; }
.small-d h2 { font-size: 22px; margin-bottom: 6px; }
.choices { display: grid; gap: 6px; margin-top: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 9px; background: var(--c); }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--base), 0 0 0 4px var(--text); }
.detail { white-space: pre-wrap; overflow-wrap: anywhere; }

dialog.settings { width: min(880px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 32px)); border-radius: 18px; margin: auto; overflow: hidden; }
.set { display: grid; grid-template-columns: 200px minmax(0, 1fr); height: 100%; }
.set nav { background: var(--mantle); padding: 18px 10px; display: flex; flex-direction: column; gap: 2px; }
.set nav h2 { font-size: 24px; padding: 0 10px 12px; }
.set nav button { text-align: left; padding: 8px 10px; border-radius: 9px; color: var(--subtext1); font-weight: 550; }
.set nav button:hover { background: var(--surface0); }
.set nav button[aria-current=true] { background: var(--surface0); color: var(--text); }
.pane { overflow-y: auto; padding: 22px 26px 30px; display: grid; gap: 22px; align-content: start; position: relative; }
.pane > .close { position: absolute; top: 12px; right: 12px; }
.pane h3 { font: 480 21px Fraunces, serif; font-variation-settings: 'SOFT' 100, 'WONK' 1; margin-bottom: 4px; }
.pane section { display: grid; gap: 10px; max-width: 560px; }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--surface0); }
.status { width: 9px; height: 9px; border-radius: 50%; background: var(--overlay0); flex: none; }
.status.ok { background: var(--green); } .status.error { background: var(--red); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { padding: 6px 12px; border-radius: 9px; background: var(--mantle); font-weight: 550; color: var(--subtext1); }
.tabs button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.copy { display: flex; gap: 6px; }
.copy input { font-size: 13px; }
.reveal { background: color-mix(in srgb, var(--green) 14%, var(--base)); padding: 12px; border-radius: 11px; display: grid; gap: 6px; }
.flavors { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.flavor { background: var(--base); color: var(--text); padding: 11px; border-radius: 12px; text-align: left; box-shadow: inset 0 0 0 1px var(--surface1); display: grid; gap: 8px; font-weight: 600; }
.flavor[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--mauve); }
.flavor i { display: flex; gap: 3px; }
.flavor i s { width: 13px; height: 13px; border-radius: 4px; }

/* Sign-in */
.auth { height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); }
.auth-art { background: var(--mantle); padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-num { font-size: clamp(190px, 30vw, 430px); line-height: .8; color: var(--accent); margin-left: -.05em; }
.auth-day { font-size: clamp(28px, 3.4vw, 48px); line-height: 1.1; }
.auth-form { display: grid; align-content: center; justify-items: center; padding: 28px; overflow-y: auto; }
.auth-form form { width: min(350px, 100%); display: grid; gap: 13px; }
.auth-form h1 { font-size: 30px; }

#toasts { position: fixed; bottom: 18px; left: 50%; translate: -50%; display: grid; gap: 8px; z-index: 100; justify-items: center; pointer-events: none; }
#toasts:popover-open { background: none; border: 0; inset: auto auto 18px 50%; }
.toast { background: var(--crust); color: var(--text); padding: 9px 15px; border-radius: 11px; box-shadow: 0 8px 26px var(--shadow); max-width: min(520px, 90vw); animation: toast .18s ease-out; }
.toast.err { background: var(--red); color: var(--on-accent); }
@keyframes toast { from { transform: translateY(8px); opacity: 0; } }
.scrim { display: none; }

@media (max-width: 1000px) { .search { width: 44px; } .search input[type=search] { padding-right: 0; color: transparent; } .search input[type=search]:focus { position: absolute; right: 0; width: 200px; color: inherit; z-index: 3; } .search input[type=search]::placeholder { color: transparent; } }
@media (max-width: 800px) {
  body { font-size: 16px; }
  input:not([type=checkbox]), select, textarea { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .rail.open { transform: none; box-shadow: 0 0 50px var(--shadow); }
  .scrim.open { display: block; position: fixed; inset: 0; background: color-mix(in srgb, var(--crust) 55%, transparent); z-index: 20; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 10px 8px; gap: 4px; }
  .topbar h1 { font-size: 24px; flex: 1; order: 0; }
  .topbar .seg { order: 5; width: 100%; margin-top: 4px; } .seg button { flex: 1; }
  .topbar .today-btn { padding: 0 9px; }
  .topbar .prev, .topbar .next { display: none; }
  .wk { --gut: 44px; --hour: 56px; }
  .cal-row .icon-btn { opacity: 1; }
  .mo-wd div { padding-inline: 3px; text-align: center; }
  .mo-cell { padding: 2px 1px; align-items: stretch; } .mo-n { align-self: center; }
  .chip { padding: 0 3px; height: 17px; line-height: 17px; font-size: 11px; } .chip time { display: none; } .chip.plain::before { display: none; }
  .ag { padding-inline: 12px; } .ag-day { grid-template-columns: 58px minmax(0, 1fr); gap: 6px; } .ag-item { grid-template-columns: minmax(0, 1fr); gap: 0; } .ag-item i { display: none; }
  .set { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .set nav { flex-direction: row; overflow-x: auto; padding: 10px; } .set nav h2 { display: none; } .set nav button { white-space: nowrap; }
  .pane { padding: 18px 16px 26px; } .pane > .close { top: 6px; right: 6px; }
  dialog.settings { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .auth-art { padding: 18px 22px; flex-direction: row; align-items: center; } .auth-num { font-size: 76px; order: 2; } .auth-day { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation: none !important; transition: none !important; } }
