/* Chat controls share the bottom navigation's water-glass surface. */
.chat-status-capsule {
  display: flex; align-items: center; gap: 0; padding: 0 5px;
  border: 1px solid rgba(255,255,255,.72); border-radius: 40px;
  background: linear-gradient(135deg,#ffffff55,#ffffff16);
  box-shadow: inset 0 2px 12px #ffffff55,0 5px 16px #17453912;
  backdrop-filter: blur(10px) saturate(170%); -webkit-backdrop-filter: blur(10px) saturate(170%);
}
.top-bar .chat-locator-rail,.top-bar #serverStatus { width: 40px; height: 40px; flex-basis: 40px; padding: 9px; }
.top-bar .chat-locator-rail svg,.gateway-water { width: 22px; height: 22px; }
.gateway-water { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: hidden; }
.water-drop { opacity: 0; transition: opacity .4s; }
.water-stream { opacity: 1; transition: opacity .4s; }
.online .water-stream { animation: water-flow 3s linear infinite; }
.connecting .water-stream { animation: water-flow 1.5s linear infinite,water-pulse 1.5s ease-in-out infinite; }
.offline .water-stream { opacity: 0; }
.offline .water-drop { opacity: 1; }
@keyframes water-flow { to { transform: translateX(-24px); } }
@keyframes water-pulse { 50% { opacity: .25; } }
#messageList { -webkit-mask-image: linear-gradient(to bottom,transparent 0,#000 56px); mask-image: linear-gradient(to bottom,transparent 0,#000 56px); padding-top: 28px; }
.message-body { gap: 14px; }
.message .message-content { line-height: 1.8; }
.message .message-content p { margin: 0 0 .85em; }
.message .message-content > :last-child { margin-bottom: 0; }
.message.user .message-content.user-paragraphs { white-space: normal; }
.message.user .message-content.user-paragraphs p { white-space: pre-wrap; }
.message .message-reasoning,.message .message-tools { margin: 0; }
.message .message-reasoning > summary,.message .message-tools > summary { min-height: 24px; padding: 0; line-height: 1.8; }
.activity-sheet header { justify-content: center; min-height: 44px; padding-bottom: 12px; text-align: center; flex-shrink: 0; }
.activity-sheet h2 { text-align: center; }
.activity-sheet:focus { outline: none; }
.activity-sheet .message-reasoning-content { white-space: normal; }

.memory-entrance { margin: auto 0; padding: 20px 0 12px; }
.memory-weather { width: min(92%,370px); display: flex; align-items: center; gap: 14px; margin: 0 auto; padding: 0; color: var(--ink); background: none; border: 0; text-align: left; }
.memory-weather-icon { font: 36px Georgia,serif; }
.memory-weather > strong { font-size: 34px; font-weight: 400; }
.memory-weather { cursor: pointer; }
.weather-city-sheet form { display: flex; gap: 10px; }
.weather-city-sheet input { width: 100%; min-width: 0; padding: 12px; border: 1px solid #bccdc4; border-radius: 10px; background: #fff8; }
.weather-city-sheet button { border: 0; padding: 10px; border-radius: 10px; color: var(--accent-ink); background: #dfebe3; }
.weather-city-results { display: grid; gap: 8px; margin: 18px 0; max-height: 36dvh; overflow-y: auto; font-size: 13px; }
.weather-city-results button { text-align: left; }
.weather-city-sheet a { font-size: 10px; color: var(--muted); }
.memory-weather-place { display: flex; flex-direction: column; gap: 5px; margin-left: auto; text-align: right; min-width: 0; max-width: 65%; }
.memory-weather-place > span { font-size: 14px; }
.memory-weather-place small { font-size: 11px; line-height: 1.5; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memory-week { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); width: min(96%,390px); margin: 26px auto 56px; gap: 4px; }
.memory-day { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.memory-day span { font-size: 10px; color: var(--muted); }
.memory-day strong { display: grid; place-items: center; width: 30px; height: 30px; font-size: 17px; font-weight: 400; }
.memory-day.is-today strong { border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-ink); background: #ffffff30; }
.memory-deck.is-expanded { height: 256px; }

/* The home backdrop is independent of the user's background on other pages. */
body.home-atmosphere::before,body.home-atmosphere::after { opacity: 0; }
body.home-atmosphere { background: #b8cfce; }
.home-atmosphere .phone-shell { position: relative; }
.home-atmosphere .screen { overflow: visible; }
#homeView { isolation: isolate; padding: 36px 20px 76px; overflow: visible; gap: 0; }
.home-sky { position: absolute; inset: calc(-1 * var(--ui-safe-top) - 2px) 0 -110px; z-index: -2; pointer-events: none; background: #b8cfce url("assets/atmosphere/sky.png") center/cover no-repeat; transition: filter 2s; }
#homeView::before { content: ""; position: absolute; inset: calc(-1 * var(--ui-safe-top) - 2px) 0 -110px; z-index: -1; pointer-events: none; background: linear-gradient(180deg,#b8ded32b,#82b1aa18 55%,#b9d9ce75); transition: background 2s; }
#homeView[data-sky="dusk"] .home-sky { filter: sepia(.36) saturate(1.25); }
#homeView[data-sky="dusk"]::before { background: linear-gradient(#efb37f35,#e7a58950 60%,#c0b29e60); }
#homeView[data-sky="night"] .home-sky { filter: brightness(.34) saturate(.7); }
#homeView[data-sky="night"]::before { background: linear-gradient(#162b5244,#344e6560); }
#homeView[data-sky="night"] { color: #f4f5e9; }
#homeView[data-sky="overcast"] .home-sky { filter: saturate(.35) brightness(.86); }
#homeView[data-sky="overcast"]::before { background: linear-gradient(#6c929940,#9ab7b335); }
.home-sky-stars { display: none; position: absolute; inset: 0; pointer-events: none; z-index: -1; background-image: radial-gradient(circle at 15% 15%,#fff 0 1px,transparent 1.5px),radial-gradient(circle at 73% 24%,#fff 0 1px,transparent 1.5px),radial-gradient(circle at 39% 38%,#fff 0 .8px,transparent 1.5px),radial-gradient(circle at 87% 12%,#fff 0 1px,transparent 2px),radial-gradient(circle at 54% 7%,#fff9 0 .8px,transparent 1.5px); }
[data-sky="night"] .home-sky-stars { display: block; }
#homeView .home-brand { font-size: clamp(34px,10vw,48px); font-weight: 300; margin: 20px 0 0; color: inherit; text-shadow: 0 2px 18px #ffffff30; }
#homeView .home-brand i { font-size: .65em; font-weight: 300; }
.home-sky-mood { font-size: 13px; text-align: center; line-height: 1.8; opacity: .72; margin: 20px 20px 0; }
#homeView .home-card-grid { width: 100%; flex: 0 0 auto; min-height: 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); grid-template-rows: auto; gap: 8px; margin-top: auto; padding-top: 40px; }
#homeView .home-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; min-height: 0; min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: inherit; }
#homeView .home-card::before,#homeView .home-card::after { display: none; }
#homeView .home-card-icon { display: grid; place-items: center; width: clamp(42px,12vw,58px); height: clamp(42px,12vw,58px); border: 1px solid color-mix(in srgb,var(--accent) 75%,white); border-radius: 50%; background: #f5fff222; box-shadow: 0 4px 12px #17382d18; color: var(--accent-ink); }
#homeView[data-sky="night"] .home-card-icon { color: #effbf4; }
#homeView .home-card-icon svg { width: 26px; height: 26px; stroke-width: 1.35; }
#homeView .home-card-copy { display: block; text-align: center; }
#homeView .home-card-copy strong { font-size: 12px; color: inherit; white-space: nowrap; }
#homeView .home-card-copy small { display: none; }
#homeView .toolbox-strip { display: none; }
#homeView .home-notice:empty { display: none; }
#homeView .home-notice { margin-top: 12px; }
.home-toolbox-sheet { position: fixed; inset: auto 0 0; margin: 0 auto; width: min(100%,600px); padding: 28px 24px max(28px,var(--ui-safe-bottom)); border: 0; border-radius: 24px 24px 0 0; background: #f1f6f2; color: var(--ink); }
.home-toolbox-sheet::backdrop { background: #0004; }
.home-toolbox-sheet h2 { text-align: center; font-size: 18px; margin: 0 0 22px; }
.home-toolbox-sheet .toolbox-actions { display: flex; justify-content: space-around; }
.home-toolbox-sheet .toolbox-actions button { width: auto; height: auto; min-width: 64px; min-height: 66px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home-toolbox-sheet .toolbox-actions button::after { content: attr(title); font-size: 12px; }

#scheduleView .schedule-dashboard { display: none; }
#scheduleView .timeline-section { padding: 8px 0 14px; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
#scheduleView .timeline-section::after,#scheduleView .timeline-section::before { display: none; }
#scheduleView .schedule-item { display: grid; grid-template-columns: minmax(0,1fr) 90px; align-items: start; gap: 10px; padding: 4px 0 4px 12px; margin: 12px 0 18px; border: 0; border-left: 3px solid var(--ink); border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#scheduleView .schedule-main { grid-column: 1; grid-row: 1; }
#scheduleView .timeline-section { gap: 10px; }
#scheduleView .timeline-section .section-title-row > strong { font-size: 18px; color: var(--ink); }
#scheduleView .timeline-section .item-list { margin: 0; gap: 8px; }
#scheduleView .schedule-main { display: block; }
#scheduleView .schedule-time { grid-column: 2; grid-row: 1; display: block; background: none; border: 0; padding: 2px 0; color: var(--muted); text-align: right; font: 12px/1.65 system-ui,sans-serif; white-space: pre-line; }
#scheduleView .schedule-kind { display: none; }
#scheduleView .schedule-title { font-size: 16px; line-height: 1.5; font-weight: 400; color: var(--ink); }
#scheduleView .schedule-details { margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--muted); }
#scheduleView .schedule-actions { margin-top: 6px; gap: 14px; }
#scheduleView .schedule-actions button { font-size: 11px; padding: 4px 0; min-height: 28px; opacity: .65; }
#scheduleView .schedule-item.is-done { opacity: .5; }
#scheduleView .schedule-item.is-done .schedule-title { text-decoration: line-through; }
#upcomingSummary { display: none; }
#scheduleView .schedule-section:has(#todoForm):not(.todo-editor-open) { display: none; }
#scheduleView .schedule-section:has(#todoForm) { margin-bottom: 16px; }
.ct-group[data-category="data"] > output { padding: 0; border: 0; background: none; box-shadow: none; }
.ct-group[data-category="data"] > output:empty { display: none; }
.ct-group[data-category="data"] > .button-row { padding: 4px 0; background: none; border: 0; box-shadow: none; }
.ct-group[data-category="data"] .chat-import-field { padding: 14px; }
.ct-group[data-category="data"] .entertainment-lock-settings .summary-settings-heading small,
.ct-group[data-category="data"] .entertainment-lock-settings > small { display: none; }
.ct-group[data-category="data"] .chat-import-session { display: flex; align-items: center; justify-content: flex-start; gap: 10px; grid-template-columns: none; }
.ct-group[data-category="data"] .chat-import-session input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; flex: 0 0 18px; padding: 0; }
.ct-group[data-category="data"] .chat-import-session span { min-width: 0; width: auto; flex: 1; font-size: 13px; line-height: 1.6; }
.ct-group[data-category="data"] .summary-settings-heading { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ct-group[data-category="data"] .summary-settings-heading output { margin-left: auto; font-size: 11px; }
.home-tab-icon .feather-tab-icon { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.feather-tab-icon .feather-outline { stroke-width: .65; opacity: .8; }
.feather-tab-icon .feather-shaft { stroke-width: 1.2; }
.feather-tab-icon .feather-vane { stroke-width: .65; opacity: .95; }
.feather-tab-icon .feather-down { stroke-width: .65; opacity: .85; }
@media (max-height:700px) { .memory-week { margin-bottom: 28px; } #homeView { padding-bottom: 32px; } }
@media (prefers-reduced-motion:reduce) { .water-stream,.home-sky { animation: none !important; transition: none; } }
/* Four atmospheric scenes: moving cloud layers, not an animated colour filter. */
#homeView .home-sky { overflow:hidden; filter:none; transition:none; background:linear-gradient(#81bcd5 0%,#badbdc 48%,#e2eadd 100%); }
#homeView[data-sky]::before { background:linear-gradient(transparent 50%,#eef4e536); }
.sky-clouds { position:absolute; width:190%; left:-50%; height:70%; background:url('assets/atmosphere/clouds.svg') center/100% 100% no-repeat; animation:sky-wind 54s ease-in-out infinite alternate; will-change:transform; }
.sky-clouds-far { top:-10%; opacity:.7; animation-duration:87s; transform:scale(.9); }
.sky-clouds-near { top:22%; opacity:.85; animation-delay:-24s; }
.sky-sun { position:absolute; top:13%; left:61%; width:130px; height:130px; border-radius:50%; background:radial-gradient(circle,#fffdeb 0 12%,#fff6cf88 25%,#fff0ba20 53%,transparent 70%); }
.sky-rays { display:none; position:absolute; inset:-5% -35% -20%; transform-origin:63% 18%; background:repeating-conic-gradient(from 152deg at 63% 18%,transparent 0deg 9deg,#fff3bb28 10deg 14deg,transparent 15deg 25deg); mask-image:linear-gradient(transparent,#0008 25%,#000 50%,transparent 90%); animation:sky-rays 19s ease-in-out infinite alternate; }
#homeView[data-sky="dusk"] .home-sky { filter:none; background:linear-gradient(#858cad,#cbb3ba 35%,#f5c5a0 65%,#f0dcb8); }
[data-sky="dusk"] .sky-rays { display:block; }
[data-sky="dusk"] .sky-sun { top:30%; left:60%; width:170px; height:170px; background:radial-gradient(circle,#ffefbd 0 9%,#ffdf9880 20%,#ffce7033 45%,transparent 70%); }
[data-sky="dusk"] .sky-clouds-far { opacity:.55; top:3%; }
[data-sky="dusk"] .sky-clouds-near { top:36%; opacity:.5; }
#homeView[data-sky="overcast"] .home-sky { filter:none; background:linear-gradient(#677b8b,#9bacb5 45%,#c3d0d0); }
[data-sky="overcast"] .sky-clouds { background-image:url('assets/atmosphere/storm-clouds.svg'); opacity:.92; }
[data-sky="overcast"] .sky-clouds-far { top:-13%; }
[data-sky="overcast"] .sky-clouds-near { top:7%; animation-duration:43s; }
[data-sky="overcast"] .sky-sun { display:none; }
.sky-rain { display:none; position:absolute; inset:0; overflow:hidden; }
[data-sky="overcast"] .sky-rain { display:block; }
.sky-rain i { position:absolute; top:20%; width:1px; height:24px; opacity:0; background:linear-gradient(transparent,#edf6fa90); animation:sky-rain 2s linear infinite; }
#homeView[data-sky="night"] .home-sky { filter:none; background:linear-gradient(#142d4b,#365775 55%,#768e9c); }
[data-sky="night"] .sky-sun { display:none; }
[data-sky="night"] .sky-clouds { opacity:.13; }
.sky-moon { display:none; position:absolute; top:14%; right:19%; width:38px; height:38px; border-radius:50%; box-shadow:-8px 5px 0 0 #f8f2d6, -10px 7px 18px #f8f2d62a; transform:rotate(-18deg); }
[data-sky="night"] .sky-moon { display:block; }
#homeView[data-sky="night"] .home-sky-stars { display:block; opacity:.85; animation:sky-stars 8s ease-in-out infinite alternate; }
@keyframes sky-wind { from { transform:translateX(-9%) translateY(-2%); } to { transform:translateX(15%) translateY(2%); } }
@keyframes sky-rays { from { transform:rotate(-4deg); opacity:.45; } to { transform:rotate(4deg); opacity:.85; } }
@keyframes sky-rain { 0% { transform:translate(0,-40px);opacity:0; } 12% { opacity:.4; } 80% { opacity:.35; } 100% { transform:translate(-45px,58vh);opacity:0; } }
@keyframes sky-stars { to { opacity:.42; } }
#homeView:not(.view-active) .home-sky *,#homeView.sky-paused .home-sky *,#homeView:not(.view-active) .home-sky-stars,#homeView.sky-paused .home-sky-stars { animation-play-state:paused; }
/* A small weather caption and a quiet five-action dock. */
#homeView .home-sky-mood { display:flex; flex-direction:column; gap:12px; max-width:280px; margin:24px auto 0; font-size:14px; line-height:1.85; letter-spacing:.06em; opacity:1; color:inherit; text-wrap:balance; }
.home-sky-mood::before { content:attr(data-weather); font:10px/1.4 system-ui,sans-serif; letter-spacing:.24em; opacity:.62; }
.home-sky-mood::after { content:''; width:26px; height:1px; margin:3px auto; background:currentColor; opacity:.25; }
#homeView .home-card-grid { padding:20px 2px 0; gap:5px; border-top:1px solid #ffffff45; }
#homeView .home-card { gap:9px; padding:5px 0; border-radius:18px; }
#homeView .home-card-icon { width:44px; height:44px; border-radius:16px; border:1px solid #ffffff65; background:#ffffff24; color:inherit; box-shadow:inset 0 1px 0 #ffffff45; }
#homeView .home-card-icon svg { width:24px; height:24px; }
#homeView .home-card-copy strong { font-size:11px; font-weight:500; letter-spacing:.05em; }
#homeView .home-card:active { background:#ffffff28; }
/* The week reads as a fine date ribbon, rather than seven unrelated blocks. */
#memoryWeek { position:relative; width:min(92%,370px); margin:32px auto 34px; padding:28px 8px 10px; gap:1px; border-top:1px solid #ffffff80; border-bottom:1px solid #18382c15; }
#memoryWeek::before { content:attr(data-month); position:absolute; top:7px; left:10px; font:10px/1 system-ui,sans-serif; letter-spacing:.14em; color:var(--muted); }
#memoryWeek .memory-day { gap:7px; padding:8px 0 10px; position:relative; }
#memoryWeek .memory-day span { font-size:9px; opacity:.65; }
#memoryWeek .memory-day strong { width:28px; height:28px; font-size:15px; font-variant-numeric:tabular-nums; }
#memoryWeek .is-today { background:color-mix(in srgb,var(--accent) 10%,transparent); border-radius:16px; }
#memoryWeek .is-today strong { border:0; background:transparent; font-weight:600; color:var(--accent-ink); }
#memoryWeek .is-today::after { content:''; position:absolute; bottom:5px; width:3px; height:3px; border-radius:50%; background:var(--accent); }
@media(prefers-reduced-motion:reduce) { #homeView .home-sky *,#homeView .home-sky-stars { animation:none !important; will-change:auto; } }
/* Detailed cloud bank travels independently from the higher, softer wisps. */
#homeView .sky-clouds-near {
  top:-8%; left:-25%; width:150%; height:120%;
  background:url('assets/atmosphere/sky.png') center/cover no-repeat;
  mask-image:linear-gradient(transparent 0%,#000 22%,#000 82%,transparent 100%);
  opacity:.92; animation-duration:68s;
}
#homeView[data-sky="dusk"] .sky-clouds-near {
  top:0%; background-image:linear-gradient(#b890ab50,#ffd39936),url('assets/atmosphere/sky.png');
  background-blend-mode:multiply; opacity:.8;
}
#homeView[data-sky="dusk"] .sky-rays { z-index:1; }
#homeView[data-sky="overcast"] .sky-clouds-near {
  top:-31%; height:145%; background-image:linear-gradient(#283e58e0,#64788b98),url('assets/atmosphere/sky.png');
  background-blend-mode:multiply; opacity:.94; animation-duration:49s;
}
#homeView[data-sky="night"] .sky-clouds-near { opacity:.19; top:10%; }
#homeView[data-sky="overcast"] { color:#f3f7fa; }
#homeView[data-sky="overcast"] .home-card-icon { color:inherit; }
#homeView .sky-rays { background:conic-gradient(from 0deg at 63% 18%,transparent 0deg 130deg,#fff3bb28 132deg 136deg,transparent 138deg 151deg,#fff3bb38 153deg 159deg,transparent 161deg 178deg,#fff3bb25 180deg 184deg,transparent 186deg 203deg,#fff3bb20 205deg 209deg,transparent 211deg 360deg); }
