/* =========================================================
   首页手帐 + 黑色悬浮 Dock
   ========================================================= */

:root {
  --home-bg: #E8D478;
  --bg-yellow: #E8D478;
  --card-white: #FFFDF7;
  --pink: #F3ACD4;
  --blue: #B4CDF2;
  --green: #9FB66C;
  --black: #151515;
  --text-main: #151515;
  --text-secondary: rgba(21, 21, 21, .58);
  --dock-yellow: #E4CE62;
  --dock-space: calc(118px + env(safe-area-inset-bottom, 0px));
  --keyboard-inset: 0px;
}

html:has(body.is-home) { background: var(--home-bg); }
html:has(body.is-butler) { background: var(--home-bg); }

body.is-home {
  --topbar-height: 64px;
  --radius-sm: 18px;
  --radius-md: 24px;
  --radius-lg: 30px;
  --radius-xl: 36px;
  --radius-pill: 999px;
  color: var(--text-main);
  background: var(--home-bg);
}

body.is-home .app-shell,
body.is-home .main-view,
body.is-home .page-content,
body.is-home .topbar {
  background: var(--home-bg);
}

body.is-home .main-view,
body.is-butler .main-view {
  flex: 1;
  min-height: 0;
}

body.is-home .topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  width: min(480px, 100%);
  height: calc(var(--topbar-height) + env(safe-area-inset-top));
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px 0;
  background: var(--home-bg);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  z-index: 80;
}

body.is-home .topbar__greeting,
body.is-home .profile-text { display: none; }

body.is-home .topbar-profile { z-index: 80; }

body.is-home .profile {
  min-height: 48px;
  padding: 0;
  background: none;
  border: none;
}

body.is-home .avatar {
  width: 48px;
  height: 48px;
  font-size: 28px;
  line-height: 1;
  background: rgba(255, 255, 255, .22);
  color: #3b2a12;
}

body.is-home .profile-menu {
  left: 0;
  right: auto;
}

