:root {
  --bg: #fff; --surface: #F7F7F9; --card: #fff; --border: #ECECF0; --border2: #E1E1E7;
  --text: #1E1F24; --text2: #6E7079; --muted: #A3A5AD;
  --accent: #5B5BD6; --accent-soft: #EEEEFC; --accent-text: #4747C2;
  --danger: #E5484D; --danger-soft: #FDECEC; --ok: #30A46C;
  --hover: #F1F1F4; --press: #E9E9EE; --backdrop: rgba(20, 20, 30, .32);
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 4px 16px rgba(20, 20, 40, .06);
  --shadow-lg: 0 10px 40px rgba(20, 20, 40, .18);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --tabh: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181C; --surface: #1E1F24; --card: #1E1F24; --border: #2B2C33; --border2: #34353D;
    --text: #ECEDF0; --text2: #A0A2AB; --muted: #6B6D76;
    --accent: #7B7BEA; --accent-soft: #2A2A48; --accent-text: #A5A5F5;
    --danger: #F06A6E; --danger-soft: #3A2224; --ok: #4CC38A;
    --hover: #24252B; --press: #2C2D34; --backdrop: rgba(0, 0, 0, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden; min-height: 100vh; min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.splash { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.splash img { border-radius: 18px; opacity: .9; }

/* ---------- login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--sat)) 20px calc(24px + var(--sab)); background: var(--surface); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 32px 24px 26px; box-shadow: var(--shadow); text-align: center; }
.login-card img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 6px 20px rgba(91, 91, 214, .25); }
.login-card h1 { font-size: 24px; margin: 14px 0 4px; letter-spacing: -.02em; }
.login-card p.sub { margin: 0 0 22px; color: var(--text2); }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card .err { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text2); }
.field { width: 100%; font-size: 16px; font-weight: 400; color: var(--text); padding: 12px 14px; min-height: 48px; border: 1px solid var(--border2); border-radius: 12px; background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 16px; background: var(--surface); border: 1px solid var(--border); transition: background .15s, transform .1s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled { opacity: .6; }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.textdanger { color: var(--danger); background: none; border-color: transparent; }
.btn.block { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text2); transition: background .15s, color .15s; flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn:active { background: var(--press); }
.iconbtn.accent { color: var(--accent); }

/* ---------- mobile shell */
.app.mobile { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--tabh) + var(--sab) + 16px); }
.app.mobile.kbd { padding-bottom: 24px; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); padding: var(--sat) calc(8px + var(--sar)) 0 calc(8px + var(--sal)); border-bottom: 1px solid transparent; }
@media (prefers-color-scheme: dark) { .topbar { background: rgba(23, 24, 28, .86); } }
.topbar.scrolled, .topbar.sub { border-bottom-color: var(--border); }
.tb-row { display: flex; align-items: center; min-height: 52px; gap: 2px; }
.tb-title { flex: 1; min-width: 0; font-weight: 650; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.tb-spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 10px 0 4px; border-radius: 12px; color: var(--accent); font-size: 16px; max-width: 42vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.back span { overflow: hidden; text-overflow: ellipsis; }
.back svg.i { width: 24px; height: 24px; }
.back:hover { background: var(--hover); }
.tb-side { display: flex; align-items: center; min-width: 88px; }
.tb-side.r { justify-content: flex-end; }
.hero { padding: 2px calc(20px + var(--sar)) 14px calc(20px + var(--sal)); }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.15; letter-spacing: -.025em; font-weight: 750; }
.hero p { margin: 4px 0 0; color: var(--text2); font-size: 15px; }
.hero p b { color: var(--accent-text); font-weight: 600; }
.content { padding: 4px calc(16px + var(--sar)) 0 calc(16px + var(--sal)); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--border); padding: 0 var(--sar) var(--sab) var(--sal); }
@media (prefers-color-scheme: dark) { .tabbar { background: rgba(23, 24, 28, .9); } }
.app.kbd .tabbar { display: none; }
.tab { position: relative; flex: 1; max-width: 200px; height: var(--tabh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tab svg.i { width: 25px; height: 25px; }
.tab.on { color: var(--accent); }
.tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 19px; text-align: center; }

.syncdot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.syncdot i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; transition: background .2s; }
.syncdot.syncing i { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.syncdot.offline i { background: var(--danger); }
.syncdot.offline { color: var(--danger); }
@keyframes pulse { 50% { opacity: .3; transform: scale(.75); } }
.iconbtn .syncdot { position: absolute; }
.gear { position: relative; }
.gear .syncdot { top: 9px; right: 9px; }
.gear .syncdot i { width: 9px; height: 9px; border: 2px solid var(--bg); box-sizing: content-box; }
.gear .syncdot:not(.offline):not(.syncing) { display: none; }

/* ---------- lists & rows */
.group { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.sect { display: flex; align-items: center; gap: 8px; margin: 18px 4px 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text2); }
.sect.danger { color: var(--danger); }
.sect .n { font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 6px 6px 14px; border-top: 1px solid var(--border); width: 100%; position: relative; transition: background .12s; }
.row:first-child { border-top: 0; }
a.row:hover, button.row:hover, .row.link:hover { background: var(--hover); }
a.row:active, button.row:active { background: var(--press); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-size: 16px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .name.placeholder { color: var(--muted); font-weight: 500; }
.row .sub { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--muted); width: 18px; height: 18px; margin-right: 6px; }
.emo { width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; font-size: 20px; flex: none; line-height: 1; }
.pg-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.count { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--surface); color: var(--text2); font-size: 12.5px; font-weight: 650; display: inline-grid; place-items: center; flex: none; }
.count.has { background: var(--accent-soft); color: var(--accent-text); }
.addrow { color: var(--accent); font-weight: 600; font-size: 16px; }
.addrow .pg-ico { background: transparent; border: 1.5px dashed var(--border2); }

