:root {
  --paper: #fffaf0;
  --cream: #fbf6e8;
  --ink: #39291c;
  --muted: #685841;
  --leaf: #4b672b;
  --leaf-light: #edf0cb;
  --border: #ddcba6;
  --garden-serif: "Yu Mincho", "Noto Serif CJK JP", Georgia, serif;
}
[hidden] { display: none !important; }
body {
  background: #faf5e8 url('./assets/flowers.webp') center bottom / min(100%, 1450px) auto no-repeat;
}
.storybook-icon { width: 26px; height: 26px; flex: none; vertical-align: middle; }
.top {
  padding: 7px clamp(15px, 2.4vw, 35px);
  min-height: 65px;
  background: url('./assets/wisteria.webp') 63% top / auto 79px no-repeat, #fbf6e8;
  box-shadow: 0 2px 10px #6e552614;
}
.current-page-title { display: flex; align-items: center; gap: 11px; font-size: clamp(1.28rem, 2.4vw, 1.83rem); font-weight: 760; }
.current-page-title .storybook-icon { width: 35px; height: 35px; }
.top .top-account {
  background: #fff9ebed;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 100px;
  min-height: 44px;
  color: #493921;
}
.top .top-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .top-account .storybook-icon { width: 26px; height: 26px; }
body[data-page=home] .top .top-account {
  width: 46px; height: 46px; min-height: 46px; padding: 0;
  justify-content: center; border-color: #d6caa2;
}
body[data-page=home] .top .top-account .storybook-icon { width: 32px; height: 32px; }
body[data-page=home] .top .top-account span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.layout { width: min(1740px, 100%); grid-template-columns: clamp(126px, 12.2vw, 210px) minmax(0, 1fr); }
.navigation { padding: 17px 13px; }
.navigation button { border-radius: 15px; font-weight: 700; }
.navigation button span { width: auto; color: inherit; font-size: .92rem; }
.navigation button[aria-current=page] { background: #eeebbd; color: #423616; }
main { padding: 19px clamp(13px, 1.6vw, 28px) 75px 11px; }
.startup-wait { margin: 10vh auto; width: min(88vw, 460px); text-align: center; padding: 24px; }
.startup-wait button { margin-top: 20px; }
.home-grid { grid-template-columns: minmax(0, 1.57fr) minmax(260px, 1fr); align-items: start; gap: 16px; }
.home-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 0 12px 8px; font-size: .9rem; }
.home-legal-links a { color: var(--leaf); text-underline-offset: .18em; }
.home-main, .home-side { gap: 13px; }
.home-controls { display: grid; gap: 13px; min-width: 0; }
.home-controls > .timer-card { grid-row: auto; }
.card { background: #fffaf0; border-color: var(--border); border-radius: 21px; box-shadow: 0 3px 10px #62481d14; }
.garden { border-radius: 22px; }
.subscribers {
  display: none; text-align: center;
  background: #fff6db;
  border: 3px double #c89b4d;
  border-radius: 56% 56% 34% 34% / 35% 35% 35% 35%;
  box-shadow: 0 2px 5px #65441e38, inset 0 0 12px #eed6989c;
}
.subscribers > span { font-weight: 700; font-size: .86rem; }
.subscribers strong { font: 700 clamp(1.55rem, 5vw, 2rem)/1.05 var(--garden-serif); }
.garden-connect {
  border: 0; background: transparent; color: #426323; text-decoration: underline; text-underline-offset: 2px;
  font-size: .78rem; padding: 4px 7px;
}
.metrics {
  position: relative; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 15px 10px; border: 3px double #d5b572; background: #fff8e6;
  box-shadow: inset 0 0 10px #f6e6b9ac, 0 2px 7px #7a541e21;
}
.metric-label { display: flex; justify-content: center; align-items: center; gap: 4px; white-space: nowrap; font-size: .9rem; font-weight: 700; }
.metric-label .storybook-icon { width: 22px; height: 22px; }
.metrics strong { font-family: var(--garden-serif); font-size: clamp(1.25rem, 2.5vw, 1.85rem); line-height: 1.14; }
.metrics-note { line-height: 1.3; }
.timer-card {
  justify-items: center; padding: 16px 22px 14px; gap: 7px; border: 3px double #d1a65b;
  background: url('./assets/leaves.webp') right top / 79px auto no-repeat, #fff7df;
  box-shadow: inset 0 0 11px #e5ce8d65, 0 2px 7px #7a541e32;
}
.timer-card h2 { text-align: center; font-size: 1.04rem; }
.timer-line { display: flex; justify-content: center; align-items: center; gap: clamp(14px, 5vw, 34px); }
.countdown { font: 750 clamp(3.1rem, 10vw, 4.35rem)/.98 var(--garden-serif); font-variant-numeric: tabular-nums; letter-spacing: 0; }
#timer-action, .album-add {
  display: grid; place-items: center; width: 51px; height: 51px; padding: 0;
  border: 1px solid #5a7d2e; border-radius: 50%; color: #fffdea; background: linear-gradient(#a7bf5b,#6d933e);
  box-shadow: inset 0 1px 2px #f3f7c8b8, 0 2px 5px #59733b42; font-size: 1.38rem;
}
.environment-select {
  display: inline-flex; gap: 4px; align-items: center; justify-content: center;
  border: 1px solid #dac48d; border-radius: 999px; background: #f8edcf; font-size: .87rem;
}
.environment-select span { padding-left: 9px; font-weight: 700; }
.environment-select select {
  min-width: 98px; border: 0; border-left: 1px solid #dac48d; border-radius: 999px; background: #fff6da;
  padding: 3px 8px; font-size: .84rem;
}
.timer-settings { text-align: center; color: var(--muted); font-size: .76rem; }
.timer-settings summary { cursor: pointer; }
.timer-settings[open] .timer-options { margin: 8px 0; justify-content: center; }
.home-side .card { padding: 15px; gap: 14px; }
.home-side h2 { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: clamp(1.06rem, 2.2vw, 1.43rem); }
.home-side .text-button { justify-self: center; font-weight: 700; text-decoration: none; }
.month-summary {
  padding: 0 15px 13px; background: #fff4d9;
  border: 1px solid #e1c57d; border-radius: 15px; text-align: center;
}
.ribbon-heading {
  width: max-content; max-width: 100%; margin: -5px auto 8px; padding: 2px 18px; border-radius: 5px 4px 9px 8px;
  background: linear-gradient(#fbe0b5,#f4ca99); border: 1px solid #d7a77b; color: #573821;
}
.home-album .album-tile { transform: rotate(-3deg); }
.home-album .album-tile + .album-tile { transform: rotate(4deg); }
.home-album .album-tile span { font-size: .73rem; }
.home-album .album-tile strong { text-align: center; }
.album-page {
  gap: 9px; max-width: 1030px; margin-inline: auto;
  background: url('./assets/leaves.webp') right top / 115px auto no-repeat;
}
.album-heading { min-height: 58px; padding-inline: 7px; justify-content: center; position: relative; }
.album-heading h1, .album-collection h2 { display: flex; align-items: center; gap: 8px; }
.album-heading .album-add { position: absolute; right: 3px; width: 45px; height: 45px; min-height: 45px; }
.album-book {
  display: grid; align-items: center; width: min(100%, 625px); aspect-ratio: 1.6;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10%; padding: 5% 8%;
  border: none; border-radius: 0;
  background: url('./assets/album-art.webp') center / 100% 100% no-repeat;
  box-shadow: none;
}
.album-book .album-tile {
  position: relative; transform: rotate(-5deg);
  border: 1px solid #ddc49e; border-radius: 3px; box-shadow: 0 2px 6px #60472535;
  padding: 6px 6px 4px; text-align: center;
}
.album-book .album-tile:nth-child(2) { transform: rotate(5deg); }
.album-book .album-tile img { border-radius: 1px; }
.album-book .album-tile::before {
  content: ""; position: absolute; z-index: 1; inset: -6px auto auto 13%;
  width: 31%; height: 13px; background: #f6b3aaad; transform: rotate(-12deg);
}
.album-book .album-tile:nth-child(2)::before { background: #dcbcdece; transform: rotate(8deg); }
.album-book .album-tile .muted { font-size: .72rem; }
.album-empty-action {
  border: 1px dashed #c7a96a; border-radius: 6px; background: #fffbebaf; padding: 8px;
  min-height: 48px; font-weight: 650; font-size: .83rem; color: #526533;
}
.album-controls { gap: clamp(15px, 6vw, 38px); min-height: 37px; font-size: .85rem; }
.album-controls button {
  border-radius: 9px; min-height: 36px; padding: 0 13px; font-size: 1.35rem; line-height: 1;
  background: #fff4d7; border-color: #decda5;
}
.album-dots { display: flex; justify-content: center; gap: 6px; min-height: 9px; }
.album-dots span { width: 7px; height: 7px; border-radius: 50%; background: #ddcfae; }
.album-dots span.active { background: #80a13f; }
.album-collection { display: grid; width: min(100%, 720px); margin-inline: auto; }
.album-collection h2 { border-bottom: 1px solid #d9c79e; padding: 4px 0 7px; }
.album-collection .empty { padding: 14px 0; }
.album-collection-row {
  display: grid; grid-template-columns: minmax(68px, 26%) minmax(0, 1fr) 14px; gap: 11px; align-items: center;
  border: 0; border-bottom: 1px solid #e4d5b5; text-align: left; width: 100%; background: transparent; padding: 8px 3px;
}
.album-collection-row img, .album-collection-row > .album-placeholder {
  width: 100%; aspect-ratio: 1.5; object-fit: cover; border-radius: 5px;
}
.album-collection-row div { display: grid; gap: 1px; overflow-wrap: anywhere; }
.album-collection-row div > span { font-size: .78rem; color: var(--muted); }
.album-chevron { font-size: 1.3rem; line-height: 1; }
@media (min-width: 801px) {
  body[data-page=home] .home-main { min-height: 64vh; }
  body[data-page=agency] .top { justify-content: space-between; gap: 12px; }
  body[data-page=agency] .agency-global-nav[hidden] { display: flex !important; gap: 4px; }
  .agency-global-nav button {
    min-height: 41px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff9eb;
  }
  .agency-global-nav button[aria-current=page] { background: var(--leaf-light); }
  body[data-page=agency] .layout { display: block; }
  body[data-page=agency] .navigation { display: none; }
  body[data-page=agency] main { padding: 14px 17px 72px; }
}
@media (max-width: 800px) {
  .top, .layout { display: block; }
  .top { position: relative; min-height: 50px; padding: 6px 12px; background-size: auto 66px; }
  .current-page-title { min-height: 38px; }
  .top .top-account { position: absolute; right: 9px; top: 5px; min-height: 39px; padding: 3px 8px; font-size: .78rem; }
  .top .top-account .storybook-icon { width: 22px; height: 22px; }
  body[data-page=home] .top { height: 0; min-height: 0; padding: 0; border: none; }
  body[data-page=home] .current-page-title { display: none; }
  body[data-page=home] .top .top-account { top: 5px; right: 5px; }
  body[data-page=planning] .top, body[data-page=goals] .top, body[data-page=album] .top { display: none; }
  main { padding: 0 12px calc(68px + env(safe-area-inset-bottom)); }
  body[data-page=planning], body[data-page=goals] {
    --plan-navigation-height: calc(58px + env(safe-area-inset-bottom, 0px));
    background-image: none;
    min-height: 100dvh;
  }
  body[data-page=planning] main, body[data-page=goals] main { padding-bottom: var(--plan-navigation-height); }
  .navigation {
    position: fixed; inset: auto 0 0; z-index: 6; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px; padding: 4px 7px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid #d8c49d;
    background: linear-gradient(#fffbef,#fbf0d7); box-shadow: 0 -2px 8px #6c4b1c16;
  }
  .navigation button { min-height: 49px; flex-direction: column; justify-content: center; gap: 0; padding: 3px; }
  .navigation button span { font-size: .76rem; }
  .navigation button .storybook-icon { width: 24px; height: 24px; }
  .navigation button[aria-current=page] { background: #ede7b7; }
  body[data-page=home] main { padding-inline: 0; }
  .home-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-main {
    min-width: 0;
    gap: 0;
  }
  .home-controls {
    gap: 7px;
    padding: 7px 11px 10px;
    /* Keep the foreground anchored at the scene edge while the controls expand. */
    background: #a6c758 url('./assets/garden-mobile-foreground.webp') center top / 100% auto no-repeat;
  }
  .garden {
    isolation: isolate; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible;
  }
  .garden-scene {
    --tree-base: 26%;
    --tree-headroom: 110px;
    height: calc(100vh - 260px);
    min-height: 245px;
    max-height: 530px;
    padding-bottom: 0;
    aspect-ratio: auto;
  }
  .garden-sky { background-position: center top; }
  .garden-landscape {
    background-image: url('./assets/garden-mobile-upper.webp');
    background-size: 100% 100%;
  }
  .garden-tree { max-width: 92%; }
  .subscribers {
    display: grid; justify-items: center; gap: 1px; padding: 7px 14px 8px; min-height: 67px;
    position: absolute; top: 13px; left: 50%; transform: translateX(-50%); z-index: 2; width: min(68vw, 263px);
    max-width: calc(100% - 112px);
  }
  .subscribers::before, .subscribers::after {
    content: ""; position: absolute; width: 56px; height: 55px; pointer-events: none;
    bottom: -7px; background: url('./assets/leaves.webp') right top / contain no-repeat;
  }
  .subscribers::before { left: -18px; transform: rotate(160deg); }
  .subscribers::after { right: -18px; transform: scaleX(-1) rotate(160deg); }
  .timer-card { order: 1; border-radius: 42% 42% 32% 32% / 23% 23% 23% 23%; padding: 8px 11px 7px; gap: 2px; }
  .metrics { order: 2; grid-template-columns: repeat(3, minmax(0,1fr)); border-radius: 17px; padding: 8px 3px; }
  .metrics > .desktop-subscribers { display: none; }
  .metrics > div:nth-child(2) { border-left: 0; }
  .metrics strong { font-size: 1.26rem; }
  .metric-label { font-size: .78rem; }
  .metric-label .storybook-icon { width: 18px; height: 18px; }
  .home-side { grid-template-columns: minmax(0,1fr); padding: 0 12px; }
  .timer-card h2 { font-size: .91rem; }
  .countdown { font-size: clamp(3rem, 12vw, 3.75rem); }
  #timer-action { width: 47px; height: 47px; min-height: 47px; }
  .album-page { padding: 4px 0 13px; }
  .album-book { gap: 12%; padding: 9% 8%; }
  .album-book .album-tile { font-size: .81rem; }
  .album-book .album-tile .muted { display: none; }
  .album-collection-row { gap: 9px; }
  body[data-page=account] main, body[data-page=agency] main, body[data-page=guide] main { padding-top: 12px; }
  body[data-page=guide] .top-account { max-width: 36%; }
}
@media (min-width: 801px) and (max-width: 950px) {
  .home-grid { grid-template-columns: minmax(0, 1.38fr) minmax(240px,1fr); }
  .metric-label { font-size: .77rem; }
}
@media print {
  body { background: white; }
  .top, .navigation { display: none !important; }
}

@supports not (width: min(100%, 1px)) {
  .layout { grid-template-columns: 145px minmax(0, 1fr); width: 100%; }
  .album-book { width: 100%; max-width: 625px; min-height: 220px; }
  .metrics strong { font-size: 1.45rem; }
  .countdown { font-size: 3.25rem; }
}

.plan-goal-hub .plan-header-illustrated::after {
  background-image: url('./assets/wisteria.webp');
}
@supports not (inset: 0) {
  .album-book .album-tile::before { top: -6px; left: 13%; }
  #timer-action { margin-left: 17px; }
  .metric-label .storybook-icon { margin-right: 4px; }
}
@supports not (width: min(100%, 1px)) {
  @media (max-width: 800px) {
    body[data-page=home] main { padding-right: 0; padding-left: 0; }
    .subscribers { width: calc(100% - 112px); max-width: 263px; }
  }
}

.environment-select { position: relative; display: block; }
.environment-select summary {
  display: flex; align-items: center; justify-content: center;
  min-height: 37px; gap: 5px; list-style: none; cursor: pointer;
}
.environment-select summary::-webkit-details-marker { display: none; }
.environment-select summary > span { padding: 2px 7px; }
.environment-select summary .environment-value {
  border: 1px solid #dac48d; border-radius: 999px; background: #fff7df;
  min-width: 100px; text-align: center;
}
.environment-select summary .environment-caret { padding-left: 0; }
.environment-menu {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(100% + 5px);
  display: grid; gap: 2px; padding: 5px; border: 1px solid #d2b976;
  background: #fff9e9; border-radius: 12px; box-shadow: 0 4px 14px #523c2433;
}
.environment-choice {
  min-height: 44px; text-align: left; padding: 5px 10px; border: 0;
  border-radius: 8px; background: transparent;
}
.environment-choice[aria-pressed="true"] { background: #e7edc9; font-weight: bold; }
.album-dialog input, .album-dialog textarea, .album-dialog select { font-size: 1rem; }
.album-dialog .actions { margin-top: 8px; }

@media screen and (max-width: 800px) {
  body[data-page=home], body[data-page=album] {
    --story-navigation-height: calc(58px + env(safe-area-inset-bottom, 0px));
    background-image: none;
    min-height: 100dvh;
  }

  body[data-page=home] #app, body[data-page=album] #app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: var(--story-navigation-height);
  }

  body[data-page=home] #app::after, body[data-page=album] #app::after {
    background: url('./assets/flowers.webp') center bottom / 100% auto no-repeat;
    content: "";
    flex: 0 0 auto;
    height: 16vw;
    margin-top: auto;
  }

  body[data-page=album] #app::after {
    margin-left: -12px;
    margin-right: -12px;
  }

  body[data-page=album] .album-page { width: 100%; }
}
