/* Home keeps the calendar as one compact card, independent of the menu catalog. */
.home-calendar{ max-width:430px; margin:0 auto; }
.home-calendar [hidden]{ display:none !important; }
.home-calendar .life-card{
  padding:12px 12px 10px; border:1px solid rgba(255,255,255,.74); border-radius:23px;
  background:linear-gradient(135deg,rgba(255,255,255,.73),rgba(255,252,251,.48));
  box-shadow:var(--menu-shadow); -webkit-backdrop-filter:blur(18px) saturate(1.1); backdrop-filter:blur(18px) saturate(1.1);
}
.life-card-head{ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.life-card-head h2{ margin:0; font-size:17px; font-weight:500; letter-spacing:.04em; }
.life-example-toggle{ border:0; background:transparent; color:var(--theme-accent, #90759c); font-family:inherit; font-size:10px; min-height:36px; padding:6px; cursor:pointer; }
.life-month-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 5px; padding-left:5px; }
.life-month-title{ font-family:var(--font-en),var(--font-cn); font-size:19px; font-weight:500; letter-spacing:.025em; }
.life-month-actions{ display:flex; align-items:center; }
.life-month-actions button{ display:grid; place-items:center; min-width:32px; height:36px; border:0; border-radius:10px; padding:4px; background:transparent; color:var(--theme-accent, #8a778d); font:inherit; font-size:11px; cursor:pointer; }
.life-month-actions button svg{ width:15px; height:15px; }
.life-month-actions button:disabled{ opacity:.28; cursor:default; }
.life-modes{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; margin:0 3px 7px; padding:3px; border-radius:11px; background:rgba(var(--theme-tint-rgb, 182,154,184),.09); }
.life-modes button{ min-height:30px; padding:4px; border:0; border-radius:8px; font:inherit; font-size:11px; letter-spacing:.03em; color:var(--theme-muted, #8a7c8c); background:transparent; cursor:pointer; }
.life-modes button[aria-pressed="true"]{ background:rgba(255,255,255,.73); color:var(--theme-accent, #755c82); box-shadow:0 2px 6px rgba(var(--theme-ink-rgb, 88,65,94),.045); }
.life-weekdays,.life-grid{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.life-weekdays{ margin-bottom:5px; text-align:center; color:var(--theme-faint, #a396a3); font:9px/20px ui-monospace,"SFMono-Regular",Menlo,monospace; }
.life-day{
  position:relative; isolation:isolate; min-width:0; height:36px; padding:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  border:0; border-radius:0; background:transparent; color:var(--theme-ink, #615364); font-family:var(--font-en),var(--font-cn); font-size:15px; line-height:1; cursor:pointer;
}
.life-day:disabled{ cursor:default; }
.life-day.outside{ color:var(--theme-faint, #b5a9b4); }
.life-day.future{ opacity:.38; }
.life-date{ position:relative; z-index:2; display:grid; place-items:center; min-width:25px; height:25px; border-radius:50%; border:1px solid transparent; }
.life-day.today .life-date{ border-color:rgba(var(--theme-tint-rgb, 156,126,174),.48); }
.life-day[aria-pressed="true"] .life-date{ background:rgba(255,255,255,.62); box-shadow:0 0 0 1px rgba(var(--theme-tint-rgb, 157,127,172),.36); }
.life-day-mark{ height:11px; line-height:11px; font-size:9px; color:var(--theme-accent, #9b81a5); font-family:ui-monospace,monospace; }
.life-day-mark.dot::after{ content:""; display:block; width:3px; height:3px; margin-top:3px; background:var(--theme-accent, #b497bd); border-radius:50%; }
.life-day-mark.mood{ font-family:system-ui; font-size:11px; }
.life-grid[data-mode="sobriety"] .life-day-mark{ display:none; }
.life-day.sober::before{
  content:""; position:absolute; z-index:0; left:0; right:0; top:calc(50% - 12px); height:24px;
  background:linear-gradient(180deg,rgba(var(--theme-secondary-rgb, 213,179,235),.12),rgba(var(--theme-secondary-rgb, 202,160,225),.24),rgba(var(--theme-secondary-rgb, 213,179,235),.12));
}
.life-day.sober.run-start::before{ left:50%; }
.life-day.sober.run-end::before{ right:50%; }
.life-day.sober.run-start.run-end::before{ display:none; }
.life-day.sober.row-start::before{ border-radius:12px 0 0 12px; }
.life-day.sober.row-end::before{ border-radius:0 12px 12px 0; }
.life-flower{
  position:absolute; z-index:1; width:35px; height:35px; top:calc(50% - 17.5px); left:calc(50% - 17.5px); pointer-events:none;
  background:radial-gradient(circle,rgba(var(--theme-secondary-rgb, 210,170,232),.67),rgba(var(--theme-secondary-rgb, 220,193,235),.5));
  clip-path:polygon(50% 0%,61% 9%,75% 7%,81% 20%,94% 25%,91% 40%,100% 50%,91% 61%,94% 75%,80% 81%,75% 94%,61% 91%,50% 100%,39% 91%,25% 94%,19% 80%,6% 75%,9% 60%,0% 50%,9% 39%,6% 25%,20% 19%,25% 6%,39% 9%);
}
.life-summary{ display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; padding:11px 4px 0; margin-top:7px; border-top:1px solid rgba(var(--theme-tint-rgb, 143,120,150),.11); }
.life-summary-text{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.life-summary-main{ color:var(--theme-accent, #7c608b); font-size:12px; line-height:1.5; }
.life-summary-sub{ color:var(--theme-muted, #9a879f); font-size:9px; line-height:1.5; }
.life-edit-day{ flex:none; border:0; border-radius:10px; background:rgba(var(--theme-tint-rgb, 180,148,196),.1); color:var(--theme-accent, #856594); padding:8px 10px; min-height:36px; font:inherit; font-size:10px; cursor:pointer; }
.life-legend{ display:flex; align-items:center; justify-content:center; gap:13px; margin:11px 0 0; font-size:9px; color:var(--theme-muted, #96829d); }
.life-legend span{ display:flex; align-items:center; gap:5px; }
.life-legend i{ width:17px; height:6px; border-radius:9px; background:rgba(var(--theme-secondary-rgb, 205,168,226),.4); }
.life-legend .unlogged{ width:4px; height:4px; border-radius:50%; background:transparent; border:1px solid var(--theme-faint, #b9a8bd); }
.life-local-note{ padding:0 8px; margin:14px 0 0; text-align:center; color:var(--theme-muted, #897a8d); font-size:9px; line-height:1.8; }
.life-preview-tools{ text-align:center; }
.life-example-note{ display:block; margin-top:3px; color:var(--theme-accent, #9879a7); }
.life-editor{
  --life-ink:var(--theme-ink, #514354); --life-muted:var(--theme-muted, #947f9a);
  --life-sheet-height:min(88dvh,760px);
  position:fixed; inset:auto 0 0; width:min(100%,500px); max-width:none; height:var(--life-sheet-height); max-height:var(--life-sheet-height); margin:0 auto;
  padding:0; overflow:hidden; border:1px solid rgba(255,255,255,.85); border-bottom:0; border-radius:26px 26px 0 0;
  background:linear-gradient(150deg,rgba(255,250,248,.98),rgba(var(--theme-paper-rgb, 246,236,244),.97)); color:var(--life-ink);
  box-shadow:0 -10px 60px rgba(var(--theme-ink-rgb, 78,49,80),.15); font-family:var(--font-cn);
}
.life-editor::backdrop{ background:rgba(var(--theme-ink-rgb, 81,63,84),.16); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
/* A single native scroller owns the title, fields and actions. There is no
   stationary footer for WebKit's caret scrolling to move a textarea beneath. */
.life-editor form{ display:block; height:100%; max-height:100%; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; margin:0; }
.life-editor form{ scroll-padding-top:calc(env(safe-area-inset-top) + 12px); scroll-padding-bottom:12px; }
.life-sheet-head{ flex:none; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:19px 21px 13px; border-bottom:1px solid rgba(var(--theme-tint-rgb, 161,136,168),.1); }
.life-sheet-head h2{ margin:0; font-size:21px; font-weight:500; }
.life-sheet-head p{ margin:5px 0 0; font-size:10px; color:var(--life-muted); }
.life-sheet-close{ width:38px; height:38px; flex:none; display:grid; place-items:center; border:0; border-radius:50%; background:rgba(var(--theme-tint-rgb, 175,149,185),.07); color:var(--theme-accent, #96809e); cursor:pointer; }
.life-sheet-close svg{ width:17px; height:17px; }
.life-sheet-body{ overflow:visible; padding:18px 21px 12px; }
.life-editor fieldset{ margin:0 0 21px; padding:0; border:0; min-width:0; }
.life-editor legend{ margin-bottom:12px; padding:0; font-size:13px; letter-spacing:.06em; }
.life-sleep-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.life-editor label{ display:block; color:var(--theme-muted, #8c7992); font-size:11px; line-height:1.6; }
.life-editor input[type="date"],.life-editor input[type="time"],.life-editor textarea{
  display:block; width:100%; min-width:0; -webkit-appearance:none; appearance:none;
  border:1px solid rgba(var(--theme-tint-rgb, 167,145,174),.19); border-radius:10px; background:rgba(255,255,255,.55); color:var(--theme-ink, #615269);
  padding:8px 9px; font-family:inherit; font-size:16px; line-height:1.4;
}
.life-editor input[type="date"]{ margin-top:5px; font-size:12px; }
.life-editor input[type="time"]{ margin-top:6px; min-height:40px; }
.life-editor textarea{ resize:vertical; min-height:64px; margin-top:10px; font-size:13px; }
.life-editor input:focus-visible,.life-editor textarea:focus-visible,.life-editor button:focus-visible{ outline:2px solid var(--theme-accent, #ab8fbb); outline-offset:2px; }
.life-options{ display:flex; flex-wrap:wrap; gap:6px; }
.life-options label{ position:relative; cursor:pointer; }
.life-options input{ position:absolute; width:1px; height:1px; opacity:0; }
.life-options span{ display:block; padding:8px 10px; min-height:34px; border:1px solid rgba(var(--theme-tint-rgb, 174,147,185),.17); border-radius:10px; color:var(--theme-muted, #95809e); font-size:11px; line-height:16px; }
.life-options input:checked + span{ background:rgba(var(--theme-tint-rgb, 207,181,221),.22); border-color:rgba(var(--theme-tint-rgb, 165,131,181),.36); color:var(--theme-accent, #7e618d); }
.life-options input:focus-visible + span{ outline:2px solid var(--theme-accent, #ab8fbb); outline-offset:2px; }
.life-mood-options{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:5px; }
.life-mood-options button{ min-width:0; padding:7px 0; border:1px solid transparent; border-radius:12px; background:transparent; cursor:pointer; }
.life-mood-options button[aria-pressed="true"]{ background:rgba(var(--theme-tint-rgb, 207,181,221),.23); border-color:rgba(var(--theme-tint-rgb, 165,131,181),.3); }
.life-mood-options b{ display:block; font:21px/1.4 system-ui; }
.life-mood-options span{ display:block; margin-top:3px; font:9px/1.4 var(--font-cn); color:var(--theme-muted, #917c97); }
.life-sleep-duration{ margin:8px 0 0; color:var(--theme-accent, #9a81a5); font-size:10px; }
.life-sheet-foot{ flex:none; padding:12px 21px calc(13px + env(safe-area-inset-bottom)); border-top:1px solid rgba(var(--theme-tint-rgb, 161,136,168),.11); }
.life-editor[data-keyboard-active] .life-sheet-foot{ padding-bottom:13px; }
.life-sheet-actions{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:10px; }
.life-save{ display:block; width:100%; min-height:44px; padding:10px; border:1px solid rgba(255,255,255,.8); border-radius:13px; background:rgba(var(--theme-tint-rgb, 198,174,210),.37); color:var(--theme-accent, #795a86); font:13px var(--font-cn); cursor:pointer; }
.life-form-error{ margin:0 0 10px; font-size:11px; line-height:1.6; color:#8f596e; }
@media (pointer:coarse){
  .life-day{ height:44px; }
  .life-example-toggle,.life-month-actions button,.life-edit-day{ min-height:44px; }
  .life-modes button{ min-height:36px; }
  .life-options span{ min-height:42px; padding-top:12px; padding-bottom:12px; }
  .life-editor textarea{ font-size:16px; }
}
@media (max-width:359px){
  .home-calendar .life-card{ padding:13px 8px 10px; }
  .life-month-title{ font-size:17px; }
  .life-sheet-body{ padding-left:15px; padding-right:15px; }
  .life-options span{ padding-left:8px; padding-right:8px; }
}
.life-notification{ padding:0 8px; margin:0 0 9px; text-align:center; color:var(--theme-accent, #9572a0); font-size:10px; line-height:1.7; }
.life-notify{ min-width:0; min-height:44px; padding:10px; border:1px solid rgba(var(--theme-tint-rgb, 198,174,210),.22); border-radius:13px; background:rgba(255,255,255,.25); color:var(--theme-accent, #886293); font:13px var(--font-cn); cursor:pointer; }
.life-notify:disabled{ opacity:.5; cursor:default; }
.life-save:disabled{ opacity:.55; cursor:wait; }
@media(max-width:600px){
  .life-editor{ inset:0; width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
  .life-sheet-head{ padding-top:calc(19px + env(safe-area-inset-top)); }
}
.life-chat-update{ display:block; padding:0 16px; }
.life-chat-update details{ width:fit-content; max-width:100%; margin:auto; color:var(--text-soft); font-size:11px; line-height:1.6; }
.life-chat-update summary{ cursor:pointer; padding:8px 12px; border-radius:14px; background:rgba(var(--theme-tint-rgb, 220,209,230),.2); }
.life-chat-update details > div{ padding:12px 14px; max-width:540px; white-space:pre-wrap; overflow-wrap:anywhere; background:rgba(var(--theme-paper-rgb, 248,244,250),.46); border-radius:14px; }