/* todo rows */
.todo { align-items: flex-start; padding: 4px 4px 4px 4px; gap: 4px; min-height: 52px; }
.check { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.check span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; transition: background .15s, border-color .15s, transform .15s; }
.check:hover span { border-color: var(--accent); }
.check:active span { transform: scale(.88); }
.check svg.i { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; opacity: 0; transition: opacity .15s; }
.check.on span { background: var(--accent); border-color: var(--accent); }
.check.on svg.i { opacity: 1; }
.todo .body { flex: 1; min-width: 0; padding: 11px 0 9px; }
.todo .txt { font-size: 16px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.todo.done .txt, .todo.done .tedit { color: var(--muted); text-decoration: line-through; }
.todo .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text2); padding: 2px 0; max-width: 100%; min-width: 0; }
.crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { color: var(--accent); }
.crumb .sep { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--text2); border: 1px solid var(--border); white-space: nowrap; flex: none; transition: filter .15s; }
.chip svg.i { width: 14px; height: 14px; stroke-width: 2; }
.chip:hover { filter: brightness(.97); }
.chip.today { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip.over { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.done { background: transparent; color: var(--muted); }
.chipwrap { height: 44px; display: flex; align-items: center; flex: none; padding: 0 2px; }
.tedit { display: block; width: 100%; border: 0; outline: none; background: transparent; resize: none; padding: 0; margin: 0; font-size: 16px; line-height: 1.4; min-height: 22px; overflow: hidden; field-sizing: content; border-radius: 4px; }
.todo .del { color: var(--muted); opacity: .0; }
.todo:hover .del, .todo:focus-within .del { opacity: 1; }
.todo .del:hover { color: var(--danger); background: var(--danger-soft); }
@media (hover: none) { .todo .del { opacity: 1; width: 36px; } }
.addtodo { display: flex; align-items: center; gap: 4px; padding: 4px; border-top: 1px solid var(--border); }
.group .addtodo:first-child { border-top: 0; }
.addtodo .plus { width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent); flex: none; }
.addtodo input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; font-size: 16px; }
.addtodo input::placeholder, .tedit::placeholder, .notes::placeholder, .ptitle::placeholder { color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; color: var(--text2); }
.empty .big { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .big svg.i { width: 30px; height: 30px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* page view */
.pcrumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); font-size: 13.5px; font-weight: 550; margin: 6px 4px 2px; }
.ptitle { display: block; width: 100%; border: 0; outline: none; background: transparent; font-size: 28px; font-weight: 750; letter-spacing: -.02em; padding: 4px 4px 6px; margin: 0 0 6px; border-radius: 8px; }
.ptitle:focus { background: var(--surface); }
.notes { display: block; width: 100%; min-height: 140px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); outline: none; resize: none; padding: 14px 16px; font-size: 16px; line-height: 1.55; overflow: hidden; field-sizing: content; transition: border-color .15s, box-shadow .15s; }
.notes:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.donehead { display: flex; align-items: center; gap: 6px; }

