/* Calendar for Jan and Can: a garden almanac for two.
   One bold thing: the big date numeral. Everything else quiet. */

@font-face {
  font-family: 'Bricolage'; font-style: normal; font-weight: 300 800; font-stretch: 75% 100%; font-display: swap;
  src: url(fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage'; font-style: normal; font-weight: 300 800; font-stretch: 75% 100%; font-display: swap;
  src: url(fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: 'Bricolage', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
  --bg: #eef2ea;
  --surface: #ffffff;
  --surface-2: #f6f8f3;
  --sunk: #e4eadf;
  --ink: #1c2921;
  --ink-2: #536258;
  --ink-3: #87958b;
  --line: #d9e1d5;
  --line-2: #e8ede5;
  --accent: #2e7a4e;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe2;
  --today: #d8402a;
  --today-soft: #fbe3dd;
  --off: #c23a2b;
  --cn: #c0262d;
  --term: #3d7a5f;
  --shadow: 0 1px 2px rgba(28, 41, 33, .06), 0 6px 20px rgba(28, 41, 33, .08);
  --shadow-up: 0 -1px 0 var(--line), 0 -8px 24px rgba(28, 41, 33, .05);
  --tab-h: 62px;
  --r: 14px;
  --hour: 52px;

  --tomato: #e0533d; --chili: #ec8530; --mustard: #d4a017; --pea: #74b043; --moss: #3e8e5e; --teal: #219594;
  --borage: #4a7dd6; --lavender: #8b6bd4; --beet: #b3376c; --rose: #dc6a9c; --earth: #96704d; --slate: #6b7a8c;
  --tint: 20%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1411; --surface: #161f1a; --surface-2: #1b2520; --sunk: #0b100d; --ink: #e3ebe5; --ink-2: #a3b1a8; --ink-3: #6f7e75;
    --line: #28342d; --line-2: #202a24; --accent: #68c08c; --accent-ink: #0b1a11; --accent-soft: #1d3426; --today: #ff6a50; --today-soft: #3a1d17;
    --off: #ff7a68; --cn: #ff6b70; --term: #7cc4a2; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --shadow-up: 0 -1px 0 var(--line);
    --tint: 30%; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1411; --surface: #161f1a; --surface-2: #1b2520; --sunk: #0b100d; --ink: #e3ebe5; --ink-2: #a3b1a8; --ink-3: #6f7e75;
  --line: #28342d; --line-2: #202a24; --accent: #68c08c; --accent-ink: #0b1a11; --accent-soft: #1d3426; --today: #ff6a50; --today-soft: #3a1d17;
  --off: #ff7a68; --cn: #ff6b70; --term: #7cc4a2; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --shadow-up: 0 -1px 0 var(--line);
  --tint: 30%; color-scheme: dark;
}

/* colour classes: c-<name> sets --c */
.c-tomato { --c: var(--tomato); } .c-chili { --c: var(--chili); } .c-mustard { --c: var(--mustard); } .c-pea { --c: var(--pea); }
.c-moss { --c: var(--moss); } .c-teal { --c: var(--teal); } .c-borage { --c: var(--borage); } .c-lavender { --c: var(--lavender); }
.c-beet { --c: var(--beet); } .c-rose { --c: var(--rose); } .c-earth { --c: var(--earth); } .c-slate { --c: var(--slate); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; font-optical-sizing: auto;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; display: block; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#app { min-height: 100dvh; }
.shell { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }

/* ---- top bar ---------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; display: flex; align-items: center; gap: 10px; min-height: 56px;
}
.top h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variation-settings: 'opsz' 48; }
.top h1 small { font-weight: 500; color: var(--ink-3); margin-left: 6px; font-size: 16px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.iconbtn:active { background: var(--sunk); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; background: var(--c); flex: none; }
.avatar.sm { width: 20px; height: 20px; font-size: 11px; }
.avatar.xs { width: 16px; height: 16px; font-size: 9px; }
.pill-btn { padding: 7px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px; color: var(--ink); }
.pill-btn:active { background: var(--sunk); }

/* ---- tab bar ----------------------------------------------------------------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface);
  box-shadow: var(--shadow-up); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { flex: 1; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.tabs button.on { color: var(--accent); }
.tabs button.on .ic { stroke-width: 2.2; }
.fab {
  position: fixed; z-index: 31; right: 18px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  width: 58px; height: 58px; border-radius: 20px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .15s;
}
.fab:active { transform: scale(.93); }

/* ---- segmented control & chips --------------------------------------------------- */
.seg { display: flex; background: var(--sunk); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 7px 8px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); white-space: nowrap;
}
.chip.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip.col.on { background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 2px var(--c); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip .x { margin-right: -4px; opacity: .6; }

/* ---- today ---------------------------------------------------------------------- */
.todaypage { padding: 4px 16px 24px; max-width: 760px; margin: 0 auto; }
.hero { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: end; padding: 6px 0 18px; }
.hero .big {
  font-size: 104px; line-height: .8; font-weight: 750; letter-spacing: -.05em; font-variation-settings: 'opsz' 96;
  color: var(--today); font-variant-numeric: lining-nums;
}
.hero .what { padding-bottom: 4px; min-width: 0; }
.hero .wd { font-size: 22px; font-weight: 700; line-height: 1.1; }
.hero .md { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.hero .lunarline { margin-top: 6px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; flex-wrap: wrap; }
.wxcard {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); margin-bottom: 18px;
}
.wxcard .temp { font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.wxcard .hours { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.wxcard .hours::-webkit-scrollbar { display: none; }
.wxcard .hr { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink-2); gap: 2px; min-width: 30px; }
.marks { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.mark { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.mark.cn { color: var(--cn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cn) 35%, transparent); }
.mark.term { color: var(--term); }
.mark.off { color: var(--off); }
.section { margin-top: 22px; }
.section > h2 { font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.section > h2 .count { font-weight: 600; color: var(--ink-3); }
.list { background: var(--surface); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 52px; border-top: 1px solid var(--line-2); width: 100%; text-align: left; }
.item:first-child { border-top: 0; }
.item:active { background: var(--surface-2); }
.item .time { width: 48px; flex: none; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.item .time small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.item .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex: none; }
.item .t { font-weight: 600; line-height: 1.25; }
.item .meta { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.item.done .t { text-decoration: line-through; color: var(--ink-3); }
.band { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); font-weight: 600; margin-bottom: 8px; width: 100%; text-align: left; }
.band .faint { font-weight: 500; }
.empty { padding: 18px; text-align: center; color: var(--ink-3); font-size: 15px; }
.updays .uday { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-2); align-items: flex-start; width: 100%; text-align: left; }
.updays .uday:first-child { border-top: 0; }
.uday .when { width: 64px; flex: none; }
.uday .when b { display: block; font-size: 14px; }
.uday .when span { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.uday .things { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; font-size: 14px; }
.uday .thing { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.uday .thing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; transform: translateY(-1px); font-style: normal; }

/* weather and moon glyphs */
.wx { flex: none; display: block; overflow: visible; }
.w-sun circle { fill: #f4b23a; }
.w-sun line { stroke: #f4b23a; stroke-width: 1.7; stroke-linecap: round; }
.w-moon { fill: #d9c27a; }
.w-cloud { fill: #d3dbe2; stroke: #9eabb7; stroke-width: .9; }
.w-rain line { stroke: #3f8fd8; stroke-width: 1.7; stroke-linecap: round; }
.w-rain circle { fill: #3f8fd8; }
.w-snow circle { fill: #8fbfe9; }
.w-bolt { fill: none; stroke: #f0a51e; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.w-fog line { stroke: #a2adb7; stroke-width: 1.7; stroke-linecap: round; }
.moon { flex: none; display: block; }
.moon-dark { fill: var(--sunk); stroke: color-mix(in srgb, var(--ink-3) 60%, transparent); stroke-width: .8; }
.moon-lit { fill: #e8cf73; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-cloud { fill: #56646f; stroke: #7d8b96; } :root:not([data-theme="light"]) .moon-lit { fill: #f2df98; } }
:root[data-theme="dark"] .w-cloud { fill: #56646f; stroke: #7d8b96; }

/* checkbox */
.check {
  width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center; color: transparent;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 70%, var(--ink-3)); transition: background .15s, transform .15s;
}
.check.round { border-radius: 50%; }
.check.on { background: var(--c); color: #fff; box-shadow: none; animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.25); } }
.window-bar { height: 4px; border-radius: 4px; background: var(--sunk); overflow: hidden; width: 70px; display: inline-block; vertical-align: middle; }
.window-bar i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.tag-over { color: var(--today); font-weight: 600; }

/* ---- calendar shell ------------------------------------------------------------------ */
.calbar { display: flex; gap: 8px; align-items: center; padding: 0 16px 8px; position: sticky; top: calc(env(safe-area-inset-top) + 56px); z-index: 19; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.calbar .seg { flex: 1; }
.swipe { touch-action: pan-y; overflow: hidden; }
.slide { will-change: transform; }
.slide.anim { transition: transform .22s cubic-bezier(.2,.8,.2,1); }

/* month */
.month { padding: 0 6px; user-select: none; -webkit-user-select: none; }
.wkhead { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: center; padding: 2px 0 4px; }
.wkhead.wn { grid-template-columns: 22px repeat(7, 1fr); }
.mrow { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.mcell { position: relative; min-width: 0; width: 100%; padding: 3px 3px 0; min-height: var(--cell-h, 92px); text-align: left; display: flex; flex-direction: column; align-items: center; border-left: 1px solid var(--line-2); }
.mcell:first-child { border-left: 0; }
.mcell.out { opacity: .42; }
.mcell.sel { background: var(--accent-soft); border-radius: 10px; }
.mcell .dn { font-size: 15px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; line-height: 1; }
.mcell.off .dn, .mcell.sun .dn { color: var(--off); }
.mcell.today .dn { background: var(--today); color: #fff; }
.mcell .lu { font-size: 10px; line-height: 1.1; color: var(--ink-3); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: -1px; }
.mcell .lu.fest { color: var(--cn); font-weight: 600; }
.mcell .lu.term { color: var(--term); }
.mcell .hol { font-size: 9.5px; line-height: 1.1; color: var(--off); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mcell .corner { position: absolute; top: 3px; right: 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; opacity: .9; }
.mcell .corner .moon { width: 11px; height: 11px; }
.mcell .bgband { position: absolute; inset: 0; background: color-mix(in srgb, var(--c) calc(var(--tint) * .6), transparent); pointer-events: none; }
.mbars { position: absolute; left: 0; right: 0; pointer-events: none; }
.mbar {
  position: absolute; height: 17px; border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 17px; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--ink); box-shadow: inset 2px 0 0 var(--c);
}
.mbar.timed { background: transparent; box-shadow: none; padding-left: 9px; font-weight: 500; }
.mbar.timed::before { content: ''; position: absolute; left: 2px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.mbar.task { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 60%, transparent); }
.mbar.task.done { opacity: .5; text-decoration: line-through; }
.mbar.win { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); font-weight: 500; }
.mbar.bg { background: transparent; box-shadow: none; color: color-mix(in srgb, var(--c) 70%, var(--ink)); font-weight: 700; padding-left: 4px; }
.mmore { position: absolute; font-size: 10.5px; color: var(--ink-2); font-weight: 600; padding-left: 4px; }
.daypanel { padding: 12px 16px 24px; max-width: 760px; margin: 0 auto; }
.daypanel h3 { margin: 0 0 8px; font-size: 17px; display: flex; align-items: center; gap: 8px; }

/* time grid (day / 3 days / week) */
.tg { --gut: 46px; user-select: none; -webkit-user-select: none; }
.tg.tz2 { --gut: 84px; }
.tghead { display: grid; grid-template-columns: var(--gut) repeat(var(--n), minmax(0, 1fr)); padding: 0 6px 0 0; }
.tghead .dh { text-align: center; padding: 2px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; min-width: 0; }
.tghead .dh .w { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.tghead .dh .n { font-size: 19px; font-weight: 700; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.tghead .dh.today .n { background: var(--today); color: #fff; }
.tghead .dh.off .n { color: var(--off); }
.tghead .dh.today.off .n { color: #fff; }
.tghead .dh .sub { font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; gap: 3px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.tghead .dh .sub.fest { color: var(--cn); font-weight: 600; }
.tgall { display: grid; grid-template-columns: var(--gut) minmax(0, 1fr); border-bottom: 1px solid var(--line); padding-right: 6px; }
.tgall .lbl { font-size: 10.5px; color: var(--ink-3); text-align: right; padding: 4px 6px 0 0; }
.tgall .lanes { position: relative; }
.tgscroll { overflow-y: auto; height: calc(100dvh - var(--tg-top, 250px) - var(--tab-h) - env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.tgbody { position: relative; display: grid; grid-template-columns: var(--gut) repeat(var(--n), minmax(0, 1fr)); height: calc(var(--hour) * 24); padding-right: 6px; }
.tggut { position: relative; }
.tggut .h { position: absolute; right: 6px; font-size: 11px; color: var(--ink-3); transform: translateY(-50%); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.tggut .h .z2 { color: var(--ink-3); opacity: .7; min-width: 30px; text-align: right; }
.tggut .wxh { position: absolute; left: 2px; display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--ink-2); line-height: 1; }
.tgcol { position: relative; min-width: 0; border-left: 1px solid var(--line-2); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line-2) calc(var(--hour) - 1px), var(--line-2) var(--hour)); }
.tgcol.bgtint { background-color: color-mix(in srgb, var(--c) calc(var(--tint) * .45), transparent); }
.tgcol.today { background-color: color-mix(in srgb, var(--today) 4%, transparent); }
.ev {
  position: absolute; border-radius: 7px; padding: 3px 5px; font-size: 12px; line-height: 1.2; overflow: hidden; text-align: left;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px var(--surface); color: var(--ink);
}
.ev b { font-weight: 650; display: block; overflow-wrap: anywhere; }
.ev span { color: var(--ink-2); font-size: 11px; }
.ev.busy { background: repeating-linear-gradient(135deg, var(--sunk) 0 5px, var(--surface-2) 5px 10px); box-shadow: inset 3px 0 0 var(--ink-3); }
.ev.drag { opacity: .85; box-shadow: inset 3px 0 0 var(--c), 0 8px 24px rgba(0,0,0,.2); z-index: 5; }
.nowline { position: absolute; left: -4px; right: 0; height: 2px; background: var(--today); z-index: 4; pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: 0; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--today); }
.ghost { position: absolute; left: 2px; right: 2px; border-radius: 7px; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); z-index: 3; pointer-events: none; font-size: 12px; padding: 3px 6px; font-weight: 600; color: var(--accent); }

/* year */
.year { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; padding: 6px 16px 24px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 700px) { .year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .year { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mini { text-align: left; display: block; width: 100%; min-width: 0; }
.mini h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--ink); }
.mini h4.cur { color: var(--today); }
.mini .g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.mini .d { aspect-ratio: 1; display: grid; place-items: center; font-size: 10.5px; border-radius: 50%; position: relative; font-variant-numeric: tabular-nums; }
.mini .d.off { color: var(--off); }
.mini .d.fest { color: var(--cn); font-weight: 700; }
.mini .d.has::after { content: ''; position: absolute; bottom: 1px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.mini .d.bg { background: color-mix(in srgb, var(--c) calc(var(--tint) * .9), transparent); border-radius: 3px; }
.mini .d.today { background: var(--today); color: #fff; }

/* ---- tasks & shopping ----------------------------------------------------------------- */
.tasks { padding: 0 16px 24px; max-width: 760px; margin: 0 auto; }
.filters { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 10px; max-width: 760px; margin: 0 auto; }
.group { margin-top: 16px; }
.group > .gh { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 700; font-size: 15px; width: 100%; text-align: left; }
.group > .gh .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.group > .gh .count { color: var(--ink-3); font-weight: 600; }
.trow { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-2); width: 100%; text-align: left; }
.trow:first-child { border-top: 0; }
.trow .check { margin-top: 1px; }
.trow .body { flex: 1; min-width: 0; }
.trow .t { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.trow.done .t { text-decoration: line-through; color: var(--ink-3); }
.trow .meta { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.trow .meta .ic { width: 14px; height: 14px; }
.trow .tog { color: var(--ink-3); padding: 2px; margin: -2px; }
.trow.child { padding-left: calc(14px + var(--depth) * 22px); }
.prog { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.quickadd { display: flex; gap: 8px; margin: 4px 0 6px; }
.quickadd input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; }
.quickadd button { padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* ---- sheets ------------------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 18, 13, .35); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top) + 10px); background: var(--bg);
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .28s cubic-bezier(.2,.8,.2,1); max-width: 680px; margin: 0 auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .sh { display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px; border-bottom: 1px solid var(--line-2); }
.sheet .sh h2 { flex: 1; text-align: center; margin: 0; font-size: 17px; font-weight: 700; }
.sheet .sh .txtbtn { padding: 8px 10px; font-weight: 600; color: var(--ink-2); min-width: 72px; text-align: left; }
.sheet .sh .txtbtn.primary { color: var(--accent); text-align: right; font-weight: 700; }
.sheet .sb { flex: 1; overflow-y: auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.field { background: var(--surface); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line-2); margin-bottom: 12px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 50px; border-top: 1px solid var(--line-2); }
.frow:first-child { border-top: 0; }
.frow > .ic { color: var(--ink-3); }
.frow label, .frow .lbl { flex: 1; font-weight: 500; }
.frow .val { color: var(--ink-2); }
.frow input[type=text], .frow input[type=password], .frow input[type=number], .frow input:not([type]), .frow textarea, .frow select {
  border: 0; background: transparent; outline: none; font-size: 16px; min-width: 0;
}
.frow input.big { font-size: 20px; font-weight: 650; flex: 1; padding: 4px 0; }
.frow textarea { flex: 1; resize: none; min-height: 90px; line-height: 1.45; padding: 4px 0; }
.frow input[type=date], .frow input[type=time] {
  border: 0; background: var(--sunk); border-radius: 9px; padding: 6px 10px; font-size: 15px; font-weight: 600; color: var(--ink); min-height: 34px;
}
.frow.dt { gap: 8px; }
.frow.dt .lbl { flex: none; width: 58px; }
.frow.dt input[type=date] { flex: 1 1 0; min-width: 0; }
.frow.dt input[type=time] { flex: 0 1 112px; min-width: 0; }
.frow select { background: var(--sunk); border-radius: 9px; padding: 6px 10px; font-weight: 600; max-width: 60%; }
.frow .seg { flex: 1; }
.alt { padding: 0 14px 10px; font-size: 13px; color: var(--ink-2); margin-top: -6px; }
.toggle { width: 50px; height: 30px; border-radius: 999px; background: var(--sunk); position: relative; flex: none; transition: background .15s; box-shadow: inset 0 0 0 1px var(--line); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.toggle.on { background: var(--accent); box-shadow: none; }
.toggle.on::after { transform: translateX(20px); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; }
.swatch { width: 32px; height: 32px; border-radius: 10px; background: var(--c); position: relative; }
.swatch.on::after { content: ''; position: absolute; inset: -4px; border-radius: 13px; box-shadow: 0 0 0 2px var(--ink); }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; border-radius: 13px; font-weight: 700; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.danger { color: var(--today); }
.btn:active { opacity: .85; }
.hint { font-size: 13px; color: var(--ink-2); padding: 0 4px 10px; line-height: 1.45; }
.sec-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 18px 4px 6px; }
.infoline { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 4px 0 14px; }
.daychips { display: flex; gap: 6px; }
.daychips button { width: 36px; height: 36px; border-radius: 50%; font-weight: 700; font-size: 13px; background: var(--sunk); color: var(--ink-2); }
.daychips button.on { background: var(--accent); color: var(--accent-ink); }
.choice { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; animation: up .22s ease; }
.choice .list { margin-bottom: 8px; }
.choice .item { justify-content: center; font-weight: 600; color: var(--accent); min-height: 54px; }
.choice .q { text-align: center; padding: 12px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }

.toast {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 86px);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; display: flex; gap: 14px; align-items: center;
  box-shadow: var(--shadow); animation: toastin .25s ease; max-width: calc(100vw - 32px);
}
.toast button { color: var(--accent-soft); font-weight: 700; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
.offline { position: sticky; top: 0; z-index: 25; background: var(--today-soft); color: var(--ink); font-size: 13px; padding: calc(env(safe-area-inset-top) + 6px) 16px 6px; text-align: center; }

/* ---- login ---------------------------------------------------------------------------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.login .mark-big { font-size: 120px; line-height: .8; font-weight: 750; color: var(--today); letter-spacing: -.05em; font-variation-settings: 'opsz' 96; }
.login h1 { font-size: 26px; margin: 18px 0 4px; }
.login p { color: var(--ink-2); margin: 0 0 22px; }
.who { display: flex; gap: 10px; margin-bottom: 14px; }
.who button { flex: 1; padding: 18px 10px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.who button.on { box-shadow: inset 0 0 0 2.5px var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.who .avatar { width: 46px; height: 46px; font-size: 20px; }
.login input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 17px; margin-bottom: 12px; }
.err { color: var(--today); font-size: 14px; margin: -4px 0 12px; }

@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 88px; }
  .tabs { top: 0; bottom: 0; right: auto; width: 88px; flex-direction: column; justify-content: center; box-shadow: 1px 0 0 var(--line); padding: 0; }
  .tabs button { flex: none; height: 76px; }
  .fab { bottom: 24px; right: 24px; }
  .toast { bottom: 28px; }
  .tgscroll { height: calc(100dvh - var(--tg-top, 250px)); }
  .month { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
