/* dd ui-bottom-nav: the menu pinned to the bottom of the screen, and the "More" sheet.
   Needs the variables of dd ui-theme (theme.css). Copy unchanged. */

/* Room under the page so the bar never covers its end. */
body.has-bottom-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* The bar: full width, an icon above a short name per item, the current one tinted. */
nav.bottom-nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  background: var(--bar); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgb(0 0 0 / .08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 6px max(6px, calc((100% - 760px) / 2)) calc(6px + env(safe-area-inset-bottom));
}
nav.bottom-nav .list { display: flex; justify-content: center; gap: 2px; }
nav.bottom-nav a, nav.bottom-nav button {
  flex: 1 1 0; min-width: 0; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--muted); text-decoration: none; font: inherit; font-size: .74rem; line-height: 1.15;
  white-space: nowrap;
}
nav.bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
nav.bottom-nav a:hover, nav.bottom-nav button:hover { background: var(--hover); color: var(--ink); }
nav.bottom-nav [aria-current="page"] { background: var(--tint); color: var(--accent); font-weight: 700; }

/* Icons: 24 x 24 line drawings in the colour of their text. */
.ui-icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* The "More" sheet: slides up from the bottom over a dimmed page. */
dialog.more-sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 85vh;
  box-sizing: border-box; border: 0; border-radius: 20px 20px 0 0;
  padding: 8px 12px calc(20px + env(safe-area-inset-bottom));
  background: var(--card); color: var(--ink); box-shadow: 0 -8px 30px rgb(0 0 0 / .2);
}
dialog.more-sheet[open] { animation: more-sheet-up .22s ease-out; }
dialog.more-sheet::backdrop { background: rgb(0 0 0 / .4); }
@keyframes more-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
dialog.more-sheet .handle { width: 40px; height: 4px; margin: 2px auto 10px; border-radius: 2px; background: var(--line); }
dialog.more-sheet nav { display: flex; flex-direction: column; }
dialog.more-sheet .row {
  display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 12px;
  color: inherit; text-decoration: none;
}
dialog.more-sheet .row:hover { background: var(--hover); }
dialog.more-sheet .row:focus:not(:focus-visible) { outline: none; }
dialog.more-sheet .row[aria-current="page"] { background: var(--tint); }
dialog.more-sheet .ic {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent); background: var(--accent);
}
dialog.more-sheet .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
dialog.more-sheet .tx b { font-weight: 650; }
dialog.more-sheet .tx small { font-size: .82rem; color: var(--muted); }
dialog.more-sheet .row > .ui-icon { width: 20px; height: 20px; color: var(--muted); }

@media print { nav.bottom-nav, dialog.more-sheet { display: none; } body.has-bottom-nav { padding-bottom: 0; } }