body.is-home .page-content {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 0 20px calc(168px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.is-home #page-home.page.is-on {
  min-height: 0;
  padding-bottom: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.topbar-profile { grid-column: 1; }
.topbar__greeting { grid-column: 2; min-width: 0; }
.topbar-settings { grid-column: 3; }

body:not(.is-home) {
  --topbar-height: 48px;
}

body:not(.is-home) .topbar-profile { display: none; }
body:not(.is-home) .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  height: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
body:not(.is-home) .topbar__greeting { grid-column: 1; }
body:not(.is-home) .topbar-settings { grid-column: 2; }

html:has(body:not(.is-home):not(.is-butler):not(.is-warm)) { background: #faf8f2; }
body:not(.is-home):not(.is-butler):not(.is-warm) .topbar { background: #faf8f2; }
body:not(.is-home):not(.is-butler):not(.is-warm) .page-content { padding-top: 8px; }

.topbar-settings {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: #111;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}

.topbar-settings:active { transform: scale(.97); }

.topbar-settings__icon,
.topbar-settings .icon {
  display: block;
  width: 20px;
  height: 20px;
}

.topbar-settings .icon {
  stroke-width: 2;
}

.topbar-settings.is-on { opacity: 1; }


/* ---------- Hero ---------- */

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 8px;
  margin: 16px 0 16px;
}

.home-hero__greet { min-width: 0; }

.home-hero__title {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  font-size: clamp(38px, 10.6vw, 62px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: #111;
}

.home-hero__title span { display: block; }

.home-hero__date {
  margin: 14px 0 0;
  font-size: 18px;
  font-weight: 400;
  color: rgba(20, 20, 20, .62);
}

.home-weather {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  color: #111;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}

.home-weather:active { transform: scale(.97); }

.home-weather__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(72px, 20vw, 92px);
  height: clamp(72px, 20vw, 92px);
  border-radius: 0;
  background: none;
  color: #111;
}

.home-weather__icon .icon {
  width: 100%;
  height: 100%;
  stroke-width: 1.45;
}

.home-weather__copy {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.weather-temp,
.home-weather strong.weather-temp {
  display: block;
  font-size: clamp(52px, 14vw, 82px);
  line-height: .9;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: #111;
}

.home-weather small {
  display: grid;
  gap: 1px;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.25;
  color: rgba(20, 20, 20, .62);
}

.home-weather small span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-weather__left,
.home-weather__tip { display: none; }


/* ---------- Today ---------- */

.home-today { margin-top: 0; }

.home-today__head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.today-title,
.home-today__head h2.today-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.today-count,
.home-today__head span.today-count {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  opacity: .58;
  color: var(--text-main);
}

.home-today__list {
  display: grid;
  gap: 10px;
}

.home-task {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 8px 26px rgba(91, 72, 17, .08);
}

.home-task__front {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 104px;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 28px;
  background: #FFFDF7;
  box-shadow: none;
  touch-action: pan-y;
  transform: translate3d(0, 0, 0);
  transition: transform 220ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.home-task.is-dragging .home-task__front { transition: none; }

.home-task__check {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #F8E7A0;
}

.home-task__check::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(21, 21, 21, .16);
}

.home-task__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #151515;
}

.home-task__icon .icon {
  width: 22px;
  height: 22px;
}

.home-task__main {
  min-width: 0;
  flex: 1;
}

.home-task__main h3 {
  overflow: hidden;
  margin: 0 0 4px;
  color: #151515;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-task__main p {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  color: rgba(21, 21, 21, .6);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-task__when {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 4px;
  color: rgba(21, 21, 21, .45);
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.home-task__meta,
.home-task__tag { display: none; }

.home-today__ops {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.home-today__more,
.home-empty,
.home-today__clearall {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: rgba(21, 21, 21, .55);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
}

.home-today__more,
.home-today__clearall {
  min-height: 28px;
  cursor: pointer;
}

.home-empty { margin-top: 4px; text-align: left; }


/* ---------- Layered cards ---------- */

.layer-stack {
  position: relative;
  isolation: isolate;
  min-height: 400px;
  margin: 12px 0 28px;
  overflow: visible;
}

.layer-card {
  position: absolute;
  display: block;
  padding: 18px 22px;
  border: 0;
  border-radius: 36px;
  color: #151515;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(70, 55, 10, .08);
  overflow: hidden;
  transition: top .22s ease, transform .18s ease, min-height .22s ease;
}

.layer-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.layer-card__title,
.layer-card__head h2,
.life-layer__head h2 {
  margin: 0;
  font-size: clamp(26px, 7vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #151515;
}

.layer-card__icon .icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.layer-card__rows {
  display: none;
  gap: 8px;
  margin-top: 12px;
  max-height: calc(3 * 62px + 16px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.layer-card.is-front {
  top: 92px;
  left: 0;
  right: 0;
  z-index: 3;
  min-height: 300px;
  height: auto;
  padding: 16px 16px 36px;
  border-radius: 36px;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
  transform: none;
  cursor: default;
  overflow: hidden;
}

.layer-card.is-front .layer-card__rows {
  display: grid;
}

.layer-card:not(.is-front) {
  height: 64px;
  padding-top: 16px;
  padding-bottom: 10px;
}

.family-layer {
  border-radius: 36px;
  background: linear-gradient(135deg, #F1A3D6, #F7C3DF);
}

.health-layer {
  border-radius: 36px;
  background: linear-gradient(135deg, #A8C6F2, #C4D8F6);
}

.life-layer {
  border-radius: 36px;
  background: linear-gradient(135deg, #9CB267, #AFC482);
}

.layer-stack.is-front-life .family-layer:not(.is-front),
.layer-stack.is-front-health .family-layer:not(.is-front),
.layer-stack.is-front-family .health-layer:not(.is-front) {
  top: 4px;
  left: 2px;
  right: 20px;
  z-index: 1;
  transform: rotate(-2deg);
}

.layer-stack.is-front-life .health-layer:not(.is-front),
.layer-stack.is-front-family .life-layer:not(.is-front),
.layer-stack.is-front-health .life-layer:not(.is-front) {
  top: 48px;
  left: 16px;
  right: 2px;
  z-index: 2;
  transform: rotate(-1deg);
}

.layer-card:not(.is-front):active {
  transform: translateY(-3px);
}

.layer-card:focus-visible {
  outline: 2px solid #151515;
  outline-offset: 3px;
}

.life-layer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 6px;
}

.life-layer__ops {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #151515;
}

.life-layer__ops .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.life-layer__rows {
  display: grid;
  gap: 9px;
}

.life-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  height: 62px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #151515;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}

.life-row.is-on { background: rgba(255, 255, 255, .82); }

.life-row:active { transform: scale(.97); }

.life-row__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: #151515;
}

.life-row.is-on .life-row__icon {
  background: rgba(156, 178, 103, .2);
}

.life-row__icon .icon {
  width: 20px;
  height: 20px;
}

.life-row__label {
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.life-row__go {
  display: grid;
  place-items: center;
  color: rgba(21, 21, 21, .55);
}

.life-row__go .icon {
  width: 18px;
  height: 18px;
}

.life-row__dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e24b4b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
}

.life-layer__close {
  display: none;
}

.life-layer__close .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}


/* ---------- Butler page (GPT mobile) ---------- */

body.is-butler {
  --topbar-height: 48px;
  color: #151515;
  background: var(--home-bg);
}

body.is-butler .app-shell,
body.is-butler .main-view {
  background: transparent;
}

body.is-butler .topbar {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  width: min(480px, 100%);
  height: calc(64px + env(safe-area-inset-top));
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px 0;
  background: var(--home-bg);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

body.is-butler .topbar-profile { display: block; }
body.is-butler .topbar__greeting,
body.is-butler .profile-text { display: none; }

body.is-butler .page-content {
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

body.is-butler #page-butler.page.is-on {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
}

.butler-page {
  --butler-clearance: 128px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0 16px;
}

.butler-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 4px 4px 8px;
}

.butler-page__who {
  display: grid;
  gap: 2px;
}

.butler-page__who strong {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.butler-page__who small {
  color: rgba(21, 21, 21, .52);
  font-size: 13px;
}

.butler-page__new {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(21, 21, 21, .06);
  color: #151515;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.butler-page__thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  min-height: 0;
  padding: 8px 2px calc(var(--dock-space) + var(--butler-clearance) + var(--keyboard-inset));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: calc(var(--dock-space) + var(--butler-clearance) + var(--keyboard-inset));
}

.butler-page__hello {
  margin: auto;
  padding: 0 8px;
  text-align: center;
}

.butler-page__hello h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.butler-page__hello p {
  margin: 10px 0 0;
  color: rgba(21, 21, 21, .56);
  font-size: 16px;
}

.butler-page.is-chatting {
  --butler-clearance: 88px;
}

.butler-page.is-chatting .butler-page__hints { display: none; }
.butler-page.is-chatting .butler-page__dock { padding-top: 12px; }

.butler-page.is-consult .message {
  width: 100%;
}

.butler-page.is-consult .message__bubble,
.butler-page.is-consult .message__bubble--consult {
  max-width: 100%;
}

.butler-page.is-consult .consult-result,
.butler-page.is-consult .quick-replies {
  width: 100%;
}

.butler-page__person {
  margin: 0 auto;
  width: min(100%, 320px);
}

.butler-page .home-chat__bubble {
  max-width: 86%;
}

.butler-page .home-chat__text {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.5;
}

.butler-page .home-chat__bubble.is-bot .home-chat__text {
  background: #fff;
  border: 0;
  box-shadow: 0 8px 20px rgba(70, 55, 10, .06);
}

.butler-page .home-chat__bubble.is-user .home-chat__text {
  background: #151515;
  color: #fff;
}

.butler-page__dock {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-space) + var(--keyboard-inset));
  z-index: 55;
  display: grid;
  gap: 10px;
  width: min(480px, 100%);
  padding: 10px 16px 8px;
  background: linear-gradient(180deg, rgba(244, 241, 232, 0), #f4f1e8 22%);
  transform: translateX(-50%);
}

.butler-page__hints {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.butler-page__hints::-webkit-scrollbar { display: none; }

.butler-page__hints .quick-reply {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #151515;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.butler-page__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(70, 55, 10, .08);
}

.butler-page__composer .input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  overflow-y: auto;
}

.butler-page__send {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #151515;
  color: #fff;
  line-height: 0;
  cursor: pointer;
}

.butler-page__send .icon {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0;
  stroke: #fff;
  vertical-align: 0;
}

.butler-page__send:disabled {
  opacity: .45;
}

.family-layer .life-row.is-on .life-row__icon { background: rgba(241, 163, 214, .28); }
.health-layer .life-row.is-on .life-row__icon { background: rgba(168, 198, 242, .35); }


/* Yellow strip under the dock only — same yellow as the page. */
body.is-home::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--home-bg);
  pointer-events: none;
  z-index: 59;
}

/* ---------- Floating black dock ---------- */

.nav-item__fab {
  display: none;
}

@media (max-width: 720px) {
  body {
    padding-bottom: 0;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 0;
  }

  .page-content {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 20px;
    right: 20px;
    width: auto;
    max-width: 440px;
    height: 88px;
    margin: 0 auto;
    padding: 6px 8px 8px;
    border: 0;
    border-radius: 34px;
    background: #151515;
    box-shadow: 0 16px 40px rgba(21, 21, 21, .22);
    backdrop-filter: none;
    overflow: visible;
    z-index: 60;
  }

  .sidebar-brand { display: none; }

  .sidebar-nav {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 0;
    flex-direction: row;
  }

  .nav-item,
  .nav-item:hover,
  .nav-item.is-active {
    position: relative;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    min-height: 0;
    height: 100%;
    padding: 10px 2px 12px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, .56);
    font-weight: 500;
  }

  .nav-item.is-active { color: #fff; }

  .nav-item.is-active::before { display: none; }

  .nav-item.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 14px;
    height: 4px;
    border-radius: 999px;
    background: var(--dock-yellow);
    transform: translateX(-50%);
  }

  .nav-item__icon {
    width: 24px;
    height: 24px;
    color: inherit;
  }

  .nav-item.is-active .nav-item__icon { color: #fff; }

  .nav-item__icon .icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
  }

  .nav-item__label {
    display: block;
    font-size: 11px;
    font-weight: 500;
  }

  .nav-item--butler {
    overflow: visible;
    color: rgba(255, 255, 255, .7);
    background: none;
    border: 0;
  }

  .nav-item--butler::after { display: none !important; }

  .nav-item--butler .nav-item__fab {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--dock-yellow);
    color: #151515;
    box-shadow: 0 8px 18px rgba(70, 55, 10, .14);
    transform: translateY(-16px);
    transition: transform .18s ease;
  }

  .nav-item--butler:active .nav-item__fab { transform: translateY(-16px) scale(.97); }

  .nav-item--butler .nav-item__icon,
  .nav-item--butler.is-active .nav-item__icon {
    color: #151515;
  }

  .nav-item--butler .nav-item__icon .icon {
    width: 26px;
    height: 26px;
    stroke-width: 1.8;
  }

  .nav-item--butler .nav-item__label {
    margin-top: -12px;
    padding-bottom: 2px;
  }

  .toast {
    bottom: calc(110px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 721px) {
  body.is-home,
  body.is-butler {
    padding-bottom: 0;
  }

  body.is-home .app-shell,
  body.is-butler .app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 0;
  }

  body.is-home .sidebar,
  body.is-butler .sidebar {
    position: fixed;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    right: auto;
    width: min(440px, calc(100% - 40px));
    height: 88px;
    padding: 6px 8px 8px;
    border: 0;
    border-radius: 34px;
    background: #151515;
    box-shadow: 0 16px 40px rgba(21, 21, 21, .22);
    backdrop-filter: none;
    overflow: visible;
    transform: translateX(-50%);
    z-index: 60;
  }

  body.is-home .sidebar-brand,
  body.is-butler .sidebar-brand { display: none; }

  body.is-home .sidebar-nav,
  body.is-butler .sidebar-nav {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 0;
  }

  body.is-home .nav-item,
  body.is-home .nav-item:hover,
  body.is-home .nav-item.is-active,
  body.is-butler .nav-item,
  body.is-butler .nav-item:hover,
  body.is-butler .nav-item.is-active {
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 10px 2px 12px;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, .56);
  }

  body.is-home .nav-item.is-active,
  body.is-butler .nav-item.is-active { color: #fff; }
  body.is-home .nav-item.is-active::before,
  body.is-butler .nav-item.is-active::before { display: none; }
  body.is-home .nav-item.is-active::after,
  body.is-butler .nav-item.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 14px;
    height: 4px;
    border-radius: 999px;
    background: var(--dock-yellow);
    transform: translateX(-50%);
  }
  body.is-home .nav-item__label,
  body.is-butler .nav-item__label { display: block; font-size: 11px; }
  body.is-home .nav-item--butler::after,
  body.is-butler .nav-item--butler::after { display: none !important; }
  body.is-home .nav-item--butler .nav-item__fab,
  body.is-butler .nav-item--butler .nav-item__fab {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--dock-yellow);
    color: #151515;
    transform: translateY(-16px);
  }
  body.is-home .nav-item--butler .nav-item__label,
  body.is-butler .nav-item--butler .nav-item__label { margin-top: -12px; }

  body:not(.is-home):not(.is-butler):not(.is-warm) .nav-item--butler .nav-item__fab {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dock-yellow);
    color: #151515;
  }

  body:not(.is-home):not(.is-butler) .nav-item--butler .nav-item__icon { color: #151515; }
}


/* ---------- Narrow phones ---------- */

@media (max-width: 430px) {
  .home-hero { margin: 16px 0 20px; }
  .home-weather__icon {
    width: clamp(56px, 15vw, 72px);
    height: clamp(56px, 15vw, 72px);
  }
  .home-task__front { min-height: 92px; padding: 16px 18px; }
  .life-row { height: 58px; }
  .layer-card__rows { max-height: calc(3 * 58px + 16px); }
  .life-layer__head { margin-bottom: 12px; }
  .layer-stack { min-height: 390px; margin-top: 14px; }
}

@media (max-width: 380px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin: 20px 0 28px;
  }

  .home-hero__title { font-size: clamp(34px, 10.2vw, 48px); }
  .weather-temp,
  .home-weather strong.weather-temp { font-size: clamp(48px, 14vw, 68px); }
  .home-weather__icon {
    width: 58px;
    height: 58px;
  }
  .home-weather small { font-size: 13px; }
  .home-hero__date { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-weather,
  .life-row,
  .layer-card,
  .topbar-settings,
  .nav-item--butler .nav-item__fab {
    transition: none;
  }
}