/* ---------- desktop */
.app.desk { display: grid; grid-template-columns: 264px 300px minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.app.desk.nopages { grid-template-columns: 264px minmax(0, 1fr); }
.side { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; padding: 16px 10px 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 8px 6px 10px; border-radius: 10px; color: var(--text); font-size: 14.5px; font-weight: 550; transition: background .12s; position: relative; }
.nav:hover { background: var(--hover); }
.nav.on { background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 5px 7px 5px 9px; }
.nav .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .ne { width: 24px; text-align: center; font-size: 17px; line-height: 1; flex: none; }
.nav .ne svg.i { color: var(--accent); }
.nav .count { height: 22px; min-width: 22px; background: transparent; color: var(--muted); }
.nav .count.has { background: var(--accent-soft); color: var(--accent-text); }
.nav .more { display: none; width: 28px; height: 28px; border-radius: 8px; place-items: center; color: var(--text2); }
.nav .more:hover { background: var(--press); }
.nav:hover .more { display: inline-grid; }
.nav:hover .count { display: none; }
.side-sect { display: flex; align-items: center; justify-content: space-between; margin: 18px 4px 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.side-sect .iconbtn { width: 30px; height: 30px; border-radius: 8px; }
.side-list { flex: 1; overflow-y: auto; min-height: 0; display: grid; align-content: start; gap: 2px; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 10px 4px 0 10px; border-top: 1px solid var(--border); margin-top: 8px; }
.side-foot .who { flex: 1; min-width: 0; display: grid; }
.side-foot .who b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .iconbtn { width: 36px; height: 36px; }
.pcol { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.pcol-head { display: flex; align-items: center; gap: 10px; padding: 16px 10px 12px 18px; }
.pcol-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcol-head .emo { width: 34px; height: 34px; font-size: 18px; }
.pcol-head .iconbtn { width: 34px; height: 34px; border-radius: 9px; }
.pcol-list { flex: 1; overflow-y: auto; padding: 0 10px 12px; display: grid; align-content: start; gap: 2px; }
.pitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; transition: background .12s; }
.pitem:hover { background: var(--hover); }
.pitem.on { background: var(--accent-soft); }
.pitem .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .t.placeholder { color: var(--muted); }
.pitem .s { grid-column: 1 / -1; font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .count { height: 20px; min-width: 20px; font-size: 11.5px; }
.pitem.on .count { background: var(--card); }
.pcol-empty { padding: 24px 18px; color: var(--muted); font-size: 14px; }
.mcol { overflow-y: auto; min-height: 0; }
.minner { max-width: 760px; margin: 0 auto; padding: 28px 40px 60px; }
.desk .hero { padding: 0 4px 10px; }
.desk .hero h1 { font-size: 30px; }
.desk .content { padding: 0; }
.mhead { display: flex; align-items: center; gap: 6px; min-height: 36px; margin: -8px -12px 0 0; }
.mhead .pcrumb { flex: 1; margin: 0 4px; }
.desk .todo .body { padding-top: 11px; }
.desk .ptitle { font-size: 30px; }

/* ---------- sheets */
#sheet { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet.open { pointer-events: auto; }
.backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity .22s; }
#sheet.open .backdrop { opacity: 1; }
.panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); padding: 8px calc(18px + var(--sar)) calc(18px + var(--sab)) calc(18px + var(--sal)); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .9, .3, 1); }
#sheet.open .panel { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--border2); margin: 2px auto 10px; }
.panel h3 { margin: 4px 0 4px; font-size: 19px; font-weight: 700; text-align: center; letter-spacing: -.01em; }
.panel p.desc { margin: 4px 0 16px; text-align: center; color: var(--text2); }
.panel .stack { display: grid; gap: 10px; margin-top: 14px; }
.panel .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.quick { display: grid; gap: 8px; margin-top: 14px; }
.qbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-size: 16px; font-weight: 600; transition: background .12s; }
.qbtn:hover { background: var(--hover); }
.qbtn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.qbtn .k { flex: 1; }
.qbtn .v { color: var(--text2); font-weight: 500; font-size: 14px; }
.qbtn svg.i { color: var(--accent); }
.qbtn.danger { color: var(--danger); }
.qbtn.danger svg.i { color: var(--danger); }
.datein { margin-top: 14px; }
.datein input { display: block; width: 100%; -webkit-appearance: none; appearance: none; }
.icongrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 14px; }
.icongrid button { aspect-ratio: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-size: 22px; display: grid; place-items: center; line-height: 1; transition: background .12s, transform .1s; }
.icongrid button:hover { background: var(--hover); }
.icongrid button.on { border: 2px solid var(--accent); background: var(--accent-soft); }
.icongrid button:active { transform: scale(.94); }
.acct { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); margin-top: 10px; }
.acct img { width: 44px; height: 44px; border-radius: 12px; }
.acct .grow { flex: 1; min-width: 0; }
.acct b { display: block; }

