/* eslint-disable css/no-invalid-properties, css/use-baseline */
.bottom-nav {
  --dc-nav-item-color: #8a95a6;
  --dc-nav-active-color: #e73573;
  --dc-nav-active-bg: #fff0f5;
  position: fixed;
  bottom: 16px;
  left: 50%;
  width: min(460px, calc(100% - 32px));
  height: 64px;
  display: flex;
  gap: 0;
  align-items: stretch;
  padding: 8px 12px calc(8px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  border: 1px solid rgba(16, 24, 40, .07);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(20px);
  transform: translateX(-50%);
  z-index: 1000;
  isolation: isolate;
}

.bottom-nav .nav-item {
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 16px;
  color: var(--dc-nav-item-color);
  background: transparent;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  position: relative;
  transition: background .18s ease, color .18s ease, transform .16s ease;
}

.bottom-nav .nav-item.active {
  color: var(--dc-nav-active-color);
  background: var(--dc-nav-active-bg);
}

.bottom-nav .nav-item svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  transition: transform .16s ease;
}

.bottom-nav .nav-item span {
  display: block;
  white-space: nowrap;
}

.bottom-nav .nav-item:active svg {
  transform: scale(.92);
}

body.custom-routine-modal-open .bottom-nav,
body.custom-status-modal-open .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 28px));
}

:root[data-theme="dark"] .bottom-nav {
  --dc-nav-item-color: #96a0af;
  --dc-nav-active-color: #bfdbfe;
  --dc-nav-active-bg: rgba(96, 165, 250, .14);
  border-color: rgba(255, 255, 255, .12);
  background: rgba(16, 22, 31, .94);
}

@media (max-width: 520px) {
  .bottom-nav {
    bottom: 8px;
    width: calc(100% - 24px);
    padding: 6px 8px calc(6px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-radius: 22px;
  }

  .bottom-nav .nav-item {
    font-size: 10px;
  }

  .bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
  }
}

/* ===================================================================
   Notification bell — a separate floating "island" docked beside the
   bottom-nav pill. notification-bell.js wraps the existing .bottom-nav
   in .dc-nav-dock at runtime and appends .dc-notif-island as a sibling,
   so this file only needs to describe the resulting layout.
   =================================================================== */
.dc-nav-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  /* 460px is .bottom-nav's own original cap; add the island's width (60px)
     plus the gap (10px) so docking it doesn't shrink the nav pill itself —
     without this, .bottom-nav was squeezed to ~390px, visibly cramming its
     five items (most noticeable on iPad, which is wide enough to actually
     hit this cap instead of just filling the viewport). */
  width: min(530px, calc(100% - 32px));
  display: flex;
  align-items: stretch;
  gap: 10px;
  z-index: 1000;
}

.dc-nav-dock .bottom-nav {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  flex: 1 1 460px;
  min-width: 0;
}

.dc-notif-island {
  flex: 0 0 60px;
  width: 60px;
  height: 64px;
  border: 1px solid rgba(16, 24, 40, .07);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: #8a95a6;
  transition: background .18s ease, color .18s ease;
}

.dc-notif-island:hover,
.dc-notif-island[aria-expanded="true"] {
  color: #e73573;
  background: #fff0f5;
}

.dc-notif-island svg {
  width: 24px;
  height: 24px;
}

.dc-notif-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e73573;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.dc-notif-badge[hidden] {
  display: none;
}

.dc-notif-panel {
  position: fixed;
  bottom: 92px;
  right: max(16px, calc(50% - 220px));
  width: min(340px, calc(100% - 32px));
  max-height: min(420px, calc(100vh - 160px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(16, 24, 40, .07);
  border-radius: 20px;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 20px 48px rgba(16, 24, 40, .16);
  z-index: 1001;
  overflow: hidden;
}

.dc-notif-panel[hidden] {
  display: none;
}

.dc-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(16, 24, 40, .07);
  flex: 0 0 auto;
}

.dc-notif-panel-title {
  font-size: 14px;
  font-weight: 800;
  color: #101828;
}

.dc-notif-mark-all {
  border: none;
  background: transparent;
  color: #8a95a6;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.dc-notif-mark-all:hover {
  color: #e73573;
}

.dc-notif-list {
  overflow-y: auto;
  flex: 1 1 auto;
}

.dc-notif-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(16, 24, 40, .05);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.dc-notif-item:last-child {
  border-bottom: none;
}

.dc-notif-item:hover {
  background: rgba(231, 53, 115, .06);
}

.dc-notif-item.is-unread {
  background: rgba(231, 53, 115, .04);
}

.dc-notif-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #101828;
}

.dc-notif-item.is-unread .dc-notif-item-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #e73573;
  flex: 0 0 auto;
}

.dc-notif-item-body {
  margin-top: 2px;
  font-size: 12.5px;
  color: #667085;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-notif-item-time {
  margin-top: 4px;
  font-size: 11px;
  color: #98a2b3;
}

.dc-notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: #98a2b3;
}

:root[data-theme="dark"] .dc-notif-island {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(16, 22, 31, .94);
  color: #96a0af;
}

:root[data-theme="dark"] .dc-notif-island:hover,
:root[data-theme="dark"] .dc-notif-island[aria-expanded="true"] {
  color: #bfdbfe;
  background: rgba(96, 165, 250, .14);
}

:root[data-theme="dark"] .dc-notif-panel {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(16, 22, 31, .98);
}

:root[data-theme="dark"] .dc-notif-panel-head {
  border-bottom-color: rgba(255, 255, 255, .1);
}

:root[data-theme="dark"] .dc-notif-panel-title {
  color: #f3f6fb;
}

:root[data-theme="dark"] .dc-notif-item {
  border-bottom-color: rgba(255, 255, 255, .06);
}

:root[data-theme="dark"] .dc-notif-item:hover,
:root[data-theme="dark"] .dc-notif-item.is-unread {
  background: rgba(96, 165, 250, .08);
}

:root[data-theme="dark"] .dc-notif-item-title {
  color: #f3f6fb;
}

:root[data-theme="dark"] .dc-notif-item-body {
  color: #96a0af;
}

@media (max-width: 520px) {
  .dc-nav-dock {
    bottom: 8px;
    width: calc(100% - 24px);
    gap: 8px;
  }

  .dc-notif-island {
    flex-basis: 52px;
    width: 52px;
    border-radius: 20px;
  }

  .dc-notif-island svg {
    width: 21px;
    height: 21px;
  }

  .dc-notif-panel {
    bottom: 84px;
    right: 12px;
  }
}
