#home, #album { min-width: 0; }
#home[hidden], #album [hidden] { display: none !important; }
.home-feature[hidden] { display: none; }
.home-feature {
  margin: 0;
  background: var(--fm-card);
  border: var(--fm-border);
  border-radius: var(--fm-card-radius);
  overflow: hidden;
  box-shadow: var(--fm-card-shadow);
}
.home-cover-open, .memory-tile {
  display: block;
  overflow: hidden;
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #f0e2d5;
  color: var(--fm-text);
  cursor: pointer;
  line-height: 0;
}
.home-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}
.home-feature-foot, .home-recent-head, .home-feature-actions, .album-head-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.home-feature-foot, .home-recent-head { justify-content: space-between; }
.home-feature-foot { min-height: 76px; padding: 12px 16px; gap: 12px; }
.home-feature-foot > :first-child { min-width: 0; overflow-wrap: anywhere; }
.home-feature-foot h2, .home-recent-head h2, .gallery-month-title {
  margin: 0;
  font: 700 var(--fm-section-size)/var(--fm-section-line) var(--fm-font);
  letter-spacing: -.02em;
  color: var(--fm-text);
}
.home-feature-foot h2 { line-height: 28px; }
.home-feature-date {
  display: block;
  margin-top: 2px;
  color: var(--fm-muted);
  font: 400 var(--fm-meta-size)/var(--fm-meta-line) var(--fm-font);
  font-variant-numeric: tabular-nums;
}
.home-feature-actions { flex: none; gap: 0; }
.home-feature-actions button, .home-all, .album-view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .35rem;
  border: 0;
  border-radius: .85rem;
  background: transparent;
  color: var(--fm-icon);
}
.home-feature-actions button:disabled { opacity: .45; }
.home-heart[aria-pressed="true"], .reaction-like[aria-pressed="true"] { color: var(--fm-primary); }
.home-heart[aria-pressed="true"] .fm-icon, .reaction-like[aria-pressed="true"] .fm-icon { fill: currentColor; }
.home-feature-actions .fm-icon, .album-head-actions .fm-icon, .reaction-row .fm-icon { width: 22px; height: 22px; }
.home-recent-head { margin: 12px 0 8px; }
.home-all { gap: 2px; min-height: 36px; padding: 4px 0 4px 8px; font-size: 13px; line-height: 20px; font-weight: 500; }
.home-all .fm-icon { width: 16px; height: 16px; }
.home-recent, .gallery-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.memory-tile { aspect-ratio: 6 / 5; border-radius: var(--fm-card-radius); isolation: isolate; }
.home-recent .memory-tile { aspect-ratio: 4 / 3; }
.memory-tile img, .memory-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.tile-play {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgb(40 30 24 / 62%);
  color: white;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}
.tile-play .fm-icon { width: 14px; height: 14px; fill: currentColor; stroke-width: 0; }
.tile-play span:empty { display: none; }
.tile-fallback { line-height: 1.5; }
#home .home-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: var(--fm-button-radius);
  background: var(--fm-primary);
  color: white;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}
.home-upload .fm-icon { width: 20px; height: 20px; }
.album-head-actions { justify-content: flex-end; gap: .12rem; }
.album-head-actions button {
  position: relative;
  display: inline-grid;
  place-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: .8rem;
  background: transparent;
  color: var(--fm-icon);
}
.album-head-actions button:focus-visible { outline-offset: 0; }
.album-search-toggle[aria-expanded="true"] { background: var(--fm-primary-soft); }
.album-browse-controls .album-search-field {
  width: 100%; min-height: 44px; margin: 0 0 .6rem; padding: .55rem .85rem;
  border: var(--fm-border); border-radius: var(--fm-button-radius); background: var(--fm-card); color: var(--fm-text);
}
#album .album-upload {
  position: fixed;
  z-index: 4;
  right: max(16px, calc((100% - var(--app-width)) / 2 + 16px));
  bottom: calc(var(--dock) + var(--dock-gap, 0px) + env(safe-area-inset-bottom) + 16px);
  display: grid;
  place-items: center;
  width: 56px; height: 56px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--fm-primary);
  color: white;
  box-shadow: var(--fm-fab-shadow);
}
#album .album-upload .fm-icon { width: 26px; height: 26px; }
#album { padding-bottom: 88px; }
.album-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 48px;
  padding: 3px;
  border-radius: 999px;
  border: var(--fm-border);
  background: #fbf5ef;
}
.album-filter {
  min-height: 0;
  min-width: 0;
  padding: .4rem .2rem;
  border: 0;
  border-radius: 1.45rem;
  background: transparent;
  color: var(--fm-text);
  font: 400 15px/22px var(--fm-font);
}
.album-filter + .album-filter { position: relative; }
.album-filter + .album-filter::before {
  content: ""; position: absolute; top: 20%; bottom: 20%; left: 0;
  width: 1px; background: #e5d4c8;
}
.album-filter[aria-pressed="true"]::before,
.album-filter[aria-pressed="true"] + .album-filter::before { display: none; }
.album-filter[aria-pressed="true"] { color: var(--fm-text); background: #edb497; font-weight: 600; }
.gallery-month { margin-top: 20px; }
.gallery-month + .gallery-month { margin-top: 36px; }
.gallery-month-title { margin: 0 0 12px; }
.gallery-none { text-align: center; color: #806c61; padding: 1.5rem .5rem; }
#memory-grid .memory { scroll-margin-top: .6rem; }
.memory-tile:focus-visible, .home-cover-open:focus-visible { outline-offset: -4px; }
@media (hover: hover) {
  .home-feature-actions button:hover, .home-all:hover, .album-head-actions button:hover { background: var(--fm-primary-soft); }
  #home .home-upload:hover, #album .album-upload:hover { background: var(--fm-primary-hover); }
  .memory-tile:hover img, .home-cover-open:hover img { filter: brightness(1.04); }
}
#home .home-upload:active, #album .album-upload:active { background: var(--fm-primary-pressed); }