@media (min-width: 640px) {
  .panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 420px; border-radius: 18px; padding: 18px 22px 22px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .2s, opacity .2s; }
  #sheet.open .panel { transform: translate(-50%, -50%); opacity: 1; }
  .grab { display: none; }
}
@media (hover: none) {
  a.row:hover, button.row:hover, .row.link:hover, .iconbtn:hover, .back:hover, .check:hover span { background: transparent; }
  .check:hover span { border-color: var(--muted); }
  .check.on:hover span { background: var(--accent); border-color: var(--accent); }
  .qbtn:hover, .icongrid button:hover { background: var(--card); }
  .qbtn.on:hover, .icongrid button.on:hover { background: var(--accent-soft); }
  a.row:active, button.row:active, .iconbtn:active { background: var(--press); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
svg.i.dots { stroke-width: 3.2; }

/* ---------- Kalender (P3) */
.c-blue { --c: #3E63DD; } .c-red { --c: #E5484D; } .c-orange { --c: #D9560A; } .c-yellow { --c: #B58900; }
.c-green { --c: #2A8F5E; } .c-teal { --c: #0E8F80; } .c-purple { --c: #8E4EC6; } .c-gray { --c: #6E7079; }
.minner.wide { max-width: 1180px; }
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.cal-tools .grow, .cal-foot .grow { flex: 1; }
.cal-tools .btn { min-height: 44px; }
.cal-tools .cal-hidden { visibility: hidden; }
.cal-tools-nav, .cal-tools-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-tools-more { margin-left: auto; }
@media (max-width: 639px) {
  .cal-tools .cal-lbl { display: none; }
  .cal-tools .btn { padding: 0 12px; }
  .cal-tools .cal-rem { width: 44px; padding: 0; }
  .cal-seg button { padding: 0 10px; }
}
.cal-seg { display: inline-flex; border: 1px solid var(--border2); border-radius: 12px; overflow: hidden; }
.cal-seg button { min-height: 44px; min-width: 44px; padding: 0 14px; font-weight: 600; color: var(--text2); }
.cal-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.cal-wrap { display: grid; gap: 16px; }
.cal-grid { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-colh { padding: 8px 2px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text2); background: var(--surface); }
.cal-cell { min-height: 56px; min-width: 0; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); cursor: pointer; }
.cal-row > .cal-cell:first-child { border-left: 0; }
.cal-cell:hover { background: var(--hover); }
.cal-cell.sel { background: var(--accent-soft); }
.cal-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell.other .cal-num { color: var(--text2); }
.cal-num { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; font-size: 14px; font-weight: 600; }
.cal-cell.today .cal-num { background: var(--accent); color: var(--bg); }
.cal-dots { display: flex; gap: 3px; min-height: 8px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-evs { display: none; }
.cal-ev { display: block; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 1.35; padding: 1px 4px; border-left: 3px solid var(--c, var(--accent)); border-radius: 3px; background: var(--surface); text-align: left; }
.cal-ev.cal-td { border-left-style: dashed; --c: var(--text2); }
.cal-ev.done { text-decoration: line-through; color: var(--muted); }
.cal-more { font-size: 12px; color: var(--text2); padding: 0 4px; }
@media (min-width: 900px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .cal-cell { min-height: 104px; align-items: stretch; padding: 4px; }
  .cal-num { align-self: flex-start; }
  .cal-evs { display: grid; gap: 2px; }
  .cal-dots { display: none; }
}
.cal-day h2, .cal-agday h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.cal-agday { margin-bottom: 18px; }
.cal-list { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.cal-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border-top: 1px solid var(--border); text-align: left; }
.cal-item:first-child { border-top: 0; }
button.cal-item:hover { background: var(--hover); }
.cal-item.past { opacity: .6; }
.cal-item.done .cal-t { text-decoration: line-through; color: var(--muted); }
.cal-stripe { align-self: stretch; width: 4px; min-height: 32px; border-radius: 2px; background: var(--c); flex: none; }
.cal-ico { color: var(--accent); display: grid; place-items: center; flex: none; }
.cal-body { flex: 1; min-width: 0; display: grid; }
.cal-t { font-weight: 600; overflow-wrap: anywhere; }
.cal-m { font-size: 13px; color: var(--text2); }
.cal-empty { color: var(--text2); margin: 0 0 12px; }
.cal-editor .cal-f { margin-top: 14px; }
.cal-editor .field + .field { margin-top: 8px; }
.cal-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cal-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; font-weight: 600; }
.cal-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.cal-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--c); display: grid; place-items: center; border: 2px solid transparent; }
.cal-swatch svg.i { stroke: #fff; stroke-width: 3; opacity: 0; }
.cal-swatch[aria-checked="true"] { border-color: var(--text); }
.cal-swatch[aria-checked="true"] svg.i { opacity: 1; }
.cal-colname { font-weight: 500; color: var(--text2); }
.cal-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-weight: 500; }
.cal-inline .field { width: auto; flex: 1; min-width: 120px; }
.cal-inline .cal-num-in { width: 84px; flex: none; min-width: 0; }
.cal-wds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cal-wd { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--border2); font-weight: 600; text-align: center; }
.cal-wd[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cal-alert { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; }
.cal-alert .grow { flex: 1; min-width: 0; display: grid; gap: 8px; }
.cal-hint { font-weight: 500; font-size: 13px; }
.cal-err { color: var(--danger); font-weight: 600; margin-top: 12px; min-height: 0; }
.cal-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.cal-notes { resize: vertical; min-height: 84px; }
@media (min-width: 640px) { .panel.cal-editor { width: 540px; } }
/* Kontrast der Navigation (NFR-09): --muted erreicht 4,5 : 1 nicht */
.tab, .side-sect { color: var(--text2); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #17181C; } }
