/*
 * Final owner-only Today bottom-control pass.
 *
 * Five matched inline outline icons replace only the previous SVG artwork.
 * The existing navigation and authenticated Community action remain the sole
 * interactive controls inside the non-interactive chassis added in Version 26.
 */

:root {
  --rebuild-deck-nav-height: 68px;
  --rebuild-deck-safe-bottom: calc(var(--rebuild-deck-bottom-offset) + env(safe-area-inset-bottom));
}

html body > .rebuild-bottom-control-deck {
  bottom: var(--rebuild-deck-safe-bottom);
  width: min(calc(100% - 20px), 430px);
  border-color: rgba(93, 119, 130, 0.46);
  border-radius: 22px;
  isolation: isolate;
  background: linear-gradient(180deg, #fffaf5 0%, #fff8f1 36%, #f4ebe2 74%, #e7d8cb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -2px 0 rgba(151, 126, 108, 0.13),
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 7px 13px rgba(37, 59, 71, 0.18),
    0 17px 30px rgba(37, 59, 71, 0.12);
}

html body > .rebuild-bottom-control-deck::before {
  right: 18px;
  left: 18px;
  background: rgba(255, 255, 255, 0.96);
}

/*
 * Historical navigation rules use !important on height and SVG materials.
 * Only those exact properties are matched.
 */
html body > .rebuild-bottom-control-deck > nav.nav,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav {
  height: var(--rebuild-deck-nav-height) !important;
}

html body > .rebuild-bottom-control-deck > nav.nav > button,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  border-radius: 13px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

html body > .rebuild-bottom-control-deck > nav.nav > button > svg,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button > svg {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(93, 119, 130, 0.34) !important;
  border-radius: 11px !important;
  padding: 4px !important;
  background: linear-gradient(145deg, #fffdf8 0%, #f0e5db 100%) !important;
  color: #536872 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 2px 4px rgba(37, 59, 71, 0.11) !important;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

html body > .rebuild-bottom-control-deck > nav.nav > button > span,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button > span {
  display: block;
  line-height: 1.05;
}

html body > .rebuild-bottom-control-deck > nav.nav > button.on,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button.on {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(238, 226, 215, 0.58) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 2px 5px rgba(37, 59, 71, 0.13);
}

html body > .rebuild-bottom-control-deck > nav.nav > button.on > svg,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button.on > svg {
  border-color: color-mix(in srgb, var(--tab-accent) 70%, #193a48) !important;
  background: linear-gradient(145deg, #193a48 0%, #102a37 100%) !important;
  color: var(--tab-accent) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.17),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 3px 7px rgba(16, 42, 55, 0.23) !important;
  transform: translateY(-1px);
}

html body > .rebuild-bottom-control-deck > nav.nav > button::before,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button::before {
  top: auto;
  bottom: 0;
  height: 2px;
}

html body > .rebuild-bottom-control-deck > nav.nav > button.on::before,
html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button.on::before {
  width: 18px;
  opacity: 0.95;
}

/*
 * The original Community button remains one full-width 48px action. Its real
 * logo, wording, HERE marker, arrow and optional badge form one centred group.
 */
html body > .rebuild-bottom-control-deck > .community-entry-dock > .community-entry {
  justify-content: center !important;
}

html body > .rebuild-bottom-control-deck .community-entry-logo {
  order: 1;
}

html body > .rebuild-bottom-control-deck .community-entry-copy {
  order: 2;
}

html body > .rebuild-bottom-control-deck .community-entry-here {
  order: 3;
}

html body > .rebuild-bottom-control-deck .community-entry-arrow {
  order: 4;
  margin-left: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(145deg, #193a48 0%, #102a37 100%) !important;
  color: #20d5ef !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 5px rgba(16, 42, 55, 0.2) !important;
}

html body > .rebuild-bottom-control-deck .community-entry-badge:not([hidden]) {
  order: 5;
  margin-left: 0 !important;
}

html body > .rebuild-bottom-control-deck .community-entry-badge:not([hidden]) + .community-entry-arrow {
  margin-left: 0 !important;
}

/* One page-end calculation: deck height + safe bottom + 10px - card-stack tail. */
html body > main.app > #today.page > .today-v3-body {
  padding-bottom: calc(
    var(--rebuild-deck-visible-height)
    + var(--rebuild-deck-safe-bottom)
    + var(--rebuild-deck-content-gap)
    - var(--today-card-stack-tail)
  ) !important;
}

@media (max-width: 370px) {
  :root {
    --rebuild-deck-nav-height: 66px;
  }

  html body > .rebuild-bottom-control-deck {
    width: calc(100% - 20px);
    border-radius: 20px;
  }

  html body > .rebuild-bottom-control-deck > nav.nav > button > svg,
  html.community-entry-available body > .rebuild-bottom-control-deck > nav.nav > button > svg {
    width: 32px !important;
    height: 32px !important;
  }

}

@media (min-width: 800px) {
  html body > .rebuild-bottom-control-deck {
    width: min(calc(100% - 32px), 760px);
  }
}
